@mux/mux-player 3.2.5-canary.2 → 3.2.5-canary.4

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 oh=Object.create;var Er=Object.defineProperty;var sh=Object.getOwnPropertyDescriptor;var lh=Object.getOwnPropertyNames;var dh=Object.getPrototypeOf,uh=Object.prototype.hasOwnProperty;var Sd=t=>{throw TypeError(t)};var ch=(t,e)=>{for(var i in e)Er(t,i,{get:e[i],enumerable:!0})},Id=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of lh(e))!uh.call(t,r)&&r!==i&&Er(t,r,{get:()=>e[r],enumerable:!(a=sh(e,r))||a.enumerable});return t};var mh=(t,e,i)=>(i=t!=null?oh(dh(t)):{},Id(e||!t||!t.__esModule?Er(i,"default",{value:t,enumerable:!0}):i,t)),hh=t=>Id(Er({},"__esModule",{value:!0}),t);var Mo=(t,e,i)=>e.has(t)||Sd("Cannot "+i);var P=(t,e,i)=>(Mo(t,e,"read from private field"),i?i.call(t):e.get(t)),pe=(t,e,i)=>e.has(t)?Sd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Te=(t,e,i,a)=>(Mo(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),J=(t,e,i)=>(Mo(t,e,"access private method"),i);var pf={};ch(pf,{MediaError:()=>E.MediaError,default:()=>hf,generatePlayerInitTime:()=>y.generatePlayerInitTime,getVideoAttribute:()=>Ot,playerSoftwareName:()=>id,playerSoftwareVersion:()=>td});module.exports=hh(pf);var pi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends pi{}globalThis.DocumentFragment=t}var da=class extends pi{},Ro=class extends pi{},ph={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(da)}},ua,Lo=class{constructor(e,i={}){pe(this,ua);Te(this,ua,i==null?void 0:i.detail)}get detail(){return P(this,ua)}initCustomEvent(){}};ua=new WeakMap;function vh(t,e){return new da}var Cd={document:{createElement:vh},DocumentFragment,customElements:ph,CustomEvent:Lo,EventTarget:pi,HTMLElement:da,HTMLVideoElement:Ro},Md=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ve=Md?Cd:globalThis,vi=Md?Cd.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"},S={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},wo={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"},Rd=Object.entries(wo),o=Rd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),fh={USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},nt=Rd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...fh}),gf=Object.entries(nt).reduce((t,[e,i])=>{let a=o[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),Ld=Object.entries(o).reduce((t,[e,i])=>{let a=nt[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),fe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},bt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var xo={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ye={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Me={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var wd={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var bh={2:"Network Error",3:"Decode Error",4:"Source Not Supported",5:"Encryption Error"},gh={2:"A network error caused the media download to fail.",3:"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",4:"An unsupported error occurred. The server or network failed, or your browser does not support this format.",5:"The media is encrypted and there are no keys to decrypt it."},Do=t=>{var e,i;return t.code===1?null:{title:(e=bh[t.code])!=null?e:`Error ${t.code}`,message:(i=gh[t.code])!=null?i:t.message}},C={ENTER_AIRPLAY:"Start airplay",EXIT_AIRPLAY:"Stop airplay",AUDIO_TRACK_MENU:"Audio",CAPTIONS:"Captions",ENABLE_CAPTIONS:"Enable captions",DISABLE_CAPTIONS:"Disable captions",START_CAST:"Start casting",STOP_CAST:"Stop casting",ENTER_FULLSCREEN:"Enter fullscreen mode",EXIT_FULLSCREEN:"Exit fullscreen mode",MUTE:"Mute",UNMUTE:"Unmute",ENTER_PIP:"Enter picture in picture mode",EXIT_PIP:"Enter picture in picture mode",PLAY:"Play",PAUSE:"Pause",PLAYBACK_RATE:"Playback rate",RENDITIONS:"Quality",SEEK_BACKWARD:"Seek backward",SEEK_FORWARD:"Seek forward",SETTINGS:"Settings"},Y={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:t=1}={})=>`current playback rate ${t}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading",SETTINGS:()=>"settings",AUDIO_TRACKS:()=>"audio tracks",QUALITY:()=>"quality"},G={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:t=30}={})=>`seek forward ${t} seconds`,SEEK_BACK_N_SECS:({seekOffset:t=30}={})=>`seek back ${t} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},_h={...Y,...G};function xd(t){return t==null?void 0:t.map(Ah).join(" ")}function Dd(t){return t==null?void 0:t.split(/\s+/).map(Th)}function Ah(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function Th(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function Od(t){return t==null?void 0:t.map(yh).join(" ")}function Nd(t){return t==null?void 0:t.split(/\s+/).map(kh)}function yh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(n=>n!=null).join(":")}}function kh(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function Pd(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function fi(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function br(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var gr=t=>new Promise(e=>setTimeout(e,t));var Ud=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Sh=(t,e)=>{let i=t===1?Ud[e].singular:Ud[e].plural;return`${t} ${i}`},Pt=t=>{if(!fi(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&&Sh(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 yf=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 _r=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ar=class extends _r{},Tr=class extends Ar{constructor(){super(...arguments),this.role=null}},Oo=class{observe(){}unobserve(){}disconnect(){}},Bd={createElement:function(){return new ca.HTMLElement},createElementNS:function(){return new ca.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},ca={ResizeObserver:Oo,document:Bd,Node:Ar,Element:Tr,HTMLElement:class extends Tr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new ca.DocumentFragment}},DocumentFragment:class extends _r{},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}}},Hd=typeof window=="undefined"||typeof window.customElements=="undefined",$d=Object.keys(ca).every(t=>t in globalThis),d=Hd&&!$d?ca:globalThis,h=Hd&&!$d?Bd:globalThis.document;var Wd=new WeakMap,No=t=>{let e=Wd.get(t);return e||Wd.set(t,e=new Set),e},Fd=new d.ResizeObserver(t=>{for(let e of t)for(let i of No(e.target))i(e)});function ot(t,e){No(t).add(e),Fd.observe(t)}function Ut(t,e){let i=No(t);i.delete(e),i.size||Fd.unobserve(t)}function Kd(t){let e={};for(let i of t)e[i.name]=i.value;return e}function z(t){var e;return(e=yr(t))!=null?e:Ue(t,"media-controller")}function yr(t){var e;let{MEDIA_CONTROLLER:i}=S,a=t.getAttribute(i);if(a)return(e=Bt(t))==null?void 0:e.getElementById(a)}var kr=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Ch=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},Sr=(t,e)=>Ch(t,e)[0],ue=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:ue(t,e.getRootNode().host),Ue=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Ue(t.getRootNode().host,e)};function ma(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=ma(i.shadowRoot))!=null?e:i:null}function Bt(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 Ir(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 Vd(t,e,i,a){let r=Po(i,a),n=Po(i,{x:t,y:e}),s=Po(a,{x:t,y:e});return n>r||s>r?n>s?1:0:n/r}function Po(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=Mh(t,a=>a===e);return i||Uo(t,e)}function Mh(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 Uo(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 M(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function D(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}M(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function H(t,e){return t.hasAttribute(e)}function U(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}H(t,e)!=i&&t.toggleAttribute(e,i)}function R(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function I(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;R(t,e,void 0)!==a&&t.setAttribute(e,a)}var Yd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},gt=(t,e,i)=>(Yd(t,e,"read from private field"),i?i.call(t):e.get(t)),Rh=(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)},Cr=(t,e,i,a)=>(Yd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ee,Gd=h.createElement("template");Gd.innerHTML=`
1
+ "use strict";var mh=Object.create;var br=Object.defineProperty;var hh=Object.getOwnPropertyDescriptor;var ph=Object.getOwnPropertyNames;var vh=Object.getPrototypeOf,fh=Object.prototype.hasOwnProperty;var Rd=t=>{throw TypeError(t)};var Eh=(t,e)=>{for(var i in e)br(t,i,{get:e[i],enumerable:!0})},wd=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ph(e))!fh.call(t,r)&&r!==i&&br(t,r,{get:()=>e[r],enumerable:!(a=hh(e,r))||a.enumerable});return t};var bh=(t,e,i)=>(i=t!=null?mh(vh(t)):{},wd(e||!t||!t.__esModule?br(i,"default",{value:t,enumerable:!0}):i,t)),gh=t=>wd(br({},"__esModule",{value:!0}),t);var Lo=(t,e,i)=>e.has(t)||Rd("Cannot "+i);var P=(t,e,i)=>(Lo(t,e,"read from private field"),i?i.call(t):e.get(t)),pe=(t,e,i)=>e.has(t)?Rd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Te=(t,e,i,a)=>(Lo(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),J=(t,e,i)=>(Lo(t,e,"access private method"),i);var bf={};Eh(bf,{MediaError:()=>E.MediaError,default:()=>Ef,generatePlayerInitTime:()=>y.generatePlayerInitTime,getVideoAttribute:()=>Nt,playerSoftwareName:()=>od,playerSoftwareVersion:()=>nd});module.exports=gh(bf);var vi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends vi{}globalThis.DocumentFragment=t}var ua=class extends vi{},xo=class extends vi{},_h={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(ua)}},ca,Do=class{constructor(e,i={}){pe(this,ca);Te(this,ca,i==null?void 0:i.detail)}get detail(){return P(this,ca)}initCustomEvent(){}};ca=new WeakMap;function Ah(t,e){return new ua}var Ld={document:{createElement:Ah},DocumentFragment,customElements:_h,CustomEvent:Do,EventTarget:vi,HTMLElement:ua,HTMLVideoElement:xo},xd=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ve=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"},S={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Oo={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(Oo),o=Dd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Th={USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},st=Dd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Th}),yf=Object.entries(st).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=st[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),fe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},_t={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var No={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ye={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Le={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Nd={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var kh={2:"Network Error",3:"Decode Error",4:"Source Not Supported",5:"Encryption Error"},Sh={2:"A network error caused the media download to fail.",3:"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",4:"An unsupported error occurred. The server or network failed, or your browser does not support this format.",5:"The media is encrypted and there are no keys to decrypt it."},Po=t=>{var e,i;return t.code===1?null:{title:(e=kh[t.code])!=null?e:`Error ${t.code}`,message:(i=Sh[t.code])!=null?i:t.message}},C={ENTER_AIRPLAY:"Start airplay",EXIT_AIRPLAY:"Stop airplay",AUDIO_TRACK_MENU:"Audio",CAPTIONS:"Captions",ENABLE_CAPTIONS:"Enable captions",DISABLE_CAPTIONS:"Disable captions",START_CAST:"Start casting",STOP_CAST:"Stop casting",ENTER_FULLSCREEN:"Enter fullscreen mode",EXIT_FULLSCREEN:"Exit fullscreen mode",MUTE:"Mute",UNMUTE:"Unmute",ENTER_PIP:"Enter picture in picture mode",EXIT_PIP:"Enter picture in picture mode",PLAY:"Play",PAUSE:"Pause",PLAYBACK_RATE:"Playback rate",RENDITIONS:"Quality",SEEK_BACKWARD:"Seek backward",SEEK_FORWARD:"Seek forward",SETTINGS:"Settings"},V={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:t=1}={})=>`current playback rate ${t}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading",SETTINGS:()=>"settings",AUDIO_TRACKS:()=>"audio tracks",QUALITY:()=>"quality"},Y={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:t=30}={})=>`seek forward ${t} seconds`,SEEK_BACK_N_SECS:({seekOffset:t=30}={})=>`seek back ${t} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},Ih={...V,...Y};function Pd(t){return t==null?void 0:t.map(Ch).join(" ")}function Ud(t){return t==null?void 0:t.split(/\s+/).map(Mh)}function Ch(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function Mh(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(Rh).join(" ")}function Hd(t){return t==null?void 0:t.split(/\s+/).map(wh)}function Rh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(n=>n!=null).join(":")}}function wh(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 Ei(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"}],Lh=(t,e)=>{let i=t===1?Wd[e].singular:Wd[e].plural;return`${t} ${i}`},Ut=t=>{if(!Ei(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&&Lh(l,u)).filter(l=>l).join(", ")}${i?" remaining":""}`};function Be(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 Cf=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 Ar=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Tr=class extends Ar{},yr=class extends Tr{constructor(){super(...arguments),this.role=null}},Uo=class{observe(){}unobserve(){}disconnect(){}},Fd={createElement:function(){return new ma.HTMLElement},createElementNS:function(){return new ma.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},ma={ResizeObserver:Uo,document:Fd,Node:Tr,Element:yr,HTMLElement:class extends yr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new ma.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}}},Kd=typeof window=="undefined"||typeof window.customElements=="undefined",Vd=Object.keys(ma).every(t=>t in globalThis),d=Kd&&!Vd?ma:globalThis,h=Kd&&!Vd?Fd:globalThis.document;var Yd=new WeakMap,Bo=t=>{let e=Yd.get(t);return e||Yd.set(t,e=new Set),e},Gd=new d.ResizeObserver(t=>{for(let e of t)for(let i of Bo(e.target))i(e)});function lt(t,e){Bo(t).add(e),Gd.observe(t)}function dt(t,e){let i=Bo(t);i.delete(e),i.size||Gd.unobserve(t)}function qd(t){let e={};for(let i of t)e[i.name]=i.value;return e}function z(t){var e;return(e=kr(t))!=null?e:He(t,"media-controller")}function kr(t){var e;let{MEDIA_CONTROLLER:i}=S,a=t.getAttribute(i);if(a)return(e=Bt(t))==null?void 0:e.getElementById(a)}var Sr=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Dh=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},Ir=(t,e)=>Dh(t,e)[0],ue=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:ue(t,e.getRootNode().host),He=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||He(t.getRootNode().host,e)};function ha(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=ha(i.shadowRoot))!=null?e:i:null}function Bt(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=Ho(i,a),n=Ho(i,{x:t,y:e}),s=Ho(a,{x:t,y:e});return n>r||s>r?n>s?1:0:n/r}function Ho(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function G(t,e){let i=Oh(t,a=>a===e);return i||$o(t,e)}function Oh(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 $o(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 M(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function D(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}M(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function H(t,e){return t.hasAttribute(e)}function U(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}H(t,e)!=i&&t.toggleAttribute(e,i)}function R(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function I(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;R(t,e,void 0)!==a&&t.setAttribute(e,a)}var zd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},At=(t,e,i)=>(zd(t,e,"read from private field"),i?i.call(t):e.get(t)),Nh=(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),Ee,Qd=h.createElement("template");Qd.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 Bo=class extends d.HTMLElement{constructor(e={}){if(super(),Rh(this,Ee,void 0),!this.shadowRoot){let i=this.attachShadow({mode:"open"}),a=Gd.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[S.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER&&(i&&((n=(r=gt(this,Ee))==null?void 0:r.unassociateElement)==null||n.call(r,this),Cr(this,Ee,null)),a&&this.isConnected&&(Cr(this,Ee,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=gt(this,Ee))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Cr(this,Ee,Lh(this)),this.getAttribute(S.MEDIA_CONTROLLER)&&((i=(e=gt(this,Ee))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=gt(this,Ee))==null||a.addEventListener("pointerdown",this),(r=gt(this,Ee))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(S.MEDIA_CONTROLLER)&&((i=(e=gt(this,Ee))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=gt(this,Ee))==null||a.removeEventListener("pointerdown",this),(r=gt(this,Ee))==null||r.removeEventListener("click",this),Cr(this,Ee,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:b}=this.getBoundingClientRect(),g=n-l,v=s-u;if(g<0||v<0||g>c||v>b||c===0&&b===0)return;let{pointerType:f=this._pointerType}=e;if(this._pointerType=void 0,f===xo.TOUCH){this.handleTap(e);return}else if(f===xo.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(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}))}};Ee=new WeakMap;function Lh(t){var e;let i=t.getAttribute(S.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",Bo);var Wo=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_t=(t,e,i)=>(Wo(t,e,"read from private field"),i?i.call(t):e.get(t)),st=(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)},ha=(t,e,i,a)=>(Wo(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Re=(t,e,i)=>(Wo(t,e,"access private method"),i),Mr,Ei,pa,bi,Ho,qd,$o,Zd,va,Rr,Lr,Fo,gi,fa,x={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},zd=h.createElement("template");zd.innerHTML=`
8
+ `;var Wo=class extends d.HTMLElement{constructor(e={}){if(super(),Nh(this,Ee,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[S.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER&&(i&&((n=(r=At(this,Ee))==null?void 0:r.unassociateElement)==null||n.call(r,this),Mr(this,Ee,null)),a&&this.isConnected&&(Mr(this,Ee,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=At(this,Ee))==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,Ee,Ph(this)),this.getAttribute(S.MEDIA_CONTROLLER)&&((i=(e=At(this,Ee))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=At(this,Ee))==null||a.addEventListener("pointerdown",this),(r=At(this,Ee))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(S.MEDIA_CONTROLLER)&&((i=(e=At(this,Ee))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=At(this,Ee))==null||a.removeEventListener("pointerdown",this),(r=At(this,Ee))==null||r.removeEventListener("click",this),Mr(this,Ee,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:_}=this.getBoundingClientRect(),g=n-l,v=s-u;if(g<0||v<0||g>c||v>_||c===0&&_===0)return;let{pointerType:f=this._pointerType}=e;if(this._pointerType=void 0,f===No.TOUCH){this.handleTap(e);return}else if(f===No.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(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}))}};Ee=new WeakMap;function Ph(t){var e;let i=t.getAttribute(S.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):He(t,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",Wo);var Yo=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Se=(t,e,i)=>(Yo(t,e,"read from private field"),i?i.call(t):e.get(t)),ke=(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)},Ht=(t,e,i,a)=>(Yo(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Me=(t,e,i)=>(Yo(t,e,"access private method"),i),Lr,bi,va,gi,Rr,Fo,Xd,pa,wr,Ko,Jd,Vo,jd,fa,xr,Dr,Go,_i,Ea,x={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},eu=h.createElement("template");eu.innerHTML=`
9
9
  <style>
10
10
 
11
11
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -99,13 +99,13 @@
99
99
 
100
100
  ::slotted(:not([slot=media]):not([slot=poster]):not([${x.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {
101
101
  opacity: 1;
102
- transition: opacity 0.25s;
102
+ transition: var(--media-control-transition-in, opacity 0.25s);
103
103
  }
104
104
 
105
105
 
106
106
  :host([${x.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_AIRPLAYING}]):not([${o.MEDIA_IS_CASTING}]):not([${x.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${x.NO_AUTOHIDE}]):not([role=dialog])) {
107
107
  opacity: 0;
108
- transition: opacity 1s;
108
+ transition: var(--media-control-transition-out, opacity 1s);
109
109
  }
110
110
 
111
111
  :host([${x.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_CASTING}]):not([${x.AUDIO}])) ::slotted([slot=media]) {
@@ -145,7 +145,7 @@
145
145
  <slot part="bottom chrome"></slot>
146
146
  </span>
147
147
  <slot name="dialog" part="layer dialog-layer"></slot>
148
- `;var wh=Object.values(o),xh="sm:384 md:576 lg:768 xl:960";function Dh(t){Oh(t.target,t.contentRect.width)}function Oh(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(x.BREAKPOINTS))!=null?i:xh,r=Nh(a),n=Ph(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)}}function Nh(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Ph(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var Ea=class extends d.HTMLElement{constructor(){super(),st(this,Ho),st(this,$o),st(this,va),st(this,Lr),st(this,gi),st(this,Mr,0),st(this,Ei,null),st(this,pa,null),st(this,bi,void 0),this.breakpointsComputed=!1,this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(zd.content.cloneNode(!0)));let e=s=>{let l=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(c=>{if(c.slot=="media"&&u.target==this){let b=u.previousSibling&&u.previousSibling.previousElementSibling;if(!b||!l)this.mediaUnsetCallback(c);else{let g=b.slot!=="media";for(;(b=b.previousSibling)!==null;)b.slot=="media"&&(g=!1);g&&this.mediaUnsetCallback(c)}}}),l&&u.addedNodes.forEach(c=>{c===l&&this.handleMediaUpdated(l)}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;ot(this,s=>{a||(setTimeout(()=>{Dh(s),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(nt.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),a=!0)});let n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){_t(this,Ei)&&this.mediaUnsetCallback(_t(this,Ei));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[x.AUTOHIDE,x.GESTURES_DISABLED].concat(wh).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()==x.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&&(ha(this,Ei,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;let a=this.getAttribute(x.AUDIO)!=null?Y.AUDIO_PLAYER():Y.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(x.USER_INACTIVE,""),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;this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){ha(this,Ei,null)}handleEvent(e){switch(e.type){case"pointerdown":ha(this,Mr,e.timeStamp);break;case"pointermove":Re(this,Ho,qd).call(this,e);break;case"pointerup":Re(this,$o,Zd).call(this,e);break;case"mouseleave":Re(this,va,Rr).call(this);break;case"mouseup":this.removeAttribute(x.KEYBOARD_CONTROL);break;case"keyup":Re(this,gi,fa).call(this),this.setAttribute(x.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);ha(this,bi,isNaN(i)?0:i)}get autohide(){return(_t(this,bi)===void 0?2:_t(this,bi)).toString()}};Mr=new WeakMap;Ei=new WeakMap;pa=new WeakMap;bi=new WeakMap;Ho=new WeakSet;qd=function(t){t.pointerType!=="mouse"&&t.timeStamp-_t(this,Mr)<250||(Re(this,Lr,Fo).call(this),clearTimeout(_t(this,pa)),[this,this.media].includes(t.target)&&Re(this,gi,fa).call(this))};$o=new WeakSet;Zd=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(x.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Re(this,va,Rr).call(this):Re(this,gi,fa).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Re(this,gi,fa).call(this)};va=new WeakSet;Rr=function(){if(_t(this,bi)<0||this.hasAttribute(x.USER_INACTIVE))return;this.setAttribute(x.USER_INACTIVE,"");let t=new d.CustomEvent(nt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};Lr=new WeakSet;Fo=function(){if(!this.hasAttribute(x.USER_INACTIVE))return;this.removeAttribute(x.USER_INACTIVE);let t=new d.CustomEvent(nt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};gi=new WeakSet;fa=function(){Re(this,Lr,Fo).call(this),clearTimeout(_t(this,pa));let t=parseInt(this.autohide);t<0||ha(this,pa,setTimeout(()=>{Re(this,va,Rr).call(this)},t*1e3))};d.customElements.get("media-container")||d.customElements.define("media-container",Ea);var Qd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ae=(t,e,i)=>(Qd(t,e,"read from private field"),i?i.call(t):e.get(t)),ba=(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)},wr=(t,e,i,a)=>(Qd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),_i,Ai,xr,Ht,lt,At,Be=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){ba(this,lt),ba(this,_i,void 0),ba(this,Ai,void 0),ba(this,xr,void 0),ba(this,Ht,new Set),wr(this,_i,e),wr(this,Ai,i),wr(this,xr,new Set(a))}[Symbol.iterator](){return ae(this,lt,At).values()}get length(){return ae(this,lt,At).size}get value(){var e;return(e=[...ae(this,lt,At)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(wr(this,Ht,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...ae(this,lt,At)][e]}values(){return ae(this,lt,At).values()}forEach(e,i){ae(this,lt,At).forEach(e,i)}add(...e){var i,a;e.forEach(r=>ae(this,Ht).add(r)),!(this.value===""&&!((i=ae(this,_i))!=null&&i.hasAttribute(`${ae(this,Ai)}`)))&&((a=ae(this,_i))==null||a.setAttribute(`${ae(this,Ai)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>ae(this,Ht).delete(a)),(i=ae(this,_i))==null||i.setAttribute(`${ae(this,Ai)}`,`${this.value}`)}contains(e){return ae(this,lt,At).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;xr=new WeakMap;Ht=new WeakMap;lt=new WeakSet;At=function(){return ae(this,Ht).size?ae(this,Ht):ae(this,xr)};var Uh=(t="")=>t.split(/\s+/),Xd=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?fe.CAPTIONS:fe.SUBTITLES,language:i,label:r}},$t=(t="",e={})=>Uh(t).map(i=>{let a=Xd(i);return{...e,...a}}),Ko=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?Xd(e):e):typeof t=="string"?$t(t):[t]:[],Dr=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,dt=(t=[])=>Array.prototype.map.call(t,Dr).join(" "),Bh=(t,e)=>i=>i[t]===e,Jd=t=>{let e=Object.entries(t).map(([i,a])=>Bh(i,a));return i=>e.every(a=>a(i))},Wt=(t,e=[],i=[])=>{let a=Ko(i).map(Jd),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=t})},Ft=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:Jd(e);return Array.from(t.textTracks).filter(i)},Or=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)};var eu=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()},jd="exitFullscreen"in h?"exitFullscreen":"webkitExitFullscreen"in h?"webkitExitFullscreen":"webkitCancelFullScreen"in h?"webkitCancelFullScreen":void 0,tu=t=>{var e;let{documentElement:i}=t;if(jd){let a=(e=i==null?void 0:i[jd])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},ga="fullscreenElement"in h?"fullscreenElement":"webkitFullscreenElement"in h?"webkitFullscreenElement":void 0,Hh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[ga];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===wd.FULLSCREEN?i:a},iu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let n=Hh(t);if(!n)return!1;if(n===r||n===i)return!0;if(n.localName.includes("-")){let s=n.shadowRoot;if(!(ga in s))return ue(n,r);for(;s!=null&&s[ga];){if(s[ga]===r)return!0;s=(e=s[ga])==null?void 0:e.shadowRoot}}return!1},$h="fullscreenEnabled"in h?"fullscreenEnabled":"webkitFullscreenEnabled"in h?"webkitFullscreenEnabled":void 0,au=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[$h])||i&&"webkitSupportsFullscreen"in i};var Nr,Vo=()=>{var t,e;return Nr||(Nr=(e=(t=h)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Nr)},ru=async(t=Vo())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([Wh(t,i.signal),Fh(t,e)]);return i.abort(),a},Wh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),Fh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await gr(10)}return t.volume!==e},Kh=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),Yo=(t=Vo())=>d.matchMedia("(display-mode: standalone)").matches&&Kh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",Go=(t=Vo())=>au({documentElement:h,media:t}),nu=Go(),ou=Yo(),su=!!d.WebKitPlaybackTargetAvailabilityEvent,lu=!!d.chrome;var Ti=t=>Ft(t.media,e=>[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),qo=t=>Ft(t.media,e=>e.mode===bt.SHOWING&&[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)),Pr=(t,e)=>{let i=Ti(t),a=qo(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)Wt(bt.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let n=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let b=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=b?[b,...globalThis.navigator.languages]:globalThis.navigator.languages,v=i.filter(f=>g.some(w=>f.language.toLowerCase().startsWith(w.split("-")[0]))).sort((f,w)=>{let A=g.findIndex(N=>f.language.toLowerCase().startsWith(N.split("-")[0])),T=g.findIndex(N=>w.language.toLowerCase().startsWith(N.split("-")[0]));return A-T});v[0]&&(n=v[0])}let{language:l,label:u,kind:c}=n;Wt(bt.DISABLED,i,a),Wt(bt.SHOWING,i,[{language:l,label:u,kind:c}])}}},Ur=(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)?Vh(t,e):Object.entries(t).every(([i,a])=>i in e&&Ur(a,e[i])),Vh=(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)=>Ur(r,e[n])):!0};var Yh=Object.values(Me),Br,Gh=ru().then(t=>(Br=t,Br)),du=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))}))},_a={mediaError:{get(t){let{media:e}=t;return e==null?void 0:e.error},mediaEvents:["emptied","error"]},mediaErrorCode:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.error)==null?void 0:e.code},mediaEvents:["emptied","error"]},mediaErrorMessage:{get(t){var e,i;let{media:a}=t;return(i=(e=a==null?void 0:a.error)==null?void 0:e.message)!=null?i:""},mediaEvents:["emptied","error"]},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;i&&(i.muted=t)},mediaEvents:["volumechange"]},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{}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let a=d.localStorage.getItem("media-chrome-pref-volume");if(a==null)return;_a.mediaVolume.set(+a,e),t(+a)}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||!fi(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=[Me.LIVE,Me.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(Yh.includes(r))return r===Me.UNKNOWN?a:r;let n=e.duration;return n===1/0?Me.LIVE:Number.isFinite(n)?Me.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=_a.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Me.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(!(_a.mediaStreamType.get(t)===Me.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 Ti(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&&![fe.CAPTIONS,fe.SUBTITLES].includes((u=l==null?void 0:l.track)==null?void 0:u.kind)||Pr(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]=Ft(i,{kind:fe.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("-")?ue(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 iu(t)},set(t,e){t?eu(e):tu(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(!nu||!Go(e))return ye.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!ou||!Yo(e))return ye.UNSUPPORTED}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(Br===!1||(e==null?void 0:e.volume)==null)return ye.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{Br==null&&Gh.then(e=>t(e?void 0:ye.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!lu||!((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(!su)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 uu={[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[f]=Ft(s,{kind:fe.METADATA,label:"thumbnails"}),w=Array.prototype.find.call((a=f==null?void 0:f.cues)!=null?a:[],(A,T,N)=>T===0?A.endTime>l:T===N.length-1?A.startTime<=l:A.startTime<=l&&A.endTime>l);if(w){let A=/'^(?:[a-z]+:)?\/\//i.test(w.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,T=new URL(w.text,A);c=new URLSearchParams(T.hash).get("#xywh").split(",").map(ee=>+ee),u=T.href}}let b=t.mediaDuration.get(e),v=(n=t.mediaChaptersCues.get(e).find((f,w,A)=>w===A.length-1&&b===f.endTime?f.startTime<=l&&f.endTime>=l:f.startTime<=l&&f.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)===Me.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=Ti(e),s=Ko(i),l=(a=s[0])==null?void 0:a.language;l&&!r.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Wt(bt.SHOWING,n,s)},[p.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=Ti(e),r=i!=null?i:[];Wt(bt.DISABLED,a,r)},[p.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){Pr(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 qh=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=_a,requestMap:r=uu,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}),b=A=>{A!=null&&(Ur(A,c)||(c=Object.freeze({...c,...A}),l.forEach(T=>T(c))))},g=()=>{let A=Object.entries(a).reduce((T,[N,{get:ee}])=>(T[N]=ee(u),T),{});b(A)},v={},f,w=async(A,T)=>{var N,ee,ge,Et,at,Xi,Ji,ji,ea,ta,ia,aa,ra,na,oa,sa;let fr=!!f;if(f={...u,...f!=null?f:{},...A},fr)return;await du(...Object.values(A));let rt=l.length>0&&T===0&&s,rd=u.media!==f.media,nd=((N=u.media)==null?void 0:N.textTracks)!==((ee=f.media)==null?void 0:ee.textTracks),od=((ge=u.media)==null?void 0:ge.videoRenditions)!==((Et=f.media)==null?void 0:Et.videoRenditions),sd=((at=u.media)==null?void 0:at.audioTracks)!==((Xi=f.media)==null?void 0:Xi.audioTracks),ld=((Ji=u.media)==null?void 0:Ji.remote)!==((ji=f.media)==null?void 0:ji.remote),dd=u.documentElement!==f.documentElement,ud=!!u.media&&(rd||rt),cd=!!((ea=u.media)!=null&&ea.textTracks)&&(nd||rt),md=!!((ta=u.media)!=null&&ta.videoRenditions)&&(od||rt),hd=!!((ia=u.media)!=null&&ia.audioTracks)&&(sd||rt),pd=!!((aa=u.media)!=null&&aa.remote)&&(ld||rt),vd=!!u.documentElement&&(dd||rt),fd=ud||cd||md||hd||pd||vd,hi=l.length===0&&T===1&&s,Ed=!!f.media&&(rd||hi),bd=!!((ra=f.media)!=null&&ra.textTracks)&&(nd||hi),gd=!!((na=f.media)!=null&&na.videoRenditions)&&(od||hi),_d=!!((oa=f.media)!=null&&oa.audioTracks)&&(sd||hi),Ad=!!((sa=f.media)!=null&&sa.remote)&&(ld||hi),Td=!!f.documentElement&&(dd||hi),yd=Ed||bd||gd||_d||Ad||Td;if(!(fd||yd)){Object.entries(f).forEach(([F,la])=>{u[F]=la}),g(),f=void 0;return}Object.entries(a).forEach(([F,{get:la,mediaEvents:jm=[],textTracksEvents:eh=[],videoRenditionsEvents:th=[],audioTracksEvents:ih=[],remoteEvents:ah=[],rootEvents:rh=[],stateOwnersUpdateHandlers:nh=[]}])=>{v[F]||(v[F]={});let _e=X=>{let Ae=la(u,X);b({[F]:Ae})},ie;ie=v[F].mediaEvents,jm.forEach(X=>{ie&&ud&&(u.media.removeEventListener(X,ie),v[F].mediaEvents=void 0),Ed&&(f.media.addEventListener(X,_e),v[F].mediaEvents=_e)}),ie=v[F].textTracksEvents,eh.forEach(X=>{var Ae,Ce;ie&&cd&&((Ae=u.media.textTracks)==null||Ae.removeEventListener(X,ie),v[F].textTracksEvents=void 0),bd&&((Ce=f.media.textTracks)==null||Ce.addEventListener(X,_e),v[F].textTracksEvents=_e)}),ie=v[F].videoRenditionsEvents,th.forEach(X=>{var Ae,Ce;ie&&md&&((Ae=u.media.videoRenditions)==null||Ae.removeEventListener(X,ie),v[F].videoRenditionsEvents=void 0),gd&&((Ce=f.media.videoRenditions)==null||Ce.addEventListener(X,_e),v[F].videoRenditionsEvents=_e)}),ie=v[F].audioTracksEvents,ih.forEach(X=>{var Ae,Ce;ie&&hd&&((Ae=u.media.audioTracks)==null||Ae.removeEventListener(X,ie),v[F].audioTracksEvents=void 0),_d&&((Ce=f.media.audioTracks)==null||Ce.addEventListener(X,_e),v[F].audioTracksEvents=_e)}),ie=v[F].remoteEvents,ah.forEach(X=>{var Ae,Ce;ie&&pd&&((Ae=u.media.remote)==null||Ae.removeEventListener(X,ie),v[F].remoteEvents=void 0),Ad&&((Ce=f.media.remote)==null||Ce.addEventListener(X,_e),v[F].remoteEvents=_e)}),ie=v[F].rootEvents,rh.forEach(X=>{ie&&vd&&(u.documentElement.removeEventListener(X,ie),v[F].rootEvents=void 0),Td&&(f.documentElement.addEventListener(X,_e),v[F].rootEvents=_e)});let kd=v[F].stateOwnersUpdateHandlers;nh.forEach(X=>{kd&&fd&&kd(),yd&&(v[F].stateOwnersUpdateHandlers=X(_e,f))})}),Object.entries(f).forEach(([F,la])=>{u[F]=la}),g(),f=void 0};return w({media:t,fullscreenElement:e,documentElement:i,options:n}),{dispatch(A){let{type:T,detail:N}=A;if(r[T]&&c.mediaErrorCode==null){b(r[T](a,u,A));return}T==="mediaelementchangerequest"?w({media:N}):T==="fullscreenelementchangerequest"?w({fullscreenElement:N}):T==="documentelementchangerequest"?w({documentElement:N}):T==="optionschangerequest"&&Object.entries(N!=null?N:{}).forEach(([ee,ge])=>{u.options[ee]=ge})},getState(){return c},subscribe(A){return w({},l.length+1),l.push(A),A(c),()=>{let T=l.indexOf(A);T>=0&&(w({},l.length-1),l.splice(T,1))}}}},cu=qh;var Xo=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},L=(t,e,i)=>(Xo(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)},Tt=(t,e,i,a)=>(Xo(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),yt=(t,e,i)=>(Xo(t,e,"access private method"),i),kt,Aa,Z,Ta,He,Hr,$r,Zo,yi,ya,Wr,zo,fu=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],mu=10,O={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"},Fr=class extends Ea{constructor(){super(),ut(this,$r),ut(this,yi),ut(this,Wr),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,ut(this,kt,new Be(this,O.HOTKEYS)),ut(this,Aa,void 0),ut(this,Z,void 0),ut(this,Ta,void 0),ut(this,He,void 0),ut(this,Hr,i=>{var a;(a=L(this,Z))==null||a.dispatch(i)}),this.associateElement(this);let e={};Tt(this,Ta,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(Ld[n],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(O.NO_HOTKEYS,O.HOTKEYS,O.DEFAULT_STREAM_TYPE,O.DEFAULT_SUBTITLES,O.DEFAULT_DURATION)}get mediaStore(){return L(this,Z)}set mediaStore(e){var i,a;if(L(this,Z)&&((i=L(this,He))==null||i.call(this),Tt(this,He,void 0)),Tt(this,Z,e),!L(this,Z)&&!this.hasAttribute(O.NO_DEFAULT_STORE)){yt(this,$r,Zo).call(this);return}Tt(this,He,(a=L(this,Z))==null?void 0:a.subscribe(L(this,Ta)))}get fullscreenElement(){var e;return(e=L(this,Aa))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(O.FULLSCREEN_ELEMENT)&&this.removeAttribute(O.FULLSCREEN_ELEMENT),Tt(this,Aa,e),(i=L(this,Z))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}attributeChangedCallback(e,i,a){var r,n,s,l,u,c;if(super.attributeChangedCallback(e,i,a),e===O.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(O.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===O.HOTKEYS)L(this,kt).value=a;else if(e===O.DEFAULT_SUBTITLES&&a!==i)(r=L(this,Z))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(O.DEFAULT_SUBTITLES)}});else if(e===O.DEFAULT_STREAM_TYPE)(s=L(this,Z))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(O.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===O.LIVE_EDGE_OFFSET)(l=L(this,Z))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(O.LIVE_EDGE_OFFSET)?+this.getAttribute(O.LIVE_EDGE_OFFSET):void 0}});else if(e===O.FULLSCREEN_ELEMENT){let b=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;Tt(this,Aa,b),(c=L(this,Z))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,i;!L(this,Z)&&!this.hasAttribute(O.NO_DEFAULT_STORE)&&yt(this,$r,Zo).call(this),(e=L(this,Z))==null||e.dispatch({type:"documentelementchangerequest",detail:h}),super.connectedCallback(),L(this,Z)&&!L(this,He)&&Tt(this,He,(i=L(this,Z))==null?void 0:i.subscribe(L(this,Ta))),this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),L(this,Z)&&((i=L(this,Z))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=L(this,Z))==null||a.dispatch({type:p.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),L(this,He)&&((r=L(this,He))==null||r.call(this),Tt(this,He,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=L(this,Z))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=L(this,Z))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){vu(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=jh(e,a,r);Object.values(p).forEach(s=>{e.addEventListener(s,L(this,Hr))}),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,L(this,Hr))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),L(this,Z)&&Object.entries(L(this,Z).getState()).forEach(([r,n])=>{vu([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,Wr,zo))}disableHotkeys(){this.removeEventListener("keydown",yt(this,Wr,zo)),this.removeEventListener("keyup",yt(this,yi,ya))}get hotkeys(){return L(this,kt)}keyboardShortcutHandler(e){var i,a,r,n,s;let l=e.target;if(((r=(a=(i=l.getAttribute(O.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,b,g;if(!L(this,kt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&L(this,kt).contains("nospace")))switch(e.key){case" ":case"k":c=L(this,Z).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(O.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_BACKWARD_SEEK_OFFSET):mu;b=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-v,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}case"ArrowRight":{let v=this.hasAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET):mu;b=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+v,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}default:break}}};kt=new WeakMap;Aa=new WeakMap;Z=new WeakMap;Ta=new WeakMap;He=new WeakMap;Hr=new WeakMap;$r=new WeakSet;Zo=function(){var t;this.mediaStore=cu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(O.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(O.DEFAULT_DURATION)?+this.getAttribute(O.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(O.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(O.LIVE_EDGE_OFFSET)?+this.getAttribute(O.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(O.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(O.NO_SUBTITLES_LANG_PREF)}})};yi=new WeakSet;ya=function(t){let{key:e}=t;if(!fu.includes(e)){this.removeEventListener("keyup",yt(this,yi,ya));return}this.keyboardShortcutHandler(t)};Wr=new WeakSet;zo=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!fu.includes(a)){this.removeEventListener("keyup",yt(this,yi,ya));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(L(this,kt).contains(`no${a.toLowerCase()}`)||a===" "&&L(this,kt).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",yt(this,yi,ya),{once:!0})};var Zh=Object.values(o),zh=Object.values(wo),Eu=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,S.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>Zh.includes(l)):[]},Qh=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),zh.some(a=>a in t)},Qo=t=>Qh(t)||!!Eu(t).length,hu=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},pu={[o.MEDIA_SUBTITLES_LIST]:dt,[o.MEDIA_SUBTITLES_SHOWING]:dt,[o.MEDIA_SEEKABLE]:hu,[o.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(hu).join(" "),[o.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[o.MEDIA_RENDITION_LIST]:xd,[o.MEDIA_AUDIO_TRACK_LIST]:Od},Xh=async(t,e,i)=>{var a,r;if(t.isConnected||await gr(0),typeof i=="boolean"||i==null)return U(t,e,i);if(typeof i=="number")return D(t,e,i);if(typeof i=="string")return I(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let n=(r=(a=pu[e])==null?void 0:a.call(pu,i))!=null?r:i;return t.setAttribute(e,n)},Jh=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},Kt=(t,e)=>{if(Jh(t))return;let i=(r,n)=>{var s,l;Qo(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(g=>Kt(g,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Qo(t)){d.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},vu=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=Eu(a),n=e.toLowerCase();r.includes(n)&&Xh(a,n,i)})},jh=(t,e,i)=>{Kt(t,e);let a=b=>{var g;let v=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;e(v)},r=b=>{var g;let v=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;i(v)};t.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=b=>{b.forEach(g=>{let{addedNodes:v=[],removedNodes:f=[],type:w,target:A,attributeName:T}=g;w==="childList"?(Array.prototype.forEach.call(v,N=>Kt(N,e)),Array.prototype.forEach.call(f,N=>Kt(N,i))):w==="attributes"&&T===S.MEDIA_CHROME_ATTRIBUTES&&(Qo(A)?e(A):i(A))})},s=[],l=b=>{let g=b.target;g.name!=="media"&&(s.forEach(v=>Kt(v,i)),s=[...g.assignedElements({flatten:!0})],s.forEach(v=>Kt(v,e)))};t.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{Kt(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",Fr);var Jo=Fr;var es=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},j=(t,e,i)=>(es(t,e,"read from private field"),i?i.call(t):e.get(t)),ki=(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)},Kr=(t,e,i,a)=>(es(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ep=(t,e,i)=>(es(t,e,"access private method"),i),$e,Ii,St,Si,Yr,jo,bu,Vr={TOOLTIP_PLACEMENT:"tooltipplacement"},gu=h.createElement("template");gu.innerHTML=`
148
+ `;var Uh=Object.values(o),Bh="sm:384 md:576 lg:768 xl:960";function Hh(t){tu(t.target,t.contentRect.width)}function tu(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(x.BREAKPOINTS))!=null?i:Bh,r=$h(a),n=Wh(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(st.BREAKPOINTS_CHANGE,{detail:n});t.dispatchEvent(l)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(st.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function $h(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Wh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var ba=class extends d.HTMLElement{constructor(){super(),ke(this,Fo),ke(this,Ko),ke(this,Vo),ke(this,fa),ke(this,Dr),ke(this,_i),ke(this,Lr,0),ke(this,bi,null),ke(this,va,null),ke(this,gi,void 0),this.breakpointsComputed=!1,ke(this,Rr,new MutationObserver(Me(this,Fo,Xd).bind(this))),ke(this,pa,!1),ke(this,wr,i=>{Se(this,pa)||(setTimeout(()=>{Hh(i),Ht(this,pa,!1)},0),Ht(this,pa,!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){Se(this,bi)&&this.mediaUnsetCallback(Se(this,bi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[x.AUTOHIDE,x.GESTURES_DISABLED].concat(Uh).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()==x.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&&(Ht(this,bi,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Se(this,Rr).observe(this,{childList:!0,subtree:!0}),lt(this,Se(this,wr));let a=this.getAttribute(x.AUDIO)!=null?V.AUDIO_PLAYER():V.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(x.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;Se(this,Rr).disconnect(),dt(this,Se(this,wr)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ht(this,bi,null)}handleEvent(e){switch(e.type){case"pointerdown":Ht(this,Lr,e.timeStamp);break;case"pointermove":Me(this,Ko,Jd).call(this,e);break;case"pointerup":Me(this,Vo,jd).call(this,e);break;case"mouseleave":Me(this,fa,xr).call(this);break;case"mouseup":this.removeAttribute(x.KEYBOARD_CONTROL);break;case"keyup":Me(this,_i,Ea).call(this),this.setAttribute(x.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Ht(this,gi,isNaN(i)?0:i)}get autohide(){return(Se(this,gi)===void 0?2:Se(this,gi)).toString()}};Lr=new WeakMap;bi=new WeakMap;va=new WeakMap;gi=new WeakMap;Rr=new WeakMap;Fo=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)}};pa=new WeakMap;wr=new WeakMap;Ko=new WeakSet;Jd=function(t){t.pointerType!=="mouse"&&t.timeStamp-Se(this,Lr)<250||(Me(this,Dr,Go).call(this),clearTimeout(Se(this,va)),[this,this.media].includes(t.target)&&Me(this,_i,Ea).call(this))};Vo=new WeakSet;jd=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(x.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Me(this,fa,xr).call(this):Me(this,_i,Ea).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Me(this,_i,Ea).call(this)};fa=new WeakSet;xr=function(){if(Se(this,gi)<0||this.hasAttribute(x.USER_INACTIVE))return;this.setAttribute(x.USER_INACTIVE,"");let t=new d.CustomEvent(st.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};Dr=new WeakSet;Go=function(){if(!this.hasAttribute(x.USER_INACTIVE))return;this.removeAttribute(x.USER_INACTIVE);let t=new d.CustomEvent(st.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};_i=new WeakSet;Ea=function(){Me(this,Dr,Go).call(this),clearTimeout(Se(this,va));let t=parseInt(this.autohide);t<0||Ht(this,va,setTimeout(()=>{Me(this,fa,xr).call(this)},t*1e3))};d.customElements.get("media-container")||d.customElements.define("media-container",ba);var iu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ae=(t,e,i)=>(iu(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)},Or=(t,e,i,a)=>(iu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ai,Ti,Nr,$t,ut,Tt,$e=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){ga(this,ut),ga(this,Ai,void 0),ga(this,Ti,void 0),ga(this,Nr,void 0),ga(this,$t,new Set),Or(this,Ai,e),Or(this,Ti,i),Or(this,Nr,new Set(a))}[Symbol.iterator](){return ae(this,ut,Tt).values()}get length(){return ae(this,ut,Tt).size}get value(){var e;return(e=[...ae(this,ut,Tt)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Or(this,$t,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...ae(this,ut,Tt)][e]}values(){return ae(this,ut,Tt).values()}forEach(e,i){ae(this,ut,Tt).forEach(e,i)}add(...e){var i,a;e.forEach(r=>ae(this,$t).add(r)),!(this.value===""&&!((i=ae(this,Ai))!=null&&i.hasAttribute(`${ae(this,Ti)}`)))&&((a=ae(this,Ai))==null||a.setAttribute(`${ae(this,Ti)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>ae(this,$t).delete(a)),(i=ae(this,Ai))==null||i.setAttribute(`${ae(this,Ti)}`,`${this.value}`)}contains(e){return ae(this,ut,Tt).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}};Ai=new WeakMap;Ti=new WeakMap;Nr=new WeakMap;$t=new WeakMap;ut=new WeakSet;Tt=function(){return ae(this,$t).size?ae(this,$t):ae(this,Nr)};var Fh=(t="")=>t.split(/\s+/),au=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?fe.CAPTIONS:fe.SUBTITLES,language:i,label:r}},Wt=(t="",e={})=>Fh(t).map(i=>{let a=au(i);return{...e,...a}}),qo=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?au(e):e):typeof t=="string"?Wt(t):[t]:[],Pr=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,ct=(t=[])=>Array.prototype.map.call(t,Pr).join(" "),Kh=(t,e)=>i=>i[t]===e,ru=t=>{let e=Object.entries(t).map(([i,a])=>Kh(i,a));return i=>e.every(a=>a(i))},Ft=(t,e=[],i=[])=>{let a=qo(i).map(ru),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=t})},Kt=(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(()=>{})}},_a="fullscreenElement"in h?"fullscreenElement":"webkitFullscreenElement"in h?"webkitFullscreenElement":void 0,Vh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[_a];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=Vh(t);if(!n)return!1;if(n===r||n===i)return!0;if(n.localName.includes("-")){let s=n.shadowRoot;if(!(_a in s))return ue(n,r);for(;s!=null&&s[_a];){if(s[_a]===r)return!0;s=(e=s[_a])==null?void 0:e.shadowRoot}}return!1},Yh="fullscreenEnabled"in h?"fullscreenEnabled":"webkitFullscreenEnabled"in h?"webkitFullscreenEnabled":void 0,du=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[Yh])||i&&"webkitSupportsFullscreen"in i};var Br,Zo=()=>{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=Zo())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([Gh(t,i.signal),qh(t,e)]);return i.abort(),a},Gh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),qh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await _r(10)}return t.volume!==e},Zh=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),zo=(t=Zo())=>d.matchMedia("(display-mode: standalone)").matches&&Zh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",Qo=(t=Zo())=>du({documentElement:h,media:t}),cu=Qo(),mu=zo(),hu=!!d.WebKitPlaybackTargetAvailabilityEvent,pu=!!d.chrome;var yi=t=>Kt(t.media,e=>[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),Xo=t=>Kt(t.media,e=>e.mode===_t.SHOWING&&[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)),Hr=(t,e)=>{let i=yi(t),a=Xo(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)Ft(_t.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let n=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let _=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=_?[_,...globalThis.navigator.languages]:globalThis.navigator.languages,v=i.filter(f=>g.some(L=>f.language.toLowerCase().startsWith(L.split("-")[0]))).sort((f,L)=>{let A=g.findIndex(N=>f.language.toLowerCase().startsWith(N.split("-")[0])),T=g.findIndex(N=>L.language.toLowerCase().startsWith(N.split("-")[0]));return A-T});v[0]&&(n=v[0])}let{language:l,label:u,kind:c}=n;Ft(_t.DISABLED,i,a),Ft(_t.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)?zh(t,e):Object.entries(t).every(([i,a])=>i in e&&$r(a,e[i])),zh=(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 Qh=Object.values(Le),Wr,Xh=uu().then(t=>(Wr=t,Wr)),vu=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))}))},Aa={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;i&&(i.muted=t)},mediaEvents:["volumechange"]},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{}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let a=d.localStorage.getItem("media-chrome-pref-volume");if(a==null)return;Aa.mediaVolume.set(+a,e),t(+a)}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||!Ei(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=[Le.LIVE,Le.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(Qh.includes(r))return r===Le.UNKNOWN?a:r;let n=e.duration;return n===1/0?Le.LIVE:Number.isFinite(n)?Le.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=Aa.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Le.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(!(Aa.mediaStreamType.get(t)===Le.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 Xo(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&&![fe.CAPTIONS,fe.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]=Kt(i,{kind:fe.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("-")?ue(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||!Qo(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&&Xh.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 fu={[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[f]=Kt(s,{kind:fe.METADATA,label:"thumbnails"}),L=Array.prototype.find.call((a=f==null?void 0:f.cues)!=null?a:[],(A,T,N)=>T===0?A.endTime>l:T===N.length-1?A.startTime<=l:A.startTime<=l&&A.endTime>l);if(L){let A=/'^(?:[a-z]+:)?\/\//i.test(L.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,T=new URL(L.text,A);c=new URLSearchParams(T.hash).get("#xywh").split(",").map(ee=>+ee),u=T.href}}let _=t.mediaDuration.get(e),v=(n=t.mediaChaptersCues.get(e).find((f,L,A)=>L===A.length-1&&_===f.endTime?f.startTime<=l&&f.endTime>=l:f.startTime<=l&&f.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)===Le.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=qo(i),l=(a=s[0])==null?void 0:a.language;l&&!r.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Ft(_t.SHOWING,n,s)},[p.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=yi(e),r=i!=null?i:[];Ft(_t.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=Aa,requestMap:r=fu,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=>{A!=null&&($r(A,c)||(c=Object.freeze({...c,...A}),l.forEach(T=>T(c))))},g=()=>{let A=Object.entries(a).reduce((T,[N,{get:ee}])=>(T[N]=ee(u),T),{});_(A)},v={},f,L=async(A,T)=>{var N,ee,ge,gt,nt,Ji,ji,ea,ta,ia,aa,ra,na,oa,sa,la;let Er=!!f;if(f={...u,...f!=null?f:{},...A},Er)return;await vu(...Object.values(A));let ot=l.length>0&&T===0&&s,ld=u.media!==f.media,dd=((N=u.media)==null?void 0:N.textTracks)!==((ee=f.media)==null?void 0:ee.textTracks),ud=((ge=u.media)==null?void 0:ge.videoRenditions)!==((gt=f.media)==null?void 0:gt.videoRenditions),cd=((nt=u.media)==null?void 0:nt.audioTracks)!==((Ji=f.media)==null?void 0:Ji.audioTracks),md=((ji=u.media)==null?void 0:ji.remote)!==((ea=f.media)==null?void 0:ea.remote),hd=u.documentElement!==f.documentElement,pd=!!u.media&&(ld||ot),vd=!!((ta=u.media)!=null&&ta.textTracks)&&(dd||ot),fd=!!((ia=u.media)!=null&&ia.videoRenditions)&&(ud||ot),Ed=!!((aa=u.media)!=null&&aa.audioTracks)&&(cd||ot),bd=!!((ra=u.media)!=null&&ra.remote)&&(md||ot),gd=!!u.documentElement&&(hd||ot),_d=pd||vd||fd||Ed||bd||gd,pi=l.length===0&&T===1&&s,Ad=!!f.media&&(ld||pi),Td=!!((na=f.media)!=null&&na.textTracks)&&(dd||pi),yd=!!((oa=f.media)!=null&&oa.videoRenditions)&&(ud||pi),kd=!!((sa=f.media)!=null&&sa.audioTracks)&&(cd||pi),Sd=!!((la=f.media)!=null&&la.remote)&&(md||pi),Id=!!f.documentElement&&(hd||pi),Cd=Ad||Td||yd||kd||Sd||Id;if(!(_d||Cd)){Object.entries(f).forEach(([W,da])=>{u[W]=da}),g(),f=void 0;return}Object.entries(a).forEach(([W,{get:da,mediaEvents:nh=[],textTracksEvents:oh=[],videoRenditionsEvents:sh=[],audioTracksEvents:lh=[],remoteEvents:dh=[],rootEvents:uh=[],stateOwnersUpdateHandlers:ch=[]}])=>{v[W]||(v[W]={});let _e=X=>{let Ae=da(u,X);_({[W]:Ae})},ie;ie=v[W].mediaEvents,nh.forEach(X=>{ie&&pd&&(u.media.removeEventListener(X,ie),v[W].mediaEvents=void 0),Ad&&(f.media.addEventListener(X,_e),v[W].mediaEvents=_e)}),ie=v[W].textTracksEvents,oh.forEach(X=>{var Ae,we;ie&&vd&&((Ae=u.media.textTracks)==null||Ae.removeEventListener(X,ie),v[W].textTracksEvents=void 0),Td&&((we=f.media.textTracks)==null||we.addEventListener(X,_e),v[W].textTracksEvents=_e)}),ie=v[W].videoRenditionsEvents,sh.forEach(X=>{var Ae,we;ie&&fd&&((Ae=u.media.videoRenditions)==null||Ae.removeEventListener(X,ie),v[W].videoRenditionsEvents=void 0),yd&&((we=f.media.videoRenditions)==null||we.addEventListener(X,_e),v[W].videoRenditionsEvents=_e)}),ie=v[W].audioTracksEvents,lh.forEach(X=>{var Ae,we;ie&&Ed&&((Ae=u.media.audioTracks)==null||Ae.removeEventListener(X,ie),v[W].audioTracksEvents=void 0),kd&&((we=f.media.audioTracks)==null||we.addEventListener(X,_e),v[W].audioTracksEvents=_e)}),ie=v[W].remoteEvents,dh.forEach(X=>{var Ae,we;ie&&bd&&((Ae=u.media.remote)==null||Ae.removeEventListener(X,ie),v[W].remoteEvents=void 0),Sd&&((we=f.media.remote)==null||we.addEventListener(X,_e),v[W].remoteEvents=_e)}),ie=v[W].rootEvents,uh.forEach(X=>{ie&&gd&&(u.documentElement.removeEventListener(X,ie),v[W].rootEvents=void 0),Id&&(f.documentElement.addEventListener(X,_e),v[W].rootEvents=_e)});let Md=v[W].stateOwnersUpdateHandlers;ch.forEach(X=>{Md&&_d&&Md(),Cd&&(v[W].stateOwnersUpdateHandlers=X(_e,f))})}),Object.entries(f).forEach(([W,da])=>{u[W]=da}),g(),f=void 0};return L({media:t,fullscreenElement:e,documentElement:i,options:n}),{dispatch(A){let{type:T,detail:N}=A;if(r[T]&&c.mediaErrorCode==null){_(r[T](a,u,A));return}T==="mediaelementchangerequest"?L({media:N}):T==="fullscreenelementchangerequest"?L({fullscreenElement:N}):T==="documentelementchangerequest"?L({documentElement:N}):T==="optionschangerequest"&&Object.entries(N!=null?N:{}).forEach(([ee,ge])=>{u.options[ee]=ge})},getState(){return c},subscribe(A){return L({},l.length+1),l.push(A),A(c),()=>{let T=l.indexOf(A);T>=0&&(L({},l.length-1),l.splice(T,1))}}}};var ts=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},w=(t,e,i)=>(ts(t,e,"read from private field"),i?i.call(t):e.get(t)),mt=(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)},yt=(t,e,i,a)=>(ts(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),kt=(t,e,i)=>(ts(t,e,"access private method"),i),St,Ta,Z,ya,We,Fr,Kr,Jo,ki,ka,Vr,jo,Tu=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],bu=10,O={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"},Yr=class extends ba{constructor(){super(),mt(this,Kr),mt(this,ki),mt(this,Vr),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,mt(this,St,new $e(this,O.HOTKEYS)),mt(this,Ta,void 0),mt(this,Z,void 0),mt(this,ya,void 0),mt(this,We,void 0),mt(this,Fr,i=>{var a;(a=w(this,Z))==null||a.dispatch(i)}),this.associateElement(this);let e={};yt(this,ya,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(O.NO_HOTKEYS,O.HOTKEYS,O.DEFAULT_STREAM_TYPE,O.DEFAULT_SUBTITLES,O.DEFAULT_DURATION)}get mediaStore(){return w(this,Z)}set mediaStore(e){var i,a;if(w(this,Z)&&((i=w(this,We))==null||i.call(this),yt(this,We,void 0)),yt(this,Z,e),!w(this,Z)&&!this.hasAttribute(O.NO_DEFAULT_STORE)){kt(this,Kr,Jo).call(this);return}yt(this,We,(a=w(this,Z))==null?void 0:a.subscribe(w(this,ya)))}get fullscreenElement(){var e;return(e=w(this,Ta))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(O.FULLSCREEN_ELEMENT)&&this.removeAttribute(O.FULLSCREEN_ELEMENT),yt(this,Ta,e),(i=w(this,Z))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}attributeChangedCallback(e,i,a){var r,n,s,l,u,c;if(super.attributeChangedCallback(e,i,a),e===O.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(O.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===O.HOTKEYS)w(this,St).value=a;else if(e===O.DEFAULT_SUBTITLES&&a!==i)(r=w(this,Z))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(O.DEFAULT_SUBTITLES)}});else if(e===O.DEFAULT_STREAM_TYPE)(s=w(this,Z))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(O.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===O.LIVE_EDGE_OFFSET)(l=w(this,Z))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(O.LIVE_EDGE_OFFSET)?+this.getAttribute(O.LIVE_EDGE_OFFSET):void 0}});else if(e===O.FULLSCREEN_ELEMENT){let _=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;yt(this,Ta,_),(c=w(this,Z))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,i;!w(this,Z)&&!this.hasAttribute(O.NO_DEFAULT_STORE)&&kt(this,Kr,Jo).call(this),(e=w(this,Z))==null||e.dispatch({type:"documentelementchangerequest",detail:h}),super.connectedCallback(),w(this,Z)&&!w(this,We)&&yt(this,We,(i=w(this,Z))==null?void 0:i.subscribe(w(this,ya))),this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),w(this,Z)&&((i=w(this,Z))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=w(this,Z))==null||a.dispatch({type:p.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),w(this,We)&&((r=w(this,We))==null||r.call(this),yt(this,We,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=w(this,Z))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=w(this,Z))==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=ap(e,a,r);Object.values(p).forEach(s=>{e.addEventListener(s,w(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,w(this,Fr))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),w(this,Z)&&Object.entries(w(this,Z).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",kt(this,Vr,jo))}disableHotkeys(){this.removeEventListener("keydown",kt(this,Vr,jo)),this.removeEventListener("keyup",kt(this,ki,ka))}get hotkeys(){return w(this,St)}keyboardShortcutHandler(e){var i,a,r,n,s;let l=e.target;if(((r=(a=(i=l.getAttribute(O.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,_,g;if(!w(this,St).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&w(this,St).contains("nospace")))switch(e.key){case" ":case"k":c=w(this,Z).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(O.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_BACKWARD_SEEK_OFFSET):bu;_=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-v,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowRight":{let v=this.hasAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET):bu;_=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+v,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}default:break}}};St=new WeakMap;Ta=new WeakMap;Z=new WeakMap;ya=new WeakMap;We=new WeakMap;Fr=new WeakMap;Kr=new WeakSet;Jo=function(){var t;this.mediaStore=Eu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(O.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(O.DEFAULT_DURATION)?+this.getAttribute(O.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(O.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(O.LIVE_EDGE_OFFSET)?+this.getAttribute(O.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(O.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(O.NO_SUBTITLES_LANG_PREF)}})};ki=new WeakSet;ka=function(t){let{key:e}=t;if(!Tu.includes(e)){this.removeEventListener("keyup",kt(this,ki,ka));return}this.keyboardShortcutHandler(t)};Vr=new WeakSet;jo=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!Tu.includes(a)){this.removeEventListener("keyup",kt(this,ki,ka));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(w(this,St).contains(`no${a.toLowerCase()}`)||a===" "&&w(this,St).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",kt(this,ki,ka),{once:!0})};var Jh=Object.values(o),jh=Object.values(Oo),yu=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,S.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>Jh.includes(l)):[]},ep=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),jh.some(a=>a in t)},es=t=>ep(t)||!!yu(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]:ct,[o.MEDIA_SUBTITLES_SHOWING]:ct,[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},tp=async(t,e,i)=>{var a,r;if(t.isConnected||await _r(0),typeof i=="boolean"||i==null)return U(t,e,i);if(typeof i=="number")return D(t,e,i);if(typeof i=="string")return I(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)},ip=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},Vt=(t,e)=>{if(ip(t))return;let i=(r,n)=>{var s,l;es(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(g=>Vt(g,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!es(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=yu(a),n=e.toLowerCase();r.includes(n)&&tp(a,n,i)})},ap=(t,e,i)=>{Vt(t,e);let a=_=>{var g;let v=(g=_==null?void 0:_.composedPath()[0])!=null?g:_.target;e(v)},r=_=>{var g;let v=(g=_==null?void 0:_.composedPath()[0])!=null?g:_.target;i(v)};t.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=_=>{_.forEach(g=>{let{addedNodes:v=[],removedNodes:f=[],type:L,target:A,attributeName:T}=g;L==="childList"?(Array.prototype.forEach.call(v,N=>Vt(N,e)),Array.prototype.forEach.call(f,N=>Vt(N,i))):L==="attributes"&&T===S.MEDIA_CHROME_ATTRIBUTES&&(es(A)?e(A):i(A))})},s=[],l=_=>{let g=_.target;g.name!=="media"&&(s.forEach(v=>Vt(v,i)),s=[...g.assignedElements({flatten:!0})],s.forEach(v=>Vt(v,e)))};t.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{Vt(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",Yr);var is=Yr;var rs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},j=(t,e,i)=>(rs(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)},Gr=(t,e,i,a)=>(rs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),rp=(t,e,i)=>(rs(t,e,"access private method"),i),Fe,Ci,It,Ii,Zr,as,ku,qr={TOOLTIP_PLACEMENT:"tooltipplacement"},Su=h.createElement("template");Su.innerHTML=`
149
149
  <style>
