@mux/mux-player 3.2.3 → 3.2.4-canary.1

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 mh=Object.create;var gr=Object.defineProperty;var hh=Object.getOwnPropertyDescriptor;var ph=Object.getOwnPropertyNames;var fh=Object.getPrototypeOf,vh=Object.prototype.hasOwnProperty;var Eh=(t,e)=>{for(var i in e)gr(t,i,{get:e[i],enumerable:!0})},xd=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ph(e))!vh.call(t,r)&&r!==i&&gr(t,r,{get:()=>e[r],enumerable:!(a=hh(e,r))||a.enumerable});return t};var bh=(t,e,i)=>(i=t!=null?mh(fh(t)):{},xd(e||!t||!t.__esModule?gr(i,"default",{value:t,enumerable:!0}):i,t)),gh=t=>xd(gr({},"__esModule",{value:!0}),t);var No=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)};var P=(t,e,i)=>(No(t,e,"read from private field"),i?i.call(t):e.get(t)),X=(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)},Ae=(t,e,i,a)=>(No(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i);var J=(t,e,i)=>(No(t,e,"access private method"),i);var _v={};Eh(_v,{MediaError:()=>E.MediaError,default:()=>gv,generatePlayerInitTime:()=>y.generatePlayerInitTime,getVideoAttribute:()=>Ot,playerSoftwareName:()=>dd,playerSoftwareVersion:()=>ld});module.exports=gh(_v);var fi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends fi{}globalThis.DocumentFragment=t}var ua=class extends fi{},Po=class extends fi{},_h={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(ua)}},ca,Uo=class{constructor(e,i={}){X(this,ca,void 0);Ae(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 Dd={document:{createElement:Ah},DocumentFragment,customElements:_h,CustomEvent:Uo,EventTarget:fi,HTMLElement:ua,HTMLVideoElement:Po},Od=typeof window=="undefined"||typeof globalThis.customElements=="undefined",pe=Od?Dd:globalThis,vi=Od?Dd.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"},Bo={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"},Nd=Object.entries(Bo),o=Nd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Th={USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},rt=Nd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Th}),Sv=Object.entries(rt).reduce((t,[e,i])=>{let a=o[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),Pd=Object.entries(o).reduce((t,[e,i])=>{let a=rt[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 Ho={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Te={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ce={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Ud={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."},$o=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 Bd(t){return t==null?void 0:t.map(Ch).join(" ")}function Hd(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 $d(t){return t==null?void 0:t.map(Rh).join(" ")}function Wd(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 Fd(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 _r(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var Ar=t=>new Promise(e=>setTimeout(e,t));var Kd=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Lh=(t,e)=>{let i=t===1?Kd[e].singular:Kd[e].plural;return`${t} ${i}`},Pt=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 Ne(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 Rv=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 Tr=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},yr=class extends Tr{},kr=class extends yr{constructor(){super(...arguments),this.role=null}},Wo=class{observe(){}unobserve(){}disconnect(){}},Vd={createElement:function(){return new ma.HTMLElement},createElementNS:function(){return new ma.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},ma={ResizeObserver:Wo,document:Vd,Node:yr,Element:kr,HTMLElement:class extends kr{constructor(){super(...arguments),this.innerHTML=""}get content(){return new ma.DocumentFragment}},DocumentFragment:class extends Tr{},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}}},Yd=typeof window=="undefined"||typeof window.customElements=="undefined",Gd=Object.keys(ma).every(t=>t in globalThis),d=Yd&&!Gd?ma:globalThis,h=Yd&&!Gd?Vd:globalThis.document;var qd=new WeakMap,Fo=t=>{let e=qd.get(t);return e||qd.set(t,e=new Set),e},Zd=new d.ResizeObserver(t=>{for(let e of t)for(let i of Fo(e.target))i(e)});function nt(t,e){Fo(t).add(e),Zd.observe(t)}function Ut(t,e){let i=Fo(t);i.delete(e),i.size||Zd.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=Sr(t))!=null?e:Pe(t,"media-controller")}function Sr(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 Ir=(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:[]},Cr=(t,e)=>Dh(t,e)[0],ue=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:ue(t,e.getRootNode().host),Pe=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Pe(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 Mr(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=Ko(i,a),n=Ko(i,{x:t,y:e}),s=Ko(a,{x:t,y:e});return n>r||s>r?n>s?1:0:n/r}function Ko(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function $(t,e){let i=Oh(t,a=>a===e);return i||Vo(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 Vo(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 Xd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},gt=(t,e,i)=>(Xd(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)},Rr=(t,e,i,a)=>(Xd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ve,Jd=h.createElement("template");Jd.innerHTML=`
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 pv={};ch(pv,{MediaError:()=>E.MediaError,default:()=>hv,generatePlayerInitTime:()=>y.generatePlayerInitTime,getVideoAttribute:()=>Dt,playerSoftwareName:()=>id,playerSoftwareVersion:()=>td});module.exports=hh(pv);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,wo=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 fh(t,e){return new da}var Cd={document:{createElement:fh},DocumentFragment,customElements:ph,CustomEvent:wo,EventTarget:pi,HTMLElement:da,HTMLVideoElement:Ro},Md=typeof window=="undefined"||typeof globalThis.customElements=="undefined",fe=Md?Cd:globalThis,fi=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"},Lo={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(Lo),o=Rd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),vh={USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},rt=Rd.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...vh}),gv=Object.entries(rt).reduce((t,[e,i])=>{let a=o[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),wd=Object.entries(o).reduce((t,[e,i])=>{let a=rt[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),ve={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Et={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 Ld={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 vi(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}`},Nt=t=>{if(!vi(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&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 yv=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 nt(t,e){No(t).add(e),Fd.observe(t)}function Pt(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 Q(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=Ut(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 Ut(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)},bt=(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=`
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 Yo=class extends d.HTMLElement{constructor(e={}){if(super(),Nh(this,ve,void 0),!this.shadowRoot){let i=this.attachShadow({mode:"open"}),a=Jd.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=h.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),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,ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),Rr(this,ve,null)),a&&this.isConnected&&(Rr(this,ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=gt(this,ve))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Rr(this,ve,Ph(this)),this.getAttribute(S.MEDIA_CONTROLLER)&&((i=(e=gt(this,ve))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=gt(this,ve))==null||a.addEventListener("pointerdown",this),(r=gt(this,ve))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(S.MEDIA_CONTROLLER)&&((i=(e=gt(this,ve))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=gt(this,ve))==null||a.removeEventListener("pointerdown",this),(r=gt(this,ve))==null||r.removeEventListener("click",this),Rr(this,ve,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,f=s-u;if(g<0||f<0||g>c||f>b||c===0&&b===0)return;let{pointerType:v=this._pointerType}=e;if(this._pointerType=void 0,v===Ho.TOUCH){this.handleTap(e);return}else if(v===Ho.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}))}};ve=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):Pe(t,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",Yo);var Zo=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_t=(t,e,i)=>(Zo(t,e,"read from private field"),i?i.call(t):e.get(t)),ot=(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)},pa=(t,e,i,a)=>(Zo(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Me=(t,e,i)=>(Zo(t,e,"access private method"),i),wr,bi,fa,gi,Go,jd,qo,eu,va,Lr,xr,Qo,_i,Ea,x={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},tu=h.createElement("template");tu.innerHTML=`
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=bt(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=bt(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,wh(this)),this.getAttribute(S.MEDIA_CONTROLLER)&&((i=(e=bt(this,Ee))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=bt(this,Ee))==null||a.addEventListener("pointerdown",this),(r=bt(this,Ee))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(S.MEDIA_CONTROLLER)&&((i=(e=bt(this,Ee))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=bt(this,Ee))==null||a.removeEventListener("pointerdown",this),(r=bt(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,f=s-u;if(g<0||f<0||g>c||f>b||c===0&&b===0)return;let{pointerType:v=this._pointerType}=e;if(this._pointerType=void 0,v===xo.TOUCH){this.handleTap(e);return}else if(v===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 wh(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)},gt=(t,e,i)=>(Wo(t,e,"read from private field"),i?i.call(t):e.get(t)),ot=(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,fa,Rr,wr,Fo,gi,va,x={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},Qd=h.createElement("template");Qd.innerHTML=`
9
9
  <style>
10
10
 
11
11
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::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 Uh=Object.values(o),Bh="sm:384 md:576 lg:768 xl:960";function Hh(t){$h(t.target,t.contentRect.width)}function $h(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(x.BREAKPOINTS))!=null?i:Bh,r=Wh(a),n=Fh(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(rt.BREAKPOINTS_CHANGE,{detail:n});t.dispatchEvent(l)}}function Wh(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Fh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var ba=class extends d.HTMLElement{constructor(){super(),ot(this,Go),ot(this,qo),ot(this,va),ot(this,xr),ot(this,_i),ot(this,wr,0),ot(this,bi,null),ot(this,fa,null),ot(this,gi,void 0),this.breakpointsComputed=!1,this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(tu.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;nt(this,s=>{a||(setTimeout(()=>{Hh(s),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(rt.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,bi)&&this.mediaUnsetCallback(_t(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&&(pa(this,bi,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;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,""),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){pa(this,bi,null)}handleEvent(e){switch(e.type){case"pointerdown":pa(this,wr,e.timeStamp);break;case"pointermove":Me(this,Go,jd).call(this,e);break;case"pointerup":Me(this,qo,eu).call(this,e);break;case"mouseleave":Me(this,va,Lr).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);pa(this,gi,isNaN(i)?0:i)}get autohide(){return(_t(this,gi)===void 0?2:_t(this,gi)).toString()}};wr=new WeakMap;bi=new WeakMap;fa=new WeakMap;gi=new WeakMap;Go=new WeakSet;jd=function(t){t.pointerType!=="mouse"&&t.timeStamp-_t(this,wr)<250||(Me(this,xr,Qo).call(this),clearTimeout(_t(this,fa)),[this,this.media].includes(t.target)&&Me(this,_i,Ea).call(this))};qo=new WeakSet;eu=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(x.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Me(this,va,Lr).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)};va=new WeakSet;Lr=function(){if(_t(this,gi)<0||this.hasAttribute(x.USER_INACTIVE))return;this.setAttribute(x.USER_INACTIVE,"");let t=new d.CustomEvent(rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};xr=new WeakSet;Qo=function(){if(!this.hasAttribute(x.USER_INACTIVE))return;this.removeAttribute(x.USER_INACTIVE);let t=new d.CustomEvent(rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};_i=new WeakSet;Ea=function(){Me(this,xr,Qo).call(this),clearTimeout(_t(this,fa));let t=parseInt(this.autohide);t<0||pa(this,fa,setTimeout(()=>{Me(this,va,Lr).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)},Dr=(t,e,i,a)=>(iu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ai,Ti,Or,Ht,st,At,Ue=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){ga(this,st),ga(this,Ai,void 0),ga(this,Ti,void 0),ga(this,Or,void 0),ga(this,Ht,new Set),Dr(this,Ai,e),Dr(this,Ti,i),Dr(this,Or,new Set(a))}[Symbol.iterator](){return ae(this,st,At).values()}get length(){return ae(this,st,At).size}get value(){var e;return(e=[...ae(this,st,At)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Dr(this,Ht,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...ae(this,st,At)][e]}values(){return ae(this,st,At).values()}forEach(e,i){ae(this,st,At).forEach(e,i)}add(...e){var i,a;e.forEach(r=>ae(this,Ht).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,Ht).delete(a)),(i=ae(this,Ai))==null||i.setAttribute(`${ae(this,Ti)}`,`${this.value}`)}contains(e){return ae(this,st,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}};Ai=new WeakMap;Ti=new WeakMap;Or=new WeakMap;Ht=new WeakMap;st=new WeakSet;At=function(){return ae(this,Ht).size?ae(this,Ht):ae(this,Or)};var Kh=(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}},$t=(t="",e={})=>Kh(t).map(i=>{let a=au(i);return{...e,...a}}),zo=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?au(e):e):typeof t=="string"?$t(t):[t]:[],Nr=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,lt=(t=[])=>Array.prototype.map.call(t,Nr).join(" "),Vh=(t,e)=>i=>i[t]===e,ru=t=>{let e=Object.entries(t).map(([i,a])=>Vh(i,a));return i=>e.every(a=>a(i))},Wt=(t,e=[],i=[])=>{let a=zo(i).map(ru),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:ru(e);return Array.from(t.textTracks).filter(i)},Pr=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,Yh=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===Ud.FULLSCREEN?i:a},lu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let n=Yh(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},Gh="fullscreenEnabled"in h?"fullscreenEnabled":"webkitFullscreenEnabled"in h?"webkitFullscreenEnabled":void 0,du=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[Gh])||i&&"webkitSupportsFullscreen"in i};var Ur,Xo=()=>{var t,e;return Ur||(Ur=(e=(t=h)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Ur)},uu=async(t=Xo())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([qh(t,i.signal),Zh(t,e)]);return i.abort(),a},qh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),Zh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await Ar(10)}return t.volume!==e},Qh=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),Jo=(t=Xo())=>d.matchMedia("(display-mode: standalone)").matches&&Qh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",jo=(t=Xo())=>du({documentElement:h,media:t}),cu=jo(),mu=Jo(),hu=!!d.WebKitPlaybackTargetAvailabilityEvent,pu=!!d.chrome;var yi=t=>Ft(t.media,e=>[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),es=t=>Ft(t.media,e=>e.mode===bt.SHOWING&&[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)),Br=(t,e)=>{let i=yi(t),a=es(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,f=i.filter(v=>g.some(L=>v.language.toLowerCase().startsWith(L.split("-")[0]))).sort((v,L)=>{let A=g.findIndex(N=>v.language.toLowerCase().startsWith(N.split("-")[0])),T=g.findIndex(N=>L.language.toLowerCase().startsWith(N.split("-")[0]));return A-T});f[0]&&(n=f[0])}let{language:l,label:u,kind:c}=n;Wt(bt.DISABLED,i,a),Wt(bt.SHOWING,i,[{language:l,label:u,kind:c}])}}},Hr=(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&&Hr(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)=>Hr(r,e[n])):!0};var Xh=Object.values(Ce),$r,Jh=uu().then(t=>($r=t,$r)),fu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=d.customElements.get(i);a&&e instanceof a||(await d.customElements.whenDefined(i),d.customElements.upgrade(e))}))},Aa={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;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=[Ce.LIVE,Ce.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(Xh.includes(r))return r===Ce.UNKNOWN?a:r;let n=e.duration;return n===1/0?Ce.LIVE:Number.isFinite(n)?Ce.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===Ce.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)===Ce.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 es(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)||Br(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 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||!jo(e))return Te.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!mu||!Jo(e))return Te.UNSUPPORTED}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if($r===!1||(e==null?void 0:e.volume)==null)return Te.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{$r==null&&Jh.then(e=>t(e?void 0:Te.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 Te.UNSUPPORTED;if(!(e==null||e==="available"))return Te.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 Te.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Te.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 Te.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return Te.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var vu={[p.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,n;let{media:s}=e,l=i!=null?i:void 0,u,c;if(s&&l!=null){let[v]=Ft(s,{kind:fe.METADATA,label:"thumbnails"}),L=Array.prototype.find.call((a=v==null?void 0:v.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 b=t.mediaDuration.get(e),f=(n=t.mediaChaptersCues.get(e).find((v,L,A)=>L===A.length-1&&b===v.endTime?v.startTime<=l&&v.endTime>=l:v.startTime<=l&&v.endTime>l))==null?void 0:n.text;return i!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:f}},[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)===Ce.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=zo(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=yi(e),r=i!=null?i:[];Wt(bt.DISABLED,a,r)},[p.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){Br(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 jh=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Aa,requestMap:r=vu,options:n={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],u={options:{...n}},c=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),b=A=>{A!=null&&(Hr(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)},f={},v,L=async(A,T)=>{var N,ee,be,Et,at,Ji,ji,ea,ta,ia,aa,ra,na,oa,sa,la;let br=!!v;if(v={...u,...v!=null?v:{},...A},br)return;await fu(...Object.values(A));let hi=l.length>0&&T===0&&s,cd=u.media!==v.media,md=((N=u.media)==null?void 0:N.textTracks)!==((ee=v.media)==null?void 0:ee.textTracks),hd=((be=u.media)==null?void 0:be.videoRenditions)!==((Et=v.media)==null?void 0:Et.videoRenditions),pd=((at=u.media)==null?void 0:at.audioTracks)!==((Ji=v.media)==null?void 0:Ji.audioTracks),fd=((ji=u.media)==null?void 0:ji.remote)!==((ea=v.media)==null?void 0:ea.remote),vd=u.documentElement!==v.documentElement,Ed=!!u.media&&(cd||hi),bd=!!((ta=u.media)!=null&&ta.textTracks)&&(md||hi),gd=!!((ia=u.media)!=null&&ia.videoRenditions)&&(hd||hi),_d=!!((aa=u.media)!=null&&aa.audioTracks)&&(pd||hi),Ad=!!((ra=u.media)!=null&&ra.remote)&&(fd||hi),Td=!!u.documentElement&&(vd||hi),yd=Ed||bd||gd||_d||Ad||Td,pi=l.length===0&&T===1&&s,kd=!!v.media&&(cd||pi),Sd=!!((na=v.media)!=null&&na.textTracks)&&(md||pi),Id=!!((oa=v.media)!=null&&oa.videoRenditions)&&(hd||pi),Cd=!!((sa=v.media)!=null&&sa.audioTracks)&&(pd||pi),Md=!!((la=v.media)!=null&&la.remote)&&(fd||pi),Rd=!!v.documentElement&&(vd||pi),wd=kd||Sd||Id||Cd||Md||Rd;if(!(yd||wd)){Object.entries(v).forEach(([W,da])=>{u[W]=da}),g(),v=void 0;return}Object.entries(a).forEach(([W,{get:da,mediaEvents:nh=[],textTracksEvents:oh=[],videoRenditionsEvents:sh=[],audioTracksEvents:lh=[],remoteEvents:dh=[],rootEvents:uh=[],stateOwnersUpdateHandlers:ch=[]}])=>{f[W]||(f[W]={});let ge=z=>{let _e=da(u,z);b({[W]:_e})},ie;ie=f[W].mediaEvents,nh.forEach(z=>{ie&&Ed&&(u.media.removeEventListener(z,ie),f[W].mediaEvents=void 0),kd&&(v.media.addEventListener(z,ge),f[W].mediaEvents=ge)}),ie=f[W].textTracksEvents,oh.forEach(z=>{var _e,Ie;ie&&bd&&((_e=u.media.textTracks)==null||_e.removeEventListener(z,ie),f[W].textTracksEvents=void 0),Sd&&((Ie=v.media.textTracks)==null||Ie.addEventListener(z,ge),f[W].textTracksEvents=ge)}),ie=f[W].videoRenditionsEvents,sh.forEach(z=>{var _e,Ie;ie&&gd&&((_e=u.media.videoRenditions)==null||_e.removeEventListener(z,ie),f[W].videoRenditionsEvents=void 0),Id&&((Ie=v.media.videoRenditions)==null||Ie.addEventListener(z,ge),f[W].videoRenditionsEvents=ge)}),ie=f[W].audioTracksEvents,lh.forEach(z=>{var _e,Ie;ie&&_d&&((_e=u.media.audioTracks)==null||_e.removeEventListener(z,ie),f[W].audioTracksEvents=void 0),Cd&&((Ie=v.media.audioTracks)==null||Ie.addEventListener(z,ge),f[W].audioTracksEvents=ge)}),ie=f[W].remoteEvents,dh.forEach(z=>{var _e,Ie;ie&&Ad&&((_e=u.media.remote)==null||_e.removeEventListener(z,ie),f[W].remoteEvents=void 0),Md&&((Ie=v.media.remote)==null||Ie.addEventListener(z,ge),f[W].remoteEvents=ge)}),ie=f[W].rootEvents,uh.forEach(z=>{ie&&Td&&(u.documentElement.removeEventListener(z,ie),f[W].rootEvents=void 0),Rd&&(v.documentElement.addEventListener(z,ge),f[W].rootEvents=ge)});let Ld=f[W].stateOwnersUpdateHandlers;ch.forEach(z=>{Ld&&yd&&Ld(),wd&&(f[W].stateOwnersUpdateHandlers=z(ge,v))})}),Object.entries(v).forEach(([W,da])=>{u[W]=da}),g(),v=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){b(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,be])=>{u.options[ee]=be})},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))}}}},Eu=jh;var rs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},w=(t,e,i)=>(rs(t,e,"read from private field"),i?i.call(t):e.get(t)),dt=(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)=>(rs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),yt=(t,e,i)=>(rs(t,e,"access private method"),i),kt,Ta,q,ya,Be,Wr,Fr,ts,ki,ka,Kr,is,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"},Vr=class extends ba{constructor(){super(),dt(this,Fr),dt(this,ki),dt(this,Kr),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,dt(this,kt,new Ue(this,O.HOTKEYS)),dt(this,Ta,void 0),dt(this,q,void 0),dt(this,ya,void 0),dt(this,Be,void 0),dt(this,Wr,i=>{var a;(a=w(this,q))==null||a.dispatch(i)}),this.associateElement(this);let e={};Tt(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(Pd[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,q)}set mediaStore(e){var i,a;if(w(this,q)&&((i=w(this,Be))==null||i.call(this),Tt(this,Be,void 0)),Tt(this,q,e),!w(this,q)&&!this.hasAttribute(O.NO_DEFAULT_STORE)){yt(this,Fr,ts).call(this);return}Tt(this,Be,(a=w(this,q))==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),Tt(this,Ta,e),(i=w(this,q))==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,kt).value=a;else if(e===O.DEFAULT_SUBTITLES&&a!==i)(r=w(this,q))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(O.DEFAULT_SUBTITLES)}});else if(e===O.DEFAULT_STREAM_TYPE)(s=w(this,q))==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,q))==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,Ta,b),(c=w(this,q))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,i;!w(this,q)&&!this.hasAttribute(O.NO_DEFAULT_STORE)&&yt(this,Fr,ts).call(this),(e=w(this,q))==null||e.dispatch({type:"documentelementchangerequest",detail:h}),super.connectedCallback(),w(this,q)&&!w(this,Be)&&Tt(this,Be,(i=w(this,q))==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,q)&&((i=w(this,q))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=w(this,q))==null||a.dispatch({type:p.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),w(this,Be)&&((r=w(this,Be))==null||r.call(this),Tt(this,Be,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=w(this,q))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=w(this,q))==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=np(e,a,r);Object.values(p).forEach(s=>{e.addEventListener(s,w(this,Wr))}),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,Wr))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),w(this,q)&&Object.entries(w(this,q).getState()).forEach(([r,n])=>{Au([e],r,n)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",yt(this,Kr,is))}disableHotkeys(){this.removeEventListener("keydown",yt(this,Kr,is)),this.removeEventListener("keyup",yt(this,ki,ka))}get hotkeys(){return w(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(f=>f==="Space"?" ":f).filter(Boolean).includes(e.key))return;let c,b,g;if(!w(this,kt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&w(this,kt).contains("nospace")))switch(e.key){case" ":case"k":c=w(this,q).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 f=this.hasAttribute(O.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_BACKWARD_SEEK_OFFSET):bu;b=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}case"ArrowRight":{let f=this.hasAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(O.KEYBOARD_FORWARD_SEEK_OFFSET):bu;b=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}default:break}}};kt=new WeakMap;Ta=new WeakMap;q=new WeakMap;ya=new WeakMap;Be=new WeakMap;Wr=new WeakMap;Fr=new WeakSet;ts=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",yt(this,ki,ka));return}this.keyboardShortcutHandler(t)};Kr=new WeakSet;is=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!Tu.includes(a)){this.removeEventListener("keyup",yt(this,ki,ka));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(w(this,kt).contains(`no${a.toLowerCase()}`)||a===" "&&w(this,kt).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",yt(this,ki,ka),{once:!0})};var ep=Object.values(o),tp=Object.values(Bo),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=>ep.includes(l)):[]},ip=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),tp.some(a=>a in t)},as=t=>ip(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]:lt,[o.MEDIA_SUBTITLES_SHOWING]:lt,[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]:Bd,[o.MEDIA_AUDIO_TRACK_LIST]:$d},ap=async(t,e,i)=>{var a,r;if(t.isConnected||await Ar(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)},rp=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},Kt=(t,e)=>{if(rp(t))return;let i=(r,n)=>{var s,l;as(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("-")&&!as(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)&&ap(a,n,i)})},np=(t,e,i)=>{Kt(t,e);let a=b=>{var g;let f=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;e(f)},r=b=>{var g;let f=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;i(f)};t.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=b=>{b.forEach(g=>{let{addedNodes:f=[],removedNodes:v=[],type:L,target:A,attributeName:T}=g;L==="childList"?(Array.prototype.forEach.call(f,N=>Kt(N,e)),Array.prototype.forEach.call(v,N=>Kt(N,i))):L==="attributes"&&T===S.MEDIA_CHROME_ATTRIBUTES&&(as(A)?e(A):i(A))})},s=[],l=b=>{let g=b.target;g.name!=="media"&&(s.forEach(f=>Kt(f,i)),s=[...g.assignedElements({flatten:!0})],s.forEach(f=>Kt(f,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",Vr);var ns=Vr;var ss=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},j=(t,e,i)=>(ss(t,e,"read from private field"),i?i.call(t):e.get(t)),Si=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Yr=(t,e,i,a)=>(ss(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),op=(t,e,i)=>(ss(t,e,"access private method"),i),He,Ci,St,Ii,qr,os,ku,Gr={TOOLTIP_PLACEMENT:"tooltipplacement"},Su=h.createElement("template");Su.innerHTML=`
148
+ `;var Lh=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(rt.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(),ot(this,Ho),ot(this,$o),ot(this,fa),ot(this,wr),ot(this,gi),ot(this,Mr,0),ot(this,Ei,null),ot(this,pa,null),ot(this,bi,void 0),this.breakpointsComputed=!1,this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Qd.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;nt(this,s=>{a||(setTimeout(()=>{Dh(s),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(rt.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){gt(this,Ei)&&this.mediaUnsetCallback(gt(this,Ei));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[x.AUTOHIDE,x.GESTURES_DISABLED].concat(Lh).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,fa,Rr).call(this);break;case"mouseup":this.removeAttribute(x.KEYBOARD_CONTROL);break;case"keyup":Re(this,gi,va).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(gt(this,bi)===void 0?2:gt(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-gt(this,Mr)<250||(Re(this,wr,Fo).call(this),clearTimeout(gt(this,pa)),[this,this.media].includes(t.target)&&Re(this,gi,va).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,fa,Rr).call(this):Re(this,gi,va).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Re(this,gi,va).call(this)};fa=new WeakSet;Rr=function(){if(gt(this,bi)<0||this.hasAttribute(x.USER_INACTIVE))return;this.setAttribute(x.USER_INACTIVE,"");let t=new d.CustomEvent(rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};wr=new WeakSet;Fo=function(){if(!this.hasAttribute(x.USER_INACTIVE))return;this.removeAttribute(x.USER_INACTIVE);let t=new d.CustomEvent(rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};gi=new WeakSet;va=function(){Re(this,wr,Fo).call(this),clearTimeout(gt(this,pa));let t=parseInt(this.autohide);t<0||ha(this,pa,setTimeout(()=>{Re(this,fa,Rr).call(this)},t*1e3))};d.customElements.get("media-container")||d.customElements.define("media-container",Ea);var zd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ae=(t,e,i)=>(zd(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)},Lr=(t,e,i,a)=>(zd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),_i,Ai,xr,Bt,st,_t,Be=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){ba(this,st),ba(this,_i,void 0),ba(this,Ai,void 0),ba(this,xr,void 0),ba(this,Bt,new Set),Lr(this,_i,e),Lr(this,Ai,i),Lr(this,xr,new Set(a))}[Symbol.iterator](){return ae(this,st,_t).values()}get length(){return ae(this,st,_t).size}get value(){var e;return(e=[...ae(this,st,_t)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Lr(this,Bt,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...ae(this,st,_t)][e]}values(){return ae(this,st,_t).values()}forEach(e,i){ae(this,st,_t).forEach(e,i)}add(...e){var i,a;e.forEach(r=>ae(this,Bt).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,Bt).delete(a)),(i=ae(this,_i))==null||i.setAttribute(`${ae(this,Ai)}`,`${this.value}`)}contains(e){return ae(this,st,_t).has(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){return this.remove(e),this.add(i),e===i}};_i=new WeakMap;Ai=new WeakMap;xr=new WeakMap;Bt=new WeakMap;st=new WeakSet;_t=function(){return ae(this,Bt).size?ae(this,Bt):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"?ve.CAPTIONS:ve.SUBTITLES,language:i,label:r}},Ht=(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"?Ht(t):[t]:[],Dr=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,lt=(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))},$t=(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})},Wt=(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===Ld.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=>Wt(t.media,e=>[ve.SUBTITLES,ve.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),qo=t=>Wt(t.media,e=>e.mode===Et.SHOWING&&[ve.SUBTITLES,ve.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)$t(Et.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,f=i.filter(v=>g.some(L=>v.language.toLowerCase().startsWith(L.split("-")[0]))).sort((v,L)=>{let A=g.findIndex(N=>v.language.toLowerCase().startsWith(N.split("-")[0])),T=g.findIndex(N=>L.language.toLowerCase().startsWith(N.split("-")[0]));return A-T});f[0]&&(n=f[0])}let{language:l,label:u,kind:c}=n;$t(Et.DISABLED,i,a),$t(Et.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||!vi(t)||(i.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){let{media:e,options:{defaultDuration:i}={}}=t;return i&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?i:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){let{media:e}=t;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;let{media:i}=t;if(!((e=i==null?void 0:i.seekable)!=null&&e.length))return;let a=i.seekable.start(0),r=i.seekable.end(i.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;let{media:i}=t,a=(e=i==null?void 0:i.buffered)!=null?e:[];return Array.from(a).map((r,n)=>[Number(a.start(n).toFixed(3)),Number(a.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[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&&![ve.CAPTIONS,ve.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]=Wt(i,{kind:ve.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[v]=Wt(s,{kind:ve.METADATA,label:"thumbnails"}),L=Array.prototype.find.call((a=v==null?void 0:v.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 b=t.mediaDuration.get(e),f=(n=t.mediaChaptersCues.get(e).find((v,L,A)=>L===A.length-1&&b===v.endTime?v.startTime<=l&&v.endTime>=l:v.startTime<=l&&v.endTime>l))==null?void 0:n.text;return i!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:f}},[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),$t(Et.SHOWING,n,s)},[p.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=Ti(e),r=i!=null?i:[];$t(Et.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)},f={},v,L=async(A,T)=>{var N,ee,ge,vt,at,Xi,Ji,ji,ea,ta,ia,aa,ra,na,oa,sa;let vr=!!v;if(v={...u,...v!=null?v:{},...A},vr)return;await du(...Object.values(A));let mi=l.length>0&&T===0&&s,rd=u.media!==v.media,nd=((N=u.media)==null?void 0:N.textTracks)!==((ee=v.media)==null?void 0:ee.textTracks),od=((ge=u.media)==null?void 0:ge.videoRenditions)!==((vt=v.media)==null?void 0:vt.videoRenditions),sd=((at=u.media)==null?void 0:at.audioTracks)!==((Xi=v.media)==null?void 0:Xi.audioTracks),ld=((Ji=u.media)==null?void 0:Ji.remote)!==((ji=v.media)==null?void 0:ji.remote),dd=u.documentElement!==v.documentElement,ud=!!u.media&&(rd||mi),cd=!!((ea=u.media)!=null&&ea.textTracks)&&(nd||mi),md=!!((ta=u.media)!=null&&ta.videoRenditions)&&(od||mi),hd=!!((ia=u.media)!=null&&ia.audioTracks)&&(sd||mi),pd=!!((aa=u.media)!=null&&aa.remote)&&(ld||mi),fd=!!u.documentElement&&(dd||mi),vd=ud||cd||md||hd||pd||fd,hi=l.length===0&&T===1&&s,Ed=!!v.media&&(rd||hi),bd=!!((ra=v.media)!=null&&ra.textTracks)&&(nd||hi),gd=!!((na=v.media)!=null&&na.videoRenditions)&&(od||hi),_d=!!((oa=v.media)!=null&&oa.audioTracks)&&(sd||hi),Ad=!!((sa=v.media)!=null&&sa.remote)&&(ld||hi),Td=!!v.documentElement&&(dd||hi),yd=Ed||bd||gd||_d||Ad||Td;if(!(vd||yd)){Object.entries(v).forEach(([F,la])=>{u[F]=la}),g(),v=void 0;return}Object.entries(a).forEach(([F,{get:la,mediaEvents:jm=[],textTracksEvents:eh=[],videoRenditionsEvents:th=[],audioTracksEvents:ih=[],remoteEvents:ah=[],rootEvents:rh=[],stateOwnersUpdateHandlers:nh=[]}])=>{f[F]||(f[F]={});let _e=X=>{let Ae=la(u,X);b({[F]:Ae})},ie;ie=f[F].mediaEvents,jm.forEach(X=>{ie&&ud&&(u.media.removeEventListener(X,ie),f[F].mediaEvents=void 0),Ed&&(v.media.addEventListener(X,_e),f[F].mediaEvents=_e)}),ie=f[F].textTracksEvents,eh.forEach(X=>{var Ae,Ce;ie&&cd&&((Ae=u.media.textTracks)==null||Ae.removeEventListener(X,ie),f[F].textTracksEvents=void 0),bd&&((Ce=v.media.textTracks)==null||Ce.addEventListener(X,_e),f[F].textTracksEvents=_e)}),ie=f[F].videoRenditionsEvents,th.forEach(X=>{var Ae,Ce;ie&&md&&((Ae=u.media.videoRenditions)==null||Ae.removeEventListener(X,ie),f[F].videoRenditionsEvents=void 0),gd&&((Ce=v.media.videoRenditions)==null||Ce.addEventListener(X,_e),f[F].videoRenditionsEvents=_e)}),ie=f[F].audioTracksEvents,ih.forEach(X=>{var Ae,Ce;ie&&hd&&((Ae=u.media.audioTracks)==null||Ae.removeEventListener(X,ie),f[F].audioTracksEvents=void 0),_d&&((Ce=v.media.audioTracks)==null||Ce.addEventListener(X,_e),f[F].audioTracksEvents=_e)}),ie=f[F].remoteEvents,ah.forEach(X=>{var Ae,Ce;ie&&pd&&((Ae=u.media.remote)==null||Ae.removeEventListener(X,ie),f[F].remoteEvents=void 0),Ad&&((Ce=v.media.remote)==null||Ce.addEventListener(X,_e),f[F].remoteEvents=_e)}),ie=f[F].rootEvents,rh.forEach(X=>{ie&&fd&&(u.documentElement.removeEventListener(X,ie),f[F].rootEvents=void 0),Td&&(v.documentElement.addEventListener(X,_e),f[F].rootEvents=_e)});let kd=f[F].stateOwnersUpdateHandlers;nh.forEach(X=>{kd&&vd&&kd(),yd&&(f[F].stateOwnersUpdateHandlers=X(_e,v))})}),Object.entries(v).forEach(([F,la])=>{u[F]=la}),g(),v=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){b(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))}}}},cu=qh;var Xo=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},w=(t,e,i)=>(Xo(t,e,"read from private field"),i?i.call(t):e.get(t)),dt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},At=(t,e,i,a)=>(Xo(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Tt=(t,e,i)=>(Xo(t,e,"access private method"),i),yt,Aa,Z,Ta,He,Hr,$r,Zo,yi,ya,Wr,Qo,vu=["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(),dt(this,$r),dt(this,yi),dt(this,Wr),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,dt(this,yt,new Be(this,O.HOTKEYS)),dt(this,Aa,void 0),dt(this,Z,void 0),dt(this,Ta,void 0),dt(this,He,void 0),dt(this,Hr,i=>{var a;(a=w(this,Z))==null||a.dispatch(i)}),this.associateElement(this);let e={};At(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(wd[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,He))==null||i.call(this),At(this,He,void 0)),At(this,Z,e),!w(this,Z)&&!this.hasAttribute(O.NO_DEFAULT_STORE)){Tt(this,$r,Zo).call(this);return}At(this,He,(a=w(this,Z))==null?void 0:a.subscribe(w(this,Ta)))}get fullscreenElement(){var e;return(e=w(this,Aa))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(O.FULLSCREEN_ELEMENT)&&this.removeAttribute(O.FULLSCREEN_ELEMENT),At(this,Aa,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,yt).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 b=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;At(this,Aa,b),(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)&&Tt(this,$r,Zo).call(this),(e=w(this,Z))==null||e.dispatch({type:"documentelementchangerequest",detail:h}),super.connectedCallback(),w(this,Z)&&!w(this,He)&&At(this,He,(i=w(this,Z))==null?void 0:i.subscribe(w(this,Ta))),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,He)&&((r=w(this,He))==null||r.call(this),At(this,He,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){fu(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,w(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,w(this,Hr))})}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])=>{fu([e],r,n)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Tt(this,Wr,Qo))}disableHotkeys(){this.removeEventListener("keydown",Tt(this,Wr,Qo)),this.removeEventListener("keyup",Tt(this,yi,ya))}get hotkeys(){return w(this,yt)}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(f=>f==="Space"?" ":f).filter(Boolean).includes(e.key))return;let c,b,g;if(!w(this,yt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&w(this,yt).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 f=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)-f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}case"ArrowRight":{let f=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)+f,0),g=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:b}),this.dispatchEvent(g);break}default:break}}};yt=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(!vu.includes(e)){this.removeEventListener("keyup",Tt(this,yi,ya));return}this.keyboardShortcutHandler(t)};Wr=new WeakSet;Qo=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!vu.includes(a)){this.removeEventListener("keyup",Tt(this,yi,ya));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(w(this,yt).contains(`no${a.toLowerCase()}`)||a===" "&&w(this,yt).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",Tt(this,yi,ya),{once:!0})};var Zh=Object.values(o),Qh=Object.values(Lo),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)):[]},zh=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),Qh.some(a=>a in t)},zo=t=>zh(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]:lt,[o.MEDIA_SUBTITLES_SHOWING]:lt,[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"]'))},Ft=(t,e)=>{if(Jh(t))return;let i=(r,n)=>{var s,l;zo(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=>Ft(g,n))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!zo(t)){d.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},fu=(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)=>{Ft(t,e);let a=b=>{var g;let f=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;e(f)},r=b=>{var g;let f=(g=b==null?void 0:b.composedPath()[0])!=null?g:b.target;i(f)};t.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=b=>{b.forEach(g=>{let{addedNodes:f=[],removedNodes:v=[],type:L,target:A,attributeName:T}=g;L==="childList"?(Array.prototype.forEach.call(f,N=>Ft(N,e)),Array.prototype.forEach.call(v,N=>Ft(N,i))):L==="attributes"&&T===S.MEDIA_CHROME_ATTRIBUTES&&(zo(A)?e(A):i(A))})},s=[],l=b=>{let g=b.target;g.name!=="media"&&(s.forEach(f=>Ft(f,i)),s=[...g.assignedElements({flatten:!0})],s.forEach(f=>Ft(f,e)))};t.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{Ft(t,i),t.removeEventListener("slotchange",l),u.disconnect(),t.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",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,kt,Si,Yr,jo,bu,Vr={TOOLTIP_PLACEMENT:"tooltipplacement"},gu=h.createElement("template");gu.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 F=class extends d.HTMLElement{constructor(e={}){var i;if(super(),Si(this,os),Si(this,He,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",Si(this,Ci,a=>{this.preventClick||this.handleClick(a),setTimeout(j(this,St),0)}),Si(this,St,()=>{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,qr,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",Gr.TOOLTIP_PLACEMENT,S.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",j(this,Ci)),this.addEventListener("keydown",j(this,qr)),this.tabIndex=0}disable(){this.removeEventListener("click",j(this,Ci)),this.removeEventListener("keydown",j(this,qr)),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,He))==null?void 0:r.unassociateElement)==null||n.call(r,this),Yr(this,He,null)),a&&this.isConnected&&(Yr(this,He,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=j(this,He))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===Gr.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i&&(this.tooltipEl.placement=a),j(this,St).call(this)}connectedCallback(){var e,i,a;let{style:r}=$(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&&(Yr(this,He,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=j(this,He))==null?void 0:i.associateElement)==null||a.call(i,this)),d.customElements.whenDefined("media-tooltip").then(()=>op(this,os,ku).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=j(this,He))==null?void 0:e.unassociateElement)==null||i.call(e,this),Yr(this,He,null),this.removeEventListener("mouseenter",j(this,St)),this.removeEventListener("focus",j(this,St)),this.removeEventListener("click",j(this,Ci))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return R(this,Gr.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){I(this,Gr.TOOLTIP_PLACEMENT,e)}handleClick(e){}};He=new WeakMap;Ci=new WeakMap;St=new WeakMap;Ii=new WeakMap;qr=new WeakMap;os=new WeakSet;ku=function(){this.addEventListener("mouseenter",j(this,St)),this.addEventListener("focus",j(this,St)),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">
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,kt),0)}),ki(this,kt,()=>{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,kt).call(this)}connectedCallback(){var e,i,a;let{style:r}=W(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")||this.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,kt)),this.removeEventListener("focus",j(this,kt)),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;kt=new WeakMap;Si=new WeakMap;Yr=new WeakMap;jo=new WeakSet;bu=function(){this.addEventListener("mouseenter",j(this,kt)),this.addEventListener("focus",j(this,kt)),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">
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
- `,Mu=h.createElement("template");Mu.innerHTML=`
226
+ `,Tu=h.createElement("template");Tu.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">${Iu}</slot>
245
- <slot name="exit">${Iu}</slot>
244
+ <slot name="enter">${_u}</slot>
245
+ <slot name="exit">${_u}</slot>
246
246
  </slot>
247
- `;var sp=`
247
+ `;var tp=`
248
248
  <slot name="tooltip-enter">${C.ENTER_AIRPLAY}</slot>
249
249
  <slot name="tooltip-exit">${C.EXIT_AIRPLAY}</slot>
250
- `,Cu=t=>{let e=t.mediaIsAirplaying?Y.EXIT_AIRPLAY():Y.ENTER_AIRPLAY();t.setAttribute("aria-label",e)},ls=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_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_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",ls);var lp=`<svg aria-hidden="true" viewBox="0 0 26 24">
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">
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>`,dp=`<svg aria-hidden="true" viewBox="0 0 26 24">
252
+ </svg>`,ap=`<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>`,xu=h.createElement("template");xu.innerHTML=`
254
+ </svg>`,Iu=h.createElement("template");Iu.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">${lp}</slot>
273
- <slot name="off">${dp}</slot>
272
+ <slot name="on">${ip}</slot>
273
+ <slot name="off">${ap}</slot>
274
274
  </slot>
275
- `;var up=`
275
+ `;var rp=`
276
276
  <slot name="tooltip-enable">${C.ENABLE_CAPTIONS}</slot>
277
277
  <slot name="tooltip-disable">${C.DISABLE_CAPTIONS}</slot>
278
- `,Ru=t=>{t.setAttribute("aria-checked",Pr(t).toString())},ds=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:xu,tooltipContent:up,...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?$t(i):[]},Lu=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=lt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",ds);var cp='<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>',mp='<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=`
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?Ht(i):[]},Su=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=lt(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=`
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">${cp}</slot>
297
- <slot name="exit">${mp}</slot>
296
+ <slot name="enter">${np}</slot>
297
+ <slot name="exit">${op}</slot>
298
298
  </slot>
299
- `;var hp=`
299
+ `;var sp=`
300
300
  <slot name="tooltip-enter">${C.START_CAST}</slot>
301
301
  <slot name="tooltip-exit">${C.STOP_CAST}</slot>
302
- `,Du=t=>{let e=t.mediaIsCasting?Y.EXIT_CAST():Y.ENTER_CAST();t.setAttribute("aria-label",e)},us=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ou,tooltipContent:hp,...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",us);var Es=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yt=(t,e,i)=>(Es(t,e,"read from private field"),i?i.call(t):e.get(t)),ut=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},bs=(t,e,i,a)=>(Es(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Vt=(t,e,i)=>(Es(t,e,"access private method"),i),Qr,Ia,Gt,Zr,cs,ms,Nu,hs,Pu,ps,Uu,fs,Bu,vs,Hu;function pp(t){return`
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)},Vt=(t,e,i)=>(us(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)},cs=(t,e,i,a)=>(us(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Kt=(t,e,i)=>(us(t,e,"access private method"),i),qr,Sa,Yt,Gr,rs,ns,Ru,os,wu,ss,Lu,ls,xu,ds,Du;function lp(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 fp(t){return`
342
+ `}function dp(t){return`
343
343
  <slot id="content"></slot>
344
- `}var Sa={OPEN:"open",ANCHOR:"anchor"},qt=class extends d.HTMLElement{constructor(){super(),ut(this,Zr),ut(this,ms),ut(this,hs),ut(this,ps),ut(this,fs),ut(this,vs),ut(this,Qr,!1),ut(this,Ia,null),ut(this,Gt,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":Vt(this,ps,Uu).call(this,e);break;case"focusout":Vt(this,fs,Bu).call(this,e);break;case"keydown":Vt(this,vs,Hu).call(this,e);break}}connectedCallback(){Vt(this,Zr,cs).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){Vt(this,Zr,cs).call(this),e===Sa.OPEN&&a!==i&&(this.open?Vt(this,ms,Nu).call(this):Vt(this,hs,Pu).call(this))}focus(){bs(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;Gt=new WeakMap;Zr=new WeakSet;cs=function(){if(!Yt(this,Qr)&&(bs(this,Qr,!0),!this.shadowRoot)){this.attachShadow({mode:"open"});let t=Qd(this.attributes);this.shadowRoot.innerHTML=`
344
+ `}var ka={OPEN:"open",ANCHOR:"anchor"},Gt=class extends d.HTMLElement{constructor(){super(),ut(this,Gr),ut(this,ns),ut(this,os),ut(this,ss),ut(this,ls),ut(this,ds),ut(this,qr,!1),ut(this,Sa,null),ut(this,Yt,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":Kt(this,ss,Lu).call(this,e);break;case"focusout":Kt(this,ls,xu).call(this,e);break;case"keydown":Kt(this,ds,Du).call(this,e);break}}connectedCallback(){Kt(this,Gr,rs).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){Kt(this,Gr,rs).call(this),e===ka.OPEN&&a!==i&&(this.open?Kt(this,ns,Ru).call(this):Kt(this,os,wu).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;Yt=new WeakMap;Gr=new WeakSet;rs=function(){if(!Vt(this,qr)&&(cs(this,qr,!0),!this.shadowRoot)){this.attachShadow({mode:"open"});let t=Kd(this.attributes);this.shadowRoot.innerHTML=`
345
345
  ${this.constructor.getTemplateHTML(t)}
346
- `}};ms=new WeakSet;Nu=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})};hs=new WeakSet;Pu=function(){var t;(t=Yt(this,Gt))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};ps=new WeakSet;Uu=function(t){bs(this,Gt,t.relatedTarget),ue(this,t.relatedTarget)||(this.open=!this.open)};fs=new WeakSet;Bu=function(t){var e;ue(this,t.relatedTarget)||((e=Yt(this,Ia))==null||e.focus(),Yt(this,Gt)&&Yt(this,Gt)!==t.relatedTarget&&this.open&&(this.open=!1))};vs=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=Yt(this,Ia))==null||n.focus(),this.open=!1))};qt.getTemplateHTML=pp;qt.getSlotTemplateHTML=fp;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",qt);var Ss=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Q=(t,e,i)=>(Ss(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)=>(Ss(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Re=(t,e,i)=>(Ss(t,e,"access private method"),i),$e,on,zr,Xr,we,rn,Jr,jr,en,Is,$u,tn,gs,an,_s,nn,Cs,As,Wu,Ts,Fu,ys,Ku,ks,Vu,Yu=h.createElement("template");Yu.innerHTML=`
346
+ `}};ns=new WeakSet;Ru=function(){var t;(t=Vt(this,Yt))==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;wu=function(){var t;(t=Vt(this,Yt))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};ss=new WeakSet;Lu=function(t){cs(this,Yt,t.relatedTarget),ue(this,t.relatedTarget)||(this.open=!this.open)};ls=new WeakSet;xu=function(t){var e;ue(this,t.relatedTarget)||((e=Vt(this,Sa))==null||e.focus(),Vt(this,Yt)&&Vt(this,Yt)!==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=Vt(this,Sa))==null||n.focus(),this.open=!1))};Gt.getTemplateHTML=lp;Gt.getSlotTemplateHTML=dp;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",Gt);var bs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},z=(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)},St=(t,e,i,a)=>(bs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),we=(t,e,i)=>(bs(t,e,"access private method"),i),We,rn,Zr,Qr,Le,tn,zr,Xr,Jr,gs,Ou,jr,ms,en,hs,an,_s,ps,Nu,fs,Pu,vs,Uu,Es,Bu,Hu=h.createElement("template");Hu.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));
@@ -565,7 +565,7 @@
565
565
  <input id="range" type="range" min="0" max="1" step="any" value="0">
566
566
  </div>
567
567
  <div id="rightgap"></div>
568
- `;var Zt=class extends d.HTMLElement{constructor(){super(),oe(this,Is),oe(this,tn),oe(this,an),oe(this,nn),oe(this,As),oe(this,Ts),oe(this,ys),oe(this,ks),oe(this,$e,void 0),oe(this,on,void 0),oe(this,zr,void 0),oe(this,Xr,void 0),oe(this,we,{}),oe(this,rn,[]),oe(this,Jr,()=>{if(this.range.matches(":focus-visible")){let{style:e}=$(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),oe(this,jr,()=>{let{style:e}=$(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),oe(this,en,()=>{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"),It(this,zr,this.shadowRoot.querySelector("#startpoint")),It(this,Xr,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",S.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,n,s,l,u;e===S.MEDIA_CONTROLLER?(i&&((n=(r=Q(this,$e))==null?void 0:r.unassociateElement)==null||n.call(r,this),It(this,$e,null)),a&&this.isConnected&&(It(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Q(this,$e))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),Re(this,tn,gs).call(this)):(this.range.setAttribute(e,a),Re(this,an,_s).call(this)))}connectedCallback(){var e,i,a;let{style:r}=$(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),Q(this,we).pointer=$(this.shadowRoot,"#pointer"),Q(this,we).progress=$(this.shadowRoot,"#progress"),Q(this,we).thumb=$(this.shadowRoot,"#thumb"),Q(this,we).activeSegment=$(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(S.MEDIA_CONTROLLER);n&&(It(this,$e,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=Q(this,$e))==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,jr)),Re(this,tn,gs).call(this),nt(this.container,Q(this,en))}disconnectedCallback(){var e,i;Re(this,an,_s).call(this),(i=(e=Q(this,$e))==null?void 0:e.unassociateElement)==null||i.call(e,this),It(this,$e,null),this.shadowRoot.removeEventListener("focusin",Q(this,Jr)),this.shadowRoot.removeEventListener("focusout",Q(this,jr)),Ut(this.container,Q(this,en))}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,rn,[...a]);let r=a.pop();for(let[n,s]of a.entries()){let[l,u]=[n===0,n===a.length-1],c=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,g=`calc(${((u?r:a[n+1])-s)*100}%${l||u?"":" - var(--segments-gap)"})`,f=h.createElementNS("http://www.w3.org/2000/svg","rect"),v=$(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);v.style.setProperty("x",c),v.style.setProperty("width",g),i.append(f)}}getPointerRatio(e){let i=zd(e.clientX,e.clientY,Q(this,zr).getBoundingClientRect(),Q(this,Xr).getBoundingClientRect());return Math.max(0,Math.min(1,i))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Re(this,ks,Vu).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Re(this,As,Wu).call(this,e);break;case"pointerdown":Re(this,nn,Cs).call(this,e);break;case"pointerup":Re(this,Ts,Fu).call(this);break;case"pointerleave":Re(this,ys,Ku).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};$e=new WeakMap;on=new WeakMap;zr=new WeakMap;Xr=new WeakMap;we=new WeakMap;rn=new WeakMap;Jr=new WeakMap;jr=new WeakMap;en=new WeakMap;Is=new WeakSet;$u=function(t){let e=Q(this,we).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${Q(this,rn).findIndex((n,s,l)=>{let u=l[s+1];return u!=null&&i>=n&&i<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};tn=new WeakSet;gs=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};an=new WeakSet;_s=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(t=d.window)==null||t.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};nn=new WeakSet;Cs=function(t){var e;It(this,on,t.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};As=new WeakSet;Wu=function(t){var e;t.pointerType!=="mouse"&&Re(this,nn,Cs).call(this,t),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};Ts=new WeakSet;Fu=function(){var t;(t=d.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};ys=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,we).activeSegment)==null||e.style.removeProperty("transform")};ks=new WeakSet;Vu=function(t){this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),Re(this,Is,$u).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!Q(this,on))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",Zt);var Gu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},sn=(t,e,i)=>(Gu(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)},ln=(t,e,i,a)=>(Gu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),We,qu=h.createElement("template");qu.innerHTML=`
568
+ `;var qt=class extends d.HTMLElement{constructor(){super(),oe(this,gs),oe(this,jr),oe(this,en),oe(this,an),oe(this,ps),oe(this,fs),oe(this,vs),oe(this,Es),oe(this,We,void 0),oe(this,rn,void 0),oe(this,Zr,void 0),oe(this,Qr,void 0),oe(this,Le,{}),oe(this,tn,[]),oe(this,zr,()=>{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"),St(this,Zr,this.shadowRoot.querySelector("#startpoint")),St(this,Qr,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=z(this,We))==null?void 0:r.unassociateElement)==null||n.call(r,this),St(this,We,null)),a&&this.isConnected&&(St(this,We,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=z(this,We))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),we(this,jr,ms).call(this)):(this.range.setAttribute(e,a),we(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))`),z(this,Le).pointer=W(this.shadowRoot,"#pointer"),z(this,Le).progress=W(this.shadowRoot,"#progress"),z(this,Le).thumb=W(this.shadowRoot,"#thumb"),z(this,Le).activeSegment=W(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(S.MEDIA_CONTROLLER);n&&(St(this,We,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=z(this,We))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",z(this,zr)),this.shadowRoot.addEventListener("focusout",z(this,Xr)),we(this,jr,ms).call(this),nt(this.container,z(this,Jr))}disconnectedCallback(){var e,i;we(this,en,hs).call(this),(i=(e=z(this,We))==null?void 0:e.unassociateElement)==null||i.call(e,this),St(this,We,null),this.shadowRoot.removeEventListener("focusin",z(this,zr)),this.shadowRoot.removeEventListener("focusout",z(this,Xr)),Pt(this.container,z(this,Jr))}updatePointerBar(e){var i;(i=z(this,Le).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=z(this,Le).progress)==null||e.style.setProperty("width",`${a}%`),(i=z(this,Le).thumb)==null||i.style.setProperty("left",`${a}%`)}updateSegments(e){let i=this.shadowRoot.querySelector("#segments-clipping");if(i.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let a=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];St(this,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)"})`,f=h.createElementNS("http://www.w3.org/2000/svg","rect"),v=W(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);v.style.setProperty("x",c),v.style.setProperty("width",g),i.append(f)}}getPointerRatio(e){let i=Vd(e.clientX,e.clientY,z(this,Zr).getBoundingClientRect(),z(this,Qr).getBoundingClientRect());return Math.max(0,Math.min(1,i))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":we(this,Es,Bu).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":we(this,ps,Nu).call(this,e);break;case"pointerdown":we(this,an,_s).call(this,e);break;case"pointerup":we(this,fs,Pu).call(this);break;case"pointerleave":we(this,vs,Uu).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};We=new WeakMap;rn=new WeakMap;Zr=new WeakMap;Qr=new WeakMap;Le=new WeakMap;tn=new WeakMap;zr=new WeakMap;Xr=new WeakMap;Jr=new WeakMap;gs=new WeakSet;Ou=function(t){let e=z(this,Le).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${z(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;St(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"&&we(this,an,_s).call(this,t),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};fs=new WeakSet;Pu=function(){var t;(t=d.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};vs=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=z(this,Le).activeSegment)==null||e.style.removeProperty("transform")};Es=new WeakSet;Bu=function(t){this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),we(this,gs,Ou).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!z(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",qt);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=`
569
569
  <style>
570
570
  :host {
571
571
 
@@ -591,7 +591,7 @@
591
591
  </style>
592
592
 
593
593
  <slot></slot>
594
- `;var Ms=class extends d.HTMLElement{constructor(){super(),vp(this,We,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=sn(this,We))==null?void 0:r.unassociateElement)==null||n.call(r,this),ln(this,We,null)),a&&this.isConnected&&(ln(this,We,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=sn(this,We))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(S.MEDIA_CONTROLLER);r&&(ln(this,We,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=sn(this,We))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=sn(this,We))==null?void 0:e.unassociateElement)==null||i.call(e,this),ln(this,We,null)}};We=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Ms);var Zu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dn=(t,e,i)=>(Zu(t,e,"read from private field"),i?i.call(t):e.get(t)),Ep=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},un=(t,e,i,a)=>(Zu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fe,Qu=h.createElement("template");Qu.innerHTML=`
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=`
595
595
  <style>
596
596
  :host {
597
597
  font: var(--media-font,
@@ -624,7 +624,7 @@
624
624
  }
625
625
  </style>
626
626
  <slot></slot>
627
- `;var Le=class extends d.HTMLElement{constructor(){super(),Ep(this,Fe,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=dn(this,Fe))==null?void 0:r.unassociateElement)==null||n.call(r,this),un(this,Fe,null)),a&&this.isConnected&&(un(this,Fe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=dn(this,Fe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let{style:r}=$(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(S.MEDIA_CONTROLLER);n&&(un(this,Fe,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(i=dn(this,Fe))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=dn(this,Fe))==null?void 0:e.unassociateElement)==null||i.call(e,this),un(this,Fe,null)}};Fe=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",Le);var Xu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},zu=(t,e,i)=>(Xu(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)},gp=(t,e,i,a)=>(Xu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ca,Rs=class extends Le{constructor(){super(),bp(this,Ca,void 0),gp(this,Ca,this.shadowRoot.querySelector("slot")),zu(this,Ca).textContent=Ne(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===o.MEDIA_DURATION&&(zu(this,Ca).textContent=Ne(+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",Rs);var ju=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_p=(t,e,i)=>(ju(t,e,"read from private field"),i?i.call(t):e.get(t)),Ap=(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)},Tp=(t,e,i,a)=>(ju(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),cn;function yp(t){return`
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)),fp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},vp=(t,e,i,a)=>(qu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),dn;function Ep(t){return`
628
628
  <style>
629
629
  :host {
630
630
  background: rgb(20 20 30 / .8);
@@ -641,13 +641,13 @@
641
641
  }
642
642
  </style>
643
643
  <slot name="error-${t.mediaerrorcode}" id="content">
644
- ${ec({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
644
+ ${Zu({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
645
645
  </slot>
646
- `}function kp(t){return t.code&&$o(t)!==null}function ec(t){var e;let{title:i,message:a}=(e=$o(t))!=null?e:{},r="";return i&&(r+=`<slot name="error-${t.code}-title"><h3>${i}</h3></slot>`),a&&(r+=`<slot name="error-${t.code}-message"><p>${a}</p></slot>`),r}var Ju=[o.MEDIA_ERROR_CODE,o.MEDIA_ERROR_MESSAGE],Mi=class extends qt{constructor(){super(...arguments),Ap(this,cn,null)}static get observedAttributes(){return[...super.observedAttributes,...Ju]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!Ju.includes(e))return;let n=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=kp(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return _p(this,cn)}set mediaError(e){Tp(this,cn,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)}};cn=new WeakMap;Mi.getSlotTemplateHTML=yp;Mi.formatErrorMessage=ec;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",Mi);var mn=Mi;var Sp=`<svg aria-hidden="true" viewBox="0 0 26 24">
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 Gt{constructor(){super(...arguments),fp(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){vp(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">
647
647
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
648
- </svg>`,Ip=`<svg aria-hidden="true" viewBox="0 0 26 24">
648
+ </svg>`,_p=`<svg aria-hidden="true" viewBox="0 0 26 24">
649
649
  <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>`,ic=h.createElement("template");ic.innerHTML=`
650
+ </svg>`,zu=h.createElement("template");zu.innerHTML=`
651
651
  <style>
652
652
  :host([${o.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
653
653
  display: none !important;
@@ -665,13 +665,13 @@
665
665
  </style>
666
666
 
667
667
  <slot name="icon">
668
- <slot name="enter">${Sp}</slot>
669
- <slot name="exit">${Ip}</slot>
668
+ <slot name="enter">${gp}</slot>
669
+ <slot name="exit">${_p}</slot>
670
670
  </slot>
671
- `;var Cp=`
671
+ `;var Ap=`
672
672
  <slot name="tooltip-enter">${C.ENTER_FULLSCREEN}</slot>
673
673
  <slot name="tooltip-exit">${C.EXIT_FULLSCREEN}</slot>
674
- `,tc=t=>{let e=t.mediaIsFullscreen?Y.EXIT_FULLSCREEN():Y.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)},ws=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:ic,tooltipContent:Cp,...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",ws);var{MEDIA_TIME_IS_LIVE:hn,MEDIA_PAUSED:Ma}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Mp,MEDIA_PLAY_REQUEST:Rp}=p,wp='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',rc=h.createElement("template");rc.innerHTML=`
674
+ `,Qu=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:zu,tooltipContent:Ap,...e})}connectedCallback(){super.connectedCallback(),Qu(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_IS_FULLSCREEN&&Qu(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=`
675
675
  <style>
676
676
  :host { --media-tooltip-display: none; }
677
677
 
@@ -683,22 +683,22 @@
683
683
  color: var(--media-live-button-icon-color, rgb(140, 140, 140));
684
684
  }
685
685
 
686
- :host([${hn}]:not([${Ma}])) slot[name=indicator] > *,
687
- :host([${hn}]:not([${Ma}])) ::slotted([slot=indicator]) {
686
+ :host([${cn}]:not([${Ca}])) slot[name=indicator] > *,
687
+ :host([${cn}]:not([${Ca}])) ::slotted([slot=indicator]) {
688
688
  fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
689
689
  color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
690
690
  }
691
691
 
692
- :host([${hn}]:not([${Ma}])) {
692
+ :host([${cn}]:not([${Ca}])) {
693
693
  cursor: not-allowed;
694
694
  }
695
695
 
696
696
  </style>
697
697
 
698
- <slot name="indicator">${wp}</slot>
698
+ <slot name="indicator">${kp}</slot>
699
699
 
700
700
  <slot name="spacer">&nbsp;</slot><slot name="text">LIVE</slot>
701
- `;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")},Ls=class extends F{static get observedAttributes(){return[...super.observedAttributes,Ma,hn]}constructor(e={}){super({slotTemplate:rc,...e})}connectedCallback(){ac(this),super.connectedCallback()}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),ac(this)}get mediaPaused(){return 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(Mp,{composed:!0,bubbles:!0})),this.hasAttribute(Ma)&&this.dispatchEvent(new d.CustomEvent(Rp,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Ls);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),Ke,pn,oc={LOADING_DELAY:"loadingdelay"},lc=500,dc=h.createElement("template"),Lp=`
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=`
702
702
  <svg aria-hidden="true" viewBox="0 0 100 100">
703
703
  <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
704
  <animateTransform
@@ -711,13 +711,13 @@
711
711
  repeatCount="indefinite" />
712
712
  </path>
713
713
  </svg>
714
- `;dc.innerHTML=`
714
+ `;ac.innerHTML=`
715
715
  <style>
716
716
  :host {
717
717
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
718
718
  vertical-align: middle;
719
719
  box-sizing: border-box;
720
- --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${lc}ms);
720
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${ic}ms);
721
721
  }
722
722
 
723
723
  #status {
@@ -756,52 +756,52 @@ svg, img, ::slotted(svg), ::slotted(img) {
756
756
  }
757
757
  </style>
758
758
 
759
- <slot name="icon">${Lp}</slot>
760
- <div id="status" role="status" aria-live="polite">${V.MEDIA_LOADING()}</div>
761
- `;var xs=class extends d.HTMLElement{constructor(){if(super(),nc(this,Ke,void 0),nc(this,pn,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,Ke))==null?void 0:r.unassociateElement)==null||n.call(r,this),wa(this,Ke,null)),a&&this.isConnected&&(wa(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ra(this,Ke))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(S.MEDIA_CONTROLLER);r&&(wa(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Ra(this,Ke))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Ra(this,Ke))==null?void 0:e.unassociateElement)==null||i.call(e,this),wa(this,Ke,null)}get loadingDelay(){return Ra(this,pn)}set loadingDelay(e){wa(this,pn,e);let{style:i}=$(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)}};Ke=new WeakMap;pn=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",xs);var{MEDIA_VOLUME_LEVEL:Qt}=o,xp=`<svg aria-hidden="true" viewBox="0 0 24 24">
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">
762
762
  <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>`,uc=`<svg aria-hidden="true" viewBox="0 0 24 24">
763
+ </svg>`,rc=`<svg aria-hidden="true" viewBox="0 0 24 24">
764
764
  <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>`,Dp=`<svg aria-hidden="true" viewBox="0 0 24 24">
765
+ </svg>`,Cp=`<svg aria-hidden="true" viewBox="0 0 24 24">
766
766
  <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>`,mc=h.createElement("template");mc.innerHTML=`
767
+ </svg>`,oc=h.createElement("template");oc.innerHTML=`
768
768
  <style>
769
769
 
770
- :host(:not([${Qt}])) slot[name=icon] slot:not([name=high]),
771
- :host([${Qt}=high]) slot[name=icon] slot:not([name=high]) {
770
+ :host(:not([${Zt}])) slot[name=icon] slot:not([name=high]),
771
+ :host([${Zt}=high]) slot[name=icon] slot:not([name=high]) {
772
772
  display: none !important;
773
773
  }
774
774
 
775
- :host([${Qt}=off]) slot[name=icon] slot:not([name=off]) {
775
+ :host([${Zt}=off]) slot[name=icon] slot:not([name=off]) {
776
776
  display: none !important;
777
777
  }
778
778
 
779
- :host([${Qt}=low]) slot[name=icon] slot:not([name=low]) {
779
+ :host([${Zt}=low]) slot[name=icon] slot:not([name=low]) {
780
780
  display: none !important;
781
781
  }
782
782
 
783
- :host([${Qt}=medium]) slot[name=icon] slot:not([name=medium]) {
783
+ :host([${Zt}=medium]) slot[name=icon] slot:not([name=medium]) {
784
784
  display: none !important;
785
785
  }
786
786
 
787
- :host(:not([${Qt}=off])) slot[name=tooltip-unmute],
788
- :host([${Qt}=off]) slot[name=tooltip-mute] {
787
+ :host(:not([${Zt}=off])) slot[name=tooltip-unmute],
788
+ :host([${Zt}=off]) slot[name=tooltip-mute] {
789
789
  display: none;
790
790
  }
791
791
  </style>
792
792
 
793
793
  <slot name="icon">
794
- <slot name="off">${xp}</slot>
795
- <slot name="low">${uc}</slot>
796
- <slot name="medium">${uc}</slot>
797
- <slot name="high">${Dp}</slot>
794
+ <slot name="off">${Ip}</slot>
795
+ <slot name="low">${rc}</slot>
796
+ <slot name="medium">${rc}</slot>
797
+ <slot name="high">${Cp}</slot>
798
798
  </slot>
799
- `;var Op=`
799
+ `;var Mp=`
800
800
  <slot name="tooltip-mute">${C.MUTE}</slot>
801
801
  <slot name="tooltip-unmute">${C.UNMUTE}</slot>
802
- `,cc=t=>{let i=t.mediaVolumeLevel==="off"?Y.UNMUTE():Y.MUTE();t.setAttribute("aria-label",i)},Ds=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:mc,tooltipContent:Op,...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",Ds);var hc=`<svg aria-hidden="true" viewBox="0 0 28 24">
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">
803
803
  <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>`,fc=h.createElement("template");fc.innerHTML=`
804
+ </svg>`,dc=h.createElement("template");dc.innerHTML=`
805
805
  <style>
806
806
  :host([${o.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
807
807
  display: none !important;
@@ -819,13 +819,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
819
819
  </style>
820
820
 
821
821
  <slot name="icon">
822
- <slot name="enter">${hc}</slot>
823
- <slot name="exit">${hc}</slot>
822
+ <slot name="enter">${sc}</slot>
823
+ <slot name="exit">${sc}</slot>
824
824
  </slot>
825
- `;var Np=`
825
+ `;var Rp=`
826
826
  <slot name="tooltip-enter">${C.ENTER_PIP}</slot>
827
827
  <slot name="tooltip-exit">${C.EXIT_PIP}</slot>
828
- `,pc=t=>{let e=t.mediaIsPip?Y.EXIT_PIP():Y.ENTER_PIP();t.setAttribute("aria-label",e)},Os=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:fc,tooltipContent:Np,...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",Os);var Pp=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},fn=(t,e,i)=>(Pp(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)},Ri,Ns={RATES:"rates"},Us=[1,1.2,1.5,1.7,2],wi=1,vc=h.createElement("template");vc.innerHTML=`
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 wp=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},hn=(t,e,i)=>(wp(t,e,"read from private field"),i?i.call(t):e.get(t)),Lp=(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"},ws=[1,1.2,1.5,1.7,2],Ri=1,uc=h.createElement("template");uc.innerHTML=`
829
829
  <style>
830
830
  :host {
831
831
  min-width: 5ch;
@@ -833,11 +833,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
833
833
  }
834
834
  </style>
835
835
  <slot name="icon"></slot>
836
- `;var Ps=class extends F{constructor(e={}){super({slotTemplate:vc,tooltipContent:C.PLAYBACK_RATE,...e}),Up(this,Ri,new Ue(this,Ns.RATES,{defaultValue:Us})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${wi}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Ns.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===Ns.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",Ps);var Bp=`<svg aria-hidden="true" viewBox="0 0 24 24">
836
+ `;var Rs=class extends K{constructor(e={}){super({slotTemplate:uc,tooltipContent:C.PLAYBACK_RATE,...e}),Lp(this,Mi,new Be(this,Ms.RATES,{defaultValue:ws})),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">
837
837
  <path d="m6 21 15-9L6 3v18Z"/>
838
- </svg>`,Hp=`<svg aria-hidden="true" viewBox="0 0 24 24">
838
+ </svg>`,Dp=`<svg aria-hidden="true" viewBox="0 0 24 24">
839
839
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
840
- </svg>`,bc=h.createElement("template");bc.innerHTML=`
840
+ </svg>`,mc=h.createElement("template");mc.innerHTML=`
841
841
  <style>
842
842
  :host([${o.MEDIA_PAUSED}]) slot[name=pause],
843
843
  :host(:not([${o.MEDIA_PAUSED}])) slot[name=play] {
@@ -851,13 +851,13 @@ svg, img, ::slotted(svg), ::slotted(img) {
851
851
  </style>
852
852
 
853
853
  <slot name="icon">
854
- <slot name="play">${Bp}</slot>
855
- <slot name="pause">${Hp}</slot>
854
+ <slot name="play">${xp}</slot>
855
+ <slot name="pause">${Dp}</slot>
856
856
  </slot>
857
- `;var $p=`
857
+ `;var Op=`
858
858
  <slot name="tooltip-play">${C.PLAY}</slot>
859
859
  <slot name="tooltip-pause">${C.PAUSE}</slot>
860
- `,Ec=t=>{let e=t.mediaPaused?Y.PLAY():Y.PAUSE();t.setAttribute("aria-label",e)},Bs=class extends F{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:bc,tooltipContent:$p,...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",Bs);var Ve={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},gc=h.createElement("template");gc.innerHTML=`
860
+ `,cc=t=>{let e=t.mediaPaused?G.PLAY():G.PAUSE();t.setAttribute("aria-label",e)},Ls=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",Ls);var Ye={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},hc=h.createElement("template");hc.innerHTML=`
861
861
  <style>
862
862
  :host {
863
863
  pointer-events: none;
@@ -879,7 +879,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
879
879
  </style>
880
880
 
881
881
  <img part="poster img" aria-hidden="true" id="image"/>
882
- `;var Wp=t=>{t.style.removeProperty("background-image")},Fp=(t,e)=>{t.style["background-image"]=`url('${e}')`},Hs=class extends d.HTMLElement{static get observedAttributes(){return[Ve.PLACEHOLDER_SRC,Ve.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===Ve.SRC&&(a==null?this.image.removeAttribute(Ve.SRC):this.image.setAttribute(Ve.SRC,a)),e===Ve.PLACEHOLDER_SRC&&(a==null?Wp(this.image):Fp(this.image,a))}get placeholderSrc(){return R(this,Ve.PLACEHOLDER_SRC)}set placeholderSrc(e){I(this,Ve.SRC,e)}get src(){return R(this,Ve.SRC)}set src(e){I(this,Ve.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Hs);var _c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Kp=(t,e,i)=>(_c(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)},Yp=(t,e,i,a)=>(_c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),vn,$s=class extends Le{constructor(){super(),Vp(this,vn,void 0),Yp(this,vn,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&&(Kp(this,vn).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)}};vn=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",$s);var Ac=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},En=(t,e,i)=>(Ac(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)},bn=(t,e,i,a)=>(Ac(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ye,Tc=h.createElement("template");Tc.innerHTML=`
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 fc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},fn=(t,e,i)=>(fc(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)},vn=(t,e,i,a)=>(fc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ge,vc=h.createElement("template");vc.innerHTML=`
883
883
  <style>
884
884
  :host {
885
885
  box-sizing: border-box;
@@ -893,11 +893,11 @@ svg, img, ::slotted(svg), ::slotted(img) {
893
893
  }
894
894
  </style>
895
895
  <img crossorigin loading="eager" decoding="async">
896
- `;var Ws=class extends d.HTMLElement{constructor(){super(),Gp(this,Ye,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&&(bn(this,Ye,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=En(this,Ye))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=En(this,Ye))==null?void 0:e.unassociateElement)==null||i.call(e,this),bn(this,Ye,null)}attributeChangedCallback(e,i,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===S.MEDIA_CONTROLLER&&(i&&((n=(r=En(this,Ye))==null?void 0:r.unassociateElement)==null||n.call(r,this),bn(this,Ye,null)),a&&this.isConnected&&(bn(this,Ye,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=En(this,Ye))==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:f}=u,v=Math.min(parseInt(c)/n,parseInt(b)/s),L=Math.max(parseInt(g)/n,parseInt(f)/s),A=v<1,T=A?v:L>1?L:1,{style:N}=$(this.shadowRoot,":host"),ee=$(this.shadowRoot,"img").style,be=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"};be.src!==l&&(be.onload=()=>{this.imgWidth=be.naturalWidth,this.imgHeight=be.naturalHeight,at()},be.src=l,at()),at(),ee.transform=`translate(-${a*T}px, -${r*T}px)`}};Ye=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Ws);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)),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),La,Fs=class extends Le{constructor(){super(),qp(this,La,void 0),Zp(this,La,this.shadowRoot.querySelector("slot")),yc(this,La).textContent=Ne(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=Ne(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",Fs);var Li={SEEK_OFFSET:"seekoffset"},gn=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)">${gn}</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=`
897
- <slot name="icon">${Qp}</slot>
898
- `;var zp=0,Ks=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,gn),super.connectedCallback()}attributeChangedCallback(e,i,a){e===Li.SEEK_OFFSET&&(this.seekOffset=M(this,Li.SEEK_OFFSET,gn)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return M(this,Li.SEEK_OFFSET,gn)}set seekOffset(e){D(this,Li.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Ir(Cr(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",Ks);var xi={SEEK_OFFSET:"seekoffset"},_n=30,Xp=`<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)">${_n}</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=`
899
- <slot name="icon">${Xp}</slot>
900
- `;var Jp=0,Vs=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,_n),super.connectedCallback()}attributeChangedCallback(e,i,a){e===xi.SEEK_OFFSET&&(this.seekOffset=M(this,xi.SEEK_OFFSET,_n)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return M(this,xi.SEEK_OFFSET,_n)}set seekOffset(e){D(this,xi.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Ir(Cr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,Jp)}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",Vs);var wc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ys=(t,e,i)=>(wc(t,e,"read from private field"),i?i.call(t):e.get(t)),jp=(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)=>(wc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Di,xe={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Cc=[...Object.values(xe),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],Mc=["Enter"," "],tf="&nbsp;/&nbsp;",Rc=(t,{timesSep:e=tf}={})=>{var i,a;let r=t.hasAttribute(xe.REMAINING),n=t.hasAttribute(xe.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?Ne(0-(u-s)):Ne(s);return n?`${c}${e}${Ne(u)}`:c},af="video not loaded, unknown time.",rf=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",af);return}let n=t.hasAttribute(xe.REMAINING),s=t.hasAttribute(xe.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)},Gs=class extends Le{constructor(){super(),jp(this,Di,void 0),ef(this,Di,this.shadowRoot.querySelector("slot")),Ys(this,Di).innerHTML=`${Rc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Cc,"disabled"]}connectedCallback(){let{style:e}=$(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,xe.REMAINING)}set remaining(e){U(this,xe.REMAINING,e)}get showDuration(){return H(this,xe.SHOW_DURATION)}set showDuration(e){U(this,xe.SHOW_DURATION,e)}get noToggle(){return H(this,xe.NO_TOGGLE)}set noToggle(e){U(this,xe.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);rf(this),e!==Ys(this,Di).innerHTML&&(Ys(this,Di).innerHTML=e)}};Di=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",Gs);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)),Ge=(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)},ye=(t,e,i,a)=>(Lc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),nf=(t,e,i,a)=>({set _(r){ye(t,e,r,i)},get _(){return re(t,e,a)}}),Oi,An,Ni,xa,Tn,yn,kn,Pi,zt,Sn,In=class{constructor(e,i,a){Ge(this,Oi,void 0),Ge(this,An,void 0),Ge(this,Ni,void 0),Ge(this,xa,void 0),Ge(this,Tn,void 0),Ge(this,yn,void 0),Ge(this,kn,void 0),Ge(this,Pi,void 0),Ge(this,zt,0),Ge(this,Sn,(r=performance.now())=>{ye(this,zt,requestAnimationFrame(re(this,Sn))),ye(this,xa,performance.now()-re(this,Ni));let n=1e3/this.fps;if(re(this,xa)>n){ye(this,Ni,r-re(this,xa)%n);let s=1e3/((r-re(this,An))/++nf(this,Tn)._),l=(r-re(this,yn))/1e3/this.duration,u=re(this,kn)+l*this.playbackRate;u-re(this,Oi).valueAsNumber>0?ye(this,Pi,this.playbackRate/this.duration/s):(ye(this,Pi,.995*re(this,Pi)),u=re(this,Oi).valueAsNumber+re(this,Pi)),this.callback(u)}}),ye(this,Oi,e),this.callback=i,this.fps=a}start(){re(this,zt)===0&&(ye(this,Ni,performance.now()),ye(this,An,re(this,Ni)),ye(this,Tn,0),re(this,Sn).call(this))}stop(){re(this,zt)!==0&&(cancelAnimationFrame(re(this,zt)),ye(this,zt,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),ye(this,kn,e),ye(this,yn,performance.now()),this.duration=i,this.playbackRate=a}};Oi=new WeakMap;An=new WeakMap;Ni=new WeakMap;xa=new WeakMap;Tn=new WeakMap;yn=new WeakMap;kn=new WeakMap;Pi=new WeakMap;zt=new WeakMap;Sn=new WeakMap;var Xs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},te=(t,e,i)=>(Xs(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)=>(Xs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),le=(t,e,i)=>(Xs(t,e,"access private method"),i),Ui,Xt,Rn,Oa,wn,Mn,Na,Pa,Bi,Hi,Da,Js,xc,qs,Ln,js,xn,el,Dn,tl,Zs,Dc,Ua,On,Qs,Oc,of="video not loaded, unknown time.",sf=t=>{let e=t.range,i=Pt(+Pc(t)),a=Pt(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:of;e.setAttribute("aria-valuetext",r)},Nc=h.createElement("template");Nc.innerHTML=`
896
+ `;var Os=class extends d.HTMLElement{constructor(){super(),$p(this,Ge,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(vc.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&&(vn(this,Ge,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=fn(this,Ge))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=fn(this,Ge))==null?void 0:e.unassociateElement)==null||i.call(e,this),vn(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=fn(this,Ge))==null?void 0:r.unassociateElement)==null||n.call(r,this),vn(this,Ge,null)),a&&this.isConnected&&(vn(this,Ge,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=fn(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:f}=u,v=Math.min(parseInt(c)/n,parseInt(b)/s),L=Math.max(parseInt(g)/n,parseInt(f)/s),A=v<1,T=A?v:L>1?L:1,{style:N}=W(this.shadowRoot,":host"),ee=W(this.shadowRoot,"img").style,ge=this.shadowRoot.querySelector("img"),vt=A?"min":"max";N.setProperty(`${vt}-width`,"initial","important"),N.setProperty(`${vt}-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),wa,Ns=class extends xe{constructor(){super(),Wp(this,wa,void 0),Fp(this,wa,this.shadowRoot.querySelector("slot")),Ec(this,wa).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,wa).textContent=Pe(parseFloat(a)))}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){D(this,o.MEDIA_PREVIEW_TIME,e)}};wa=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Ns);var wi={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,wi.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:gc,tooltipContent:C.SEEK_BACKWARD,...e})}connectedCallback(){this.seekOffset=M(this,wi.SEEK_OFFSET,En),super.connectedCallback()}attributeChangedCallback(e,i,a){e===wi.SEEK_OFFSET&&(this.seekOffset=M(this,wi.SEEK_OFFSET,En)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return M(this,wi.SEEK_OFFSET,En)}set seekOffset(e){D(this,wi.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 Li={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,Li.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:_c,tooltipContent:C.SEEK_FORWARD,...e})}connectedCallback(){this.seekOffset=M(this,Li.SEEK_OFFSET,bn),super.connectedCallback()}attributeChangedCallback(e,i,a){e===Li.SEEK_OFFSET&&(this.seekOffset=M(this,Li.SEEK_OFFSET,bn)),super.attributeChangedCallback(e,i,a)}get seekOffset(){return M(this,Li.SEEK_OFFSET,bn)}set seekOffset(e){D(this,Li.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"," "],Qp="&nbsp;/&nbsp;",yc=(t,{timesSep:e=Qp}={})=>{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},zp="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",zp);return}let n=t.hasAttribute(De.REMAINING),s=t.hasAttribute(De.SHOW_DURATION),l=n?Nt(0-(r-i)):Nt(i);if(!s){t.setAttribute("aria-valuetext",l);return}let u=Nt(r),c=`${l} of ${u}`;t.setAttribute("aria-valuetext",c)},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,La,_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,La,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,La,performance.now()-re(this,Oi));let n=1e3/this.fps;if(re(this,La)>n){ke(this,Oi,r-re(this,La)%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;La=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,zt,Cn,Da,Mn,In,Oa,Na,Ui,Bi,xa,Ys,Ic,$s,Rn,Gs,wn,qs,Ln,Zs,Ws,Cc,Pa,xn,Fs,Mc,jp="video not loaded, unknown time.",ef=t=>{let e=t.range,i=Nt(+wc(t)),a=Nt(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:jp;e.setAttribute("aria-valuetext",r)},Rc=h.createElement("template");Rc.innerHTML=`
901
901
  <style>
902
902
  :host {
903
903
  --media-box-border-radius: 4px;
@@ -1110,7 +1110,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1110
1110
 
1111
1111
  </slot>
1112
1112
  </div>
1113
- `;var Cn=(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},zs=class extends Zt{constructor(){super(),ne(this,Hi),ne(this,Js),ne(this,Ln),ne(this,xn),ne(this,Dn),ne(this,Zs),ne(this,Ua),ne(this,Qs),ne(this,Ui,void 0),ne(this,Xt,void 0),ne(this,Rn,void 0),ne(this,Oa,void 0),ne(this,wn,void 0),ne(this,Mn,void 0),ne(this,Na,void 0),ne(this,Pa,void 0),ne(this,Bi,void 0),ne(this,qs,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,Rn,this.shadowRoot.querySelectorAll('[part~="box"]')),qe(this,wn,this.shadowRoot.querySelector('[part~="preview-box"]')),qe(this,Mn,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,Xt,new In(this.range,te(this,qs),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,Xt).update({start:Cn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,Hi,Da).call(this),sf(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:Cn(this,a.startTime),end:Cn(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=Cn(this,s)}let{style:r}=$(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=$(this.shadowRoot,"#current-rail"),a=$(this.shadowRoot,'[part~="current-box"]'),r=le(this,Ln,js).call(this,te(this,Mn)),n=le(this,xn,el).call(this,r,this.range.valueAsNumber),s=le(this,Dn,tl).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,Qs,Oc).call(this);break;case"pointermove":le(this,Zs,Dc).call(this,e);break;case"pointerup":case"pointerleave":le(this,Ua,On).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>le(this,Hi,Da).call(this),0);break}}};Ui=new WeakMap;Xt=new WeakMap;Rn=new WeakMap;Oa=new WeakMap;wn=new WeakMap;Mn=new WeakMap;Na=new WeakMap;Pa=new WeakMap;Bi=new WeakMap;Hi=new WeakSet;Da=function(){le(this,Js,xc).call(this)?te(this,Xt).start():te(this,Xt).stop()};Js=new WeakSet;xc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Mr(this)};qs=new WeakMap;Ln=new WeakSet;js=function(t){var e;let a=((e=this.getAttribute("bounds")?Pe(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}};xn=new WeakSet;el=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};Dn=new WeakSet;tl=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};Zs=new WeakSet;Dc=function(t){let e=[...te(this,Rn)].some(b=>t.composedPath().includes(b));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,Ua,On).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=$(this.shadowRoot,"#preview-rail"),r=$(this.shadowRoot,'[part~="preview-box"]'),n=le(this,Ln,js).call(this,te(this,wn)),s=(t.clientX-n.range.left)/n.range.width;s=Math.max(0,Math.min(1,s));let l=le(this,xn,el).call(this,n,s),u=le(this,Dn,tl).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,On).call(this,te(this,Oa)))};Ua=new WeakSet;On=function(t){this.dispatchEvent(new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Qs=new WeakSet;Oc=function(){te(this,Xt).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",zs);var $i={PLACEMENT:"placement",BOUNDS:"bounds"},Uc=h.createElement("template");Uc.innerHTML=`
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))},wc=(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 qt{constructor(){super(),ne(this,Bi),ne(this,Ys),ne(this,Rn),ne(this,wn),ne(this,Ln),ne(this,Ws),ne(this,Pa),ne(this,Fs),ne(this,Pi,void 0),ne(this,zt,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||(vi(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,zt,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,zt).update({start:Sn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,Bi,xa).call(this),ef(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,wn,qs).call(this,r,this.range.valueAsNumber),s=le(this,Ln,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;zt=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,zt).start():te(this,zt).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}};wn=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};Ln=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,wn,qs).call(this,n,s),u=le(this,Ln,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,zt).stop();let t=wc(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"},Lc=h.createElement("template");Lc.innerHTML=`
1114
1114
  <style>
1115
1115
  :host {
1116
1116
  --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
@@ -1220,8 +1220,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
1220
1220
  </style>
1221
1221
  <slot></slot>
1222
1222
  <div id="arrow"></div>
1223
- `;var il=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Mr(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=Pe(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"),f=g?parseFloat(g.replace("px","")):0,v=a.getPropertyValue("--media-tooltip-container-margin"),L=v?parseFloat(v.replace("px","")):0,A=l-n+f-L,T=c-b+f+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",il);var lf=1,df=t=>t.mediaMuted?0:t.mediaVolume,uf=t=>`${Math.round(t*100)}%`,al=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=df(this),this.range.setAttribute("aria-valuetext",uf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,lf)}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",al);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 ei=require("@mux/playback-core");function Bc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Nn(i)}: ${a}; `)}),e?e.trim():void 0}function Nn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Pn(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 rl(t){let e=cf(t).toString();return e?"?"+e:""}function cf(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var nl=(t,e)=>!t||!e?!1:t.contains(e)?!0:nl(t,e.getRootNode().host);var Hc="mux.com",mf=()=>{try{return"3.2.3"}catch{}return"UNKNOWN"},hf=mf(),Bn=()=>hf,$c=(t,{token:e,customDomain:i=Hc,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${rl({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,ei.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${i}/${t}/storyboard.vtt${rl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ba=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 pf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Fc(t){var e;return(e=pf[t])!=null?e:Pn(t)}var Jt,jt,me,Un=class{constructor(e,i){X(this,Jt,void 0);X(this,jt,void 0);X(this,me,[]);Ae(this,Jt,e),Ae(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&&(Ae(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 Vc=`[mux-player ${Bn()}]`;function Ze(...t){console.warn(Vc,...t)}function Ee(...t){console.error(Vc,...t)}function ol(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Kc.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"},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}}),ff=qc.VideoEvents.filter(t=>t!=="error"),vf=Object.values(de).filter(t=>![de.PLAYSINLINE].includes(t)),Ef=Object.values(ti),sl=class extends pe.HTMLElement{static get observedAttributes(){return[...vf,...Ef]}constructor(){super()}init(){ff.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: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(ti.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ti.PLAYBACKRATE,`${e}`):this.removeAttribute(ti.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){Ee("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(de.PRELOAD,e):this.removeAttribute(de.PRELOAD)}};function Ha(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var ll=sl;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)),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)},ct=(t,e,i,a)=>(Jc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Wi,Hn,ii,$a,Ct,Mt,Rt,ai,Fi,$n,De,Zc=1,Qc=0,bf=1,gf={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}}}},mt=class extends d.DocumentFragment{constructor(e,i,a=gf){var r;super(),Qe(this,Wi,void 0),Qe(this,Hn,void 0),this.append(e.content.cloneNode(!0)),ct(this,Wi,jc(this)),ct(this,Hn,a),(r=a.createCallback)==null||r.call(a,this,k(this,Wi),i),a.processCallback(this,k(this,Wi),i)}update(e){k(this,Hn).processCallback(this,k(this,Wi),e)}};Wi=new WeakMap;Hn=new WeakMap;var jc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let n=new dl;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 ht(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},zc={},Xc=t=>{let e="",i=0,a=zc[t],r=0,n;if(a)return a;for(a=[];n=t[r];r++)n==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([Qc,e]),e="",r++):n==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([bf,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Qc,(i>0?"{{":"")+e]),zc[t]=a},_f=11,Wn=class{get value(){return""}set value(e){}toString(){return this.value}},em=new WeakMap,dl=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&&em.set(i,this),k(this,ii).push(i)}toString(){return k(this,ii).join("")}};ii=new WeakMap;var he=class extends Wn{constructor(e,i,a){super(),Qe(this,ai),Qe(this,$a,""),Qe(this,Ct,void 0),Qe(this,Mt,void 0),Qe(this,Rt,void 0),ct(this,Ct,e),ct(this,Mt,i),ct(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,$a)}set value(e){k(this,$a)!==e&&(ct(this,$a,e),!k(this,ai,Fi)||k(this,ai,Fi).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,Fi).toString()))}get booleanValue(){return k(this,Ct).hasAttributeNS(k(this,Rt),k(this,Mt))}set booleanValue(e){if(!k(this,ai,Fi)||k(this,ai,Fi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};$a=new WeakMap;Ct=new WeakMap;Mt=new WeakMap;Rt=new WeakMap;ai=new WeakSet;Fi=function(){return em.get(this)};var ht=class extends Wn{constructor(e,i){super(),Qe(this,$n,void 0),Qe(this,De,void 0),ct(this,$n,e),ct(this,De,i?[...i]:[new Text])}get replacementNodes(){return k(this,De)}get parentNode(){return k(this,$n)}get nextSibling(){return k(this,De)[k(this,De).length-1].nextSibling}get previousSibling(){return k(this,De)[0].previousSibling}get value(){return k(this,De).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===_f?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),ct(this,De,Af(k(this,De)[0].parentNode,k(this,De),i,this.nextSibling))}};$n=new WeakMap;De=new WeakMap;var Wa=class extends ht{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 Af(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)},Kn=class{constructor(e){this.template=e,this.state=void 0}},ri=new WeakMap,ni=new WeakMap,ul={partial:(t,e)=>{e[t.expression]=new Kn(t.template)},if:(t,e)=>{var i;if(am(t.expression,e))if(ri.get(t)!==t.template){ri.set(t,t.template);let a=new mt(t.template,e,Vn);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)}},Tf=Object.keys(ul),Vn={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof Wa){if(!s.directive){let u=Tf.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=ul[s.directive])==null||a.call(ul,s,i);continue}let l=am(n,i);if(l instanceof Kn){ri.get(s)!==l.template?(ri.set(s,l.template),l=new mt(l.template,l.state,Vn),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))}}},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 yf(t){return kf(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=yf(t);if(c.length===0||c.some(({type:b})=>!b))return Fa(t);if(((i=c[0])==null?void 0:i.token)===">"){let b=e[(a=c[1])==null?void 0:a.token];if(!b)return Fa(t);let g={...e};b.state=g;let f=c.slice(2);for(let v=0;v<f.length;v+=3){let L=(r=f[v])==null?void 0:r.token,A=(n=f[v+1])==null?void 0:n.token,T=(s=f[v+2])==null?void 0:s.token;L&&A==="="&&(g[L]=Ka(T,e))}return b}if(c.length===1)return Fn(c[0])?Ka(c[0].token,e):Fa(t);if(c.length===2){let b=(l=c[0])==null?void 0:l.token,g=im[b];if(!g||!Fn(c[1]))return Fa(t);let f=Ka(c[1].token,e);return g(f)}if(c.length===3){let b=(u=c[1])==null?void 0:u.token,g=im[b];if(!g||!Fn(c[0])||!Fn(c[2]))return Fa(t);let f=Ka(c[0].token,e);if(b==="|")return g(f,c[2].token);let v=Ka(c[2].token,e);return g(f,v)}}function Fa(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Fn({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):_r(t)?parseFloat(t):e[t]}function kf(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 vl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},hl=(t,e,i)=>(vl(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)},oi=(t,e,i,a)=>(vl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),cl=(t,e,i)=>(vl(t,e,"access private method"),i),Ki,Yn,Vi,pl,rm,Gn,fl,ml={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},nm=h.createElement("template");nm.innerHTML=`
1223
+ `;var Qs=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:Q(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"),f=g?parseFloat(g.replace("px","")):0,v=a.getPropertyValue("--media-tooltip-container-margin"),L=v?parseFloat(v.replace("px","")):0,A=l-n+f-L,T=c-b+f+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(Lc.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",Qs);var tf=1,af=t=>t.mediaMuted?0:t.mediaVolume,rf=t=>`${Math.round(t*100)}%`,zs=class extends qt{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=af(this),this.range.setAttribute("aria-valuetext",rf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,tf)}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",zs);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 jt=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=nf(t).toString();return e?"?"+e:""}function nf(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",of=()=>{try{return"3.2.3"}catch{}return"UNKNOWN"},sf=of(),Pn=()=>sf,Oc=(t,{token:e,customDomain:i=Dc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,jt.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,jt.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([jt.StreamTypes.LIVE,jt.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return jt.StreamTypes.LIVE}};var lf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Pc(t){var e;return(e=lf[t])!=null?e:On(t)}var Xt,Jt,me,Nn=class{constructor(e,i){pe(this,Xt);pe(this,Jt);pe(this,me,[]);Te(this,Xt,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,Xt))!=null&&i.hasAttribute(`${P(this,Jt)}`)))&&((a=P(this,Xt))==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,Xt))==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)}};Xt=new WeakMap,Jt=new WeakMap,me=new WeakMap;var Bc=`[mux-player ${Pn()}]`;function Qe(...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}`),Qe(e)}var de={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ei={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}}),df=Wc.VideoEvents.filter(t=>t!=="error"),uf=Object.values(de).filter(t=>![de.PLAYSINLINE].includes(t)),cf=Object.values(ei),el=class extends fe.HTMLElement{static get observedAttributes(){return[...uf,...cf]}constructor(){super()}init(){df.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 ei.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ei.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ei.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(ei.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ei.PLAYBACKRATE,`${e}`):this.removeAttribute(ei.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)),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)},ct=(t,e,i,a)=>(Gc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),$i,Un,ti,Ha,It,Ct,Mt,ii,Wi,Bn,Oe,Fc=1,Kc=0,mf=1,hf={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}}}},mt=class extends d.DocumentFragment{constructor(e,i,a=hf){var r;super(),ze(this,$i,void 0),ze(this,Un,void 0),this.append(e.content.cloneNode(!0)),ct(this,$i,qc(this)),ct(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 ht(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([mf,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Kc,(i>0?"{{":"")+e]),Vc[t]=a},pf=11,Hn=class{get value(){return""}set value(e){}toString(){return this.value}},Zc=new WeakMap,il=class{constructor(){ze(this,ti,[])}[Symbol.iterator](){return k(this,ti).values()}get length(){return k(this,ti).length}item(e){return k(this,ti)[e]}append(...e){for(let i of e)i instanceof he&&Zc.set(i,this),k(this,ti).push(i)}toString(){return k(this,ti).join("")}};ti=new WeakMap;var he=class extends Hn{constructor(e,i,a){super(),ze(this,ii),ze(this,Ha,""),ze(this,It,void 0),ze(this,Ct,void 0),ze(this,Mt,void 0),ct(this,It,e),ct(this,Ct,i),ct(this,Mt,a)}get attributeName(){return k(this,Ct)}get attributeNamespace(){return k(this,Mt)}get element(){return k(this,It)}get value(){return k(this,Ha)}set value(e){k(this,Ha)!==e&&(ct(this,Ha,e),!k(this,ii,Wi)||k(this,ii,Wi).length===1?e==null?k(this,It).removeAttributeNS(k(this,Mt),k(this,Ct)):k(this,It).setAttributeNS(k(this,Mt),k(this,Ct),e):k(this,It).setAttributeNS(k(this,Mt),k(this,Ct),k(this,ii,Wi).toString()))}get booleanValue(){return k(this,It).hasAttributeNS(k(this,Mt),k(this,Ct))}set booleanValue(e){if(!k(this,ii,Wi)||k(this,ii,Wi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Ha=new WeakMap;It=new WeakMap;Ct=new WeakMap;Mt=new WeakMap;ii=new WeakSet;Wi=function(){return Zc.get(this)};var ht=class extends Hn{constructor(e,i){super(),ze(this,Bn,void 0),ze(this,Oe,void 0),ct(this,Bn,e),ct(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===pf?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),ct(this,Oe,ff(k(this,Oe)[0].parentNode,k(this,Oe),i,this.nextSibling))}};Bn=new WeakMap;Oe=new WeakMap;var $a=class extends ht{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 ff(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 Qc={string:t=>String(t)},Wn=class{constructor(e){this.template=e,this.state=void 0}},ai=new WeakMap,ri=new WeakMap,al={partial:(t,e)=>{e[t.expression]=new Wn(t.template)},if:(t,e)=>{var i;if(Xc(t.expression,e))if(ai.get(t)!==t.template){ai.set(t,t.template);let a=new mt(t.template,e,Fn);t.replace(a),ri.set(t,a)}else(i=ri.get(t))==null||i.update(e);else t.replace(""),ai.delete(t),ri.delete(t)}},vf=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=vf.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){ai.get(s)!==l.template?(ai.set(s,l.template),l=new mt(l.template,l.state,Fn),s.value=l,ri.set(s,l)):(r=ri.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,ai.delete(s),ri.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,ai.delete(s),ri.delete(s))}}},zc={"!":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=Qc[e])==null?void 0:i.call(Qc,t)}};function Ef(t){return bf(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=Ef(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 f=c.slice(2);for(let v=0;v<f.length;v+=3){let L=(r=f[v])==null?void 0:r.token,A=(n=f[v+1])==null?void 0:n.token,T=(s=f[v+2])==null?void 0:s.token;L&&A==="="&&(g[L]=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=zc[b];if(!g||!$n(c[1]))return Wa(t);let f=Fa(c[1].token,e);return g(f)}if(c.length===3){let b=(u=c[1])==null?void 0:u.token,g=zc[b];if(!g||!$n(c[0])||!$n(c[2]))return Wa(t);let f=Fa(c[0].token,e);if(b==="|")return g(f,c[2].token);let v=Fa(c[2].token,e);return g(f,v)}}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 bf(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)},ni=(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=`
1225
1225
  <style>
1226
1226
  :host {
1227
1227
  display: inline-block;
@@ -1251,7 +1251,7 @@ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Ze(e)}var de={AU
1251
1251
  display: none;
1252
1252
  }
1253
1253
  </style>
1254
- `;var si=class extends d.HTMLElement{constructor(){super(),Va(this,pl),Va(this,Gn),Va(this,Ki,void 0),Va(this,Yn,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:!!(ml[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(rt.BREAKPOINTS_COMPUTED,this.render),cl(this,pl,rm).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=hl(this,Ki))!=null?e:this.constructor.template}set template(e){oi(this,Vi,null),oi(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})=>ml[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=ml[s.name])!=null?a:Fd(s.name),{value:u}=s;u!=null?(_r(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&cl(this,Gn,fl).call(this)}connectedCallback(){cl(this,Gn,fl).call(this)}createRenderer(){this.template&&this.template!==hl(this,Yn)&&(oi(this,Yn,this.template),this.renderer=new mt(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(nm.content.cloneNode(!0),this.renderer))}render(){var e;if((e=this.renderer)==null||e.update(this.props),this.renderRoot.isConnected){let{style:i}=$(this.renderRoot,":host");i.visibility==="hidden"&&i.removeProperty("visibility")}}};Ki=new WeakMap;Yn=new WeakMap;Vi=new WeakMap;pl=new WeakSet;rm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};Gn=new WeakSet;fl=function(){var t;let e=this.getAttribute("template");if(!e||e===hl(this,Vi))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){oi(this,Vi,e),oi(this,Ki,a),this.createRenderer();return}Sf(e)&&(oi(this,Vi,e),If(e).then(r=>{let n=h.createElement("template");n.innerHTML=r,oi(this,Ki,n),this.createRenderer()}).catch(console.error))};si.observedAttributes=["template"];si.processor=Vn;function Sf(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 If(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 om=`:host {
1254
+ `;var oi=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(rt.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){ni(this,Ki,null),ni(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)&&(ni(this,Kn,this.template),this.renderer=new mt(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){ni(this,Ki,e),ni(this,Fi,a),this.createRenderer();return}gf(e)&&(ni(this,Ki,e),_f(e).then(r=>{let n=h.createElement("template");n.innerHTML=r,ni(this,Fi,n),this.createRenderer()}).catch(console.error))};oi.observedAttributes=["template"];oi.processor=Fn;function gf(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 _f(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",oi);var em=`:host {
1255
1255
  --media-control-display: var(--controls);
1256
1256
  --media-loading-indicator-display: var(--loading-indicator);
1257
1257
  --media-dialog-display: var(--dialog);
@@ -1402,23 +1402,23 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1402
1402
  :host([no-tooltips]) {
1403
1403
  --media-tooltip-display: none;
1404
1404
  }
1405
- `;var Ya=new WeakMap,bl=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 Mf(t,e){return t instanceof he&&t.attributeName.startsWith("on")?(bl.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Rf(t,e){return e instanceof qn&&t instanceof ht?(e.renderInto(t),!0):!1}function wf(t,e){return e instanceof DocumentFragment&&t instanceof ht?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function Lf(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 xf(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 Df(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 Of(t,e){return e===!1&&t instanceof ht?(t.replace(""),!0):!1}function Nf(t,e){xf(t,e)||Df(t,e)||Mf(t,e)||Of(t,e)||Rf(t,e)||wf(t,e)||Lf(t,e)}var El=new Map,sm=new WeakMap,lm=new WeakMap,qn=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(El.has(this.stringsKey))return El.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} }}`:""),""),El.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 mt(i,this.values,this.processor);lm.set(e,n),e instanceof ht?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)}},Pf={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:"";Nf(n,s)}}}};function Ga(t,...e){return new qn(t,e,Pf)}function dm(t,e){t.renderInto(e)}var qa=require("@mux/playback-core"),Uf=t=>{let{tokens:e}=t;return e.drm?":host { --_cast-button-drm-display: none; }":""},um=t=>Ga`
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 Tf(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 yf(t,e){return e instanceof Yn&&t instanceof ht?(e.renderInto(t),!0):!1}function kf(t,e){return e instanceof DocumentFragment&&t instanceof ht?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function Sf(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 If(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 Cf(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 Mf(t,e){return e===!1&&t instanceof ht?(t.replace(""),!0):!1}function Rf(t,e){If(t,e)||Cf(t,e)||Tf(t,e)||Mf(t,e)||yf(t,e)||kf(t,e)||Sf(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=fi.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 mt(i,this.values,this.processor);im.set(e,n),e instanceof ht?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)}},wf={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:"";Rf(n,s)}}}};function Ya(t,...e){return new Yn(t,e,wf)}function am(t,e){t.renderInto(e)}var Ga=require("@mux/playback-core"),Lf=t=>{let{tokens:e}=t;return e.drm?":host { --_cast-button-drm-display: none; }":""},rm=t=>Ya`
1406
1406
  <style>
1407
- ${Uf(t)}
1408
- ${om}
1407
+ ${Lf(t)}
1408
+ ${em}
1409
1409
  </style>
1410
- ${Wf(t)}
1411
- `,Bf=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Ba(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Hf={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"},$f=Object.values(Hf).join(", "),Wf=t=>{var e,i,a,r,n,s,l,u,c,b,g,f,v,L,A,T,N,ee,be,Et,at,Ji,ji,ea,ta,ia,aa,ra,na,oa,sa,la,br;return Ga`
1410
+ ${Nf(t)}
1411
+ `,xf=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Ua(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Df={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"},Of=Object.values(Df).join(", "),Nf=t=>{var e,i,a,r,n,s,l,u,c,b,g,f,v,L,A,T,N,ee,ge,vt,at,Xi,Ji,ji,ea,ta,ia,aa,ra,na,oa,sa,vr;return Ya`
1412
1412
  <media-theme
1413
1413
  template="${t.themeTemplate||!1}"
1414
1414
  defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
1415
- hotkeys="${Bf(t)||!1}"
1415
+ hotkeys="${xf(t)||!1}"
1416
1416
  nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
1417
- noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(qa.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
1417
+ noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(Ga.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
1418
1418
  novolumepref="${t.novolumepref||!1}"
1419
1419
  disabled="${!t.hasSrc||t.isDialogOpen}"
1420
1420
  audio="${(a=t.audio)!=null?a:!1}"
1421
- style="${(r=Bc({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
1421
+ style="${(r=xc({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
1422
1422
  defaultsubtitles="${!t.defaultHiddenCaptions}"
1423
1423
  forwardseekoffset="${(n=t.forwardSeekOffset)!=null?n:!1}"
1424
1424
  backwardseekoffset="${(s=t.backwardSeekOffset)!=null?s:!1}"
@@ -1427,39 +1427,39 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1427
1427
  defaultduration="${(c=t.defaultDuration)!=null?c:!1}"
1428
1428
  hideduration="${(b=t.hideDuration)!=null?b:!1}"
1429
1429
  title="${(g=t.title)!=null?g:!1}"
1430
- exportparts="${$f}"
1430
+ exportparts="${Of}"
1431
1431
  onclose="${t.onCloseErrorDialog}"
1432
1432
  onfocusin="${t.onFocusInErrorDialog}"
1433
1433
  >
1434
1434
  <mux-video
1435
1435
  slot="media"
1436
1436
  target-live-window="${(f=t.targetLiveWindow)!=null?f:!1}"
1437
- stream-type="${(v=Ba(t.streamType))!=null?v:!1}"
1437
+ stream-type="${(v=Ua(t.streamType))!=null?v:!1}"
1438
1438
  crossorigin="${(L=t.crossOrigin)!=null?L:""}"
1439
1439
  playsinline
1440
1440
  autoplay="${(A=t.autoplay)!=null?A:!1}"
1441
1441
  muted="${(T=t.muted)!=null?T:!1}"
1442
1442
  loop="${(N=t.loop)!=null?N:!1}"
1443
1443
  preload="${(ee=t.preload)!=null?ee:!1}"
1444
- debug="${(be=t.debug)!=null?be:!1}"
1445
- prefer-cmcd="${(Et=t.preferCmcd)!=null?Et:!1}"
1444
+ debug="${(ge=t.debug)!=null?ge:!1}"
1445
+ prefer-cmcd="${(vt=t.preferCmcd)!=null?vt:!1}"
1446
1446
  disable-tracking="${(at=t.disableTracking)!=null?at:!1}"
1447
- disable-cookies="${(Ji=t.disableCookies)!=null?Ji:!1}"
1448
- prefer-playback="${(ji=t.preferPlayback)!=null?ji:!1}"
1447
+ disable-cookies="${(Xi=t.disableCookies)!=null?Xi:!1}"
1448
+ prefer-playback="${(Ji=t.preferPlayback)!=null?Ji:!1}"
1449
1449
  start-time="${t.startTime!=null?t.startTime:!1}"
1450
- beacon-collection-domain="${(ea=t.beaconCollectionDomain)!=null?ea:!1}"
1451
- player-init-time="${(ta=t.playerInitTime)!=null?ta:!1}"
1452
- player-software-name="${(ia=t.playerSoftwareName)!=null?ia:!1}"
1453
- player-software-version="${(aa=t.playerSoftwareVersion)!=null?aa:!1}"
1454
- env-key="${(ra=t.envKey)!=null?ra:!1}"
1455
- custom-domain="${(na=t.customDomain)!=null?na:!1}"
1456
- src="${t.src?t.src:t.playbackId?(0,qa.toMuxVideoURL)(t):!1}"
1457
- cast-src="${t.src?t.src:t.playbackId?(0,qa.toMuxVideoURL)(t):!1}"
1458
- cast-receiver="${(oa=t.castReceiver)!=null?oa:!1}"
1459
- drm-token="${(la=(sa=t.tokens)==null?void 0:sa.drm)!=null?la:!1}"
1450
+ beacon-collection-domain="${(ji=t.beaconCollectionDomain)!=null?ji:!1}"
1451
+ player-init-time="${(ea=t.playerInitTime)!=null?ea:!1}"
1452
+ player-software-name="${(ta=t.playerSoftwareName)!=null?ta:!1}"
1453
+ player-software-version="${(ia=t.playerSoftwareVersion)!=null?ia:!1}"
1454
+ env-key="${(aa=t.envKey)!=null?aa:!1}"
1455
+ custom-domain="${(ra=t.customDomain)!=null?ra:!1}"
1456
+ src="${t.src?t.src:t.playbackId?(0,Ga.toMuxVideoURL)(t):!1}"
1457
+ cast-src="${t.src?t.src:t.playbackId?(0,Ga.toMuxVideoURL)(t):!1}"
1458
+ cast-receiver="${(na=t.castReceiver)!=null?na:!1}"
1459
+ drm-token="${(sa=(oa=t.tokens)==null?void 0:oa.drm)!=null?sa:!1}"
1460
1460
  exportparts="video"
1461
1461
  >
1462
- ${t.storyboard?Ga`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:Ga``}
1462
+ ${t.storyboard?Ya`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:Ya``}
1463
1463
  <slot></slot>
1464
1464
  </mux-video>
1465
1465
  <slot name="poster" slot="poster">
@@ -1467,11 +1467,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1467
1467
  part="poster"
1468
1468
  exportparts="poster, img"
1469
1469
  src="${t.poster?t.poster:!1}"
1470
- placeholdersrc="${(br=t.placeholder)!=null?br:!1}"
1470
+ placeholdersrc="${(vr=t.placeholder)!=null?vr:!1}"
1471
1471
  ></media-poster-image>
1472
1472
  </slot>
1473
1473
  </media-theme>
1474
- `};var _=require("@mux/playback-core"),cm=t=>t.charAt(0).toUpperCase()+t.slice(1),Ff=(t,e=!1)=>{var i,a;if(t.muxCode){let r=cm((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)},Kf=(t,e=!1)=>{var i,a;if(t.muxCode){let r=cm((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},mm=(t,e=!1)=>{let i=Ff(t,e),a=Kf(t,e);return{title:i,message:a}},Vf=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""},gl=(t,e)=>{let i=Vf(t);return{message:t.message,context:t.context,file:i}};var hm=`<template id="media-theme-gerwig">
1474
+ `};var _=require("@mux/playback-core"),nm=t=>t.charAt(0).toUpperCase()+t.slice(1),Pf=(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)},Uf=(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=Pf(t,e),a=Uf(t,e);return{title:i,message:a}},Bf=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=Bf(t);return{message:t.message,context:t.context,file:i}};var sm=`<template id="media-theme-gerwig">
1475
1475
  <style>
1476
1476
  @keyframes pre-play-hide {
1477
1477
  0% {
@@ -2478,7 +2478,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2478
2478
  <slot></slot>
2479
2479
  </media-controller>
2480
2480
  </template>
2481
- `;function pm({anchor:t,floating:e,placement:i}){let a=Gf({anchor:t,floating:e}),{x:r,y:n}=Zf(a,i);return{x:r,y:n}}function Gf({anchor:t,floating:e}){return{anchor:qf(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function qf(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 Zf({anchor:t,floating:e},i){let a=Qf(i)==="x"?"y":"x",r=a==="y"?"height":"width",n=fm(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 fm(t){return t.split("-")[0]}function Qf(t){return["top","bottom"].includes(fm(t))?"y":"x"}var wt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},Zn=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var Ll=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},B=(t,e,i)=>(Ll(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)},ze=(t,e,i,a)=>(Ll(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),G=(t,e,i)=>(Ll(t,e,"access private method"),i),Xe,di,Lt,Qn,zn,ui,za,_l,vm,jn,Xn,Al,Tl,Em,yl,bm,kl,gm,Yi,Gi,qi,Xa,eo,xl,Sl,_m,Dl,Am,Il,Tm,Ol,ym,Cl,km,Ml,Sm,Za,to,Rl,Im,Qa,io,Jn,wl;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 Oe(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=`
2481
+ `;function lm({anchor:t,floating:e,placement:i}){let a=$f({anchor:t,floating:e}),{x:r,y:n}=Ff(a,i);return{x:r,y:n}}function $f({anchor:t,floating:e}){return{anchor:Wf(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Wf(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 Ff({anchor:t,floating:e},i){let a=Kf(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 Kf(t){return["top","bottom"].includes(dm(t))?"y":"x"}var Rt=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,li,wt,qn,Zn,di,Qa,hl,um,Xn,Qn,pl,fl,cm,vl,mm,El,hm,Vi,Yi,Gi,za,Jn,Sl,bl,pm,Il,fm,gl,vm,Cl,Em,_l,bm,Al,gm,qa,jn,Tl,_m,Za,eo,zn,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=`
2482
2482
  <style>
2483
2483
  :host {
2484
2484
  font: var(--media-font,
@@ -2645,7 +2645,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2645
2645
  <slot></slot>
2646
2646
  </div>
2647
2647
  <slot name="checked-indicator" hidden></slot>
2648
- `;var li={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},se=class extends d.HTMLElement{constructor(){super(),K(this,_l),K(this,Xn),K(this,Tl),K(this,yl),K(this,kl),K(this,qi),K(this,eo),K(this,Sl),K(this,Dl),K(this,Il),K(this,Ol),K(this,Cl),K(this,Ml),K(this,Za),K(this,Rl),K(this,Qa),K(this,Jn),K(this,Xe,null),K(this,di,null),K(this,Lt,null),K(this,Qn,new Set),K(this,zn,void 0),K(this,ui,!1),K(this,za,null),K(this,jn,()=>{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}));ze(this,Qn,i)}),K(this,Yi,()=>{G(this,qi,Xa).call(this),G(this,eo,xl).call(this,!1)}),K(this,Gi,()=>{G(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),ze(this,zn,new MutationObserver(B(this,jn))),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":G(this,_l,vm).call(this,e);break;case"invoke":G(this,Tl,Em).call(this,e);break;case"click":G(this,Sl,_m).call(this,e);break;case"toggle":G(this,Il,Tm).call(this,e);break;case"focusout":G(this,Cl,km).call(this,e);break;case"keydown":G(this,Ml,Sm).call(this,e);break}}connectedCallback(){var e,i;ze(this,za,Vo(this.shadowRoot,":host")),G(this,Xn,Al).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),ze(this,Xe,Sr(this)),(i=(e=B(this,Xe))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(nt(Ja(this),B(this,Yi)),nt(this,B(this,Gi)))}disconnectedCallback(){var e,i;Ut(Ja(this),B(this,Yi)),Ut(this,B(this,Gi)),this.disable(),(i=(e=B(this,Xe))==null?void 0:e.unassociateElement)==null||i.call(e,this),ze(this,Xe,null)}attributeChangedCallback(e,i,a){var r,n,s,l;e===li.HIDDEN&&a!==i?(B(this,ui)||ze(this,ui,!0),this.hidden?G(this,kl,gm).call(this):G(this,yl,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,Xe))==null?void 0:r.unassociateElement)==null||n.call(r,this),ze(this,Xe,null)),a&&this.isConnected&&(ze(this,Xe,Sr(this)),(l=(s=B(this,Xe))==null?void 0:s.associateElement)==null||l.call(s,this))):e===li.DISABLED&&a!==i?a==null?this.enable():this.disable():e===li.STYLE&&a!==i&&G(this,Xn,Al).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(zf)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return(i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(a=>a.value===e);i&&G(this,Jn,wl).call(this,i)}focus(){if(ze(this,di,ha()),this.items.length){G(this,Qa,io).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var i;let a=G(this,Za,to).call(this,e);a&&(G(this,Jn,wl).call(this,a,a.type==="checkbox"),B(this,Lt)&&!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=G(this,Za,to).call(this,e))!=null?i:G(this,Rl,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),G(this,Qa,io).call(this,n[u]),n[u].focus()}};Xe=new WeakMap;di=new WeakMap;Lt=new WeakMap;Qn=new WeakMap;zn=new WeakMap;ui=new WeakMap;za=new WeakMap;_l=new WeakSet;vm=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,jn).call(this)};jn=new WeakMap;Xn=new WeakSet;Al=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")};Tl=new WeakSet;Em=function(t){ze(this,Lt,t.relatedTarget),ue(this,t.relatedTarget)||(this.hidden=!this.hidden)};yl=new WeakSet;bm=function(){var t;(t=B(this,Lt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),nt(Ja(this),B(this,Yi)),nt(this,B(this,Gi))};kl=new WeakSet;gm=function(){var t;(t=B(this,Lt))==null||t.setAttribute("aria-expanded","false"),Ut(Ja(this),B(this,Yi)),Ut(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,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`)};eo=new WeakSet;xl=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`),G(this,qi,Xa).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,qi,Xa).call(this);a.removeProperty("--media-menu-transition-in")};Sl=new WeakSet;_m=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(B(this,Dl,Am))){(e=B(this,di))==null||e.focus(),this.hidden=!0;return}let i=G(this,Za,to).call(this,t);!i||i.hasAttribute("disabled")||(G(this,Qa,io).call(this,i),this.handleSelect(t))};Dl=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"]'))};Il=new WeakSet;Tm=function(t){if(t.target===this)return;G(this,Ol,ym).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new wt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,eo,xl).call(this,!0)};Ol=new WeakSet;ym=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Cl=new WeakSet;km=function(t){var e;ue(this,t.relatedTarget)||(B(this,ui)&&((e=B(this,di))==null||e.focus()),B(this,Lt)&&B(this,Lt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Ml=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,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)};Za=new WeakSet;to=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Rl=new WeakSet;Im=function(){return this.items.find(t=>t.tabIndex===0)};Qa=new WeakSet;io=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};Jn=new WeakSet;wl=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 zf(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function Ja(t){var e;return(e=t.getAttribute("bounds")?Pe(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 $l=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},et=(t,e,i)=>($l(t,e,"read from private field"),i?i.call(t):e.get(t)),pt=(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)},Nl=(t,e,i,a)=>($l(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),je=(t,e,i)=>($l(t,e,"access private method"),i),ao,er,Pl,Mm,Wl,Rm,Fl,wm,tt,Zi,tr,Ul,Lm,ro,Bl,xm=h.createElement("template");xm.innerHTML=`
2648
+ `;var si={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},se=class extends d.HTMLElement{constructor(){super(),V(this,hl),V(this,Qn),V(this,fl),V(this,vl),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,zn),V(this,Je,null),V(this,li,null),V(this,wt,null),V(this,qn,new Set),V(this,Zn,void 0),V(this,di,!1),V(this,Qa,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,za).call(this),q(this,Jn,Sl).call(this,!1)}),V(this,Yi,()=>{q(this,Gi,za).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[si.DISABLED,si.HIDDEN,si.STYLE,si.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,fl,cm).call(this,e);break;case"click":q(this,bl,pm).call(this,e);break;case"toggle":q(this,gl,vm).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,Qa,Uo(this.shadowRoot,":host")),q(this,Qn,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||(nt(Xa(this),B(this,Vi)),nt(this,B(this,Yi)))}disconnectedCallback(){var e,i;Pt(Xa(this),B(this,Vi)),Pt(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===si.HIDDEN&&a!==i?(B(this,di)||Xe(this,di,!0),this.hidden?q(this,El,hm).call(this):q(this,vl,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===si.DISABLED&&a!==i?a==null?this.enable():this.disable():e===si.STYLE&&a!==i&&q(this,Qn,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=Ut(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Vf)}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,zn,yl).call(this,i)}focus(){if(Xe(this,li,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,zn,yl).call(this,a,a.type==="checkbox"),B(this,wt)&&!this.hidden&&((i=B(this,li))==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;li=new WeakMap;wt=new WeakMap;qn=new WeakMap;Zn=new WeakMap;di=new WeakMap;Qa=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;Qn=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")};fl=new WeakSet;cm=function(t){Xe(this,wt,t.relatedTarget),ue(this,t.relatedTarget)||(this.hidden=!this.hidden)};vl=new WeakSet;mm=function(){var t;(t=B(this,wt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),nt(Xa(this),B(this,Vi)),nt(this,B(this,Yi))};El=new WeakSet;hm=function(){var t;(t=B(this,wt))==null||t.setAttribute("aria-expanded","false"),Pt(Xa(this),B(this,Vi)),Pt(this,B(this,Yi))};Vi=new WeakMap;Yi=new WeakMap;Gi=new WeakSet;za=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,Qa);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,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,Gi,za).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),q(this,Gi,za).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,fm))){(e=B(this,li))==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;fm=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;vm=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 Rt({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,di)&&((e=B(this,li))==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,di)){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,li))==null||n.focus(),B(this,di)&&(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};zn=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 Vf(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")}`):Q(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)),pt=(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,wl,Sm,io,Ll,Im=h.createElement("template");Im.innerHTML=`
2649
2649
  <style>
2650
2650
  :host {
2651
2651
  transition: var(--media-menu-item-transition,
@@ -2761,7 +2761,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2761
2761
  <slot name="description"></slot>
2762
2762
  <slot name="suffix"></slot>
2763
2763
  <slot name="submenu"></slot>
2764
- `;var Se={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},xt=class extends d.HTMLElement{constructor(){super(),pt(this,Pl),pt(this,Wl),pt(this,Fl),pt(this,Zi),pt(this,Ul),pt(this,ro),pt(this,ao,!1),pt(this,er,void 0),pt(this,tt,()=>{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[Se.TYPE,Se.DISABLED,Se.CHECKED,Se.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":je(this,Pl,Mm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":je(this,Ul,Lm).call(this,e);break;case"keyup":je(this,Zi,tr).call(this,e);break}}attributeChangedCallback(e,i,a){e===Se.CHECKED&&ja(this)&&!et(this,ao)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Se.TYPE&&a!==i?this.role="menuitem"+a:e===Se.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Se.DISABLED)||this.enable(),this.role="menuitem"+this.type,Nl(this,er,Hl(this,this.parentNode)),je(this,ro,Bl).call(this)}disconnectedCallback(){this.disable(),je(this,ro,Bl).call(this),Nl(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(Se.TYPE))!=null?e:""}set type(e){this.setAttribute(Se.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Se.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Se.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)&&(Nl(this,ao,!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 wt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};ao=new WeakMap;er=new WeakMap;Pl=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?je(this,Wl,Rm).call(this):je(this,Fl,wm).call(this))};Wl=new WeakSet;Rm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",et(this,tt)),this.submenuElement.addEventListener("addmenuitem",et(this,tt)),this.submenuElement.addEventListener("removemenuitem",et(this,tt)),et(this,tt).call(this)};Fl=new WeakSet;wm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",et(this,tt)),this.submenuElement.removeEventListener("addmenuitem",et(this,tt)),this.submenuElement.removeEventListener("removemenuitem",et(this,tt)),et(this,tt).call(this)};tt=new WeakMap;Zi=new WeakSet;tr=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",je(this,Zi,tr));return}this.handleClick(t)};Ul=new WeakSet;Lm=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",je(this,Zi,tr));return}this.addEventListener("keyup",je(this,Zi,tr),{once:!0})};ro=new WeakSet;Bl=function(){var t;let e=(t=et(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")};xt.template=xm;function ja(t){return t.type==="radio"||t.type==="checkbox"}function Hl(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?Hl(t,i):e!=null&&e.items?e:Hl(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",xt);var Dm=h.createElement("template");Dm.innerHTML=se.template.innerHTML+`
2764
+ `;var Ie={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Lt=class extends d.HTMLElement{constructor(){super(),pt(this,Rl),pt(this,Ol),pt(this,Nl),pt(this,qi),pt(this,wl),pt(this,io),pt(this,to,!1),pt(this,ja,void 0),pt(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,wl,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,Ll).call(this)}disconnectedCallback(){this.disable(),et(this,io,Ll).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=Ut(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 Rt({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)};wl=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;Ll=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")};Lt.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",Lt);var Cm=h.createElement("template");Cm.innerHTML=se.template.innerHTML+`
2765
2765
  <style>
2766
2766
  :host {
2767
2767
  background: var(--media-settings-menu-background,
@@ -2788,7 +2788,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2788
2788
  --media-settings-menu-item-opacity: 0;
2789
2789
  }
2790
2790
  </style>
2791
- `;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,no=h.createElement("template");no.innerHTML=xt.template.innerHTML+`
2791
+ `;var tr=class extends se{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Q(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=Lt.template.innerHTML+`
2792
2792
  <style>
2793
2793
  slot:not([name="submenu"]) {
2794
2794
  opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
@@ -2798,11 +2798,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2798
2798
  background: transparent;
2799
2799
  }
2800
2800
  </style>
2801
- `;(Om=no.content)!=null&&Om.querySelector&&(no.content.querySelector('slot[name="suffix"]').innerHTML=`
2801
+ `;(Mm=ao.content)!=null&&Mm.querySelector&&(ao.content.querySelector('slot[name="suffix"]').innerHTML=`
2802
2802
  <svg aria-hidden="true" viewBox="0 0 20 24">
2803
2803
  <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"/>
2804
2804
  </svg>
2805
- `);var ar=class extends xt{};ar.template=no;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",ar);var ke=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 wt({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",ke);var Nm=h.createElement("template");Nm.innerHTML=`
2805
+ `);var ir=class extends Lt{};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=Ut(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new Rt({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",Se);var Rm=h.createElement("template");Rm.innerHTML=`
2806
2806
  <style>
2807
2807
  :host([aria-expanded="true"]) slot[name=tooltip] {
2808
2808
  display: none;
@@ -2813,25 +2813,25 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2813
2813
  <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"/>
2814
2814
  </svg>
2815
2815
  </slot>
2816
- `;var oo=class extends ke{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",oo);var Gl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Pm=(t,e,i)=>(Gl(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)},Kl=(t,e,i,a)=>(Gl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),lo=(t,e,i)=>(Gl(t,e,"access private method"),i),rr,mo,uo,Vl,co,Yl,ho=class extends se{constructor(){super(...arguments),so(this,uo),so(this,co),so(this,rr,[]),so(this,mo,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&&(Kl(this,rr,Wd(a!=null?a:"")),lo(this,uo,Vl).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",lo(this,co,Yl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",lo(this,co,Yl))}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){Kl(this,rr,e),lo(this,uo,Vl).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;mo=new WeakMap;uo=new WeakSet;Vl=function(){if(Pm(this,mo)===JSON.stringify(this.mediaAudioTrackList))return;Kl(this,mo,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(Oe(this,"checked-indicator")),this.defaultSlot.append(a)}};co=new WeakSet;Yl=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",ho);var Xf=`<svg aria-hidden="true" viewBox="0 0 24 24">
2816
+ `;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:Q(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)},wm=(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=Q(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return wm(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(wm(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 Yf=`<svg aria-hidden="true" viewBox="0 0 24 24">
2817
2817
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
2818
2818
  <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"/>
2819
- </svg>`,Um=h.createElement("template");Um.innerHTML=`
2819
+ </svg>`,Lm=h.createElement("template");Lm.innerHTML=`
2820
2820
  <style>
2821
2821
  :host([aria-expanded="true"]) slot[name=tooltip] {
2822
2822
  display: none;
2823
2823
  }
2824
2824
  </style>
2825
- <slot name="icon">${Xf}</slot>
2826
- `;var po=class extends ke{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",po);var Xl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Jf=(t,e,i)=>(Xl(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)},jf=(t,e,i,a)=>(Xl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Zl=(t,e,i)=>(Xl(t,e,"access private method"),i),vo,Ql,$m,fo,zl,ev=`
2825
+ <slot name="icon">${Yf}</slot>
2826
+ `;var mo=class extends Se{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Lm,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=Q(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)},Gf=(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)},qf=(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,Zf=`
2827
2827
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
2828
2828
  <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"/>
2829
- </svg>`,Wm=h.createElement("template");Wm.innerHTML=se.template.innerHTML+`
2830
- <slot name="captions-indicator" hidden>${ev}</slot>`;var nr=class extends se{constructor(){super(...arguments),ql(this,Ql),ql(this,fo),ql(this,vo,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?Zl(this,Ql,$m).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Zl(this,fo,zl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Zl(this,fo,zl))}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)}};vo=new WeakMap;Ql=new WeakSet;$m=function(){var t;if(Jf(this,vo)===JSON.stringify(this.mediaSubtitlesList))return;jf(this,vo,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(Oe(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:Nr(r),checked:this.value==Nr(r)});n.prepend(Oe(this,"checked-indicator")),((t=r.kind)!=null?t:"subs")==="captions"&&n.append(Oe(this,"captions-indicator")),this.defaultSlot.append(n)}};fo=new WeakSet;zl=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?$t(i):[]},Hm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=lt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",nr);var tv=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},iv=(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)},av=(t,e,i,a)=>(tv(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Jl,rv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2829
+ </svg>`,Nm=h.createElement("template");Nm.innerHTML=se.template.innerHTML+`
2830
+ <slot name="captions-indicator" hidden>${Zf}</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:Q(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(Gf(this,po)===JSON.stringify(this.mediaSubtitlesList))return;qf(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?Ht(i):[]},Dm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=lt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",rr);var Qf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},zf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Xf=(t,e,i,a)=>(Qf(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Yl,Jf=`<svg aria-hidden="true" viewBox="0 0 26 24">
2831
2831
  <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"/>
2832
- </svg>`,nv=`<svg aria-hidden="true" viewBox="0 0 26 24">
2832
+ </svg>`,jf=`<svg aria-hidden="true" viewBox="0 0 26 24">
2833
2833
  <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"/>
2834
- </svg>`,Ym=h.createElement("template");Ym.innerHTML=`
2834
+ </svg>`,Hm=h.createElement("template");Hm.innerHTML=`
2835
2835
  <style>
2836
2836
  :host([aria-checked="true"]) slot[name=off] {
2837
2837
  display: none !important;
@@ -2848,10 +2848,10 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2848
2848
  </style>
2849
2849
 
2850
2850
  <slot name="icon">
2851
- <slot name="on">${rv}</slot>
2852
- <slot name="off">${nv}</slot>
2851
+ <slot name="on">${Jf}</slot>
2852
+ <slot name="off">${jf}</slot>
2853
2853
  </slot>
2854
- `;var Fm=t=>{t.setAttribute("aria-checked",Pr(t).toString())},Eo=class extends ke{constructor(e={}){super({slotTemplate:Ym,tooltipContent:C.CAPTIONS,...e}),iv(this,Jl,void 0),av(this,Jl,!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)}};Jl=new WeakMap;var Km=(t,e)=>{let i=t.getAttribute(e);return i?$t(i):[]},Vm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=lt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",Eo);var Gm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bo=(t,e,i)=>(Gm(t,e,"read from private field"),i?i.call(t):e.get(t)),jl=(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),Qi,sr,go,_o,td,ed={RATES:"rates"},Ao=class extends se{constructor(){super(),jl(this,sr),jl(this,_o),jl(this,Qi,new Ue(this,ed.RATES,{defaultValue:Us})),or(this,sr,go).call(this)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,ed.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===o.MEDIA_PLAYBACK_RATE&&i!=a?this.value=a:e===ed.RATES&&i!=a&&(bo(this,Qi).value=a,or(this,sr,go).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",or(this,_o,td))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",or(this,_o,td))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Z(this).querySelector("media-playback-rate-menu-button")}get rates(){return bo(this,Qi)}set rates(e){e?Array.isArray(e)&&(bo(this,Qi).value=e.join(" ")):bo(this,Qi).value="",or(this,sr,go).call(this)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,wi)}set mediaPlaybackRate(e){D(this,o.MEDIA_PLAYBACK_RATE,e)}};Qi=new WeakMap;sr=new WeakSet;go=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(Oe(this,"checked-indicator")),this.defaultSlot.append(e)}};_o=new WeakSet;td=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",Ao);var ov=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},To=(t,e,i)=>(ov(t,e,"read from private field"),i?i.call(t):e.get(t)),sv=(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,id={RATES:"rates"},lv=[1,1.2,1.5,1.7,2],ad=1,qm=h.createElement("template");qm.innerHTML=`
2854
+ `;var Pm=t=>{t.setAttribute("aria-checked",Or(t).toString())},fo=class extends Se{constructor(e={}){super({slotTemplate:Hm,tooltipContent:C.CAPTIONS,...e}),zf(this,Yl,void 0),Xf(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=Q(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?Ht(i):[]},Bm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=lt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",fo);var $m=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},vo=(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:ws})),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&&(vo(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:Q(this).querySelector("media-playback-rate-menu-button")}get rates(){return vo(this,Zi)}set rates(e){e?Array.isArray(e)&&(vo(this,Zi).value=e.join(" ")):vo(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 ev=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_o=(t,e,i)=>(ev(t,e,"read from private field"),i?i.call(t):e.get(t)),tv=(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,Ql={RATES:"rates"},iv=[1,1.2,1.5,1.7,2],zl=1,Wm=h.createElement("template");Wm.innerHTML=`
2855
2855
  <style>
2856
2856
  :host {
2857
2857
  min-width: 5ch;
@@ -2863,16 +2863,16 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2863
2863
  }
2864
2864
  </style>
2865
2865
  <slot name="icon"></slot>
2866
- `;var yo=class extends ke{constructor(e={}){super({slotTemplate:qm,tooltipContent:C.PLAYBACK_RATE,...e}),sv(this,zi,new Ue(this,id.RATES,{defaultValue:lv})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${ad}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,id.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===id.RATES&&(To(this,zi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?ad: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 To(this,zi)}set rates(e){e?Array.isArray(e)&&(To(this,zi).value=e.join(" ")):To(this,zi).value=""}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,ad)}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",yo);var nd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dr=(t,e,i)=>(nd(t,e,"read from private field"),i?i.call(t):e.get(t)),ko=(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)=>(nd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),lr=(t,e,i)=>(nd(t,e,"access private method"),i),ur,Xi,cr,So,Io,rd,Co=class extends se{constructor(){super(...arguments),ko(this,cr),ko(this,Io),ko(this,ur,[]),ko(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,Hd(a)),lr(this,cr,So).call(this)):e===o.MEDIA_HEIGHT&&i!==a&&lr(this,cr,So).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",lr(this,Io,rd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",lr(this,Io,rd))}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,So).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;So=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=Je({type:"radio",text:n,value:`${r.id}`,checked:r.selected&&!e});s.prepend(Oe(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(Oe(this,"checked-indicator")),this.defaultSlot.append(i)};Io=new WeakSet;rd=function(){if(this.value==null)return;let t=new d.CustomEvent(p.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",Co);var dv=`<svg aria-hidden="true" viewBox="0 0 24 24">
2866
+ `;var Ao=class extends Se{constructor(e={}){super({slotTemplate:Wm,tooltipContent:C.PLAYBACK_RATE,...e}),tv(this,Qi,new Be(this,Ql.RATES,{defaultValue:iv})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${zl}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Ql.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===Ql.RATES&&(_o(this,Qi).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?zl:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",Y.PLAYBACK_RATE({playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Q(this).querySelector("media-playback-rate-menu")}get rates(){return _o(this,Qi)}set rates(e){e?Array.isArray(e)&&(_o(this,Qi).value=e.join(" ")):_o(this,Qi).value=""}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,zl)}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",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,zi,ur,yo,ko,Xl,So=class extends se{constructor(){super(...arguments),To(this,ur),To(this,ko),To(this,dr,[]),To(this,zi,{})}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:Q(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;zi=new WeakMap;ur=new WeakSet;yo=function(){if(lr(this,zi).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&lr(this,zi).mediaHeight===this.mediaHeight)return;lr(this,zi).mediaRenditionList=JSON.stringify(this.mediaRenditionList),lr(this,zi).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 av=`<svg aria-hidden="true" viewBox="0 0 24 24">
2867
2867
  <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" />
2868
- </svg>`,Qm=h.createElement("template");Qm.innerHTML=`
2868
+ </svg>`,Km=h.createElement("template");Km.innerHTML=`
2869
2869
  <style>
2870
2870
  :host([aria-expanded="true"]) slot[name=tooltip] {
2871
2871
  display: none;
2872
2872
  }
2873
2873
  </style>
2874
- <slot name="icon">${dv}</slot>
2875
- `;var Mo=class extends ke{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE,o.MEDIA_HEIGHT]}constructor(){super({slotTemplate:Qm,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",Mo);var od=vi.createElement("template");"innerHTML"in od&&(od.innerHTML=hm);var zm,Xm,Ro=class extends si{};Ro.template=(Xm=(zm=od.content)==null?void 0:zm.children)==null?void 0:Xm[0];pe.customElements.get("media-theme-gerwig")||pe.customElements.define("media-theme-gerwig",Ro);var uv="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"},sd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function cv(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:hv(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:pv(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,...e,extraSourceParams:t.extraSourceParams}}var mv=mn.formatErrorMessage;mn.formatErrorMessage=t=>{var e,i;if(t instanceof E.MediaError){let a=mm(t,!1);return`
2874
+ <slot name="icon">${av}</slot>
2875
+ `;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:Q(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=fi.createElement("template");"innerHTML"in jl&&(jl.innerHTML=sm);var Vm,Ym,Co=class extends oi{};Co.template=(Ym=(Vm=jl.content)==null?void 0:Vm.children)==null?void 0:Ym[0];fe.customElements.get("media-theme-gerwig")||fe.customElements.define("media-theme-gerwig",Co);var rv="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"},ed=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function nv(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:sv(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:lv(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,...e,extraSourceParams:t.extraSourceParams}}var ov=un.formatErrorMessage;un.formatErrorMessage=t=>{var e,i;if(t instanceof E.MediaError){let a=om(t,!1);return`
2876
2876
  ${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
2877
2877
  ${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
2878
2878
  ${a==null?void 0:a.message}
@@ -2884,5 +2884,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2884
2884
  >${(i=a.linkText)!=null?i:a.linkUrl}</a
2885
2885
  >`:""}
2886
2886
  </p>`:""}
2887
- `}return mv(t)};function hv(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=pe.customElements.get(e);if(n!=null&&n.template)return n.template}}function pv(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 fv=Object.values(E.Attributes),vv=Object.values(ft),Ev=Object.values(m),ld=Bn(),dd="mux-player",jm={isDialogOpen:!1},bv={redundant_streams:!0},hr,pr,fr,Nt,vr,mi,it,Dt,wo,eh,Er,ud,vt,ci,Lo,th,xo,ih,Do,ah,Oo,rh,mr=class extends ll{constructor(){super();X(this,it);X(this,wo);X(this,Er);X(this,vt);X(this,Lo);X(this,xo);X(this,Do);X(this,Oo);X(this,hr,void 0);X(this,pr,!1);X(this,fr,{});X(this,Nt,!0);X(this,vr,new Un(this,"hotkeys"));X(this,mi,{...jm,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&J(this,Er,ud).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var n;if(((n=i.composedPath()[0])==null?void 0:n.localName)!=="media-error-dialog")return;nl(this,vi.activeElement)||i.preventDefault()}});Ae(this,hr,(0,y.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),J(this,wo,eh).call(this),this.isConnected&&J(this,it,Dt).call(this)}static get NAME(){return dd}static get VERSION(){return ld}static get observedAttributes(){var i;return[...(i=ll.observedAttributes)!=null?i:[],...vv,...fv,...Ev]}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,it,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")&&Ee((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:ol({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&&Ae(this,mi,{...P(this,mi),...jm}),J(this,vt,ci).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):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:uv}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(sd.includes(r))continue;let n=i.getAttribute(r);a[Pn(r)]=n===""?!0:n}return a}set themeProps(i){var r,n;J(this,it,Dt).call(this);let a={...this.themeProps,...i};for(let s in a){if(sd.includes(s))continue;let l=i==null?void 0:i[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Nn(s),!!l):(n=this.mediaTheme)==null||n.setAttribute(Nn(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 $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(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 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,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=pe.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=pe.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=pe.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:dd}get playerSoftwareVersion(){var i;return(i=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:ld}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),{}):bv}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,it,Dt).call(this),!this.media){Ee("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,it,Dt).call(this),!this.media){Ee("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,it,Dt).call(this),!this.media){Ee("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(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,it,Dt).call(this),!this.media){Ee("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,fr),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...n!=null?{storyboard:n}:{}}}set tokens(i){Ae(this,fr,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(m.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(m.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(m.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(m.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(m.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(m.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(m.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(m.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return(0,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){Ee("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,"")}};hr=new WeakMap,pr=new WeakMap,fr=new WeakMap,Nt=new WeakMap,vr=new WeakMap,mi=new WeakMap,it=new WeakSet,Dt=function(){var i,a,r,n;if(!P(this,pr)){Ae(this,pr,!0),J(this,vt,ci).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof pe.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof E.default))throw""}catch{Ee("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ns))throw""}catch{Ee("<media-controller> failed to upgrade!")}this.init(),J(this,Lo,th).call(this),J(this,xo,ih).call(this),J(this,Do,ah).call(this),Ae(this,Nt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(x.USER_INACTIVE))!=null?a:!0),J(this,Oo,rh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>J(this,vt,ci).call(this)),(n=this.media)==null||n.addEventListener("loadstart",()=>J(this,vt,ci).call(this))}},wo=new WeakSet,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{}},Er=new WeakSet,ud=function(i){Object.assign(P(this,mi),i),J(this,vt,ci).call(this)},vt=new WeakSet,ci=function(i={}){dm(um(cv(this,{...P(this,mi),...i})),this.shadowRoot)},Lo=new WeakSet,th=function(){let i=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(sd.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)},xo=new WeakSet,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)){Ze(n),n.data&&Ze(`${n.name} data:`,n.data);return}let s=gl(n,!1);s.message&&ol(s),Ee(n),n.data&&Ee(`${n.name} data:`,n.data),J(this,Er,ud).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=gl((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}))})},Do=new WeakSet,ah=function(){var a,r,n,s;let i=()=>J(this,vt,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)},Oo=new WeakSet,rh=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,f,v=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(A=>{if(!(!A.snapToLines||A.line<-5||A.line>=0&&A.line<10))if(!f||this.paused){let T=A.text.split(`
2888
- `).length,N=-3;this.streamType===y.StreamTypes.LIVE&&(N=-2);let ee=N-T;if(A.line===ee&&!v)return;r.has(A)||r.set(A,A.line),A.line=ee}else setTimeout(()=>{A.line=r.get(A)||"auto"},500)})},l=()=>{var g,f;s(a,(f=(g=this.mediaController)==null?void 0:g.hasAttribute(x.USER_INACTIVE))!=null?f:!1)},u=()=>{var v,L;let f=Array.from(((L=(v=this.mediaController)==null?void 0:v.media)==null?void 0:L.textTracks)||[]).filter(A=>["subtitles","captions"].includes(A.kind)&&A.mode==="showing")[0];f!==a&&(a==null||a.removeEventListener("cuechange",l)),a=f,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 f,v;let g=(v=(f=this.mediaController)==null?void 0:f.hasAttribute(x.USER_INACTIVE))!=null?v:!0;P(this,Nt)!==g&&(Ae(this,Nt,g),s(a,P(this,Nt)))})};function Ot(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}pe.customElements.get("mux-player")||(pe.customElements.define("mux-player",mr),pe.MuxPlayerElement=mr);var gv=mr;
2887
+ `}return ov(t)};function sv(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=fe.customElements.get(e);if(n!=null&&n.template)return n.template}}function lv(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 dv=Object.values(E.Attributes),uv=Object.values(ft),cv=Object.values(m),td=Pn(),id="mux-player",qm={isDialogOpen:!1},mv={redundant_streams:!0},mr,hr,pr,Ot,fr,ci,$,xt,Zm,ad,ui,Qm,zm,Xm,Jm,cr=class extends tl{constructor(){super();pe(this,$);pe(this,mr);pe(this,hr,!1);pe(this,pr,{});pe(this,Ot,!0);pe(this,fr,new Nn(this,"hotkeys"));pe(this,ci,{...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,fi.activeElement)||i.preventDefault()}});Te(this,mr,(0,y.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),J(this,$,Zm).call(this),this.isConnected&&J(this,$,xt).call(this)}static get NAME(){return id}static get VERSION(){return td}static get observedAttributes(){var i;return[...(i=tl.observedAttributes)!=null?i:[],...uv,...dv,...cv]}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,$,xt).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&&Qe((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&&Qe((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&&Qe((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&&Qe((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,ci,{...P(this,ci),...qm}),J(this,$,ui).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):Qe(`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:rv}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,$,xt).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=Dt(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){Qe("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,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=Dt(this,m.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(m.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(m.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=fe.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=fe.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=fe.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),{}):mv}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=Dt(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 Dt(this,E.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(E.Attributes.DEBUG,""):this.removeAttribute(E.Attributes.DEBUG)}get disableTracking(){return Dt(this,E.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(E.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Dt(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(Dt(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,$,xt).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,$,xt).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,$,xt).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,$,xt).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,"")}};mr=new WeakMap,hr=new WeakMap,pr=new WeakMap,Ot=new WeakMap,fr=new WeakMap,ci=new WeakMap,$=new WeakSet,xt=function(){var i,a,r,n;if(!P(this,hr)){Te(this,hr,!0),J(this,$,ui).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof fe.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,$,Qm).call(this),J(this,$,zm).call(this),J(this,$,Xm).call(this),Te(this,Ot,(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,$,ui).call(this)),(n=this.media)==null||n.addEventListener("loadstart",()=>J(this,$,ui).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,ci),i),J(this,$,ui).call(this)},ui=function(i={}){am(rm(nv(this,{...P(this,ci),...i})),this.shadowRoot)},Qm=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)},zm=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)){Qe(n),n.data&&Qe(`${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,$,ui).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,f,v=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(A=>{if(!(!A.snapToLines||A.line<-5||A.line>=0&&A.line<10))if(!f||this.paused){let T=A.text.split(`
2888
+ `).length,N=-3;this.streamType===y.StreamTypes.LIVE&&(N=-2);let ee=N-T;if(A.line===ee&&!v)return;r.has(A)||r.set(A,A.line),A.line=ee}else setTimeout(()=>{A.line=r.get(A)||"auto"},500)})},l=()=>{var g,f;s(a,(f=(g=this.mediaController)==null?void 0:g.hasAttribute(x.USER_INACTIVE))!=null?f:!1)},u=()=>{var v,L;let f=Array.from(((L=(v=this.mediaController)==null?void 0:v.media)==null?void 0:L.textTracks)||[]).filter(A=>["subtitles","captions"].includes(A.kind)&&A.mode==="showing")[0];f!==a&&(a==null||a.removeEventListener("cuechange",l)),a=f,a==null||a.addEventListener("cuechange",l),s(a,P(this,Ot))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(b=this.textTracks)==null||b.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var f,v;let g=(v=(f=this.mediaController)==null?void 0:f.hasAttribute(x.USER_INACTIVE))!=null?v:!0;P(this,Ot)!==g&&(Te(this,Ot,g),s(a,P(this,Ot)))})};function Dt(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}fe.customElements.get("mux-player")||(fe.customElements.define("mux-player",cr),fe.MuxPlayerElement=cr);var hv=cr;