@mux/mux-player 3.3.2-canary.3 → 3.3.2

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,11 +1,11 @@
1
- "use strict";var ch=Object.create;var br=Object.defineProperty;var mh=Object.getOwnPropertyDescriptor;var hh=Object.getOwnPropertyNames;var ph=Object.getPrototypeOf,fh=Object.prototype.hasOwnProperty;var wd=t=>{throw TypeError(t)};var vh=(t,e)=>{for(var i in e)br(t,i,{get:e[i],enumerable:!0})},Rd=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of hh(e))!fh.call(t,r)&&r!==i&&br(t,r,{get:()=>e[r],enumerable:!(a=mh(e,r))||a.enumerable});return t};var Eh=(t,e,i)=>(i=t!=null?ch(ph(t)):{},Rd(e||!t||!t.__esModule?br(i,"default",{value:t,enumerable:!0}):i,t)),bh=t=>Rd(br({},"__esModule",{value:!0}),t);var Ro=(t,e,i)=>e.has(t)||wd("Cannot "+i);var B=(t,e,i)=>(Ro(t,e,"read from private field"),i?i.call(t):e.get(t)),me=(t,e,i)=>e.has(t)?wd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Ae=(t,e,i,a)=>(Ro(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Q=(t,e,i)=>(Ro(t,e,"access private method"),i);var bv={};vh(bv,{MediaError:()=>b.MediaError,default:()=>Ev,generatePlayerInitTime:()=>L.generatePlayerInitTime,getVideoAttribute:()=>Dt,playerSoftwareName:()=>od,playerSoftwareVersion:()=>nd});module.exports=bh(bv);var pi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends pi{}globalThis.DocumentFragment=t}var ma=class extends pi{},Lo=class extends pi{},gh={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(ma)}},ha,xo=class{constructor(e,i={}){me(this,ha);Ae(this,ha,i==null?void 0:i.detail)}get detail(){return B(this,ha)}initCustomEvent(){}};ha=new WeakMap;function _h(t,e){return new ma}var Ld={document:{createElement:_h},DocumentFragment,customElements:gh,CustomEvent:xo,EventTarget:pi,HTMLElement:ma,HTMLVideoElement:Lo},xd=typeof window=="undefined"||typeof globalThis.customElements=="undefined",he=xd?Ld:globalThis,fi=xd?Ld.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_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"},R={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Do={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_WIDTH:"mediaWidth"},Dd=Object.entries(Do),o=Dd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Ah={USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},nt=Dd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Ah}),Tv=Object.entries(nt).reduce((t,[e,i])=>{let a=o[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),Od=Object.entries(o).reduce((t,[e,i])=>{let a=nt[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),pe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},bt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Oo={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ye={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},we={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Nd={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Pd(t){return t==null?void 0:t.map(Th).join(" ")}function Ud(t){return t==null?void 0:t.split(/\s+/).map(kh)}function Th(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function kh(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function Bd(t){return t==null?void 0:t.map(Sh).join(" ")}function Hd(t){return t==null?void 0:t.split(/\s+/).map(Ih)}function Sh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(n=>n!=null).join(":")}}function Ih(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function $d(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function vi(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function gr(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var _r=t=>new Promise(e=>setTimeout(e,t));var Wd=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Ch=(t,e)=>{let i=t===1?Wd[e].singular:Wd[e].plural;return`${t} ${i}`},Nt=t=>{if(!vi(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&Ch(l,u)).filter(l=>l).join(", ")}${i?" remaining":""}`};function Pe(t,e){let i=!1;t<0&&(i=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),n=Math.floor(t/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(n=r=a="0"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+n+r+a}var Iv=Object.freeze({length:0,start(t){let e=t>>>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(t){let e=t>>>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 No={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute",live:"live","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var wh={en:No};var Rh=()=>{var t;return((t=globalThis.navigator)==null?void 0:t.language.split("-")[0])||"en"},f=(t,e={})=>{var i;return(((i=wh[Rh()])==null?void 0:i[t])||No[t]).replace(/\{(\w+)\}/g,(r,n)=>e[n]!==void 0?String(e[n]):`{${n}}`)};var Ar=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},yr=class extends Ar{},Tr=class extends yr{constructor(){super(...arguments),this.role=null}},Po=class{observe(){}unobserve(){}disconnect(){}},Fd={createElement:function(){return new pa.HTMLElement},createElementNS:function(){return new pa.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},pa={ResizeObserver:Po,document:Fd,Node:yr,Element:Tr,HTMLElement:class extends Tr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new pa.DocumentFragment}},DocumentFragment:class extends Ar{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(t){return null},setItem(t,e){},removeItem(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(t){return{matches:!1,media:t}}},Vd=typeof window=="undefined"||typeof window.customElements=="undefined",Kd=Object.keys(pa).every(t=>t in globalThis),d=Vd&&!Kd?pa:globalThis,h=Vd&&!Kd?Fd:globalThis.document;var Gd=new WeakMap,Uo=t=>{let e=Gd.get(t);return e||Gd.set(t,e=new Set),e},Yd=new d.ResizeObserver(t=>{for(let e of t)for(let i of Uo(e.target))i(e)});function ot(t,e){Uo(t).add(e),Yd.observe(t)}function st(t,e){let i=Uo(t);i.delete(e),i.size||Yd.unobserve(t)}function qd(t){let e={};for(let i of t)e[i.name]=i.value;return e}function q(t){var e;return(e=kr(t))!=null?e:Ue(t,"media-controller")}function kr(t){var e;let{MEDIA_CONTROLLER:i}=R,a=t.getAttribute(i);if(a)return(e=Pt(t))==null?void 0:e.getElementById(a)}var Sr=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Lh=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},Ir=(t,e)=>Lh(t,e)[0],le=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:le(t,e.getRootNode().host),Ue=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Ue(t.getRootNode().host,e)};function fa(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=fa(i.shadowRoot))!=null?e:i:null}function Pt(t){var e;let i=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t);return i instanceof ShadowRoot||i instanceof Document?i:null}function Cr(t,{depth:e=3,checkOpacity:i=!0,checkVisibilityCSS:a=!0}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:i,checkVisibilityCSS:a});let r=t;for(;r&&e>0;){let n=getComputedStyle(r);if(i&&n.opacity==="0"||a&&n.visibility==="hidden"||n.display==="none")return!1;r=r.parentElement,e--}return!0}function Zd(t,e,i,a){let r=Bo(i,a),n=Bo(i,{x:t,y:e}),s=Bo(a,{x:t,y:e});return n>r||s>r?n>s?1:0:n/r}function Bo(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function W(t,e){let i=xh(t,a=>a===e);return i||Ho(t,e)}function xh(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let n;try{n=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of n!=null?n:[])if(e(s.selectorText))return s}}function Ho(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],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",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function x(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function O(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}x(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function k(t,e){return t.hasAttribute(e)}function S(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}k(t,e)!=i&&t.toggleAttribute(e,i)}function C(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function M(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;C(t,e,void 0)!==a&&t.setAttribute(e,a)}var zd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},gt=(t,e,i)=>(zd(t,e,"read from private field"),i?i.call(t):e.get(t)),Dh=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Mr=(t,e,i,a)=>(zd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),fe,Qd=h.createElement("template");Qd.innerHTML=`
1
+ "use strict";var hh=Object.create;var br=Object.defineProperty;var ph=Object.getOwnPropertyDescriptor;var fh=Object.getOwnPropertyNames;var vh=Object.getPrototypeOf,Eh=Object.prototype.hasOwnProperty;var Md=i=>{throw TypeError(i)};var bh=(i,e)=>{for(var t in e)br(i,t,{get:e[t],enumerable:!0})},wd=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of fh(e))!Eh.call(i,r)&&r!==t&&br(i,r,{get:()=>e[r],enumerable:!(a=ph(e,r))||a.enumerable});return i};var gh=(i,e,t)=>(t=i!=null?hh(vh(i)):{},wd(e||!i||!i.__esModule?br(t,"default",{value:i,enumerable:!0}):t,i)),_h=i=>wd(br({},"__esModule",{value:!0}),i);var Lo=(i,e,t)=>e.has(i)||Md("Cannot "+t);var B=(i,e,t)=>(Lo(i,e,"read from private field"),t?t.call(i):e.get(i)),me=(i,e,t)=>e.has(i)?Md("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ae=(i,e,t,a)=>(Lo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Q=(i,e,t)=>(Lo(i,e,"access private method"),t);var gv={};bh(gv,{MediaError:()=>b.MediaError,default:()=>bv,generatePlayerInitTime:()=>R.generatePlayerInitTime,getVideoAttribute:()=>Dt,playerSoftwareName:()=>nd,playerSoftwareVersion:()=>rd});module.exports=_h(gv);var pi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends pi{}globalThis.DocumentFragment=i}var ma=class extends pi{},Ro=class extends pi{},Ah={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(ma)}},ha,xo=class{constructor(e,t={}){me(this,ha);Ae(this,ha,t==null?void 0:t.detail)}get detail(){return B(this,ha)}initCustomEvent(){}};ha=new WeakMap;function Th(i,e){return new ma}var Ld={document:{createElement:Th},DocumentFragment,customElements:Ah,CustomEvent:xo,EventTarget:pi,HTMLElement:ma,HTMLVideoElement:Ro},Rd=typeof window=="undefined"||typeof globalThis.customElements=="undefined",he=Rd?Ld:globalThis,fi=Rd?Ld.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"},L={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Do={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_WIDTH:"mediaWidth"},xd=Object.entries(Do),o=xd.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),yh={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},nt=xd.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...yh}),kv=Object.entries(nt).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),Dd=Object.entries(o).reduce((i,[e,t])=>{let a=nt[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),pe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},bt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Oo={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Te={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},we={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Od={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Nd(i){return i==null?void 0:i.map(Sh).join(" ")}function Pd(i){return i==null?void 0:i.split(/\s+/).map(Ih)}function Sh(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function Ih(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:+t,height:+a}}}function Ud(i){return i==null?void 0:i.map(Ch).join(" ")}function Bd(i){return i==null?void 0:i.split(/\s+/).map(Mh)}function Ch(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function Mh(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function Hd(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function vi(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function gr(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var _r=i=>new Promise(e=>setTimeout(e,i));var $d=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],wh=(i,e)=>{let t=i===1?$d[e].singular:$d[e].plural;return`${i} ${t}`},Nt=i=>{if(!vi(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&wh(l,u)).filter(l=>l).join(", ")}${t?" remaining":""}`};function Pe(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Cv=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 No={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute",live:"live","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var Wd,Rh={en:No},Fd=((Wd=globalThis.navigator)==null?void 0:Wd.language.split("-")[0])||"en",Vd=i=>{Fd=i};var v=(i,e={})=>{var t;return(((t=Rh[Fd])==null?void 0:t[i])||No[i]).replace(/\{(\w+)\}/g,(r,n)=>e[n]!==void 0?String(e[n]):`{${n}}`)};var Ar=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Tr=class extends Ar{},yr=class extends Tr{constructor(){super(...arguments),this.role=null}},Po=class{observe(){}unobserve(){}disconnect(){}},Kd={createElement:function(){return new pa.HTMLElement},createElementNS:function(){return new pa.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},pa={ResizeObserver:Po,document:Kd,Node:Tr,Element:yr,HTMLElement:class extends yr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new pa.DocumentFragment}},DocumentFragment:class extends Ar{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}}},Gd=typeof window=="undefined"||typeof window.customElements=="undefined",Yd=Object.keys(pa).every(i=>i in globalThis),d=Gd&&!Yd?pa:globalThis,h=Gd&&!Yd?Kd:globalThis.document;var qd=new WeakMap,Uo=i=>{let e=qd.get(i);return e||qd.set(i,e=new Set),e},Zd=new d.ResizeObserver(i=>{for(let e of i)for(let t of Uo(e.target))t(e)});function ot(i,e){Uo(i).add(e),Zd.observe(i)}function st(i,e){let t=Uo(i);t.delete(e),t.size||Zd.unobserve(i)}function zd(i){let e={};for(let t of i)e[t.name]=t.value;return e}function q(i){var e;return(e=kr(i))!=null?e:Ue(i,"media-controller")}function kr(i){var e;let{MEDIA_CONTROLLER:t}=L,a=i.getAttribute(t);if(a)return(e=Pt(i))==null?void 0:e.getElementById(a)}var Sr=(i,e,t=".value")=>{let a=i.querySelector(t);a&&(a.textContent=e)},xh=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Ir=(i,e)=>xh(i,e)[0],le=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:le(i,e.getRootNode().host),Ue=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Ue(i.getRootNode().host,e)};function fa(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=fa(t.shadowRoot))!=null?e:t:null}function Pt(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 Cr(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:a=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:a});let r=i;for(;r&&e>0;){let n=getComputedStyle(r);if(t&&n.opacity==="0"||a&&n.visibility==="hidden"||n.display==="none")return!1;r=r.parentElement,e--}return!0}function Qd(i,e,t,a){let r=a.x-t.x,n=a.y-t.y,s=r*r+n*n;if(s===0)return 0;let l=((i-t.x)*r+(e-t.y)*n)/s;return Math.max(0,Math.min(1,l))}function W(i,e){let t=Dh(i,a=>a===e);return t||Bo(i,e)}function Dh(i,e){var t,a;let r;for(r of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of n!=null?n:[])if(e(s.selectorText))return s}}function Bo(i,e){var t,a;let r=(t=i.querySelectorAll("style:not([media])"))!=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 x(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function N(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}x(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function S(i,e){return i.hasAttribute(e)}function I(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}S(i,e)!=t&&i.toggleAttribute(e,t)}function C(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;C(i,e,void 0)!==a&&i.setAttribute(e,a)}var Xd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gt=(i,e,t)=>(Xd(i,e,"read from private field"),t?t.call(i):e.get(i)),Oh=(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)},Mr=(i,e,t,a)=>(Xd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),fe,Jd=h.createElement("template");Jd.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
5
5
  box-sizing: border-box;
6
6
  }
7
7
  </style>
8
- `;var $o=class extends d.HTMLElement{constructor(e={}){if(super(),Dh(this,fe,void 0),!this.shadowRoot){let i=this.attachShadow({mode:"open"}),a=Qd.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=h.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),i.appendChild(a)}}static get observedAttributes(){return[R.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER&&(i&&((n=(r=gt(this,fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),Mr(this,fe,null)),a&&this.isConnected&&(Mr(this,fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=gt(this,fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Mr(this,fe,Oh(this)),this.getAttribute(R.MEDIA_CONTROLLER)&&((i=(e=gt(this,fe))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=gt(this,fe))==null||a.addEventListener("pointerdown",this),(r=gt(this,fe))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(R.MEDIA_CONTROLLER)&&((i=(e=gt(this,fe))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=gt(this,fe))==null||a.removeEventListener("pointerdown",this),(r=gt(this,fe))==null||r.removeEventListener("click",this),Mr(this,fe,null)}handleEvent(e){var i;let a=(i=e.composedPath())==null?void 0:i[0];if(["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:l,top:u,width:c,height:A}=this.getBoundingClientRect(),_=n-l,v=s-u;if(_<0||v<0||_>c||v>A||c===0&&A===0)return;let{pointerType:E=this._pointerType}=e;if(this._pointerType=void 0,E===Oo.TOUCH){this.handleTap(e);return}else if(E===Oo.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return k(this,o.MEDIA_PAUSED)}set mediaPaused(e){S(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let i=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(i,{composed:!0,bubbles:!0}))}};fe=new WeakMap;function Oh(t){var e;let i=t.getAttribute(R.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):Ue(t,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",$o);var Ko=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ke=(t,e,i)=>(Ko(t,e,"read from private field"),i?i.call(t):e.get(t)),Te=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ut=(t,e,i,a)=>(Ko(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ie=(t,e,i)=>(Ko(t,e,"access private method"),i),Lr,Ei,Ea,bi,wr,Wo,Xd,va,Rr,Fo,Jd,Vo,jd,ba,xr,Dr,Go,gi,ga,I={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},eu=h.createElement("template");eu.innerHTML=`
8
+ `;var Ho=class extends d.HTMLElement{constructor(e={}){if(super(),Oh(this,fe,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Jd.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=h.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[L.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===L.MEDIA_CONTROLLER&&(t&&((n=(r=gt(this,fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),Mr(this,fe,null)),a&&this.isConnected&&(Mr(this,fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=gt(this,fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Mr(this,fe,Nh(this)),this.getAttribute(L.MEDIA_CONTROLLER)&&((t=(e=gt(this,fe))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=gt(this,fe))==null||a.addEventListener("pointerdown",this),(r=gt(this,fe))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(L.MEDIA_CONTROLLER)&&((t=(e=gt(this,fe))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=gt(this,fe))==null||a.removeEventListener("pointerdown",this),(r=gt(this,fe))==null||r.removeEventListener("click",this),Mr(this,fe,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:l,top:u,width:c,height:T}=this.getBoundingClientRect(),_=n-l,p=s-u;if(_<0||p<0||_>c||p>T||c===0&&T===0)return;let{pointerType:E=this._pointerType}=e;if(this._pointerType=void 0,E===Oo.TOUCH){this.handleTap(e);return}else if(E===Oo.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return S(this,o.MEDIA_PAUSED)}set mediaPaused(e){I(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};fe=new WeakMap;function Nh(i){var e;let t=i.getAttribute(L.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Ue(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",Ho);var Vo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ke=(i,e,t)=>(Vo(i,e,"read from private field"),t?t.call(i):e.get(i)),ye=(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)},Ut=(i,e,t,a)=>(Vo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ie=(i,e,t)=>(Vo(i,e,"access private method"),t),Rr,Ei,Ea,bi,wr,$o,jd,va,Lr,Wo,eu,Fo,tu,ba,xr,Dr,Ko,gi,ga,k={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"},iu=h.createElement("template");iu.innerHTML=`
9
9
  <style>
10
10
 
11
11
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -20,7 +20,7 @@
20
20
  background-color: var(--media-background-color, #000);
21
21
  }
22
22
 