150
150
  :host {
151
151
  position: relative;
@@ -220,10 +220,10 @@
220
220
  <slot name="tooltip-content"></slot>
221
221
  </media-tooltip>
222
222
  </slot>
223
- `;var K=class extends d.HTMLElement{constructor(e={}){var i;if(super(),ki(this,jo),ki(this,$e,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",ki(this,Ii,a=>{this.preventClick||this.handleClick(a),setTimeout(j(this,St),0)}),ki(this,St,()=>{var a,r;(r=(a=this.tooltipEl)==null?void 0:a.updateXOffset)==null||r.call(a)}),ki(this,Si,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",j(this,Si));return}this.preventClick||this.handleClick(a)}),ki(this,Yr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",j(this,Si));return}this.addEventListener("keyup",j(this,Si),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=gu.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",Vr.TOOLTIP_PLACEMENT,S.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",j(this,Ii)),this.addEventListener("keydown",j(this,Yr)),this.tabIndex=0}disable(){this.removeEventListener("click",j(this,Ii)),this.removeEventListener("keydown",j(this,Yr)),this.removeEventListener("keyup",j(this,Si)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER?(i&&((n=(r=j(this,$e))==null?void 0:r.unassociateElement)==null||n.call(r,this),Kr(this,$e,null)),a&&this.isConnected&&(Kr(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=j(this,$e))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===Vr.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i&&(this.tooltipEl.placement=a),j(this,St).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.enable(),this.setAttribute("role","button");let n=this.getAttribute(S.MEDIA_CONTROLLER);n&&(Kr(this,$e,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=j(this,$e))==null?void 0:i.associateElement)==null||a.call(i,this)),d.customElements.whenDefined("media-tooltip").then(()=>ep(this,jo,bu).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=j(this,$e))==null?void 0:e.unassociateElement)==null||i.call(e,this),Kr(this,$e,null),this.removeEventListener("mouseenter",j(this,St)),this.removeEventListener("focus",j(this,St)),this.removeEventListener("click",j(this,Ii))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return R(this,Vr.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){I(this,Vr.TOOLTIP_PLACEMENT,e)}handleClick(e){}};$e=new WeakMap;Ii=new WeakMap;St=new WeakMap;Si=new WeakMap;Yr=new WeakMap;jo=new WeakSet;bu=function(){this.addEventListener("mouseenter",j(this,St)),this.addEventListener("focus",j(this,St)),this.addEventListener("click",j(this,Ii));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",K);var _u=`<svg aria-hidden="true" viewBox="0 0 26 24">
223
+ `;var F=class extends d.HTMLElement{constructor(e={}){var i;if(super(),Si(this,as),Si(this,Fe,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",Si(this,Ci,a=>{this.preventClick||this.handleClick(a),setTimeout(j(this,It),0)}),Si(this,It,()=>{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",j(this,Ii));return}this.preventClick||this.handleClick(a)}),Si(this,Zr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",j(this,Ii));return}this.addEventListener("keyup",j(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",qr.TOOLTIP_PLACEMENT,S.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",j(this,Ci)),this.addEventListener("keydown",j(this,Zr)),this.tabIndex=0}disable(){this.removeEventListener("click",j(this,Ci)),this.removeEventListener("keydown",j(this,Zr)),this.removeEventListener("keyup",j(this,Ii)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER?(i&&((n=(r=j(this,Fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),Gr(this,Fe,null)),a&&this.isConnected&&(Gr(this,Fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=j(this,Fe))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===qr.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i&&(this.tooltipEl.placement=a),j(this,It).call(this)}connectedCallback(){var e,i,a;let{style:r}=G(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let n=this.getAttribute(S.MEDIA_CONTROLLER);n&&(Gr(this,Fe,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=j(this,Fe))==null?void 0:i.associateElement)==null||a.call(i,this)),d.customElements.whenDefined("media-tooltip").then(()=>rp(this,as,ku).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=j(this,Fe))==null?void 0:e.unassociateElement)==null||i.call(e,this),Gr(this,Fe,null),this.removeEventListener("mouseenter",j(this,It)),this.removeEventListener("focus",j(this,It)),this.removeEventListener("click",j(this,Ci))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return R(this,qr.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){I(this,qr.TOOLTIP_PLACEMENT,e)}handleClick(e){}};Fe=new WeakMap;Ci=new WeakMap;It=new WeakMap;Ii=new WeakMap;Zr=new WeakMap;as=new WeakSet;ku=function(){this.addEventListener("mouseenter",j(this,It)),this.addEventListener("focus",j(this,It)),this.addEventListener("click",j(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",F);var Iu=`<svg aria-hidden="true" viewBox="0 0 26 24">
224
224
  <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
225
  </svg>
226
- `,Tu=h.createElement("template");Tu.innerHTML=`
226
+ `,Mu=h.createElement("template");Mu.innerHTML=`
227
227
  <style>
228
228
  :host([${o.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
229
229
  display: none !important;
@@ -241,17 +241,17 @@
241
241
  </style>
242
242
 
243
243
  <slot name="icon">
244
- <slot name="enter">${_u}</slot>
245
- <slot name="exit">${_u}</slot>
244
+ <slot name="enter">${Iu}</slot>
245
+ <slot name="exit">${Iu}</slot>
246
246
  </slot>
247
- `;var tp=`
247
+ `;var np=`
248
248
  <slot name="tooltip-enter">${C.ENTER_AIRPLAY}</slot>
249
249
  <slot name="tooltip-exit">${C.EXIT_AIRPLAY}</slot>
250
- `,Au=t=>{let e=t.mediaIsAirplaying?G.EXIT_AIRPLAY():G.ENTER_AIRPLAY();t.setAttribute("aria-label",e)},ts=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Tu,tooltipContent:tp,...e})}connectedCallback(){super.connectedCallback(),Au(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_AIRPLAYING&&Au(this)}get mediaIsAirplaying(){return H(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){U(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return R(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){I(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",ts);var ip=`<svg aria-hidden="true" viewBox="0 0 26 24">
250
+ `,Cu=t=>{let e=t.mediaIsAirplaying?Y.EXIT_AIRPLAY():Y.ENTER_AIRPLAY();t.setAttribute("aria-label",e)},ns=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Mu,tooltipContent:np,...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 H(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){U(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return R(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){I(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",ns);var op=`<svg aria-hidden="true" viewBox="0 0 26 24">
251
251
  <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>`,ap=`<svg aria-hidden="true" viewBox="0 0 26 24">
252
+ </svg>`,sp=`<svg aria-hidden="true" viewBox="0 0 26 24">
253
253
  <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>`,Iu=h.createElement("template");Iu.innerHTML=`
254
+ </svg>`,xu=h.createElement("template");xu.innerHTML=`
255
255
  <style>
256
256
  :host([aria-checked="true"]) slot[name=off] {
257
257
  display: none !important;
@@ -269,13 +269,13 @@
269
269
  </style>
270
270
 
271
271
  <slot name="icon">
272
- <slot name="on">${ip}</slot>
273
- <slot name="off">${ap}</slot>
272
+ <slot name="on">${op}</slot>
273
+ <slot name="off">${sp}</slot>
274
274
  </slot>
275
- `;var rp=`
275
+ `;var lp=`
276
276
  <slot name="tooltip-enable">${C.ENABLE_CAPTIONS}</slot>
277
277
  <slot name="tooltip-disable">${C.DISABLE_CAPTIONS}</slot>
278
- `,yu=t=>{t.setAttribute("aria-checked",Or(t).toString())},is=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Iu,tooltipContent:rp,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",Y.CLOSED_CAPTIONS()),yu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&yu(this)}get mediaSubtitlesList(){return ku(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Su(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return ku(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Su(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(p.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},ku=(t,e)=>{let i=t.getAttribute(e);return i?$t(i):[]},Su=(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",is);var np='<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>',op='<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>',Mu=h.createElement("template");Mu.innerHTML=`
278
+ `,Ru=t=>{t.setAttribute("aria-checked",Ur(t).toString())},os=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:xu,tooltipContent:lp,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",V.CLOSED_CAPTIONS()),Ru(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&Ru(this)}get mediaSubtitlesList(){return wu(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Lu(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return wu(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}))}},wu=(t,e)=>{let i=t.getAttribute(e);return i?Wt(i):[]},Lu=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=ct(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",os);var 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"/></g></svg>',up='<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=`
279
279
  <style>
280
280
  :host([${o.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
281
281
  display: none !important;
@@ -293,13 +293,13 @@
293
293
  </style>
294
294
 
295
295
  <slot name="icon">
296
- <slot name="enter">${np}</slot>
297
- <slot name="exit">${op}</slot>
296
+ <slot name="enter">${dp}</slot>
297
+ <slot name="exit">${up}</slot>
298
298
  </slot>
299
- `;var sp=`
299
+ `;var cp=`
300
300
  <slot name="tooltip-enter">${C.START_CAST}</slot>
301
301
  <slot name="tooltip-exit">${C.STOP_CAST}</slot>
302
- `,Cu=t=>{let e=t.mediaIsCasting?G.EXIT_CAST():G.ENTER_CAST();t.setAttribute("aria-label",e)},as=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Mu,tooltipContent:sp,...e})}connectedCallback(){super.connectedCallback(),Cu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_CASTING&&Cu(this)}get mediaIsCasting(){return H(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){U(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return R(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){I(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",as);var us=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yt=(t,e,i)=>(us(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)},cs=(t,e,i,a)=>(us(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Vt=(t,e,i)=>(us(t,e,"access private method"),i),qr,Sa,Gt,Gr,rs,ns,Ru,os,Lu,ss,wu,ls,xu,ds,Du;function lp(t){return`
302
+ `,Du=t=>{let e=t.mediaIsCasting?Y.EXIT_CAST():Y.ENTER_CAST();t.setAttribute("aria-label",e)},ss=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ou,tooltipContent:cp,...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 H(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){U(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return R(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){I(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",ss);var ps=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Gt=(t,e,i)=>(ps(t,e,"read from private field"),i?i.call(t):e.get(t)),ht=(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)},vs=(t,e,i,a)=>(ps(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Yt=(t,e,i)=>(ps(t,e,"access private method"),i),Qr,Ia,qt,zr,ls,ds,Nu,us,Pu,cs,Uu,ms,Bu,hs,Hu;function mp(t){return`
303
303
  <style>
304
304
  :host {
305
305
  font: var(--media-font,
@@ -339,11 +339,11 @@
339
339
  }
340
340
  </style>
341
341
  ${this.getSlotTemplateHTML(t)}
342
- `}function dp(t){return`
342
+ `}function hp(t){return`
343
343
  <slot id="content"></slot>
344
- `}var ka={OPEN:"open",ANCHOR:"anchor"},qt=class extends d.HTMLElement{constructor(){super(),ct(this,Gr),ct(this,ns),ct(this,os),ct(this,ss),ct(this,ls),ct(this,ds),ct(this,qr,!1),ct(this,Sa,null),ct(this,Gt,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[ka.OPEN,ka.ANCHOR]}get open(){return H(this,ka.OPEN)}set open(e){U(this,ka.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Vt(this,ss,wu).call(this,e);break;case"focusout":Vt(this,ls,xu).call(this,e);break;case"keydown":Vt(this,ds,Du).call(this,e);break}}connectedCallback(){Vt(this,Gr,rs).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){Vt(this,Gr,rs).call(this),e===ka.OPEN&&a!==i&&(this.open?Vt(this,ns,Ru).call(this):Vt(this,os,Lu).call(this))}focus(){cs(this,Sa,ma());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"]}};qr=new WeakMap;Sa=new WeakMap;Gt=new WeakMap;Gr=new WeakSet;rs=function(){if(!Yt(this,qr)&&(cs(this,qr,!0),!this.shadowRoot)){this.attachShadow({mode:"open"});let t=Kd(this.attributes);this.shadowRoot.innerHTML=`
344
+ `}var Sa={OPEN:"open",ANCHOR:"anchor"},Zt=class extends d.HTMLElement{constructor(){super(),ht(this,zr),ht(this,ds),ht(this,us),ht(this,cs),ht(this,ms),ht(this,hs),ht(this,Qr,!1),ht(this,Ia,null),ht(this,qt,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Sa.OPEN,Sa.ANCHOR]}get open(){return H(this,Sa.OPEN)}set open(e){U(this,Sa.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":Yt(this,cs,Uu).call(this,e);break;case"focusout":Yt(this,ms,Bu).call(this,e);break;case"keydown":Yt(this,hs,Hu).call(this,e);break}}connectedCallback(){Yt(this,zr,ls).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){Yt(this,zr,ls).call(this),e===Sa.OPEN&&a!==i&&(this.open?Yt(this,ds,Nu).call(this):Yt(this,us,Pu).call(this))}focus(){vs(this,Ia,ha());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"]}};Qr=new WeakMap;Ia=new WeakMap;qt=new WeakMap;zr=new WeakSet;ls=function(){if(!Gt(this,Qr)&&(vs(this,Qr,!0),!this.shadowRoot)){this.attachShadow({mode:"open"});let t=qd(this.attributes);this.shadowRoot.innerHTML=`
345
345
  ${this.constructor.getTemplateHTML(t)}
346
- `}};ns=new WeakSet;Ru=function(){var t;(t=Yt(this,Gt))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};os=new WeakSet;Lu=function(){var t;(t=Yt(this,Gt))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};ss=new WeakSet;wu=function(t){cs(this,Gt,t.relatedTarget),ue(this,t.relatedTarget)||(this.open=!this.open)};ls=new WeakSet;xu=function(t){var e;ue(this,t.relatedTarget)||((e=Yt(this,Sa))==null||e.focus(),Yt(this,Gt)&&Yt(this,Gt)!==t.relatedTarget&&this.open&&(this.open=!1))};ds=new WeakSet;Du=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=Yt(this,Sa))==null||n.focus(),this.open=!1))};qt.getTemplateHTML=lp;qt.getSlotTemplateHTML=dp;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",qt);var bs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Q=(t,e,i)=>(bs(t,e,"read from private field"),i?i.call(t):e.get(t)),oe=(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)},It=(t,e,i,a)=>(bs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Le=(t,e,i)=>(bs(t,e,"access private method"),i),We,rn,Zr,zr,we,tn,Qr,Xr,Jr,gs,Ou,jr,ms,en,hs,an,_s,ps,Nu,vs,Pu,fs,Uu,Es,Bu,Hu=h.createElement("template");Hu.innerHTML=`
346
+ `}};ds=new WeakSet;Nu=function(){var t;(t=Gt(this,qt))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};us=new WeakSet;Pu=function(){var t;(t=Gt(this,qt))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};cs=new WeakSet;Uu=function(t){vs(this,qt,t.relatedTarget),ue(this,t.relatedTarget)||(this.open=!this.open)};ms=new WeakSet;Bu=function(t){var e;ue(this,t.relatedTarget)||((e=Gt(this,Ia))==null||e.focus(),Gt(this,qt)&&Gt(this,qt)!==t.relatedTarget&&this.open&&(this.open=!1))};hs=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,Ia))==null||n.focus(),this.open=!1))};Zt.getTemplateHTML=mp;Zt.getSlotTemplateHTML=hp;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",Zt);var Ts=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Q=(t,e,i)=>(Ts(t,e,"read from private field"),i?i.call(t):e.get(t)),oe=(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)},Ct=(t,e,i,a)=>(Ts(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),xe=(t,e,i)=>(Ts(t,e,"access private method"),i),Ke,sn,Xr,Jr,De,nn,jr,en,tn,ys,$u,an,fs,rn,Es,on,ks,bs,Wu,gs,Fu,_s,Ku,As,Vu,Yu=h.createElement("template");Yu.innerHTML=`
347
347
  <style>
348
348
  :host {
349
349
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -499,22 +499,26 @@
499
499
  }
500
500
  }
501
501
 
502
- #thumb {
502
+ #thumb,
503
+ ::slotted([slot=thumb]) {
503
504
  width: var(--media-range-thumb-width, 10px);
504
505
  height: var(--media-range-thumb-height, 10px);
505
- margin-left: calc(var(--media-range-thumb-width, 10px) / -2);
506
- border: var(--media-range-thumb-border, none);
507
- border-radius: var(--media-range-thumb-border-radius, 10px);
508
- background: var(--media-range-thumb-background, var(--media-primary-color, rgb(238 238 238)));
509
- box-shadow: var(--media-range-thumb-box-shadow, 1px 1px 1px transparent);
510
506
  transition: var(--media-range-thumb-transition);
511
507
  transform: var(--media-range-thumb-transform, none);
512
508
  opacity: var(--media-range-thumb-opacity, 1);
509
+ translate: -50%;
513
510
  position: absolute;
514
511
  left: 0;
515
512
  cursor: pointer;
516
513
  }
517
514
 
515
+ #thumb {
516
+ border-radius: var(--media-range-thumb-border-radius, 10px);
517
+ background: var(--media-range-thumb-background, var(--media-primary-color, rgb(238 238 238)));
518
+ box-shadow: var(--media-range-thumb-box-shadow, 1px 1px 1px transparent);
519
+ border: var(--media-range-thumb-border, none);
520
+ }
521
+
518
522
  :host([disabled]) #thumb {
519
523
  background-color: #777;
520
524
  }
@@ -559,13 +563,15 @@
559
563
  <div id="pointer"></div>
560
564
  <div id="progress" part="progress"></div>
561
565
  </div>
562
- <div id="thumb" part="thumb"></div>
566
+ <slot name="thumb">
567
+ <div id="thumb" part="thumb"></div>
568
+ </slot>
563
569
  <svg id="segments"><clipPath id="segments-clipping"></clipPath></svg>
564
570
  </div>
565
571
  <input id="range" type="range" min="0" max="1" step="any" value="0">
566
572
  </div>
567
573
  <div id="rightgap"></div>
568
- `;var Zt=class extends d.HTMLElement{constructor(){super(),oe(this,gs),oe(this,jr),oe(this,en),oe(this,an),oe(this,ps),oe(this,vs),oe(this,fs),oe(this,Es),oe(this,We,void 0),oe(this,rn,void 0),oe(this,Zr,void 0),oe(this,zr,void 0),oe(this,we,{}),oe(this,tn,[]),oe(this,Qr,()=>{if(this.range.matches(":focus-visible")){let{style:e}=W(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),oe(this,Xr,()=>{let{style:e}=W(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),oe(this,Jr,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Hu.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),It(this,Zr,this.shadowRoot.querySelector("#startpoint")),It(this,zr,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",S.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER?(i&&((n=(r=Q(this,We))==null?void 0:r.unassociateElement)==null||n.call(r,this),It(this,We,null)),a&&this.isConnected&&(It(this,We,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Q(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),Le(this,jr,ms).call(this)):(this.range.setAttribute(e,a),Le(this,en,hs).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))`),Q(this,we).pointer=W(this.shadowRoot,"#pointer"),Q(this,we).progress=W(this.shadowRoot,"#progress"),Q(this,we).thumb=W(this.shadowRoot,"#thumb"),Q(this,we).activeSegment=W(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(S.MEDIA_CONTROLLER);n&&(It(this,We,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=Q(this,We))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Q(this,Qr)),this.shadowRoot.addEventListener("focusout",Q(this,Xr)),Le(this,jr,ms).call(this),ot(this.container,Q(this,Jr))}disconnectedCallback(){var e,i;Le(this,en,hs).call(this),(i=(e=Q(this,We))==null?void 0:e.unassociateElement)==null||i.call(e,this),It(this,We,null),this.shadowRoot.removeEventListener("focusin",Q(this,Qr)),this.shadowRoot.removeEventListener("focusout",Q(this,Xr)),Ut(this.container,Q(this,Jr))}updatePointerBar(e){var i;(i=Q(this,we).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=Q(this,we).progress)==null||e.style.setProperty("width",`${a}%`),(i=Q(this,we).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])];It(this,tn,[...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}%`,g=`calc(${((u?r:a[n+1])-s)*100}%${l||u?"":" - var(--segments-gap)"})`,v=h.createElementNS("http://www.w3.org/2000/svg","rect"),f=W(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);f.style.setProperty("x",c),f.style.setProperty("width",g),i.append(v)}}getPointerRatio(e){let i=Vd(e.clientX,e.clientY,Q(this,Zr).getBoundingClientRect(),Q(this,zr).getBoundingClientRect());return Math.max(0,Math.min(1,i))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Le(this,Es,Bu).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Le(this,ps,Nu).call(this,e);break;case"pointerdown":Le(this,an,_s).call(this,e);break;case"pointerup":Le(this,vs,Pu).call(this);break;case"pointerleave":Le(this,fs,Uu).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};We=new WeakMap;rn=new WeakMap;Zr=new WeakMap;zr=new WeakMap;we=new WeakMap;tn=new WeakMap;Qr=new WeakMap;Xr=new WeakMap;Jr=new WeakMap;gs=new WeakSet;Ou=function(t){let e=Q(this,we).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${Q(this,tn).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))"))};jr=new WeakSet;ms=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};en=new WeakSet;hs=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)};an=new WeakSet;_s=function(t){var e;It(this,rn,t.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};ps=new WeakSet;Nu=function(t){var e;t.pointerType!=="mouse"&&Le(this,an,_s).call(this,t),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};vs=new WeakSet;Pu=function(){var t;(t=d.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};fs=new WeakSet;Uu=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=Q(this,we).activeSegment)==null||e.style.removeProperty("transform")};Es=new WeakSet;Bu=function(t){this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),Le(this,gs,Ou).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!Q(this,rn))&&(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 $u=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},nn=(t,e,i)=>($u(t,e,"read from private field"),i?i.call(t):e.get(t)),up=(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)},on=(t,e,i,a)=>($u(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fe,Wu=h.createElement("template");Wu.innerHTML=`
574
+ `;var zt=class extends d.HTMLElement{constructor(){super(),oe(this,ys),oe(this,an),oe(this,rn),oe(this,on),oe(this,bs),oe(this,gs),oe(this,_s),oe(this,As),oe(this,Ke,void 0),oe(this,sn,void 0),oe(this,Xr,void 0),oe(this,Jr,void 0),oe(this,De,{}),oe(this,nn,[]),oe(this,jr,()=>{if(this.range.matches(":focus-visible")){let{style:e}=G(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),oe(this,en,()=>{let{style:e}=G(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),oe(this,tn,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Yu.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),Ct(this,Xr,this.shadowRoot.querySelector("#startpoint")),Ct(this,Jr,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",S.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER?(i&&((n=(r=Q(this,Ke))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ct(this,Ke,null)),a&&this.isConnected&&(Ct(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Q(this,Ke))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),xe(this,an,fs).call(this)):(this.range.setAttribute(e,a),xe(this,rn,Es).call(this)))}connectedCallback(){var e,i,a;let{style:r}=G(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),Q(this,De).pointer=G(this.shadowRoot,"#pointer"),Q(this,De).progress=G(this.shadowRoot,"#progress"),Q(this,De).thumb=G(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),Q(this,De).activeSegment=G(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(S.MEDIA_CONTROLLER);n&&(Ct(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=Q(this,Ke))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Q(this,jr)),this.shadowRoot.addEventListener("focusout",Q(this,en)),xe(this,an,fs).call(this),lt(this.container,Q(this,tn))}disconnectedCallback(){var e,i;xe(this,rn,Es).call(this),(i=(e=Q(this,Ke))==null?void 0:e.unassociateElement)==null||i.call(e,this),Ct(this,Ke,null),this.shadowRoot.removeEventListener("focusin",Q(this,jr)),this.shadowRoot.removeEventListener("focusout",Q(this,en)),dt(this.container,Q(this,tn))}updatePointerBar(e){var i;(i=Q(this,De).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=Q(this,De).progress)==null||e.style.setProperty("width",`${a}%`),(i=Q(this,De).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])];Ct(this,nn,[...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}%`,g=`calc(${((u?r:a[n+1])-s)*100}%${l||u?"":" - var(--segments-gap)"})`,v=h.createElementNS("http://www.w3.org/2000/svg","rect"),f=G(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);f.style.setProperty("x",c),f.style.setProperty("width",g),i.append(v)}}getPointerRatio(e){let i=Zd(e.clientX,e.clientY,Q(this,Xr).getBoundingClientRect(),Q(this,Jr).getBoundingClientRect());return Math.max(0,Math.min(1,i))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":xe(this,As,Vu).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":xe(this,bs,Wu).call(this,e);break;case"pointerdown":xe(this,on,ks).call(this,e);break;case"pointerup":xe(this,gs,Fu).call(this);break;case"pointerleave":xe(this,_s,Ku).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Ke=new WeakMap;sn=new WeakMap;Xr=new WeakMap;Jr=new WeakMap;De=new WeakMap;nn=new WeakMap;jr=new WeakMap;en=new WeakMap;tn=new WeakMap;ys=new WeakSet;$u=function(t){let e=Q(this,De).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${Q(this,nn).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))"))};an=new WeakSet;fs=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};rn=new WeakSet;Es=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)};on=new WeakSet;ks=function(t){var e;Ct(this,sn,t.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};bs=new WeakSet;Wu=function(t){var e;t.pointerType!=="mouse"&&xe(this,on,ks).call(this,t),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};gs=new WeakSet;Fu=function(){var t;(t=d.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};_s=new WeakSet;Ku=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=Q(this,De).activeSegment)==null||e.style.removeProperty("transform")};As=new WeakSet;Vu=function(t){this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),xe(this,ys,$u).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!Q(this,sn))&&(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 Gu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ln=(t,e,i)=>(Gu(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)},dn=(t,e,i,a)=>(Gu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ve,qu=h.createElement("template");qu.innerHTML=`
569
575
  <style>
570
576
  :host {
571
577
 
@@ -591,7 +597,7 @@
591
597
  </style>
592
598
 
593
599
  <slot></slot>
594
- `;var As=class extends d.HTMLElement{constructor(){super(),up(this,Fe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Wu.content.cloneNode(!0)))}static get observedAttributes(){return[S.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER&&(i&&((n=(r=nn(this,Fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),on(this,Fe,null)),a&&this.isConnected&&(on(this,Fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=nn(this,Fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(S.MEDIA_CONTROLLER);r&&(on(this,Fe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=nn(this,Fe))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=nn(this,Fe))==null?void 0:e.unassociateElement)==null||i.call(e,this),on(this,Fe,null)}};Fe=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",As);var Fu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},sn=(t,e,i)=>(Fu(t,e,"read from private field"),i?i.call(t):e.get(t)),cp=(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)=>(Fu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ke,Ku=h.createElement("template");Ku.innerHTML=`
600
+ `;var Ss=class extends d.HTMLElement{constructor(){super(),pp(this,Ve,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(qu.content.cloneNode(!0)))}static get observedAttributes(){return[S.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER&&(i&&((n=(r=ln(this,Ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),dn(this,Ve,null)),a&&this.isConnected&&(dn(this,Ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=ln(this,Ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(S.MEDIA_CONTROLLER);r&&(dn(this,Ve,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=ln(this,Ve))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=ln(this,Ve))==null?void 0:e.unassociateElement)==null||i.call(e,this),dn(this,Ve,null)}};Ve=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Ss);var Zu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},un=(t,e,i)=>(Zu(t,e,"read from private field"),i?i.call(t):e.get(t)),vp=(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)},cn=(t,e,i,a)=>(Zu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ye,zu=h.createElement("template");zu.innerHTML=`
595
601
  <style>
596
602
  :host {
597
603
  font: var(--media-font,
@@ -624,7 +630,7 @@
624
630
  }
625
631
  </style>
626
632
  <slot></slot>
627
- `;var xe=class extends d.HTMLElement{constructor(){super(),cp(this,Ke,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ku.content.cloneNode(!0)))}static get observedAttributes(){return[S.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER&&(i&&((n=(r=sn(this,Ke))==null?void 0:r.unassociateElement)==null||n.call(r,this),ln(this,Ke,null)),a&&this.isConnected&&(ln(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=sn(this,Ke))==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(S.MEDIA_CONTROLLER);n&&(ln(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=sn(this,Ke))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=sn(this,Ke))==null?void 0:e.unassociateElement)==null||i.call(e,this),ln(this,Ke,null)}};Ke=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",xe);var Yu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Vu=(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)},hp=(t,e,i,a)=>(Yu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ia,Ts=class extends xe{constructor(){super(),mp(this,Ia,void 0),hp(this,Ia,this.shadowRoot.querySelector("slot")),Vu(this,Ia).textContent=Pe(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===o.MEDIA_DURATION&&(Vu(this,Ia).textContent=Pe(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){D(this,o.MEDIA_DURATION,e)}};Ia=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Ts);var qu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},pp=(t,e,i)=>(qu(t,e,"read from private field"),i?i.call(t):e.get(t)),vp=(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)=>(qu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),dn;function Ep(t){return`
633
+ `;var Oe=class extends d.HTMLElement{constructor(){super(),vp(this,Ye,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(zu.content.cloneNode(!0)))}static get observedAttributes(){return[S.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER&&(i&&((n=(r=un(this,Ye))==null?void 0:r.unassociateElement)==null||n.call(r,this),cn(this,Ye,null)),a&&this.isConnected&&(cn(this,Ye,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=un(this,Ye))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let{style:r}=G(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(S.MEDIA_CONTROLLER);n&&(cn(this,Ye,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=un(this,Ye))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=un(this,Ye))==null?void 0:e.unassociateElement)==null||i.call(e,this),cn(this,Ye,null)}};Ye=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",Oe);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)),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)},Ep=(t,e,i,a)=>(Xu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ca,Is=class extends Oe{constructor(){super(),fp(this,Ca,void 0),Ep(this,Ca,this.shadowRoot.querySelector("slot")),Qu(this,Ca).textContent=Be(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===o.MEDIA_DURATION&&(Qu(this,Ca).textContent=Be(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){D(this,o.MEDIA_DURATION,e)}};Ca=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Is);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),mn;function Ap(t){return`
628
634
  <style>
629
635
  :host {
630
636
  background: rgb(20 20 30 / .8);
@@ -641,13 +647,13 @@
641
647
  }
642
648
  </style>
643
649
  <slot name="error-${t.mediaerrorcode}" id="content">
644
- ${Zu({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
650
+ ${ec({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
645
651
  </slot>
646
- `}function bp(t){return t.code&&Do(t)!==null}function Zu(t){var e;let{title:i,message:a}=(e=Do(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 Gu=[o.MEDIA_ERROR_CODE,o.MEDIA_ERROR_MESSAGE],Ci=class extends qt{constructor(){super(...arguments),vp(this,dn,null)}static get observedAttributes(){return[...super.observedAttributes,...Gu]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!Gu.includes(e))return;let n=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=bp(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return pp(this,dn)}set mediaError(e){fp(this,dn,e)}get mediaErrorCode(){return M(this,"mediaerrorcode")}set mediaErrorCode(e){D(this,"mediaerrorcode",e)}get mediaErrorMessage(){return R(this,"mediaerrormessage")}set mediaErrorMessage(e){I(this,"mediaerrormessage",e)}};dn=new WeakMap;Ci.getSlotTemplateHTML=Ep;Ci.formatErrorMessage=Zu;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",Ci);var un=Ci;var gp=`<svg aria-hidden="true" viewBox="0 0 26 24">
652
+ `}function Tp(t){return t.code&&Po(t)!==null}function ec(t){var e;let{title:i,message:a}=(e=Po(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 Zt{constructor(){super(...arguments),gp(this,mn,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=Tp(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return bp(this,mn)}set mediaError(e){_p(this,mn,e)}get mediaErrorCode(){return M(this,"mediaerrorcode")}set mediaErrorCode(e){D(this,"mediaerrorcode",e)}get mediaErrorMessage(){return R(this,"mediaerrormessage")}set mediaErrorMessage(e){I(this,"mediaerrormessage",e)}};mn=new WeakMap;Mi.getSlotTemplateHTML=Ap;Mi.formatErrorMessage=ec;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",Mi);var hn=Mi;var yp=`<svg aria-hidden="true" viewBox="0 0 26 24">
647
653
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
648
- </svg>`,_p=`<svg aria-hidden="true" viewBox="0 0 26 24">
654
+ </svg>`,kp=`<svg aria-hidden="true" viewBox="0 0 26 24">
649
655
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
650
- </svg>`,Qu=h.createElement("template");Qu.innerHTML=`
656
+ </svg>`,ic=h.createElement("template");ic.innerHTML=`
651
657
  <style>
652
658
  :host([${o.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
653
659
  display: none !important;
@@ -665,13 +671,13 @@
665
671
  </style>
666
672
 
667
673
  <slot name="icon">
668
- <slot name="enter">${gp}</slot>
669
- <slot name="exit">${_p}</slot>
674
+ <slot name="enter">${yp}</slot>
675
+ <slot name="exit">${kp}</slot>
670
676
  </slot>
671
- `;var Ap=`
677
+ `;var Sp=`
672
678
  <slot name="tooltip-enter">${C.ENTER_FULLSCREEN}</slot>
673
679
  <slot name="tooltip-exit">${C.EXIT_FULLSCREEN}</slot>
674
- `,zu=t=>{let e=t.mediaIsFullscreen?G.EXIT_FULLSCREEN():G.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)},ys=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Qu,tooltipContent:Ap,...e})}connectedCallback(){super.connectedCallback(),zu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_FULLSCREEN&&zu(this)}get mediaFullscreenUnavailable(){return R(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){I(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return H(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){U(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",ys);var{MEDIA_TIME_IS_LIVE:cn,MEDIA_PAUSED:Ca}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Tp,MEDIA_PLAY_REQUEST:yp}=p,kp='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',Ju=h.createElement("template");Ju.innerHTML=`
680
+ `,tc=t=>{let e=t.mediaIsFullscreen?Y.EXIT_FULLSCREEN():Y.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)},Cs=class extends F{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 R(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){I(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return H(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){U(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:pn,MEDIA_PAUSED:Ma}=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=`
675
681
  <style>
676
682
  :host { --media-tooltip-display: none; }
677
683
 
@@ -683,22 +689,22 @@
683
689
  color: var(--media-live-button-icon-color, rgb(140, 140, 140));
684
690
  }
685
691
 
686
- :host([${cn}]:not([${Ca}])) slot[name=indicator] > *,
687
- :host([${cn}]:not([${Ca}])) ::slotted([slot=indicator]) {
692
+ :host([${pn}]:not([${Ma}])) slot[name=indicator] > *,
693
+ :host([${pn}]:not([${Ma}])) ::slotted([slot=indicator]) {
688
694
  fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
689
695
  color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
690
696
  }
691
697
 
692
- :host([${cn}]:not([${Ca}])) {
698
+ :host([${pn}]:not([${Ma}])) {
693
699
  cursor: not-allowed;
694
700
  }
695
701
 
696
702
  </style>
697
703
 
698
- <slot name="indicator">${kp}</slot>
704
+ <slot name="indicator">${Mp}</slot>
699
705
 
700
706
  <slot name="spacer">&nbsp;</slot><slot name="text">LIVE</slot>
701
- `;var Xu=t=>{let e=t.mediaPaused||!t.mediaTimeIsLive,i=e?G.SEEK_LIVE():G.PLAYING_LIVE();t.setAttribute("aria-label",i),e?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},ks=class extends K{static get observedAttributes(){return[...super.observedAttributes,Ca,cn]}constructor(e={}){super({slotTemplate:Ju,...e})}connectedCallback(){Xu(this),super.connectedCallback()}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),Xu(this)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return H(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){U(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Tp,{composed:!0,bubbles:!0})),this.hasAttribute(Ca)&&this.dispatchEvent(new d.CustomEvent(yp,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",ks);var tc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ma=(t,e,i)=>(tc(t,e,"read from private field"),i?i.call(t):e.get(t)),ju=(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)},Ra=(t,e,i,a)=>(tc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ve,mn,ec={LOADING_DELAY:"loadingdelay"},ic=500,ac=h.createElement("template"),Sp=`
707
+ `;var ac=t=>{let e=t.mediaPaused||!t.mediaTimeIsLive,i=e?Y.SEEK_LIVE():Y.PLAYING_LIVE();t.setAttribute("aria-label",i),e?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},Ms=class extends F{static get observedAttributes(){return[...super.observedAttributes,Ma,pn]}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 H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return H(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){U(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Ip,{composed:!0,bubbles:!0})),this.hasAttribute(Ma)&&this.dispatchEvent(new d.CustomEvent(Cp,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Ms);var sc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ra=(t,e,i)=>(sc(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)},wa=(t,e,i,a)=>(sc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ge,vn,oc={LOADING_DELAY:"loadingdelay"},lc=500,dc=h.createElement("template"),Rp=`
702
708
  <svg aria-hidden="true" viewBox="0 0 100 100">
703
709
  <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">
704
710
  <animateTransform
@@ -711,13 +717,13 @@
711
717
  repeatCount="indefinite" />
712
718
  </path>
713
719
  </svg>
714
- `;ac.innerHTML=`
720
+ `;dc.innerHTML=`
715
721
  <style>
716
722
  :host {
717
723
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
718
724
  vertical-align: middle;
719
725
  box-sizing: border-box;
720
- --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${ic}ms);
726
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${lc}ms);
721
727
  }
722
728
 
723
729
  #status {
@@ -756,52 +762,52 @@ svg, img, ::slotted(svg), ::slotted(img) {
756
762
  }
757
763
  </style>
758
764
 
759
- <slot name="icon">${Sp}</slot>
760
- <div id="status" role="status" aria-live="polite">${Y.MEDIA_LOADING()}</div>
761
- `;var Ss=class extends d.HTMLElement{constructor(){if(super(),ju(this,Ve,void 0),ju(this,mn,ic),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),i=ac.content.cloneNode(!0);e.appendChild(i)}}static get observedAttributes(){return[S.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,ec.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===ec.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===S.MEDIA_CONTROLLER&&(i&&((n=(r=Ma(this,Ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ra(this,Ve,null)),a&&this.isConnected&&(Ra(this,Ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ma(this,Ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(S.MEDIA_CONTROLLER);r&&(Ra(this,Ve,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Ma(this,Ve))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Ma(this,Ve))==null?void 0:e.unassociateElement)==null||i.call(e,this),Ra(this,Ve,null)}get loadingDelay(){return Ma(this,mn)}set loadingDelay(e){Ra(this,mn,e);let{style:i}=W(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,o.MEDIA_LOADING)}set mediaLoading(e){U(this,o.MEDIA_LOADING,e)}};Ve=new WeakMap;mn=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",Ss);var{MEDIA_VOLUME_LEVEL:zt}=o,Ip=`<svg aria-hidden="true" viewBox="0 0 24 24">
765
+ <slot name="icon">${Rp}</slot>
766
+ <div id="status" role="status" aria-live="polite">${V.MEDIA_LOADING()}</div>
767
+ `;var Rs=class extends d.HTMLElement{constructor(){if(super(),nc(this,Ge,void 0),nc(this,vn,lc),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),i=dc.content.cloneNode(!0);e.appendChild(i)}}static get observedAttributes(){return[S.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,oc.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===oc.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===S.MEDIA_CONTROLLER&&(i&&((n=(r=Ra(this,Ge))==null?void 0:r.unassociateElement)==null||n.call(r,this),wa(this,Ge,null)),a&&this.isConnected&&(wa(this,Ge,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ra(this,Ge))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(S.MEDIA_CONTROLLER);r&&(wa(this,Ge,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Ra(this,Ge))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Ra(this,Ge))==null?void 0:e.unassociateElement)==null||i.call(e,this),wa(this,Ge,null)}get loadingDelay(){return Ra(this,vn)}set loadingDelay(e){wa(this,vn,e);let{style:i}=G(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,o.MEDIA_LOADING)}set mediaLoading(e){U(this,o.MEDIA_LOADING,e)}};Ge=new WeakMap;vn=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",Rs);var{MEDIA_VOLUME_LEVEL:Qt}=o,wp=`<svg aria-hidden="true" viewBox="0 0 24 24">
762
768
  <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"/>
763
- </svg>`,rc=`<svg aria-hidden="true" viewBox="0 0 24 24">
769
+ </svg>`,uc=`<svg aria-hidden="true" viewBox="0 0 24 24">
764
770
  <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"/>
765
- </svg>`,Cp=`<svg aria-hidden="true" viewBox="0 0 24 24">
771
+ </svg>`,Lp=`<svg aria-hidden="true" viewBox="0 0 24 24">
766
772
  <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"/>
767
- </svg>`,oc=h.createElement("template");oc.innerHTML=`
773
+ </svg>`,mc=h.createElement("template");mc.innerHTML=`
768
774
  <style>
769
775
 
770
- :host(:not([${zt}])) slot[name=icon] slot:not([name=high]),
771
- :host([${zt}=high]) slot[name=icon] slot:not([name=high]) {
776
+ :host(:not([${Qt}])) slot[name=icon] slot:not([name=high]),
777
+ :host([${Qt}=high]) slot[name=icon] slot:not([name=high]) {
772
778
  display: none !important;
773
779
  }
774
780
 
775
- :host([${zt}=off]) slot[name=icon] slot:not([name=off]) {
781
+ :host([${Qt}=off]) slot[name=icon] slot:not([name=off]) {
776
782
  display: none !important;
777
783
  }
778
784
 
779
- :host([${zt}=low]) slot[name=icon] slot:not([name=low]) {
785
+ :host([${Qt}=low]) slot[name=icon] slot:not([name=low]) {
780
786
  display: none !important;
781
787
  }
782
788
 
783
- :host([${zt}=medium]) slot[name=icon] slot:not([name=medium]) {
789
+ :host([${Qt}=medium]) slot[name=icon] slot:not([name=medium]) {
784
790
  display: none !important;
785
791
  }
786
792
 
787
- :host(:not([${zt}=off])) slot[name=tooltip-unmute],
788
- :host([${zt}=off]) slot[name=tooltip-mute] {
793
+ :host(:not([${Qt}=off])) slot[name=tooltip-unmute],
794
+ :host([${Qt}=off]) slot[name=tooltip-mute] {
789
795
  display: none;
790
796
  }
791
797
  </style>
792
798
 
793
799
  <slot name="icon">
794
- <slot name="off">${Ip}</slot>
795
- <slot name="low">${rc}</slot>
796
- <slot name="medium">${rc}</slot>
797
- <slot name="high">${Cp}</slot>
800
+ <slot name="off">${wp}</slot>
801
+ <slot name="low">${uc}</slot>
802
+ <slot name="medium">${uc}</slot>
803
+ <slot name="high">${Lp}</slot>
798
804
  </slot>
799
- `;var Mp=`
805
+ `;var xp=`
800
806
  <slot name="tooltip-mute">${C.MUTE}</slot>
801
807
  <slot name="tooltip-unmute">${C.UNMUTE}</slot>
802
- `,nc=t=>{let i=t.mediaVolumeLevel==="off"?G.UNMUTE():G.MUTE();t.setAttribute("aria-label",i)},Is=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:oc,tooltipContent:Mp,...e})}connectedCallback(){nc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_VOLUME_LEVEL&&nc(this),super.attributeChangedCallback(e,i,a)}get mediaVolumeLevel(){return R(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){I(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",Is);var sc=`<svg aria-hidden="true" viewBox="0 0 28 24">
808
+ `,cc=t=>{let i=t.mediaVolumeLevel==="off"?Y.UNMUTE():Y.MUTE();t.setAttribute("aria-label",i)},ws=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:mc,tooltipContent:xp,...e})}connectedCallback(){cc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_VOLUME_LEVEL&&cc(this),super.attributeChangedCallback(e,i,a)}get mediaVolumeLevel(){return R(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){I(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",ws);var hc=`<svg aria-hidden="true" viewBox="0 0 28 24">
803
809
  <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"/>
804
- </svg>`,dc=h.createElement("template");dc.innerHTML=`
810
+ </svg>`,vc=h.createElement("template");vc.innerHTML=`
805
811
  <style>
806
812
  :host([${o.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
807
813
  display: none !important;
@@ -819,13 +825,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
819
825
  </style>
820
826
 
821
827
  <slot name="icon">
822
- <slot name="enter">${sc}</slot>
823
- <slot name="exit">${sc}</slot>
828
+ <slot name="enter">${hc}</slot>
829
+ <slot name="exit">${hc}</slot>
824
830
  </slot>
825
- `;var Rp=`
831
+ `;var Dp=`
826
832
  <slot name="tooltip-enter">${C.ENTER_PIP}</slot>
827
833
  <slot name="tooltip-exit">${C.EXIT_PIP}</slot>
828
- `,lc=t=>{let e=t.mediaIsPip?G.EXIT_PIP():G.ENTER_PIP();t.setAttribute("aria-label",e)},Cs=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:dc,tooltipContent:Rp,...e})}connectedCallback(){lc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_IS_PIP&&lc(this),super.attributeChangedCallback(e,i,a)}get mediaPipUnavailable(){return R(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){I(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return H(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){U(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",Cs);var Lp=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},hn=(t,e,i)=>(Lp(t,e,"read from private field"),i?i.call(t):e.get(t)),wp=(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)},Mi,Ms={RATES:"rates"},Ls=[1,1.2,1.5,1.7,2],Ri=1,uc=h.createElement("template");uc.innerHTML=`
834
+ `,pc=t=>{let e=t.mediaIsPip?Y.EXIT_PIP():Y.ENTER_PIP();t.setAttribute("aria-label",e)},Ls=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:vc,tooltipContent:Dp,...e})}connectedCallback(){pc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_IS_PIP&&pc(this),super.attributeChangedCallback(e,i,a)}get mediaPipUnavailable(){return R(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){I(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return H(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){U(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)},fn=(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)},Ri,xs={RATES:"rates"},Os=[1,1.2,1.5,1.7,2],wi=1,fc=h.createElement("template");fc.innerHTML=`
829
835
  <style>
830
836
  :host {
831
837
  min-width: 5ch;
@@ -833,11 +839,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
833
839
  }
834
840
  </style>
835
841
  <slot name="icon"></slot>
836
- `;var Rs=class extends K{constructor(e={}){super({slotTemplate:uc,tooltipContent:C.PLAYBACK_RATE,...e}),wp(this,Mi,new Be(this,Ms.RATES,{defaultValue:Ls})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Ri}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Ms.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===Ms.RATES&&(hn(this,Mi).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",Y.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return hn(this,Mi)}set rates(e){e?Array.isArray(e)&&(hn(this,Mi).value=e.join(" ")):hn(this,Mi).value=""}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,Ri)}set mediaPlaybackRate(e){D(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)}};Mi=new WeakMap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Rs);var xp=`<svg aria-hidden="true" viewBox="0 0 24 24">
842
+ `;var Ds=class extends F{constructor(e={}){super({slotTemplate:fc,tooltipContent:C.PLAYBACK_RATE,...e}),Np(this,Ri,new $e(this,xs.RATES,{defaultValue:Os})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${wi}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&&(fn(this,Ri).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?wi:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",V.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return fn(this,Ri)}set rates(e){e?Array.isArray(e)&&(fn(this,Ri).value=e.join(" ")):fn(this,Ri).value=""}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,wi)}set mediaPlaybackRate(e){D(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:wi,n=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};Ri=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">
837
843
  <path d="m6 21 15-9L6 3v18Z"/>
838
- </svg>`,Dp=`<svg aria-hidden="true" viewBox="0 0 24 24">
844
+ </svg>`,Up=`<svg aria-hidden="true" viewBox="0 0 24 24">
839
845
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
840
- </svg>`,mc=h.createElement("template");mc.innerHTML=`
846
+ </svg>`,bc=h.createElement("template");bc.innerHTML=`
841
847
  <style>
842
848
  :host([${o.MEDIA_PAUSED}]) slot[name=pause],
843
849
  :host(:not([${o.MEDIA_PAUSED}])) slot[name=play] {
@@ -851,13 +857,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
851
857
  </style>
852
858
 
853
859
  <slot name="icon">
854
- <slot name="play">${xp}</slot>
855
- <slot name="pause">${Dp}</slot>
860
+ <slot name="play">${Pp}</slot>
861
+ <slot name="pause">${Up}</slot>
856
862
  </slot>
857
- `;var Op=`
863
+ `;var Bp=`
858
864
  <slot name="tooltip-play">${C.PLAY}</slot>
859
865
  <slot name="tooltip-pause">${C.PAUSE}</slot>
860
- `,cc=t=>{let e=t.mediaPaused?G.PLAY():G.PAUSE();t.setAttribute("aria-label",e)},ws=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:mc,tooltipContent:Op,...e})}connectedCallback(){cc(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_PAUSED&&cc(this),super.attributeChangedCallback(e,i,a)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(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",ws);var Ye={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},hc=h.createElement("template");hc.innerHTML=`
866
+ `,Ec=t=>{let e=t.mediaPaused?Y.PLAY():Y.PAUSE();t.setAttribute("aria-label",e)},Ns=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:bc,tooltipContent:Bp,...e})}connectedCallback(){Ec(this),super.connectedCallback()}attributeChangedCallback(e,i,a){e===o.MEDIA_PAUSED&&Ec(this),super.attributeChangedCallback(e,i,a)}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(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 qe={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},gc=h.createElement("template");gc.innerHTML=`
861
867
  <style>
862
868
  :host {
863
869
  pointer-events: none;
@@ -879,7 +885,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
879
885
  </style>
880
886
 
881
887
  <img part="poster img" aria-hidden="true" id="image"/>
882
- `;var Np=t=>{t.style.removeProperty("background-image")},Pp=(t,e)=>{t.style["background-image"]=`url('${e}')`},xs=class extends d.HTMLElement{static get observedAttributes(){return[Ye.PLACEHOLDER_SRC,Ye.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(hc.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,i,a){e===Ye.SRC&&(a==null?this.image.removeAttribute(Ye.SRC):this.image.setAttribute(Ye.SRC,a)),e===Ye.PLACEHOLDER_SRC&&(a==null?Np(this.image):Pp(this.image,a))}get placeholderSrc(){return R(this,Ye.PLACEHOLDER_SRC)}set placeholderSrc(e){I(this,Ye.SRC,e)}get src(){return R(this,Ye.SRC)}set src(e){I(this,Ye.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",xs);var pc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Up=(t,e,i)=>(pc(t,e,"read from private field"),i?i.call(t):e.get(t)),Bp=(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)},Hp=(t,e,i,a)=>(pc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),pn,Ds=class extends xe{constructor(){super(),Bp(this,pn,void 0),Hp(this,pn,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&&(Up(this,pn).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return R(this,o.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){I(this,o.MEDIA_PREVIEW_CHAPTER,e)}};pn=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",Ds);var vc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},vn=(t,e,i)=>(vc(t,e,"read from private field"),i?i.call(t):e.get(t)),$p=(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)},fn=(t,e,i,a)=>(vc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ge,fc=h.createElement("template");fc.innerHTML=`
888
+ `;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[qe.PLACEHOLDER_SRC,qe.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(gc.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,i,a){e===qe.SRC&&(a==null?this.image.removeAttribute(qe.SRC):this.image.setAttribute(qe.SRC,a)),e===qe.PLACEHOLDER_SRC&&(a==null?Hp(this.image):$p(this.image,a))}get placeholderSrc(){return R(this,qe.PLACEHOLDER_SRC)}set placeholderSrc(e){I(this,qe.SRC,e)}get src(){return R(this,qe.SRC)}set src(e){I(this,qe.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Ps);var _c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Wp=(t,e,i)=>(_c(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)},Kp=(t,e,i,a)=>(_c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),En,Us=class extends Oe{constructor(){super(),Fp(this,En,void 0),Kp(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 R(this,o.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){I(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 Ac=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bn=(t,e,i)=>(Ac(t,e,"read from private field"),i?i.call(t):e.get(t)),Vp=(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)=>(Ac(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ze,Tc=h.createElement("template");Tc.innerHTML=`
883
889
  <style>
884
890
  :host {
885
891
  box-sizing: border-box;
@@ -893,11 +899,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
893
899
  }
894
900
  </style>
895
901
  <img crossorigin loading="eager" decoding="async">
896
- `;var Os=class extends d.HTMLElement{constructor(){super(),$p(this,Ge,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(fc.content.cloneNode(!0)))}static get observedAttributes(){return[S.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(S.MEDIA_CONTROLLER);r&&(fn(this,Ge,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=vn(this,Ge))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=vn(this,Ge))==null?void 0:e.unassociateElement)==null||i.call(e,this),fn(this,Ge,null)}attributeChangedCallback(e,i,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===S.MEDIA_CONTROLLER&&(i&&((n=(r=vn(this,Ge))==null?void 0:r.unassociateElement)==null||n.call(r,this),fn(this,Ge,null)),a&&this.isConnected&&(fn(this,Ge,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=vn(this,Ge))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return R(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){I(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:b,minWidth:g,minHeight:v}=u,f=Math.min(parseInt(c)/n,parseInt(b)/s),w=Math.max(parseInt(g)/n,parseInt(v)/s),A=f<1,T=A?f:w>1?w:1,{style:N}=W(this.shadowRoot,":host"),ee=W(this.shadowRoot,"img").style,ge=this.shadowRoot.querySelector("img"),Et=A?"min":"max";N.setProperty(`${Et}-width`,"initial","important"),N.setProperty(`${Et}-height`,"initial","important"),N.width=`${n*T}px`,N.height=`${s*T}px`;let at=()=>{ee.width=`${this.imgWidth*T}px`,ee.height=`${this.imgHeight*T}px`,ee.display="block"};ge.src!==l&&(ge.onload=()=>{this.imgWidth=ge.naturalWidth,this.imgHeight=ge.naturalHeight,at()},ge.src=l,at()),at(),ee.transform=`translate(-${a*T}px, -${r*T}px)`}};Ge=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Os);var bc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ec=(t,e,i)=>(bc(t,e,"read from private field"),i?i.call(t):e.get(t)),Wp=(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)=>(bc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),La,Ns=class extends xe{constructor(){super(),Wp(this,La,void 0),Fp(this,La,this.shadowRoot.querySelector("slot")),Ec(this,La).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&&(Ec(this,La).textContent=Pe(parseFloat(a)))}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){D(this,o.MEDIA_PREVIEW_TIME,e)}};La=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Ns);var Li={SEEK_OFFSET:"seekoffset"},En=30,Kp=`<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)">${En}</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>`,gc=h.createElement("template");gc.innerHTML=`
897
- <slot name="icon">${Kp}</slot>
898
- `;var Vp=0,Ps=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Li.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:gc,tooltipContent:C.SEEK_BACKWARD,...e})}connectedCallback(){this.seekOffset=M(this,Li.SEEK_OFFSET,En),super.connectedCallback()}attributeChangedCallback(e,i,a){e===Li.SEEK_OFFSET&&(this.seekOffset=M(this,Li.SEEK_OFFSET,En)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return M(this,Li.SEEK_OFFSET,En)}set seekOffset(e){D(this,Li.SEEK_OFFSET,e),this.setAttribute("aria-label",G.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),kr(Sr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,Vp)}set mediaCurrentTime(e){D(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",Ps);var wi={SEEK_OFFSET:"seekoffset"},bn=30,Yp=`<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)">${bn}</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>`,_c=h.createElement("template");_c.innerHTML=`
899
- <slot name="icon">${Yp}</slot>
900
- `;var Gp=0,Us=class extends K{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,wi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:_c,tooltipContent:C.SEEK_FORWARD,...e})}connectedCallback(){this.seekOffset=M(this,wi.SEEK_OFFSET,bn),super.connectedCallback()}attributeChangedCallback(e,i,a){e===wi.SEEK_OFFSET&&(this.seekOffset=M(this,wi.SEEK_OFFSET,bn)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return M(this,wi.SEEK_OFFSET,bn)}set seekOffset(e){D(this,wi.SEEK_OFFSET,e),this.setAttribute("aria-label",G.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),kr(Sr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,Gp)}set mediaCurrentTime(e){D(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",Us);var kc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Bs=(t,e,i)=>(kc(t,e,"read from private field"),i?i.call(t):e.get(t)),qp=(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)},Zp=(t,e,i,a)=>(kc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),xi,De={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Ac=[...Object.values(De),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],Tc=["Enter"," "],zp="&nbsp;/&nbsp;",yc=(t,{timesSep:e=zp}={})=>{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},Qp="video not loaded, unknown time.",Xp=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",Qp);return}let n=t.hasAttribute(De.REMAINING),s=t.hasAttribute(De.SHOW_DURATION),l=n?Pt(0-(r-i)):Pt(i);if(!s){t.setAttribute("aria-valuetext",l);return}let u=Pt(r),c=`${l} of ${u}`;t.setAttribute("aria-valuetext",c)},Hs=class extends xe{constructor(){super(),qp(this,xi,void 0),Zp(this,xi,this.shadowRoot.querySelector("slot")),Bs(this,xi).innerHTML=`${yc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Ac,"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",Y.PLAYBACK_TIME());let i=a=>{let{key:r}=a;if(!Tc.includes(r)){this.removeEventListener("keyup",i);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Tc.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){Ac.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 H(this,De.REMAINING)}set remaining(e){U(this,De.REMAINING,e)}get showDuration(){return H(this,De.SHOW_DURATION)}set showDuration(e){U(this,De.SHOW_DURATION,e)}get noToggle(){return H(this,De.NO_TOGGLE)}set noToggle(e){U(this,De.NO_TOGGLE,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){D(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){D(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=yc(this);Xp(this),e!==Bs(this,xi).innerHTML&&(Bs(this,xi).innerHTML=e)}};xi=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",Hs);var Sc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},re=(t,e,i)=>(Sc(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)},ke=(t,e,i,a)=>(Sc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Jp=(t,e,i,a)=>({set _(r){ke(t,e,r,i)},get _(){return re(t,e,a)}}),Di,gn,Oi,wa,_n,An,Tn,Ni,Qt,yn,kn=class{constructor(e,i,a){qe(this,Di,void 0),qe(this,gn,void 0),qe(this,Oi,void 0),qe(this,wa,void 0),qe(this,_n,void 0),qe(this,An,void 0),qe(this,Tn,void 0),qe(this,Ni,void 0),qe(this,Qt,0),qe(this,yn,(r=performance.now())=>{ke(this,Qt,requestAnimationFrame(re(this,yn))),ke(this,wa,performance.now()-re(this,Oi));let n=1e3/this.fps;if(re(this,wa)>n){ke(this,Oi,r-re(this,wa)%n);let s=1e3/((r-re(this,gn))/++Jp(this,_n)._),l=(r-re(this,An))/1e3/this.duration,u=re(this,Tn)+l*this.playbackRate;u-re(this,Di).valueAsNumber>0?ke(this,Ni,this.playbackRate/this.duration/s):(ke(this,Ni,.995*re(this,Ni)),u=re(this,Di).valueAsNumber+re(this,Ni)),this.callback(u)}}),ke(this,Di,e),this.callback=i,this.fps=a}start(){re(this,Qt)===0&&(ke(this,Oi,performance.now()),ke(this,gn,re(this,Oi)),ke(this,_n,0),re(this,yn).call(this))}stop(){re(this,Qt)!==0&&(cancelAnimationFrame(re(this,Qt)),ke(this,Qt,0))}update({start:e,duration:i,playbackRate:a}){let r=e-re(this,Di).valueAsNumber,n=Math.abs(i-this.duration);(r>0||r<-.03||n>=.5)&&this.callback(e),ke(this,Tn,e),ke(this,An,performance.now()),this.duration=i,this.playbackRate=a}};Di=new WeakMap;gn=new WeakMap;Oi=new WeakMap;wa=new WeakMap;_n=new WeakMap;An=new WeakMap;Tn=new WeakMap;Ni=new WeakMap;Qt=new WeakMap;yn=new WeakMap;var Vs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},te=(t,e,i)=>(Vs(t,e,"read from private field"),i?i.call(t):e.get(t)),ne=(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)=>(Vs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),le=(t,e,i)=>(Vs(t,e,"access private method"),i),Pi,Xt,Cn,Da,Mn,In,Oa,Na,Ui,Bi,xa,Ys,Ic,$s,Rn,Gs,Ln,qs,wn,Zs,Ws,Cc,Pa,xn,Fs,Mc,jp="video not loaded, unknown time.",ev=t=>{let e=t.range,i=Pt(+Lc(t)),a=Pt(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:jp;e.setAttribute("aria-valuetext",r)},Rc=h.createElement("template");Rc.innerHTML=`
902
+ `;var Bs=class extends d.HTMLElement{constructor(){super(),Vp(this,Ze,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Tc.content.cloneNode(!0)))}static get observedAttributes(){return[S.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(S.MEDIA_CONTROLLER);r&&(gn(this,Ze,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=bn(this,Ze))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=bn(this,Ze))==null?void 0:e.unassociateElement)==null||i.call(e,this),gn(this,Ze,null)}attributeChangedCallback(e,i,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===S.MEDIA_CONTROLLER&&(i&&((n=(r=bn(this,Ze))==null?void 0:r.unassociateElement)==null||n.call(r,this),gn(this,Ze,null)),a&&this.isConnected&&(gn(this,Ze,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=bn(this,Ze))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return R(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){I(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:_,minWidth:g,minHeight:v}=u,f=Math.min(parseInt(c)/n,parseInt(_)/s),L=Math.max(parseInt(g)/n,parseInt(v)/s),A=f<1,T=A?f:L>1?L:1,{style:N}=G(this.shadowRoot,":host"),ee=G(this.shadowRoot,"img").style,ge=this.shadowRoot.querySelector("img"),gt=A?"min":"max";N.setProperty(`${gt}-width`,"initial","important"),N.setProperty(`${gt}-height`,"initial","important"),N.width=`${n*T}px`,N.height=`${s*T}px`;let nt=()=>{ee.width=`${this.imgWidth*T}px`,ee.height=`${this.imgHeight*T}px`,ee.display="block"};ge.src!==l&&(ge.onload=()=>{this.imgWidth=ge.naturalWidth,this.imgHeight=ge.naturalHeight,nt()},ge.src=l,nt()),nt(),ee.transform=`translate(-${a*T}px, -${r*T}px)`}};Ze=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Bs);var kc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},yc=(t,e,i)=>(kc(t,e,"read from private field"),i?i.call(t):e.get(t)),Yp=(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)},Gp=(t,e,i,a)=>(kc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),La,Hs=class extends Oe{constructor(){super(),Yp(this,La,void 0),Gp(this,La,this.shadowRoot.querySelector("slot")),yc(this,La).textContent=Be(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,La).textContent=Be(parseFloat(a)))}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){D(this,o.MEDIA_PREVIEW_TIME,e)}};La=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>`,Sc=h.createElement("template");Sc.innerHTML=`
903
+ <slot name="icon">${qp}</slot>
904
+ `;var Zp=0,$s=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Li.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Sc,tooltipContent:C.SEEK_BACKWARD,...e})}connectedCallback(){this.seekOffset=M(this,Li.SEEK_OFFSET,_n),super.connectedCallback()}attributeChangedCallback(e,i,a){e===Li.SEEK_OFFSET&&(this.seekOffset=M(this,Li.SEEK_OFFSET,_n)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return M(this,Li.SEEK_OFFSET,_n)}set seekOffset(e){D(this,Li.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Sr(Ir(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,Zp)}set mediaCurrentTime(e){D(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>`,Ic=h.createElement("template");Ic.innerHTML=`
905
+ <slot name="icon">${zp}</slot>
906
+ `;var Qp=0,Ws=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,xi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Ic,tooltipContent:C.SEEK_FORWARD,...e})}connectedCallback(){this.seekOffset=M(this,xi.SEEK_OFFSET,An),super.connectedCallback()}attributeChangedCallback(e,i,a){e===xi.SEEK_OFFSET&&(this.seekOffset=M(this,xi.SEEK_OFFSET,An)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return M(this,xi.SEEK_OFFSET,An)}set seekOffset(e){D(this,xi.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Sr(Ir(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,Qp)}set mediaCurrentTime(e){D(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,Ne={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Cc=[...Object.values(Ne),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],Mc=["Enter"," "],jp="&nbsp;/&nbsp;",Rc=(t,{timesSep:e=jp}={})=>{var i,a;let r=t.hasAttribute(Ne.REMAINING),n=t.hasAttribute(Ne.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?Be(0-(u-s)):Be(s);return n?`${c}${e}${Be(u)}`:c},ev="video not loaded, unknown time.",tv=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",ev);return}let n=t.hasAttribute(Ne.REMAINING),s=t.hasAttribute(Ne.SHOW_DURATION),l=n?Ut(0-(r-i)):Ut(i);if(!s){t.setAttribute("aria-valuetext",l);return}let u=Ut(r),c=`${l} of ${u}`;t.setAttribute("aria-valuetext",c)},Ks=class extends Oe{constructor(){super(),Xp(this,Di,void 0),Jp(this,Di,this.shadowRoot.querySelector("slot")),Fs(this,Di).innerHTML=`${Rc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Cc,"disabled"]}connectedCallback(){let{style:e}=G(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",V.PLAYBACK_TIME());let i=a=>{let{key:r}=a;if(!Mc.includes(r)){this.removeEventListener("keyup",i);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!Mc.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){Cc.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 H(this,Ne.REMAINING)}set remaining(e){U(this,Ne.REMAINING,e)}get showDuration(){return H(this,Ne.SHOW_DURATION)}set showDuration(e){U(this,Ne.SHOW_DURATION,e)}get noToggle(){return H(this,Ne.NO_TOGGLE)}set noToggle(e){U(this,Ne.NO_TOGGLE,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){D(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){D(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=Rc(this);tv(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",Ks);var Lc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},re=(t,e,i)=>(Lc(t,e,"read from private field"),i?i.call(t):e.get(t)),ze=(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)},Ie=(t,e,i,a)=>(Lc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),iv=(t,e,i,a)=>({set _(r){Ie(t,e,r,i)},get _(){return re(t,e,a)}}),Oi,Tn,Ni,xa,yn,kn,Sn,Pi,Xt,In,Cn=class{constructor(e,i,a){ze(this,Oi,void 0),ze(this,Tn,void 0),ze(this,Ni,void 0),ze(this,xa,void 0),ze(this,yn,void 0),ze(this,kn,void 0),ze(this,Sn,void 0),ze(this,Pi,void 0),ze(this,Xt,0),ze(this,In,(r=performance.now())=>{Ie(this,Xt,requestAnimationFrame(re(this,In))),Ie(this,xa,performance.now()-re(this,Ni));let n=1e3/this.fps;if(re(this,xa)>n){Ie(this,Ni,r-re(this,xa)%n);let s=1e3/((r-re(this,Tn))/++iv(this,yn)._),l=(r-re(this,kn))/1e3/this.duration,u=re(this,Sn)+l*this.playbackRate;u-re(this,Oi).valueAsNumber>0?Ie(this,Pi,this.playbackRate/this.duration/s):(Ie(this,Pi,.995*re(this,Pi)),u=re(this,Oi).valueAsNumber+re(this,Pi)),this.callback(u)}}),Ie(this,Oi,e),this.callback=i,this.fps=a}start(){re(this,Xt)===0&&(Ie(this,Ni,performance.now()),Ie(this,Tn,re(this,Ni)),Ie(this,yn,0),re(this,In).call(this))}stop(){re(this,Xt)!==0&&(cancelAnimationFrame(re(this,Xt)),Ie(this,Xt,0))}update({start:e,duration:i,playbackRate:a}){let r=e-re(this,Oi).valueAsNumber,n=Math.abs(i-this.duration);(r>0||r<-.03||n>=.5)&&this.callback(e),Ie(this,Sn,e),Ie(this,kn,performance.now()),this.duration=i,this.playbackRate=a}};Oi=new WeakMap;Tn=new WeakMap;Ni=new WeakMap;xa=new WeakMap;yn=new WeakMap;kn=new WeakMap;Sn=new WeakMap;Pi=new WeakMap;Xt=new WeakMap;In=new WeakMap;var Zs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},te=(t,e,i)=>(Zs(t,e,"read from private field"),i?i.call(t):e.get(t)),ne=(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)},Qe=(t,e,i,a)=>(Zs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),le=(t,e,i)=>(Zs(t,e,"access private method"),i),Ui,Jt,wn,Oa,Ln,Rn,Na,Pa,Bi,Hi,Da,zs,xc,Vs,xn,Qs,Dn,Xs,On,Js,Ys,Dc,Ua,Nn,Gs,Oc,av="video not loaded, unknown time.",rv=t=>{let e=t.range,i=Ut(+Pc(t)),a=Ut(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:av;e.setAttribute("aria-valuetext",r)},Nc=h.createElement("template");Nc.innerHTML=`
901
907
  <style>
902
908
  :host {
903
909
  --media-box-border-radius: 4px;
@@ -1110,7 +1116,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1110
1116
 
1111
1117
  </slot>
1112
1118
  </div>
1113
- `;var Sn=(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))},Lc=(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},Ks=class extends Zt{constructor(){super(),ne(this,Bi),ne(this,Ys),ne(this,Rn),ne(this,Ln),ne(this,wn),ne(this,Ws),ne(this,Pa),ne(this,Fs),ne(this,Pi,void 0),ne(this,Xt,void 0),ne(this,Cn,void 0),ne(this,Da,void 0),ne(this,Mn,void 0),ne(this,In,void 0),ne(this,Oa,void 0),ne(this,Na,void 0),ne(this,Ui,void 0),ne(this,$s,a=>{this.dragging||(fi(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.container.appendChild(Rc.content.cloneNode(!0)),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ze(this,Cn,this.shadowRoot.querySelectorAll('[part~="box"]')),Ze(this,Mn,this.shadowRoot.querySelector('[part~="preview-box"]')),Ze(this,In,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);Ze(this,Oa,parseInt(i.getPropertyValue("--media-box-padding-left"))),Ze(this,Na,parseInt(i.getPropertyValue("--media-box-padding-right"))),Ze(this,Xt,new kn(this.range,te(this,$s),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",Y.SEEK()),le(this,Bi,xa).call(this),Ze(this,Pi,this.getRootNode()),(e=te(this,Pi))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),le(this,Bi,xa).call(this),(e=te(this,Pi))==null||e.removeEventListener("transitionstart",this),Ze(this,Pi,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?(te(this,Xt).update({start:Sn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,Bi,xa).call(this),ev(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=te(this,Ui),this.updateBar()))}get mediaChaptersCues(){return te(this,Ui)}set mediaChaptersCues(e){var i;Ze(this,Ui,e),this.updateSegments((i=te(this,Ui))==null?void 0:i.map(a=>({start:Sn(this,a.startTime),end:Sn(this,a.endTime)})))}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,o.MEDIA_LOADING)}set mediaLoading(e){U(this,o.MEDIA_LOADING,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){D(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){D(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){D(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 R(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){I(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){D(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return H(this,o.MEDIA_ENDED)}set mediaEnded(e){U(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=Sn(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=le(this,Rn,Gs).call(this,te(this,In)),n=le(this,Ln,qs).call(this,r,this.range.valueAsNumber),s=le(this,wn,Zs).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":le(this,Fs,Mc).call(this);break;case"pointermove":le(this,Ws,Cc).call(this,e);break;case"pointerup":case"pointerleave":le(this,Pa,xn).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>le(this,Bi,xa).call(this),0);break}}};Pi=new WeakMap;Xt=new WeakMap;Cn=new WeakMap;Da=new WeakMap;Mn=new WeakMap;In=new WeakMap;Oa=new WeakMap;Na=new WeakMap;Ui=new WeakMap;Bi=new WeakSet;xa=function(){le(this,Ys,Ic).call(this)?te(this,Xt).start():te(this,Xt).stop()};Ys=new WeakSet;Ic=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Ir(this)};$s=new WeakMap;Rn=new WeakSet;Gs=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}};Ln=new WeakSet;qs=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};wn=new WeakSet;Zs=function(t,e){let{width:i,min:a,max:r}=t.box,n=e*t.range.width;if(n<a+te(this,Oa)){let s=t.range.left-t.bounds.left-te(this,Oa);return`${n-i/2+s}px`}if(n>r-te(this,Na)){let s=t.bounds.right-t.range.right-te(this,Na);return`${n+i/2-s-t.range.width}px`}return 0};Ws=new WeakSet;Cc=function(t){let e=[...te(this,Cn)].some(b=>t.composedPath().includes(b));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,Pa,xn).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=le(this,Rn,Gs).call(this,te(this,Mn)),s=(t.clientX-n.range.left)/n.range.width;s=Math.max(0,Math.min(1,s));let l=le(this,Ln,qs).call(this,n,s),u=le(this,wn,Zs).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(te(this,Da))-Math.round(s*i);Math.abs(c)<1&&s>.01&&s<.99||(Ze(this,Da,s*i),le(this,Pa,xn).call(this,te(this,Da)))};Pa=new WeakSet;xn=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Fs=new WeakSet;Mc=function(){te(this,Xt).stop();let t=Lc(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",Ks);var Hi={PLACEMENT:"placement",BOUNDS:"bounds"},wc=h.createElement("template");wc.innerHTML=`
1119
+ `;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))},Pc=(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(),ne(this,Hi),ne(this,zs),ne(this,xn),ne(this,Dn),ne(this,On),ne(this,Ys),ne(this,Ua),ne(this,Gs),ne(this,Ui,void 0),ne(this,Jt,void 0),ne(this,wn,void 0),ne(this,Oa,void 0),ne(this,Ln,void 0),ne(this,Rn,void 0),ne(this,Na,void 0),ne(this,Pa,void 0),ne(this,Bi,void 0),ne(this,Vs,a=>{this.dragging||(Ei(a)&&(this.range.valueAsNumber=a),this.updateBar())}),this.container.appendChild(Nc.content.cloneNode(!0)),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Qe(this,wn,this.shadowRoot.querySelectorAll('[part~="box"]')),Qe(this,Ln,this.shadowRoot.querySelector('[part~="preview-box"]')),Qe(this,Rn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);Qe(this,Na,parseInt(i.getPropertyValue("--media-box-padding-left"))),Qe(this,Pa,parseInt(i.getPropertyValue("--media-box-padding-right"))),Qe(this,Jt,new Cn(this.range,te(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()),le(this,Hi,Da).call(this),Qe(this,Ui,this.getRootNode()),(e=te(this,Ui))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),le(this,Hi,Da).call(this),(e=te(this,Ui))==null||e.removeEventListener("transitionstart",this),Qe(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?(te(this,Jt).update({start:Mn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,Hi,Da).call(this),rv(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=te(this,Bi),this.updateBar()))}get mediaChaptersCues(){return te(this,Bi)}set mediaChaptersCues(e){var i;Qe(this,Bi,e),this.updateSegments((i=te(this,Bi))==null?void 0:i.map(a=>({start:Mn(this,a.startTime),end:Mn(this,a.endTime)})))}get mediaPaused(){return H(this,o.MEDIA_PAUSED)}set mediaPaused(e){U(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,o.MEDIA_LOADING)}set mediaLoading(e){U(this,o.MEDIA_LOADING,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){D(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){D(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){D(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 R(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){I(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){D(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return H(this,o.MEDIA_ENDED)}set mediaEnded(e){U(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}=G(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=G(this.shadowRoot,"#current-rail"),a=G(this.shadowRoot,'[part~="current-box"]'),r=le(this,xn,Qs).call(this,te(this,Rn)),n=le(this,Dn,Xs).call(this,r,this.range.valueAsNumber),s=le(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":le(this,Gs,Oc).call(this);break;case"pointermove":le(this,Ys,Dc).call(this,e);break;case"pointerup":case"pointerleave":le(this,Ua,Nn).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>le(this,Hi,Da).call(this),0);break}}};Ui=new WeakMap;Jt=new WeakMap;wn=new WeakMap;Oa=new WeakMap;Ln=new WeakMap;Rn=new WeakMap;Na=new WeakMap;Pa=new WeakMap;Bi=new WeakMap;Hi=new WeakSet;Da=function(){le(this,zs,xc).call(this)?te(this,Jt).start():te(this,Jt).stop()};zs=new WeakSet;xc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Cr(this)};Vs=new WeakMap;xn=new WeakSet;Qs=function(t){var e;let a=((e=this.getAttribute("bounds")?He(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+te(this,Na)){let s=t.range.left-t.bounds.left-te(this,Na);return`${n-i/2+s}px`}if(n>r-te(this,Pa)){let s=t.bounds.right-t.range.right-te(this,Pa);return`${n+i/2-s-t.range.width}px`}return 0};Ys=new WeakSet;Dc=function(t){let e=[...te(this,wn)].some(_=>t.composedPath().includes(_));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,Ua,Nn).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=G(this.shadowRoot,"#preview-rail"),r=G(this.shadowRoot,'[part~="preview-box"]'),n=le(this,xn,Qs).call(this,te(this,Ln)),s=(t.clientX-n.range.left)/n.range.width;s=Math.max(0,Math.min(1,s));let l=le(this,Dn,Xs).call(this,n,s),u=le(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(te(this,Oa))-Math.round(s*i);Math.abs(c)<1&&s>.01&&s<.99||(Qe(this,Oa,s*i),le(this,Ua,Nn).call(this,te(this,Oa)))};Ua=new WeakSet;Nn=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Gs=new WeakSet;Oc=function(){te(this,Jt).stop();let t=Pc(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"},Uc=h.createElement("template");Uc.innerHTML=`
1114
1120
  <style>
1115
1121
  :host {
1116
1122
  --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
@@ -1220,15 +1226,12 @@ svg, img, ::slotted(svg), ::slotted(img) {
1220
1226
  </style>
1221
1227
  <slot></slot>
1222
1228
  <div id="arrow"></div>
1223
- `;var zs=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Ir(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:z(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,b=n+s,g=a.getPropertyValue("--media-tooltip-offset-x"),v=g?parseFloat(g.replace("px","")):0,f=a.getPropertyValue("--media-tooltip-container-margin"),w=f?parseFloat(f.replace("px","")):0,A=l-n+v-w,T=c-b+v+w;if(A<0){this.style.setProperty("--media-tooltip-offset-x",`${A}px`);return}if(T>0){this.style.setProperty("--media-tooltip-offset-x",`${T}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(wc.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[Hi.PLACEMENT,Hi.BOUNDS]}get placement(){return R(this,Hi.PLACEMENT)}set placement(e){I(this,Hi.PLACEMENT,e)}get bounds(){return R(this,Hi.BOUNDS)}set bounds(e){I(this,Hi.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",zs);var tv=1,iv=t=>t.mediaMuted?0:t.mediaVolume,av=t=>`${Math.round(t*100)}%`,Qs=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",Y.VOLUME())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=iv(this),this.range.setAttribute("aria-valuetext",av(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,tv)}set mediaVolume(e){D(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,o.MEDIA_MUTED)}set mediaMuted(e){U(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return R(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){I(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",Qs);var E=mh(require("@mux/mux-video")),y=require("@mux/playback-core");var Wc=require("@mux/mux-video");var Uc=require("@mux/playback-core");var ei=require("@mux/playback-core");function xc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Dn(i)}: ${a}; `)}),e?e.trim():void 0}function Dn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function On(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Xs(t){let e=rv(t).toString();return e?"?"+e:""}function rv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Js=(t,e)=>!t||!e?!1:t.contains(e)?!0:Js(t,e.getRootNode().host);var Dc="mux.com",nv=()=>{try{return"3.2.4"}catch{}return"UNKNOWN"},ov=nv(),Pn=()=>ov,Oc=(t,{token:e,customDomain:i=Dc,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${Xs({token:e,time:n,program_time:r})}`},Nc=(t,{token:e,customDomain:i=Dc,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${Xs({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ua=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 sv={crossorigin:"crossOrigin",playsinline:"playsInline"};function Pc(t){var e;return(e=sv[t])!=null?e:On(t)}var Jt,jt,me,Nn=class{constructor(e,i){pe(this,Jt);pe(this,jt);pe(this,me,[]);Te(this,Jt,e),Te(this,jt,i)}[Symbol.iterator](){return P(this,me).values()}get length(){return P(this,me).length}get value(){var e;return(e=P(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Te(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return P(this,me)[e]}values(){return P(this,me).values()}keys(){return P(this,me).keys()}forEach(e){P(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||P(this,me).push(r)}),!(this.value===""&&!((i=P(this,Jt))!=null&&i.hasAttribute(`${P(this,jt)}`)))&&((a=P(this,Jt))==null||a.setAttribute(`${P(this,jt)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{P(this,me).splice(P(this,me).indexOf(a),1)}),(i=P(this,Jt))==null||i.setAttribute(`${P(this,jt)}`,`${this.value}`)}contains(e){return P(this,me).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,me=new WeakMap;var Bc=`[mux-player ${Pn()}]`;function ze(...t){console.warn(Bc,...t)}function be(...t){console.error(Bc,...t)}function js(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Uc.i18n)("Read more: ")}
1224
- https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ze(e)}var de={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ti={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},$c=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}}),lv=Wc.VideoEvents.filter(t=>t!=="error"),dv=Object.values(de).filter(t=>![de.PLAYSINLINE].includes(t)),uv=Object.values(ti),el=class extends ve.HTMLElement{static get observedAttributes(){return[...dv,...uv]}constructor(){super()}init(){lv.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=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ti.PLAYBACKRATE:{let s=(n=ce(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:$c}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:$c}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=ce(this.getAttribute(ti.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ti.PLAYBACKRATE,`${e}`):this.removeAttribute(ti.PLAYBACKRATE)}get crossOrigin(){return Ba(this,de.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(de.CROSSORIGIN,`${e}`)}get autoplay(){return Ba(this,de.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(de.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(de.AUTOPLAY)}get loop(){return Ba(this,de.LOOP)!=null}set loop(e){e?this.setAttribute(de.LOOP,""):this.removeAttribute(de.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 Ba(this,de.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(de.MUTED,""):this.removeAttribute(de.MUTED)}get playsInline(){return Ba(this,de.PLAYSINLINE)!=null}set playsInline(e){be("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(de.PRELOAD,e):this.removeAttribute(de.PRELOAD)}};function Ba(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var tl=el;var Gc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},k=(t,e,i)=>(Gc(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)=>(Gc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),$i,Un,ii,Ha,Ct,Mt,Rt,ai,Wi,Bn,Oe,Fc=1,Kc=0,cv=1,mv={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 he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof he?r.element[r.attributeName]=n:r.value=n}}}},ht=class extends d.DocumentFragment{constructor(e,i,a=mv){var r;super(),Qe(this,$i,void 0),Qe(this,Un,void 0),this.append(e.content.cloneNode(!0)),mt(this,$i,qc(this)),mt(this,Un,a),(r=a.createCallback)==null||r.call(a,this,k(this,$i),i),a.processCallback(this,k(this,$i),i)}update(e){k(this,Un).processCallback(this,k(this,$i),e)}};$i=new WeakMap;Un=new WeakMap;var qc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let n=new il;for([i,a]of Yc(r.value))if(!i)n.append(a);else{let s=new he(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===Fc&&!(r instanceof HTMLTemplateElement))qc(r,e);else{let n=r.data;if(r.nodeType===Fc||n.includes("{{")){let s=[];if(n)for([i,a]of Yc(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 $a(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Vc={},Yc=t=>{let e="",i=0,a=Vc[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([Kc,e]),e="",r++):n==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([cv,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Kc,(i>0?"{{":"")+e]),Vc[t]=a},hv=11,Hn=class{get value(){return""}set value(e){}toString(){return this.value}},Zc=new WeakMap,il=class{constructor(){Qe(this,ii,[])}[Symbol.iterator](){return k(this,ii).values()}get length(){return k(this,ii).length}item(e){return k(this,ii)[e]}append(...e){for(let i of e)i instanceof he&&Zc.set(i,this),k(this,ii).push(i)}toString(){return k(this,ii).join("")}};ii=new WeakMap;var he=class extends Hn{constructor(e,i,a){super(),Qe(this,ai),Qe(this,Ha,""),Qe(this,Ct,void 0),Qe(this,Mt,void 0),Qe(this,Rt,void 0),mt(this,Ct,e),mt(this,Mt,i),mt(this,Rt,a)}get attributeName(){return k(this,Mt)}get attributeNamespace(){return k(this,Rt)}get element(){return k(this,Ct)}get value(){return k(this,Ha)}set value(e){k(this,Ha)!==e&&(mt(this,Ha,e),!k(this,ai,Wi)||k(this,ai,Wi).length===1?e==null?k(this,Ct).removeAttributeNS(k(this,Rt),k(this,Mt)):k(this,Ct).setAttributeNS(k(this,Rt),k(this,Mt),e):k(this,Ct).setAttributeNS(k(this,Rt),k(this,Mt),k(this,ai,Wi).toString()))}get booleanValue(){return k(this,Ct).hasAttributeNS(k(this,Rt),k(this,Mt))}set booleanValue(e){if(!k(this,ai,Wi)||k(this,ai,Wi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Ha=new WeakMap;Ct=new WeakMap;Mt=new WeakMap;Rt=new WeakMap;ai=new WeakSet;Wi=function(){return Zc.get(this)};var pt=class extends Hn{constructor(e,i){super(),Qe(this,Bn,void 0),Qe(this,Oe,void 0),mt(this,Bn,e),mt(this,Oe,i?[...i]:[new Text])}get replacementNodes(){return k(this,Oe)}get parentNode(){return k(this,Bn)}get nextSibling(){return k(this,Oe)[k(this,Oe).length-1].nextSibling}get previousSibling(){return k(this,Oe)[0].previousSibling}get value(){return k(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===hv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),mt(this,Oe,pv(k(this,Oe)[0].parentNode,k(this,Oe),i,this.nextSibling))}};Bn=new WeakMap;Oe=new WeakMap;var $a=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 pv(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 zc={string:t=>String(t)},Wn=class{constructor(e){this.template=e,this.state=void 0}},ri=new WeakMap,ni=new WeakMap,al={partial:(t,e)=>{e[t.expression]=new Wn(t.template)},if:(t,e)=>{var i;if(Xc(t.expression,e))if(ri.get(t)!==t.template){ri.set(t,t.template);let a=new ht(t.template,e,Fn);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)}},vv=Object.keys(al),Fn={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof $a){if(!s.directive){let u=vv.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=al[s.directive])==null||a.call(al,s,i);continue}let l=Xc(n,i);if(l instanceof Wn){ri.get(s)!==l.template?(ri.set(s,l.template),l=new ht(l.template,l.state,Fn),s.value=l,ni.set(s,l)):(r=ni.get(s))==null||r.update(l.state);continue}l?(s instanceof he&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof he?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 he?s.value=void 0:(s.value=void 0,ri.delete(s),ni.delete(s))}}},Qc={"!":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=zc[e])==null?void 0:i.call(zc,t)}};function fv(t){return Ev(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Xc(t,e={}){var i,a,r,n,s,l,u;let c=fv(t);if(c.length===0||c.some(({type:b})=>!b))return Wa(t);if(((i=c[0])==null?void 0:i.token)===">"){let b=e[(a=c[1])==null?void 0:a.token];if(!b)return Wa(t);let g={...e};b.state=g;let v=c.slice(2);for(let f=0;f<v.length;f+=3){let w=(r=v[f])==null?void 0:r.token,A=(n=v[f+1])==null?void 0:n.token,T=(s=v[f+2])==null?void 0:s.token;w&&A==="="&&(g[w]=Fa(T,e))}return b}if(c.length===1)return $n(c[0])?Fa(c[0].token,e):Wa(t);if(c.length===2){let b=(l=c[0])==null?void 0:l.token,g=Qc[b];if(!g||!$n(c[1]))return Wa(t);let v=Fa(c[1].token,e);return g(v)}if(c.length===3){let b=(u=c[1])==null?void 0:u.token,g=Qc[b];if(!g||!$n(c[0])||!$n(c[2]))return Wa(t);let v=Fa(c[0].token,e);if(b==="|")return g(v,c[2].token);let f=Fa(c[2].token,e);return g(v,f)}}function Wa(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function $n({type:t}){return["number","boolean","string","param"].includes(t)}function Fa(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):br(t)?parseFloat(t):e[t]}function Ev(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 dl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ol=(t,e,i)=>(dl(t,e,"read from private field"),i?i.call(t):e.get(t)),Ka=(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)=>(dl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),rl=(t,e,i)=>(dl(t,e,"access private method"),i),Fi,Kn,Ki,sl,Jc,Vn,ll,nl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},jc=h.createElement("template");jc.innerHTML=`
1229
+ `;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=He(this,"#"+this.bounds))!=null?e:z(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,_=n+s,g=a.getPropertyValue("--media-tooltip-offset-x"),v=g?parseFloat(g.replace("px","")):0,f=a.getPropertyValue("--media-tooltip-container-margin"),L=f?parseFloat(f.replace("px","")):0,A=l-n+v-L,T=c-_+v+L;if(A<0){this.style.setProperty("--media-tooltip-offset-x",`${A}px`);return}if(T>0){this.style.setProperty("--media-tooltip-offset-x",`${T}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Uc.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 R(this,$i.PLACEMENT)}set placement(e){I(this,$i.PLACEMENT,e)}get bounds(){return R(this,$i.BOUNDS)}set bounds(e){I(this,$i.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",js);var nv=1,ov=t=>t.mediaMuted?0:t.mediaVolume,sv=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",V.VOLUME())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=ov(this),this.range.setAttribute("aria-valuetext",sv(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,nv)}set mediaVolume(e){D(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,o.MEDIA_MUTED)}set mediaMuted(e){U(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return R(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){I(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",el);var E=bh(require("@mux/mux-video")),y=require("@mux/playback-core");var qc=require("@mux/mux-video");var Kc=require("@mux/playback-core");var ti=require("@mux/playback-core");function Bc(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 ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function tl(t){let e=lv(t).toString();return e?"?"+e:""}function lv(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 Hc="mux.com",dv=()=>{try{return"3.2.4"}catch{}return"UNKNOWN"},uv=dv(),Hn=()=>uv,$c=(t,{token:e,customDomain:i=Hc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ti.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${tl({token:e,time:n,program_time:r})}`},Wc=(t,{token:e,customDomain:i=Hc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ti.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})}`},Ba=t=>{if(t){if([ti.StreamTypes.LIVE,ti.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return ti.StreamTypes.LIVE}};var cv={crossorigin:"crossOrigin",playsinline:"playsInline"};function Fc(t){var e;return(e=cv[t])!=null?e:Un(t)}var jt,ei,me,Bn=class{constructor(e,i){pe(this,jt);pe(this,ei);pe(this,me,[]);Te(this,jt,e),Te(this,ei,i)}[Symbol.iterator](){return P(this,me).values()}get length(){return P(this,me).length}get value(){var e;return(e=P(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Te(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return P(this,me)[e]}values(){return P(this,me).values()}keys(){return P(this,me).keys()}forEach(e){P(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||P(this,me).push(r)}),!(this.value===""&&!((i=P(this,jt))!=null&&i.hasAttribute(`${P(this,ei)}`)))&&((a=P(this,jt))==null||a.setAttribute(`${P(this,ei)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{P(this,me).splice(P(this,me).indexOf(a),1)}),(i=P(this,jt))==null||i.setAttribute(`${P(this,ei)}`,`${this.value}`)}contains(e){return P(this,me).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,ei=new WeakMap,me=new WeakMap;var Vc=`[mux-player ${Hn()}]`;function Xe(...t){console.warn(Vc,...t)}function be(...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,Kc.i18n)("Read more: ")}
1230
+ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Xe(e)}var de={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ii={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}}),mv=qc.VideoEvents.filter(t=>t!=="error"),hv=Object.values(de).filter(t=>![de.PLAYSINLINE].includes(t)),pv=Object.values(ii),rl=class extends ve.HTMLElement{static get observedAttributes(){return[...hv,...pv]}constructor(){super()}init(){mv.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 ii.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ii.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ii.PLAYBACKRATE:{let s=(n=ce(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=ce(this.getAttribute(ii.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ii.PLAYBACKRATE,`${e}`):this.removeAttribute(ii.PLAYBACKRATE)}get crossOrigin(){return Ha(this,de.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(de.CROSSORIGIN,`${e}`)}get autoplay(){return Ha(this,de.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(de.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(de.AUTOPLAY)}get loop(){return Ha(this,de.LOOP)!=null}set loop(e){e?this.setAttribute(de.LOOP,""):this.removeAttribute(de.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 Ha(this,de.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(de.MUTED,""):this.removeAttribute(de.MUTED)}get playsInline(){return Ha(this,de.PLAYSINLINE)!=null}set playsInline(e){be("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(de.PRELOAD,e):this.removeAttribute(de.PRELOAD)}};function Ha(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var nl=rl;var Jc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},k=(t,e,i)=>(Jc(t,e,"read from private field"),i?i.call(t):e.get(t)),Je=(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)},pt=(t,e,i,a)=>(Jc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Wi,$n,ai,$a,Mt,Rt,wt,ri,Fi,Wn,Pe,Zc=1,zc=0,vv=1,fv={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 he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof he?r.element[r.attributeName]=n:r.value=n}}}},vt=class extends d.DocumentFragment{constructor(e,i,a=fv){var r;super(),Je(this,Wi,void 0),Je(this,$n,void 0),this.append(e.content.cloneNode(!0)),pt(this,Wi,jc(this)),pt(this,$n,a),(r=a.createCallback)==null||r.call(a,this,k(this,Wi),i),a.processCallback(this,k(this,Wi),i)}update(e){k(this,$n).processCallback(this,k(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 Xc(r.value))if(!i)n.append(a);else{let s=new he(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===Zc&&!(r instanceof HTMLTemplateElement))jc(r,e);else{let n=r.data;if(r.nodeType===Zc||n.includes("{{")){let s=[];if(n)for([i,a]of Xc(n))if(!i)s.push(new Text(a));else{let l=new ft(t);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new Wa(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Qc={},Xc=t=>{let e="",i=0,a=Qc[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([vv,e.trim()]),e="",r++):e+=n||"";return e&&a.push([zc,(i>0?"{{":"")+e]),Qc[t]=a},Ev=11,Fn=class{get value(){return""}set value(e){}toString(){return this.value}},em=new WeakMap,ol=class{constructor(){Je(this,ai,[])}[Symbol.iterator](){return k(this,ai).values()}get length(){return k(this,ai).length}item(e){return k(this,ai)[e]}append(...e){for(let i of e)i instanceof he&&em.set(i,this),k(this,ai).push(i)}toString(){return k(this,ai).join("")}};ai=new WeakMap;var he=class extends Fn{constructor(e,i,a){super(),Je(this,ri),Je(this,$a,""),Je(this,Mt,void 0),Je(this,Rt,void 0),Je(this,wt,void 0),pt(this,Mt,e),pt(this,Rt,i),pt(this,wt,a)}get attributeName(){return k(this,Rt)}get attributeNamespace(){return k(this,wt)}get element(){return k(this,Mt)}get value(){return k(this,$a)}set value(e){k(this,$a)!==e&&(pt(this,$a,e),!k(this,ri,Fi)||k(this,ri,Fi).length===1?e==null?k(this,Mt).removeAttributeNS(k(this,wt),k(this,Rt)):k(this,Mt).setAttributeNS(k(this,wt),k(this,Rt),e):k(this,Mt).setAttributeNS(k(this,wt),k(this,Rt),k(this,ri,Fi).toString()))}get booleanValue(){return k(this,Mt).hasAttributeNS(k(this,wt),k(this,Rt))}set booleanValue(e){if(!k(this,ri,Fi)||k(this,ri,Fi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};$a=new WeakMap;Mt=new WeakMap;Rt=new WeakMap;wt=new WeakMap;ri=new WeakSet;Fi=function(){return em.get(this)};var ft=class extends Fn{constructor(e,i){super(),Je(this,Wn,void 0),Je(this,Pe,void 0),pt(this,Wn,e),pt(this,Pe,i?[...i]:[new Text])}get replacementNodes(){return k(this,Pe)}get parentNode(){return k(this,Wn)}get nextSibling(){return k(this,Pe)[k(this,Pe).length-1].nextSibling}get previousSibling(){return k(this,Pe)[0].previousSibling}get value(){return k(this,Pe).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===Ev?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),pt(this,Pe,bv(k(this,Pe)[0].parentNode,k(this,Pe),i,this.nextSibling))}};Wn=new WeakMap;Pe=new WeakMap;var Wa=class extends ft{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 bv(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 tm={string:t=>String(t)},Vn=class{constructor(e){this.template=e,this.state=void 0}},ni=new WeakMap,oi=new WeakMap,sl={partial:(t,e)=>{e[t.expression]=new Vn(t.template)},if:(t,e)=>{var i;if(am(t.expression,e))if(ni.get(t)!==t.template){ni.set(t,t.template);let a=new vt(t.template,e,Yn);t.replace(a),oi.set(t,a)}else(i=oi.get(t))==null||i.update(e);else t.replace(""),ni.delete(t),oi.delete(t)}},gv=Object.keys(sl),Yn={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof Wa){if(!s.directive){let u=gv.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=am(n,i);if(l instanceof Vn){ni.get(s)!==l.template?(ni.set(s,l.template),l=new vt(l.template,l.state,Yn),s.value=l,oi.set(s,l)):(r=oi.get(s))==null||r.update(l.state);continue}l?(s instanceof he&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof he?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ni.delete(s),oi.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,ni.delete(s),oi.delete(s))}}},im={"!":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=tm[e])==null?void 0:i.call(tm,t)}};function _v(t){return Av(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function am(t,e={}){var i,a,r,n,s,l,u;let c=_v(t);if(c.length===0||c.some(({type:_})=>!_))return Fa(t);if(((i=c[0])==null?void 0:i.token)===">"){let _=e[(a=c[1])==null?void 0:a.token];if(!_)return Fa(t);let g={...e};_.state=g;let v=c.slice(2);for(let f=0;f<v.length;f+=3){let L=(r=v[f])==null?void 0:r.token,A=(n=v[f+1])==null?void 0:n.token,T=(s=v[f+2])==null?void 0:s.token;L&&A==="="&&(g[L]=Ka(T,e))}return _}if(c.length===1)return Kn(c[0])?Ka(c[0].token,e):Fa(t);if(c.length===2){let _=(l=c[0])==null?void 0:l.token,g=im[_];if(!g||!Kn(c[1]))return Fa(t);let v=Ka(c[1].token,e);return g(v)}if(c.length===3){let _=(u=c[1])==null?void 0:u.token,g=im[_];if(!g||!Kn(c[0])||!Kn(c[2]))return Fa(t);let v=Ka(c[0].token,e);if(_==="|")return g(v,c[2].token);let f=Ka(c[2].token,e);return g(v,f)}}function Fa(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Kn({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 Av(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)),Va=(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)},si=(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),Ki,Gn,Vi,cl,rm,qn,ml,dl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},nm=h.createElement("template");nm.innerHTML=`
1225
1231
  <style>
1226
1232
  :host {
1227
1233
  display: inline-block;
1228
1234
  line-height: 0;
1229
-
1230
- /* Hide theme element until the breakpoints are available to avoid flicker. */
1231
- visibility: hidden;
1232
1235
  }
1233
1236
 
1234
1237
  media-controller {
@@ -1251,7 +1254,7 @@ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ze(e)}var de={AU
1251
1254
  display: none;
1252
1255
  }
1253
1256
  </style>
1254
- `;var si=class extends d.HTMLElement{constructor(){super(),Ka(this,sl),Ka(this,Vn),Ka(this,Fi,void 0),Ka(this,Kn,void 0),Ka(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:!!(nl[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),rl(this,sl,Jc).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=ol(this,Fi))!=null?e:this.constructor.template}set template(e){oi(this,Ki,null),oi(this,Fi,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})=>nl[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=nl[s.name])!=null?a:Pd(s.name),{value:u}=s;u!=null?(br(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&rl(this,Vn,ll).call(this)}connectedCallback(){rl(this,Vn,ll).call(this)}createRenderer(){this.template&&this.template!==ol(this,Kn)&&(oi(this,Kn,this.template),this.renderer=new ht(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(jc.content.cloneNode(!0),this.renderer))}render(){var e;if((e=this.renderer)==null||e.update(this.props),this.renderRoot.isConnected){let{style:i}=W(this.renderRoot,":host");i.visibility==="hidden"&&i.removeProperty("visibility")}}};Fi=new WeakMap;Kn=new WeakMap;Ki=new WeakMap;sl=new WeakSet;Jc=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};Vn=new WeakSet;ll=function(){var t;let e=this.getAttribute("template");if(!e||e===ol(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,Fi,a),this.createRenderer();return}bv(e)&&(oi(this,Ki,e),gv(e).then(r=>{let n=h.createElement("template");n.innerHTML=r,oi(this,Fi,n),this.createRenderer()}).catch(console.error))};si.observedAttributes=["template"];si.processor=Fn;function bv(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 gv(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 em=`:host {
1257
+ `;var li=class extends d.HTMLElement{constructor(){super(),Va(this,cl),Va(this,qn),Va(this,Ki,void 0),Va(this,Gn,void 0),Va(this,Vi,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(st.BREAKPOINTS_COMPUTED,this.render),ll(this,cl,rm).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=ul(this,Ki))!=null?e:this.constructor.template}set template(e){si(this,Vi,null),si(this,Ki,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,Gn)&&(si(this,Gn,this.template),this.renderer=new vt(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(nm.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Ki=new WeakMap;Gn=new WeakMap;Vi=new WeakMap;cl=new WeakSet;rm=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,Vi))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){si(this,Vi,e),si(this,Ki,a),this.createRenderer();return}Tv(e)&&(si(this,Vi,e),yv(e).then(r=>{let n=h.createElement("template");n.innerHTML=r,si(this,Ki,n),this.createRenderer()}).catch(console.error))};li.observedAttributes=["template"];li.processor=Yn;function Tv(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 yv(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",li);var om=`:host {
1255
1258
  --media-control-display: var(--controls);
1256
1259
  --media-loading-indicator-display: var(--loading-indicator);
1257
1260
  --media-dialog-display: var(--dialog);
@@ -1277,13 +1280,8 @@ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ze(e)}var de={AU
1277
1280
  --media-title-display-display: var(--title-display);
1278
1281
 
1279
1282
  display: inline-block;
1280
- width: 100%;
1281
1283
  line-height: 0;
1282
- }
1283
-
1284
- /* Hide custom elements that are not defined yet */
1285
- :not(:defined) {
1286
- display: none;
1284
+ width: 100%;
1287
1285
  }
1288
1286
 
1289
1287
  a {
@@ -1293,12 +1291,16 @@ a {
1293
1291
  }
1294
1292
 
1295
1293
  media-theme {
1294
+ display: inline-block;
1295
+ line-height: 0;
1296
1296
  width: 100%;
1297
1297
  height: 100%;
1298
1298
  direction: ltr;
1299
1299
  }
1300
1300
 
1301
1301
  media-poster-image {
1302
+ display: inline-block;
1303
+ line-height: 0;
1302
1304
  width: 100%;
1303
1305
  height: 100%;
1304
1306
  }
@@ -1402,65 +1404,65 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1402
1404
  :host([no-tooltips]) {
1403
1405
  --media-tooltip-display: none;
1404
1406
  }
1405
- `;var Va=new WeakMap,cl=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=Va.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=Va.get(this.element);i&&i.delete(this.type)}}static for(e){Va.has(e.element)||Va.set(e.element,new Map);let i=e.attributeName.slice(2),a=Va.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function Av(t,e){return t instanceof he&&t.attributeName.startsWith("on")?(cl.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Tv(t,e){return e instanceof Yn&&t instanceof pt?(e.renderInto(t),!0):!1}function yv(t,e){return e instanceof DocumentFragment&&t instanceof pt?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function kv(t,e){if(t instanceof he){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 Sv(t,e){if(t instanceof he&&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 Iv(t,e){if(typeof e=="boolean"&&t instanceof he){let i=t.attributeNamespace,a=t.element.hasAttributeNS(i,t.attributeName);return e!==a&&(t.booleanValue=e),!0}return!1}function Cv(t,e){return e===!1&&t instanceof pt?(t.replace(""),!0):!1}function Mv(t,e){Sv(t,e)||Iv(t,e)||Av(t,e)||Cv(t,e)||Tv(t,e)||yv(t,e)||kv(t,e)}var ul=new Map,tm=new WeakMap,im=new WeakMap,Yn=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(ul.has(this.stringsKey))return ul.get(this.stringsKey);{let e=vi.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<i?`{{ ${n} }}`:""),""),ul.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(tm.get(e)!==i){tm.set(e,i);let n=new ht(i,this.values,this.processor);im.set(e,n),e instanceof pt?e.replace(...n.children):e.appendChild(n);return}let a=im.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Rv={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:"";Mv(n,s)}}}};function Ya(t,...e){return new Yn(t,e,Rv)}function am(t,e){t.renderInto(e)}var Ga=require("@mux/playback-core"),Lv=t=>{let{tokens:e}=t;return e.drm?":host { --_cast-button-drm-display: none; }":""},rm=t=>Ya`
1407
+ `;var Ya=new WeakMap,vl=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 Sv(t,e){return t instanceof he&&t.attributeName.startsWith("on")?(vl.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Iv(t,e){return e instanceof Zn&&t instanceof ft?(e.renderInto(t),!0):!1}function Cv(t,e){return e instanceof DocumentFragment&&t instanceof ft?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function Mv(t,e){if(t instanceof he){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 Rv(t,e){if(t instanceof he&&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 wv(t,e){if(typeof e=="boolean"&&t instanceof he){let i=t.attributeNamespace,a=t.element.hasAttributeNS(i,t.attributeName);return e!==a&&(t.booleanValue=e),!0}return!1}function Lv(t,e){return e===!1&&t instanceof ft?(t.replace(""),!0):!1}function xv(t,e){Rv(t,e)||wv(t,e)||Sv(t,e)||Lv(t,e)||Iv(t,e)||Cv(t,e)||Mv(t,e)}var pl=new Map,sm=new WeakMap,lm=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(sm.get(e)!==i){sm.set(e,i);let n=new vt(i,this.values,this.processor);lm.set(e,n),e instanceof ft?e.replace(...n.children):e.appendChild(n);return}let a=lm.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Dv={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:"";xv(n,s)}}}};function Ga(t,...e){return new Zn(t,e,Dv)}function dm(t,e){t.renderInto(e)}var qa=require("@mux/playback-core"),Ov=t=>{let{tokens:e}=t;return e.drm?":host { --_cast-button-drm-display: none; }":""},um=t=>Ga`
1406
1408
  <style>
1407
- ${Lv(t)}
1408
- ${em}
1409
+ ${Ov(t)}
1410
+ ${om}
1409
1411
  </style>
1410
- ${Ov(t)}
1411
- `,wv=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Ua(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},xv={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",LISTBOX:"listbox",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},Dv=Object.values(xv).join(", "),Ov=t=>{var e,i,a,r,n,s,l,u,c,b,g,v,f,w,A,T,N,ee,ge,Et,at,Xi,Ji,ji,ea,ta,ia,aa,ra,na,oa,sa,fr,rt;return Ya`
1412
+ ${Bv(t)}
1413
+ `,Nv=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Ba(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Pv={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",LISTBOX:"listbox",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},Uv=Object.values(Pv).join(", "),Bv=t=>{var e,i,a,r,n,s,l,u,c,_,g,v,f,L,A,T,N,ee,ge,gt,nt,Ji,ji,ea,ta,ia,aa,ra,na,oa,sa,la,Er,ot;return Ga`
1412
1414
  <media-theme
1413
1415
  template="${t.themeTemplate||!1}"
1414
1416
  defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
1415
- hotkeys="${wv(t)||!1}"
1417
+ hotkeys="${Nv(t)||!1}"
1416
1418
  nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
1417
- noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(Ga.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
1419
+ noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(qa.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
1418
1420
  novolumepref="${t.novolumepref||!1}"
1419
1421
  disabled="${!t.hasSrc||t.isDialogOpen}"
1420
1422
  audio="${(a=t.audio)!=null?a:!1}"
1421
- style="${(r=xc({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
1423
+ style="${(r=Bc({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
1422
1424
  defaultsubtitles="${!t.defaultHiddenCaptions}"
1423
1425
  forwardseekoffset="${(n=t.forwardSeekOffset)!=null?n:!1}"
1424
1426
  backwardseekoffset="${(s=t.backwardSeekOffset)!=null?s:!1}"
1425
1427
  playbackrates="${(l=t.playbackRates)!=null?l:!1}"
1426
1428
  defaultshowremainingtime="${(u=t.defaultShowRemainingTime)!=null?u:!1}"
1427
1429
  defaultduration="${(c=t.defaultDuration)!=null?c:!1}"
1428
- hideduration="${(b=t.hideDuration)!=null?b:!1}"
1430
+ hideduration="${(_=t.hideDuration)!=null?_:!1}"
1429
1431
  title="${(g=t.title)!=null?g:!1}"
1430
1432
  proudlydisplaymuxbadge="${(v=t.proudlyDisplayMuxBadge)!=null?v:!1}"
1431
- exportparts="${Dv}"
1433
+ exportparts="${Uv}"
1432
1434
  onclose="${t.onCloseErrorDialog}"
1433
1435
  onfocusin="${t.onFocusInErrorDialog}"
1434
1436
  >
1435
1437
  <mux-video
1436
1438
  slot="media"
1437
1439
  target-live-window="${(f=t.targetLiveWindow)!=null?f:!1}"
1438
- stream-type="${(w=Ua(t.streamType))!=null?w:!1}"
1440
+ stream-type="${(L=Ba(t.streamType))!=null?L:!1}"
1439
1441
  crossorigin="${(A=t.crossOrigin)!=null?A:""}"
1440
1442
  playsinline
1441
1443
  autoplay="${(T=t.autoplay)!=null?T:!1}"
1442
1444
  muted="${(N=t.muted)!=null?N:!1}"
1443
1445
  loop="${(ee=t.loop)!=null?ee:!1}"
1444
1446
  preload="${(ge=t.preload)!=null?ge:!1}"
1445
- debug="${(Et=t.debug)!=null?Et:!1}"
1446
- prefer-cmcd="${(at=t.preferCmcd)!=null?at:!1}"
1447
- disable-tracking="${(Xi=t.disableTracking)!=null?Xi:!1}"
1448
- disable-cookies="${(Ji=t.disableCookies)!=null?Ji:!1}"
1449
- prefer-playback="${(ji=t.preferPlayback)!=null?ji:!1}"
1447
+ debug="${(gt=t.debug)!=null?gt:!1}"
1448
+ prefer-cmcd="${(nt=t.preferCmcd)!=null?nt:!1}"
1449
+ disable-tracking="${(Ji=t.disableTracking)!=null?Ji:!1}"
1450
+ disable-cookies="${(ji=t.disableCookies)!=null?ji:!1}"
1451
+ prefer-playback="${(ea=t.preferPlayback)!=null?ea:!1}"
1450
1452
  start-time="${t.startTime!=null?t.startTime:!1}"
1451
- beacon-collection-domain="${(ea=t.beaconCollectionDomain)!=null?ea:!1}"
1452
- player-init-time="${(ta=t.playerInitTime)!=null?ta:!1}"
1453
- player-software-name="${(ia=t.playerSoftwareName)!=null?ia:!1}"
1454
- player-software-version="${(aa=t.playerSoftwareVersion)!=null?aa:!1}"
1455
- env-key="${(ra=t.envKey)!=null?ra:!1}"
1456
- custom-domain="${(na=t.customDomain)!=null?na:!1}"
1457
- src="${t.src?t.src:t.playbackId?(0,Ga.toMuxVideoURL)(t):!1}"
1458
- cast-src="${t.src?t.src:t.playbackId?(0,Ga.toMuxVideoURL)(t):!1}"
1459
- cast-receiver="${(oa=t.castReceiver)!=null?oa:!1}"
1460
- drm-token="${(fr=(sa=t.tokens)==null?void 0:sa.drm)!=null?fr:!1}"
1453
+ beacon-collection-domain="${(ta=t.beaconCollectionDomain)!=null?ta:!1}"
1454
+ player-init-time="${(ia=t.playerInitTime)!=null?ia:!1}"
1455
+ player-software-name="${(aa=t.playerSoftwareName)!=null?aa:!1}"
1456
+ player-software-version="${(ra=t.playerSoftwareVersion)!=null?ra:!1}"
1457
+ env-key="${(na=t.envKey)!=null?na:!1}"
1458
+ custom-domain="${(oa=t.customDomain)!=null?oa:!1}"
1459
+ src="${t.src?t.src:t.playbackId?(0,qa.toMuxVideoURL)(t):!1}"
1460
+ cast-src="${t.src?t.src:t.playbackId?(0,qa.toMuxVideoURL)(t):!1}"
1461
+ cast-receiver="${(sa=t.castReceiver)!=null?sa:!1}"
1462
+ drm-token="${(Er=(la=t.tokens)==null?void 0:la.drm)!=null?Er:!1}"
1461
1463
  exportparts="video"
1462
1464
  >
1463
- ${t.storyboard?Ya`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:Ya``}
1465
+ ${t.storyboard?Ga`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:Ga``}
1464
1466
  <slot></slot>
1465
1467
  </mux-video>
1466
1468
  <slot name="poster" slot="poster">
@@ -1468,11 +1470,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1468
1470
  part="poster"
1469
1471
  exportparts="poster, img"
1470
1472
  src="${t.poster?t.poster:!1}"
1471
- placeholdersrc="${(rt=t.placeholder)!=null?rt:!1}"
1473
+ placeholdersrc="${(ot=t.placeholder)!=null?ot:!1}"
1472
1474
  ></media-poster-image>
1473
1475
  </slot>
1474
1476
  </media-theme>
1475
- `};var _=require("@mux/playback-core"),nm=t=>t.charAt(0).toUpperCase()+t.slice(1),Nv=(t,e=!1)=>{var i,a;if(t.muxCode){let r=nm((i=t.errorCategory)!=null?i:"video"),n=(0,_.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:_.MuxErrorCategory.VIDEO);if(t.muxCode===_.MuxErrorCode.NETWORK_OFFLINE)return(0,_.i18n)("Your device appears to be offline",e);if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,_.i18n)("{category} URL has expired",e).format({category:r});if([_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,_.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,_.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,_.i18n)("Invalid {categoryName} URL",e).format({categoryName:n});if(t.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND)return(0,_.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===_.MuxErrorCode.NETWORK_NOT_READY)return(0,_.i18n)("{category} is not currently available",e).format({category:r})}if(t.code){if(t.code===_.MediaError.MEDIA_ERR_NETWORK)return(0,_.i18n)("Network Error",e);if(t.code===_.MediaError.MEDIA_ERR_DECODE)return(0,_.i18n)("Media Error",e);if(t.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,_.i18n)("Source Not Supported",e)}return(0,_.i18n)("Error",e)},Pv=(t,e=!1)=>{var i,a;if(t.muxCode){let r=nm((i=t.errorCategory)!=null?i:"video"),n=(0,_.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:_.MuxErrorCategory.VIDEO);return t.muxCode===_.MuxErrorCode.NETWORK_OFFLINE?(0,_.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,_.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:n}):t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,_.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:n}):t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,_.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,_.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:n}):[_.MuxErrorCode.NETWORK_TOKEN_MISSING,_.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,_.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:n}):t.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND?"":t.muxCode===_.MuxErrorCode.NETWORK_NOT_READY?(0,_.i18n)("The live stream or video file are not yet ready.",e):t.message}return t.code&&(t.code===_.MediaError.MEDIA_ERR_NETWORK||t.code===_.MediaError.MEDIA_ERR_DECODE||t.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},om=(t,e=!1)=>{let i=Nv(t,e),a=Pv(t,e);return{title:i,message:a}},Uv=t=>{if(t.muxCode){if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([_.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,_.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===_.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===_.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===_.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===_.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===_.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===_.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},ml=(t,e)=>{let i=Uv(t);return{message:t.message,context:t.context,file:i}};var sm=`<template id="media-theme-gerwig">
1477
+ `};var b=require("@mux/playback-core"),cm=t=>t.charAt(0).toUpperCase()+t.slice(1),Hv=(t,e=!1)=>{var i,a;if(t.muxCode){let r=cm((i=t.errorCategory)!=null?i:"video"),n=(0,b.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:b.MuxErrorCategory.VIDEO);if(t.muxCode===b.MuxErrorCode.NETWORK_OFFLINE)return(0,b.i18n)("Your device appears to be offline",e);if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,b.i18n)("{category} URL has expired",e).format({category:r});if([b.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,b.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,b.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,b.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,b.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,b.i18n)("Invalid {categoryName} URL",e).format({categoryName:n});if(t.muxCode===b.MuxErrorCode.NETWORK_NOT_FOUND)return(0,b.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===b.MuxErrorCode.NETWORK_NOT_READY)return(0,b.i18n)("{category} is not currently available",e).format({category:r})}if(t.code){if(t.code===b.MediaError.MEDIA_ERR_NETWORK)return(0,b.i18n)("Network Error",e);if(t.code===b.MediaError.MEDIA_ERR_DECODE)return(0,b.i18n)("Media Error",e);if(t.code===b.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,b.i18n)("Source Not Supported",e)}return(0,b.i18n)("Error",e)},$v=(t,e=!1)=>{var i,a;if(t.muxCode){let r=cm((i=t.errorCategory)!=null?i:"video"),n=(0,b.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:b.MuxErrorCategory.VIDEO);return t.muxCode===b.MuxErrorCode.NETWORK_OFFLINE?(0,b.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,b.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:n}):t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,b.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:n}):t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,b.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[b.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,b.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,b.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:n}):[b.MuxErrorCode.NETWORK_TOKEN_MISSING,b.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,b.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:n}):t.muxCode===b.MuxErrorCode.NETWORK_NOT_FOUND?"":t.muxCode===b.MuxErrorCode.NETWORK_NOT_READY?(0,b.i18n)("The live stream or video file are not yet ready.",e):t.message}return t.code&&(t.code===b.MediaError.MEDIA_ERR_NETWORK||t.code===b.MediaError.MEDIA_ERR_DECODE||t.code===b.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},mm=(t,e=!1)=>{let i=Hv(t,e),a=$v(t,e);return{title:i,message:a}},Wv=t=>{if(t.muxCode){if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([b.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,b.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===b.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===b.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===b.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===b.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===b.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===b.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},fl=(t,e)=>{let i=Wv(t);return{message:t.message,context:t.context,file:i}};var hm=`<template id="media-theme-gerwig">
1476
1478
  <style>
1477
1479
  @keyframes pre-play-hide {
1478
1480
  0% {
@@ -1865,6 +1867,10 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1865
1867
  display: none;
1866
1868
  }
1867
1869
 
1870
+ media-error-dialog:not([mediaerrorcode]) {
1871
+ opacity: 0;
1872
+ }
1873
+
1868
1874
  media-loading-indicator {
1869
1875
  --media-loading-icon-width: 100%;
1870
1876
  --media-button-icon-height: auto;
@@ -2585,7 +2591,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2585
2591
  <slot></slot>
2586
2592
  </media-controller>
2587
2593
  </template>
2588
- `;function lm({anchor:t,floating:e,placement:i}){let a=Hv({anchor:t,floating:e}),{x:r,y:n}=Wv(a,i);return{x:r,y:n}}function Hv({anchor:t,floating:e}){return{anchor:$v(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function $v(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 Wv({anchor:t,floating:e},i){let a=Fv(i)==="x"?"y":"x",r=a==="y"?"height":"width",n=dm(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 dm(t){return t.split("-")[0]}function Fv(t){return["top","bottom"].includes(dm(t))?"y":"x"}var Lt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},Gn=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var kl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},B=(t,e,i)=>(kl(t,e,"read from private field"),i?i.call(t):e.get(t)),V=(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)=>(kl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),q=(t,e,i)=>(kl(t,e,"access private method"),i),Je,di,wt,qn,Zn,ui,za,hl,um,Xn,zn,pl,vl,cm,fl,mm,El,hm,Vi,Yi,Gi,Qa,Jn,Sl,bl,pm,Il,vm,gl,fm,Cl,Em,_l,bm,Al,gm,qa,jn,Tl,_m,Za,eo,Qn,yl;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 Am=h.createElement("template");Am.innerHTML=`
2594
+ `;function pm({anchor:t,floating:e,placement:i}){let a=Kv({anchor:t,floating:e}),{x:r,y:n}=Yv(a,i);return{x:r,y:n}}function Kv({anchor:t,floating:e}){return{anchor:Vv(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Vv(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 Yv({anchor:t,floating:e},i){let a=Gv(i)==="x"?"y":"x",r=a==="y"?"height":"width",n=vm(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 vm(t){return t.split("-")[0]}function Gv(t){return["top","bottom"].includes(vm(t))?"y":"x"}var Lt=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)},B=(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)},je=(t,e,i,a)=>(Ml(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),q=(t,e,i)=>(Ml(t,e,"access private method"),i),et,ui,xt,Qn,Xn,ci,Qa,El,fm,eo,Jn,bl,gl,Em,_l,bm,Al,gm,Yi,Gi,qi,Xa,to,Rl,Tl,_m,wl,Am,yl,Tm,Ll,ym,kl,km,Sl,Sm,Za,io,Il,Im,za,ao,jn,Cl;function tt({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 Ue(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 Cm=h.createElement("template");Cm.innerHTML=`
2589
2595
  <style>
2590
2596
  :host {
2591
2597
  font: var(--media-font,
@@ -2752,7 +2758,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2752
2758
  <slot></slot>
2753
2759
  </div>
2754
2760
  <slot name="checked-indicator" hidden></slot>
2755
- `;var li={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},se=class extends d.HTMLElement{constructor(){super(),V(this,hl),V(this,zn),V(this,vl),V(this,fl),V(this,El),V(this,Gi),V(this,Jn),V(this,bl),V(this,Il),V(this,gl),V(this,Cl),V(this,_l),V(this,Al),V(this,qa),V(this,Tl),V(this,Za),V(this,Qn),V(this,Je,null),V(this,di,null),V(this,wt,null),V(this,qn,new Set),V(this,Zn,void 0),V(this,ui,!1),V(this,za,null),V(this,Xn,()=>{let e=B(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)}),V(this,Vi,()=>{q(this,Gi,Qa).call(this),q(this,Jn,Sl).call(this,!1)}),V(this,Yi,()=>{q(this,Gi,Qa).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,Zn,new MutationObserver(B(this,Xn))),B(this,Zn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[li.DISABLED,li.HIDDEN,li.STYLE,li.ANCHOR,S.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":q(this,hl,um).call(this,e);break;case"invoke":q(this,vl,cm).call(this,e);break;case"click":q(this,bl,pm).call(this,e);break;case"toggle":q(this,gl,fm).call(this,e);break;case"focusout":q(this,_l,bm).call(this,e);break;case"keydown":q(this,Al,gm).call(this,e);break}}connectedCallback(){var e,i;Xe(this,za,Uo(this.shadowRoot,":host")),q(this,zn,pl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Xe(this,Je,yr(this)),(i=(e=B(this,Je))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(ot(Xa(this),B(this,Vi)),ot(this,B(this,Yi)))}disconnectedCallback(){var e,i;Ut(Xa(this),B(this,Vi)),Ut(this,B(this,Yi)),this.disable(),(i=(e=B(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?(B(this,ui)||Xe(this,ui,!0),this.hidden?q(this,El,hm).call(this):q(this,fl,mm).call(this),this.dispatchEvent(new Gn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===S.MEDIA_CONTROLLER?(i&&((n=(r=B(this,Je))==null?void 0:r.unassociateElement)==null||n.call(r,this),Xe(this,Je,null)),a&&this.isConnected&&(Xe(this,Je,yr(this)),(l=(s=B(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&&q(this,zn,pl).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=Bt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Kv)}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&&q(this,Qn,yl).call(this,i)}focus(){if(Xe(this,di,ma()),this.items.length){q(this,Za,eo).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=q(this,qa,jn).call(this,e);a&&(q(this,Qn,yl).call(this,a,a.type==="checkbox"),B(this,wt)&&!this.hidden&&((i=B(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=q(this,qa,jn).call(this,e))!=null?i:q(this,Tl,_m).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),q(this,Za,eo).call(this,n[u]),n[u].focus()}};Je=new WeakMap;di=new WeakMap;wt=new WeakMap;qn=new WeakMap;Zn=new WeakMap;ui=new WeakMap;za=new WeakMap;hl=new WeakSet;um=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||B(this,Xn).call(this)};Xn=new WeakMap;zn=new WeakSet;pl=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")};vl=new WeakSet;cm=function(t){Xe(this,wt,t.relatedTarget),ue(this,t.relatedTarget)||(this.hidden=!this.hidden)};fl=new WeakSet;mm=function(){var t;(t=B(this,wt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),ot(Xa(this),B(this,Vi)),ot(this,B(this,Yi))};El=new WeakSet;hm=function(){var t;(t=B(this,wt))==null||t.setAttribute("aria-expanded","false"),Ut(Xa(this),B(this,Vi)),Ut(this,B(this,Yi))};Vi=new WeakMap;Yi=new WeakMap;Gi=new WeakSet;Qa=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=lm({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=Xa(this).getBoundingClientRect(),n=r.width-e-t,s=r.height-i-this.offsetHeight,{style:l}=B(this,za);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),b=l.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),g=r.height-b-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};Jn=new WeakSet;Sl=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=B(this,za);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`),q(this,Gi,Qa).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),q(this,Gi,Qa).call(this);a.removeProperty("--media-menu-transition-in")};bl=new WeakSet;pm=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(B(this,Il,vm))){(e=B(this,di))==null||e.focus(),this.hidden=!0;return}let i=q(this,qa,jn).call(this,t);!i||i.hasAttribute("disabled")||(q(this,Za,eo).call(this,i),this.handleSelect(t))};Il=new WeakSet;vm=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"]'))};gl=new WeakSet;fm=function(t){if(t.target===this)return;q(this,Cl,Em).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 Lt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);q(this,Jn,Sl).call(this,!0)};Cl=new WeakSet;Em=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};_l=new WeakSet;bm=function(t){var e;ue(this,t.relatedTarget)||(B(this,ui)&&((e=B(this,di))==null||e.focus()),B(this,wt)&&B(this,wt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Al=new WeakSet;gm=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(B(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=B(this,di))==null||n.focus(),B(this,ui)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};qa=new WeakSet;jn=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Tl=new WeakSet;_m=function(){return this.items.find(t=>t.tabIndex===0)};Za=new WeakSet;eo=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};Qn=new WeakSet;yl=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}))};se.template=Am;function Kv(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function Xa(t){var e;return(e=t.getAttribute("bounds")?Ue(t,`#${t.getAttribute("bounds")}`):z(t)||t.parentElement)!=null?e:t}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",se);var Dl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},tt=(t,e,i)=>(Dl(t,e,"read from private field"),i?i.call(t):e.get(t)),vt=(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)},Ml=(t,e,i,a)=>(Dl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),et=(t,e,i)=>(Dl(t,e,"access private method"),i),to,ja,Rl,Tm,Ol,ym,Nl,km,it,qi,er,Ll,Sm,io,wl,Im=h.createElement("template");Im.innerHTML=`
2761
+ `;var di={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},se=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,Tl),K(this,wl),K(this,yl),K(this,Ll),K(this,kl),K(this,Sl),K(this,Za),K(this,Il),K(this,za),K(this,jn),K(this,et,null),K(this,ui,null),K(this,xt,null),K(this,Qn,new Set),K(this,Xn,void 0),K(this,ci,!1),K(this,Qa,null),K(this,eo,()=>{let e=B(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}));je(this,Qn,i)}),K(this,Yi,()=>{q(this,qi,Xa).call(this),q(this,to,Rl).call(this,!1)}),K(this,Gi,()=>{q(this,qi,Xa).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),je(this,Xn,new MutationObserver(B(this,eo))),B(this,Xn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[di.DISABLED,di.HIDDEN,di.STYLE,di.ANCHOR,S.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":q(this,El,fm).call(this,e);break;case"invoke":q(this,gl,Em).call(this,e);break;case"click":q(this,Tl,_m).call(this,e);break;case"toggle":q(this,yl,Tm).call(this,e);break;case"focusout":q(this,kl,km).call(this,e);break;case"keydown":q(this,Sl,Sm).call(this,e);break}}connectedCallback(){var e,i;je(this,Qa,$o(this.shadowRoot,":host")),q(this,Jn,bl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),je(this,et,kr(this)),(i=(e=B(this,et))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(lt(Ja(this),B(this,Yi)),lt(this,B(this,Gi)))}disconnectedCallback(){var e,i;dt(Ja(this),B(this,Yi)),dt(this,B(this,Gi)),this.disable(),(i=(e=B(this,et))==null?void 0:e.unassociateElement)==null||i.call(e,this),je(this,et,null)}attributeChangedCallback(e,i,a){var r,n,s,l;e===di.HIDDEN&&a!==i?(B(this,ci)||je(this,ci,!0),this.hidden?q(this,Al,gm).call(this):q(this,_l,bm).call(this),this.dispatchEvent(new zn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===S.MEDIA_CONTROLLER?(i&&((n=(r=B(this,et))==null?void 0:r.unassociateElement)==null||n.call(r,this),je(this,et,null)),a&&this.isConnected&&(je(this,et,kr(this)),(l=(s=B(this,et))==null?void 0:s.associateElement)==null||l.call(s,this))):e===di.DISABLED&&a!==i?a==null?this.enable():this.disable():e===di.STYLE&&a!==i&&q(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=Bt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(qv)}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&&q(this,jn,Cl).call(this,i)}focus(){if(je(this,ui,ha()),this.items.length){q(this,za,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=q(this,Za,io).call(this,e);a&&(q(this,jn,Cl).call(this,a,a.type==="checkbox"),B(this,xt)&&!this.hidden&&((i=B(this,ui))==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=q(this,Za,io).call(this,e))!=null?i:q(this,Il,Im).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),q(this,za,ao).call(this,n[u]),n[u].focus()}};et=new WeakMap;ui=new WeakMap;xt=new WeakMap;Qn=new WeakMap;Xn=new WeakMap;ci=new WeakMap;Qa=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||B(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;Em=function(t){je(this,xt,t.relatedTarget),ue(this,t.relatedTarget)||(this.hidden=!this.hidden)};_l=new WeakSet;bm=function(){var t;(t=B(this,xt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),lt(Ja(this),B(this,Yi)),lt(this,B(this,Gi))};Al=new WeakSet;gm=function(){var t;(t=B(this,xt))==null||t.setAttribute("aria-expanded","false"),dt(Ja(this),B(this,Yi)),dt(this,B(this,Gi))};Yi=new WeakMap;Gi=new WeakMap;qi=new WeakSet;Xa=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=pm({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}=B(this,Qa);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),_=l.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),g=r.height-_-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};to=new WeakSet;Rl=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=B(this,Qa);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`),q(this,qi,Xa).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),q(this,qi,Xa).call(this);a.removeProperty("--media-menu-transition-in")};Tl=new WeakSet;_m=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(B(this,wl,Am))){(e=B(this,ui))==null||e.focus(),this.hidden=!0;return}let i=q(this,Za,io).call(this,t);!i||i.hasAttribute("disabled")||(q(this,za,ao).call(this,i),this.handleSelect(t))};wl=new WeakSet;Am=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"]'))};yl=new WeakSet;Tm=function(t){if(t.target===this)return;q(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 Lt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);q(this,to,Rl).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;km=function(t){var e;ue(this,t.relatedTarget)||(B(this,ci)&&((e=B(this,ui))==null||e.focus()),B(this,xt)&&B(this,xt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Sl=new WeakSet;Sm=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(B(this,ci)){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=B(this,ui))==null||n.focus(),B(this,ci)&&(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;Im=function(){return this.items.find(t=>t.tabIndex===0)};za=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}))};se.template=Cm;function qv(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function Ja(t){var e;return(e=t.getAttribute("bounds")?He(t,`#${t.getAttribute("bounds")}`):z(t)||t.parentElement)!=null?e:t}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",se);var Ul=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},at=(t,e,i)=>(Ul(t,e,"read from private field"),i?i.call(t):e.get(t)),Et=(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),it=(t,e,i)=>(Ul(t,e,"access private method"),i),ro,er,Dl,Mm,Bl,Rm,Hl,wm,rt,Zi,tr,Ol,Lm,no,Nl,xm=h.createElement("template");xm.innerHTML=`
2756
2762
  <style>
2757
2763
  :host {
2758
2764
  transition: var(--media-menu-item-transition,
@@ -2868,7 +2874,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2868
2874
  <slot name="description"></slot>
2869
2875
  <slot name="suffix"></slot>
2870
2876
  <slot name="submenu"></slot>
2871
- `;var Ie={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},xt=class extends d.HTMLElement{constructor(){super(),vt(this,Rl),vt(this,Ol),vt(this,Nl),vt(this,qi),vt(this,Ll),vt(this,io),vt(this,to,!1),vt(this,ja,void 0),vt(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[Ie.TYPE,Ie.DISABLED,Ie.CHECKED,Ie.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Ja(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,Rl,Tm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":et(this,Ll,Sm).call(this,e);break;case"keyup":et(this,qi,er).call(this,e);break}}attributeChangedCallback(e,i,a){e===Ie.CHECKED&&Ja(this)&&!tt(this,to)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Ie.TYPE&&a!==i?this.role="menuitem"+a:e===Ie.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Ie.DISABLED)||this.enable(),this.role="menuitem"+this.type,Ml(this,ja,xl(this,this.parentNode)),et(this,io,wl).call(this)}disconnectedCallback(){this.disable(),et(this,io,wl).call(this),Ml(this,ja,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Bt(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(Ie.TYPE))!=null?e:""}set type(e){this.setAttribute(Ie.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Ie.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Ie.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Ja(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Ja(this)&&(Ml(this,to,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Ja(this)||this.invokeTargetElement&&ue(this,e.target)&&this.invokeTargetElement.dispatchEvent(new Lt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};to=new WeakMap;ja=new WeakMap;Rl=new WeakSet;Tm=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,Ol,ym).call(this):et(this,Nl,km).call(this))};Ol=new WeakSet;ym=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)};Nl=new WeakSet;km=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;qi=new WeakSet;er=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",et(this,qi,er));return}this.handleClick(t)};Ll=new WeakSet;Sm=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",et(this,qi,er));return}this.addEventListener("keyup",et(this,qi,er),{once:!0})};io=new WeakSet;wl=function(){var t;let e=(t=tt(this,ja))==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")};xt.template=Im;function Ja(t){return t.type==="radio"||t.type==="checkbox"}function xl(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?xl(t,i):e!=null&&e.items?e:xl(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",xt);var Cm=h.createElement("template");Cm.innerHTML=se.template.innerHTML+`
2877
+ `;var Re={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Dt=class extends d.HTMLElement{constructor(){super(),Et(this,Dl),Et(this,Bl),Et(this,Hl),Et(this,Zi),Et(this,Ol),Et(this,no),Et(this,ro,!1),Et(this,er,void 0),Et(this,rt,()=>{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[Re.TYPE,Re.DISABLED,Re.CHECKED,Re.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),ja(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":it(this,Dl,Mm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":it(this,Ol,Lm).call(this,e);break;case"keyup":it(this,Zi,tr).call(this,e);break}}attributeChangedCallback(e,i,a){e===Re.CHECKED&&ja(this)&&!at(this,ro)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Re.TYPE&&a!==i?this.role="menuitem"+a:e===Re.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Re.DISABLED)||this.enable(),this.role="menuitem"+this.type,xl(this,er,Pl(this,this.parentNode)),it(this,no,Nl).call(this)}disconnectedCallback(){this.disable(),it(this,no,Nl).call(this),xl(this,er,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Bt(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(Re.TYPE))!=null?e:""}set type(e){this.setAttribute(Re.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Re.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Re.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(ja(this))return this.getAttribute("aria-checked")==="true"}set checked(e){ja(this)&&(xl(this,ro,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){ja(this)||this.invokeTargetElement&&ue(this,e.target)&&this.invokeTargetElement.dispatchEvent(new Lt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};ro=new WeakMap;er=new WeakMap;Dl=new WeakSet;Mm=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?it(this,Bl,Rm).call(this):it(this,Hl,wm).call(this))};Bl=new WeakSet;Rm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",at(this,rt)),this.submenuElement.addEventListener("addmenuitem",at(this,rt)),this.submenuElement.addEventListener("removemenuitem",at(this,rt)),at(this,rt).call(this)};Hl=new WeakSet;wm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",at(this,rt)),this.submenuElement.removeEventListener("addmenuitem",at(this,rt)),this.submenuElement.removeEventListener("removemenuitem",at(this,rt)),at(this,rt).call(this)};rt=new WeakMap;Zi=new WeakSet;tr=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",it(this,Zi,tr));return}this.handleClick(t)};Ol=new WeakSet;Lm=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",it(this,Zi,tr));return}this.addEventListener("keyup",it(this,Zi,tr),{once:!0})};no=new WeakSet;Nl=function(){var t;let e=(t=at(this,er))==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")};Dt.template=xm;function ja(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",Dt);var Dm=h.createElement("template");Dm.innerHTML=se.template.innerHTML+`
2872
2878
  <style>
2873
2879
  :host {
2874
2880
  background: var(--media-settings-menu-background,
@@ -2895,7 +2901,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2895
2901
  --media-settings-menu-item-opacity: 0;
2896
2902
  }
2897
2903
  </style>
2898
- `;var tr=class extends se{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(this).querySelector("media-settings-menu-button")}};tr.template=Cm;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",tr);var Mm,ao=h.createElement("template");ao.innerHTML=xt.template.innerHTML+`
2904
+ `;var ir=class extends se{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(this).querySelector("media-settings-menu-button")}};ir.template=Dm;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",ir);var Om,oo=h.createElement("template");oo.innerHTML=Dt.template.innerHTML+`
2899
2905
  <style>
2900
2906
  slot:not([name="submenu"]) {
2901
2907
  opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
@@ -2905,11 +2911,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2905
2911
  background: transparent;
2906
2912
  }
2907
2913
  </style>
2908
- `;(Mm=ao.content)!=null&&Mm.querySelector&&(ao.content.querySelector('slot[name="suffix"]').innerHTML=`
2914
+ `;(Om=oo.content)!=null&&Om.querySelector&&(oo.content.querySelector('slot[name="suffix"]').innerHTML=`
2909
2915
  <svg aria-hidden="true" viewBox="0 0 20 24">
2910
2916
  <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"/>
2911
2917
  </svg>
2912
- `);var ir=class extends xt{};ir.template=ao;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",ir);var Se=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=Bt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new Lt({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",Se);var Rm=h.createElement("template");Rm.innerHTML=`
2918
+ `);var ar=class extends Dt{};ar.template=oo;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",ar);var Ce=class extends F{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=Bt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new Lt({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",Ce);var Nm=h.createElement("template");Nm.innerHTML=`
2913
2919
  <style>
2914
2920
  :host([aria-expanded="true"]) slot[name=tooltip] {
2915
2921
  display: none;
@@ -2920,25 +2926,25 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2920
2926
  <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"/>
2921
2927
  </svg>
2922
2928
  </slot>
2923
- `;var ro=class extends Se{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:Rm,tooltipContent:C.SETTINGS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",Y.SETTINGS())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:z(this).querySelector("media-settings-menu")}};d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",ro);var Hl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Lm=(t,e,i)=>(Hl(t,e,"read from private field"),i?i.call(t):e.get(t)),no=(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)},Pl=(t,e,i,a)=>(Hl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),oo=(t,e,i)=>(Hl(t,e,"access private method"),i),ar,uo,so,Ul,lo,Bl,co=class extends se{constructor(){super(...arguments),no(this,so),no(this,lo),no(this,ar,[]),no(this,uo,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&&(Pl(this,ar,Nd(a!=null?a:"")),oo(this,so,Ul).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",oo(this,lo,Bl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",oo(this,lo,Bl))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=z(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Lm(this,ar)}set mediaAudioTrackList(e){Pl(this,ar,e),oo(this,so,Ul).call(this)}get mediaAudioTrackEnabled(){var e;return(e=R(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){I(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};ar=new WeakMap;uo=new WeakMap;so=new WeakSet;Ul=function(){if(Lm(this,uo)===JSON.stringify(this.mediaAudioTrackList))return;Pl(this,uo,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)}};lo=new WeakSet;Bl=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",co);var Vv=`<svg aria-hidden="true" viewBox="0 0 24 24">
2929
+ `;var so=class extends Ce{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:Nm,tooltipContent:C.SETTINGS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.SETTINGS())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:z(this).querySelector("media-settings-menu")}};d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",so);var Kl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Pm=(t,e,i)=>(Kl(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)=>(Kl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),uo=(t,e,i)=>(Kl(t,e,"access private method"),i),rr,ho,co,Wl,mo,Fl,po=class extends se{constructor(){super(...arguments),lo(this,co),lo(this,mo),lo(this,rr,[]),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,rr,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=z(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Pm(this,rr)}set mediaAudioTrackList(e){$l(this,rr,e),uo(this,co,Wl).call(this)}get mediaAudioTrackEnabled(){var e;return(e=R(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){I(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};rr=new WeakMap;ho=new WeakMap;co=new WeakSet;Wl=function(){if(Pm(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=tt({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(Ue(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 Zv=`<svg aria-hidden="true" viewBox="0 0 24 24">
2924
2930
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
2925
2931
  <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"/>
2926
- </svg>`,wm=h.createElement("template");wm.innerHTML=`
2932
+ </svg>`,Um=h.createElement("template");Um.innerHTML=`
2927
2933
  <style>
2928
2934
  :host([aria-expanded="true"]) slot[name=tooltip] {
2929
2935
  display: none;
2930
2936
  }
2931
2937
  </style>
2932
- <slot name="icon">${Vv}</slot>
2933
- `;var mo=class extends Se{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:wm,tooltipContent:C.AUDIO_TRACK_MENU})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",Y.AUDIO_TRACKS())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=z(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=R(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){I(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",mo);var Vl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yv=(t,e,i)=>(Vl(t,e,"read from private field"),i?i.call(t):e.get(t)),$l=(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)},Gv=(t,e,i,a)=>(Vl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Wl=(t,e,i)=>(Vl(t,e,"access private method"),i),po,Fl,Om,ho,Kl,qv=`
2938
+ <slot name="icon">${Zv}</slot>
2939
+ `;var vo=class extends Ce{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Um,tooltipContent:C.AUDIO_TRACK_MENU})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.AUDIO_TRACKS())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=z(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=R(this,o.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){I(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",vo);var Zl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},zv=(t,e,i)=>(Zl(t,e,"read from private field"),i?i.call(t):e.get(t)),Vl=(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)},Qv=(t,e,i,a)=>(Zl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Yl=(t,e,i)=>(Zl(t,e,"access private method"),i),Eo,Gl,$m,fo,ql,Xv=`
2934
2940
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
2935
2941
  <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"/>
2936
- </svg>`,Nm=h.createElement("template");Nm.innerHTML=se.template.innerHTML+`
2937
- <slot name="captions-indicator" hidden>${qv}</slot>`;var rr=class extends se{constructor(){super(...arguments),$l(this,Fl),$l(this,ho),$l(this,po,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?Wl(this,Fl,Om).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Wl(this,ho,Kl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Wl(this,ho,Kl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return xm(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Dm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return xm(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Dm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};po=new WeakMap;Fl=new WeakSet;Om=function(){var t;if(Yv(this,po)===JSON.stringify(this.mediaSubtitlesList))return;Gv(this,po,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:Dr(r),checked:this.value==Dr(r)});n.prepend(Ne(this,"checked-indicator")),((t=r.kind)!=null?t:"subs")==="captions"&&n.append(Ne(this,"captions-indicator")),this.defaultSlot.append(n)}};ho=new WeakSet;Kl=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)};rr.template=Nm;var xm=(t,e)=>{let i=t.getAttribute(e);return i?$t(i):[]},Dm=(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",rr);var Zv=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},zv=(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)},Qv=(t,e,i,a)=>(Zv(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Yl,Xv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2942
+ </svg>`,Wm=h.createElement("template");Wm.innerHTML=se.template.innerHTML+`
2943
+ <slot name="captions-indicator" hidden>${Xv}</slot>`;var nr=class extends se{constructor(){super(...arguments),Vl(this,Gl),Vl(this,fo),Vl(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?Yl(this,Gl,$m).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Yl(this,fo,ql))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Yl(this,fo,ql))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Bm(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Hm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Bm(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Hm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Eo=new WeakMap;Gl=new WeakSet;$m=function(){var t;if(zv(this,Eo)===JSON.stringify(this.mediaSubtitlesList))return;Qv(this,Eo,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,i=tt({type:"radio",text:this.formatMenuItemText("Off"),value:"off",checked:e});i.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(i);let a=this.mediaSubtitlesList;for(let r of a){let n=tt({type:"radio",text:this.formatMenuItemText(r.label,r),value:Pr(r),checked:this.value==Pr(r)});n.prepend(Ue(this,"checked-indicator")),((t=r.kind)!=null?t:"subs")==="captions"&&n.append(Ue(this,"captions-indicator")),this.defaultSlot.append(n)}};fo=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)};nr.template=Wm;var Bm=(t,e)=>{let i=t.getAttribute(e);return i?Wt(i):[]},Hm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=ct(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",nr);var Jv=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},jv=(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)},ef=(t,e,i,a)=>(Jv(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),zl,tf=`<svg aria-hidden="true" viewBox="0 0 26 24">
2938
2944
  <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"/>
2939
- </svg>`,Jv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2945
+ </svg>`,af=`<svg aria-hidden="true" viewBox="0 0 26 24">
2940
2946
  <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"/>
2941
- </svg>`,Hm=h.createElement("template");Hm.innerHTML=`
2947
+ </svg>`,Ym=h.createElement("template");Ym.innerHTML=`
2942
2948
  <style>
2943
2949
  :host([aria-checked="true"]) slot[name=off] {
2944
2950
  display: none !important;
@@ -2955,10 +2961,10 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2955
2961
  </style>
2956
2962
 
2957
2963
  <slot name="icon">
2958
- <slot name="on">${Xv}</slot>
2959
- <slot name="off">${Jv}</slot>
2964
+ <slot name="on">${tf}</slot>
2965
+ <slot name="off">${af}</slot>
2960
2966
  </slot>
2961
- `;var Pm=t=>{t.setAttribute("aria-checked",Or(t).toString())},vo=class extends Se{constructor(e={}){super({slotTemplate:Hm,tooltipContent:C.CAPTIONS,...e}),zv(this,Yl,void 0),Qv(this,Yl,!1)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",Y.CLOSED_CAPTIONS()),Pm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&Pm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=z(this))==null?void 0:e.querySelector("media-captions-menu")}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)}};Yl=new WeakMap;var Um=(t,e)=>{let i=t.getAttribute(e);return i?$t(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-button")||d.customElements.define("media-captions-menu-button",vo);var $m=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},fo=(t,e,i)=>($m(t,e,"read from private field"),i?i.call(t):e.get(t)),Gl=(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)},nr=(t,e,i)=>($m(t,e,"access private method"),i),Zi,or,Eo,bo,Zl,ql={RATES:"rates"},go=class extends se{constructor(){super(),Gl(this,or),Gl(this,bo),Gl(this,Zi,new Be(this,ql.RATES,{defaultValue:Ls})),nr(this,or,Eo).call(this)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,ql.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PLAYBACK_RATE&&i!=a?this.value=a:e===ql.RATES&&i!=a&&(fo(this,Zi).value=a,nr(this,or,Eo).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",nr(this,bo,Zl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",nr(this,bo,Zl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(this).querySelector("media-playback-rate-menu-button")}get rates(){return fo(this,Zi)}set rates(e){e?Array.isArray(e)&&(fo(this,Zi).value=e.join(" ")):fo(this,Zi).value="",nr(this,or,Eo).call(this)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,Ri)}set mediaPlaybackRate(e){D(this,o.MEDIA_PLAYBACK_RATE,e)}};Zi=new WeakMap;or=new WeakSet;Eo=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)}};bo=new WeakSet;Zl=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",go);var jv=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_o=(t,e,i)=>(jv(t,e,"read from private field"),i?i.call(t):e.get(t)),ef=(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)},zi,zl={RATES:"rates"},tf=[1,1.2,1.5,1.7,2],Ql=1,Wm=h.createElement("template");Wm.innerHTML=`
2967
+ `;var Fm=t=>{t.setAttribute("aria-checked",Ur(t).toString())},bo=class extends Ce{constructor(e={}){super({slotTemplate:Ym,tooltipContent:C.CAPTIONS,...e}),jv(this,zl,void 0),ef(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()),Fm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_SUBTITLES_SHOWING&&Fm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=z(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Km(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Vm(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Km(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Vm(this,o.MEDIA_SUBTITLES_SHOWING,e)}};zl=new WeakMap;var Km=(t,e)=>{let i=t.getAttribute(e);return i?Wt(i):[]},Vm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=ct(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)},or=(t,e,i)=>(Gm(t,e,"access private method"),i),zi,sr,_o,Ao,Jl,Xl={RATES:"rates"},To=class extends se{constructor(){super(),Ql(this,sr),Ql(this,Ao),Ql(this,zi,new $e(this,Xl.RATES,{defaultValue:Os})),or(this,sr,_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,or(this,sr,_o).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",or(this,Ao,Jl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",or(this,Ao,Jl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(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="",or(this,sr,_o).call(this)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,wi)}set mediaPlaybackRate(e){D(this,o.MEDIA_PLAYBACK_RATE,e)}};zi=new WeakMap;sr=new WeakSet;_o=function(){this.defaultSlot.textContent="";for(let t of this.rates){let e=tt({type:"radio",text:this.formatMenuItemText(`${t}x`,t),value:t,checked:this.mediaPlaybackRate==t});e.prepend(Ue(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",To);var rf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},yo=(t,e,i)=>(rf(t,e,"read from private field"),i?i.call(t):e.get(t)),nf=(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"},of=[1,1.2,1.5,1.7,2],ed=1,qm=h.createElement("template");qm.innerHTML=`
2962
2968
  <style>
2963
2969
  :host {
2964
2970
  min-width: 5ch;
@@ -2970,16 +2976,16 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2970
2976
  }
2971
2977
  </style>
2972
2978
  <slot name="icon"></slot>
2973
- `;var Ao=class extends Se{constructor(e={}){super({slotTemplate:Wm,tooltipContent:C.PLAYBACK_RATE,...e}),ef(this,zi,new Be(this,zl.RATES,{defaultValue:tf})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Ql}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,zl.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===zl.RATES&&(_o(this,zi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Ql:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",Y.PLAYBACK_RATE({playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:z(this).querySelector("media-playback-rate-menu")}get rates(){return _o(this,zi)}set rates(e){e?Array.isArray(e)&&(_o(this,zi).value=e.join(" ")):_o(this,zi).value=""}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,Ql)}set mediaPlaybackRate(e){D(this,o.MEDIA_PLAYBACK_RATE,e)}};zi=new WeakMap;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",Ao);var Jl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},lr=(t,e,i)=>(Jl(t,e,"read from private field"),i?i.call(t):e.get(t)),To=(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)},Fm=(t,e,i,a)=>(Jl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),sr=(t,e,i)=>(Jl(t,e,"access private method"),i),dr,Qi,ur,yo,ko,Xl,So=class extends se{constructor(){super(...arguments),To(this,ur),To(this,ko),To(this,dr,[]),To(this,Qi,{})}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":e===o.MEDIA_RENDITION_LIST&&i!==a?(Fm(this,dr,Dd(a)),sr(this,ur,yo).call(this)):e===o.MEDIA_HEIGHT&&i!==a&&sr(this,ur,yo).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",sr(this,ko,Xl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",sr(this,ko,Xl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return lr(this,dr)}set mediaRenditionList(e){Fm(this,dr,e),sr(this,ur,yo).call(this)}get mediaRenditionSelected(){return R(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){I(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return M(this,o.MEDIA_HEIGHT)}set mediaHeight(e){D(this,o.MEDIA_HEIGHT,e)}};dr=new WeakMap;Qi=new WeakMap;ur=new WeakSet;yo=function(){if(lr(this,Qi).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&lr(this,Qi).mediaHeight===this.mediaHeight)return;lr(this,Qi).mediaRenditionList=JSON.stringify(this.mediaRenditionList),lr(this,Qi).mediaHeight=this.mediaHeight;let t=this.mediaRenditionList.sort((r,n)=>n.height-r.height);for(let r of t)r.selected=r.id===this.mediaRenditionSelected;this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let r of t){let n=this.formatMenuItemText(`${Math.min(r.width,r.height)}p`,r),s=je({type:"radio",text:n,value:`${r.id}`,checked:r.selected&&!e});s.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(s)}let i=je({type:"radio",text:this.formatMenuItemText("Auto"),value:"auto",checked:e}),a=this.mediaHeight>0?`Auto (${this.mediaHeight}p)`:"Auto";i.dataset.description=a,i.prepend(Ne(this,"checked-indicator")),this.defaultSlot.append(i)};ko=new WeakSet;Xl=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",So);var af=`<svg aria-hidden="true" viewBox="0 0 24 24">
2979
+ `;var ko=class extends Ce{constructor(e={}){super({slotTemplate:qm,tooltipContent:C.PLAYBACK_RATE,...e}),nf(this,Qi,new $e(this,jl.RATES,{defaultValue:of})),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&&(yo(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",V.PLAYBACK_RATE({playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:z(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 M(this,o.MEDIA_PLAYBACK_RATE,ed)}set mediaPlaybackRate(e){D(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)},Zm=(t,e,i,a)=>(id(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),lr=(t,e,i)=>(id(t,e,"access private method"),i),ur,Xi,cr,Io,Co,td,Mo=class extends se{constructor(){super(...arguments),So(this,cr),So(this,Co),So(this,ur,[]),So(this,Xi,{})}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":e===o.MEDIA_RENDITION_LIST&&i!==a?(Zm(this,ur,Ud(a)),lr(this,cr,Io).call(this)):e===o.MEDIA_HEIGHT&&i!==a&&lr(this,cr,Io).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",lr(this,Co,td))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",lr(this,Co,td))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:z(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return dr(this,ur)}set mediaRenditionList(e){Zm(this,ur,e),lr(this,cr,Io).call(this)}get mediaRenditionSelected(){return R(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){I(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return M(this,o.MEDIA_HEIGHT)}set mediaHeight(e){D(this,o.MEDIA_HEIGHT,e)}};ur=new WeakMap;Xi=new WeakMap;cr=new WeakSet;Io=function(){if(dr(this,Xi).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&dr(this,Xi).mediaHeight===this.mediaHeight)return;dr(this,Xi).mediaRenditionList=JSON.stringify(this.mediaRenditionList),dr(this,Xi).mediaHeight=this.mediaHeight;let t=this.mediaRenditionList.sort((r,n)=>n.height-r.height);for(let r of t)r.selected=r.id===this.mediaRenditionSelected;this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let r of t){let n=this.formatMenuItemText(`${Math.min(r.width,r.height)}p`,r),s=tt({type:"radio",text:n,value:`${r.id}`,checked:r.selected&&!e});s.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(s)}let i=tt({type:"radio",text:this.formatMenuItemText("Auto"),value:"auto",checked:e}),a=this.mediaHeight>0?`Auto (${this.mediaHeight}p)`:"Auto";i.dataset.description=a,i.prepend(Ue(this,"checked-indicator")),this.defaultSlot.append(i)};Co=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",Mo);var sf=`<svg aria-hidden="true" viewBox="0 0 24 24">
2974
2980
  <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" />
2975
- </svg>`,Km=h.createElement("template");Km.innerHTML=`
2981
+ </svg>`,zm=h.createElement("template");zm.innerHTML=`
2976
2982
  <style>
2977
2983
  :host([aria-expanded="true"]) slot[name=tooltip] {
2978
2984
  display: none;
2979
2985
  }
2980
2986
  </style>
2981
- <slot name="icon">${af}</slot>
2982
- `;var Io=class extends Se{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}constructor(){super({slotTemplate:Km,tooltipContent:C.RENDITIONS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",Y.QUALITY())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:z(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return R(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){I(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return M(this,o.MEDIA_HEIGHT)}set mediaHeight(e){D(this,o.MEDIA_HEIGHT,e)}};d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",Io);var jl=vi.createElement("template");"innerHTML"in jl&&(jl.innerHTML=sm);var Vm,Ym,Co=class extends si{};Co.template=(Ym=(Vm=jl.content)==null?void 0:Vm.children)==null?void 0:Ym[0];ve.customElements.get("media-theme-gerwig")||ve.customElements.define("media-theme-gerwig",Co);var rf="gerwig";var ft={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"},ed=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref","proudlydisplaymuxbadge"];function nf(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:sf(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(E.Attributes.TARGET_LIVE_WINDOW),streamType:Ua(t.getAttribute(E.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:lf(t),playbackRates:t.getAttribute(m.PLAYBACK_RATES),customDomain:(a=t.getAttribute(E.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 of=un.formatErrorMessage;un.formatErrorMessage=t=>{var e,i;if(t instanceof E.MediaError){let a=om(t,!1);return`
2987
+ <slot name="icon">${sf}</slot>
2988
+ `;var Ro=class extends Ce{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}constructor(){super({slotTemplate:zm,tooltipContent:C.RENDITIONS})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",V.QUALITY())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:z(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return R(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){I(this,o.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return M(this,o.MEDIA_HEIGHT)}set mediaHeight(e){D(this,o.MEDIA_HEIGHT,e)}};d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",Ro);var ad=fi.createElement("template");"innerHTML"in ad&&(ad.innerHTML=hm);var Qm,Xm,wo=class extends li{};wo.template=(Xm=(Qm=ad.content)==null?void 0:Qm.children)==null?void 0:Xm[0];ve.customElements.get("media-theme-gerwig")||ve.customElements.define("media-theme-gerwig",wo);var lf="gerwig";var bt={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 df(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:cf(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(E.Attributes.TARGET_LIVE_WINDOW),streamType:Ba(t.getAttribute(E.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:mf(t),playbackRates:t.getAttribute(m.PLAYBACK_RATES),customDomain:(a=t.getAttribute(E.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 uf=hn.formatErrorMessage;hn.formatErrorMessage=t=>{var e,i;if(t instanceof E.MediaError){let a=mm(t,!1);return`
2983
2989
  ${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
2984
2990
  ${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
2985
2991
  ${a==null?void 0:a.message}
@@ -2991,5 +2997,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2991
2997
  >${(i=a.linkText)!=null?i:a.linkUrl}</a
2992
2998
  >`:""}
2993
2999
  </p>`:""}
2994
- `}return of(t)};function sf(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=ve.customElements.get(e);if(n!=null&&n.template)return n.template}}function lf(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 Gm(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 df=Object.values(E.Attributes),uf=Object.values(ft),cf=Object.values(m),td=Pn(),id="mux-player",qm={isDialogOpen:!1},mf={redundant_streams:!0},mr,hr,pr,Nt,vr,mi,$,Dt,Zm,ad,ci,zm,Qm,Xm,Jm,cr=class extends tl{constructor(){super();pe(this,$);pe(this,mr);pe(this,hr,!1);pe(this,pr,{});pe(this,Nt,!0);pe(this,vr,new Nn(this,"hotkeys"));pe(this,mi,{...qm,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&J(this,$,ad).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var n;if(((n=i.composedPath()[0])==null?void 0:n.localName)!=="media-error-dialog")return;Js(this,vi.activeElement)||i.preventDefault()}});Te(this,mr,(0,y.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),J(this,$,Zm).call(this),this.isConnected&&J(this,$,Dt).call(this)}static get NAME(){return id}static get VERSION(){return td}static get observedAttributes(){var i;return[...(i=tl.observedAttributes)!=null?i:[],...uf,...df,...cf]}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=Gm(this))}attributeChangedCallback(i,a,r){switch(J(this,$,Dt).call(this),super.attributeChangedCallback(i,a,r),i){case m.HOTKEYS:P(this,vr).value=r;break;case m.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ze((0,y.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time."));break}case m.THUMBNAIL_TOKEN:{if(r){let s=(0,y.parseJwt)(r);if(s){let{aud:l}=s,u=y.MuxJWTAud.THUMBNAIL;l!==u&&ze((0,y.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,y.parseJwt)(r);if(s){let{aud:l}=s,u=y.MuxJWTAud.STORYBOARD;l!==u&&ze((0,y.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,y.parseJwt)(r);if(s){let{aud:l}=s,u=y.MuxJWTAud.DRM;l!==u&&ze((0,y.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case E.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&be((0,y.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case E.Attributes.STREAM_TYPE:r&&![y.StreamTypes.LIVE,y.StreamTypes.ON_DEMAND,y.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:js({file:"invalid-stream-type.md",message:(0,y.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===y.StreamTypes.LIVE?this.getAttribute(m.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[E.Attributes.PLAYBACK_ID,ft.SRC,m.PLAYBACK_TOKEN].includes(i)&&a!==r&&Te(this,mi,{...P(this,mi),...qm}),J(this,$,ci).call(this,{[Pc(i)]:r})}get preferCmcd(){var i;return(i=this.getAttribute(E.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?y.CmcdTypeValues.includes(i)?this.setAttribute(E.Attributes.PREFER_CMCD,i):ze(`Invalid value for preferCmcd. Must be one of ${y.CmcdTypeValues.join()}`):this.removeAttribute(E.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:rf}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(ed.includes(r))continue;let n=i.getAttribute(r);a[On(r)]=n===""?!0:n}return a}set themeProps(i){var r,n;J(this,$,Dt).call(this);let a={...this.themeProps,...i};for(let s in a){if(ed.includes(s))continue;let l=i==null?void 0:i[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Dn(s),!!l):(n=this.mediaTheme)==null||n.setAttribute(Dn(s),l)}}get playbackId(){var i;return(i=this.getAttribute(E.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(E.Attributes.PLAYBACK_ID,i):this.removeAttribute(E.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Ot(this,ft.SRC))!=null?i:void 0:(a=this.getAttribute(ft.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(ft.SRC,i):this.removeAttribute(ft.SRC)}get poster(){var r;let i=this.getAttribute(ft.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 Oc(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(ft.POSTER,i):this.removeAttribute(ft.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||[y.StreamTypes.LIVE,y.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return Nc(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 P(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 ce(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=Ot(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=ve.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=ve.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=ve.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=ce(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=ce(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 ce(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(E.Attributes.PLAYER_INIT_TIME)?ce(this.getAttribute(E.Attributes.PLAYER_INIT_TIME)):P(this,mr)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(E.Attributes.PLAYER_INIT_TIME):this.setAttribute(E.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:id}get playerSoftwareVersion(){var i;return(i=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:td}get beaconCollectionDomain(){var i;return(i=this.getAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(E.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(E.Attributes.MAX_RESOLUTION,i):this.removeAttribute(E.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(E.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(E.Attributes.MIN_RESOLUTION,i):this.removeAttribute(E.Attributes.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(E.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(E.Attributes.RENDITION_ORDER,i):this.removeAttribute(E.Attributes.RENDITION_ORDER))}get programStartTime(){return ce(this.getAttribute(E.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(E.Attributes.PROGRAM_START_TIME):this.setAttribute(E.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ce(this.getAttribute(E.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(E.Attributes.PROGRAM_END_TIME):this.setAttribute(E.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ce(this.getAttribute(E.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(E.Attributes.ASSET_START_TIME):this.setAttribute(E.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ce(this.getAttribute(E.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(E.Attributes.ASSET_END_TIME):this.setAttribute(E.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),{}):mf}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(E.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(E.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(E.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Ot(this,E.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(E.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 Ot(this,E.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(E.Attributes.DEBUG,""):this.removeAttribute(E.Attributes.DEBUG)}get disableTracking(){return Ot(this,E.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(E.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Ot(this,E.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(E.Attributes.DISABLE_COOKIES,""):this.removeAttribute(E.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(E.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:y.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(E.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:y.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 ce(Ot(this,E.Attributes.START_TIME))}set startTime(i){this.setAttribute(E.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(E.Attributes.PREFER_PLAYBACK);if(i===y.PlaybackTypes.MSE||i===y.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===y.PlaybackTypes.MSE||i===y.PlaybackTypes.NATIVE?this.setAttribute(E.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(E.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(J(this,$,Dt).call(this),!this.media){be("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Gm(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(J(this,$,Dt).call(this),!this.media){be("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(J(this,$,Dt).call(this),!this.media){be("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(J(this,$,Dt).call(this),!this.media){be("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{...P(this,pr),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...n!=null?{storyboard:n}:{}}}set tokens(i){Te(this,pr,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,y.addTextTrack)(s,i,a,r,n)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,y.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){be("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)}};mr=new WeakMap,hr=new WeakMap,pr=new WeakMap,Nt=new WeakMap,vr=new WeakMap,mi=new WeakMap,$=new WeakSet,Dt=function(){var i,a,r,n;if(!P(this,hr)){Te(this,hr,!0),J(this,$,ci).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof ve.HTMLElement))throw""}catch{be("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof E.default))throw""}catch{be("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Jo))throw""}catch{be("<media-controller> failed to upgrade!")}this.init(),J(this,$,zm).call(this),J(this,$,Qm).call(this),J(this,$,Xm).call(this),Te(this,Nt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(x.USER_INACTIVE))!=null?a:!0),J(this,$,Jm).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>J(this,$,ci).call(this)),(n=this.media)==null||n.addEventListener("loadstart",()=>J(this,$,ci).call(this))}},Zm=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{}},ad=function(i){Object.assign(P(this,mi),i),J(this,$,ci).call(this)},ci=function(i={}){am(rm(nf(this,{...P(this,mi),...i})),this.shadowRoot)},zm=function(){let i=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(ed.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)},Qm=function(){var a;let i=r=>{let{detail:n}=r;if(n instanceof E.MediaError||(n=new E.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){ze(n),n.data&&ze(`${n.name} data:`,n.data);return}let s=ml(n,!1);s.message&&js(s),be(n),n.data&&be(`${n.name} data:`,n.data),J(this,$,ad).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 E.MediaError))return r;let n=ml((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 E.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Xm=function(){var a,r,n,s;let i=()=>J(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)},Jm=function(){var c,b;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===y.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(g,v,f=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(A=>{if(!(!A.snapToLines||A.line<-5||A.line>=0&&A.line<10))if(!v||this.paused){let T=A.text.split(`
2995
- `).length,N=-3;this.streamType===y.StreamTypes.LIVE&&(N=-2);let ee=N-T;if(A.line===ee&&!f)return;r.has(A)||r.set(A,A.line),A.line=ee}else setTimeout(()=>{A.line=r.get(A)||"auto"},500)})},l=()=>{var g,v;s(a,(v=(g=this.mediaController)==null?void 0:g.hasAttribute(x.USER_INACTIVE))!=null?v:!1)},u=()=>{var f,w;let v=Array.from(((w=(f=this.mediaController)==null?void 0:f.media)==null?void 0:w.textTracks)||[]).filter(A=>["subtitles","captions"].includes(A.kind)&&A.mode==="showing")[0];v!==a&&(a==null||a.removeEventListener("cuechange",l)),a=v,a==null||a.addEventListener("cuechange",l),s(a,P(this,Nt))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(b=this.textTracks)==null||b.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var v,f;let g=(f=(v=this.mediaController)==null?void 0:v.hasAttribute(x.USER_INACTIVE))!=null?f:!0;P(this,Nt)!==g&&(Te(this,Nt,g),s(a,P(this,Nt)))})};function Ot(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}ve.customElements.get("mux-player")||(ve.customElements.define("mux-player",cr),ve.MuxPlayerElement=cr);var hf=cr;
3000
+ `}return uf(t)};function cf(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=ve.customElements.get(e);if(n!=null&&n.template)return n.template}}function mf(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 Jm(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 hf=Object.values(E.Attributes),pf=Object.values(bt),vf=Object.values(m),nd=Hn(),od="mux-player",jm={isDialogOpen:!1},ff={redundant_streams:!0},hr,pr,vr,Pt,fr,hi,$,Ot,eh,sd,mi,th,ih,ah,rh,mr=class extends nl{constructor(){super();pe(this,$);pe(this,hr);pe(this,pr,!1);pe(this,vr,{});pe(this,Pt,!0);pe(this,fr,new Bn(this,"hotkeys"));pe(this,hi,{...jm,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&J(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()}});Te(this,hr,(0,y.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),J(this,$,eh).call(this),this.isConnected&&J(this,$,Ot).call(this)}static get NAME(){return od}static get VERSION(){return nd}static get observedAttributes(){var i;return[...(i=nl.observedAttributes)!=null?i:[],...pf,...hf,...vf]}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=Jm(this))}attributeChangedCallback(i,a,r){switch(J(this,$,Ot).call(this),super.attributeChangedCallback(i,a,r),i){case m.HOTKEYS:P(this,fr).value=r;break;case m.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Xe((0,y.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time."));break}case m.THUMBNAIL_TOKEN:{if(r){let s=(0,y.parseJwt)(r);if(s){let{aud:l}=s,u=y.MuxJWTAud.THUMBNAIL;l!==u&&Xe((0,y.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,y.parseJwt)(r);if(s){let{aud:l}=s,u=y.MuxJWTAud.STORYBOARD;l!==u&&Xe((0,y.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,y.parseJwt)(r);if(s){let{aud:l}=s,u=y.MuxJWTAud.DRM;l!==u&&Xe((0,y.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:l,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case E.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&be((0,y.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case E.Attributes.STREAM_TYPE:r&&![y.StreamTypes.LIVE,y.StreamTypes.ON_DEMAND,y.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,y.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===y.StreamTypes.LIVE?this.getAttribute(m.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[E.Attributes.PLAYBACK_ID,bt.SRC,m.PLAYBACK_TOKEN].includes(i)&&a!==r&&Te(this,hi,{...P(this,hi),...jm}),J(this,$,mi).call(this,{[Fc(i)]:r})}get preferCmcd(){var i;return(i=this.getAttribute(E.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?y.CmcdTypeValues.includes(i)?this.setAttribute(E.Attributes.PREFER_CMCD,i):Xe(`Invalid value for preferCmcd. Must be one of ${y.CmcdTypeValues.join()}`):this.removeAttribute(E.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:lf}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;J(this,$,Ot).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(E.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(E.Attributes.PLAYBACK_ID,i):this.removeAttribute(E.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Nt(this,bt.SRC))!=null?i:void 0:(a=this.getAttribute(bt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(bt.SRC,i):this.removeAttribute(bt.SRC)}get poster(){var r;let i=this.getAttribute(bt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){Xe("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return $c(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(bt.POSTER,i):this.removeAttribute(bt.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||[y.StreamTypes.LIVE,y.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return Wc(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 P(this,fr)}get nohotkeys(){return this.hasAttribute(m.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(m.NOHOTKEYS);return}this.setAttribute(m.NOHOTKEYS,"")}get thumbnailTime(){return ce(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=Nt(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=ve.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=ve.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=ve.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=ce(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=ce(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 ce(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(E.Attributes.PLAYER_INIT_TIME)?ce(this.getAttribute(E.Attributes.PLAYER_INIT_TIME)):P(this,hr)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(E.Attributes.PLAYER_INIT_TIME):this.setAttribute(E.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:od}get playerSoftwareVersion(){var i;return(i=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:nd}get beaconCollectionDomain(){var i;return(i=this.getAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(E.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(E.Attributes.MAX_RESOLUTION,i):this.removeAttribute(E.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(E.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(E.Attributes.MIN_RESOLUTION,i):this.removeAttribute(E.Attributes.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(E.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(E.Attributes.RENDITION_ORDER,i):this.removeAttribute(E.Attributes.RENDITION_ORDER))}get programStartTime(){return ce(this.getAttribute(E.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(E.Attributes.PROGRAM_START_TIME):this.setAttribute(E.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ce(this.getAttribute(E.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(E.Attributes.PROGRAM_END_TIME):this.setAttribute(E.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ce(this.getAttribute(E.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(E.Attributes.ASSET_START_TIME):this.setAttribute(E.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ce(this.getAttribute(E.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(E.Attributes.ASSET_END_TIME):this.setAttribute(E.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),{}):ff}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(E.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(E.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(E.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Nt(this,E.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(E.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 Nt(this,E.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(E.Attributes.DEBUG,""):this.removeAttribute(E.Attributes.DEBUG)}get disableTracking(){return Nt(this,E.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(E.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Nt(this,E.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(E.Attributes.DISABLE_COOKIES,""):this.removeAttribute(E.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(E.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:y.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(E.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:y.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 ce(Nt(this,E.Attributes.START_TIME))}set startTime(i){this.setAttribute(E.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(E.Attributes.PREFER_PLAYBACK);if(i===y.PlaybackTypes.MSE||i===y.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===y.PlaybackTypes.MSE||i===y.PlaybackTypes.NATIVE?this.setAttribute(E.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(E.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(J(this,$,Ot).call(this),!this.media){be("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Jm(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(J(this,$,Ot).call(this),!this.media){be("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(J(this,$,Ot).call(this),!this.media){be("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(J(this,$,Ot).call(this),!this.media){be("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{...P(this,vr),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...n!=null?{storyboard:n}:{}}}set tokens(i){Te(this,vr,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,y.addTextTrack)(s,i,a,r,n)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,y.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){be("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,vr=new WeakMap,Pt=new WeakMap,fr=new WeakMap,hi=new WeakMap,$=new WeakSet,Ot=function(){var i,a,r,n;if(!P(this,pr)){Te(this,pr,!0),J(this,$,mi).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof ve.HTMLElement))throw""}catch{be("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof E.default))throw""}catch{be("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof is))throw""}catch{be("<media-controller> failed to upgrade!")}this.init(),J(this,$,th).call(this),J(this,$,ih).call(this),J(this,$,ah).call(this),Te(this,Pt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(x.USER_INACTIVE))!=null?a:!0),J(this,$,rh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>J(this,$,mi).call(this)),(n=this.media)==null||n.addEventListener("loadstart",()=>J(this,$,mi).call(this))}},eh=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(P(this,hi),i),J(this,$,mi).call(this)},mi=function(i={}){dm(um(df(this,{...P(this,hi),...i})),this.shadowRoot)},th=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)},ih=function(){var a;let i=r=>{let{detail:n}=r;if(n instanceof E.MediaError||(n=new E.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Xe(n),n.data&&Xe(`${n.name} data:`,n.data);return}let s=fl(n,!1);s.message&&al(s),be(n),n.data&&be(`${n.name} data:`,n.data),J(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 E.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 E.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},ah=function(){var a,r,n,s;let i=()=>J(this,$,mi).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)},rh=function(){var c,_;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===y.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(g,v,f=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(A=>{if(!(!A.snapToLines||A.line<-5||A.line>=0&&A.line<10))if(!v||this.paused){let T=A.text.split(`
3001
+ `).length,N=-3;this.streamType===y.StreamTypes.LIVE&&(N=-2);let ee=N-T;if(A.line===ee&&!f)return;r.has(A)||r.set(A,A.line),A.line=ee}else setTimeout(()=>{A.line=r.get(A)||"auto"},500)})},l=()=>{var g,v;s(a,(v=(g=this.mediaController)==null?void 0:g.hasAttribute(x.USER_INACTIVE))!=null?v:!1)},u=()=>{var f,L;let v=Array.from(((L=(f=this.mediaController)==null?void 0:f.media)==null?void 0:L.textTracks)||[]).filter(A=>["subtitles","captions"].includes(A.kind)&&A.mode==="showing")[0];v!==a&&(a==null||a.removeEventListener("cuechange",l)),a=v,a==null||a.addEventListener("cuechange",l),s(a,P(this,Pt))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(_=this.textTracks)==null||_.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var v,f;let g=(f=(v=this.mediaController)==null?void 0:v.hasAttribute(x.USER_INACTIVE))!=null?f:!0;P(this,Pt)!==g&&(Te(this,Pt,g),s(a,P(this,Pt)))})};function Nt(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}ve.customElements.get("mux-player")||(ve.customElements.define("mux-player",mr),ve.MuxPlayerElement=mr);var Ef=mr;