@mux/mux-player 1.12.0 → 1.12.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,4 +1,4 @@
1
- "use strict";var Ad=Object.create;var Zi=Object.defineProperty;var _d=Object.getOwnPropertyDescriptor;var yd=Object.getOwnPropertyNames;var Td=Object.getPrototypeOf,Id=Object.prototype.hasOwnProperty;var Sd=(i,e)=>{for(var t in e)Zi(i,t,{get:e[t],enumerable:!0})},Hs=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of yd(e))!Id.call(i,r)&&r!==t&&Zi(i,r,{get:()=>e[r],enumerable:!(a=_d(e,r))||a.enumerable});return i};var kd=(i,e,t)=>(t=i!=null?Ad(Td(i)):{},Hs(e||!i||!i.__esModule?Zi(t,"default",{value:i,enumerable:!0}):t,i)),Md=i=>Hs(Zi({},"__esModule",{value:!0}),i);var Or=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var S=(i,e,t)=>(Or(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},oe=(i,e,t,a)=>(Or(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var K=(i,e,t)=>(Or(i,e,"access private method"),t);var Zc={};Sd(Zc,{MediaError:()=>g.MediaError,default:()=>Gc,getVideoAttribute:()=>kt});module.exports=Md(Zc);var Ct=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Ct{}globalThis.DocumentFragment=i}var si=class extends Ct{},Nr=class extends Ct{},Ld={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(si)}},oi,Pr=class{constructor(e,t={}){W(this,oi,void 0);oe(this,oi,t==null?void 0:t.detail)}get detail(){return S(this,oi)}initCustomEvent(){}};oi=new WeakMap;function Cd(i,e){return new si}var Ws={document:{createElement:Cd},DocumentFragment,customElements:Ld,CustomEvent:Pr,EventTarget:Ct,HTMLElement:si,HTMLVideoElement:Nr},Fs=typeof window=="undefined"||typeof globalThis.customElements=="undefined",B=Fs?Ws:globalThis,ne=Fs?Ws.document:globalThis.document;var v={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},A={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},lt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected"},Ks=Object.entries(lt),o=Ks.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),Rt=Ks.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange"}),Xc=Object.entries(Rt).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),Ys=Object.entries(o).reduce((i,[e,t])=>{let a=Rt[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),wt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},qi={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ur={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},le={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},ce={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Q={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},x={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},wd={...Q,...x};function Gs(i){return i==null?void 0:i.map(xd).join(" ")}function Zs(i){return i==null?void 0:i.split(/\s+/).map(Dd)}function xd(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function Dd(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function Qi(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function qs(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Qs(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function zi(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var Xi=i=>new Promise(e=>setTimeout(e,i));var zs=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Od=(i,e)=>{let t=i===1?zs[e].singular:zs[e].plural;return`${i} ${t}`},dt=i=>{if(!Qs(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&Od(l,u)).filter(l=>l).join(", ")}${t?" remaining":""}`};function be(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var tm=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var Ji=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},Pd=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},ji=(i,e)=>Pd(i,e)[0],li=(i,e)=>!i||!e?!1:i.contains(e)?!0:li(i,e.getRootNode().host),ut=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||ut(i.getRootNode().host,e)};function D(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}function k(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function w(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}k(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function C(i,e){return i.hasAttribute(e)}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}C(i,e)!=t&&i.toggleAttribute(e,t)}function N(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function O(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;N(i,e,void 0)!==a&&i.setAttribute(e,a)}var ea=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Br=class{observe(){}},Xs={createElement:function(){return new $r.HTMLElement},addEventListener(){},removeEventListener(){}},$r={ResizeObserver:Br,document:Xs,HTMLElement:class extends ea{},DocumentFragment:class extends ea{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){}},Js=typeof window=="undefined"||typeof window.customElements=="undefined",js=Object.keys($r).every(i=>i in globalThis),d=Js&&!js?$r:globalThis,m=Js&&!js?Xs:globalThis.document;var Ud=Object.defineProperty,Bd=(i,e,t)=>e in i?Ud(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,$d=(i,e,t)=>(Bd(i,typeof e!="symbol"?e+"":e,t),t),eo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(eo(i,e,"read from private field"),t?t.call(i):e.get(i)),ta=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ia=(i,e,t,a)=>(eo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),fe,aa,xt,ra,to=m.createElement("template");to.innerHTML=`
1
+ "use strict";var Ad=Object.create;var Zi=Object.defineProperty;var _d=Object.getOwnPropertyDescriptor;var yd=Object.getOwnPropertyNames;var Td=Object.getPrototypeOf,Id=Object.prototype.hasOwnProperty;var Sd=(i,e)=>{for(var t in e)Zi(i,t,{get:e[t],enumerable:!0})},Hs=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of yd(e))!Id.call(i,r)&&r!==t&&Zi(i,r,{get:()=>e[r],enumerable:!(a=_d(e,r))||a.enumerable});return i};var kd=(i,e,t)=>(t=i!=null?Ad(Td(i)):{},Hs(e||!i||!i.__esModule?Zi(t,"default",{value:i,enumerable:!0}):t,i)),Md=i=>Hs(Zi({},"__esModule",{value:!0}),i);var Or=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var S=(i,e,t)=>(Or(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},oe=(i,e,t,a)=>(Or(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var K=(i,e,t)=>(Or(i,e,"access private method"),t);var zc={};Sd(zc,{MediaError:()=>g.MediaError,default:()=>Qc,getVideoAttribute:()=>kt});module.exports=Md(zc);var Ct=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Ct{}globalThis.DocumentFragment=i}var si=class extends Ct{},Nr=class extends Ct{},Ld={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(si)}},oi,Pr=class{constructor(e,t={}){W(this,oi,void 0);oe(this,oi,t==null?void 0:t.detail)}get detail(){return S(this,oi)}initCustomEvent(){}};oi=new WeakMap;function Cd(i,e){return new si}var Ws={document:{createElement:Cd},DocumentFragment,customElements:Ld,CustomEvent:Pr,EventTarget:Ct,HTMLElement:si,HTMLVideoElement:Nr},Fs=typeof window=="undefined"||typeof globalThis.customElements=="undefined",B=Fs?Ws:globalThis,ne=Fs?Ws.document:globalThis.document;var v={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},A={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},lt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected"},Ks=Object.entries(lt),o=Ks.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),Rt=Ks.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange"}),em=Object.entries(Rt).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),Ys=Object.entries(o).reduce((i,[e,t])=>{let a=Rt[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),wt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},qi={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Ur={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},le={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},ce={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Q={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},x={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},wd={...Q,...x};function Gs(i){return i==null?void 0:i.map(xd).join(" ")}function Zs(i){return i==null?void 0:i.split(/\s+/).map(Dd)}function xd(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function Dd(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function Qi(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function qs(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Qs(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function zi(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var Xi=i=>new Promise(e=>setTimeout(e,i));var zs=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Od=(i,e)=>{let t=i===1?zs[e].singular:zs[e].plural;return`${i} ${t}`},dt=i=>{if(!Qs(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&Od(l,u)).filter(l=>l).join(", ")}${t?" remaining":""}`};function be(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var rm=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var Ji=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},Pd=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},ji=(i,e)=>Pd(i,e)[0],li=(i,e)=>!i||!e?!1:i.contains(e)?!0:li(i,e.getRootNode().host),ut=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||ut(i.getRootNode().host,e)};function D(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}function k(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function w(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}k(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function C(i,e){return i.hasAttribute(e)}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}C(i,e)!=t&&i.toggleAttribute(e,t)}function N(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function O(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;N(i,e,void 0)!==a&&i.setAttribute(e,a)}var ea=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Br=class{observe(){}},Xs={createElement:function(){return new $r.HTMLElement},addEventListener(){},removeEventListener(){}},$r={ResizeObserver:Br,document:Xs,HTMLElement:class extends ea{},DocumentFragment:class extends ea{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){}},Js=typeof window=="undefined"||typeof window.customElements=="undefined",js=Object.keys($r).every(i=>i in globalThis),d=Js&&!js?$r:globalThis,m=Js&&!js?Xs:globalThis.document;var Ud=Object.defineProperty,Bd=(i,e,t)=>e in i?Ud(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,$d=(i,e,t)=>(Bd(i,typeof e!="symbol"?e+"":e,t),t),eo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(eo(i,e,"read from private field"),t?t.call(i):e.get(i)),ta=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ia=(i,e,t,a)=>(eo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),fe,aa,xt,ra,to=m.createElement("template");to.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  font: var(--media-font,
@@ -74,7 +74,7 @@
74
74
  box-sizing: border-box;
75
75
  }
76
76
  </style>
77
- `;var Wr=class extends d.HTMLElement{constructor(e={}){if(super(),Fd(this,te,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=so.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Ke(this,te))==null?void 0:r.unassociateElement)==null||n.call(r,this),na(this,te,null)),a&&(na(this,te,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ke(this,te))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),na(this,te,Kd(this)),this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=Ke(this,te))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=Ke(this,te))==null||a.addEventListener("pointerdown",this),(r=Ke(this,te))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=Ke(this,te))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=Ke(this,te))==null||a.removeEventListener("pointerdown",this),(r=Ke(this,te))==null||r.removeEventListener("click",this),na(this,te,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:l,top:u,width:c,height:E}=this.getBoundingClientRect(),f=n-l,b=s-u;if(f<0||b<0||f>c||b>E||c===0&&E===0)return;let{pointerType:T=this._pointerType}=e;if(this._pointerType=void 0,T===Ur.TOUCH){this.handleTap(e);return}else if(T===Ur.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return C(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};te=new WeakMap;function Kd(i){var e;let t=i.getAttribute(A.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):ut(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",Wr);var L={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},oo=m.createElement("template");oo.innerHTML=`
77
+ `;var Wr=class extends d.HTMLElement{constructor(e={}){if(super(),Fd(this,te,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=so.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Ke(this,te))==null?void 0:r.unassociateElement)==null||n.call(r,this),na(this,te,null)),a&&(na(this,te,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ke(this,te))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),na(this,te,Kd(this)),this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=Ke(this,te))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=Ke(this,te))==null||a.addEventListener("pointerdown",this),(r=Ke(this,te))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=Ke(this,te))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=Ke(this,te))==null||a.removeEventListener("pointerdown",this),(r=Ke(this,te))==null||r.removeEventListener("click",this),na(this,te,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:l,top:u,width:c,height:E}=this.getBoundingClientRect(),f=n-l,b=s-u;if(f<0||b<0||f>c||b>E||c===0&&E===0)return;let{pointerType:T=this._pointerType}=e;if(this._pointerType=void 0,T===Ur.TOUCH){this.handleTap(e);return}else if(T===Ur.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return C(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};te=new WeakMap;function Kd(i){var e;let t=i.getAttribute(A.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):ut(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",Wr);var Yd=Object.defineProperty,Gd=(i,e,t)=>e in i?Yd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Zd=(i,e,t)=>(Gd(i,typeof e!="symbol"?e+"":e,t),t),L={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},oo=m.createElement("template");oo.innerHTML=`
78
78
  <style>
79
79
 
80
80
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -198,7 +198,7 @@
198
198
 
199
199
  <slot part="bottom chrome"></slot>
200
200
  </span>
201
- `;var Yd=Object.values(o),Gd="sm:384 md:576 lg:768 xl:960";function Zd(i){for(let e of i)qd(e.target,e.contentRect.width)}function qd(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(L.BREAKPOINTS))!=null?t:Gd,r=Qd(a),n=zd(r,e),s=!1;if(Object.keys(r).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Rt.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}}function Qd(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function zd(i,e){return Object.keys(i).filter(t=>e>=i[t])}var sa=class extends d.HTMLElement{static get observedAttributes(){return[L.AUTOHIDE,L.GESTURES_DISABLED].concat(Yd).filter(e=>![o.MEDIA_RENDITION_LIST].includes(e))}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(oo.content.cloneNode(!0)));let e=u=>{let c=this.media;for(let E of u)E.type==="childList"&&(E.removedNodes.forEach(f=>{if(f.slot=="media"&&E.target==this){let b=E.previousSibling&&E.previousSibling.previousElementSibling;if(!b||!c)this.mediaUnsetCallback(f);else{let T=b.slot!=="media";for(;(b=b.previousSibling)!==null;)b.slot=="media"&&(T=!1);T&&this.mediaUnsetCallback(f)}}}),c&&E.addedNodes.forEach(f=>{f==c&&this.handleMediaUpdated(c).then(b=>this.mediaSetCallback(b))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1,r=u=>{a||(setTimeout(()=>{Zd(u),a=!1},0),a=!0)},n=new ResizeObserver(r);this.resizeObserver=n,n.observe(this);let s=this.media,l=this.querySelector(":scope > slot[slot=media]");l&&l.addEventListener("slotchange",()=>{if(!l.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(s);return}this.media&&(s=this.media,this.handleMediaUpdated(this.media).then(c=>this.mediaSetCallback(c)))})}attributeChangedCallback(e,t,a){e.toLowerCase()==L.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?d.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){var e;let a=this.getAttribute(L.AUDIO)!=null?Q.AUDIO_PLAYER():Q.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.media&&this.handleMediaUpdated(this.media).then(l=>this.mediaSetCallback(l)),this.setAttribute(L.USER_INACTIVE,"");let r=()=>{if(this.autohide<0||this.hasAttribute(L.USER_INACTIVE))return;this.setAttribute(L.USER_INACTIVE,"");let l=new d.CustomEvent(Rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(l)},n=()=>{if(!this.hasAttribute(L.USER_INACTIVE))return;this.removeAttribute(L.USER_INACTIVE);let l=new d.CustomEvent(Rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(l)},s=()=>{n(),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{r()},this.autohide*1e3))};this.addEventListener("keyup",()=>{s()}),this.addEventListener("pointerup",l=>{l.pointerType==="touch"?[this,this.media].includes(l.target)&&!this.hasAttribute(L.USER_INACTIVE)?r():s():l.composedPath().some(u=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=u==null?void 0:u.nodeName)==null?void 0:c.toLowerCase())})&&s()}),this.addEventListener("pointermove",l=>{l.pointerType==="mouse"&&(n(),clearTimeout(this._inactiveTimeout),[this,this.media].includes(l.target)&&s())}),this.addEventListener("mouseleave",()=>{r()}),this.addEventListener("keyup",()=>{this.setAttribute(L.KEYBOARD_CONTROL,"")}),(e=d.window)==null||e.addEventListener("mouseup",()=>{this.removeAttribute(L.KEYBOARD_CONTROL)})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};var lo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Y=(i,e,t)=>(lo(i,e,"read from private field"),t?t.call(i):e.get(i)),di=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},oa=(i,e,t,a)=>(lo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Dt,Ot,la,ct,we,Ye,Ge=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){di(this,we),di(this,Dt,void 0),di(this,Ot,void 0),di(this,la,void 0),di(this,ct,new Set),oa(this,Dt,e),oa(this,Ot,t),oa(this,la,new Set(a))}[Symbol.iterator](){return Y(this,we,Ye).values()}get length(){return Y(this,we,Ye).size}get value(){var e;return(e=[...Y(this,we,Ye)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(oa(this,ct,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...Y(this,we,Ye)][e]}values(){return Y(this,we,Ye).values()}forEach(e){Y(this,we,Ye).forEach(e)}add(...e){var t,a;e.forEach(r=>Y(this,ct).add(r)),!(this.value===""&&!((t=Y(this,Dt))!=null&&t.hasAttribute(`${Y(this,Ot)}`)))&&((a=Y(this,Dt))==null||a.setAttribute(`${Y(this,Ot)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>Y(this,ct).delete(a)),(t=Y(this,Dt))==null||t.setAttribute(`${Y(this,Ot)}`,`${this.value}`)}contains(e){return Y(this,we,Ye).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};Dt=new WeakMap;Ot=new WeakMap;la=new WeakMap;ct=new WeakMap;we=new WeakSet;Ye=function(){return Y(this,ct).size?Y(this,ct):Y(this,la)};var uo=(i="")=>i.split(/\s+/),co=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return e=e==="cc"?"captions":"subtitles",{kind:e,language:t,label:r}},ui=(i="",e={})=>uo(i).map(t=>{let a=co(t);return{...e,...a}}),Xd=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?co(e):e):typeof i=="string"?ui(i):[i],da=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,mt=(i=[])=>Array.prototype.map.call(i,da).join(" "),Jd=(i,e)=>t=>t[i]===e,mo=i=>{let e=Object.entries(i).map(([t,a])=>Jd(t,a));return t=>e.every(a=>a(t))},Fr=(i,e=[],t=[])=>{let a=Xd(t).map(mo),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},ua=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:mo(e);return Array.from(i.textTracks).filter(t)},Kr=i=>!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING),xe=(i,e)=>{var t,a;let r=Kr(i);if(r||e===!1){let n=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(n){let s=new d.CustomEvent(v.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(s)}}else if(!r||e===!0){let[n]=(a=uo((t=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?t:""))!=null?a:[];if(n){let s=new d.CustomEvent(v.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(s)}}else console.error("Attempting to enable captions or subtitles but none are available! Please verify your media content if this is unexpected.")};var $={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};m.fullscreenElement===void 0&&($.enter="webkitRequestFullScreen",$.exit=m.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",$.rootEvents=["webkitfullscreenchange"],$.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],$.element="webkitFullscreenElement",$.error="webkitfullscreenerror",$.enabled="webkitFullscreenEnabled");var ca,Yr=()=>{var i,e;return ca||(ca=(e=(i=m)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),ca)},ho=async(i=Yr())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Xi(0),i.volume!==e},jd=(i=Yr())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",eu=(i=Yr())=>{let e=m[$.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Gr=eu(),po=jd(),Eo=!!d.WebKitPlaybackTargetAvailabilityEvent,vo=!!d.chrome;var ma,bo=ho().then(i=>(ma=i,ma)),tu=Object.values(ce),Zr=i=>ua(i.media,e=>[wt.SUBTITLES,wt.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),iu=i=>ua(i.media,e=>e.mode===qi.SHOWING&&[wt.SUBTITLES,wt.CAPTIONS].includes(e.kind)),ie={MEDIA_PAUSED:{get:function(i){let{media:e}=i;return e?e.paused:!0},mediaEvents:["play","playing","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(i){let{media:e}=i;return e?!e.paused:!1},mediaEvents:["playing","emptied"]},MEDIA_ENDED:{get:function(i){let{media:e}=i;return e?e.ended:!1},mediaEvents:["seeked","ended","emptied"]},MEDIA_PLAYBACK_RATE:{get:function(i){let{media:e}=i;return!e||typeof e.playbackRate=="undefined"?1:e.playbackRate},mediaEvents:["ratechange","loadstart"]},MEDIA_MUTED:{get:function(i){let{media:e}=i;return!e||typeof e.muted=="undefined"?!1:e.muted},mediaEvents:["volumechange"]},MEDIA_VOLUME:{get:function(i){let{media:e}=i;return!e||typeof e.volume=="undefined"?1:Number(e.volume)},mediaEvents:["volumechange"]},MEDIA_VOLUME_LEVEL:{get:function(i){let{media:e}=i,t="high";if(!e||typeof e.volume=="undefined")return t;let{muted:a,volume:r}=e;return r===0||a?t="off":r<.5?t="low":r<.75&&(t="medium"),t},mediaEvents:["volumechange"]},MEDIA_CURRENT_TIME:{get:function(i){let{media:e}=i;return!e||typeof e.currentTime=="undefined"?0:e.currentTime},mediaEvents:["timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return!e||!Number.isFinite(e.duration)?NaN:e.duration},mediaEvents:["durationchange","loadedmetadata","emptied"]},MEDIA_SEEKABLE:{get:function(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress"]},MEDIA_LOADING:{get:function(i){var e;return((e=i.media)==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},MEDIA_BUFFERED:{get:function(i){var e,t,a;let r=(e=i.media)==null?void 0:e.buffered;return Array.from((a=(t=i.media)==null?void 0:t.buffered)!=null?a:[]).map((n,s)=>[Number(r.start(s)).toFixed(3),Number(r.end(s)).toFixed(3)])},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(tu.includes(t)){if(t===ce.UNKNOWN){let r=i.getAttribute("defaultstreamtype");return[ce.LIVE,ce.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return ce.LIVE;if(Number.isFinite(a))return ce.ON_DEMAND;{let r=i.getAttribute("defaultstreamtype");if([ce.LIVE,ce.ON_DEMAND].includes(r))return r}},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},MEDIA_TARGET_LIVE_WINDOW:{get:function(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=ie.MEDIA_STREAM_TYPE.get(i);return(t==null||Number.isNaN(t))&&a===ce.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},MEDIA_TIME_IS_LIVE:{get:function(i){let{media:e}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(ie.MEDIA_STREAM_TYPE.get(i)==="live"))return!1;let a=e.seekable;if(!a)return!0;if(!a.length)return!1;let r=i.hasAttribute("liveedgeoffset")?Number(i.getAttribute("liveedgeoffset")):10,n=a.end(a.length-1)-r;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},MEDIA_IS_FULLSCREEN:{get:function(i,e){var t;let a=i.media;if(a&&m[$.element]===void 0&&"webkitDisplayingFullscreen"in a)return a.webkitDisplayingFullscreen&&a.webkitPresentationMode==="fullscreen";let r;return e?r=m[$.element]?e.target:null:r=(t=i.getRootNode().fullscreenElement)!=null?t:m[$.element],li(i.fullscreenElement,r)},rootEvents:$.rootEvents,mediaEvents:$.mediaEvents},MEDIA_IS_PIP:{get:function(i,e){var t;let a=i.media;if(!a)return!1;if(e)return e.type=="enterpictureinpicture";{let r=(t=i.getRootNode().pictureInPictureElement)!=null?t:m.pictureInPictureElement;return li(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_CASTING:{get:function(i,e){var t;let{media:a}=i;if(!a)return!1;let r=(t=d.CastableVideoElement)==null?void 0:t.castElement,n=li(a,r);return(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),n},mediaEvents:["entercast","leavecast","castchange"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,e){if(!Eo)return le.UNSUPPORTED;if(!!e&&e.availability!=="available"&&e.availability==="not-available")return le.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"]},MEDIA_CAST_UNAVAILABLE:{get:function(){var i;let e=(i=d.CastableVideoElement)==null?void 0:i.castState;if(!vo||!e)return le.UNSUPPORTED;if(!e.includes("CONNECT"))return le.UNAVAILABLE},mediaEvents:["castchange"]},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return Gr?void 0:le.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return po?void 0:le.UNSUPPORTED}},MEDIA_RENDITION_UNAVAILABLE:{get:function(i){var e;let{media:t}=i;if(!t)return le.UNSUPPORTED;if(!t.videoRenditions)return le.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return le.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(ma!==void 0&&!ma)return le.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return le.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_SUBTITLES_LIST:{get:function(i){return Zr(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_SHOWING:{get:function(i){return i.hasAttribute("defaultsubtitles")&&!i.hasAttribute(o.MEDIA_HAS_PLAYED)&&!i.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)&&xe(i,!0),iu(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"]},MEDIA_RENDITION_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]]},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_RENDITION_SELECTED:{get:function(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]}},ha={MEDIA_PLAY_REQUEST:(i,e,t)=>{var a;let r=ie.MEDIA_STREAM_TYPE.get(t),n=t.getAttribute("noautoseektolive")===null;r==ce.LIVE&&n&&ha.MEDIA_SEEK_TO_LIVE_REQUEST(i),(a=i.play())==null||a.catch(()=>{})},MEDIA_PAUSE_REQUEST:i=>i.pause(),MEDIA_MUTE_REQUEST:i=>i.muted=!0,MEDIA_UNMUTE_REQUEST:i=>{i.muted=!1,i.volume===0&&(i.volume=.25)},MEDIA_VOLUME_REQUEST:(i,e,t)=>{let a=e.detail;if(i.volume=a,a>0&&i.muted&&(i.muted=!1),!t.hasAttribute("novolumepref"))try{d.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!Gr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}m.pictureInPictureElement&&m.exitPictureInPicture(),t[$.enter]?t.fullscreenElement[$.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{m[$.exit]()},MEDIA_ENTER_PIP_REQUEST:i=>{if(!m.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}m[$.element]&&m[$.exit]();let e=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(t=>{if(t.code===11)if(i.readyState===0&&i.preload==="none"){let a=()=>{i.removeEventListener("loadedmetadata",r),i.preload="none"},r=()=>{i.requestPictureInPicture().catch(e),a()};i.addEventListener("loadedmetadata",r),i.preload="metadata",setTimeout(()=>{i.readyState===0&&e(),a()},1e3)}else throw t;else throw t})},MEDIA_EXIT_PIP_REQUEST:()=>{m.pictureInPictureElement&&m.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:i=>{var e;!((e=d.CastableVideoElement)!=null&&e.castEnabled)||(m[$.element]&&m[$.exit](),i.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var i;(i=d.CastableVideoElement)!=null&&i.castElement&&d.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:(i,e)=>{let t=e.detail;(i.readyState>0||i.readyState===void 0)&&(i.currentTime=t)},MEDIA_PLAYBACK_RATE_REQUEST:(i,e)=>{i.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:(i,e,t)=>{var a;if(!i)return;let r=e.detail;r===null&&t.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_TIME,r);let[n]=ua(i,{kind:wt.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(r===null){t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let s=Array.prototype.find.call(n.cues,E=>E.startTime>=r);if(!s)return;let l=/'^(?:[a-z]+:)?\/\//i.test(s.text)||(a=i.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,u=new URL(s.text,l),c=new URLSearchParams(u.hash).get("#xywh");t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,u.href),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,c.split(","))},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{let a=Zr(t),{detail:r=[]}=e;Fr(qi.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=Zr(t),{detail:r=[]}=e;Fr(qi.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:i=>{if(!!i){if(!(i.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaController: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaController: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)},MEDIA_RENDITION_REQUEST:(i,e)=>{if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let t=e.detail,a=[...i.videoRenditions].findIndex(r=>r.id==t);i.videoRenditions.selectedIndex!=a&&(i.videoRenditions.selectedIndex=a)}};var zr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pt=(i,e,t)=>(zr(i,e,"read from private field"),t?t.call(i):e.get(i)),pa=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},fo=(i,e,t,a)=>(zr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Nt=(i,e,t)=>(zr(i,e,"access private method"),t),Ze,ci,Pt,mi,Ea,qr,Io=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],au=10,go=0,ae={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys"},va=class extends sa{constructor(){super(),pa(this,Pt),pa(this,Ea),pa(this,Ze,new Ge(this,ae.HOTKEYS)),pa(this,ci,void 0),ie.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&bo.then(()=>{this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,ie.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(ha).forEach(e=>{let t=`_handle${Qi(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}ha[e](this.media,a,this)},this.addEventListener(v[e],this[t])}),this._mediaStatePropagators={},Object.keys(ie).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(lt[e],ie[e].get(this,t))}}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(ae.NO_HOTKEYS,ae.HOTKEYS,ae.DEFAULT_STREAM_TYPE,ae.DEFAULT_SUBTITLES)}get fullscreenElement(){var e;return(e=pt(this,ci))!=null?e:this}set fullscreenElement(e){this.hasAttribute(ae.FULLSCREEN_ELEMENT)&&this.removeAttribute(ae.FULLSCREEN_ELEMENT),fo(this,ci,e)}attributeChangedCallback(e,t,a){var r;if(e===ae.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(ae.HOTKEYS)&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===ae.HOTKEYS)pt(this,Ze).value=a;else if(e===ae.DEFAULT_SUBTITLES&&a!==t&&a==="")xe(this,!0);else if(e===ae.DEFAULT_STREAM_TYPE)this.propagateMediaState(lt.MEDIA_STREAM_TYPE);else if(e===ae.FULLSCREEN_ELEMENT){let n=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;fo(this,ci,n)}super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||(e.tabIndex=-1),Object.keys(ie).forEach(t=>{let{mediaEvents:a,rootEvents:r,textTracksEvents:n,videoRenditionsEvents:s}=ie[t],l=this._mediaStatePropagators[t];a==null||a.forEach(u=>{e.addEventListener(u,l),l()}),r==null||r.forEach(u=>{this.getRootNode().addEventListener(u,l),l()}),n==null||n.forEach(u=>{var c;(c=e.textTracks)==null||c.addEventListener(u,l),l()}),s==null||s.forEach(u=>{var c;(c=e.videoRenditions)==null||c.addEventListener(u,l),l()})}),!this.hasAttribute("novolumepref"))try{let t=d.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(ie).forEach(t=>{let{mediaEvents:a,rootEvents:r,textTracksEvents:n,videoRenditionsEvents:s}=ie[t],l=this._mediaStatePropagators[t];a==null||a.forEach(u=>{e.removeEventListener(u,l)}),r==null||r.forEach(u=>{this.getRootNode().removeEventListener(u,l)}),n==null||n.forEach(u=>{var c;(c=e.textTracks)==null||c.removeEventListener(u,l)}),s==null||s.forEach(u=>{var c;(c=e.videoRenditions)==null||c.removeEventListener(u,l),l()})}),this.propagateMediaState(lt.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=To(this.mediaStateReceivers,e);if(yo(this.mediaStateReceivers,e,t),a===To(this.mediaStateReceivers,e))return;let r=e.toLowerCase(),n=new d.CustomEvent(Ys[r],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(n)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=du(e,a,r);Object.keys(v).forEach(s=>{e.addEventListener(v[s],this[`_handle${Qi(s,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(v).forEach(r=>{e.removeEventListener(v[r],this[`_handle${Qi(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(ie).forEach(r=>{let n=ie[r];yo([e],lt[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Nt(this,Ea,qr))}disableHotkeys(){this.removeEventListener("keydown",Nt(this,Ea,qr)),this.removeEventListener("keyup",Nt(this,Pt,mi))}get hotkeys(){return pt(this,Ze)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute(ae.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(T=>T==="Space"?" ":T).filter(Boolean).includes(e.key))return;let l,u,c,E,f,b=au;if(!pt(this,Ze).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&pt(this,Ze).contains("nospace")))switch(e.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?v.MEDIA_UNMUTE_REQUEST:v.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?v.MEDIA_EXIT_FULLSCREEN_REQUEST:v.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":xe(this);break;case"ArrowLeft":u=this.getAttribute(o.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:go,E=Math.max(c-b,0),f=new d.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(f);break;case"ArrowRight":u=this.getAttribute(o.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:go,E=Math.max(c+b,0),f=new d.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(f);break;default:break}}};Ze=new WeakMap;ci=new WeakMap;Pt=new WeakSet;mi=function(i){let{key:e}=i;if(!Io.includes(e)){this.removeEventListener("keyup",Nt(this,Pt,mi));return}this.keyboardShortcutHandler(i)};Ea=new WeakSet;qr=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Io.includes(a)){this.removeEventListener("keyup",Nt(this,Pt,mi));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(pt(this,Ze).contains(`no${a.toLowerCase()}`)||a===" "&&pt(this,Ze).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",Nt(this,Pt,mi),{once:!0})};var ru=Object.values(o),nu=Object.values(lt),Xr=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,A.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>ru.includes(l)):[]},su=i=>{var e,t;return((e=i.nodeName)==null?void 0:e.includes("-"))&&!!d.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof d.customElements.get(i.nodeName.toLowerCase()))&&d.customElements.upgrade(i),nu.some(a=>a in i)},Qr=i=>su(i)||!!Xr(i).length,Ao=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},_o={[o.MEDIA_SUBTITLES_LIST]:mt,[o.MEDIA_SUBTITLES_SHOWING]:mt,[o.MEDIA_SEEKABLE]:Ao,[o.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Ao).join(" "),[o.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[o.MEDIA_RENDITION_LIST]:Gs},ou=async(i,e,t)=>{var a,r;if(i.isConnected||await Xi(0),typeof t=="boolean"||t==null)return M(i,e,t);if(typeof t=="number")return w(i,e,t);if(typeof t=="string")return O(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=_o[e])==null?void 0:a.call(_o,t))!=null?r:t;return i.setAttribute(e,n)},lu=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},ht=(i,e)=>{if(lu(i))return;let t=(r,n)=>{var s,l;Qr(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(f=>ht(f,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Qr(i)){d.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},yo=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=Xr(a),n=e.toLowerCase();!r.includes(n)||ou(a,n,t)})},To=(i,e)=>{for(let t of i){if(e in t)return t[e];let a=Xr(t),r=e.toLowerCase();if(!!a.includes(r))return t.getAttribute(r)}},du=(i,e,t)=>{ht(i,e);let a=E=>{var f;let b=(f=E==null?void 0:E.composedPath()[0])!=null?f:E.target;e(b)},r=E=>{var f;let b=(f=E==null?void 0:E.composedPath()[0])!=null?f:E.target;t(b)};i.addEventListener(v.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(v.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=E=>{E.forEach(f=>{let{addedNodes:b=[],removedNodes:T=[],type:V,target:G,attributeName:I}=f;V==="childList"?(Array.prototype.forEach.call(b,re=>ht(re,e)),Array.prototype.forEach.call(T,re=>ht(re,t))):V==="attributes"&&I===A.MEDIA_CHROME_ATTRIBUTES&&(Qr(G)?e(G):t(G))})},s=[],l=E=>{let f=E.target;f.name!=="media"&&(s.forEach(b=>ht(b,t)),s=[...f.assignedElements({flatten:!0})],s.forEach(b=>ht(b,e)))};i.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{ht(i,t),i.removeEventListener("slotchange",l),u.disconnect(),i.removeEventListener(v.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(v.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",va);var Jr=va;var uu=Object.defineProperty,cu=(i,e,t)=>e in i?uu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,mu=(i,e,t)=>(cu(i,typeof e!="symbol"?e+"":e,t),t),ko=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qe=(i,e,t)=>(ko(i,e,"read from private field"),t?t.call(i):e.get(i)),jr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ba=(i,e,t,a)=>(ko(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ge,fa,ga,Mo=m.createElement("template"),So=`
201
+ `;var qd=Object.values(o),Qd="sm:384 md:576 lg:768 xl:960";function zd(i){for(let e of i)Xd(e.target,e.contentRect.width)}function Xd(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(L.BREAKPOINTS))!=null?t:Qd,r=Jd(a),n=jd(r,e),s=!1;if(Object.keys(r).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Rt.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}}function Jd(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function jd(i,e){return Object.keys(i).filter(t=>e>=i[t])}var sa=class extends d.HTMLElement{constructor(){super(),Zd(this,"breakpointsUncomputed",!0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(oo.content.cloneNode(!0)));let e=u=>{let c=this.media;for(let E of u)E.type==="childList"&&(E.removedNodes.forEach(f=>{if(f.slot=="media"&&E.target==this){let b=E.previousSibling&&E.previousSibling.previousElementSibling;if(!b||!c)this.mediaUnsetCallback(f);else{let T=b.slot!=="media";for(;(b=b.previousSibling)!==null;)b.slot=="media"&&(T=!1);T&&this.mediaUnsetCallback(f)}}}),c&&E.addedNodes.forEach(f=>{f==c&&this.handleMediaUpdated(c).then(b=>this.mediaSetCallback(b))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1,r=u=>{a||(setTimeout(()=>{zd(u),a=!1,this.breakpointsUncomputed=!1},0),a=!0)},n=new ResizeObserver(r);this.resizeObserver=n,n.observe(this);let s=this.media,l=this.querySelector(":scope > slot[slot=media]");l&&l.addEventListener("slotchange",()=>{if(!l.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(s);return}this.media&&(s=this.media,this.handleMediaUpdated(this.media).then(c=>this.mediaSetCallback(c)))})}static get observedAttributes(){return[L.AUTOHIDE,L.GESTURES_DISABLED].concat(qd).filter(e=>![o.MEDIA_RENDITION_LIST].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==L.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?d.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){var e;let a=this.getAttribute(L.AUDIO)!=null?Q.AUDIO_PLAYER():Q.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.media&&this.handleMediaUpdated(this.media).then(l=>this.mediaSetCallback(l)),this.setAttribute(L.USER_INACTIVE,"");let r=()=>{if(this.autohide<0||this.hasAttribute(L.USER_INACTIVE))return;this.setAttribute(L.USER_INACTIVE,"");let l=new d.CustomEvent(Rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(l)},n=()=>{if(!this.hasAttribute(L.USER_INACTIVE))return;this.removeAttribute(L.USER_INACTIVE);let l=new d.CustomEvent(Rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(l)},s=()=>{n(),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{r()},this.autohide*1e3))};this.addEventListener("keyup",()=>{s()}),this.addEventListener("pointerup",l=>{l.pointerType==="touch"?[this,this.media].includes(l.target)&&!this.hasAttribute(L.USER_INACTIVE)?r():s():l.composedPath().some(u=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=u==null?void 0:u.nodeName)==null?void 0:c.toLowerCase())})&&s()}),this.addEventListener("pointermove",l=>{l.pointerType==="mouse"&&(n(),clearTimeout(this._inactiveTimeout),[this,this.media].includes(l.target)&&s())}),this.addEventListener("mouseleave",()=>{r()}),this.addEventListener("keyup",()=>{this.setAttribute(L.KEYBOARD_CONTROL,"")}),(e=d.window)==null||e.addEventListener("mouseup",()=>{this.removeAttribute(L.KEYBOARD_CONTROL)})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};var lo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Y=(i,e,t)=>(lo(i,e,"read from private field"),t?t.call(i):e.get(i)),di=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},oa=(i,e,t,a)=>(lo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Dt,Ot,la,ct,we,Ye,Ge=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){di(this,we),di(this,Dt,void 0),di(this,Ot,void 0),di(this,la,void 0),di(this,ct,new Set),oa(this,Dt,e),oa(this,Ot,t),oa(this,la,new Set(a))}[Symbol.iterator](){return Y(this,we,Ye).values()}get length(){return Y(this,we,Ye).size}get value(){var e;return(e=[...Y(this,we,Ye)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(oa(this,ct,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...Y(this,we,Ye)][e]}values(){return Y(this,we,Ye).values()}forEach(e){Y(this,we,Ye).forEach(e)}add(...e){var t,a;e.forEach(r=>Y(this,ct).add(r)),!(this.value===""&&!((t=Y(this,Dt))!=null&&t.hasAttribute(`${Y(this,Ot)}`)))&&((a=Y(this,Dt))==null||a.setAttribute(`${Y(this,Ot)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>Y(this,ct).delete(a)),(t=Y(this,Dt))==null||t.setAttribute(`${Y(this,Ot)}`,`${this.value}`)}contains(e){return Y(this,we,Ye).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};Dt=new WeakMap;Ot=new WeakMap;la=new WeakMap;ct=new WeakMap;we=new WeakSet;Ye=function(){return Y(this,ct).size?Y(this,ct):Y(this,la)};var uo=(i="")=>i.split(/\s+/),co=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return e=e==="cc"?"captions":"subtitles",{kind:e,language:t,label:r}},ui=(i="",e={})=>uo(i).map(t=>{let a=co(t);return{...e,...a}}),eu=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?co(e):e):typeof i=="string"?ui(i):[i],da=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,mt=(i=[])=>Array.prototype.map.call(i,da).join(" "),tu=(i,e)=>t=>t[i]===e,mo=i=>{let e=Object.entries(i).map(([t,a])=>tu(t,a));return t=>e.every(a=>a(t))},Fr=(i,e=[],t=[])=>{let a=eu(t).map(mo),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},ua=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:mo(e);return Array.from(i.textTracks).filter(t)},Kr=i=>!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING),xe=(i,e)=>{var t,a;let r=Kr(i);if(r||e===!1){let n=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(n){let s=new d.CustomEvent(v.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(s)}}else if(!r||e===!0){let[n]=(a=uo((t=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?t:""))!=null?a:[];if(n){let s=new d.CustomEvent(v.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(s)}}else console.error("Attempting to enable captions or subtitles but none are available! Please verify your media content if this is unexpected.")};var $={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};m.fullscreenElement===void 0&&($.enter="webkitRequestFullScreen",$.exit=m.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",$.rootEvents=["webkitfullscreenchange"],$.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],$.element="webkitFullscreenElement",$.error="webkitfullscreenerror",$.enabled="webkitFullscreenEnabled");var ca,Yr=()=>{var i,e;return ca||(ca=(e=(i=m)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),ca)},ho=async(i=Yr())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Xi(0),i.volume!==e},iu=(i=Yr())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",au=(i=Yr())=>{let e=m[$.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Gr=au(),po=iu(),Eo=!!d.WebKitPlaybackTargetAvailabilityEvent,vo=!!d.chrome;var ma,bo=ho().then(i=>(ma=i,ma)),ru=Object.values(ce),Zr=i=>ua(i.media,e=>[wt.SUBTITLES,wt.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),nu=i=>ua(i.media,e=>e.mode===qi.SHOWING&&[wt.SUBTITLES,wt.CAPTIONS].includes(e.kind)),ie={MEDIA_PAUSED:{get:function(i){let{media:e}=i;return e?e.paused:!0},mediaEvents:["play","playing","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(i){let{media:e}=i;return e?!e.paused:!1},mediaEvents:["playing","emptied"]},MEDIA_ENDED:{get:function(i){let{media:e}=i;return e?e.ended:!1},mediaEvents:["seeked","ended","emptied"]},MEDIA_PLAYBACK_RATE:{get:function(i){let{media:e}=i;return!e||typeof e.playbackRate=="undefined"?1:e.playbackRate},mediaEvents:["ratechange","loadstart"]},MEDIA_MUTED:{get:function(i){let{media:e}=i;return!e||typeof e.muted=="undefined"?!1:e.muted},mediaEvents:["volumechange"]},MEDIA_VOLUME:{get:function(i){let{media:e}=i;return!e||typeof e.volume=="undefined"?1:Number(e.volume)},mediaEvents:["volumechange"]},MEDIA_VOLUME_LEVEL:{get:function(i){let{media:e}=i,t="high";if(!e||typeof e.volume=="undefined")return t;let{muted:a,volume:r}=e;return r===0||a?t="off":r<.5?t="low":r<.75&&(t="medium"),t},mediaEvents:["volumechange"]},MEDIA_CURRENT_TIME:{get:function(i){let{media:e}=i;return!e||typeof e.currentTime=="undefined"?0:e.currentTime},mediaEvents:["timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return!e||!Number.isFinite(e.duration)?NaN:e.duration},mediaEvents:["durationchange","loadedmetadata","emptied"]},MEDIA_SEEKABLE:{get:function(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress"]},MEDIA_LOADING:{get:function(i){var e;return((e=i.media)==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},MEDIA_BUFFERED:{get:function(i){var e,t,a;let r=(e=i.media)==null?void 0:e.buffered;return Array.from((a=(t=i.media)==null?void 0:t.buffered)!=null?a:[]).map((n,s)=>[Number(r.start(s)).toFixed(3),Number(r.end(s)).toFixed(3)])},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(ru.includes(t)){if(t===ce.UNKNOWN){let r=i.getAttribute("defaultstreamtype");return[ce.LIVE,ce.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return ce.LIVE;if(Number.isFinite(a))return ce.ON_DEMAND;{let r=i.getAttribute("defaultstreamtype");if([ce.LIVE,ce.ON_DEMAND].includes(r))return r}},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},MEDIA_TARGET_LIVE_WINDOW:{get:function(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=ie.MEDIA_STREAM_TYPE.get(i);return(t==null||Number.isNaN(t))&&a===ce.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},MEDIA_TIME_IS_LIVE:{get:function(i){let{media:e}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(ie.MEDIA_STREAM_TYPE.get(i)==="live"))return!1;let a=e.seekable;if(!a)return!0;if(!a.length)return!1;let r=i.hasAttribute("liveedgeoffset")?Number(i.getAttribute("liveedgeoffset")):10,n=a.end(a.length-1)-r;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},MEDIA_IS_FULLSCREEN:{get:function(i,e){var t;let a=i.media;if(a&&m[$.element]===void 0&&"webkitDisplayingFullscreen"in a)return a.webkitDisplayingFullscreen&&a.webkitPresentationMode==="fullscreen";let r;return e?r=m[$.element]?e.target:null:r=(t=i.getRootNode().fullscreenElement)!=null?t:m[$.element],li(i.fullscreenElement,r)},rootEvents:$.rootEvents,mediaEvents:$.mediaEvents},MEDIA_IS_PIP:{get:function(i,e){var t;let a=i.media;if(!a)return!1;if(e)return e.type=="enterpictureinpicture";{let r=(t=i.getRootNode().pictureInPictureElement)!=null?t:m.pictureInPictureElement;return li(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_CASTING:{get:function(i,e){var t;let{media:a}=i;if(!a)return!1;let r=(t=d.CastableVideoElement)==null?void 0:t.castElement,n=li(a,r);return(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),n},mediaEvents:["entercast","leavecast","castchange"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,e){if(!Eo)return le.UNSUPPORTED;if(!!e&&e.availability!=="available"&&e.availability==="not-available")return le.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"]},MEDIA_CAST_UNAVAILABLE:{get:function(){var i;let e=(i=d.CastableVideoElement)==null?void 0:i.castState;if(!vo||!e)return le.UNSUPPORTED;if(!e.includes("CONNECT"))return le.UNAVAILABLE},mediaEvents:["castchange"]},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return Gr?void 0:le.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return po?void 0:le.UNSUPPORTED}},MEDIA_RENDITION_UNAVAILABLE:{get:function(i){var e;let{media:t}=i;if(!t)return le.UNSUPPORTED;if(!t.videoRenditions)return le.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return le.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(ma!==void 0&&!ma)return le.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return le.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_SUBTITLES_LIST:{get:function(i){return Zr(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_SHOWING:{get:function(i){return i.hasAttribute("defaultsubtitles")&&!i.hasAttribute(o.MEDIA_HAS_PLAYED)&&!i.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)&&xe(i,!0),nu(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"]},MEDIA_RENDITION_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]]},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_RENDITION_SELECTED:{get:function(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]}},ha={MEDIA_PLAY_REQUEST:(i,e,t)=>{var a;let r=ie.MEDIA_STREAM_TYPE.get(t),n=t.getAttribute("noautoseektolive")===null;r==ce.LIVE&&n&&ha.MEDIA_SEEK_TO_LIVE_REQUEST(i),(a=i.play())==null||a.catch(()=>{})},MEDIA_PAUSE_REQUEST:i=>i.pause(),MEDIA_MUTE_REQUEST:i=>i.muted=!0,MEDIA_UNMUTE_REQUEST:i=>{i.muted=!1,i.volume===0&&(i.volume=.25)},MEDIA_VOLUME_REQUEST:(i,e,t)=>{let a=e.detail;if(i.volume=a,a>0&&i.muted&&(i.muted=!1),!t.hasAttribute("novolumepref"))try{d.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!Gr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}m.pictureInPictureElement&&m.exitPictureInPicture(),t[$.enter]?t.fullscreenElement[$.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{m[$.exit]()},MEDIA_ENTER_PIP_REQUEST:i=>{if(!m.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}m[$.element]&&m[$.exit]();let e=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(t=>{if(t.code===11)if(i.readyState===0&&i.preload==="none"){let a=()=>{i.removeEventListener("loadedmetadata",r),i.preload="none"},r=()=>{i.requestPictureInPicture().catch(e),a()};i.addEventListener("loadedmetadata",r),i.preload="metadata",setTimeout(()=>{i.readyState===0&&e(),a()},1e3)}else throw t;else throw t})},MEDIA_EXIT_PIP_REQUEST:()=>{m.pictureInPictureElement&&m.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:i=>{var e;!((e=d.CastableVideoElement)!=null&&e.castEnabled)||(m[$.element]&&m[$.exit](),i.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var i;(i=d.CastableVideoElement)!=null&&i.castElement&&d.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:(i,e)=>{let t=e.detail;(i.readyState>0||i.readyState===void 0)&&(i.currentTime=t)},MEDIA_PLAYBACK_RATE_REQUEST:(i,e)=>{i.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:(i,e,t)=>{var a;if(!i)return;let r=e.detail;r===null&&t.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_TIME,r);let[n]=ua(i,{kind:wt.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(r===null){t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let s=Array.prototype.find.call(n.cues,E=>E.startTime>=r);if(!s)return;let l=/'^(?:[a-z]+:)?\/\//i.test(s.text)||(a=i.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,u=new URL(s.text,l),c=new URLSearchParams(u.hash).get("#xywh");t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,u.href),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,c.split(","))},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{let a=Zr(t),{detail:r=[]}=e;Fr(qi.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=Zr(t),{detail:r=[]}=e;Fr(qi.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:i=>{if(!!i){if(!(i.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaController: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaController: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)},MEDIA_RENDITION_REQUEST:(i,e)=>{if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let t=e.detail,a=[...i.videoRenditions].findIndex(r=>r.id==t);i.videoRenditions.selectedIndex!=a&&(i.videoRenditions.selectedIndex=a)}};var zr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pt=(i,e,t)=>(zr(i,e,"read from private field"),t?t.call(i):e.get(i)),pa=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},fo=(i,e,t,a)=>(zr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Nt=(i,e,t)=>(zr(i,e,"access private method"),t),Ze,ci,Pt,mi,Ea,qr,Io=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],su=10,go=0,ae={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys"},va=class extends sa{constructor(){super(),pa(this,Pt),pa(this,Ea),pa(this,Ze,new Ge(this,ae.HOTKEYS)),pa(this,ci,void 0),ie.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&bo.then(()=>{this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,ie.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(ha).forEach(e=>{let t=`_handle${Qi(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}ha[e](this.media,a,this)},this.addEventListener(v[e],this[t])}),this._mediaStatePropagators={},Object.keys(ie).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(lt[e],ie[e].get(this,t))}}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(ae.NO_HOTKEYS,ae.HOTKEYS,ae.DEFAULT_STREAM_TYPE,ae.DEFAULT_SUBTITLES)}get fullscreenElement(){var e;return(e=pt(this,ci))!=null?e:this}set fullscreenElement(e){this.hasAttribute(ae.FULLSCREEN_ELEMENT)&&this.removeAttribute(ae.FULLSCREEN_ELEMENT),fo(this,ci,e)}attributeChangedCallback(e,t,a){var r;if(e===ae.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(ae.HOTKEYS)&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===ae.HOTKEYS)pt(this,Ze).value=a;else if(e===ae.DEFAULT_SUBTITLES&&a!==t&&a==="")xe(this,!0);else if(e===ae.DEFAULT_STREAM_TYPE)this.propagateMediaState(lt.MEDIA_STREAM_TYPE);else if(e===ae.FULLSCREEN_ELEMENT){let n=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;fo(this,ci,n)}super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||(e.tabIndex=-1),Object.keys(ie).forEach(t=>{let{mediaEvents:a,rootEvents:r,textTracksEvents:n,videoRenditionsEvents:s}=ie[t],l=this._mediaStatePropagators[t];a==null||a.forEach(u=>{e.addEventListener(u,l),l()}),r==null||r.forEach(u=>{this.getRootNode().addEventListener(u,l),l()}),n==null||n.forEach(u=>{var c;(c=e.textTracks)==null||c.addEventListener(u,l),l()}),s==null||s.forEach(u=>{var c;(c=e.videoRenditions)==null||c.addEventListener(u,l),l()})}),!this.hasAttribute("novolumepref"))try{let t=d.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(ie).forEach(t=>{let{mediaEvents:a,rootEvents:r,textTracksEvents:n,videoRenditionsEvents:s}=ie[t],l=this._mediaStatePropagators[t];a==null||a.forEach(u=>{e.removeEventListener(u,l)}),r==null||r.forEach(u=>{this.getRootNode().removeEventListener(u,l)}),n==null||n.forEach(u=>{var c;(c=e.textTracks)==null||c.removeEventListener(u,l)}),s==null||s.forEach(u=>{var c;(c=e.videoRenditions)==null||c.removeEventListener(u,l),l()})}),this.propagateMediaState(lt.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=To(this.mediaStateReceivers,e);if(yo(this.mediaStateReceivers,e,t),a===To(this.mediaStateReceivers,e))return;let r=e.toLowerCase(),n=new d.CustomEvent(Ys[r],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(n)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=mu(e,a,r);Object.keys(v).forEach(s=>{e.addEventListener(v[s],this[`_handle${Qi(s,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(v).forEach(r=>{e.removeEventListener(v[r],this[`_handle${Qi(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(ie).forEach(r=>{let n=ie[r];yo([e],lt[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Nt(this,Ea,qr))}disableHotkeys(){this.removeEventListener("keydown",Nt(this,Ea,qr)),this.removeEventListener("keyup",Nt(this,Pt,mi))}get hotkeys(){return pt(this,Ze)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute(ae.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(T=>T==="Space"?" ":T).filter(Boolean).includes(e.key))return;let l,u,c,E,f,b=su;if(!pt(this,Ze).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&pt(this,Ze).contains("nospace")))switch(e.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?v.MEDIA_UNMUTE_REQUEST:v.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?v.MEDIA_EXIT_FULLSCREEN_REQUEST:v.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":xe(this);break;case"ArrowLeft":u=this.getAttribute(o.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:go,E=Math.max(c-b,0),f=new d.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(f);break;case"ArrowRight":u=this.getAttribute(o.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:go,E=Math.max(c+b,0),f=new d.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(f);break;default:break}}};Ze=new WeakMap;ci=new WeakMap;Pt=new WeakSet;mi=function(i){let{key:e}=i;if(!Io.includes(e)){this.removeEventListener("keyup",Nt(this,Pt,mi));return}this.keyboardShortcutHandler(i)};Ea=new WeakSet;qr=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Io.includes(a)){this.removeEventListener("keyup",Nt(this,Pt,mi));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(pt(this,Ze).contains(`no${a.toLowerCase()}`)||a===" "&&pt(this,Ze).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",Nt(this,Pt,mi),{once:!0})};var ou=Object.values(o),lu=Object.values(lt),Xr=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,A.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>ou.includes(l)):[]},du=i=>{var e,t;return((e=i.nodeName)==null?void 0:e.includes("-"))&&!!d.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof d.customElements.get(i.nodeName.toLowerCase()))&&d.customElements.upgrade(i),lu.some(a=>a in i)},Qr=i=>du(i)||!!Xr(i).length,Ao=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},_o={[o.MEDIA_SUBTITLES_LIST]:mt,[o.MEDIA_SUBTITLES_SHOWING]:mt,[o.MEDIA_SEEKABLE]:Ao,[o.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Ao).join(" "),[o.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[o.MEDIA_RENDITION_LIST]:Gs},uu=async(i,e,t)=>{var a,r;if(i.isConnected||await Xi(0),typeof t=="boolean"||t==null)return M(i,e,t);if(typeof t=="number")return w(i,e,t);if(typeof t=="string")return O(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=_o[e])==null?void 0:a.call(_o,t))!=null?r:t;return i.setAttribute(e,n)},cu=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},ht=(i,e)=>{if(cu(i))return;let t=(r,n)=>{var s,l;Qr(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(f=>ht(f,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Qr(i)){d.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},yo=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=Xr(a),n=e.toLowerCase();!r.includes(n)||uu(a,n,t)})},To=(i,e)=>{for(let t of i){if(e in t)return t[e];let a=Xr(t),r=e.toLowerCase();if(!!a.includes(r))return t.getAttribute(r)}},mu=(i,e,t)=>{ht(i,e);let a=E=>{var f;let b=(f=E==null?void 0:E.composedPath()[0])!=null?f:E.target;e(b)},r=E=>{var f;let b=(f=E==null?void 0:E.composedPath()[0])!=null?f:E.target;t(b)};i.addEventListener(v.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(v.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=E=>{E.forEach(f=>{let{addedNodes:b=[],removedNodes:T=[],type:V,target:G,attributeName:I}=f;V==="childList"?(Array.prototype.forEach.call(b,re=>ht(re,e)),Array.prototype.forEach.call(T,re=>ht(re,t))):V==="attributes"&&I===A.MEDIA_CHROME_ATTRIBUTES&&(Qr(G)?e(G):t(G))})},s=[],l=E=>{let f=E.target;f.name!=="media"&&(s.forEach(b=>ht(b,t)),s=[...f.assignedElements({flatten:!0})],s.forEach(b=>ht(b,e)))};i.addEventListener("slotchange",l);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{ht(i,t),i.removeEventListener("slotchange",l),u.disconnect(),i.removeEventListener(v.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(v.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",va);var Jr=va;var hu=Object.defineProperty,pu=(i,e,t)=>e in i?hu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Eu=(i,e,t)=>(pu(i,typeof e!="symbol"?e+"":e,t),t),ko=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qe=(i,e,t)=>(ko(i,e,"read from private field"),t?t.call(i):e.get(i)),jr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ba=(i,e,t,a)=>(ko(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ge,fa,ga,Mo=m.createElement("template"),So=`
202
202
  height: var(--thumb-height);
203
203
  width: var(--media-range-thumb-width, 10px);
204
204
  border: var(--media-range-thumb-border, none);
@@ -365,7 +365,7 @@
365
365
  <div id="hoverzone"></div>
366
366
  <input id="range" type="range" min="0" max="1000" step="any" value="0">
367
367
  </div>
368
- `;var Et=class extends d.HTMLElement{constructor(){super(),mu(this,"thumbWidth"),jr(this,ge,void 0),jr(this,fa,()=>{if(this.range.matches(":focus-visible")){let{style:t}=D(this.shadowRoot,":host");t.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),jr(this,ga,()=>{let{style:t}=D(this.shadowRoot,":host");t.removeProperty("--_focus-visible-box-shadow")}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Mo.content.cloneNode(!0)));let{style:e}=D(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-block))`),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this)),this.thumbWidth=parseInt(getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10",10)}static get observedAttributes(){return["disabled","aria-disabled",A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=qe(this,ge))==null?void 0:r.unassociateElement)==null||n.call(r,this),ba(this,ge,null)),a&&(ba(this,ge,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=qe(this,ge))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?this.range.removeAttribute(e):this.range.setAttribute(e,a))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(ba(this,ge,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=qe(this,ge))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",qe(this,fa)),this.shadowRoot.addEventListener("focusout",qe(this,ga))}disconnectedCallback(){var e,t;(t=(e=qe(this,ge))==null?void 0:e.unassociateElement)==null||t.call(e,this),ba(this,ge,null),this.shadowRoot.removeEventListener("focusin",qe(this,fa)),this.shadowRoot.removeEventListener("focusout",qe(this,ga))}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a));let{style:r}=D(this.shadowRoot,"#pointer");r.setProperty("width",`${a*t.width}px`)}updateBar(){let e=this.getBarColors(),t="linear-gradient(to right, ",a=0;e.forEach(n=>{n[1]<a||(t=t+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),t=t.slice(0,t.length-1)+")";let{style:r}=D(this.shadowRoot,"#range");r.setProperty("--media-range-track-progress-internal",t)}getRelativeValues(){let{range:e}=this;return{relativeValue:e.value-e.min,relativeMax:e.max-e.min}}getBarColors(){let e=this.range,{relativeValue:t,relativeMax:a}=this.getRelativeValues(),r=t/a*100,n=0;return!!t&&t<a&&(n=this.thumbWidth*(.5-r/100)/e.offsetWidth*100),[["var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)))",r+n],["var(--media-range-track-color, transparent)",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ge=new WeakMap;fa=new WeakMap;ga=new WeakMap;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",Et);var Lo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Aa=(i,e,t)=>(Lo(i,e,"read from private field"),t?t.call(i):e.get(i)),hu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_a=(i,e,t,a)=>(Lo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ae,Co=m.createElement("template");Co.innerHTML=`
368
+ `;var Et=class extends d.HTMLElement{constructor(){super(),Eu(this,"thumbWidth"),jr(this,ge,void 0),jr(this,fa,()=>{if(this.range.matches(":focus-visible")){let{style:t}=D(this.shadowRoot,":host");t.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),jr(this,ga,()=>{let{style:t}=D(this.shadowRoot,":host");t.removeProperty("--_focus-visible-box-shadow")}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Mo.content.cloneNode(!0)));let{style:e}=D(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-block))`),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this)),this.thumbWidth=parseInt(getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10",10)}static get observedAttributes(){return["disabled","aria-disabled",A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=qe(this,ge))==null?void 0:r.unassociateElement)==null||n.call(r,this),ba(this,ge,null)),a&&(ba(this,ge,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=qe(this,ge))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?this.range.removeAttribute(e):this.range.setAttribute(e,a))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(ba(this,ge,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=qe(this,ge))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",qe(this,fa)),this.shadowRoot.addEventListener("focusout",qe(this,ga))}disconnectedCallback(){var e,t;(t=(e=qe(this,ge))==null?void 0:e.unassociateElement)==null||t.call(e,this),ba(this,ge,null),this.shadowRoot.removeEventListener("focusin",qe(this,fa)),this.shadowRoot.removeEventListener("focusout",qe(this,ga))}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a));let{style:r}=D(this.shadowRoot,"#pointer");r.setProperty("width",`${a*t.width}px`)}updateBar(){let e=this.getBarColors(),t="linear-gradient(to right, ",a=0;e.forEach(n=>{n[1]<a||(t=t+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),t=t.slice(0,t.length-1)+")";let{style:r}=D(this.shadowRoot,"#range");r.setProperty("--media-range-track-progress-internal",t)}getRelativeValues(){let{range:e}=this;return{relativeValue:e.value-e.min,relativeMax:e.max-e.min}}getBarColors(){let e=this.range,{relativeValue:t,relativeMax:a}=this.getRelativeValues(),r=t/a*100,n=0;return!!t&&t<a&&(n=this.thumbWidth*(.5-r/100)/e.offsetWidth*100),[["var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)))",r+n],["var(--media-range-track-color, transparent)",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ge=new WeakMap;fa=new WeakMap;ga=new WeakMap;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",Et);var Lo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Aa=(i,e,t)=>(Lo(i,e,"read from private field"),t?t.call(i):e.get(i)),vu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_a=(i,e,t,a)=>(Lo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ae,Co=m.createElement("template");Co.innerHTML=`
369
369
  <style>
370
370
  :host {
371
371
 
@@ -391,7 +391,7 @@
391
391
  </style>
392
392
 
393
393
  <slot></slot>
394
- `;var tn=class extends d.HTMLElement{constructor(){super(),hu(this,Ae,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Co.content.cloneNode(!0))),this.shadowRoot.querySelector("slot").addEventListener("slotchange",({target:e})=>{let t=e.assignedElements({flatten:!0}).every(n=>["media-time-range","media-volume-range"].includes(n.nodeName.toLowerCase())),{style:a}=D(this.shadowRoot,":host"),r=t?"unset":"initial";a.setProperty("--_range-auto-size",r)})}static get observedAttributes(){return[A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Aa(this,Ae))==null?void 0:r.unassociateElement)==null||n.call(r,this),_a(this,Ae,null)),a&&(_a(this,Ae,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Aa(this,Ae))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(_a(this,Ae,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Aa(this,Ae))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Aa(this,Ae))==null?void 0:e.unassociateElement)==null||t.call(e,this),_a(this,Ae,null)}};Ae=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",tn);var Ro=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ya=(i,e,t)=>(Ro(i,e,"read from private field"),t?t.call(i):e.get(i)),pu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ta=(i,e,t,a)=>(Ro(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_e,wo=m.createElement("template");wo.innerHTML=`
394
+ `;var tn=class extends d.HTMLElement{constructor(){super(),vu(this,Ae,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Co.content.cloneNode(!0))),this.shadowRoot.querySelector("slot").addEventListener("slotchange",({target:e})=>{let t=e.assignedElements({flatten:!0}).every(n=>["media-time-range","media-volume-range"].includes(n.nodeName.toLowerCase())),{style:a}=D(this.shadowRoot,":host"),r=t?"unset":"initial";a.setProperty("--_range-auto-size",r)})}static get observedAttributes(){return[A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Aa(this,Ae))==null?void 0:r.unassociateElement)==null||n.call(r,this),_a(this,Ae,null)),a&&(_a(this,Ae,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Aa(this,Ae))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(_a(this,Ae,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Aa(this,Ae))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Aa(this,Ae))==null?void 0:e.unassociateElement)==null||t.call(e,this),_a(this,Ae,null)}};Ae=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",tn);var Ro=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ya=(i,e,t)=>(Ro(i,e,"read from private field"),t?t.call(i):e.get(i)),bu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ta=(i,e,t,a)=>(Ro(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_e,wo=m.createElement("template");wo.innerHTML=`
395
395
  <style>
396
396
  :host {
397
397
  font: var(--media-font,
@@ -424,9 +424,9 @@
424
424
  }
425
425
  </style>
426
426
  <slot></slot>
427
- `;var De=class extends d.HTMLElement{constructor(){super(),pu(this,_e,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(wo.content.cloneNode(!0)));let{style:e}=D(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=ya(this,_e))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ta(this,_e,null)),a&&(Ta(this,_e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=ya(this,_e))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ta(this,_e,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ya(this,_e))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ya(this,_e))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ta(this,_e,null)}};_e=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",De);var Do=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},xo=(i,e,t)=>(Do(i,e,"read from private field"),t?t.call(i):e.get(i)),Eu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},vu=(i,e,t,a)=>(Do(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),hi,an=class extends De{constructor(){super(),Eu(this,hi,void 0),vu(this,hi,this.shadowRoot.querySelector("slot")),xo(this,hi).textContent=be(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(xo(this,hi).textContent=be(a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return k(this,o.MEDIA_DURATION)}set mediaDuration(e){w(this,o.MEDIA_DURATION,e)}};hi=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",an);var Uo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},rn=(i,e,t)=>(Uo(i,e,"read from private field"),t?t.call(i):e.get(i)),bu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},fu=(i,e,t,a)=>(Uo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ut,me={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Oo=[...Object.values(me),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],No=["Enter"," "],gu="&nbsp;/&nbsp;",Po=(i,{timesSep:e=gu}={})=>{var t,a,r,n;let s=i.hasAttribute(me.REMAINING),l=i.hasAttribute(me.SHOW_DURATION),u=(t=i.mediaCurrentTime)!=null?t:0,[,c]=(a=i.mediaSeekable)!=null?a:[],E=(n=(r=i.mediaDuration)!=null?r:c)!=null?n:0,f=s?be(0-(E-u)):be(u);return l?`${f}${e}${be(E)}`:f},Au="video not loaded, unknown time.",_u=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=i.mediaDuration||a;if(t==null||r==null){i.setAttribute("aria-valuetext",Au);return}let n=i.hasAttribute(me.REMAINING),s=i.hasAttribute(me.SHOW_DURATION),l=n?dt(0-(r-t)):dt(t);if(!s){i.setAttribute("aria-valuetext",l);return}let u=dt(r),c=`${l} of ${u}`;i.setAttribute("aria-valuetext",c)},nn=class extends De{constructor(){super(),bu(this,Ut,void 0),fu(this,Ut,this.shadowRoot.querySelector("slot")),rn(this,Ut).innerHTML=`${Po(this)}`;let{style:e}=D(this.shadowRoot,":host:not([notoggle])");e.setProperty("cursor","pointer");let{style:t}=D(this.shadowRoot,":host(:hover:not([notoggle]))");t.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))")}static get observedAttributes(){return[...super.observedAttributes,...Oo,"disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",Q.PLAYBACK_TIME());let e=t=>{let{key:a}=t;if(!No.includes(a)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!No.includes(n)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){Oo.includes(e)?this.update():e==="disabled"&&a!==t&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return C(this,me.REMAINING)}set remaining(e){M(this,me.REMAINING,e)}get showDuration(){return C(this,me.SHOW_DURATION)}set showDuration(e){M(this,me.SHOW_DURATION,e)}get noToggle(){return C(this,me.NO_TOGGLE)}set noToggle(e){M(this,me.NO_TOGGLE,e)}get mediaDuration(){return k(this,o.MEDIA_DURATION)}set mediaDuration(e){w(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return k(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){w(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Po(this);_u(this),e!==rn(this,Ut).innerHTML&&(rn(this,Ut).innerHTML=e)}};Ut=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",nn);var yu=`<svg aria-hidden="true" viewBox="0 0 26 24">
427
+ `;var De=class extends d.HTMLElement{constructor(){super(),bu(this,_e,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(wo.content.cloneNode(!0)));let{style:e}=D(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=ya(this,_e))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ta(this,_e,null)),a&&(Ta(this,_e,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=ya(this,_e))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ta(this,_e,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ya(this,_e))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ya(this,_e))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ta(this,_e,null)}};_e=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",De);var Do=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},xo=(i,e,t)=>(Do(i,e,"read from private field"),t?t.call(i):e.get(i)),fu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},gu=(i,e,t,a)=>(Do(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),hi,an=class extends De{constructor(){super(),fu(this,hi,void 0),gu(this,hi,this.shadowRoot.querySelector("slot")),xo(this,hi).textContent=be(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(xo(this,hi).textContent=be(a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return k(this,o.MEDIA_DURATION)}set mediaDuration(e){w(this,o.MEDIA_DURATION,e)}};hi=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",an);var Uo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},rn=(i,e,t)=>(Uo(i,e,"read from private field"),t?t.call(i):e.get(i)),Au=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_u=(i,e,t,a)=>(Uo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ut,me={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Oo=[...Object.values(me),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],No=["Enter"," "],yu="&nbsp;/&nbsp;",Po=(i,{timesSep:e=yu}={})=>{var t,a,r,n;let s=i.hasAttribute(me.REMAINING),l=i.hasAttribute(me.SHOW_DURATION),u=(t=i.mediaCurrentTime)!=null?t:0,[,c]=(a=i.mediaSeekable)!=null?a:[],E=(n=(r=i.mediaDuration)!=null?r:c)!=null?n:0,f=s?be(0-(E-u)):be(u);return l?`${f}${e}${be(E)}`:f},Tu="video not loaded, unknown time.",Iu=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=i.mediaDuration||a;if(t==null||r==null){i.setAttribute("aria-valuetext",Tu);return}let n=i.hasAttribute(me.REMAINING),s=i.hasAttribute(me.SHOW_DURATION),l=n?dt(0-(r-t)):dt(t);if(!s){i.setAttribute("aria-valuetext",l);return}let u=dt(r),c=`${l} of ${u}`;i.setAttribute("aria-valuetext",c)},nn=class extends De{constructor(){super(),Au(this,Ut,void 0),_u(this,Ut,this.shadowRoot.querySelector("slot")),rn(this,Ut).innerHTML=`${Po(this)}`;let{style:e}=D(this.shadowRoot,":host:not([notoggle])");e.setProperty("cursor","pointer");let{style:t}=D(this.shadowRoot,":host(:hover:not([notoggle]))");t.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))")}static get observedAttributes(){return[...super.observedAttributes,...Oo,"disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",Q.PLAYBACK_TIME());let e=t=>{let{key:a}=t;if(!No.includes(a)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!No.includes(n)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){Oo.includes(e)?this.update():e==="disabled"&&a!==t&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return C(this,me.REMAINING)}set remaining(e){M(this,me.REMAINING,e)}get showDuration(){return C(this,me.SHOW_DURATION)}set showDuration(e){M(this,me.SHOW_DURATION,e)}get noToggle(){return C(this,me.NO_TOGGLE)}set noToggle(e){M(this,me.NO_TOGGLE,e)}get mediaDuration(){return k(this,o.MEDIA_DURATION)}set mediaDuration(e){w(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return k(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){w(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Po(this);Iu(this),e!==rn(this,Ut).innerHTML&&(rn(this,Ut).innerHTML=e)}};Ut=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",nn);var Su=`<svg aria-hidden="true" viewBox="0 0 26 24">
428
428
  <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"/>
429
- </svg>`,Tu=`<svg aria-hidden="true" viewBox="0 0 26 24">
429
+ </svg>`,ku=`<svg aria-hidden="true" viewBox="0 0 26 24">
430
430
  <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"/>
431
431
  </svg>`,Ho=m.createElement("template");Ho.innerHTML=`
432
432
  <style>
@@ -441,14 +441,14 @@
441
441
  </style>
442
442
 
443
443
  <slot name="icon">
444
- <slot name="on">${yu}</slot>
445
- <slot name="off">${Tu}</slot>
444
+ <slot name="on">${Su}</slot>
445
+ <slot name="off">${ku}</slot>
446
446
  </slot>
447
- `;var Bo=i=>{i.setAttribute("aria-checked",Kr(i))},sn=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Ho,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",Q.CLOSED_CAPTIONS()),Bo(this)}attributeChangedCallback(e,t,a){e===o.MEDIA_SUBTITLES_SHOWING&&Bo(this),super.attributeChangedCallback(e,t,a)}get mediaSubtitlesList(){return $o(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Vo(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return $o(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Vo(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){xe(this)}},$o=(i,e)=>{let t=i.getAttribute(e);return t?ui(t):[]},Vo=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=mt(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",sn);var Bt={SEEK_OFFSET:"seekoffset"},Ia=30,Iu=`<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)">${Ia}</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>`,Wo=m.createElement("template");Wo.innerHTML=`
448
- <slot name="icon">${Iu}</slot>
449
- `;var Su=0,on=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Bt.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Wo,...e})}connectedCallback(){this.seekOffset=k(this,Bt.SEEK_OFFSET,Ia),super.connectedCallback()}attributeChangedCallback(e,t,a){e===Bt.SEEK_OFFSET&&(this.seekOffset=k(this,Bt.SEEK_OFFSET,Ia)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return k(this,Bt.SEEK_OFFSET,Ia)}set seekOffset(e){w(this,Bt.SEEK_OFFSET,e),this.setAttribute("aria-label",x.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Ji(ji(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return k(this,o.MEDIA_CURRENT_TIME,Su)}set mediaCurrentTime(e){w(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new d.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",on);var ku=`<svg aria-hidden="true" viewBox="0 0 26 24">
447
+ `;var Bo=i=>{i.setAttribute("aria-checked",Kr(i))},sn=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Ho,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",Q.CLOSED_CAPTIONS()),Bo(this)}attributeChangedCallback(e,t,a){e===o.MEDIA_SUBTITLES_SHOWING&&Bo(this),super.attributeChangedCallback(e,t,a)}get mediaSubtitlesList(){return $o(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Vo(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return $o(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Vo(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){xe(this)}},$o=(i,e)=>{let t=i.getAttribute(e);return t?ui(t):[]},Vo=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=mt(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",sn);var Bt={SEEK_OFFSET:"seekoffset"},Ia=30,Mu=`<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)">${Ia}</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>`,Wo=m.createElement("template");Wo.innerHTML=`
448
+ <slot name="icon">${Mu}</slot>
449
+ `;var Lu=0,on=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Bt.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Wo,...e})}connectedCallback(){this.seekOffset=k(this,Bt.SEEK_OFFSET,Ia),super.connectedCallback()}attributeChangedCallback(e,t,a){e===Bt.SEEK_OFFSET&&(this.seekOffset=k(this,Bt.SEEK_OFFSET,Ia)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return k(this,Bt.SEEK_OFFSET,Ia)}set seekOffset(e){w(this,Bt.SEEK_OFFSET,e),this.setAttribute("aria-label",x.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Ji(ji(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return k(this,o.MEDIA_CURRENT_TIME,Lu)}set mediaCurrentTime(e){w(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new d.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",on);var Cu=`<svg aria-hidden="true" viewBox="0 0 26 24">
450
450
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
451
- </svg>`,Mu=`<svg aria-hidden="true" viewBox="0 0 26 24">
451
+ </svg>`,Ru=`<svg aria-hidden="true" viewBox="0 0 26 24">
452
452
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
453
453
  </svg>`,Ko=m.createElement("template");Ko.innerHTML=`
454
454
  <style>
@@ -463,10 +463,10 @@
463
463
  </style>
464
464
 
465
465
  <slot name="icon">
466
- <slot name="enter">${ku}</slot>
467
- <slot name="exit">${Mu}</slot>
466
+ <slot name="enter">${Cu}</slot>
467
+ <slot name="exit">${Ru}</slot>
468
468
  </slot>
469
- `;var Fo=i=>{let e=i.mediaIsFullscreen?x.EXIT_FULLSCREEN():x.ENTER_FULLSCREEN();i.setAttribute("aria-label",e)},ln=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ko,...e})}connectedCallback(){Fo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_FULLSCREEN&&Fo(this),super.attributeChangedCallback(e,t,a)}get mediaFullscreenUnavailable(){return N(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){O(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return C(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){M(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?v.MEDIA_EXIT_FULLSCREEN_REQUEST:v.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",ln);var{MEDIA_TIME_IS_LIVE:Sa,MEDIA_PAUSED:pi}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Lu,MEDIA_PLAY_REQUEST:Cu}=v,Ru='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',Go=m.createElement("template");Go.innerHTML=`
469
+ `;var Fo=i=>{let e=i.mediaIsFullscreen?x.EXIT_FULLSCREEN():x.ENTER_FULLSCREEN();i.setAttribute("aria-label",e)},ln=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ko,...e})}connectedCallback(){Fo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_FULLSCREEN&&Fo(this),super.attributeChangedCallback(e,t,a)}get mediaFullscreenUnavailable(){return N(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){O(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return C(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){M(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?v.MEDIA_EXIT_FULLSCREEN_REQUEST:v.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",ln);var{MEDIA_TIME_IS_LIVE:Sa,MEDIA_PAUSED:pi}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:wu,MEDIA_PLAY_REQUEST:xu}=v,Du='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',Go=m.createElement("template");Go.innerHTML=`
470
470
  <style>
471
471
 
472
472
  slot[name=indicator] > *,
@@ -489,14 +489,14 @@
489
489
 
490
490
  </style>
491
491
 
492
- <slot name="indicator">${Ru}</slot>
492
+ <slot name="indicator">${Du}</slot>
493
493
 
494
494
  <slot name="spacer">&nbsp;</slot><slot name="text">LIVE</slot>
495
- `;var Yo=i=>{let e=i.mediaPaused||!i.mediaTimeIsLive,t=e?x.SEEK_LIVE():x.PLAYING_LIVE();i.setAttribute("aria-label",t),e?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},dn=class extends R{static get observedAttributes(){return[...super.observedAttributes,pi,Sa]}constructor(e={}){super({slotTemplate:Go,...e})}connectedCallback(){Yo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),Yo(this)}get mediaPaused(){return C(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return C(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){M(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Lu,{composed:!0,bubbles:!0})),this.hasAttribute(pi)&&this.dispatchEvent(new d.CustomEvent(Cu,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",dn);var{MEDIA_VOLUME_LEVEL:Ei}=o,wu=`<svg aria-hidden="true" viewBox="0 0 24 24">
495
+ `;var Yo=i=>{let e=i.mediaPaused||!i.mediaTimeIsLive,t=e?x.SEEK_LIVE():x.PLAYING_LIVE();i.setAttribute("aria-label",t),e?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},dn=class extends R{static get observedAttributes(){return[...super.observedAttributes,pi,Sa]}constructor(e={}){super({slotTemplate:Go,...e})}connectedCallback(){Yo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),Yo(this)}get mediaPaused(){return C(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return C(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){M(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(wu,{composed:!0,bubbles:!0})),this.hasAttribute(pi)&&this.dispatchEvent(new d.CustomEvent(xu,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",dn);var{MEDIA_VOLUME_LEVEL:Ei}=o,Ou=`<svg aria-hidden="true" viewBox="0 0 24 24">
496
496
  <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"/>
497
497
  </svg>`,Zo=`<svg aria-hidden="true" viewBox="0 0 24 24">
498
498
  <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"/>
499
- </svg>`,xu=`<svg aria-hidden="true" viewBox="0 0 24 24">
499
+ </svg>`,Nu=`<svg aria-hidden="true" viewBox="0 0 24 24">
500
500
  <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"/>
501
501
  </svg>`,Qo=m.createElement("template");Qo.innerHTML=`
502
502
  <style>
@@ -520,10 +520,10 @@
520
520
  </style>
521
521
 
522
522
  <slot name="icon">
523
- <slot name="off">${wu}</slot>
523
+ <slot name="off">${Ou}</slot>
524
524
  <slot name="low">${Zo}</slot>
525
525
  <slot name="medium">${Zo}</slot>
526
- <slot name="high">${xu}</slot>
526
+ <slot name="high">${Nu}</slot>
527
527
  </slot>
528
528
  `;var qo=i=>{let t=i.mediaVolumeLevel==="off"?x.UNMUTE():x.MUTE();i.setAttribute("aria-label",t)},un=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:Qo,...e})}connectedCallback(){qo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_VOLUME_LEVEL&&qo(this),super.attributeChangedCallback(e,t,a)}get mediaVolumeLevel(){return N(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){O(this,o.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?v.MEDIA_UNMUTE_REQUEST:v.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",un);var zo=`<svg aria-hidden="true" viewBox="0 0 28 24">
529
529
  <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"/>
@@ -543,9 +543,9 @@
543
543
  <slot name="enter">${zo}</slot>
544
544
  <slot name="exit">${zo}</slot>
545
545
  </slot>
546
- `;var Xo=i=>{let e=i.mediaIsPip?x.EXIT_PIP():x.ENTER_PIP();i.setAttribute("aria-label",e)},cn=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Jo,...e})}connectedCallback(){Xo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&Xo(this),super.attributeChangedCallback(e,t,a)}get mediaPipUnavailable(){return N(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){O(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return C(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){M(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?v.MEDIA_EXIT_PIP_REQUEST:v.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",cn);var Du=`<svg aria-hidden="true" viewBox="0 0 24 24">
546
+ `;var Xo=i=>{let e=i.mediaIsPip?x.EXIT_PIP():x.ENTER_PIP();i.setAttribute("aria-label",e)},cn=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Jo,...e})}connectedCallback(){Xo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&Xo(this),super.attributeChangedCallback(e,t,a)}get mediaPipUnavailable(){return N(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){O(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return C(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){M(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?v.MEDIA_EXIT_PIP_REQUEST:v.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",cn);var Pu=`<svg aria-hidden="true" viewBox="0 0 24 24">
547
547
  <path d="m6 21 15-9L6 3v18Z"/>
548
- </svg>`,Ou=`<svg aria-hidden="true" viewBox="0 0 24 24">
548
+ </svg>`,Uu=`<svg aria-hidden="true" viewBox="0 0 24 24">
549
549
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
550
550
  </svg>`,el=m.createElement("template");el.innerHTML=`
551
551
  <style>
@@ -559,12 +559,12 @@
559
559
  </style>
560
560
 
561
561
  <slot name="icon">
562
- <slot name="play">${Du}</slot>
563
- <slot name="pause">${Ou}</slot>
562
+ <slot name="play">${Pu}</slot>
563
+ <slot name="pause">${Uu}</slot>
564
564
  </slot>
565
- `;var jo=i=>{let e=i.mediaPaused?x.PLAY():x.PAUSE();i.setAttribute("aria-label",e)},mn=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:el,...e})}connectedCallback(){jo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&jo(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return C(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",mn);var Nu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ka=(i,e,t)=>(Nu(i,e,"read from private field"),t?t.call(i):e.get(i)),Pu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},$t,hn={RATES:"rates"},En=[1,1.25,1.5,1.75,2],Vt=1,tl=m.createElement("template");tl.innerHTML=`
565
+ `;var jo=i=>{let e=i.mediaPaused?x.PLAY():x.PAUSE();i.setAttribute("aria-label",e)},mn=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:el,...e})}connectedCallback(){jo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&jo(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return C(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",mn);var Bu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ka=(i,e,t)=>(Bu(i,e,"read from private field"),t?t.call(i):e.get(i)),$u=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},$t,hn={RATES:"rates"},En=[1,1.25,1.5,1.75,2],Vt=1,tl=m.createElement("template");tl.innerHTML=`
566
566
  <span id="container"></span>
567
- `;var pn=class extends R{constructor(e={}){super({slotTemplate:tl,...e}),Pu(this,$t,new Ge(this,hn.RATES,{defaultValue:En})),this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${Vt}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,hn.RATES]}attributeChangedCallback(e,t,a){if(e===hn.RATES&&(ka(this,$t).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Vt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",Q.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(e,t,a)}get rates(){return ka(this,$t)}set rates(e){e?Array.isArray(e)&&(ka(this,$t).value=e.join(" ")):ka(this,$t).value=""}get mediaPlaybackRate(){return k(this,o.MEDIA_PLAYBACK_RATE,Vt)}set mediaPlaybackRate(e){w(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),s=>+s).sort((s,l)=>s-l),r=(t=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:Vt,n=new d.CustomEvent(v.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};$t=new WeakMap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",pn);var ye={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},il=m.createElement("template");il.innerHTML=`
567
+ `;var pn=class extends R{constructor(e={}){super({slotTemplate:tl,...e}),$u(this,$t,new Ge(this,hn.RATES,{defaultValue:En})),this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${Vt}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,hn.RATES]}attributeChangedCallback(e,t,a){if(e===hn.RATES&&(ka(this,$t).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Vt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",Q.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(e,t,a)}get rates(){return ka(this,$t)}set rates(e){e?Array.isArray(e)&&(ka(this,$t).value=e.join(" ")):ka(this,$t).value=""}get mediaPlaybackRate(){return k(this,o.MEDIA_PLAYBACK_RATE,Vt)}set mediaPlaybackRate(e){w(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),s=>+s).sort((s,l)=>s-l),r=(t=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:Vt,n=new d.CustomEvent(v.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};$t=new WeakMap;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",pn);var ye={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},il=m.createElement("template");il.innerHTML=`
568
568
  <style>
569
569
  :host {
570
570
  pointer-events: none;
@@ -586,9 +586,9 @@
586
586
  </style>
587
587
 
588
588
  <img part="poster img" aria-hidden="true" id="image"/>
589
- `;var Uu=i=>{i.style.removeProperty("background-image")},Bu=(i,e)=>{i.style["background-image"]=`url('${e}')`},vn=class extends d.HTMLElement{static get observedAttributes(){return[ye.PLACEHOLDER_SRC,ye.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(il.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===ye.SRC&&(a==null?this.image.removeAttribute(ye.SRC):this.image.setAttribute(ye.SRC,a)),e===ye.PLACEHOLDER_SRC&&(a==null?Uu(this.image):Bu(this.image,a))}get placeholderSrc(){return N(this,ye.PLACEHOLDER_SRC)}set placeholderSrc(e){O(this,ye.SRC,e)}get src(){return N(this,ye.SRC)}set src(e){O(this,ye.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",vn);var Ht={SEEK_OFFSET:"seekoffset"},Ma=30,$u=`<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)">${Ma}</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>`,al=m.createElement("template");al.innerHTML=`
590
- <slot name="icon">${$u}</slot>
591
- `;var Vu=0,bn=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Ht.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:al,...e})}connectedCallback(){this.seekOffset=k(this,Ht.SEEK_OFFSET,Ma),super.connectedCallback()}attributeChangedCallback(e,t,a){e===Ht.SEEK_OFFSET&&(this.seekOffset=k(this,Ht.SEEK_OFFSET,Ma)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return k(this,Ht.SEEK_OFFSET,Ma)}set seekOffset(e){w(this,Ht.SEEK_OFFSET,e),this.setAttribute("aria-label",x.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Ji(ji(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return k(this,o.MEDIA_CURRENT_TIME,Vu)}set mediaCurrentTime(e){w(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new d.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",bn);var nl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},rl=(i,e,t)=>(nl(i,e,"read from private field"),t?t.call(i):e.get(i)),Hu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Wu=(i,e,t,a)=>(nl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),vi,fn=class extends De{constructor(){super(),Hu(this,vi,void 0),Wu(this,vi,this.shadowRoot.querySelector("slot")),rl(this,vi).textContent=be(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(rl(this,vi).textContent=be(a)),super.attributeChangedCallback(e,t,a)}get mediaPreviewTime(){return k(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){w(this,o.MEDIA_PREVIEW_TIME,e)}};vi=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",fn);var sl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},La=(i,e,t)=>(sl(i,e,"read from private field"),t?t.call(i):e.get(i)),Fu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ca=(i,e,t,a)=>(sl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Te,ol=m.createElement("template");ol.innerHTML=`
589
+ `;var Vu=i=>{i.style.removeProperty("background-image")},Hu=(i,e)=>{i.style["background-image"]=`url('${e}')`},vn=class extends d.HTMLElement{static get observedAttributes(){return[ye.PLACEHOLDER_SRC,ye.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(il.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===ye.SRC&&(a==null?this.image.removeAttribute(ye.SRC):this.image.setAttribute(ye.SRC,a)),e===ye.PLACEHOLDER_SRC&&(a==null?Vu(this.image):Hu(this.image,a))}get placeholderSrc(){return N(this,ye.PLACEHOLDER_SRC)}set placeholderSrc(e){O(this,ye.SRC,e)}get src(){return N(this,ye.SRC)}set src(e){O(this,ye.SRC,e)}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",vn);var Ht={SEEK_OFFSET:"seekoffset"},Ma=30,Wu=`<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)">${Ma}</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>`,al=m.createElement("template");al.innerHTML=`
590
+ <slot name="icon">${Wu}</slot>
591
+ `;var Fu=0,bn=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,Ht.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:al,...e})}connectedCallback(){this.seekOffset=k(this,Ht.SEEK_OFFSET,Ma),super.connectedCallback()}attributeChangedCallback(e,t,a){e===Ht.SEEK_OFFSET&&(this.seekOffset=k(this,Ht.SEEK_OFFSET,Ma)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return k(this,Ht.SEEK_OFFSET,Ma)}set seekOffset(e){w(this,Ht.SEEK_OFFSET,e),this.setAttribute("aria-label",x.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Ji(ji(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return k(this,o.MEDIA_CURRENT_TIME,Fu)}set mediaCurrentTime(e){w(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new d.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",bn);var nl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},rl=(i,e,t)=>(nl(i,e,"read from private field"),t?t.call(i):e.get(i)),Ku=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Yu=(i,e,t,a)=>(nl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),vi,fn=class extends De{constructor(){super(),Ku(this,vi,void 0),Yu(this,vi,this.shadowRoot.querySelector("slot")),rl(this,vi).textContent=be(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(rl(this,vi).textContent=be(a)),super.attributeChangedCallback(e,t,a)}get mediaPreviewTime(){return k(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){w(this,o.MEDIA_PREVIEW_TIME,e)}};vi=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",fn);var sl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},La=(i,e,t)=>(sl(i,e,"read from private field"),t?t.call(i):e.get(i)),Gu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ca=(i,e,t,a)=>(sl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Te,ol=m.createElement("template");ol.innerHTML=`
592
592
  <style>
593
593
  :host {
594
594
  box-sizing: border-box;
@@ -602,7 +602,7 @@
602
602
  }
603
603
  </style>
604
604
  <img crossorigin loading="eager" decoding="async">
605
- `;var gn=class extends d.HTMLElement{constructor(){super(),Fu(this,Te,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ol.content.cloneNode(!0)))}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ca(this,Te,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=La(this,Te))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=La(this,Te))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ca(this,Te,null)}attributeChangedCallback(e,t,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===A.MEDIA_CONTROLLER&&(t&&((n=(r=La(this,Te))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ca(this,Te,null)),a&&(Ca(this,Te,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=La(this,Te))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return N(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){O(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(!!e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,s]=e,l=t.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:E,minWidth:f,minHeight:b}=u,T=Math.min(parseInt(c)/n,parseInt(E)/s),V=Math.max(parseInt(f)/n,parseInt(b)/s),G=T<1,I=G?T:V>1?V:1,{style:re}=D(this.shadowRoot,":host"),ve=D(this.shadowRoot,"img").style,se=this.shadowRoot.querySelector("img"),ni=G?"min":"max";re.setProperty(`${ni}-width`,"initial","important"),re.setProperty(`${ni}-height`,"initial","important"),re.width=`${n*I}px`,re.height=`${s*I}px`;let Lt=()=>{ve.width=`${this.imgWidth*I}px`,ve.height=`${this.imgHeight*I}px`,ve.display="block"};se.src!==l&&(se.onload=()=>{this.imgWidth=se.naturalWidth,this.imgHeight=se.naturalHeight,Lt()},se.src=l,Lt()),Lt(),ve.transform=`translate(-${a*I}px, -${r*I}px)`}};Te=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",gn);var Ln=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},H=(i,e,t)=>(Ln(i,e,"read from private field"),t?t.call(i):e.get(i)),z=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qe=(i,e,t,a)=>(Ln(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),bi=(i,e,t)=>(Ln(i,e,"access private method"),t),fi,Ra,gi,Na,Pa,wa,_n,yn,ll,xa,Tn,Da,Wt,Ai,In,Ua,Ba,Oa,Sn,kn,dl,Ku="video not loaded, unknown time.",An=i=>{let e=i.range,t=dt(+e.value),a=dt(+e.max),r=t&&a?`${t} of ${a}`:Ku;e.setAttribute("aria-valuetext",r)},ul=m.createElement("template");ul.innerHTML=`
605
+ `;var gn=class extends d.HTMLElement{constructor(){super(),Gu(this,Te,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ol.content.cloneNode(!0)))}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ca(this,Te,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=La(this,Te))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=La(this,Te))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ca(this,Te,null)}attributeChangedCallback(e,t,a){var r,n,s,l,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===A.MEDIA_CONTROLLER&&(t&&((n=(r=La(this,Te))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ca(this,Te,null)),a&&(Ca(this,Te,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=La(this,Te))==null?void 0:l.associateElement)==null||u.call(l,this)))}get mediaPreviewImage(){return N(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){O(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(!!e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,s]=e,l=t.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:E,minWidth:f,minHeight:b}=u,T=Math.min(parseInt(c)/n,parseInt(E)/s),V=Math.max(parseInt(f)/n,parseInt(b)/s),G=T<1,I=G?T:V>1?V:1,{style:re}=D(this.shadowRoot,":host"),ve=D(this.shadowRoot,"img").style,se=this.shadowRoot.querySelector("img"),ni=G?"min":"max";re.setProperty(`${ni}-width`,"initial","important"),re.setProperty(`${ni}-height`,"initial","important"),re.width=`${n*I}px`,re.height=`${s*I}px`;let Lt=()=>{ve.width=`${this.imgWidth*I}px`,ve.height=`${this.imgHeight*I}px`,ve.display="block"};se.src!==l&&(se.onload=()=>{this.imgWidth=se.naturalWidth,this.imgHeight=se.naturalHeight,Lt()},se.src=l,Lt()),Lt(),ve.transform=`translate(-${a*I}px, -${r*I}px)`}};Te=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",gn);var Ln=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},H=(i,e,t)=>(Ln(i,e,"read from private field"),t?t.call(i):e.get(i)),z=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qe=(i,e,t,a)=>(Ln(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),bi=(i,e,t)=>(Ln(i,e,"access private method"),t),fi,Ra,gi,Na,Pa,wa,_n,yn,ll,xa,Tn,Da,Wt,Ai,In,Ua,Ba,Oa,Sn,kn,dl,Zu="video not loaded, unknown time.",An=i=>{let e=i.range,t=dt(+e.value),a=dt(+e.max),r=t&&a?`${t} of ${a}`:Zu;e.setAttribute("aria-valuetext",r)},ul=m.createElement("template");ul.innerHTML=`
606
606
  <style>
607
607
  :host {
608
608
  --media-preview-border-radius: 3px;
@@ -707,7 +707,7 @@
707
707
 
708
708
  </slot>
709
709
  </div>
710
- `;var Mn=class extends Et{constructor(){super(),z(this,wa),z(this,yn),z(this,xa),z(this,Oa),z(this,kn),z(this,fi,void 0),z(this,Ra,void 0),z(this,gi,void 0),z(this,Na,void 0),z(this,Pa,void 0),z(this,Da,t=>{if([...H(this,fi)].some(E=>t.composedPath().includes(E)))return;this.updatePointerBar(t);let a=this.mediaDuration;if(!a)return;let r=this.range.getBoundingClientRect(),n=(t.clientX-r.left-this.thumbWidth/2)/(r.width-this.thumbWidth);n=Math.max(0,Math.min(1,n));let s=bi(this,xa,Tn).call(this,H(this,Ra),n),{style:l}=D(this.shadowRoot,"#preview-rail");l.transform=`translateX(${s})`;let u=n*a,c=new d.CustomEvent(v.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:u});this.dispatchEvent(c)}),z(this,Wt,!1),z(this,Ai,t=>{var a;(!t.composedPath().includes(this)||[...H(this,fi)].some(r=>t.composedPath().includes(r)))&&((a=d.window)==null||a.removeEventListener("pointermove",H(this,Ai)),Qe(this,Wt,!1),H(this,Ua).call(this))}),z(this,In,()=>{var t;(t=d.window)==null||t.addEventListener("pointermove",H(this,Da),!1)}),z(this,Ua,()=>{var t;(t=d.window)==null||t.removeEventListener("pointermove",H(this,Da));let a=new d.CustomEvent(v.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(a)}),z(this,Ba,()=>{var t;let a=this.getAttribute(o.MEDIA_DURATION);!H(this,Wt)&&a&&(Qe(this,Wt,!0),H(this,In).call(this),(t=d.window)==null||t.addEventListener("pointermove",H(this,Ai),!1))}),this.container.appendChild(ul.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let a=this.range.value,r=new d.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(r)}),this._refreshBar=()=>{let t=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+t*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},Qe(this,fi,this.shadowRoot.querySelectorAll('[part~="box"]')),Qe(this,Ra,this.shadowRoot.querySelector('[part~="preview-box"]')),Qe(this,gi,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);Qe(this,Na,parseInt(e.getPropertyValue("--media-box-padding-left"))),Qe(this,Pa,parseInt(e.getPropertyValue("--media-box-padding-right"))),bi(this,Oa,Sn).call(this)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING,o.MEDIA_ENDED]}connectedCallback(){this.range.setAttribute("aria-label",Q.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,t,a){var r,n,s,l,u;(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_ENDED||e===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,An(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),e===o.MEDIA_DURATION&&(this.range.max=(n=(r=H(this,wa,_n))!=null?r:this.mediaDuration)!=null?n:1e3,An(this),this.updateBar(),this.updateCurrentBox()),e===o.MEDIA_SEEKABLE&&(this.range.min=(s=H(this,yn,ll))!=null?s:0,this.range.max=(u=(l=H(this,wa,_n))!=null?l:this.mediaDuration)!=null?u:1e3,An(this),this.updateBar()),e===o.MEDIA_BUFFERED&&this.updateBar(),e==="disabled"&&(a==null?bi(this,Oa,Sn).call(this):bi(this,kn,dl).call(this)),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return C(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return C(this,o.MEDIA_LOADING)}set mediaLoading(e){M(this,o.MEDIA_LOADING,e)}get mediaDuration(){return k(this,o.MEDIA_DURATION)}set mediaDuration(e){w(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return k(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){w(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return k(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){w(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let t=e.map((a,r)=>`${a}:${r}`).join(" ");this.setAttribute(o.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}get mediaPreviewImage(){return N(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){O(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return k(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){w(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return C(this,o.MEDIA_ENDED)}set mediaEnded(e){M(this,o.MEDIA_ENDED,e)}getRelativeValues(){let e=super.getRelativeValues();return this.mediaEnded?{...e,relativeValue:e.relativeMax}:e}getBarColors(){var e;let t=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return t;let s;if(this.mediaEnded)s=r;else{let u=this.mediaCurrentTime,[,c=a.min]=(e=n.find(([E,f])=>E<=u&&u<=f))!=null?e:[];s=c-a.min}let l=s/r*100;return t.splice(1,0,["var(--media-time-range-buffered-color, rgb(255 255 255 / .4))",l]),t}updateCurrentBox(){if(!H(this,gi).assignedElements().length)return;let e=this.range.value/(this.range.max-this.range.min),t=bi(this,xa,Tn).call(this,H(this,gi),e),{style:a}=D(this.shadowRoot,"#current-rail");a.transform=`translateX(${t})`}};fi=new WeakMap;Ra=new WeakMap;gi=new WeakMap;Na=new WeakMap;Pa=new WeakMap;wa=new WeakSet;_n=function(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e};yn=new WeakSet;ll=function(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e};xa=new WeakSet;Tn=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let n=(t=this.getAttribute("bounds")?ut(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,s=this.range.getBoundingClientRect(),l=n.getBoundingClientRect(),u=(H(this,Na)-(s.left-l.left-r/2))/s.width*100,c=(l.right-s.left-r/2-H(this,Pa))/s.width*100;return Number.isNaN(u)||(a=`max(${u*100}%, ${a})`),Number.isNaN(c)||(a=`min(${a}, ${c*100}%)`),a};Da=new WeakMap;Wt=new WeakMap;Ai=new WeakMap;In=new WeakMap;Ua=new WeakMap;Ba=new WeakMap;Oa=new WeakSet;Sn=function(){this.addEventListener("pointermove",H(this,Ba),!1)};kn=new WeakSet;dl=function(){var i;(i=d.window)==null||i.removeEventListener("pointermove",H(this,Ai)),this.removeEventListener("pointermove",H(this,Ba)),Qe(this,Wt,!1),H(this,Ua).call(this)};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",Mn);var ml=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ft=(i,e,t)=>(ml(i,e,"read from private field"),t?t.call(i):e.get(i)),Cn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Kt=(i,e,t,a)=>(ml(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ie,$a,Va,cl={LOADING_DELAY:"loadingdelay"},hl=500,pl=m.createElement("template"),Yu=`
710
+ `;var Mn=class extends Et{constructor(){super(),z(this,wa),z(this,yn),z(this,xa),z(this,Oa),z(this,kn),z(this,fi,void 0),z(this,Ra,void 0),z(this,gi,void 0),z(this,Na,void 0),z(this,Pa,void 0),z(this,Da,t=>{if([...H(this,fi)].some(E=>t.composedPath().includes(E)))return;this.updatePointerBar(t);let a=this.mediaDuration;if(!a)return;let r=this.range.getBoundingClientRect(),n=(t.clientX-r.left-this.thumbWidth/2)/(r.width-this.thumbWidth);n=Math.max(0,Math.min(1,n));let s=bi(this,xa,Tn).call(this,H(this,Ra),n),{style:l}=D(this.shadowRoot,"#preview-rail");l.transform=`translateX(${s})`;let u=n*a,c=new d.CustomEvent(v.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:u});this.dispatchEvent(c)}),z(this,Wt,!1),z(this,Ai,t=>{var a;(!t.composedPath().includes(this)||[...H(this,fi)].some(r=>t.composedPath().includes(r)))&&((a=d.window)==null||a.removeEventListener("pointermove",H(this,Ai)),Qe(this,Wt,!1),H(this,Ua).call(this))}),z(this,In,()=>{var t;(t=d.window)==null||t.addEventListener("pointermove",H(this,Da),!1)}),z(this,Ua,()=>{var t;(t=d.window)==null||t.removeEventListener("pointermove",H(this,Da));let a=new d.CustomEvent(v.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(a)}),z(this,Ba,()=>{var t;let a=this.getAttribute(o.MEDIA_DURATION);!H(this,Wt)&&a&&(Qe(this,Wt,!0),H(this,In).call(this),(t=d.window)==null||t.addEventListener("pointermove",H(this,Ai),!1))}),this.container.appendChild(ul.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let a=this.range.value,r=new d.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(r)}),this._refreshBar=()=>{let t=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+t*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},Qe(this,fi,this.shadowRoot.querySelectorAll('[part~="box"]')),Qe(this,Ra,this.shadowRoot.querySelector('[part~="preview-box"]')),Qe(this,gi,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);Qe(this,Na,parseInt(e.getPropertyValue("--media-box-padding-left"))),Qe(this,Pa,parseInt(e.getPropertyValue("--media-box-padding-right"))),bi(this,Oa,Sn).call(this)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING,o.MEDIA_ENDED]}connectedCallback(){this.range.setAttribute("aria-label",Q.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,t,a){var r,n,s,l,u;(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_ENDED||e===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,An(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),e===o.MEDIA_DURATION&&(this.range.max=(n=(r=H(this,wa,_n))!=null?r:this.mediaDuration)!=null?n:1e3,An(this),this.updateBar(),this.updateCurrentBox()),e===o.MEDIA_SEEKABLE&&(this.range.min=(s=H(this,yn,ll))!=null?s:0,this.range.max=(u=(l=H(this,wa,_n))!=null?l:this.mediaDuration)!=null?u:1e3,An(this),this.updateBar()),e===o.MEDIA_BUFFERED&&this.updateBar(),e==="disabled"&&(a==null?bi(this,Oa,Sn).call(this):bi(this,kn,dl).call(this)),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return C(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return C(this,o.MEDIA_LOADING)}set mediaLoading(e){M(this,o.MEDIA_LOADING,e)}get mediaDuration(){return k(this,o.MEDIA_DURATION)}set mediaDuration(e){w(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return k(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){w(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return k(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){w(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let t=e.map((a,r)=>`${a}:${r}`).join(" ");this.setAttribute(o.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}get mediaPreviewImage(){return N(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){O(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return k(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){w(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return C(this,o.MEDIA_ENDED)}set mediaEnded(e){M(this,o.MEDIA_ENDED,e)}getRelativeValues(){let e=super.getRelativeValues();return this.mediaEnded?{...e,relativeValue:e.relativeMax}:e}getBarColors(){var e;let t=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return t;let s;if(this.mediaEnded)s=r;else{let u=this.mediaCurrentTime,[,c=a.min]=(e=n.find(([E,f])=>E<=u&&u<=f))!=null?e:[];s=c-a.min}let l=s/r*100;return t.splice(1,0,["var(--media-time-range-buffered-color, rgb(255 255 255 / .4))",l]),t}updateCurrentBox(){if(!H(this,gi).assignedElements().length)return;let e=this.range.value/(this.range.max-this.range.min),t=bi(this,xa,Tn).call(this,H(this,gi),e),{style:a}=D(this.shadowRoot,"#current-rail");a.transform=`translateX(${t})`}};fi=new WeakMap;Ra=new WeakMap;gi=new WeakMap;Na=new WeakMap;Pa=new WeakMap;wa=new WeakSet;_n=function(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e};yn=new WeakSet;ll=function(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e};xa=new WeakSet;Tn=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let n=(t=this.getAttribute("bounds")?ut(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,s=this.range.getBoundingClientRect(),l=n.getBoundingClientRect(),u=(H(this,Na)-(s.left-l.left-r/2))/s.width*100,c=(l.right-s.left-r/2-H(this,Pa))/s.width*100;return Number.isNaN(u)||(a=`max(${u*100}%, ${a})`),Number.isNaN(c)||(a=`min(${a}, ${c*100}%)`),a};Da=new WeakMap;Wt=new WeakMap;Ai=new WeakMap;In=new WeakMap;Ua=new WeakMap;Ba=new WeakMap;Oa=new WeakSet;Sn=function(){this.addEventListener("pointermove",H(this,Ba),!1)};kn=new WeakSet;dl=function(){var i;(i=d.window)==null||i.removeEventListener("pointermove",H(this,Ai)),this.removeEventListener("pointermove",H(this,Ba)),Qe(this,Wt,!1),H(this,Ua).call(this)};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",Mn);var ml=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ft=(i,e,t)=>(ml(i,e,"read from private field"),t?t.call(i):e.get(i)),Cn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Kt=(i,e,t,a)=>(ml(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ie,$a,Va,cl={LOADING_DELAY:"loadingdelay"},hl=500,pl=m.createElement("template"),qu=`
711
711
  <svg aria-hidden="true" viewBox="0 0 100 100">
712
712
  <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">
713
713
  <animateTransform
@@ -765,9 +765,9 @@ svg, img, ::slotted(svg), ::slotted(img) {
765
765
  }
766
766
  </style>
767
767
 
768
- <slot name="icon">${Yu}</slot>
768
+ <slot name="icon">${qu}</slot>
769
769
  <div id="status" role="status" aria-live="polite">${Q.MEDIA_LOADING()}</div>
770
- `;var Rn=class extends d.HTMLElement{constructor(){if(super(),Cn(this,Ie,void 0),Cn(this,$a,hl),Cn(this,Va,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=pl.content.cloneNode(!0);t.appendChild(a)}let{style:e}=D(this.shadowRoot,":host");Kt(this,Va,e)}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,cl.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===cl.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Ft(this,Ie))==null?void 0:r.unassociateElement)==null||n.call(r,this),Kt(this,Ie,null)),a&&(Kt(this,Ie,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ft(this,Ie))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Kt(this,Ie,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ft(this,Ie))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ft(this,Ie))==null?void 0:e.unassociateElement)==null||t.call(e,this),Kt(this,Ie,null)}get loadingDelay(){return Ft(this,$a)}set loadingDelay(e){Kt(this,$a,e),Ft(this,Va).setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return C(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return C(this,o.MEDIA_LOADING)}set mediaLoading(e){M(this,o.MEDIA_LOADING,e)}};Ie=new WeakMap;$a=new WeakMap;Va=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",Rn);var Gu=100,Zu=1,qu=i=>i.mediaMuted?0:Math.round(i.mediaVolume*i.range.max),Qu=({value:i,max:e})=>`${Math.round(i/e*100)}%`,wn=class extends Et{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Gu,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new d.CustomEvent(v.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",Q.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let r=qu(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Qu(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}get mediaVolume(){return k(this,o.MEDIA_VOLUME,Zu)}set mediaVolume(e){w(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return C(this,o.MEDIA_MUTED)}set mediaMuted(e){M(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return N(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){O(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",wn);var Pn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Z=(i,e,t)=>(Pn(i,e,"read from private field"),t?t.call(i):e.get(i)),ue=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},he=(i,e,t,a)=>(Pn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Oe=(i,e,t)=>(Pn(i,e,"access private method"),t),Se,ze,Gt,_i,Ha,Wa,xn,Yt,Dn,yi,Fa,Ka,On,Nn,El,Un,vl,zu=`
770
+ `;var Rn=class extends d.HTMLElement{constructor(){if(super(),Cn(this,Ie,void 0),Cn(this,$a,hl),Cn(this,Va,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=pl.content.cloneNode(!0);t.appendChild(a)}let{style:e}=D(this.shadowRoot,":host");Kt(this,Va,e)}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,cl.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===cl.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Ft(this,Ie))==null?void 0:r.unassociateElement)==null||n.call(r,this),Kt(this,Ie,null)),a&&(Kt(this,Ie,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Ft(this,Ie))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Kt(this,Ie,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ft(this,Ie))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ft(this,Ie))==null?void 0:e.unassociateElement)==null||t.call(e,this),Kt(this,Ie,null)}get loadingDelay(){return Ft(this,$a)}set loadingDelay(e){Kt(this,$a,e),Ft(this,Va).setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return C(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return C(this,o.MEDIA_LOADING)}set mediaLoading(e){M(this,o.MEDIA_LOADING,e)}};Ie=new WeakMap;$a=new WeakMap;Va=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",Rn);var Qu=100,zu=1,Xu=i=>i.mediaMuted?0:Math.round(i.mediaVolume*i.range.max),Ju=({value:i,max:e})=>`${Math.round(i/e*100)}%`,wn=class extends Et{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Qu,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new d.CustomEvent(v.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",Q.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let r=Xu(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Ju(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}get mediaVolume(){return k(this,o.MEDIA_VOLUME,zu)}set mediaVolume(e){w(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return C(this,o.MEDIA_MUTED)}set mediaMuted(e){M(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return N(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){O(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",wn);var Pn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Z=(i,e,t)=>(Pn(i,e,"read from private field"),t?t.call(i):e.get(i)),ue=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},he=(i,e,t,a)=>(Pn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Oe=(i,e,t)=>(Pn(i,e,"access private method"),t),Se,ze,Gt,_i,Ha,Wa,xn,Yt,Dn,yi,Fa,Ka,On,Nn,El,Un,vl,ju=`
771
771
  <svg aria-hidden="true" viewBox="0 1 24 24" part="select-indicator indicator">
772
772
  <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
773
773
  </svg>`;function Xe(i,e,t){let a=m.createElement("media-chrome-option");a.part.add("option"),a.value=e,a.selected=t;let r=m.createElement("span");return r.textContent=i,a.append(r),a}function Ne(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);return(t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t?(t=t.cloneNode(!0),t.removeAttribute("slot"),t):i.shadowRoot.querySelector(`[name="${e}"] > svg`).cloneNode(!0)}var bl=m.createElement("template");bl.innerHTML=`
@@ -815,7 +815,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
815
815
  </style>
816
816
  <slot name="header"></slot>
817
817
  <slot id="container"></slot>
818
- <slot name="select-indicator" hidden>${zu}</slot>
818
+ <slot name="select-indicator" hidden>${ju}</slot>
819
819
  `;var ke=class extends d.HTMLElement{constructor(e={}){super(),ue(this,Wa),ue(this,yi),ue(this,Ka),ue(this,Nn),ue(this,Un),ue(this,Se,void 0),ue(this,ze,""),ue(this,Gt,null),ue(this,_i,!1),ue(this,Ha,t=>{this.handleClick(t)}),ue(this,Yt,t=>{let{key:a}=t;if(a==="Escape"){this.removeEventListener("keyup",Z(this,Yt));return}if(a==="Meta"){he(this,_i,!1);return}Oe(this,Wa,xn).call(this,t)}),ue(this,Dn,t=>{let{key:a,altKey:r}=t;if(r){this.removeEventListener("keyup",Z(this,Yt));return}if(a==="Meta"){he(this,_i,!0);return}if(this.keysUsed.includes(a)&&t.preventDefault(),Z(this,_i)&&this.keysUsed.includes(a)){Oe(this,Wa,xn).call(this,t);return}this.addEventListener("keyup",Z(this,Yt),{once:!0})}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=bl.content.cloneNode(!0),e.slotTemplate&&this.nativeEl.append(e.slotTemplate.content.cloneNode(!0)),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.container.addEventListener("slotchange",t=>{for(let a of t.target.assignedNodes({flatten:!0}))a.nodeType===3&&a.textContent.trim()===""&&a.remove()})}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}static formatOptionText(e){return e}formatOptionText(e,t){return this.constructor.formatOptionText(e,t)}get options(){var e;let t=this.querySelectorAll("media-chrome-option");return t.length||(t=(e=this.container)==null?void 0:e.querySelectorAll("media-chrome-option")),Array.from(t)}get selectedOptions(){return this.options.filter(e=>e.selected)}get value(){var e,t;return(t=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.options.find(a=>a.value===e);!t||Oe(this,Ka,On).call(this,t)}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",Z(this,Ha)),this.addEventListener("keydown",Z(this,Dn))}disable(){this.removeEventListener("click",Z(this,Ha)),this.removeEventListener("keyup",Z(this,Yt))}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=Z(this,Se))==null?void 0:r.unassociateElement)==null||n.call(r,this),he(this,Se,null)),a&&(he(this,Se,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=Z(this,Se))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(he(this,Se,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Z(this,Se))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=Z(this,Se))==null?void 0:e.unassociateElement)==null||t.call(e,this),he(this,Se,null)}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e,t){let a=Oe(this,yi,Fa).call(this,e);!a||Oe(this,Ka,On).call(this,a,t)}handleMovement(e){let{key:t}=e,a=this.options,r=Oe(this,yi,Fa).call(this,e);r||(r=a.filter(s=>s.getAttribute("tabindex")==="0")[0]);let n;switch(t){case"ArrowDown":n=r.nextElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.nextElementSibling);break;case"ArrowUp":n=r.previousElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.previousElementSibling);break;case"Home":n=a[0];break;case"End":n=a[a.length-1];break;default:n=Oe(this,Nn,El).call(this,t);break}n&&(a.forEach(s=>s.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=Oe(this,yi,Fa).call(this,e);!t||t.hasAttribute("disabled")||(this.options.forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"))}};Se=new WeakMap;ze=new WeakMap;Gt=new WeakMap;_i=new WeakMap;Ha=new WeakMap;Wa=new WeakSet;xn=function(i){let{key:e}=i;e==="Enter"||e===" "?this.handleSelection(i,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"):this.handleMovement(i)};Yt=new WeakMap;Dn=new WeakMap;yi=new WeakSet;Fa=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-OPTION");return e[t]};Ka=new WeakSet;On=function(i,e){let t=[...this.selectedOptions];(!this.hasAttribute("aria-multiselectable")||this.getAttribute("aria-multiselectable")!=="true")&&this.options.forEach(a=>a.selected=!1),e?i.selected=!i.selected:i.selected=!0,this.selectedOptions.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change"))};Nn=new WeakSet;El=function(i){Oe(this,Un,vl).call(this);let e=this.options,t=e.findIndex(c=>c.getAttribute("tabindex")==="0");he(this,ze,Z(this,ze)+i);let a=Z(this,ze).split("").every(c=>c===i),r=e.slice(t+(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(Z(this,ze))),n=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(Z(this,ze))),s=[],l=[];return a&&(s=e.slice(t+(a?1:0)).filter(c=>c.textContent.startsWith(i)),l=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.startsWith(i))),[...r,...n,...s,...l][0]};Un=new WeakSet;vl=function(){clearTimeout(Z(this,Gt)),he(this,Gt,null),he(this,Gt,setTimeout(()=>{he(this,ze,""),he(this,Gt,null)},500))};d.customElements.get("media-chrome-listbox")||d.customElements.define("media-chrome-listbox",ke);var Fn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Vn=(i,e,t)=>(Fn(i,e,"read from private field"),t?t.call(i):e.get(i)),Bn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},$n=(i,e,t,a)=>(Fn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),fl=(i,e,t)=>(Fn(i,e,"access private method"),t),Ya,Zt,Ga,Hn,gl=m.createElement("template");gl.innerHTML=`
820
820
  <style>
821
821
  :host {
@@ -903,17 +903,17 @@ svg, img, ::slotted(svg), ::slotted(img) {
903
903
  <slot></slot>
904
904
  </media-chrome-listbox>
905
905
  </slot>
906
- `;var Ce=class extends d.HTMLElement{constructor(){var e;super(),q(this,Kn),q(this,Yn),q(this,Xt),q(this,Zn),q(this,Qa),q(this,Me,void 0),q(this,qt,void 0),q(this,Ti,void 0),q(this,Qt,!0),q(this,F,void 0),q(this,Ii,void 0),q(this,P,void 0),q(this,Le,void 0),q(this,Si,!1),q(this,vt,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",h(this,vt));return}a.composedPath().includes(h(this,F))&&(r==="Enter"||r===" ")?h(this,qt).call(this):r==="Escape"&&!h(this,Le).hidden&&Pe(this,Xt,ki).call(this)}),q(this,zt,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",h(this,vt));return}a.preventDefault(),this.addEventListener("keyup",h(this,vt),{once:!0})}),q(this,qa,a=>{a.composedPath().includes(this)||h(this,Le).hidden||Pe(this,Xt,ki).call(this)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Tl.content.cloneNode(!0)));let{style:t}=D(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),X(this,qt,Pe(this,Kn,Al).bind(this)),X(this,Ti,Pe(this,Yn,_l).bind(this)),(e=this.init)==null||e.call(this),X(this,F,this.shadowRoot.querySelector("[part=button]")),X(this,P,this.shadowRoot.querySelector("[part=listbox]")),X(this,Ii,this.shadowRoot.querySelector("slot[name=button]")),h(this,Ii).addEventListener("slotchange",()=>{let a=h(this,Ii).assignedElements()[0];!a||(this.disable(),X(this,F,a),h(this,F).preventClick=!0,h(this,F).hasAttribute("disabled")&&X(this,Qt,!1),h(this,Qt)?(this.enable(),h(this,F).setAttribute("aria-haspopup","listbox")):this.disable())}),X(this,Le,this.shadowRoot.querySelector("slot[name=listbox]")),h(this,Le).addEventListener("slotchange",()=>{this.disable(),X(this,P,h(this,Le).assignedElements()[0]||h(this,P)),this.enable()})}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){h(this,F).removeAttribute("disabled"),h(this,F).addEventListener("click",h(this,qt)),h(this,F).addEventListener("keydown",h(this,zt)),h(this,P).addEventListener("keydown",h(this,zt)),Pe(this,Qa,qn).call(this),h(this,P).addEventListener("change",h(this,Ti)),m.addEventListener("click",h(this,qa))}disable(){h(this,F).setAttribute("disabled",""),h(this,F).removeEventListener("click",h(this,qt)),h(this,F).removeEventListener("keydown",h(this,zt)),h(this,F).removeEventListener("keyup",h(this,vt)),h(this,P).removeEventListener("keydown",h(this,zt)),h(this,P).removeEventListener("keyup",h(this,vt)),h(this,P).addEventListener("change",h(this,Ti)),m.removeEventListener("click",h(this,qa))}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=h(this,Me))==null?void 0:r.unassociateElement)==null||n.call(r,this),X(this,Me,null),h(this,P).removeAttribute(A.MEDIA_CONTROLLER)),a&&(X(this,Me,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=h(this,Me))==null?void 0:l.associateElement)==null||u.call(l,this),h(this,P).setAttribute(A.MEDIA_CONTROLLER,a))):e==="disabled"&&a!==t&&(a==null?(X(this,Qt,!0),this.enable()):(X(this,Qt,!1),this.disable()))}connectedCallback(){var e,t,a;this.hasAttribute("disabled")||this.enable();let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(X(this,Me,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=h(this,Me))==null?void 0:t.associateElement)==null||a.call(t,this),h(this,P).setAttribute(A.MEDIA_CONTROLLER,r))}disconnectedCallback(){var e,t;this.disable(),(t=(e=h(this,Me))==null?void 0:e.unassociateElement)==null||t.call(e,this),X(this,Me,null),h(this,P).removeAttribute(A.MEDIA_CONTROLLER)}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};Me=new WeakMap;qt=new WeakMap;Ti=new WeakMap;Qt=new WeakMap;F=new WeakMap;Ii=new WeakMap;P=new WeakMap;Le=new WeakMap;Si=new WeakMap;vt=new WeakMap;zt=new WeakMap;qa=new WeakMap;Kn=new WeakSet;Al=function(){Pe(this,Xt,ki).call(this)};Yn=new WeakSet;_l=function(){Pe(this,Xt,ki).call(this,!0)};Xt=new WeakSet;ki=function(i){h(this,Le).hidden=!h(this,Le).hidden||i,Pe(this,Qa,qn).call(this,i),h(this,Le).hidden?(this.shadowRoot.activeElement===h(this,P)||h(this,P).contains(this.shadowRoot.activeElement))&&h(this,F).focus():(h(this,P).focus(),Pe(this,Zn,yl).call(this))};Zn=new WeakSet;yl=function(){var i;if(h(this,P).offsetWidth===0)return;let e=h(this,F).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||h(this,F).hasAttribute("mediacontroller")||h(this,P).hasAttribute("mediacontroller")){h(this,P).style.zIndex="1",h(this,P).style.bottom="unset",h(this,P).style.top=e.height+"px";return}let t=(i=this.getAttribute("bounds")?ut(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?i:this,a=h(this,P).offsetWidth,r=t.getBoundingClientRect(),n=-Math.max(e.x+a-r.right,0);h(this,P).style.left=`${n}px`};Qa=new WeakSet;qn=function(i=!1){X(this,Si,!h(this,Si)||i),h(this,F).setAttribute("aria-expanded",h(this,Si))};d.customElements.get("media-chrome-selectmenu")||d.customElements.define("media-chrome-selectmenu",Ce);var jn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Xu=(i,e,t)=>(jn(i,e,"read from private field"),t?t.call(i):e.get(i)),Qn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ju=(i,e,t,a)=>(jn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),zn=(i,e,t)=>(jn(i,e,"access private method"),t),Xa,Xn,kl,za,Jn,ju=`
906
+ `;var Ce=class extends d.HTMLElement{constructor(){var e;super(),q(this,Kn),q(this,Yn),q(this,Xt),q(this,Zn),q(this,Qa),q(this,Me,void 0),q(this,qt,void 0),q(this,Ti,void 0),q(this,Qt,!0),q(this,F,void 0),q(this,Ii,void 0),q(this,P,void 0),q(this,Le,void 0),q(this,Si,!1),q(this,vt,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",h(this,vt));return}a.composedPath().includes(h(this,F))&&(r==="Enter"||r===" ")?h(this,qt).call(this):r==="Escape"&&!h(this,Le).hidden&&Pe(this,Xt,ki).call(this)}),q(this,zt,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",h(this,vt));return}a.preventDefault(),this.addEventListener("keyup",h(this,vt),{once:!0})}),q(this,qa,a=>{a.composedPath().includes(this)||h(this,Le).hidden||Pe(this,Xt,ki).call(this)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Tl.content.cloneNode(!0)));let{style:t}=D(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),X(this,qt,Pe(this,Kn,Al).bind(this)),X(this,Ti,Pe(this,Yn,_l).bind(this)),(e=this.init)==null||e.call(this),X(this,F,this.shadowRoot.querySelector("[part=button]")),X(this,P,this.shadowRoot.querySelector("[part=listbox]")),X(this,Ii,this.shadowRoot.querySelector("slot[name=button]")),h(this,Ii).addEventListener("slotchange",()=>{let a=h(this,Ii).assignedElements()[0];!a||(this.disable(),X(this,F,a),h(this,F).preventClick=!0,h(this,F).hasAttribute("disabled")&&X(this,Qt,!1),h(this,Qt)?(this.enable(),h(this,F).setAttribute("aria-haspopup","listbox")):this.disable())}),X(this,Le,this.shadowRoot.querySelector("slot[name=listbox]")),h(this,Le).addEventListener("slotchange",()=>{this.disable(),X(this,P,h(this,Le).assignedElements()[0]||h(this,P)),this.enable()})}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){h(this,F).removeAttribute("disabled"),h(this,F).addEventListener("click",h(this,qt)),h(this,F).addEventListener("keydown",h(this,zt)),h(this,P).addEventListener("keydown",h(this,zt)),Pe(this,Qa,qn).call(this),h(this,P).addEventListener("change",h(this,Ti)),m.addEventListener("click",h(this,qa))}disable(){h(this,F).setAttribute("disabled",""),h(this,F).removeEventListener("click",h(this,qt)),h(this,F).removeEventListener("keydown",h(this,zt)),h(this,F).removeEventListener("keyup",h(this,vt)),h(this,P).removeEventListener("keydown",h(this,zt)),h(this,P).removeEventListener("keyup",h(this,vt)),h(this,P).addEventListener("change",h(this,Ti)),m.removeEventListener("click",h(this,qa))}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=h(this,Me))==null?void 0:r.unassociateElement)==null||n.call(r,this),X(this,Me,null),h(this,P).removeAttribute(A.MEDIA_CONTROLLER)),a&&(X(this,Me,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=h(this,Me))==null?void 0:l.associateElement)==null||u.call(l,this),h(this,P).setAttribute(A.MEDIA_CONTROLLER,a))):e==="disabled"&&a!==t&&(a==null?(X(this,Qt,!0),this.enable()):(X(this,Qt,!1),this.disable()))}connectedCallback(){var e,t,a;this.hasAttribute("disabled")||this.enable();let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(X(this,Me,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=h(this,Me))==null?void 0:t.associateElement)==null||a.call(t,this),h(this,P).setAttribute(A.MEDIA_CONTROLLER,r))}disconnectedCallback(){var e,t;this.disable(),(t=(e=h(this,Me))==null?void 0:e.unassociateElement)==null||t.call(e,this),X(this,Me,null),h(this,P).removeAttribute(A.MEDIA_CONTROLLER)}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};Me=new WeakMap;qt=new WeakMap;Ti=new WeakMap;Qt=new WeakMap;F=new WeakMap;Ii=new WeakMap;P=new WeakMap;Le=new WeakMap;Si=new WeakMap;vt=new WeakMap;zt=new WeakMap;qa=new WeakMap;Kn=new WeakSet;Al=function(){Pe(this,Xt,ki).call(this)};Yn=new WeakSet;_l=function(){Pe(this,Xt,ki).call(this,!0)};Xt=new WeakSet;ki=function(i){h(this,Le).hidden=!h(this,Le).hidden||i,Pe(this,Qa,qn).call(this,i),h(this,Le).hidden?(this.shadowRoot.activeElement===h(this,P)||h(this,P).contains(this.shadowRoot.activeElement))&&h(this,F).focus():(h(this,P).focus(),Pe(this,Zn,yl).call(this))};Zn=new WeakSet;yl=function(){var i;if(h(this,P).offsetWidth===0)return;let e=h(this,F).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||h(this,F).hasAttribute("mediacontroller")||h(this,P).hasAttribute("mediacontroller")){h(this,P).style.zIndex="1",h(this,P).style.bottom="unset",h(this,P).style.top=e.height+"px";return}let t=(i=this.getAttribute("bounds")?ut(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?i:this,a=h(this,P).offsetWidth,r=t.getBoundingClientRect(),n=-Math.max(e.x+a-r.right,0);h(this,P).style.left=`${n}px`};Qa=new WeakSet;qn=function(i=!1){X(this,Si,!h(this,Si)||i),h(this,F).setAttribute("aria-expanded",h(this,Si))};d.customElements.get("media-chrome-selectmenu")||d.customElements.define("media-chrome-selectmenu",Ce);var jn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ec=(i,e,t)=>(jn(i,e,"read from private field"),t?t.call(i):e.get(i)),Qn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},tc=(i,e,t,a)=>(jn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),zn=(i,e,t)=>(jn(i,e,"access private method"),t),Xa,Xn,kl,za,Jn,ic=`
907
907
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
908
908
  <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"/>
909
909
  </svg>`,Ml=m.createElement("template");Ml.innerHTML=`
910
- <slot name="captions-indicator" hidden>${ju}</slot>
911
- `;var Ja=class extends ke{constructor(){super({slotTemplate:Ml}),Qn(this,Xn),Qn(this,za),Qn(this,Xa,void 0)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_LIST&&t!==a?zn(this,Xn,kl).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&t!==a?this.value=a:e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTrack API."))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",zn(this,za,Jn))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",zn(this,za,Jn))}get mediaSubtitlesList(){return Il(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Sl(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Il(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Sl(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Xa=new WeakMap;Xn=new WeakSet;kl=function(){var i;if(Xu(this,Xa)===JSON.stringify(this.mediaSubtitlesList))return;Ju(this,Xa,JSON.stringify(this.mediaSubtitlesList));let e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.value,a=Xe(this.formatOptionText("Off"),"off",t);a.prepend(Ne(this,"select-indicator")),e.append(a);let r=this.mediaSubtitlesList;for(let n of r){let s=Xe(this.formatOptionText(n.label,n),da(n),this.value==da(n));s.prepend(Ne(this,"select-indicator")),((i=n.kind)!=null?i:"subs")==="captions"&&s.append(Ne(this,"captions-indicator")),e.append(s)}};za=new WeakSet;Jn=function(){if(xe(this,!1),!this.value)return;let i=new d.CustomEvent(v.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};var Il=(i,e)=>{let t=i.getAttribute(e);return t?ui(t):[]},Sl=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=mt(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-listbox")||d.customElements.define("media-captions-listbox",Ja);var ja=class extends Ce{init(){let e=m.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};d.customElements.get("media-captions-selectmenu")||d.customElements.define("media-captions-selectmenu",ja);var Ll=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},er=(i,e,t)=>(Ll(i,e,"read from private field"),t?t.call(i):e.get(i)),es=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Mi=(i,e,t)=>(Ll(i,e,"access private method"),t),Jt,Li,tr,ir,is,ts={RATES:"rates"},ar=class extends ke{constructor(){super(),es(this,Li),es(this,ir),es(this,Jt,new Ge(this,ts.RATES,{defaultValue:En})),Mi(this,Li,tr).call(this)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_PLAYBACK_RATE,ts.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===ts.RATES&&t!=a&&(er(this,Jt).value=a,Mi(this,Li,tr).call(this))}get rates(){return er(this,Jt)}set rates(e){e?Array.isArray(e)&&(er(this,Jt).value=e.join(" ")):er(this,Jt).value="",Mi(this,Li,tr).call(this)}get mediaPlaybackRate(){return k(this,o.MEDIA_PLAYBACK_RATE,Vt)}set mediaPlaybackRate(e){w(this,o.MEDIA_PLAYBACK_RATE,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Mi(this,ir,is))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Mi(this,ir,is))}};Jt=new WeakMap;Li=new WeakSet;tr=function(){let i=this.shadowRoot.querySelector("#container");i.textContent="";for(let e of this.rates){let t=Xe(this.formatOptionText(`${e}x`,e),e,this.mediaPlaybackRate==e);t.prepend(Ne(this,"select-indicator")),i.append(t)}};ir=new WeakSet;is=function(){if(!this.value)return;let i=new d.CustomEvent(v.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-playback-rate-listbox")||d.customElements.define("media-playback-rate-listbox",ar);var rr=class extends Ce{init(){let e=m.createElement("media-playback-rate-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-playback-rate-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};d.customElements.get("media-playback-rate-selectmenu")||d.customElements.define("media-playback-rate-selectmenu",rr);var ss=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Cl=(i,e,t)=>(ss(i,e,"read from private field"),t?t.call(i):e.get(i)),nr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},as=(i,e,t,a)=>(ss(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),sr=(i,e,t)=>(ss(i,e,"access private method"),t),Ci,dr,or,rs,lr,ns,ur=class extends ke{constructor(){super(...arguments),nr(this,or),nr(this,lr),nr(this,Ci,[]),nr(this,dr,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===o.MEDIA_RENDITION_LIST&&t!==a&&(as(this,Ci,Zs(a)),sr(this,or,rs).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",sr(this,lr,ns))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",sr(this,lr,ns))}get mediaRenditionList(){return Cl(this,Ci)}set mediaRenditionList(e){as(this,Ci,e),sr(this,or,rs).call(this)}get mediaRenditionSelected(){return N(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){O(this,o.MEDIA_RENDITION_SELECTED,e)}};Ci=new WeakMap;dr=new WeakMap;or=new WeakSet;rs=function(){if(Cl(this,dr)===JSON.stringify(this.mediaRenditionList))return;as(this,dr,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height),e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.mediaRenditionSelected;for(let r of i){let n=this.formatOptionText(`${Math.min(r.width,r.height)}p`,r),s=Xe(n,`${r.id}`,r.selected&&!t);s.prepend(Ne(this,"select-indicator")),e.append(s)}let a=Xe(this.formatOptionText("Auto"),"auto",t);a.prepend(Ne(this,"select-indicator")),e.append(a)};lr=new WeakSet;ns=function(){if(this.value==null)return;let i=new d.CustomEvent(v.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-rendition-listbox")||d.customElements.define("media-rendition-listbox",ur);var ec=`<svg aria-hidden="true" viewBox="0 0 24 24">
910
+ <slot name="captions-indicator" hidden>${ic}</slot>
911
+ `;var Ja=class extends ke{constructor(){super({slotTemplate:Ml}),Qn(this,Xn),Qn(this,za),Qn(this,Xa,void 0)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_LIST&&t!==a?zn(this,Xn,kl).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&t!==a?this.value=a:e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTrack API."))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",zn(this,za,Jn))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",zn(this,za,Jn))}get mediaSubtitlesList(){return Il(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Sl(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Il(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Sl(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Xa=new WeakMap;Xn=new WeakSet;kl=function(){var i;if(ec(this,Xa)===JSON.stringify(this.mediaSubtitlesList))return;tc(this,Xa,JSON.stringify(this.mediaSubtitlesList));let e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.value,a=Xe(this.formatOptionText("Off"),"off",t);a.prepend(Ne(this,"select-indicator")),e.append(a);let r=this.mediaSubtitlesList;for(let n of r){let s=Xe(this.formatOptionText(n.label,n),da(n),this.value==da(n));s.prepend(Ne(this,"select-indicator")),((i=n.kind)!=null?i:"subs")==="captions"&&s.append(Ne(this,"captions-indicator")),e.append(s)}};za=new WeakSet;Jn=function(){if(xe(this,!1),!this.value)return;let i=new d.CustomEvent(v.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};var Il=(i,e)=>{let t=i.getAttribute(e);return t?ui(t):[]},Sl=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=mt(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};d.customElements.get("media-captions-listbox")||d.customElements.define("media-captions-listbox",Ja);var ja=class extends Ce{init(){let e=m.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};d.customElements.get("media-captions-selectmenu")||d.customElements.define("media-captions-selectmenu",ja);var Ll=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},er=(i,e,t)=>(Ll(i,e,"read from private field"),t?t.call(i):e.get(i)),es=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Mi=(i,e,t)=>(Ll(i,e,"access private method"),t),Jt,Li,tr,ir,is,ts={RATES:"rates"},ar=class extends ke{constructor(){super(),es(this,Li),es(this,ir),es(this,Jt,new Ge(this,ts.RATES,{defaultValue:En})),Mi(this,Li,tr).call(this)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_PLAYBACK_RATE,ts.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===ts.RATES&&t!=a&&(er(this,Jt).value=a,Mi(this,Li,tr).call(this))}get rates(){return er(this,Jt)}set rates(e){e?Array.isArray(e)&&(er(this,Jt).value=e.join(" ")):er(this,Jt).value="",Mi(this,Li,tr).call(this)}get mediaPlaybackRate(){return k(this,o.MEDIA_PLAYBACK_RATE,Vt)}set mediaPlaybackRate(e){w(this,o.MEDIA_PLAYBACK_RATE,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Mi(this,ir,is))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Mi(this,ir,is))}};Jt=new WeakMap;Li=new WeakSet;tr=function(){let i=this.shadowRoot.querySelector("#container");i.textContent="";for(let e of this.rates){let t=Xe(this.formatOptionText(`${e}x`,e),e,this.mediaPlaybackRate==e);t.prepend(Ne(this,"select-indicator")),i.append(t)}};ir=new WeakSet;is=function(){if(!this.value)return;let i=new d.CustomEvent(v.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-playback-rate-listbox")||d.customElements.define("media-playback-rate-listbox",ar);var rr=class extends Ce{init(){let e=m.createElement("media-playback-rate-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-playback-rate-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};d.customElements.get("media-playback-rate-selectmenu")||d.customElements.define("media-playback-rate-selectmenu",rr);var ss=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Cl=(i,e,t)=>(ss(i,e,"read from private field"),t?t.call(i):e.get(i)),nr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},as=(i,e,t,a)=>(ss(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),sr=(i,e,t)=>(ss(i,e,"access private method"),t),Ci,dr,or,rs,lr,ns,ur=class extends ke{constructor(){super(...arguments),nr(this,or),nr(this,lr),nr(this,Ci,[]),nr(this,dr,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===o.MEDIA_RENDITION_LIST&&t!==a&&(as(this,Ci,Zs(a)),sr(this,or,rs).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",sr(this,lr,ns))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",sr(this,lr,ns))}get mediaRenditionList(){return Cl(this,Ci)}set mediaRenditionList(e){as(this,Ci,e),sr(this,or,rs).call(this)}get mediaRenditionSelected(){return N(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){O(this,o.MEDIA_RENDITION_SELECTED,e)}};Ci=new WeakMap;dr=new WeakMap;or=new WeakSet;rs=function(){if(Cl(this,dr)===JSON.stringify(this.mediaRenditionList))return;as(this,dr,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height),e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.mediaRenditionSelected;for(let r of i){let n=this.formatOptionText(`${Math.min(r.width,r.height)}p`,r),s=Xe(n,`${r.id}`,r.selected&&!t);s.prepend(Ne(this,"select-indicator")),e.append(s)}let a=Xe(this.formatOptionText("Auto"),"auto",t);a.prepend(Ne(this,"select-indicator")),e.append(a)};lr=new WeakSet;ns=function(){if(this.value==null)return;let i=new d.CustomEvent(v.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-rendition-listbox")||d.customElements.define("media-rendition-listbox",ur);var ac=`<svg aria-hidden="true" viewBox="0 0 24 24">
912
912
  <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" />
913
913
  </svg>`,Rl=m.createElement("template");Rl.innerHTML=`
914
- <slot name="icon">${ec}</slot>
915
- `;var os=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE]}constructor(){super({slotTemplate:Rl})}get mediaRenditionSelected(){return N(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){O(this,o.MEDIA_RENDITION_SELECTED,e)}};d.customElements.get("media-rendition-button")||d.customElements.define("media-rendition-button",os);var cr=class extends Ce{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE]}init(){let e=m.createElement("media-rendition-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-rendition-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};d.customElements.get("media-rendition-selectmenu")||d.customElements.define("media-rendition-selectmenu",cr);var g=kd(require("@mux/mux-video"),1),U=require("@mux/playback-core");var $l=require("@mux/mux-video");var tc="en",bt={code:tc};var wl="en";function y(i,e=!0){var r,n;let t=e&&(n=(r=bt)==null?void 0:r[i])!=null?n:i,a=e?bt.code:wl;return new ls(t,a)}var ls=class{constructor(e,t=(a=>(a=bt.code)!=null?a:wl)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function xl(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${mr(t)}: ${a}; `)}),e?e.trim():void 0}function mr(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function hr(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ue(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function pr(i){let e=ic(i).toString();return e?"?"+e:""}function ic(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function je(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var ds=(i,e)=>!i||!e?!1:i.contains(e)?!0:ds(i,e.getRootNode().host);var Er=require("@mux/playback-core");var us="mux.com",ac=()=>{try{return"1.12.0"}catch{}return"UNKNOWN"},rc=ac(),br=()=>rc,cs=(i,{maxResolution:e,token:t,domain:a=us}={})=>{let s=!!t?{token:t}:{redundant_streams:!0,...e?{max_resolution:e}:{}};return`https://stream.${a}/${i}.m3u8${pr(s)}`},Dl=(i,{token:e,thumbnailTime:t,domain:a=us}={})=>{let r=e==null?t:void 0,{aud:n}=je(e);if(!(e&&n!=="t"))return`https://image.${a}/${i}/thumbnail.webp${pr({token:e,time:r})}`},Ol=(i,{token:e,domain:t=us}={})=>{let{aud:a}=je(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${pr({token:e,format:"webp"})}`},Ri=i=>{if(!!i){if([Er.StreamTypes.LIVE,Er.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Er.StreamTypes.LIVE}};var nc={crossorigin:"crossOrigin",playsinline:"playsInline"};function Nl(i){var e;return(e=nc[i])!=null?e:hr(i)}var ft,gt,j,vr=class{constructor(e,t){W(this,ft,void 0);W(this,gt,void 0);W(this,j,[]);oe(this,ft,e),oe(this,gt,t)}[Symbol.iterator](){return S(this,j).values()}get length(){return S(this,j).length}get value(){var e;return(e=S(this,j).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(oe(this,j,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return S(this,j)[e]}values(){return S(this,j).values()}keys(){return S(this,j).keys()}forEach(e){S(this,j).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||S(this,j).push(r)}),!(this.value===""&&!((t=S(this,ft))!=null&&t.hasAttribute(`${S(this,gt)}`)))&&((a=S(this,ft))==null||a.setAttribute(`${S(this,gt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{S(this,j).splice(S(this,j).indexOf(a),1)}),(t=S(this,ft))==null||t.setAttribute(`${S(this,gt)}`,`${this.value}`)}contains(e){return S(this,j).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};ft=new WeakMap,gt=new WeakMap,j=new WeakMap;var Pl=`[mux-player ${br()}]`;function et(...i){console.warn(Pl,...i)}function pe(...i){console.error(Pl,...i)}function ms(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${y("Read more: ")}
916
- ${a}${i.file}`}et(e)}var J={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},At={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Bl=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),sc=$l.VideoEvents.filter(i=>i!=="error"),oc=Object.values(J).filter(i=>![J.PLAYSINLINE].includes(i)),lc=Object.values(At);function Vl(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),sc.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var hs=class extends B.HTMLElement{static get observedAttributes(){return[...oc,...lc]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var l,u;let s=(l=this.media)==null?void 0:l.querySelector(`track[src="${n.src}"]`);s&&((u=this.media)==null||u.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case At.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case At.VOLUME:{let s=(r=Ue(a))!=null?r:1;this.media&&(this.media.volume=s);return}case At.PLAYBACKRATE:{let s=(n=Ue(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:Bl}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:Bl}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Ue(this.getAttribute(At.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(At.PLAYBACKRATE,`${e}`):this.removeAttribute(At.PLAYBACKRATE)}get crossOrigin(){return wi(this,J.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(J.CROSSORIGIN,`${e}`)}get autoplay(){return wi(this,J.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(J.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(J.AUTOPLAY)}get loop(){return wi(this,J.LOOP)!=null}set loop(e){e?this.setAttribute(J.LOOP,""):this.removeAttribute(J.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=Boolean(e))}get defaultMuted(){return wi(this,J.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(J.MUTED,""):this.removeAttribute(J.MUTED)}get playsInline(){return wi(this,J.PLAYSINLINE)!=null}set playsInline(e){pe("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(J.PRELOAD,e):this.removeAttribute(J.PRELOAD)}};function wi(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var ps=hs;var dc=Object.defineProperty,uc=(i,e,t)=>e in i?dc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,cc=(i,e,t)=>(uc(i,typeof e!="symbol"?e+"":e,t),t),Yl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(Yl(i,e,"read from private field"),t?t.call(i):e.get(i)),Re=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Be=(i,e,t,a)=>(Yl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt,fr,_t,xi,tt,it,at,yt,ei,gr,Ee,Hl=1,Wl=0,mc=1,hc={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof ee&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof ee?r.element[r.attributeName]=n:r.value=n}}}},$e=class extends d.DocumentFragment{constructor(e,t,a=hc){var r;super(),Re(this,jt,void 0),Re(this,fr,void 0),this.append(e.content.cloneNode(!0)),Be(this,jt,Gl(this)),Be(this,fr,a),(r=a.createCallback)==null||r.call(a,this,_(this,jt),t),a.processCallback(this,_(this,jt),t)}update(e){_(this,fr).processCallback(this,_(this,jt),e)}};jt=new WeakMap;fr=new WeakMap;var Gl=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Es;for([t,a]of Kl(r.value))if(!t)n.append(a);else{let s=new ee(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Hl&&!(r instanceof HTMLTemplateElement))Gl(r,e);else if(r.nodeType===Hl||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of Kl(r.data))if(!t)n.push(new Text(a));else{let s=new Ve(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new Di(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},Fl={},Kl=i=>{let e="",t=0,a=Fl[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([Wl,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([mc,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Wl,(t>0?"{{":"")+e]),Fl[i]=a},pc=11,Ar=class{get value(){return""}set value(e){}toString(){return this.value}},Zl=new WeakMap,Es=class{constructor(){Re(this,_t,[])}[Symbol.iterator](){return _(this,_t).values()}get length(){return _(this,_t).length}item(e){return _(this,_t)[e]}append(...e){for(let t of e)t instanceof ee&&Zl.set(t,this),_(this,_t).push(t)}toString(){return _(this,_t).join("")}};_t=new WeakMap;var ee=class extends Ar{constructor(e,t,a){super(),Re(this,yt),Re(this,xi,""),Re(this,tt,void 0),Re(this,it,void 0),Re(this,at,void 0),Be(this,tt,e),Be(this,it,t),Be(this,at,a)}get attributeName(){return _(this,it)}get attributeNamespace(){return _(this,at)}get element(){return _(this,tt)}get value(){return _(this,xi)}set value(e){_(this,xi)!==e&&(Be(this,xi,e),!_(this,yt,ei)||_(this,yt,ei).length===1?e==null?_(this,tt).removeAttributeNS(_(this,at),_(this,it)):_(this,tt).setAttributeNS(_(this,at),_(this,it),e):_(this,tt).setAttributeNS(_(this,at),_(this,it),_(this,yt,ei)))}get booleanValue(){return _(this,tt).hasAttributeNS(_(this,at),_(this,it))}set booleanValue(e){if(!_(this,yt,ei)||_(this,yt,ei).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};xi=new WeakMap;tt=new WeakMap;it=new WeakMap;at=new WeakMap;yt=new WeakSet;ei=function(){return Zl.get(this)};var Ve=class extends Ar{constructor(e,t){super(),Re(this,gr,void 0),Re(this,Ee,void 0),Be(this,gr,e),Be(this,Ee,t?[...t]:[new Text])}get replacementNodes(){return _(this,Ee)}get parentNode(){return _(this,gr)}get nextSibling(){return _(this,Ee)[_(this,Ee).length-1].nextSibling}get previousSibling(){return _(this,Ee)[0].previousSibling}get value(){return _(this,Ee).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===pc?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Be(this,Ee,Ec(_(this,Ee)[0].parentNode,_(this,Ee),t,this.nextSibling))}};gr=new WeakMap;Ee=new WeakMap;var Di=class extends Ve{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),cc(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Ec(i,e,t,a=null){let r=0,n,s,l,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)l=t[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&t[r]==s?(i.replaceChild(l,n),n=s):i.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var ql={string:i=>String(i)},yr=class{constructor(e){this.template=e,this.state=void 0}},Tt=new WeakMap,It=new WeakMap,vs={partial:(i,e)=>{e[i.expression]=new yr(i.template)},if:(i,e)=>{var t;if(zl(i.expression,e))if(Tt.get(i)!==i.template){Tt.set(i,i.template);let a=new $e(i.template,e,Tr);i.replace(a),It.set(i,a)}else(t=It.get(i))==null||t.update(e);else i.replace(""),Tt.delete(i),It.delete(i)}},vc=Object.keys(vs),Tr={processCallback(i,e,t){var a,r;if(!!t)for(let[n,s]of e){if(s instanceof Di){if(!s.directive){let u=vc.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=vs[s.directive])==null||a.call(vs,s,t);continue}let l=zl(n,t);if(l instanceof yr){Tt.get(s)!==l.template?(Tt.set(s,l.template),l=new $e(l.template,l.state,Tr),s.value=l,It.set(s,l)):(r=It.get(s))==null||r.update(l.state);continue}l?(s instanceof ee&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof ee?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,Tt.delete(s),It.delete(s))):s instanceof ee?s.value=void 0:(s.value=void 0,Tt.delete(s),It.delete(s))}}},Ql={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=ql[e])==null?void 0:t.call(ql,i)}};function bc(i){return fc(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function zl(i,e={}){var t,a,r,n,s,l,u;let c=bc(i);if(c.length===0||c.some(({type:E})=>!E))return Oi(i);if(((t=c[0])==null?void 0:t.token)===">"){let E=e[(a=c[1])==null?void 0:a.token];if(!E)return Oi(i);let f={...e};E.state=f;let b=c.slice(2);for(let T=0;T<b.length;T+=3){let V=(r=b[T])==null?void 0:r.token,G=(n=b[T+1])==null?void 0:n.token,I=(s=b[T+2])==null?void 0:s.token;V&&G==="="&&(f[V]=Ni(I,e))}return E}if(c.length===1)return _r(c[0])?Ni(c[0].token,e):Oi(i);if(c.length===2){let E=(l=c[0])==null?void 0:l.token,f=Ql[E];if(!f||!_r(c[1]))return Oi(i);let b=Ni(c[1].token,e);return f(b)}if(c.length===3){let E=(u=c[1])==null?void 0:u.token,f=Ql[E];if(!f||!_r(c[0])||!_r(c[2]))return Oi(i);let b=Ni(c[0].token,e);if(E==="|")return f(b,c[2].token);let T=Ni(c[2].token,e);return f(b,T)}}function Oi(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function _r({type:i}){return["number","boolean","string","param"].includes(i)}function Ni(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):zi(i)?parseFloat(i):e[i]}function fc(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var gc=Object.defineProperty,Ac=(i,e,t)=>e in i?gc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ui=(i,e,t)=>(Ac(i,typeof e!="symbol"?e+"":e,t),t),ys=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gs=(i,e,t)=>(ys(i,e,"read from private field"),t?t.call(i):e.get(i)),Pi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},St=(i,e,t,a)=>(ys(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),bs=(i,e,t)=>(ys(i,e,"access private method"),t),ti,Ir,ii,As,Xl,Sr,_s,fs={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Jl=m.createElement("template");Jl.innerHTML=`
914
+ <slot name="icon">${ac}</slot>
915
+ `;var os=class extends R{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE]}constructor(){super({slotTemplate:Rl})}get mediaRenditionSelected(){return N(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){O(this,o.MEDIA_RENDITION_SELECTED,e)}};d.customElements.get("media-rendition-button")||d.customElements.define("media-rendition-button",os);var cr=class extends Ce{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE]}init(){let e=m.createElement("media-rendition-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-rendition-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};d.customElements.get("media-rendition-selectmenu")||d.customElements.define("media-rendition-selectmenu",cr);var g=kd(require("@mux/mux-video")),U=require("@mux/playback-core");var $l=require("@mux/mux-video");var rc="en",bt={code:rc};var wl="en";function y(i,e=!0){var r,n;let t=e&&(n=(r=bt)==null?void 0:r[i])!=null?n:i,a=e?bt.code:wl;return new ls(t,a)}var ls=class{constructor(e,t=(a=>(a=bt.code)!=null?a:wl)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function xl(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${mr(t)}: ${a}; `)}),e?e.trim():void 0}function mr(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function hr(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ue(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function pr(i){let e=nc(i).toString();return e?"?"+e:""}function nc(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function je(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var ds=(i,e)=>!i||!e?!1:i.contains(e)?!0:ds(i,e.getRootNode().host);var Er=require("@mux/playback-core");var us="mux.com",sc=()=>{try{return"1.12.1"}catch{}return"UNKNOWN"},oc=sc(),br=()=>oc,cs=(i,{maxResolution:e,token:t,domain:a=us}={})=>{let s=!!t?{token:t}:{redundant_streams:!0,...e?{max_resolution:e}:{}};return`https://stream.${a}/${i}.m3u8${pr(s)}`},Dl=(i,{token:e,thumbnailTime:t,domain:a=us}={})=>{let r=e==null?t:void 0,{aud:n}=je(e);if(!(e&&n!=="t"))return`https://image.${a}/${i}/thumbnail.webp${pr({token:e,time:r})}`},Ol=(i,{token:e,domain:t=us}={})=>{let{aud:a}=je(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${pr({token:e,format:"webp"})}`},Ri=i=>{if(!!i){if([Er.StreamTypes.LIVE,Er.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Er.StreamTypes.LIVE}};var lc={crossorigin:"crossOrigin",playsinline:"playsInline"};function Nl(i){var e;return(e=lc[i])!=null?e:hr(i)}var ft,gt,j,vr=class{constructor(e,t){W(this,ft,void 0);W(this,gt,void 0);W(this,j,[]);oe(this,ft,e),oe(this,gt,t)}[Symbol.iterator](){return S(this,j).values()}get length(){return S(this,j).length}get value(){var e;return(e=S(this,j).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(oe(this,j,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return S(this,j)[e]}values(){return S(this,j).values()}keys(){return S(this,j).keys()}forEach(e){S(this,j).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||S(this,j).push(r)}),!(this.value===""&&!((t=S(this,ft))!=null&&t.hasAttribute(`${S(this,gt)}`)))&&((a=S(this,ft))==null||a.setAttribute(`${S(this,gt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{S(this,j).splice(S(this,j).indexOf(a),1)}),(t=S(this,ft))==null||t.setAttribute(`${S(this,gt)}`,`${this.value}`)}contains(e){return S(this,j).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};ft=new WeakMap,gt=new WeakMap,j=new WeakMap;var Pl=`[mux-player ${br()}]`;function et(...i){console.warn(Pl,...i)}function pe(...i){console.error(Pl,...i)}function ms(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${y("Read more: ")}
916
+ ${a}${i.file}`}et(e)}var J={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},At={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Bl=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),dc=$l.VideoEvents.filter(i=>i!=="error"),uc=Object.values(J).filter(i=>![J.PLAYSINLINE].includes(i)),cc=Object.values(At);function Vl(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),dc.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var hs=class extends B.HTMLElement{static get observedAttributes(){return[...uc,...cc]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var l,u;let s=(l=this.media)==null?void 0:l.querySelector(`track[src="${n.src}"]`);s&&((u=this.media)==null||u.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case At.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case At.VOLUME:{let s=(r=Ue(a))!=null?r:1;this.media&&(this.media.volume=s);return}case At.PLAYBACKRATE:{let s=(n=Ue(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:Bl}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:Bl}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Ue(this.getAttribute(At.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(At.PLAYBACKRATE,`${e}`):this.removeAttribute(At.PLAYBACKRATE)}get crossOrigin(){return wi(this,J.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(J.CROSSORIGIN,`${e}`)}get autoplay(){return wi(this,J.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(J.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(J.AUTOPLAY)}get loop(){return wi(this,J.LOOP)!=null}set loop(e){e?this.setAttribute(J.LOOP,""):this.removeAttribute(J.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=Boolean(e))}get defaultMuted(){return wi(this,J.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(J.MUTED,""):this.removeAttribute(J.MUTED)}get playsInline(){return wi(this,J.PLAYSINLINE)!=null}set playsInline(e){pe("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(J.PRELOAD,e):this.removeAttribute(J.PRELOAD)}};function wi(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var ps=hs;var mc=Object.defineProperty,hc=(i,e,t)=>e in i?mc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,pc=(i,e,t)=>(hc(i,typeof e!="symbol"?e+"":e,t),t),Yl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(Yl(i,e,"read from private field"),t?t.call(i):e.get(i)),Re=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Be=(i,e,t,a)=>(Yl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt,fr,_t,xi,tt,it,at,yt,ei,gr,Ee,Hl=1,Wl=0,Ec=1,vc={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof ee&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof ee?r.element[r.attributeName]=n:r.value=n}}}},$e=class extends d.DocumentFragment{constructor(e,t,a=vc){var r;super(),Re(this,jt,void 0),Re(this,fr,void 0),this.append(e.content.cloneNode(!0)),Be(this,jt,Gl(this)),Be(this,fr,a),(r=a.createCallback)==null||r.call(a,this,_(this,jt),t),a.processCallback(this,_(this,jt),t)}update(e){_(this,fr).processCallback(this,_(this,jt),e)}};jt=new WeakMap;fr=new WeakMap;var Gl=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Es;for([t,a]of Kl(r.value))if(!t)n.append(a);else{let s=new ee(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Hl&&!(r instanceof HTMLTemplateElement))Gl(r,e);else if(r.nodeType===Hl||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of Kl(r.data))if(!t)n.push(new Text(a));else{let s=new Ve(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new Di(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},Fl={},Kl=i=>{let e="",t=0,a=Fl[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([Wl,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Ec,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Wl,(t>0?"{{":"")+e]),Fl[i]=a},bc=11,Ar=class{get value(){return""}set value(e){}toString(){return this.value}},Zl=new WeakMap,Es=class{constructor(){Re(this,_t,[])}[Symbol.iterator](){return _(this,_t).values()}get length(){return _(this,_t).length}item(e){return _(this,_t)[e]}append(...e){for(let t of e)t instanceof ee&&Zl.set(t,this),_(this,_t).push(t)}toString(){return _(this,_t).join("")}};_t=new WeakMap;var ee=class extends Ar{constructor(e,t,a){super(),Re(this,yt),Re(this,xi,""),Re(this,tt,void 0),Re(this,it,void 0),Re(this,at,void 0),Be(this,tt,e),Be(this,it,t),Be(this,at,a)}get attributeName(){return _(this,it)}get attributeNamespace(){return _(this,at)}get element(){return _(this,tt)}get value(){return _(this,xi)}set value(e){_(this,xi)!==e&&(Be(this,xi,e),!_(this,yt,ei)||_(this,yt,ei).length===1?e==null?_(this,tt).removeAttributeNS(_(this,at),_(this,it)):_(this,tt).setAttributeNS(_(this,at),_(this,it),e):_(this,tt).setAttributeNS(_(this,at),_(this,it),_(this,yt,ei)))}get booleanValue(){return _(this,tt).hasAttributeNS(_(this,at),_(this,it))}set booleanValue(e){if(!_(this,yt,ei)||_(this,yt,ei).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};xi=new WeakMap;tt=new WeakMap;it=new WeakMap;at=new WeakMap;yt=new WeakSet;ei=function(){return Zl.get(this)};var Ve=class extends Ar{constructor(e,t){super(),Re(this,gr,void 0),Re(this,Ee,void 0),Be(this,gr,e),Be(this,Ee,t?[...t]:[new Text])}get replacementNodes(){return _(this,Ee)}get parentNode(){return _(this,gr)}get nextSibling(){return _(this,Ee)[_(this,Ee).length-1].nextSibling}get previousSibling(){return _(this,Ee)[0].previousSibling}get value(){return _(this,Ee).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===bc?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Be(this,Ee,fc(_(this,Ee)[0].parentNode,_(this,Ee),t,this.nextSibling))}};gr=new WeakMap;Ee=new WeakMap;var Di=class extends Ve{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),pc(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function fc(i,e,t,a=null){let r=0,n,s,l,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)l=t[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&t[r]==s?(i.replaceChild(l,n),n=s):i.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var ql={string:i=>String(i)},yr=class{constructor(e){this.template=e,this.state=void 0}},Tt=new WeakMap,It=new WeakMap,vs={partial:(i,e)=>{e[i.expression]=new yr(i.template)},if:(i,e)=>{var t;if(zl(i.expression,e))if(Tt.get(i)!==i.template){Tt.set(i,i.template);let a=new $e(i.template,e,Tr);i.replace(a),It.set(i,a)}else(t=It.get(i))==null||t.update(e);else i.replace(""),Tt.delete(i),It.delete(i)}},gc=Object.keys(vs),Tr={processCallback(i,e,t){var a,r;if(!!t)for(let[n,s]of e){if(s instanceof Di){if(!s.directive){let u=gc.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=vs[s.directive])==null||a.call(vs,s,t);continue}let l=zl(n,t);if(l instanceof yr){Tt.get(s)!==l.template?(Tt.set(s,l.template),l=new $e(l.template,l.state,Tr),s.value=l,It.set(s,l)):(r=It.get(s))==null||r.update(l.state);continue}l?(s instanceof ee&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof ee?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,Tt.delete(s),It.delete(s))):s instanceof ee?s.value=void 0:(s.value=void 0,Tt.delete(s),It.delete(s))}}},Ql={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=ql[e])==null?void 0:t.call(ql,i)}};function Ac(i){return _c(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function zl(i,e={}){var t,a,r,n,s,l,u;let c=Ac(i);if(c.length===0||c.some(({type:E})=>!E))return Oi(i);if(((t=c[0])==null?void 0:t.token)===">"){let E=e[(a=c[1])==null?void 0:a.token];if(!E)return Oi(i);let f={...e};E.state=f;let b=c.slice(2);for(let T=0;T<b.length;T+=3){let V=(r=b[T])==null?void 0:r.token,G=(n=b[T+1])==null?void 0:n.token,I=(s=b[T+2])==null?void 0:s.token;V&&G==="="&&(f[V]=Ni(I,e))}return E}if(c.length===1)return _r(c[0])?Ni(c[0].token,e):Oi(i);if(c.length===2){let E=(l=c[0])==null?void 0:l.token,f=Ql[E];if(!f||!_r(c[1]))return Oi(i);let b=Ni(c[1].token,e);return f(b)}if(c.length===3){let E=(u=c[1])==null?void 0:u.token,f=Ql[E];if(!f||!_r(c[0])||!_r(c[2]))return Oi(i);let b=Ni(c[0].token,e);if(E==="|")return f(b,c[2].token);let T=Ni(c[2].token,e);return f(b,T)}}function Oi(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function _r({type:i}){return["number","boolean","string","param"].includes(i)}function Ni(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):zi(i)?parseFloat(i):e[i]}function _c(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var yc=Object.defineProperty,Tc=(i,e,t)=>e in i?yc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ui=(i,e,t)=>(Tc(i,typeof e!="symbol"?e+"":e,t),t),ys=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gs=(i,e,t)=>(ys(i,e,"read from private field"),t?t.call(i):e.get(i)),Pi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},St=(i,e,t,a)=>(ys(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),bs=(i,e,t)=>(ys(i,e,"access private method"),t),ti,Ir,ii,As,Xl,Sr,_s,fs={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Jl=m.createElement("template");Jl.innerHTML=`
917
917
  <style>
918
918
  :host {
919
919
  display: inline-block;
@@ -936,7 +936,7 @@ ${a}${i.file}`}et(e)}var J={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"
936
936
  display: none;
937
937
  }
938
938
  </style>
939
- `;var rt=class extends d.HTMLElement{constructor(){super(),Pi(this,As),Pi(this,Sr),Ui(this,"renderRoot"),Ui(this,"renderer"),Pi(this,ti,void 0),Pi(this,Ir,void 0),Pi(this,ii,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{t.some(a=>{let r=a.target;return r===this?!0:r.localName!=="media-controller"?!1:!!(fs[a.attributeName]||a.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),bs(this,As,Xl).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=gs(this,ti))!=null?e:this.constructor.template}set template(e){St(this,ii,null),St(this,ti,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:s})=>fs[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=fs[s.name])!=null?a:qs(s.name),{value:u}=s;u!=null?(zi(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&bs(this,Sr,_s).call(this)}connectedCallback(){bs(this,Sr,_s).call(this)}createRenderer(){this.template&&this.template!==gs(this,Ir)&&(St(this,Ir,this.template),this.renderer=new $e(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Jl.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};ti=new WeakMap;Ir=new WeakMap;ii=new WeakMap;As=new WeakSet;Xl=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};Sr=new WeakSet;_s=function(){var i;let e=this.getAttribute("template");if(!e||e===gs(this,ii))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){St(this,ii,e),St(this,ti,a),this.createRenderer();return}_c(e)&&(St(this,ii,e),yc(e).then(r=>{let n=m.createElement("template");n.innerHTML=r,St(this,ti,n),this.createRenderer()}).catch(console.error))};Ui(rt,"template");Ui(rt,"observedAttributes",["template"]);Ui(rt,"processor",Tr);function _c(i){if(!/^(\/|\.\/|https?:\/\/)/.test(i))return!1;let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function yc(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}d.customElements.get("media-theme")||d.customElements.define("media-theme",rt);var jl=`:host {
939
+ `;var rt=class extends d.HTMLElement{constructor(){super(),Pi(this,As),Pi(this,Sr),Ui(this,"renderRoot"),Ui(this,"renderer"),Pi(this,ti,void 0),Pi(this,Ir,void 0),Pi(this,ii,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{var a;(a=this.mediaController)!=null&&a.breakpointsUncomputed||t.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(fs[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),bs(this,As,Xl).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=gs(this,ti))!=null?e:this.constructor.template}set template(e){St(this,ii,null),St(this,ti,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:s})=>fs[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=fs[s.name])!=null?a:qs(s.name),{value:u}=s;u!=null?(zi(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&bs(this,Sr,_s).call(this)}connectedCallback(){bs(this,Sr,_s).call(this)}createRenderer(){this.template&&this.template!==gs(this,Ir)&&(St(this,Ir,this.template),this.renderer=new $e(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Jl.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};ti=new WeakMap;Ir=new WeakMap;ii=new WeakMap;As=new WeakSet;Xl=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};Sr=new WeakSet;_s=function(){var i;let e=this.getAttribute("template");if(!e||e===gs(this,ii))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){St(this,ii,e),St(this,ti,a),this.createRenderer();return}Ic(e)&&(St(this,ii,e),Sc(e).then(r=>{let n=m.createElement("template");n.innerHTML=r,St(this,ti,n),this.createRenderer()}).catch(console.error))};Ui(rt,"template");Ui(rt,"observedAttributes",["template"]);Ui(rt,"processor",Tr);function Ic(i){if(!/^(\/|\.\/|https?:\/\/)/.test(i))return!1;let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function Sc(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}d.customElements.get("media-theme")||d.customElements.define("media-theme",rt);var jl=`:host {
940
940
  --media-control-display: var(--controls);
941
941
  --media-loading-indicator-display: var(--loading-indicator);
942
942
  --media-dialog-display: var(--dialog);
@@ -1116,7 +1116,7 @@ media-theme {
1116
1116
  <div class="dialog">
1117
1117
  <slot></slot>
1118
1118
  </div>
1119
- `;var nt=class extends B.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),ed(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Ic(this))}attributeChangedCallback(t,a,r){t==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&ed(this)}};nt.styles=td,nt.template=id,nt.observedAttributes=["open"];function ed(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=ad(i.shadowRoot)),i._previouslyFocusedElement=ne.activeElement,ne.activeElement instanceof HTMLElement&&ne.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function ad(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=ad(r[n].shadowRoot),a));n++);}return a}function Ic(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}B.customElements.get("media-dialog")||(B.customElements.define("media-dialog",nt),B.MediaDialog=nt);var Ts=nt;var rd=ne.createElement("template");rd.innerHTML=`
1119
+ `;var nt=class extends B.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),ed(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Mc(this))}attributeChangedCallback(t,a,r){t==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&ed(this)}};nt.styles=td,nt.template=id,nt.observedAttributes=["open"];function ed(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=ad(i.shadowRoot)),i._previouslyFocusedElement=ne.activeElement,ne.activeElement instanceof HTMLElement&&ne.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function ad(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=ad(r[n].shadowRoot),a));n++);}return a}function Mc(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}B.customElements.get("media-dialog")||(B.customElements.define("media-dialog",nt),B.MediaDialog=nt);var Ts=nt;var rd=ne.createElement("template");rd.innerHTML=`
1120
1120
  <style>
1121
1121
  ${Ts.styles}
1122
1122
 
@@ -1147,16 +1147,16 @@ media-theme {
1147
1147
  </svg>
1148
1148
  </button>
1149
1149
  </slot>
1150
- `;var Bi=class extends Ts{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};Bi.template=rd;B.customElements.get("mxp-dialog")||(B.customElements.define("mxp-dialog",Bi),B.MxpDialog=Bi);var $i=new WeakMap,Vi=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=$i.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=$i.get(this.element);t&&t.delete(this.type)}}static for(e){$i.has(e.element)||$i.set(e.element,new Map);let t=e.attributeName.slice(2),a=$i.get(e.element);return a&&a.has(t)?a.get(t):new Vi(e.element,t)}};function Sc(i,e){return i instanceof ee&&i.attributeName.startsWith("on")?(Vi.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function kc(i,e){return e instanceof kr&&i instanceof Ve?(e.renderInto(i),!0):!1}function Mc(i,e){return e instanceof DocumentFragment&&i instanceof Ve?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function Lc(i,e){if(i instanceof ee){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function Cc(i,e){if(i instanceof ee&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function Rc(i,e){if(typeof e=="boolean"&&i instanceof ee){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function wc(i,e){return e===!1&&i instanceof Ve?(i.replace(""),!0):!1}function xc(i,e){Cc(i,e)||Rc(i,e)||Sc(i,e)||wc(i,e)||kc(i,e)||Mc(i,e)||Lc(i,e)}var Is=new Map,nd=new WeakMap,sd=new WeakMap,kr=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Is.has(this.stringsKey))return Is.get(this.stringsKey);{let e=ne.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),Is.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(nd.get(e)!==t){nd.set(e,t);let n=new $e(t,this.values,this.processor);sd.set(e,n),e instanceof Ve?e.replace(...n.children):e.appendChild(n);return}let a=sd.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Dc={processCallback(i,e,t){var a;if(!!t){for(let[r,n]of e)if(r in t){let s=(a=t[r])!=null?a:"";xc(n,s)}}}};function He(i,...e){return new kr(i,e,Dc)}function od(i,e){i.renderInto(e)}var ld=require("@mux/playback-core"),dd=i=>He`
1150
+ `;var Bi=class extends Ts{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};Bi.template=rd;B.customElements.get("mxp-dialog")||(B.customElements.define("mxp-dialog",Bi),B.MxpDialog=Bi);var $i=new WeakMap,Vi=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=$i.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=$i.get(this.element);t&&t.delete(this.type)}}static for(e){$i.has(e.element)||$i.set(e.element,new Map);let t=e.attributeName.slice(2),a=$i.get(e.element);return a&&a.has(t)?a.get(t):new Vi(e.element,t)}};function Lc(i,e){return i instanceof ee&&i.attributeName.startsWith("on")?(Vi.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function Cc(i,e){return e instanceof kr&&i instanceof Ve?(e.renderInto(i),!0):!1}function Rc(i,e){return e instanceof DocumentFragment&&i instanceof Ve?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function wc(i,e){if(i instanceof ee){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function xc(i,e){if(i instanceof ee&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function Dc(i,e){if(typeof e=="boolean"&&i instanceof ee){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function Oc(i,e){return e===!1&&i instanceof Ve?(i.replace(""),!0):!1}function Nc(i,e){xc(i,e)||Dc(i,e)||Lc(i,e)||Oc(i,e)||Cc(i,e)||Rc(i,e)||wc(i,e)}var Is=new Map,nd=new WeakMap,sd=new WeakMap,kr=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Is.has(this.stringsKey))return Is.get(this.stringsKey);{let e=ne.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),Is.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(nd.get(e)!==t){nd.set(e,t);let n=new $e(t,this.values,this.processor);sd.set(e,n),e instanceof Ve?e.replace(...n.children):e.appendChild(n);return}let a=sd.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Pc={processCallback(i,e,t){var a;if(!!t){for(let[r,n]of e)if(r in t){let s=(a=t[r])!=null?a:"";Nc(n,s)}}}};function He(i,...e){return new kr(i,e,Pc)}function od(i,e){i.renderInto(e)}var ld=require("@mux/playback-core"),dd=i=>He`
1151
1151
  <style>
1152
1152
  ${jl}
1153
1153
  </style>
1154
- ${Nc(i)}
1155
- `,Oc=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return Ri(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Nc=i=>{var e,t,a,r,n,s,l,u,c,E,f,b,T,V,G,I,re,ve,se,ni,Lt,Ls,Cs,Rs,ws,xs,Ds,Os,Ns,Ps,Us,Bs,$s,Vs;return He`
1154
+ ${Bc(i)}
1155
+ `,Uc=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return Ri(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Bc=i=>{var e,t,a,r,n,s,l,u,c,E,f,b,T,V,G,I,re,ve,se,ni,Lt,Ls,Cs,Rs,ws,xs,Ds,Os,Ns,Ps,Us,Bs,$s,Vs;return He`
1156
1156
  <media-theme
1157
1157
  template="${i.themeTemplate||!1}"
1158
1158
  defaultstreamtype="${(e=i.defaultStreamType)!=null?e:!1}"
1159
- hotkeys="${Oc(i)||!1}"
1159
+ hotkeys="${Uc(i)||!1}"
1160
1160
  nohotkeys="${i.noHotKeys||!i.hasSrc||i.isDialogOpen||!1}"
1161
1161
  noautoseektolive="${!!((t=i.streamType)!=null&&t.includes(ld.StreamTypes.LIVE))&&i.targetLiveWindow!==0}"
1162
1162
  novolumepref="${i.novolumepref||!1}"
@@ -1994,5 +1994,5 @@ media-theme {
1994
1994
 
1995
1995
  </media-controller>
1996
1996
  </template>
1997
- `;var Ss=ne.createElement("template");"innerHTML"in Ss&&(Ss.innerHTML=ud);var cd,md,Lr=class extends rt{};Lr.template=(md=(cd=Ss.content)==null?void 0:cd.children)==null?void 0:md[0];B.customElements.get("media-theme-classic")||B.customElements.define("media-theme-classic",Lr);var Uc="classic";var We={SRC:"src",POSTER:"poster"},p={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},ks=["audio","backwardseekoffset","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function Bc(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:$c(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:Ri(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:Vc(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e}}function $c(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=B.customElements.get(e);if(n!=null&&n.template)return n.template}}function Vc(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function hd(i){return i.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,t)=>{let a=i.getAttribute(t);return a!==null&&(e[t.replace(/^metadata-/,"").replace(/-/g,"_")]=a),e},{})}var Hc=Object.values(g.Attributes),Wc=Object.values(We),Fc=Object.values(p),Kc=br(),Yc="mux-player",pd={dialog:void 0,isDialogOpen:!1},Fi,Ki,Fe,Yi,Mt,st,ai,Cr,Ed,Gi,Ms,ot,ri,Rr,vd,wr,bd,xr,fd,Dr,gd,Wi=class extends ps{constructor(){super();W(this,st);W(this,Cr);W(this,Gi);W(this,ot);W(this,Rr);W(this,wr);W(this,xr);W(this,Dr);W(this,Fi,!1);W(this,Ki,{});W(this,Fe,!0);W(this,Yi,new vr(this,"hotkeys"));W(this,Mt,{...pd,onCloseErrorDialog:()=>K(this,Gi,Ms).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{ds(this,ne.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),K(this,Cr,Ed).call(this),this.isConnected&&K(this,st,ai).call(this)}static get observedAttributes(){var t;return[...(t=ps.observedAttributes)!=null?t:[],...Wc,...Hc,...Fc]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=hd(this))}attributeChangedCallback(t,a,r){switch(K(this,st,ai).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:S(this,Yi).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&et(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:s}=je(r);r&&s!=="t"&&et(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case p.STORYBOARD_TOKEN:{let{aud:s}=je(r);r&&s!=="s"&&et(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&pe(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![U.StreamTypes.LIVE,U.StreamTypes.ON_DEMAND,U.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:ms({file:"invalid-stream-type.md",message:y("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=r===U.StreamTypes.LIVE?0:Number.NaN}[g.Attributes.PLAYBACK_ID,We.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&oe(this,Mt,{...S(this,Mt),...pd}),K(this,ot,ri).call(this,{[Nl(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?U.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):et(`Invalid value for preferCmcd. Must be one of ${U.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("media-time-is-live")}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(p.THEME))!=null?t:Uc}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(ks.includes(r))continue;let n=t.getAttribute(r);a[hr(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;K(this,st,ai).call(this);let a={...this.themeProps,...t};for(let s in a){if(ks.includes(s))continue;let l=t==null?void 0:t[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(mr(s),Boolean(l)):(n=this.mediaTheme)==null||n.setAttribute(mr(s),l)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=kt(this,We.SRC))!=null?t:void 0:(a=this.getAttribute(We.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(We.SRC,t):this.removeAttribute(We.SRC)}get poster(){var a;let t=this.getAttribute(We.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return Dl(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(We.POSTER,t):this.removeAttribute(We.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[U.StreamTypes.LIVE,U.StreamTypes.UNKNOWN].includes(this.streamType)))return Ol(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return S(this,Yi)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return Ue(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=kt(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Ue(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Ue(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:Yc}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:Kc}get beaconCollectionDomain(){var t;return(t=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(g.Attributes.MAX_RESOLUTION,t):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=kt(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return kt(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return kt(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:U.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:U.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Ue(kt(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===U.PlaybackTypes.MSE||t===U.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===U.PlaybackTypes.MSE||t===U.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(K(this,st,ai).call(this),!this.media){pe("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...hd(this),...t}}async addCuePoints(t){var a;if(K(this,st,ai).call(this),!this.media){pe("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...S(this,Ki),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){oe(this,Ki,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,U.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,U.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};Fi=new WeakMap,Ki=new WeakMap,Fe=new WeakMap,Yi=new WeakMap,Mt=new WeakMap,st=new WeakSet,ai=function(){var t,a,r;if(!S(this,Fi)){oe(this,Fi,!0),K(this,ot,ri).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof B.HTMLElement))throw""}catch{pe("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{pe("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Jr))throw""}catch{pe("<media-controller> failed to upgrade!")}Vl(this),K(this,Rr,vd).call(this),K(this,wr,bd).call(this),K(this,xr,fd).call(this),oe(this,Fe,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("userinactive"))!=null?a:!0),K(this,Dr,gd).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{K(this,ot,ri).call(this)})}},Cr=new WeakSet,Ed=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Gi=new WeakSet,Ms=function(t){Object.assign(S(this,Mt),t),K(this,ot,ri).call(this)},ot=new WeakSet,ri=function(t={}){od(dd(Bc(this,{...S(this,Mt),...t})),this.shadowRoot)},Rr=new WeakSet,vd=function(){let t=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(ks.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},wr=new WeakSet,bd=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){et(n),n.data&&et(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=Mr(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&ms(l),pe(n),n.data&&pe(`${n.name} data:`,n.data),K(this,Gi,Ms).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof g.MediaError))return r;let{devlog:n}=Mr((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:u,code:c}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new g.MediaError(u,c)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},xr=new WeakSet,fd=function(){var a,r,n,s;let t=()=>K(this,ot,ri).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},Dr=new WeakSet,gd=function(){var E,f;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let r,n=new WeakMap,s=()=>this.streamType===U.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,l=(b,T,V=!1)=>{if(s())return;Array.from(b&&b.activeCues||[]).forEach(I=>{if(!(!I.snapToLines||I.line<-5||I.line>=0&&I.line<10))if(!T||this.paused){let re=I.text.split(`
1998
- `).length,ve=t?-2:-3;this.streamType===U.StreamTypes.LIVE&&(ve=t?-1:-2);let se=ve-re;if(I.line===se&&!V)return;n.has(I)||n.set(I,I.line),I.line=se-1,I.line=se}else setTimeout(()=>{I.line=n.get(I)||"auto"},500)})},u=()=>{var b,T;l(r,(T=(b=this.mediaController)==null?void 0:b.hasAttribute("userinactive"))!=null?T:!1)},c=()=>{var V,G;let T=Array.from(((G=(V=this.mediaController)==null?void 0:V.media)==null?void 0:G.textTracks)||[]).filter(I=>["subtitles","captions"].includes(I.kind)&&I.mode==="showing")[0];T!==r&&(r==null||r.removeEventListener("cuechange",u)),r=T,r==null||r.addEventListener("cuechange",u),l(r,S(this,Fe))};if(c(),(E=this.textTracks)==null||E.addEventListener("change",c),(f=this.textTracks)==null||f.addEventListener("addtrack",c),navigator.userAgent.includes("Chrome/")){let b=()=>{l(r,S(this,Fe),!0),this.paused||window.requestAnimationFrame(b)};this.addEventListener("playing",()=>{b()})}this.addEventListener("userinactivechange",()=>{var T,V;let b=(V=(T=this.mediaController)==null?void 0:T.hasAttribute("userinactive"))!=null?V:!0;S(this,Fe)!==b&&(oe(this,Fe,b),l(r,S(this,Fe)))})};function kt(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}B.customElements.get("mux-player")||(B.customElements.define("mux-player",Wi),B.MuxPlayerElement=Wi);var Gc=Wi;
1997
+ `;var Ss=ne.createElement("template");"innerHTML"in Ss&&(Ss.innerHTML=ud);var cd,md,Lr=class extends rt{};Lr.template=(md=(cd=Ss.content)==null?void 0:cd.children)==null?void 0:md[0];B.customElements.get("media-theme-classic")||B.customElements.define("media-theme-classic",Lr);var Vc="classic";var We={SRC:"src",POSTER:"poster"},p={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},ks=["audio","backwardseekoffset","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function Hc(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:Wc(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:Ri(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:Fc(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e}}function Wc(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=B.customElements.get(e);if(n!=null&&n.template)return n.template}}function Fc(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function hd(i){return i.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,t)=>{let a=i.getAttribute(t);return a!==null&&(e[t.replace(/^metadata-/,"").replace(/-/g,"_")]=a),e},{})}var Kc=Object.values(g.Attributes),Yc=Object.values(We),Gc=Object.values(p),Zc=br(),qc="mux-player",pd={dialog:void 0,isDialogOpen:!1},Fi,Ki,Fe,Yi,Mt,st,ai,Cr,Ed,Gi,Ms,ot,ri,Rr,vd,wr,bd,xr,fd,Dr,gd,Wi=class extends ps{constructor(){super();W(this,st);W(this,Cr);W(this,Gi);W(this,ot);W(this,Rr);W(this,wr);W(this,xr);W(this,Dr);W(this,Fi,!1);W(this,Ki,{});W(this,Fe,!0);W(this,Yi,new vr(this,"hotkeys"));W(this,Mt,{...pd,onCloseErrorDialog:()=>K(this,Gi,Ms).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{ds(this,ne.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),K(this,Cr,Ed).call(this),this.isConnected&&K(this,st,ai).call(this)}static get observedAttributes(){var t;return[...(t=ps.observedAttributes)!=null?t:[],...Yc,...Kc,...Gc]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=hd(this))}attributeChangedCallback(t,a,r){switch(K(this,st,ai).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:S(this,Yi).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&et(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:s}=je(r);r&&s!=="t"&&et(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case p.STORYBOARD_TOKEN:{let{aud:s}=je(r);r&&s!=="s"&&et(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&pe(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![U.StreamTypes.LIVE,U.StreamTypes.ON_DEMAND,U.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:ms({file:"invalid-stream-type.md",message:y("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=r===U.StreamTypes.LIVE?0:Number.NaN}[g.Attributes.PLAYBACK_ID,We.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&oe(this,Mt,{...S(this,Mt),...pd}),K(this,ot,ri).call(this,{[Nl(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?U.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):et(`Invalid value for preferCmcd. Must be one of ${U.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("media-time-is-live")}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(p.THEME))!=null?t:Vc}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(ks.includes(r))continue;let n=t.getAttribute(r);a[hr(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;K(this,st,ai).call(this);let a={...this.themeProps,...t};for(let s in a){if(ks.includes(s))continue;let l=t==null?void 0:t[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(mr(s),Boolean(l)):(n=this.mediaTheme)==null||n.setAttribute(mr(s),l)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=kt(this,We.SRC))!=null?t:void 0:(a=this.getAttribute(We.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(We.SRC,t):this.removeAttribute(We.SRC)}get poster(){var a;let t=this.getAttribute(We.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return Dl(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(We.POSTER,t):this.removeAttribute(We.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[U.StreamTypes.LIVE,U.StreamTypes.UNKNOWN].includes(this.streamType)))return Ol(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return S(this,Yi)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return Ue(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=kt(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Ue(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Ue(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:qc}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:Zc}get beaconCollectionDomain(){var t;return(t=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(g.Attributes.MAX_RESOLUTION,t):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=kt(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return kt(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return kt(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:U.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:U.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Ue(kt(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===U.PlaybackTypes.MSE||t===U.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===U.PlaybackTypes.MSE||t===U.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(K(this,st,ai).call(this),!this.media){pe("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...hd(this),...t}}async addCuePoints(t){var a;if(K(this,st,ai).call(this),!this.media){pe("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...S(this,Ki),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){oe(this,Ki,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,U.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,U.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};Fi=new WeakMap,Ki=new WeakMap,Fe=new WeakMap,Yi=new WeakMap,Mt=new WeakMap,st=new WeakSet,ai=function(){var t,a,r;if(!S(this,Fi)){oe(this,Fi,!0),K(this,ot,ri).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof B.HTMLElement))throw""}catch{pe("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{pe("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Jr))throw""}catch{pe("<media-controller> failed to upgrade!")}Vl(this),K(this,Rr,vd).call(this),K(this,wr,bd).call(this),K(this,xr,fd).call(this),oe(this,Fe,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("userinactive"))!=null?a:!0),K(this,Dr,gd).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{K(this,ot,ri).call(this)})}},Cr=new WeakSet,Ed=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Gi=new WeakSet,Ms=function(t){Object.assign(S(this,Mt),t),K(this,ot,ri).call(this)},ot=new WeakSet,ri=function(t={}){od(dd(Hc(this,{...S(this,Mt),...t})),this.shadowRoot)},Rr=new WeakSet,vd=function(){let t=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(ks.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},wr=new WeakSet,bd=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){et(n),n.data&&et(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=Mr(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&ms(l),pe(n),n.data&&pe(`${n.name} data:`,n.data),K(this,Gi,Ms).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof g.MediaError))return r;let{devlog:n}=Mr((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:u,code:c}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new g.MediaError(u,c)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},xr=new WeakSet,fd=function(){var a,r,n,s;let t=()=>K(this,ot,ri).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},Dr=new WeakSet,gd=function(){var E,f;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let r,n=new WeakMap,s=()=>this.streamType===U.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,l=(b,T,V=!1)=>{if(s())return;Array.from(b&&b.activeCues||[]).forEach(I=>{if(!(!I.snapToLines||I.line<-5||I.line>=0&&I.line<10))if(!T||this.paused){let re=I.text.split(`
1998
+ `).length,ve=t?-2:-3;this.streamType===U.StreamTypes.LIVE&&(ve=t?-1:-2);let se=ve-re;if(I.line===se&&!V)return;n.has(I)||n.set(I,I.line),I.line=se-1,I.line=se}else setTimeout(()=>{I.line=n.get(I)||"auto"},500)})},u=()=>{var b,T;l(r,(T=(b=this.mediaController)==null?void 0:b.hasAttribute("userinactive"))!=null?T:!1)},c=()=>{var V,G;let T=Array.from(((G=(V=this.mediaController)==null?void 0:V.media)==null?void 0:G.textTracks)||[]).filter(I=>["subtitles","captions"].includes(I.kind)&&I.mode==="showing")[0];T!==r&&(r==null||r.removeEventListener("cuechange",u)),r=T,r==null||r.addEventListener("cuechange",u),l(r,S(this,Fe))};if(c(),(E=this.textTracks)==null||E.addEventListener("change",c),(f=this.textTracks)==null||f.addEventListener("addtrack",c),navigator.userAgent.includes("Chrome/")){let b=()=>{l(r,S(this,Fe),!0),this.paused||window.requestAnimationFrame(b)};this.addEventListener("playing",()=>{b()})}this.addEventListener("userinactivechange",()=>{var T,V;let b=(V=(T=this.mediaController)==null?void 0:T.hasAttribute("userinactive"))!=null?V:!0;S(this,Fe)!==b&&(oe(this,Fe,b),l(r,S(this,Fe)))})};function kt(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}B.customElements.get("mux-player")||(B.customElements.define("mux-player",Wi),B.MuxPlayerElement=Wi);var Qc=Wi;