23
- :host(:not([${I.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
23
+ :host(:not([${k.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
24
24
  position: absolute;
25
25
  top: 0;
26
26
  left: 0;
@@ -38,19 +38,19 @@
38
38
  }
39
39
 
40
40
 
41
- :host([${I.AUDIO}]) slot[name=media] {
41
+ :host([${k.AUDIO}]) slot[name=media] {
42
42
  display: var(--media-slot-display, none);
43
43
  }
44
44
 
45
45
 
46
- :host([${I.AUDIO}]) [part~=layer][part~=gesture-layer] {
46
+ :host([${k.AUDIO}]) [part~=layer][part~=gesture-layer] {
47
47
  height: 0;
48
48
  display: block;
49
49
  }
50
50
 
51
51
 
52
- :host(:not([${I.AUDIO}])[${I.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
53
- :host(:not([${I.AUDIO}])[${I.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
52
+ :host(:not([${k.AUDIO}])[${k.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
53
+ :host(:not([${k.AUDIO}])[${k.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
54
54
  display: none;
55
55
  }
56
56
 
@@ -59,13 +59,13 @@
59
59
  pointer-events: auto;
60
60
  }
61
61
 
62
- :host(:not([${I.AUDIO}])) *[part~=layer][part~=centered-layer] {
62
+ :host(:not([${k.AUDIO}])) *[part~=layer][part~=centered-layer] {
63
63
  align-items: center;
64
64
  justify-content: center;
65
65
  }
66
66
 
67
- :host(:not([${I.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
68
- :host(:not([${I.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
67
+ :host(:not([${k.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
68
+ :host(:not([${k.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
69
69
  align-self: stretch;
70
70
  flex-grow: 1;
71
71
  }
@@ -85,7 +85,7 @@
85
85
  }
86
86
 
87
87
 
88
- :host(:not([${I.AUDIO}])) .spacer {
88
+ :host(:not([${k.AUDIO}])) .spacer {
89
89
  flex-grow: 1;
90
90
  }
91
91
 
@@ -97,27 +97,33 @@
97
97
  }
98
98
 
99
99
 
100
- ::slotted(:not([slot=media]):not([slot=poster]):not([${I.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {
100
+ ::slotted(:not([slot=media]):not([slot=poster]):not([${k.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {
101
101
  opacity: 1;
102
102
  transition: var(--media-control-transition-in, opacity 0.25s);
103
103
  }
104
104
 
105
105
 
106
- :host([${I.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_AIRPLAYING}]):not([${o.MEDIA_IS_CASTING}]):not([${I.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${I.NO_AUTOHIDE}]):not([role=dialog])) {
106
+ :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}]):not([role=dialog])) {
107
107
  opacity: 0;
108
108
  transition: var(--media-control-transition-out, opacity 1s);
109
109
  }
110
110
 
111
- :host([${I.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_CASTING}]):not([${I.AUDIO}])) ::slotted([slot=media]) {
111
+ :host([${k.USER_INACTIVE}]:not([${k.NO_AUTOHIDE}]):not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_CASTING}]):not([${k.AUDIO}])) ::slotted([slot=media]) {
112
112
  cursor: none;
113
113
  }
114
114
 
115
+ :host([${k.USER_INACTIVE}][${k.AUTOHIDE_OVER_CONTROLS}]:not([${k.NO_AUTOHIDE}]):not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_CASTING}]):not([${k.AUDIO}])) * {
116
+ --media-cursor: none;
117
+ cursor: none;
118
+ }
119
+
120
+
115
121
  ::slotted(media-control-bar) {
116
122
  align-self: stretch;
117
123
  }
118
124
 
119
125
 
120
- :host(:not([${I.AUDIO}])[${o.MEDIA_HAS_PLAYED}]) slot[name=poster] {
126
+ :host(:not([${k.AUDIO}])[${o.MEDIA_HAS_PLAYED}]) slot[name=poster] {
121
127
  display: none;
122
128
  }
123
129
 
@@ -145,7 +151,7 @@
145
151
  <slot part="bottom chrome"></slot>
146
152
  </span>
147
153
  <slot name="dialog" part="layer dialog-layer"></slot>
148
- `;var Nh=Object.values(o),Ph="sm:384 md:576 lg:768 xl:960";function Uh(t){tu(t.target,t.contentRect.width)}function tu(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(I.BREAKPOINTS))!=null?i:Ph,r=Bh(a),n=Hh(r,e),s=!1;if(Object.keys(r).forEach(l=>{if(n.includes(l)){t.hasAttribute(`breakpoint${l}`)||(t.setAttribute(`breakpoint${l}`,""),s=!0);return}t.hasAttribute(`breakpoint${l}`)&&(t.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(nt.BREAKPOINTS_CHANGE,{detail:n});t.dispatchEvent(l)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(nt.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Bh(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Hh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var _a=class extends d.HTMLElement{constructor(){super(),Te(this,Wo),Te(this,Fo),Te(this,Vo),Te(this,ba),Te(this,Dr),Te(this,gi),Te(this,Lr,0),Te(this,Ei,null),Te(this,Ea,null),Te(this,bi,void 0),this.breakpointsComputed=!1,Te(this,wr,new MutationObserver(Ie(this,Wo,Xd).bind(this))),Te(this,va,!1),Te(this,Rr,i=>{ke(this,va)||(setTimeout(()=>{Uh(i),Ut(this,va,!1)},0),Ut(this,va,!0))}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(eu.content.cloneNode(!0)));let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){ke(this,Ei)&&this.mediaUnsetCallback(ke(this,Ei));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[I.AUTOHIDE,I.GESTURES_DISABLED].concat(Nh).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_CHAPTERS_CUES,o.MEDIA_WIDTH,o.MEDIA_HEIGHT,o.MEDIA_ERROR,o.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==I.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&&(Ut(this,Ei,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;ke(this,wr).observe(this,{childList:!0,subtree:!0}),ot(this,ke(this,Rr));let a=this.getAttribute(I.AUDIO)!=null?f("audio player"):f("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(I.USER_INACTIVE,""),tu(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;ke(this,wr).disconnect(),st(this,ke(this,Rr)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ut(this,Ei,null)}handleEvent(e){switch(e.type){case"pointerdown":Ut(this,Lr,e.timeStamp);break;case"pointermove":Ie(this,Fo,Jd).call(this,e);break;case"pointerup":Ie(this,Vo,jd).call(this,e);break;case"mouseleave":Ie(this,ba,xr).call(this);break;case"mouseup":this.removeAttribute(I.KEYBOARD_CONTROL);break;case"keyup":Ie(this,gi,ga).call(this),this.setAttribute(I.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Ut(this,bi,isNaN(i)?0:i)}get autohide(){return(ke(this,bi)===void 0?2:ke(this,bi)).toString()}get breakpoints(){return C(this,I.BREAKPOINTS)}set breakpoints(e){M(this,I.BREAKPOINTS,e)}get audio(){return k(this,I.AUDIO)}set audio(e){S(this,I.AUDIO,e)}get gesturesDisabled(){return k(this,I.GESTURES_DISABLED)}set gesturesDisabled(e){S(this,I.GESTURES_DISABLED,e)}get keyboardControl(){return k(this,I.KEYBOARD_CONTROL)}set keyboardControl(e){S(this,I.KEYBOARD_CONTROL,e)}get noAutohide(){return k(this,I.NO_AUTOHIDE)}set noAutohide(e){S(this,I.NO_AUTOHIDE,e)}get userInteractive(){return k(this,I.USER_INACTIVE)}set userInteractive(e){S(this,I.USER_INACTIVE,e)}};Lr=new WeakMap;Ei=new WeakMap;Ea=new WeakMap;bi=new WeakMap;wr=new WeakMap;Wo=new WeakSet;Xd=function(t){let e=this.media;for(let i of t){if(i.type!=="childList")continue;let a=i.removedNodes;for(let r of a){if(r.slot!="media"||i.target!=this)continue;let n=i.previousSibling&&i.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(r);else{let s=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of i.addedNodes)r===e&&this.handleMediaUpdated(e)}};va=new WeakMap;Rr=new WeakMap;Fo=new WeakSet;Jd=function(t){t.pointerType!=="mouse"&&t.timeStamp-ke(this,Lr)<250||(Ie(this,Dr,Go).call(this),clearTimeout(ke(this,Ea)),[this,this.media].includes(t.target)&&Ie(this,gi,ga).call(this))};Vo=new WeakSet;jd=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(I.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Ie(this,ba,xr).call(this):Ie(this,gi,ga).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Ie(this,gi,ga).call(this)};ba=new WeakSet;xr=function(){if(ke(this,bi)<0||this.hasAttribute(I.USER_INACTIVE))return;this.setAttribute(I.USER_INACTIVE,"");let t=new d.CustomEvent(nt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};Dr=new WeakSet;Go=function(){if(!this.hasAttribute(I.USER_INACTIVE))return;this.removeAttribute(I.USER_INACTIVE);let t=new d.CustomEvent(nt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};gi=new WeakSet;ga=function(){Ie(this,Dr,Go).call(this),clearTimeout(ke(this,Ea));let t=parseInt(this.autohide);t<0||Ut(this,Ea,setTimeout(()=>{Ie(this,ba,xr).call(this)},t*1e3))};d.customElements.get("media-container")||d.customElements.define("media-container",_a);var iu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},te=(t,e,i)=>(iu(t,e,"read from private field"),i?i.call(t):e.get(t)),Aa=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Or=(t,e,i,a)=>(iu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),_i,Ai,Nr,Bt,lt,_t,Be=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){Aa(this,lt),Aa(this,_i,void 0),Aa(this,Ai,void 0),Aa(this,Nr,void 0),Aa(this,Bt,new Set),Or(this,_i,e),Or(this,Ai,i),Or(this,Nr,new Set(a))}[Symbol.iterator](){return te(this,lt,_t).values()}get length(){return te(this,lt,_t).size}get value(){var e;return(e=[...te(this,lt,_t)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Or(this,Bt,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...te(this,lt,_t)][e]}values(){return te(this,lt,_t).values()}forEach(e,i){te(this,lt,_t).forEach(e,i)}add(...e){var i,a;e.forEach(r=>te(this,Bt).add(r)),!(this.value===""&&!((i=te(this,_i))!=null&&i.hasAttribute(`${te(this,Ai)}`)))&&((a=te(this,_i))==null||a.setAttribute(`${te(this,Ai)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>te(this,Bt).delete(a)),(i=te(this,_i))==null||i.setAttribute(`${te(this,Ai)}`,`${this.value}`)}contains(e){return te(this,lt,_t).has(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){return this.remove(e),this.add(i),e===i}};_i=new WeakMap;Ai=new WeakMap;Nr=new WeakMap;Bt=new WeakMap;lt=new WeakSet;_t=function(){return te(this,Bt).size?te(this,Bt):te(this,Nr)};var $h=(t="")=>t.split(/\s+/),au=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?pe.CAPTIONS:pe.SUBTITLES,language:i,label:r}},Ht=(t="",e={})=>$h(t).map(i=>{let a=au(i);return{...e,...a}}),Yo=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?au(e):e):typeof t=="string"?Ht(t):[t]:[],Pr=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,dt=(t=[])=>Array.prototype.map.call(t,Pr).join(" "),Wh=(t,e)=>i=>i[t]===e,ru=t=>{let e=Object.entries(t).map(([i,a])=>Wh(i,a));return i=>e.every(a=>a(i))},$t=(t,e=[],i=[])=>{let a=Yo(i).map(ru),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=t})},Wt=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:ru(e);return Array.from(t.textTracks).filter(i)},Ur=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)};var ou=t=>{var e;let{media:i,fullscreenElement:a}=t,r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let n=(e=a[r])==null?void 0:e.call(a);if(n instanceof Promise)return n.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()},nu="exitFullscreen"in h?"exitFullscreen":"webkitExitFullscreen"in h?"webkitExitFullscreen":"webkitCancelFullScreen"in h?"webkitCancelFullScreen":void 0,su=t=>{var e;let{documentElement:i}=t;if(nu){let a=(e=i==null?void 0:i[nu])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},ya="fullscreenElement"in h?"fullscreenElement":"webkitFullscreenElement"in h?"webkitFullscreenElement":void 0,Fh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[ya];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===Nd.FULLSCREEN?i:a},lu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let n=Fh(t);if(!n)return!1;if(n===r||n===i)return!0;if(n.localName.includes("-")){let s=n.shadowRoot;if(!(ya in s))return le(n,r);for(;s!=null&&s[ya];){if(s[ya]===r)return!0;s=(e=s[ya])==null?void 0:e.shadowRoot}}return!1},Vh="fullscreenEnabled"in h?"fullscreenEnabled":"webkitFullscreenEnabled"in h?"webkitFullscreenEnabled":void 0,du=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[Vh])||i&&"webkitSupportsFullscreen"in i};var Br,qo=()=>{var t,e;return Br||(Br=(e=(t=h)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Br)},uu=async(t=qo())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([Kh(t,i.signal),Gh(t,e)]);return i.abort(),a},Kh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),Gh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await _r(10)}return t.volume!==e},Yh=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),Zo=(t=qo())=>d.matchMedia("(display-mode: standalone)").matches&&Yh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",zo=(t=qo())=>du({documentElement:h,media:t}),cu=zo(),mu=Zo(),hu=!!d.WebKitPlaybackTargetAvailabilityEvent,pu=!!d.chrome;var yi=t=>Wt(t.media,e=>[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),Qo=t=>Wt(t.media,e=>e.mode===bt.SHOWING&&[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)),Hr=(t,e)=>{let i=yi(t),a=Qo(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)$t(bt.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let n=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let A=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),_=A?[A,...globalThis.navigator.languages]:globalThis.navigator.languages,v=i.filter(E=>_.some(P=>E.language.toLowerCase().startsWith(P.split("-")[0]))).sort((E,P)=>{let y=_.findIndex(U=>E.language.toLowerCase().startsWith(U.split("-")[0])),w=_.findIndex(U=>P.language.toLowerCase().startsWith(U.split("-")[0]));return y-w});v[0]&&(n=v[0])}let{language:l,label:u,kind:c}=n;$t(bt.DISABLED,i,a),$t(bt.SHOWING,i,[{language:l,label:u,kind:c}])}}},$r=(t,e)=>t===e?!0:t==null||e==null||typeof t!=typeof e?!1:typeof t=="number"&&Number.isNaN(t)&&Number.isNaN(e)?!0:typeof t!="object"?!1:Array.isArray(t)?qh(t,e):Object.entries(t).every(([i,a])=>i in e&&$r(a,e[i])),qh=(t,e)=>{let i=Array.isArray(t),a=Array.isArray(e);return i!==a?!1:i||a?t.length!==e.length?!1:t.every((r,n)=>$r(r,e[n])):!0};var Zh=Object.values(we),Wr,zh=uu().then(t=>(Wr=t,Wr)),fu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=d.customElements.get(i);a&&e instanceof a||(await d.customElements.whenDefined(i),d.customElements.upgrade(e))}))},Ti={mediaError:{get(t,e){let{media:i}=t;if((e==null?void 0:e.type)!=="playing")return i==null?void 0:i.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(t,e){var i;let{media:a}=t;if((e==null?void 0:e.type)!=="playing")return(i=a==null?void 0:a.error)==null?void 0:i.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(t,e){var i,a;let{media:r}=t;if((e==null?void 0:e.type)!=="playing")return(a=(i=r==null?void 0:r.error)==null?void 0:i.message)!=null?a:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.paused)!=null?e:!0},set(t,e){var i;let{media:a}=e;a&&(t?a.pause():(i=a.play())==null||i.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(t,e){let{media:i}=t;return i?e?e.type==="playing":!i.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.playbackRate)!=null?e:1},set(t,e){let{media:i}=e;i&&Number.isFinite(+t)&&(i.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.muted)!=null?e:!1},set(t,e){let{media:i}=e;if(i){try{d.localStorage.setItem("media-chrome-pref-muted",t?"true":"false")}catch(a){console.debug("Error setting muted pref",a)}i.muted=t}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noMutedPref:i}}=e,{media:a}=e;if(!(!a||a.muted||i))try{let r=d.localStorage.getItem("media-chrome-pref-muted")==="true";Ti.mediaMuted.set(r,e),t(r)}catch(r){console.debug("Error getting muted pref",r)}}]},mediaVolume:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.volume)!=null?e:1},set(t,e){let{media:i}=e;if(i){try{t==null?d.localStorage.removeItem("media-chrome-pref-volume"):d.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch(a){console.debug("Error setting volume pref",a)}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let{media:a}=e;if(!a)return;let r=d.localStorage.getItem("media-chrome-pref-volume");if(r==null)return;Ti.mediaVolume.set(+r,e),t(+r)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(t){let{media:e}=t;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.currentTime)!=null?e:0},set(t,e){let{media:i}=e;!i||!vi(t)||(i.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){let{media:e,options:{defaultDuration:i}={}}=t;return i&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?i:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){let{media:e}=t;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;let{media:i}=t;if(!((e=i==null?void 0:i.seekable)!=null&&e.length))return;let a=i.seekable.start(0),r=i.seekable.end(i.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;let{media:i}=t,a=(e=i==null?void 0:i.buffered)!=null?e:[];return Array.from(a).map((r,n)=>[Number(a.start(n).toFixed(3)),Number(a.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[we.LIVE,we.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(Zh.includes(r))return r===we.UNKNOWN?a:r;let n=e.duration;return n===1/0?we.LIVE:Number.isFinite(n)?we.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(t){let{media:e}=t;if(!e)return Number.NaN;let{targetLiveWindow:i}=e,a=Ti.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===we.LIVE?0:i},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(t){let{media:e,options:{liveEdgeOffset:i=10}={}}=t;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Ti.mediaStreamType.get(t)===we.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let n=r.end(r.length-1)-i;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return yi(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return Qo(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i,a;let{media:r,options:n}=e;if(!r)return;let s=l=>{var u;!n.defaultSubtitles||l&&![pe.CAPTIONS,pe.SUBTITLES].includes((u=l==null?void 0:l.track)==null?void 0:u.kind)||Hr(e,!0)};return(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),s(),()=>{var l,u;(l=r.textTracks)==null||l.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(t){var e;let{media:i}=t;if(!i)return[];let[a]=Wt(i,{kind:pe.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","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),n=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),n==null||n.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),n==null||n.removeEventListener("load",t)}}]},mediaIsPip:{get(t){var e,i;let{media:a,documentElement:r}=t;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?le(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let n=r.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===a)return!0;n=(i=n.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!h.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}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(r=>{if(r.code===11){if(!i.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(i.readyState===0&&i.preload==="none"){let n=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),n()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),n()},1e3)}else throw r}else throw r})}else h.pictureInPictureElement&&h.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(t){var e,i,a;let{media:r}=t;return(a=(i=r==null?void 0:r.videoRenditions)==null?void 0:i[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=t,r=Array.prototype.findIndex.call(i.videoRenditions,n=>n.id==a);i.videoRenditions.selectedIndex!=r&&(i.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(t){var e,i;let{media:a}=t;return(i=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:i.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=t;for(let r of i.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(t){return lu(t)},set(t,e){t?ou(e):su(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(t){var e;let{media:i}=t;return!(i!=null&&i.remote)||((e=i.remote)==null?void 0:e.state)==="disconnected"?!1:!!i.remote.state},set(t,e){var i,a;let{media:r}=e;if(r&&!(t&&((i=r.remote)==null?void 0:i.state)!=="disconnected")&&!(!t&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(t,e){let{media:i}=e;if(i){if(!(i.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(t){let{media:e}=t;if(!cu||!zo(e))return ye.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!mu||!Zo(e))return ye.UNSUPPORTED}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(Wr===!1||(e==null?void 0:e.volume)==null)return ye.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{Wr==null&&zh.then(e=>t(e?void 0:ye.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!pu||!((i=a==null?void 0:a.remote)!=null&&i.state))return ye.UNSUPPORTED;if(!(e==null||e==="available"))return ye.UNAVAILABLE},stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(n=>{t({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!hu)return ye.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return ye.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(n=>{t({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return ye.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return ye.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return ye.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return ye.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var vu={[p.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,n;let{media:s}=e,l=i!=null?i:void 0,u,c;if(s&&l!=null){let[E]=Wt(s,{kind:pe.METADATA,label:"thumbnails"}),P=Array.prototype.find.call((a=E==null?void 0:E.cues)!=null?a:[],(y,w,U)=>w===0?y.endTime>l:w===U.length-1?y.startTime<=l:y.startTime<=l&&y.endTime>l);if(P){let y=/'^(?:[a-z]+:)?\/\//i.test(P.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,w=new URL(P.text,y);c=new URLSearchParams(w.hash).get("#xywh").split(",").map(J=>+J),u=w.href}}let A=t.mediaDuration.get(e),v=(n=t.mediaChaptersCues.get(e).find((E,P,y)=>P===y.length-1&&A===E.endTime?E.startTime<=l&&E.endTime>=l:E.startTime<=l&&E.endTime>l))==null?void 0:n.text;return i!=null&&v==null&&(v=""),{mediaPreviewTime:l,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:v}},[p.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[p.MEDIA_PLAY_REQUEST](t,e){var i;let a="mediaPaused";if(t.mediaStreamType.get(e)===we.LIVE){let s=!(t.mediaTargetLiveWindow.get(e)>0),l=(i=t.mediaSeekable.get(e))==null?void 0:i[1];s&&l&&t.mediaCurrentTime.set(l,e)}t[a].set(!1,e)},[p.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[p.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[p.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[p.MEDIA_VOLUME_REQUEST](t,e,{detail:i}){let a="mediaVolume",r=i;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t[a].set(r,e)},[p.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[p.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i;let a="mediaCurrentTime",r=(i=t.mediaSeekable.get(e))==null?void 0:i[1];Number.isNaN(Number(r))||t[a].set(r,e)},[p.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,n=yi(e),s=Yo(i),l=(a=s[0])==null?void 0:a.language;l&&!r.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),$t(bt.SHOWING,n,s)},[p.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=yi(e),r=i!=null?i:[];$t(bt.DISABLED,a,r)},[p.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){Hr(e,i)},[p.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[p.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[p.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[p.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e){let i="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[p.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[p.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[p.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var Eu=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Ti,requestMap:r=vu,options:n={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],u={options:{...n}},c=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),A=y=>{y!=null&&($r(y,c)||(c=Object.freeze({...c,...y}),l.forEach(w=>w(c))))},_=()=>{let y=Object.entries(a).reduce((w,[U,{get:J}])=>(w[U]=J(u),w),{});A(y)},v={},E,P=async(y,w)=>{var U,J,be,Et,at,ea,ta,ia,aa,ra,na,oa,sa,la,da,ua;let Er=!!E;if(E={...u,...E!=null?E:{},...y},Er)return;await fu(...Object.values(y));let rt=l.length>0&&w===0&&s,ld=u.media!==E.media,dd=((U=u.media)==null?void 0:U.textTracks)!==((J=E.media)==null?void 0:J.textTracks),ud=((be=u.media)==null?void 0:be.videoRenditions)!==((Et=E.media)==null?void 0:Et.videoRenditions),cd=((at=u.media)==null?void 0:at.audioTracks)!==((ea=E.media)==null?void 0:ea.audioTracks),md=((ta=u.media)==null?void 0:ta.remote)!==((ia=E.media)==null?void 0:ia.remote),hd=u.documentElement!==E.documentElement,pd=!!u.media&&(ld||rt),fd=!!((aa=u.media)!=null&&aa.textTracks)&&(dd||rt),vd=!!((ra=u.media)!=null&&ra.videoRenditions)&&(ud||rt),Ed=!!((na=u.media)!=null&&na.audioTracks)&&(cd||rt),bd=!!((oa=u.media)!=null&&oa.remote)&&(md||rt),gd=!!u.documentElement&&(hd||rt),_d=pd||fd||vd||Ed||bd||gd,hi=l.length===0&&w===1&&s,Ad=!!E.media&&(ld||hi),yd=!!((sa=E.media)!=null&&sa.textTracks)&&(dd||hi),Td=!!((la=E.media)!=null&&la.videoRenditions)&&(ud||hi),kd=!!((da=E.media)!=null&&da.audioTracks)&&(cd||hi),Sd=!!((ua=E.media)!=null&&ua.remote)&&(md||hi),Id=!!E.documentElement&&(hd||hi),Cd=Ad||yd||Td||kd||Sd||Id;if(!(_d||Cd)){Object.entries(E).forEach(([F,ca])=>{u[F]=ca}),_(),E=void 0;return}Object.entries(a).forEach(([F,{get:ca,mediaEvents:rh=[],textTracksEvents:nh=[],videoRenditionsEvents:oh=[],audioTracksEvents:sh=[],remoteEvents:lh=[],rootEvents:dh=[],stateOwnersUpdateHandlers:uh=[]}])=>{v[F]||(v[F]={});let ge=z=>{let _e=ca(u,z);A({[F]:_e})},ee;ee=v[F].mediaEvents,rh.forEach(z=>{ee&&pd&&(u.media.removeEventListener(z,ee),v[F].mediaEvents=void 0),Ad&&(E.media.addEventListener(z,ge),v[F].mediaEvents=ge)}),ee=v[F].textTracksEvents,nh.forEach(z=>{var _e,Me;ee&&fd&&((_e=u.media.textTracks)==null||_e.removeEventListener(z,ee),v[F].textTracksEvents=void 0),yd&&((Me=E.media.textTracks)==null||Me.addEventListener(z,ge),v[F].textTracksEvents=ge)}),ee=v[F].videoRenditionsEvents,oh.forEach(z=>{var _e,Me;ee&&vd&&((_e=u.media.videoRenditions)==null||_e.removeEventListener(z,ee),v[F].videoRenditionsEvents=void 0),Td&&((Me=E.media.videoRenditions)==null||Me.addEventListener(z,ge),v[F].videoRenditionsEvents=ge)}),ee=v[F].audioTracksEvents,sh.forEach(z=>{var _e,Me;ee&&Ed&&((_e=u.media.audioTracks)==null||_e.removeEventListener(z,ee),v[F].audioTracksEvents=void 0),kd&&((Me=E.media.audioTracks)==null||Me.addEventListener(z,ge),v[F].audioTracksEvents=ge)}),ee=v[F].remoteEvents,lh.forEach(z=>{var _e,Me;ee&&bd&&((_e=u.media.remote)==null||_e.removeEventListener(z,ee),v[F].remoteEvents=void 0),Sd&&((Me=E.media.remote)==null||Me.addEventListener(z,ge),v[F].remoteEvents=ge)}),ee=v[F].rootEvents,dh.forEach(z=>{ee&&gd&&(u.documentElement.removeEventListener(z,ee),v[F].rootEvents=void 0),Id&&(E.documentElement.addEventListener(z,ge),v[F].rootEvents=ge)});let Md=v[F].stateOwnersUpdateHandlers;uh.forEach(z=>{Md&&_d&&Md(),Cd&&(v[F].stateOwnersUpdateHandlers=z(ge,E))})}),Object.entries(E).forEach(([F,ca])=>{u[F]=ca}),_(),E=void 0};return P({media:t,fullscreenElement:e,documentElement:i,options:n}),{dispatch(y){let{type:w,detail:U}=y;if(r[w]&&c.mediaErrorCode==null){A(r[w](a,u,y));return}w==="mediaelementchangerequest"?P({media:U}):w==="fullscreenelementchangerequest"?P({fullscreenElement:U}):w==="documentelementchangerequest"?P({documentElement:U}):w==="optionschangerequest"&&Object.entries(U!=null?U:{}).forEach(([J,be])=>{u.options[J]=be})},getState(){return c},subscribe(y){return P({},l.length+1),l.push(y),y(c),()=>{let w=l.indexOf(y);w>=0&&(P({},l.length-1),l.splice(w,1))}}}};var es=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},N=(t,e,i)=>(es(t,e,"read from private field"),i?i.call(t):e.get(t)),ut=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},At=(t,e,i,a)=>(es(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),yt=(t,e,i)=>(es(t,e,"access private method"),i),Vt,Ta,Y,ka,He,Fr,Vr,Xo,ki,Sa,Kr,Jo,yu=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],bu=10,T={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",NO_VOLUME_PREF:"novolumepref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset"},Gr=class extends _a{constructor(){super(),ut(this,Vr),ut(this,ki),ut(this,Kr),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,ut(this,Vt,new Be(this,T.HOTKEYS)),ut(this,Ta,void 0),ut(this,Y,void 0),ut(this,ka,void 0),ut(this,He,void 0),ut(this,Fr,i=>{var a;(a=N(this,Y))==null||a.dispatch(i)}),this.associateElement(this);let e={};At(this,ka,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let n=a.toLowerCase(),s=new d.CustomEvent(Od[n],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(T.NO_HOTKEYS,T.HOTKEYS,T.DEFAULT_STREAM_TYPE,T.DEFAULT_SUBTITLES,T.DEFAULT_DURATION)}get mediaStore(){return N(this,Y)}set mediaStore(e){var i,a;if(N(this,Y)&&((i=N(this,He))==null||i.call(this),At(this,He,void 0)),At(this,Y,e),!N(this,Y)&&!this.hasAttribute(T.NO_DEFAULT_STORE)){yt(this,Vr,Xo).call(this);return}At(this,He,(a=N(this,Y))==null?void 0:a.subscribe(N(this,ka)))}get fullscreenElement(){var e;return(e=N(this,Ta))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(T.FULLSCREEN_ELEMENT)&&this.removeAttribute(T.FULLSCREEN_ELEMENT),At(this,Ta,e),(i=N(this,Y))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return k(this,T.DEFAULT_SUBTITLES)}set defaultSubtitles(e){S(this,T.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return C(this,T.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){M(this,T.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return x(this,T.DEFAULT_DURATION)}set defaultDuration(e){O(this,T.DEFAULT_DURATION,e)}get noHotkeys(){return k(this,T.NO_HOTKEYS)}set noHotkeys(e){S(this,T.NO_HOTKEYS,e)}get keysUsed(){return C(this,T.KEYS_USED)}set keysUsed(e){M(this,T.KEYS_USED,e)}get liveEdgeOffset(){return x(this,T.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){O(this,T.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return k(this,T.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){S(this,T.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return k(this,T.NO_VOLUME_PREF)}set noVolumePref(e){S(this,T.NO_VOLUME_PREF,e)}get noSubtitlesLangPref(){return k(this,T.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){S(this,T.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return k(this,T.NO_DEFAULT_STORE)}set noDefaultStore(e){S(this,T.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,n,s,l,u,c;if(super.attributeChangedCallback(e,i,a),e===T.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(T.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==i&&a===null&&this.enableHotkeys();else if(e===T.HOTKEYS)N(this,Vt).value=a;else if(e===T.DEFAULT_SUBTITLES&&a!==i)(r=N(this,Y))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES)}});else if(e===T.DEFAULT_STREAM_TYPE)(s=N(this,Y))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===T.LIVE_EDGE_OFFSET)(l=N(this,Y))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0}});else if(e===T.FULLSCREEN_ELEMENT){let A=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;At(this,Ta,A),(c=N(this,Y))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,i;!N(this,Y)&&!this.hasAttribute(T.NO_DEFAULT_STORE)&&yt(this,Vr,Xo).call(this),(e=N(this,Y))==null||e.dispatch({type:"documentelementchangerequest",detail:h}),super.connectedCallback(),N(this,Y)&&!N(this,He)&&At(this,He,(i=N(this,Y))==null?void 0:i.subscribe(N(this,ka))),this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),N(this,Y)&&((i=N(this,Y))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=N(this,Y))==null||a.dispatch({type:p.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),N(this,He)&&((r=N(this,He))==null||r.call(this),At(this,He,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=N(this,Y))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=N(this,Y))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){Au(this.mediaStateReceivers,e,i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(i.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=tp(e,a,r);Object.values(p).forEach(s=>{e.addEventListener(s,N(this,Fr))}),i.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(p).forEach(r=>{e.removeEventListener(r,N(this,Fr))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),N(this,Y)&&Object.entries(N(this,Y).getState()).forEach(([r,n])=>{Au([e],r,n)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",yt(this,Kr,Jo))}disableHotkeys(){this.removeEventListener("keydown",yt(this,Kr,Jo)),this.removeEventListener("keyup",yt(this,ki,Sa))}get hotkeys(){return C(this,T.HOTKEYS)}set hotkeys(e){M(this,T.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,n,s;let l=e.target;if(((r=(a=(i=l.getAttribute(T.KEYS_USED))==null?void 0:i.split(" "))!=null?a:l==null?void 0:l.keysUsed)!=null?r:[]).map(v=>v==="Space"?" ":v).filter(Boolean).includes(e.key))return;let c,A,_;if(!N(this,Vt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&N(this,Vt).contains("nospace")))switch(e.key){case" ":case"k":c=N(this,Y).getState().mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"m":c=this.mediaStore.getState().mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"f":c=this.mediaStore.getState().mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let v=this.hasAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET):bu;A=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-v,0),_=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(_);break}case"ArrowRight":{let v=this.hasAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET):bu;A=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+v,0),_=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(_);break}default:break}}};Vt=new WeakMap;Ta=new WeakMap;Y=new WeakMap;ka=new WeakMap;He=new WeakMap;Fr=new WeakMap;Vr=new WeakSet;Xo=function(){var t;this.mediaStore=Eu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(T.DEFAULT_DURATION)?+this.getAttribute(T.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(T.NO_SUBTITLES_LANG_PREF)}})};ki=new WeakSet;Sa=function(t){let{key:e}=t;if(!yu.includes(e)){this.removeEventListener("keyup",yt(this,ki,Sa));return}this.keyboardShortcutHandler(t)};Kr=new WeakSet;Jo=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!yu.includes(a)){this.removeEventListener("keyup",yt(this,ki,Sa));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(N(this,Vt).contains(`no${a.toLowerCase()}`)||a===" "&&N(this,Vt).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",yt(this,ki,Sa),{once:!0})};var Qh=Object.values(o),Xh=Object.values(Do),Tu=t=>{var e,i,a,r;let{observedAttributes:n}=t.constructor;!n&&((e=t.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(t),{observedAttributes:n}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,R.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>Qh.includes(l)):[]},Jh=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&d.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof d.customElements.get(t.nodeName.toLowerCase()))&&d.customElements.upgrade(t),Xh.some(a=>a in t)},jo=t=>Jh(t)||!!Tu(t).length,gu=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},_u={[o.MEDIA_SUBTITLES_LIST]:dt,[o.MEDIA_SUBTITLES_SHOWING]:dt,[o.MEDIA_SEEKABLE]:gu,[o.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(gu).join(" "),[o.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[o.MEDIA_RENDITION_LIST]:Pd,[o.MEDIA_AUDIO_TRACK_LIST]:Bd},jh=async(t,e,i)=>{var a,r;if(t.isConnected||await _r(0),typeof i=="boolean"||i==null)return S(t,e,i);if(typeof i=="number")return O(t,e,i);if(typeof i=="string")return M(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let n=(r=(a=_u[e])==null?void 0:a.call(_u,i))!=null?r:i;return t.setAttribute(e,n)},ep=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},Ft=(t,e)=>{if(ep(t))return;let i=(r,n)=>{var s,l;jo(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...c].forEach(_=>Ft(_,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!jo(t)){d.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},Au=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=Tu(a),n=e.toLowerCase();r.includes(n)&&jh(a,n,i)})},tp=(t,e,i)=>{Ft(t,e);let a=A=>{var _;let v=(_=A==null?void 0:A.composedPath()[0])!=null?_:A.target;e(v)},r=A=>{var _;let v=(_=A==null?void 0:A.composedPath()[0])!=null?_:A.target;i(v)};t.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=A=>{A.forEach(_=>{let{addedNodes:v=[],removedNodes:E=[],type:P,target:y,attributeName:w}=_;P==="childList"?(Array.prototype.forEach.call(v,U=>Ft(U,e)),Array.prototype.forEach.call(E,U=>Ft(U,i))):P==="attributes"&&w===R.MEDIA_CHROME_ATTRIBUTES&&(jo(y)?e(y):i(y))})},s=[],l=A=>{let _=A.target;_.name!=="media"&&(s.forEach(v=>Ft(v,i)),s=[..._.assignedElements({flatten:!0})],s.forEach(v=>Ft(v,e)))};t.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{Ft(t,i),t.removeEventListener("slotchange",l),u.disconnect(),t.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",Gr);var ts=Gr;var as=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},X=(t,e,i)=>(as(t,e,"read from private field"),i?i.call(t):e.get(t)),Si=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Yr=(t,e,i,a)=>(as(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ip=(t,e,i)=>(as(t,e,"access private method"),i),$e,Ci,kt,Ii,qr,is,ku,Tt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"},Su=h.createElement("template");Su.innerHTML=`
154
+ `;var Ph=Object.values(o),Uh="sm:384 md:576 lg:768 xl:960";function Bh(i){au(i.target,i.contentRect.width)}function au(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(k.BREAKPOINTS))!=null?t:Uh,r=Hh(a),n=$h(r,e),s=!1;if(Object.keys(r).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(nt.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(nt.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Hh(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function $h(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var _a=class extends d.HTMLElement{constructor(){super(),ye(this,$o),ye(this,Wo),ye(this,Fo),ye(this,ba),ye(this,Dr),ye(this,gi),ye(this,Rr,0),ye(this,Ei,null),ye(this,Ea,null),ye(this,bi,void 0),this.breakpointsComputed=!1,ye(this,wr,new MutationObserver(Ie(this,$o,jd).bind(this))),ye(this,va,!1),ye(this,Lr,t=>{ke(this,va)||(setTimeout(()=>{Bh(t),Ut(this,va,!1)},0),Ut(this,va,!0))}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(iu.content.cloneNode(!0)));let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){ke(this,Ei)&&this.mediaUnsetCallback(ke(this,Ei));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[k.AUTOHIDE,k.GESTURES_DISABLED].concat(Ph).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_CHAPTERS_CUES,o.MEDIA_WIDTH,o.MEDIA_HEIGHT,o.MEDIA_ERROR,o.MEDIA_ERROR_MESSAGE].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&&(Ut(this,Ei,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;ke(this,wr).observe(this,{childList:!0,subtree:!0}),ot(this,ke(this,Lr));let a=this.getAttribute(k.AUDIO)!=null?v("audio player"):v("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(k.USER_INACTIVE,""),au(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;ke(this,wr).disconnect(),st(this,ke(this,Lr)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ut(this,Ei,null)}handleEvent(e){switch(e.type){case"pointerdown":Ut(this,Rr,e.timeStamp);break;case"pointermove":Ie(this,Wo,eu).call(this,e);break;case"pointerup":Ie(this,Fo,tu).call(this,e);break;case"mouseleave":Ie(this,ba,xr).call(this);break;case"mouseup":this.removeAttribute(k.KEYBOARD_CONTROL);break;case"keyup":Ie(this,gi,ga).call(this),this.setAttribute(k.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ut(this,bi,isNaN(t)?0:t)}get autohide(){return(ke(this,bi)===void 0?2:ke(this,bi)).toString()}get breakpoints(){return C(this,k.BREAKPOINTS)}set breakpoints(e){M(this,k.BREAKPOINTS,e)}get audio(){return S(this,k.AUDIO)}set audio(e){I(this,k.AUDIO,e)}get gesturesDisabled(){return S(this,k.GESTURES_DISABLED)}set gesturesDisabled(e){I(this,k.GESTURES_DISABLED,e)}get keyboardControl(){return S(this,k.KEYBOARD_CONTROL)}set keyboardControl(e){I(this,k.KEYBOARD_CONTROL,e)}get noAutohide(){return S(this,k.NO_AUTOHIDE)}set noAutohide(e){I(this,k.NO_AUTOHIDE,e)}get autohideOverControls(){return S(this,k.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){I(this,k.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return S(this,k.USER_INACTIVE)}set userInteractive(e){I(this,k.USER_INACTIVE,e)}};Rr=new WeakMap;Ei=new WeakMap;Ea=new WeakMap;bi=new WeakMap;wr=new WeakMap;$o=new WeakSet;jd=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let a=t.removedNodes;for(let r of a){if(r.slot!="media"||t.target!=this)continue;let n=t.previousSibling&&t.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(r);else{let s=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of t.addedNodes)r===e&&this.handleMediaUpdated(e)}};va=new WeakMap;Lr=new WeakMap;Wo=new WeakSet;eu=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-ke(this,Rr)<250)return;Ie(this,Dr,Ko).call(this),clearTimeout(ke(this,Ea));let e=this.hasAttribute(k.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Ie(this,gi,ga).call(this)};Fo=new WeakSet;tu=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(k.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Ie(this,ba,xr).call(this):Ie(this,gi,ga).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Ie(this,gi,ga).call(this)};ba=new WeakSet;xr=function(){if(ke(this,bi)<0||this.hasAttribute(k.USER_INACTIVE))return;this.setAttribute(k.USER_INACTIVE,"");let i=new d.CustomEvent(nt.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Dr=new WeakSet;Ko=function(){if(!this.hasAttribute(k.USER_INACTIVE))return;this.removeAttribute(k.USER_INACTIVE);let i=new d.CustomEvent(nt.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};gi=new WeakSet;ga=function(){Ie(this,Dr,Ko).call(this),clearTimeout(ke(this,Ea));let i=parseInt(this.autohide);i<0||Ut(this,Ea,setTimeout(()=>{Ie(this,ba,xr).call(this)},i*1e3))};d.customElements.get("media-container")||d.customElements.define("media-container",_a);var ru=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},te=(i,e,t)=>(ru(i,e,"read from private field"),t?t.call(i):e.get(i)),Aa=(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)},Or=(i,e,t,a)=>(ru(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_i,Ai,Nr,Bt,lt,_t,Be=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){Aa(this,lt),Aa(this,_i,void 0),Aa(this,Ai,void 0),Aa(this,Nr,void 0),Aa(this,Bt,new Set),Or(this,_i,e),Or(this,Ai,t),Or(this,Nr,new Set(a))}[Symbol.iterator](){return te(this,lt,_t).values()}get length(){return te(this,lt,_t).size}get value(){var e;return(e=[...te(this,lt,_t)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Or(this,Bt,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...te(this,lt,_t)][e]}values(){return te(this,lt,_t).values()}forEach(e,t){te(this,lt,_t).forEach(e,t)}add(...e){var t,a;e.forEach(r=>te(this,Bt).add(r)),!(this.value===""&&!((t=te(this,_i))!=null&&t.hasAttribute(`${te(this,Ai)}`)))&&((a=te(this,_i))==null||a.setAttribute(`${te(this,Ai)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>te(this,Bt).delete(a)),(t=te(this,_i))==null||t.setAttribute(`${te(this,Ai)}`,`${this.value}`)}contains(e){return te(this,lt,_t).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}};_i=new WeakMap;Ai=new WeakMap;Nr=new WeakMap;Bt=new WeakMap;lt=new WeakSet;_t=function(){return te(this,Bt).size?te(this,Bt):te(this,Nr)};var Wh=(i="")=>i.split(/\s+/),nu=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?pe.CAPTIONS:pe.SUBTITLES,language:t,label:r}},Ht=(i="",e={})=>Wh(i).map(t=>{let a=nu(t);return{...e,...a}}),Go=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?nu(e):e):typeof i=="string"?Ht(i):[i]:[],Pr=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,dt=(i=[])=>Array.prototype.map.call(i,Pr).join(" "),Fh=(i,e)=>t=>t[i]===e,ou=i=>{let e=Object.entries(i).map(([t,a])=>Fh(t,a));return t=>e.every(a=>a(t))},$t=(i,e=[],t=[])=>{let a=Go(t).map(ou),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},Wt=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:ou(e);return Array.from(i.textTracks).filter(t)},Ur=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)};var lu=i=>{var e;let{media:t,fullscreenElement:a}=i,r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let n=(e=a[r])==null?void 0:e.call(a);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()},su="exitFullscreen"in h?"exitFullscreen":"webkitExitFullscreen"in h?"webkitExitFullscreen":"webkitCancelFullScreen"in h?"webkitCancelFullScreen":void 0,du=i=>{var e;let{documentElement:t}=i;if(su){let a=(e=t==null?void 0:t[su])==null?void 0:e.call(t);if(a instanceof Promise)return a.catch(()=>{})}},Ta="fullscreenElement"in h?"fullscreenElement":"webkitFullscreenElement"in h?"webkitFullscreenElement":void 0,Vh=i=>{let{documentElement:e,media:t}=i,a=e==null?void 0:e[Ta];return!a&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===Od.FULLSCREEN?t:a},uu=i=>{var e;let{media:t,documentElement:a,fullscreenElement:r=t}=i;if(!t||!a)return!1;let n=Vh(i);if(!n)return!1;if(n===r||n===t)return!0;if(n.localName.includes("-")){let s=n.shadowRoot;if(!(Ta in s))return le(n,r);for(;s!=null&&s[Ta];){if(s[Ta]===r)return!0;s=(e=s[Ta])==null?void 0:e.shadowRoot}}return!1},Kh="fullscreenEnabled"in h?"fullscreenEnabled":"webkitFullscreenEnabled"in h?"webkitFullscreenEnabled":void 0,cu=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[Kh])||t&&"webkitSupportsFullscreen"in t};var Br,Yo=()=>{var i,e;return Br||(Br=(e=(i=h)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Br)},mu=async(i=Yo())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,a=await Promise.race([Gh(i,t.signal),Yh(i,e)]);return t.abort(),a},Gh=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),Yh=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await _r(10)}return i.volume!==e},qh=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),qo=(i=Yo())=>d.matchMedia("(display-mode: standalone)").matches&&qh?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Zo=(i=Yo())=>cu({documentElement:h,media:i}),hu=Zo(),pu=qo(),fu=!!d.WebKitPlaybackTargetAvailabilityEvent,vu=!!d.chrome;var Ti=i=>Wt(i.media,e=>[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),zo=i=>Wt(i.media,e=>e.mode===bt.SHOWING&&[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)),Hr=(i,e)=>{let t=Ti(i),a=zo(i),r=!!a.length;if(t.length){if(e===!1||r&&e!==!0)$t(bt.DISABLED,t,a);else if(e===!0||!r&&e!==!1){let n=t[0],{options:s}=i;if(!(s!=null&&s.noSubtitlesLangPref)){let T=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),_=T?[T,...globalThis.navigator.languages]:globalThis.navigator.languages,p=t.filter(E=>_.some(P=>E.language.toLowerCase().startsWith(P.split("-")[0]))).sort((E,P)=>{let y=_.findIndex(U=>E.language.toLowerCase().startsWith(U.split("-")[0])),w=_.findIndex(U=>P.language.toLowerCase().startsWith(U.split("-")[0]));return y-w});p[0]&&(n=p[0])}let{language:l,label:u,kind:c}=n;$t(bt.DISABLED,t,a),$t(bt.SHOWING,t,[{language:l,label:u,kind:c}])}}},$r=(i,e)=>i===e?!0:i==null||e==null||typeof i!=typeof e?!1:typeof i=="number"&&Number.isNaN(i)&&Number.isNaN(e)?!0:typeof i!="object"?!1:Array.isArray(i)?Zh(i,e):Object.entries(i).every(([t,a])=>t in e&&$r(a,e[t])),Zh=(i,e)=>{let t=Array.isArray(i),a=Array.isArray(e);return t!==a?!1:t||a?i.length!==e.length?!1:i.every((r,n)=>$r(r,e[n])):!0};var zh=Object.values(we),Wr,Qh=mu().then(i=>(Wr=i,Wr)),Eu=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let a=d.customElements.get(t);a&&e instanceof a||(await d.customElements.whenDefined(t),d.customElements.upgrade(e))}))},yi={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:a}=i;if((e==null?void 0:e.type)!=="playing")return(t=a==null?void 0:a.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,a;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(a=(t=r==null?void 0:r.error)==null?void 0:t.message)!=null?a:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:a}=e;a&&(i?a.pause():(t=a.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t}=e;if(t){try{d.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(a){console.debug("Error setting muted pref",a)}t.muted=i}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:a}=e;if(!(!a||a.muted||t))try{let r=d.localStorage.getItem("media-chrome-pref-muted")==="true";yi.mediaMuted.set(r,e),i(r)}catch(r){console.debug("Error getting muted pref",r)}}]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t}=e;if(t){try{i==null?d.localStorage.removeItem("media-chrome-pref-volume"):d.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(a){console.debug("Error setting volume pref",a)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:a}=e;if(!a)return;let r=d.localStorage.getItem("media-chrome-pref-volume");if(r==null)return;yi.mediaVolume.set(+r,e),i(+r)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!vi(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(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","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,a=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(a).map((r,n)=>[Number(a.start(n).toFixed(3)),Number(a.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,a=[we.LIVE,we.ON_DEMAND].includes(t)?t:void 0;if(!e)return a;let{streamType:r}=e;if(zh.includes(r))return r===we.UNKNOWN?a:r;let n=e.duration;return n===1/0?we.LIVE:Number.isFinite(n)?we.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=yi.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&a===we.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(yi.mediaStreamType.get(i)===we.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let n=r.end(r.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return Ti(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return zo(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,a;let{media:r,options:n}=e;if(!r)return;let s=l=>{var u;!n.defaultSubtitles||l&&![pe.CAPTIONS,pe.SUBTITLES].includes((u=l==null?void 0:l.track)==null?void 0:u.kind)||Hr(e,!0)};return r.addEventListener("loadstart",s),(t=r.textTracks)==null||t.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),()=>{var l,u;r.removeEventListener("loadstart",s),(l=r.textTracks)==null||l.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[a]=Wt(t,{kind:pe.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","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),n=(t=a.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{r==null||r.removeEventListener("load",i),n==null||n.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:a,documentElement:r}=i;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?le(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let n=r.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===a)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!h.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(r=>{if(r.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(a),n()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),n()},1e3)}else throw r}else throw r})}else h.pictureInPictureElement&&h.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(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},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=i,r=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==a);t.videoRenditions.selectedIndex!=r&&(t.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(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},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=i;for(let r of t.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return uu(i)},set(i,e){i?lu(e):du(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(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},set(i,e){var t,a;let{media:r}=e;if(r&&!(i&&((t=r.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!hu||!Zo(e))return Te.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!pu||!qo(e))return Te.UNSUPPORTED}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(Wr===!1||(e==null?void 0:e.volume)==null)return Te.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{Wr==null&&Qh.then(e=>i(e?void 0:Te.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:a}=i;if(!vu||!((t=a==null?void 0:a.remote)!=null&&t.state))return Te.UNSUPPORTED;if(!(e==null||e==="available"))return Te.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(t=a==null?void 0:a.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!fu)return Te.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Te.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(t=a==null?void 0:a.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Te.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return Te.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var bu={[f.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var a,r,n;let{media:s}=e,l=t!=null?t:void 0,u,c;if(s&&l!=null){let[E]=Wt(s,{kind:pe.METADATA,label:"thumbnails"}),P=Array.prototype.find.call((a=E==null?void 0:E.cues)!=null?a:[],(y,w,U)=>w===0?y.endTime>l:w===U.length-1?y.startTime<=l:y.startTime<=l&&y.endTime>l);if(P){let y=/'^(?:[a-z]+:)?\/\//i.test(P.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,w=new URL(P.text,y);c=new URLSearchParams(w.hash).get("#xywh").split(",").map(J=>+J),u=w.href}}let T=i.mediaDuration.get(e),p=(n=i.mediaChaptersCues.get(e).find((E,P,y)=>P===y.length-1&&T===E.endTime?E.startTime<=l&&E.endTime>=l:E.startTime<=l&&E.endTime>l))==null?void 0:n.text;return t!=null&&p==null&&(p=""),{mediaPreviewTime:l,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:p}},[f.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[f.MEDIA_PLAY_REQUEST](i,e){var t,a,r,n;let s="mediaPaused",u=i.mediaStreamType.get(e)===we.LIVE,c=!((t=e.options)!=null&&t.noAutoSeekToLive),T=i.mediaTargetLiveWindow.get(e)>0;if(u&&c&&!T){let _=(a=i.mediaSeekable.get(e))==null?void 0:a[1];if(_){let p=(n=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?n:0,E=_-p;i.mediaCurrentTime.set(E,e)}}i[s].set(!1,e)},[f.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let a="mediaPlaybackRate",r=t;i[a].set(r,e)},[f.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[f.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[f.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let a="mediaVolume",r=t;r&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[a].set(r,e)},[f.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let a="mediaCurrentTime",r=t;i[a].set(r,e)},[f.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,a,r;let n="mediaCurrentTime",s=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(s)))return;let l=(r=(a=e.options)==null?void 0:a.seekToLiveOffset)!=null?r:0,u=s-l;i[n].set(u,e)},[f.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var a;let{options:r}=e,n=Ti(e),s=Go(t),l=(a=s[0])==null?void 0:a.language;l&&!r.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),$t(bt.SHOWING,n,s)},[f.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let a=Ti(e),r=t!=null?t:[];$t(bt.DISABLED,a,r)},[f.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){Hr(e,t)},[f.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let a="mediaRenditionSelected",r=t;i[a].set(r,e)},[f.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let a="mediaAudioTrackEnabled",r=t;i[a].set(r,e)},[f.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[f.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[f.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e){let t="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[t].set(!0,e)},[f.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[f.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[f.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[f.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var gu=({media:i,fullscreenElement:e,documentElement:t,stateMediator:a=yi,requestMap:r=bu,options:n={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],u={options:{...n}},c=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),T=y=>{y!=null&&($r(y,c)||(c=Object.freeze({...c,...y}),l.forEach(w=>w(c))))},_=()=>{let y=Object.entries(a).reduce((w,[U,{get:J}])=>(w[U]=J(u),w),{});T(y)},p={},E,P=async(y,w)=>{var U,J,be,Et,at,ea,ta,ia,aa,ra,na,oa,sa,la,da,ua;let Er=!!E;if(E={...u,...E!=null?E:{},...y},Er)return;await Eu(...Object.values(y));let rt=l.length>0&&w===0&&s,sd=u.media!==E.media,ld=((U=u.media)==null?void 0:U.textTracks)!==((J=E.media)==null?void 0:J.textTracks),dd=((be=u.media)==null?void 0:be.videoRenditions)!==((Et=E.media)==null?void 0:Et.videoRenditions),ud=((at=u.media)==null?void 0:at.audioTracks)!==((ea=E.media)==null?void 0:ea.audioTracks),cd=((ta=u.media)==null?void 0:ta.remote)!==((ia=E.media)==null?void 0:ia.remote),md=u.documentElement!==E.documentElement,hd=!!u.media&&(sd||rt),pd=!!((aa=u.media)!=null&&aa.textTracks)&&(ld||rt),fd=!!((ra=u.media)!=null&&ra.videoRenditions)&&(dd||rt),vd=!!((na=u.media)!=null&&na.audioTracks)&&(ud||rt),Ed=!!((oa=u.media)!=null&&oa.remote)&&(cd||rt),bd=!!u.documentElement&&(md||rt),gd=hd||pd||fd||vd||Ed||bd,hi=l.length===0&&w===1&&s,_d=!!E.media&&(sd||hi),Ad=!!((sa=E.media)!=null&&sa.textTracks)&&(ld||hi),Td=!!((la=E.media)!=null&&la.videoRenditions)&&(dd||hi),yd=!!((da=E.media)!=null&&da.audioTracks)&&(ud||hi),kd=!!((ua=E.media)!=null&&ua.remote)&&(cd||hi),Sd=!!E.documentElement&&(md||hi),Id=_d||Ad||Td||yd||kd||Sd;if(!(gd||Id)){Object.entries(E).forEach(([F,ca])=>{u[F]=ca}),_(),E=void 0;return}Object.entries(a).forEach(([F,{get:ca,mediaEvents:oh=[],textTracksEvents:sh=[],videoRenditionsEvents:lh=[],audioTracksEvents:dh=[],remoteEvents:uh=[],rootEvents:ch=[],stateOwnersUpdateHandlers:mh=[]}])=>{p[F]||(p[F]={});let ge=z=>{let _e=ca(u,z);T({[F]:_e})},ee;ee=p[F].mediaEvents,oh.forEach(z=>{ee&&hd&&(u.media.removeEventListener(z,ee),p[F].mediaEvents=void 0),_d&&(E.media.addEventListener(z,ge),p[F].mediaEvents=ge)}),ee=p[F].textTracksEvents,sh.forEach(z=>{var _e,Me;ee&&pd&&((_e=u.media.textTracks)==null||_e.removeEventListener(z,ee),p[F].textTracksEvents=void 0),Ad&&((Me=E.media.textTracks)==null||Me.addEventListener(z,ge),p[F].textTracksEvents=ge)}),ee=p[F].videoRenditionsEvents,lh.forEach(z=>{var _e,Me;ee&&fd&&((_e=u.media.videoRenditions)==null||_e.removeEventListener(z,ee),p[F].videoRenditionsEvents=void 0),Td&&((Me=E.media.videoRenditions)==null||Me.addEventListener(z,ge),p[F].videoRenditionsEvents=ge)}),ee=p[F].audioTracksEvents,dh.forEach(z=>{var _e,Me;ee&&vd&&((_e=u.media.audioTracks)==null||_e.removeEventListener(z,ee),p[F].audioTracksEvents=void 0),yd&&((Me=E.media.audioTracks)==null||Me.addEventListener(z,ge),p[F].audioTracksEvents=ge)}),ee=p[F].remoteEvents,uh.forEach(z=>{var _e,Me;ee&&Ed&&((_e=u.media.remote)==null||_e.removeEventListener(z,ee),p[F].remoteEvents=void 0),kd&&((Me=E.media.remote)==null||Me.addEventListener(z,ge),p[F].remoteEvents=ge)}),ee=p[F].rootEvents,ch.forEach(z=>{ee&&bd&&(u.documentElement.removeEventListener(z,ee),p[F].rootEvents=void 0),Sd&&(E.documentElement.addEventListener(z,ge),p[F].rootEvents=ge)});let Cd=p[F].stateOwnersUpdateHandlers;mh.forEach(z=>{Cd&&gd&&Cd(),Id&&(p[F].stateOwnersUpdateHandlers=z(ge,E))})}),Object.entries(E).forEach(([F,ca])=>{u[F]=ca}),_(),E=void 0};return P({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(y){let{type:w,detail:U}=y;if(r[w]&&c.mediaErrorCode==null){T(r[w](a,u,y));return}w==="mediaelementchangerequest"?P({media:U}):w==="fullscreenelementchangerequest"?P({fullscreenElement:U}):w==="documentelementchangerequest"?P({documentElement:U}):w==="optionschangerequest"&&Object.entries(U!=null?U:{}).forEach(([J,be])=>{u.options[J]=be})},getState(){return c},subscribe(y){return P({},l.length+1),l.push(y),y(c),()=>{let w=l.indexOf(y);w>=0&&(P({},l.length-1),l.splice(w,1))}}}};var jo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},O=(i,e,t)=>(jo(i,e,"read from private field"),t?t.call(i):e.get(i)),ut=(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)},At=(i,e,t,a)=>(jo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Tt=(i,e,t)=>(jo(i,e,"access private method"),t),Vt,ya,V,ka,He,Fr,Vr,Qo,ki,Sa,Kr,Xo,ku=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],_u=10,g={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",SEEK_TO_LIVE_OFFSET:"seektoliveoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys",NO_VOLUME_PREF:"novolumepref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",LANG:"lang"},Gr=class extends _a{constructor(){super(),ut(this,Vr),ut(this,ki),ut(this,Kr),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,ut(this,Vt,new Be(this,g.HOTKEYS)),ut(this,ya,void 0),ut(this,V,void 0),ut(this,ka,void 0),ut(this,He,void 0),ut(this,Fr,t=>{var a;(a=O(this,V))==null||a.dispatch(t)}),this.associateElement(this);let e={};At(this,ka,t=>{Object.entries(t).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let n=a.toLowerCase(),s=new d.CustomEvent(Dd[n],{composed:!0,detail:r});this.dispatchEvent(s)}),e=t}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(g.NO_HOTKEYS,g.HOTKEYS,g.DEFAULT_STREAM_TYPE,g.DEFAULT_SUBTITLES,g.DEFAULT_DURATION,g.LANG)}get mediaStore(){return O(this,V)}set mediaStore(e){var t,a;if(O(this,V)&&((t=O(this,He))==null||t.call(this),At(this,He,void 0)),At(this,V,e),!O(this,V)&&!this.hasAttribute(g.NO_DEFAULT_STORE)){Tt(this,Vr,Qo).call(this);return}At(this,He,(a=O(this,V))==null?void 0:a.subscribe(O(this,ka)))}get fullscreenElement(){var e;return(e=O(this,ya))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(g.FULLSCREEN_ELEMENT)&&this.removeAttribute(g.FULLSCREEN_ELEMENT),At(this,ya,e),(t=O(this,V))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return S(this,g.DEFAULT_SUBTITLES)}set defaultSubtitles(e){I(this,g.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return C(this,g.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){M(this,g.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return x(this,g.DEFAULT_DURATION)}set defaultDuration(e){N(this,g.DEFAULT_DURATION,e)}get noHotkeys(){return S(this,g.NO_HOTKEYS)}set noHotkeys(e){I(this,g.NO_HOTKEYS,e)}get keysUsed(){return C(this,g.KEYS_USED)}set keysUsed(e){M(this,g.KEYS_USED,e)}get liveEdgeOffset(){return x(this,g.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){N(this,g.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return S(this,g.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){I(this,g.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return S(this,g.NO_VOLUME_PREF)}set noVolumePref(e){I(this,g.NO_VOLUME_PREF,e)}get noSubtitlesLangPref(){return S(this,g.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){I(this,g.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return S(this,g.NO_DEFAULT_STORE)}set noDefaultStore(e){I(this,g.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,a){var r,n,s,l,u,c,T,_;if(super.attributeChangedCallback(e,t,a),e===g.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(g.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===g.HOTKEYS)O(this,Vt).value=a;else if(e===g.DEFAULT_SUBTITLES&&a!==t)(r=O(this,V))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(g.DEFAULT_SUBTITLES)}});else if(e===g.DEFAULT_STREAM_TYPE)(s=O(this,V))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(g.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===g.LIVE_EDGE_OFFSET)(l=O(this,V))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(g.LIVE_EDGE_OFFSET)?+this.getAttribute(g.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(g.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(g.LIVE_EDGE_OFFSET)}});else if(e===g.SEEK_TO_LIVE_OFFSET)(u=O(this,V))==null||u.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(g.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(g.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===g.NO_AUTO_SEEK_TO_LIVE)(c=O(this,V))==null||c.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(g.NO_AUTO_SEEK_TO_LIVE)}});else if(e===g.FULLSCREEN_ELEMENT){let p=a?(T=this.getRootNode())==null?void 0:T.getElementById(a):void 0;At(this,ya,p),(_=O(this,V))==null||_.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===g.LANG&&a!==t&&Vd(a)}connectedCallback(){var e,t;!O(this,V)&&!this.hasAttribute(g.NO_DEFAULT_STORE)&&Tt(this,Vr,Qo).call(this),(e=O(this,V))==null||e.dispatch({type:"documentelementchangerequest",detail:h}),super.connectedCallback(),O(this,V)&&!O(this,He)&&At(this,He,(t=O(this,V))==null?void 0:t.subscribe(O(this,ka))),this.enableHotkeys()}disconnectedCallback(){var e,t,a,r;(e=super.disconnectedCallback)==null||e.call(this),O(this,V)&&((t=O(this,V))==null||t.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=O(this,V))==null||a.dispatch({type:f.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),O(this,He)&&((r=O(this,He))==null||r.call(this),At(this,He,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=O(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=O(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){yu(this.mediaStateReceivers,e,t)}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=ip(e,a,r);Object.values(f).forEach(s=>{e.addEventListener(s,O(this,Fr))}),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.values(f).forEach(r=>{e.removeEventListener(r,O(this,Fr))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),O(this,V)&&Object.entries(O(this,V).getState()).forEach(([r,n])=>{yu([e],r,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Tt(this,Kr,Xo))}disableHotkeys(){this.removeEventListener("keydown",Tt(this,Kr,Xo)),this.removeEventListener("keyup",Tt(this,ki,Sa))}get hotkeys(){return C(this,g.HOTKEYS)}set hotkeys(e){M(this,g.HOTKEYS,e)}keyboardShortcutHandler(e){var t,a,r,n,s;let l=e.target;if(((r=(a=(t=l.getAttribute(g.KEYS_USED))==null?void 0:t.split(" "))!=null?a:l==null?void 0:l.keysUsed)!=null?r:[]).map(p=>p==="Space"?" ":p).filter(Boolean).includes(e.key))return;let c,T,_;if(!O(this,Vt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&O(this,Vt).contains("nospace")))switch(e.key){case" ":case"k":c=O(this,V).getState().mediaPaused?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"m":c=this.mediaStore.getState().mediaVolumeLevel==="off"?f.MEDIA_UNMUTE_REQUEST:f.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"f":c=this.mediaStore.getState().mediaIsFullscreen?f.MEDIA_EXIT_FULLSCREEN_REQUEST:f.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let p=this.hasAttribute(g.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(g.KEYBOARD_BACKWARD_SEEK_OFFSET):_u;T=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-p,0),_=new d.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(_);break}case"ArrowRight":{let p=this.hasAttribute(g.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(g.KEYBOARD_FORWARD_SEEK_OFFSET):_u;T=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+p,0),_=new d.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(_);break}default:break}}};Vt=new WeakMap;ya=new WeakMap;V=new WeakMap;ka=new WeakMap;He=new WeakMap;Fr=new WeakMap;Vr=new WeakSet;Qo=function(){var i;this.mediaStore=gu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(g.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(g.DEFAULT_DURATION)?+this.getAttribute(g.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(g.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(g.LIVE_EDGE_OFFSET)?+this.getAttribute(g.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(g.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(g.SEEK_TO_LIVE_OFFSET):this.hasAttribute(g.LIVE_EDGE_OFFSET)?+this.getAttribute(g.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(g.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(g.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(g.NO_SUBTITLES_LANG_PREF)}})};ki=new WeakSet;Sa=function(i){let{key:e}=i;if(!ku.includes(e)){this.removeEventListener("keyup",Tt(this,ki,Sa));return}this.keyboardShortcutHandler(i)};Kr=new WeakSet;Xo=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!ku.includes(a)){this.removeEventListener("keyup",Tt(this,ki,Sa));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(O(this,Vt).contains(`no${a.toLowerCase()}`)||a===" "&&O(this,Vt).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",Tt(this,ki,Sa),{once:!0})};var Xh=Object.values(o),Jh=Object.values(Do),Su=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,L.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>Xh.includes(l)):[]},jh=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&d.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof d.customElements.get(i.nodeName.toLowerCase()))&&d.customElements.upgrade(i),Jh.some(a=>a in i)},Jo=i=>jh(i)||!!Su(i).length,Au=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Tu={[o.MEDIA_SUBTITLES_LIST]:dt,[o.MEDIA_SUBTITLES_SHOWING]:dt,[o.MEDIA_SEEKABLE]:Au,[o.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Au).join(" "),[o.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[o.MEDIA_RENDITION_LIST]:Nd,[o.MEDIA_AUDIO_TRACK_LIST]:Ud},ep=async(i,e,t)=>{var a,r;if(i.isConnected||await _r(0),typeof t=="boolean"||t==null)return I(i,e,t);if(typeof t=="number")return N(i,e,t);if(typeof t=="string")return M(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=Tu[e])==null?void 0:a.call(Tu,t))!=null?r:t;return i.setAttribute(e,n)},tp=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Ft=(i,e)=>{if(tp(i))return;let t=(r,n)=>{var s,l;Jo(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...c].forEach(_=>Ft(_,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Jo(i)){d.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},yu=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=Su(a),n=e.toLowerCase();r.includes(n)&&ep(a,n,t)})},ip=(i,e,t)=>{Ft(i,e);let a=T=>{var _;let p=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;e(p)},r=T=>{var _;let p=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;t(p)};i.addEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=T=>{T.forEach(_=>{let{addedNodes:p=[],removedNodes:E=[],type:P,target:y,attributeName:w}=_;P==="childList"?(Array.prototype.forEach.call(p,U=>Ft(U,e)),Array.prototype.forEach.call(E,U=>Ft(U,t))):P==="attributes"&&w===L.MEDIA_CHROME_ATTRIBUTES&&(Jo(y)?e(y):t(y))})},s=[],l=T=>{let _=T.target;_.name!=="media"&&(s.forEach(p=>Ft(p,t)),s=[..._.assignedElements({flatten:!0})],s.forEach(p=>Ft(p,e)))};i.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Ft(i,t),i.removeEventListener("slotchange",l),u.disconnect(),i.removeEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",Gr);var es=Gr;var is=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},X=(i,e,t)=>(is(i,e,"read from private field"),t?t.call(i):e.get(i)),Si=(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)},Yr=(i,e,t,a)=>(is(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ap=(i,e,t)=>(is(i,e,"access private method"),t),$e,Ci,kt,Ii,qr,ts,Iu,yt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"},Cu=h.createElement("template");Cu.innerHTML=`
149
155
  <style>
150
156
  :host {
151
157
  position: relative;
@@ -164,7 +170,7 @@
164
170
  box-sizing: border-box;
165
171
  transition: background .15s linear;
166
172
  pointer-events: auto;
167
- cursor: pointer;
173
+ cursor: var(--media-cursor, pointer);
168
174
  -webkit-tap-highlight-color: transparent;
169
175
  }
170
176
 
@@ -220,10 +226,10 @@
220
226
  <slot name="tooltip-content"></slot>
221
227
  </media-tooltip>
222
228
  </slot>
223
- `;var V=class extends d.HTMLElement{constructor(e={}){var i;if(super(),Si(this,is),Si(this,$e,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",Si(this,Ci,a=>{this.preventClick||this.handleClick(a),setTimeout(X(this,kt),0)}),Si(this,kt,()=>{var a,r;(r=(a=this.tooltipEl)==null?void 0:a.updateXOffset)==null||r.call(a)}),Si(this,Ii,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",X(this,Ii));return}this.preventClick||this.handleClick(a)}),Si(this,qr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",X(this,Ii));return}this.addEventListener("keyup",X(this,Ii),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=Su.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=h.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),e.tooltipContent&&(a.querySelector('slot[name="tooltip-content"]').innerHTML=(i=e.tooltipContent)!=null?i:"",this.tooltipContent=e.tooltipContent),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(a)}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",Tt.TOOLTIP_PLACEMENT,R.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",X(this,Ci)),this.addEventListener("keydown",X(this,qr)),this.tabIndex=0}disable(){this.removeEventListener("click",X(this,Ci)),this.removeEventListener("keydown",X(this,qr)),this.removeEventListener("keyup",X(this,Ii)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER?(i&&((n=(r=X(this,$e))==null?void 0:r.unassociateElement)==null||n.call(r,this),Yr(this,$e,null)),a&&this.isConnected&&(Yr(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=X(this,$e))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===Tt.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i&&(this.tooltipEl.placement=a),X(this,kt).call(this)}connectedCallback(){var e,i,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let n=this.getAttribute(R.MEDIA_CONTROLLER);n&&(Yr(this,$e,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=X(this,$e))==null?void 0:i.associateElement)==null||a.call(i,this)),d.customElements.whenDefined("media-tooltip").then(()=>ip(this,is,ku).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=X(this,$e))==null?void 0:e.unassociateElement)==null||i.call(e,this),Yr(this,$e,null),this.removeEventListener("mouseenter",X(this,kt)),this.removeEventListener("focus",X(this,kt)),this.removeEventListener("click",X(this,Ci))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return C(this,Tt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){M(this,Tt.TOOLTIP_PLACEMENT,e)}get mediaController(){return C(this,R.MEDIA_CONTROLLER)}set mediaController(e){M(this,R.MEDIA_CONTROLLER,e)}get disabled(){return k(this,Tt.DISABLED)}set disabled(e){S(this,Tt.DISABLED,e)}get noTooltip(){return k(this,Tt.NO_TOOLTIP)}set noTooltip(e){S(this,Tt.NO_TOOLTIP,e)}handleClick(e){}};$e=new WeakMap;Ci=new WeakMap;kt=new WeakMap;Ii=new WeakMap;qr=new WeakMap;is=new WeakSet;ku=function(){this.addEventListener("mouseenter",X(this,kt)),this.addEventListener("focus",X(this,kt)),this.addEventListener("click",X(this,Ci));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",V);var Iu=`<svg aria-hidden="true" viewBox="0 0 26 24">
229
+ `;var K=class extends d.HTMLElement{constructor(e={}){var t;if(super(),Si(this,ts),Si(this,$e,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",Si(this,Ci,a=>{this.preventClick||this.handleClick(a),setTimeout(X(this,kt),0)}),Si(this,kt,()=>{var a,r;(r=(a=this.tooltipEl)==null?void 0:a.updateXOffset)==null||r.call(a)}),Si(this,Ii,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",X(this,Ii));return}this.preventClick||this.handleClick(a)}),Si(this,qr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",X(this,Ii));return}this.addEventListener("keyup",X(this,Ii),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=Cu.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=h.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),e.tooltipContent&&(a.querySelector('slot[name="tooltip-content"]').innerHTML=(t=e.tooltipContent)!=null?t:"",this.tooltipContent=e.tooltipContent),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(a)}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",yt.TOOLTIP_PLACEMENT,L.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",X(this,Ci)),this.addEventListener("keydown",X(this,qr)),this.tabIndex=0}disable(){this.removeEventListener("click",X(this,Ci)),this.removeEventListener("keydown",X(this,qr)),this.removeEventListener("keyup",X(this,Ii)),this.tabIndex=-1}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===L.MEDIA_CONTROLLER?(t&&((n=(r=X(this,$e))==null?void 0:r.unassociateElement)==null||n.call(r,this),Yr(this,$e,null)),a&&this.isConnected&&(Yr(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=X(this,$e))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==t?a==null?this.enable():this.disable():e===yt.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==t&&(this.tooltipEl.placement=a),X(this,kt).call(this)}connectedCallback(){var e,t,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let n=this.getAttribute(L.MEDIA_CONTROLLER);n&&(Yr(this,$e,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=X(this,$e))==null?void 0:t.associateElement)==null||a.call(t,this)),d.customElements.whenDefined("media-tooltip").then(()=>ap(this,ts,Iu).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=X(this,$e))==null?void 0:e.unassociateElement)==null||t.call(e,this),Yr(this,$e,null),this.removeEventListener("mouseenter",X(this,kt)),this.removeEventListener("focus",X(this,kt)),this.removeEventListener("click",X(this,Ci))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return C(this,yt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){M(this,yt.TOOLTIP_PLACEMENT,e)}get mediaController(){return C(this,L.MEDIA_CONTROLLER)}set mediaController(e){M(this,L.MEDIA_CONTROLLER,e)}get disabled(){return S(this,yt.DISABLED)}set disabled(e){I(this,yt.DISABLED,e)}get noTooltip(){return S(this,yt.NO_TOOLTIP)}set noTooltip(e){I(this,yt.NO_TOOLTIP,e)}handleClick(e){}};$e=new WeakMap;Ci=new WeakMap;kt=new WeakMap;Ii=new WeakMap;qr=new WeakMap;ts=new WeakSet;Iu=function(){this.addEventListener("mouseenter",X(this,kt)),this.addEventListener("focus",X(this,kt)),this.addEventListener("click",X(this,Ci));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",K);var Mu=`<svg aria-hidden="true" viewBox="0 0 26 24">
224
230
  <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"/>
225
231
  </svg>
226
- `,Mu=h.createElement("template");Mu.innerHTML=`
232
+ `,Lu=h.createElement("template");Lu.innerHTML=`
227
233
  <style>
228
234
  :host([${o.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
229
235
  display: none !important;
@@ -241,17 +247,17 @@
241
247
  </style>
242
248
 
243
249
  <slot name="icon">
244
- <slot name="enter">${Iu}</slot>
245
- <slot name="exit">${Iu}</slot>
250
+ <slot name="enter">${Mu}</slot>
251
+ <slot name="exit">${Mu}</slot>
246
252
  </slot>
247
- `;var ap=`
248
- <slot name="tooltip-enter">${f("start airplay")}</slot>
249
- <slot name="tooltip-exit">${f("stop airplay")}</slot>
250
- `,Cu=t=>{let e=t.mediaIsAirplaying?f("stop airplay"):f("start airplay");t.setAttribute("aria-label",e)},rs=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Mu,tooltipContent:ap,...e})}connectedCallback(){super.connectedCallback(),Cu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_AIRPLAYING&&Cu(this)}get mediaIsAirplaying(){return k(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){S(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return C(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){M(this,o.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(p.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",rs);var rp=`<svg aria-hidden="true" viewBox="0 0 26 24">
253
+ `;var rp=`
254
+ <slot name="tooltip-enter">${v("start airplay")}</slot>
255
+ <slot name="tooltip-exit">${v("stop airplay")}</slot>
256
+ `,wu=i=>{let e=i.mediaIsAirplaying?v("stop airplay"):v("start airplay");i.setAttribute("aria-label",e)},as=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Lu,tooltipContent:rp,...e})}connectedCallback(){super.connectedCallback(),wu(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_AIRPLAYING&&wu(this)}get mediaIsAirplaying(){return S(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){I(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return C(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){M(this,o.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(f.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",as);var np=`<svg aria-hidden="true" viewBox="0 0 26 24">
251
257
  <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"/>
252
- </svg>`,np=`<svg aria-hidden="true" viewBox="0 0 26 24">
258
+ </svg>`,op=`<svg aria-hidden="true" viewBox="0 0 26 24">
253
259
  <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"/>
254
- </svg>`,xu=h.createElement("template");xu.innerHTML=`
260
+ </svg>`,Ou=h.createElement("template");Ou.innerHTML=`
255
261
  <style>
256
262
  :host([aria-checked="true"]) slot[name=off] {
257
263
  display: none !important;
@@ -269,13 +275,13 @@
269
275
  </style>
270
276
 
271
277
  <slot name="icon">
272
- <slot name="on">${rp}</slot>
273
- <slot name="off">${np}</slot>
278
+ <slot name="on">${np}</slot>
279
+ <slot name="off">${op}</slot>
274
280
  </slot>
275
- `;var op=`
276
- <slot name="tooltip-enable">${f("Enable captions")}</slot>
277
- <slot name="tooltip-disable">${f("Disable captions")}</slot>
278
- `,wu=t=>{t.setAttribute("aria-checked",Ur(t).toString())},ns=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:xu,tooltipContent:op,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",f("closed captions")),wu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&wu(this)}get mediaSubtitlesList(){return Ru(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Lu(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Ru(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Lu(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},Ru=(t,e)=>{let i=t.getAttribute(e);return i?Ht(i):[]},Lu=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=dt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",ns);var sp='<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>',lp='<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>',Ou=h.createElement("template");Ou.innerHTML=`
281
+ `;var sp=`
282
+ <slot name="tooltip-enable">${v("Enable captions")}</slot>
283
+ <slot name="tooltip-disable">${v("Disable captions")}</slot>
284
+ `,Ru=i=>{i.setAttribute("aria-checked",Ur(i).toString())},rs=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Ou,tooltipContent:sp,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",v("closed captions")),Ru(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_SHOWING&&Ru(this)}get mediaSubtitlesList(){return xu(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Du(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return xu(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Du(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},xu=(i,e)=>{let t=i.getAttribute(e);return t?Ht(t):[]},Du=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=dt(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",rs);var lp='<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>',dp='<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>',Pu=h.createElement("template");Pu.innerHTML=`
279
285
  <style>
280
286
  :host([${o.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
281
287
  display: none !important;
@@ -293,13 +299,13 @@
293
299
  </style>
294
300
 
295
301
  <slot name="icon">
296
- <slot name="enter">${sp}</slot>
297
- <slot name="exit">${lp}</slot>
302
+ <slot name="enter">${lp}</slot>
303
+ <slot name="exit">${dp}</slot>
298
304
  </slot>
299
- `;var dp=`
300
- <slot name="tooltip-enter">${f("Start casting")}</slot>
301
- <slot name="tooltip-exit">${f("Stop casting")}</slot>
302
- `,Du=t=>{let e=t.mediaIsCasting?f("stop casting"):f("start casting");t.setAttribute("aria-label",e)},os=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ou,tooltipContent:dp,...e})}connectedCallback(){super.connectedCallback(),Du(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_CASTING&&Du(this)}get mediaIsCasting(){return k(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){S(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return C(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){M(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?p.MEDIA_EXIT_CAST_REQUEST:p.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",os);var hs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Gt=(t,e,i)=>(hs(t,e,"read from private field"),i?i.call(t):e.get(t)),ct=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ps=(t,e,i,a)=>(hs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Kt=(t,e,i)=>(hs(t,e,"access private method"),i),zr,Ca,Yt,Zr,ss,ls,Nu,ds,Pu,us,Uu,cs,Bu,ms,Hu;function up(t){return`
305
+ `;var up=`
306
+ <slot name="tooltip-enter">${v("Start casting")}</slot>
307
+ <slot name="tooltip-exit">${v("Stop casting")}</slot>
308
+ `,Nu=i=>{let e=i.mediaIsCasting?v("stop casting"):v("start casting");i.setAttribute("aria-label",e)},ns=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Pu,tooltipContent:up,...e})}connectedCallback(){super.connectedCallback(),Nu(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_CASTING&&Nu(this)}get mediaIsCasting(){return S(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){I(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return C(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){M(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?f.MEDIA_EXIT_CAST_REQUEST:f.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",ns);var ms=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Gt=(i,e,t)=>(ms(i,e,"read from private field"),t?t.call(i):e.get(i)),ct=(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)},hs=(i,e,t,a)=>(ms(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Kt=(i,e,t)=>(ms(i,e,"access private method"),t),zr,Ca,Yt,Zr,os,ss,Uu,ls,Bu,ds,Hu,us,$u,cs,Wu;function cp(i){return`
303
309
  <style>
304
310
  :host {
305
311
  font: var(--media-font,
@@ -339,12 +345,12 @@
339
345
  line-height: 1.4;
340
346
  }
341
347
  </style>
342
- ${this.getSlotTemplateHTML(t)}
343
- `}function cp(t){return`
348
+ ${this.getSlotTemplateHTML(i)}
349
+ `}function mp(i){return`
344
350
  <slot id="content"></slot>
345
- `}var Ia={OPEN:"open",ANCHOR:"anchor"},qt=class extends d.HTMLElement{constructor(){super(),ct(this,Zr),ct(this,ls),ct(this,ds),ct(this,us),ct(this,cs),ct(this,ms),ct(this,zr,!1),ct(this,Ca,null),ct(this,Yt,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Ia.OPEN,Ia.ANCHOR]}get open(){return k(this,Ia.OPEN)}set open(e){S(this,Ia.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Kt(this,us,Uu).call(this,e);break;case"focusout":Kt(this,cs,Bu).call(this,e);break;case"keydown":Kt(this,ms,Hu).call(this,e);break}}connectedCallback(){Kt(this,Zr,ss).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){Kt(this,Zr,ss).call(this),e===Ia.OPEN&&a!==i&&(this.open?Kt(this,ls,Nu).call(this):Kt(this,ds,Pu).call(this))}focus(){ps(this,Ca,fa());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),i=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||i)return;let a=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');a==null||a.focus()}get keysUsed(){return["Escape","Tab"]}};zr=new WeakMap;Ca=new WeakMap;Yt=new WeakMap;Zr=new WeakSet;ss=function(){if(!Gt(this,zr)&&(ps(this,zr,!0),!this.shadowRoot)){this.attachShadow({mode:"open"});let t=qd(this.attributes);this.shadowRoot.innerHTML=`
346
- ${this.constructor.getTemplateHTML(t)}
347
- `,queueMicrotask(()=>{let{style:e}=W(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};ls=new WeakSet;Nu=function(){var t;(t=Gt(this,Yt))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};ds=new WeakSet;Pu=function(){var t;(t=Gt(this,Yt))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};us=new WeakSet;Uu=function(t){ps(this,Yt,t.relatedTarget),le(this,t.relatedTarget)||(this.open=!this.open)};cs=new WeakSet;Bu=function(t){var e;le(this,t.relatedTarget)||((e=Gt(this,Ca))==null||e.focus(),Gt(this,Yt)&&Gt(this,Yt)!==t.relatedTarget&&this.open&&(this.open=!1))};ms=new WeakSet;Hu=function(t){var e,i,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=t;l||u||c||this.keysUsed.includes(s)&&(t.preventDefault(),t.stopPropagation(),s==="Tab"?(t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):s==="Escape"&&((n=Gt(this,Ca))==null||n.focus(),this.open=!1))};qt.getTemplateHTML=up;qt.getSlotTemplateHTML=cp;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",qt);var As=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Z=(t,e,i)=>(As(t,e,"read from private field"),i?i.call(t):e.get(t)),re=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},St=(t,e,i,a)=>(As(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Re=(t,e,i)=>(As(t,e,"access private method"),i),We,on,Qr,Xr,Le,rn,Jr,jr,en,ys,$u,tn,fs,an,vs,nn,Ts,Es,Wu,bs,Fu,gs,Vu,_s,Ku,Gu=h.createElement("template");Gu.innerHTML=`
351
+ `}var Ia={OPEN:"open",ANCHOR:"anchor"},qt=class extends d.HTMLElement{constructor(){super(),ct(this,Zr),ct(this,ss),ct(this,ls),ct(this,ds),ct(this,us),ct(this,cs),ct(this,zr,!1),ct(this,Ca,null),ct(this,Yt,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Ia.OPEN,Ia.ANCHOR]}get open(){return S(this,Ia.OPEN)}set open(e){I(this,Ia.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Kt(this,ds,Hu).call(this,e);break;case"focusout":Kt(this,us,$u).call(this,e);break;case"keydown":Kt(this,cs,Wu).call(this,e);break}}connectedCallback(){Kt(this,Zr,os).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,a){Kt(this,Zr,os).call(this),e===Ia.OPEN&&a!==t&&(this.open?Kt(this,ss,Uu).call(this):Kt(this,ls,Bu).call(this))}focus(){hs(this,Ca,fa());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),t=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||t)return;let a=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');a==null||a.focus()}get keysUsed(){return["Escape","Tab"]}};zr=new WeakMap;Ca=new WeakMap;Yt=new WeakMap;Zr=new WeakSet;os=function(){if(!Gt(this,zr)&&(hs(this,zr,!0),!this.shadowRoot)){this.attachShadow({mode:"open"});let i=zd(this.attributes);this.shadowRoot.innerHTML=`
352
+ ${this.constructor.getTemplateHTML(i)}
353
+ `,queueMicrotask(()=>{let{style:e}=W(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};ss=new WeakSet;Uu=function(){var i;(i=Gt(this,Yt))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};ls=new WeakSet;Bu=function(){var i;(i=Gt(this,Yt))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};ds=new WeakSet;Hu=function(i){hs(this,Yt,i.relatedTarget),le(this,i.relatedTarget)||(this.open=!this.open)};us=new WeakSet;$u=function(i){var e;le(this,i.relatedTarget)||((e=Gt(this,Ca))==null||e.focus(),Gt(this,Yt)&&Gt(this,Yt)!==i.relatedTarget&&this.open&&(this.open=!1))};cs=new WeakSet;Wu=function(i){var e,t,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=i;l||u||c||this.keysUsed.includes(s)&&(i.preventDefault(),i.stopPropagation(),s==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):s==="Escape"&&((n=Gt(this,Ca))==null||n.focus(),this.open=!1))};qt.getTemplateHTML=cp;qt.getSlotTemplateHTML=mp;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",qt);var _s=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Z=(i,e,t)=>(_s(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)},St=(i,e,t,a)=>(_s(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Le=(i,e,t)=>(_s(i,e,"access private method"),t),We,on,Qr,Xr,Re,rn,Jr,jr,en,As,Fu,tn,ps,an,fs,nn,Ts,vs,Vu,Es,Ku,bs,Gu,gs,Yu,qu=h.createElement("template");qu.innerHTML=`
348
354
  <style>
349
355
  :host {
350
356
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -361,7 +367,7 @@
361
367
  position: relative;
362
368
  width: 100px;
363
369
  transition: background .15s linear;
364
- cursor: pointer;
370
+ cursor: var(--media-cursor, pointer);
365
371
  pointer-events: auto;
366
372
  touch-action: none;
367
373
  }
@@ -413,7 +419,7 @@
413
419
  height: var(--media-time-range-hover-height, max(100% + 7px, 25px));
414
420
  width: 100%;
415
421
  position: absolute;
416
- cursor: pointer;
422
+ cursor: var(--media-cursor, pointer);
417
423
 
418
424
  -webkit-appearance: none;
419
425
  -webkit-tap-highlight-color: transparent;
@@ -510,7 +516,7 @@
510
516
  translate: -50%;
511
517
  position: absolute;
512
518
  left: 0;
513
- cursor: pointer;
519
+ cursor: var(--media-cursor, pointer);
514
520
  }
515
521
 
516
522
  #thumb {
@@ -572,7 +578,7 @@
572
578
  <input id="range" type="range" min="0" max="1" step="any" value="0">
573
579
  </div>
574
580
  <div id="rightgap"></div>
575
- `;var Zt=class extends d.HTMLElement{constructor(){super(),re(this,ys),re(this,tn),re(this,an),re(this,nn),re(this,Es),re(this,bs),re(this,gs),re(this,_s),re(this,We,void 0),re(this,on,void 0),re(this,Qr,void 0),re(this,Xr,void 0),re(this,Le,{}),re(this,rn,[]),re(this,Jr,()=>{if(this.range.matches(":focus-visible")){let{style:e}=W(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),re(this,jr,()=>{let{style:e}=W(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),re(this,en,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Gu.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),St(this,Qr,this.shadowRoot.querySelector("#startpoint")),St(this,Xr,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",R.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER?(i&&((n=(r=Z(this,We))==null?void 0:r.unassociateElement)==null||n.call(r,this),St(this,We,null)),a&&this.isConnected&&(St(this,We,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Z(this,We))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),Re(this,tn,fs).call(this)):(this.range.setAttribute(e,a),Re(this,an,vs).call(this)))}connectedCallback(){var e,i,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),Z(this,Le).pointer=W(this.shadowRoot,"#pointer"),Z(this,Le).progress=W(this.shadowRoot,"#progress"),Z(this,Le).thumb=W(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),Z(this,Le).activeSegment=W(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(R.MEDIA_CONTROLLER);n&&(St(this,We,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=Z(this,We))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Z(this,Jr)),this.shadowRoot.addEventListener("focusout",Z(this,jr)),Re(this,tn,fs).call(this),ot(this.container,Z(this,en))}disconnectedCallback(){var e,i;Re(this,an,vs).call(this),(i=(e=Z(this,We))==null?void 0:e.unassociateElement)==null||i.call(e,this),St(this,We,null),this.shadowRoot.removeEventListener("focusin",Z(this,Jr)),this.shadowRoot.removeEventListener("focusout",Z(this,jr)),st(this.container,Z(this,en))}updatePointerBar(e){var i;(i=Z(this,Le).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=Z(this,Le).progress)==null||e.style.setProperty("width",`${a}%`),(i=Z(this,Le).thumb)==null||i.style.setProperty("left",`${a}%`)}updateSegments(e){let i=this.shadowRoot.querySelector("#segments-clipping");if(i.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let a=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];St(this,rn,[...a]);let r=a.pop();for(let[n,s]of a.entries()){let[l,u]=[n===0,n===a.length-1],c=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,_=`calc(${((u?r:a[n+1])-s)*100}%${l||u?"":" - var(--segments-gap)"})`,v=h.createElementNS("http://www.w3.org/2000/svg","rect"),E=W(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);E.style.setProperty("x",c),E.style.setProperty("width",_),i.append(v)}}getPointerRatio(e){let i=Zd(e.clientX,e.clientY,Z(this,Qr).getBoundingClientRect(),Z(this,Xr).getBoundingClientRect());return Math.max(0,Math.min(1,i))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Re(this,_s,Ku).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Re(this,Es,Wu).call(this,e);break;case"pointerdown":Re(this,nn,Ts).call(this,e);break;case"pointerup":Re(this,bs,Fu).call(this);break;case"pointerleave":Re(this,gs,Vu).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};We=new WeakMap;on=new WeakMap;Qr=new WeakMap;Xr=new WeakMap;Le=new WeakMap;rn=new WeakMap;Jr=new WeakMap;jr=new WeakMap;en=new WeakMap;ys=new WeakSet;$u=function(t){let e=Z(this,Le).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${Z(this,rn).findIndex((n,s,l)=>{let u=l[s+1];return u!=null&&i>=n&&i<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};tn=new WeakSet;fs=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};an=new WeakSet;vs=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(t=d.window)==null||t.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};nn=new WeakSet;Ts=function(t){var e;St(this,on,t.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};Es=new WeakSet;Wu=function(t){var e;t.pointerType!=="mouse"&&Re(this,nn,Ts).call(this,t),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};bs=new WeakSet;Fu=function(){var t;(t=d.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};gs=new WeakSet;Vu=function(){var t,e;this.removeEventListener("pointerleave",this),(t=d.window)==null||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=Z(this,Le).activeSegment)==null||e.style.removeProperty("transform")};_s=new WeakSet;Ku=function(t){this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),Re(this,ys,$u).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!Z(this,on))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",Zt);var Yu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},sn=(t,e,i)=>(Yu(t,e,"read from private field"),i?i.call(t):e.get(t)),mp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ln=(t,e,i,a)=>(Yu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fe,qu=h.createElement("template");qu.innerHTML=`
581
+ `;var Zt=class extends d.HTMLElement{constructor(){super(),re(this,As),re(this,tn),re(this,an),re(this,nn),re(this,vs),re(this,Es),re(this,bs),re(this,gs),re(this,We,void 0),re(this,on,void 0),re(this,Qr,void 0),re(this,Xr,void 0),re(this,Re,{}),re(this,rn,[]),re(this,Jr,()=>{if(this.range.matches(":focus-visible")){let{style:e}=W(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),re(this,jr,()=>{let{style:e}=W(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),re(this,en,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(qu.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),St(this,Qr,this.shadowRoot.querySelector("#startpoint")),St(this,Xr,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",L.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===L.MEDIA_CONTROLLER?(t&&((n=(r=Z(this,We))==null?void 0:r.unassociateElement)==null||n.call(r,this),St(this,We,null)),a&&this.isConnected&&(St(this,We,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Z(this,We))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?(this.range.removeAttribute(e),Le(this,tn,ps).call(this)):(this.range.setAttribute(e,a),Le(this,an,fs).call(this)))}connectedCallback(){var e,t,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),Z(this,Re).pointer=W(this.shadowRoot,"#pointer"),Z(this,Re).progress=W(this.shadowRoot,"#progress"),Z(this,Re).thumb=W(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),Z(this,Re).activeSegment=W(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(L.MEDIA_CONTROLLER);n&&(St(this,We,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=Z(this,We))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Z(this,Jr)),this.shadowRoot.addEventListener("focusout",Z(this,jr)),Le(this,tn,ps).call(this),ot(this.container,Z(this,en))}disconnectedCallback(){var e,t;Le(this,an,fs).call(this),(t=(e=Z(this,We))==null?void 0:e.unassociateElement)==null||t.call(e,this),St(this,We,null),this.shadowRoot.removeEventListener("focusin",Z(this,Jr)),this.shadowRoot.removeEventListener("focusout",Z(this,jr)),st(this.container,Z(this,en))}updatePointerBar(e){var t;(t=Z(this,Re).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let a=this.range.valueAsNumber*100;(e=Z(this,Re).progress)==null||e.style.setProperty("width",`${a}%`),(t=Z(this,Re).thumb)==null||t.style.setProperty("left",`${a}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let a=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];St(this,rn,[...a]);let r=a.pop();for(let[n,s]of a.entries()){let[l,u]=[n===0,n===a.length-1],c=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,_=`calc(${((u?r:a[n+1])-s)*100}%${l||u?"":" - var(--segments-gap)"})`,p=h.createElementNS("http://www.w3.org/2000/svg","rect"),E=W(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);E.style.setProperty("x",c),E.style.setProperty("width",_),t.append(p)}}getPointerRatio(e){return Qd(e.clientX,e.clientY,Z(this,Qr).getBoundingClientRect(),Z(this,Xr).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Le(this,gs,Yu).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Le(this,vs,Vu).call(this,e);break;case"pointerdown":Le(this,nn,Ts).call(this,e);break;case"pointerup":Le(this,Es,Ku).call(this);break;case"pointerleave":Le(this,bs,Gu).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};We=new WeakMap;on=new WeakMap;Qr=new WeakMap;Xr=new WeakMap;Re=new WeakMap;rn=new WeakMap;Jr=new WeakMap;jr=new WeakMap;en=new WeakMap;As=new WeakSet;Fu=function(i){let e=Z(this,Re).activeSegment;if(!e)return;let t=this.getPointerRatio(i),r=`#segments-clipping rect:nth-child(${Z(this,rn).findIndex((n,s,l)=>{let u=l[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))"))};tn=new WeakSet;ps=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};an=new WeakSet;fs=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=d.window)==null||i.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};nn=new WeakSet;Ts=function(i){var e;St(this,on,i.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};vs=new WeakSet;Vu=function(i){var e;i.pointerType!=="mouse"&&Le(this,nn,Ts).call(this,i),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};Es=new WeakSet;Ku=function(){var i;(i=d.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};bs=new WeakSet;Gu=function(){var i,e;this.removeEventListener("pointerleave",this),(i=d.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=Z(this,Re).activeSegment)==null||e.style.removeProperty("transform")};gs=new WeakSet;Yu=function(i){this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),Le(this,As,Fu).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!Z(this,on))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",Zt);var Zu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},sn=(i,e,t)=>(Zu(i,e,"read from private field"),t?t.call(i):e.get(i)),hp=(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)},ln=(i,e,t,a)=>(Zu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Fe,zu=h.createElement("template");zu.innerHTML=`
576
582
  <style>
577
583
  :host {
578
584
 
@@ -598,7 +604,7 @@
598
604
  </style>
599
605
 
600
606
  <slot></slot>
601
- `;var ks=class extends d.HTMLElement{constructor(){super(),mp(this,Fe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(qu.content.cloneNode(!0)))}static get observedAttributes(){return[R.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER&&(i&&((n=(r=sn(this,Fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),ln(this,Fe,null)),a&&this.isConnected&&(ln(this,Fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=sn(this,Fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(R.MEDIA_CONTROLLER);r&&(ln(this,Fe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=sn(this,Fe))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=sn(this,Fe))==null?void 0:e.unassociateElement)==null||i.call(e,this),ln(this,Fe,null)}};Fe=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",ks);var Zu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dn=(t,e,i)=>(Zu(t,e,"read from private field"),i?i.call(t):e.get(t)),hp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},un=(t,e,i,a)=>(Zu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ve,zu=h.createElement("template");zu.innerHTML=`
607
+ `;var ys=class extends d.HTMLElement{constructor(){super(),hp(this,Fe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(zu.content.cloneNode(!0)))}static get observedAttributes(){return[L.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===L.MEDIA_CONTROLLER&&(t&&((n=(r=sn(this,Fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),ln(this,Fe,null)),a&&this.isConnected&&(ln(this,Fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=sn(this,Fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(L.MEDIA_CONTROLLER);r&&(ln(this,Fe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=sn(this,Fe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=sn(this,Fe))==null?void 0:e.unassociateElement)==null||t.call(e,this),ln(this,Fe,null)}};Fe=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",ys);var Qu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},dn=(i,e,t)=>(Qu(i,e,"read from private field"),t?t.call(i):e.get(i)),pp=(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)=>(Qu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ve,Xu=h.createElement("template");Xu.innerHTML=`
602
608
  <style>
603
609
  :host {
604
610
  font: var(--media-font,
@@ -631,7 +637,7 @@
631
637
  }
632
638
  </style>
633
639
  <slot></slot>
634
- `;var xe=class extends d.HTMLElement{constructor(){super(),hp(this,Ve,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(zu.content.cloneNode(!0)))}static get observedAttributes(){return[R.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===R.MEDIA_CONTROLLER&&(i&&((n=(r=dn(this,Ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),un(this,Ve,null)),a&&this.isConnected&&(un(this,Ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=dn(this,Ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(R.MEDIA_CONTROLLER);n&&(un(this,Ve,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=dn(this,Ve))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=dn(this,Ve))==null?void 0:e.unassociateElement)==null||i.call(e,this),un(this,Ve,null)}};Ve=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",xe);var Xu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Qu=(t,e,i)=>(Xu(t,e,"read from private field"),i?i.call(t):e.get(t)),pp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},fp=(t,e,i,a)=>(Xu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ma,Ss=class extends xe{constructor(){super(),pp(this,Ma,void 0),fp(this,Ma,this.shadowRoot.querySelector("slot")),Qu(this,Ma).textContent=Pe(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===o.MEDIA_DURATION&&(Qu(this,Ma).textContent=Pe(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return x(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}};Ma=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Ss);var vp={2:f("Network Error"),3:f("Decode Error"),4:f("Source Not Supported"),5:f("Encryption Error")},Ep={2:f("A network error caused the media download to fail."),3:f("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:f("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:f("The media is encrypted and there are no keys to decrypt it.")},Is=t=>{var e,i;return t.code===1?null:{title:(e=vp[t.code])!=null?e:`Error ${t.code}`,message:(i=Ep[t.code])!=null?i:t.message}};var ju=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bp=(t,e,i)=>(ju(t,e,"read from private field"),i?i.call(t):e.get(t)),gp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},_p=(t,e,i,a)=>(ju(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),cn;function Ap(t){return`
640
+ `;var xe=class extends d.HTMLElement{constructor(){super(),pp(this,Ve,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Xu.content.cloneNode(!0)))}static get observedAttributes(){return[L.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===L.MEDIA_CONTROLLER&&(t&&((n=(r=dn(this,Ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),un(this,Ve,null)),a&&this.isConnected&&(un(this,Ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=dn(this,Ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(L.MEDIA_CONTROLLER);n&&(un(this,Ve,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=dn(this,Ve))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=dn(this,Ve))==null?void 0:e.unassociateElement)==null||t.call(e,this),un(this,Ve,null)}};Ve=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",xe);var ju=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ju=(i,e,t)=>(ju(i,e,"read from private field"),t?t.call(i):e.get(i)),fp=(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)},vp=(i,e,t,a)=>(ju(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ma,ks=class extends xe{constructor(){super(),fp(this,Ma,void 0),vp(this,Ma,this.shadowRoot.querySelector("slot")),Ju(this,Ma).textContent=Pe(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(Ju(this,Ma).textContent=Pe(+a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return x(this,o.MEDIA_DURATION)}set mediaDuration(e){N(this,o.MEDIA_DURATION,e)}};Ma=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",ks);var Ep={2:v("Network Error"),3:v("Decode Error"),4:v("Source Not Supported"),5:v("Encryption Error")},bp={2:v("A network error caused the media download to fail."),3:v("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:v("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:v("The media is encrypted and there are no keys to decrypt it.")},Ss=i=>{var e,t;return i.code===1?null:{title:(e=Ep[i.code])!=null?e:`Error ${i.code}`,message:(t=bp[i.code])!=null?t:i.message}};var tc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gp=(i,e,t)=>(tc(i,e,"read from private field"),t?t.call(i):e.get(i)),_p=(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)},Ap=(i,e,t,a)=>(tc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),cn;function Tp(i){return`
635
641
  <style>
636
642
  :host {
637
643
  background: rgb(20 20 30 / .8);
@@ -647,14 +653,14 @@
647
653
  margin-block: 0 .3em;
648
654
  }
649
655
  </style>
650
- <slot name="error-${t.mediaerrorcode}" id="content">
651
- ${ec({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
656
+ <slot name="error-${i.mediaerrorcode}" id="content">
657
+ ${ic({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
652
658
  </slot>
653
- `}function yp(t){return t.code&&Is(t)!==null}function ec(t){var e;let{title:i,message:a}=(e=Is(t))!=null?e:{},r="";return i&&(r+=`<slot name="error-${t.code}-title"><h3>${i}</h3></slot>`),a&&(r+=`<slot name="error-${t.code}-message"><p>${a}</p></slot>`),r}var Ju=[o.MEDIA_ERROR_CODE,o.MEDIA_ERROR_MESSAGE],Mi=class extends qt{constructor(){super(...arguments),gp(this,cn,null)}static get observedAttributes(){return[...super.observedAttributes,...Ju]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!Ju.includes(e))return;let n=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=yp(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return bp(this,cn)}set mediaError(e){_p(this,cn,e)}get mediaErrorCode(){return x(this,"mediaerrorcode")}set mediaErrorCode(e){O(this,"mediaerrorcode",e)}get mediaErrorMessage(){return C(this,"mediaerrormessage")}set mediaErrorMessage(e){M(this,"mediaerrormessage",e)}};cn=new WeakMap;Mi.getSlotTemplateHTML=Ap;Mi.formatErrorMessage=ec;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",Mi);var mn=Mi;var Tp=`<svg aria-hidden="true" viewBox="0 0 26 24">
659
+ `}function yp(i){return i.code&&Ss(i)!==null}function ic(i){var e;let{title:t,message:a}=(e=Ss(i))!=null?e:{},r="";return t&&(r+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),a&&(r+=`<slot name="error-${i.code}-message"><p>${a}</p></slot>`),r}var ec=[o.MEDIA_ERROR_CODE,o.MEDIA_ERROR_MESSAGE],Mi=class extends qt{constructor(){super(...arguments),_p(this,cn,null)}static get observedAttributes(){return[...super.observedAttributes,...ec]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,a){var r;if(super.attributeChangedCallback(e,t,a),!ec.includes(e))return;let n=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=yp(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return gp(this,cn)}set mediaError(e){Ap(this,cn,e)}get mediaErrorCode(){return x(this,"mediaerrorcode")}set mediaErrorCode(e){N(this,"mediaerrorcode",e)}get mediaErrorMessage(){return C(this,"mediaerrormessage")}set mediaErrorMessage(e){M(this,"mediaerrormessage",e)}};cn=new WeakMap;Mi.getSlotTemplateHTML=Tp;Mi.formatErrorMessage=ic;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",Mi);var mn=Mi;var kp=`<svg aria-hidden="true" viewBox="0 0 26 24">
654
660
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
655
- </svg>`,kp=`<svg aria-hidden="true" viewBox="0 0 26 24">
661
+ </svg>`,Sp=`<svg aria-hidden="true" viewBox="0 0 26 24">
656
662
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
657
- </svg>`,ic=h.createElement("template");ic.innerHTML=`
663
+ </svg>`,rc=h.createElement("template");rc.innerHTML=`
658
664
  <style>
659
665
  :host([${o.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
660
666
  display: none !important;
@@ -672,13 +678,13 @@
672
678
  </style>
673
679
 
674
680
  <slot name="icon">
675
- <slot name="enter">${Tp}</slot>
676
- <slot name="exit">${kp}</slot>
681
+ <slot name="enter">${kp}</slot>
682
+ <slot name="exit">${Sp}</slot>
677
683
  </slot>
678
- `;var Sp=`
679
- <slot name="tooltip-enter">${f("Enter fullscreen mode")}</slot>
680
- <slot name="tooltip-exit">${f("Exit fullscreen mode")}</slot>
681
- `,tc=t=>{let e=t.mediaIsFullscreen?f("exit fullscreen mode"):f("enter fullscreen mode");t.setAttribute("aria-label",e)},Cs=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:ic,tooltipContent:Sp,...e})}connectedCallback(){super.connectedCallback(),tc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_FULLSCREEN&&tc(this)}get mediaFullscreenUnavailable(){return C(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){M(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return k(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){S(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",Cs);var{MEDIA_TIME_IS_LIVE:hn,MEDIA_PAUSED:wa}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Ip,MEDIA_PLAY_REQUEST:Cp}=p,Mp='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',rc=h.createElement("template");rc.innerHTML=`
684
+ `;var Ip=`
685
+ <slot name="tooltip-enter">${v("Enter fullscreen mode")}</slot>
686
+ <slot name="tooltip-exit">${v("Exit fullscreen mode")}</slot>
687
+ `,ac=i=>{let e=i.mediaIsFullscreen?v("exit fullscreen mode"):v("enter fullscreen mode");i.setAttribute("aria-label",e)},Is=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:rc,tooltipContent:Ip,...e})}connectedCallback(){super.connectedCallback(),ac(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_FULLSCREEN&&ac(this)}get mediaFullscreenUnavailable(){return C(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){M(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return S(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){I(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?f.MEDIA_EXIT_FULLSCREEN_REQUEST:f.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",Is);var{MEDIA_TIME_IS_LIVE:hn,MEDIA_PAUSED:wa}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Cp,MEDIA_PLAY_REQUEST:Mp}=f,wp='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',oc=h.createElement("template");oc.innerHTML=`
682
688
  <style>
683
689
  :host { --media-tooltip-display: none; }
684
690
 
@@ -697,7 +703,7 @@
697
703
  }
698
704
 
699
705
  :host([${hn}]:not([${wa}])) {
700
- cursor: not-allowed;
706
+ cursor: var(--media-cursor, not-allowed);
701
707
  }
702
708
 
703
709
  slot[name=text]{
@@ -706,10 +712,10 @@
706
712
 
707
713
  </style>
708
714
 
709
- <slot name="indicator">${Mp}</slot>
715
+ <slot name="indicator">${wp}</slot>
710
716
 
711
- <slot name="spacer">&nbsp;</slot><slot name="text">${f("live")}</slot>
712
- `;var ac=t=>{let e=t.mediaPaused||!t.mediaTimeIsLive,i=e?f("seek to live"):f("playing live");t.setAttribute("aria-label",i),e?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},Ms=class extends V{static get observedAttributes(){return[...super.observedAttributes,wa,hn]}constructor(e={}){super({slotTemplate:rc,...e})}connectedCallback(){ac(this),super.connectedCallback()}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),ac(this)}get mediaPaused(){return k(this,o.MEDIA_PAUSED)}set mediaPaused(e){S(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return k(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){S(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Ip,{composed:!0,bubbles:!0})),this.hasAttribute(wa)&&this.dispatchEvent(new d.CustomEvent(Cp,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Ms);var oc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ra=(t,e,i)=>(oc(t,e,"read from private field"),i?i.call(t):e.get(t)),nc=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},La=(t,e,i,a)=>(oc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ke,fn,pn={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},sc=500,lc=h.createElement("template"),wp=`
717
+ <slot name="spacer">&nbsp;</slot><slot name="text">${v("live")}</slot>
718
+ `;var nc=i=>{let e=i.mediaPaused||!i.mediaTimeIsLive,t=e?v("seek to live"):v("playing live");i.setAttribute("aria-label",t),e?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},Cs=class extends K{static get observedAttributes(){return[...super.observedAttributes,wa,hn]}constructor(e={}){super({slotTemplate:oc,...e})}connectedCallback(){nc(this),super.connectedCallback()}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),nc(this)}get mediaPaused(){return S(this,o.MEDIA_PAUSED)}set mediaPaused(e){I(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return S(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){I(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Cp,{composed:!0,bubbles:!0})),this.hasAttribute(wa)&&this.dispatchEvent(new d.CustomEvent(Mp,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Cs);var lc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},La=(i,e,t)=>(lc(i,e,"read from private field"),t?t.call(i):e.get(i)),sc=(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)=>(lc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ke,fn,pn={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},dc=500,uc=h.createElement("template"),Lp=`
713
719
  <svg aria-hidden="true" viewBox="0 0 100 100">
714
720
  <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">
715
721
  <animateTransform
@@ -722,13 +728,13 @@
722
728
  repeatCount="indefinite" />
723
729
  </path>
724
730
  </svg>
725
- `;lc.innerHTML=`
731
+ `;uc.innerHTML=`
726
732
  <style>
727
733
  :host {
728
734
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
729
735
  vertical-align: middle;
730
736
  box-sizing: border-box;
731
- --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${sc}ms);
737
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${dc}ms);
732
738
  }
733
739
 
734
740
  #status {
@@ -767,15 +773,15 @@ svg, img, ::slotted(svg), ::slotted(img) {
767
773
  }
768
774
  </style>
769
775
 
770
- <slot name="icon">${wp}</slot>
771
- <div id="status" role="status" aria-live="polite">${f("media loading")}</div>
772
- `;var ws=class extends d.HTMLElement{constructor(){if(super(),nc(this,Ke,void 0),nc(this,fn,sc),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),i=lc.content.cloneNode(!0);e.appendChild(i)}}static get observedAttributes(){return[R.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,pn.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===pn.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===R.MEDIA_CONTROLLER&&(i&&((n=(r=Ra(this,Ke))==null?void 0:r.unassociateElement)==null||n.call(r,this),La(this,Ke,null)),a&&this.isConnected&&(La(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ra(this,Ke))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(R.MEDIA_CONTROLLER);r&&(La(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Ra(this,Ke))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Ra(this,Ke))==null?void 0:e.unassociateElement)==null||i.call(e,this),La(this,Ke,null)}get loadingDelay(){return Ra(this,fn)}set loadingDelay(e){La(this,fn,e);let{style:i}=W(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return k(this,o.MEDIA_PAUSED)}set mediaPaused(e){S(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,o.MEDIA_LOADING)}set mediaLoading(e){S(this,o.MEDIA_LOADING,e)}get mediaController(){return C(this,R.MEDIA_CONTROLLER)}set mediaController(e){M(this,R.MEDIA_CONTROLLER,e)}get noAutohide(){return k(this,pn.NO_AUTOHIDE)}set noAutohide(e){S(this,pn.NO_AUTOHIDE,e)}};Ke=new WeakMap;fn=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",ws);var{MEDIA_VOLUME_LEVEL:zt}=o,Rp=`<svg aria-hidden="true" viewBox="0 0 24 24">
776
+ <slot name="icon">${Lp}</slot>
777
+ <div id="status" role="status" aria-live="polite">${v("media loading")}</div>
778
+ `;var Ms=class extends d.HTMLElement{constructor(){if(super(),sc(this,Ke,void 0),sc(this,fn,dc),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),t=uc.content.cloneNode(!0);e.appendChild(t)}}static get observedAttributes(){return[L.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,pn.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===pn.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===L.MEDIA_CONTROLLER&&(t&&((n=(r=La(this,Ke))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ra(this,Ke,null)),a&&this.isConnected&&(Ra(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=La(this,Ke))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(L.MEDIA_CONTROLLER);r&&(Ra(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=La(this,Ke))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=La(this,Ke))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ra(this,Ke,null)}get loadingDelay(){return La(this,fn)}set loadingDelay(e){Ra(this,fn,e);let{style:t}=W(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return S(this,o.MEDIA_PAUSED)}set mediaPaused(e){I(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return S(this,o.MEDIA_LOADING)}set mediaLoading(e){I(this,o.MEDIA_LOADING,e)}get mediaController(){return C(this,L.MEDIA_CONTROLLER)}set mediaController(e){M(this,L.MEDIA_CONTROLLER,e)}get noAutohide(){return S(this,pn.NO_AUTOHIDE)}set noAutohide(e){I(this,pn.NO_AUTOHIDE,e)}};Ke=new WeakMap;fn=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",Ms);var{MEDIA_VOLUME_LEVEL:zt}=o,Rp=`<svg aria-hidden="true" viewBox="0 0 24 24">
773
779
  <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"/>
774
- </svg>`,dc=`<svg aria-hidden="true" viewBox="0 0 24 24">
780
+ </svg>`,cc=`<svg aria-hidden="true" viewBox="0 0 24 24">
775
781
  <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"/>
776
- </svg>`,Lp=`<svg aria-hidden="true" viewBox="0 0 24 24">
782
+ </svg>`,xp=`<svg aria-hidden="true" viewBox="0 0 24 24">
777
783
  <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"/>
778
- </svg>`,cc=h.createElement("template");cc.innerHTML=`
784
+ </svg>`,hc=h.createElement("template");hc.innerHTML=`
779
785
  <style>
780
786
 
781
787
  :host(:not([${zt}])) slot[name=icon] slot:not([name=high]),
@@ -803,16 +809,16 @@ svg, img, ::slotted(svg), ::slotted(img) {
803
809
 
804
810
  <slot name="icon">
805
811
  <slot name="off">${Rp}</slot>
806
- <slot name="low">${dc}</slot>
807
- <slot name="medium">${dc}</slot>
808
- <slot name="high">${Lp}</slot>
812
+ <slot name="low">${cc}</slot>
813
+ <slot name="medium">${cc}</slot>
814
+ <slot name="high">${xp}</slot>
809
815
  </slot>
810
- `;var xp=`
811
- <slot name="tooltip-mute">${f("Mute")}</slot>
812
- <slot name="tooltip-unmute">${f("Unmute")}</slot>
813
- `,uc=t=>{let i=t.mediaVolumeLevel==="off"?f("unmute"):f("mute");t.setAttribute("aria-label",i)},Rs=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:cc,tooltipContent:xp,...e})}connectedCallback(){uc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_VOLUME_LEVEL&&uc(this),super.attributeChangedCallback(e,i,a)}get mediaVolumeLevel(){return C(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){M(this,o.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",Rs);var mc=`<svg aria-hidden="true" viewBox="0 0 28 24">
816
+ `;var Dp=`
817
+ <slot name="tooltip-mute">${v("Mute")}</slot>
818
+ <slot name="tooltip-unmute">${v("Unmute")}</slot>
819
+ `,mc=i=>{let t=i.mediaVolumeLevel==="off"?v("unmute"):v("mute");i.setAttribute("aria-label",t)},ws=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:hc,tooltipContent:Dp,...e})}connectedCallback(){mc(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_VOLUME_LEVEL&&mc(this),super.attributeChangedCallback(e,t,a)}get mediaVolumeLevel(){return C(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){M(this,o.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?f.MEDIA_UNMUTE_REQUEST:f.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",ws);var pc=`<svg aria-hidden="true" viewBox="0 0 28 24">
814
820
  <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"/>
815
- </svg>`,pc=h.createElement("template");pc.innerHTML=`
821
+ </svg>`,vc=h.createElement("template");vc.innerHTML=`
816
822
  <style>
817
823
  :host([${o.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
818
824
  display: none !important;
@@ -830,13 +836,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
830
836
  </style>
831
837
 
832
838
  <slot name="icon">
833
- <slot name="enter">${mc}</slot>
834
- <slot name="exit">${mc}</slot>
839
+ <slot name="enter">${pc}</slot>
840
+ <slot name="exit">${pc}</slot>
835
841
  </slot>
836
- `;var Dp=`
837
- <slot name="tooltip-enter">${f("Enter picture in picture mode")}</slot>
838
- <slot name="tooltip-exit">${f("Exit picture in picture mode")}</slot>
839
- `,hc=t=>{let e=t.mediaIsPip?f("exit picture in picture mode"):f("enter picture in picture mode");t.setAttribute("aria-label",e)},Ls=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:pc,tooltipContent:Dp,...e})}connectedCallback(){hc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_IS_PIP&&hc(this),super.attributeChangedCallback(e,i,a)}get mediaPipUnavailable(){return C(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){M(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return k(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){S(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?p.MEDIA_EXIT_PIP_REQUEST:p.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",Ls);var Op=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},vn=(t,e,i)=>(Op(t,e,"read from private field"),i?i.call(t):e.get(t)),Np=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},wi,xs={RATES:"rates"},Os=[1,1.2,1.5,1.7,2],Ri=1,fc=h.createElement("template");fc.innerHTML=`
842
+ `;var Op=`
843
+ <slot name="tooltip-enter">${v("Enter picture in picture mode")}</slot>
844
+ <slot name="tooltip-exit">${v("Exit picture in picture mode")}</slot>
845
+ `,fc=i=>{let e=i.mediaIsPip?v("exit picture in picture mode"):v("enter picture in picture mode");i.setAttribute("aria-label",e)},Ls=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:vc,tooltipContent:Op,...e})}connectedCallback(){fc(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&fc(this),super.attributeChangedCallback(e,t,a)}get mediaPipUnavailable(){return C(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){M(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return S(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){I(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?f.MEDIA_EXIT_PIP_REQUEST:f.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",Ls);var Np=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},vn=(i,e,t)=>(Np(i,e,"read from private field"),t?t.call(i):e.get(i)),Pp=(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)},wi,Rs={RATES:"rates"},Ds=[1,1.2,1.5,1.7,2],Li=1,Ec=h.createElement("template");Ec.innerHTML=`
840
846
  <style>
841
847
  :host {
842
848
  min-width: 5ch;
@@ -844,11 +850,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
844
850
  }
845
851
  </style>
846
852
  <slot name="icon"></slot>
847
- `;var Ds=class extends V{constructor(e={}){super({slotTemplate:fc,tooltipContent:f("Playback rate"),...e}),Np(this,wi,new Be(this,xs.RATES,{defaultValue:Os})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Ri}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,xs.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===xs.RATES&&(vn(this,wi).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",f("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return vn(this,wi)}set rates(e){e?Array.isArray(e)&&(vn(this,wi).value=e.join(" ")):vn(this,wi).value=""}get mediaPlaybackRate(){return x(this,o.MEDIA_PLAYBACK_RATE,Ri)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,i;let a=Array.from(this.rates.values(),s=>+s).sort((s,l)=>s-l),r=(i=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?i:Ri,n=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};wi=new WeakMap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Ds);var Pp=`<svg aria-hidden="true" viewBox="0 0 24 24">
853
+ `;var xs=class extends K{constructor(e={}){super({slotTemplate:Ec,tooltipContent:v("Playback rate"),...e}),Pp(this,wi,new Be(this,Rs.RATES,{defaultValue:Ds})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Li}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Rs.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===Rs.RATES&&(vn(this,wi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Li:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",v("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return vn(this,wi)}set rates(e){e?Array.isArray(e)&&(vn(this,wi).value=e.join(" ")):vn(this,wi).value=""}get mediaPlaybackRate(){return x(this,o.MEDIA_PLAYBACK_RATE,Li)}set mediaPlaybackRate(e){N(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),s=>+s).sort((s,l)=>s-l),r=(t=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:Li,n=new d.CustomEvent(f.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};wi=new WeakMap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",xs);var Up=`<svg aria-hidden="true" viewBox="0 0 24 24">
848
854
  <path d="m6 21 15-9L6 3v18Z"/>
849
- </svg>`,Up=`<svg aria-hidden="true" viewBox="0 0 24 24">
855
+ </svg>`,Bp=`<svg aria-hidden="true" viewBox="0 0 24 24">
850
856
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
851
- </svg>`,Ec=h.createElement("template");Ec.innerHTML=`
857
+ </svg>`,gc=h.createElement("template");gc.innerHTML=`
852
858
  <style>
853
859
  :host([${o.MEDIA_PAUSED}]) slot[name=pause],
854
860
  :host(:not([${o.MEDIA_PAUSED}])) slot[name=play] {
@@ -862,13 +868,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
862
868
  </style>
863
869
 
864
870
  <slot name="icon">
865
- <slot name="play">${Pp}</slot>
866
- <slot name="pause">${Up}</slot>
871
+ <slot name="play">${Up}</slot>
872
+ <slot name="pause">${Bp}</slot>
867
873
  </slot>
868
- `;var Bp=`
869
- <slot name="tooltip-play">${f("Play")}</slot>
870
- <slot name="tooltip-pause">${f("Pause")}</slot>
871
- `,vc=t=>{let e=t.mediaPaused?f("play"):f("pause");t.setAttribute("aria-label",e)},Ns=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:Ec,tooltipContent:Bp,...e})}connectedCallback(){vc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_PAUSED&&vc(this),super.attributeChangedCallback(e,i,a)}get mediaPaused(){return k(this,o.MEDIA_PAUSED)}set mediaPaused(e){S(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",Ns);var Ge={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},bc=h.createElement("template");bc.innerHTML=`
874
+ `;var Hp=`
875
+ <slot name="tooltip-play">${v("Play")}</slot>
876
+ <slot name="tooltip-pause">${v("Pause")}</slot>
877
+ `,bc=i=>{let e=i.mediaPaused?v("play"):v("pause");i.setAttribute("aria-label",e)},Os=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:gc,tooltipContent:Hp,...e})}connectedCallback(){bc(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&bc(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return S(this,o.MEDIA_PAUSED)}set mediaPaused(e){I(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",Os);var Ge={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},_c=h.createElement("template");_c.innerHTML=`
872
878
  <style>
873
879
  :host {
874
880
  pointer-events: none;
@@ -890,7 +896,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
890
896
  </style>
891
897
 
892
898
  <img part="poster img" aria-hidden="true" id="image"/>
893
- `;var Hp=t=>{t.style.removeProperty("background-image")},$p=(t,e)=>{t.style["background-image"]=`url('${e}')`},Ps=class extends d.HTMLElement{static get observedAttributes(){return[Ge.PLACEHOLDER_SRC,Ge.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(bc.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,i,a){e===Ge.SRC&&(a==null?this.image.removeAttribute(Ge.SRC):this.image.setAttribute(Ge.SRC,a)),e===Ge.PLACEHOLDER_SRC&&(a==null?Hp(this.image):$p(this.image,a))}get placeholderSrc(){return C(this,Ge.PLACEHOLDER_SRC)}set placeholderSrc(e){M(this,Ge.SRC,e)}get src(){return C(this,Ge.SRC)}set src(e){M(this,Ge.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Ps);var gc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Wp=(t,e,i)=>(gc(t,e,"read from private field"),i?i.call(t):e.get(t)),Fp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Vp=(t,e,i,a)=>(gc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),En,Us=class extends xe{constructor(){super(),Fp(this,En,void 0),Vp(this,En,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PREVIEW_CHAPTER&&a!==i&&a!=null&&(Wp(this,En).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return C(this,o.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){M(this,o.MEDIA_PREVIEW_CHAPTER,e)}};En=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",Us);var _c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bn=(t,e,i)=>(_c(t,e,"read from private field"),i?i.call(t):e.get(t)),Kp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},gn=(t,e,i,a)=>(_c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ye,Ac=h.createElement("template");Ac.innerHTML=`
899
+ `;var $p=i=>{i.style.removeProperty("background-image")},Wp=(i,e)=>{i.style["background-image"]=`url('${e}')`},Ns=class extends d.HTMLElement{static get observedAttributes(){return[Ge.PLACEHOLDER_SRC,Ge.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(_c.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===Ge.SRC&&(a==null?this.image.removeAttribute(Ge.SRC):this.image.setAttribute(Ge.SRC,a)),e===Ge.PLACEHOLDER_SRC&&(a==null?$p(this.image):Wp(this.image,a))}get placeholderSrc(){return C(this,Ge.PLACEHOLDER_SRC)}set placeholderSrc(e){M(this,Ge.SRC,e)}get src(){return C(this,Ge.SRC)}set src(e){M(this,Ge.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Ns);var Ac=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fp=(i,e,t)=>(Ac(i,e,"read from private field"),t?t.call(i):e.get(i)),Vp=(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)},Kp=(i,e,t,a)=>(Ac(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),En,Ps=class extends xe{constructor(){super(),Vp(this,En,void 0),Kp(this,En,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PREVIEW_CHAPTER&&a!==t&&a!=null&&(Fp(this,En).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return C(this,o.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){M(this,o.MEDIA_PREVIEW_CHAPTER,e)}};En=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",Ps);var Tc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},bn=(i,e,t)=>(Tc(i,e,"read from private field"),t?t.call(i):e.get(i)),Gp=(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)},gn=(i,e,t,a)=>(Tc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ye,yc=h.createElement("template");yc.innerHTML=`
894
900
  <style>
895
901
  :host {
896
902
  box-sizing: border-box;
@@ -904,11 +910,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
904
910
  }
905
911
  </style>
906
912
  <img crossorigin loading="eager" decoding="async">
907
- `;var Bs=class extends d.HTMLElement{constructor(){super(),Kp(this,Ye,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ac.content.cloneNode(!0)))}static get observedAttributes(){return[R.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(R.MEDIA_CONTROLLER);r&&(gn(this,Ye,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=bn(this,Ye))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=bn(this,Ye))==null?void 0:e.unassociateElement)==null||i.call(e,this),gn(this,Ye,null)}attributeChangedCallback(e,i,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===R.MEDIA_CONTROLLER&&(i&&((n=(r=bn(this,Ye))==null?void 0:r.unassociateElement)==null||n.call(r,this),gn(this,Ye,null)),a&&this.isConnected&&(gn(this,Ye,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=bn(this,Ye))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return C(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(i=>+i)}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,i=this.mediaPreviewImage;if(!(e&&i))return;let[a,r,n,s]=e,l=i.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:A,minWidth:_,minHeight:v}=u,E=Math.min(parseInt(c)/n,parseInt(A)/s),P=Math.max(parseInt(_)/n,parseInt(v)/s),y=E<1,w=y?E:P>1?P:1,{style:U}=W(this.shadowRoot,":host"),J=W(this.shadowRoot,"img").style,be=this.shadowRoot.querySelector("img"),Et=y?"min":"max";U.setProperty(`${Et}-width`,"initial","important"),U.setProperty(`${Et}-height`,"initial","important"),U.width=`${n*w}px`,U.height=`${s*w}px`;let at=()=>{J.width=`${this.imgWidth*w}px`,J.height=`${this.imgHeight*w}px`,J.display="block"};be.src!==l&&(be.onload=()=>{this.imgWidth=be.naturalWidth,this.imgHeight=be.naturalHeight,at()},be.src=l,at()),at(),J.transform=`translate(-${a*w}px, -${r*w}px)`}};Ye=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Bs);var Tc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},yc=(t,e,i)=>(Tc(t,e,"read from private field"),i?i.call(t):e.get(t)),Gp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Yp=(t,e,i,a)=>(Tc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),xa,Hs=class extends xe{constructor(){super(),Gp(this,xa,void 0),Yp(this,xa,this.shadowRoot.querySelector("slot")),yc(this,xa).textContent=Pe(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PREVIEW_TIME&&a!=null&&(yc(this,xa).textContent=Pe(parseFloat(a)))}get mediaPreviewTime(){return x(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}};xa=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Hs);var Li={SEEK_OFFSET:"seekoffset"},_n=30,qp=`<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)">${_n}</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>`,kc=h.createElement("template");kc.innerHTML=`
908
- <slot name="icon">${qp}</slot>
909
- `;var Zp=0,$s=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Li.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:kc,tooltipContent:f("Seek backward"),...e})}connectedCallback(){this.seekOffset=x(this,Li.SEEK_OFFSET,_n),super.connectedCallback()}attributeChangedCallback(e,i,a){e===Li.SEEK_OFFSET&&(this.seekOffset=x(this,Li.SEEK_OFFSET,_n)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return x(this,Li.SEEK_OFFSET,_n)}set seekOffset(e){O(this,Li.SEEK_OFFSET,e),this.setAttribute("aria-label",f("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Sr(Ir(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return x(this,o.MEDIA_CURRENT_TIME,Zp)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",$s);var xi={SEEK_OFFSET:"seekoffset"},An=30,zp=`<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)">${An}</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>`,Sc=h.createElement("template");Sc.innerHTML=`
910
- <slot name="icon">${zp}</slot>
911
- `;var Qp=0,Ws=class extends V{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,xi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Sc,tooltipContent:f("Seek forward"),...e})}connectedCallback(){this.seekOffset=x(this,xi.SEEK_OFFSET,An),super.connectedCallback()}attributeChangedCallback(e,i,a){e===xi.SEEK_OFFSET&&(this.seekOffset=x(this,xi.SEEK_OFFSET,An)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return x(this,xi.SEEK_OFFSET,An)}set seekOffset(e){O(this,xi.SEEK_OFFSET,e),this.setAttribute("aria-label",f("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Sr(Ir(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return x(this,o.MEDIA_CURRENT_TIME,Qp)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,i=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",Ws);var wc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Fs=(t,e,i)=>(wc(t,e,"read from private field"),i?i.call(t):e.get(t)),Xp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Jp=(t,e,i,a)=>(wc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Di,De={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Ic=[...Object.values(De),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],Cc=["Enter"," "],jp="&nbsp;/&nbsp;",Mc=(t,{timesSep:e=jp}={})=>{var i,a;let r=t.hasAttribute(De.REMAINING),n=t.hasAttribute(De.SHOW_DURATION),s=(i=t.mediaCurrentTime)!=null?i:0,[,l]=(a=t.mediaSeekable)!=null?a:[],u=0;Number.isFinite(t.mediaDuration)?u=t.mediaDuration:Number.isFinite(l)&&(u=l);let c=r?Pe(0-(u-s)):Pe(s);return n?`${c}${e}${Pe(u)}`:c},ef="video not loaded, unknown time.",tf=t=>{var e;let i=t.mediaCurrentTime,[,a]=(e=t.mediaSeekable)!=null?e:[],r=null;if(Number.isFinite(t.mediaDuration)?r=t.mediaDuration:Number.isFinite(a)&&(r=a),i==null||r===null){t.setAttribute("aria-valuetext",ef);return}let n=t.hasAttribute(De.REMAINING),s=t.hasAttribute(De.SHOW_DURATION),l=n?Nt(0-(r-i)):Nt(i);if(!s){t.setAttribute("aria-valuetext",l);return}let u=Nt(r),c=`${l} of ${u}`;t.setAttribute("aria-valuetext",c)},Vs=class extends xe{constructor(){super(),Xp(this,Di,void 0),Jp(this,Di,this.shadowRoot.querySelector("slot")),Fs(this,Di).innerHTML=`${Mc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Ic,"disabled"]}connectedCallback(){let{style:e}=W(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",f("playback time"));let i=a=>{let{key:r}=a;if(!Cc.includes(r)){this.removeEventListener("keyup",i);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Cc.includes(s)){this.removeEventListener("keyup",i);return}this.addEventListener("keyup",i)}),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,i,a){Ic.includes(e)?this.update():e==="disabled"&&a!==i&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,i,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return k(this,De.REMAINING)}set remaining(e){S(this,De.REMAINING,e)}get showDuration(){return k(this,De.SHOW_DURATION)}set showDuration(e){S(this,De.SHOW_DURATION,e)}get noToggle(){return k(this,De.NO_TOGGLE)}set noToggle(e){S(this,De.NO_TOGGLE,e)}get mediaDuration(){return x(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(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(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Mc(this);tf(this),e!==Fs(this,Di).innerHTML&&(Fs(this,Di).innerHTML=e)}};Di=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",Vs);var Rc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ie=(t,e,i)=>(Rc(t,e,"read from private field"),i?i.call(t):e.get(t)),qe=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Se=(t,e,i,a)=>(Rc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),af=(t,e,i,a)=>({set _(r){Se(t,e,r,i)},get _(){return ie(t,e,a)}}),Oi,yn,Ni,Da,Tn,kn,Sn,Pi,Qt,In,Cn=class{constructor(e,i,a){qe(this,Oi,void 0),qe(this,yn,void 0),qe(this,Ni,void 0),qe(this,Da,void 0),qe(this,Tn,void 0),qe(this,kn,void 0),qe(this,Sn,void 0),qe(this,Pi,void 0),qe(this,Qt,0),qe(this,In,(r=performance.now())=>{Se(this,Qt,requestAnimationFrame(ie(this,In))),Se(this,Da,performance.now()-ie(this,Ni));let n=1e3/this.fps;if(ie(this,Da)>n){Se(this,Ni,r-ie(this,Da)%n);let s=1e3/((r-ie(this,yn))/++af(this,Tn)._),l=(r-ie(this,kn))/1e3/this.duration,u=ie(this,Sn)+l*this.playbackRate;u-ie(this,Oi).valueAsNumber>0?Se(this,Pi,this.playbackRate/this.duration/s):(Se(this,Pi,.995*ie(this,Pi)),u=ie(this,Oi).valueAsNumber+ie(this,Pi)),this.callback(u)}}),Se(this,Oi,e),this.callback=i,this.fps=a}start(){ie(this,Qt)===0&&(Se(this,Ni,performance.now()),Se(this,yn,ie(this,Ni)),Se(this,Tn,0),ie(this,In).call(this))}stop(){ie(this,Qt)!==0&&(cancelAnimationFrame(ie(this,Qt)),Se(this,Qt,0))}update({start:e,duration:i,playbackRate:a}){let r=e-ie(this,Oi).valueAsNumber,n=Math.abs(i-this.duration);(r>0||r<-.03||n>=.5)&&this.callback(e),Se(this,Sn,e),Se(this,kn,performance.now()),this.duration=i,this.playbackRate=a}};Oi=new WeakMap;yn=new WeakMap;Ni=new WeakMap;Da=new WeakMap;Tn=new WeakMap;kn=new WeakMap;Sn=new WeakMap;Pi=new WeakMap;Qt=new WeakMap;In=new WeakMap;var Zs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},j=(t,e,i)=>(Zs(t,e,"read from private field"),i?i.call(t):e.get(t)),ae=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ze=(t,e,i,a)=>(Zs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),oe=(t,e,i)=>(Zs(t,e,"access private method"),i),Ui,Xt,Rn,Na,Ln,wn,Pa,Ua,Bi,Hi,Oa,zs,Lc,Ks,xn,Qs,Dn,Xs,On,Js,Gs,xc,Ba,Nn,Ys,Dc,rf="video not loaded, unknown time.",nf=t=>{let e=t.range,i=Nt(+Nc(t)),a=Nt(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:rf;e.setAttribute("aria-valuetext",r)},Oc=h.createElement("template");Oc.innerHTML=`
913
+ `;var Us=class extends d.HTMLElement{constructor(){super(),Gp(this,Ye,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(yc.content.cloneNode(!0)))}static get observedAttributes(){return[L.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(L.MEDIA_CONTROLLER);r&&(gn(this,Ye,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=bn(this,Ye))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=bn(this,Ye))==null?void 0:e.unassociateElement)==null||t.call(e,this),gn(this,Ye,null)}attributeChangedCallback(e,t,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===L.MEDIA_CONTROLLER&&(t&&((n=(r=bn(this,Ye))==null?void 0:r.unassociateElement)==null||n.call(r,this),gn(this,Ye,null)),a&&this.isConnected&&(gn(this,Ye,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=bn(this,Ye))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return C(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(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,l=t.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:T,minWidth:_,minHeight:p}=u,E=Math.min(parseInt(c)/n,parseInt(T)/s),P=Math.max(parseInt(_)/n,parseInt(p)/s),y=E<1,w=y?E:P>1?P:1,{style:U}=W(this.shadowRoot,":host"),J=W(this.shadowRoot,"img").style,be=this.shadowRoot.querySelector("img"),Et=y?"min":"max";U.setProperty(`${Et}-width`,"initial","important"),U.setProperty(`${Et}-height`,"initial","important"),U.width=`${n*w}px`,U.height=`${s*w}px`;let at=()=>{J.width=`${this.imgWidth*w}px`,J.height=`${this.imgHeight*w}px`,J.display="block"};be.src!==l&&(be.onload=()=>{this.imgWidth=be.naturalWidth,this.imgHeight=be.naturalHeight,at()},be.src=l,at()),at(),J.transform=`translate(-${a*w}px, -${r*w}px)`}};Ye=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Us);var Sc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},kc=(i,e,t)=>(Sc(i,e,"read from private field"),t?t.call(i):e.get(i)),Yp=(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)},qp=(i,e,t,a)=>(Sc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),xa,Bs=class extends xe{constructor(){super(),Yp(this,xa,void 0),qp(this,xa,this.shadowRoot.querySelector("slot")),kc(this,xa).textContent=Pe(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&&(kc(this,xa).textContent=Pe(parseFloat(a)))}get mediaPreviewTime(){return x(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){N(this,o.MEDIA_PREVIEW_TIME,e)}};xa=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Bs);var Ri={SEEK_OFFSET:"seekoffset"},_n=30,Zp=`<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)">${_n}</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>`,Ic=h.createElement("template");Ic.innerHTML=`
914
+ <slot name="icon">${Zp}</slot>
915
+ `;var zp=0,Hs=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Ri.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Ic,tooltipContent:v("Seek backward"),...e})}connectedCallback(){this.seekOffset=x(this,Ri.SEEK_OFFSET,_n),super.connectedCallback()}attributeChangedCallback(e,t,a){e===Ri.SEEK_OFFSET&&(this.seekOffset=x(this,Ri.SEEK_OFFSET,_n)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return x(this,Ri.SEEK_OFFSET,_n)}set seekOffset(e){N(this,Ri.SEEK_OFFSET,e),this.setAttribute("aria-label",v("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Sr(Ir(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return x(this,o.MEDIA_CURRENT_TIME,zp)}set mediaCurrentTime(e){N(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new d.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Hs);var xi={SEEK_OFFSET:"seekoffset"},An=30,Qp=`<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)">${An}</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>`,Cc=h.createElement("template");Cc.innerHTML=`
916
+ <slot name="icon">${Qp}</slot>
917
+ `;var Xp=0,$s=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,xi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Cc,tooltipContent:v("Seek forward"),...e})}connectedCallback(){this.seekOffset=x(this,xi.SEEK_OFFSET,An),super.connectedCallback()}attributeChangedCallback(e,t,a){e===xi.SEEK_OFFSET&&(this.seekOffset=x(this,xi.SEEK_OFFSET,An)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return x(this,xi.SEEK_OFFSET,An)}set seekOffset(e){N(this,xi.SEEK_OFFSET,e),this.setAttribute("aria-label",v("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Sr(Ir(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return x(this,o.MEDIA_CURRENT_TIME,Xp)}set mediaCurrentTime(e){N(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new d.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",$s);var Rc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ws=(i,e,t)=>(Rc(i,e,"read from private field"),t?t.call(i):e.get(i)),Jp=(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)},jp=(i,e,t,a)=>(Rc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Di,De={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Mc=[...Object.values(De),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],wc=["Enter"," "],ef="&nbsp;/&nbsp;",Lc=(i,{timesSep:e=ef}={})=>{var t,a;let r=i.hasAttribute(De.REMAINING),n=i.hasAttribute(De.SHOW_DURATION),s=(t=i.mediaCurrentTime)!=null?t:0,[,l]=(a=i.mediaSeekable)!=null?a:[],u=0;Number.isFinite(i.mediaDuration)?u=i.mediaDuration:Number.isFinite(l)&&(u=l);let c=r?Pe(0-(u-s)):Pe(s);return n?`${c}${e}${Pe(u)}`:c},tf="video not loaded, unknown time.",af=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=null;if(Number.isFinite(i.mediaDuration)?r=i.mediaDuration:Number.isFinite(a)&&(r=a),t==null||r===null){i.setAttribute("aria-valuetext",tf);return}let n=i.hasAttribute(De.REMAINING),s=i.hasAttribute(De.SHOW_DURATION),l=n?Nt(0-(r-t)):Nt(t);if(!s){i.setAttribute("aria-valuetext",l);return}let u=Nt(r),c=`${l} of ${u}`;i.setAttribute("aria-valuetext",c)},Fs=class extends xe{constructor(){super(),Jp(this,Di,void 0),jp(this,Di,this.shadowRoot.querySelector("slot")),Ws(this,Di).innerHTML=`${Lc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Mc,"disabled"]}connectedCallback(){let{style:e}=W(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-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",v("playback time"));let t=a=>{let{key:r}=a;if(!wc.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!wc.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){Mc.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 S(this,De.REMAINING)}set remaining(e){I(this,De.REMAINING,e)}get showDuration(){return S(this,De.SHOW_DURATION)}set showDuration(e){I(this,De.SHOW_DURATION,e)}get noToggle(){return S(this,De.NO_TOGGLE)}set noToggle(e){I(this,De.NO_TOGGLE,e)}get mediaDuration(){return x(this,o.MEDIA_DURATION)}set mediaDuration(e){N(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){N(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=Lc(this);af(this),e!==Ws(this,Di).innerHTML&&(Ws(this,Di).innerHTML=e)}};Di=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",Fs);var xc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ie=(i,e,t)=>(xc(i,e,"read from private field"),t?t.call(i):e.get(i)),qe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Se=(i,e,t,a)=>(xc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),rf=(i,e,t,a)=>({set _(r){Se(i,e,r,t)},get _(){return ie(i,e,a)}}),Oi,Tn,Ni,Da,yn,kn,Sn,Pi,Qt,In,Cn=class{constructor(e,t,a){qe(this,Oi,void 0),qe(this,Tn,void 0),qe(this,Ni,void 0),qe(this,Da,void 0),qe(this,yn,void 0),qe(this,kn,void 0),qe(this,Sn,void 0),qe(this,Pi,void 0),qe(this,Qt,0),qe(this,In,(r=performance.now())=>{Se(this,Qt,requestAnimationFrame(ie(this,In))),Se(this,Da,performance.now()-ie(this,Ni));let n=1e3/this.fps;if(ie(this,Da)>n){Se(this,Ni,r-ie(this,Da)%n);let s=1e3/((r-ie(this,Tn))/++rf(this,yn)._),l=(r-ie(this,kn))/1e3/this.duration,u=ie(this,Sn)+l*this.playbackRate;u-ie(this,Oi).valueAsNumber>0?Se(this,Pi,this.playbackRate/this.duration/s):(Se(this,Pi,.995*ie(this,Pi)),u=ie(this,Oi).valueAsNumber+ie(this,Pi)),this.callback(u)}}),Se(this,Oi,e),this.callback=t,this.fps=a}start(){ie(this,Qt)===0&&(Se(this,Ni,performance.now()),Se(this,Tn,ie(this,Ni)),Se(this,yn,0),ie(this,In).call(this))}stop(){ie(this,Qt)!==0&&(cancelAnimationFrame(ie(this,Qt)),Se(this,Qt,0))}update({start:e,duration:t,playbackRate:a}){let r=e-ie(this,Oi).valueAsNumber,n=Math.abs(t-this.duration);(r>0||r<-.03||n>=.5)&&this.callback(e),Se(this,Sn,e),Se(this,kn,performance.now()),this.duration=t,this.playbackRate=a}};Oi=new WeakMap;Tn=new WeakMap;Ni=new WeakMap;Da=new WeakMap;yn=new WeakMap;kn=new WeakMap;Sn=new WeakMap;Pi=new WeakMap;Qt=new WeakMap;In=new WeakMap;var qs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},j=(i,e,t)=>(qs(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)},Ze=(i,e,t,a)=>(qs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),oe=(i,e,t)=>(qs(i,e,"access private method"),t),Ui,Xt,Ln,Na,Rn,wn,Pa,Ua,Bi,Hi,Oa,Zs,Dc,Vs,xn,zs,Dn,Qs,On,Xs,Ks,Oc,Ba,Nn,Gs,Nc,nf="video not loaded, unknown time.",of=i=>{let e=i.range,t=Nt(+Uc(i)),a=Nt(+i.mediaSeekableEnd),r=t&&a?`${t} of ${a}`:nf;e.setAttribute("aria-valuetext",r)},Pc=h.createElement("template");Pc.innerHTML=`
912
918
  <style>
913
919
  :host {
914
920
  --media-box-border-radius: 4px;
@@ -1121,7 +1127,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1121
1127
 
1122
1128
  </slot>
1123
1129
  </div>
1124
- `;var Mn=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},Nc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},qs=class extends Zt{constructor(){super(),ae(this,Hi),ae(this,zs),ae(this,xn),ae(this,Dn),ae(this,On),ae(this,Gs),ae(this,Ba),ae(this,Ys),ae(this,Ui,void 0),ae(this,Xt,void 0),ae(this,Rn,void 0),ae(this,Na,void 0),ae(this,Ln,void 0),ae(this,wn,void 0),ae(this,Pa,void 0),ae(this,Ua,void 0),ae(this,Bi,void 0),ae(this,Ks,a=>{this.dragging||(vi(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.container.appendChild(Oc.content.cloneNode(!0)),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ze(this,Rn,this.shadowRoot.querySelectorAll('[part~="box"]')),Ze(this,Ln,this.shadowRoot.querySelector('[part~="preview-box"]')),Ze(this,wn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);Ze(this,Pa,parseInt(i.getPropertyValue("--media-box-padding-left"))),Ze(this,Ua,parseInt(i.getPropertyValue("--media-box-padding-right"))),Ze(this,Xt,new Cn(this.range,j(this,Ks),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",f("seek")),oe(this,Hi,Oa).call(this),Ze(this,Ui,this.getRootNode()),(e=j(this,Ui))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),oe(this,Hi,Oa).call(this),(e=j(this,Ui))==null||e.removeEventListener("transitionstart",this),Ze(this,Ui,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=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?(j(this,Xt).update({start:Mn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),oe(this,Hi,Oa).call(this),nf(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=j(this,Bi),this.updateBar()))}get mediaChaptersCues(){return j(this,Bi)}set mediaChaptersCues(e){var i;Ze(this,Bi,e),this.updateSegments((i=j(this,Bi))==null?void 0:i.map(a=>({start:Mn(this,a.startTime),end:Mn(this,a.endTime)})))}get mediaPaused(){return k(this,o.MEDIA_PAUSED)}set mediaPaused(e){S(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,o.MEDIA_LOADING)}set mediaLoading(e){S(this,o.MEDIA_LOADING,e)}get mediaDuration(){return x(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return x(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(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(o.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return C(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return x(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,o.MEDIA_ENDED)}set mediaEnded(e){S(this,o.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let n=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([l,u])=>l<=n&&n<=u))!=null?e:[];a=Mn(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=oe(this,xn,Qs).call(this,j(this,wn)),n=oe(this,Dn,Xs).call(this,r,this.range.valueAsNumber),s=oe(this,On,Js).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${n})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":oe(this,Ys,Dc).call(this);break;case"pointermove":oe(this,Gs,xc).call(this,e);break;case"pointerup":case"pointerleave":oe(this,Ba,Nn).call(this,null);break;case"transitionstart":le(e.target,this)&&setTimeout(()=>oe(this,Hi,Oa).call(this),0);break}}};Ui=new WeakMap;Xt=new WeakMap;Rn=new WeakMap;Na=new WeakMap;Ln=new WeakMap;wn=new WeakMap;Pa=new WeakMap;Ua=new WeakMap;Bi=new WeakMap;Hi=new WeakSet;Oa=function(){oe(this,zs,Lc).call(this)?j(this,Xt).start():j(this,Xt).stop()};zs=new WeakSet;Lc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Cr(this)};Ks=new WeakMap;xn=new WeakSet;Qs=function(t){var e;let a=((e=this.getAttribute("bounds")?Ue(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),n=t.offsetWidth,s=-(r.left-a.left-n/2),l=a.right-r.left-n/2;return{box:{width:n,min:s,max:l},bounds:a,range:r}};Dn=new WeakSet;Xs=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:n}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;i=`min(${i}, ${l})`}return i};On=new WeakSet;Js=function(t,e){let{width:i,min:a,max:r}=t.box,n=e*t.range.width;if(n<a+j(this,Pa)){let s=t.range.left-t.bounds.left-j(this,Pa);return`${n-i/2+s}px`}if(n>r-j(this,Ua)){let s=t.bounds.right-t.range.right-j(this,Ua);return`${n+i/2-s-t.range.width}px`}return 0};Gs=new WeakSet;xc=function(t){let e=[...j(this,Rn)].some(A=>t.composedPath().includes(A));if(!this.dragging&&(e||!t.composedPath().includes(this))){oe(this,Ba,Nn).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),n=oe(this,xn,Qs).call(this,j(this,Ln)),s=(t.clientX-n.range.left)/n.range.width;s=Math.max(0,Math.min(1,s));let l=oe(this,Dn,Xs).call(this,n,s),u=oe(this,On,Js).call(this,n,s);a.style.transform=`translateX(${l})`,a.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${n.box.width}px`);let c=Math.round(j(this,Na))-Math.round(s*i);Math.abs(c)<1&&s>.01&&s<.99||(Ze(this,Na,s*i),oe(this,Ba,Nn).call(this,j(this,Na)))};Ba=new WeakSet;Nn=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Ys=new WeakSet;Dc=function(){j(this,Xt).stop();let t=Nc(this);this.dispatchEvent(new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",qs);var $i={PLACEMENT:"placement",BOUNDS:"bounds"},Pc=h.createElement("template");Pc.innerHTML=`
1130
+ `;var Mn=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,a=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-t)/(a-t);return Math.max(0,Math.min(r,1))},Uc=(i,e=i.range.valueAsNumber)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,a=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-t)+t},Ys=class extends Zt{constructor(){super(),ae(this,Hi),ae(this,Zs),ae(this,xn),ae(this,Dn),ae(this,On),ae(this,Ks),ae(this,Ba),ae(this,Gs),ae(this,Ui,void 0),ae(this,Xt,void 0),ae(this,Ln,void 0),ae(this,Na,void 0),ae(this,Rn,void 0),ae(this,wn,void 0),ae(this,Pa,void 0),ae(this,Ua,void 0),ae(this,Bi,void 0),ae(this,Vs,a=>{this.dragging||(vi(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.container.appendChild(Pc.content.cloneNode(!0)),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ze(this,Ln,this.shadowRoot.querySelectorAll('[part~="box"]')),Ze(this,Rn,this.shadowRoot.querySelector('[part~="preview-box"]')),Ze(this,wn,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Ze(this,Pa,parseInt(t.getPropertyValue("--media-box-padding-left"))),Ze(this,Ua,parseInt(t.getPropertyValue("--media-box-padding-right"))),Ze(this,Xt,new Cn(this.range,j(this,Vs),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",v("seek")),oe(this,Hi,Oa).call(this),Ze(this,Ui,this.getRootNode()),(e=j(this,Ui))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),oe(this,Hi,Oa).call(this),(e=j(this,Ui))==null||e.removeEventListener("transitionstart",this),Ze(this,Ui,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?(j(this,Xt).update({start:Mn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),oe(this,Hi,Oa).call(this),of(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=j(this,Bi),this.updateBar()))}get mediaChaptersCues(){return j(this,Bi)}set mediaChaptersCues(e){var t;Ze(this,Bi,e),this.updateSegments((t=j(this,Bi))==null?void 0:t.map(a=>({start:Mn(this,a.startTime),end:Mn(this,a.endTime)})))}get mediaPaused(){return S(this,o.MEDIA_PAUSED)}set mediaPaused(e){I(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return S(this,o.MEDIA_LOADING)}set mediaLoading(e){I(this,o.MEDIA_LOADING,e)}get mediaDuration(){return x(this,o.MEDIA_DURATION)}set mediaDuration(e){N(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){N(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return x(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){N(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 C(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return x(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){N(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return S(this,o.MEDIA_ENDED)}set mediaEnded(e){I(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(([l,u])=>l<=n&&n<=u))!=null?e:[];a=Mn(this,s)}let{style:r}=W(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=W(this.shadowRoot,"#current-rail"),a=W(this.shadowRoot,'[part~="current-box"]'),r=oe(this,xn,zs).call(this,j(this,wn)),n=oe(this,Dn,Qs).call(this,r,this.range.valueAsNumber),s=oe(this,On,Xs).call(this,r,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":oe(this,Gs,Nc).call(this);break;case"pointermove":oe(this,Ks,Oc).call(this,e);break;case"pointerup":case"pointerleave":oe(this,Ba,Nn).call(this,null);break;case"transitionstart":le(e.target,this)&&setTimeout(()=>oe(this,Hi,Oa).call(this),0);break}}};Ui=new WeakMap;Xt=new WeakMap;Ln=new WeakMap;Na=new WeakMap;Rn=new WeakMap;wn=new WeakMap;Pa=new WeakMap;Ua=new WeakMap;Bi=new WeakMap;Hi=new WeakSet;Oa=function(){oe(this,Zs,Dc).call(this)?j(this,Xt).start():j(this,Xt).stop()};Zs=new WeakSet;Dc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Cr(this)};Vs=new WeakMap;xn=new WeakSet;zs=function(i){var e;let a=((e=this.getAttribute("bounds")?Ue(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),n=i.offsetWidth,s=-(r.left-a.left-n/2),l=a.right-r.left-n/2;return{box:{width:n,min:s,max:l},bounds:a,range:r}};Dn=new WeakSet;Qs=function(i,e){let t=`${e*100}%`,{width:a,min:r,max:n}=i.box;if(!a)return t;if(Number.isNaN(r)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};On=new WeakSet;Xs=function(i,e){let{width:t,min:a,max:r}=i.box,n=e*i.range.width;if(n<a+j(this,Pa)){let s=i.range.left-i.bounds.left-j(this,Pa);return`${n-t/2+s}px`}if(n>r-j(this,Ua)){let s=i.bounds.right-i.range.right-j(this,Ua);return`${n+t/2-s-i.range.width}px`}return 0};Ks=new WeakSet;Oc=function(i){let e=[...j(this,Ln)].some(T=>i.composedPath().includes(T));if(!this.dragging&&(e||!i.composedPath().includes(this))){oe(this,Ba,Nn).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let a=W(this.shadowRoot,"#preview-rail"),r=W(this.shadowRoot,'[part~="preview-box"]'),n=oe(this,xn,zs).call(this,j(this,Rn)),s=(i.clientX-n.range.left)/n.range.width;s=Math.max(0,Math.min(1,s));let l=oe(this,Dn,Qs).call(this,n,s),u=oe(this,On,Xs).call(this,n,s);a.style.transform=`translateX(${l})`,a.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${n.box.width}px`);let c=Math.round(j(this,Na))-Math.round(s*t);Math.abs(c)<1&&s>.01&&s<.99||(Ze(this,Na,s*t),oe(this,Ba,Nn).call(this,j(this,Na)))};Ba=new WeakSet;Nn=function(i){this.dispatchEvent(new d.CustomEvent(f.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Gs=new WeakSet;Nc=function(){j(this,Xt).stop();let i=Uc(this);this.dispatchEvent(new d.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",Ys);var $i={PLACEMENT:"placement",BOUNDS:"bounds"},Bc=h.createElement("template");Bc.innerHTML=`
1125
1131
  <style>
1126
1132
  :host {
1127
1133
  --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
@@ -1231,8 +1237,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
1231
1237
  </style>
1232
1238
  <slot></slot>
1233
1239
  <div id="arrow"></div>
1234
- `;var js=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Cr(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ue(this,"#"+this.bounds))!=null?e:q(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,A=n+s,_=a.getPropertyValue("--media-tooltip-offset-x"),v=_?parseFloat(_.replace("px","")):0,E=a.getPropertyValue("--media-tooltip-container-margin"),P=E?parseFloat(E.replace("px","")):0,y=l-n+v-P,w=c-A+v+P;if(y<0){this.style.setProperty("--media-tooltip-offset-x",`${y}px`);return}if(w>0){this.style.setProperty("--media-tooltip-offset-x",`${w}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Pc.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[$i.PLACEMENT,$i.BOUNDS]}get placement(){return C(this,$i.PLACEMENT)}set placement(e){M(this,$i.PLACEMENT,e)}get bounds(){return C(this,$i.BOUNDS)}set bounds(e){M(this,$i.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",js);var of=1,sf=t=>t.mediaMuted?0:t.mediaVolume,lf=t=>`${Math.round(t*100)}%`,el=class extends Zt{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,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",f("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=sf(this),this.range.setAttribute("aria-valuetext",lf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return x(this,o.MEDIA_VOLUME,of)}set mediaVolume(e){O(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,o.MEDIA_MUTED)}set mediaMuted(e){S(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return C(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",el);var b=Eh(require("@mux/mux-video")),L=require("@mux/playback-core");var Yc=require("@mux/mux-video");var Fc=require("@mux/playback-core");var ei=require("@mux/playback-core");function Uc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Pn(i)}: ${a}; `)}),e?e.trim():void 0}function Pn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Un(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function de(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function tl(t){let e=df(t).toString();return e?"?"+e:""}function df(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var il=(t,e)=>!t||!e?!1:t.contains(e)?!0:il(t,e.getRootNode().host);var Bc="mux.com",uf=()=>{try{return"3.3.1"}catch{}return"UNKNOWN"},cf=uf(),Hn=()=>cf,Hc=(t,{token:e,customDomain:i=Bc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ei.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${tl({token:e,time:n,program_time:r})}`},$c=(t,{token:e,customDomain:i=Bc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ei.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${i}/${t}/storyboard.vtt${tl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ha=t=>{if(t){if([ei.StreamTypes.LIVE,ei.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return ei.StreamTypes.LIVE}};var mf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Wc(t){var e;return(e=mf[t])!=null?e:Un(t)}var Jt,jt,ue,Bn=class{constructor(e,i){me(this,Jt);me(this,jt);me(this,ue,[]);Ae(this,Jt,e),Ae(this,jt,i)}[Symbol.iterator](){return B(this,ue).values()}get length(){return B(this,ue).length}get value(){var e;return(e=B(this,ue).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Ae(this,ue,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return B(this,ue)[e]}values(){return B(this,ue).values()}keys(){return B(this,ue).keys()}forEach(e){B(this,ue).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||B(this,ue).push(r)}),!(this.value===""&&!((i=B(this,Jt))!=null&&i.hasAttribute(`${B(this,jt)}`)))&&((a=B(this,Jt))==null||a.setAttribute(`${B(this,jt)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{B(this,ue).splice(B(this,ue).indexOf(a),1)}),(i=B(this,Jt))==null||i.setAttribute(`${B(this,jt)}`,`${this.value}`)}contains(e){return B(this,ue).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};Jt=new WeakMap,jt=new WeakMap,ue=new WeakMap;var Vc=`[mux-player ${Hn()}]`;function ze(...t){console.warn(Vc,...t)}function ve(...t){console.error(Vc,...t)}function al(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Fc.i18n)("Read more: ")}
1235
- https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ze(e)}var se={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ti={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Gc=Object.freeze({length:0,start(t){let e=t>>>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(t){let e=t>>>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}}),hf=Yc.VideoEvents.filter(t=>t!=="error"),pf=Object.values(se).filter(t=>![se.PLAYSINLINE].includes(t)),ff=Object.values(ti),rl=class extends he.HTMLElement{static get observedAttributes(){return[...pf,...ff]}constructor(){super()}init(){hf.forEach(e=>{var i;(i=this.media)==null||i.addEventListener(e,a=>{this.dispatchEvent(new Event(a.type))})})}attributeChangedCallback(e,i,a){var r,n;switch(e){case ti.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ti.VOLUME:{let s=(r=de(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ti.PLAYBACKRATE:{let s=(n=de(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var i;return(i=this.media)==null?void 0:i.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,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:Gc}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Gc}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=de(this.getAttribute(ti.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ti.PLAYBACKRATE,`${e}`):this.removeAttribute(ti.PLAYBACKRATE)}get crossOrigin(){return $a(this,se.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(se.CROSSORIGIN,`${e}`)}get autoplay(){return $a(this,se.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(se.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(se.AUTOPLAY)}get loop(){return $a(this,se.LOOP)!=null}set loop(e){e?this.setAttribute(se.LOOP,""):this.removeAttribute(se.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return $a(this,se.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(se.MUTED,""):this.removeAttribute(se.MUTED)}get playsInline(){return $a(this,se.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(se.PRELOAD,e):this.removeAttribute(se.PRELOAD)}};function $a(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var nl=rl;var Xc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},D=(t,e,i)=>(Xc(t,e,"read from private field"),i?i.call(t):e.get(t)),Qe=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},mt=(t,e,i,a)=>(Xc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Wi,$n,ii,Wa,It,Ct,Mt,ai,Fi,Wn,Oe,qc=1,Zc=0,vf=1,Ef={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let n=i[a];typeof n=="boolean"&&r instanceof ce&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof ce?r.element[r.attributeName]=n:r.value=n}}}},ht=class extends d.DocumentFragment{constructor(e,i,a=Ef){var r;super(),Qe(this,Wi,void 0),Qe(this,$n,void 0),this.append(e.content.cloneNode(!0)),mt(this,Wi,Jc(this)),mt(this,$n,a),(r=a.createCallback)==null||r.call(a,this,D(this,Wi),i),a.processCallback(this,D(this,Wi),i)}update(e){D(this,$n).processCallback(this,D(this,Wi),e)}};Wi=new WeakMap;$n=new WeakMap;var Jc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let n=new ol;for([i,a]of Qc(r.value))if(!i)n.append(a);else{let s=new ce(t,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of t.childNodes)if(r.nodeType===qc&&!(r instanceof HTMLTemplateElement))Jc(r,e);else{let n=r.data;if(r.nodeType===qc||n.includes("{{")){let s=[];if(n)for([i,a]of Qc(n))if(!i)s.push(new Text(a));else{let l=new pt(t);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new Fa(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},zc={},Qc=t=>{let e="",i=0,a=zc[t],r=0,n;if(a)return a;for(a=[];n=t[r];r++)n==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([Zc,e]),e="",r++):n==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([vf,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Zc,(i>0?"{{":"")+e]),zc[t]=a},bf=11,Fn=class{get value(){return""}set value(e){}toString(){return this.value}},jc=new WeakMap,ol=class{constructor(){Qe(this,ii,[])}[Symbol.iterator](){return D(this,ii).values()}get length(){return D(this,ii).length}item(e){return D(this,ii)[e]}append(...e){for(let i of e)i instanceof ce&&jc.set(i,this),D(this,ii).push(i)}toString(){return D(this,ii).join("")}};ii=new WeakMap;var ce=class extends Fn{constructor(e,i,a){super(),Qe(this,ai),Qe(this,Wa,""),Qe(this,It,void 0),Qe(this,Ct,void 0),Qe(this,Mt,void 0),mt(this,It,e),mt(this,Ct,i),mt(this,Mt,a)}get attributeName(){return D(this,Ct)}get attributeNamespace(){return D(this,Mt)}get element(){return D(this,It)}get value(){return D(this,Wa)}set value(e){D(this,Wa)!==e&&(mt(this,Wa,e),!D(this,ai,Fi)||D(this,ai,Fi).length===1?e==null?D(this,It).removeAttributeNS(D(this,Mt),D(this,Ct)):D(this,It).setAttributeNS(D(this,Mt),D(this,Ct),e):D(this,It).setAttributeNS(D(this,Mt),D(this,Ct),D(this,ai,Fi).toString()))}get booleanValue(){return D(this,It).hasAttributeNS(D(this,Mt),D(this,Ct))}set booleanValue(e){if(!D(this,ai,Fi)||D(this,ai,Fi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Wa=new WeakMap;It=new WeakMap;Ct=new WeakMap;Mt=new WeakMap;ai=new WeakSet;Fi=function(){return jc.get(this)};var pt=class extends Fn{constructor(e,i){super(),Qe(this,Wn,void 0),Qe(this,Oe,void 0),mt(this,Wn,e),mt(this,Oe,i?[...i]:[new Text])}get replacementNodes(){return D(this,Oe)}get parentNode(){return D(this,Wn)}get nextSibling(){return D(this,Oe)[D(this,Oe).length-1].nextSibling}get previousSibling(){return D(this,Oe)[0].previousSibling}get value(){return D(this,Oe).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===bf?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),mt(this,Oe,gf(D(this,Oe)[0].parentNode,D(this,Oe),i,this.nextSibling))}};Wn=new WeakMap;Oe=new WeakMap;var Fa=class extends pt{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function gf(t,e,i,a=null){let r=0,n,s,l,u=i.length,c=e.length;for(;r<u&&r<c&&e[r]==i[r];)r++;for(;r<u&&r<c&&i[u-1]==e[c-1];)a=i[--c,--u];if(r==c)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<c;)t.removeChild(e[r++]);else{for(n=e[r];r<u;)l=i[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&i[r]==s?(t.replaceChild(l,n),n=s):t.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,t.removeChild(n),n=s}return i}var em={string:t=>String(t)},Kn=class{constructor(e){this.template=e,this.state=void 0}},ri=new WeakMap,ni=new WeakMap,sl={partial:(t,e)=>{e[t.expression]=new Kn(t.template)},if:(t,e)=>{var i;if(im(t.expression,e))if(ri.get(t)!==t.template){ri.set(t,t.template);let a=new ht(t.template,e,Gn);t.replace(a),ni.set(t,a)}else(i=ni.get(t))==null||i.update(e);else t.replace(""),ri.delete(t),ni.delete(t)}},_f=Object.keys(sl),Gn={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof Fa){if(!s.directive){let u=_f.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=sl[s.directive])==null||a.call(sl,s,i);continue}let l=im(n,i);if(l instanceof Kn){ri.get(s)!==l.template?(ri.set(s,l.template),l=new ht(l.template,l.state,Gn),s.value=l,ni.set(s,l)):(r=ni.get(s))==null||r.update(l.state);continue}l?(s instanceof ce&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof ce?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ri.delete(s),ni.delete(s))):s instanceof ce?s.value=void 0:(s.value=void 0,ri.delete(s),ni.delete(s))}}},tm={"!":t=>!t,"!!":t=>!!t,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,"??":(t,e)=>t!=null?t:e,"|":(t,e)=>{var i;return(i=em[e])==null?void 0:i.call(em,t)}};function Af(t){return yf(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function im(t,e={}){var i,a,r,n,s,l,u;let c=Af(t);if(c.length===0||c.some(({type:A})=>!A))return Va(t);if(((i=c[0])==null?void 0:i.token)===">"){let A=e[(a=c[1])==null?void 0:a.token];if(!A)return Va(t);let _={...e};A.state=_;let v=c.slice(2);for(let E=0;E<v.length;E+=3){let P=(r=v[E])==null?void 0:r.token,y=(n=v[E+1])==null?void 0:n.token,w=(s=v[E+2])==null?void 0:s.token;P&&y==="="&&(_[P]=Ka(w,e))}return A}if(c.length===1)return Vn(c[0])?Ka(c[0].token,e):Va(t);if(c.length===2){let A=(l=c[0])==null?void 0:l.token,_=tm[A];if(!_||!Vn(c[1]))return Va(t);let v=Ka(c[1].token,e);return _(v)}if(c.length===3){let A=(u=c[1])==null?void 0:u.token,_=tm[A];if(!_||!Vn(c[0])||!Vn(c[2]))return Va(t);let v=Ka(c[0].token,e);if(A==="|")return _(v,c[2].token);let E=Ka(c[2].token,e);return _(v,E)}}function Va(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Vn({type:t}){return["number","boolean","string","param"].includes(t)}function Ka(t,e){let i=t[0],a=t.slice(-1);return t==="true"||t==="false"?t==="true":i===a&&["'",'"'].includes(i)?t.slice(1,-1):gr(t)?parseFloat(t):e[t]}function yf(t,e){let i,a,r,n=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&n.push({token:t.substr(0,i),type:void 0}),r&&n.push(r),t=t.substr(i+(r?r.token.length:0))}return n}var hl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ul=(t,e,i)=>(hl(t,e,"read from private field"),i?i.call(t):e.get(t)),Ga=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},oi=(t,e,i,a)=>(hl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ll=(t,e,i)=>(hl(t,e,"access private method"),i),Vi,Yn,Ki,cl,am,qn,ml,dl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},rm=h.createElement("template");rm.innerHTML=`
1240
+ `;var Js=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Cr(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ue(this,"#"+this.bounds))!=null?e:q(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,T=n+s,_=a.getPropertyValue("--media-tooltip-offset-x"),p=_?parseFloat(_.replace("px","")):0,E=a.getPropertyValue("--media-tooltip-container-margin"),P=E?parseFloat(E.replace("px","")):0,y=l-n+p-P,w=c-T+p+P;if(y<0){this.style.setProperty("--media-tooltip-offset-x",`${y}px`);return}if(w>0){this.style.setProperty("--media-tooltip-offset-x",`${w}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Bc.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[$i.PLACEMENT,$i.BOUNDS]}get placement(){return C(this,$i.PLACEMENT)}set placement(e){M(this,$i.PLACEMENT,e)}get bounds(){return C(this,$i.BOUNDS)}set bounds(e){M(this,$i.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",Js);var sf=1,lf=i=>i.mediaMuted?0:i.mediaVolume,df=i=>`${Math.round(i*100)}%`,js=class extends Zt{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 d.CustomEvent(f.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",v("volume"))}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=lf(this),this.range.setAttribute("aria-valuetext",df(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return x(this,o.MEDIA_VOLUME,sf)}set mediaVolume(e){N(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return S(this,o.MEDIA_MUTED)}set mediaMuted(e){I(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return C(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",js);var b=gh(require("@mux/mux-video")),R=require("@mux/playback-core");var Zc=require("@mux/mux-video");var Kc=require("@mux/playback-core");var ei=require("@mux/playback-core");function Hc(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Pn(t)}: ${a}; `)}),e?e.trim():void 0}function Pn(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 de(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function el(i){let e=uf(i).toString();return e?"?"+e:""}function uf(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var tl=(i,e)=>!i||!e?!1:i.contains(e)?!0:tl(i,e.getRootNode().host);var $c="mux.com",cf=()=>{try{return"3.3.2"}catch{}return"UNKNOWN"},mf=cf(),Hn=()=>mf,Wc=(i,{token:e,customDomain:t=$c,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ei.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${t}/${i}/thumbnail.webp${el({token:e,time:n,program_time:r})}`},Fc=(i,{token:e,customDomain:t=$c,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ei.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${el({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ha=i=>{if(i){if([ei.StreamTypes.LIVE,ei.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return ei.StreamTypes.LIVE}};var hf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Vc(i){var e;return(e=hf[i])!=null?e:Un(i)}var Jt,jt,ue,Bn=class{constructor(e,t){me(this,Jt);me(this,jt);me(this,ue,[]);Ae(this,Jt,e),Ae(this,jt,t)}[Symbol.iterator](){return B(this,ue).values()}get length(){return B(this,ue).length}get value(){var e;return(e=B(this,ue).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ae(this,ue,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return B(this,ue)[e]}values(){return B(this,ue).values()}keys(){return B(this,ue).keys()}forEach(e){B(this,ue).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||B(this,ue).push(r)}),!(this.value===""&&!((t=B(this,Jt))!=null&&t.hasAttribute(`${B(this,jt)}`)))&&((a=B(this,Jt))==null||a.setAttribute(`${B(this,jt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{B(this,ue).splice(B(this,ue).indexOf(a),1)}),(t=B(this,Jt))==null||t.setAttribute(`${B(this,jt)}`,`${this.value}`)}contains(e){return B(this,ue).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)}};Jt=new WeakMap,jt=new WeakMap,ue=new WeakMap;var Gc=`[mux-player ${Hn()}]`;function ze(...i){console.warn(Gc,...i)}function ve(...i){console.error(Gc,...i)}function il(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${(0,Kc.i18n)("Read more: ")}
1241
+ https://github.com/muxinc/elements/blob/main/errors/${i.file}`),ze(e)}var se={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ti={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},qc=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}}),pf=Zc.VideoEvents.filter(i=>i!=="error"),ff=Object.values(se).filter(i=>![se.PLAYSINLINE].includes(i)),vf=Object.values(ti),al=class extends he.HTMLElement{static get observedAttributes(){return[...ff,...vf]}constructor(){super()}init(){pf.forEach(e=>{var t;(t=this.media)==null||t.addEventListener(e,a=>{this.dispatchEvent(new Event(a.type))})})}attributeChangedCallback(e,t,a){var r,n;switch(e){case ti.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ti.VOLUME:{let s=(r=de(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ti.PLAYBACKRATE:{let s=(n=de(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()}load(){var e;(e=this.media)==null||e.load()}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:qc}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:qc}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 currentSrc(){var e,t;return(t=(e=this.media)==null?void 0:e.currentSrc)!=null?t:""}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=de(this.getAttribute(ti.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ti.PLAYBACKRATE,`${e}`):this.removeAttribute(ti.PLAYBACKRATE)}get crossOrigin(){return $a(this,se.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(se.CROSSORIGIN,`${e}`)}get autoplay(){return $a(this,se.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(se.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(se.AUTOPLAY)}get loop(){return $a(this,se.LOOP)!=null}set loop(e){e?this.setAttribute(se.LOOP,""):this.removeAttribute(se.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 $a(this,se.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(se.MUTED,""):this.removeAttribute(se.MUTED)}get playsInline(){return $a(this,se.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(se.PRELOAD,e):this.removeAttribute(se.PRELOAD)}};function $a(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var rl=al;var jc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},D=(i,e,t)=>(jc(i,e,"read from private field"),t?t.call(i):e.get(i)),Qe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mt=(i,e,t,a)=>(jc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wi,$n,ii,Wa,It,Ct,Mt,ai,Fi,Wn,Oe,zc=1,Qc=0,Ef=1,bf={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 ce&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof ce?r.element[r.attributeName]=n:r.value=n}}}},ht=class extends d.DocumentFragment{constructor(e,t,a=bf){var r;super(),Qe(this,Wi,void 0),Qe(this,$n,void 0),this.append(e.content.cloneNode(!0)),mt(this,Wi,em(this)),mt(this,$n,a),(r=a.createCallback)==null||r.call(a,this,D(this,Wi),t),a.processCallback(this,D(this,Wi),t)}update(e){D(this,$n).processCallback(this,D(this,Wi),e)}};Wi=new WeakMap;$n=new WeakMap;var em=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new nl;for([t,a]of Jc(r.value))if(!t)n.append(a);else{let s=new ce(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===zc&&!(r instanceof HTMLTemplateElement))em(r,e);else{let n=r.data;if(r.nodeType===zc||n.includes("{{")){let s=[];if(n)for([t,a]of Jc(n))if(!t)s.push(new Text(a));else{let l=new pt(i);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new Fa(i,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Xc={},Jc=i=>{let e="",t=0,a=Xc[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([Qc,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Ef,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Qc,(t>0?"{{":"")+e]),Xc[i]=a},gf=11,Fn=class{get value(){return""}set value(e){}toString(){return this.value}},tm=new WeakMap,nl=class{constructor(){Qe(this,ii,[])}[Symbol.iterator](){return D(this,ii).values()}get length(){return D(this,ii).length}item(e){return D(this,ii)[e]}append(...e){for(let t of e)t instanceof ce&&tm.set(t,this),D(this,ii).push(t)}toString(){return D(this,ii).join("")}};ii=new WeakMap;var ce=class extends Fn{constructor(e,t,a){super(),Qe(this,ai),Qe(this,Wa,""),Qe(this,It,void 0),Qe(this,Ct,void 0),Qe(this,Mt,void 0),mt(this,It,e),mt(this,Ct,t),mt(this,Mt,a)}get attributeName(){return D(this,Ct)}get attributeNamespace(){return D(this,Mt)}get element(){return D(this,It)}get value(){return D(this,Wa)}set value(e){D(this,Wa)!==e&&(mt(this,Wa,e),!D(this,ai,Fi)||D(this,ai,Fi).length===1?e==null?D(this,It).removeAttributeNS(D(this,Mt),D(this,Ct)):D(this,It).setAttributeNS(D(this,Mt),D(this,Ct),e):D(this,It).setAttributeNS(D(this,Mt),D(this,Ct),D(this,ai,Fi).toString()))}get booleanValue(){return D(this,It).hasAttributeNS(D(this,Mt),D(this,Ct))}set booleanValue(e){if(!D(this,ai,Fi)||D(this,ai,Fi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Wa=new WeakMap;It=new WeakMap;Ct=new WeakMap;Mt=new WeakMap;ai=new WeakSet;Fi=function(){return tm.get(this)};var pt=class extends Fn{constructor(e,t){super(),Qe(this,Wn,void 0),Qe(this,Oe,void 0),mt(this,Wn,e),mt(this,Oe,t?[...t]:[new Text])}get replacementNodes(){return D(this,Oe)}get parentNode(){return D(this,Wn)}get nextSibling(){return D(this,Oe)[D(this,Oe).length-1].nextSibling}get previousSibling(){return D(this,Oe)[0].previousSibling}get value(){return D(this,Oe).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===gf?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),mt(this,Oe,_f(D(this,Oe)[0].parentNode,D(this,Oe),t,this.nextSibling))}};Wn=new WeakMap;Oe=new WeakMap;var Fa=class extends pt{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),this.expression=r,this.template=t,this.directive=a}};function _f(i,e,t,a=null){let r=0,n,s,l,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)l=t[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&t[r]==s?(i.replaceChild(l,n),n=s):i.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var im={string:i=>String(i)},Kn=class{constructor(e){this.template=e,this.state=void 0}},ri=new WeakMap,ni=new WeakMap,ol={partial:(i,e)=>{e[i.expression]=new Kn(i.template)},if:(i,e)=>{var t;if(rm(i.expression,e))if(ri.get(i)!==i.template){ri.set(i,i.template);let a=new ht(i.template,e,Gn);i.replace(a),ni.set(i,a)}else(t=ni.get(i))==null||t.update(e);else i.replace(""),ri.delete(i),ni.delete(i)}},Af=Object.keys(ol),Gn={processCallback(i,e,t){var a,r;if(t)for(let[n,s]of e){if(s instanceof Fa){if(!s.directive){let u=Af.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=ol[s.directive])==null||a.call(ol,s,t);continue}let l=rm(n,t);if(l instanceof Kn){ri.get(s)!==l.template?(ri.set(s,l.template),l=new ht(l.template,l.state,Gn),s.value=l,ni.set(s,l)):(r=ni.get(s))==null||r.update(l.state);continue}l?(s instanceof ce&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof ce?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ri.delete(s),ni.delete(s))):s instanceof ce?s.value=void 0:(s.value=void 0,ri.delete(s),ni.delete(s))}}},am={"!":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=im[e])==null?void 0:t.call(im,i)}};function Tf(i){return yf(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function rm(i,e={}){var t,a,r,n,s,l,u;let c=Tf(i);if(c.length===0||c.some(({type:T})=>!T))return Va(i);if(((t=c[0])==null?void 0:t.token)===">"){let T=e[(a=c[1])==null?void 0:a.token];if(!T)return Va(i);let _={...e};T.state=_;let p=c.slice(2);for(let E=0;E<p.length;E+=3){let P=(r=p[E])==null?void 0:r.token,y=(n=p[E+1])==null?void 0:n.token,w=(s=p[E+2])==null?void 0:s.token;P&&y==="="&&(_[P]=Ka(w,e))}return T}if(c.length===1)return Vn(c[0])?Ka(c[0].token,e):Va(i);if(c.length===2){let T=(l=c[0])==null?void 0:l.token,_=am[T];if(!_||!Vn(c[1]))return Va(i);let p=Ka(c[1].token,e);return _(p)}if(c.length===3){let T=(u=c[1])==null?void 0:u.token,_=am[T];if(!_||!Vn(c[0])||!Vn(c[2]))return Va(i);let p=Ka(c[0].token,e);if(T==="|")return _(p,c[2].token);let E=Ka(c[2].token,e);return _(p,E)}}function Va(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Vn({type:i}){return["number","boolean","string","param"].includes(i)}function Ka(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):gr(i)?parseFloat(i):e[i]}function yf(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 ml=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},dl=(i,e,t)=>(ml(i,e,"read from private field"),t?t.call(i):e.get(i)),Ga=(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)},oi=(i,e,t,a)=>(ml(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),sl=(i,e,t)=>(ml(i,e,"access private method"),t),Vi,Yn,Ki,ul,nm,qn,cl,ll={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},om=h.createElement("template");om.innerHTML=`
1236
1242
  <style>
1237
1243
  :host {
1238
1244
  display: inline-block;
@@ -1259,7 +1265,7 @@ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ze(e)}var se={AU
1259
1265
  display: none;
1260
1266
  }
1261
1267
  </style>
1262
- `;var si=class extends d.HTMLElement{constructor(){super(),Ga(this,cl),Ga(this,qn),Ga(this,Vi,void 0),Ga(this,Yn,void 0),Ga(this,Ki,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(i=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||i.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(dl[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(nt.BREAKPOINTS_COMPUTED,this.render),ll(this,cl,am).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=ul(this,Vi))!=null?e:this.constructor.template}set template(e){oi(this,Ki,null),oi(this,Vi,e),this.createRenderer()}get props(){var e,i,a;let r=[...Array.from((i=(e=this.mediaController)==null?void 0:e.attributes)!=null?i:[]).filter(({name:s})=>dl[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=dl[s.name])!=null?a:$d(s.name),{value:u}=s;u!=null?(gr(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&ll(this,qn,ml).call(this)}connectedCallback(){ll(this,qn,ml).call(this)}createRenderer(){this.template&&this.template!==ul(this,Yn)&&(oi(this,Yn,this.template),this.renderer=new ht(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(rm.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Vi=new WeakMap;Yn=new WeakMap;Ki=new WeakMap;cl=new WeakSet;am=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};qn=new WeakSet;ml=function(){var t;let e=this.getAttribute("template");if(!e||e===ul(this,Ki))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){oi(this,Ki,e),oi(this,Vi,a),this.createRenderer();return}Tf(e)&&(oi(this,Ki,e),kf(e).then(r=>{let n=h.createElement("template");n.innerHTML=r,oi(this,Vi,n),this.createRenderer()}).catch(console.error))};si.observedAttributes=["template"];si.processor=Gn;function Tf(t){if(!/^(\/|\.\/|https?:\/\/)/.test(t))return!1;let e=/^https?:\/\//.test(t)?void 0:location.origin;try{new URL(t,e)}catch{return!1}return!0}async function kf(t){let e=await fetch(t);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}d.customElements.get("media-theme")||d.customElements.define("media-theme",si);var nm=`:host {
1268
+ `;var si=class extends d.HTMLElement{constructor(){super(),Ga(this,ul),Ga(this,qn),Ga(this,Vi,void 0),Ga(this,Yn,void 0),Ga(this,Ki,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:!!(ll[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(nt.BREAKPOINTS_COMPUTED,this.render),sl(this,ul,nm).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=dl(this,Vi))!=null?e:this.constructor.template}set template(e){oi(this,Ki,null),oi(this,Vi,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})=>ll[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=ll[s.name])!=null?a:Hd(s.name),{value:u}=s;u!=null?(gr(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&sl(this,qn,cl).call(this)}connectedCallback(){sl(this,qn,cl).call(this)}createRenderer(){this.template&&this.template!==dl(this,Yn)&&(oi(this,Yn,this.template),this.renderer=new ht(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(om.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Vi=new WeakMap;Yn=new WeakMap;Ki=new WeakMap;ul=new WeakSet;nm=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};qn=new WeakSet;cl=function(){var i;let e=this.getAttribute("template");if(!e||e===dl(this,Ki))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){oi(this,Ki,e),oi(this,Vi,a),this.createRenderer();return}kf(e)&&(oi(this,Ki,e),Sf(e).then(r=>{let n=h.createElement("template");n.innerHTML=r,oi(this,Vi,n),this.createRenderer()}).catch(console.error))};si.observedAttributes=["template"];si.processor=Gn;function kf(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 Sf(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}d.customElements.get("media-theme")||d.customElements.define("media-theme",si);var sm=`:host {
1263
1269
  --media-control-display: var(--controls);
1264
1270
  --media-loading-indicator-display: var(--loading-indicator);
1265
1271
  --media-dialog-display: var(--dialog);
@@ -1409,77 +1415,77 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1409
1415
  :host([no-tooltips]) {
1410
1416
  --media-tooltip-display: none;
1411
1417
  }
1412
- `;var Ya=new WeakMap,fl=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=Ya.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 i=Ya.get(this.element);i&&i.delete(this.type)}}static for(e){Ya.has(e.element)||Ya.set(e.element,new Map);let i=e.attributeName.slice(2),a=Ya.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function If(t,e){return t instanceof ce&&t.attributeName.startsWith("on")?(fl.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Cf(t,e){return e instanceof Zn&&t instanceof pt?(e.renderInto(t),!0):!1}function Mf(t,e){return e instanceof DocumentFragment&&t instanceof pt?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function wf(t,e){if(t instanceof ce){let i=t.attributeNamespace,a=t.element.getAttributeNS(i,t.attributeName);return String(e)!==a&&(t.value=String(e)),!0}return t.value=String(e),!0}function Rf(t,e){if(t instanceof ce&&e instanceof Element){let i=t.element;return i[t.attributeName]!==e&&(t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),i[t.attributeName]=e),!0}return!1}function Lf(t,e){if(typeof e=="boolean"&&t instanceof ce){let i=t.attributeNamespace,a=t.element.hasAttributeNS(i,t.attributeName);return e!==a&&(t.booleanValue=e),!0}return!1}function xf(t,e){return e===!1&&t instanceof pt?(t.replace(""),!0):!1}function Df(t,e){Rf(t,e)||Lf(t,e)||If(t,e)||xf(t,e)||Cf(t,e)||Mf(t,e)||wf(t,e)}var pl=new Map,om=new WeakMap,sm=new WeakMap,Zn=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(pl.has(this.stringsKey))return pl.get(this.stringsKey);{let e=fi.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<i?`{{ ${n} }}`:""),""),pl.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(om.get(e)!==i){om.set(e,i);let n=new ht(i,this.values,this.processor);sm.set(e,n),e instanceof pt?e.replace(...n.children):e.appendChild(n);return}let a=sm.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Of={processCallback(t,e,i){var a;if(i){for(let[r,n]of e)if(r in i){let s=(a=i[r])!=null?a:"";Df(n,s)}}}};function qa(t,...e){return new Zn(t,e,Of)}function lm(t,e){t.renderInto(e)}var Za=require("@mux/playback-core"),Nf=t=>{let{tokens:e}=t;return e.drm?":host { --_cast-button-drm-display: none; }":""},dm=t=>qa`
1418
+ `;var Ya=new WeakMap,pl=class i{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Ya.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=Ya.get(this.element);t&&t.delete(this.type)}}static for(e){Ya.has(e.element)||Ya.set(e.element,new Map);let t=e.attributeName.slice(2),a=Ya.get(e.element);return a&&a.has(t)?a.get(t):new i(e.element,t)}};function Cf(i,e){return i instanceof ce&&i.attributeName.startsWith("on")?(pl.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function Mf(i,e){return e instanceof Zn&&i instanceof pt?(e.renderInto(i),!0):!1}function wf(i,e){return e instanceof DocumentFragment&&i instanceof pt?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function Lf(i,e){if(i instanceof ce){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 Rf(i,e){if(i instanceof ce&&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 xf(i,e){if(typeof e=="boolean"&&i instanceof ce){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function Df(i,e){return e===!1&&i instanceof pt?(i.replace(""),!0):!1}function Of(i,e){Rf(i,e)||xf(i,e)||Cf(i,e)||Df(i,e)||Mf(i,e)||wf(i,e)||Lf(i,e)}var hl=new Map,lm=new WeakMap,dm=new WeakMap,Zn=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(hl.has(this.stringsKey))return hl.get(this.stringsKey);{let e=fi.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),hl.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(lm.get(e)!==t){lm.set(e,t);let n=new ht(t,this.values,this.processor);dm.set(e,n),e instanceof pt?e.replace(...n.children):e.appendChild(n);return}let a=dm.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Nf={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:"";Of(n,s)}}}};function qa(i,...e){return new Zn(i,e,Nf)}function um(i,e){i.renderInto(e)}var Za=require("@mux/playback-core"),Pf=i=>{let{tokens:e}=i;return e.drm?":host { --_cast-button-drm-display: none; }":""},cm=i=>qa`
1413
1419
  <style>
1414
- ${Nf(t)}
1415
- ${nm}
1420
+ ${Pf(i)}
1421
+ ${sm}
1416
1422
  </style>
1417
- ${Hf(t)}
1418
- `,Pf=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Ha(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Uf={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",MENU_BUTTON:"menu-button",MENU:"menu",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"},Bf=Object.values(Uf).join(", "),Hf=t=>{var e,i,a,r,n,s,l,u,c,A,_,v,E,P,y,w,U,J,be,Et,at,ea,ta,ia,aa,ra,na,oa,sa,la,da,ua,Er,rt;return qa`
1423
+ ${$f(i)}
1424
+ `,Uf=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return Ha(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Bf={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",MENU_BUTTON:"menu-button",MENU:"menu",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"},Hf=Object.values(Bf).join(", "),$f=i=>{var e,t,a,r,n,s,l,u,c,T,_,p,E,P,y,w,U,J,be,Et,at,ea,ta,ia,aa,ra,na,oa,sa,la,da,ua,Er,rt;return qa`
1419
1425
  <media-theme
1420
- template="${t.themeTemplate||!1}"
1421
- defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
1422
- hotkeys="${Pf(t)||!1}"
1423
- nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
1424
- noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(Za.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
1425
- novolumepref="${t.novolumepref||!1}"
1426
- disabled="${!t.hasSrc||t.isDialogOpen}"
1427
- audio="${(a=t.audio)!=null?a:!1}"
1428
- style="${(r=Uc({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
1429
- defaultsubtitles="${!t.defaultHiddenCaptions}"
1430
- forwardseekoffset="${(n=t.forwardSeekOffset)!=null?n:!1}"
1431
- backwardseekoffset="${(s=t.backwardSeekOffset)!=null?s:!1}"
1432
- playbackrates="${(l=t.playbackRates)!=null?l:!1}"
1433
- defaultshowremainingtime="${(u=t.defaultShowRemainingTime)!=null?u:!1}"
1434
- defaultduration="${(c=t.defaultDuration)!=null?c:!1}"
1435
- hideduration="${(A=t.hideDuration)!=null?A:!1}"
1436
- title="${(_=t.title)!=null?_:!1}"
1437
- proudlydisplaymuxbadge="${(v=t.proudlyDisplayMuxBadge)!=null?v:!1}"
1438
- exportparts="${Bf}"
1439
- onclose="${t.onCloseErrorDialog}"
1440
- onfocusin="${t.onFocusInErrorDialog}"
1426
+ template="${i.themeTemplate||!1}"
1427
+ defaultstreamtype="${(e=i.defaultStreamType)!=null?e:!1}"
1428
+ hotkeys="${Uf(i)||!1}"
1429
+ nohotkeys="${i.noHotKeys||!i.hasSrc||!1}"
1430
+ noautoseektolive="${!!((t=i.streamType)!=null&&t.includes(Za.StreamTypes.LIVE))&&i.targetLiveWindow!==0}"
1431
+ novolumepref="${i.novolumepref||!1}"
1432
+ disabled="${!i.hasSrc||i.isDialogOpen}"
1433
+ audio="${(a=i.audio)!=null?a:!1}"
1434
+ style="${(r=Hc({"--media-primary-color":i.primaryColor,"--media-secondary-color":i.secondaryColor,"--media-accent-color":i.accentColor}))!=null?r:!1}"
1435
+ defaultsubtitles="${!i.defaultHiddenCaptions}"
1436
+ forwardseekoffset="${(n=i.forwardSeekOffset)!=null?n:!1}"
1437
+ backwardseekoffset="${(s=i.backwardSeekOffset)!=null?s:!1}"
1438
+ playbackrates="${(l=i.playbackRates)!=null?l:!1}"
1439
+ defaultshowremainingtime="${(u=i.defaultShowRemainingTime)!=null?u:!1}"
1440
+ defaultduration="${(c=i.defaultDuration)!=null?c:!1}"
1441
+ hideduration="${(T=i.hideDuration)!=null?T:!1}"
1442
+ title="${(_=i.title)!=null?_:!1}"
1443
+ proudlydisplaymuxbadge="${(p=i.proudlyDisplayMuxBadge)!=null?p:!1}"
1444
+ exportparts="${Hf}"
1445
+ onclose="${i.onCloseErrorDialog}"
1446
+ onfocusin="${i.onFocusInErrorDialog}"
1441
1447
  >
1442
1448
  <mux-video
1443
1449
  slot="media"
1444
- target-live-window="${(E=t.targetLiveWindow)!=null?E:!1}"
1445
- stream-type="${(P=Ha(t.streamType))!=null?P:!1}"
1446
- crossorigin="${(y=t.crossOrigin)!=null?y:""}"
1450
+ target-live-window="${(E=i.targetLiveWindow)!=null?E:!1}"
1451
+ stream-type="${(P=Ha(i.streamType))!=null?P:!1}"
1452
+ crossorigin="${(y=i.crossOrigin)!=null?y:""}"
1447
1453
  playsinline
1448
- autoplay="${(w=t.autoplay)!=null?w:!1}"
1449
- muted="${(U=t.muted)!=null?U:!1}"
1450
- loop="${(J=t.loop)!=null?J:!1}"
1451
- preload="${(be=t.preload)!=null?be:!1}"
1452
- debug="${(Et=t.debug)!=null?Et:!1}"
1453
- prefer-cmcd="${(at=t.preferCmcd)!=null?at:!1}"
1454
- disable-tracking="${(ea=t.disableTracking)!=null?ea:!1}"
1455
- disable-cookies="${(ta=t.disableCookies)!=null?ta:!1}"
1456
- prefer-playback="${(ia=t.preferPlayback)!=null?ia:!1}"
1457
- start-time="${t.startTime!=null?t.startTime:!1}"
1458
- beacon-collection-domain="${(aa=t.beaconCollectionDomain)!=null?aa:!1}"
1459
- player-init-time="${(ra=t.playerInitTime)!=null?ra:!1}"
1460
- player-software-name="${(na=t.playerSoftwareName)!=null?na:!1}"
1461
- player-software-version="${(oa=t.playerSoftwareVersion)!=null?oa:!1}"
1462
- env-key="${(sa=t.envKey)!=null?sa:!1}"
1463
- custom-domain="${(la=t.customDomain)!=null?la:!1}"
1464
- src="${t.src?t.src:t.playbackId?(0,Za.toMuxVideoURL)(t):!1}"
1465
- cast-src="${t.src?t.src:t.playbackId?(0,Za.toMuxVideoURL)(t):!1}"
1466
- cast-receiver="${(da=t.castReceiver)!=null?da:!1}"
1467
- drm-token="${(Er=(ua=t.tokens)==null?void 0:ua.drm)!=null?Er:!1}"
1454
+ autoplay="${(w=i.autoplay)!=null?w:!1}"
1455
+ muted="${(U=i.muted)!=null?U:!1}"
1456
+ loop="${(J=i.loop)!=null?J:!1}"
1457
+ preload="${(be=i.preload)!=null?be:!1}"
1458
+ debug="${(Et=i.debug)!=null?Et:!1}"
1459
+ prefer-cmcd="${(at=i.preferCmcd)!=null?at:!1}"
1460
+ disable-tracking="${(ea=i.disableTracking)!=null?ea:!1}"
1461
+ disable-cookies="${(ta=i.disableCookies)!=null?ta:!1}"
1462
+ prefer-playback="${(ia=i.preferPlayback)!=null?ia:!1}"
1463
+ start-time="${i.startTime!=null?i.startTime:!1}"
1464
+ beacon-collection-domain="${(aa=i.beaconCollectionDomain)!=null?aa:!1}"
1465
+ player-init-time="${(ra=i.playerInitTime)!=null?ra:!1}"
1466
+ player-software-name="${(na=i.playerSoftwareName)!=null?na:!1}"
1467
+ player-software-version="${(oa=i.playerSoftwareVersion)!=null?oa:!1}"
1468
+ env-key="${(sa=i.envKey)!=null?sa:!1}"
1469
+ custom-domain="${(la=i.customDomain)!=null?la:!1}"
1470
+ src="${i.src?i.src:i.playbackId?(0,Za.toMuxVideoURL)(i):!1}"
1471
+ cast-src="${i.src?i.src:i.playbackId?(0,Za.toMuxVideoURL)(i):!1}"
1472
+ cast-receiver="${(da=i.castReceiver)!=null?da:!1}"
1473
+ drm-token="${(Er=(ua=i.tokens)==null?void 0:ua.drm)!=null?Er:!1}"
1468
1474
  exportparts="video"
1469
1475
  >
1470
- ${t.storyboard?qa`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:qa``}
1476
+ ${i.storyboard?qa`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:qa``}
1471
1477
  <slot></slot>
1472
1478
  </mux-video>
1473
1479
  <slot name="poster" slot="poster">
1474
1480
  <media-poster-image
1475
1481
  part="poster"
1476
1482
  exportparts="poster, img"
1477
- src="${t.poster?t.poster:!1}"
1478
- placeholdersrc="${(rt=t.placeholder)!=null?rt:!1}"
1483
+ src="${i.poster?i.poster:!1}"
1484
+ placeholdersrc="${(rt=i.placeholder)!=null?rt:!1}"
1479
1485
  ></media-poster-image>
1480
1486
  </slot>
1481
1487
  </media-theme>
1482
- `};var g=require("@mux/playback-core"),um=t=>t.charAt(0).toUpperCase()+t.slice(1),$f=(t,e=!1)=>{var i,a;if(t.muxCode){let r=um((i=t.errorCategory)!=null?i:"video"),n=(0,g.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:g.MuxErrorCategory.VIDEO);if(t.muxCode===g.MuxErrorCode.NETWORK_OFFLINE)return(0,g.i18n)("Your device appears to be offline",e);if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,g.i18n)("{category} URL has expired",e).format({category:r});if([g.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,g.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,g.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,g.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,g.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,g.i18n)("Invalid {categoryName} URL",e).format({categoryName:n});if(t.muxCode===g.MuxErrorCode.NETWORK_NOT_FOUND)return(0,g.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===g.MuxErrorCode.NETWORK_NOT_READY)return(0,g.i18n)("{category} is not currently available",e).format({category:r})}if(t.code){if(t.code===g.MediaError.MEDIA_ERR_NETWORK)return(0,g.i18n)("Network Error",e);if(t.code===g.MediaError.MEDIA_ERR_DECODE)return(0,g.i18n)("Media Error",e);if(t.code===g.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,g.i18n)("Source Not Supported",e)}return(0,g.i18n)("Error",e)},Wf=(t,e=!1)=>{var i,a;if(t.muxCode){let r=um((i=t.errorCategory)!=null?i:"video"),n=(0,g.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:g.MuxErrorCategory.VIDEO);return t.muxCode===g.MuxErrorCode.NETWORK_OFFLINE?(0,g.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,g.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:n}):t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,g.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:n}):t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,g.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[g.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,g.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,g.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:n}):[g.MuxErrorCode.NETWORK_TOKEN_MISSING,g.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,g.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:n}):t.muxCode===g.MuxErrorCode.NETWORK_NOT_FOUND?"":t.muxCode===g.MuxErrorCode.NETWORK_NOT_READY?(0,g.i18n)("The live stream or video file are not yet ready.",e):t.message}return t.code&&(t.code===g.MediaError.MEDIA_ERR_NETWORK||t.code===g.MediaError.MEDIA_ERR_DECODE||t.code===g.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},cm=(t,e=!1)=>{let i=$f(t,e),a=Wf(t,e);return{title:i,message:a}},Ff=t=>{if(t.muxCode){if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([g.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,g.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===g.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===g.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===g.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===g.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===g.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===g.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},vl=(t,e)=>{let i=Ff(t);return{message:t.message,context:t.context,file:i}};var mm=`<template id="media-theme-gerwig">
1488
+ `};var A=require("@mux/playback-core"),mm=i=>i.charAt(0).toUpperCase()+i.slice(1),Wf=(i,e=!1)=>{var t,a;if(i.muxCode){let r=mm((t=i.errorCategory)!=null?t:"video"),n=(0,A.errorCategoryToTokenNameOrPrefix)((a=i.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);if(i.muxCode===A.MuxErrorCode.NETWORK_OFFLINE)return(0,A.i18n)("Your device appears to be offline",e);if(i.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,A.i18n)("{category} URL has expired",e).format({category:r});if([A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,A.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(i.muxCode))return(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(i.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,A.i18n)("Invalid {categoryName} URL",e).format({categoryName:n});if(i.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return(0,A.i18n)("{category} does not exist",e).format({category:r});if(i.muxCode===A.MuxErrorCode.NETWORK_NOT_READY)return(0,A.i18n)("{category} is not currently available",e).format({category:r})}if(i.code){if(i.code===A.MediaError.MEDIA_ERR_NETWORK)return(0,A.i18n)("Network Error",e);if(i.code===A.MediaError.MEDIA_ERR_DECODE)return(0,A.i18n)("Media Error",e);if(i.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,A.i18n)("Source Not Supported",e)}return(0,A.i18n)("Error",e)},Ff=(i,e=!1)=>{var t,a;if(i.muxCode){let r=mm((t=i.errorCategory)!=null?t:"video"),n=(0,A.errorCategoryToTokenNameOrPrefix)((a=i.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);return i.muxCode===A.MuxErrorCode.NETWORK_OFFLINE?(0,A.i18n)("Check your internet connection and try reloading this video.",e):i.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,A.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:n}):i.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,A.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:n}):i.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(i.muxCode)?(0,A.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:n}):[A.MuxErrorCode.NETWORK_TOKEN_MISSING,A.MuxErrorCode.NETWORK_INVALID_URL].includes(i.muxCode)?(0,A.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:n}):i.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND?"":i.muxCode===A.MuxErrorCode.NETWORK_NOT_READY?(0,A.i18n)("The live stream or video file are not yet ready.",e):i.message}return i.code&&(i.code===A.MediaError.MEDIA_ERR_NETWORK||i.code===A.MediaError.MEDIA_ERR_DECODE||i.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),i.message},hm=(i,e=!1)=>{let t=Wf(i,e),a=Ff(i,e);return{title:t,message:a}},Vf=i=>{if(i.muxCode){if(i.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(i.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(i.muxCode))return"403-incorrect-aud-value.md";if(i.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(i.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(i.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(i.muxCode===A.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(i.code){if(i.code===A.MediaError.MEDIA_ERR_NETWORK)return"";if(i.code===A.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(i.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},fl=(i,e)=>{let t=Vf(i);return{message:i.message,context:i.context,file:t}};var pm=`<template id="media-theme-gerwig">
1483
1489
  <style>
1484
1490
  @keyframes pre-play-hide {
1485
1491
  0% {
@@ -2596,7 +2602,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2596
2602
  <slot></slot>
2597
2603
  </media-controller>
2598
2604
  </template>
2599
- `;function hm({anchor:t,floating:e,placement:i}){let a=Kf({anchor:t,floating:e}),{x:r,y:n}=Yf(a,i);return{x:r,y:n}}function Kf({anchor:t,floating:e}){return{anchor:Gf(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Gf(t,e){var i;let a=t.getBoundingClientRect(),r=(i=e==null?void 0:e.getBoundingClientRect())!=null?i:{x:0,y:0};return{x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}function Yf({anchor:t,floating:e},i){let a=qf(i)==="x"?"y":"x",r=a==="y"?"height":"width",n=pm(i),s=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,u=t[r]/2-e[r]/2,c;switch(n){case"top":c={x:s,y:t.y-e.height};break;case"bottom":c={x:s,y:t.y+t.height};break;case"right":c={x:t.x+t.width,y:l};break;case"left":c={x:t.x-e.width,y:l};break;default:c={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":c[a]-=u;break;case"end":c[a]+=u;break}return c}function pm(t){return t.split("-")[0]}function qf(t){return["top","bottom"].includes(pm(t))?"y":"x"}var wt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},zn=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var Ml=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},H=(t,e,i)=>(Ml(t,e,"read from private field"),i?i.call(t):e.get(t)),K=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Xe=(t,e,i,a)=>(Ml(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),G=(t,e,i)=>(Ml(t,e,"access private method"),i),Je,di,Rt,Qn,Xn,ui,Xa,El,fm,eo,Jn,bl,gl,vm,_l,Em,Al,bm,Gi,Yi,qi,Ja,to,wl,yl,gm,Rl,_m,Tl,Am,Ll,ym,kl,Tm,Sl,km,za,io,Il,Sm,Qa,ao,jn,Cl;function je({type:t,text:e,value:i,checked:a}){let r=h.createElement("media-chrome-menu-item");r.type=t!=null?t:"",r.part.add("menu-item"),t&&r.part.add(t),r.value=i,r.checked=a;let n=h.createElement("span");return n.textContent=e,r.append(n),r}function Ne(t,e){let i=t.querySelector(`:scope > [slot="${e}"]`);if((i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i)return i=i.cloneNode(!0),i;let a=t.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}var Im=h.createElement("template");Im.innerHTML=`
2605
+ `;function fm({anchor:i,floating:e,placement:t}){let a=Gf({anchor:i,floating:e}),{x:r,y:n}=qf(a,t);return{x:r,y:n}}function Gf({anchor:i,floating:e}){return{anchor:Yf(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Yf(i,e){var t;let a=i.getBoundingClientRect(),r=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}function qf({anchor:i,floating:e},t){let a=Zf(t)==="x"?"y":"x",r=a==="y"?"height":"width",n=vm(t),s=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,u=i[r]/2-e[r]/2,c;switch(n){case"top":c={x:s,y:i.y-e.height};break;case"bottom":c={x:s,y:i.y+i.height};break;case"right":c={x:i.x+i.width,y:l};break;case"left":c={x:i.x-e.width,y:l};break;default:c={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":c[a]-=u;break;case"end":c[a]+=u;break}return c}function vm(i){return i.split("-")[0]}function Zf(i){return["top","bottom"].includes(vm(i))?"y":"x"}var wt=class extends Event{constructor({action:e="auto",relatedTarget:t,...a}){super("invoke",a),this.action=e,this.relatedTarget=t}},zn=class extends Event{constructor({newState:e,oldState:t,...a}){super("toggle",a),this.newState=e,this.oldState=t}};var Cl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},H=(i,e,t)=>(Cl(i,e,"read from private field"),t?t.call(i):e.get(i)),G=(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)},Xe=(i,e,t,a)=>(Cl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Y=(i,e,t)=>(Cl(i,e,"access private method"),t),Je,di,Lt,Qn,Xn,ui,Xa,vl,Em,eo,Jn,El,bl,bm,gl,gm,_l,_m,Gi,Yi,qi,Ja,to,Ml,Al,Am,wl,Tm,Tl,ym,Ll,km,yl,Sm,kl,Im,za,io,Sl,Cm,Qa,ao,jn,Il;function je({type:i,text:e,value:t,checked:a}){let r=h.createElement("media-chrome-menu-item");r.type=i!=null?i:"",r.part.add("menu-item"),i&&r.part.add(i),r.value=t,r.checked=a;let n=h.createElement("span");return n.textContent=e,r.append(n),r}function Ne(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let a=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}var Mm=h.createElement("template");Mm.innerHTML=`
2600
2606
  <style>
2601
2607
  :host {
2602
2608
  font: var(--media-font,
@@ -2692,12 +2698,12 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2692
2698
  slot[name="header"]::slotted(*) {
2693
2699
  padding: .4em .7em;
2694
2700
  border-bottom: 1px solid rgb(255 255 255 / .25);
2695
- cursor: default;
2701
+ cursor: var(--media-cursor, default);
2696
2702
  }
2697
2703
 
2698
2704
  slot[name="header"] > button[part~="back"],
2699
2705
  slot[name="header"]::slotted(button[part~="back"]) {
2700
- cursor: pointer;
2706
+ cursor: var(--media-cursor, pointer);
2701
2707
  }
2702
2708
 
2703
2709
  svg[part~="back"] {
@@ -2770,7 +2776,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2770
2776
  <slot></slot>
2771
2777
  </div>
2772
2778
  <slot name="checked-indicator" hidden></slot>
2773
- `;var li={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ne=class extends d.HTMLElement{constructor(){super(),K(this,El),K(this,Jn),K(this,gl),K(this,_l),K(this,Al),K(this,qi),K(this,to),K(this,yl),K(this,Rl),K(this,Tl),K(this,Ll),K(this,kl),K(this,Sl),K(this,za),K(this,Il),K(this,Qa),K(this,jn),K(this,Je,null),K(this,di,null),K(this,Rt,null),K(this,Qn,new Set),K(this,Xn,void 0),K(this,ui,!1),K(this,Xa,null),K(this,eo,()=>{let e=H(this,Qn),i=new Set(this.items);for(let a of e)i.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of i)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));Xe(this,Qn,i)}),K(this,Gi,()=>{G(this,qi,Ja).call(this),G(this,to,wl).call(this,!1)}),K(this,Yi,()=>{G(this,qi,Ja).call(this)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),Xe(this,Xn,new MutationObserver(H(this,eo))),H(this,Xn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[li.DISABLED,li.HIDDEN,li.STYLE,li.ANCHOR,R.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":G(this,El,fm).call(this,e);break;case"invoke":G(this,gl,vm).call(this,e);break;case"click":G(this,yl,gm).call(this,e);break;case"toggle":G(this,Tl,Am).call(this,e);break;case"focusout":G(this,kl,Tm).call(this,e);break;case"keydown":G(this,Sl,km).call(this,e);break}}connectedCallback(){var e,i;Xe(this,Xa,Ho(this.shadowRoot,":host")),G(this,Jn,bl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Xe(this,Je,kr(this)),(i=(e=H(this,Je))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(ot(ja(this),H(this,Gi)),ot(this,H(this,Yi)))}disconnectedCallback(){var e,i;st(ja(this),H(this,Gi)),st(this,H(this,Yi)),this.disable(),(i=(e=H(this,Je))==null?void 0:e.unassociateElement)==null||i.call(e,this),Xe(this,Je,null)}attributeChangedCallback(e,i,a){var r,n,s,l;e===li.HIDDEN&&a!==i?(H(this,ui)||Xe(this,ui,!0),this.hidden?G(this,Al,bm).call(this):G(this,_l,Em).call(this),this.dispatchEvent(new zn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===R.MEDIA_CONTROLLER?(i&&((n=(r=H(this,Je))==null?void 0:r.unassociateElement)==null||n.call(r,this),Xe(this,Je,null)),a&&this.isConnected&&(Xe(this,Je,kr(this)),(l=(s=H(this,Je))==null?void 0:s.associateElement)==null||l.call(s,this))):e===li.DISABLED&&a!==i?a==null?this.enable():this.disable():e===li.STYLE&&a!==i&&G(this,Jn,bl).call(this)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=Pt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Zf)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return(i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(a=>a.value===e);i&&G(this,jn,Cl).call(this,i)}focus(){if(Xe(this,di,fa()),this.items.length){G(this,Qa,ao).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var i;let a=G(this,za,io).call(this,e);a&&(G(this,jn,Cl).call(this,a,a.type==="checkbox"),H(this,Rt)&&!this.hidden&&((i=H(this,di))==null||i.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,a;let{key:r}=e,n=this.items,s=(a=(i=G(this,za,io).call(this,e))!=null?i:G(this,Il,Sm).call(this))!=null?a:n[0],l=n.indexOf(s),u=Math.max(0,l);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=n.length-1),u<0&&(u=n.length-1),u>n.length-1&&(u=0),G(this,Qa,ao).call(this,n[u]),n[u].focus()}};Je=new WeakMap;di=new WeakMap;Rt=new WeakMap;Qn=new WeakMap;Xn=new WeakMap;ui=new WeakMap;Xa=new WeakMap;El=new WeakSet;fm=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();if(["header","title"].includes(e.name)){let i=this.shadowRoot.querySelector('slot[name="header"]');i.hidden=e.assignedNodes().length===0}e.name||H(this,eo).call(this)};eo=new WeakMap;Jn=new WeakSet;bl=function(){var t;let e=this.shadowRoot.querySelector("#layout-row"),i=(t=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:t.trim();e.setAttribute("media",i==="row"?"":"width:0")};gl=new WeakSet;vm=function(t){Xe(this,Rt,t.relatedTarget),le(this,t.relatedTarget)||(this.hidden=!this.hidden)};_l=new WeakSet;Em=function(){var t;(t=H(this,Rt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),ot(ja(this),H(this,Gi)),ot(this,H(this,Yi))};Al=new WeakSet;bm=function(){var t;(t=H(this,Rt))==null||t.setAttribute("aria-expanded","false"),st(ja(this),H(this,Gi)),st(this,H(this,Yi))};Gi=new WeakMap;Yi=new WeakMap;qi=new WeakSet;Ja=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=hm({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=ja(this).getBoundingClientRect(),n=r.width-e-t,s=r.height-i-this.offsetHeight,{style:l}=H(this,Xa);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),A=l.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),_=r.height-A-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${_}px`)};to=new WeakSet;wl=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=H(this,Xa);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,n=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${r}px`),G(this,qi,Ja).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,qi,Ja).call(this);a.removeProperty("--media-menu-transition-in")};yl=new WeakSet;gm=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(H(this,Rl,_m))){(e=H(this,di))==null||e.focus(),this.hidden=!0;return}let i=G(this,za,io).call(this,t);!i||i.hasAttribute("disabled")||(G(this,Qa,ao).call(this,i),this.handleSelect(t))};Rl=new WeakSet;_m=function(){var t;return(t=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:t.find(i=>i.matches('button[part~="back"]'))};Tl=new WeakSet;Am=function(t){if(t.target===this)return;G(this,Ll,ym).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new wt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,to,wl).call(this,!0)};Ll=new WeakSet;ym=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};kl=new WeakSet;Tm=function(t){var e;le(this,t.relatedTarget)||(H(this,ui)&&((e=H(this,di))==null||e.focus()),H(this,Rt)&&H(this,Rt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Sl=new WeakSet;km=function(t){var e,i,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=t;if(!(l||u||c)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if(H(this,ui)){this.hidden=!0;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((n=H(this,di))==null||n.focus(),H(this,ui)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};za=new WeakSet;io=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Il=new WeakSet;Sm=function(){return this.items.find(t=>t.tabIndex===0)};Qa=new WeakSet;ao=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};jn=new WeakSet;Cl=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?t.checked=!t.checked:t.checked=!0,this.checkedItems.some((a,r)=>a!=i[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};ne.template=Im;function Zf(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function ja(t){var e;return(e=t.getAttribute("bounds")?Ue(t,`#${t.getAttribute("bounds")}`):q(t)||t.parentElement)!=null?e:t}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",ne);var Ul=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},tt=(t,e,i)=>(Ul(t,e,"read from private field"),i?i.call(t):e.get(t)),ft=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},xl=(t,e,i,a)=>(Ul(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),et=(t,e,i)=>(Ul(t,e,"access private method"),i),ro,tr,Dl,Cm,Bl,Mm,Hl,wm,it,Zi,ir,Ol,Rm,no,Nl,Lm=h.createElement("template");Lm.innerHTML=`
2779
+ `;var li={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ne=class extends d.HTMLElement{constructor(){super(),G(this,vl),G(this,Jn),G(this,bl),G(this,gl),G(this,_l),G(this,qi),G(this,to),G(this,Al),G(this,wl),G(this,Tl),G(this,Ll),G(this,yl),G(this,kl),G(this,za),G(this,Sl),G(this,Qa),G(this,jn),G(this,Je,null),G(this,di,null),G(this,Lt,null),G(this,Qn,new Set),G(this,Xn,void 0),G(this,ui,!1),G(this,Xa,null),G(this,eo,()=>{let e=H(this,Qn),t=new Set(this.items);for(let a of e)t.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of t)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));Xe(this,Qn,t)}),G(this,Gi,()=>{Y(this,qi,Ja).call(this),Y(this,to,Ml).call(this,!1)}),G(this,Yi,()=>{Y(this,qi,Ja).call(this)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),Xe(this,Xn,new MutationObserver(H(this,eo))),H(this,Xn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[li.DISABLED,li.HIDDEN,li.STYLE,li.ANCHOR,L.MEDIA_CONTROLLER]}static formatMenuItemText(e,t){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":Y(this,vl,Em).call(this,e);break;case"invoke":Y(this,bl,bm).call(this,e);break;case"click":Y(this,Al,Am).call(this,e);break;case"toggle":Y(this,Tl,ym).call(this,e);break;case"focusout":Y(this,yl,Sm).call(this,e);break;case"keydown":Y(this,kl,Im).call(this,e);break}}connectedCallback(){var e,t;Xe(this,Xa,Bo(this.shadowRoot,":host")),Y(this,Jn,El).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Xe(this,Je,kr(this)),(t=(e=H(this,Je))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(ot(ja(this),H(this,Gi)),ot(this,H(this,Yi)))}disconnectedCallback(){var e,t;st(ja(this),H(this,Gi)),st(this,H(this,Yi)),this.disable(),(t=(e=H(this,Je))==null?void 0:e.unassociateElement)==null||t.call(e,this),Xe(this,Je,null)}attributeChangedCallback(e,t,a){var r,n,s,l;e===li.HIDDEN&&a!==t?(H(this,ui)||Xe(this,ui,!0),this.hidden?Y(this,_l,_m).call(this):Y(this,gl,gm).call(this),this.dispatchEvent(new zn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===L.MEDIA_CONTROLLER?(t&&((n=(r=H(this,Je))==null?void 0:r.unassociateElement)==null||n.call(r,this),Xe(this,Je,null)),a&&this.isConnected&&(Xe(this,Je,kr(this)),(l=(s=H(this,Je))==null?void 0:s.associateElement)==null||l.call(s,this))):e===li.DISABLED&&a!==t?a==null?this.enable():this.disable():e===li.STYLE&&a!==t&&Y(this,Jn,El).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=Pt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(zf)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(a=>a.value===e);t&&Y(this,jn,Il).call(this,t)}focus(){if(Xe(this,di,fa()),this.items.length){Y(this,Qa,ao).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let a=Y(this,za,io).call(this,e);a&&(Y(this,jn,Il).call(this,a,a.type==="checkbox"),H(this,Lt)&&!this.hidden&&((t=H(this,di))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,a;let{key:r}=e,n=this.items,s=(a=(t=Y(this,za,io).call(this,e))!=null?t:Y(this,Sl,Cm).call(this))!=null?a:n[0],l=n.indexOf(s),u=Math.max(0,l);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=n.length-1),u<0&&(u=n.length-1),u>n.length-1&&(u=0),Y(this,Qa,ao).call(this,n[u]),n[u].focus()}};Je=new WeakMap;di=new WeakMap;Lt=new WeakMap;Qn=new WeakMap;Xn=new WeakMap;ui=new WeakMap;Xa=new WeakMap;vl=new WeakSet;Em=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();if(["header","title"].includes(e.name)){let t=this.shadowRoot.querySelector('slot[name="header"]');t.hidden=e.assignedNodes().length===0}e.name||H(this,eo).call(this)};eo=new WeakMap;Jn=new WeakSet;El=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=(i=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:i.trim();e.setAttribute("media",t==="row"?"":"width:0")};bl=new WeakSet;bm=function(i){Xe(this,Lt,i.relatedTarget),le(this,i.relatedTarget)||(this.hidden=!this.hidden)};gl=new WeakSet;gm=function(){var i;(i=H(this,Lt))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),ot(ja(this),H(this,Gi)),ot(this,H(this,Yi))};_l=new WeakSet;_m=function(){var i;(i=H(this,Lt))==null||i.setAttribute("aria-expanded","false"),st(ja(this),H(this,Gi)),st(this,H(this,Yi))};Gi=new WeakMap;Yi=new WeakMap;qi=new WeakSet;Ja=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=fm({anchor:this.anchorElement,floating:this,placement:"top-start"});i!=null||(i=this.offsetWidth);let r=ja(this).getBoundingClientRect(),n=r.width-e-i,s=r.height-t-this.offsetHeight,{style:l}=H(this,Xa);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),T=l.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),_=r.height-T-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${_}px`)};to=new WeakSet;Ml=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=H(this,Xa);if(i||a.setProperty("--media-menu-transition-in","none"),t){let r=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${r}px`),Y(this,qi,Ja).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Y(this,qi,Ja).call(this);a.removeProperty("--media-menu-transition-in")};Al=new WeakSet;Am=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(H(this,wl,Tm))){(e=H(this,di))==null||e.focus(),this.hidden=!0;return}let t=Y(this,za,io).call(this,i);!t||t.hasAttribute("disabled")||(Y(this,Qa,ao).call(this,t),this.handleSelect(i))};wl=new WeakSet;Tm=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.matches('button[part~="back"]'))};Tl=new WeakSet;ym=function(i){if(i.target===this)return;Y(this,Ll,km).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let t of e)t.invokeTargetElement!=i.target&&i.newState=="open"&&t.getAttribute("aria-expanded")=="true"&&!t.invokeTargetElement.hidden&&t.invokeTargetElement.dispatchEvent(new wt({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Y(this,to,Ml).call(this,!0)};Ll=new WeakSet;km=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};yl=new WeakSet;Sm=function(i){var e;le(this,i.relatedTarget)||(H(this,ui)&&((e=H(this,di))==null||e.focus()),H(this,Lt)&&H(this,Lt)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};kl=new WeakSet;Im=function(i){var e,t,a,r,n;let{key:s,ctrlKey:l,altKey:u,metaKey:c}=i;if(!(l||u||c)&&this.keysUsed.includes(s))if(i.preventDefault(),i.stopPropagation(),s==="Tab"){if(H(this,ui)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((n=H(this,di))==null||n.focus(),H(this,ui)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};za=new WeakSet;io=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Sl=new WeakSet;Cm=function(){return this.items.find(i=>i.tabIndex===0)};Qa=new WeakSet;ao=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};jn=new WeakSet;Il=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};ne.template=Mm;function zf(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function ja(i){var e;return(e=i.getAttribute("bounds")?Ue(i,`#${i.getAttribute("bounds")}`):q(i)||i.parentElement)!=null?e:i}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",ne);var Pl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tt=(i,e,t)=>(Pl(i,e,"read from private field"),t?t.call(i):e.get(i)),ft=(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)},Rl=(i,e,t,a)=>(Pl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),et=(i,e,t)=>(Pl(i,e,"access private method"),t),ro,tr,xl,wm,Ul,Lm,Bl,Rm,it,Zi,ir,Dl,xm,no,Ol,Dm=h.createElement("template");Dm.innerHTML=`
2774
2780
  <style>
2775
2781
  :host {
2776
2782
  transition: var(--media-menu-item-transition,
@@ -2779,7 +2785,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2779
2785
  );
2780
2786
  outline: var(--media-menu-item-outline, 0);
2781
2787
  outline-offset: var(--media-menu-item-outline-offset, -1px);
2782
- cursor: pointer;
2788
+ cursor: var(--media-cursor, pointer);
2783
2789
  display: flex;
2784
2790
  align-items: center;
2785
2791
  align-self: stretch;
@@ -2797,7 +2803,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2797
2803
  }
2798
2804
 
2799
2805
  :host(:hover) {
2800
- cursor: pointer;
2806
+ cursor: var(--media-cursor, pointer);
2801
2807
  background: var(--media-menu-item-hover-background, rgb(92 92 102 / .5));
2802
2808
  outline: var(--media-menu-item-hover-outline);
2803
2809
  outline-offset: var(--media-menu-item-hover-outline-offset, var(--media-menu-item-outline-offset, -1px));
@@ -2886,7 +2892,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2886
2892
  <slot name="description"></slot>
2887
2893
  <slot name="suffix"></slot>
2888
2894
  <slot name="submenu"></slot>
2889
- `;var Ce={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Lt=class extends d.HTMLElement{constructor(){super(),ft(this,Dl),ft(this,Bl),ft(this,Hl),ft(this,Zi),ft(this,Ol),ft(this,no),ft(this,ro,!1),ft(this,tr,void 0),ft(this,it,()=>{var e,i;this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(i=r==null?void 0:r.dataset.description)!=null?i:r==null?void 0:r.text,s=h.createElement("span");s.textContent=n!=null?n:"",a.replaceChildren(s)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0))),this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Ce.TYPE,Ce.DISABLED,Ce.CHECKED,Ce.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),er(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":et(this,Dl,Cm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":et(this,Ol,Rm).call(this,e);break;case"keyup":et(this,Zi,ir).call(this,e);break}}attributeChangedCallback(e,i,a){e===Ce.CHECKED&&er(this)&&!tt(this,ro)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Ce.TYPE&&a!==i?this.role="menuitem"+a:e===Ce.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Ce.DISABLED)||this.enable(),this.role="menuitem"+this.type,xl(this,tr,Pl(this,this.parentNode)),et(this,no,Nl).call(this)}disconnectedCallback(){this.disable(),et(this,no,Nl).call(this),xl(this,tr,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Pt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(Ce.TYPE))!=null?e:""}set type(e){this.setAttribute(Ce.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Ce.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Ce.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(er(this))return this.getAttribute("aria-checked")==="true"}set checked(e){er(this)&&(xl(this,ro,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){er(this)||this.invokeTargetElement&&le(this,e.target)&&this.invokeTargetElement.dispatchEvent(new wt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};ro=new WeakMap;tr=new WeakMap;Dl=new WeakSet;Cm=function(t){let e=t.target;if(!(e!=null&&e.name))for(let a of e.assignedNodes({flatten:!0}))a instanceof Text&&a.textContent.trim()===""&&a.remove();e.name==="submenu"&&(this.submenuElement?et(this,Bl,Mm).call(this):et(this,Hl,wm).call(this))};Bl=new WeakSet;Mm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",tt(this,it)),this.submenuElement.addEventListener("addmenuitem",tt(this,it)),this.submenuElement.addEventListener("removemenuitem",tt(this,it)),tt(this,it).call(this)};Hl=new WeakSet;wm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",tt(this,it)),this.submenuElement.removeEventListener("addmenuitem",tt(this,it)),this.submenuElement.removeEventListener("removemenuitem",tt(this,it)),tt(this,it).call(this)};it=new WeakMap;Zi=new WeakSet;ir=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",et(this,Zi,ir));return}this.handleClick(t)};Ol=new WeakSet;Rm=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",et(this,Zi,ir));return}this.addEventListener("keyup",et(this,Zi,ir),{once:!0})};no=new WeakSet;Nl=function(){var t;let e=(t=tt(this,tr))==null?void 0:t.radioGroupItems;if(!e)return;let i=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();i||(i=e[0]);for(let a of e)a.setAttribute("aria-checked","false");i==null||i.setAttribute("aria-checked","true")};Lt.template=Lm;function er(t){return t.type==="radio"||t.type==="checkbox"}function Pl(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?Pl(t,i):e!=null&&e.items?e:Pl(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",Lt);var xm=h.createElement("template");xm.innerHTML=ne.template.innerHTML+`
2895
+ `;var Ce={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Rt=class extends d.HTMLElement{constructor(){super(),ft(this,xl),ft(this,Ul),ft(this,Bl),ft(this,Zi),ft(this,Dl),ft(this,no),ft(this,ro,!1),ft(this,tr,void 0),ft(this,it,()=>{var e,t;this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(t=r==null?void 0:r.dataset.description)!=null?t:r==null?void 0:r.text,s=h.createElement("span");s.textContent=n!=null?n:"",a.replaceChildren(s)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0))),this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Ce.TYPE,Ce.DISABLED,Ce.CHECKED,Ce.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),er(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":et(this,xl,wm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":et(this,Dl,xm).call(this,e);break;case"keyup":et(this,Zi,ir).call(this,e);break}}attributeChangedCallback(e,t,a){e===Ce.CHECKED&&er(this)&&!tt(this,ro)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Ce.TYPE&&a!==t?this.role="menuitem"+a:e===Ce.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Ce.DISABLED)||this.enable(),this.role="menuitem"+this.type,Rl(this,tr,Nl(this,this.parentNode)),et(this,no,Ol).call(this)}disconnectedCallback(){this.disable(),et(this,no,Ol).call(this),Rl(this,tr,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Pt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(Ce.TYPE))!=null?e:""}set type(e){this.setAttribute(Ce.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Ce.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Ce.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(er(this))return this.getAttribute("aria-checked")==="true"}set checked(e){er(this)&&(Rl(this,ro,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){er(this)||this.invokeTargetElement&&le(this,e.target)&&this.invokeTargetElement.dispatchEvent(new wt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};ro=new WeakMap;tr=new WeakMap;xl=new WeakSet;wm=function(i){let e=i.target;if(!(e!=null&&e.name))for(let a of e.assignedNodes({flatten:!0}))a instanceof Text&&a.textContent.trim()===""&&a.remove();e.name==="submenu"&&(this.submenuElement?et(this,Ul,Lm).call(this):et(this,Bl,Rm).call(this))};Ul=new WeakSet;Lm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",tt(this,it)),this.submenuElement.addEventListener("addmenuitem",tt(this,it)),this.submenuElement.addEventListener("removemenuitem",tt(this,it)),tt(this,it).call(this)};Bl=new WeakSet;Rm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",tt(this,it)),this.submenuElement.removeEventListener("addmenuitem",tt(this,it)),this.submenuElement.removeEventListener("removemenuitem",tt(this,it)),tt(this,it).call(this)};it=new WeakMap;Zi=new WeakSet;ir=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",et(this,Zi,ir));return}this.handleClick(i)};Dl=new WeakSet;xm=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!this.keysUsed.includes(a)){this.removeEventListener("keyup",et(this,Zi,ir));return}this.addEventListener("keyup",et(this,Zi,ir),{once:!0})};no=new WeakSet;Ol=function(){var i;let e=(i=tt(this,tr))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let a of e)a.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};Rt.template=Dm;function er(i){return i.type==="radio"||i.type==="checkbox"}function Nl(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Nl(i,t):e!=null&&e.items?e:Nl(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",Rt);var Om=h.createElement("template");Om.innerHTML=ne.template.innerHTML+`
2890
2896
  <style>
2891
2897
  :host {
2892
2898
  --_menu-bg: rgb(20 20 30 / .8);
@@ -2920,7 +2926,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2920
2926
  --media-settings-menu-item-opacity: 0;
2921
2927
  }
2922
2928
  </style>
2923
- `;var ar=class extends ne{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-settings-menu-button")}};ar.template=xm;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",ar);var Dm,oo=h.createElement("template");oo.innerHTML=Lt.template.innerHTML+`
2929
+ `;var ar=class extends ne{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-settings-menu-button")}};ar.template=Om;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",ar);var Nm,oo=h.createElement("template");oo.innerHTML=Rt.template.innerHTML+`
2924
2930
  <style>
2925
2931
  slot:not([name="submenu"]) {
2926
2932
  opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
@@ -2930,11 +2936,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2930
2936
  background: transparent;
2931
2937
  }
2932
2938
  </style>
2933
- `;(Dm=oo.content)!=null&&Dm.querySelector&&(oo.content.querySelector('slot[name="suffix"]').innerHTML=`
2939
+ `;(Nm=oo.content)!=null&&Nm.querySelector&&(oo.content.querySelector('slot[name="suffix"]').innerHTML=`
2934
2940
  <svg aria-hidden="true" viewBox="0 0 20 24">
2935
2941
  <path d="m8.12 17.585-.742-.669 4.2-4.665-4.2-4.666.743-.669 4.803 5.335-4.803 5.334Z"/>
2936
2942
  </svg>
2937
- `);var rr=class extends Lt{};rr.template=oo;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",rr);var Ee=class extends V{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Pt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new wt({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",Ee);var Om=h.createElement("template");Om.innerHTML=`
2943
+ `);var rr=class extends Rt{};rr.template=oo;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",rr);var Ee=class extends K{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Pt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new wt({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",Ee);var Pm=h.createElement("template");Pm.innerHTML=`
2938
2944
  <style>
2939
2945
  :host([aria-expanded="true"]) slot[name=tooltip] {
2940
2946
  display: none;
@@ -2945,25 +2951,25 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2945
2951
  <path d="M4.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"/>
2946
2952
  </svg>
2947
2953
  </slot>
2948
- `;var so=class extends Ee{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:Om,tooltipContent:f("Settings")})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",f("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:q(this).querySelector("media-settings-menu")}};d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",so);var Vl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Nm=(t,e,i)=>(Vl(t,e,"read from private field"),i?i.call(t):e.get(t)),lo=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},$l=(t,e,i,a)=>(Vl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),uo=(t,e,i)=>(Vl(t,e,"access private method"),i),nr,ho,co,Wl,mo,Fl,po=class extends ne{constructor(){super(...arguments),lo(this,co),lo(this,mo),lo(this,nr,[]),lo(this,ho,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_AUDIO_TRACK_ENABLED&&i!==a?this.value=a:e===o.MEDIA_AUDIO_TRACK_LIST&&i!==a&&($l(this,nr,Hd(a!=null?a:"")),uo(this,co,Wl).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",uo(this,mo,Fl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",uo(this,mo,Fl))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=q(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Nm(this,nr)}set mediaAudioTrackList(e){$l(this,nr,e),uo(this,co,Wl).call(this)}get mediaAudioTrackEnabled(){var e;return(e=C(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};nr=new WeakMap;ho=new WeakMap;co=new WeakSet;Wl=function(){if(Nm(this,ho)===JSON.stringify(this.mediaAudioTrackList))return;$l(this,ho,JSON.stringify(this.mediaAudioTrackList));let t=this.mediaAudioTrackList;this.defaultSlot.textContent="";for(let e of t){let i=this.formatMenuItemText(e.label,e),a=je({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(a)}};mo=new WeakSet;Fl=function(){if(this.value==null)return;let t=new d.CustomEvent(p.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",po);var zf=`<svg aria-hidden="true" viewBox="0 0 24 24">
2954
+ `;var so=class extends Ee{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:Pm,tooltipContent:v("Settings")})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",v("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:q(this).querySelector("media-settings-menu")}};d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",so);var Fl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Um=(i,e,t)=>(Fl(i,e,"read from private field"),t?t.call(i):e.get(i)),lo=(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)},Hl=(i,e,t,a)=>(Fl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),uo=(i,e,t)=>(Fl(i,e,"access private method"),t),nr,ho,co,$l,mo,Wl,po=class extends ne{constructor(){super(...arguments),lo(this,co),lo(this,mo),lo(this,nr,[]),lo(this,ho,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}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&&(Hl(this,nr,Bd(a!=null?a:"")),uo(this,co,$l).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",uo(this,mo,Wl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",uo(this,mo,Wl))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=q(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Um(this,nr)}set mediaAudioTrackList(e){Hl(this,nr,e),uo(this,co,$l).call(this)}get mediaAudioTrackEnabled(){var e;return(e=C(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};nr=new WeakMap;ho=new WeakMap;co=new WeakSet;$l=function(){if(Um(this,ho)===JSON.stringify(this.mediaAudioTrackList))return;Hl(this,ho,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="";for(let e of i){let t=this.formatMenuItemText(e.label,e),a=je({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});a.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(a)}};mo=new WeakSet;Wl=function(){if(this.value==null)return;let i=new d.CustomEvent(f.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",po);var Qf=`<svg aria-hidden="true" viewBox="0 0 24 24">
2949
2955
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
2950
2956
  <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"/>
2951
- </svg>`,Pm=h.createElement("template");Pm.innerHTML=`
2957
+ </svg>`,Bm=h.createElement("template");Bm.innerHTML=`
2952
2958
  <style>
2953
2959
  :host([aria-expanded="true"]) slot[name=tooltip] {
2954
2960
  display: none;
2955
2961
  }
2956
2962
  </style>
2957
- <slot name="icon">${zf}</slot>
2958
- `;var fo=class extends Ee{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Pm,tooltipContent:f("Audio")})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",f("Audio"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=q(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=C(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",fo);var Zl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Qf=(t,e,i)=>(Zl(t,e,"read from private field"),i?i.call(t):e.get(t)),Kl=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Xf=(t,e,i,a)=>(Zl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gl=(t,e,i)=>(Zl(t,e,"access private method"),i),Eo,Yl,Hm,vo,ql,Jf=`
2963
+ <slot name="icon">${Qf}</slot>
2964
+ `;var fo=class extends Ee{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Bm,tooltipContent:v("Audio")})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",v("Audio"))}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=q(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=C(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){M(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",fo);var ql=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Xf=(i,e,t)=>(ql(i,e,"read from private field"),t?t.call(i):e.get(i)),Vl=(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)},Jf=(i,e,t,a)=>(ql(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Kl=(i,e,t)=>(ql(i,e,"access private method"),t),Eo,Gl,Wm,vo,Yl,jf=`
2959
2965
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
2960
2966
  <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"/>
2961
- </svg>`,$m=h.createElement("template");$m.innerHTML=ne.template.innerHTML+`
2962
- <slot name="captions-indicator" hidden>${Jf}</slot>`;var or=class extends ne{constructor(){super(...arguments),Kl(this,Yl),Kl(this,vo),Kl(this,Eo,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_LIST&&i!==a?Gl(this,Yl,Hm).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Gl(this,vo,ql))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Gl(this,vo,ql))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Um(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Bm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Um(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Bm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Eo=new WeakMap;Yl=new WeakSet;Hm=function(){var t;if(Qf(this,Eo)===JSON.stringify(this.mediaSubtitlesList))return;Xf(this,Eo,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,i=je({type:"radio",text:this.formatMenuItemText("Off"),value:"off",checked:e});i.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(i);let a=this.mediaSubtitlesList;for(let r of a){let n=je({type:"radio",text:this.formatMenuItemText(r.label,r),value:Pr(r),checked:this.value==Pr(r)});n.prepend(Ne(this,"checked-indicator")),((t=r.kind)!=null?t:"subs")==="captions"&&n.append(Ne(this,"captions-indicator")),this.defaultSlot.append(n)}};vo=new WeakSet;ql=function(){let t=this.mediaSubtitlesShowing,e=this.getAttribute(o.MEDIA_SUBTITLES_SHOWING),i=this.value!==e;if(t!=null&&t.length&&i&&this.dispatchEvent(new d.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),!this.value||!i)return;let a=new d.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};or.template=$m;var Um=(t,e)=>{let i=t.getAttribute(e);return i?Ht(i):[]},Bm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=dt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",or);var jf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ev=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},tv=(t,e,i,a)=>(jf(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),zl,iv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2967
+ </svg>`,Fm=h.createElement("template");Fm.innerHTML=ne.template.innerHTML+`
2968
+ <slot name="captions-indicator" hidden>${jf}</slot>`;var or=class extends ne{constructor(){super(...arguments),Vl(this,Gl),Vl(this,vo),Vl(this,Eo,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_LIST&&t!==a?Kl(this,Gl,Wm).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&t!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Kl(this,vo,Yl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Kl(this,vo,Yl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Hm(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){$m(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Hm(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){$m(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Eo=new WeakMap;Gl=new WeakSet;Wm=function(){var i;if(Xf(this,Eo)===JSON.stringify(this.mediaSubtitlesList))return;Jf(this,Eo,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,t=je({type:"radio",text:this.formatMenuItemText("Off"),value:"off",checked:e});t.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(t);let a=this.mediaSubtitlesList;for(let r of a){let n=je({type:"radio",text:this.formatMenuItemText(r.label,r),value:Pr(r),checked:this.value==Pr(r)});n.prepend(Ne(this,"checked-indicator")),((i=r.kind)!=null?i:"subs")==="captions"&&n.append(Ne(this,"captions-indicator")),this.defaultSlot.append(n)}};vo=new WeakSet;Yl=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 d.CustomEvent(f.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new d.CustomEvent(f.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};or.template=Fm;var Hm=(i,e)=>{let t=i.getAttribute(e);return t?Ht(t):[]},$m=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=dt(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",or);var ev=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tv=(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)},iv=(i,e,t,a)=>(ev(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Zl,av=`<svg aria-hidden="true" viewBox="0 0 26 24">
2963
2969
  <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"/>
2964
- </svg>`,av=`<svg aria-hidden="true" viewBox="0 0 26 24">
2970
+ </svg>`,rv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2965
2971
  <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"/>
2966
- </svg>`,Km=h.createElement("template");Km.innerHTML=`
2972
+ </svg>`,Ym=h.createElement("template");Ym.innerHTML=`
2967
2973
  <style>
2968
2974
  :host([aria-checked="true"]) slot[name=off] {
2969
2975
  display: none !important;
@@ -2980,10 +2986,10 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2980
2986
  </style>
2981
2987
 
2982
2988
  <slot name="icon">
2983
- <slot name="on">${iv}</slot>
2984
- <slot name="off">${av}</slot>
2989
+ <slot name="on">${av}</slot>
2990
+ <slot name="off">${rv}</slot>
2985
2991
  </slot>
2986
- `;var Wm=t=>{t.setAttribute("aria-checked",Ur(t).toString())},bo=class extends Ee{constructor(e={}){super({slotTemplate:Km,tooltipContent:f("Captions"),...e}),ev(this,zl,void 0),tv(this,zl,!1)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",f("closed captions")),Wm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&Wm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=q(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Fm(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Vm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Fm(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Vm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};zl=new WeakMap;var Fm=(t,e)=>{let i=t.getAttribute(e);return i?Ht(i):[]},Vm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=dt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",bo);var Gm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},go=(t,e,i)=>(Gm(t,e,"read from private field"),i?i.call(t):e.get(t)),Ql=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},sr=(t,e,i)=>(Gm(t,e,"access private method"),i),zi,lr,_o,Ao,Jl,Xl={RATES:"rates"},yo=class extends ne{constructor(){super(),Ql(this,lr),Ql(this,Ao),Ql(this,zi,new Be(this,Xl.RATES,{defaultValue:Os})),sr(this,lr,_o).call(this)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Xl.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PLAYBACK_RATE&&i!=a?this.value=a:e===Xl.RATES&&i!=a&&(go(this,zi).value=a,sr(this,lr,_o).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",sr(this,Ao,Jl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",sr(this,Ao,Jl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-playback-rate-menu-button")}get rates(){return go(this,zi)}set rates(e){e?Array.isArray(e)&&(go(this,zi).value=e.join(" ")):go(this,zi).value="",sr(this,lr,_o).call(this)}get mediaPlaybackRate(){return x(this,o.MEDIA_PLAYBACK_RATE,Ri)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}};zi=new WeakMap;lr=new WeakSet;_o=function(){this.defaultSlot.textContent="";for(let t of this.rates){let e=je({type:"radio",text:this.formatMenuItemText(`${t}x`,t),value:t,checked:this.mediaPlaybackRate==t});e.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(e)}};Ao=new WeakSet;Jl=function(){if(!this.value)return;let t=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",yo);var rv=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},To=(t,e,i)=>(rv(t,e,"read from private field"),i?i.call(t):e.get(t)),nv=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Qi,jl={RATES:"rates"},ov=[1,1.2,1.5,1.7,2],ed=1,Ym=h.createElement("template");Ym.innerHTML=`
2992
+ `;var Vm=i=>{i.setAttribute("aria-checked",Ur(i).toString())},bo=class extends Ee{constructor(e={}){super({slotTemplate:Ym,tooltipContent:v("Captions"),...e}),tv(this,Zl,void 0),iv(this,Zl,!1)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",v("closed captions")),Vm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_SHOWING&&Vm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=q(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Km(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Gm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Km(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Gm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Zl=new WeakMap;var Km=(i,e)=>{let t=i.getAttribute(e);return t?Ht(t):[]},Gm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=dt(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",bo);var qm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},go=(i,e,t)=>(qm(i,e,"read from private field"),t?t.call(i):e.get(i)),zl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},sr=(i,e,t)=>(qm(i,e,"access private method"),t),zi,lr,_o,Ao,Xl,Ql={RATES:"rates"},To=class extends ne{constructor(){super(),zl(this,lr),zl(this,Ao),zl(this,zi,new Be(this,Ql.RATES,{defaultValue:Ds})),sr(this,lr,_o).call(this)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Ql.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===Ql.RATES&&t!=a&&(go(this,zi).value=a,sr(this,lr,_o).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",sr(this,Ao,Xl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",sr(this,Ao,Xl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-playback-rate-menu-button")}get rates(){return go(this,zi)}set rates(e){e?Array.isArray(e)&&(go(this,zi).value=e.join(" ")):go(this,zi).value="",sr(this,lr,_o).call(this)}get mediaPlaybackRate(){return x(this,o.MEDIA_PLAYBACK_RATE,Li)}set mediaPlaybackRate(e){N(this,o.MEDIA_PLAYBACK_RATE,e)}};zi=new WeakMap;lr=new WeakSet;_o=function(){this.defaultSlot.textContent="";for(let i of this.rates){let e=je({type:"radio",text:this.formatMenuItemText(`${i}x`,i),value:i,checked:this.mediaPlaybackRate==i});e.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(e)}};Ao=new WeakSet;Xl=function(){if(!this.value)return;let i=new d.CustomEvent(f.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",To);var nv=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},yo=(i,e,t)=>(nv(i,e,"read from private field"),t?t.call(i):e.get(i)),ov=(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,Jl={RATES:"rates"},sv=[1,1.2,1.5,1.7,2],jl=1,Zm=h.createElement("template");Zm.innerHTML=`
2987
2993
  <style>
2988
2994
  :host {
2989
2995
  min-width: 5ch;
@@ -2995,16 +3001,16 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2995
3001
  }
2996
3002
  </style>
2997
3003
  <slot name="icon"></slot>
2998
- `;var ko=class extends Ee{constructor(e={}){super({slotTemplate:Ym,tooltipContent:f("Playback rate"),...e}),nv(this,Qi,new Be(this,jl.RATES,{defaultValue:ov})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${ed}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,jl.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===jl.RATES&&(To(this,Qi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?ed:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",f("Playback rate {playbackRate}",{playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:q(this).querySelector("media-playback-rate-menu")}get rates(){return To(this,Qi)}set rates(e){e?Array.isArray(e)&&(To(this,Qi).value=e.join(" ")):To(this,Qi).value=""}get mediaPlaybackRate(){return x(this,o.MEDIA_PLAYBACK_RATE,ed)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}};Qi=new WeakMap;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",ko);var id=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dr=(t,e,i)=>(id(t,e,"read from private field"),i?i.call(t):e.get(t)),So=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},qm=(t,e,i,a)=>(id(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Xi=(t,e,i)=>(id(t,e,"access private method"),i),ur,ji,Ji,cr,Io,td,Co=class extends ne{constructor(){super(...arguments),So(this,Ji),So(this,Io),So(this,ur,[]),So(this,ji,{})}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_RENDITION_SELECTED&&i!==a?(this.value=a!=null?a:"auto",Xi(this,Ji,cr).call(this)):e===o.MEDIA_RENDITION_LIST&&i!==a?(qm(this,ur,Ud(a)),Xi(this,Ji,cr).call(this)):e===o.MEDIA_HEIGHT&&i!==a&&Xi(this,Ji,cr).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Xi(this,Io,td))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Xi(this,Io,td))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return dr(this,ur)}set mediaRenditionList(e){qm(this,ur,e),Xi(this,Ji,cr).call(this)}get mediaRenditionSelected(){return C(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return x(this,o.MEDIA_HEIGHT)}set mediaHeight(e){O(this,o.MEDIA_HEIGHT,e)}};ur=new WeakMap;ji=new WeakMap;Ji=new WeakSet;cr=function(){if(dr(this,ji).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&dr(this,ji).mediaHeight===this.mediaHeight)return;dr(this,ji).mediaRenditionList=JSON.stringify(this.mediaRenditionList),dr(this,ji).mediaHeight=this.mediaHeight;let t=this.mediaRenditionList.sort((n,s)=>s.height-n.height);for(let n of t)n.selected=n.id===this.mediaRenditionSelected;this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let n of t){let s=this.formatMenuItemText(`${Math.min(n.width,n.height)}p`,n),l=je({type:"radio",text:s,value:`${n.id}`,checked:n.selected&&!e});l.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(l)}let i=e?this.formatMenuItemText(`Auto (${this.mediaHeight}p)`):this.formatMenuItemText("Auto"),a=je({type:"radio",text:i,value:"auto",checked:e}),r=this.mediaHeight>0?`Auto (${this.mediaHeight}p)`:"Auto";a.dataset.description=r,a.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(a)};Io=new WeakSet;td=function(){if(this.value==null)return;let t=new d.CustomEvent(p.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",Co);var sv=`<svg aria-hidden="true" viewBox="0 0 24 24">
3004
+ `;var ko=class extends Ee{constructor(e={}){super({slotTemplate:Zm,tooltipContent:v("Playback rate"),...e}),ov(this,Qi,new Be(this,Jl.RATES,{defaultValue:sv})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${jl}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Jl.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===Jl.RATES&&(yo(this,Qi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?jl:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",v("Playback rate {playbackRate}",{playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:q(this).querySelector("media-playback-rate-menu")}get rates(){return yo(this,Qi)}set rates(e){e?Array.isArray(e)&&(yo(this,Qi).value=e.join(" ")):yo(this,Qi).value=""}get mediaPlaybackRate(){return x(this,o.MEDIA_PLAYBACK_RATE,jl)}set mediaPlaybackRate(e){N(this,o.MEDIA_PLAYBACK_RATE,e)}};Qi=new WeakMap;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",ko);var td=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},dr=(i,e,t)=>(td(i,e,"read from private field"),t?t.call(i):e.get(i)),So=(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)},zm=(i,e,t,a)=>(td(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Xi=(i,e,t)=>(td(i,e,"access private method"),t),ur,ji,Ji,cr,Io,ed,Co=class extends ne{constructor(){super(...arguments),So(this,Ji),So(this,Io),So(this,ur,[]),So(this,ji,{})}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_RENDITION_SELECTED&&t!==a?(this.value=a!=null?a:"auto",Xi(this,Ji,cr).call(this)):e===o.MEDIA_RENDITION_LIST&&t!==a?(zm(this,ur,Pd(a)),Xi(this,Ji,cr).call(this)):e===o.MEDIA_HEIGHT&&t!==a&&Xi(this,Ji,cr).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Xi(this,Io,ed))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Xi(this,Io,ed))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:q(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return dr(this,ur)}set mediaRenditionList(e){zm(this,ur,e),Xi(this,Ji,cr).call(this)}get mediaRenditionSelected(){return C(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return x(this,o.MEDIA_HEIGHT)}set mediaHeight(e){N(this,o.MEDIA_HEIGHT,e)}};ur=new WeakMap;ji=new WeakMap;Ji=new WeakSet;cr=function(){if(dr(this,ji).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&dr(this,ji).mediaHeight===this.mediaHeight)return;dr(this,ji).mediaRenditionList=JSON.stringify(this.mediaRenditionList),dr(this,ji).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort((n,s)=>s.height-n.height);for(let n of i)n.selected=n.id===this.mediaRenditionSelected;this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let n of i){let s=this.formatMenuItemText(`${Math.min(n.width,n.height)}p`,n),l=je({type:"radio",text:s,value:`${n.id}`,checked:n.selected&&!e});l.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(l)}let t=e?this.formatMenuItemText(`Auto (${this.mediaHeight}p)`):this.formatMenuItemText("Auto"),a=je({type:"radio",text:t,value:"auto",checked:e}),r=this.mediaHeight>0?`Auto (${this.mediaHeight}p)`:"Auto";a.dataset.description=r,a.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(a)};Io=new WeakSet;ed=function(){if(this.value==null)return;let i=new d.CustomEvent(f.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",Co);var lv=`<svg aria-hidden="true" viewBox="0 0 24 24">
2999
3005
  <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" />
3000
- </svg>`,Zm=h.createElement("template");Zm.innerHTML=`
3006
+ </svg>`,Qm=h.createElement("template");Qm.innerHTML=`
3001
3007
  <style>
3002
3008
  :host([aria-expanded="true"]) slot[name=tooltip] {
3003
3009
  display: none;
3004
3010
  }
3005
3011
  </style>
3006
- <slot name="icon">${sv}</slot>
3007
- `;var Mo=class extends Ee{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}constructor(){super({slotTemplate:Zm,tooltipContent:f("Quality")})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",f("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:q(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return C(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return x(this,o.MEDIA_HEIGHT)}set mediaHeight(e){O(this,o.MEDIA_HEIGHT,e)}};d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",Mo);var ad=fi.createElement("template");"innerHTML"in ad&&(ad.innerHTML=mm);var zm,Qm,wo=class extends si{};wo.template=(Qm=(zm=ad.content)==null?void 0:zm.children)==null?void 0:Qm[0];he.customElements.get("media-theme-gerwig")||he.customElements.define("media-theme-gerwig",wo);var lv="gerwig";var vt={SRC:"src",POSTER:"poster"},m={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge"},rd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref","proudlydisplaymuxbadge"];function dv(t,e){var a;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(m.STORYBOARD_SRC),placeholder:t.getAttribute("placeholder"),themeTemplate:cv(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(m.NOHOTKEYS),hotKeys:t.getAttribute(m.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,assetStartTime:t.assetStartTime,assetEndTime:t.assetEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerInitTime:t.playerInitTime,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(b.Attributes.TARGET_LIVE_WINDOW),streamType:Ha(t.getAttribute(b.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(m.PRIMARY_COLOR),secondaryColor:t.getAttribute(m.SECONDARY_COLOR),accentColor:t.getAttribute(m.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:mv(t),playbackRates:t.getAttribute(m.PLAYBACK_RATES),customDomain:(a=t.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:t.getAttribute(m.TITLE),novolumepref:t.hasAttribute(m.NO_VOLUME_PREF),castReceiver:t.castReceiver,proudlyDisplayMuxBadge:t.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE),...e,extraSourceParams:t.extraSourceParams}}var uv=mn.formatErrorMessage;mn.formatErrorMessage=t=>{var e,i;if(t instanceof b.MediaError){let a=cm(t,!1);return`
3012
+ <slot name="icon">${lv}</slot>
3013
+ `;var Mo=class extends Ee{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}constructor(){super({slotTemplate:Qm,tooltipContent:v("Quality")})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",v("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:q(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return C(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return x(this,o.MEDIA_HEIGHT)}set mediaHeight(e){N(this,o.MEDIA_HEIGHT,e)}};d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",Mo);var id=fi.createElement("template");"innerHTML"in id&&(id.innerHTML=pm);var Xm,Jm,wo=class extends si{};wo.template=(Jm=(Xm=id.content)==null?void 0:Xm.children)==null?void 0:Jm[0];he.customElements.get("media-theme-gerwig")||he.customElements.define("media-theme-gerwig",wo);var dv="gerwig";var vt={SRC:"src",POSTER:"poster"},m={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge"},ad=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref","proudlydisplaymuxbadge"];function uv(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src||!!i.currentSrc,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(m.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:mv(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(m.NOHOTKEYS),hotKeys:i.getAttribute(m.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableTracking:i.disableTracking,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,minResolution:i.minResolution,programStartTime:i.programStartTime,programEndTime:i.programEndTime,assetStartTime:i.assetStartTime,assetEndTime:i.assetEndTime,renditionOrder:i.renditionOrder,metadata:i.metadata,playerInitTime:i.playerInitTime,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(b.Attributes.TARGET_LIVE_WINDOW),streamType:Ha(i.getAttribute(b.Attributes.STREAM_TYPE)),primaryColor:i.getAttribute(m.PRIMARY_COLOR),secondaryColor:i.getAttribute(m.SECONDARY_COLOR),accentColor:i.getAttribute(m.ACCENT_COLOR),forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultDuration:i.defaultDuration,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:hv(i),playbackRates:i.getAttribute(m.PLAYBACK_RATES),customDomain:(a=i.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(m.TITLE),novolumepref:i.hasAttribute(m.NO_VOLUME_PREF),castReceiver:i.castReceiver,proudlyDisplayMuxBadge:i.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE),...e,extraSourceParams:i.extraSourceParams}}var cv=mn.formatErrorMessage;mn.formatErrorMessage=i=>{var e,t;if(i instanceof b.MediaError){let a=hm(i,!1);return`
3008
3014
  ${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
3009
3015
  ${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
3010
3016
  ${a==null?void 0:a.message}
@@ -3012,9 +3018,9 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3012
3018
  href="${a.linkUrl}"
3013
3019
  target="_blank"
3014
3020
  rel="external noopener"
3015
- aria-label="${(e=a.linkText)!=null?e:""} ${(0,L.i18n)("(opens in a new window)")}"
3016
- >${(i=a.linkText)!=null?i:a.linkUrl}</a
3021
+ aria-label="${(e=a.linkText)!=null?e:""} ${(0,R.i18n)("(opens in a new window)")}"
3022
+ >${(t=a.linkText)!=null?t:a.linkUrl}</a
3017
3023
  >`:""}
3018
3024
  </p>`:""}
3019
- `}return uv(t)};function cv(t){var i,a;let e=t.theme;if(e){let r=(a=(i=t.getRootNode())==null?void 0:i.getElementById)==null?void 0:a.call(i,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=he.customElements.get(e);if(n!=null&&n.template)return n.template}}function mv(t){var i;let e=(i=t.mediaController)==null?void 0:i.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Xm(t){let e=t.hasAttribute(m.TITLE)?{video_title:t.getAttribute(m.TITLE)}:{};return t.getAttributeNames().filter(i=>i.startsWith("metadata-")).reduce((i,a)=>{let r=t.getAttribute(a);return r!==null&&(i[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),i},e)}var hv=Object.values(b.Attributes),pv=Object.values(vt),fv=Object.values(m),nd=Hn(),od="mux-player",Jm={isDialogOpen:!1},vv={redundant_streams:!0},hr,pr,fr,Ot,vr,mi,$,xt,jm,sd,ci,eh,th,ih,ah,mr=class extends nl{constructor(){super();me(this,$);me(this,hr);me(this,pr,!1);me(this,fr,{});me(this,Ot,!0);me(this,vr,new Bn(this,"hotkeys"));me(this,mi,{...Jm,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&Q(this,$,sd).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var n;if(((n=i.composedPath()[0])==null?void 0:n.localName)!=="media-error-dialog")return;il(this,fi.activeElement)||i.preventDefault()}});Ae(this,hr,(0,L.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),Q(this,$,jm).call(this),this.isConnected&&Q(this,$,xt).call(this)}static get NAME(){return od}static get VERSION(){return nd}static get observedAttributes(){var i;return[...(i=nl.observedAttributes)!=null?i:[],...pv,...hv,...fv]}get mediaTheme(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("media-theme")}get mediaController(){var i,a;return(a=(i=this.mediaTheme)==null?void 0:i.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let i=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");i&&(i.metadata=Xm(this))}attributeChangedCallback(i,a,r){switch(Q(this,$,xt).call(this),super.attributeChangedCallback(i,a,r),i){case m.HOTKEYS:B(this,vr).value=r;break;case m.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ze((0,L.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time."));break}case m.THUMBNAIL_TOKEN:{if(r){let s=(0,L.parseJwt)(r);if(s){let{aud:l}=s,u=L.MuxJWTAud.THUMBNAIL;l!==u&&ze((0,L.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case m.STORYBOARD_TOKEN:{if(r){let s=(0,L.parseJwt)(r);if(s){let{aud:l}=s,u=L.MuxJWTAud.STORYBOARD;l!==u&&ze((0,L.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case m.DRM_TOKEN:{if(r){let s=(0,L.parseJwt)(r);if(s){let{aud:l}=s,u=L.MuxJWTAud.DRM;l!==u&&ze((0,L.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case b.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&ve((0,L.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case b.Attributes.STREAM_TYPE:r&&![L.StreamTypes.LIVE,L.StreamTypes.ON_DEMAND,L.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:al({file:"invalid-stream-type.md",message:(0,L.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===L.StreamTypes.LIVE?this.getAttribute(m.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[b.Attributes.PLAYBACK_ID,vt.SRC,m.PLAYBACK_TOKEN].includes(i)&&a!==r&&Ae(this,mi,{...B(this,mi),...Jm}),Q(this,$,ci).call(this,{[Wc(i)]:r})}get preferCmcd(){var i;return(i=this.getAttribute(b.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?L.CmcdTypeValues.includes(i)?this.setAttribute(b.Attributes.PREFER_CMCD,i):ze(`Invalid value for preferCmcd. Must be one of ${L.CmcdTypeValues.join()}`):this.removeAttribute(b.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(o.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(o.MEDIA_TIME_IS_LIVE)}get _hls(){var i;return(i=this.media)==null?void 0:i._hls}get mux(){var i;return(i=this.media)==null?void 0:i.mux}get theme(){var i;return(i=this.getAttribute(m.THEME))!=null?i:lv}set theme(i){this.setAttribute(m.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(rd.includes(r))continue;let n=i.getAttribute(r);a[Un(r)]=n===""?!0:n}return a}set themeProps(i){var r,n;Q(this,$,xt).call(this);let a={...this.themeProps,...i};for(let s in a){if(rd.includes(s))continue;let l=i==null?void 0:i[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Pn(s),!!l):(n=this.mediaTheme)==null||n.setAttribute(Pn(s),l)}}get playbackId(){var i;return(i=this.getAttribute(b.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(b.Attributes.PLAYBACK_ID,i):this.removeAttribute(b.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Dt(this,vt.SRC))!=null?i:void 0:(a=this.getAttribute(vt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(vt.SRC,i):this.removeAttribute(vt.SRC)}get poster(){var r;let i=this.getAttribute(vt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){ze("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return Hc(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(i){i||i===""?this.setAttribute(vt.POSTER,i):this.removeAttribute(vt.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(m.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(m.STORYBOARD_SRC,i):this.removeAttribute(m.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[L.StreamTypes.LIVE,L.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return $c(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(m.AUDIO)}set audio(i){if(!i){this.removeAttribute(m.AUDIO);return}this.setAttribute(m.AUDIO,"")}get hotkeys(){return B(this,vr)}get nohotkeys(){return this.hasAttribute(m.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(m.NOHOTKEYS);return}this.setAttribute(m.NOHOTKEYS,"")}get thumbnailTime(){return de(this.getAttribute(m.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(m.THUMBNAIL_TIME,`${i}`)}get title(){var i;return(i=this.getAttribute(m.TITLE))!=null?i:""}set title(i){i!==this.title&&(i?this.setAttribute(m.TITLE,i):this.removeAttribute("title"),super.title=i)}get placeholder(){var i;return(i=Dt(this,m.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(m.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(m.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=he.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(m.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(m.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=he.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(m.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(m.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=he.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(m.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(m.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(m.PLAYBACK_RATES))return this.getAttribute(m.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,a)=>i-a)}set playbackRates(i){if(!i){this.removeAttribute(m.PLAYBACK_RATES);return}this.setAttribute(m.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=de(this.getAttribute(m.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(m.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=de(this.getAttribute(m.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(m.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(m.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return de(this.getAttribute(m.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(m.DEFAULT_DURATION):this.setAttribute(m.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(b.Attributes.PLAYER_INIT_TIME)?de(this.getAttribute(b.Attributes.PLAYER_INIT_TIME)):B(this,hr)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(b.Attributes.PLAYER_INIT_TIME):this.setAttribute(b.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:od}get playerSoftwareVersion(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:nd}get beaconCollectionDomain(){var i;return(i=this.getAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(b.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(b.Attributes.MAX_RESOLUTION,i):this.removeAttribute(b.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(b.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(b.Attributes.MIN_RESOLUTION,i):this.removeAttribute(b.Attributes.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(b.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(b.Attributes.RENDITION_ORDER,i):this.removeAttribute(b.Attributes.RENDITION_ORDER))}get programStartTime(){return de(this.getAttribute(b.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_START_TIME):this.setAttribute(b.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return de(this.getAttribute(b.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_END_TIME):this.setAttribute(b.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return de(this.getAttribute(b.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_START_TIME):this.setAttribute(b.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return de(this.getAttribute(b.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_END_TIME):this.setAttribute(b.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(m.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(m.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):vv}set extraSourceParams(i){i==null?this.removeAttribute(m.EXTRA_SOURCE_PARAMS):this.setAttribute(m.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(b.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(b.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Dt(this,b.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(b.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(m.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(m.NO_VOLUME_PREF,""):this.removeAttribute(m.NO_VOLUME_PREF)}get debug(){return Dt(this,b.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(b.Attributes.DEBUG,""):this.removeAttribute(b.Attributes.DEBUG)}get disableTracking(){return Dt(this,b.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(b.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Dt(this,b.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(b.Attributes.DISABLE_COOKIES,""):this.removeAttribute(b.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(b.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:L.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(b.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?r:L.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(m.DEFAULT_STREAM_TYPE,i):this.removeAttribute(m.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(m.TARGET_LIVE_WINDOW)?+this.getAttribute(m.TARGET_LIVE_WINDOW):(a=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(m.TARGET_LIVE_WINDOW):this.setAttribute(m.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return de(Dt(this,b.Attributes.START_TIME))}set startTime(i){this.setAttribute(b.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(b.Attributes.PREFER_PLAYBACK);if(i===L.PlaybackTypes.MSE||i===L.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===L.PlaybackTypes.MSE||i===L.PlaybackTypes.NATIVE?this.setAttribute(b.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(b.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(Q(this,$,xt).call(this),!this.media){ve("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Xm(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(Q(this,$,xt).call(this),!this.media){ve("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var a;if(Q(this,$,xt).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(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,a;return(a=(i=this.media)==null?void 0:i.cuePoints)!=null?a:[]}addChapters(i){var a;if(Q(this,$,xt).call(this),!this.media){ve("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,a;return(a=(i=this.media)==null?void 0:i.chapters)!=null?a:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(m.PLAYBACK_TOKEN),a=this.getAttribute(m.DRM_TOKEN),r=this.getAttribute(m.THUMBNAIL_TOKEN),n=this.getAttribute(m.STORYBOARD_TOKEN);return{...B(this,fr),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...n!=null?{storyboard:n}:{}}}set tokens(i){Ae(this,fr,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(m.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(m.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(m.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(m.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(m.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(m.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(m.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(m.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return(0,L.addTextTrack)(s,i,a,r,n)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,L.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(m.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(m.CAST_RECEIVER,i):this.removeAttribute(m.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){ve("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(m.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(m.NO_TOOLTIPS);return}this.setAttribute(m.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(m.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}};hr=new WeakMap,pr=new WeakMap,fr=new WeakMap,Ot=new WeakMap,vr=new WeakMap,mi=new WeakMap,$=new WeakSet,xt=function(){var i,a,r,n;if(!B(this,pr)){Ae(this,pr,!0),Q(this,$,ci).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof he.HTMLElement))throw""}catch{ve("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof b.default))throw""}catch{ve("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ts))throw""}catch{ve("<media-controller> failed to upgrade!")}this.init(),Q(this,$,eh).call(this),Q(this,$,th).call(this),Q(this,$,ih).call(this),Ae(this,Ot,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(I.USER_INACTIVE))!=null?a:!0),Q(this,$,ah).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>Q(this,$,ci).call(this)),(n=this.media)==null||n.addEventListener("loadstart",()=>Q(this,$,ci).call(this))}},jm=function(){var i,a;try{(i=window==null?void 0:window.CSS)==null||i.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{}},sd=function(i){Object.assign(B(this,mi),i),Q(this,$,ci).call(this)},ci=function(i={}){lm(dm(dv(this,{...B(this,mi),...i})),this.shadowRoot)},eh=function(){let i=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(rd.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)i(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},th=function(){var a;let i=r=>{let{detail:n}=r;if(n instanceof b.MediaError||(n=new b.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){ze(n),n.data&&ze(`${n.name} data:`,n.data);return}let s=vl(n,!1);s.message&&al(s),ve(n),n.data&&ve(`${n.name} data:`,n.data),Q(this,$,sd).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof b.MediaError))return r;let n=vl((l=this.media)==null?void 0:l.error,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:u,code:c}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new b.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},ih=function(){var a,r,n,s;let i=()=>Q(this,$,ci).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",i)},ah=function(){var c,A;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===L.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(_,v,E=!1)=>{if(n())return;Array.from(_&&_.activeCues||[]).forEach(y=>{if(!(!y.snapToLines||y.line<-5||y.line>=0&&y.line<10))if(!v||this.paused){let w=y.text.split(`
3020
- `).length,U=-3;this.streamType===L.StreamTypes.LIVE&&(U=-2);let J=U-w;if(y.line===J&&!E)return;r.has(y)||r.set(y,y.line),y.line=J}else setTimeout(()=>{y.line=r.get(y)||"auto"},500)})},l=()=>{var _,v;s(a,(v=(_=this.mediaController)==null?void 0:_.hasAttribute(I.USER_INACTIVE))!=null?v:!1)},u=()=>{var E,P;let v=Array.from(((P=(E=this.mediaController)==null?void 0:E.media)==null?void 0:P.textTracks)||[]).filter(y=>["subtitles","captions"].includes(y.kind)&&y.mode==="showing")[0];v!==a&&(a==null||a.removeEventListener("cuechange",l)),a=v,a==null||a.addEventListener("cuechange",l),s(a,B(this,Ot))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(A=this.textTracks)==null||A.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var v,E;let _=(E=(v=this.mediaController)==null?void 0:v.hasAttribute(I.USER_INACTIVE))!=null?E:!0;B(this,Ot)!==_&&(Ae(this,Ot,_),s(a,B(this,Ot)))})};function Dt(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}he.customElements.get("mux-player")||(he.customElements.define("mux-player",mr),he.MuxPlayerElement=mr);var Ev=mr;
3025
+ `}return cv(i)};function mv(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=he.customElements.get(e);if(n!=null&&n.template)return n.template}}function hv(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 jm(i){let e=i.hasAttribute(m.TITLE)?{video_title:i.getAttribute(m.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 pv=Object.values(b.Attributes),fv=Object.values(vt),vv=Object.values(m),rd=Hn(),nd="mux-player",eh={isDialogOpen:!1},Ev={redundant_streams:!0},hr,pr,fr,Ot,vr,mi,$,xt,th,od,ci,ih,ah,rh,nh,mr=class extends rl{constructor(){super();me(this,$);me(this,hr);me(this,pr,!1);me(this,fr,{});me(this,Ot,!0);me(this,vr,new Bn(this,"hotkeys"));me(this,mi,{...eh,onCloseErrorDialog:t=>{var r;((r=t.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&Q(this,$,od).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:t=>{var n;if(((n=t.composedPath()[0])==null?void 0:n.localName)!=="media-error-dialog")return;tl(this,fi.activeElement)||t.preventDefault()}});Ae(this,hr,(0,R.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),Q(this,$,th).call(this),this.isConnected&&Q(this,$,xt).call(this)}static get NAME(){return nd}static get VERSION(){return rd}static get observedAttributes(){var t;return[...(t=rl.observedAttributes)!=null?t:[],...fv,...pv,...vv]}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=jm(this))}attributeChangedCallback(t,a,r){switch(Q(this,$,xt).call(this),super.attributeChangedCallback(t,a,r),t){case m.HOTKEYS:B(this,vr).value=r;break;case m.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ze((0,R.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time."));break}case m.THUMBNAIL_TOKEN:{if(r){let s=(0,R.parseJwt)(r);if(s){let{aud:l}=s,u=R.MuxJWTAud.THUMBNAIL;l!==u&&ze((0,R.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case m.STORYBOARD_TOKEN:{if(r){let s=(0,R.parseJwt)(r);if(s){let{aud:l}=s,u=R.MuxJWTAud.STORYBOARD;l!==u&&ze((0,R.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case m.DRM_TOKEN:{if(r){let s=(0,R.parseJwt)(r);if(s){let{aud:l}=s,u=R.MuxJWTAud.DRM;l!==u&&ze((0,R.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case b.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&ve((0,R.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case b.Attributes.STREAM_TYPE:r&&![R.StreamTypes.LIVE,R.StreamTypes.ON_DEMAND,R.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:il({file:"invalid-stream-type.md",message:(0,R.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===R.StreamTypes.LIVE?this.getAttribute(m.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[b.Attributes.PLAYBACK_ID,vt.SRC,m.PLAYBACK_TOKEN].includes(t)&&a!==r&&Ae(this,mi,{...B(this,mi),...eh}),Q(this,$,ci).call(this,{[Vc(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(b.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?R.CmcdTypeValues.includes(t)?this.setAttribute(b.Attributes.PREFER_CMCD,t):ze(`Invalid value for preferCmcd. Must be one of ${R.CmcdTypeValues.join()}`):this.removeAttribute(b.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(m.THEME))!=null?t:dv}set theme(t){this.setAttribute(m.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(ad.includes(r))continue;let n=t.getAttribute(r);a[Un(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;Q(this,$,xt).call(this);let a={...this.themeProps,...t};for(let s in a){if(ad.includes(s))continue;let l=t==null?void 0:t[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Pn(s),!!l):(n=this.mediaTheme)==null||n.setAttribute(Pn(s),l)}}get playbackId(){var t;return(t=this.getAttribute(b.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(b.Attributes.PLAYBACK_ID,t):this.removeAttribute(b.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=Dt(this,vt.SRC))!=null?t:void 0:(a=this.getAttribute(vt.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(vt.SRC,t):this.removeAttribute(vt.SRC)}get poster(){var r;let t=this.getAttribute(vt.POSTER);if(t!=null)return t;let{tokens:a}=this;if(a.playback&&!a.thumbnail){ze("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return Wc(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(t){t||t===""?this.setAttribute(vt.POSTER,t):this.removeAttribute(vt.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(m.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(m.STORYBOARD_SRC,t):this.removeAttribute(m.STORYBOARD_SRC)}get storyboard(){let{tokens:t}=this;if(this.storyboardSrc&&!t.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[R.StreamTypes.LIVE,R.StreamTypes.UNKNOWN].includes(this.streamType)||t.playback&&!t.storyboard))return Fc(this.playbackId,{customDomain:this.customDomain,token:t.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(m.AUDIO)}set audio(t){if(!t){this.removeAttribute(m.AUDIO);return}this.setAttribute(m.AUDIO,"")}get hotkeys(){return B(this,vr)}get nohotkeys(){return this.hasAttribute(m.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(m.NOHOTKEYS);return}this.setAttribute(m.NOHOTKEYS,"")}get thumbnailTime(){return de(this.getAttribute(m.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(m.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(m.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(m.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Dt(this,m.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(m.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(m.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=he.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(m.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(m.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=he.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(m.SECONDARY_COLOR,`${t}`)}get accentColor(){var a,r;let t=this.getAttribute(m.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=he.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),t))return t}set accentColor(t){this.setAttribute(m.ACCENT_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(m.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(m.PLAYBACK_RATES))return this.getAttribute(m.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(m.PLAYBACK_RATES);return}this.setAttribute(m.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=de(this.getAttribute(m.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(m.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=de(this.getAttribute(m.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(m.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(m.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return de(this.getAttribute(m.DEFAULT_DURATION))}set defaultDuration(t){t==null?this.removeAttribute(m.DEFAULT_DURATION):this.setAttribute(m.DEFAULT_DURATION,`${t}`)}get playerInitTime(){return this.hasAttribute(b.Attributes.PLAYER_INIT_TIME)?de(this.getAttribute(b.Attributes.PLAYER_INIT_TIME)):B(this,hr)}set playerInitTime(t){t!=this.playerInitTime&&(t==null?this.removeAttribute(b.Attributes.PLAYER_INIT_TIME):this.setAttribute(b.Attributes.PLAYER_INIT_TIME,`${+t}`))}get playerSoftwareName(){var t;return(t=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:nd}get playerSoftwareVersion(){var t;return(t=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:rd}get beaconCollectionDomain(){var t;return(t=this.getAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(b.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(b.Attributes.MAX_RESOLUTION,t):this.removeAttribute(b.Attributes.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(b.Attributes.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(b.Attributes.MIN_RESOLUTION,t):this.removeAttribute(b.Attributes.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(b.Attributes.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(b.Attributes.RENDITION_ORDER,t):this.removeAttribute(b.Attributes.RENDITION_ORDER))}get programStartTime(){return de(this.getAttribute(b.Attributes.PROGRAM_START_TIME))}set programStartTime(t){t==null?this.removeAttribute(b.Attributes.PROGRAM_START_TIME):this.setAttribute(b.Attributes.PROGRAM_START_TIME,`${t}`)}get programEndTime(){return de(this.getAttribute(b.Attributes.PROGRAM_END_TIME))}set programEndTime(t){t==null?this.removeAttribute(b.Attributes.PROGRAM_END_TIME):this.setAttribute(b.Attributes.PROGRAM_END_TIME,`${t}`)}get assetStartTime(){return de(this.getAttribute(b.Attributes.ASSET_START_TIME))}set assetStartTime(t){t==null?this.removeAttribute(b.Attributes.ASSET_START_TIME):this.setAttribute(b.Attributes.ASSET_START_TIME,`${t}`)}get assetEndTime(){return de(this.getAttribute(b.Attributes.ASSET_END_TIME))}set assetEndTime(t){t==null?this.removeAttribute(b.Attributes.ASSET_END_TIME):this.setAttribute(b.Attributes.ASSET_END_TIME,`${t}`)}get extraSourceParams(){return this.hasAttribute(m.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(m.EXTRA_SOURCE_PARAMS)).entries()].reduce((t,[a,r])=>(t[a]=r,t),{}):Ev}set extraSourceParams(t){t==null?this.removeAttribute(m.EXTRA_SOURCE_PARAMS):this.setAttribute(m.EXTRA_SOURCE_PARAMS,new URLSearchParams(t).toString())}get customDomain(){var t;return(t=this.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(b.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(b.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=Dt(this,b.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(b.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(m.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(m.NO_VOLUME_PREF,""):this.removeAttribute(m.NO_VOLUME_PREF)}get debug(){return Dt(this,b.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(b.Attributes.DEBUG,""):this.removeAttribute(b.Attributes.DEBUG)}get disableTracking(){return Dt(this,b.Attributes.DISABLE_TRACKING)!=null}set disableTracking(t){this.toggleAttribute(b.Attributes.DISABLE_TRACKING,!!t)}get disableCookies(){return Dt(this,b.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(b.Attributes.DISABLE_COOKIES,""):this.removeAttribute(b.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(b.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:R.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(b.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?r:R.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(m.DEFAULT_STREAM_TYPE,t):this.removeAttribute(m.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(m.TARGET_LIVE_WINDOW)?+this.getAttribute(m.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(m.TARGET_LIVE_WINDOW):this.setAttribute(m.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return de(Dt(this,b.Attributes.START_TIME))}set startTime(t){this.setAttribute(b.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(b.Attributes.PREFER_PLAYBACK);if(t===R.PlaybackTypes.MSE||t===R.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===R.PlaybackTypes.MSE||t===R.PlaybackTypes.NATIVE?this.setAttribute(b.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(b.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(Q(this,$,xt).call(this),!this.media){ve("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...jm(this),...t}}get _hlsConfig(){var t;return(t=this.media)==null?void 0:t._hlsConfig}set _hlsConfig(t){if(Q(this,$,xt).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(Q(this,$,xt).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:[]}addChapters(t){var a;if(Q(this,$,xt).call(this),!this.media){ve("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(t)}get activeChapter(){var t;return(t=this.media)==null?void 0:t.activeChapter}get chapters(){var t,a;return(a=(t=this.media)==null?void 0:t.chapters)!=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(m.PLAYBACK_TOKEN),a=this.getAttribute(m.DRM_TOKEN),r=this.getAttribute(m.THUMBNAIL_TOKEN),n=this.getAttribute(m.STORYBOARD_TOKEN);return{...B(this,fr),...t!=null?{playback:t}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...n!=null?{storyboard:n}:{}}}set tokens(t){Ae(this,fr,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(m.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(m.PLAYBACK_TOKEN,`${t}`)}get drmToken(){var t;return(t=this.getAttribute(m.DRM_TOKEN))!=null?t:void 0}set drmToken(t){this.setAttribute(m.DRM_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(m.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(m.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(m.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(m.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return(0,R.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,R.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}get castReceiver(){var t;return(t=this.getAttribute(m.CAST_RECEIVER))!=null?t:void 0}set castReceiver(t){t!==this.castReceiver&&(t?this.setAttribute(m.CAST_RECEIVER,t):this.removeAttribute(m.CAST_RECEIVER))}get castCustomData(){var t;return(t=this.media)==null?void 0:t.castCustomData}set castCustomData(t){if(!this.media){ve("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=t}get noTooltips(){return this.hasAttribute(m.NO_TOOLTIPS)}set noTooltips(t){if(!t){this.removeAttribute(m.NO_TOOLTIPS);return}this.setAttribute(m.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(t){t?this.setAttribute(m.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}};hr=new WeakMap,pr=new WeakMap,fr=new WeakMap,Ot=new WeakMap,vr=new WeakMap,mi=new WeakMap,$=new WeakSet,xt=function(){var t,a,r,n;if(!B(this,pr)){Ae(this,pr,!0),Q(this,$,ci).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof he.HTMLElement))throw""}catch{ve("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof b.default))throw""}catch{ve("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof es))throw""}catch{ve("<media-controller> failed to upgrade!")}this.init(),Q(this,$,ih).call(this),Q(this,$,ah).call(this),Q(this,$,rh).call(this),Ae(this,Ot,(a=(t=this.mediaController)==null?void 0:t.hasAttribute(k.USER_INACTIVE))!=null?a:!0),Q(this,$,nh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>Q(this,$,ci).call(this)),(n=this.media)==null||n.addEventListener("loadstart",()=>Q(this,$,ci).call(this))}},th=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{}},od=function(t){Object.assign(B(this,mi),t),Q(this,$,ci).call(this)},ci=function(t={}){um(cm(uv(this,{...B(this,mi),...t})),this.shadowRoot)},ih=function(){let t=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(ad.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},ah=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof b.MediaError||(n=new b.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){ze(n),n.data&&ze(`${n.name} data:`,n.data);return}let s=fl(n,!1);s.message&&il(s),ve(n),n.data&&ve(`${n.name} data:`,n.data),Q(this,$,od).call(this,{isDialogOpen:!0})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof b.MediaError))return r;let n=fl((l=this.media)==null?void 0:l.error,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:u,code:c}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new b.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},rh=function(){var a,r,n,s;let t=()=>Q(this,$,ci).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)},nh=function(){var c,T;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===R.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(_,p,E=!1)=>{if(n())return;Array.from(_&&_.activeCues||[]).forEach(y=>{if(!(!y.snapToLines||y.line<-5||y.line>=0&&y.line<10))if(!p||this.paused){let w=y.text.split(`
3026
+ `).length,U=-3;this.streamType===R.StreamTypes.LIVE&&(U=-2);let J=U-w;if(y.line===J&&!E)return;r.has(y)||r.set(y,y.line),y.line=J}else setTimeout(()=>{y.line=r.get(y)||"auto"},500)})},l=()=>{var _,p;s(a,(p=(_=this.mediaController)==null?void 0:_.hasAttribute(k.USER_INACTIVE))!=null?p:!1)},u=()=>{var E,P;let p=Array.from(((P=(E=this.mediaController)==null?void 0:E.media)==null?void 0:P.textTracks)||[]).filter(y=>["subtitles","captions"].includes(y.kind)&&y.mode==="showing")[0];p!==a&&(a==null||a.removeEventListener("cuechange",l)),a=p,a==null||a.addEventListener("cuechange",l),s(a,B(this,Ot))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(T=this.textTracks)==null||T.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var p,E;let _=(E=(p=this.mediaController)==null?void 0:p.hasAttribute(k.USER_INACTIVE))!=null?E:!0;B(this,Ot)!==_&&(Ae(this,Ot,_),s(a,B(this,Ot)))})};function Dt(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}he.customElements.get("mux-player")||(he.customElements.define("mux-player",mr),he.MuxPlayerElement=mr);var bv=mr;