/**
* Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.37.0.
* Original file: /npm/media-chrome@4.4.0/dist/index.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
const e={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},t={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},i={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_WIDTH:"mediaWidth"},n=Object.entries(i),a=n.reduce(((e,[t,i])=>(e[t]=i.toLowerCase(),e)),{}),s=n.reduce(((e,[t,i])=>(e[t]=i.toLowerCase(),e)),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"}),r=Object.entries(s).reduce(((e,[t,i])=>{const n=a[t];return n&&(e[i]=n),e}),{userinactivechange:"userinactive"}),o=Object.entries(a).reduce(((e,[t,i])=>{const n=s[t];return n&&(e[i]=n),e}),{userinactive:"userinactivechange"}),l={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},d={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"},c={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},h={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},u={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"},m={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var p=Object.freeze({__proto__:null,AttributeToStateChangeEventMap:o,AvailabilityStates:h,MediaStateChangeEvents:s,MediaStateReceiverAttributes:t,MediaUIAttributes:a,MediaUIEvents:e,MediaUIProps:i,PointerTypes:c,ReadyStates:{HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},StateChangeEventToAttributeMap:r,StreamTypes:u,TextTrackKinds:l,TextTrackModes:d,VolumeLevels:{HIGH:"high",MEDIUM:"medium",LOW:"low",OFF:"off"},WebkitPresentationModes:m});const E={2:"Network Error",3:"Decode Error",4:"Source Not Supported",5:"Encryption Error"},v={2:"A network error caused the media download to fail.",3:"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",4:"An unsupported error occurred. The server or network failed, or your browser does not support this format.",5:"The media is encrypted and there are no keys to decrypt it."},b=e=>{var t,i;return 1===e.code?null:{title:null!=(t=E[e.code])?t:`Error ${e.code}`,message:null!=(i=v[e.code])?i:e.message}},g="Start airplay",A="Stop airplay",I="Enable captions",f="Disable captions",_="Start casting",w="Stop casting",y="Enter fullscreen mode",T="Exit fullscreen mode",M="Mute",k="Unmute",S="Enter picture in picture mode",R="Enter picture in picture mode",C="Play",L="Pause",D="Playback rate",x="Seek backward",N="Seek forward",U={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:e=1}={})=>`current playback rate ${e}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading",SETTINGS:()=>"settings",AUDIO_TRACKS:()=>"audio tracks",QUALITY:()=>"quality"},P={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:e=30}={})=>`seek forward ${e} seconds`,SEEK_BACK_N_SECS:({seekOffset:e=30}={})=>`seek back ${e} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"};var O={...U,...P};function W(e){if(e){const{id:t,width:i,height:n}=e;return[t,i,n].filter((e=>null!=e)).join(":")}}function V(e){if(e){const{id:t,kind:i,language:n,label:a}=e;return[t,i,n,a].filter((e=>null!=e)).join(":")}}function B(e){return"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)}const $=e=>new Promise((t=>setTimeout(t,e))),H=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],F=e=>{if(!B(e))return"";const t=Math.abs(e),i=t!==e,n=new Date(0,0,0,0,0,t,0);return`${[n.getHours(),n.getMinutes(),n.getSeconds()].map(((e,t)=>e&&((e,t)=>`${e} ${1===e?H[t].singular:H[t].plural}`)(e,t))).filter((e=>e)).join(", ")}${i?" remaining":""}`};function G(e,t){let i=!1;e<0&&(i=!0,e=0-e),e=e<0?0:e;let n=Math.floor(e%60),a=Math.floor(e/60%60),s=Math.floor(e/3600);const r=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(s=a=n="0"),s=s>0||o>0?s+":":"",a=((s||r>=10)&&a<10?"0"+a:a)+":",n=n<10?"0"+n:n,(i?"-":"")+s+a+n}const q=Object.freeze({length:0,start(e){const t=e>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(e){const t=e>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var K=Object.freeze({__proto__:null,emptyTimeRanges:q,formatAsTimePhrase:F,formatTime:G,serializeTimeRanges:function(e=q){return Array.from(e).map(((t,i)=>[Number(e.start(i).toFixed(3)),Number(e.end(i).toFixed(3))].join(":"))).join(" ")}});class Q{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}}class j extends Q{}class Y extends j{constructor(){super(...arguments),this.role=null}}const Z={createElement:function(){return new z.HTMLElement},createElementNS:function(){return new z.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent:e=>!1},z={ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},document:Z,Node:j,Element:Y,HTMLElement:class extends Y{constructor(){super(...arguments),this.innerHTML=""}get content(){return new z.DocumentFragment}},DocumentFragment:class extends Q{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem:e=>null,setItem(e,t){},removeItem(e){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia:e=>({matches:!1,media:e})},X="undefined"==typeof window||void 0===window.customElements,J=Object.keys(z).every((e=>e in globalThis)),ee=X&&!J?z:globalThis,te=X&&!J?Z:globalThis.document,ie=new WeakMap,ne=e=>{let t=ie.get(e);return t||ie.set(e,t=new Set),t},ae=new ee.ResizeObserver((e=>{for(const t of e)for(const e of ne(t.target))e(t)}));function se(e,t){ne(e).add(t),ae.observe(e)}function re(e,t){const i=ne(e);i.delete(t),i.size||ae.unobserve(e)}function oe(e){var i;return null!=(i=function(e){var i;const{MEDIA_CONTROLLER:n}=t,a=e.getAttribute(n);if(a)return null==(i=function(e){var t;const i=null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e);if(i instanceof ShadowRoot||i instanceof Document)return i;return null}(e))?void 0:i.getElementById(a)}(e))?i:he(e,"media-controller")}const le=(e,t,i=".value")=>{const n=e.querySelector(i);n&&(n.textContent=t)},de=(e,t)=>((e,t)=>{const i=`slot[name="${t}"]`,n=e.shadowRoot.querySelector(i);return n?n.children:[]})(e,t)[0],ce=(e,t)=>!(!e||!t)&&(!!(null==e?void 0:e.contains(t))||ce(e,t.getRootNode().host)),he=(e,t)=>{if(!e)return null;const i=e.closest(t);return i||he(e.getRootNode().host,t)};function ue(e=document){var t;const i=null==e?void 0:e.activeElement;return i?null!=(t=ue(i.shadowRoot))?t:i:null}function me(e,{depth:t=3,checkOpacity:i=!0,checkVisibilityCSS:n=!0}={}){if(e.checkVisibility)return e.checkVisibility({checkOpacity:i,checkVisibilityCSS:n});let a=e;for(;a&&t>0;){const e=getComputedStyle(a);if(i&&"0"===e.opacity||n&&"hidden"===e.visibility||"none"===e.display)return!1;a=a.parentElement,t--}return!0}function pe(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Ee(e,t){const i=function(e,t){var i,n;let a;for(a of null!=(i=e.querySelectorAll("style:not([media])"))?i:[]){let e;try{e=null==(n=a.sheet)?void 0:n.cssRules}catch{continue}for(const i of null!=e?e:[])if(t(i.selectorText))return i}}(e,(e=>e===t));return i||function(e,t){var i,n;const a=null!=(i=e.querySelectorAll("style:not([media])"))?i:[],s=null==a?void 0:a[a.length-1];if(!(null==s?void 0:s.sheet))return console.warn("Media Chrome: No style sheet found on style tag of",e),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}};return null==s||s.sheet.insertRule(`${t}{}`,s.sheet.cssRules.length),null==(n=s.sheet.cssRules)?void 0:n[s.sheet.cssRules.length-1]}(e,t)}function ve(e,t,i=Number.NaN){const n=e.getAttribute(t);return null!=n?+n:i}function be(e,t,i){const n=+i;null==i||Number.isNaN(n)?e.hasAttribute(t)&&e.removeAttribute(t):ve(e,t,void 0)!==n&&e.setAttribute(t,`${n}`)}function ge(e,t){return e.hasAttribute(t)}function Ae(e,t,i){null!=i?ge(e,t)!=i&&e.toggleAttribute(t,i):e.hasAttribute(t)&&e.removeAttribute(t)}function Ie(e,t,i=null){var n;return null!=(n=e.getAttribute(t))?n:i}function fe(e,t,i){if(null==i)return void(e.hasAttribute(t)&&e.removeAttribute(t));const n=`${i}`;Ie(e,t,void 0)!==n&&e.setAttribute(t,n)}var _e,we=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},ye=(e,t,i)=>(we(e,t,"read from private field"),i?i.call(e):t.get(e)),Te=(e,t,i,n)=>(we(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);const Me=te.createElement("template");Me.innerHTML="\n\n";class ke extends ee.HTMLElement{constructor(e={}){if(super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,_e,void 0),!this.shadowRoot){const t=this.attachShadow({mode:"open"}),i=Me.content.cloneNode(!0);this.nativeEl=i;let n=e.slotTemplate;n||(n=te.createElement("template"),n.innerHTML=`${e.defaultContent||""}`),this.nativeEl.appendChild(n.content.cloneNode(!0)),t.appendChild(i)}}static get observedAttributes(){return[t.MEDIA_CONTROLLER,a.MEDIA_PAUSED]}attributeChangedCallback(e,i,n){var a,s,r,o,l;e===t.MEDIA_CONTROLLER&&(i&&(null==(s=null==(a=ye(this,_e))?void 0:a.unassociateElement)||s.call(a,this),Te(this,_e,null)),n&&this.isConnected&&(Te(this,_e,null==(r=this.getRootNode())?void 0:r.getElementById(n)),null==(l=null==(o=ye(this,_e))?void 0:o.associateElement)||l.call(o,this)))}connectedCallback(){var e,i,n,a;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Te(this,_e,function(e){var i;const n=e.getAttribute(t.MEDIA_CONTROLLER);if(n)return null==(i=e.getRootNode())?void 0:i.getElementById(n);return he(e,"media-controller")}(this)),this.getAttribute(t.MEDIA_CONTROLLER)&&(null==(i=null==(e=ye(this,_e))?void 0:e.associateElement)||i.call(e,this)),null==(n=ye(this,_e))||n.addEventListener("pointerdown",this),null==(a=ye(this,_e))||a.addEventListener("click",this)}disconnectedCallback(){var e,i,n,a;this.getAttribute(t.MEDIA_CONTROLLER)&&(null==(i=null==(e=ye(this,_e))?void 0:e.unassociateElement)||i.call(e,this)),null==(n=ye(this,_e))||n.removeEventListener("pointerdown",this),null==(a=ye(this,_e))||a.removeEventListener("click",this),Te(this,_e,null)}handleEvent(e){var t;const i=null==(t=e.composedPath())?void 0:t[0];if(["video","media-controller"].includes(null==i?void 0:i.localName))if("pointerdown"===e.type)this._pointerType=e.pointerType;else if("click"===e.type){const{clientX:t,clientY:i}=e,{left:n,top:a,width:s,height:r}=this.getBoundingClientRect(),o=t-n,l=i-a;if(o<0||l<0||o>s||l>r||0===s&&0===r)return;const{pointerType:d=this._pointerType}=e;if(this._pointerType=void 0,d===c.TOUCH)return void this.handleTap(e);if(d===c.MOUSE)return void this.handleMouseClick(e)}}get mediaPaused(){return ge(this,a.MEDIA_PAUSED)}set mediaPaused(e){Ae(this,a.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(t){const i=this.mediaPaused?e.MEDIA_PLAY_REQUEST:e.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new ee.CustomEvent(i,{composed:!0,bubbles:!0}))}}_e=new WeakMap,ee.customElements.get("media-gesture-receiver")||ee.customElements.define("media-gesture-receiver",ke);var Se,Re,Ce,Le,De,xe,Ne,Ue,Pe,Oe,We,Ve,Be,$e,He,Fe,Ge,qe,Ke,Qe=ke,je=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Ye=(e,t,i)=>(je(e,t,"read from private field"),i?i.call(e):t.get(e)),Ze=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},ze=(e,t,i,n)=>(je(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),Xe=(e,t,i)=>(je(e,t,"access private method"),i);const Je={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},et=te.createElement("template");et.innerHTML=`\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n`;const tt=Object.values(a);function it(e,t){var i;if(!e.isConnected)return;const n=function(e){const t=e.split(/\s+/);return Object.fromEntries(t.map((e=>e.split(":"))))}(null!=(i=e.getAttribute(Je.BREAKPOINTS))?i:"sm:384 md:576 lg:768 xl:960"),a=function(e,t){return Object.keys(e).filter((i=>t>=parseInt(e[i])))}(n,t);let r=!1;if(Object.keys(n).forEach((t=>{a.includes(t)?e.hasAttribute(`breakpoint${t}`)||(e.setAttribute(`breakpoint${t}`,""),r=!0):e.hasAttribute(`breakpoint${t}`)&&(e.removeAttribute(`breakpoint${t}`),r=!0)})),r){const t=new CustomEvent(s.BREAKPOINTS_CHANGE,{detail:a});e.dispatchEvent(t)}e.breakpointsComputed||(e.breakpointsComputed=!0,e.dispatchEvent(new CustomEvent(s.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}class nt extends ee.HTMLElement{constructor(){super(),Ze(this,xe),Ze(this,Oe),Ze(this,Ve),Ze(this,$e),Ze(this,Fe),Ze(this,qe),Ze(this,Se,0),Ze(this,Re,null),Ze(this,Ce,null),Ze(this,Le,void 0),this.breakpointsComputed=!1,Ze(this,De,new MutationObserver(Xe(this,xe,Ne).bind(this))),Ze(this,Ue,!1),Ze(this,Pe,(e=>{Ye(this,Ue)||(setTimeout((()=>{!function(e){it(e.target,e.contentRect.width)}(e),ze(this,Ue,!1)}),0),ze(this,Ue,!0))})),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(et.content.cloneNode(!0)));const e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",(()=>{e.assignedElements({flatten:!0}).length?this.handleMediaUpdated(this.media):Ye(this,Re)&&this.mediaUnsetCallback(Ye(this,Re))}))}static get observedAttributes(){return[Je.AUTOHIDE,Je.GESTURES_DISABLED].concat(tt).filter((e=>![a.MEDIA_RENDITION_LIST,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_CHAPTERS_CUES,a.MEDIA_WIDTH,a.MEDIA_HEIGHT,a.MEDIA_ERROR,a.MEDIA_ERROR_MESSAGE].includes(e)))}attributeChangedCallback(e,t,i){e.toLowerCase()==Je.AUTOHIDE&&(this.autohide=i)}get media(){let e=this.querySelector(":scope > [slot=media]");return"SLOT"==(null==e?void 0:e.nodeName)&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(ze(this,Re,e),e.localName.includes("-")&&await ee.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ye(this,De).observe(this,{childList:!0,subtree:!0}),se(this,Ye(this,Pe));const t=null!=this.getAttribute(Je.AUDIO)?U.AUDIO_PLAYER():U.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",t),this.handleMediaUpdated(this.media),this.setAttribute(Je.USER_INACTIVE,""),it(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),null==(e=ee.window)||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Ye(this,De).disconnect(),re(this,Ye(this,Pe)),this.media&&this.mediaUnsetCallback(this.media),null==(e=ee.window)||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){ze(this,Re,null)}handleEvent(e){switch(e.type){case"pointerdown":ze(this,Se,e.timeStamp);break;case"pointermove":Xe(this,Oe,We).call(this,e);break;case"pointerup":Xe(this,Ve,Be).call(this,e);break;case"mouseleave":Xe(this,$e,He).call(this);break;case"mouseup":this.removeAttribute(Je.KEYBOARD_CONTROL);break;case"keyup":Xe(this,qe,Ke).call(this),this.setAttribute(Je.KEYBOARD_CONTROL,"")}}set autohide(e){const t=Number(e);ze(this,Le,isNaN(t)?0:t)}get autohide(){return(void 0===Ye(this,Le)?2:Ye(this,Le)).toString()}}Se=new WeakMap,Re=new WeakMap,Ce=new WeakMap,Le=new WeakMap,De=new WeakMap,xe=new WeakSet,Ne=function(e){const t=this.media;for(const i of e){if("childList"!==i.type)continue;const e=i.removedNodes;for(const n of e){if("media"!=n.slot||i.target!=this)continue;let e=i.previousSibling&&i.previousSibling.previousElementSibling;if(e&&t){let t="media"!==e.slot;for(;null!==(e=e.previousSibling);)"media"==e.slot&&(t=!1);t&&this.mediaUnsetCallback(n)}else this.mediaUnsetCallback(n)}if(t)for(const e of i.addedNodes)e===t&&this.handleMediaUpdated(t)}},Ue=new WeakMap,Pe=new WeakMap,Oe=new WeakSet,We=function(e){if("mouse"!==e.pointerType){const t=250;if(e.timeStamp-Ye(this,Se)["media-play-button","media-fullscreen-button"].includes(null==e?void 0:e.localName)))&&Xe(this,qe,Ke).call(this)},$e=new WeakSet,He=function(){if(Ye(this,Le)<0)return;if(this.hasAttribute(Je.USER_INACTIVE))return;this.setAttribute(Je.USER_INACTIVE,"");const e=new ee.CustomEvent(s.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(e)},Fe=new WeakSet,Ge=function(){if(!this.hasAttribute(Je.USER_INACTIVE))return;this.removeAttribute(Je.USER_INACTIVE);const e=new ee.CustomEvent(s.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(e)},qe=new WeakSet,Ke=function(){Xe(this,Fe,Ge).call(this),clearTimeout(Ye(this,Ce));const e=parseInt(this.autohide);e<0||ze(this,Ce,setTimeout((()=>{Xe(this,$e,He).call(this)}),1e3*e))},ee.customElements.get("media-container")||ee.customElements.define("media-container",nt);var at,st,rt,ot,lt,dt,ct=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},ht=(e,t,i)=>(ct(e,t,"read from private field"),i?i.call(e):t.get(e)),ut=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},mt=(e,t,i,n)=>(ct(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);class pt{constructor(e,t,{defaultValue:i}={defaultValue:void 0}){ut(this,lt),ut(this,at,void 0),ut(this,st,void 0),ut(this,rt,void 0),ut(this,ot,new Set),mt(this,at,e),mt(this,st,t),mt(this,rt,new Set(i))}[Symbol.iterator](){return ht(this,lt,dt).values()}get length(){return ht(this,lt,dt).size}get value(){var e;return null!=(e=[...ht(this,lt,dt)].join(" "))?e:""}set value(e){var t;e!==this.value&&(mt(this,ot,new Set),this.add(...null!=(t=null==e?void 0:e.split(" "))?t:[]))}toString(){return this.value}item(e){return[...ht(this,lt,dt)][e]}values(){return ht(this,lt,dt).values()}forEach(e,t){ht(this,lt,dt).forEach(e,t)}add(...e){var t,i;e.forEach((e=>ht(this,ot).add(e))),(""!==this.value||(null==(t=ht(this,at))?void 0:t.hasAttribute(`${ht(this,st)}`)))&&(null==(i=ht(this,at))||i.setAttribute(`${ht(this,st)}`,`${this.value}`))}remove(...e){var t;e.forEach((e=>ht(this,ot).delete(e))),null==(t=ht(this,at))||t.setAttribute(`${ht(this,st)}`,`${this.value}`)}contains(e){return ht(this,lt,dt).has(e)}toggle(e,t){return void 0!==t?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}}at=new WeakMap,st=new WeakMap,rt=new WeakMap,ot=new WeakMap,lt=new WeakSet,dt=function(){return ht(this,ot).size?ht(this,ot):ht(this,rt)};const Et=(e="")=>{const[t,i,n]=e.split(":"),a=n?decodeURIComponent(n):void 0;return{kind:"cc"===t?l.CAPTIONS:l.SUBTITLES,language:i,label:a}},vt=(e="",t={})=>((e="")=>e.split(/\s+/))(e).map((e=>{const i=Et(e);return{...t,...i}})),bt=e=>e?Array.isArray(e)?e.map((e=>"string"==typeof e?Et(e):e)):"string"==typeof e?vt(e):[e]:[],gt=({kind:e,label:t,language:i}={kind:"subtitles"})=>t?`${"captions"===e?"cc":"sb"}:${i}:${encodeURIComponent(t)}`:i,At=(e=[])=>Array.prototype.map.call(e,gt).join(" "),It=e=>{const t=Object.entries(e).map((([e,t])=>((e,t)=>i=>i[e]===t)(e,t)));return e=>t.every((t=>t(e)))},ft=(e,t=[],i=[])=>{const n=bt(i).map(It);Array.from(t).filter((e=>n.some((t=>t(e))))).forEach((t=>{t.mode=e}))},_t=(e,t=()=>!0)=>{if(!(null==e?void 0:e.textTracks))return[];const i="function"==typeof t?t:It(t);return Array.from(e.textTracks).filter(i)},wt="exitFullscreen"in te?"exitFullscreen":"webkitExitFullscreen"in te?"webkitExitFullscreen":"webkitCancelFullScreen"in te?"webkitCancelFullScreen":void 0,yt="fullscreenElement"in te?"fullscreenElement":"webkitFullscreenElement"in te?"webkitFullscreenElement":void 0,Tt=e=>{var t;const{media:i,documentElement:n,fullscreenElement:a=i}=e;if(!i||!n)return!1;const s=(e=>{const{documentElement:t,media:i}=e,n=null==t?void 0:t[yt];return!n&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===m.FULLSCREEN?i:n})(e);if(!s)return!1;if(s===a||s===i)return!0;if(s.localName.includes("-")){let e=s.shadowRoot;if(!(yt in e))return ce(s,a);for(;null==e?void 0:e[yt];){if(e[yt]===a)return!0;e=null==(t=e[yt])?void 0:t.shadowRoot}}return!1},Mt="fullscreenEnabled"in te?"fullscreenEnabled":"webkitFullscreenEnabled"in te?"webkitFullscreenEnabled":void 0;let kt;const St=()=>{var e,t;return kt||(kt=null==(t=null==(e=te)?void 0:e.createElement)?void 0:t.call(e,"video"),kt)},Rt=(e,t)=>new Promise((i=>{e.addEventListener("volumechange",(()=>i(!0)),{signal:t})})),Ct=async(e,t)=>{for(let i=0;i<10;i++){if(e.volume===t)return!1;await $(10)}return e.volume!==t},Lt=/.*Version\/.*Safari\/.*/.test(ee.navigator.userAgent),Dt=(e=St())=>(!ee.matchMedia("(display-mode: standalone)").matches||!Lt)&&"function"==typeof(null==e?void 0:e.requestPictureInPicture),xt=(e=St())=>(e=>{const{documentElement:t,media:i}=e;return!!(null==t?void 0:t[Mt])||i&&"webkitSupportsFullscreen"in i})({documentElement:te,media:e}),Nt=xt(),Ut=Dt(),Pt=!!ee.WebKitPlaybackTargetAvailabilityEvent,Ot=!!ee.chrome,Wt=e=>_t(e.media,(e=>[l.SUBTITLES,l.CAPTIONS].includes(e.kind))).sort(((e,t)=>e.kind>=t.kind?1:-1)),Vt=e=>_t(e.media,(e=>e.mode===d.SHOWING&&[l.SUBTITLES,l.CAPTIONS].includes(e.kind))),Bt=(e,t)=>{const i=Wt(e),n=Vt(e),a=!!n.length;if(i.length)if(!1===t||a&&!0!==t)ft(d.DISABLED,i,n);else if(!0===t||!a&&!1!==t){let t=i[0];const{options:a}=e;if(!(null==a?void 0:a.noSubtitlesLangPref)){const e=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),n=e?[e,...globalThis.navigator.languages]:globalThis.navigator.languages,a=i.filter((e=>n.some((t=>e.language.toLowerCase().startsWith(t.split("-")[0]))))).sort(((e,t)=>n.findIndex((t=>e.language.toLowerCase().startsWith(t.split("-")[0])))-n.findIndex((e=>t.language.toLowerCase().startsWith(e.split("-")[0])))));a[0]&&(t=a[0])}const{language:s,label:r,kind:o}=t;ft(d.DISABLED,i,n),ft(d.SHOWING,i,[{language:s,label:r,kind:o}])}},$t=(e,t)=>e===t||null!=e&&null!=t&&(typeof e==typeof t&&(!("number"!=typeof e||!Number.isNaN(e)||!Number.isNaN(t))||"object"==typeof e&&(Array.isArray(e)?Ht(e,t):Object.entries(e).every((([e,i])=>e in t&&$t(i,t[e])))))),Ht=(e,t)=>{const i=Array.isArray(e),n=Array.isArray(t);return i===n&&(!i&&!n||e.length===t.length&&e.every(((e,i)=>$t(e,t[i]))))},Ft=Object.values(u);let Gt;const qt=(async(e=St())=>{if(!e)return!1;const t=e.volume;e.volume=t/2+.1;const i=new AbortController,n=await Promise.race([Rt(e,i.signal),Ct(e,t)]);return i.abort(),n})().then((e=>(Gt=e,Gt))),Kt={mediaError:{get(e){const{media:t}=e;return null==t?void 0:t.error},mediaEvents:["emptied","error"]},mediaErrorCode:{get(e){var t;const{media:i}=e;return null==(t=null==i?void 0:i.error)?void 0:t.code},mediaEvents:["emptied","error"]},mediaErrorMessage:{get(e){var t,i;const{media:n}=e;return null!=(i=null==(t=null==n?void 0:n.error)?void 0:t.message)?i:""},mediaEvents:["emptied","error"]},mediaWidth:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.videoWidth)?t:0},mediaEvents:["resize"]},mediaHeight:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.videoHeight)?t:0},mediaEvents:["resize"]},mediaPaused:{get(e){var t;const{media:i}=e;return null==(t=null==i?void 0:i.paused)||t},set(e,t){var i;const{media:n}=t;n&&(e?n.pause():null==(i=n.play())||i.catch((()=>{})))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(e,t){const{media:i}=e;return!!i&&(t?"playing"===t.type:!i.paused)},mediaEvents:["playing","emptied"]},mediaEnded:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.ended)&&t},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.playbackRate)?t:1},set(e,t){const{media:i}=t;i&&Number.isFinite(+e)&&(i.playbackRate=+e)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.muted)&&t},set(e,t){const{media:i}=t;i&&(i.muted=e)},mediaEvents:["volumechange"]},mediaVolume:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.volume)?t:1},set(e,t){const{media:i}=t;if(i){try{null==e?ee.localStorage.removeItem("media-chrome-pref-volume"):ee.localStorage.setItem("media-chrome-pref-volume",e.toString())}catch(e){}Number.isFinite(+e)&&(i.volume=+e)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(e,t)=>{const{options:{noVolumePref:i}}=t;if(!i)try{const i=ee.localStorage.getItem("media-chrome-pref-volume");if(null==i)return;Kt.mediaVolume.set(+i,t),e(+i)}catch(e){console.debug("Error getting volume pref",e)}}]},mediaVolumeLevel:{get(e){const{media:t}=e;return void 0===(null==t?void 0:t.volume)?"high":t.muted||0===t.volume?"off":t.volume<.5?"low":t.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(e){var t;const{media:i}=e;return null!=(t=null==i?void 0:i.currentTime)?t:0},set(e,t){const{media:i}=t;i&&B(e)&&(i.currentTime=e)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(e){const{media:t,options:{defaultDuration:i}={}}=e;return!i||t&&t.duration&&!Number.isNaN(t.duration)&&Number.isFinite(t.duration)?Number.isFinite(null==t?void 0:t.duration)?t.duration:Number.NaN:i},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(e){const{media:t}=e;return(null==t?void 0:t.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(e){var t;const{media:i}=e;if(!(null==(t=null==i?void 0:i.seekable)?void 0:t.length))return;const n=i.seekable.start(0),a=i.seekable.end(i.seekable.length-1);return n||a?[Number(n.toFixed(3)),Number(a.toFixed(3))]:void 0},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(e){var t;const{media:i}=e,n=null!=(t=null==i?void 0:i.buffered)?t:[];return Array.from(n).map(((e,t)=>[Number(n.start(t).toFixed(3)),Number(n.end(t).toFixed(3))]))},mediaEvents:["progress","emptied"]},mediaStreamType:{get(e){const{media:t,options:{defaultStreamType:i}={}}=e,n=[u.LIVE,u.ON_DEMAND].includes(i)?i:void 0;if(!t)return n;const{streamType:a}=t;if(Ft.includes(a))return a===u.UNKNOWN?n:a;const s=t.duration;return s===1/0?u.LIVE:Number.isFinite(s)?u.ON_DEMAND:n},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(e){const{media:t}=e;if(!t)return Number.NaN;const{targetLiveWindow:i}=t,n=Kt.mediaStreamType.get(e);return null!=i&&!Number.isNaN(i)||n!==u.LIVE?i:0},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(e){const{media:t,options:{liveEdgeOffset:i=10}={}}=e;if(!t)return!1;if("number"==typeof t.liveEdgeStart)return!Number.isNaN(t.liveEdgeStart)&&t.currentTime>=t.liveEdgeStart;if(!(Kt.mediaStreamType.get(e)===u.LIVE))return!1;const n=t.seekable;if(!n)return!0;if(!n.length)return!1;const a=n.end(n.length-1)-i;return t.currentTime>=a},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get:e=>Wt(e).map((({kind:e,label:t,language:i})=>({kind:e,label:t,language:i}))),mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get:e=>Vt(e).map((({kind:e,label:t,language:i})=>({kind:e,label:t,language:i}))),mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(e,t)=>{var i,n;const{media:a,options:s}=t;if(!a)return;const r=e=>{var i;if(!s.defaultSubtitles)return;e&&![l.CAPTIONS,l.SUBTITLES].includes(null==(i=null==e?void 0:e.track)?void 0:i.kind)||Bt(t,!0)};return null==(i=a.textTracks)||i.addEventListener("addtrack",r),null==(n=a.textTracks)||n.addEventListener("removetrack",r),r(),()=>{var e,t;null==(e=a.textTracks)||e.removeEventListener("addtrack",r),null==(t=a.textTracks)||t.removeEventListener("removetrack",r)}}]},mediaChaptersCues:{get(e){var t;const{media:i}=e;if(!i)return[];const[n]=_t(i,{kind:l.CHAPTERS});return Array.from(null!=(t=null==n?void 0:n.cues)?t:[]).map((({text:e,startTime:t,endTime:i})=>({text:e,startTime:t,endTime:i})))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(e,t)=>{var i;const{media:n}=t;if(!n)return;const a=n.querySelector('track[kind="chapters"][default][src]'),s=null==(i=n.shadowRoot)?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return null==a||a.addEventListener("load",e),null==s||s.addEventListener("load",e),()=>{null==a||a.removeEventListener("load",e),null==s||s.removeEventListener("load",e)}}]},mediaIsPip:{get(e){var t,i;const{media:n,documentElement:a}=e;if(!n||!a)return!1;if(!a.pictureInPictureElement)return!1;if(a.pictureInPictureElement===n)return!0;if(a.pictureInPictureElement instanceof HTMLMediaElement)return!!(null==(t=n.localName)?void 0:t.includes("-"))&&ce(n,a.pictureInPictureElement);if(a.pictureInPictureElement.localName.includes("-")){let e=a.pictureInPictureElement.shadowRoot;for(;null==e?void 0:e.pictureInPictureElement;){if(e.pictureInPictureElement===n)return!0;e=null==(i=e.pictureInPictureElement)?void 0:i.shadowRoot}}return!1},set(e,t){const{media:i}=t;if(i)if(e){if(!te.pictureInPictureEnabled)return void console.warn("MediaChrome: Picture-in-picture is not enabled");if(!i.requestPictureInPicture)return void console.warn("MediaChrome: The current media does not support picture-in-picture");const e=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch((t=>{if(11!==t.code)throw t;if(i.src){if(0!==i.readyState||"none"!==i.preload)throw t;{const t=()=>{i.removeEventListener("loadedmetadata",n),i.preload="none"},n=()=>{i.requestPictureInPicture().catch(e),t()};i.addEventListener("loadedmetadata",n),i.preload="metadata",setTimeout((()=>{0===i.readyState&&e(),t()}),1e3)}}else console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.")}))}else te.pictureInPictureElement&&te.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(e){var t;const{media:i}=e;return[...null!=(t=null==i?void 0:i.videoRenditions)?t:[]].map((e=>({...e})))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(e){var t,i,n;const{media:a}=e;return null==(n=null==(i=null==a?void 0:a.videoRenditions)?void 0:i[null==(t=a.videoRenditions)?void 0:t.selectedIndex])?void 0:n.id},set(e,t){const{media:i}=t;if(!(null==i?void 0:i.videoRenditions))return void console.warn("MediaController: Rendition selection not supported by this media.");const n=e,a=Array.prototype.findIndex.call(i.videoRenditions,(e=>e.id==n));i.videoRenditions.selectedIndex!=a&&(i.videoRenditions.selectedIndex=a)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(e){var t;const{media:i}=e;return[...null!=(t=null==i?void 0:i.audioTracks)?t:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(e){var t,i;const{media:n}=e;return null==(i=[...null!=(t=null==n?void 0:n.audioTracks)?t:[]].find((e=>e.enabled)))?void 0:i.id},set(e,t){const{media:i}=t;if(!(null==i?void 0:i.audioTracks))return void console.warn("MediaChrome: Audio track selection not supported by this media.");const n=e;for(const e of i.audioTracks)e.enabled=n==e.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get:e=>Tt(e),set(e,t){e?(e=>{var t;const{media:i,fullscreenElement:n}=e,a=n&&"requestFullscreen"in n?"requestFullscreen":n&&"webkitRequestFullScreen"in n?"webkitRequestFullScreen":void 0;if(a){const e=null==(t=n[a])?void 0:t.call(n);if(e instanceof Promise)e.catch((()=>{}))}else(null==i?void 0:i.webkitEnterFullscreen)?i.webkitEnterFullscreen():(null==i?void 0:i.requestFullscreen)&&i.requestFullscreen()})(t):(e=>{var t;const{documentElement:i}=e;if(wt){const e=null==(t=null==i?void 0:i[wt])?void 0:t.call(i);if(e instanceof Promise)e.catch((()=>{}))}})(t)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(e){var t;const{media:i}=e;return!(!(null==i?void 0:i.remote)||"disconnected"===(null==(t=i.remote)?void 0:t.state))&&!!i.remote.state},set(e,t){var i,n;const{media:a}=t;a&&(e&&"disconnected"!==(null==(i=a.remote)?void 0:i.state)||(e||"connected"===(null==(n=a.remote)?void 0:n.state))&&("function"==typeof a.remote.prompt?a.remote.prompt().catch((()=>{})):console.warn("MediaChrome: Casting is not supported in this environment")))},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get:()=>!1,set(e,t){const{media:i}=t;i&&(i.webkitShowPlaybackTargetPicker&&ee.WebKitPlaybackTargetAvailabilityEvent?i.webkitShowPlaybackTargetPicker():console.warn("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment"))},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(e){const{media:t}=e;if(!Nt||!xt(t))return h.UNSUPPORTED}},mediaPipUnavailable:{get(e){const{media:t}=e;if(!Ut||!Dt(t))return h.UNSUPPORTED}},mediaVolumeUnavailable:{get(e){const{media:t}=e;if(!1===Gt||null==(null==t?void 0:t.volume))return h.UNSUPPORTED},stateOwnersUpdateHandlers:[e=>{null==Gt&&qt.then((t=>e(t?void 0:h.UNSUPPORTED)))}]},mediaCastUnavailable:{get(e,{availability:t="not-available"}={}){var i;const{media:n}=e;return Ot&&(null==(i=null==n?void 0:n.remote)?void 0:i.state)?null!=t&&"available"!==t?h.UNAVAILABLE:void 0:h.UNSUPPORTED},stateOwnersUpdateHandlers:[(e,t)=>{var i;const{media:n}=t;if(!n)return;return n.disableRemotePlayback||n.hasAttribute("disableremoteplayback")||null==(i=null==n?void 0:n.remote)||i.watchAvailability((t=>{e({availability:t?"available":"not-available"})})).catch((t=>{"NotSupportedError"===t.name?e({availability:null}):e({availability:"not-available"})})),()=>{var e;null==(e=null==n?void 0:n.remote)||e.cancelWatchAvailability().catch((()=>{}))}}]},mediaAirplayUnavailable:{get:(e,t)=>Pt?"not-available"===(null==t?void 0:t.availability)?h.UNAVAILABLE:void 0:h.UNSUPPORTED,mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(e,t)=>{var i;const{media:n}=t;if(!n)return;return n.disableRemotePlayback||n.hasAttribute("disableremoteplayback")||null==(i=null==n?void 0:n.remote)||i.watchAvailability((t=>{e({availability:t?"available":"not-available"})})).catch((t=>{"NotSupportedError"===t.name?e({availability:null}):e({availability:"not-available"})})),()=>{var e;null==(e=null==n?void 0:n.remote)||e.cancelWatchAvailability().catch((()=>{}))}}]},mediaRenditionUnavailable:{get(e){var t;const{media:i}=e;return(null==i?void 0:i.videoRenditions)?(null==(t=i.videoRenditions)?void 0:t.length)?void 0:h.UNAVAILABLE:h.UNSUPPORTED},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(e){var t,i;const{media:n}=e;return(null==n?void 0:n.audioTracks)?(null!=(i=null==(t=n.audioTracks)?void 0:t.length)?i:0)<=1?h.UNAVAILABLE:void 0:h.UNSUPPORTED},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}},Qt={[e.MEDIA_PREVIEW_REQUEST](e,t,{detail:i}){var n,a,s;const{media:r}=t,o=null!=i?i:void 0;let d,c;if(r&&null!=o){const[e]=_t(r,{kind:l.METADATA,label:"thumbnails"}),t=Array.prototype.find.call(null!=(n=null==e?void 0:e.cues)?n:[],((e,t,i)=>0===t?e.endTime>o:t===i.length-1?e.startTime<=o:e.startTime<=o&&e.endTime>o));if(t){const e=/'^(?:[a-z]+:)?\/\//i.test(t.text)||null==(a=null==r?void 0:r.querySelector('track[label="thumbnails"]'))?void 0:a.src,i=new URL(t.text,e);c=new URLSearchParams(i.hash).get("#xywh").split(",").map((e=>+e)),d=i.href}}const h=e.mediaDuration.get(t);let u=null==(s=e.mediaChaptersCues.get(t).find(((e,t,i)=>t===i.length-1&&h===e.endTime?e.startTime<=o&&e.endTime>=o:e.startTime<=o&&e.endTime>o)))?void 0:s.text;return null!=i&&null==u&&(u=""),{mediaPreviewTime:o,mediaPreviewImage:d,mediaPreviewCoords:c,mediaPreviewChapter:u}},[e.MEDIA_PAUSE_REQUEST](e,t){e.mediaPaused.set(!0,t)},[e.MEDIA_PLAY_REQUEST](e,t){var i;if(e.mediaStreamType.get(t)===u.LIVE){const n=!(e.mediaTargetLiveWindow.get(t)>0),a=null==(i=e.mediaSeekable.get(t))?void 0:i[1];n&&a&&e.mediaCurrentTime.set(a,t)}e.mediaPaused.set(!1,t)},[e.MEDIA_PLAYBACK_RATE_REQUEST](e,t,{detail:i}){const n=i;e.mediaPlaybackRate.set(n,t)},[e.MEDIA_MUTE_REQUEST](e,t){e.mediaMuted.set(!0,t)},[e.MEDIA_UNMUTE_REQUEST](e,t){e.mediaVolume.get(t)||e.mediaVolume.set(.25,t),e.mediaMuted.set(!1,t)},[e.MEDIA_VOLUME_REQUEST](e,t,{detail:i}){const n=i;n&&e.mediaMuted.get(t)&&e.mediaMuted.set(!1,t),e.mediaVolume.set(n,t)},[e.MEDIA_SEEK_REQUEST](e,t,{detail:i}){const n=i;e.mediaCurrentTime.set(n,t)},[e.MEDIA_SEEK_TO_LIVE_REQUEST](e,t){var i;const n=null==(i=e.mediaSeekable.get(t))?void 0:i[1];Number.isNaN(Number(n))||e.mediaCurrentTime.set(n,t)},[e.MEDIA_SHOW_SUBTITLES_REQUEST](e,t,{detail:i}){var n;const{options:a}=t,s=Wt(t),r=bt(i),o=null==(n=r[0])?void 0:n.language;o&&!a.noSubtitlesLangPref&&ee.localStorage.setItem("media-chrome-pref-subtitles-lang",o),ft(d.SHOWING,s,r)},[e.MEDIA_DISABLE_SUBTITLES_REQUEST](e,t,{detail:i}){const n=Wt(t);ft(d.DISABLED,n,null!=i?i:[])},[e.MEDIA_TOGGLE_SUBTITLES_REQUEST](e,t,{detail:i}){Bt(t,i)},[e.MEDIA_RENDITION_REQUEST](e,t,{detail:i}){const n=i;e.mediaRenditionSelected.set(n,t)},[e.MEDIA_AUDIO_TRACK_REQUEST](e,t,{detail:i}){const n=i;e.mediaAudioTrackEnabled.set(n,t)},[e.MEDIA_ENTER_PIP_REQUEST](e,t){e.mediaIsFullscreen.get(t)&&e.mediaIsFullscreen.set(!1,t),e.mediaIsPip.set(!0,t)},[e.MEDIA_EXIT_PIP_REQUEST](e,t){e.mediaIsPip.set(!1,t)},[e.MEDIA_ENTER_FULLSCREEN_REQUEST](e,t){e.mediaIsPip.get(t)&&e.mediaIsPip.set(!1,t),e.mediaIsFullscreen.set(!0,t)},[e.MEDIA_EXIT_FULLSCREEN_REQUEST](e,t){e.mediaIsFullscreen.set(!1,t)},[e.MEDIA_ENTER_CAST_REQUEST](e,t){e.mediaIsFullscreen.get(t)&&e.mediaIsFullscreen.set(!1,t),e.mediaIsCasting.set(!0,t)},[e.MEDIA_EXIT_CAST_REQUEST](e,t){e.mediaIsCasting.set(!1,t)},[e.MEDIA_AIRPLAY_REQUEST](e,t){e.mediaIsAirplaying.set(!0,t)}},jt=({media:e,fullscreenElement:t,documentElement:i,stateMediator:n=Kt,requestMap:a=Qt,options:s={},monitorStateOwnersOnlyWithSubscriptions:r=!0})=>{const o=[],l={options:{...s}};let d=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0});const c=e=>{null!=e&&($t(e,d)||(d=Object.freeze({...d,...e}),o.forEach((e=>e(d)))))},h=()=>{const e=Object.entries(n).reduce(((e,[t,{get:i}])=>(e[t]=i(l),e)),{});c(e)},u={};let m;const p=async(e,t)=>{var i,a,s,d,p,E,v,b,g,A,I,f,_,w,y,T;const M=!!m;if(m={...l,...null!=m?m:{},...e},M)return;await(async(...e)=>{await Promise.all(e.filter((e=>e)).map((async e=>{if(!("localName"in e&&e instanceof ee.HTMLElement))return;const t=e.localName;if(!t.includes("-"))return;const i=ee.customElements.get(t);i&&e instanceof i||(await ee.customElements.whenDefined(t),ee.customElements.upgrade(e))})))})(...Object.values(e));const k=o.length>0&&0===t&&r,S=l.media!==m.media,R=(null==(i=l.media)?void 0:i.textTracks)!==(null==(a=m.media)?void 0:a.textTracks),C=(null==(s=l.media)?void 0:s.videoRenditions)!==(null==(d=m.media)?void 0:d.videoRenditions),L=(null==(p=l.media)?void 0:p.audioTracks)!==(null==(E=m.media)?void 0:E.audioTracks),D=(null==(v=l.media)?void 0:v.remote)!==(null==(b=m.media)?void 0:b.remote),x=l.documentElement!==m.documentElement,N=!!l.media&&(S||k),U=!!(null==(g=l.media)?void 0:g.textTracks)&&(R||k),P=!!(null==(A=l.media)?void 0:A.videoRenditions)&&(C||k),O=!!(null==(I=l.media)?void 0:I.audioTracks)&&(L||k),W=!!(null==(f=l.media)?void 0:f.remote)&&(D||k),V=!!l.documentElement&&(x||k),B=N||U||P||O||W||V,$=0===o.length&&1===t&&r,H=!!m.media&&(S||$),F=!!(null==(_=m.media)?void 0:_.textTracks)&&(R||$),G=!!(null==(w=m.media)?void 0:w.videoRenditions)&&(C||$),q=!!(null==(y=m.media)?void 0:y.audioTracks)&&(L||$),K=!!(null==(T=m.media)?void 0:T.remote)&&(D||$),Q=!!m.documentElement&&(x||$),j=H||F||G||q||K||Q;if(!(B||j))return Object.entries(m).forEach((([e,t])=>{l[e]=t})),h(),void(m=void 0);Object.entries(n).forEach((([e,{get:t,mediaEvents:i=[],textTracksEvents:n=[],videoRenditionsEvents:a=[],audioTracksEvents:s=[],remoteEvents:r=[],rootEvents:o=[],stateOwnersUpdateHandlers:d=[]}])=>{u[e]||(u[e]={});const h=i=>{const n=t(l,i);c({[e]:n})};let p;p=u[e].mediaEvents,i.forEach((t=>{p&&N&&(l.media.removeEventListener(t,p),u[e].mediaEvents=void 0),H&&(m.media.addEventListener(t,h),u[e].mediaEvents=h)})),p=u[e].textTracksEvents,n.forEach((t=>{var i,n;p&&U&&(null==(i=l.media.textTracks)||i.removeEventListener(t,p),u[e].textTracksEvents=void 0),F&&(null==(n=m.media.textTracks)||n.addEventListener(t,h),u[e].textTracksEvents=h)})),p=u[e].videoRenditionsEvents,a.forEach((t=>{var i,n;p&&P&&(null==(i=l.media.videoRenditions)||i.removeEventListener(t,p),u[e].videoRenditionsEvents=void 0),G&&(null==(n=m.media.videoRenditions)||n.addEventListener(t,h),u[e].videoRenditionsEvents=h)})),p=u[e].audioTracksEvents,s.forEach((t=>{var i,n;p&&O&&(null==(i=l.media.audioTracks)||i.removeEventListener(t,p),u[e].audioTracksEvents=void 0),q&&(null==(n=m.media.audioTracks)||n.addEventListener(t,h),u[e].audioTracksEvents=h)})),p=u[e].remoteEvents,r.forEach((t=>{var i,n;p&&W&&(null==(i=l.media.remote)||i.removeEventListener(t,p),u[e].remoteEvents=void 0),K&&(null==(n=m.media.remote)||n.addEventListener(t,h),u[e].remoteEvents=h)})),p=u[e].rootEvents,o.forEach((t=>{p&&V&&(l.documentElement.removeEventListener(t,p),u[e].rootEvents=void 0),Q&&(m.documentElement.addEventListener(t,h),u[e].rootEvents=h)}));const E=u[e].stateOwnersUpdateHandlers;d.forEach((t=>{E&&B&&E(),j&&(u[e].stateOwnersUpdateHandlers=t(h,m))}))})),Object.entries(m).forEach((([e,t])=>{l[e]=t})),h(),m=void 0};return p({media:e,fullscreenElement:t,documentElement:i,options:s}),{dispatch(e){const{type:t,detail:i}=e;a[t]&&null==d.mediaErrorCode?c(a[t](n,l,e)):"mediaelementchangerequest"===t?p({media:i}):"fullscreenelementchangerequest"===t?p({fullscreenElement:i}):"documentelementchangerequest"===t?p({documentElement:i}):"optionschangerequest"===t&&Object.entries(null!=i?i:{}).forEach((([e,t])=>{l.options[e]=t}))},getState:()=>d,subscribe:e=>(p({},o.length+1),o.push(e),e(d),()=>{const t=o.indexOf(e);t>=0&&(p({},o.length-1),o.splice(t,1))})}};var Yt,Zt,zt,Xt,Jt,ei,ti,ii,ni,ai,si,ri,oi=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},li=(e,t,i)=>(oi(e,t,"read from private field"),i?i.call(e):t.get(e)),di=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},ci=(e,t,i,n)=>(oi(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),hi=(e,t,i)=>(oi(e,t,"access private method"),i);const ui=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],mi="defaultsubtitles",pi="defaultstreamtype",Ei="defaultduration",vi="fullscreenelement",bi="hotkeys",gi="keysused",Ai="liveedgeoffset",Ii="nohotkeys",fi="novolumepref",_i="nosubtitleslangpref",wi="nodefaultstore",yi="keyboardforwardseekoffset",Ti="keyboardbackwardseekoffset";class Mi extends nt{constructor(){super(),di(this,ti),di(this,ni),di(this,si),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,di(this,Yt,new pt(this,bi)),di(this,Zt,void 0),di(this,zt,void 0),di(this,Xt,void 0),di(this,Jt,void 0),di(this,ei,(e=>{var t;null==(t=li(this,zt))||t.dispatch(e)})),this.associateElement(this);let e={};ci(this,Xt,(t=>{Object.entries(t).forEach((([t,i])=>{if(t in e&&e[t]===i)return;this.propagateMediaState(t,i);const n=t.toLowerCase(),a=new ee.CustomEvent(o[n],{composed:!0,detail:i});this.dispatchEvent(a)})),e=t})),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(Ii,bi,pi,mi,Ei)}get mediaStore(){return li(this,zt)}set mediaStore(e){var t,i;li(this,zt)&&(null==(t=li(this,Jt))||t.call(this),ci(this,Jt,void 0)),ci(this,zt,e),li(this,zt)||this.hasAttribute(wi)?ci(this,Jt,null==(i=li(this,zt))?void 0:i.subscribe(li(this,Xt))):hi(this,ti,ii).call(this)}get fullscreenElement(){var e;return null!=(e=li(this,Zt))?e:this}set fullscreenElement(e){var t;this.hasAttribute(vi)&&this.removeAttribute(vi),ci(this,Zt,e),null==(t=li(this,zt))||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}attributeChangedCallback(e,t,i){var n,a,s,r,o,l;if(super.attributeChangedCallback(e,t,i),e===Ii)i!==t&&""===i?(this.hasAttribute(bi)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):i!==t&&null===i&&this.enableHotkeys();else if(e===bi)li(this,Yt).value=i;else if(e===mi&&i!==t)null==(n=li(this,zt))||n.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(mi)}});else if(e===pi)null==(s=li(this,zt))||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:null!=(a=this.getAttribute(pi))?a:void 0}});else if(e===Ai)null==(r=li(this,zt))||r.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(Ai)?+this.getAttribute(Ai):void 0}});else if(e===vi){const e=i?null==(o=this.getRootNode())?void 0:o.getElementById(i):void 0;ci(this,Zt,e),null==(l=li(this,zt))||l.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,t;li(this,zt)||this.hasAttribute(wi)||hi(this,ti,ii).call(this),null==(e=li(this,zt))||e.dispatch({type:"documentelementchangerequest",detail:te}),super.connectedCallback(),li(this,zt)&&!li(this,Jt)&&ci(this,Jt,null==(t=li(this,zt))?void 0:t.subscribe(li(this,Xt))),this.enableHotkeys()}disconnectedCallback(){var t,i,n,a;null==(t=super.disconnectedCallback)||t.call(this),li(this,zt)&&(null==(i=li(this,zt))||i.dispatch({type:"documentelementchangerequest",detail:void 0}),null==(n=li(this,zt))||n.dispatch({type:e.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),li(this,Jt)&&(null==(a=li(this,Jt))||a.call(this),ci(this,Jt,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),null==(t=li(this,zt))||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),null==(t=li(this,zt))||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){Ni(this.mediaStateReceivers,e,t)}associateElement(t){if(!t)return;const{associatedElementSubscriptions:i}=this;if(i.has(t))return;const n=this.registerMediaStateReceiver.bind(this),a=this.unregisterMediaStateReceiver.bind(this),s=Ui(t,n,a);Object.values(e).forEach((e=>{t.addEventListener(e,li(this,ei))})),i.set(t,s)}unassociateElement(t){if(!t)return;const{associatedElementSubscriptions:i}=this;if(!i.has(t))return;i.get(t)(),i.delete(t),Object.values(e).forEach((e=>{t.removeEventListener(e,li(this,ei))}))}registerMediaStateReceiver(e){if(!e)return;const t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),li(this,zt)&&Object.entries(li(this,zt).getState()).forEach((([t,i])=>{Ni([e],t,i)})))}unregisterMediaStateReceiver(e){const t=this.mediaStateReceivers,i=t.indexOf(e);i<0||t.splice(i,1)}enableHotkeys(){this.addEventListener("keydown",hi(this,si,ri))}disableHotkeys(){this.removeEventListener("keydown",hi(this,si,ri)),this.removeEventListener("keyup",hi(this,ni,ai))}get hotkeys(){return li(this,Yt)}keyboardShortcutHandler(t){var i,n,a,s,r;const o=t.target;if((null!=(a=null!=(n=null==(i=o.getAttribute(gi))?void 0:i.split(" "))?n:null==o?void 0:o.keysUsed)?a:[]).map((e=>"Space"===e?" ":e)).filter(Boolean).includes(t.key))return;let l,d,c;if(!(li(this,Yt).contains(`no${t.key.toLowerCase()}`)||" "===t.key&&li(this,Yt).contains("nospace")))switch(t.key){case" ":case"k":l=li(this,zt).getState().mediaPaused?e.MEDIA_PLAY_REQUEST:e.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new ee.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l="off"===this.mediaStore.getState().mediaVolumeLevel?e.MEDIA_UNMUTE_REQUEST:e.MEDIA_MUTE_REQUEST,this.dispatchEvent(new ee.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.mediaStore.getState().mediaIsFullscreen?e.MEDIA_EXIT_FULLSCREEN_REQUEST:e.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new ee.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new ee.CustomEvent(e.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{const t=this.hasAttribute(Ti)?+this.getAttribute(Ti):10;d=Math.max((null!=(s=this.mediaStore.getState().mediaCurrentTime)?s:0)-t,0),c=new ee.CustomEvent(e.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:d}),this.dispatchEvent(c);break}case"ArrowRight":{const t=this.hasAttribute(yi)?+this.getAttribute(yi):10;d=Math.max((null!=(r=this.mediaStore.getState().mediaCurrentTime)?r:0)+t,0),c=new ee.CustomEvent(e.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:d}),this.dispatchEvent(c);break}}}}Yt=new WeakMap,Zt=new WeakMap,zt=new WeakMap,Xt=new WeakMap,Jt=new WeakMap,ei=new WeakMap,ti=new WeakSet,ii=function(){var e;this.mediaStore=jt({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(mi),defaultDuration:this.hasAttribute(Ei)?+this.getAttribute(Ei):void 0,defaultStreamType:null!=(e=this.getAttribute(pi))?e:void 0,liveEdgeOffset:this.hasAttribute(Ai)?+this.getAttribute(Ai):void 0,noVolumePref:this.hasAttribute(fi),noSubtitlesLangPref:this.hasAttribute(_i)}})},ni=new WeakSet,ai=function(e){const{key:t}=e;ui.includes(t)?this.keyboardShortcutHandler(e):this.removeEventListener("keyup",hi(this,ni,ai))},si=new WeakSet,ri=function(e){const{metaKey:t,altKey:i,key:n}=e;t||i||!ui.includes(n)?this.removeEventListener("keyup",hi(this,ni,ai)):([" ","ArrowLeft","ArrowRight"].includes(n)&&!(li(this,Yt).contains(`no${n.toLowerCase()}`)||" "===n&&li(this,Yt).contains("nospace"))&&e.preventDefault(),this.addEventListener("keyup",hi(this,ni,ai),{once:!0}))};const ki=Object.values(a),Si=Object.values(i),Ri=e=>{var i,n,a,s;let{observedAttributes:r}=e.constructor;!r&&(null==(i=e.nodeName)?void 0:i.includes("-"))&&(ee.customElements.upgrade(e),({observedAttributes:r}=e.constructor));const o=null==(s=null==(a=null==(n=null==e?void 0:e.getAttribute)?void 0:n.call(e,t.MEDIA_CHROME_ATTRIBUTES))?void 0:a.split)?void 0:s.call(a,/\s+/);return Array.isArray(r||o)?(r||o).filter((e=>ki.includes(e))):[]},Ci=e=>{return!(null==(i=(t=e).nodeName)?void 0:i.includes("-"))||!ee.customElements.get(null==(n=t.nodeName)?void 0:n.toLowerCase())||t instanceof ee.customElements.get(t.nodeName.toLowerCase())||ee.customElements.upgrade(t),Si.some((e=>e in t))||!!Ri(e).length;var t,i,n},Li=e=>{var t;return null==(t=null==e?void 0:e.join)?void 0:t.call(e,":")},Di={[a.MEDIA_SUBTITLES_LIST]:At,[a.MEDIA_SUBTITLES_SHOWING]:At,[a.MEDIA_SEEKABLE]:Li,[a.MEDIA_BUFFERED]:e=>null==e?void 0:e.map(Li).join(" "),[a.MEDIA_PREVIEW_COORDS]:e=>null==e?void 0:e.join(" "),[a.MEDIA_RENDITION_LIST]:function(e){return null==e?void 0:e.map(W).join(" ")},[a.MEDIA_AUDIO_TRACK_LIST]:function(e){return null==e?void 0:e.map(V).join(" ")}},xi=(e,t)=>{if(null==(n=(i=e).closest)?void 0:n.call(i,'*[slot="media"]'))return;var i,n;const a=(e,t)=>{var i,n;Ci(e)&&t(e);const{children:a=[]}=null!=e?e:{};[...a,...null!=(n=null==(i=null==e?void 0:e.shadowRoot)?void 0:i.children)?n:[]].forEach((e=>xi(e,t)))},s=null==e?void 0:e.nodeName.toLowerCase();!s.includes("-")||Ci(e)?a(e,t):ee.customElements.whenDefined(s).then((()=>{a(e,t)}))},Ni=(e,t,i)=>{e.forEach((e=>{if(t in e)return void(e[t]=i);const n=Ri(e),a=t.toLowerCase();n.includes(a)&&(async(e,t,i)=>{var n,a;if(e.isConnected||await $(0),"boolean"==typeof i||null==i)return Ae(e,t,i);if("number"==typeof i)return be(e,t,i);if("string"==typeof i)return fe(e,t,i);if(Array.isArray(i)&&!i.length)return e.removeAttribute(t);const s=null!=(a=null==(n=Di[t])?void 0:n.call(Di,i))?a:i;e.setAttribute(t,s)})(e,a,i)}))},Ui=(i,n,a)=>{xi(i,n);const s=e=>{var t;const i=null!=(t=null==e?void 0:e.composedPath()[0])?t:e.target;n(i)},r=e=>{var t;const i=null!=(t=null==e?void 0:e.composedPath()[0])?t:e.target;a(i)};i.addEventListener(e.REGISTER_MEDIA_STATE_RECEIVER,s),i.addEventListener(e.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=[];const l=e=>{const t=e.target;"media"!==t.name&&(o.forEach((e=>xi(e,a))),o=[...t.assignedElements({flatten:!0})],o.forEach((e=>xi(e,n))))};i.addEventListener("slotchange",l);const d=new MutationObserver((e=>{e.forEach((e=>{const{addedNodes:i=[],removedNodes:s=[],type:r,target:o,attributeName:l}=e;"childList"===r?(Array.prototype.forEach.call(i,(e=>xi(e,n))),Array.prototype.forEach.call(s,(e=>xi(e,a)))):"attributes"===r&&l===t.MEDIA_CHROME_ATTRIBUTES&&(Ci(o)?n(o):a(o))}))}));d.observe(i,{childList:!0,attributes:!0,subtree:!0});return()=>{xi(i,a),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(e.REGISTER_MEDIA_STATE_RECEIVER,s),i.removeEventListener(e.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};ee.customElements.get("media-controller")||ee.customElements.define("media-controller",Mi);var Pi,Oi,Wi,Vi,Bi,$i,Hi,Fi=Mi,Gi=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},qi=(e,t,i)=>(Gi(e,t,"read from private field"),i?i.call(e):t.get(e)),Ki=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},Qi=(e,t,i,n)=>(Gi(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);const ji="tooltipplacement",Yi=te.createElement("template");Yi.innerHTML='\n\n\n\n \n \n \n\n';class Zi extends ee.HTMLElement{constructor(e={}){var t;if(super(),Ki(this,$i),Ki(this,Pi,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",Ki(this,Oi,(e=>{this.preventClick||this.handleClick(e),setTimeout(qi(this,Wi),0)})),Ki(this,Wi,(()=>{var e,t;null==(t=null==(e=this.tooltipEl)?void 0:e.updateXOffset)||t.call(e)})),Ki(this,Vi,(e=>{const{key:t}=e;this.keysUsed.includes(t)?this.preventClick||this.handleClick(e):this.removeEventListener("keyup",qi(this,Vi))})),Ki(this,Bi,(e=>{const{metaKey:t,altKey:i,key:n}=e;t||i||!this.keysUsed.includes(n)?this.removeEventListener("keyup",qi(this,Vi)):this.addEventListener("keyup",qi(this,Vi),{once:!0})})),!this.shadowRoot){this.attachShadow({mode:"open"});const i=Yi.content.cloneNode(!0);this.nativeEl=i;let n=e.slotTemplate;n||(n=te.createElement("template"),n.innerHTML=`${e.defaultContent||""}`),e.tooltipContent&&(i.querySelector('slot[name="tooltip-content"]').innerHTML=null!=(t=e.tooltipContent)?t:"",this.tooltipContent=e.tooltipContent),this.nativeEl.appendChild(n.content.cloneNode(!0)),this.shadowRoot.appendChild(i)}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",ji,t.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",qi(this,Oi)),this.addEventListener("keydown",qi(this,Bi)),this.tabIndex=0}disable(){this.removeEventListener("click",qi(this,Oi)),this.removeEventListener("keydown",qi(this,Bi)),this.removeEventListener("keyup",qi(this,Vi)),this.tabIndex=-1}attributeChangedCallback(e,i,n){var a,s,r,o,l;e===t.MEDIA_CONTROLLER?(i&&(null==(s=null==(a=qi(this,Pi))?void 0:a.unassociateElement)||s.call(a,this),Qi(this,Pi,null)),n&&this.isConnected&&(Qi(this,Pi,null==(r=this.getRootNode())?void 0:r.getElementById(n)),null==(l=null==(o=qi(this,Pi))?void 0:o.associateElement)||l.call(o,this))):"disabled"===e&&n!==i?null==n?this.enable():this.disable():e===ji&&this.tooltipEl&&n!==i&&(this.tooltipEl.placement=n),qi(this,Wi).call(this)}connectedCallback(){var e,i,n;const{style:a}=Ee(this.shadowRoot,":host");a.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");const s=this.getAttribute(t.MEDIA_CONTROLLER);s&&(Qi(this,Pi,null==(e=this.getRootNode())?void 0:e.getElementById(s)),null==(n=null==(i=qi(this,Pi))?void 0:i.associateElement)||n.call(i,this)),ee.customElements.whenDefined("media-tooltip").then((()=>{return(e=this,t=$i,i=Hi,Gi(e,t,"access private method"),i).call(this);var e,t,i}))}disconnectedCallback(){var e,t;this.disable(),null==(t=null==(e=qi(this,Pi))?void 0:e.unassociateElement)||t.call(e,this),Qi(this,Pi,null),this.removeEventListener("mouseenter",qi(this,Wi)),this.removeEventListener("focus",qi(this,Wi)),this.removeEventListener("click",qi(this,Oi))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return Ie(this,ji)}set tooltipPlacement(e){fe(this,ji,e)}handleClick(e){}}Pi=new WeakMap,Oi=new WeakMap,Wi=new WeakMap,Vi=new WeakMap,Bi=new WeakMap,$i=new WeakSet,Hi=function(){this.addEventListener("mouseenter",qi(this,Wi)),this.addEventListener("focus",qi(this,Wi)),this.addEventListener("click",qi(this,Oi));const e=this.tooltipPlacement;e&&this.tooltipEl&&(this.tooltipEl.placement=e)},ee.customElements.get("media-chrome-button")||ee.customElements.define("media-chrome-button",Zi);var zi=Zi;const Xi='\n',Ji=te.createElement("template");Ji.innerHTML=`\n \n\n \n ${Xi}\n ${Xi}\n \n`;const en=`\n ${g}\n ${A}\n`,tn=e=>{const t=e.mediaIsAirplaying?P.EXIT_AIRPLAY():P.ENTER_AIRPLAY();e.setAttribute("aria-label",t)};class nn extends Zi{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_AIRPLAYING,a.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ji,tooltipContent:en,...e})}connectedCallback(){super.connectedCallback(),tn(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_IS_AIRPLAYING&&tn(this)}get mediaIsAirplaying(){return ge(this,a.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){Ae(this,a.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return Ie(this,a.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){fe(this,a.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){const t=new ee.CustomEvent(e.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(t)}}ee.customElements.get("media-airplay-button")||ee.customElements.define("media-airplay-button",nn);var an=nn;const sn=te.createElement("template");sn.innerHTML='\n \n\n \n \n \n \n';const rn=`\n ${I}\n ${f}\n`,on=e=>{e.setAttribute("aria-checked",(e=>{var t;return!!(null==(t=e.mediaSubtitlesShowing)?void 0:t.length)||e.hasAttribute(a.MEDIA_SUBTITLES_SHOWING)})(e).toString())};class ln extends Zi{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:sn,tooltipContent:rn,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",U.CLOSED_CAPTIONS()),on(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_SUBTITLES_SHOWING&&on(this)}get mediaSubtitlesList(){return dn(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){cn(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return dn(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){cn(this,a.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new ee.CustomEvent(e.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}}const dn=(e,t)=>{const i=e.getAttribute(t);return i?vt(i):[]},cn=(e,t,i)=>{if(!(null==i?void 0:i.length))return void e.removeAttribute(t);const n=At(i);e.getAttribute(t)!==n&&e.setAttribute(t,n)};ee.customElements.get("media-captions-button")||ee.customElements.define("media-captions-button",ln);var hn=ln;const un=te.createElement("template");un.innerHTML=`\n \n\n \n \n \n \n`;const mn=`\n ${_}\n ${w}\n`,pn=e=>{const t=e.mediaIsCasting?P.EXIT_CAST():P.ENTER_CAST();e.setAttribute("aria-label",t)};class En extends Zi{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_CASTING,a.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:un,tooltipContent:mn,...e})}connectedCallback(){super.connectedCallback(),pn(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_IS_CASTING&&pn(this)}get mediaIsCasting(){return ge(this,a.MEDIA_IS_CASTING)}set mediaIsCasting(e){Ae(this,a.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return Ie(this,a.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){fe(this,a.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){const t=this.mediaIsCasting?e.MEDIA_EXIT_CAST_REQUEST:e.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new ee.CustomEvent(t,{composed:!0,bubbles:!0}))}}ee.customElements.get("media-cast-button")||ee.customElements.define("media-cast-button",En);var vn,bn,gn,An,In,fn,_n,wn,yn,Tn,Mn,kn,Sn,Rn,Cn,Ln=En,Dn=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},xn=(e,t,i)=>(Dn(e,t,"read from private field"),i?i.call(e):t.get(e)),Nn=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},Un=(e,t,i,n)=>(Dn(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),Pn=(e,t,i)=>(Dn(e,t,"access private method"),i);const On="open",Wn="anchor";class Vn extends ee.HTMLElement{constructor(){super(),Nn(this,An),Nn(this,fn),Nn(this,wn),Nn(this,Tn),Nn(this,kn),Nn(this,Rn),Nn(this,vn,!1),Nn(this,bn,null),Nn(this,gn,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[On,Wn]}get open(){return ge(this,On)}set open(e){Ae(this,On,e)}handleEvent(e){switch(e.type){case"invoke":Pn(this,Tn,Mn).call(this,e);break;case"focusout":Pn(this,kn,Sn).call(this,e);break;case"keydown":Pn(this,Rn,Cn).call(this,e)}}connectedCallback(){Pn(this,An,In).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,i){Pn(this,An,In).call(this),e===On&&i!==t&&(this.open?Pn(this,fn,_n).call(this):Pn(this,wn,yn).call(this))}focus(){Un(this,bn,ue());const e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),t=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||t)return;const i=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');null==i||i.focus()}get keysUsed(){return["Escape","Tab"]}}vn=new WeakMap,bn=new WeakMap,gn=new WeakMap,An=new WeakSet,In=function(){if(!xn(this,vn)&&(Un(this,vn,!0),!this.shadowRoot)){this.attachShadow({mode:"open"});const e=function(e){const t={};for(const i of e)t[i.name]=i.value;return t}(this.attributes);this.shadowRoot.innerHTML=`\n ${this.constructor.getTemplateHTML(e)}\n `}},fn=new WeakSet,_n=function(){var e;null==(e=xn(this,gn))||e.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",(()=>this.focus()),{once:!0})},wn=new WeakSet,yn=function(){var e;null==(e=xn(this,gn))||e.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))},Tn=new WeakSet,Mn=function(e){Un(this,gn,e.relatedTarget),ce(this,e.relatedTarget)||(this.open=!this.open)},kn=new WeakSet,Sn=function(e){var t;ce(this,e.relatedTarget)||(null==(t=xn(this,bn))||t.focus(),xn(this,gn)&&xn(this,gn)!==e.relatedTarget&&this.open&&(this.open=!1))},Rn=new WeakSet,Cn=function(e){var t,i,n,a,s;const{key:r,ctrlKey:o,altKey:l,metaKey:d}=e;o||l||d||this.keysUsed.includes(r)&&(e.preventDefault(),e.stopPropagation(),"Tab"===r?(e.shiftKey?null==(i=null==(t=this.previousElementSibling)?void 0:t.focus)||i.call(t):null==(a=null==(n=this.nextElementSibling)?void 0:n.focus)||a.call(n),this.blur()):"Escape"===r&&(null==(s=xn(this,bn))||s.focus(),this.open=!1))},Vn.getTemplateHTML=function(e){return`\n \n ${this.getSlotTemplateHTML(e)}\n `},Vn.getSlotTemplateHTML=function(e){return'\n \n '},ee.customElements.get("media-chrome-dialog")||ee.customElements.define("media-chrome-dialog",Vn);var Bn,$n,Hn,Fn,Gn,qn,Kn,Qn,jn,Yn,Zn,zn,Xn,Jn,ea,ta,ia,na,aa,sa,ra,oa,la,da,ca,ha=Vn,ua=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},ma=(e,t,i)=>(ua(e,t,"read from private field"),i?i.call(e):t.get(e)),pa=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},Ea=(e,t,i,n)=>(ua(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),va=(e,t,i)=>(ua(e,t,"access private method"),i);const ba=te.createElement("template");ba.innerHTML='\n \n \n \n \n';class ga extends ee.HTMLElement{constructor(){super(),pa(this,Yn),pa(this,zn),pa(this,Jn),pa(this,ta),pa(this,na),pa(this,sa),pa(this,oa),pa(this,da),pa(this,Bn,void 0),pa(this,$n,void 0),pa(this,Hn,void 0),pa(this,Fn,void 0),pa(this,Gn,{}),pa(this,qn,[]),pa(this,Kn,(()=>{if(this.range.matches(":focus-visible")){const{style:e}=Ee(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}})),pa(this,Qn,(()=>{const{style:e}=Ee(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")})),pa(this,jn,(()=>{const e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)})),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ba.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),Ea(this,Hn,this.shadowRoot.querySelector("#startpoint")),Ea(this,Fn,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",t.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,n){var a,s,r,o,l;e===t.MEDIA_CONTROLLER?(i&&(null==(s=null==(a=ma(this,Bn))?void 0:a.unassociateElement)||s.call(a,this),Ea(this,Bn,null)),n&&this.isConnected&&(Ea(this,Bn,null==(r=this.getRootNode())?void 0:r.getElementById(n)),null==(l=null==(o=ma(this,Bn))?void 0:o.associateElement)||l.call(o,this))):("disabled"===e||"aria-disabled"===e&&i!==n)&&(null==n?(this.range.removeAttribute(e),va(this,zn,Xn).call(this)):(this.range.setAttribute(e,n),va(this,Jn,ea).call(this)))}connectedCallback(){var e,i,n;const{style:a}=Ee(this.shadowRoot,":host");a.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),ma(this,Gn).pointer=Ee(this.shadowRoot,"#pointer"),ma(this,Gn).progress=Ee(this.shadowRoot,"#progress"),ma(this,Gn).thumb=Ee(this.shadowRoot,"#thumb"),ma(this,Gn).activeSegment=Ee(this.shadowRoot,"#segments-clipping rect:nth-child(0)");const s=this.getAttribute(t.MEDIA_CONTROLLER);s&&(Ea(this,Bn,null==(e=this.getRootNode())?void 0:e.getElementById(s)),null==(n=null==(i=ma(this,Bn))?void 0:i.associateElement)||n.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ma(this,Kn)),this.shadowRoot.addEventListener("focusout",ma(this,Qn)),va(this,zn,Xn).call(this),se(this.container,ma(this,jn))}disconnectedCallback(){var e,t;va(this,Jn,ea).call(this),null==(t=null==(e=ma(this,Bn))?void 0:e.unassociateElement)||t.call(e,this),Ea(this,Bn,null),this.shadowRoot.removeEventListener("focusin",ma(this,Kn)),this.shadowRoot.removeEventListener("focusout",ma(this,Qn)),re(this.container,ma(this,jn))}updatePointerBar(e){var t;null==(t=ma(this,Gn).pointer)||t.style.setProperty("width",100*this.getPointerRatio(e)+"%")}updateBar(){var e,t;const i=100*this.range.valueAsNumber;null==(e=ma(this,Gn).progress)||e.style.setProperty("width",`${i}%`),null==(t=ma(this,Gn).thumb)||t.style.setProperty("left",`${i}%`)}updateSegments(e){const t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(null==e?void 0:e.length)),!(null==e?void 0:e.length))return;const i=[...new Set([+this.range.min,...e.flatMap((e=>[e.start,e.end])),+this.range.max])];Ea(this,qn,[...i]);const n=i.pop();for(const[e,a]of i.entries()){const[s,r]=[0===e,e===i.length-1],o=s?"calc(var(--segments-gap) / -1)":100*a+"%",l=`calc(${100*((r?n:i[e+1])-a)}%${s||r?"":" - var(--segments-gap)"})`,d=te.createElementNS("http://www.w3.org/2000/svg","rect"),c=Ee(this.shadowRoot,`#segments-clipping rect:nth-child(${e+1})`);c.style.setProperty("x",o),c.style.setProperty("width",l),t.append(d)}}getPointerRatio(e){const t=function(e,t,i,n){const a=pe(i,n),s=pe(i,{x:e,y:t}),r=pe(n,{x:e,y:t});return s>a||r>a?s>r?1:0:s/a}(e.clientX,e.clientY,ma(this,Hn).getBoundingClientRect(),ma(this,Fn).getBoundingClientRect());return Math.max(0,Math.min(1,t))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":va(this,da,ca).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":va(this,na,aa).call(this,e);break;case"pointerdown":va(this,ta,ia).call(this,e);break;case"pointerup":va(this,sa,ra).call(this);break;case"pointerleave":va(this,oa,la).call(this)}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}}Bn=new WeakMap,$n=new WeakMap,Hn=new WeakMap,Fn=new WeakMap,Gn=new WeakMap,qn=new WeakMap,Kn=new WeakMap,Qn=new WeakMap,jn=new WeakMap,Yn=new WeakSet,Zn=function(e){const t=ma(this,Gn).activeSegment;if(!t)return;const i=this.getPointerRatio(e),n=`#segments-clipping rect:nth-child(${ma(this,qn).findIndex(((e,t,n)=>{const a=n[t+1];return null!=a&&i>=e&&i<=a}))+1})`;t.selectorText==n&&t.style.transform||(t.selectorText=n,t.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))},zn=new WeakSet,Xn=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))},Jn=new WeakSet,ea=function(){var e,t;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),null==(e=ee.window)||e.removeEventListener("pointerup",this),null==(t=ee.window)||t.removeEventListener("pointermove",this)},ta=new WeakSet,ia=function(e){var t;Ea(this,$n,e.composedPath().includes(this.range)),null==(t=ee.window)||t.addEventListener("pointerup",this)},na=new WeakSet,aa=function(e){var t;"mouse"!==e.pointerType&&va(this,ta,ia).call(this,e),this.addEventListener("pointerleave",this),null==(t=ee.window)||t.addEventListener("pointermove",this)},sa=new WeakSet,ra=function(){var e;null==(e=ee.window)||e.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")},oa=new WeakSet,la=function(){var e,t;this.removeEventListener("pointerleave",this),null==(e=ee.window)||e.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),null==(t=ma(this,Gn).activeSegment)||t.style.removeProperty("transform")},da=new WeakSet,ca=function(e){this.toggleAttribute("dragging",1===e.buttons||"mouse"!==e.pointerType),this.updatePointerBar(e),va(this,Yn,Zn).call(this,e),!this.dragging||"mouse"===e.pointerType&&ma(this,$n)||(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(e),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))},ee.customElements.get("media-chrome-range")||ee.customElements.define("media-chrome-range",ga);var Aa,Ia=ga,fa=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},_a=(e,t,i)=>(fa(e,t,"read from private field"),i?i.call(e):t.get(e)),wa=(e,t,i,n)=>(fa(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);const ya=te.createElement("template");ya.innerHTML='\n \n\n \n';class Ta extends ee.HTMLElement{constructor(){super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Aa,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ya.content.cloneNode(!0)))}static get observedAttributes(){return[t.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,n){var a,s,r,o,l;e===t.MEDIA_CONTROLLER&&(i&&(null==(s=null==(a=_a(this,Aa))?void 0:a.unassociateElement)||s.call(a,this),wa(this,Aa,null)),n&&this.isConnected&&(wa(this,Aa,null==(r=this.getRootNode())?void 0:r.getElementById(n)),null==(l=null==(o=_a(this,Aa))?void 0:o.associateElement)||l.call(o,this)))}connectedCallback(){var e,i,n;const a=this.getAttribute(t.MEDIA_CONTROLLER);a&&(wa(this,Aa,null==(e=this.getRootNode())?void 0:e.getElementById(a)),null==(n=null==(i=_a(this,Aa))?void 0:i.associateElement)||n.call(i,this))}disconnectedCallback(){var e,t;null==(t=null==(e=_a(this,Aa))?void 0:e.unassociateElement)||t.call(e,this),wa(this,Aa,null)}}Aa=new WeakMap,ee.customElements.get("media-control-bar")||ee.customElements.define("media-control-bar",Ta);var Ma,ka=Ta,Sa=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Ra=(e,t,i)=>(Sa(e,t,"read from private field"),i?i.call(e):t.get(e)),Ca=(e,t,i,n)=>(Sa(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);const La=te.createElement("template");La.innerHTML="\n \n \n";class Da extends ee.HTMLElement{constructor(){super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Ma,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(La.content.cloneNode(!0)))}static get observedAttributes(){return[t.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,n){var a,s,r,o,l;e===t.MEDIA_CONTROLLER&&(i&&(null==(s=null==(a=Ra(this,Ma))?void 0:a.unassociateElement)||s.call(a,this),Ca(this,Ma,null)),n&&this.isConnected&&(Ca(this,Ma,null==(r=this.getRootNode())?void 0:r.getElementById(n)),null==(l=null==(o=Ra(this,Ma))?void 0:o.associateElement)||l.call(o,this)))}connectedCallback(){var e,i,n;const{style:a}=Ee(this.shadowRoot,":host");a.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);const s=this.getAttribute(t.MEDIA_CONTROLLER);s&&(Ca(this,Ma,null==(e=this.getRootNode())?void 0:e.getElementById(s)),null==(n=null==(i=Ra(this,Ma))?void 0:i.associateElement)||n.call(i,this))}disconnectedCallback(){var e,t;null==(t=null==(e=Ra(this,Ma))?void 0:e.unassociateElement)||t.call(e,this),Ca(this,Ma,null)}}Ma=new WeakMap,ee.customElements.get("media-text-display")||ee.customElements.define("media-text-display",Da);var xa,Na=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Ua=(e,t,i)=>(Na(e,t,"read from private field"),i?i.call(e):t.get(e));class Pa extends Da{constructor(){var e,t,i,n;super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,xa,void 0),e=this,t=xa,i=this.shadowRoot.querySelector("slot"),Na(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),Ua(this,xa).textContent=G(0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_DURATION]}attributeChangedCallback(e,t,i){e===a.MEDIA_DURATION&&(Ua(this,xa).textContent=G(+i)),super.attributeChangedCallback(e,t,i)}get mediaDuration(){return ve(this,a.MEDIA_DURATION)}set mediaDuration(e){be(this,a.MEDIA_DURATION,e)}}xa=new WeakMap,ee.customElements.get("media-duration-display")||ee.customElements.define("media-duration-display",Pa);var Oa,Wa=Pa,Va=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)};function Ba(e){var t;const{title:i,message:n}=null!=(t=b(e))?t:{};let a="";return i&&(a+=`${i}
`),n&&(a+=`${n}
`),a}const $a=[a.MEDIA_ERROR_CODE,a.MEDIA_ERROR_MESSAGE];class Ha extends Vn{constructor(){super(...arguments),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Oa,null)}static get observedAttributes(){return[...super.observedAttributes,...$a]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,i){var n;if(super.attributeChangedCallback(e,t,i),!$a.includes(e))return;const a=null!=(n=this.mediaError)?n:{code:this.mediaErrorCode,message:this.mediaErrorMessage};var s;this.open=(s=a).code&&null!==b(s),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(a))}get mediaError(){return Va(e=this,t=Oa,"read from private field"),i?i.call(e):t.get(e);var e,t,i}set mediaError(e){((e,t,i,n)=>{Va(e,t,"write to private field"),n?n.call(e,i):t.set(e,i)})(this,Oa,e)}get mediaErrorCode(){return ve(this,"mediaerrorcode")}set mediaErrorCode(e){be(this,"mediaerrorcode",e)}get mediaErrorMessage(){return Ie(this,"mediaerrormessage")}set mediaErrorMessage(e){fe(this,"mediaerrormessage",e)}}Oa=new WeakMap,Ha.getSlotTemplateHTML=function(e){return`\n \n \n ${Ba({code:+e.mediaerrorcode,message:e.mediaerrormessage})}\n \n `},Ha.formatErrorMessage=Ba,ee.customElements.get("media-error-dialog")||ee.customElements.define("media-error-dialog",Ha);var Fa=Ha;const Ga=te.createElement("template");Ga.innerHTML=`\n \n\n \n \n \n \n`;const qa=`\n ${y}\n ${T}\n`,Ka=e=>{const t=e.mediaIsFullscreen?P.EXIT_FULLSCREEN():P.ENTER_FULLSCREEN();e.setAttribute("aria-label",t)};class Qa extends Zi{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_FULLSCREEN,a.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ga,tooltipContent:qa,...e})}connectedCallback(){super.connectedCallback(),Ka(this)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_IS_FULLSCREEN&&Ka(this)}get mediaFullscreenUnavailable(){return Ie(this,a.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){fe(this,a.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return ge(this,a.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){Ae(this,a.MEDIA_IS_FULLSCREEN,e)}handleClick(){const t=this.mediaIsFullscreen?e.MEDIA_EXIT_FULLSCREEN_REQUEST:e.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new ee.CustomEvent(t,{composed:!0,bubbles:!0}))}}ee.customElements.get("media-fullscreen-button")||ee.customElements.define("media-fullscreen-button",Qa);var ja=Qa;const{MEDIA_TIME_IS_LIVE:Ya,MEDIA_PAUSED:Za}=a,{MEDIA_SEEK_TO_LIVE_REQUEST:za,MEDIA_PLAY_REQUEST:Xa}=e,Ja=te.createElement("template");Ja.innerHTML=`\n \n\n \n \n LIVE\n`;const es=e=>{const t=e.mediaPaused||!e.mediaTimeIsLive,i=t?P.SEEK_LIVE():P.PLAYING_LIVE();e.setAttribute("aria-label",i),t?e.removeAttribute("aria-disabled"):e.setAttribute("aria-disabled","true")};class ts extends Zi{static get observedAttributes(){return[...super.observedAttributes,Za,Ya]}constructor(e={}){super({slotTemplate:Ja,...e})}connectedCallback(){es(this),super.connectedCallback()}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),es(this)}get mediaPaused(){return ge(this,a.MEDIA_PAUSED)}set mediaPaused(e){Ae(this,a.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return ge(this,a.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){Ae(this,a.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new ee.CustomEvent(za,{composed:!0,bubbles:!0})),this.hasAttribute(Za)&&this.dispatchEvent(new ee.CustomEvent(Xa,{composed:!0,bubbles:!0})))}}ee.customElements.get("media-live-button")||ee.customElements.define("media-live-button",ts);var is,ns,as=ts,ss=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},rs=(e,t,i)=>(ss(e,t,"read from private field"),i?i.call(e):t.get(e)),os=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},ls=(e,t,i,n)=>(ss(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);const ds="loadingdelay",cs=te.createElement("template");cs.innerHTML=`\n\n\n\n\n\n${U.MEDIA_LOADING()}
\n`;class hs extends ee.HTMLElement{constructor(){if(super(),os(this,is,void 0),os(this,ns,500),!this.shadowRoot){const e=this.attachShadow({mode:"open"}),t=cs.content.cloneNode(!0);e.appendChild(t)}}static get observedAttributes(){return[t.MEDIA_CONTROLLER,a.MEDIA_PAUSED,a.MEDIA_LOADING,ds]}attributeChangedCallback(e,i,n){var a,s,r,o,l;e===ds&&i!==n?this.loadingDelay=Number(n):e===t.MEDIA_CONTROLLER&&(i&&(null==(s=null==(a=rs(this,is))?void 0:a.unassociateElement)||s.call(a,this),ls(this,is,null)),n&&this.isConnected&&(ls(this,is,null==(r=this.getRootNode())?void 0:r.getElementById(n)),null==(l=null==(o=rs(this,is))?void 0:o.associateElement)||l.call(o,this)))}connectedCallback(){var e,i,n;const a=this.getAttribute(t.MEDIA_CONTROLLER);a&&(ls(this,is,null==(e=this.getRootNode())?void 0:e.getElementById(a)),null==(n=null==(i=rs(this,is))?void 0:i.associateElement)||n.call(i,this))}disconnectedCallback(){var e,t;null==(t=null==(e=rs(this,is))?void 0:e.unassociateElement)||t.call(e,this),ls(this,is,null)}get loadingDelay(){return rs(this,ns)}set loadingDelay(e){ls(this,ns,e);const{style:t}=Ee(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return ge(this,a.MEDIA_PAUSED)}set mediaPaused(e){Ae(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return ge(this,a.MEDIA_LOADING)}set mediaLoading(e){Ae(this,a.MEDIA_LOADING,e)}}is=new WeakMap,ns=new WeakMap,ee.customElements.get("media-loading-indicator")||ee.customElements.define("media-loading-indicator",hs);var us=hs;const{MEDIA_VOLUME_LEVEL:ms}=a,ps='',Es=te.createElement("template");Es.innerHTML=`\n \n\n \n \n ${ps}\n ${ps}\n \n \n`;const vs=`\n ${M}\n ${k}\n`,bs=e=>{const t="off"===e.mediaVolumeLevel?P.UNMUTE():P.MUTE();e.setAttribute("aria-label",t)};class gs extends Zi{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:Es,tooltipContent:vs,...e})}connectedCallback(){bs(this),super.connectedCallback()}attributeChangedCallback(e,t,i){e===a.MEDIA_VOLUME_LEVEL&&bs(this),super.attributeChangedCallback(e,t,i)}get mediaVolumeLevel(){return Ie(this,a.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){fe(this,a.MEDIA_VOLUME_LEVEL,e)}handleClick(){const t="off"===this.mediaVolumeLevel?e.MEDIA_UNMUTE_REQUEST:e.MEDIA_MUTE_REQUEST;this.dispatchEvent(new ee.CustomEvent(t,{composed:!0,bubbles:!0}))}}ee.customElements.get("media-mute-button")||ee.customElements.define("media-mute-button",gs);var As=gs;const Is='',fs=te.createElement("template");fs.innerHTML=`\n \n\n \n ${Is}\n ${Is}\n \n`;const _s=`\n ${S}\n ${R}\n`,ws=e=>{const t=e.mediaIsPip?P.EXIT_PIP():P.ENTER_PIP();e.setAttribute("aria-label",t)};class ys extends Zi{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_PIP,a.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:fs,tooltipContent:_s,...e})}connectedCallback(){ws(this),super.connectedCallback()}attributeChangedCallback(e,t,i){e===a.MEDIA_IS_PIP&&ws(this),super.attributeChangedCallback(e,t,i)}get mediaPipUnavailable(){return Ie(this,a.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){fe(this,a.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return ge(this,a.MEDIA_IS_PIP)}set mediaIsPip(e){Ae(this,a.MEDIA_IS_PIP,e)}handleClick(){const t=this.mediaIsPip?e.MEDIA_EXIT_PIP_REQUEST:e.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new ee.CustomEvent(t,{composed:!0,bubbles:!0}))}}ee.customElements.get("media-pip-button")||ee.customElements.define("media-pip-button",ys);var Ts,Ms=ys,ks=(e,t,i)=>(((e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)})(e,t,"read from private field"),i?i.call(e):t.get(e));const Ss="rates",Rs=[1,1.2,1.5,1.7,2],Cs=te.createElement("template");Cs.innerHTML='\n \n \n';class Ls extends Zi{constructor(e={}){super({slotTemplate:Cs,tooltipContent:D,...e}),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Ts,new pt(this,Ss,{defaultValue:Rs})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML="1x"}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,Ss]}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),e===Ss&&(ks(this,Ts).value=i),e===a.MEDIA_PLAYBACK_RATE){const e=i?+i:Number.NaN,t=Number.isNaN(e)?1:e;this.container.innerHTML=`${t}x`,this.setAttribute("aria-label",U.PLAYBACK_RATE({playbackRate:t}))}}get rates(){return ks(this,Ts)}set rates(e){e?Array.isArray(e)&&(ks(this,Ts).value=e.join(" ")):ks(this,Ts).value=""}get mediaPlaybackRate(){return ve(this,a.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){be(this,a.MEDIA_PLAYBACK_RATE,e)}handleClick(){var t,i;const n=Array.from(this.rates.values(),(e=>+e)).sort(((e,t)=>e-t)),a=null!=(i=null!=(t=n.find((e=>e>this.mediaPlaybackRate)))?t:n[0])?i:1,s=new ee.CustomEvent(e.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(s)}}Ts=new WeakMap,ee.customElements.get("media-playback-rate-button")||ee.customElements.define("media-playback-rate-button",Ls);var Ds=Ls;const xs=te.createElement("template");xs.innerHTML=`\n \n\n \n \n \n \n`;const Ns=`\n ${C}\n ${L}\n`,Us=e=>{const t=e.mediaPaused?P.PLAY():P.PAUSE();e.setAttribute("aria-label",t)};class Ps extends Zi{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:xs,tooltipContent:Ns,...e})}connectedCallback(){Us(this),super.connectedCallback()}attributeChangedCallback(e,t,i){e===a.MEDIA_PAUSED&&Us(this),super.attributeChangedCallback(e,t,i)}get mediaPaused(){return ge(this,a.MEDIA_PAUSED)}set mediaPaused(e){Ae(this,a.MEDIA_PAUSED,e)}handleClick(){const t=this.mediaPaused?e.MEDIA_PLAY_REQUEST:e.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new ee.CustomEvent(t,{composed:!0,bubbles:!0}))}}ee.customElements.get("media-play-button")||ee.customElements.define("media-play-button",Ps);var Os=Ps;const Ws="placeholdersrc",Vs="src",Bs=te.createElement("template");Bs.innerHTML='\n \n\n
\n';class $s extends ee.HTMLElement{static get observedAttributes(){return[Ws,Vs]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Bs.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,i){e===Vs&&(null==i?this.image.removeAttribute(Vs):this.image.setAttribute(Vs,i)),e===Ws&&(null==i?this.image.style.removeProperty("background-image"):((e,t)=>{e.style["background-image"]=`url('${t}')`})(this.image,i))}get placeholderSrc(){return Ie(this,Ws)}set placeholderSrc(e){fe(this,Vs,e)}get src(){return Ie(this,Vs)}set src(e){fe(this,Vs,e)}}ee.customElements.get("media-poster-image")||ee.customElements.define("media-poster-image",$s);var Hs,Fs=$s,Gs=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)};class qs extends Da{constructor(){var e,t,i,n;super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Hs,void 0),e=this,t=Hs,i=this.shadowRoot.querySelector("slot"),Gs(e,t,"write to private field"),n?n.call(e,i):t.set(e,i)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,t,i){var n,s,r;super.attributeChangedCallback(e,t,i),e===a.MEDIA_PREVIEW_CHAPTER&&i!==t&&null!=i&&((n=this,s=Hs,Gs(n,s,"read from private field"),r?r.call(n):s.get(n)).textContent=i,""!==i?this.setAttribute("aria-valuetext",`chapter: ${i}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return Ie(this,a.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){fe(this,a.MEDIA_PREVIEW_CHAPTER,e)}}Hs=new WeakMap,ee.customElements.get("media-preview-chapter-display")||ee.customElements.define("media-preview-chapter-display",qs);var Ks,Qs=qs,js=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Ys=(e,t,i)=>(js(e,t,"read from private field"),i?i.call(e):t.get(e)),Zs=(e,t,i,n)=>(js(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);const zs=te.createElement("template");zs.innerHTML='\n \n
\n';class Xs extends ee.HTMLElement{constructor(){super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Ks,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(zs.content.cloneNode(!0)))}static get observedAttributes(){return[t.MEDIA_CONTROLLER,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,n;const a=this.getAttribute(t.MEDIA_CONTROLLER);a&&(Zs(this,Ks,null==(e=this.getRootNode())?void 0:e.getElementById(a)),null==(n=null==(i=Ys(this,Ks))?void 0:i.associateElement)||n.call(i,this))}disconnectedCallback(){var e,t;null==(t=null==(e=Ys(this,Ks))?void 0:e.unassociateElement)||t.call(e,this),Zs(this,Ks,null)}attributeChangedCallback(e,i,n){var s,r,o,l,d;[a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===t.MEDIA_CONTROLLER&&(i&&(null==(r=null==(s=Ys(this,Ks))?void 0:s.unassociateElement)||r.call(s,this),Zs(this,Ks,null)),n&&this.isConnected&&(Zs(this,Ks,null==(o=this.getRootNode())?void 0:o.getElementById(n)),null==(d=null==(l=Ys(this,Ks))?void 0:l.associateElement)||d.call(l,this)))}get mediaPreviewImage(){return Ie(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){fe(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){const e=this.getAttribute(a.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map((e=>+e))}set mediaPreviewCoords(e){e?this.setAttribute(a.MEDIA_PREVIEW_COORDS,e.join(" ")):this.removeAttribute(a.MEDIA_PREVIEW_COORDS)}update(){const e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!e||!t)return;const[i,n,a,s]=e,r=t.split("#")[0],o=getComputedStyle(this),{maxWidth:l,maxHeight:d,minWidth:c,minHeight:h}=o,u=Math.min(parseInt(l)/a,parseInt(d)/s),m=Math.max(parseInt(c)/a,parseInt(h)/s),p=u<1,E=p?u:m>1?m:1,{style:v}=Ee(this.shadowRoot,":host"),b=Ee(this.shadowRoot,"img").style,g=this.shadowRoot.querySelector("img"),A=p?"min":"max";v.setProperty(`${A}-width`,"initial","important"),v.setProperty(`${A}-height`,"initial","important"),v.width=a*E+"px",v.height=s*E+"px";const I=()=>{b.width=this.imgWidth*E+"px",b.height=this.imgHeight*E+"px",b.display="block"};g.src!==r&&(g.onload=()=>{this.imgWidth=g.naturalWidth,this.imgHeight=g.naturalHeight,I()},g.src=r,I()),I(),b.transform=`translate(-${i*E}px, -${n*E}px)`}}Ks=new WeakMap,ee.customElements.get("media-preview-thumbnail")||ee.customElements.define("media-preview-thumbnail",Xs);var Js,er=Xs,tr=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},ir=(e,t,i)=>(tr(e,t,"read from private field"),i?i.call(e):t.get(e));class nr extends Da{constructor(){var e,t,i,n;super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,Js,void 0),e=this,t=Js,i=this.shadowRoot.querySelector("slot"),tr(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),ir(this,Js).textContent=G(0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e===a.MEDIA_PREVIEW_TIME&&null!=i&&(ir(this,Js).textContent=G(parseFloat(i)))}get mediaPreviewTime(){return ve(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){be(this,a.MEDIA_PREVIEW_TIME,e)}}Js=new WeakMap,ee.customElements.get("media-preview-time-display")||ee.customElements.define("media-preview-time-display",nr);var ar=nr;const sr="seekoffset",rr=te.createElement("template");rr.innerHTML='\n \n';class or extends Zi{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,sr]}constructor(e={}){super({slotTemplate:rr,tooltipContent:x,...e})}connectedCallback(){this.seekOffset=ve(this,sr,30),super.connectedCallback()}attributeChangedCallback(e,t,i){e===sr&&(this.seekOffset=ve(this,sr,30)),super.attributeChangedCallback(e,t,i)}get seekOffset(){return ve(this,sr,30)}set seekOffset(e){be(this,sr,e),this.setAttribute("aria-label",P.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),le(de(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return ve(this,a.MEDIA_CURRENT_TIME,0)}set mediaCurrentTime(e){be(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){const t=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new ee.CustomEvent(e.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(i)}}ee.customElements.get("media-seek-backward-button")||ee.customElements.define("media-seek-backward-button",or);var lr=or;const dr="seekoffset",cr=te.createElement("template");cr.innerHTML='\n \n';class hr extends Zi{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,dr]}constructor(e={}){super({slotTemplate:cr,tooltipContent:N,...e})}connectedCallback(){this.seekOffset=ve(this,dr,30),super.connectedCallback()}attributeChangedCallback(e,t,i){e===dr&&(this.seekOffset=ve(this,dr,30)),super.attributeChangedCallback(e,t,i)}get seekOffset(){return ve(this,dr,30)}set seekOffset(e){be(this,dr,e),this.setAttribute("aria-label",P.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),le(de(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return ve(this,a.MEDIA_CURRENT_TIME,0)}set mediaCurrentTime(e){be(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){const t=this.mediaCurrentTime+this.seekOffset,i=new ee.CustomEvent(e.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(i)}}ee.customElements.get("media-seek-forward-button")||ee.customElements.define("media-seek-forward-button",hr);var ur,mr=hr,pr=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},Er=(e,t,i)=>(pr(e,t,"read from private field"),i?i.call(e):t.get(e));const vr={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},br=[...Object.values(vr),a.MEDIA_CURRENT_TIME,a.MEDIA_DURATION,a.MEDIA_SEEKABLE],gr=["Enter"," "],Ar=(e,{timesSep:t=" / "}={})=>{var i,n;const a=e.hasAttribute(vr.REMAINING),s=e.hasAttribute(vr.SHOW_DURATION),r=null!=(i=e.mediaCurrentTime)?i:0,[,o]=null!=(n=e.mediaSeekable)?n:[];let l=0;Number.isFinite(e.mediaDuration)?l=e.mediaDuration:Number.isFinite(o)&&(l=o);const d=G(a?0-(l-r):r);return s?`${d}${t}${G(l)}`:d};class Ir extends Da{constructor(){var e,t,i,n;super(),((e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)})(this,ur,void 0),e=this,t=ur,i=this.shadowRoot.querySelector("slot"),pr(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),Er(this,ur).innerHTML=`${Ar(this)}`}static get observedAttributes(){return[...super.observedAttributes,...br,"disabled"]}connectedCallback(){const{style:e}=Ee(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","pointer"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",U.PLAYBACK_TIME());const t=e=>{const{key:i}=e;gr.includes(i)?this.toggleTimeDisplay():this.removeEventListener("keyup",t)};this.addEventListener("keydown",(e=>{const{metaKey:i,altKey:n,key:a}=e;i||n||!gr.includes(a)?this.removeEventListener("keyup",t):this.addEventListener("keyup",t)})),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,i){br.includes(e)?this.update():"disabled"===e&&i!==t&&(null==i?this.enable():this.disable()),super.attributeChangedCallback(e,t,i)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return ge(this,vr.REMAINING)}set remaining(e){Ae(this,vr.REMAINING,e)}get showDuration(){return ge(this,vr.SHOW_DURATION)}set showDuration(e){Ae(this,vr.SHOW_DURATION,e)}get noToggle(){return ge(this,vr.NO_TOGGLE)}set noToggle(e){Ae(this,vr.NO_TOGGLE,e)}get mediaDuration(){return ve(this,a.MEDIA_DURATION)}set mediaDuration(e){be(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return ve(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){be(this,a.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){const e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map((e=>+e))}set mediaSeekable(e){null!=e?this.setAttribute(a.MEDIA_SEEKABLE,e.join(":")):this.removeAttribute(a.MEDIA_SEEKABLE)}update(){const e=Ar(this);(e=>{var t;const i=e.mediaCurrentTime,[,n]=null!=(t=e.mediaSeekable)?t:[];let a=null;if(Number.isFinite(e.mediaDuration)?a=e.mediaDuration:Number.isFinite(n)&&(a=n),null==i||null===a)return void e.setAttribute("aria-valuetext","video not loaded, unknown time.");const s=e.hasAttribute(vr.REMAINING),r=e.hasAttribute(vr.SHOW_DURATION),o=F(s?0-(a-i):i);if(!r)return void e.setAttribute("aria-valuetext",o);const l=`${o} of ${F(a)}`;e.setAttribute("aria-valuetext",l)})(this),e!==Er(this,ur).innerHTML&&(Er(this,ur).innerHTML=e)}}ur=new WeakMap,ee.customElements.get("media-time-display")||ee.customElements.define("media-time-display",Ir);var fr,_r,wr,yr,Tr,Mr,kr,Sr,Rr,Cr,Lr=Ir,Dr=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},xr=(e,t,i)=>(Dr(e,t,"read from private field"),i?i.call(e):t.get(e)),Nr=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},Ur=(e,t,i,n)=>(Dr(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i);class Pr{constructor(e,t,i){Nr(this,fr,void 0),Nr(this,_r,void 0),Nr(this,wr,void 0),Nr(this,yr,void 0),Nr(this,Tr,void 0),Nr(this,Mr,void 0),Nr(this,kr,void 0),Nr(this,Sr,void 0),Nr(this,Rr,0),Nr(this,Cr,((e=performance.now())=>{Ur(this,Rr,requestAnimationFrame(xr(this,Cr))),Ur(this,yr,performance.now()-xr(this,wr));const t=1e3/this.fps;if(xr(this,yr)>t){Ur(this,wr,e-xr(this,yr)%t);const r=1e3/((e-xr(this,_r))/++(i=this,n=Tr,{set _(e){Ur(i,n,e,a)},get _(){return xr(i,n,s)}})._),o=(e-xr(this,Mr))/1e3/this.duration;let l=xr(this,kr)+o*this.playbackRate;l-xr(this,fr).valueAsNumber>0?Ur(this,Sr,this.playbackRate/this.duration/r):(Ur(this,Sr,.995*xr(this,Sr)),l=xr(this,fr).valueAsNumber+xr(this,Sr)),this.callback(l)}var i,n,a,s})),Ur(this,fr,e),this.callback=t,this.fps=i}start(){0===xr(this,Rr)&&(Ur(this,wr,performance.now()),Ur(this,_r,xr(this,wr)),Ur(this,Tr,0),xr(this,Cr).call(this))}stop(){0!==xr(this,Rr)&&(cancelAnimationFrame(xr(this,Rr)),Ur(this,Rr,0))}update({start:e,duration:t,playbackRate:i}){const n=e-xr(this,fr).valueAsNumber,a=Math.abs(t-this.duration);(n>0||n<-.03||a>=.5)&&this.callback(e),Ur(this,kr,e),Ur(this,Mr,performance.now()),this.duration=t,this.playbackRate=i}}fr=new WeakMap,_r=new WeakMap,wr=new WeakMap,yr=new WeakMap,Tr=new WeakMap,Mr=new WeakMap,kr=new WeakMap,Sr=new WeakMap,Rr=new WeakMap,Cr=new WeakMap;var Or,Wr,Vr,Br,$r,Hr,Fr,Gr,qr,Kr,Qr,jr,Yr,Zr,zr,Xr,Jr,eo,to,io,no,ao,so,ro,oo,lo,co=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},ho=(e,t,i)=>(co(e,t,"read from private field"),i?i.call(e):t.get(e)),uo=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},mo=(e,t,i,n)=>(co(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),po=(e,t,i)=>(co(e,t,"access private method"),i);const Eo=te.createElement("template");Eo.innerHTML=`\n \n \n \n \n \n \n
\n`;const vo=(e,t=e.mediaCurrentTime)=>{const i=Number.isFinite(e.mediaSeekableStart)?e.mediaSeekableStart:0,n=Number.isFinite(e.mediaDuration)?e.mediaDuration:e.mediaSeekableEnd;if(Number.isNaN(n))return 0;const a=(t-i)/(n-i);return Math.max(0,Math.min(a,1))},bo=(e,t=e.range.valueAsNumber)=>{const i=Number.isFinite(e.mediaSeekableStart)?e.mediaSeekableStart:0,n=Number.isFinite(e.mediaDuration)?e.mediaDuration:e.mediaSeekableEnd;return Number.isNaN(n)?0:t*(n-i)+i};class go extends ga{constructor(){super(),uo(this,Kr),uo(this,jr),uo(this,zr),uo(this,Jr),uo(this,to),uo(this,no),uo(this,so),uo(this,oo),uo(this,Or,void 0),uo(this,Wr,void 0),uo(this,Vr,void 0),uo(this,Br,void 0),uo(this,$r,void 0),uo(this,Hr,void 0),uo(this,Fr,void 0),uo(this,Gr,void 0),uo(this,qr,void 0),uo(this,Zr,(e=>{this.dragging||(B(e)&&(this.range.valueAsNumber=e),this.updateBar())})),this.container.appendChild(Eo.content.cloneNode(!0));this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",''),mo(this,Vr,this.shadowRoot.querySelectorAll('[part~="box"]')),mo(this,$r,this.shadowRoot.querySelector('[part~="preview-box"]')),mo(this,Hr,this.shadowRoot.querySelector('[part~="current-box"]'));const e=getComputedStyle(this);mo(this,Fr,parseInt(e.getPropertyValue("--media-box-padding-left"))),mo(this,Gr,parseInt(e.getPropertyValue("--media-box-padding-right"))),mo(this,Wr,new Pr(this.range,ho(this,Zr),60))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_DURATION,a.MEDIA_SEEKABLE,a.MEDIA_CURRENT_TIME,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_TIME,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_BUFFERED,a.MEDIA_PLAYBACK_RATE,a.MEDIA_LOADING,a.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",U.SEEK()),po(this,Kr,Qr).call(this),mo(this,Or,this.getRootNode()),null==(e=ho(this,Or))||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),po(this,Kr,Qr).call(this),null==(e=ho(this,Or))||e.removeEventListener("transitionstart",this),mo(this,Or,null)}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),t!=i&&(e===a.MEDIA_CURRENT_TIME||e===a.MEDIA_PAUSED||e===a.MEDIA_ENDED||e===a.MEDIA_LOADING||e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE?(ho(this,Wr).update({start:vo(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),po(this,Kr,Qr).call(this),(e=>{const t=e.range,i=F(+bo(e)),n=F(+e.mediaSeekableEnd),a=i&&n?`${i} of ${n}`:"video not loaded, unknown time.";t.setAttribute("aria-valuetext",a)})(this)):e===a.MEDIA_BUFFERED&&this.updateBufferedBar(),e!==a.MEDIA_DURATION&&e!==a.MEDIA_SEEKABLE||(this.mediaChaptersCues=ho(this,qr),this.updateBar()))}get mediaChaptersCues(){return ho(this,qr)}set mediaChaptersCues(e){var t;mo(this,qr,e),this.updateSegments(null==(t=ho(this,qr))?void 0:t.map((e=>({start:vo(this,e.startTime),end:vo(this,e.endTime)}))))}get mediaPaused(){return ge(this,a.MEDIA_PAUSED)}set mediaPaused(e){Ae(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return ge(this,a.MEDIA_LOADING)}set mediaLoading(e){Ae(this,a.MEDIA_LOADING,e)}get mediaDuration(){return ve(this,a.MEDIA_DURATION)}set mediaDuration(e){be(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return ve(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){be(this,a.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return ve(this,a.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){be(this,a.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){const e=this.getAttribute(a.MEDIA_BUFFERED);return e?e.split(" ").map((e=>e.split(":").map((e=>+e)))):[]}set mediaBuffered(e){if(!e)return void this.removeAttribute(a.MEDIA_BUFFERED);const t=e.map((e=>e.join(":"))).join(" ");this.setAttribute(a.MEDIA_BUFFERED,t)}get mediaSeekable(){const e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map((e=>+e))}set mediaSeekable(e){null!=e?this.setAttribute(a.MEDIA_SEEKABLE,e.join(":")):this.removeAttribute(a.MEDIA_SEEKABLE)}get mediaSeekableEnd(){var e;const[,t=this.mediaDuration]=null!=(e=this.mediaSeekable)?e:[];return t}get mediaSeekableStart(){var e;const[t=0]=null!=(e=this.mediaSeekable)?e:[];return t}get mediaPreviewImage(){return Ie(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){fe(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return ve(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){be(this,a.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return ge(this,a.MEDIA_ENDED)}set mediaEnded(e){Ae(this,a.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;const t=this.mediaBuffered;if(!t.length)return;let i;if(this.mediaEnded)i=1;else{const n=this.mediaCurrentTime,[,a=this.mediaSeekableStart]=null!=(e=t.find((([e,t])=>e<=n&&n<=t)))?e:[];i=vo(this,a)}const{style:n}=Ee(this.shadowRoot,"#buffered");n.setProperty("width",100*i+"%")}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;const e=Ee(this.shadowRoot,"#current-rail"),t=Ee(this.shadowRoot,'[part~="current-box"]'),i=po(this,zr,Xr).call(this,ho(this,Hr)),n=po(this,Jr,eo).call(this,i,this.range.valueAsNumber),a=po(this,to,io).call(this,i,this.range.valueAsNumber);e.style.transform=`translateX(${n})`,e.style.setProperty("--_range-width",`${i.range.width}`),t.style.setProperty("--_box-shift",`${a}`),t.style.setProperty("--_box-width",`${i.box.width}px`),t.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":po(this,oo,lo).call(this);break;case"pointermove":po(this,no,ao).call(this,e);break;case"pointerup":case"pointerleave":po(this,so,ro).call(this,null);break;case"transitionstart":ce(e.target,this)&&setTimeout((()=>po(this,Kr,Qr).call(this)),0)}}}Or=new WeakMap,Wr=new WeakMap,Vr=new WeakMap,Br=new WeakMap,$r=new WeakMap,Hr=new WeakMap,Fr=new WeakMap,Gr=new WeakMap,qr=new WeakMap,Kr=new WeakSet,Qr=function(){po(this,jr,Yr).call(this)?ho(this,Wr).start():ho(this,Wr).stop()},jr=new WeakSet,Yr=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&me(this)},Zr=new WeakMap,zr=new WeakSet,Xr=function(e){var t;const i=(null!=(t=this.getAttribute("bounds")?he(this,`#${this.getAttribute("bounds")}`):this.parentElement)?t:this).getBoundingClientRect(),n=this.range.getBoundingClientRect(),a=e.offsetWidth;return{box:{width:a,min:-(n.left-i.left-a/2),max:i.right-n.left-a/2},bounds:i,range:n}},Jr=new WeakSet,eo=function(e,t){let i=100*t+"%";const{width:n,min:a,max:s}=e.box;if(!n)return i;if(!Number.isNaN(a)){i=`max(${`calc(1 / var(--_range-width) * 100 * ${a}% + ${"var(--media-box-padding-left)"})`}, ${i})`}if(!Number.isNaN(s)){i=`min(${i}, ${`calc(1 / var(--_range-width) * 100 * ${s}% - ${"var(--media-box-padding-right)"})`})`}return i},to=new WeakSet,io=function(e,t){const{width:i,min:n,max:a}=e.box,s=t*e.range.width;if(sa-ho(this,Gr)){return s+i/2-(e.bounds.right-e.range.right-ho(this,Gr))-e.range.width+"px"}return 0},no=new WeakSet,ao=function(e){const t=[...ho(this,Vr)].some((t=>e.composedPath().includes(t)));if(!this.dragging&&(t||!e.composedPath().includes(this)))return void po(this,so,ro).call(this,null);const i=this.mediaSeekableEnd;if(!i)return;const n=Ee(this.shadowRoot,"#preview-rail"),a=Ee(this.shadowRoot,'[part~="preview-box"]'),s=po(this,zr,Xr).call(this,ho(this,$r));let r=(e.clientX-s.range.left)/s.range.width;r=Math.max(0,Math.min(1,r));const o=po(this,Jr,eo).call(this,s,r),l=po(this,to,io).call(this,s,r);n.style.transform=`translateX(${o})`,n.style.setProperty("--_range-width",`${s.range.width}`),a.style.setProperty("--_box-shift",`${l}`),a.style.setProperty("--_box-width",`${s.box.width}px`);const d=Math.round(ho(this,Br))-Math.round(r*i);Math.abs(d)<1&&r>.01&&r<.99||(mo(this,Br,r*i),po(this,so,ro).call(this,ho(this,Br)))},so=new WeakSet,ro=function(t){this.dispatchEvent(new ee.CustomEvent(e.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))},oo=new WeakSet,lo=function(){ho(this,Wr).stop();const t=bo(this);this.dispatchEvent(new ee.CustomEvent(e.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))},ee.customElements.get("media-time-range")||ee.customElements.define("media-time-range",go);var Ao=go;const Io="placement",fo="bounds",_o=te.createElement("template");_o.innerHTML='\n \n \n \n';class wo extends ee.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!me(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;const t=this.placement;if("left"===t||"right"===t)return void this.style.removeProperty("--media-tooltip-offset-x");const i=getComputedStyle(this),n=null!=(e=he(this,"#"+this.bounds))?e:oe(this);if(!n)return;const{x:a,width:s}=n.getBoundingClientRect(),{x:r,width:o}=this.getBoundingClientRect(),l=r+o,d=a+s,c=i.getPropertyValue("--media-tooltip-offset-x"),h=c?parseFloat(c.replace("px","")):0,u=i.getPropertyValue("--media-tooltip-container-margin"),m=u?parseFloat(u.replace("px","")):0,p=r-a+h-m,E=l-d+h+m;p<0?this.style.setProperty("--media-tooltip-offset-x",`${p}px`):E>0?this.style.setProperty("--media-tooltip-offset-x",`${E}px`):this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(_o.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){const e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Io,fo]}get placement(){return Ie(this,Io)}set placement(e){fe(this,Io,e)}get bounds(){return Ie(this,fo)}set bounds(e){fe(this,fo,e)}}ee.customElements.get("media-tooltip")||ee.customElements.define("media-tooltip",wo);var yo=wo;class To extends ga{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME,a.MEDIA_MUTED,a.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",(()=>{const t=this.range.value,i=new ee.CustomEvent(e.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(i)}))}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",U.VOLUME())}attributeChangedCallback(e,t,i){var n,s;super.attributeChangedCallback(e,t,i),e!==a.MEDIA_VOLUME&&e!==a.MEDIA_MUTED||(this.range.valueAsNumber=(s=this).mediaMuted?0:s.mediaVolume,this.range.setAttribute("aria-valuetext",(n=this.range.valueAsNumber,`${Math.round(100*n)}%`)),this.updateBar())}get mediaVolume(){return ve(this,a.MEDIA_VOLUME,1)}set mediaVolume(e){be(this,a.MEDIA_VOLUME,e)}get mediaMuted(){return ge(this,a.MEDIA_MUTED)}set mediaMuted(e){Ae(this,a.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return Ie(this,a.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){fe(this,a.MEDIA_VOLUME_UNAVAILABLE,e)}}ee.customElements.get("media-volume-range")||ee.customElements.define("media-volume-range",To);var Mo=To;export{an as MediaAirplayButton,hn as MediaCaptionsButton,Ln as MediaCastButton,zi as MediaChromeButton,ha as MediaChromeDialog,Ia as MediaChromeRange,ka as MediaControlBar,Fi as MediaController,Wa as MediaDurationDisplay,Fa as MediaErrorDialog,ja as MediaFullscreenButton,Qe as MediaGestureReceiver,as as MediaLiveButton,us as MediaLoadingIndicator,As as MediaMuteButton,Ms as MediaPipButton,Os as MediaPlayButton,Ds as MediaPlaybackRateButton,Fs as MediaPosterImage,Qs as MediaPreviewChapterDisplay,er as MediaPreviewThumbnail,ar as MediaPreviewTimeDisplay,lr as MediaSeekBackwardButton,mr as MediaSeekForwardButton,Lr as MediaTimeDisplay,Ao as MediaTimeRange,yo as MediaTooltip,Mo as MediaVolumeRange,p as constants,O as labels,K as timeUtils};export default null;
//# sourceMappingURL=/sm/f8b1664cb26f7b69c10db46dba0fca3991efd82e4c0a93b1afbe888d61cbaef3.map