@broadcastingplatforms/player 1.5.8 → 1.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bp-player.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * BP Player (v1.5.8)
2
+ * BP Player (v1.5.10)
3
3
  * Universal video player web component
4
4
  */
5
- "use strict";var BPPlayer=(()=>{var Dv=Object.create;var Dr=Object.defineProperty;var eh=Object.getOwnPropertyDescriptor;var Ov=Object.getOwnPropertyNames;var th=Object.getPrototypeOf,Nv=Object.prototype.hasOwnProperty;var Uv=Reflect.get;var ih=i=>{throw TypeError(i)};var Hv=(i,e,t)=>e in i?Dr(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var rh=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var $v=(i,e)=>{for(var t in e)Dr(i,t,{get:e[t],enumerable:!0})},nh=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ov(e))!Nv.call(i,n)&&n!==t&&Dr(i,n,{get:()=>e[n],enumerable:!(r=eh(e,n))||r.enumerable});return i};var Vv=(i,e,t)=>(t=i!=null?Dv(th(i)):{},nh(e||!i||!i.__esModule?Dr(t,"default",{value:i,enumerable:!0}):t,i)),Bv=i=>nh(Dr({},"__esModule",{value:!0}),i),B=(i,e,t,r)=>{for(var n=r>1?void 0:r?eh(e,t):e,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&Dr(e,t,n),n};var G=(i,e,t)=>Hv(i,typeof e!="symbol"?e+"":e,t),cd=(i,e,t)=>e.has(i)||ih("Cannot "+t);var c=(i,e,t)=>(cd(i,e,"read from private field"),t?t.call(i):e.get(i)),k=(i,e,t)=>e.has(i)?ih("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),m=(i,e,t,r)=>(cd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),C=(i,e,t)=>(cd(i,e,"access private method"),t);var ud=(i,e,t)=>Uv(th(i),t,e);var Fb={};$v(Fb,{Attribute:()=>_o,BPDefaultUI:()=>de,BPErrorDisplay:()=>Yt,BPLiveError:()=>st,BPLiveService:()=>Ur,BPOverlay:()=>Vt,BPPlayer:()=>Me,HLS_ERROR_CODES:()=>Xe,Hls:()=>be.default,HlsVideo:()=>Ni,HlsVideoElement:()=>Cu,LiveKitVideo:()=>Mr,LiveKitVideoElement:()=>Du,NANOPLAYER_NO_REPLAY_CODES:()=>Ah,NanoVideo:()=>Vi,NanoVideoElement:()=>Mu,StateReceiverMixin:()=>Lh,StateReceiverProps:()=>zi,addGlobalStyles:()=>Hr,classifyHlsError:()=>qs,classifyLiveKitError:()=>Ks,classifyNanoPlayerError:()=>Fs,createInitialState:()=>po,createPlayerCore:()=>zs,createTemplate:()=>Rh,forEachStateReceiverElement:()=>Yi,isBPLiveClipSource:()=>vo,isBPLiveSource:()=>Gs,isBPLiveStreamSource:()=>mo,isStateReceiverElement:()=>Ys,propagateStateToReceiver:()=>go,removeStateFromReceiver:()=>bo,templateWithStyles:()=>Mh,toggleAttribute:()=>_e});var Hs=globalThis,$s=Hs.ShadowRoot&&(Hs.ShadyCSS===void 0||Hs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hd=Symbol(),oh=new WeakMap,io=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==hd)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if($s&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=oh.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&oh.set(t,e))}return e}toString(){return this.cssText}},sh=i=>new io(typeof i=="string"?i:i+"",void 0,hd),ro=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1],i[0]);return new io(t,i,hd)},ah=(i,e)=>{if($s)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=Hs.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},pd=$s?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return sh(t)})(i):i;var{is:Wv,defineProperty:Fv,getOwnPropertyDescriptor:Kv,getOwnPropertyNames:qv,getOwnPropertySymbols:Gv,getPrototypeOf:zv}=Object,ri=globalThis,lh=ri.trustedTypes,Yv=lh?lh.emptyScript:"",md=ri.reactiveElementPolyfillSupport,no=(i,e)=>i,oo={toAttribute(i,e){switch(e){case Boolean:i=i?Yv:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Vs=(i,e)=>!Wv(i,e),dh={attribute:!0,type:String,converter:oo,reflect:!1,useDefault:!1,hasChanged:Vs};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ri.litPropertyMetadata??(ri.litPropertyMetadata=new WeakMap);var Bt=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=dh){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Fv(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:o}=Kv(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:n,set(s){let l=n==null?void 0:n.call(this);o==null||o.call(this,s),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??dh}static _$Ei(){if(this.hasOwnProperty(no("elementProperties")))return;let e=zv(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(no("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(no("properties"))){let t=this.properties,r=[...qv(t),...Gv(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(pd(n))}else e!==void 0&&t.push(pd(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ah(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var o;let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let s=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:oo).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){var o,s;let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let l=r.getPropertyOptions(n),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((o=l.converter)==null?void 0:o.fromAttribute)!==void 0?l.converter:oo;this._$Em=n;let h=d.fromAttribute(t,l.type);this[n]=h??((s=this._$Ej)==null?void 0:s.get(n))??h,this._$Em=null}}requestUpdate(e,t,r,n=!1,o){var s;if(e!==void 0){let l=this.constructor;if(n===!1&&(o=this[e]),r??(r=l.getPropertyOptions(e)),!((r.hasChanged??Vs)(o,t)||r.useDefault&&r.reflect&&o===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:o},s){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,s??t??this[e]),o!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[o,s]of n){let{wrapped:l}=s,d=this[o];l!==!0||this._$AL.has(o)||d===void 0||this.C(o,void 0,s,d)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var n;return(n=r.hostUpdated)==null?void 0:n.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Bt.elementStyles=[],Bt.shadowRootOptions={mode:"open"},Bt[no("elementProperties")]=new Map,Bt[no("finalized")]=new Map,md==null||md({ReactiveElement:Bt}),(ri.reactiveElementVersions??(ri.reactiveElementVersions=[])).push("2.1.2");var ao=globalThis,ch=i=>i,Bs=ao.trustedTypes,uh=Bs?Bs.createPolicy("lit-html",{createHTML:i=>i}):void 0,Eh="$lit$",ni=`lit$${Math.random().toFixed(9).slice(2)}$`,gh="?"+ni,Qv=`<${gh}>`,Ki=document,lo=()=>Ki.createComment(""),co=i=>i===null||typeof i!="object"&&typeof i!="function",Td=Array.isArray,Zv=i=>Td(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",vd=`[
5
+ "use strict";var BPPlayer=(()=>{var Ov=Object.create;var Dr=Object.defineProperty;var eh=Object.getOwnPropertyDescriptor;var Nv=Object.getOwnPropertyNames;var th=Object.getPrototypeOf,Uv=Object.prototype.hasOwnProperty;var Hv=Reflect.get;var ih=i=>{throw TypeError(i)};var $v=(i,e,t)=>e in i?Dr(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var rh=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var Vv=(i,e)=>{for(var t in e)Dr(i,t,{get:e[t],enumerable:!0})},nh=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Nv(e))!Uv.call(i,n)&&n!==t&&Dr(i,n,{get:()=>e[n],enumerable:!(r=eh(e,n))||r.enumerable});return i};var Bv=(i,e,t)=>(t=i!=null?Ov(th(i)):{},nh(e||!i||!i.__esModule?Dr(t,"default",{value:i,enumerable:!0}):t,i)),Wv=i=>nh(Dr({},"__esModule",{value:!0}),i),B=(i,e,t,r)=>{for(var n=r>1?void 0:r?eh(e,t):e,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&Dr(e,t,n),n};var G=(i,e,t)=>$v(i,typeof e!="symbol"?e+"":e,t),cd=(i,e,t)=>e.has(i)||ih("Cannot "+t);var c=(i,e,t)=>(cd(i,e,"read from private field"),t?t.call(i):e.get(i)),k=(i,e,t)=>e.has(i)?ih("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),m=(i,e,t,r)=>(cd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),C=(i,e,t)=>(cd(i,e,"access private method"),t);var ud=(i,e,t)=>Hv(th(i),t,e);var Kb={};Vv(Kb,{Attribute:()=>_o,BPDefaultUI:()=>de,BPErrorDisplay:()=>Yt,BPLiveError:()=>st,BPLiveService:()=>Ur,BPOverlay:()=>Vt,BPPlayer:()=>Me,HLS_ERROR_CODES:()=>Xe,Hls:()=>be.default,HlsVideo:()=>Ni,HlsVideoElement:()=>Cu,LiveKitVideo:()=>Mr,LiveKitVideoElement:()=>Du,NANOPLAYER_NO_REPLAY_CODES:()=>Ah,NanoVideo:()=>Vi,NanoVideoElement:()=>Mu,StateReceiverMixin:()=>Lh,StateReceiverProps:()=>zi,addGlobalStyles:()=>Hr,classifyHlsError:()=>qs,classifyLiveKitError:()=>Ks,classifyNanoPlayerError:()=>Fs,createInitialState:()=>po,createPlayerCore:()=>zs,createTemplate:()=>Rh,forEachStateReceiverElement:()=>Yi,isBPLiveClipSource:()=>vo,isBPLiveSource:()=>Gs,isBPLiveStreamSource:()=>mo,isStateReceiverElement:()=>Ys,propagateStateToReceiver:()=>go,removeStateFromReceiver:()=>bo,templateWithStyles:()=>Mh,toggleAttribute:()=>_e});var Hs=globalThis,$s=Hs.ShadowRoot&&(Hs.ShadyCSS===void 0||Hs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hd=Symbol(),oh=new WeakMap,io=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==hd)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if($s&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=oh.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&oh.set(t,e))}return e}toString(){return this.cssText}},sh=i=>new io(typeof i=="string"?i:i+"",void 0,hd),ro=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1],i[0]);return new io(t,i,hd)},ah=(i,e)=>{if($s)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=Hs.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},pd=$s?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return sh(t)})(i):i;var{is:Fv,defineProperty:Kv,getOwnPropertyDescriptor:qv,getOwnPropertyNames:Gv,getOwnPropertySymbols:zv,getPrototypeOf:Yv}=Object,ri=globalThis,lh=ri.trustedTypes,Qv=lh?lh.emptyScript:"",md=ri.reactiveElementPolyfillSupport,no=(i,e)=>i,oo={toAttribute(i,e){switch(e){case Boolean:i=i?Qv:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Vs=(i,e)=>!Fv(i,e),dh={attribute:!0,type:String,converter:oo,reflect:!1,useDefault:!1,hasChanged:Vs};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ri.litPropertyMetadata??(ri.litPropertyMetadata=new WeakMap);var Bt=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=dh){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Kv(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:o}=qv(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:n,set(s){let l=n==null?void 0:n.call(this);o==null||o.call(this,s),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??dh}static _$Ei(){if(this.hasOwnProperty(no("elementProperties")))return;let e=Yv(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(no("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(no("properties"))){let t=this.properties,r=[...Gv(t),...zv(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(pd(n))}else e!==void 0&&t.push(pd(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ah(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var o;let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let s=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:oo).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){var o,s;let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let l=r.getPropertyOptions(n),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((o=l.converter)==null?void 0:o.fromAttribute)!==void 0?l.converter:oo;this._$Em=n;let h=d.fromAttribute(t,l.type);this[n]=h??((s=this._$Ej)==null?void 0:s.get(n))??h,this._$Em=null}}requestUpdate(e,t,r,n=!1,o){var s;if(e!==void 0){let l=this.constructor;if(n===!1&&(o=this[e]),r??(r=l.getPropertyOptions(e)),!((r.hasChanged??Vs)(o,t)||r.useDefault&&r.reflect&&o===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:o},s){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,s??t??this[e]),o!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[o,s]of n){let{wrapped:l}=s,d=this[o];l!==!0||this._$AL.has(o)||d===void 0||this.C(o,void 0,s,d)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var n;return(n=r.hostUpdated)==null?void 0:n.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Bt.elementStyles=[],Bt.shadowRootOptions={mode:"open"},Bt[no("elementProperties")]=new Map,Bt[no("finalized")]=new Map,md==null||md({ReactiveElement:Bt}),(ri.reactiveElementVersions??(ri.reactiveElementVersions=[])).push("2.1.2");var ao=globalThis,ch=i=>i,Bs=ao.trustedTypes,uh=Bs?Bs.createPolicy("lit-html",{createHTML:i=>i}):void 0,Eh="$lit$",ni=`lit$${Math.random().toFixed(9).slice(2)}$`,gh="?"+ni,Zv=`<${gh}>`,Ki=document,lo=()=>Ki.createComment(""),co=i=>i===null||typeof i!="object"&&typeof i!="function",Td=Array.isArray,Xv=i=>Td(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",vd=`[
6
6
  \f\r]`,so=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,hh=/-->/g,ph=/>/g,Wi=RegExp(`>|${vd}(?:([^\\s"'>=/]+)(${vd}*=${vd}*(?:[^
7
- \f\r"'\`<>=]|("|')|))|$)`,"g"),mh=/'/g,vh=/"/g,bh=/^(?:script|style|textarea|title)$/i,Ad=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ze=Ad(1),Zb=Ad(2),Xb=Ad(3),qi=Symbol.for("lit-noChange"),Ae=Symbol.for("lit-nothing"),fh=new WeakMap,Fi=Ki.createTreeWalker(Ki,129);function _h(i,e){if(!Td(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return uh!==void 0?uh.createHTML(e):e}var Xv=(i,e)=>{let t=i.length-1,r=[],n,o=e===2?"<svg>":e===3?"<math>":"",s=so;for(let l=0;l<t;l++){let d=i[l],h,p,g=-1,f=0;for(;f<d.length&&(s.lastIndex=f,p=s.exec(d),p!==null);)f=s.lastIndex,s===so?p[1]==="!--"?s=hh:p[1]!==void 0?s=ph:p[2]!==void 0?(bh.test(p[2])&&(n=RegExp("</"+p[2],"g")),s=Wi):p[3]!==void 0&&(s=Wi):s===Wi?p[0]===">"?(s=n??so,g=-1):p[1]===void 0?g=-2:(g=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?Wi:p[3]==='"'?vh:mh):s===vh||s===mh?s=Wi:s===hh||s===ph?s=so:(s=Wi,n=void 0);let E=s===Wi&&i[l+1].startsWith("/>")?" ":"";o+=s===so?d+Qv:g>=0?(r.push(h),d.slice(0,g)+Eh+d.slice(g)+ni+E):d+ni+(g===-2?l:E)}return[_h(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},uo=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,s=0,l=e.length-1,d=this.parts,[h,p]=Xv(e,t);if(this.el=i.createElement(h,r),Fi.currentNode=this.el.content,t===2||t===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(n=Fi.nextNode())!==null&&d.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let g of n.getAttributeNames())if(g.endsWith(Eh)){let f=p[s++],E=n.getAttribute(g).split(ni),T=/([.?@])?(.*)/.exec(f);d.push({type:1,index:o,name:T[2],strings:E,ctor:T[1]==="."?gd:T[1]==="?"?bd:T[1]==="@"?_d:Nr}),n.removeAttribute(g)}else g.startsWith(ni)&&(d.push({type:6,index:o}),n.removeAttribute(g));if(bh.test(n.tagName)){let g=n.textContent.split(ni),f=g.length-1;if(f>0){n.textContent=Bs?Bs.emptyScript:"";for(let E=0;E<f;E++)n.append(g[E],lo()),Fi.nextNode(),d.push({type:2,index:++o});n.append(g[f],lo())}}}else if(n.nodeType===8)if(n.data===gh)d.push({type:2,index:o});else{let g=-1;for(;(g=n.data.indexOf(ni,g+1))!==-1;)d.push({type:7,index:o}),g+=ni.length-1}o++}}static createElement(e,t){let r=Ki.createElement("template");return r.innerHTML=e,r}};function Or(i,e,t=i,r){var s,l;if(e===qi)return e;let n=r!==void 0?(s=t._$Co)==null?void 0:s[r]:t._$Cl,o=co(e)?void 0:e._$litDirective$;return(n==null?void 0:n.constructor)!==o&&((l=n==null?void 0:n._$AO)==null||l.call(n,!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=n:t._$Cl=n),n!==void 0&&(e=Or(i,n._$AS(i,e.values),n,r)),e}var Ed=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,n=((e==null?void 0:e.creationScope)??Ki).importNode(t,!0);Fi.currentNode=n;let o=Fi.nextNode(),s=0,l=0,d=r[0];for(;d!==void 0;){if(s===d.index){let h;d.type===2?h=new ho(o,o.nextSibling,this,e):d.type===1?h=new d.ctor(o,d.name,d.strings,this,e):d.type===6&&(h=new yd(o,this,e)),this._$AV.push(h),d=r[++l]}s!==(d==null?void 0:d.index)&&(o=Fi.nextNode(),s++)}return Fi.currentNode=Ki,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},ho=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=Ae,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Or(this,e,t),co(e)?e===Ae||e==null||e===""?(this._$AH!==Ae&&this._$AR(),this._$AH=Ae):e!==this._$AH&&e!==qi&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Zv(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Ae&&co(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ki.createTextNode(e)),this._$AH=e}$(e){var o;let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=uo.createElement(_h(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===n)this._$AH.p(t);else{let s=new Ed(n,this),l=s.u(this.options);s.p(t),this.T(l),this._$AH=s}}_$AC(e){let t=fh.get(e.strings);return t===void 0&&fh.set(e.strings,t=new uo(e)),t}k(e){Td(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let o of e)n===t.length?t.push(r=new i(this.O(lo()),this.O(lo()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let n=ch(e).nextSibling;ch(e).remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Nr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=Ae,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Ae}_$AI(e,t=this,r,n){let o=this.strings,s=!1;if(o===void 0)e=Or(this,e,t,0),s=!co(e)||e!==this._$AH&&e!==qi,s&&(this._$AH=e);else{let l=e,d,h;for(e=o[0],d=0;d<o.length-1;d++)h=Or(this,l[r+d],t,d),h===qi&&(h=this._$AH[d]),s||(s=!co(h)||h!==this._$AH[d]),h===Ae?e=Ae:e!==Ae&&(e+=(h??"")+o[d+1]),this._$AH[d]=h}s&&!n&&this.j(e)}j(e){e===Ae?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},gd=class extends Nr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ae?void 0:e}},bd=class extends Nr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Ae)}},_d=class extends Nr{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=Or(this,e,t,0)??Ae)===qi)return;let r=this._$AH,n=e===Ae&&r!==Ae||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==Ae&&(r===Ae||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},yd=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Or(this,e)}};var fd=ao.litHtmlPolyfillSupport;fd==null||fd(uo,ho),(ao.litHtmlVersions??(ao.litHtmlVersions=[])).push("3.3.2");var yh=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,n=r._$litPart$;if(n===void 0){let o=(t==null?void 0:t.renderBefore)??null;r._$litPart$=n=new ho(e.insertBefore(lo(),o),o,void 0,t??{})}return n._$AI(i),n};var Gi=globalThis,Oe=class extends Bt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;let e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=yh(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return qi}},Th;Oe._$litElement$=!0,Oe.finalized=!0,(Th=Gi.litElementHydrateSupport)==null||Th.call(Gi,{LitElement:Oe});var Sd=Gi.litElementPolyfillSupport;Sd==null||Sd({LitElement:Oe});(Gi.litElementVersions??(Gi.litElementVersions=[])).push("4.2.2");var oi=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var jv={attribute:!0,type:String,converter:oo,reflect:!1,hasChanged:Vs},Jv=(i=jv,e,t)=>{let{kind:r,metadata:n}=t,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(t.name,i),r==="accessor"){let{name:s}=t;return{set(l){let d=e.get.call(this);e.set.call(this,l),this.requestUpdate(s,d,i,!0,l)},init(l){return l!==void 0&&this.C(s,void 0,i,l),l}}}if(r==="setter"){let{name:s}=t;return function(l){let d=this[s];e.call(this,l),this.requestUpdate(s,d,i,!0,l)}}throw Error("Unsupported decorator location: "+r)};function Z(i){return(e,t)=>typeof t=="object"?Jv(i,e,t):((r,n,o)=>{let s=n.hasOwnProperty(o);return n.constructor.createProperty(o,r),s?Object.getOwnPropertyDescriptor(n,o):void 0})(i,e,t)}function si(i){return Z({...i,state:!0,attribute:!1})}var Ah=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Fs(i){return i===1005||i===1007||i===1009?"autoplay":i>=2001&&i<=2004?"offline":i>=3e3&&i<=3999?"media":i>=4900&&i<=4999?"security":i>=4e3&&i<=4899?"network":i>=5e3&&i<=5999?"setup":i>=1e3&&i<=1999?"media":"unknown"}function Ks(i){return i===4e3||i===4001?"network":"unknown"}var Xe={network:6001,media:6002,keySystem:6003,other:6004,auth:6005};function qs(i){switch(i){case Xe.network:return"network";case Xe.media:return"media";case Xe.keySystem:case Xe.auth:return"security";default:return"unknown"}}function po(){return{paused:!0,playing:!1,ended:!1,seeking:!1,waiting:!1,currentTime:0,duration:NaN,buffered:null,volume:1,muted:!1,loop:!1,playbackRate:1,readyState:0,videoWidth:0,videoHeight:0,qualities:[],currentQuality:null,targetQuality:null,fullscreen:!1,presentationMode:"inline",providerType:null,connectionState:"idle",streamType:"vod",contentType:"video",error:null}}function mo(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function vo(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function Gs(i){return mo(i)||vo(i)}var st=class extends Error{constructor(t,r,n){super(t);this.code=r;this.status=n;this.name="BPLiveError"}},Ur=class{constructor(e,t){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null,this._network=t??null}get config(){return this._config}get authToken(){return this._authToken}get stream(){return this._stream}get clip(){return this._clip}async fetch(e){if(!this._authToken)throw new st("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r={"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`};if(this._network){let s=await this._network.intercept({url:t,method:"GET",type:"api",headers:r});if(s.response)return s.response.body;t=s.url,r=s.headers}let n=new AbortController,o=setTimeout(()=>n.abort(),3e4);try{let s=await fetch(t,{method:"GET",headers:r,signal:n.signal});if(!s.ok)throw new st(`HTTP ${s.status}: ${s.statusText}`,"HTTP_ERROR",s.status);let l=await s.json();return this._network&&(l=(await this._network.interceptResponse({url:t,status:s.status,headers:Object.fromEntries(s.headers),body:l})).body),l}catch(s){throw s instanceof Error&&s.name==="AbortError"?new st("Request timeout after 30s","TIMEOUT"):s}finally{clearTimeout(o)}}async getStream(e){return this.fetch(`/streams/${e}`)}async getClip(e){return this.fetch(`/clips/${e}`)}mapPlayerSourceToResolvedSource(e){if(e.provider==="livekit")return{type:"livekit",url:e.url,token:e.token,room:e.room};if(e.provider==="nanoplayer"){let{provider:t,...r}=e;return{type:"nano",source:r}}throw new st(`Unknown player source provider: ${e.provider}`,"UNKNOWN_PROVIDER")}selectClipMedia(e,t="landscape"){let r=e.filter(l=>l.type==="clip");if(r.length===0)return null;let n=r.find(l=>l.orientation===t);if(n)return n;let o=t==="landscape"?"portrait":"landscape",s=r.find(l=>l.orientation===o);return s||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,mo(e))return this.resolveStreamSource(e);if(vo(e))return this.resolveClipSource(e);throw new st("Invalid BPLive source","INVALID_SOURCE")}extractStreamPoster(e){var t;return e.cover_photo??((t=e.channel)==null?void 0:t.cover_image)??void 0}async resolveStreamSource(e){var l,d,h,p,g,f,E,T,v;let r=(await this.getStream(e.streamId)).data;this._stream=r;let n=this.extractStreamPoster(r);if(!!r.ended_at&&((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let S=r.media.vod[0];return{source:{type:"video",url:S.original},contentType:"video",poster:n??S.thumb??void 0,videoWidth:(h=S.dimension)==null?void 0:h.width,videoHeight:(p=S.dimension)==null?void 0:p.height}}let s=r.player_source??((g=r.active_stream)==null?void 0:g.player_source);if(s)return{source:this.mapPlayerSourceToResolvedSource(s),contentType:"stream",poster:n};if(((E=(f=r.media)==null?void 0:f.vod)==null?void 0:E.length)>0){let S=r.media.vod[0];return{source:{type:"video",url:S.original},contentType:"video",poster:n??S.thumb??void 0,videoWidth:(T=S.dimension)==null?void 0:T.width,videoHeight:(v=S.dimension)==null?void 0:v.height}}throw new st("Stream is not live and has no VOD content","STREAM_OFFLINE")}async resolveClipSource(e){let r=(await this.getClip(e.clipId)).data;this._clip=r;let n=this.selectClipMedia(r.media,e.preferredOrientation);if(!n)throw new st("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(n),contentType:"clip",poster:n.thumbnail??void 0,videoWidth:n.width,videoHeight:n.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function fo(i){return i!=null&&typeof i.then=="function"}function Sh(i){return new Promise((e,t)=>{let r=!1,n=o=>{r||(r=!0,o?t(o):e())};try{let o=i(n);fo(o)&&(r=!0,o.then(()=>e(),t))}catch(o){n(o)}})}var kd=class{constructor(e,t,r){this._closed=!1;this._pendingCount=0;this._firstError=null;this._redirectResult=null;this._responseResult=null;this.promise=new Promise((n,o)=>{this._resolve=n,this._reject=o}),this._state=e,this._interceptor=t,this._canModify=r,this._start()}get redirectResult(){return this._redirectResult}get responseResult(){return this._responseResult}get _open(){return this._canModify&&!this._closed}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());fo(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get method(){return e._state.method},get type(){return e._state.type},get headers(){return{...e._state.headers}},get closed(){return!e._open},redirect(t){e._redirect(t)},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_redirect(e){if(!this._open)throw new Error("Request is closed");let t=typeof e=="string"?{url:e}:e;this._redirectResult={url:t.url??this._state.url,method:t.method??this._state.method,type:this._state.type,headers:t.headers??{...this._state.headers}},this._close()}_respondWith(e){if(!this._open)throw new Error("Request is closed");this._responseResult=e,this._close()}_waitUntil(e){if(!this._open)throw new Error("Request is closed");fo(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(Sh(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},Ld=class{constructor(e,t){this._closed=!1;this._pendingCount=0;this._firstError=null;this._responseResult=null;this.promise=new Promise((r,n)=>{this._resolve=r,this._reject=n}),this._state=e,this._interceptor=t,this._start()}get responseResult(){return this._responseResult}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());fo(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get status(){return e._state.status},get headers(){return{...e._state.headers}},get body(){return e._state.body},get closed(){return e._closed},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_respondWith(e){if(this._closed)throw new Error("Response is closed");this._responseResult=e,this._close()}_waitUntil(e){if(this._closed)throw new Error("Response is closed");fo(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(Sh(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},Eo=class{constructor(){this._requestInterceptors=[];this._responseInterceptors=[]}addRequestInterceptor(e){this._requestInterceptors.unshift(e)}removeRequestInterceptor(e){let t=this._requestInterceptors.indexOf(e);t>=0&&this._requestInterceptors.splice(t,1)}addResponseInterceptor(e){this._responseInterceptors.unshift(e)}removeResponseInterceptor(e){let t=this._responseInterceptors.indexOf(e);t>=0&&this._responseInterceptors.splice(t,1)}async intercept(e){let t={...e,headers:{...e.headers}},r=!1,n=null;for(let o of this._requestInterceptors.slice()){let s=new kd(t,o,!r);try{await s.promise}catch{continue}s.responseResult&&!r&&(r=!0,n=s.responseResult),s.redirectResult&&!r&&(t=s.redirectResult)}return{url:t.url,headers:t.headers,response:n}}async interceptResponse(e){let t={...e,headers:{...e.headers}};for(let r of this._responseInterceptors.slice()){let n=new Ld(t,r);try{await n.promise}catch{continue}n.responseResult&&(t={...t,status:n.responseResult.status!==void 0?n.responseResult.status:t.status,headers:n.responseResult.headers!==void 0?n.responseResult.headers:t.headers,body:"body"in n.responseResult?n.responseResult.body:t.body})}return{status:t.status,headers:t.headers,body:t.body}}};function ef(i){if(typeof i=="string")return"video";switch(i.type){case"video":return"video";case"nano":return"nano";case"livekit":return"livekit";default:return"video"}}function kh(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var tf=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],wd=class{constructor(){this._mediaElement=null;this._container=null;this._webkitFullscreen=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._network=new Eo;this._currentProviderType=null;this._ready=!1;this._loadGeneration=0;this._attachedElementGeneration=0;this._state=po()}get state(){return this._state}get videoElement(){return this._mediaElement}get activeVideoElement(){let e=this._mediaElement;return(e==null?void 0:e.activeVideoElement)??null}get bpLive(){return this._bpLive}get network(){return this._network}get ready(){return this._ready}get providerType(){return this._currentProviderType}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r)this._listeners.has(n)||this._listeners.set(n,new Set),this._listeners.get(n).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r){let o=this._listeners.get(n);o&&(o.delete(t),o.size===0&&this._listeners.delete(n))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let n of r)try{n(t)}catch(o){console.error(`[PlayerCore] Error in event listener for "${e}":`,o)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}attach(e,t){this._destroyed||(this._container=e,this._config=t,this._ready=!0)}async loadSource(e,t,r){if(this._destroyed)return;let n=++this._loadGeneration,o=t??this._container,s=r??this._config;if(!o){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=o,s&&(this._config=s);let l=kh(e)?"clipId"in e?"clip":"stream":"video";this.updateState({error:null,connectionState:"connecting",ended:!1,contentType:l}),this.dispatch("sourcechange",{source:e});try{let d=e,h=l,p,g,f;if(kh(e)){if(s!=null&&s.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new Ur(s.bpLive,this._network)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let I=await this._bpLive.resolveSource(e);if(n!==this._loadGeneration)return;d=I.source,h=I.contentType,p=I.poster,g=I.videoWidth,f=I.videoHeight}else this._bpLive&&(this._bpLive.destroy(),this._bpLive=null);let E=ef(d),S=E==="nano"||E==="livekit"||h==="stream"?"live":"vod";return this._mediaElement&&this.destroyMediaElement(),this._state.targetQuality&&this.setTargetQuality(null),this._currentProviderType=E,this.updateState({providerType:E,contentType:h,streamType:S,error:null,paused:!0,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this._mediaElement=this.createMediaElement(E,d,s),this._mediaElement.style.width="100%",this._mediaElement.style.height="100%",this._state.muted&&(this._mediaElement.muted=!0),this._state.loop&&(this._mediaElement.loop=!0),this.attachMediaElementListeners(this._mediaElement),this.attachActiveVideoElementForwarding(this._mediaElement),o.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),this.dispatch("activevideoelementchange",{video:this.activeVideoElement}),{poster:p,videoWidth:g,videoHeight:f}}catch(d){if(n!==this._loadGeneration)return;this._attachedElementGeneration=this._loadGeneration,console.error("[PlayerCore] loadSource error:",d);let h={code:-1,message:d instanceof Error?d.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:h,connectionState:"failed"}),this.dispatch("error",h)}}destroyMediaElement(){if(this._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null,this.dispatch("emptied",void 0),this.dispatch("videoelementchange",{video:null}),this.dispatch("activevideoelementchange",{video:null})),this._container)for(;this._container.firstChild;)this._container.removeChild(this._container.firstChild)}createMediaElement(e,t,r){switch(e){case"nano":{let n=document.createElement("nano-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=t;return n.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",o.source?n.sourceConfig=o.source:o.streamid&&(n.streamid=o.streamid),r!=null&&r.nano&&(n.config=r.nano),n}case"livekit":{let n=document.createElement("livekit-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=t;return n.url=o.url,n.token=o.token,r!=null&&r.livekit&&(n.config=r.livekit),n}case"video":default:{let n=document.createElement("hls-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=typeof t=="string"?t:t.url;n.src=o;let s={...r==null?void 0:r.video},l=this._network,d=s.xhrSetup;return s.xhrSetup=async(h,p)=>{let g=p.includes(".m3u8")?"manifest":p.includes(".ts")||p.includes(".m4s")||p.includes(".fmp4")?"segment":"other",f=await l.intercept({url:p,method:"GET",type:g,headers:{}});f.url!==p&&h.open("GET",f.url,!0);for(let[E,T]of Object.entries(f.headers))h.setRequestHeader(E,T);d&&await d(h,f.url)},n.config=s,n}}}attachMediaElementListeners(e){this._attachedElementGeneration=this._loadGeneration;for(let t of tf){let r=n=>{t==="error"&&this._attachedElementGeneration!==this._loadGeneration||this.handleMediaEvent(t,e,n)};e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}attachActiveVideoElementForwarding(e){let t=r=>{let n=r.detail;this.dispatch("activevideoelementchange",{video:(n==null?void 0:n.video)??null})};e.addEventListener("activevideoelementchange",t),this._eventCleanup.push(()=>e.removeEventListener("activevideoelementchange",t))}handleMediaEvent(e,t,r){var n,o,s,l;switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:d}),this.dispatch("loadedmetadata",{duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight});break}case"loadeddata":this.updateState({readyState:2}),this.dispatch("loadeddata",void 0);break;case"canplay":this.updateState({readyState:3,connectionState:"connected"}),this.dispatch("canplay",void 0),this.dispatch("connectionstatechange",{state:"connected"});break;case"canplaythrough":this.updateState({readyState:4}),this.dispatch("canplaythrough",void 0);break;case"play":this.updateState({paused:!1,ended:!1}),this.dispatch("play",void 0);break;case"playing":this.updateState({error:null,paused:!1,playing:!0,ended:!1,waiting:!1,readyState:4}),this.dispatch("playing",void 0);break;case"pause":this.updateState({paused:!0,playing:!1,waiting:!1}),this.dispatch("pause",void 0);break;case"waiting":this.updateState({playing:!1,waiting:!0,readyState:2}),this.dispatch("waiting",void 0);break;case"seeking":this.updateState({seeking:!0,currentTime:t.currentTime}),this.dispatch("seeking",{currentTime:t.currentTime});break;case"seeked":this.updateState({seeking:!1,currentTime:t.currentTime}),this.dispatch("seeked",{currentTime:t.currentTime});break;case"timeupdate":this.updateState({currentTime:t.currentTime,duration:t.duration}),this.dispatch("timeupdate",{currentTime:t.currentTime,duration:t.duration});break;case"durationchange":{let d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:d}),this.dispatch("durationchange",{duration:t.duration}),this.dispatch("streamtypechange",{streamType:this._state.streamType});break}case"ratechange":this.updateState({playbackRate:t.playbackRate}),this.dispatch("ratechange",{playbackRate:t.playbackRate});break;case"volumechange":this.updateState({volume:t.volume,muted:t.muted}),this.dispatch("volumechange",{volume:t.volume,muted:t.muted});break;case"ended":this.updateState({ended:!0,paused:!0,playing:!1,waiting:!1}),this.dispatch("ended",void 0);break;case"progress":this.updateState({buffered:t.buffered}),this.dispatch("progress",{buffered:t.buffered});break;case"error":{let d=-1,h="Unknown error",p="none";r instanceof ErrorEvent&&r.error?(d=r.error.code??-1,h=r.error.message??r.message??"Unknown error",p="ErrorEvent"):t.error&&(d=t.error.code??-1,h=t.error.message??"Unknown error",p="element.error");let g=t.nativeEl;console.error("[PlayerCore] error event",{providerType:this._state.providerType,elementTag:t.tagName,eventTarget:(n=r.target)==null?void 0:n.tagName,source:p,code:d,message:h,eventIsErrorEvent:r instanceof ErrorEvent,eventErrorCode:r instanceof ErrorEvent?(o=r.error)==null?void 0:o.code:void 0,elementErrorCode:(s=t.error)==null?void 0:s.code,nativeElTag:g==null?void 0:g.tagName,nativeElErrorCode:(l=g==null?void 0:g.error)==null?void 0:l.code,nativeElSrc:g==null?void 0:g.currentSrc,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState});let f="media",E=!0;this._state.providerType==="nano"&&d>0?(f=Fs(d),E=f!=="offline"&&f!=="autoplay"):this._state.providerType==="livekit"&&d>0?(f=Ks(d),E=!0):this._state.providerType==="video"&&d>=6e3&&(f=qs(d),E=!0);let T={code:d,message:h,fatal:E,category:f};this.updateState({error:T}),this.dispatch("error",T);break}case"resize":t.videoWidth&&t.videoHeight&&(this.updateState({videoWidth:t.videoWidth,videoHeight:t.videoHeight}),this.dispatch("resize",{videoWidth:t.videoWidth,videoHeight:t.videoHeight}));break}}unloadSource(){this._loadGeneration++,this.destroyMediaElement(),this._currentProviderType=null,this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this.updateState({...po(),volume:this._state.volume,muted:this._state.muted,loop:this._state.loop,playbackRate:this._state.playbackRate}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1});try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this._mediaElement.pause())}seek(e){this._mediaElement&&(this._mediaElement.currentTime=e)}setVolume(e){let t=Math.max(0,Math.min(1,e));this.updateState({volume:t}),this._mediaElement&&(this._mediaElement.volume=t),this.dispatch("volumechange",{volume:t,muted:this._state.muted})}setMuted(e){this.updateState({muted:e}),this._mediaElement&&(this._mediaElement.muted=e),this.dispatch("volumechange",{volume:this._state.volume,muted:e})}setLoop(e){this.updateState({loop:e}),this._mediaElement&&(this._mediaElement.loop=e)}setPlaybackRate(e){this.updateState({playbackRate:e}),this._mediaElement&&(this._mediaElement.playbackRate=e),this.dispatch("ratechange",{playbackRate:e})}setTargetQuality(e){this.updateState({targetQuality:e}),this.dispatch("targetqualitychanged",{quality:e});let t=this._mediaElement;t!=null&&t.videoRenditions&&(t.videoRenditions.selectedIndex=(e==null?void 0:e.index)??-1)}setQuality(e){this.setTargetQuality(e)}_getFullscreenTarget(){return this._container?this._container.closest("media-controller")??this._container.parentElement:null}async setFullscreen(e){var t;if(this._applyFullscreenState(e),e){let r=this._getFullscreenTarget();if(!r){this._applyFullscreenState(!1);return}if(document.fullscreenElement){document.fullscreenElement!==r&&this._applyFullscreenState(!1);return}if(typeof r.requestFullscreen=="function")try{await r.requestFullscreen()}catch(n){throw this._applyFullscreenState(!1),n}else this._enterWebkitVideoFullscreen()}else if(document.fullscreenElement)await document.exitFullscreen();else{let r=this._webkitFullscreen,n=(r==null?void 0:r.video)??this.activeVideoElement;n!=null&&n.webkitDisplayingFullscreen&&(r==null||r.disarm(),(t=n.webkitExitFullscreen)==null||t.call(n))}}_applyFullscreenState(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"})}_enterWebkitVideoFullscreen(){var n;let e=this.activeVideoElement;if(!(e!=null&&e.webkitEnterFullscreen)){this._applyFullscreenState(!1);return}(n=this._webkitFullscreen)==null||n.disarm();let t=()=>{this._webkitFullscreen=null,this._applyFullscreenState(!1)};e.addEventListener("webkitendfullscreen",t,{once:!0});let r={video:e,disarm:()=>{this._webkitFullscreen=null,e.removeEventListener("webkitendfullscreen",t)}};if(this._webkitFullscreen=r,!e.webkitDisplayingFullscreen)try{e.webkitEnterFullscreen()}catch(o){throw r.disarm(),this._applyFullscreenState(!1),o}}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){var e;this._destroyed||(this._destroyed=!0,(e=this._webkitFullscreen)==null||e.disarm(),this.unloadSource(),this._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function zs(){return new wd}var zi="bpPlayerObservedProperties";function Ys(i){return zi in i&&Array.isArray(i[zi])}function Lh(i,e){class t extends i{get[zi](){return e}}return t}function rf(i){if(i.shadowRoot)return Array.from(i.shadowRoot.children);if(i.localName==="slot"){let t=i.assignedNodes();if(t.length>0)return t.filter(r=>r.nodeType===Node.ELEMENT_NODE)}return Array.from(i.children)}async function Yi(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!Ys(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),Ys(i)&&t(i);let r=rf(i);r.length>0&&await Promise.all(r.map(n=>Yi(n,e,t)))}function go(i,e,t){let r=i[zi];r.includes("player")&&(i.player=e),r.includes("paused")&&(i.paused=t.paused),r.includes("playing")&&(i.playing=t.playing),r.includes("ended")&&(i.ended=t.ended),r.includes("seeking")&&(i.seeking=t.seeking),r.includes("currentTime")&&(i.currentTime=t.currentTime),r.includes("duration")&&(i.duration=t.duration),r.includes("volume")&&(i.volume=t.volume),r.includes("muted")&&(i.muted=t.muted),r.includes("playbackRate")&&(i.playbackRate=t.playbackRate),r.includes("readyState")&&(i.readyState=t.readyState),r.includes("videoWidth")&&(i.videoWidth=t.videoWidth),r.includes("videoHeight")&&(i.videoHeight=t.videoHeight),r.includes("qualities")&&(i.qualities=t.qualities),r.includes("currentQuality")&&(i.currentQuality=t.currentQuality),r.includes("targetQuality")&&(i.targetQuality=t.targetQuality),r.includes("fullscreen")&&(i.fullscreen=t.fullscreen),r.includes("presentationMode")&&(i.presentationMode=t.presentationMode),r.includes("connectionState")&&(i.connectionState=t.connectionState),r.includes("streamType")&&(i.streamType=t.streamType),r.includes("error")&&(i.error=t.error)}function bo(i){i[zi].includes("player")&&(i.player=void 0)}var wh=`/**
7
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),mh=/'/g,vh=/"/g,bh=/^(?:script|style|textarea|title)$/i,Ad=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ze=Ad(1),Xb=Ad(2),jb=Ad(3),qi=Symbol.for("lit-noChange"),Ae=Symbol.for("lit-nothing"),fh=new WeakMap,Fi=Ki.createTreeWalker(Ki,129);function _h(i,e){if(!Td(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return uh!==void 0?uh.createHTML(e):e}var jv=(i,e)=>{let t=i.length-1,r=[],n,o=e===2?"<svg>":e===3?"<math>":"",s=so;for(let l=0;l<t;l++){let d=i[l],h,p,g=-1,f=0;for(;f<d.length&&(s.lastIndex=f,p=s.exec(d),p!==null);)f=s.lastIndex,s===so?p[1]==="!--"?s=hh:p[1]!==void 0?s=ph:p[2]!==void 0?(bh.test(p[2])&&(n=RegExp("</"+p[2],"g")),s=Wi):p[3]!==void 0&&(s=Wi):s===Wi?p[0]===">"?(s=n??so,g=-1):p[1]===void 0?g=-2:(g=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?Wi:p[3]==='"'?vh:mh):s===vh||s===mh?s=Wi:s===hh||s===ph?s=so:(s=Wi,n=void 0);let E=s===Wi&&i[l+1].startsWith("/>")?" ":"";o+=s===so?d+Zv:g>=0?(r.push(h),d.slice(0,g)+Eh+d.slice(g)+ni+E):d+ni+(g===-2?l:E)}return[_h(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},uo=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,s=0,l=e.length-1,d=this.parts,[h,p]=jv(e,t);if(this.el=i.createElement(h,r),Fi.currentNode=this.el.content,t===2||t===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(n=Fi.nextNode())!==null&&d.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let g of n.getAttributeNames())if(g.endsWith(Eh)){let f=p[s++],E=n.getAttribute(g).split(ni),T=/([.?@])?(.*)/.exec(f);d.push({type:1,index:o,name:T[2],strings:E,ctor:T[1]==="."?gd:T[1]==="?"?bd:T[1]==="@"?_d:Nr}),n.removeAttribute(g)}else g.startsWith(ni)&&(d.push({type:6,index:o}),n.removeAttribute(g));if(bh.test(n.tagName)){let g=n.textContent.split(ni),f=g.length-1;if(f>0){n.textContent=Bs?Bs.emptyScript:"";for(let E=0;E<f;E++)n.append(g[E],lo()),Fi.nextNode(),d.push({type:2,index:++o});n.append(g[f],lo())}}}else if(n.nodeType===8)if(n.data===gh)d.push({type:2,index:o});else{let g=-1;for(;(g=n.data.indexOf(ni,g+1))!==-1;)d.push({type:7,index:o}),g+=ni.length-1}o++}}static createElement(e,t){let r=Ki.createElement("template");return r.innerHTML=e,r}};function Or(i,e,t=i,r){var s,l;if(e===qi)return e;let n=r!==void 0?(s=t._$Co)==null?void 0:s[r]:t._$Cl,o=co(e)?void 0:e._$litDirective$;return(n==null?void 0:n.constructor)!==o&&((l=n==null?void 0:n._$AO)==null||l.call(n,!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=n:t._$Cl=n),n!==void 0&&(e=Or(i,n._$AS(i,e.values),n,r)),e}var Ed=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,n=((e==null?void 0:e.creationScope)??Ki).importNode(t,!0);Fi.currentNode=n;let o=Fi.nextNode(),s=0,l=0,d=r[0];for(;d!==void 0;){if(s===d.index){let h;d.type===2?h=new ho(o,o.nextSibling,this,e):d.type===1?h=new d.ctor(o,d.name,d.strings,this,e):d.type===6&&(h=new yd(o,this,e)),this._$AV.push(h),d=r[++l]}s!==(d==null?void 0:d.index)&&(o=Fi.nextNode(),s++)}return Fi.currentNode=Ki,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},ho=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=Ae,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Or(this,e,t),co(e)?e===Ae||e==null||e===""?(this._$AH!==Ae&&this._$AR(),this._$AH=Ae):e!==this._$AH&&e!==qi&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Xv(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Ae&&co(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ki.createTextNode(e)),this._$AH=e}$(e){var o;let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=uo.createElement(_h(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===n)this._$AH.p(t);else{let s=new Ed(n,this),l=s.u(this.options);s.p(t),this.T(l),this._$AH=s}}_$AC(e){let t=fh.get(e.strings);return t===void 0&&fh.set(e.strings,t=new uo(e)),t}k(e){Td(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let o of e)n===t.length?t.push(r=new i(this.O(lo()),this.O(lo()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let n=ch(e).nextSibling;ch(e).remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Nr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=Ae,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Ae}_$AI(e,t=this,r,n){let o=this.strings,s=!1;if(o===void 0)e=Or(this,e,t,0),s=!co(e)||e!==this._$AH&&e!==qi,s&&(this._$AH=e);else{let l=e,d,h;for(e=o[0],d=0;d<o.length-1;d++)h=Or(this,l[r+d],t,d),h===qi&&(h=this._$AH[d]),s||(s=!co(h)||h!==this._$AH[d]),h===Ae?e=Ae:e!==Ae&&(e+=(h??"")+o[d+1]),this._$AH[d]=h}s&&!n&&this.j(e)}j(e){e===Ae?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},gd=class extends Nr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ae?void 0:e}},bd=class extends Nr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Ae)}},_d=class extends Nr{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=Or(this,e,t,0)??Ae)===qi)return;let r=this._$AH,n=e===Ae&&r!==Ae||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==Ae&&(r===Ae||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},yd=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Or(this,e)}};var fd=ao.litHtmlPolyfillSupport;fd==null||fd(uo,ho),(ao.litHtmlVersions??(ao.litHtmlVersions=[])).push("3.3.2");var yh=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,n=r._$litPart$;if(n===void 0){let o=(t==null?void 0:t.renderBefore)??null;r._$litPart$=n=new ho(e.insertBefore(lo(),o),o,void 0,t??{})}return n._$AI(i),n};var Gi=globalThis,Oe=class extends Bt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;let e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=yh(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return qi}},Th;Oe._$litElement$=!0,Oe.finalized=!0,(Th=Gi.litElementHydrateSupport)==null||Th.call(Gi,{LitElement:Oe});var Sd=Gi.litElementPolyfillSupport;Sd==null||Sd({LitElement:Oe});(Gi.litElementVersions??(Gi.litElementVersions=[])).push("4.2.2");var oi=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Jv={attribute:!0,type:String,converter:oo,reflect:!1,hasChanged:Vs},ef=(i=Jv,e,t)=>{let{kind:r,metadata:n}=t,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(t.name,i),r==="accessor"){let{name:s}=t;return{set(l){let d=e.get.call(this);e.set.call(this,l),this.requestUpdate(s,d,i,!0,l)},init(l){return l!==void 0&&this.C(s,void 0,i,l),l}}}if(r==="setter"){let{name:s}=t;return function(l){let d=this[s];e.call(this,l),this.requestUpdate(s,d,i,!0,l)}}throw Error("Unsupported decorator location: "+r)};function Z(i){return(e,t)=>typeof t=="object"?ef(i,e,t):((r,n,o)=>{let s=n.hasOwnProperty(o);return n.constructor.createProperty(o,r),s?Object.getOwnPropertyDescriptor(n,o):void 0})(i,e,t)}function si(i){return Z({...i,state:!0,attribute:!1})}var Ah=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Fs(i){return i===1005||i===1007||i===1009?"autoplay":i>=2001&&i<=2004?"offline":i>=3e3&&i<=3999?"media":i>=4900&&i<=4999?"security":i>=4e3&&i<=4899?"network":i>=5e3&&i<=5999?"setup":i>=1e3&&i<=1999?"media":"unknown"}function Ks(i){return i===4e3||i===4001?"network":"unknown"}var Xe={network:6001,media:6002,keySystem:6003,other:6004,auth:6005};function qs(i){switch(i){case Xe.network:return"network";case Xe.media:return"media";case Xe.keySystem:case Xe.auth:return"security";default:return"unknown"}}function po(){return{paused:!0,playing:!1,ended:!1,seeking:!1,waiting:!1,currentTime:0,duration:NaN,buffered:null,volume:1,muted:!1,loop:!1,playbackRate:1,readyState:0,videoWidth:0,videoHeight:0,qualities:[],currentQuality:null,targetQuality:null,fullscreen:!1,presentationMode:"inline",providerType:null,connectionState:"idle",streamType:"vod",contentType:"video",error:null}}function mo(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function vo(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function Gs(i){return mo(i)||vo(i)}var st=class extends Error{constructor(t,r,n){super(t);this.code=r;this.status=n;this.name="BPLiveError"}},Ur=class{constructor(e,t){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null,this._network=t??null}get config(){return this._config}get authToken(){return this._authToken}get stream(){return this._stream}get clip(){return this._clip}async fetch(e){if(!this._authToken)throw new st("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r={"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`};if(this._network){let s=await this._network.intercept({url:t,method:"GET",type:"api",headers:r});if(s.response)return s.response.body;t=s.url,r=s.headers}let n=new AbortController,o=setTimeout(()=>n.abort(),3e4);try{let s=await fetch(t,{method:"GET",headers:r,signal:n.signal});if(!s.ok)throw new st(`HTTP ${s.status}: ${s.statusText}`,"HTTP_ERROR",s.status);let l=await s.json();return this._network&&(l=(await this._network.interceptResponse({url:t,status:s.status,headers:Object.fromEntries(s.headers),body:l})).body),l}catch(s){throw s instanceof Error&&s.name==="AbortError"?new st("Request timeout after 30s","TIMEOUT"):s}finally{clearTimeout(o)}}async getStream(e){return this.fetch(`/streams/${e}`)}async getClip(e){return this.fetch(`/clips/${e}`)}mapPlayerSourceToResolvedSource(e){if(e.provider==="livekit")return{type:"livekit",url:e.url,token:e.token,room:e.room};if(e.provider==="nanoplayer"){let{provider:t,...r}=e;return{type:"nano",source:r}}throw new st(`Unknown player source provider: ${e.provider}`,"UNKNOWN_PROVIDER")}selectClipMedia(e,t="landscape"){let r=e.filter(l=>l.type==="clip");if(r.length===0)return null;let n=r.find(l=>l.orientation===t);if(n)return n;let o=t==="landscape"?"portrait":"landscape",s=r.find(l=>l.orientation===o);return s||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,mo(e))return this.resolveStreamSource(e);if(vo(e))return this.resolveClipSource(e);throw new st("Invalid BPLive source","INVALID_SOURCE")}extractStreamPoster(e){var t;return e.cover_photo??((t=e.channel)==null?void 0:t.cover_image)??void 0}async resolveStreamSource(e){var l,d,h,p,g,f,E,T,v;let r=(await this.getStream(e.streamId)).data;this._stream=r;let n=this.extractStreamPoster(r);if(!!r.ended_at&&((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let S=r.media.vod[0];return{source:{type:"video",url:S.original},contentType:"video",poster:n??S.thumb??void 0,videoWidth:(h=S.dimension)==null?void 0:h.width,videoHeight:(p=S.dimension)==null?void 0:p.height}}let s=r.player_source??((g=r.active_stream)==null?void 0:g.player_source);if(s)return{source:this.mapPlayerSourceToResolvedSource(s),contentType:"stream",poster:n};if(((E=(f=r.media)==null?void 0:f.vod)==null?void 0:E.length)>0){let S=r.media.vod[0];return{source:{type:"video",url:S.original},contentType:"video",poster:n??S.thumb??void 0,videoWidth:(T=S.dimension)==null?void 0:T.width,videoHeight:(v=S.dimension)==null?void 0:v.height}}throw new st("Stream is not live and has no VOD content","STREAM_OFFLINE")}async resolveClipSource(e){let r=(await this.getClip(e.clipId)).data;this._clip=r;let n=this.selectClipMedia(r.media,e.preferredOrientation);if(!n)throw new st("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(n),contentType:"clip",poster:n.thumbnail??void 0,videoWidth:n.width,videoHeight:n.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function fo(i){return i!=null&&typeof i.then=="function"}function Sh(i){return new Promise((e,t)=>{let r=!1,n=o=>{r||(r=!0,o?t(o):e())};try{let o=i(n);fo(o)&&(r=!0,o.then(()=>e(),t))}catch(o){n(o)}})}var kd=class{constructor(e,t,r){this._closed=!1;this._pendingCount=0;this._firstError=null;this._redirectResult=null;this._responseResult=null;this.promise=new Promise((n,o)=>{this._resolve=n,this._reject=o}),this._state=e,this._interceptor=t,this._canModify=r,this._start()}get redirectResult(){return this._redirectResult}get responseResult(){return this._responseResult}get _open(){return this._canModify&&!this._closed}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());fo(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get method(){return e._state.method},get type(){return e._state.type},get headers(){return{...e._state.headers}},get closed(){return!e._open},redirect(t){e._redirect(t)},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_redirect(e){if(!this._open)throw new Error("Request is closed");let t=typeof e=="string"?{url:e}:e;this._redirectResult={url:t.url??this._state.url,method:t.method??this._state.method,type:this._state.type,headers:t.headers??{...this._state.headers}},this._close()}_respondWith(e){if(!this._open)throw new Error("Request is closed");this._responseResult=e,this._close()}_waitUntil(e){if(!this._open)throw new Error("Request is closed");fo(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(Sh(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},Ld=class{constructor(e,t){this._closed=!1;this._pendingCount=0;this._firstError=null;this._responseResult=null;this.promise=new Promise((r,n)=>{this._resolve=r,this._reject=n}),this._state=e,this._interceptor=t,this._start()}get responseResult(){return this._responseResult}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());fo(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get status(){return e._state.status},get headers(){return{...e._state.headers}},get body(){return e._state.body},get closed(){return e._closed},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_respondWith(e){if(this._closed)throw new Error("Response is closed");this._responseResult=e,this._close()}_waitUntil(e){if(this._closed)throw new Error("Response is closed");fo(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(Sh(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},Eo=class{constructor(){this._requestInterceptors=[];this._responseInterceptors=[]}addRequestInterceptor(e){this._requestInterceptors.unshift(e)}removeRequestInterceptor(e){let t=this._requestInterceptors.indexOf(e);t>=0&&this._requestInterceptors.splice(t,1)}addResponseInterceptor(e){this._responseInterceptors.unshift(e)}removeResponseInterceptor(e){let t=this._responseInterceptors.indexOf(e);t>=0&&this._responseInterceptors.splice(t,1)}async intercept(e){let t={...e,headers:{...e.headers}},r=!1,n=null;for(let o of this._requestInterceptors.slice()){let s=new kd(t,o,!r);try{await s.promise}catch{continue}s.responseResult&&!r&&(r=!0,n=s.responseResult),s.redirectResult&&!r&&(t=s.redirectResult)}return{url:t.url,headers:t.headers,response:n}}async interceptResponse(e){let t={...e,headers:{...e.headers}};for(let r of this._responseInterceptors.slice()){let n=new Ld(t,r);try{await n.promise}catch{continue}n.responseResult&&(t={...t,status:n.responseResult.status!==void 0?n.responseResult.status:t.status,headers:n.responseResult.headers!==void 0?n.responseResult.headers:t.headers,body:"body"in n.responseResult?n.responseResult.body:t.body})}return{status:t.status,headers:t.headers,body:t.body}}};function tf(i){if(typeof i=="string")return"video";switch(i.type){case"video":return"video";case"nano":return"nano";case"livekit":return"livekit";default:return"video"}}function kh(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var rf=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],wd=class{constructor(){this._mediaElement=null;this._container=null;this._webkitFullscreen=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._network=new Eo;this._currentProviderType=null;this._ready=!1;this._loadGeneration=0;this._attachedElementGeneration=0;this._state=po()}get state(){return this._state}get videoElement(){return this._mediaElement}get activeVideoElement(){let e=this._mediaElement;return(e==null?void 0:e.activeVideoElement)??null}get bpLive(){return this._bpLive}get network(){return this._network}get ready(){return this._ready}get providerType(){return this._currentProviderType}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r)this._listeners.has(n)||this._listeners.set(n,new Set),this._listeners.get(n).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r){let o=this._listeners.get(n);o&&(o.delete(t),o.size===0&&this._listeners.delete(n))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let n of r)try{n(t)}catch(o){console.error(`[PlayerCore] Error in event listener for "${e}":`,o)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}attach(e,t){this._destroyed||(this._container=e,this._config=t,this._ready=!0)}async loadSource(e,t,r){if(this._destroyed)return;let n=++this._loadGeneration,o=t??this._container,s=r??this._config;if(!o){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=o,s&&(this._config=s);let l=kh(e)?"clipId"in e?"clip":"stream":"video";this.updateState({error:null,connectionState:"connecting",ended:!1,contentType:l}),this.dispatch("sourcechange",{source:e});try{let d=e,h=l,p,g,f;if(kh(e)){if(s!=null&&s.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new Ur(s.bpLive,this._network)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let I=await this._bpLive.resolveSource(e);if(n!==this._loadGeneration)return;d=I.source,h=I.contentType,p=I.poster,g=I.videoWidth,f=I.videoHeight}else this._bpLive&&(this._bpLive.destroy(),this._bpLive=null);let E=tf(d),S=E==="nano"||E==="livekit"||h==="stream"?"live":"vod";return this._mediaElement&&this.destroyMediaElement(),this._state.targetQuality&&this.setTargetQuality(null),this._currentProviderType=E,this.updateState({providerType:E,contentType:h,streamType:S,error:null,paused:!0,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this._mediaElement=this.createMediaElement(E,d,s),this._mediaElement.style.width="100%",this._mediaElement.style.height="100%",this._state.muted&&(this._mediaElement.muted=!0),this._state.loop&&(this._mediaElement.loop=!0),this.attachMediaElementListeners(this._mediaElement),this.attachActiveVideoElementForwarding(this._mediaElement),o.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),this.dispatch("activevideoelementchange",{video:this.activeVideoElement}),{poster:p,videoWidth:g,videoHeight:f}}catch(d){if(n!==this._loadGeneration)return;this._attachedElementGeneration=this._loadGeneration,console.error("[PlayerCore] loadSource error:",d);let h={code:-1,message:d instanceof Error?d.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:h,connectionState:"failed"}),this.dispatch("error",h)}}destroyMediaElement(){if(this._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null,this.dispatch("emptied",void 0),this.dispatch("videoelementchange",{video:null}),this.dispatch("activevideoelementchange",{video:null})),this._container)for(;this._container.firstChild;)this._container.removeChild(this._container.firstChild)}createMediaElement(e,t,r){switch(e){case"nano":{let n=document.createElement("nano-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=t;return n.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",r!=null&&r.nano&&(n.config=r.nano),o.source?n.sourceConfig=o.source:o.streamid&&(n.streamid=o.streamid),n}case"livekit":{let n=document.createElement("livekit-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=t;return r!=null&&r.livekit&&(n.config=r.livekit),n.url=o.url,n.token=o.token,n}case"video":default:{let n=document.createElement("hls-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=typeof t=="string"?t:t.url,s={...r==null?void 0:r.video},l=this._network,d=s.xhrSetup;return s.xhrSetup=async(h,p)=>{let g=p.includes(".m3u8")?"manifest":p.includes(".ts")||p.includes(".m4s")||p.includes(".fmp4")?"segment":"other",f=await l.intercept({url:p,method:"GET",type:g,headers:{}});f.url!==p&&h.open("GET",f.url,!0);for(let[E,T]of Object.entries(f.headers))h.setRequestHeader(E,T);d&&await d(h,f.url)},n.config=s,n.src=o,n}}}attachMediaElementListeners(e){this._attachedElementGeneration=this._loadGeneration;for(let t of rf){let r=n=>{t==="error"&&this._attachedElementGeneration!==this._loadGeneration||this.handleMediaEvent(t,e,n)};e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}attachActiveVideoElementForwarding(e){let t=r=>{let n=r.detail;this.dispatch("activevideoelementchange",{video:(n==null?void 0:n.video)??null})};e.addEventListener("activevideoelementchange",t),this._eventCleanup.push(()=>e.removeEventListener("activevideoelementchange",t))}handleMediaEvent(e,t,r){var n,o,s,l;switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:d}),this.dispatch("loadedmetadata",{duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight});break}case"loadeddata":this.updateState({readyState:2}),this.dispatch("loadeddata",void 0);break;case"canplay":this.updateState({readyState:3,connectionState:"connected"}),this.dispatch("canplay",void 0),this.dispatch("connectionstatechange",{state:"connected"});break;case"canplaythrough":this.updateState({readyState:4}),this.dispatch("canplaythrough",void 0);break;case"play":this.updateState({paused:!1,ended:!1}),this.dispatch("play",void 0);break;case"playing":this.updateState({error:null,paused:!1,playing:!0,ended:!1,waiting:!1,readyState:4}),this.dispatch("playing",void 0);break;case"pause":this.updateState({paused:!0,playing:!1,waiting:!1}),this.dispatch("pause",void 0);break;case"waiting":this.updateState({playing:!1,waiting:!0,readyState:2}),this.dispatch("waiting",void 0);break;case"seeking":this.updateState({seeking:!0,currentTime:t.currentTime}),this.dispatch("seeking",{currentTime:t.currentTime});break;case"seeked":this.updateState({seeking:!1,currentTime:t.currentTime}),this.dispatch("seeked",{currentTime:t.currentTime});break;case"timeupdate":this.updateState({currentTime:t.currentTime,duration:t.duration}),this.dispatch("timeupdate",{currentTime:t.currentTime,duration:t.duration});break;case"durationchange":{let d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:d}),this.dispatch("durationchange",{duration:t.duration}),this.dispatch("streamtypechange",{streamType:this._state.streamType});break}case"ratechange":this.updateState({playbackRate:t.playbackRate}),this.dispatch("ratechange",{playbackRate:t.playbackRate});break;case"volumechange":this.updateState({volume:t.volume,muted:t.muted}),this.dispatch("volumechange",{volume:t.volume,muted:t.muted});break;case"ended":this.updateState({ended:!0,paused:!0,playing:!1,waiting:!1}),this.dispatch("ended",void 0);break;case"progress":this.updateState({buffered:t.buffered}),this.dispatch("progress",{buffered:t.buffered});break;case"error":{let d=-1,h="Unknown error",p="none";r instanceof ErrorEvent&&r.error?(d=r.error.code??-1,h=r.error.message??r.message??"Unknown error",p="ErrorEvent"):t.error&&(d=t.error.code??-1,h=t.error.message??"Unknown error",p="element.error");let g=t.nativeEl;console.error("[PlayerCore] error event",{providerType:this._state.providerType,elementTag:t.tagName,eventTarget:(n=r.target)==null?void 0:n.tagName,source:p,code:d,message:h,eventIsErrorEvent:r instanceof ErrorEvent,eventErrorCode:r instanceof ErrorEvent?(o=r.error)==null?void 0:o.code:void 0,elementErrorCode:(s=t.error)==null?void 0:s.code,nativeElTag:g==null?void 0:g.tagName,nativeElErrorCode:(l=g==null?void 0:g.error)==null?void 0:l.code,nativeElSrc:g==null?void 0:g.currentSrc,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState});let f="media",E=!0;this._state.providerType==="nano"&&d>0?(f=Fs(d),E=f!=="offline"&&f!=="autoplay"):this._state.providerType==="livekit"&&d>0?(f=Ks(d),E=!0):this._state.providerType==="video"&&d>=6e3&&(f=qs(d),E=!0);let T={code:d,message:h,fatal:E,category:f};this.updateState({error:T}),this.dispatch("error",T);break}case"resize":t.videoWidth&&t.videoHeight&&(this.updateState({videoWidth:t.videoWidth,videoHeight:t.videoHeight}),this.dispatch("resize",{videoWidth:t.videoWidth,videoHeight:t.videoHeight}));break}}unloadSource(){this._loadGeneration++,this.destroyMediaElement(),this._currentProviderType=null,this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this.updateState({...po(),volume:this._state.volume,muted:this._state.muted,loop:this._state.loop,playbackRate:this._state.playbackRate}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1});try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this._mediaElement.pause())}seek(e){this._mediaElement&&(this._mediaElement.currentTime=e)}setVolume(e){let t=Math.max(0,Math.min(1,e));this.updateState({volume:t}),this._mediaElement&&(this._mediaElement.volume=t),this.dispatch("volumechange",{volume:t,muted:this._state.muted})}setMuted(e){this.updateState({muted:e}),this._mediaElement&&(this._mediaElement.muted=e),this.dispatch("volumechange",{volume:this._state.volume,muted:e})}setLoop(e){this.updateState({loop:e}),this._mediaElement&&(this._mediaElement.loop=e)}setPlaybackRate(e){this.updateState({playbackRate:e}),this._mediaElement&&(this._mediaElement.playbackRate=e),this.dispatch("ratechange",{playbackRate:e})}setTargetQuality(e){this.updateState({targetQuality:e}),this.dispatch("targetqualitychanged",{quality:e});let t=this._mediaElement;t!=null&&t.videoRenditions&&(t.videoRenditions.selectedIndex=(e==null?void 0:e.index)??-1)}setQuality(e){this.setTargetQuality(e)}_getFullscreenTarget(){return this._container?this._container.closest("media-controller")??this._container.parentElement:null}async setFullscreen(e){var t;if(this._applyFullscreenState(e),e){let r=this._getFullscreenTarget();if(!r){this._applyFullscreenState(!1);return}if(document.fullscreenElement){document.fullscreenElement!==r&&this._applyFullscreenState(!1);return}if(typeof r.requestFullscreen=="function")try{await r.requestFullscreen()}catch(n){throw this._applyFullscreenState(!1),n}else this._enterWebkitVideoFullscreen()}else if(document.fullscreenElement)await document.exitFullscreen();else{let r=this._webkitFullscreen,n=(r==null?void 0:r.video)??this.activeVideoElement;n!=null&&n.webkitDisplayingFullscreen&&(r==null||r.disarm(),(t=n.webkitExitFullscreen)==null||t.call(n))}}_applyFullscreenState(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"})}_enterWebkitVideoFullscreen(){var n;let e=this.activeVideoElement;if(!(e!=null&&e.webkitEnterFullscreen)){this._applyFullscreenState(!1);return}(n=this._webkitFullscreen)==null||n.disarm();let t=()=>{this._webkitFullscreen=null,this._applyFullscreenState(!1)};e.addEventListener("webkitendfullscreen",t,{once:!0});let r={video:e,disarm:()=>{this._webkitFullscreen=null,e.removeEventListener("webkitendfullscreen",t)}};if(this._webkitFullscreen=r,!e.webkitDisplayingFullscreen)try{e.webkitEnterFullscreen()}catch(o){throw r.disarm(),this._applyFullscreenState(!1),o}}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){var e;this._destroyed||(this._destroyed=!0,(e=this._webkitFullscreen)==null||e.disarm(),this.unloadSource(),this._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function zs(){return new wd}var zi="bpPlayerObservedProperties";function Ys(i){return zi in i&&Array.isArray(i[zi])}function Lh(i,e){class t extends i{get[zi](){return e}}return t}function nf(i){if(i.shadowRoot)return Array.from(i.shadowRoot.children);if(i.localName==="slot"){let t=i.assignedNodes();if(t.length>0)return t.filter(r=>r.nodeType===Node.ELEMENT_NODE)}return Array.from(i.children)}async function Yi(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!Ys(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),Ys(i)&&t(i);let r=nf(i);r.length>0&&await Promise.all(r.map(n=>Yi(n,e,t)))}function go(i,e,t){let r=i[zi];r.includes("player")&&(i.player=e),r.includes("paused")&&(i.paused=t.paused),r.includes("playing")&&(i.playing=t.playing),r.includes("ended")&&(i.ended=t.ended),r.includes("seeking")&&(i.seeking=t.seeking),r.includes("currentTime")&&(i.currentTime=t.currentTime),r.includes("duration")&&(i.duration=t.duration),r.includes("volume")&&(i.volume=t.volume),r.includes("muted")&&(i.muted=t.muted),r.includes("playbackRate")&&(i.playbackRate=t.playbackRate),r.includes("readyState")&&(i.readyState=t.readyState),r.includes("videoWidth")&&(i.videoWidth=t.videoWidth),r.includes("videoHeight")&&(i.videoHeight=t.videoHeight),r.includes("qualities")&&(i.qualities=t.qualities),r.includes("currentQuality")&&(i.currentQuality=t.currentQuality),r.includes("targetQuality")&&(i.targetQuality=t.targetQuality),r.includes("fullscreen")&&(i.fullscreen=t.fullscreen),r.includes("presentationMode")&&(i.presentationMode=t.presentationMode),r.includes("connectionState")&&(i.connectionState=t.connectionState),r.includes("streamType")&&(i.streamType=t.streamType),r.includes("error")&&(i.error=t.error)}function bo(i){i[zi].includes("player")&&(i.player=void 0)}var wh=`/**
8
8
  * BP Player CSS Custom Properties
9
9
  *
10
10
  * All styling can be customized by overriding these CSS variables.
@@ -137,7 +137,7 @@ html.bp-player-full-window > body {
137
137
  padding: 0 !important;
138
138
  }
139
139
  `;var Ch=!1;function Hr(){if(Ch)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=wh+`
140
- `+Ih,document.head.appendChild(i),Ch=!0}function Rh(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function Mh(i,e){return`<style>${i}</style>${e}`}var _o=(R=>(R.CONFIGURATION="configuration",R.SOURCE="source",R.SOURCES="sources",R.AUTOPLAY="autoplay",R.MUTED="muted",R.LOOP="loop",R.SCALING="scaling",R.ASPECT_RATIO="aspect-ratio",R.DEBUG="debug",R.AUTOHIDE="autohide",R.HOTKEYS="hotkeys",R.PAUSED="paused",R.PLAYING="playing",R.ENDED="ended",R.SEEKING="seeking",R.WAITING="waiting",R.LOADING="loading",R.READY="ready",R.HAS_ERROR="has-error",R.HAS_FIRST_PLAY="has-first-play",R.FULLSCREEN="fullscreen",R.FULLWINDOW="fullwindow",R.DEVICE_TYPE="device-type",R.MOBILE="mobile",R.TV="tv",R.STREAM_TYPE="stream-type",R.LIVE="live",R.CONTENT_TYPE="content-type",R.USER_IDLE="user-idle",R.USER_IDLE_TIMEOUT="user-idle-timeout",R.MOBILE_ONLY="mobile-only",R.MOBILE_HIDDEN="mobile-hidden",R.TV_ONLY="tv-only",R.TV_HIDDEN="tv-hidden",R.LIVE_ONLY="live-only",R.LIVE_HIDDEN="live-hidden",R.VOD_HIDDEN="vod-hidden",R.CLIP_HIDDEN="clip-hidden",R.NO_AUTO_HIDE="no-auto-hide",R.DISABLED="disabled",R.HIDDEN="hidden",R.NOTOOLTIP="notooltip",R.MENU="menu",R.MENU_OPENED="menu-opened",R.ARIA_LABEL="aria-label",R.ARIA_LIVE="aria-live",R.ARIA_CHECKED="aria-checked",R.VOLUME_LEVEL="volume-level",R.PROVIDER_TYPE="provider-type",R))(_o||{});function _e(i,e,t){return t!==void 0?t?(i.setAttribute(e,""),!0):(i.removeAttribute(e),!1):i.hasAttribute(e)?(i.removeAttribute(e),!1):(i.setAttribute(e,""),!0)}function $r(){return{fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{return}},toAttribute:i=>i==null?null:JSON.stringify(i)}}var j=(i,e)=>new Event(i,{bubbles:!0,composed:!0,...e}),Qi=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function Ne(i,e){let t=e!==void 0?Object.assign(i,{code:e}):i;return new ErrorEvent("error",{error:t,message:i.message,bubbles:!0,composed:!0})}var yo="play";var ai="pause";var li="playing";var Vr="waiting";var To="ended";var Ao="timeupdate";var Id="durationchange";var Cd="loadstart";var Rd="loadedmetadata";var Md="loadeddata";var So="canplay";var Qs="canplaythrough";var Br="volumechange";var di="resize";var ko="ready";var Zs="change";var xd="addrendition";var Xs=class extends EventTarget{constructor(t){super();this._renditions=[];this._cleanup=[];this._host=t}get length(){return this._renditions.length}[Symbol.iterator](){return this._renditions[Symbol.iterator]()}get selectedIndex(){var r;let t=(r=this._host.player)==null?void 0:r.state.targetQuality;return t?this._renditions.findIndex(n=>n.id===String(t.index)):-1}set selectedIndex(t){var r,n,o;if(t<0)(r=this._host.player)==null||r.setQuality(null);else{let l=(((n=this._host.player)==null?void 0:n.state.qualities)??[])[t];l&&((o=this._host.player)==null||o.setQuality(l))}this._updateSelection(),this.dispatchEvent(j(Zs))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,n)=>{r.selected=n===t})}_syncFromPlayer(){var n,o;let t=((n=this._host.player)==null?void 0:n.state.qualities)??[];if(t.length===0){let s=(o=this._host.player)==null?void 0:o.videoElement;s!=null&&s.videoRenditions&&(t=[...s.videoRenditions].map((l,d)=>({index:d,width:l.width??0,height:l.height??0,bitrate:l.bitrate??0})))}let r=this._renditions.length;for(let s=0;s<r;s++)delete this[s];this._renditions=t.map(s=>({id:String(s.index),width:s.width,height:s.height,bitrate:s.bitrate,selected:!1})),this._renditions.forEach((s,l)=>{this[l]=s}),this._updateSelection();for(let s of this._renditions)this.dispatchEvent(Qi(xd,{detail:s}))}_setupListeners(){this._cleanup.forEach(s=>s()),this._cleanup=[];let t=this._host.player;if(!t)return;let r=()=>{this._syncFromPlayer()},n=()=>{this._updateSelection(),this.dispatchEvent(j(Zs))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",n),t.addEventListener("targetqualitychanged",n),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",n),t.removeEventListener("targetqualitychanged",n)});let o=t.videoElement;o!=null&&o.videoRenditions&&(o.videoRenditions.addEventListener("addrendition",r),o.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var s,l;(s=o.videoRenditions)==null||s.removeEventListener("addrendition",r),(l=o.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(r=>r()),this._cleanup=[];let t=this._renditions.length;this._renditions=[];for(let r=0;r<t;r++)delete this[r]}};var xh=`/**
140
+ `+Ih,document.head.appendChild(i),Ch=!0}function Rh(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function Mh(i,e){return`<style>${i}</style>${e}`}var _o=(R=>(R.CONFIGURATION="configuration",R.SOURCE="source",R.SOURCES="sources",R.AUTOPLAY="autoplay",R.MUTED="muted",R.LOOP="loop",R.SCALING="scaling",R.ASPECT_RATIO="aspect-ratio",R.DEBUG="debug",R.AUTOHIDE="autohide",R.HOTKEYS="hotkeys",R.PAUSED="paused",R.PLAYING="playing",R.ENDED="ended",R.SEEKING="seeking",R.WAITING="waiting",R.LOADING="loading",R.READY="ready",R.HAS_ERROR="has-error",R.HAS_FIRST_PLAY="has-first-play",R.FULLSCREEN="fullscreen",R.FULLWINDOW="fullwindow",R.DEVICE_TYPE="device-type",R.MOBILE="mobile",R.TV="tv",R.STREAM_TYPE="stream-type",R.LIVE="live",R.CONTENT_TYPE="content-type",R.USER_IDLE="user-idle",R.USER_IDLE_TIMEOUT="user-idle-timeout",R.MOBILE_ONLY="mobile-only",R.MOBILE_HIDDEN="mobile-hidden",R.TV_ONLY="tv-only",R.TV_HIDDEN="tv-hidden",R.LIVE_ONLY="live-only",R.LIVE_HIDDEN="live-hidden",R.VOD_HIDDEN="vod-hidden",R.CLIP_HIDDEN="clip-hidden",R.NO_AUTO_HIDE="no-auto-hide",R.DISABLED="disabled",R.HIDDEN="hidden",R.NOTOOLTIP="notooltip",R.MENU="menu",R.MENU_OPENED="menu-opened",R.ARIA_LABEL="aria-label",R.ARIA_LIVE="aria-live",R.ARIA_CHECKED="aria-checked",R.VOLUME_LEVEL="volume-level",R.PROVIDER_TYPE="provider-type",R))(_o||{});function _e(i,e,t){return t!==void 0?t?(i.setAttribute(e,""),!0):(i.removeAttribute(e),!1):i.hasAttribute(e)?(i.removeAttribute(e),!1):(i.setAttribute(e,""),!0)}function $r(){return{fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{return}},toAttribute:i=>i==null?null:JSON.stringify(i)}}function xh(){return{fromAttribute:i=>i!=="false"}}var j=(i,e)=>new Event(i,{bubbles:!0,composed:!0,...e}),Qi=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function Ne(i,e){let t=e!==void 0?Object.assign(i,{code:e}):i;return new ErrorEvent("error",{error:t,message:i.message,bubbles:!0,composed:!0})}var yo="play";var ai="pause";var li="playing";var Vr="waiting";var To="ended";var Ao="timeupdate";var Id="durationchange";var Cd="loadstart";var Rd="loadedmetadata";var Md="loadeddata";var So="canplay";var Qs="canplaythrough";var Br="volumechange";var di="resize";var ko="ready";var Zs="change";var xd="addrendition";var Xs=class extends EventTarget{constructor(t){super();this._renditions=[];this._cleanup=[];this._host=t}get length(){return this._renditions.length}[Symbol.iterator](){return this._renditions[Symbol.iterator]()}get selectedIndex(){var r;let t=(r=this._host.player)==null?void 0:r.state.targetQuality;return t?this._renditions.findIndex(n=>n.id===String(t.index)):-1}set selectedIndex(t){var r,n,o;if(t<0)(r=this._host.player)==null||r.setQuality(null);else{let l=(((n=this._host.player)==null?void 0:n.state.qualities)??[])[t];l&&((o=this._host.player)==null||o.setQuality(l))}this._updateSelection(),this.dispatchEvent(j(Zs))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,n)=>{r.selected=n===t})}_syncFromPlayer(){var n,o;let t=((n=this._host.player)==null?void 0:n.state.qualities)??[];if(t.length===0){let s=(o=this._host.player)==null?void 0:o.videoElement;s!=null&&s.videoRenditions&&(t=[...s.videoRenditions].map((l,d)=>({index:d,width:l.width??0,height:l.height??0,bitrate:l.bitrate??0})))}let r=this._renditions.length;for(let s=0;s<r;s++)delete this[s];this._renditions=t.map(s=>({id:String(s.index),width:s.width,height:s.height,bitrate:s.bitrate,selected:!1})),this._renditions.forEach((s,l)=>{this[l]=s}),this._updateSelection();for(let s of this._renditions)this.dispatchEvent(Qi(xd,{detail:s}))}_setupListeners(){this._cleanup.forEach(s=>s()),this._cleanup=[];let t=this._host.player;if(!t)return;let r=()=>{this._syncFromPlayer()},n=()=>{this._updateSelection(),this.dispatchEvent(j(Zs))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",n),t.addEventListener("targetqualitychanged",n),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",n),t.removeEventListener("targetqualitychanged",n)});let o=t.videoElement;o!=null&&o.videoRenditions&&(o.videoRenditions.addEventListener("addrendition",r),o.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var s,l;(s=o.videoRenditions)==null||s.removeEventListener("addrendition",r),(l=o.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(r=>r()),this._cleanup=[];let t=this._renditions.length;this._renditions=[];for(let r=0;r<t;r++)delete this[r]}};var Ph=`/**
141
141
  * BP Player Styles
142
142
  *
143
143
  * Core player component styles using CSS custom properties.
@@ -233,20 +233,20 @@ bp-player[waiting] {
233
233
  bp-player[has-error] {
234
234
  /* Styles when player has an error */
235
235
  }
236
- `;var Ph=!1;function af(){if(Ph||(Ph=!0,document.getElementById("bp-player-styles")))return;Hr();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=xh,document.head.appendChild(i)}var lf=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Me=class extends Oe{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=null;this._hasDispatchedReady=!1;this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let n of r.addedNodes)n.nodeType===Node.ELEMENT_NODE&&Yi(n,this.providerContainer,this.registerStateReceiver);for(let n of r.removedNodes)n.nodeType===Node.ELEMENT_NODE&&Yi(n,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&go(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),bo(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),af(),this._mutationObserver=new MutationObserver(this.handleMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}get player(){return this._playerCore}get playerState(){var t;return((t=this._playerCore)==null?void 0:t.state)??null}get bpLive(){var t;return((t=this._playerCore)==null?void 0:t.bpLive)??null}async play(){var t;this.debug&&console.log("[BPPlayer] play() called"),await((t=this._playerCore)==null?void 0:t.play())}pause(){var t;this.debug&&console.log("[BPPlayer] pause() called"),(t=this._playerCore)==null||t.pause()}get paused(){var r;let t=((r=this._playerCore)==null?void 0:r.state.paused)??!0;return this.debug&&console.log("[BPPlayer] paused getter:",t),t}get ended(){var t;return((t=this._playerCore)==null?void 0:t.state.ended)??!1}get seeking(){var t;return((t=this._playerCore)==null?void 0:t.state.seeking)??!1}get waiting(){var t;return((t=this._playerCore)==null?void 0:t.state.waiting)??!1}get currentTime(){var t;return((t=this._playerCore)==null?void 0:t.state.currentTime)??0}set currentTime(t){var r;(r=this._playerCore)==null||r.seek(t)}get duration(){var t;return((t=this._playerCore)==null?void 0:t.state.duration)??NaN}get volume(){var t;return((t=this._playerCore)==null?void 0:t.state.volume)??1}set volume(t){var r;(r=this._playerCore)==null||r.setVolume(t)}get muted(){var t;return((t=this._playerCore)==null?void 0:t.state.muted)??this.defaultMuted}set muted(t){var r;(r=this._playerCore)==null||r.setMuted(t)}get playbackRate(){var t;return((t=this._playerCore)==null?void 0:t.state.playbackRate)??1}set playbackRate(t){var r;(r=this._playerCore)==null||r.setPlaybackRate(t)}get readyState(){var t;return((t=this._playerCore)==null?void 0:t.state.readyState)??0}get buffered(){var r;let t=(r=this._playerCore)==null?void 0:r.state.buffered;return t||{length:0,start:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")},end:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")}}}get videoWidth(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.width?r.width:((s=this._playerCore)==null?void 0:s.state.videoWidth)??0}get videoHeight(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.height?r.height:((s=this._playerCore)==null?void 0:s.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}webkitEnterFullscreen(){var r,n;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;(n=t==null?void 0:t.webkitEnterFullscreen)==null||n.call(t)}get webkitDisplayingFullscreen(){var r;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;return(t==null?void 0:t.webkitDisplayingFullscreen)??!1}get webkitPresentationMode(){var r;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;return(t==null?void 0:t.webkitPresentationMode)??"inline"}get providerType(){var t;return((t=this._playerCore)==null?void 0:t.state.providerType)??null}get videoRenditions(){return this._videoRenditions}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._mutationObserver)==null||t.disconnect(),this.destroyPlayer()}firstUpdated(t){super.firstUpdated(t),this.containerRef=this.renderRoot.querySelector(".bp-player-container"),this.containerRef&&!this.providerContainer&&(this.providerContainer=document.createElement("div"),this.providerContainer.className="bp-player-provider",this.providerContainer.style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.containerRef.appendChild(this.providerContainer)),this.initPlayerCore()}updated(t){super.updated(t),t.has("source")&&this.loadSource(),t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}initPlayerCore(){var t;if(!(this._playerCore||!this.providerContainer))try{this._playerCore=zs(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new Xs(this),this._hasDispatchedReady||(this._hasDispatchedReady=!0,Yi(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent(Qi(ko,{detail:this._playerCore})),this.debug&&console.log("[BPPlayer] Player ready",(t=this._playerCore)==null?void 0:t.state))}catch(r){console.error("[BPPlayer] Failed to initialize player:",r),this.dispatchEvent(Ne(r instanceof Error?r:new Error(String(r))))}}async loadSource(){var r,n,o,s,l,d;let t=(n=(r=this.source)==null?void 0:r.sources)==null?void 0:n[0];if(!t){(o=this._playerCore)!=null&&o.ready&&this._playerCore.unloadSource();return}if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadSource skipped - player not initialized");return}this.debug&&console.log("[BPPlayer] loadSource:",t);try{let h=await this._playerCore.loadSource(t);if(!this._playerCore)return;if(h!=null&&h.videoWidth&&(h!=null&&h.videoHeight)&&(this.updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPPlayer] Source video dimensions:",{width:h.videoWidth,height:h.videoHeight})),(s=this._videoRenditions)==null||s._setupListeners(),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(d=(l=this._playerCore)==null?void 0:l.state)!=null&&d.paused&&this.dispatchEvent(j(ai)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h),this.dispatchEvent(Ne(h instanceof Error?h:new Error(String(h))))}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)go(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;let t=this._playerCore;for(let d of lf){let h=()=>{this.debug&&!["durationchange","timeupdate"].includes(d)&&console.log(`[BPPlayer] Forwarding event: ${d}`,t.state),this.dispatchEvent(j(d))};t.addEventListener(d,h),this.eventCleanup.push(()=>t.removeEventListener(d,h))}let r=()=>{let d=t.videoElement;d&&this.updateVideoDimensions(d.videoWidth,d.videoHeight)};t.addEventListener("resize",r),t.addEventListener("loadedmetadata",r),this.eventCleanup.push(()=>t.removeEventListener("resize",r)),this.eventCleanup.push(()=>t.removeEventListener("loadedmetadata",r)),r();let n=()=>{this.dispatchEvent(j(di))};t.addEventListener("qualitychange",n),this.eventCleanup.push(()=>t.removeEventListener("qualitychange",n));let o=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};t.addEventListener("statechange",o),this.eventCleanup.push(()=>t.removeEventListener("statechange",o));let s=[],l=()=>{s.forEach(h=>h()),s=[];let d=t.activeVideoElement;if(d)for(let h of["webkitbeginfullscreen","webkitendfullscreen"]){let p=()=>this.dispatchEvent(new Event(h));d.addEventListener(h,p),s.push(()=>d.removeEventListener(h,p))}};l(),t.addEventListener("activevideoelementchange",l),this.eventCleanup.push(()=>t.removeEventListener("activevideoelementchange",l)),this.eventCleanup.push(()=>s.forEach(d=>d()))}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;_e(this,"paused",t.paused),_e(this,"playing",t.playing),_e(this,"ended",t.ended),_e(this,"seeking",t.seeking),_e(this,"waiting",t.waiting),_e(this,"has-error",t.error!==null),_e(this,"ready",this._playerCore.ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}destroyPlayer(){var t;this.eventCleanup.forEach(r=>r()),this.eventCleanup=[],(t=this._videoRenditions)==null||t._destroy(),this._videoRenditions=null;for(let r of this.stateReceivers)bo(r);if(this.stateReceivers=[],this._playerCore&&(this._playerCore.destroy(),this._playerCore=null),this.providerContainer)for(;this.providerContainer.firstChild;)this.providerContainer.removeChild(this.providerContainer.firstChild);this.clearVideoDimensions(),this._hasDispatchedReady=!1}updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r)),this.debug&&console.log("[BPPlayer] Set video dimensions:",{width:t,height:r})):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"),this.debug&&console.log("[BPPlayer] Cleared video dimensions"))}clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}getContainerClasses(){return["bp-player-container",`bp-player-container--${this.scaling}`].join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}render(){return Ze`
236
+ `;var Dh=!1;function lf(){if(Dh||(Dh=!0,document.getElementById("bp-player-styles")))return;Hr();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=Ph,document.head.appendChild(i)}var df=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Me=class extends Oe{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=null;this._hasDispatchedReady=!1;this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let n of r.addedNodes)n.nodeType===Node.ELEMENT_NODE&&Yi(n,this.providerContainer,this.registerStateReceiver);for(let n of r.removedNodes)n.nodeType===Node.ELEMENT_NODE&&Yi(n,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&go(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),bo(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),lf(),this._mutationObserver=new MutationObserver(this.handleMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}get player(){return this._playerCore}get playerState(){var t;return((t=this._playerCore)==null?void 0:t.state)??null}get bpLive(){var t;return((t=this._playerCore)==null?void 0:t.bpLive)??null}async play(){var t;this.debug&&console.log("[BPPlayer] play() called"),await((t=this._playerCore)==null?void 0:t.play())}pause(){var t;this.debug&&console.log("[BPPlayer] pause() called"),(t=this._playerCore)==null||t.pause()}get paused(){var r;let t=((r=this._playerCore)==null?void 0:r.state.paused)??!0;return this.debug&&console.log("[BPPlayer] paused getter:",t),t}get ended(){var t;return((t=this._playerCore)==null?void 0:t.state.ended)??!1}get seeking(){var t;return((t=this._playerCore)==null?void 0:t.state.seeking)??!1}get waiting(){var t;return((t=this._playerCore)==null?void 0:t.state.waiting)??!1}get currentTime(){var t;return((t=this._playerCore)==null?void 0:t.state.currentTime)??0}set currentTime(t){var r;(r=this._playerCore)==null||r.seek(t)}get duration(){var t;return((t=this._playerCore)==null?void 0:t.state.duration)??NaN}get volume(){var t;return((t=this._playerCore)==null?void 0:t.state.volume)??1}set volume(t){var r;(r=this._playerCore)==null||r.setVolume(t)}get muted(){var t;return((t=this._playerCore)==null?void 0:t.state.muted)??this.defaultMuted}set muted(t){var r;(r=this._playerCore)==null||r.setMuted(t)}get playbackRate(){var t;return((t=this._playerCore)==null?void 0:t.state.playbackRate)??1}set playbackRate(t){var r;(r=this._playerCore)==null||r.setPlaybackRate(t)}get readyState(){var t;return((t=this._playerCore)==null?void 0:t.state.readyState)??0}get buffered(){var r;let t=(r=this._playerCore)==null?void 0:r.state.buffered;return t||{length:0,start:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")},end:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")}}}get videoWidth(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.width?r.width:((s=this._playerCore)==null?void 0:s.state.videoWidth)??0}get videoHeight(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.height?r.height:((s=this._playerCore)==null?void 0:s.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}webkitEnterFullscreen(){var r,n;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;(n=t==null?void 0:t.webkitEnterFullscreen)==null||n.call(t)}get webkitDisplayingFullscreen(){var r;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;return(t==null?void 0:t.webkitDisplayingFullscreen)??!1}get webkitPresentationMode(){var r;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;return(t==null?void 0:t.webkitPresentationMode)??"inline"}get providerType(){var t;return((t=this._playerCore)==null?void 0:t.state.providerType)??null}get videoRenditions(){return this._videoRenditions}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._mutationObserver)==null||t.disconnect(),this.destroyPlayer()}firstUpdated(t){super.firstUpdated(t),this.containerRef=this.renderRoot.querySelector(".bp-player-container"),this.containerRef&&!this.providerContainer&&(this.providerContainer=document.createElement("div"),this.providerContainer.className="bp-player-provider",this.providerContainer.style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.containerRef.appendChild(this.providerContainer)),this.initPlayerCore()}updated(t){super.updated(t),t.has("source")&&this.loadSource(),t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}initPlayerCore(){var t;if(!(this._playerCore||!this.providerContainer))try{this._playerCore=zs(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new Xs(this),this._hasDispatchedReady||(this._hasDispatchedReady=!0,Yi(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent(Qi(ko,{detail:this._playerCore})),this.debug&&console.log("[BPPlayer] Player ready",(t=this._playerCore)==null?void 0:t.state))}catch(r){console.error("[BPPlayer] Failed to initialize player:",r),this.dispatchEvent(Ne(r instanceof Error?r:new Error(String(r))))}}async loadSource(){var r,n,o,s,l,d;let t=(n=(r=this.source)==null?void 0:r.sources)==null?void 0:n[0];if(!t){(o=this._playerCore)!=null&&o.ready&&this._playerCore.unloadSource();return}if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadSource skipped - player not initialized");return}this.debug&&console.log("[BPPlayer] loadSource:",t);try{let h=await this._playerCore.loadSource(t);if(!this._playerCore)return;if(h!=null&&h.videoWidth&&(h!=null&&h.videoHeight)&&(this.updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPPlayer] Source video dimensions:",{width:h.videoWidth,height:h.videoHeight})),(s=this._videoRenditions)==null||s._setupListeners(),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(d=(l=this._playerCore)==null?void 0:l.state)!=null&&d.paused&&this.dispatchEvent(j(ai)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h),this.dispatchEvent(Ne(h instanceof Error?h:new Error(String(h))))}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)go(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;let t=this._playerCore;for(let d of df){let h=()=>{this.debug&&!["durationchange","timeupdate"].includes(d)&&console.log(`[BPPlayer] Forwarding event: ${d}`,t.state),this.dispatchEvent(j(d))};t.addEventListener(d,h),this.eventCleanup.push(()=>t.removeEventListener(d,h))}let r=()=>{let d=t.videoElement;d&&this.updateVideoDimensions(d.videoWidth,d.videoHeight)};t.addEventListener("resize",r),t.addEventListener("loadedmetadata",r),this.eventCleanup.push(()=>t.removeEventListener("resize",r)),this.eventCleanup.push(()=>t.removeEventListener("loadedmetadata",r)),r();let n=()=>{this.dispatchEvent(j(di))};t.addEventListener("qualitychange",n),this.eventCleanup.push(()=>t.removeEventListener("qualitychange",n));let o=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};t.addEventListener("statechange",o),this.eventCleanup.push(()=>t.removeEventListener("statechange",o));let s=[],l=()=>{s.forEach(h=>h()),s=[];let d=t.activeVideoElement;if(d)for(let h of["webkitbeginfullscreen","webkitendfullscreen"]){let p=()=>this.dispatchEvent(new Event(h));d.addEventListener(h,p),s.push(()=>d.removeEventListener(h,p))}};l(),t.addEventListener("activevideoelementchange",l),this.eventCleanup.push(()=>t.removeEventListener("activevideoelementchange",l)),this.eventCleanup.push(()=>s.forEach(d=>d()))}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;_e(this,"paused",t.paused),_e(this,"playing",t.playing),_e(this,"ended",t.ended),_e(this,"seeking",t.seeking),_e(this,"waiting",t.waiting),_e(this,"has-error",t.error!==null),_e(this,"ready",this._playerCore.ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}destroyPlayer(){var t;this.eventCleanup.forEach(r=>r()),this.eventCleanup=[],(t=this._videoRenditions)==null||t._destroy(),this._videoRenditions=null;for(let r of this.stateReceivers)bo(r);if(this.stateReceivers=[],this._playerCore&&(this._playerCore.destroy(),this._playerCore=null),this.providerContainer)for(;this.providerContainer.firstChild;)this.providerContainer.removeChild(this.providerContainer.firstChild);this.clearVideoDimensions(),this._hasDispatchedReady=!1}updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r)),this.debug&&console.log("[BPPlayer] Set video dimensions:",{width:t,height:r})):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"),this.debug&&console.log("[BPPlayer] Cleared video dimensions"))}clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}getContainerClasses(){return["bp-player-container",`bp-player-container--${this.scaling}`].join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}render(){return Ze`
237
237
  <div
238
238
  class="${this.getContainerClasses()}"
239
239
  style="${this.getContainerStyle()}"
240
240
  >
241
241
  </div>
242
- `}};B([Z({converter:$r()})],Me.prototype,"source",2),B([Z({type:Boolean})],Me.prototype,"autoplay",2),B([Z({type:Boolean,reflect:!0,attribute:"muted"})],Me.prototype,"defaultMuted",2),B([Z({type:Boolean})],Me.prototype,"loop",2),B([Z({type:String})],Me.prototype,"scaling",2),B([Z({type:String,attribute:"aspect-ratio"})],Me.prototype,"aspectRatio",2),B([Z({converter:$r()})],Me.prototype,"config",2),B([Z({type:Boolean})],Me.prototype,"debug",2),B([si()],Me.prototype,"_playerCore",2),Me=B([oi("bp-player")],Me);var _={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",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"},V={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Pd={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_LOOP:"mediaLoop",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_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},Dh=Object.entries(Pd),a=Dh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),df={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Zi=Dh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...df}),_T=Object.entries(Zi).reduce((i,[e,t])=>{let r=a[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),Oh=Object.entries(a).reduce((i,[e,t])=>{let r=Zi[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Ue={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ci={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var js={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},He={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},at={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Nh={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Uh(i){return i==null?void 0:i.map(uf).join(" ")}function Hh(i){return i==null?void 0:i.split(/\s+/).map(hf)}function uf(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(n=>n!=null).join(":")}}function hf(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function $h(i){return i==null?void 0:i.map(pf).join(" ")}function Vh(i){return i==null?void 0:i.split(/\s+/).map(mf)}function pf(i){if(i){let{id:e,kind:t,language:r,label:n}=i;return[e,t,r,n].filter(o=>o!=null).join(":")}}function mf(i){if(i){let[e,t,r,n]=i.split(":");return{id:e,kind:t,language:r,label:n}}}function Wr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var Js=i=>new Promise(e=>setTimeout(e,i));var Bh=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],vf=(i,e)=>{let t=i===1?Bh[e].singular:Bh[e].plural;return`${i} ${t}`},Xi=i=>{if(!Wr(i))return"";let e=Math.abs(i),t=e!==i,r=new Date(0,0,0,0,0,e,0);return`${[r.getHours(),r.getMinutes(),r.getSeconds()].map((l,d)=>l&&vf(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function lt(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),n=Math.floor(i/60%60),o=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(o=n=r="0"),o=o>0||l>0?o+":":"",n=((o||s>=10)&&n<10?"0"+n:n)+":",r=r<10?"0"+r:r,(t?"-":"")+o+n+r}var AT=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var Wh={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var Fh,Dd={en:Wh},Od=((Fh=globalThis.navigator)==null?void 0:Fh.language)||"en",Kh=i=>{Od=i};var Ef=i=>{var e,t,r;let[n]=Od.split("-");return((e=Dd[Od])==null?void 0:e[i])||((t=Dd[n])==null?void 0:t[i])||((r=Dd.en)==null?void 0:r[i])||i},b=(i,e={})=>Ef(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var ea=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},ta=class extends ea{},ia=class extends ta{constructor(){super(...arguments),this.role=null}},Nd=class{observe(){}unobserve(){}disconnect(){}},qh={createElement:function(){return new Lo.HTMLElement},createElementNS:function(){return new Lo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Lo={ResizeObserver:Nd,document:qh,Node:ta,Element:ia,HTMLElement:class extends ia{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Lo.DocumentFragment}},DocumentFragment:class extends ea{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},Gh="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",zh=Object.keys(Lo).every(i=>i in globalThis),u=Gh&&!zh?Lo:globalThis,le=Gh&&!zh?qh:globalThis.document;var Yh=new WeakMap,Ud=i=>{let e=Yh.get(i);return e||Yh.set(i,e=new Set),e},Qh=new u.ResizeObserver(i=>{for(let e of i)for(let t of Ud(e.target))t(e)});function Wt(i,e){Ud(i).add(e),Qh.observe(i)}function Ft(i,e){let t=Ud(i);t.delete(e),t.size||Qh.unobserve(i)}function ae(i){let e={};for(let t of i)e[t.name]=t.value;return e}function ne(i){var e;return(e=ra(i))!=null?e:bt(i,"media-controller")}function ra(i){var e;let{MEDIA_CONTROLLER:t}=V,r=i.getAttribute(t);if(r)return(e=ji(i))==null?void 0:e.getElementById(r)}var na=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},gf=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},oa=(i,e)=>gf(i,e)[0],xe=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:xe(i,e.getRootNode().host),bt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||bt(i.getRootNode().host,e)};function wo(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=wo(t.shadowRoot))!=null?e:t:null}function ji(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function sa(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let n=i;for(;n&&e>0;){let o=getComputedStyle(n);if(t&&o.opacity==="0"||r&&o.visibility==="hidden"||o.display==="none")return!1;n=n.parentElement,e--}return!0}function Zh(i,e,t,r){let n=r.x-t.x,o=r.y-t.y,s=n*n+o*o;if(s===0)return 0;let l=((i-t.x)*n+(e-t.y)*o)/s;return Math.max(0,Math.min(1,l))}function oe(i,e){let t=bf(i,r=>r===e);return t||Io(i,e)}function bf(i,e){var t,r;let n;for(n of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let o;try{o=(r=n.sheet)==null?void 0:r.cssRules}catch{continue}for(let s of o??[])if(e(s.selectorText))return s}}function Io(i,e){var t,r;let n=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],o=n==null?void 0:n[n.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(r=o.sheet.cssRules)==null?void 0:r[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function q(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function z(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}q(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function M(i,e){return i.hasAttribute(e)}function x(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}M(i,e)!=t&&i.toggleAttribute(e,t)}function O(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function N(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;O(i,e,void 0)!==r&&i.setAttribute(e,r)}var Xh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ui=(i,e,t)=>(Xh(i,e,"read from private field"),t?t.call(i):e.get(i)),_f=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},aa=(i,e,t,r)=>(Xh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$e;function yf(i){return`
242
+ `}};B([Z({converter:$r()})],Me.prototype,"source",2),B([Z({type:Boolean})],Me.prototype,"autoplay",2),B([Z({type:Boolean,reflect:!0,attribute:"muted"})],Me.prototype,"defaultMuted",2),B([Z({type:Boolean})],Me.prototype,"loop",2),B([Z({type:String})],Me.prototype,"scaling",2),B([Z({type:String,attribute:"aspect-ratio"})],Me.prototype,"aspectRatio",2),B([Z({converter:$r()})],Me.prototype,"config",2),B([Z({type:Boolean})],Me.prototype,"debug",2),B([si()],Me.prototype,"_playerCore",2),Me=B([oi("bp-player")],Me);var _={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",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"},V={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Pd={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_LOOP:"mediaLoop",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_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},Oh=Object.entries(Pd),a=Oh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),cf={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Zi=Oh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...cf}),yT=Object.entries(Zi).reduce((i,[e,t])=>{let r=a[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),Nh=Object.entries(a).reduce((i,[e,t])=>{let r=Zi[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Ue={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ci={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var js={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},He={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},at={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Uh={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Hh(i){return i==null?void 0:i.map(hf).join(" ")}function $h(i){return i==null?void 0:i.split(/\s+/).map(pf)}function hf(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(n=>n!=null).join(":")}}function pf(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function Vh(i){return i==null?void 0:i.map(mf).join(" ")}function Bh(i){return i==null?void 0:i.split(/\s+/).map(vf)}function mf(i){if(i){let{id:e,kind:t,language:r,label:n}=i;return[e,t,r,n].filter(o=>o!=null).join(":")}}function vf(i){if(i){let[e,t,r,n]=i.split(":");return{id:e,kind:t,language:r,label:n}}}function Wr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var Js=i=>new Promise(e=>setTimeout(e,i));var Wh=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],ff=(i,e)=>{let t=i===1?Wh[e].singular:Wh[e].plural;return`${i} ${t}`},Xi=i=>{if(!Wr(i))return"";let e=Math.abs(i),t=e!==i,r=new Date(0,0,0,0,0,e,0);return`${[r.getHours(),r.getMinutes(),r.getSeconds()].map((l,d)=>l&&ff(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function lt(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),n=Math.floor(i/60%60),o=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(o=n=r="0"),o=o>0||l>0?o+":":"",n=((o||s>=10)&&n<10?"0"+n:n)+":",r=r<10?"0"+r:r,(t?"-":"")+o+n+r}var ST=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var Fh={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var Kh,Dd={en:Fh},Od=((Kh=globalThis.navigator)==null?void 0:Kh.language)||"en",qh=i=>{Od=i};var gf=i=>{var e,t,r;let[n]=Od.split("-");return((e=Dd[Od])==null?void 0:e[i])||((t=Dd[n])==null?void 0:t[i])||((r=Dd.en)==null?void 0:r[i])||i},b=(i,e={})=>gf(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var ea=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},ta=class extends ea{},ia=class extends ta{constructor(){super(...arguments),this.role=null}},Nd=class{observe(){}unobserve(){}disconnect(){}},Gh={createElement:function(){return new Lo.HTMLElement},createElementNS:function(){return new Lo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Lo={ResizeObserver:Nd,document:Gh,Node:ta,Element:ia,HTMLElement:class extends ia{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Lo.DocumentFragment}},DocumentFragment:class extends ea{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},zh="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Yh=Object.keys(Lo).every(i=>i in globalThis),u=zh&&!Yh?Lo:globalThis,le=zh&&!Yh?Gh:globalThis.document;var Qh=new WeakMap,Ud=i=>{let e=Qh.get(i);return e||Qh.set(i,e=new Set),e},Zh=new u.ResizeObserver(i=>{for(let e of i)for(let t of Ud(e.target))t(e)});function Wt(i,e){Ud(i).add(e),Zh.observe(i)}function Ft(i,e){let t=Ud(i);t.delete(e),t.size||Zh.unobserve(i)}function ae(i){let e={};for(let t of i)e[t.name]=t.value;return e}function ne(i){var e;return(e=ra(i))!=null?e:bt(i,"media-controller")}function ra(i){var e;let{MEDIA_CONTROLLER:t}=V,r=i.getAttribute(t);if(r)return(e=ji(i))==null?void 0:e.getElementById(r)}var na=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},bf=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},oa=(i,e)=>bf(i,e)[0],xe=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:xe(i,e.getRootNode().host),bt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||bt(i.getRootNode().host,e)};function wo(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=wo(t.shadowRoot))!=null?e:t:null}function ji(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function sa(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let n=i;for(;n&&e>0;){let o=getComputedStyle(n);if(t&&o.opacity==="0"||r&&o.visibility==="hidden"||o.display==="none")return!1;n=n.parentElement,e--}return!0}function Xh(i,e,t,r){let n=r.x-t.x,o=r.y-t.y,s=n*n+o*o;if(s===0)return 0;let l=((i-t.x)*n+(e-t.y)*o)/s;return Math.max(0,Math.min(1,l))}function oe(i,e){let t=_f(i,r=>r===e);return t||Io(i,e)}function _f(i,e){var t,r;let n;for(n of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let o;try{o=(r=n.sheet)==null?void 0:r.cssRules}catch{continue}for(let s of o??[])if(e(s.selectorText))return s}}function Io(i,e){var t,r;let n=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],o=n==null?void 0:n[n.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(r=o.sheet.cssRules)==null?void 0:r[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function q(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function z(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}q(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function M(i,e){return i.hasAttribute(e)}function x(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}M(i,e)!=t&&i.toggleAttribute(e,t)}function O(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function N(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;O(i,e,void 0)!==r&&i.setAttribute(e,r)}var jh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ui=(i,e,t)=>(jh(i,e,"read from private field"),t?t.call(i):e.get(i)),yf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},aa=(i,e,t,r)=>(jh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$e;function Tf(i){return`
243
243
  <style>
244
244
  :host {
245
245
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
246
246
  box-sizing: border-box;
247
247
  }
248
248
  </style>
249
- `}var Fr=class extends u.HTMLElement{constructor(){if(super(),_f(this,$e,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[V.MEDIA_CONTROLLER,a.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===V.MEDIA_CONTROLLER&&(t&&((o=(n=ui(this,$e))==null?void 0:n.unassociateElement)==null||o.call(n,this),aa(this,$e,null)),r&&this.isConnected&&(aa(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ui(this,$e))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r,n;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),aa(this,$e,Tf(this)),this.getAttribute(V.MEDIA_CONTROLLER)&&((t=(e=ui(this,$e))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=ui(this,$e))==null||r.addEventListener("pointerdown",this),(n=ui(this,$e))==null||n.addEventListener("click",this)}disconnectedCallback(){var e,t,r,n;this.getAttribute(V.MEDIA_CONTROLLER)&&((t=(e=ui(this,$e))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=ui(this,$e))==null||r.removeEventListener("pointerdown",this),(n=ui(this,$e))==null||n.removeEventListener("click",this),aa(this,$e,null)}handleEvent(e){var t;let r=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(r==null?void 0:r.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:o,clientY:s}=e,{left:l,top:d,width:h,height:p}=this.getBoundingClientRect(),g=o-l,f=s-d;if(g<0||f<0||g>h||f>p||h===0&&p===0)return;let E=this._pointerType||"mouse";if(this._pointerType=void 0,E===js.TOUCH){this.handleTap(e);return}else if(E===js.MOUSE||E===js.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?_.MEDIA_PLAY_REQUEST:_.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(t,{composed:!0,bubbles:!0}))}};$e=new WeakMap;Fr.shadowRootOptions={mode:"open"};Fr.getTemplateHTML=yf;function Tf(i){var e;let t=i.getAttribute(V.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):bt(i,"media-controller")}u.customElements.get("media-gesture-receiver")||u.customElements.define("media-gesture-receiver",Fr);var la=Fr;var Bd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qe=(i,e,t)=>(Bd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ke=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ji=(i,e,t,r)=>(Bd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),je=(i,e,t)=>(Bd(i,e,"access private method"),t),ua,Kr,Ro,qr,da,Hd,jh,Co,ca,$d,Jh,Vd,ep,Mo,ha,pa,Wd,Gr,xo,D={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Af(i){return`
249
+ `}var Fr=class extends u.HTMLElement{constructor(){if(super(),yf(this,$e,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[V.MEDIA_CONTROLLER,a.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===V.MEDIA_CONTROLLER&&(t&&((o=(n=ui(this,$e))==null?void 0:n.unassociateElement)==null||o.call(n,this),aa(this,$e,null)),r&&this.isConnected&&(aa(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ui(this,$e))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r,n;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),aa(this,$e,Af(this)),this.getAttribute(V.MEDIA_CONTROLLER)&&((t=(e=ui(this,$e))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=ui(this,$e))==null||r.addEventListener("pointerdown",this),(n=ui(this,$e))==null||n.addEventListener("click",this)}disconnectedCallback(){var e,t,r,n;this.getAttribute(V.MEDIA_CONTROLLER)&&((t=(e=ui(this,$e))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=ui(this,$e))==null||r.removeEventListener("pointerdown",this),(n=ui(this,$e))==null||n.removeEventListener("click",this),aa(this,$e,null)}handleEvent(e){var t;let r=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(r==null?void 0:r.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:o,clientY:s}=e,{left:l,top:d,width:h,height:p}=this.getBoundingClientRect(),g=o-l,f=s-d;if(g<0||f<0||g>h||f>p||h===0&&p===0)return;let E=this._pointerType||"mouse";if(this._pointerType=void 0,E===js.TOUCH){this.handleTap(e);return}else if(E===js.MOUSE||E===js.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?_.MEDIA_PLAY_REQUEST:_.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(t,{composed:!0,bubbles:!0}))}};$e=new WeakMap;Fr.shadowRootOptions={mode:"open"};Fr.getTemplateHTML=Tf;function Af(i){var e;let t=i.getAttribute(V.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):bt(i,"media-controller")}u.customElements.get("media-gesture-receiver")||u.customElements.define("media-gesture-receiver",Fr);var la=Fr;var Bd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qe=(i,e,t)=>(Bd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ke=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ji=(i,e,t,r)=>(Bd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),je=(i,e,t)=>(Bd(i,e,"access private method"),t),ua,Kr,Ro,qr,da,Hd,Jh,Co,ca,$d,ep,Vd,tp,Mo,ha,pa,Wd,Gr,xo,D={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Sf(i){return`
250
250
  <style>
251
251
 
252
252
  :host([${a.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -397,7 +397,7 @@ bp-player[has-error] {
397
397
  <slot part="bottom chrome"></slot>
398
398
  </span>
399
399
  <slot name="dialog" part="layer dialog-layer"></slot>
400
- `}var Sf=Object.values(a),kf="sm:384 md:576 lg:768 xl:960";function Lf(i){tp(i.target,i.contentRect.width)}function tp(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(D.BREAKPOINTS))!=null?t:kf,n=wf(r),o=If(n,e),s=!1;if(Object.keys(n).forEach(l=>{if(o.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Zi.BREAKPOINTS_CHANGE,{detail:o});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Zi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function wf(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function If(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var er=class extends u.HTMLElement{constructor(){if(super(),Ke(this,Hd),Ke(this,$d),Ke(this,Vd),Ke(this,Mo),Ke(this,pa),Ke(this,Gr),Ke(this,ua,0),Ke(this,Kr,null),Ke(this,Ro,null),Ke(this,qr,void 0),this.breakpointsComputed=!1,Ke(this,da,new MutationObserver(je(this,Hd,jh).bind(this))),Ke(this,Co,!1),Ke(this,ca,t=>{qe(this,Co)||(setTimeout(()=>{Lf(t),Ji(this,Co,!1)},0),Ji(this,Co,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=ae(this.attributes),r=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(r):this.shadowRoot.innerHTML=r}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){qe(this,Kr)&&this.mediaUnsetCallback(qe(this,Kr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[D.AUTOHIDE,D.GESTURES_DISABLED].concat(Sf).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,r){e.toLowerCase()==D.AUTOHIDE&&(this.autohide=r)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Ji(this,Kr,e),e.localName.includes("-")&&await u.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;qe(this,da).observe(this,{childList:!0,subtree:!0}),Wt(this,qe(this,ca));let r=this.getAttribute(D.AUDIO)!=null?b("audio player"):b("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(D.USER_INACTIVE,""),tp(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=u.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;qe(this,da).disconnect(),Ft(this,qe(this,ca)),this.media&&this.mediaUnsetCallback(this.media),(e=u.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ji(this,Kr,null)}handleEvent(e){switch(e.type){case"pointerdown":Ji(this,ua,e.timeStamp);break;case"pointermove":je(this,$d,Jh).call(this,e);break;case"pointerup":je(this,Vd,ep).call(this,e);break;case"mouseleave":je(this,Mo,ha).call(this);break;case"mouseup":this.removeAttribute(D.KEYBOARD_CONTROL);break;case"keyup":je(this,Gr,xo).call(this),this.setAttribute(D.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ji(this,qr,isNaN(t)?0:t)}get autohide(){return(qe(this,qr)===void 0?2:qe(this,qr)).toString()}get breakpoints(){return O(this,D.BREAKPOINTS)}set breakpoints(e){N(this,D.BREAKPOINTS,e)}get audio(){return M(this,D.AUDIO)}set audio(e){x(this,D.AUDIO,e)}get gesturesDisabled(){return M(this,D.GESTURES_DISABLED)}set gesturesDisabled(e){x(this,D.GESTURES_DISABLED,e)}get keyboardControl(){return M(this,D.KEYBOARD_CONTROL)}set keyboardControl(e){x(this,D.KEYBOARD_CONTROL,e)}get noAutohide(){return M(this,D.NO_AUTOHIDE)}set noAutohide(e){x(this,D.NO_AUTOHIDE,e)}get autohideOverControls(){return M(this,D.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){x(this,D.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return M(this,D.USER_INACTIVE)}set userInteractive(e){x(this,D.USER_INACTIVE,e)}};ua=new WeakMap;Kr=new WeakMap;Ro=new WeakMap;qr=new WeakMap;da=new WeakMap;Hd=new WeakSet;jh=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let n of r){if(n.slot!="media"||t.target!=this)continue;let o=t.previousSibling&&t.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(n);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(n)}}if(e)for(let n of t.addedNodes)n===e&&this.handleMediaUpdated(e)}};Co=new WeakMap;ca=new WeakMap;$d=new WeakSet;Jh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-qe(this,ua)<250)return;je(this,pa,Wd).call(this),clearTimeout(qe(this,Ro));let e=this.hasAttribute(D.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&je(this,Gr,xo).call(this)};Vd=new WeakSet;ep=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(D.USER_INACTIVE);[this,this.media].includes(i.target)&&e?je(this,Mo,ha).call(this):je(this,Gr,xo).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&je(this,Gr,xo).call(this)};Mo=new WeakSet;ha=function(){if(qe(this,qr)<0||this.hasAttribute(D.USER_INACTIVE))return;this.setAttribute(D.USER_INACTIVE,"");let i=new u.CustomEvent(Zi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};pa=new WeakSet;Wd=function(){if(!this.hasAttribute(D.USER_INACTIVE))return;this.removeAttribute(D.USER_INACTIVE);let i=new u.CustomEvent(Zi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Gr=new WeakSet;xo=function(){je(this,pa,Wd).call(this),clearTimeout(qe(this,Ro));let i=parseInt(this.autohide);i<0||Ji(this,Ro,setTimeout(()=>{je(this,Mo,ha).call(this)},i*1e3))};er.shadowRootOptions={mode:"open"};er.getTemplateHTML=Af;u.customElements.get("media-container")||u.customElements.define("media-container",er);var ip=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Se=(i,e,t)=>(ip(i,e,"read from private field"),t?t.call(i):e.get(i)),Po=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ma=(i,e,t,r)=>(ip(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),zr,Yr,va,tr,Kt,hi,pi=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){Po(this,Kt),Po(this,zr,void 0),Po(this,Yr,void 0),Po(this,va,void 0),Po(this,tr,new Set),ma(this,zr,e),ma(this,Yr,t),ma(this,va,new Set(r))}[Symbol.iterator](){return Se(this,Kt,hi).values()}get length(){return Se(this,Kt,hi).size}get value(){var e;return(e=[...Se(this,Kt,hi)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(ma(this,tr,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...Se(this,Kt,hi)][e]}values(){return Se(this,Kt,hi).values()}forEach(e,t){Se(this,Kt,hi).forEach(e,t)}add(...e){var t,r;e.forEach(n=>Se(this,tr).add(n)),!(this.value===""&&!((t=Se(this,zr))!=null&&t.hasAttribute(`${Se(this,Yr)}`)))&&((r=Se(this,zr))==null||r.setAttribute(`${Se(this,Yr)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>Se(this,tr).delete(r)),(t=Se(this,zr))==null||t.setAttribute(`${Se(this,Yr)}`,`${this.value}`)}contains(e){return Se(this,Kt,hi).has(e)}toggle(e,t){return typeof t<"u"?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}};zr=new WeakMap;Yr=new WeakMap;va=new WeakMap;tr=new WeakMap;Kt=new WeakSet;hi=function(){return Se(this,tr).size?Se(this,tr):Se(this,va)};var Cf=(i="")=>i.split(/\s+/),rp=(i="")=>{let[e,t,r]=i.split(":"),n=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Ue.CAPTIONS:Ue.SUBTITLES,language:t,label:n}},ir=(i="",e={})=>Cf(i).map(t=>{let r=rp(t);return{...e,...r}}),Fd=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?rp(e):e):typeof i=="string"?ir(i):[i]:[],fa=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,qt=(i=[])=>Array.prototype.map.call(i,fa).join(" "),Rf=(i,e)=>t=>t[i]===e,np=i=>{let e=Object.entries(i).map(([t,r])=>Rf(t,r));return t=>e.every(r=>r(t))},rr=(i,e=[],t=[])=>{let r=Fd(t).map(np),n=o=>r.some(s=>s(o));Array.from(e).filter(n).forEach(o=>{o.mode=i})},nr=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:np(e);return Array.from(i.textTracks).filter(t)},Ea=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(a.MEDIA_SUBTITLES_SHOWING)};var sp=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let n=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(n){let o=(e=r[n])==null?void 0:e.call(r);if(o instanceof Promise)return o.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(n){console.error(n)}},op="exitFullscreen"in le?"exitFullscreen":"webkitExitFullscreen"in le?"webkitExitFullscreen":"webkitCancelFullScreen"in le?"webkitCancelFullScreen":void 0,ap=i=>{var e;let{documentElement:t}=i;if(op){let r=(e=t==null?void 0:t[op])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},Do="fullscreenElement"in le?"fullscreenElement":"webkitFullscreenElement"in le?"webkitFullscreenElement":void 0,Mf=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[Do];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===Nh.FULLSCREEN?t:r},lp=i=>{var e;let{media:t,documentElement:r,fullscreenElement:n=t}=i;if(!t||!r)return!1;let o=Mf(i);if(!o)return!1;if(o===n||o===t)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(Do in s))return xe(o,n);for(;s!=null&&s[Do];){if(s[Do]===n)return!0;s=(e=s[Do])==null?void 0:e.shadowRoot}}return!1},xf="fullscreenEnabled"in le?"fullscreenEnabled":"webkitFullscreenEnabled"in le?"webkitFullscreenEnabled":void 0,dp=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[xf])||t&&"webkitSupportsFullscreen"in t};var ga,Kd=()=>{var i,e;return ga||(ga=(e=(i=le)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),ga)},cp=async(i=Kd())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([Pf(i,t.signal),Df(i,e)]);return t.abort(),r},Pf=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),Df=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await Js(10)}return i.volume!==e},Of=/.*Version\/.*Safari\/.*/.test(u.navigator.userAgent),qd=(i=Kd())=>u.matchMedia("(display-mode: standalone)").matches&&Of?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Gd=(i=Kd())=>dp({documentElement:le,media:i}),up=Gd(),hp=qd(),pp=!!u.WebKitPlaybackTargetAvailabilityEvent,mp=!!u.chrome;var Qr=i=>nr(i.media,e=>[Ue.SUBTITLES,Ue.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),zd=i=>nr(i.media,e=>e.mode===ci.SHOWING&&[Ue.SUBTITLES,Ue.CAPTIONS].includes(e.kind)),ba=(i,e)=>{let t=Qr(i),r=zd(i),n=!!r.length;if(t.length){if(e===!1||n&&e!==!0)rr(ci.DISABLED,t,r);else if(e===!0||!n&&e!==!1){let o=t[0],{options:s}=i;if(!(s!=null&&s.noSubtitlesLangPref)){let p=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=p?[p,...globalThis.navigator.languages]:globalThis.navigator.languages,f=t.filter(E=>g.some(T=>E.language.toLowerCase().startsWith(T.split("-")[0]))).sort((E,T)=>{let v=g.findIndex(I=>E.language.toLowerCase().startsWith(I.split("-")[0])),S=g.findIndex(I=>T.language.toLowerCase().startsWith(I.split("-")[0]));return v-S});f[0]&&(o=f[0])}let{language:l,label:d,kind:h}=o;rr(ci.DISABLED,t,r),rr(ci.SHOWING,t,[{language:l,label:d,kind:h}])}}},_a=(i,e)=>i===e?!0:i==null||e==null||typeof i!=typeof e?!1:typeof i=="number"&&Number.isNaN(i)&&Number.isNaN(e)?!0:typeof i!="object"?!1:Array.isArray(i)?Nf(i,e):Object.entries(i).every(([t,r])=>t in e&&_a(r,e[t])),Nf=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((n,o)=>_a(n,e[o])):!0};var Uf=Object.values(at),ya,Hf=cp().then(i=>(ya=i,ya)),vp=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof u.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=u.customElements.get(t);r&&e instanceof r||(await u.customElements.whenDefined(t),u.customElements.upgrade(e))}))},$f=new u.DOMParser,Vf=i=>i&&($f.parseFromString(i,"text/html").body.textContent||i),Zr={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(t=r==null?void 0:r.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,r;let{media:n}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=n==null?void 0:n.error)==null?void 0:t.message)!=null?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:r}=e;r&&(i?r.pause():(t=r.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t,options:{noMutedPref:r}={}}=e;if(t){t.muted=i;try{let n=u.localStorage.getItem("media-chrome-pref-muted")!==null,o=t.hasAttribute("muted");if(r){n&&u.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!n)return;u.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(n){console.debug("Error setting muted pref",n)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let n=u.localStorage.getItem("media-chrome-pref-muted")==="true";Zr.mediaMuted.set(n,e),i(n)}catch(n){console.debug("Error getting muted pref",n)}}]},mediaLoop:{get(i){let{media:e}=i;return e==null?void 0:e.loop},set(i,e){let{media:t}=e;t&&(t.loop=i)},mediaEvents:["medialooprequest"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t,options:{noVolumePref:r}={}}=e;if(t){try{i==null?u.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&u.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(n){console.debug("Error setting volume pref",n)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:r}=e;if(!r)return;let n=u.localStorage.getItem("media-chrome-pref-volume");if(n==null)return;Zr.mediaVolume.set(+n,e),i(+n)}catch(r){console.debug("Error getting volume pref",r)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!Wr(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let r=t.seekable.start(0),n=t.seekable.end(t.seekable.length-1);if(!(!r&&!n))return[Number(r.toFixed(3)),Number(n.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,r=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(r).map((n,o)=>[Number(r.start(o).toFixed(3)),Number(r.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[at.LIVE,at.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:n}=e;if(Uf.includes(n))return n===at.UNKNOWN?r:n;let o=e.duration;return o===1/0?at.LIVE:Number.isFinite(o)?at.ON_DEMAND:r},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,r=Zr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===at.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Zr.mediaStreamType.get(i)===at.LIVE))return!1;let n=e.seekable;if(!n)return!0;if(!n.length)return!1;let o=n.end(n.length-1)-t;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return Qr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return zd(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,r;let{media:n,options:o}=e;if(!n)return;let s=l=>{var d;!o.defaultSubtitles||l&&![Ue.CAPTIONS,Ue.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||ba(e,!0)};return n.addEventListener("loadstart",s),(t=n.textTracks)==null||t.addEventListener("addtrack",s),(r=n.textTracks)==null||r.addEventListener("removetrack",s),()=>{var l,d;n.removeEventListener("loadstart",s),(l=n.textTracks)==null||l.removeEventListener("addtrack",s),(d=n.textTracks)==null||d.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=nr(t,{kind:Ue.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:n,startTime:o,endTime:s})=>({text:Vf(n),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let n=r.querySelector('track[kind="chapters"][default][src]'),o=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return n==null||n.addEventListener("load",i),o==null||o.addEventListener("load",i),()=>{n==null||n.removeEventListener("load",i),o==null||o.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:n}=i;if(!r||!n||!n.pictureInPictureElement)return!1;if(n.pictureInPictureElement===r)return!0;if(n.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?xe(r,n.pictureInPictureElement):!1;if(n.pictureInPictureElement.localName.includes("-")){let o=n.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===r)return!0;o=(t=o.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!le.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let r=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(n=>{if(n.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let o=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(r),o()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),o()},1e3)}else throw n}else throw n})}else le.pictureInPictureElement&&le.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(r=>({...r}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,r;let{media:n}=i;return(r=(t=n==null?void 0:n.videoRenditions)==null?void 0:t[(e=n.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:r.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let r=i,n=Array.prototype.findIndex.call(t.videoRenditions,o=>o.id==r);t.videoRenditions.selectedIndex!=n&&(t.videoRenditions.selectedIndex=n)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:r}=i;return(t=[...(e=r==null?void 0:r.audioTracks)!=null?e:[]].find(n=>n.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let r=i;for(let n of t.audioTracks)n.enabled=r==n.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return lp(i)},set(i,e,t){var r;i?(sp(e),t.detail&&((r=e.media)==null||r.focus())):ap(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,r;let{media:n}=e;if(n&&!(i&&((t=n.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=n.remote)==null?void 0:r.state)!=="connected")){if(typeof n.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}n.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&u.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!up||!Gd(e))return He.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!hp||!qd(e))return He.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return He.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(ya===!1||(e==null?void 0:e.volume)==null)return He.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{ya==null&&Hf.then(e=>i(e?void 0:He.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!mp||!((t=r==null?void 0:r.remote)!=null&&t.state))return He.UNSUPPORTED;if(!(e==null||e==="available"))return He.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!pp)return He.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return He.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return He.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return He.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return He.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return He.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var fp={[_.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,n,o;let{media:s}=e,l=t??void 0,d,h;if(s&&l!=null){let[E]=nr(s,{kind:Ue.METADATA,label:"thumbnails"}),T=Array.prototype.find.call((r=E==null?void 0:E.cues)!=null?r:[],(v,S,I)=>S===0?v.endTime>l:S===I.length-1?v.startTime<=l:v.startTime<=l&&v.endTime>l);if(T){let v=/'^(?:[a-z]+:)?\/\//i.test(T.text)||(n=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:n.src,S=new URL(T.text,v);h=new URLSearchParams(S.hash).get("#xywh").split(",").map(F=>+F),d=S.href}}let p=i.mediaDuration.get(e),f=(o=i.mediaChaptersCues.get(e).find((E,T,v)=>T===v.length-1&&p===E.endTime?E.startTime<=l&&E.endTime>=l:E.startTime<=l&&E.endTime>l))==null?void 0:o.text;return t!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:h,mediaPreviewChapter:f}},[_.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[_.MEDIA_PLAY_REQUEST](i,e){var t,r,n,o;let s="mediaPaused",d=i.mediaStreamType.get(e)===at.LIVE,h=!((t=e.options)!=null&&t.noAutoSeekToLive),p=i.mediaTargetLiveWindow.get(e)>0;if(d&&h&&!p){let g=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(g){let f=(o=(n=e.options)==null?void 0:n.seekToLiveOffset)!=null?o:0,E=g-f;i.mediaCurrentTime.set(E,e)}}i[s].set(!1,e)},[_.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",n=t;i[r].set(n,e)},[_.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[_.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[_.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",n=!!t;return i[r].set(n,e),{mediaLoop:n}},[_.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",n=t;n&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(n,e)},[_.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",n=t;i[r].set(n,e)},[_.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,n;let o="mediaCurrentTime",s=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(s)))return;let l=(n=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?n:0,d=s-l;i[o].set(d,e)},[_.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:n}=e,o=Qr(e),s=Fd(t),l=(r=s[0])==null?void 0:r.language;l&&!n.noSubtitlesLangPref&&u.localStorage.setItem("media-chrome-pref-subtitles-lang",l),rr(ci.SHOWING,o,s)},[_.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=Qr(e),n=t??[];rr(ci.DISABLED,r,n)},[_.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){ba(e,t)},[_.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",n=t;i[r].set(n,e)},[_.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",n=t;i[r].set(n,e)},[_.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[_.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[_.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e,t){let r="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[r].set(!0,e,t)},[_.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[_.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[_.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[_.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var Ep=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Zr,requestMap:n=fp,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],d={options:{...o}},h=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),p=v=>{v!=null&&(_a(v,h)||(h=Object.freeze({...h,...v}),l.forEach(S=>S(h))))},g=()=>{let v=Object.entries(r).reduce((S,[I,{get:F}])=>(S[I]=F(d),S),{});p(v)},f={},E,T=async(v,S)=>{var I,F,se,De,gt,ii,y,L,$,ue,re,Q,K,Qe,eo,Ou;let Lv=!!E;if(E={...d,...E??{},...v},Lv)return;await vp(...Object.values(v));let xr=l.length>0&&S===0&&s,Nu=d.media!==E.media,Uu=((I=d.media)==null?void 0:I.textTracks)!==((F=E.media)==null?void 0:F.textTracks),Hu=((se=d.media)==null?void 0:se.videoRenditions)!==((De=E.media)==null?void 0:De.videoRenditions),$u=((gt=d.media)==null?void 0:gt.audioTracks)!==((ii=E.media)==null?void 0:ii.audioTracks),Vu=((y=d.media)==null?void 0:y.remote)!==((L=E.media)==null?void 0:L.remote),Bu=d.documentElement!==E.documentElement,Wu=!!d.media&&(Nu||xr),Fu=!!(($=d.media)!=null&&$.textTracks)&&(Uu||xr),Ku=!!((ue=d.media)!=null&&ue.videoRenditions)&&(Hu||xr),qu=!!((re=d.media)!=null&&re.audioTracks)&&($u||xr),Gu=!!((Q=d.media)!=null&&Q.remote)&&(Vu||xr),zu=!!d.documentElement&&(Bu||xr),dd=Wu||Fu||Ku||qu||Gu||zu,Pr=l.length===0&&S===1&&s,R=!!E.media&&(Nu||Pr),Yu=!!((K=E.media)!=null&&K.textTracks)&&(Uu||Pr),Qu=!!((Qe=E.media)!=null&&Qe.videoRenditions)&&(Hu||Pr),Zu=!!((eo=E.media)!=null&&eo.audioTracks)&&($u||Pr),Xu=!!((Ou=E.media)!=null&&Ou.remote)&&(Vu||Pr),ju=!!E.documentElement&&(Bu||Pr),Ju=R||Yu||Qu||Zu||Xu||ju;if(!(dd||Ju)){Object.entries(E).forEach(([ee,to])=>{d[ee]=to}),g(),E=void 0;return}Object.entries(r).forEach(([ee,{get:to,mediaEvents:wv=[],textTracksEvents:Iv=[],videoRenditionsEvents:Cv=[],audioTracksEvents:Rv=[],remoteEvents:Mv=[],rootEvents:xv=[],stateOwnersUpdateHandlers:Pv=[]}])=>{f[ee]||(f[ee]={});let Fe=he=>{let Ee=to(d,he);p({[ee]:Ee})},Te;Te=f[ee].mediaEvents,wv.forEach(he=>{Te&&Wu&&(d.media.removeEventListener(he,Te),f[ee].mediaEvents=void 0),R&&(E.media.addEventListener(he,Fe),f[ee].mediaEvents=Fe)}),Te=f[ee].textTracksEvents,Iv.forEach(he=>{var Ee,ot;Te&&Fu&&((Ee=d.media.textTracks)==null||Ee.removeEventListener(he,Te),f[ee].textTracksEvents=void 0),Yu&&((ot=E.media.textTracks)==null||ot.addEventListener(he,Fe),f[ee].textTracksEvents=Fe)}),Te=f[ee].videoRenditionsEvents,Cv.forEach(he=>{var Ee,ot;Te&&Ku&&((Ee=d.media.videoRenditions)==null||Ee.removeEventListener(he,Te),f[ee].videoRenditionsEvents=void 0),Qu&&((ot=E.media.videoRenditions)==null||ot.addEventListener(he,Fe),f[ee].videoRenditionsEvents=Fe)}),Te=f[ee].audioTracksEvents,Rv.forEach(he=>{var Ee,ot;Te&&qu&&((Ee=d.media.audioTracks)==null||Ee.removeEventListener(he,Te),f[ee].audioTracksEvents=void 0),Zu&&((ot=E.media.audioTracks)==null||ot.addEventListener(he,Fe),f[ee].audioTracksEvents=Fe)}),Te=f[ee].remoteEvents,Mv.forEach(he=>{var Ee,ot;Te&&Gu&&((Ee=d.media.remote)==null||Ee.removeEventListener(he,Te),f[ee].remoteEvents=void 0),Xu&&((ot=E.media.remote)==null||ot.addEventListener(he,Fe),f[ee].remoteEvents=Fe)}),Te=f[ee].rootEvents,xv.forEach(he=>{Te&&zu&&(d.documentElement.removeEventListener(he,Te),f[ee].rootEvents=void 0),ju&&(E.documentElement.addEventListener(he,Fe),f[ee].rootEvents=Fe)});let Us=f[ee].stateOwnersUpdateHandlers;if(Us&&dd&&(Array.isArray(Us)?Us:[Us]).forEach(Ee=>{typeof Ee=="function"&&Ee()}),Ju){let he=Pv.map(Ee=>Ee(Fe,E)).filter(Ee=>typeof Ee=="function");f[ee].stateOwnersUpdateHandlers=he.length===1?he[0]:he}else dd&&(f[ee].stateOwnersUpdateHandlers=void 0)}),Object.entries(E).forEach(([ee,to])=>{d[ee]=to}),g(),E=void 0};return T({media:i,fullscreenElement:e,documentElement:t,options:o}),{dispatch(v){let{type:S,detail:I}=v;if(n[S]&&h.mediaErrorCode==null){p(n[S](r,d,v));return}S==="mediaelementchangerequest"?T({media:I}):S==="fullscreenelementchangerequest"?T({fullscreenElement:I}):S==="documentelementchangerequest"?T({documentElement:I}):S==="optionschangerequest"&&(Object.entries(I??{}).forEach(([F,se])=>{d.options[F]=se}),g())},getState(){return h},subscribe(v){return T({},l.length+1),l.push(v),v(h),()=>{let S=l.indexOf(v);S>=0&&(T({},l.length-1),l.splice(S,1))}}}};var Jd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},P=(i,e,t)=>(Jd(i,e,"read from private field"),t?t.call(i):e.get(i)),Je=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_t=(i,e,t,r)=>(Jd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Tt=(i,e,t)=>(Jd(i,e,"access private method"),t),mi,Oo,Y,sr,No,yt,Ta,Uo,Aa,Yd,ar,Xr,Sa,Qd,Zd,Sp,kp=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],gp=10,bp=.025,_p=.25,Bf=.25,Wf=2,A={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},Xd=class extends er{constructor(){super(),Je(this,Aa),Je(this,ar),Je(this,Sa),Je(this,Zd),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Je(this,mi,new pi(this,A.HOTKEYS)),Je(this,Oo,void 0),Je(this,Y,void 0),Je(this,sr,null),Je(this,No,void 0),Je(this,yt,void 0),Je(this,Ta,t=>{var r;(r=P(this,Y))==null||r.dispatch(t)}),Je(this,Uo,void 0),this.associateElement(this);let e={};_t(this,No,t=>{Object.entries(t).forEach(([r,n])=>{if(r in e&&e[r]===n)return;this.propagateMediaState(r,n);let o=r.toLowerCase(),s=new u.CustomEvent(Oh[o],{composed:!0,detail:n});this.dispatchEvent(s)}),e=t}),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(A.NO_HOTKEYS,A.HOTKEYS,A.DEFAULT_STREAM_TYPE,A.DEFAULT_SUBTITLES,A.DEFAULT_DURATION,A.NO_MUTED_PREF,A.NO_VOLUME_PREF,A.LANG,A.LOOP)}get mediaStore(){return P(this,Y)}set mediaStore(e){var t,r;if(P(this,Y)&&((t=P(this,yt))==null||t.call(this),_t(this,yt,void 0)),_t(this,Y,e),!P(this,Y)&&!this.hasAttribute(A.NO_DEFAULT_STORE)){Tt(this,Aa,Yd).call(this);return}_t(this,yt,(r=P(this,Y))==null?void 0:r.subscribe(P(this,No)))}get fullscreenElement(){var e;return(e=P(this,Oo))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(A.FULLSCREEN_ELEMENT)&&this.removeAttribute(A.FULLSCREEN_ELEMENT),_t(this,Oo,e),(t=P(this,Y))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return M(this,A.DEFAULT_SUBTITLES)}set defaultSubtitles(e){x(this,A.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return O(this,A.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){N(this,A.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return q(this,A.DEFAULT_DURATION)}set defaultDuration(e){z(this,A.DEFAULT_DURATION,e)}get noHotkeys(){return M(this,A.NO_HOTKEYS)}set noHotkeys(e){x(this,A.NO_HOTKEYS,e)}get keysUsed(){return O(this,A.KEYS_USED)}set keysUsed(e){N(this,A.KEYS_USED,e)}get liveEdgeOffset(){return q(this,A.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){z(this,A.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return M(this,A.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){x(this,A.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return M(this,A.NO_VOLUME_PREF)}set noVolumePref(e){x(this,A.NO_VOLUME_PREF,e)}get noMutedPref(){return M(this,A.NO_MUTED_PREF)}set noMutedPref(e){x(this,A.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return M(this,A.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){x(this,A.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return M(this,A.NO_DEFAULT_STORE)}set noDefaultStore(e){x(this,A.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var n,o,s,l,d,h,p,g,f,E,T,v;if(super.attributeChangedCallback(e,t,r),e===A.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(A.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==t&&r===null&&this.enableHotkeys();else if(e===A.HOTKEYS)P(this,mi).value=r;else if(e===A.DEFAULT_SUBTITLES&&r!==t)(n=P(this,Y))==null||n.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES)}});else if(e===A.DEFAULT_STREAM_TYPE)(s=P(this,Y))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===A.LIVE_EDGE_OFFSET)(l=P(this,Y))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(A.LIVE_EDGE_OFFSET)}});else if(e===A.SEEK_TO_LIVE_OFFSET)(d=P(this,Y))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===A.NO_AUTO_SEEK_TO_LIVE)(h=P(this,Y))==null||h.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE)}});else if(e===A.FULLSCREEN_ELEMENT){let S=r?(p=this.getRootNode())==null?void 0:p.getElementById(r):void 0;_t(this,Oo,S),(g=P(this,Y))==null||g.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===A.LANG&&r!==t?(Kh(r),(f=P(this,Y))==null||f.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===A.LOOP&&r!==t?(E=P(this,Y))==null||E.dispatch({type:_.MEDIA_LOOP_REQUEST,detail:r!=null}):e===A.NO_VOLUME_PREF&&r!==t?(T=P(this,Y))==null||T.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF)}}):e===A.NO_MUTED_PREF&&r!==t&&((v=P(this,Y))==null||v.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(A.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!P(this,Y)&&!this.hasAttribute(A.NO_DEFAULT_STORE)&&Tt(this,Aa,Yd).call(this),(e=P(this,Y))==null||e.dispatch({type:"documentelementchangerequest",detail:le}),super.connectedCallback(),P(this,Y)&&!P(this,yt)&&_t(this,yt,(t=P(this,Y))==null?void 0:t.subscribe(P(this,No))),P(this,Uo)!==void 0&&P(this,Y)&&this.media&&setTimeout(()=>{var r,n,o;(n=(r=this.media)==null?void 0:r.textTracks)!=null&&n.length&&((o=P(this,Y))==null||o.dispatch({type:_.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:P(this,Uo)}))},0),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,n,o;if((e=super.disconnectedCallback)==null||e.call(this),P(this,Y)){let s=P(this,Y).getState();_t(this,Uo,!!((t=s.mediaSubtitlesShowing)!=null&&t.length)),(r=P(this,Y))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(n=P(this,Y))==null||n.dispatch({type:_.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}P(this,yt)&&((o=P(this,yt))==null||o.call(this),_t(this,yt,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=P(this,Y))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=P(this,Y))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){Ap(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),n=this.unregisterMediaStateReceiver.bind(this),o=Yf(e,r,n);Object.values(_).forEach(s=>{e.addEventListener(s,P(this,Ta))}),t.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(_).forEach(n=>{e.removeEventListener(n,P(this,Ta))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),P(this,Y)&&Object.entries(P(this,Y).getState()).forEach(([n,o])=>{Ap([e],n,o)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",Tt(this,Sa,Qd))}disableHotkeys(){this.removeEventListener("keydown",Tt(this,Sa,Qd)),this.removeEventListener("keyup",Tt(this,ar,Xr))}get hotkeys(){return O(this,A.HOTKEYS)}set hotkeys(e){N(this,A.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,n,o,s,l,d,h,p;let g=e.target;if(((n=(r=(t=g.getAttribute(A.KEYS_USED))==null?void 0:t.split(" "))!=null?r:g==null?void 0:g.keysUsed)!=null?n:[]).map(I=>I==="Space"?" ":I).filter(Boolean).includes(e.key))return;let E,T,v;if(!(P(this,mi).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&P(this,mi).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&P(this,mi).contains("noshift+/")))switch(e.key){case" ":case"k":E=P(this,Y).getState().mediaPaused?_.MEDIA_PLAY_REQUEST:_.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new u.CustomEvent(E,{composed:!0,bubbles:!0}));break;case"m":E=this.mediaStore.getState().mediaVolumeLevel==="off"?_.MEDIA_UNMUTE_REQUEST:_.MEDIA_MUTE_REQUEST,this.dispatchEvent(new u.CustomEvent(E,{composed:!0,bubbles:!0}));break;case"f":E=this.mediaStore.getState().mediaIsFullscreen?_.MEDIA_EXIT_FULLSCREEN_REQUEST:_.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new u.CustomEvent(E,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new u.CustomEvent(_.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let I=this.hasAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET):gp;T=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-I,0),v=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"ArrowRight":case"l":{let I=this.hasAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET):gp;T=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+I,0),v=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"ArrowUp":{let I=this.hasAttribute(A.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_UP_VOLUME_STEP):bp;T=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+I,1),v=new u.CustomEvent(_.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"ArrowDown":{let I=this.hasAttribute(A.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_DOWN_VOLUME_STEP):bp;T=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-I,0),v=new u.CustomEvent(_.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"<":{let I=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;T=Math.max(I-_p,Bf).toFixed(2),v=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case">":{let I=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;T=Math.min(I+_p,Wf).toFixed(2),v=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"/":case"?":{e.shiftKey&&Tt(this,Zd,Sp).call(this);break}case"p":{E=this.mediaStore.getState().mediaIsPip?_.MEDIA_EXIT_PIP_REQUEST:_.MEDIA_ENTER_PIP_REQUEST,v=new u.CustomEvent(E,{composed:!0,bubbles:!0}),this.dispatchEvent(v);break}default:break}}};mi=new WeakMap;Oo=new WeakMap;Y=new WeakMap;sr=new WeakMap;No=new WeakMap;yt=new WeakMap;Ta=new WeakMap;Uo=new WeakMap;Aa=new WeakSet;Yd=function(){var i;this.mediaStore=Ep({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(A.DEFAULT_DURATION)?+this.getAttribute(A.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(A.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(A.NO_SUBTITLES_LANG_PREF)}})};ar=new WeakSet;Xr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||kp.includes(e))){this.removeEventListener("keyup",Tt(this,ar,Xr));return}this.keyboardShortcutHandler(i)};Sa=new WeakSet;Qd=function(i){var e;let{metaKey:t,altKey:r,key:n,shiftKey:o}=i,s=o&&(n==="/"||n==="?");if(s&&((e=P(this,sr))!=null&&e.open)){this.removeEventListener("keyup",Tt(this,ar,Xr));return}if(t||r||!s&&!kp.includes(n)){this.removeEventListener("keyup",Tt(this,ar,Xr));return}let l=i.target,d=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(n)&&!(P(this,mi).contains(`no${n.toLowerCase()}`)||n===" "&&P(this,mi).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",Tt(this,ar,Xr),{once:!0})};Zd=new WeakSet;Sp=function(){P(this,sr)||(_t(this,sr,le.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(P(this,sr))),P(this,sr).open=!0};var Ff=Object.values(a),Kf=Object.values(Pd),Lp=i=>{var e,t,r,n;let{observedAttributes:o}=i.constructor;!o&&((e=i.nodeName)!=null&&e.includes("-"))&&(u.customElements.upgrade(i),{observedAttributes:o}=i.constructor);let s=(n=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,V.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:n.call(r,/\s+/);return Array.isArray(o||s)?(o||s).filter(l=>Ff.includes(l)):[]},qf=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&u.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof u.customElements.get(i.nodeName.toLowerCase()))&&u.customElements.upgrade(i),Kf.some(r=>r in i)},jd=i=>qf(i)||!!Lp(i).length,yp=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Tp={[a.MEDIA_SUBTITLES_LIST]:qt,[a.MEDIA_SUBTITLES_SHOWING]:qt,[a.MEDIA_SEEKABLE]:yp,[a.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(yp).join(" "),[a.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[a.MEDIA_RENDITION_LIST]:Uh,[a.MEDIA_AUDIO_TRACK_LIST]:$h},Gf=async(i,e,t)=>{var r,n;if(i.isConnected||await Js(0),typeof t=="boolean"||t==null)return x(i,e,t);if(typeof t=="number")return z(i,e,t);if(typeof t=="string")return N(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let o=(n=(r=Tp[e])==null?void 0:r.call(Tp,t))!=null?n:t;return i.setAttribute(e,o)},zf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},or=(i,e)=>{if(zf(i))return;let t=(n,o)=>{var s,l;jd(n)&&o(n);let{children:d=[]}=n??{},h=(l=(s=n==null?void 0:n.shadowRoot)==null?void 0:s.children)!=null?l:[];[...d,...h].forEach(g=>or(g,o))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!jd(i)){u.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},Ap=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let n=Lp(r),o=e.toLowerCase();n.includes(o)&&Gf(r,o,t)})},Yf=(i,e,t)=>{or(i,e);let r=p=>{var g;let f=(g=p==null?void 0:p.composedPath()[0])!=null?g:p.target;e(f)},n=p=>{var g;let f=(g=p==null?void 0:p.composedPath()[0])!=null?g:p.target;t(f)};i.addEventListener(_.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(_.UNREGISTER_MEDIA_STATE_RECEIVER,n);let o=p=>{p.forEach(g=>{let{addedNodes:f=[],removedNodes:E=[],type:T,target:v,attributeName:S}=g;T==="childList"?(Array.prototype.forEach.call(f,I=>or(I,e)),Array.prototype.forEach.call(E,I=>or(I,t))):T==="attributes"&&S===V.MEDIA_CHROME_ATTRIBUTES&&(jd(v)?e(v):t(v))})},s=[],l=p=>{let g=p.target;g.name!=="media"&&(s.forEach(f=>or(f,t)),s=[...g.assignedElements({flatten:!0})],s.forEach(f=>or(f,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(o);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{or(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(_.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(_.UNREGISTER_MEDIA_STATE_RECEIVER,n)}};u.customElements.get("media-controller")||u.customElements.define("media-controller",Xd);var jr={PLACEMENT:"placement",BOUNDS:"bounds"};function Qf(i){return`
400
+ `}var kf=Object.values(a),Lf="sm:384 md:576 lg:768 xl:960";function wf(i){ip(i.target,i.contentRect.width)}function ip(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(D.BREAKPOINTS))!=null?t:Lf,n=If(r),o=Cf(n,e),s=!1;if(Object.keys(n).forEach(l=>{if(o.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Zi.BREAKPOINTS_CHANGE,{detail:o});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Zi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function If(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Cf(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var er=class extends u.HTMLElement{constructor(){if(super(),Ke(this,Hd),Ke(this,$d),Ke(this,Vd),Ke(this,Mo),Ke(this,pa),Ke(this,Gr),Ke(this,ua,0),Ke(this,Kr,null),Ke(this,Ro,null),Ke(this,qr,void 0),this.breakpointsComputed=!1,Ke(this,da,new MutationObserver(je(this,Hd,Jh).bind(this))),Ke(this,Co,!1),Ke(this,ca,t=>{qe(this,Co)||(setTimeout(()=>{wf(t),Ji(this,Co,!1)},0),Ji(this,Co,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=ae(this.attributes),r=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(r):this.shadowRoot.innerHTML=r}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){qe(this,Kr)&&this.mediaUnsetCallback(qe(this,Kr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[D.AUTOHIDE,D.GESTURES_DISABLED].concat(kf).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,r){e.toLowerCase()==D.AUTOHIDE&&(this.autohide=r)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Ji(this,Kr,e),e.localName.includes("-")&&await u.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;qe(this,da).observe(this,{childList:!0,subtree:!0}),Wt(this,qe(this,ca));let r=this.getAttribute(D.AUDIO)!=null?b("audio player"):b("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(D.USER_INACTIVE,""),ip(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=u.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;qe(this,da).disconnect(),Ft(this,qe(this,ca)),this.media&&this.mediaUnsetCallback(this.media),(e=u.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ji(this,Kr,null)}handleEvent(e){switch(e.type){case"pointerdown":Ji(this,ua,e.timeStamp);break;case"pointermove":je(this,$d,ep).call(this,e);break;case"pointerup":je(this,Vd,tp).call(this,e);break;case"mouseleave":je(this,Mo,ha).call(this);break;case"mouseup":this.removeAttribute(D.KEYBOARD_CONTROL);break;case"keyup":je(this,Gr,xo).call(this),this.setAttribute(D.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ji(this,qr,isNaN(t)?0:t)}get autohide(){return(qe(this,qr)===void 0?2:qe(this,qr)).toString()}get breakpoints(){return O(this,D.BREAKPOINTS)}set breakpoints(e){N(this,D.BREAKPOINTS,e)}get audio(){return M(this,D.AUDIO)}set audio(e){x(this,D.AUDIO,e)}get gesturesDisabled(){return M(this,D.GESTURES_DISABLED)}set gesturesDisabled(e){x(this,D.GESTURES_DISABLED,e)}get keyboardControl(){return M(this,D.KEYBOARD_CONTROL)}set keyboardControl(e){x(this,D.KEYBOARD_CONTROL,e)}get noAutohide(){return M(this,D.NO_AUTOHIDE)}set noAutohide(e){x(this,D.NO_AUTOHIDE,e)}get autohideOverControls(){return M(this,D.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){x(this,D.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return M(this,D.USER_INACTIVE)}set userInteractive(e){x(this,D.USER_INACTIVE,e)}};ua=new WeakMap;Kr=new WeakMap;Ro=new WeakMap;qr=new WeakMap;da=new WeakMap;Hd=new WeakSet;Jh=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let n of r){if(n.slot!="media"||t.target!=this)continue;let o=t.previousSibling&&t.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(n);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(n)}}if(e)for(let n of t.addedNodes)n===e&&this.handleMediaUpdated(e)}};Co=new WeakMap;ca=new WeakMap;$d=new WeakSet;ep=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-qe(this,ua)<250)return;je(this,pa,Wd).call(this),clearTimeout(qe(this,Ro));let e=this.hasAttribute(D.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&je(this,Gr,xo).call(this)};Vd=new WeakSet;tp=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(D.USER_INACTIVE);[this,this.media].includes(i.target)&&e?je(this,Mo,ha).call(this):je(this,Gr,xo).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&je(this,Gr,xo).call(this)};Mo=new WeakSet;ha=function(){if(qe(this,qr)<0||this.hasAttribute(D.USER_INACTIVE))return;this.setAttribute(D.USER_INACTIVE,"");let i=new u.CustomEvent(Zi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};pa=new WeakSet;Wd=function(){if(!this.hasAttribute(D.USER_INACTIVE))return;this.removeAttribute(D.USER_INACTIVE);let i=new u.CustomEvent(Zi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Gr=new WeakSet;xo=function(){je(this,pa,Wd).call(this),clearTimeout(qe(this,Ro));let i=parseInt(this.autohide);i<0||Ji(this,Ro,setTimeout(()=>{je(this,Mo,ha).call(this)},i*1e3))};er.shadowRootOptions={mode:"open"};er.getTemplateHTML=Sf;u.customElements.get("media-container")||u.customElements.define("media-container",er);var rp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Se=(i,e,t)=>(rp(i,e,"read from private field"),t?t.call(i):e.get(i)),Po=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ma=(i,e,t,r)=>(rp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),zr,Yr,va,tr,Kt,hi,pi=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){Po(this,Kt),Po(this,zr,void 0),Po(this,Yr,void 0),Po(this,va,void 0),Po(this,tr,new Set),ma(this,zr,e),ma(this,Yr,t),ma(this,va,new Set(r))}[Symbol.iterator](){return Se(this,Kt,hi).values()}get length(){return Se(this,Kt,hi).size}get value(){var e;return(e=[...Se(this,Kt,hi)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(ma(this,tr,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...Se(this,Kt,hi)][e]}values(){return Se(this,Kt,hi).values()}forEach(e,t){Se(this,Kt,hi).forEach(e,t)}add(...e){var t,r;e.forEach(n=>Se(this,tr).add(n)),!(this.value===""&&!((t=Se(this,zr))!=null&&t.hasAttribute(`${Se(this,Yr)}`)))&&((r=Se(this,zr))==null||r.setAttribute(`${Se(this,Yr)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>Se(this,tr).delete(r)),(t=Se(this,zr))==null||t.setAttribute(`${Se(this,Yr)}`,`${this.value}`)}contains(e){return Se(this,Kt,hi).has(e)}toggle(e,t){return typeof t<"u"?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}};zr=new WeakMap;Yr=new WeakMap;va=new WeakMap;tr=new WeakMap;Kt=new WeakSet;hi=function(){return Se(this,tr).size?Se(this,tr):Se(this,va)};var Rf=(i="")=>i.split(/\s+/),np=(i="")=>{let[e,t,r]=i.split(":"),n=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Ue.CAPTIONS:Ue.SUBTITLES,language:t,label:n}},ir=(i="",e={})=>Rf(i).map(t=>{let r=np(t);return{...e,...r}}),Fd=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?np(e):e):typeof i=="string"?ir(i):[i]:[],fa=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,qt=(i=[])=>Array.prototype.map.call(i,fa).join(" "),Mf=(i,e)=>t=>t[i]===e,op=i=>{let e=Object.entries(i).map(([t,r])=>Mf(t,r));return t=>e.every(r=>r(t))},rr=(i,e=[],t=[])=>{let r=Fd(t).map(op),n=o=>r.some(s=>s(o));Array.from(e).filter(n).forEach(o=>{o.mode=i})},nr=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:op(e);return Array.from(i.textTracks).filter(t)},Ea=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(a.MEDIA_SUBTITLES_SHOWING)};var ap=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let n=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(n){let o=(e=r[n])==null?void 0:e.call(r);if(o instanceof Promise)return o.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(n){console.error(n)}},sp="exitFullscreen"in le?"exitFullscreen":"webkitExitFullscreen"in le?"webkitExitFullscreen":"webkitCancelFullScreen"in le?"webkitCancelFullScreen":void 0,lp=i=>{var e;let{documentElement:t}=i;if(sp){let r=(e=t==null?void 0:t[sp])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},Do="fullscreenElement"in le?"fullscreenElement":"webkitFullscreenElement"in le?"webkitFullscreenElement":void 0,xf=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[Do];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===Uh.FULLSCREEN?t:r},dp=i=>{var e;let{media:t,documentElement:r,fullscreenElement:n=t}=i;if(!t||!r)return!1;let o=xf(i);if(!o)return!1;if(o===n||o===t)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(Do in s))return xe(o,n);for(;s!=null&&s[Do];){if(s[Do]===n)return!0;s=(e=s[Do])==null?void 0:e.shadowRoot}}return!1},Pf="fullscreenEnabled"in le?"fullscreenEnabled":"webkitFullscreenEnabled"in le?"webkitFullscreenEnabled":void 0,cp=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[Pf])||t&&"webkitSupportsFullscreen"in t};var ga,Kd=()=>{var i,e;return ga||(ga=(e=(i=le)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),ga)},up=async(i=Kd())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([Df(i,t.signal),Of(i,e)]);return t.abort(),r},Df=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),Of=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await Js(10)}return i.volume!==e},Nf=/.*Version\/.*Safari\/.*/.test(u.navigator.userAgent),qd=(i=Kd())=>u.matchMedia("(display-mode: standalone)").matches&&Nf?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Gd=(i=Kd())=>cp({documentElement:le,media:i}),hp=Gd(),pp=qd(),mp=!!u.WebKitPlaybackTargetAvailabilityEvent,vp=!!u.chrome;var Qr=i=>nr(i.media,e=>[Ue.SUBTITLES,Ue.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),zd=i=>nr(i.media,e=>e.mode===ci.SHOWING&&[Ue.SUBTITLES,Ue.CAPTIONS].includes(e.kind)),ba=(i,e)=>{let t=Qr(i),r=zd(i),n=!!r.length;if(t.length){if(e===!1||n&&e!==!0)rr(ci.DISABLED,t,r);else if(e===!0||!n&&e!==!1){let o=t[0],{options:s}=i;if(!(s!=null&&s.noSubtitlesLangPref)){let p=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=p?[p,...globalThis.navigator.languages]:globalThis.navigator.languages,f=t.filter(E=>g.some(T=>E.language.toLowerCase().startsWith(T.split("-")[0]))).sort((E,T)=>{let v=g.findIndex(I=>E.language.toLowerCase().startsWith(I.split("-")[0])),S=g.findIndex(I=>T.language.toLowerCase().startsWith(I.split("-")[0]));return v-S});f[0]&&(o=f[0])}let{language:l,label:d,kind:h}=o;rr(ci.DISABLED,t,r),rr(ci.SHOWING,t,[{language:l,label:d,kind:h}])}}},_a=(i,e)=>i===e?!0:i==null||e==null||typeof i!=typeof e?!1:typeof i=="number"&&Number.isNaN(i)&&Number.isNaN(e)?!0:typeof i!="object"?!1:Array.isArray(i)?Uf(i,e):Object.entries(i).every(([t,r])=>t in e&&_a(r,e[t])),Uf=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((n,o)=>_a(n,e[o])):!0};var Hf=Object.values(at),ya,$f=up().then(i=>(ya=i,ya)),fp=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof u.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=u.customElements.get(t);r&&e instanceof r||(await u.customElements.whenDefined(t),u.customElements.upgrade(e))}))},Vf=new u.DOMParser,Bf=i=>i&&(Vf.parseFromString(i,"text/html").body.textContent||i),Zr={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(t=r==null?void 0:r.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,r;let{media:n}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=n==null?void 0:n.error)==null?void 0:t.message)!=null?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:r}=e;r&&(i?r.pause():(t=r.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t,options:{noMutedPref:r}={}}=e;if(t){t.muted=i;try{let n=u.localStorage.getItem("media-chrome-pref-muted")!==null,o=t.hasAttribute("muted");if(r){n&&u.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!n)return;u.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(n){console.debug("Error setting muted pref",n)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let n=u.localStorage.getItem("media-chrome-pref-muted")==="true";Zr.mediaMuted.set(n,e),i(n)}catch(n){console.debug("Error getting muted pref",n)}}]},mediaLoop:{get(i){let{media:e}=i;return e==null?void 0:e.loop},set(i,e){let{media:t}=e;t&&(t.loop=i)},mediaEvents:["medialooprequest"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t,options:{noVolumePref:r}={}}=e;if(t){try{i==null?u.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&u.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(n){console.debug("Error setting volume pref",n)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:r}=e;if(!r)return;let n=u.localStorage.getItem("media-chrome-pref-volume");if(n==null)return;Zr.mediaVolume.set(+n,e),i(+n)}catch(r){console.debug("Error getting volume pref",r)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!Wr(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let r=t.seekable.start(0),n=t.seekable.end(t.seekable.length-1);if(!(!r&&!n))return[Number(r.toFixed(3)),Number(n.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,r=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(r).map((n,o)=>[Number(r.start(o).toFixed(3)),Number(r.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[at.LIVE,at.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:n}=e;if(Hf.includes(n))return n===at.UNKNOWN?r:n;let o=e.duration;return o===1/0?at.LIVE:Number.isFinite(o)?at.ON_DEMAND:r},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,r=Zr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===at.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Zr.mediaStreamType.get(i)===at.LIVE))return!1;let n=e.seekable;if(!n)return!0;if(!n.length)return!1;let o=n.end(n.length-1)-t;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return Qr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return zd(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,r;let{media:n,options:o}=e;if(!n)return;let s=l=>{var d;!o.defaultSubtitles||l&&![Ue.CAPTIONS,Ue.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||ba(e,!0)};return n.addEventListener("loadstart",s),(t=n.textTracks)==null||t.addEventListener("addtrack",s),(r=n.textTracks)==null||r.addEventListener("removetrack",s),()=>{var l,d;n.removeEventListener("loadstart",s),(l=n.textTracks)==null||l.removeEventListener("addtrack",s),(d=n.textTracks)==null||d.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=nr(t,{kind:Ue.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:n,startTime:o,endTime:s})=>({text:Bf(n),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let n=r.querySelector('track[kind="chapters"][default][src]'),o=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return n==null||n.addEventListener("load",i),o==null||o.addEventListener("load",i),()=>{n==null||n.removeEventListener("load",i),o==null||o.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:n}=i;if(!r||!n||!n.pictureInPictureElement)return!1;if(n.pictureInPictureElement===r)return!0;if(n.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?xe(r,n.pictureInPictureElement):!1;if(n.pictureInPictureElement.localName.includes("-")){let o=n.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===r)return!0;o=(t=o.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!le.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let r=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(n=>{if(n.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let o=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(r),o()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),o()},1e3)}else throw n}else throw n})}else le.pictureInPictureElement&&le.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(r=>({...r}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,r;let{media:n}=i;return(r=(t=n==null?void 0:n.videoRenditions)==null?void 0:t[(e=n.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:r.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let r=i,n=Array.prototype.findIndex.call(t.videoRenditions,o=>o.id==r);t.videoRenditions.selectedIndex!=n&&(t.videoRenditions.selectedIndex=n)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:r}=i;return(t=[...(e=r==null?void 0:r.audioTracks)!=null?e:[]].find(n=>n.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let r=i;for(let n of t.audioTracks)n.enabled=r==n.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return dp(i)},set(i,e,t){var r;i?(ap(e),t.detail&&((r=e.media)==null||r.focus())):lp(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,r;let{media:n}=e;if(n&&!(i&&((t=n.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=n.remote)==null?void 0:r.state)!=="connected")){if(typeof n.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}n.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&u.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!hp||!Gd(e))return He.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!pp||!qd(e))return He.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return He.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(ya===!1||(e==null?void 0:e.volume)==null)return He.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{ya==null&&$f.then(e=>i(e?void 0:He.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!vp||!((t=r==null?void 0:r.remote)!=null&&t.state))return He.UNSUPPORTED;if(!(e==null||e==="available"))return He.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!mp)return He.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return He.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return He.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return He.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return He.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return He.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var Ep={[_.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,n,o;let{media:s}=e,l=t??void 0,d,h;if(s&&l!=null){let[E]=nr(s,{kind:Ue.METADATA,label:"thumbnails"}),T=Array.prototype.find.call((r=E==null?void 0:E.cues)!=null?r:[],(v,S,I)=>S===0?v.endTime>l:S===I.length-1?v.startTime<=l:v.startTime<=l&&v.endTime>l);if(T){let v=/'^(?:[a-z]+:)?\/\//i.test(T.text)||(n=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:n.src,S=new URL(T.text,v);h=new URLSearchParams(S.hash).get("#xywh").split(",").map(F=>+F),d=S.href}}let p=i.mediaDuration.get(e),f=(o=i.mediaChaptersCues.get(e).find((E,T,v)=>T===v.length-1&&p===E.endTime?E.startTime<=l&&E.endTime>=l:E.startTime<=l&&E.endTime>l))==null?void 0:o.text;return t!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:h,mediaPreviewChapter:f}},[_.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[_.MEDIA_PLAY_REQUEST](i,e){var t,r,n,o;let s="mediaPaused",d=i.mediaStreamType.get(e)===at.LIVE,h=!((t=e.options)!=null&&t.noAutoSeekToLive),p=i.mediaTargetLiveWindow.get(e)>0;if(d&&h&&!p){let g=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(g){let f=(o=(n=e.options)==null?void 0:n.seekToLiveOffset)!=null?o:0,E=g-f;i.mediaCurrentTime.set(E,e)}}i[s].set(!1,e)},[_.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",n=t;i[r].set(n,e)},[_.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[_.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[_.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",n=!!t;return i[r].set(n,e),{mediaLoop:n}},[_.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",n=t;n&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(n,e)},[_.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",n=t;i[r].set(n,e)},[_.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,n;let o="mediaCurrentTime",s=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(s)))return;let l=(n=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?n:0,d=s-l;i[o].set(d,e)},[_.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:n}=e,o=Qr(e),s=Fd(t),l=(r=s[0])==null?void 0:r.language;l&&!n.noSubtitlesLangPref&&u.localStorage.setItem("media-chrome-pref-subtitles-lang",l),rr(ci.SHOWING,o,s)},[_.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=Qr(e),n=t??[];rr(ci.DISABLED,r,n)},[_.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){ba(e,t)},[_.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",n=t;i[r].set(n,e)},[_.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",n=t;i[r].set(n,e)},[_.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[_.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[_.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e,t){let r="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[r].set(!0,e,t)},[_.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[_.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[_.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[_.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var gp=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Zr,requestMap:n=Ep,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],d={options:{...o}},h=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),p=v=>{v!=null&&(_a(v,h)||(h=Object.freeze({...h,...v}),l.forEach(S=>S(h))))},g=()=>{let v=Object.entries(r).reduce((S,[I,{get:F}])=>(S[I]=F(d),S),{});p(v)},f={},E,T=async(v,S)=>{var I,F,se,De,gt,ii,y,L,$,ue,re,Q,K,Qe,eo,Ou;let wv=!!E;if(E={...d,...E??{},...v},wv)return;await fp(...Object.values(v));let xr=l.length>0&&S===0&&s,Nu=d.media!==E.media,Uu=((I=d.media)==null?void 0:I.textTracks)!==((F=E.media)==null?void 0:F.textTracks),Hu=((se=d.media)==null?void 0:se.videoRenditions)!==((De=E.media)==null?void 0:De.videoRenditions),$u=((gt=d.media)==null?void 0:gt.audioTracks)!==((ii=E.media)==null?void 0:ii.audioTracks),Vu=((y=d.media)==null?void 0:y.remote)!==((L=E.media)==null?void 0:L.remote),Bu=d.documentElement!==E.documentElement,Wu=!!d.media&&(Nu||xr),Fu=!!(($=d.media)!=null&&$.textTracks)&&(Uu||xr),Ku=!!((ue=d.media)!=null&&ue.videoRenditions)&&(Hu||xr),qu=!!((re=d.media)!=null&&re.audioTracks)&&($u||xr),Gu=!!((Q=d.media)!=null&&Q.remote)&&(Vu||xr),zu=!!d.documentElement&&(Bu||xr),dd=Wu||Fu||Ku||qu||Gu||zu,Pr=l.length===0&&S===1&&s,R=!!E.media&&(Nu||Pr),Yu=!!((K=E.media)!=null&&K.textTracks)&&(Uu||Pr),Qu=!!((Qe=E.media)!=null&&Qe.videoRenditions)&&(Hu||Pr),Zu=!!((eo=E.media)!=null&&eo.audioTracks)&&($u||Pr),Xu=!!((Ou=E.media)!=null&&Ou.remote)&&(Vu||Pr),ju=!!E.documentElement&&(Bu||Pr),Ju=R||Yu||Qu||Zu||Xu||ju;if(!(dd||Ju)){Object.entries(E).forEach(([ee,to])=>{d[ee]=to}),g(),E=void 0;return}Object.entries(r).forEach(([ee,{get:to,mediaEvents:Iv=[],textTracksEvents:Cv=[],videoRenditionsEvents:Rv=[],audioTracksEvents:Mv=[],remoteEvents:xv=[],rootEvents:Pv=[],stateOwnersUpdateHandlers:Dv=[]}])=>{f[ee]||(f[ee]={});let Fe=he=>{let Ee=to(d,he);p({[ee]:Ee})},Te;Te=f[ee].mediaEvents,Iv.forEach(he=>{Te&&Wu&&(d.media.removeEventListener(he,Te),f[ee].mediaEvents=void 0),R&&(E.media.addEventListener(he,Fe),f[ee].mediaEvents=Fe)}),Te=f[ee].textTracksEvents,Cv.forEach(he=>{var Ee,ot;Te&&Fu&&((Ee=d.media.textTracks)==null||Ee.removeEventListener(he,Te),f[ee].textTracksEvents=void 0),Yu&&((ot=E.media.textTracks)==null||ot.addEventListener(he,Fe),f[ee].textTracksEvents=Fe)}),Te=f[ee].videoRenditionsEvents,Rv.forEach(he=>{var Ee,ot;Te&&Ku&&((Ee=d.media.videoRenditions)==null||Ee.removeEventListener(he,Te),f[ee].videoRenditionsEvents=void 0),Qu&&((ot=E.media.videoRenditions)==null||ot.addEventListener(he,Fe),f[ee].videoRenditionsEvents=Fe)}),Te=f[ee].audioTracksEvents,Mv.forEach(he=>{var Ee,ot;Te&&qu&&((Ee=d.media.audioTracks)==null||Ee.removeEventListener(he,Te),f[ee].audioTracksEvents=void 0),Zu&&((ot=E.media.audioTracks)==null||ot.addEventListener(he,Fe),f[ee].audioTracksEvents=Fe)}),Te=f[ee].remoteEvents,xv.forEach(he=>{var Ee,ot;Te&&Gu&&((Ee=d.media.remote)==null||Ee.removeEventListener(he,Te),f[ee].remoteEvents=void 0),Xu&&((ot=E.media.remote)==null||ot.addEventListener(he,Fe),f[ee].remoteEvents=Fe)}),Te=f[ee].rootEvents,Pv.forEach(he=>{Te&&zu&&(d.documentElement.removeEventListener(he,Te),f[ee].rootEvents=void 0),ju&&(E.documentElement.addEventListener(he,Fe),f[ee].rootEvents=Fe)});let Us=f[ee].stateOwnersUpdateHandlers;if(Us&&dd&&(Array.isArray(Us)?Us:[Us]).forEach(Ee=>{typeof Ee=="function"&&Ee()}),Ju){let he=Dv.map(Ee=>Ee(Fe,E)).filter(Ee=>typeof Ee=="function");f[ee].stateOwnersUpdateHandlers=he.length===1?he[0]:he}else dd&&(f[ee].stateOwnersUpdateHandlers=void 0)}),Object.entries(E).forEach(([ee,to])=>{d[ee]=to}),g(),E=void 0};return T({media:i,fullscreenElement:e,documentElement:t,options:o}),{dispatch(v){let{type:S,detail:I}=v;if(n[S]&&h.mediaErrorCode==null){p(n[S](r,d,v));return}S==="mediaelementchangerequest"?T({media:I}):S==="fullscreenelementchangerequest"?T({fullscreenElement:I}):S==="documentelementchangerequest"?T({documentElement:I}):S==="optionschangerequest"&&(Object.entries(I??{}).forEach(([F,se])=>{d.options[F]=se}),g())},getState(){return h},subscribe(v){return T({},l.length+1),l.push(v),v(h),()=>{let S=l.indexOf(v);S>=0&&(T({},l.length-1),l.splice(S,1))}}}};var Jd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},P=(i,e,t)=>(Jd(i,e,"read from private field"),t?t.call(i):e.get(i)),Je=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_t=(i,e,t,r)=>(Jd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Tt=(i,e,t)=>(Jd(i,e,"access private method"),t),mi,Oo,Y,sr,No,yt,Ta,Uo,Aa,Yd,ar,Xr,Sa,Qd,Zd,kp,Lp=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],bp=10,_p=.025,yp=.25,Wf=.25,Ff=2,A={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},Xd=class extends er{constructor(){super(),Je(this,Aa),Je(this,ar),Je(this,Sa),Je(this,Zd),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Je(this,mi,new pi(this,A.HOTKEYS)),Je(this,Oo,void 0),Je(this,Y,void 0),Je(this,sr,null),Je(this,No,void 0),Je(this,yt,void 0),Je(this,Ta,t=>{var r;(r=P(this,Y))==null||r.dispatch(t)}),Je(this,Uo,void 0),this.associateElement(this);let e={};_t(this,No,t=>{Object.entries(t).forEach(([r,n])=>{if(r in e&&e[r]===n)return;this.propagateMediaState(r,n);let o=r.toLowerCase(),s=new u.CustomEvent(Nh[o],{composed:!0,detail:n});this.dispatchEvent(s)}),e=t}),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(A.NO_HOTKEYS,A.HOTKEYS,A.DEFAULT_STREAM_TYPE,A.DEFAULT_SUBTITLES,A.DEFAULT_DURATION,A.NO_MUTED_PREF,A.NO_VOLUME_PREF,A.LANG,A.LOOP)}get mediaStore(){return P(this,Y)}set mediaStore(e){var t,r;if(P(this,Y)&&((t=P(this,yt))==null||t.call(this),_t(this,yt,void 0)),_t(this,Y,e),!P(this,Y)&&!this.hasAttribute(A.NO_DEFAULT_STORE)){Tt(this,Aa,Yd).call(this);return}_t(this,yt,(r=P(this,Y))==null?void 0:r.subscribe(P(this,No)))}get fullscreenElement(){var e;return(e=P(this,Oo))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(A.FULLSCREEN_ELEMENT)&&this.removeAttribute(A.FULLSCREEN_ELEMENT),_t(this,Oo,e),(t=P(this,Y))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return M(this,A.DEFAULT_SUBTITLES)}set defaultSubtitles(e){x(this,A.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return O(this,A.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){N(this,A.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return q(this,A.DEFAULT_DURATION)}set defaultDuration(e){z(this,A.DEFAULT_DURATION,e)}get noHotkeys(){return M(this,A.NO_HOTKEYS)}set noHotkeys(e){x(this,A.NO_HOTKEYS,e)}get keysUsed(){return O(this,A.KEYS_USED)}set keysUsed(e){N(this,A.KEYS_USED,e)}get liveEdgeOffset(){return q(this,A.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){z(this,A.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return M(this,A.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){x(this,A.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return M(this,A.NO_VOLUME_PREF)}set noVolumePref(e){x(this,A.NO_VOLUME_PREF,e)}get noMutedPref(){return M(this,A.NO_MUTED_PREF)}set noMutedPref(e){x(this,A.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return M(this,A.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){x(this,A.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return M(this,A.NO_DEFAULT_STORE)}set noDefaultStore(e){x(this,A.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var n,o,s,l,d,h,p,g,f,E,T,v;if(super.attributeChangedCallback(e,t,r),e===A.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(A.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==t&&r===null&&this.enableHotkeys();else if(e===A.HOTKEYS)P(this,mi).value=r;else if(e===A.DEFAULT_SUBTITLES&&r!==t)(n=P(this,Y))==null||n.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES)}});else if(e===A.DEFAULT_STREAM_TYPE)(s=P(this,Y))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===A.LIVE_EDGE_OFFSET)(l=P(this,Y))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(A.LIVE_EDGE_OFFSET)}});else if(e===A.SEEK_TO_LIVE_OFFSET)(d=P(this,Y))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===A.NO_AUTO_SEEK_TO_LIVE)(h=P(this,Y))==null||h.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE)}});else if(e===A.FULLSCREEN_ELEMENT){let S=r?(p=this.getRootNode())==null?void 0:p.getElementById(r):void 0;_t(this,Oo,S),(g=P(this,Y))==null||g.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===A.LANG&&r!==t?(qh(r),(f=P(this,Y))==null||f.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===A.LOOP&&r!==t?(E=P(this,Y))==null||E.dispatch({type:_.MEDIA_LOOP_REQUEST,detail:r!=null}):e===A.NO_VOLUME_PREF&&r!==t?(T=P(this,Y))==null||T.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF)}}):e===A.NO_MUTED_PREF&&r!==t&&((v=P(this,Y))==null||v.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(A.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!P(this,Y)&&!this.hasAttribute(A.NO_DEFAULT_STORE)&&Tt(this,Aa,Yd).call(this),(e=P(this,Y))==null||e.dispatch({type:"documentelementchangerequest",detail:le}),super.connectedCallback(),P(this,Y)&&!P(this,yt)&&_t(this,yt,(t=P(this,Y))==null?void 0:t.subscribe(P(this,No))),P(this,Uo)!==void 0&&P(this,Y)&&this.media&&setTimeout(()=>{var r,n,o;(n=(r=this.media)==null?void 0:r.textTracks)!=null&&n.length&&((o=P(this,Y))==null||o.dispatch({type:_.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:P(this,Uo)}))},0),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,n,o;if((e=super.disconnectedCallback)==null||e.call(this),P(this,Y)){let s=P(this,Y).getState();_t(this,Uo,!!((t=s.mediaSubtitlesShowing)!=null&&t.length)),(r=P(this,Y))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(n=P(this,Y))==null||n.dispatch({type:_.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}P(this,yt)&&((o=P(this,yt))==null||o.call(this),_t(this,yt,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=P(this,Y))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=P(this,Y))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){Sp(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),n=this.unregisterMediaStateReceiver.bind(this),o=Qf(e,r,n);Object.values(_).forEach(s=>{e.addEventListener(s,P(this,Ta))}),t.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(_).forEach(n=>{e.removeEventListener(n,P(this,Ta))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),P(this,Y)&&Object.entries(P(this,Y).getState()).forEach(([n,o])=>{Sp([e],n,o)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",Tt(this,Sa,Qd))}disableHotkeys(){this.removeEventListener("keydown",Tt(this,Sa,Qd)),this.removeEventListener("keyup",Tt(this,ar,Xr))}get hotkeys(){return O(this,A.HOTKEYS)}set hotkeys(e){N(this,A.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,n,o,s,l,d,h,p;let g=e.target;if(((n=(r=(t=g.getAttribute(A.KEYS_USED))==null?void 0:t.split(" "))!=null?r:g==null?void 0:g.keysUsed)!=null?n:[]).map(I=>I==="Space"?" ":I).filter(Boolean).includes(e.key))return;let E,T,v;if(!(P(this,mi).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&P(this,mi).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&P(this,mi).contains("noshift+/")))switch(e.key){case" ":case"k":E=P(this,Y).getState().mediaPaused?_.MEDIA_PLAY_REQUEST:_.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new u.CustomEvent(E,{composed:!0,bubbles:!0}));break;case"m":E=this.mediaStore.getState().mediaVolumeLevel==="off"?_.MEDIA_UNMUTE_REQUEST:_.MEDIA_MUTE_REQUEST,this.dispatchEvent(new u.CustomEvent(E,{composed:!0,bubbles:!0}));break;case"f":E=this.mediaStore.getState().mediaIsFullscreen?_.MEDIA_EXIT_FULLSCREEN_REQUEST:_.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new u.CustomEvent(E,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new u.CustomEvent(_.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let I=this.hasAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET):bp;T=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-I,0),v=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"ArrowRight":case"l":{let I=this.hasAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET):bp;T=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+I,0),v=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"ArrowUp":{let I=this.hasAttribute(A.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_UP_VOLUME_STEP):_p;T=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+I,1),v=new u.CustomEvent(_.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"ArrowDown":{let I=this.hasAttribute(A.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_DOWN_VOLUME_STEP):_p;T=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-I,0),v=new u.CustomEvent(_.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"<":{let I=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;T=Math.max(I-yp,Wf).toFixed(2),v=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case">":{let I=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;T=Math.min(I+yp,Ff).toFixed(2),v=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(v);break}case"/":case"?":{e.shiftKey&&Tt(this,Zd,kp).call(this);break}case"p":{E=this.mediaStore.getState().mediaIsPip?_.MEDIA_EXIT_PIP_REQUEST:_.MEDIA_ENTER_PIP_REQUEST,v=new u.CustomEvent(E,{composed:!0,bubbles:!0}),this.dispatchEvent(v);break}default:break}}};mi=new WeakMap;Oo=new WeakMap;Y=new WeakMap;sr=new WeakMap;No=new WeakMap;yt=new WeakMap;Ta=new WeakMap;Uo=new WeakMap;Aa=new WeakSet;Yd=function(){var i;this.mediaStore=gp({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(A.DEFAULT_DURATION)?+this.getAttribute(A.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(A.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(A.NO_SUBTITLES_LANG_PREF)}})};ar=new WeakSet;Xr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||Lp.includes(e))){this.removeEventListener("keyup",Tt(this,ar,Xr));return}this.keyboardShortcutHandler(i)};Sa=new WeakSet;Qd=function(i){var e;let{metaKey:t,altKey:r,key:n,shiftKey:o}=i,s=o&&(n==="/"||n==="?");if(s&&((e=P(this,sr))!=null&&e.open)){this.removeEventListener("keyup",Tt(this,ar,Xr));return}if(t||r||!s&&!Lp.includes(n)){this.removeEventListener("keyup",Tt(this,ar,Xr));return}let l=i.target,d=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(n)&&!(P(this,mi).contains(`no${n.toLowerCase()}`)||n===" "&&P(this,mi).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",Tt(this,ar,Xr),{once:!0})};Zd=new WeakSet;kp=function(){P(this,sr)||(_t(this,sr,le.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(P(this,sr))),P(this,sr).open=!0};var Kf=Object.values(a),qf=Object.values(Pd),wp=i=>{var e,t,r,n;let{observedAttributes:o}=i.constructor;!o&&((e=i.nodeName)!=null&&e.includes("-"))&&(u.customElements.upgrade(i),{observedAttributes:o}=i.constructor);let s=(n=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,V.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:n.call(r,/\s+/);return Array.isArray(o||s)?(o||s).filter(l=>Kf.includes(l)):[]},Gf=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&u.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof u.customElements.get(i.nodeName.toLowerCase()))&&u.customElements.upgrade(i),qf.some(r=>r in i)},jd=i=>Gf(i)||!!wp(i).length,Tp=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Ap={[a.MEDIA_SUBTITLES_LIST]:qt,[a.MEDIA_SUBTITLES_SHOWING]:qt,[a.MEDIA_SEEKABLE]:Tp,[a.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Tp).join(" "),[a.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[a.MEDIA_RENDITION_LIST]:Hh,[a.MEDIA_AUDIO_TRACK_LIST]:Vh},zf=async(i,e,t)=>{var r,n;if(i.isConnected||await Js(0),typeof t=="boolean"||t==null)return x(i,e,t);if(typeof t=="number")return z(i,e,t);if(typeof t=="string")return N(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let o=(n=(r=Ap[e])==null?void 0:r.call(Ap,t))!=null?n:t;return i.setAttribute(e,o)},Yf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},or=(i,e)=>{if(Yf(i))return;let t=(n,o)=>{var s,l;jd(n)&&o(n);let{children:d=[]}=n??{},h=(l=(s=n==null?void 0:n.shadowRoot)==null?void 0:s.children)!=null?l:[];[...d,...h].forEach(g=>or(g,o))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!jd(i)){u.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},Sp=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let n=wp(r),o=e.toLowerCase();n.includes(o)&&zf(r,o,t)})},Qf=(i,e,t)=>{or(i,e);let r=p=>{var g;let f=(g=p==null?void 0:p.composedPath()[0])!=null?g:p.target;e(f)},n=p=>{var g;let f=(g=p==null?void 0:p.composedPath()[0])!=null?g:p.target;t(f)};i.addEventListener(_.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(_.UNREGISTER_MEDIA_STATE_RECEIVER,n);let o=p=>{p.forEach(g=>{let{addedNodes:f=[],removedNodes:E=[],type:T,target:v,attributeName:S}=g;T==="childList"?(Array.prototype.forEach.call(f,I=>or(I,e)),Array.prototype.forEach.call(E,I=>or(I,t))):T==="attributes"&&S===V.MEDIA_CHROME_ATTRIBUTES&&(jd(v)?e(v):t(v))})},s=[],l=p=>{let g=p.target;g.name!=="media"&&(s.forEach(f=>or(f,t)),s=[...g.assignedElements({flatten:!0})],s.forEach(f=>or(f,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(o);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{or(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(_.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(_.UNREGISTER_MEDIA_STATE_RECEIVER,n)}};u.customElements.get("media-controller")||u.customElements.define("media-controller",Xd);var jr={PLACEMENT:"placement",BOUNDS:"bounds"};function Zf(i){return`
401
401
  <style>
402
402
  :host {
403
403
  --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
@@ -506,7 +506,7 @@ bp-player[has-error] {
506
506
  </style>
507
507
  <slot></slot>
508
508
  <div id="arrow"></div>
509
- `}var Jr=class extends u.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!sa(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let r=getComputedStyle(this),n=(e=bt(this,"#"+this.bounds))!=null?e:ne(this);if(!n)return;let{x:o,width:s}=n.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),h=l+d,p=o+s,g=r.getPropertyValue("--media-tooltip-offset-x"),f=g?parseFloat(g.replace("px","")):0,E=r.getPropertyValue("--media-tooltip-container-margin"),T=E?parseFloat(E.replace("px","")):0,v=l-o+f-T,S=h-p+f+T;if(v<0){this.style.setProperty("--media-tooltip-offset-x",`${v}px`);return}if(S>0){this.style.setProperty("--media-tooltip-offset-x",`${S}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[jr.PLACEMENT,jr.BOUNDS]}get placement(){return O(this,jr.PLACEMENT)}set placement(e){N(this,jr.PLACEMENT,e)}get bounds(){return O(this,jr.BOUNDS)}set bounds(e){N(this,jr.BOUNDS,e)}};Jr.shadowRootOptions={mode:"open"};Jr.getTemplateHTML=Qf;u.customElements.get("media-tooltip")||u.customElements.define("media-tooltip",Jr);var ka=Jr;var tc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(tc(i,e,"read from private field"),t?t.call(i):e.get(i)),en=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},La=(i,e,t,r)=>(tc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Zf=(i,e,t)=>(tc(i,e,"access private method"),t),At,rn,fi,tn,wa,ec,wp,vi={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Xf(i,e={}){return`
509
+ `}var Jr=class extends u.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!sa(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let r=getComputedStyle(this),n=(e=bt(this,"#"+this.bounds))!=null?e:ne(this);if(!n)return;let{x:o,width:s}=n.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),h=l+d,p=o+s,g=r.getPropertyValue("--media-tooltip-offset-x"),f=g?parseFloat(g.replace("px","")):0,E=r.getPropertyValue("--media-tooltip-container-margin"),T=E?parseFloat(E.replace("px","")):0,v=l-o+f-T,S=h-p+f+T;if(v<0){this.style.setProperty("--media-tooltip-offset-x",`${v}px`);return}if(S>0){this.style.setProperty("--media-tooltip-offset-x",`${S}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[jr.PLACEMENT,jr.BOUNDS]}get placement(){return O(this,jr.PLACEMENT)}set placement(e){N(this,jr.PLACEMENT,e)}get bounds(){return O(this,jr.BOUNDS)}set bounds(e){N(this,jr.BOUNDS,e)}};Jr.shadowRootOptions={mode:"open"};Jr.getTemplateHTML=Zf;u.customElements.get("media-tooltip")||u.customElements.define("media-tooltip",Jr);var ka=Jr;var tc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(tc(i,e,"read from private field"),t?t.call(i):e.get(i)),en=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},La=(i,e,t,r)=>(tc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Xf=(i,e,t)=>(tc(i,e,"access private method"),t),At,rn,fi,tn,wa,ec,Ip,vi={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function jf(i,e={}){return`
510
510
  <style>
511
511
  :host {
512
512
  position: relative;
@@ -588,12 +588,12 @@ bp-player[has-error] {
588
588
  </slot>
589
589
  </media-tooltip>
590
590
  </slot>
591
- `}function jf(i,e){return`
591
+ `}function Jf(i,e){return`
592
592
  <slot></slot>
593
- `}function Jf(){return""}var X=class extends u.HTMLElement{constructor(){if(super(),en(this,ec),en(this,At,void 0),this.preventClick=!1,this.tooltipEl=null,en(this,rn,e=>{this.preventClick||this.handleClick(e),setTimeout(ge(this,fi),0)}),en(this,fi,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),en(this,tn,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",ge(this,tn));return}this.preventClick||this.handleClick(e)}),en(this,wa,e=>{let{metaKey:t,altKey:r,key:n}=e;if(t||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",ge(this,tn));return}this.addEventListener("keyup",ge(this,tn),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",vi.TOOLTIP_PLACEMENT,V.MEDIA_CONTROLLER,a.MEDIA_LANG]}enable(){this.addEventListener("click",ge(this,rn)),this.addEventListener("keydown",ge(this,wa)),this.tabIndex=0}disable(){this.removeEventListener("click",ge(this,rn)),this.removeEventListener("keydown",ge(this,wa)),this.removeEventListener("keyup",ge(this,tn)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===V.MEDIA_CONTROLLER?(t&&((o=(n=ge(this,At))==null?void 0:n.unassociateElement)==null||o.call(n,this),La(this,At,null)),r&&this.isConnected&&(La(this,At,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ge(this,At))==null?void 0:l.associateElement)==null||d.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===vi.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===a.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),ge(this,fi).call(this)}connectedCallback(){var e,t,r;let{style:n}=oe(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let o=this.getAttribute(V.MEDIA_CONTROLLER);o&&(La(this,At,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=ge(this,At))==null?void 0:t.associateElement)==null||r.call(t,this)),u.customElements.whenDefined("media-tooltip").then(()=>Zf(this,ec,wp).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=ge(this,At))==null?void 0:e.unassociateElement)==null||t.call(e,this),La(this,At,null),this.removeEventListener("mouseenter",ge(this,fi)),this.removeEventListener("focus",ge(this,fi)),this.removeEventListener("click",ge(this,rn))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return O(this,vi.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){N(this,vi.TOOLTIP_PLACEMENT,e)}get mediaController(){return O(this,V.MEDIA_CONTROLLER)}set mediaController(e){N(this,V.MEDIA_CONTROLLER,e)}get disabled(){return M(this,vi.DISABLED)}set disabled(e){x(this,vi.DISABLED,e)}get noTooltip(){return M(this,vi.NO_TOOLTIP)}set noTooltip(e){x(this,vi.NO_TOOLTIP,e)}handleClick(e){}};At=new WeakMap;rn=new WeakMap;fi=new WeakMap;tn=new WeakMap;wa=new WeakMap;ec=new WeakSet;wp=function(){this.addEventListener("mouseenter",ge(this,fi)),this.addEventListener("focus",ge(this,fi)),this.addEventListener("click",ge(this,rn));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};X.shadowRootOptions={mode:"open"};X.getTemplateHTML=Xf;X.getSlotTemplateHTML=jf;X.getTooltipContentHTML=Jf;u.customElements.get("media-chrome-button")||u.customElements.define("media-chrome-button",X);var Ip=`<svg aria-hidden="true" viewBox="0 0 26 24">
593
+ `}function eE(){return""}var X=class extends u.HTMLElement{constructor(){if(super(),en(this,ec),en(this,At,void 0),this.preventClick=!1,this.tooltipEl=null,en(this,rn,e=>{this.preventClick||this.handleClick(e),setTimeout(ge(this,fi),0)}),en(this,fi,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),en(this,tn,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",ge(this,tn));return}this.preventClick||this.handleClick(e)}),en(this,wa,e=>{let{metaKey:t,altKey:r,key:n}=e;if(t||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",ge(this,tn));return}this.addEventListener("keyup",ge(this,tn),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",vi.TOOLTIP_PLACEMENT,V.MEDIA_CONTROLLER,a.MEDIA_LANG]}enable(){this.addEventListener("click",ge(this,rn)),this.addEventListener("keydown",ge(this,wa)),this.tabIndex=0}disable(){this.removeEventListener("click",ge(this,rn)),this.removeEventListener("keydown",ge(this,wa)),this.removeEventListener("keyup",ge(this,tn)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===V.MEDIA_CONTROLLER?(t&&((o=(n=ge(this,At))==null?void 0:n.unassociateElement)==null||o.call(n,this),La(this,At,null)),r&&this.isConnected&&(La(this,At,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ge(this,At))==null?void 0:l.associateElement)==null||d.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===vi.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===a.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),ge(this,fi).call(this)}connectedCallback(){var e,t,r;let{style:n}=oe(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let o=this.getAttribute(V.MEDIA_CONTROLLER);o&&(La(this,At,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=ge(this,At))==null?void 0:t.associateElement)==null||r.call(t,this)),u.customElements.whenDefined("media-tooltip").then(()=>Xf(this,ec,Ip).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=ge(this,At))==null?void 0:e.unassociateElement)==null||t.call(e,this),La(this,At,null),this.removeEventListener("mouseenter",ge(this,fi)),this.removeEventListener("focus",ge(this,fi)),this.removeEventListener("click",ge(this,rn))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return O(this,vi.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){N(this,vi.TOOLTIP_PLACEMENT,e)}get mediaController(){return O(this,V.MEDIA_CONTROLLER)}set mediaController(e){N(this,V.MEDIA_CONTROLLER,e)}get disabled(){return M(this,vi.DISABLED)}set disabled(e){x(this,vi.DISABLED,e)}get noTooltip(){return M(this,vi.NO_TOOLTIP)}set noTooltip(e){x(this,vi.NO_TOOLTIP,e)}handleClick(e){}};At=new WeakMap;rn=new WeakMap;fi=new WeakMap;tn=new WeakMap;wa=new WeakMap;ec=new WeakSet;Ip=function(){this.addEventListener("mouseenter",ge(this,fi)),this.addEventListener("focus",ge(this,fi)),this.addEventListener("click",ge(this,rn));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};X.shadowRootOptions={mode:"open"};X.getTemplateHTML=jf;X.getSlotTemplateHTML=Jf;X.getTooltipContentHTML=eE;u.customElements.get("media-chrome-button")||u.customElements.define("media-chrome-button",X);var Cp=`<svg aria-hidden="true" viewBox="0 0 26 24">
594
594
  <path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
595
595
  </svg>
596
- `;function eE(i){return`
596
+ `;function tE(i){return`
597
597
  <style>
598
598
  :host([${a.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
599
599
  display: none !important;
@@ -611,17 +611,17 @@ bp-player[has-error] {
611
611
  </style>
612
612
 
613
613
  <slot name="icon">
614
- <slot name="enter">${Ip}</slot>
615
- <slot name="exit">${Ip}</slot>
614
+ <slot name="enter">${Cp}</slot>
615
+ <slot name="exit">${Cp}</slot>
616
616
  </slot>
617
- `}function tE(){return`
617
+ `}function iE(){return`
618
618
  <slot name="tooltip-enter">${b("start airplay")}</slot>
619
619
  <slot name="tooltip-exit">${b("stop airplay")}</slot>
620
- `}var Cp=i=>{let e=i.mediaIsAirplaying?b("stop airplay"):b("start airplay");i.setAttribute("aria-label",e)},Ho=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_AIRPLAYING,a.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Cp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_AIRPLAYING&&Cp(this)}get mediaIsAirplaying(){return M(this,a.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){x(this,a.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return O(this,a.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){N(this,a.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new u.CustomEvent(_.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};Ho.getSlotTemplateHTML=eE;Ho.getTooltipContentHTML=tE;u.customElements.get("media-airplay-button")||u.customElements.define("media-airplay-button",Ho);var iE=`<svg aria-hidden="true" viewBox="0 0 26 24">
620
+ `}var Rp=i=>{let e=i.mediaIsAirplaying?b("stop airplay"):b("start airplay");i.setAttribute("aria-label",e)},Ho=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_AIRPLAYING,a.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Rp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_AIRPLAYING&&Rp(this)}get mediaIsAirplaying(){return M(this,a.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){x(this,a.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return O(this,a.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){N(this,a.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new u.CustomEvent(_.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};Ho.getSlotTemplateHTML=tE;Ho.getTooltipContentHTML=iE;u.customElements.get("media-airplay-button")||u.customElements.define("media-airplay-button",Ho);var rE=`<svg aria-hidden="true" viewBox="0 0 26 24">
621
621
  <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
622
- </svg>`,rE=`<svg aria-hidden="true" viewBox="0 0 26 24">
622
+ </svg>`,nE=`<svg aria-hidden="true" viewBox="0 0 26 24">
623
623
  <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
624
- </svg>`;function nE(i){return`
624
+ </svg>`;function oE(i){return`
625
625
  <style>
626
626
  :host([aria-checked="true"]) slot[name=off] {
627
627
  display: none !important;
@@ -639,13 +639,13 @@ bp-player[has-error] {
639
639
  </style>
640
640
 
641
641
  <slot name="icon">
642
- <slot name="on">${iE}</slot>
643
- <slot name="off">${rE}</slot>
642
+ <slot name="on">${rE}</slot>
643
+ <slot name="off">${nE}</slot>
644
644
  </slot>
645
- `}function oE(){return`
645
+ `}function sE(){return`
646
646
  <slot name="tooltip-enable">${b("Enable captions")}</slot>
647
647
  <slot name="tooltip-disable">${b("Disable captions")}</slot>
648
- `}var Rp=i=>{i.setAttribute("aria-checked",Ea(i).toString())},$o=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",b("closed captions")),Rp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING&&Rp(this)}get mediaSubtitlesList(){return Mp(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){xp(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Mp(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){xp(this,a.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new u.CustomEvent(_.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};$o.getSlotTemplateHTML=nE;$o.getTooltipContentHTML=oE;var Mp=(i,e)=>{let t=i.getAttribute(e);return t?ir(t):[]},xp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=qt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-button")||u.customElements.define("media-captions-button",$o);var sE='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',aE='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>';function lE(i){return`
648
+ `}var Mp=i=>{i.setAttribute("aria-checked",Ea(i).toString())},$o=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",b("closed captions")),Mp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING&&Mp(this)}get mediaSubtitlesList(){return xp(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Pp(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return xp(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Pp(this,a.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new u.CustomEvent(_.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};$o.getSlotTemplateHTML=oE;$o.getTooltipContentHTML=sE;var xp=(i,e)=>{let t=i.getAttribute(e);return t?ir(t):[]},Pp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=qt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-button")||u.customElements.define("media-captions-button",$o);var aE='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',lE='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>';function dE(i){return`
649
649
  <style>
650
650
  :host([${a.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
651
651
  display: none !important;
@@ -663,13 +663,13 @@ bp-player[has-error] {
663
663
  </style>
664
664
 
665
665
  <slot name="icon">
666
- <slot name="enter">${sE}</slot>
667
- <slot name="exit">${aE}</slot>
666
+ <slot name="enter">${aE}</slot>
667
+ <slot name="exit">${lE}</slot>
668
668
  </slot>
669
- `}function dE(){return`
669
+ `}function cE(){return`
670
670
  <slot name="tooltip-enter">${b("Start casting")}</slot>
671
671
  <slot name="tooltip-exit">${b("Stop casting")}</slot>
672
- `}var Pp=i=>{let e=i.mediaIsCasting?b("stop casting"):b("start casting");i.setAttribute("aria-label",e)},Vo=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_CASTING,a.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Pp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_CASTING&&Pp(this)}get mediaIsCasting(){return M(this,a.MEDIA_IS_CASTING)}set mediaIsCasting(e){x(this,a.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return O(this,a.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){N(this,a.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?_.MEDIA_EXIT_CAST_REQUEST:_.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};Vo.getSlotTemplateHTML=lE;Vo.getTooltipContentHTML=dE;u.customElements.get("media-cast-button")||u.customElements.define("media-cast-button",Vo);var lc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},dr=(i,e,t)=>(lc(i,e,"read from private field"),t?t.call(i):e.get(i)),Gt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},dc=(i,e,t,r)=>(lc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),lr=(i,e,t)=>(lc(i,e,"access private method"),t),Ca,Wo,cr,Ia,ic,rc,Dp,nc,Op,oc,Np,sc,Up,ac,Hp;function cE(i){return`
672
+ `}var Dp=i=>{let e=i.mediaIsCasting?b("stop casting"):b("start casting");i.setAttribute("aria-label",e)},Vo=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_CASTING,a.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Dp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_CASTING&&Dp(this)}get mediaIsCasting(){return M(this,a.MEDIA_IS_CASTING)}set mediaIsCasting(e){x(this,a.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return O(this,a.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){N(this,a.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?_.MEDIA_EXIT_CAST_REQUEST:_.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};Vo.getSlotTemplateHTML=dE;Vo.getTooltipContentHTML=cE;u.customElements.get("media-cast-button")||u.customElements.define("media-cast-button",Vo);var lc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},dr=(i,e,t)=>(lc(i,e,"read from private field"),t?t.call(i):e.get(i)),Gt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},dc=(i,e,t,r)=>(lc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),lr=(i,e,t)=>(lc(i,e,"access private method"),t),Ca,Wo,cr,Ia,ic,rc,Op,nc,Np,oc,Up,sc,Hp,ac,$p;function uE(i){return`
673
673
  <style>
674
674
  :host {
675
675
  font: var(--media-font,
@@ -710,9 +710,9 @@ bp-player[has-error] {
710
710
  }
711
711
  </style>
712
712
  ${this.getSlotTemplateHTML(i)}
713
- `}function uE(i){return`
713
+ `}function hE(i){return`
714
714
  <slot id="content"></slot>
715
- `}var Bo={OPEN:"open",ANCHOR:"anchor"},St=class extends u.HTMLElement{constructor(){super(),Gt(this,Ia),Gt(this,rc),Gt(this,nc),Gt(this,oc),Gt(this,sc),Gt(this,ac),Gt(this,Ca,!1),Gt(this,Wo,null),Gt(this,cr,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Bo.OPEN,Bo.ANCHOR]}get open(){return M(this,Bo.OPEN)}set open(e){x(this,Bo.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":lr(this,oc,Np).call(this,e);break;case"focusout":lr(this,sc,Up).call(this,e);break;case"keydown":lr(this,ac,Hp).call(this,e);break}}connectedCallback(){lr(this,Ia,ic).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){lr(this,Ia,ic).call(this),e===Bo.OPEN&&r!==t&&(this.open?lr(this,rc,Dp).call(this):lr(this,nc,Op).call(this))}focus(){dc(this,Wo,wo());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),t=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||t)return;let r=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');r==null||r.focus()}get keysUsed(){return["Escape","Tab"]}};Ca=new WeakMap;Wo=new WeakMap;cr=new WeakMap;Ia=new WeakSet;ic=function(){if(!dr(this,Ca)&&(dc(this,Ca,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=oe(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};rc=new WeakSet;Dp=function(){var i;(i=dr(this,cr))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};nc=new WeakSet;Op=function(){var i;(i=dr(this,cr))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};oc=new WeakSet;Np=function(i){dc(this,cr,i.relatedTarget),xe(this,i.relatedTarget)||(this.open=!this.open)};sc=new WeakSet;Up=function(i){var e;xe(this,i.relatedTarget)||((e=dr(this,Wo))==null||e.focus(),dr(this,cr)&&dr(this,cr)!==i.relatedTarget&&this.open&&(this.open=!1))};ac=new WeakSet;Hp=function(i){var e,t,r,n,o;let{key:s,ctrlKey:l,altKey:d,metaKey:h}=i;l||d||h||this.keysUsed.includes(s)&&(i.preventDefault(),i.stopPropagation(),s==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(n=(r=this.nextElementSibling)==null?void 0:r.focus)==null||n.call(r),this.blur()):s==="Escape"&&((o=dr(this,Wo))==null||o.focus(),this.open=!1))};St.shadowRootOptions={mode:"open"};St.getTemplateHTML=cE;St.getSlotTemplateHTML=uE;u.customElements.get("media-chrome-dialog")||u.customElements.define("media-chrome-dialog",St);var fc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pe=(i,e,t)=>(fc(i,e,"read from private field"),t?t.call(i):e.get(i)),Ie=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ei=(i,e,t,r)=>(fc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),dt=(i,e,t)=>(fc(i,e,"access private method"),t),kt,$a,Ra,Ma,ct,Ua,xa,Pa,Da,Ec,$p,Oa,cc,Na,uc,Ha,gc,hc,Vp,pc,Bp,mc,Wp,vc,Fp;function hE(i){return`
715
+ `}var Bo={OPEN:"open",ANCHOR:"anchor"},St=class extends u.HTMLElement{constructor(){super(),Gt(this,Ia),Gt(this,rc),Gt(this,nc),Gt(this,oc),Gt(this,sc),Gt(this,ac),Gt(this,Ca,!1),Gt(this,Wo,null),Gt(this,cr,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Bo.OPEN,Bo.ANCHOR]}get open(){return M(this,Bo.OPEN)}set open(e){x(this,Bo.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":lr(this,oc,Up).call(this,e);break;case"focusout":lr(this,sc,Hp).call(this,e);break;case"keydown":lr(this,ac,$p).call(this,e);break}}connectedCallback(){lr(this,Ia,ic).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){lr(this,Ia,ic).call(this),e===Bo.OPEN&&r!==t&&(this.open?lr(this,rc,Op).call(this):lr(this,nc,Np).call(this))}focus(){dc(this,Wo,wo());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),t=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||t)return;let r=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');r==null||r.focus()}get keysUsed(){return["Escape","Tab"]}};Ca=new WeakMap;Wo=new WeakMap;cr=new WeakMap;Ia=new WeakSet;ic=function(){if(!dr(this,Ca)&&(dc(this,Ca,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=oe(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};rc=new WeakSet;Op=function(){var i;(i=dr(this,cr))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};nc=new WeakSet;Np=function(){var i;(i=dr(this,cr))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};oc=new WeakSet;Up=function(i){dc(this,cr,i.relatedTarget),xe(this,i.relatedTarget)||(this.open=!this.open)};sc=new WeakSet;Hp=function(i){var e;xe(this,i.relatedTarget)||((e=dr(this,Wo))==null||e.focus(),dr(this,cr)&&dr(this,cr)!==i.relatedTarget&&this.open&&(this.open=!1))};ac=new WeakSet;$p=function(i){var e,t,r,n,o;let{key:s,ctrlKey:l,altKey:d,metaKey:h}=i;l||d||h||this.keysUsed.includes(s)&&(i.preventDefault(),i.stopPropagation(),s==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(n=(r=this.nextElementSibling)==null?void 0:r.focus)==null||n.call(r),this.blur()):s==="Escape"&&((o=dr(this,Wo))==null||o.focus(),this.open=!1))};St.shadowRootOptions={mode:"open"};St.getTemplateHTML=uE;St.getSlotTemplateHTML=hE;u.customElements.get("media-chrome-dialog")||u.customElements.define("media-chrome-dialog",St);var fc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pe=(i,e,t)=>(fc(i,e,"read from private field"),t?t.call(i):e.get(i)),Ie=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ei=(i,e,t,r)=>(fc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),dt=(i,e,t)=>(fc(i,e,"access private method"),t),kt,$a,Ra,Ma,ct,Ua,xa,Pa,Da,Ec,Vp,Oa,cc,Na,uc,Ha,gc,hc,Bp,pc,Wp,mc,Fp,vc,Kp;function pE(i){return`
716
716
  <style>
717
717
  :host {
718
718
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -942,7 +942,7 @@ bp-player[has-error] {
942
942
  ${this.getContainerTemplateHTML(i)}
943
943
  </div>
944
944
  <div id="rightgap"></div>
945
- `}function pE(i){return""}var Lt=class extends u.HTMLElement{constructor(){if(super(),Ie(this,Ec),Ie(this,Oa),Ie(this,Na),Ie(this,Ha),Ie(this,hc),Ie(this,pc),Ie(this,mc),Ie(this,vc),Ie(this,kt,void 0),Ie(this,$a,void 0),Ie(this,Ra,void 0),Ie(this,Ma,void 0),Ie(this,ct,{}),Ie(this,Ua,[]),Ie(this,xa,()=>{if(this.range.matches(":focus-visible")){let{style:e}=oe(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),Ie(this,Pa,()=>{let{style:e}=oe(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),Ie(this,Da,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),Ei(this,Ra,this.shadowRoot.querySelector("#startpoint")),Ei(this,Ma,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",V.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===V.MEDIA_CONTROLLER?(t&&((o=(n=pe(this,kt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ei(this,kt,null)),r&&this.isConnected&&(Ei(this,kt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=pe(this,kt))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),dt(this,Oa,cc).call(this)):(this.range.setAttribute(e,r),dt(this,Na,uc).call(this)))}connectedCallback(){var e,t,r;let{style:n}=oe(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),pe(this,ct).pointer=oe(this.shadowRoot,"#pointer"),pe(this,ct).progress=oe(this.shadowRoot,"#progress"),pe(this,ct).thumb=oe(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),pe(this,ct).activeSegment=oe(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(V.MEDIA_CONTROLLER);o&&(Ei(this,kt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=pe(this,kt))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",pe(this,xa)),this.shadowRoot.addEventListener("focusout",pe(this,Pa)),dt(this,Oa,cc).call(this),Wt(this.container,pe(this,Da))}disconnectedCallback(){var e,t;dt(this,Na,uc).call(this),(t=(e=pe(this,kt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ei(this,kt,null),this.shadowRoot.removeEventListener("focusin",pe(this,xa)),this.shadowRoot.removeEventListener("focusout",pe(this,Pa)),Ft(this.container,pe(this,Da))}updatePointerBar(e){var t;(t=pe(this,ct).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=pe(this,ct).progress)==null||e.style.setProperty("width",`${r}%`),(t=pe(this,ct).thumb)==null||t.style.setProperty("left",`${r}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let r=[...new Set([+this.range.min,...e.flatMap(o=>[o.start,o.end]),+this.range.max])];Ei(this,Ua,[...r]);let n=r.pop();for(let[o,s]of r.entries()){let[l,d]=[o===0,o===r.length-1],h=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,g=`calc(${((d?n:r[o+1])-s)*100}%${l||d?"":" - var(--segments-gap)"})`,f=le.createElementNS("http://www.w3.org/2000/svg","rect"),E=Io(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);E.style.setProperty("x",h),E.style.setProperty("width",g),t.append(f)}}getPointerRatio(e){return Zh(e.clientX,e.clientY,pe(this,Ra).getBoundingClientRect(),pe(this,Ma).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":dt(this,vc,Fp).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":dt(this,hc,Vp).call(this,e);break;case"pointerdown":dt(this,Ha,gc).call(this,e);break;case"pointerup":dt(this,pc,Bp).call(this);break;case"pointerleave":dt(this,mc,Wp).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};kt=new WeakMap;$a=new WeakMap;Ra=new WeakMap;Ma=new WeakMap;ct=new WeakMap;Ua=new WeakMap;xa=new WeakMap;Pa=new WeakMap;Da=new WeakMap;Ec=new WeakSet;$p=function(i){let e=pe(this,ct).activeSegment;if(!e)return;let t=this.getPointerRatio(i),n=`#segments-clipping rect:nth-child(${pe(this,Ua).findIndex((o,s,l)=>{let d=l[s+1];return d!=null&&t>=o&&t<=d})+1})`;(e.selectorText!=n||!e.style.transform)&&(e.selectorText=n,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Oa=new WeakSet;cc=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Na=new WeakSet;uc=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=u.window)==null||i.removeEventListener("pointerup",this),(e=u.window)==null||e.removeEventListener("pointermove",this)};Ha=new WeakSet;gc=function(i){var e;Ei(this,$a,i.composedPath().includes(this.range)),(e=u.window)==null||e.addEventListener("pointerup",this)};hc=new WeakSet;Vp=function(i){var e;i.pointerType!=="mouse"&&dt(this,Ha,gc).call(this,i),this.addEventListener("pointerleave",this),(e=u.window)==null||e.addEventListener("pointermove",this)};pc=new WeakSet;Bp=function(){var i;(i=u.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};mc=new WeakSet;Wp=function(){var i,e;this.removeEventListener("pointerleave",this),(i=u.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=pe(this,ct).activeSegment)==null||e.style.removeProperty("transform")};vc=new WeakSet;Fp=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),dt(this,Ec,$p).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!pe(this,$a))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};Lt.shadowRootOptions={mode:"open"};Lt.getTemplateHTML=hE;Lt.getContainerTemplateHTML=pE;u.customElements.get("media-chrome-range")||u.customElements.define("media-chrome-range",Lt);var Kp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Va=(i,e,t)=>(Kp(i,e,"read from private field"),t?t.call(i):e.get(i)),mE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ba=(i,e,t,r)=>(Kp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),wt;function vE(i){return`
945
+ `}function mE(i){return""}var Lt=class extends u.HTMLElement{constructor(){if(super(),Ie(this,Ec),Ie(this,Oa),Ie(this,Na),Ie(this,Ha),Ie(this,hc),Ie(this,pc),Ie(this,mc),Ie(this,vc),Ie(this,kt,void 0),Ie(this,$a,void 0),Ie(this,Ra,void 0),Ie(this,Ma,void 0),Ie(this,ct,{}),Ie(this,Ua,[]),Ie(this,xa,()=>{if(this.range.matches(":focus-visible")){let{style:e}=oe(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),Ie(this,Pa,()=>{let{style:e}=oe(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),Ie(this,Da,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),Ei(this,Ra,this.shadowRoot.querySelector("#startpoint")),Ei(this,Ma,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",V.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===V.MEDIA_CONTROLLER?(t&&((o=(n=pe(this,kt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ei(this,kt,null)),r&&this.isConnected&&(Ei(this,kt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=pe(this,kt))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),dt(this,Oa,cc).call(this)):(this.range.setAttribute(e,r),dt(this,Na,uc).call(this)))}connectedCallback(){var e,t,r;let{style:n}=oe(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),pe(this,ct).pointer=oe(this.shadowRoot,"#pointer"),pe(this,ct).progress=oe(this.shadowRoot,"#progress"),pe(this,ct).thumb=oe(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),pe(this,ct).activeSegment=oe(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(V.MEDIA_CONTROLLER);o&&(Ei(this,kt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=pe(this,kt))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",pe(this,xa)),this.shadowRoot.addEventListener("focusout",pe(this,Pa)),dt(this,Oa,cc).call(this),Wt(this.container,pe(this,Da))}disconnectedCallback(){var e,t;dt(this,Na,uc).call(this),(t=(e=pe(this,kt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ei(this,kt,null),this.shadowRoot.removeEventListener("focusin",pe(this,xa)),this.shadowRoot.removeEventListener("focusout",pe(this,Pa)),Ft(this.container,pe(this,Da))}updatePointerBar(e){var t;(t=pe(this,ct).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=pe(this,ct).progress)==null||e.style.setProperty("width",`${r}%`),(t=pe(this,ct).thumb)==null||t.style.setProperty("left",`${r}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let r=[...new Set([+this.range.min,...e.flatMap(o=>[o.start,o.end]),+this.range.max])];Ei(this,Ua,[...r]);let n=r.pop();for(let[o,s]of r.entries()){let[l,d]=[o===0,o===r.length-1],h=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,g=`calc(${((d?n:r[o+1])-s)*100}%${l||d?"":" - var(--segments-gap)"})`,f=le.createElementNS("http://www.w3.org/2000/svg","rect"),E=Io(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);E.style.setProperty("x",h),E.style.setProperty("width",g),t.append(f)}}getPointerRatio(e){return Xh(e.clientX,e.clientY,pe(this,Ra).getBoundingClientRect(),pe(this,Ma).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":dt(this,vc,Kp).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":dt(this,hc,Bp).call(this,e);break;case"pointerdown":dt(this,Ha,gc).call(this,e);break;case"pointerup":dt(this,pc,Wp).call(this);break;case"pointerleave":dt(this,mc,Fp).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};kt=new WeakMap;$a=new WeakMap;Ra=new WeakMap;Ma=new WeakMap;ct=new WeakMap;Ua=new WeakMap;xa=new WeakMap;Pa=new WeakMap;Da=new WeakMap;Ec=new WeakSet;Vp=function(i){let e=pe(this,ct).activeSegment;if(!e)return;let t=this.getPointerRatio(i),n=`#segments-clipping rect:nth-child(${pe(this,Ua).findIndex((o,s,l)=>{let d=l[s+1];return d!=null&&t>=o&&t<=d})+1})`;(e.selectorText!=n||!e.style.transform)&&(e.selectorText=n,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Oa=new WeakSet;cc=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Na=new WeakSet;uc=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=u.window)==null||i.removeEventListener("pointerup",this),(e=u.window)==null||e.removeEventListener("pointermove",this)};Ha=new WeakSet;gc=function(i){var e;Ei(this,$a,i.composedPath().includes(this.range)),(e=u.window)==null||e.addEventListener("pointerup",this)};hc=new WeakSet;Bp=function(i){var e;i.pointerType!=="mouse"&&dt(this,Ha,gc).call(this,i),this.addEventListener("pointerleave",this),(e=u.window)==null||e.addEventListener("pointermove",this)};pc=new WeakSet;Wp=function(){var i;(i=u.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};mc=new WeakSet;Fp=function(){var i,e;this.removeEventListener("pointerleave",this),(i=u.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=pe(this,ct).activeSegment)==null||e.style.removeProperty("transform")};vc=new WeakSet;Kp=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),dt(this,Ec,Vp).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!pe(this,$a))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};Lt.shadowRootOptions={mode:"open"};Lt.getTemplateHTML=pE;Lt.getContainerTemplateHTML=mE;u.customElements.get("media-chrome-range")||u.customElements.define("media-chrome-range",Lt);var qp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Va=(i,e,t)=>(qp(i,e,"read from private field"),t?t.call(i):e.get(i)),vE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ba=(i,e,t,r)=>(qp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),wt;function fE(i){return`
946
946
  <style>
947
947
  :host {
948
948
 
@@ -968,7 +968,7 @@ bp-player[has-error] {
968
968
  </style>
969
969
 
970
970
  <slot></slot>
971
- `}var Fo=class extends u.HTMLElement{constructor(){if(super(),mE(this,wt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[V.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===V.MEDIA_CONTROLLER&&(t&&((o=(n=Va(this,wt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ba(this,wt,null)),r&&this.isConnected&&(Ba(this,wt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Va(this,wt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let n=this.getAttribute(V.MEDIA_CONTROLLER);n&&(Ba(this,wt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Va(this,wt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Va(this,wt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ba(this,wt,null)}};wt=new WeakMap;Fo.shadowRootOptions={mode:"open"};Fo.getTemplateHTML=vE;u.customElements.get("media-control-bar")||u.customElements.define("media-control-bar",Fo);var qp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Wa=(i,e,t)=>(qp(i,e,"read from private field"),t?t.call(i):e.get(i)),fE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Fa=(i,e,t,r)=>(qp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),It;function EE(i,e={}){return`
971
+ `}var Fo=class extends u.HTMLElement{constructor(){if(super(),vE(this,wt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[V.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===V.MEDIA_CONTROLLER&&(t&&((o=(n=Va(this,wt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ba(this,wt,null)),r&&this.isConnected&&(Ba(this,wt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Va(this,wt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let n=this.getAttribute(V.MEDIA_CONTROLLER);n&&(Ba(this,wt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Va(this,wt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Va(this,wt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ba(this,wt,null)}};wt=new WeakMap;Fo.shadowRootOptions={mode:"open"};Fo.getTemplateHTML=fE;u.customElements.get("media-control-bar")||u.customElements.define("media-control-bar",Fo);var Gp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Wa=(i,e,t)=>(Gp(i,e,"read from private field"),t?t.call(i):e.get(i)),EE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Fa=(i,e,t,r)=>(Gp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),It;function gE(i,e={}){return`
972
972
  <style>
973
973
  :host {
974
974
  font: var(--media-font,
@@ -1002,11 +1002,11 @@ bp-player[has-error] {
1002
1002
  </style>
1003
1003
 
1004
1004
  ${this.getSlotTemplateHTML(i,e)}
1005
- `}function gE(i,e){return`
1005
+ `}function bE(i,e){return`
1006
1006
  <slot></slot>
1007
- `}var Ve=class extends u.HTMLElement{constructor(){if(super(),fE(this,It,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[V.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===V.MEDIA_CONTROLLER&&(t&&((o=(n=Wa(this,It))==null?void 0:n.unassociateElement)==null||o.call(n,this),Fa(this,It,null)),r&&this.isConnected&&(Fa(this,It,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Wa(this,It))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let{style:n}=oe(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let o=this.getAttribute(V.MEDIA_CONTROLLER);o&&(Fa(this,It,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Wa(this,It))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Wa(this,It))==null?void 0:e.unassociateElement)==null||t.call(e,this),Fa(this,It,null)}};It=new WeakMap;Ve.shadowRootOptions={mode:"open"};Ve.getTemplateHTML=EE;Ve.getSlotTemplateHTML=gE;u.customElements.get("media-text-display")||u.customElements.define("media-text-display",Ve);var zp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Gp=(i,e,t)=>(zp(i,e,"read from private field"),t?t.call(i):e.get(i)),bE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_E=(i,e,t,r)=>(zp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ko;function yE(i,e){return`
1007
+ `}var Ve=class extends u.HTMLElement{constructor(){if(super(),EE(this,It,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[V.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===V.MEDIA_CONTROLLER&&(t&&((o=(n=Wa(this,It))==null?void 0:n.unassociateElement)==null||o.call(n,this),Fa(this,It,null)),r&&this.isConnected&&(Fa(this,It,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Wa(this,It))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let{style:n}=oe(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let o=this.getAttribute(V.MEDIA_CONTROLLER);o&&(Fa(this,It,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Wa(this,It))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Wa(this,It))==null?void 0:e.unassociateElement)==null||t.call(e,this),Fa(this,It,null)}};It=new WeakMap;Ve.shadowRootOptions={mode:"open"};Ve.getTemplateHTML=gE;Ve.getSlotTemplateHTML=bE;u.customElements.get("media-text-display")||u.customElements.define("media-text-display",Ve);var Yp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},zp=(i,e,t)=>(Yp(i,e,"read from private field"),t?t.call(i):e.get(i)),_E=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},yE=(i,e,t,r)=>(Yp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ko;function TE(i,e){return`
1008
1008
  <slot>${lt(e.mediaDuration)}</slot>
1009
- `}var Ka=class extends Ve{constructor(){var e;super(),bE(this,Ko,void 0),_E(this,Ko,this.shadowRoot.querySelector("slot")),Gp(this,Ko).textContent=lt((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===a.MEDIA_DURATION&&(Gp(this,Ko).textContent=lt(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return q(this,a.MEDIA_DURATION)}set mediaDuration(e){z(this,a.MEDIA_DURATION,e)}};Ko=new WeakMap;Ka.getSlotTemplateHTML=yE;u.customElements.get("media-duration-display")||u.customElements.define("media-duration-display",Ka);var TE={2:b("Network Error"),3:b("Decode Error"),4:b("Source Not Supported"),5:b("Encryption Error")},AE={2:b("A network error caused the media download to fail."),3:b("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:b("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:b("The media is encrypted and there are no keys to decrypt it.")},bc=i=>{var e,t;return i.code===1?null:{title:(e=TE[i.code])!=null?e:`Error ${i.code}`,message:(t=AE[i.code])!=null?t:i.message}};var Qp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},SE=(i,e,t)=>(Qp(i,e,"read from private field"),t?t.call(i):e.get(i)),kE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},LE=(i,e,t,r)=>(Qp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),qa;function wE(i){return`
1009
+ `}var Ka=class extends Ve{constructor(){var e;super(),_E(this,Ko,void 0),yE(this,Ko,this.shadowRoot.querySelector("slot")),zp(this,Ko).textContent=lt((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===a.MEDIA_DURATION&&(zp(this,Ko).textContent=lt(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return q(this,a.MEDIA_DURATION)}set mediaDuration(e){z(this,a.MEDIA_DURATION,e)}};Ko=new WeakMap;Ka.getSlotTemplateHTML=TE;u.customElements.get("media-duration-display")||u.customElements.define("media-duration-display",Ka);var AE={2:b("Network Error"),3:b("Decode Error"),4:b("Source Not Supported"),5:b("Encryption Error")},SE={2:b("A network error caused the media download to fail."),3:b("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:b("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:b("The media is encrypted and there are no keys to decrypt it.")},bc=i=>{var e,t;return i.code===1?null:{title:(e=AE[i.code])!=null?e:`Error ${i.code}`,message:(t=SE[i.code])!=null?t:i.message}};var Zp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},kE=(i,e,t)=>(Zp(i,e,"read from private field"),t?t.call(i):e.get(i)),LE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},wE=(i,e,t,r)=>(Zp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),qa;function IE(i){return`
1010
1010
  <style>
1011
1011
  :host {
1012
1012
  background: rgb(20 20 30 / .8);
@@ -1023,9 +1023,9 @@ bp-player[has-error] {
1023
1023
  }
1024
1024
  </style>
1025
1025
  <slot name="error-${i.mediaerrorcode}" id="content">
1026
- ${Zp({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1026
+ ${Xp({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1027
1027
  </slot>
1028
- `}function IE(i){return i.code&&bc(i)!==null}function Zp(i){var e;let{title:t,message:r}=(e=bc(i))!=null?e:{},n="";return t&&(n+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(n+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),n}var Yp=[a.MEDIA_ERROR_CODE,a.MEDIA_ERROR_MESSAGE],qo=class extends St{constructor(){super(...arguments),kE(this,qa,null)}static get observedAttributes(){return[...super.observedAttributes,...Yp]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var n;if(super.attributeChangedCallback(e,t,r),!Yp.includes(e))return;let o=(n=this.mediaError)!=null?n:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=IE(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o))}get mediaError(){return SE(this,qa)}set mediaError(e){LE(this,qa,e)}get mediaErrorCode(){return q(this,"mediaerrorcode")}set mediaErrorCode(e){z(this,"mediaerrorcode",e)}get mediaErrorMessage(){return O(this,"mediaerrormessage")}set mediaErrorMessage(e){N(this,"mediaerrormessage",e)}};qa=new WeakMap;qo.getSlotTemplateHTML=wE;qo.formatErrorMessage=Zp;u.customElements.get("media-error-dialog")||u.customElements.define("media-error-dialog",qo);var CE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gi=(i,e,t)=>(CE(i,e,"read from private field"),t?t.call(i):e.get(i)),Xp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},nn,on;function RE(i){return`
1028
+ `}function CE(i){return i.code&&bc(i)!==null}function Xp(i){var e;let{title:t,message:r}=(e=bc(i))!=null?e:{},n="";return t&&(n+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(n+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),n}var Qp=[a.MEDIA_ERROR_CODE,a.MEDIA_ERROR_MESSAGE],qo=class extends St{constructor(){super(...arguments),LE(this,qa,null)}static get observedAttributes(){return[...super.observedAttributes,...Qp]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var n;if(super.attributeChangedCallback(e,t,r),!Qp.includes(e))return;let o=(n=this.mediaError)!=null?n:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=CE(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o))}get mediaError(){return kE(this,qa)}set mediaError(e){wE(this,qa,e)}get mediaErrorCode(){return q(this,"mediaerrorcode")}set mediaErrorCode(e){z(this,"mediaerrorcode",e)}get mediaErrorMessage(){return O(this,"mediaerrormessage")}set mediaErrorMessage(e){N(this,"mediaerrormessage",e)}};qa=new WeakMap;qo.getSlotTemplateHTML=IE;qo.formatErrorMessage=Xp;u.customElements.get("media-error-dialog")||u.customElements.define("media-error-dialog",qo);var RE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gi=(i,e,t)=>(RE(i,e,"read from private field"),t?t.call(i):e.get(i)),jp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},nn,on;function ME(i){return`
1029
1029
  <style>
1030
1030
  :host {
1031
1031
  position: fixed;
@@ -1110,9 +1110,9 @@ bp-player[has-error] {
1110
1110
  }
1111
1111
  </style>
1112
1112
  <slot id="content">
1113
- ${ME()}
1113
+ ${xE()}
1114
1114
  </slot>
1115
- `}function ME(){return`
1115
+ `}function xE(){return`
1116
1116
  <h2>Keyboard Shortcuts</h2>
1117
1117
  <table class="shortcuts-table">${[{keys:["Space","k"],description:"Toggle Playback"},{keys:["m"],description:"Toggle mute"},{keys:["f"],description:"Toggle fullscreen"},{keys:["c"],description:"Toggle captions or subtitles, if available"},{keys:["p"],description:"Toggle Picture in Picture"},{keys:["\u2190","j"],description:"Seek back 10s"},{keys:["\u2192","l"],description:"Seek forward 10s"},{keys:["\u2191"],description:"Turn volume up"},{keys:["\u2193"],description:"Turn volume down"},{keys:["< (SHIFT+,)"],description:"Decrease playback rate"},{keys:["> (SHIFT+.)"],description:"Increase playback rate"}].map(({keys:t,description:r})=>`
1118
1118
  <tr>
@@ -1122,11 +1122,11 @@ bp-player[has-error] {
1122
1122
  <td class="description">${r}</td>
1123
1123
  </tr>
1124
1124
  `).join("")}</table>
1125
- `}var Ga=class extends St{constructor(){super(...arguments),Xp(this,nn,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let n=e.composedPath(),o=n[0]===this||n.includes(this),s=n.includes(r);o&&!s&&(this.open=!1)}),Xp(this,on,e=>{if(!this.open)return;let t=e.shiftKey&&(e.key==="/"||e.key==="?");(e.key==="Escape"||t)&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(this.open=!1,e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener("click",gi(this,nn)),document.addEventListener("keydown",gi(this,on)))}disconnectedCallback(){this.removeEventListener("click",gi(this,nn)),document.removeEventListener("keydown",gi(this,on))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",gi(this,nn)),document.addEventListener("keydown",gi(this,on))):(this.removeEventListener("click",gi(this,nn)),document.removeEventListener("keydown",gi(this,on))))}};nn=new WeakMap;on=new WeakMap;Ga.getSlotTemplateHTML=RE;u.customElements.get("media-keyboard-shortcuts-dialog")||u.customElements.define("media-keyboard-shortcuts-dialog",Ga);var Jp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},xE=(i,e,t)=>(Jp(i,e,"read from private field"),t?t.call(i):e.get(i)),PE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},DE=(i,e,t,r)=>(Jp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),za,OE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1125
+ `}var Ga=class extends St{constructor(){super(...arguments),jp(this,nn,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let n=e.composedPath(),o=n[0]===this||n.includes(this),s=n.includes(r);o&&!s&&(this.open=!1)}),jp(this,on,e=>{if(!this.open)return;let t=e.shiftKey&&(e.key==="/"||e.key==="?");(e.key==="Escape"||t)&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(this.open=!1,e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener("click",gi(this,nn)),document.addEventListener("keydown",gi(this,on)))}disconnectedCallback(){this.removeEventListener("click",gi(this,nn)),document.removeEventListener("keydown",gi(this,on))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",gi(this,nn)),document.addEventListener("keydown",gi(this,on))):(this.removeEventListener("click",gi(this,nn)),document.removeEventListener("keydown",gi(this,on))))}};nn=new WeakMap;on=new WeakMap;Ga.getSlotTemplateHTML=ME;u.customElements.get("media-keyboard-shortcuts-dialog")||u.customElements.define("media-keyboard-shortcuts-dialog",Ga);var em=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},PE=(i,e,t)=>(em(i,e,"read from private field"),t?t.call(i):e.get(i)),DE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},OE=(i,e,t,r)=>(em(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),za,NE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1126
1126
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
1127
- </svg>`,NE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1127
+ </svg>`,UE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1128
1128
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
1129
- </svg>`;function UE(i){return`
1129
+ </svg>`;function HE(i){return`
1130
1130
  <style>
1131
1131
  :host([${a.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
1132
1132
  display: none !important;
@@ -1144,13 +1144,13 @@ bp-player[has-error] {
1144
1144
  </style>
1145
1145
 
1146
1146
  <slot name="icon">
1147
- <slot name="enter">${OE}</slot>
1148
- <slot name="exit">${NE}</slot>
1147
+ <slot name="enter">${NE}</slot>
1148
+ <slot name="exit">${UE}</slot>
1149
1149
  </slot>
1150
- `}function HE(){return`
1150
+ `}function $E(){return`
1151
1151
  <slot name="tooltip-enter">${b("Enter fullscreen mode")}</slot>
1152
1152
  <slot name="tooltip-exit">${b("Exit fullscreen mode")}</slot>
1153
- `}var jp=i=>{let e=i.mediaIsFullscreen?b("exit fullscreen mode"):b("enter fullscreen mode");i.setAttribute("aria-label",e)},Go=class extends X{constructor(){super(...arguments),PE(this,za,null)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_FULLSCREEN,a.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),jp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_FULLSCREEN&&jp(this)}get mediaFullscreenUnavailable(){return O(this,a.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){N(this,a.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return M(this,a.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){x(this,a.MEDIA_IS_FULLSCREEN,e)}handleClick(e){DE(this,za,e);let t=xE(this,za)instanceof PointerEvent,r=this.mediaIsFullscreen?new u.CustomEvent(_.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new u.CustomEvent(_.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};za=new WeakMap;Go.getSlotTemplateHTML=UE;Go.getTooltipContentHTML=HE;u.customElements.get("media-fullscreen-button")||u.customElements.define("media-fullscreen-button",Go);var{MEDIA_TIME_IS_LIVE:Ya,MEDIA_PAUSED:zo}=a,{MEDIA_SEEK_TO_LIVE_REQUEST:$E,MEDIA_PLAY_REQUEST:VE}=_,BE='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function WE(i){return`
1153
+ `}var Jp=i=>{let e=i.mediaIsFullscreen?b("exit fullscreen mode"):b("enter fullscreen mode");i.setAttribute("aria-label",e)},Go=class extends X{constructor(){super(...arguments),DE(this,za,null)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_FULLSCREEN,a.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Jp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_FULLSCREEN&&Jp(this)}get mediaFullscreenUnavailable(){return O(this,a.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){N(this,a.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return M(this,a.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){x(this,a.MEDIA_IS_FULLSCREEN,e)}handleClick(e){OE(this,za,e);let t=PE(this,za)instanceof PointerEvent,r=this.mediaIsFullscreen?new u.CustomEvent(_.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new u.CustomEvent(_.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};za=new WeakMap;Go.getSlotTemplateHTML=HE;Go.getTooltipContentHTML=$E;u.customElements.get("media-fullscreen-button")||u.customElements.define("media-fullscreen-button",Go);var{MEDIA_TIME_IS_LIVE:Ya,MEDIA_PAUSED:zo}=a,{MEDIA_SEEK_TO_LIVE_REQUEST:VE,MEDIA_PLAY_REQUEST:BE}=_,WE='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function FE(i){return`
1154
1154
  <style>
1155
1155
  :host { --media-tooltip-display: none; }
1156
1156
 
@@ -1178,10 +1178,10 @@ bp-player[has-error] {
1178
1178
 
1179
1179
  </style>
1180
1180
 
1181
- <slot name="indicator">${BE}</slot>
1181
+ <slot name="indicator">${WE}</slot>
1182
1182
 
1183
1183
  <slot name="spacer">&nbsp;</slot><slot name="text">${b("live")}</slot>
1184
- `}var em=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?b("seek to live"):b("playing live");i.setAttribute("aria-label",r);let n=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');n&&(n.textContent=b("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},Qa=class extends X{static get observedAttributes(){return[...super.observedAttributes,Ya,zo]}connectedCallback(){super.connectedCallback(),em(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),em(this)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return M(this,a.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){x(this,a.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new u.CustomEvent($E,{composed:!0,bubbles:!0})),this.hasAttribute(zo)&&this.dispatchEvent(new u.CustomEvent(VE,{composed:!0,bubbles:!0})))}};Qa.getSlotTemplateHTML=WE;u.customElements.get("media-live-button")||u.customElements.define("media-live-button",Qa);var im=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yo=(i,e,t)=>(im(i,e,"read from private field"),t?t.call(i):e.get(i)),tm=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qo=(i,e,t,r)=>(im(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ct,Xa,Za={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},rm=500,FE=`
1184
+ `}var tm=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?b("seek to live"):b("playing live");i.setAttribute("aria-label",r);let n=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');n&&(n.textContent=b("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},Qa=class extends X{static get observedAttributes(){return[...super.observedAttributes,Ya,zo]}connectedCallback(){super.connectedCallback(),tm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),tm(this)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return M(this,a.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){x(this,a.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new u.CustomEvent(VE,{composed:!0,bubbles:!0})),this.hasAttribute(zo)&&this.dispatchEvent(new u.CustomEvent(BE,{composed:!0,bubbles:!0})))}};Qa.getSlotTemplateHTML=FE;u.customElements.get("media-live-button")||u.customElements.define("media-live-button",Qa);var rm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yo=(i,e,t)=>(rm(i,e,"read from private field"),t?t.call(i):e.get(i)),im=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qo=(i,e,t,r)=>(rm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ct,Xa,Za={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},nm=500,KE=`
1185
1185
  <svg aria-hidden="true" viewBox="0 0 100 100">
1186
1186
  <path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
1187
1187
  <animateTransform
@@ -1194,13 +1194,13 @@ bp-player[has-error] {
1194
1194
  repeatCount="indefinite" />
1195
1195
  </path>
1196
1196
  </svg>
1197
- `;function KE(i){return`
1197
+ `;function qE(i){return`
1198
1198
  <style>
1199
1199
  :host {
1200
1200
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
1201
1201
  vertical-align: middle;
1202
1202
  box-sizing: border-box;
1203
- --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${rm}ms);
1203
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${nm}ms);
1204
1204
  }
1205
1205
 
1206
1206
  #status {
@@ -1239,15 +1239,15 @@ bp-player[has-error] {
1239
1239
  }
1240
1240
  </style>
1241
1241
 
1242
- <slot name="icon">${FE}</slot>
1242
+ <slot name="icon">${KE}</slot>
1243
1243
  <div id="status" role="status" aria-live="polite">${b("media loading")}</div>
1244
- `}var Zo=class extends u.HTMLElement{constructor(){if(super(),tm(this,Ct,void 0),tm(this,Xa,rm),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[V.MEDIA_CONTROLLER,a.MEDIA_PAUSED,a.MEDIA_LOADING,Za.LOADING_DELAY]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===Za.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===V.MEDIA_CONTROLLER&&(t&&((o=(n=Yo(this,Ct))==null?void 0:n.unassociateElement)==null||o.call(n,this),Qo(this,Ct,null)),r&&this.isConnected&&(Qo(this,Ct,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Yo(this,Ct))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let n=this.getAttribute(V.MEDIA_CONTROLLER);n&&(Qo(this,Ct,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Yo(this,Ct))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Yo(this,Ct))==null?void 0:e.unassociateElement)==null||t.call(e,this),Qo(this,Ct,null)}get loadingDelay(){return Yo(this,Xa)}set loadingDelay(e){Qo(this,Xa,e);let{style:t}=oe(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,a.MEDIA_LOADING)}set mediaLoading(e){x(this,a.MEDIA_LOADING,e)}get mediaController(){return O(this,V.MEDIA_CONTROLLER)}set mediaController(e){N(this,V.MEDIA_CONTROLLER,e)}get noAutohide(){return M(this,Za.NO_AUTOHIDE)}set noAutohide(e){x(this,Za.NO_AUTOHIDE,e)}};Ct=new WeakMap;Xa=new WeakMap;Zo.shadowRootOptions={mode:"open"};Zo.getTemplateHTML=KE;u.customElements.get("media-loading-indicator")||u.customElements.define("media-loading-indicator",Zo);var qE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1244
+ `}var Zo=class extends u.HTMLElement{constructor(){if(super(),im(this,Ct,void 0),im(this,Xa,nm),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[V.MEDIA_CONTROLLER,a.MEDIA_PAUSED,a.MEDIA_LOADING,Za.LOADING_DELAY]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===Za.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===V.MEDIA_CONTROLLER&&(t&&((o=(n=Yo(this,Ct))==null?void 0:n.unassociateElement)==null||o.call(n,this),Qo(this,Ct,null)),r&&this.isConnected&&(Qo(this,Ct,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Yo(this,Ct))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let n=this.getAttribute(V.MEDIA_CONTROLLER);n&&(Qo(this,Ct,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Yo(this,Ct))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Yo(this,Ct))==null?void 0:e.unassociateElement)==null||t.call(e,this),Qo(this,Ct,null)}get loadingDelay(){return Yo(this,Xa)}set loadingDelay(e){Qo(this,Xa,e);let{style:t}=oe(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,a.MEDIA_LOADING)}set mediaLoading(e){x(this,a.MEDIA_LOADING,e)}get mediaController(){return O(this,V.MEDIA_CONTROLLER)}set mediaController(e){N(this,V.MEDIA_CONTROLLER,e)}get noAutohide(){return M(this,Za.NO_AUTOHIDE)}set noAutohide(e){x(this,Za.NO_AUTOHIDE,e)}};Ct=new WeakMap;Xa=new WeakMap;Zo.shadowRootOptions={mode:"open"};Zo.getTemplateHTML=qE;u.customElements.get("media-loading-indicator")||u.customElements.define("media-loading-indicator",Zo);var GE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1245
1245
  <path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
1246
- </svg>`,nm=`<svg aria-hidden="true" viewBox="0 0 24 24">
1246
+ </svg>`,om=`<svg aria-hidden="true" viewBox="0 0 24 24">
1247
1247
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
1248
- </svg>`,GE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1248
+ </svg>`,zE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1249
1249
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
1250
- </svg>`;function zE(i){return`
1250
+ </svg>`;function YE(i){return`
1251
1251
  <style>
1252
1252
  :host(:not([${a.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
1253
1253
  :host([${a.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
@@ -1273,17 +1273,17 @@ bp-player[has-error] {
1273
1273
  </style>
1274
1274
 
1275
1275
  <slot name="icon">
1276
- <slot name="off">${qE}</slot>
1277
- <slot name="low">${nm}</slot>
1278
- <slot name="medium">${nm}</slot>
1279
- <slot name="high">${GE}</slot>
1276
+ <slot name="off">${GE}</slot>
1277
+ <slot name="low">${om}</slot>
1278
+ <slot name="medium">${om}</slot>
1279
+ <slot name="high">${zE}</slot>
1280
1280
  </slot>
1281
- `}function YE(){return`
1281
+ `}function QE(){return`
1282
1282
  <slot name="tooltip-mute">${b("Mute")}</slot>
1283
1283
  <slot name="tooltip-unmute">${b("Unmute")}</slot>
1284
- `}var om=i=>{let t=i.mediaVolumeLevel==="off"?b("unmute"):b("mute");i.setAttribute("aria-label",t)},Xo=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),om(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_VOLUME_LEVEL&&om(this)}get mediaVolumeLevel(){return O(this,a.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){N(this,a.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?_.MEDIA_UNMUTE_REQUEST:_.MEDIA_MUTE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};Xo.getSlotTemplateHTML=zE;Xo.getTooltipContentHTML=YE;u.customElements.get("media-mute-button")||u.customElements.define("media-mute-button",Xo);var sm=`<svg aria-hidden="true" viewBox="0 0 28 24">
1284
+ `}var sm=i=>{let t=i.mediaVolumeLevel==="off"?b("unmute"):b("mute");i.setAttribute("aria-label",t)},Xo=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),sm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_VOLUME_LEVEL&&sm(this)}get mediaVolumeLevel(){return O(this,a.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){N(this,a.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?_.MEDIA_UNMUTE_REQUEST:_.MEDIA_MUTE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};Xo.getSlotTemplateHTML=YE;Xo.getTooltipContentHTML=QE;u.customElements.get("media-mute-button")||u.customElements.define("media-mute-button",Xo);var am=`<svg aria-hidden="true" viewBox="0 0 28 24">
1285
1285
  <path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
1286
- </svg>`;function QE(i){return`
1286
+ </svg>`;function ZE(i){return`
1287
1287
  <style>
1288
1288
  :host([${a.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
1289
1289
  display: none !important;
@@ -1300,13 +1300,13 @@ bp-player[has-error] {
1300
1300
  </style>
1301
1301
 
1302
1302
  <slot name="icon">
1303
- <slot name="enter">${sm}</slot>
1304
- <slot name="exit">${sm}</slot>
1303
+ <slot name="enter">${am}</slot>
1304
+ <slot name="exit">${am}</slot>
1305
1305
  </slot>
1306
- `}function ZE(){return`
1306
+ `}function XE(){return`
1307
1307
  <slot name="tooltip-enter">${b("Enter picture in picture mode")}</slot>
1308
1308
  <slot name="tooltip-exit">${b("Exit picture in picture mode")}</slot>
1309
- `}var am=i=>{let e=i.mediaIsPip?b("exit picture in picture mode"):b("enter picture in picture mode");i.setAttribute("aria-label",e)},jo=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_PIP,a.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),am(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_PIP&&am(this)}get mediaPipUnavailable(){return O(this,a.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){N(this,a.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return M(this,a.MEDIA_IS_PIP)}set mediaIsPip(e){x(this,a.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?_.MEDIA_EXIT_PIP_REQUEST:_.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};jo.getSlotTemplateHTML=QE;jo.getTooltipContentHTML=ZE;u.customElements.get("media-pip-button")||u.customElements.define("media-pip-button",jo);var XE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},sn=(i,e,t)=>(XE(i,e,"read from private field"),t?t.call(i):e.get(i)),jE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},bi,_c={RATES:"rates"},yc=[1,1.2,1.5,1.7,2],ur=1;function JE(i){return`
1309
+ `}var lm=i=>{let e=i.mediaIsPip?b("exit picture in picture mode"):b("enter picture in picture mode");i.setAttribute("aria-label",e)},jo=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_PIP,a.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),lm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_PIP&&lm(this)}get mediaPipUnavailable(){return O(this,a.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){N(this,a.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return M(this,a.MEDIA_IS_PIP)}set mediaIsPip(e){x(this,a.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?_.MEDIA_EXIT_PIP_REQUEST:_.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};jo.getSlotTemplateHTML=ZE;jo.getTooltipContentHTML=XE;u.customElements.get("media-pip-button")||u.customElements.define("media-pip-button",jo);var jE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},sn=(i,e,t)=>(jE(i,e,"read from private field"),t?t.call(i):e.get(i)),JE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},bi,_c={RATES:"rates"},yc=[1,1.2,1.5,1.7,2],ur=1;function eg(i){return`
1310
1310
  <style>
1311
1311
  :host {
1312
1312
  min-width: 5ch;
@@ -1314,11 +1314,11 @@ bp-player[has-error] {
1314
1314
  }
1315
1315
  </style>
1316
1316
  <slot name="icon">${i.mediaplaybackrate||ur}x</slot>
1317
- `}function eg(){return b("Playback rate")}var Jo=class extends X{constructor(){var e;super(),jE(this,bi,new pi(this,_c.RATES,{defaultValue:yc})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:ur}x`}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,_c.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===_c.RATES&&(sn(this,bi).value=r),e===a.MEDIA_PLAYBACK_RATE){let n=r?+r:Number.NaN,o=Number.isNaN(n)?ur:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return sn(this,bi)}set rates(e){e?Array.isArray(e)?sn(this,bi).value=e.join(" "):typeof e=="string"&&(sn(this,bi).value=e):sn(this,bi).value=""}get mediaPlaybackRate(){return q(this,a.MEDIA_PLAYBACK_RATE,ur)}set mediaPlaybackRate(e){z(this,a.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(sn(this,bi).values(),s=>+s).sort((s,l)=>s-l),n=(t=(e=r.find(s=>s>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:ur,o=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(o)}};bi=new WeakMap;Jo.getSlotTemplateHTML=JE;Jo.getTooltipContentHTML=eg;u.customElements.get("media-playback-rate-button")||u.customElements.define("media-playback-rate-button",Jo);var tg=`<svg aria-hidden="true" viewBox="0 0 24 24">
1317
+ `}function tg(){return b("Playback rate")}var Jo=class extends X{constructor(){var e;super(),JE(this,bi,new pi(this,_c.RATES,{defaultValue:yc})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:ur}x`}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,_c.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===_c.RATES&&(sn(this,bi).value=r),e===a.MEDIA_PLAYBACK_RATE){let n=r?+r:Number.NaN,o=Number.isNaN(n)?ur:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return sn(this,bi)}set rates(e){e?Array.isArray(e)?sn(this,bi).value=e.join(" "):typeof e=="string"&&(sn(this,bi).value=e):sn(this,bi).value=""}get mediaPlaybackRate(){return q(this,a.MEDIA_PLAYBACK_RATE,ur)}set mediaPlaybackRate(e){z(this,a.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(sn(this,bi).values(),s=>+s).sort((s,l)=>s-l),n=(t=(e=r.find(s=>s>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:ur,o=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(o)}};bi=new WeakMap;Jo.getSlotTemplateHTML=eg;Jo.getTooltipContentHTML=tg;u.customElements.get("media-playback-rate-button")||u.customElements.define("media-playback-rate-button",Jo);var ig=`<svg aria-hidden="true" viewBox="0 0 24 24">
1318
1318
  <path d="m6 21 15-9L6 3v18Z"/>
1319
- </svg>`,ig=`<svg aria-hidden="true" viewBox="0 0 24 24">
1319
+ </svg>`,rg=`<svg aria-hidden="true" viewBox="0 0 24 24">
1320
1320
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
1321
- </svg>`;function rg(i){return`
1321
+ </svg>`;function ng(i){return`
1322
1322
  <style>
1323
1323
  :host([${a.MEDIA_PAUSED}]) slot[name=pause],
1324
1324
  :host(:not([${a.MEDIA_PAUSED}])) slot[name=play] {
@@ -1332,13 +1332,13 @@ bp-player[has-error] {
1332
1332
  </style>
1333
1333
 
1334
1334
  <slot name="icon">
1335
- <slot name="play">${tg}</slot>
1336
- <slot name="pause">${ig}</slot>
1335
+ <slot name="play">${ig}</slot>
1336
+ <slot name="pause">${rg}</slot>
1337
1337
  </slot>
1338
- `}function ng(){return`
1338
+ `}function og(){return`
1339
1339
  <slot name="tooltip-play">${b("Play")}</slot>
1340
1340
  <slot name="tooltip-pause">${b("Pause")}</slot>
1341
- `}var lm=i=>{let e=i.mediaPaused?b("play"):b("pause");i.setAttribute("aria-label",e)},es=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),lm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PAUSED||e===a.MEDIA_LANG)&&lm(this)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?_.MEDIA_PLAY_REQUEST:_.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};es.getSlotTemplateHTML=rg;es.getTooltipContentHTML=ng;u.customElements.get("media-play-button")||u.customElements.define("media-play-button",es);var Rt={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function og(i){return`
1341
+ `}var dm=i=>{let e=i.mediaPaused?b("play"):b("pause");i.setAttribute("aria-label",e)},es=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),dm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PAUSED||e===a.MEDIA_LANG)&&dm(this)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?_.MEDIA_PLAY_REQUEST:_.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};es.getSlotTemplateHTML=ng;es.getTooltipContentHTML=og;u.customElements.get("media-play-button")||u.customElements.define("media-play-button",es);var Rt={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function sg(i){return`
1342
1342
  <style>
1343
1343
  :host {
1344
1344
  pointer-events: none;
@@ -1360,7 +1360,7 @@ bp-player[has-error] {
1360
1360
  </style>
1361
1361
 
1362
1362
  <img part="poster img" aria-hidden="true" id="image"/>
1363
- `}var sg=i=>{i.style.removeProperty("background-image")},ag=(i,e)=>{i.style["background-image"]=`url('${e}')`},ts=class extends u.HTMLElement{static get observedAttributes(){return[Rt.PLACEHOLDER_SRC,Rt.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===Rt.SRC&&(r==null?this.image.removeAttribute(Rt.SRC):this.image.setAttribute(Rt.SRC,r)),e===Rt.PLACEHOLDER_SRC&&(r==null?sg(this.image):ag(this.image,r))}get placeholderSrc(){return O(this,Rt.PLACEHOLDER_SRC)}set placeholderSrc(e){N(this,Rt.SRC,e)}get src(){return O(this,Rt.SRC)}set src(e){N(this,Rt.SRC,e)}};ts.shadowRootOptions={mode:"open"};ts.getTemplateHTML=og;u.customElements.get("media-poster-image")||u.customElements.define("media-poster-image",ts);var dm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},lg=(i,e,t)=>(dm(i,e,"read from private field"),t?t.call(i):e.get(i)),dg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},cg=(i,e,t,r)=>(dm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ja,Tc=class extends Ve{constructor(){super(),dg(this,ja,void 0),cg(this,ja,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PREVIEW_CHAPTER||e===a.MEDIA_LANG)&&r!==t&&r!=null)if(lg(this,ja).textContent=r,r!==""){let n=b("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",n)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return O(this,a.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){N(this,a.MEDIA_PREVIEW_CHAPTER,e)}};ja=new WeakMap;u.customElements.get("media-preview-chapter-display")||u.customElements.define("media-preview-chapter-display",Tc);var cm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ja=(i,e,t)=>(cm(i,e,"read from private field"),t?t.call(i):e.get(i)),ug=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},el=(i,e,t,r)=>(cm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Mt;function hg(i){return`
1363
+ `}var ag=i=>{i.style.removeProperty("background-image")},lg=(i,e)=>{i.style["background-image"]=`url('${e}')`},ts=class extends u.HTMLElement{static get observedAttributes(){return[Rt.PLACEHOLDER_SRC,Rt.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===Rt.SRC&&(r==null?this.image.removeAttribute(Rt.SRC):this.image.setAttribute(Rt.SRC,r)),e===Rt.PLACEHOLDER_SRC&&(r==null?ag(this.image):lg(this.image,r))}get placeholderSrc(){return O(this,Rt.PLACEHOLDER_SRC)}set placeholderSrc(e){N(this,Rt.SRC,e)}get src(){return O(this,Rt.SRC)}set src(e){N(this,Rt.SRC,e)}};ts.shadowRootOptions={mode:"open"};ts.getTemplateHTML=sg;u.customElements.get("media-poster-image")||u.customElements.define("media-poster-image",ts);var cm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},dg=(i,e,t)=>(cm(i,e,"read from private field"),t?t.call(i):e.get(i)),cg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ug=(i,e,t,r)=>(cm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ja,Tc=class extends Ve{constructor(){super(),cg(this,ja,void 0),ug(this,ja,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PREVIEW_CHAPTER||e===a.MEDIA_LANG)&&r!==t&&r!=null)if(dg(this,ja).textContent=r,r!==""){let n=b("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",n)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return O(this,a.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){N(this,a.MEDIA_PREVIEW_CHAPTER,e)}};ja=new WeakMap;u.customElements.get("media-preview-chapter-display")||u.customElements.define("media-preview-chapter-display",Tc);var um=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ja=(i,e,t)=>(um(i,e,"read from private field"),t?t.call(i):e.get(i)),hg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},el=(i,e,t,r)=>(um(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Mt;function pg(i){return`
1364
1364
  <style>
1365
1365
  :host {
1366
1366
  box-sizing: border-box;
@@ -1374,27 +1374,27 @@ bp-player[has-error] {
1374
1374
  }
1375
1375
  </style>
1376
1376
  <img crossorigin loading="eager" decoding="async">
1377
- `}var an=class extends u.HTMLElement{constructor(){if(super(),ug(this,Mt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[V.MEDIA_CONTROLLER,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let n=this.getAttribute(V.MEDIA_CONTROLLER);n&&(el(this,Mt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Ja(this,Mt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ja(this,Mt))==null?void 0:e.unassociateElement)==null||t.call(e,this),el(this,Mt,null)}attributeChangedCallback(e,t,r){var n,o,s,l,d;[a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===V.MEDIA_CONTROLLER&&(t&&((o=(n=Ja(this,Mt))==null?void 0:n.unassociateElement)==null||o.call(n,this),el(this,Mt,null)),r&&this.isConnected&&(el(this,Mt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Ja(this,Mt))==null?void 0:l.associateElement)==null||d.call(l,this)))}get mediaPreviewImage(){return O(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){N(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(a.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(a.MEDIA_PREVIEW_COORDS);return}this.setAttribute(a.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,n,o,s]=e,l=t.split("#")[0],d=getComputedStyle(this),{maxWidth:h,maxHeight:p,minWidth:g,minHeight:f}=d,E=Math.min(parseInt(h)/o,parseInt(p)/s),T=Math.max(parseInt(g)/o,parseInt(f)/s),v=E<1,S=v?E:T>1?T:1,{style:I}=oe(this.shadowRoot,":host"),F=oe(this.shadowRoot,"img").style,se=this.shadowRoot.querySelector("img"),De=v?"min":"max";I.setProperty(`${De}-width`,"initial","important"),I.setProperty(`${De}-height`,"initial","important"),I.width=`${o*S}px`,I.height=`${s*S}px`;let gt=()=>{F.width=`${this.imgWidth*S}px`,F.height=`${this.imgHeight*S}px`,F.display="block"};se.src!==l&&(se.onload=()=>{this.imgWidth=se.naturalWidth,this.imgHeight=se.naturalHeight,gt()},se.src=l,gt()),gt(),F.transform=`translate(-${r*S}px, -${n*S}px)`}};Mt=new WeakMap;an.shadowRootOptions={mode:"open"};an.getTemplateHTML=hg;u.customElements.get("media-preview-thumbnail")||u.customElements.define("media-preview-thumbnail",an);var tl=an;var hm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},um=(i,e,t)=>(hm(i,e,"read from private field"),t?t.call(i):e.get(i)),pg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mg=(i,e,t,r)=>(hm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),is,Ac=class extends Ve{constructor(){super(),pg(this,is,void 0),mg(this,is,this.shadowRoot.querySelector("slot")),um(this,is).textContent=lt(0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PREVIEW_TIME&&r!=null&&(um(this,is).textContent=lt(parseFloat(r)))}get mediaPreviewTime(){return q(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){z(this,a.MEDIA_PREVIEW_TIME,e)}};is=new WeakMap;u.customElements.get("media-preview-time-display")||u.customElements.define("media-preview-time-display",Ac);var ln={SEEK_OFFSET:"seekoffset"},Sc=30,vg=i=>`
1377
+ `}var an=class extends u.HTMLElement{constructor(){if(super(),hg(this,Mt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[V.MEDIA_CONTROLLER,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let n=this.getAttribute(V.MEDIA_CONTROLLER);n&&(el(this,Mt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Ja(this,Mt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ja(this,Mt))==null?void 0:e.unassociateElement)==null||t.call(e,this),el(this,Mt,null)}attributeChangedCallback(e,t,r){var n,o,s,l,d;[a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===V.MEDIA_CONTROLLER&&(t&&((o=(n=Ja(this,Mt))==null?void 0:n.unassociateElement)==null||o.call(n,this),el(this,Mt,null)),r&&this.isConnected&&(el(this,Mt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Ja(this,Mt))==null?void 0:l.associateElement)==null||d.call(l,this)))}get mediaPreviewImage(){return O(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){N(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(a.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(a.MEDIA_PREVIEW_COORDS);return}this.setAttribute(a.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,n,o,s]=e,l=t.split("#")[0],d=getComputedStyle(this),{maxWidth:h,maxHeight:p,minWidth:g,minHeight:f}=d,E=Math.min(parseInt(h)/o,parseInt(p)/s),T=Math.max(parseInt(g)/o,parseInt(f)/s),v=E<1,S=v?E:T>1?T:1,{style:I}=oe(this.shadowRoot,":host"),F=oe(this.shadowRoot,"img").style,se=this.shadowRoot.querySelector("img"),De=v?"min":"max";I.setProperty(`${De}-width`,"initial","important"),I.setProperty(`${De}-height`,"initial","important"),I.width=`${o*S}px`,I.height=`${s*S}px`;let gt=()=>{F.width=`${this.imgWidth*S}px`,F.height=`${this.imgHeight*S}px`,F.display="block"};se.src!==l&&(se.onload=()=>{this.imgWidth=se.naturalWidth,this.imgHeight=se.naturalHeight,gt()},se.src=l,gt()),gt(),F.transform=`translate(-${r*S}px, -${n*S}px)`}};Mt=new WeakMap;an.shadowRootOptions={mode:"open"};an.getTemplateHTML=pg;u.customElements.get("media-preview-thumbnail")||u.customElements.define("media-preview-thumbnail",an);var tl=an;var pm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},hm=(i,e,t)=>(pm(i,e,"read from private field"),t?t.call(i):e.get(i)),mg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},vg=(i,e,t,r)=>(pm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),is,Ac=class extends Ve{constructor(){super(),mg(this,is,void 0),vg(this,is,this.shadowRoot.querySelector("slot")),hm(this,is).textContent=lt(0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PREVIEW_TIME&&r!=null&&(hm(this,is).textContent=lt(parseFloat(r)))}get mediaPreviewTime(){return q(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){z(this,a.MEDIA_PREVIEW_TIME,e)}};is=new WeakMap;u.customElements.get("media-preview-time-display")||u.customElements.define("media-preview-time-display",Ac);var ln={SEEK_OFFSET:"seekoffset"},Sc=30,fg=i=>`
1378
1378
  <svg aria-hidden="true" viewBox="0 0 20 24">
1379
1379
  <defs>
1380
1380
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
1381
1381
  </defs>
1382
1382
  <text class="text value" transform="translate(2.18 19.87)">${i}</text>
1383
1383
  <path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/>
1384
- </svg>`;function fg(i,e){return`
1385
- <slot name="icon">${vg(e.seekOffset)}</slot>
1386
- `}function Eg(){return b("Seek backward")}var gg=0,rs=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,ln.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=q(this,ln.SEEK_OFFSET,Sc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===ln.SEEK_OFFSET&&(this.seekOffset=q(this,ln.SEEK_OFFSET,Sc))}get seekOffset(){return q(this,ln.SEEK_OFFSET,Sc)}set seekOffset(e){z(this,ln.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),na(oa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return q(this,a.MEDIA_CURRENT_TIME,gg)}set mediaCurrentTime(e){z(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};rs.getSlotTemplateHTML=fg;rs.getTooltipContentHTML=Eg;u.customElements.get("media-seek-backward-button")||u.customElements.define("media-seek-backward-button",rs);var dn={SEEK_OFFSET:"seekoffset"},kc=30,bg=i=>`
1384
+ </svg>`;function Eg(i,e){return`
1385
+ <slot name="icon">${fg(e.seekOffset)}</slot>
1386
+ `}function gg(){return b("Seek backward")}var bg=0,rs=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,ln.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=q(this,ln.SEEK_OFFSET,Sc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===ln.SEEK_OFFSET&&(this.seekOffset=q(this,ln.SEEK_OFFSET,Sc))}get seekOffset(){return q(this,ln.SEEK_OFFSET,Sc)}set seekOffset(e){z(this,ln.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),na(oa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return q(this,a.MEDIA_CURRENT_TIME,bg)}set mediaCurrentTime(e){z(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};rs.getSlotTemplateHTML=Eg;rs.getTooltipContentHTML=gg;u.customElements.get("media-seek-backward-button")||u.customElements.define("media-seek-backward-button",rs);var dn={SEEK_OFFSET:"seekoffset"},kc=30,_g=i=>`
1387
1387
  <svg aria-hidden="true" viewBox="0 0 20 24">
1388
1388
  <defs>
1389
1389
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
1390
1390
  </defs>
1391
1391
  <text class="text value" transform="translate(8.9 19.87)">${i}</text>
1392
1392
  <path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/>
1393
- </svg>`;function _g(i,e){return`
1394
- <slot name="icon">${bg(e.seekOffset)}</slot>
1395
- `}function yg(){return b("Seek forward")}var Tg=0,ns=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,dn.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=q(this,dn.SEEK_OFFSET,kc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===dn.SEEK_OFFSET&&(this.seekOffset=q(this,dn.SEEK_OFFSET,kc))}get seekOffset(){return q(this,dn.SEEK_OFFSET,kc)}set seekOffset(e){z(this,dn.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),na(oa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return q(this,a.MEDIA_CURRENT_TIME,Tg)}set mediaCurrentTime(e){z(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};ns.getSlotTemplateHTML=_g;ns.getTooltipContentHTML=yg;u.customElements.get("media-seek-forward-button")||u.customElements.define("media-seek-forward-button",ns);var vm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Lc=(i,e,t)=>(vm(i,e,"read from private field"),t?t.call(i):e.get(i)),Ag=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Sg=(i,e,t,r)=>(vm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),cn,hr={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},pm=[...Object.values(hr),a.MEDIA_CURRENT_TIME,a.MEDIA_DURATION,a.MEDIA_SEEKABLE],mm=["Enter"," "],kg="&nbsp;/&nbsp;",wc=(i,{timesSep:e=kg}={})=>{var t,r;let n=(t=i.mediaCurrentTime)!=null?t:0,[,o]=(r=i.mediaSeekable)!=null?r:[],s=0;Number.isFinite(i.mediaDuration)?s=i.mediaDuration:Number.isFinite(o)&&(s=o);let l=i.remaining?lt(0-(s-n)):lt(n);return i.showDuration?`${l}${e}${lt(s)}`:l},Lg="video not loaded, unknown time.",wg=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],n=null;if(Number.isFinite(i.mediaDuration)?n=i.mediaDuration:Number.isFinite(r)&&(n=r),t==null||n===null){i.setAttribute("aria-valuetext",Lg);return}let o=i.remaining?Xi(0-(n-t)):Xi(t);if(!i.showDuration){i.setAttribute("aria-valuetext",o);return}let s=Xi(n),l=`${o} of ${s}`;i.setAttribute("aria-valuetext",l)};function Ig(i,e){return`
1393
+ </svg>`;function yg(i,e){return`
1394
+ <slot name="icon">${_g(e.seekOffset)}</slot>
1395
+ `}function Tg(){return b("Seek forward")}var Ag=0,ns=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,dn.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=q(this,dn.SEEK_OFFSET,kc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===dn.SEEK_OFFSET&&(this.seekOffset=q(this,dn.SEEK_OFFSET,kc))}get seekOffset(){return q(this,dn.SEEK_OFFSET,kc)}set seekOffset(e){z(this,dn.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),na(oa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return q(this,a.MEDIA_CURRENT_TIME,Ag)}set mediaCurrentTime(e){z(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};ns.getSlotTemplateHTML=yg;ns.getTooltipContentHTML=Tg;u.customElements.get("media-seek-forward-button")||u.customElements.define("media-seek-forward-button",ns);var fm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Lc=(i,e,t)=>(fm(i,e,"read from private field"),t?t.call(i):e.get(i)),Sg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kg=(i,e,t,r)=>(fm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),cn,hr={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},mm=[...Object.values(hr),a.MEDIA_CURRENT_TIME,a.MEDIA_DURATION,a.MEDIA_SEEKABLE],vm=["Enter"," "],Lg="&nbsp;/&nbsp;",wc=(i,{timesSep:e=Lg}={})=>{var t,r;let n=(t=i.mediaCurrentTime)!=null?t:0,[,o]=(r=i.mediaSeekable)!=null?r:[],s=0;Number.isFinite(i.mediaDuration)?s=i.mediaDuration:Number.isFinite(o)&&(s=o);let l=i.remaining?lt(0-(s-n)):lt(n);return i.showDuration?`${l}${e}${lt(s)}`:l},wg="video not loaded, unknown time.",Ig=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],n=null;if(Number.isFinite(i.mediaDuration)?n=i.mediaDuration:Number.isFinite(r)&&(n=r),t==null||n===null){i.setAttribute("aria-valuetext",wg);return}let o=i.remaining?Xi(0-(n-t)):Xi(t);if(!i.showDuration){i.setAttribute("aria-valuetext",o);return}let s=Xi(n),l=`${o} of ${s}`;i.setAttribute("aria-valuetext",l)};function Cg(i,e){return`
1396
1396
  <slot>${wc(e)}</slot>
1397
- `}var il=class extends Ve{constructor(){super(),Ag(this,cn,void 0),Sg(this,cn,this.shadowRoot.querySelector("slot")),Lc(this,cn).innerHTML=`${wc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...pm,"disabled"]}connectedCallback(){let{style:e}=oe(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",b("playback time"));let t=r=>{let{key:n}=r;if(!mm.includes(n)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:n,altKey:o,key:s}=r;if(n||o||!mm.includes(s)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,r){pm.includes(e)?this.update():e==="disabled"&&r!==t&&(r==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,r)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return M(this,hr.REMAINING)}set remaining(e){x(this,hr.REMAINING,e)}get showDuration(){return M(this,hr.SHOW_DURATION)}set showDuration(e){x(this,hr.SHOW_DURATION,e)}get noToggle(){return M(this,hr.NO_TOGGLE)}set noToggle(e){x(this,hr.NO_TOGGLE,e)}get mediaDuration(){return q(this,a.MEDIA_DURATION)}set mediaDuration(e){z(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return q(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){z(this,a.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.MEDIA_SEEKABLE,e.join(":"))}update(){let e=wc(this);wg(this),e!==Lc(this,cn).innerHTML&&(Lc(this,cn).innerHTML=e)}};cn=new WeakMap;il.getSlotTemplateHTML=Ig;u.customElements.get("media-time-display")||u.customElements.define("media-time-display",il);var fm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ke=(i,e,t)=>(fm(i,e,"read from private field"),t?t.call(i):e.get(i)),xt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ge=(i,e,t,r)=>(fm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Cg=(i,e,t,r)=>({set _(n){Ge(i,e,n,t)},get _(){return ke(i,e,r)}}),un,rl,hn,os,nl,ol,sl,pn,pr,al,ll=class{constructor(e,t,r){xt(this,un,void 0),xt(this,rl,void 0),xt(this,hn,void 0),xt(this,os,void 0),xt(this,nl,void 0),xt(this,ol,void 0),xt(this,sl,void 0),xt(this,pn,void 0),xt(this,pr,0),xt(this,al,(n=performance.now())=>{Ge(this,pr,requestAnimationFrame(ke(this,al))),Ge(this,os,performance.now()-ke(this,hn));let o=1e3/this.fps;if(ke(this,os)>o){Ge(this,hn,n-ke(this,os)%o);let s=1e3/((n-ke(this,rl))/++Cg(this,nl)._),l=(n-ke(this,ol))/1e3/this.duration,d=ke(this,sl)+l*this.playbackRate;d-ke(this,un).valueAsNumber>0?Ge(this,pn,this.playbackRate/this.duration/s):(Ge(this,pn,.995*ke(this,pn)),d=ke(this,un).valueAsNumber+ke(this,pn)),this.callback(d)}}),Ge(this,un,e),this.callback=t,this.fps=r}start(){ke(this,pr)===0&&(Ge(this,hn,performance.now()),Ge(this,rl,ke(this,hn)),Ge(this,nl,0),ke(this,al).call(this))}stop(){ke(this,pr)!==0&&(cancelAnimationFrame(ke(this,pr)),Ge(this,pr,0))}update({start:e,duration:t,playbackRate:r}){let n=e-ke(this,un).valueAsNumber,o=Math.abs(t-this.duration);(n>0||n<-.03||o>=.5)&&this.callback(e),Ge(this,sl,e),Ge(this,ol,performance.now()),this.duration=t,this.playbackRate=r}};un=new WeakMap;rl=new WeakMap;hn=new WeakMap;os=new WeakMap;nl=new WeakMap;ol=new WeakMap;sl=new WeakMap;pn=new WeakMap;pr=new WeakMap;al=new WeakMap;var Mc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},me=(i,e,t)=>(Mc(i,e,"read from private field"),t?t.call(i):e.get(i)),ye=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},et=(i,e,t,r)=>(Mc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Re=(i,e,t)=>(Mc(i,e,"access private method"),t),mn,mr,ul,as,hl,cl,ls,ds,vn,fn,En,ss,xc,Em,Ic,pl,Pc,ml,Dc,vl,Oc,Cc,gm,cs,fl,Rc,bm,Rg="video not loaded, unknown time.",Mg=i=>{let e=i.range,t=Xi(+_m(i)),r=Xi(+i.mediaSeekableEnd),n=t&&r?`${t} of ${r}`:Rg;e.setAttribute("aria-valuetext",n)};function xg(i){return`
1397
+ `}var il=class extends Ve{constructor(){super(),Sg(this,cn,void 0),kg(this,cn,this.shadowRoot.querySelector("slot")),Lc(this,cn).innerHTML=`${wc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...mm,"disabled"]}connectedCallback(){let{style:e}=oe(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",b("playback time"));let t=r=>{let{key:n}=r;if(!vm.includes(n)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:n,altKey:o,key:s}=r;if(n||o||!vm.includes(s)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,r){mm.includes(e)?this.update():e==="disabled"&&r!==t&&(r==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,r)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return M(this,hr.REMAINING)}set remaining(e){x(this,hr.REMAINING,e)}get showDuration(){return M(this,hr.SHOW_DURATION)}set showDuration(e){x(this,hr.SHOW_DURATION,e)}get noToggle(){return M(this,hr.NO_TOGGLE)}set noToggle(e){x(this,hr.NO_TOGGLE,e)}get mediaDuration(){return q(this,a.MEDIA_DURATION)}set mediaDuration(e){z(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return q(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){z(this,a.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.MEDIA_SEEKABLE,e.join(":"))}update(){let e=wc(this);Ig(this),e!==Lc(this,cn).innerHTML&&(Lc(this,cn).innerHTML=e)}};cn=new WeakMap;il.getSlotTemplateHTML=Cg;u.customElements.get("media-time-display")||u.customElements.define("media-time-display",il);var Em=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ke=(i,e,t)=>(Em(i,e,"read from private field"),t?t.call(i):e.get(i)),xt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ge=(i,e,t,r)=>(Em(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Rg=(i,e,t,r)=>({set _(n){Ge(i,e,n,t)},get _(){return ke(i,e,r)}}),un,rl,hn,os,nl,ol,sl,pn,pr,al,ll=class{constructor(e,t,r){xt(this,un,void 0),xt(this,rl,void 0),xt(this,hn,void 0),xt(this,os,void 0),xt(this,nl,void 0),xt(this,ol,void 0),xt(this,sl,void 0),xt(this,pn,void 0),xt(this,pr,0),xt(this,al,(n=performance.now())=>{Ge(this,pr,requestAnimationFrame(ke(this,al))),Ge(this,os,performance.now()-ke(this,hn));let o=1e3/this.fps;if(ke(this,os)>o){Ge(this,hn,n-ke(this,os)%o);let s=1e3/((n-ke(this,rl))/++Rg(this,nl)._),l=(n-ke(this,ol))/1e3/this.duration,d=ke(this,sl)+l*this.playbackRate;d-ke(this,un).valueAsNumber>0?Ge(this,pn,this.playbackRate/this.duration/s):(Ge(this,pn,.995*ke(this,pn)),d=ke(this,un).valueAsNumber+ke(this,pn)),this.callback(d)}}),Ge(this,un,e),this.callback=t,this.fps=r}start(){ke(this,pr)===0&&(Ge(this,hn,performance.now()),Ge(this,rl,ke(this,hn)),Ge(this,nl,0),ke(this,al).call(this))}stop(){ke(this,pr)!==0&&(cancelAnimationFrame(ke(this,pr)),Ge(this,pr,0))}update({start:e,duration:t,playbackRate:r}){let n=e-ke(this,un).valueAsNumber,o=Math.abs(t-this.duration);(n>0||n<-.03||o>=.5)&&this.callback(e),Ge(this,sl,e),Ge(this,ol,performance.now()),this.duration=t,this.playbackRate=r}};un=new WeakMap;rl=new WeakMap;hn=new WeakMap;os=new WeakMap;nl=new WeakMap;ol=new WeakMap;sl=new WeakMap;pn=new WeakMap;pr=new WeakMap;al=new WeakMap;var Mc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},me=(i,e,t)=>(Mc(i,e,"read from private field"),t?t.call(i):e.get(i)),ye=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},et=(i,e,t,r)=>(Mc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Re=(i,e,t)=>(Mc(i,e,"access private method"),t),mn,mr,ul,as,hl,cl,ls,ds,vn,fn,En,ss,xc,gm,Ic,pl,Pc,ml,Dc,vl,Oc,Cc,bm,cs,fl,Rc,_m,Mg="video not loaded, unknown time.",xg=i=>{let e=i.range,t=Xi(+ym(i)),r=Xi(+i.mediaSeekableEnd),n=t&&r?`${t} of ${r}`:Mg;e.setAttribute("aria-valuetext",n)};function Pg(i){return`
1398
1398
  <style>
1399
1399
  :host {
1400
1400
  --media-box-border-radius: 4px;
@@ -1611,7 +1611,7 @@ bp-player[has-error] {
1611
1611
 
1612
1612
  </slot>
1613
1613
  </div>
1614
- `}var dl=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(r))return 0;let n=(e-t)/(r-t);return Math.max(0,Math.min(n,1))},_m=(i,e=i.range.valueAsNumber)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;return Number.isNaN(r)?0:e*(r-t)+t},us=class extends Lt{constructor(){super(),ye(this,En),ye(this,xc),ye(this,pl),ye(this,ml),ye(this,vl),ye(this,Cc),ye(this,cs),ye(this,Rc),ye(this,mn,void 0),ye(this,mr,void 0),ye(this,ul,void 0),ye(this,as,void 0),ye(this,hl,void 0),ye(this,cl,void 0),ye(this,ls,void 0),ye(this,ds,void 0),ye(this,vn,void 0),ye(this,fn,void 0),ye(this,Ic,r=>{this.dragging||(Wr(r)&&(this.range.valueAsNumber=r),me(this,fn)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),et(this,ul,this.shadowRoot.querySelectorAll('[part~="box"]')),et(this,hl,this.shadowRoot.querySelector('[part~="preview-box"]')),et(this,cl,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);et(this,ls,parseInt(t.getPropertyValue("--media-box-padding-left"))),et(this,ds,parseInt(t.getPropertyValue("--media-box-padding-right"))),et(this,mr,new ll(this.range,me(this,Ic),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",b("seek")),Re(this,En,ss).call(this),et(this,mn,this.getRootNode()),(e=me(this,mn))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),Re(this,En,ss).call(this),(e=me(this,mn))==null||e.removeEventListener("transitionstart",this),et(this,mn,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(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?(me(this,mr).update({start:dl(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),Re(this,En,ss).call(this),Mg(this)):e===a.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=me(this,vn),this.updateBar()))}get mediaChaptersCues(){return me(this,vn)}set mediaChaptersCues(e){var t;et(this,vn,e),this.updateSegments((t=me(this,vn))==null?void 0:t.map(r=>({start:dl(this,r.startTime),end:dl(this,r.endTime)})))}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,a.MEDIA_LOADING)}set mediaLoading(e){x(this,a.MEDIA_LOADING,e)}get mediaDuration(){return q(this,a.MEDIA_DURATION)}set mediaDuration(e){z(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return q(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){z(this,a.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return q(this,a.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){z(this,a.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(a.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(a.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(a.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return O(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){N(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return q(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){z(this,a.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return M(this,a.MEDIA_ENDED)}set mediaEnded(e){x(this,a.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let r;if(this.mediaEnded)r=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=t.find(([l,d])=>l<=o&&o<=d))!=null?e:[];r=dl(this,s)}let{style:n}=oe(this.shadowRoot,"#buffered");n.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=oe(this.shadowRoot,"#current-rail"),r=oe(this.shadowRoot,'[part~="current-box"]'),n=Re(this,pl,Pc).call(this,me(this,cl)),o=Re(this,ml,Dc).call(this,n,this.range.valueAsNumber),s=Re(this,vl,Oc).call(this,n,this.range.valueAsNumber);t.style.transform=`translateX(${o})`,t.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${s}`),r.style.setProperty("--_box-width",`${n.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":Re(this,Rc,bm).call(this);break;case"pointermove":Re(this,Cc,gm).call(this,e);break;case"pointerup":me(this,fn)&&et(this,fn,!1);break;case"pointerdown":et(this,fn,!0);break;case"pointerleave":Re(this,cs,fl).call(this,null);break;case"transitionstart":xe(e.target,this)&&setTimeout(()=>Re(this,En,ss).call(this),0);break}}};mn=new WeakMap;mr=new WeakMap;ul=new WeakMap;as=new WeakMap;hl=new WeakMap;cl=new WeakMap;ls=new WeakMap;ds=new WeakMap;vn=new WeakMap;fn=new WeakMap;En=new WeakSet;ss=function(){Re(this,xc,Em).call(this)?me(this,mr).start():me(this,mr).stop()};xc=new WeakSet;Em=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&sa(this)};Ic=new WeakMap;pl=new WeakSet;Pc=function(i){var e;let r=((e=this.getAttribute("bounds")?bt(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),n=this.range.getBoundingClientRect(),o=i.offsetWidth,s=-(n.left-r.left-o/2),l=r.right-n.left-o/2;return{box:{width:o,min:s,max:l},bounds:r,range:n}};ml=new WeakSet;Dc=function(i,e){let t=`${e*100}%`,{width:r,min:n,max:o}=i.box;if(!r)return t;if(Number.isNaN(n)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${n}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(o)){let l=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};vl=new WeakSet;Oc=function(i,e){let{width:t,min:r,max:n}=i.box,o=e*i.range.width;if(o<r+me(this,ls)){let s=i.range.left-i.bounds.left-me(this,ls);return`${o-t/2+s}px`}if(o>n-me(this,ds)){let s=i.bounds.right-i.range.right-me(this,ds);return`${o+t/2-s-i.range.width}px`}return 0};Cc=new WeakSet;gm=function(i){let e=[...me(this,ul)].some(p=>i.composedPath().includes(p));if(!this.dragging&&(e||!i.composedPath().includes(this))){Re(this,cs,fl).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=oe(this.shadowRoot,"#preview-rail"),n=oe(this.shadowRoot,'[part~="preview-box"]'),o=Re(this,pl,Pc).call(this,me(this,hl)),s=(i.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=Re(this,ml,Dc).call(this,o,s),d=Re(this,vl,Oc).call(this,o,s);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${o.range.width}`),n.style.setProperty("--_box-shift",`${d}`),n.style.setProperty("--_box-width",`${o.box.width}px`);let h=Math.round(me(this,as))-Math.round(s*t);Math.abs(h)<1&&s>.01&&s<.99||(et(this,as,s*t),Re(this,cs,fl).call(this,me(this,as)))};cs=new WeakSet;fl=function(i){this.dispatchEvent(new u.CustomEvent(_.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Rc=new WeakSet;bm=function(){me(this,mr).stop();let i=_m(this);this.dispatchEvent(new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};us.shadowRootOptions={mode:"open"};us.getContainerTemplateHTML=xg;u.customElements.get("media-time-range")||u.customElements.define("media-time-range",us);var Pg=1,Dg=i=>i.mediaMuted?0:i.mediaVolume,Og=i=>`${Math.round(i*100)}%`,Nc=class extends Lt{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME,a.MEDIA_MUTED,a.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new u.CustomEvent(_.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",b("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_VOLUME||e===a.MEDIA_MUTED)&&(this.range.valueAsNumber=Dg(this),this.range.setAttribute("aria-valuetext",Og(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return q(this,a.MEDIA_VOLUME,Pg)}set mediaVolume(e){z(this,a.MEDIA_VOLUME,e)}get mediaMuted(){return M(this,a.MEDIA_MUTED)}set mediaMuted(e){x(this,a.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return O(this,a.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){N(this,a.MEDIA_VOLUME_UNAVAILABLE,e)}};u.customElements.get("media-volume-range")||u.customElements.define("media-volume-range",Nc);function Ng(i){return`
1614
+ `}var dl=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(r))return 0;let n=(e-t)/(r-t);return Math.max(0,Math.min(n,1))},ym=(i,e=i.range.valueAsNumber)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;return Number.isNaN(r)?0:e*(r-t)+t},us=class extends Lt{constructor(){super(),ye(this,En),ye(this,xc),ye(this,pl),ye(this,ml),ye(this,vl),ye(this,Cc),ye(this,cs),ye(this,Rc),ye(this,mn,void 0),ye(this,mr,void 0),ye(this,ul,void 0),ye(this,as,void 0),ye(this,hl,void 0),ye(this,cl,void 0),ye(this,ls,void 0),ye(this,ds,void 0),ye(this,vn,void 0),ye(this,fn,void 0),ye(this,Ic,r=>{this.dragging||(Wr(r)&&(this.range.valueAsNumber=r),me(this,fn)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),et(this,ul,this.shadowRoot.querySelectorAll('[part~="box"]')),et(this,hl,this.shadowRoot.querySelector('[part~="preview-box"]')),et(this,cl,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);et(this,ls,parseInt(t.getPropertyValue("--media-box-padding-left"))),et(this,ds,parseInt(t.getPropertyValue("--media-box-padding-right"))),et(this,mr,new ll(this.range,me(this,Ic),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",b("seek")),Re(this,En,ss).call(this),et(this,mn,this.getRootNode()),(e=me(this,mn))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),Re(this,En,ss).call(this),(e=me(this,mn))==null||e.removeEventListener("transitionstart",this),et(this,mn,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(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?(me(this,mr).update({start:dl(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),Re(this,En,ss).call(this),xg(this)):e===a.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=me(this,vn),this.updateBar()))}get mediaChaptersCues(){return me(this,vn)}set mediaChaptersCues(e){var t;et(this,vn,e),this.updateSegments((t=me(this,vn))==null?void 0:t.map(r=>({start:dl(this,r.startTime),end:dl(this,r.endTime)})))}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,a.MEDIA_LOADING)}set mediaLoading(e){x(this,a.MEDIA_LOADING,e)}get mediaDuration(){return q(this,a.MEDIA_DURATION)}set mediaDuration(e){z(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return q(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){z(this,a.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return q(this,a.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){z(this,a.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(a.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(a.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(a.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return O(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){N(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return q(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){z(this,a.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return M(this,a.MEDIA_ENDED)}set mediaEnded(e){x(this,a.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let r;if(this.mediaEnded)r=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=t.find(([l,d])=>l<=o&&o<=d))!=null?e:[];r=dl(this,s)}let{style:n}=oe(this.shadowRoot,"#buffered");n.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=oe(this.shadowRoot,"#current-rail"),r=oe(this.shadowRoot,'[part~="current-box"]'),n=Re(this,pl,Pc).call(this,me(this,cl)),o=Re(this,ml,Dc).call(this,n,this.range.valueAsNumber),s=Re(this,vl,Oc).call(this,n,this.range.valueAsNumber);t.style.transform=`translateX(${o})`,t.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${s}`),r.style.setProperty("--_box-width",`${n.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":Re(this,Rc,_m).call(this);break;case"pointermove":Re(this,Cc,bm).call(this,e);break;case"pointerup":me(this,fn)&&et(this,fn,!1);break;case"pointerdown":et(this,fn,!0);break;case"pointerleave":Re(this,cs,fl).call(this,null);break;case"transitionstart":xe(e.target,this)&&setTimeout(()=>Re(this,En,ss).call(this),0);break}}};mn=new WeakMap;mr=new WeakMap;ul=new WeakMap;as=new WeakMap;hl=new WeakMap;cl=new WeakMap;ls=new WeakMap;ds=new WeakMap;vn=new WeakMap;fn=new WeakMap;En=new WeakSet;ss=function(){Re(this,xc,gm).call(this)?me(this,mr).start():me(this,mr).stop()};xc=new WeakSet;gm=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&sa(this)};Ic=new WeakMap;pl=new WeakSet;Pc=function(i){var e;let r=((e=this.getAttribute("bounds")?bt(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),n=this.range.getBoundingClientRect(),o=i.offsetWidth,s=-(n.left-r.left-o/2),l=r.right-n.left-o/2;return{box:{width:o,min:s,max:l},bounds:r,range:n}};ml=new WeakSet;Dc=function(i,e){let t=`${e*100}%`,{width:r,min:n,max:o}=i.box;if(!r)return t;if(Number.isNaN(n)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${n}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(o)){let l=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};vl=new WeakSet;Oc=function(i,e){let{width:t,min:r,max:n}=i.box,o=e*i.range.width;if(o<r+me(this,ls)){let s=i.range.left-i.bounds.left-me(this,ls);return`${o-t/2+s}px`}if(o>n-me(this,ds)){let s=i.bounds.right-i.range.right-me(this,ds);return`${o+t/2-s-i.range.width}px`}return 0};Cc=new WeakSet;bm=function(i){let e=[...me(this,ul)].some(p=>i.composedPath().includes(p));if(!this.dragging&&(e||!i.composedPath().includes(this))){Re(this,cs,fl).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=oe(this.shadowRoot,"#preview-rail"),n=oe(this.shadowRoot,'[part~="preview-box"]'),o=Re(this,pl,Pc).call(this,me(this,hl)),s=(i.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=Re(this,ml,Dc).call(this,o,s),d=Re(this,vl,Oc).call(this,o,s);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${o.range.width}`),n.style.setProperty("--_box-shift",`${d}`),n.style.setProperty("--_box-width",`${o.box.width}px`);let h=Math.round(me(this,as))-Math.round(s*t);Math.abs(h)<1&&s>.01&&s<.99||(et(this,as,s*t),Re(this,cs,fl).call(this,me(this,as)))};cs=new WeakSet;fl=function(i){this.dispatchEvent(new u.CustomEvent(_.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Rc=new WeakSet;_m=function(){me(this,mr).stop();let i=ym(this);this.dispatchEvent(new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};us.shadowRootOptions={mode:"open"};us.getContainerTemplateHTML=Pg;u.customElements.get("media-time-range")||u.customElements.define("media-time-range",us);var Dg=1,Og=i=>i.mediaMuted?0:i.mediaVolume,Ng=i=>`${Math.round(i*100)}%`,Nc=class extends Lt{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME,a.MEDIA_MUTED,a.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new u.CustomEvent(_.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",b("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_VOLUME||e===a.MEDIA_MUTED)&&(this.range.valueAsNumber=Og(this),this.range.setAttribute("aria-valuetext",Ng(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return q(this,a.MEDIA_VOLUME,Dg)}set mediaVolume(e){z(this,a.MEDIA_VOLUME,e)}get mediaMuted(){return M(this,a.MEDIA_MUTED)}set mediaMuted(e){x(this,a.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return O(this,a.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){N(this,a.MEDIA_VOLUME_UNAVAILABLE,e)}};u.customElements.get("media-volume-range")||u.customElements.define("media-volume-range",Nc);function Ug(i){return`
1615
1615
  <style>
1616
1616
  :host {
1617
1617
  min-width: 4ch;
@@ -1640,7 +1640,7 @@ bp-player[has-error] {
1640
1640
  <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
1641
1641
  </svg>
1642
1642
  </div>
1643
- `}function Ug(){return b("Loop")}var hs=class extends X{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=b("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return M(this,a.MEDIA_LOOP)}set mediaLoop(e){x(this,a.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new u.CustomEvent(_.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};hs.getSlotTemplateHTML=Ng;hs.getTooltipContentHTML=Ug;u.customElements.get("media-loop-button")||u.customElements.define("media-loop-button",hs);function ym({anchor:i,floating:e,placement:t}){let r=Hg({anchor:i,floating:e}),{x:n,y:o}=Vg(r,t);return{x:n,y:o}}function Hg({anchor:i,floating:e}){return{anchor:$g(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function $g(i,e){var t;let r=i.getBoundingClientRect(),n=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-n.x,y:r.y-n.y,width:r.width,height:r.height}}function Vg({anchor:i,floating:e},t){let r=Bg(t)==="x"?"y":"x",n=r==="y"?"height":"width",o=Tm(t),s=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,d=i[n]/2-e[n]/2,h;switch(o){case"top":h={x:s,y:i.y-e.height};break;case"bottom":h={x:s,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:l};break;case"left":h={x:i.x-e.width,y:l};break;default:h={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":h[r]-=d;break;case"end":h[r]+=d;break}return h}function Tm(i){return i.split("-")[0]}function Bg(i){return["top","bottom"].includes(Tm(i))?"y":"x"}var _i=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},El=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var Yc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},J=(i,e,t)=>(Yc(i,e,"read from private field"),t?t.call(i):e.get(i)),te=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Pt=(i,e,t,r)=>(Yc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ie=(i,e,t)=>(Yc(i,e,"access private method"),t),Dt,fr,yi,gl,bl,Er,vs,Uc,Am,Tl,Qc,Al,_l,Hc,$c,Sm,Vc,km,Bc,Lm,gn,bn,_n,fs,Sl,Zc,Wc,wm,Xc,Im,Fc,Cm,jc,Rm,Kc,Mm,qc,xm,ps,kl,Gc,Pm,ms,Ll,yl,zc;function Ot({type:i,text:e,value:t,checked:r}){let n=le.createElement("media-chrome-menu-item");n.type=i??"",n.part.add("menu-item"),i&&n.part.add(i),n.value=t,n.checked=r;let o=le.createElement("span");return o.textContent=e,n.append(o),n}function ut(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let r=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return r?r.cloneNode(!0):""}function Wg(i){return`
1643
+ `}function Hg(){return b("Loop")}var hs=class extends X{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=b("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return M(this,a.MEDIA_LOOP)}set mediaLoop(e){x(this,a.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new u.CustomEvent(_.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};hs.getSlotTemplateHTML=Ug;hs.getTooltipContentHTML=Hg;u.customElements.get("media-loop-button")||u.customElements.define("media-loop-button",hs);function Tm({anchor:i,floating:e,placement:t}){let r=$g({anchor:i,floating:e}),{x:n,y:o}=Bg(r,t);return{x:n,y:o}}function $g({anchor:i,floating:e}){return{anchor:Vg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Vg(i,e){var t;let r=i.getBoundingClientRect(),n=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-n.x,y:r.y-n.y,width:r.width,height:r.height}}function Bg({anchor:i,floating:e},t){let r=Wg(t)==="x"?"y":"x",n=r==="y"?"height":"width",o=Am(t),s=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,d=i[n]/2-e[n]/2,h;switch(o){case"top":h={x:s,y:i.y-e.height};break;case"bottom":h={x:s,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:l};break;case"left":h={x:i.x-e.width,y:l};break;default:h={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":h[r]-=d;break;case"end":h[r]+=d;break}return h}function Am(i){return i.split("-")[0]}function Wg(i){return["top","bottom"].includes(Am(i))?"y":"x"}var _i=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},El=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var Yc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},J=(i,e,t)=>(Yc(i,e,"read from private field"),t?t.call(i):e.get(i)),te=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Pt=(i,e,t,r)=>(Yc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ie=(i,e,t)=>(Yc(i,e,"access private method"),t),Dt,fr,yi,gl,bl,Er,vs,Uc,Sm,Tl,Qc,Al,_l,Hc,$c,km,Vc,Lm,Bc,wm,gn,bn,_n,fs,Sl,Zc,Wc,Im,Xc,Cm,Fc,Rm,jc,Mm,Kc,xm,qc,Pm,ps,kl,Gc,Dm,ms,Ll,yl,zc;function Ot({type:i,text:e,value:t,checked:r}){let n=le.createElement("media-chrome-menu-item");n.type=i??"",n.part.add("menu-item"),i&&n.part.add(i),n.value=t,n.checked=r;let o=le.createElement("span");return o.textContent=e,n.append(o),n}function ut(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let r=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return r?r.cloneNode(!0):""}function Fg(i){return`
1644
1644
  <style>
1645
1645
  :host {
1646
1646
  font: var(--media-font,
@@ -1815,7 +1815,7 @@ bp-player[has-error] {
1815
1815
  <slot></slot>
1816
1816
  </div>
1817
1817
  <slot name="checked-indicator" hidden></slot>
1818
- `}var vr={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ve=class extends u.HTMLElement{constructor(){if(super(),te(this,Uc),te(this,Tl),te(this,_l),te(this,$c),te(this,Vc),te(this,Bc),te(this,_n),te(this,Sl),te(this,Wc),te(this,Xc),te(this,Fc),te(this,jc),te(this,Kc),te(this,qc),te(this,ps),te(this,Gc),te(this,ms),te(this,yl),te(this,Dt,null),te(this,fr,null),te(this,yi,null),te(this,gl,new Set),te(this,bl,void 0),te(this,Er,!1),te(this,vs,null),te(this,Al,()=>{let e=J(this,gl),t=new Set(this.items);for(let r of e)t.has(r)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:r}));for(let r of t)e.has(r)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:r}));Pt(this,gl,t)}),te(this,gn,()=>{ie(this,_n,fs).call(this),ie(this,Sl,Zc).call(this,!1)}),te(this,bn,()=>{ie(this,_n,fs).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),Pt(this,bl,new MutationObserver(J(this,Al))),J(this,bl).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[vr.DISABLED,vr.HIDDEN,vr.STYLE,vr.ANCHOR,V.MEDIA_CONTROLLER]}static formatMenuItemText(e,t){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":ie(this,Uc,Am).call(this,e);break;case"invoke":ie(this,$c,Sm).call(this,e);break;case"click":ie(this,Wc,wm).call(this,e);break;case"toggle":ie(this,Fc,Cm).call(this,e);break;case"focusout":ie(this,Kc,Mm).call(this,e);break;case"keydown":ie(this,qc,xm).call(this,e);break}}connectedCallback(){var e,t;Pt(this,vs,Io(this.shadowRoot,":host")),ie(this,_l,Hc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Pt(this,Dt,ra(this)),(t=(e=J(this,Dt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Wt(Es(this),J(this,gn)),Wt(this,J(this,bn))),ie(this,Tl,Qc).call(this)}disconnectedCallback(){var e,t;Ft(Es(this),J(this,gn)),Ft(this,J(this,bn)),this.disable(),(t=(e=J(this,Dt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Pt(this,Dt,null)}attributeChangedCallback(e,t,r){var n,o,s,l;e===vr.HIDDEN&&r!==t?(J(this,Er)||Pt(this,Er,!0),this.hidden?ie(this,Bc,Lm).call(this):ie(this,Vc,km).call(this),this.dispatchEvent(new El({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===V.MEDIA_CONTROLLER?(t&&((o=(n=J(this,Dt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Pt(this,Dt,null)),r&&this.isConnected&&(Pt(this,Dt,ra(this)),(l=(s=J(this,Dt))==null?void 0:s.associateElement)==null||l.call(s,this))):e===vr.DISABLED&&r!==t?r==null?this.enable():this.disable():e===vr.STYLE&&r!==t&&ie(this,_l,Hc).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=ji(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Fg)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(r=>r.value===e);t&&ie(this,yl,zc).call(this,t)}focus(){if(Pt(this,fr,wo()),this.items.length){ie(this,ms,Ll).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let r=ie(this,ps,kl).call(this,e);r&&(ie(this,yl,zc).call(this,r,r.type==="checkbox"),J(this,yi)&&!this.hidden&&((t=J(this,fr))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:n}=e,o=this.items,s=(r=(t=ie(this,ps,kl).call(this,e))!=null?t:ie(this,Gc,Pm).call(this))!=null?r:o[0],l=o.indexOf(s),d=Math.max(0,l);n==="ArrowDown"?d++:n==="ArrowUp"?d--:e.key==="Home"?d=0:e.key==="End"&&(d=o.length-1),d<0&&(d=o.length-1),d>o.length-1&&(d=0),ie(this,ms,Ll).call(this,o[d]),o[d].focus()}};Dt=new WeakMap;fr=new WeakMap;yi=new WeakMap;gl=new WeakMap;bl=new WeakMap;Er=new WeakMap;vs=new WeakMap;Uc=new WeakSet;Am=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();["header","title"].includes(e.name)&&ie(this,Tl,Qc).call(this),e.name||J(this,Al).call(this)};Tl=new WeakSet;Qc=function(){let i=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');i.hidden=e.assignedNodes().length===0&&i.assignedNodes().length===0};Al=new WeakMap;_l=new WeakSet;Hc=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=(i=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:i.trim();e.setAttribute("media",t==="row"?"":"width:0")};$c=new WeakSet;Sm=function(i){Pt(this,yi,i.relatedTarget),xe(this,i.relatedTarget)||(this.hidden=!this.hidden)};Vc=new WeakSet;km=function(){var i;(i=J(this,yi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Wt(Es(this),J(this,gn)),Wt(this,J(this,bn))};Bc=new WeakSet;Lm=function(){var i;(i=J(this,yi))==null||i.setAttribute("aria-expanded","false"),Ft(Es(this),J(this,gn)),Ft(this,J(this,bn))};gn=new WeakMap;bn=new WeakMap;_n=new WeakSet;fs=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=ym({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let n=Es(this).getBoundingClientRect(),o=n.width-e-i,s=n.height-t-this.offsetHeight,{style:l}=J(this,vs);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,o)}px`),l.setProperty("--_menu-bottom",`${s}px`);let d=getComputedStyle(this),p=l.getPropertyValue("--_menu-bottom")===d.bottom?s:parseFloat(d.bottom),g=n.height-p-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};Sl=new WeakSet;Zc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=J(this,vs);if(i||r.setProperty("--media-menu-transition-in","none"),t){let n=t.offsetHeight,o=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${n}px`),ie(this,_n,fs).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),ie(this,_n,fs).call(this);r.removeProperty("--media-menu-transition-in")};Wc=new WeakSet;wm=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(J(this,Xc,Im))){(e=J(this,fr))==null||e.focus(),this.hidden=!0;return}let t=ie(this,ps,kl).call(this,i);!t||t.hasAttribute("disabled")||(ie(this,ms,Ll).call(this,t),this.handleSelect(i))};Xc=new WeakSet;Im=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.matches('button[part~="back"]'))};Fc=new WeakSet;Cm=function(i){if(i.target===this)return;ie(this,jc,Rm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let t of e)t.invokeTargetElement!=i.target&&i.newState=="open"&&t.getAttribute("aria-expanded")=="true"&&!t.invokeTargetElement.hidden&&t.invokeTargetElement.dispatchEvent(new _i({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);ie(this,Sl,Zc).call(this,!0)};jc=new WeakSet;Rm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Kc=new WeakSet;Mm=function(i){var e;xe(this,i.relatedTarget)||(J(this,Er)&&((e=J(this,fr))==null||e.focus()),J(this,yi)&&J(this,yi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};qc=new WeakSet;xm=function(i){var e,t,r,n,o;let{key:s,ctrlKey:l,altKey:d,metaKey:h}=i;if(!(l||d||h)&&this.keysUsed.includes(s))if(i.preventDefault(),i.stopPropagation(),s==="Tab"){if(J(this,Er)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(n=(r=this.nextElementSibling)==null?void 0:r.focus)==null||n.call(r),this.blur()}else s==="Escape"?((o=J(this,fr))==null||o.focus(),J(this,Er)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};ps=new WeakSet;kl=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Gc=new WeakSet;Pm=function(){return this.items.find(i=>i.tabIndex===0)};ms=new WeakSet;Ll=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};yl=new WeakSet;zc=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(r=>r.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((r,n)=>r!=t[n])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};ve.shadowRootOptions={mode:"open"};ve.getTemplateHTML=Wg;function Fg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Es(i){var e;return(e=i.getAttribute("bounds")?bt(i,`#${i.getAttribute("bounds")}`):ne(i)||i.parentElement)!=null?e:i}u.customElements.get("media-chrome-menu")||u.customElements.define("media-chrome-menu",ve);var nu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Nt=(i,e,t)=>(nu(i,e,"read from private field"),t?t.call(i):e.get(i)),zt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Jc=(i,e,t,r)=>(nu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ht=(i,e,t)=>(nu(i,e,"access private method"),t),wl,bs,eu,Dm,Cl,ou,su,Om,Ut,yn,_s,tu,Nm,Il,iu;function Kg(i){return`
1818
+ `}var vr={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ve=class extends u.HTMLElement{constructor(){if(super(),te(this,Uc),te(this,Tl),te(this,_l),te(this,$c),te(this,Vc),te(this,Bc),te(this,_n),te(this,Sl),te(this,Wc),te(this,Xc),te(this,Fc),te(this,jc),te(this,Kc),te(this,qc),te(this,ps),te(this,Gc),te(this,ms),te(this,yl),te(this,Dt,null),te(this,fr,null),te(this,yi,null),te(this,gl,new Set),te(this,bl,void 0),te(this,Er,!1),te(this,vs,null),te(this,Al,()=>{let e=J(this,gl),t=new Set(this.items);for(let r of e)t.has(r)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:r}));for(let r of t)e.has(r)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:r}));Pt(this,gl,t)}),te(this,gn,()=>{ie(this,_n,fs).call(this),ie(this,Sl,Zc).call(this,!1)}),te(this,bn,()=>{ie(this,_n,fs).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),Pt(this,bl,new MutationObserver(J(this,Al))),J(this,bl).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[vr.DISABLED,vr.HIDDEN,vr.STYLE,vr.ANCHOR,V.MEDIA_CONTROLLER]}static formatMenuItemText(e,t){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":ie(this,Uc,Sm).call(this,e);break;case"invoke":ie(this,$c,km).call(this,e);break;case"click":ie(this,Wc,Im).call(this,e);break;case"toggle":ie(this,Fc,Rm).call(this,e);break;case"focusout":ie(this,Kc,xm).call(this,e);break;case"keydown":ie(this,qc,Pm).call(this,e);break}}connectedCallback(){var e,t;Pt(this,vs,Io(this.shadowRoot,":host")),ie(this,_l,Hc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Pt(this,Dt,ra(this)),(t=(e=J(this,Dt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Wt(Es(this),J(this,gn)),Wt(this,J(this,bn))),ie(this,Tl,Qc).call(this)}disconnectedCallback(){var e,t;Ft(Es(this),J(this,gn)),Ft(this,J(this,bn)),this.disable(),(t=(e=J(this,Dt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Pt(this,Dt,null)}attributeChangedCallback(e,t,r){var n,o,s,l;e===vr.HIDDEN&&r!==t?(J(this,Er)||Pt(this,Er,!0),this.hidden?ie(this,Bc,wm).call(this):ie(this,Vc,Lm).call(this),this.dispatchEvent(new El({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===V.MEDIA_CONTROLLER?(t&&((o=(n=J(this,Dt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Pt(this,Dt,null)),r&&this.isConnected&&(Pt(this,Dt,ra(this)),(l=(s=J(this,Dt))==null?void 0:s.associateElement)==null||l.call(s,this))):e===vr.DISABLED&&r!==t?r==null?this.enable():this.disable():e===vr.STYLE&&r!==t&&ie(this,_l,Hc).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=ji(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Kg)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(r=>r.value===e);t&&ie(this,yl,zc).call(this,t)}focus(){if(Pt(this,fr,wo()),this.items.length){ie(this,ms,Ll).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let r=ie(this,ps,kl).call(this,e);r&&(ie(this,yl,zc).call(this,r,r.type==="checkbox"),J(this,yi)&&!this.hidden&&((t=J(this,fr))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:n}=e,o=this.items,s=(r=(t=ie(this,ps,kl).call(this,e))!=null?t:ie(this,Gc,Dm).call(this))!=null?r:o[0],l=o.indexOf(s),d=Math.max(0,l);n==="ArrowDown"?d++:n==="ArrowUp"?d--:e.key==="Home"?d=0:e.key==="End"&&(d=o.length-1),d<0&&(d=o.length-1),d>o.length-1&&(d=0),ie(this,ms,Ll).call(this,o[d]),o[d].focus()}};Dt=new WeakMap;fr=new WeakMap;yi=new WeakMap;gl=new WeakMap;bl=new WeakMap;Er=new WeakMap;vs=new WeakMap;Uc=new WeakSet;Sm=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();["header","title"].includes(e.name)&&ie(this,Tl,Qc).call(this),e.name||J(this,Al).call(this)};Tl=new WeakSet;Qc=function(){let i=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');i.hidden=e.assignedNodes().length===0&&i.assignedNodes().length===0};Al=new WeakMap;_l=new WeakSet;Hc=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=(i=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:i.trim();e.setAttribute("media",t==="row"?"":"width:0")};$c=new WeakSet;km=function(i){Pt(this,yi,i.relatedTarget),xe(this,i.relatedTarget)||(this.hidden=!this.hidden)};Vc=new WeakSet;Lm=function(){var i;(i=J(this,yi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Wt(Es(this),J(this,gn)),Wt(this,J(this,bn))};Bc=new WeakSet;wm=function(){var i;(i=J(this,yi))==null||i.setAttribute("aria-expanded","false"),Ft(Es(this),J(this,gn)),Ft(this,J(this,bn))};gn=new WeakMap;bn=new WeakMap;_n=new WeakSet;fs=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=Tm({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let n=Es(this).getBoundingClientRect(),o=n.width-e-i,s=n.height-t-this.offsetHeight,{style:l}=J(this,vs);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,o)}px`),l.setProperty("--_menu-bottom",`${s}px`);let d=getComputedStyle(this),p=l.getPropertyValue("--_menu-bottom")===d.bottom?s:parseFloat(d.bottom),g=n.height-p-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};Sl=new WeakSet;Zc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=J(this,vs);if(i||r.setProperty("--media-menu-transition-in","none"),t){let n=t.offsetHeight,o=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${n}px`),ie(this,_n,fs).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),ie(this,_n,fs).call(this);r.removeProperty("--media-menu-transition-in")};Wc=new WeakSet;Im=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(J(this,Xc,Cm))){(e=J(this,fr))==null||e.focus(),this.hidden=!0;return}let t=ie(this,ps,kl).call(this,i);!t||t.hasAttribute("disabled")||(ie(this,ms,Ll).call(this,t),this.handleSelect(i))};Xc=new WeakSet;Cm=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.matches('button[part~="back"]'))};Fc=new WeakSet;Rm=function(i){if(i.target===this)return;ie(this,jc,Mm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let t of e)t.invokeTargetElement!=i.target&&i.newState=="open"&&t.getAttribute("aria-expanded")=="true"&&!t.invokeTargetElement.hidden&&t.invokeTargetElement.dispatchEvent(new _i({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);ie(this,Sl,Zc).call(this,!0)};jc=new WeakSet;Mm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Kc=new WeakSet;xm=function(i){var e;xe(this,i.relatedTarget)||(J(this,Er)&&((e=J(this,fr))==null||e.focus()),J(this,yi)&&J(this,yi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};qc=new WeakSet;Pm=function(i){var e,t,r,n,o;let{key:s,ctrlKey:l,altKey:d,metaKey:h}=i;if(!(l||d||h)&&this.keysUsed.includes(s))if(i.preventDefault(),i.stopPropagation(),s==="Tab"){if(J(this,Er)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(n=(r=this.nextElementSibling)==null?void 0:r.focus)==null||n.call(r),this.blur()}else s==="Escape"?((o=J(this,fr))==null||o.focus(),J(this,Er)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};ps=new WeakSet;kl=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Gc=new WeakSet;Dm=function(){return this.items.find(i=>i.tabIndex===0)};ms=new WeakSet;Ll=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};yl=new WeakSet;zc=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(r=>r.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((r,n)=>r!=t[n])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};ve.shadowRootOptions={mode:"open"};ve.getTemplateHTML=Fg;function Kg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Es(i){var e;return(e=i.getAttribute("bounds")?bt(i,`#${i.getAttribute("bounds")}`):ne(i)||i.parentElement)!=null?e:i}u.customElements.get("media-chrome-menu")||u.customElements.define("media-chrome-menu",ve);var nu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Nt=(i,e,t)=>(nu(i,e,"read from private field"),t?t.call(i):e.get(i)),zt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Jc=(i,e,t,r)=>(nu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ht=(i,e,t)=>(nu(i,e,"access private method"),t),wl,bs,eu,Om,Cl,ou,su,Nm,Ut,yn,_s,tu,Um,Il,iu;function qg(i){return`
1819
1819
  <style>
1820
1820
  :host {
1821
1821
  transition: var(--media-menu-item-transition,
@@ -1933,7 +1933,7 @@ bp-player[has-error] {
1933
1933
  ${this.getSuffixSlotInnerHTML(i)}
1934
1934
  </slot>
1935
1935
  <slot name="submenu"></slot>
1936
- `}function qg(i){return""}var tt={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},ze=class extends u.HTMLElement{constructor(){if(super(),zt(this,eu),zt(this,Cl),zt(this,su),zt(this,yn),zt(this,tu),zt(this,Il),zt(this,wl,!1),zt(this,bs,void 0),zt(this,Ut,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),n=(e=this.submenuElement.checkedItems)==null?void 0:e[0],o=(t=n==null?void 0:n.dataset.description)!=null?t:n==null?void 0:n.text,s=le.createElement("span");s.textContent=o??"",r.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[tt.TYPE,tt.DISABLED,tt.CHECKED,tt.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),gs(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":ht(this,eu,Dm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":ht(this,tu,Nm).call(this,e);break;case"keyup":ht(this,yn,_s).call(this,e);break}}attributeChangedCallback(e,t,r){e===tt.CHECKED&&gs(this)&&!Nt(this,wl)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===tt.TYPE&&r!==t?this.role="menuitem"+r:e===tt.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(tt.DISABLED)||this.enable(),this.role="menuitem"+this.type,Jc(this,bs,ru(this,this.parentNode)),ht(this,Il,iu).call(this),this.submenuElement&&ht(this,Cl,ou).call(this)}disconnectedCallback(){this.disable(),ht(this,Il,iu).call(this),Jc(this,bs,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=ji(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(tt.TYPE))!=null?e:""}set type(e){this.setAttribute(tt.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(tt.VALUE))!=null?e:this.text}set value(e){this.setAttribute(tt.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(gs(this))return this.getAttribute("aria-checked")==="true"}set checked(e){gs(this)&&(Jc(this,wl,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){gs(this)||this.invokeTargetElement&&xe(this,e.target)&&this.invokeTargetElement.dispatchEvent(new _i({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};wl=new WeakMap;bs=new WeakMap;eu=new WeakSet;Dm=function(i){let e=i.target;if(!(e!=null&&e.name))for(let r of e.assignedNodes({flatten:!0}))r instanceof Text&&r.textContent.trim()===""&&r.remove();e.name==="submenu"&&(this.submenuElement?ht(this,Cl,ou).call(this):ht(this,su,Om).call(this))};Cl=new WeakSet;ou=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",Nt(this,Ut)),this.submenuElement.addEventListener("addmenuitem",Nt(this,Ut)),this.submenuElement.addEventListener("removemenuitem",Nt(this,Ut)),Nt(this,Ut).call(this)};su=new WeakSet;Om=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Nt(this,Ut)),this.submenuElement.removeEventListener("addmenuitem",Nt(this,Ut)),this.submenuElement.removeEventListener("removemenuitem",Nt(this,Ut)),Nt(this,Ut).call(this)};Ut=new WeakMap;yn=new WeakSet;_s=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",ht(this,yn,_s));return}this.handleClick(i)};tu=new WeakSet;Nm=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",ht(this,yn,_s));return}this.addEventListener("keyup",ht(this,yn,_s),{once:!0})};Il=new WeakSet;iu=function(){var i;let e=(i=Nt(this,bs))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(r=>r.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let r of e)r.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};ze.shadowRootOptions={mode:"open"};ze.getTemplateHTML=Kg;ze.getSuffixSlotInnerHTML=qg;function gs(i){return i.type==="radio"||i.type==="checkbox"}function ru(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?ru(i,t):e!=null&&e.items?e:ru(e,e==null?void 0:e.parentNode)}u.customElements.get("media-chrome-menu-item")||u.customElements.define("media-chrome-menu-item",ze);function Gg(i){return`
1936
+ `}function Gg(i){return""}var tt={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},ze=class extends u.HTMLElement{constructor(){if(super(),zt(this,eu),zt(this,Cl),zt(this,su),zt(this,yn),zt(this,tu),zt(this,Il),zt(this,wl,!1),zt(this,bs,void 0),zt(this,Ut,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),n=(e=this.submenuElement.checkedItems)==null?void 0:e[0],o=(t=n==null?void 0:n.dataset.description)!=null?t:n==null?void 0:n.text,s=le.createElement("span");s.textContent=o??"",r.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[tt.TYPE,tt.DISABLED,tt.CHECKED,tt.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),gs(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":ht(this,eu,Om).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":ht(this,tu,Um).call(this,e);break;case"keyup":ht(this,yn,_s).call(this,e);break}}attributeChangedCallback(e,t,r){e===tt.CHECKED&&gs(this)&&!Nt(this,wl)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===tt.TYPE&&r!==t?this.role="menuitem"+r:e===tt.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(tt.DISABLED)||this.enable(),this.role="menuitem"+this.type,Jc(this,bs,ru(this,this.parentNode)),ht(this,Il,iu).call(this),this.submenuElement&&ht(this,Cl,ou).call(this)}disconnectedCallback(){this.disable(),ht(this,Il,iu).call(this),Jc(this,bs,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=ji(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(tt.TYPE))!=null?e:""}set type(e){this.setAttribute(tt.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(tt.VALUE))!=null?e:this.text}set value(e){this.setAttribute(tt.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(gs(this))return this.getAttribute("aria-checked")==="true"}set checked(e){gs(this)&&(Jc(this,wl,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){gs(this)||this.invokeTargetElement&&xe(this,e.target)&&this.invokeTargetElement.dispatchEvent(new _i({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};wl=new WeakMap;bs=new WeakMap;eu=new WeakSet;Om=function(i){let e=i.target;if(!(e!=null&&e.name))for(let r of e.assignedNodes({flatten:!0}))r instanceof Text&&r.textContent.trim()===""&&r.remove();e.name==="submenu"&&(this.submenuElement?ht(this,Cl,ou).call(this):ht(this,su,Nm).call(this))};Cl=new WeakSet;ou=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",Nt(this,Ut)),this.submenuElement.addEventListener("addmenuitem",Nt(this,Ut)),this.submenuElement.addEventListener("removemenuitem",Nt(this,Ut)),Nt(this,Ut).call(this)};su=new WeakSet;Nm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Nt(this,Ut)),this.submenuElement.removeEventListener("addmenuitem",Nt(this,Ut)),this.submenuElement.removeEventListener("removemenuitem",Nt(this,Ut)),Nt(this,Ut).call(this)};Ut=new WeakMap;yn=new WeakSet;_s=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",ht(this,yn,_s));return}this.handleClick(i)};tu=new WeakSet;Um=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",ht(this,yn,_s));return}this.addEventListener("keyup",ht(this,yn,_s),{once:!0})};Il=new WeakSet;iu=function(){var i;let e=(i=Nt(this,bs))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(r=>r.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let r of e)r.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};ze.shadowRootOptions={mode:"open"};ze.getTemplateHTML=qg;ze.getSuffixSlotInnerHTML=Gg;function gs(i){return i.type==="radio"||i.type==="checkbox"}function ru(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?ru(i,t):e!=null&&e.items?e:ru(e,e==null?void 0:e.parentNode)}u.customElements.get("media-chrome-menu-item")||u.customElements.define("media-chrome-menu-item",ze);function zg(i){return`
1937
1937
  ${ve.getTemplateHTML(i)}
1938
1938
  <style>
1939
1939
  :host {
@@ -1968,7 +1968,7 @@ bp-player[has-error] {
1968
1968
  --media-settings-menu-item-opacity: 0;
1969
1969
  }
1970
1970
  </style>
1971
- `}var ys=class extends ve{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-settings-menu-button")}};ys.getTemplateHTML=Gg;u.customElements.get("media-settings-menu")||u.customElements.define("media-settings-menu",ys);function zg(i){return`
1971
+ `}var ys=class extends ve{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-settings-menu-button")}};ys.getTemplateHTML=zg;u.customElements.get("media-settings-menu")||u.customElements.define("media-settings-menu",ys);function Yg(i){return`
1972
1972
  ${ze.getTemplateHTML.call(this,i)}
1973
1973
  <style>
1974
1974
  slot:not([name="submenu"]) {
@@ -1979,11 +1979,11 @@ bp-player[has-error] {
1979
1979
  background: transparent;
1980
1980
  }
1981
1981
  </style>
1982
- `}function Yg(i){return`
1982
+ `}function Qg(i){return`
1983
1983
  <svg aria-hidden="true" viewBox="0 0 20 24">
1984
1984
  <path d="m8.12 17.585-.742-.669 4.2-4.665-4.2-4.666.743-.669 4.803 5.335-4.803 5.334Z"/>
1985
1985
  </svg>
1986
- `}var gr=class extends ze{};gr.shadowRootOptions={mode:"open"};gr.getTemplateHTML=zg;gr.getSuffixSlotInnerHTML=Yg;u.customElements.get("media-settings-menu-item")||u.customElements.define("media-settings-menu-item",gr);var Be=class extends X{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=ji(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new _i({relatedTarget:this}))}};u.customElements.get("media-chrome-menu-button")||u.customElements.define("media-chrome-menu-button",Be);function Qg(){return`
1986
+ `}var gr=class extends ze{};gr.shadowRootOptions={mode:"open"};gr.getTemplateHTML=Yg;gr.getSuffixSlotInnerHTML=Qg;u.customElements.get("media-settings-menu-item")||u.customElements.define("media-settings-menu-item",gr);var Be=class extends X{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=ji(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new _i({relatedTarget:this}))}};u.customElements.get("media-chrome-menu-button")||u.customElements.define("media-chrome-menu-button",Be);function Zg(){return`
1987
1987
  <style>
1988
1988
  :host([aria-expanded="true"]) slot[name=tooltip] {
1989
1989
  display: none;
@@ -1994,27 +1994,27 @@ bp-player[has-error] {
1994
1994
  <path d="M4.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"/>
1995
1995
  </svg>
1996
1996
  </slot>
1997
- `}function Zg(){return b("Settings")}var Tn=class extends Be{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",b("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ne(this).querySelector("media-settings-menu")}};Tn.getSlotTemplateHTML=Qg;Tn.getTooltipContentHTML=Zg;u.customElements.get("media-settings-menu-button")||u.customElements.define("media-settings-menu-button",Tn);var cu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Um=(i,e,t)=>(cu(i,e,"read from private field"),t?t.call(i):e.get(i)),Rl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},au=(i,e,t,r)=>(cu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ml=(i,e,t)=>(cu(i,e,"access private method"),t),Ts,Dl,xl,lu,Pl,du,Ol=class extends ve{constructor(){super(...arguments),Rl(this,xl),Rl(this,Pl),Rl(this,Ts,[]),Rl(this,Dl,void 0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===a.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(au(this,Ts,Vh(r??"")),Ml(this,xl,lu).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ml(this,Pl,du))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ml(this,Pl,du))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=ne(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Um(this,Ts)}set mediaAudioTrackList(e){au(this,Ts,e),Ml(this,xl,lu).call(this)}get mediaAudioTrackEnabled(){var e;return(e=O(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){N(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};Ts=new WeakMap;Dl=new WeakMap;xl=new WeakSet;lu=function(){if(Um(this,Dl)===JSON.stringify(this.mediaAudioTrackList))return;au(this,Dl,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="",i.sort((e,t)=>e.id.localeCompare(t.id,void 0,{numeric:!0}));for(let e of i){let t=this.formatMenuItemText(e.label,e),r=Ot({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(r)}};Pl=new WeakSet;du=function(){if(this.value==null)return;let i=new u.CustomEvent(_.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-audio-track-menu")||u.customElements.define("media-audio-track-menu",Ol);var Xg=`<svg aria-hidden="true" viewBox="0 0 24 24">
1997
+ `}function Xg(){return b("Settings")}var Tn=class extends Be{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",b("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ne(this).querySelector("media-settings-menu")}};Tn.getSlotTemplateHTML=Zg;Tn.getTooltipContentHTML=Xg;u.customElements.get("media-settings-menu-button")||u.customElements.define("media-settings-menu-button",Tn);var cu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hm=(i,e,t)=>(cu(i,e,"read from private field"),t?t.call(i):e.get(i)),Rl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},au=(i,e,t,r)=>(cu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ml=(i,e,t)=>(cu(i,e,"access private method"),t),Ts,Dl,xl,lu,Pl,du,Ol=class extends ve{constructor(){super(...arguments),Rl(this,xl),Rl(this,Pl),Rl(this,Ts,[]),Rl(this,Dl,void 0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===a.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(au(this,Ts,Bh(r??"")),Ml(this,xl,lu).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ml(this,Pl,du))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ml(this,Pl,du))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=ne(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Hm(this,Ts)}set mediaAudioTrackList(e){au(this,Ts,e),Ml(this,xl,lu).call(this)}get mediaAudioTrackEnabled(){var e;return(e=O(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){N(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};Ts=new WeakMap;Dl=new WeakMap;xl=new WeakSet;lu=function(){if(Hm(this,Dl)===JSON.stringify(this.mediaAudioTrackList))return;au(this,Dl,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="",i.sort((e,t)=>e.id.localeCompare(t.id,void 0,{numeric:!0}));for(let e of i){let t=this.formatMenuItemText(e.label,e),r=Ot({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(r)}};Pl=new WeakSet;du=function(){if(this.value==null)return;let i=new u.CustomEvent(_.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-audio-track-menu")||u.customElements.define("media-audio-track-menu",Ol);var jg=`<svg aria-hidden="true" viewBox="0 0 24 24">
1998
1998
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
1999
1999
  <path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
2000
- </svg>`;function jg(){return`
2000
+ </svg>`;function Jg(){return`
2001
2001
  <style>
2002
2002
  :host([aria-expanded="true"]) slot[name=tooltip] {
2003
2003
  display: none;
2004
2004
  }
2005
2005
  </style>
2006
- <slot name="icon">${Xg}</slot>
2007
- `}function Jg(){return b("Audio")}var Hm=i=>{let e=b("Audio");i.setAttribute("aria-label",e)},An=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Hm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LANG&&Hm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=ne(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=O(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){N(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};An.getSlotTemplateHTML=jg;An.getTooltipContentHTML=Jg;u.customElements.get("media-audio-track-menu-button")||u.customElements.define("media-audio-track-menu-button",An);var mu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},eb=(i,e,t)=>(mu(i,e,"read from private field"),t?t.call(i):e.get(i)),uu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},tb=(i,e,t,r)=>(mu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Nl=(i,e,t)=>(mu(i,e,"access private method"),t),$l,Ul,hu,Hl,pu,ib=`
2006
+ <slot name="icon">${jg}</slot>
2007
+ `}function eb(){return b("Audio")}var $m=i=>{let e=b("Audio");i.setAttribute("aria-label",e)},An=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),$m(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LANG&&$m(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=ne(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=O(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){N(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};An.getSlotTemplateHTML=Jg;An.getTooltipContentHTML=eb;u.customElements.get("media-audio-track-menu-button")||u.customElements.define("media-audio-track-menu-button",An);var mu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tb=(i,e,t)=>(mu(i,e,"read from private field"),t?t.call(i):e.get(i)),uu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ib=(i,e,t,r)=>(mu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Nl=(i,e,t)=>(mu(i,e,"access private method"),t),$l,Ul,hu,Hl,pu,rb=`
2008
2008
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
2009
2009
  <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
2010
- </svg>`;function rb(i){return`
2010
+ </svg>`;function nb(i){return`
2011
2011
  ${ve.getTemplateHTML(i)}
2012
- <slot name="captions-indicator" hidden>${ib}</slot>
2013
- `}var As=class extends ve{constructor(){super(...arguments),uu(this,Ul),uu(this,Hl),uu(this,$l,void 0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_LIST&&t!==r?Nl(this,Ul,hu).call(this):e===a.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",Nl(this,Ul,hu).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Nl(this,Hl,pu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Nl(this,Hl,pu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return $m(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Vm(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return $m(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Vm(this,a.MEDIA_SUBTITLES_SHOWING,e)}};$l=new WeakMap;Ul=new WeakSet;hu=function(){var i;let e=eb(this,$l)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(a.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;tb(this,$l,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,n=Ot({type:"radio",text:this.formatMenuItemText(b("Off")),value:"off",checked:r});n.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(n);let o=this.mediaSubtitlesList;for(let s of o){let l=Ot({type:"radio",text:this.formatMenuItemText(s.label,s),value:fa(s),checked:this.value==fa(s)});l.prepend(ut(this,"checked-indicator")),((i=s.kind)!=null?i:"subs")==="captions"&&l.append(ut(this,"captions-indicator")),this.defaultSlot.append(l)}};Hl=new WeakSet;pu=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(a.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new u.CustomEvent(_.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new u.CustomEvent(_.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};As.getTemplateHTML=rb;var $m=(i,e)=>{let t=i.getAttribute(e);return t?ir(t):[]},Vm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=qt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-menu")||u.customElements.define("media-captions-menu",As);var nb=`<svg aria-hidden="true" viewBox="0 0 26 24">
2012
+ <slot name="captions-indicator" hidden>${rb}</slot>
2013
+ `}var As=class extends ve{constructor(){super(...arguments),uu(this,Ul),uu(this,Hl),uu(this,$l,void 0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_LIST&&t!==r?Nl(this,Ul,hu).call(this):e===a.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",Nl(this,Ul,hu).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Nl(this,Hl,pu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Nl(this,Hl,pu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Vm(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Bm(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Vm(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Bm(this,a.MEDIA_SUBTITLES_SHOWING,e)}};$l=new WeakMap;Ul=new WeakSet;hu=function(){var i;let e=tb(this,$l)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(a.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;ib(this,$l,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,n=Ot({type:"radio",text:this.formatMenuItemText(b("Off")),value:"off",checked:r});n.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(n);let o=this.mediaSubtitlesList;for(let s of o){let l=Ot({type:"radio",text:this.formatMenuItemText(s.label,s),value:fa(s),checked:this.value==fa(s)});l.prepend(ut(this,"checked-indicator")),((i=s.kind)!=null?i:"subs")==="captions"&&l.append(ut(this,"captions-indicator")),this.defaultSlot.append(l)}};Hl=new WeakSet;pu=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(a.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new u.CustomEvent(_.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new u.CustomEvent(_.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};As.getTemplateHTML=nb;var Vm=(i,e)=>{let t=i.getAttribute(e);return t?ir(t):[]},Bm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=qt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-menu")||u.customElements.define("media-captions-menu",As);var ob=`<svg aria-hidden="true" viewBox="0 0 26 24">
2014
2014
  <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
2015
- </svg>`,ob=`<svg aria-hidden="true" viewBox="0 0 26 24">
2015
+ </svg>`,sb=`<svg aria-hidden="true" viewBox="0 0 26 24">
2016
2016
  <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
2017
- </svg>`;function sb(){return`
2017
+ </svg>`;function ab(){return`
2018
2018
  <style>
2019
2019
  :host([data-captions-enabled="true"]) slot[name=off] {
2020
2020
  display: none !important;
@@ -2031,10 +2031,10 @@ bp-player[has-error] {
2031
2031
  </style>
2032
2032
 
2033
2033
  <slot name="icon">
2034
- <slot name="on">${nb}</slot>
2035
- <slot name="off">${ob}</slot>
2034
+ <slot name="on">${ob}</slot>
2035
+ <slot name="off">${sb}</slot>
2036
2036
  </slot>
2037
- `}function ab(){return b("Captions")}var Bm=i=>{i.setAttribute("data-captions-enabled",Ea(i).toString())},Wm=i=>{i.setAttribute("aria-label",b("closed captions"))},Sn=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING,a.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),Wm(this),Bm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING?Bm(this):e===a.MEDIA_LANG&&Wm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=ne(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Fm(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Km(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Fm(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Km(this,a.MEDIA_SUBTITLES_SHOWING,e)}};Sn.getSlotTemplateHTML=sb;Sn.getTooltipContentHTML=ab;var Fm=(i,e)=>{let t=i.getAttribute(e);return t?ir(t):[]},Km=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=qt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-menu-button")||u.customElements.define("media-captions-menu-button",Sn);var qm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ln=(i,e,t)=>(qm(i,e,"read from private field"),t?t.call(i):e.get(i)),vu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kn=(i,e,t)=>(qm(i,e,"access private method"),t),Ti,wn,Ss,Vl,Eu,fu={RATES:"rates"},Bl=class extends ve{constructor(){super(),vu(this,wn),vu(this,Vl),vu(this,Ti,new pi(this,fu.RATES,{defaultValue:yc})),kn(this,wn,Ss).call(this)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,fu.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,kn(this,wn,Ss).call(this)):e===fu.RATES&&t!=r&&(Ln(this,Ti).value=r,kn(this,wn,Ss).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",kn(this,Vl,Eu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",kn(this,Vl,Eu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-playback-rate-menu-button")}get rates(){return Ln(this,Ti)}set rates(e){e?Array.isArray(e)?Ln(this,Ti).value=e.join(" "):typeof e=="string"&&(Ln(this,Ti).value=e):Ln(this,Ti).value="",kn(this,wn,Ss).call(this)}get mediaPlaybackRate(){return q(this,a.MEDIA_PLAYBACK_RATE,ur)}set mediaPlaybackRate(e){z(this,a.MEDIA_PLAYBACK_RATE,e)}};Ti=new WeakMap;wn=new WeakSet;Ss=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(Ln(this,Ti)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,n)=>r-n);for(let r of t){let n=Ot({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});n.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(n)}};Vl=new WeakSet;Eu=function(){if(!this.value)return;let i=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-playback-rate-menu")||u.customElements.define("media-playback-rate-menu",Bl);var Wl=1;function lb(i){return`
2037
+ `}function lb(){return b("Captions")}var Wm=i=>{i.setAttribute("data-captions-enabled",Ea(i).toString())},Fm=i=>{i.setAttribute("aria-label",b("closed captions"))},Sn=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING,a.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),Fm(this),Wm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING?Wm(this):e===a.MEDIA_LANG&&Fm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=ne(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Km(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){qm(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Km(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){qm(this,a.MEDIA_SUBTITLES_SHOWING,e)}};Sn.getSlotTemplateHTML=ab;Sn.getTooltipContentHTML=lb;var Km=(i,e)=>{let t=i.getAttribute(e);return t?ir(t):[]},qm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=qt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-menu-button")||u.customElements.define("media-captions-menu-button",Sn);var Gm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ln=(i,e,t)=>(Gm(i,e,"read from private field"),t?t.call(i):e.get(i)),vu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kn=(i,e,t)=>(Gm(i,e,"access private method"),t),Ti,wn,Ss,Vl,Eu,fu={RATES:"rates"},Bl=class extends ve{constructor(){super(),vu(this,wn),vu(this,Vl),vu(this,Ti,new pi(this,fu.RATES,{defaultValue:yc})),kn(this,wn,Ss).call(this)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,fu.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,kn(this,wn,Ss).call(this)):e===fu.RATES&&t!=r&&(Ln(this,Ti).value=r,kn(this,wn,Ss).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",kn(this,Vl,Eu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",kn(this,Vl,Eu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-playback-rate-menu-button")}get rates(){return Ln(this,Ti)}set rates(e){e?Array.isArray(e)?Ln(this,Ti).value=e.join(" "):typeof e=="string"&&(Ln(this,Ti).value=e):Ln(this,Ti).value="",kn(this,wn,Ss).call(this)}get mediaPlaybackRate(){return q(this,a.MEDIA_PLAYBACK_RATE,ur)}set mediaPlaybackRate(e){z(this,a.MEDIA_PLAYBACK_RATE,e)}};Ti=new WeakMap;wn=new WeakSet;Ss=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(Ln(this,Ti)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,n)=>r-n);for(let r of t){let n=Ot({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});n.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(n)}};Vl=new WeakSet;Eu=function(){if(!this.value)return;let i=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-playback-rate-menu")||u.customElements.define("media-playback-rate-menu",Bl);var Wl=1;function db(i){return`
2038
2038
  <style>
2039
2039
  :host {
2040
2040
  min-width: 5ch;
@@ -2050,16 +2050,16 @@ bp-player[has-error] {
2050
2050
  }
2051
2051
  </style>
2052
2052
  <slot name="icon">${i.mediaplaybackrate||Wl}x</slot>
2053
- `}function db(){return b("Playback rate")}var In=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Wl}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE){let n=r?+r:Number.NaN,o=Number.isNaN(n)?Wl:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ne(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return q(this,a.MEDIA_PLAYBACK_RATE,Wl)}set mediaPlaybackRate(e){z(this,a.MEDIA_PLAYBACK_RATE,e)}};In.getSlotTemplateHTML=lb;In.getTooltipContentHTML=db;u.customElements.get("media-playback-rate-menu-button")||u.customElements.define("media-playback-rate-menu-button",In);var bu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ks=(i,e,t)=>(bu(i,e,"read from private field"),t?t.call(i):e.get(i)),Fl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Gm=(i,e,t,r)=>(bu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Cn=(i,e,t)=>(bu(i,e,"access private method"),t),Ls,Mn,Rn,ws,Kl,gu,ql=class extends ve{constructor(){super(...arguments),Fl(this,Rn),Fl(this,Kl),Fl(this,Ls,[]),Fl(this,Mn,{})}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_LIST,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.MEDIA_HEIGHT]}static formatMenuItemText(e,t){return super.formatMenuItemText(e,t)}static formatRendition(e,{showBitrate:t=!1}={}){let r=`${Math.min(e.width,e.height)}p`;if(t&&e.bitrate){let n=e.bitrate/1e6,o=`${n.toFixed(n<1?1:0)} Mbps`;return`${r} (${o})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,n;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((n=e.bitrate)!=null?n:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",Cn(this,Rn,ws).call(this)):e===a.MEDIA_RENDITION_LIST&&t!==r?(Gm(this,Ls,Hh(r)),Cn(this,Rn,ws).call(this)):e===a.MEDIA_HEIGHT&&t!==r&&Cn(this,Rn,ws).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Cn(this,Kl,gu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Cn(this,Kl,gu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return ks(this,Ls)}set mediaRenditionList(e){Gm(this,Ls,e),Cn(this,Rn,ws).call(this)}get mediaRenditionSelected(){return O(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){N(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return q(this,a.MEDIA_HEIGHT)}set mediaHeight(e){z(this,a.MEDIA_HEIGHT,e)}compareRendition(e,t){return this.constructor.compareRendition(e,t)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}formatRendition(e,t){return this.constructor.formatRendition(e,t)}showRenditionBitrate(e){return this.mediaRenditionList.some(t=>t!==e&&t.height===e.height&&t.bitrate!==e.bitrate)}};Ls=new WeakMap;Mn=new WeakMap;Rn=new WeakSet;ws=function(){if(ks(this,Mn).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&ks(this,Mn).mediaHeight===this.mediaHeight)return;ks(this,Mn).mediaRenditionList=JSON.stringify(this.mediaRenditionList),ks(this,Mn).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(s=>s.id===this.mediaRenditionSelected);for(let s of i)s.selected=s===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let s of i){let l=this.formatRendition(s,{showBitrate:this.showRenditionBitrate(s)}),d=Ot({type:"radio",text:l,value:`${s.id}`,checked:s.selected&&!t});d.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(d)}let r=e&&this.showRenditionBitrate(e),n=t?e?this.formatMenuItemText(`${b("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${b("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(b("Auto")),o=Ot({type:"radio",text:n,value:"auto",checked:t});o.dataset.description=n,o.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(o)};Kl=new WeakSet;gu=function(){if(this.value==null)return;let i=new u.CustomEvent(_.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-rendition-menu")||u.customElements.define("media-rendition-menu",ql);var cb=`<svg aria-hidden="true" viewBox="0 0 24 24">
2053
+ `}function cb(){return b("Playback rate")}var In=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Wl}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE){let n=r?+r:Number.NaN,o=Number.isNaN(n)?Wl:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ne(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return q(this,a.MEDIA_PLAYBACK_RATE,Wl)}set mediaPlaybackRate(e){z(this,a.MEDIA_PLAYBACK_RATE,e)}};In.getSlotTemplateHTML=db;In.getTooltipContentHTML=cb;u.customElements.get("media-playback-rate-menu-button")||u.customElements.define("media-playback-rate-menu-button",In);var bu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ks=(i,e,t)=>(bu(i,e,"read from private field"),t?t.call(i):e.get(i)),Fl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},zm=(i,e,t,r)=>(bu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Cn=(i,e,t)=>(bu(i,e,"access private method"),t),Ls,Mn,Rn,ws,Kl,gu,ql=class extends ve{constructor(){super(...arguments),Fl(this,Rn),Fl(this,Kl),Fl(this,Ls,[]),Fl(this,Mn,{})}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_LIST,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.MEDIA_HEIGHT]}static formatMenuItemText(e,t){return super.formatMenuItemText(e,t)}static formatRendition(e,{showBitrate:t=!1}={}){let r=`${Math.min(e.width,e.height)}p`;if(t&&e.bitrate){let n=e.bitrate/1e6,o=`${n.toFixed(n<1?1:0)} Mbps`;return`${r} (${o})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,n;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((n=e.bitrate)!=null?n:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",Cn(this,Rn,ws).call(this)):e===a.MEDIA_RENDITION_LIST&&t!==r?(zm(this,Ls,$h(r)),Cn(this,Rn,ws).call(this)):e===a.MEDIA_HEIGHT&&t!==r&&Cn(this,Rn,ws).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Cn(this,Kl,gu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Cn(this,Kl,gu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return ks(this,Ls)}set mediaRenditionList(e){zm(this,Ls,e),Cn(this,Rn,ws).call(this)}get mediaRenditionSelected(){return O(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){N(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return q(this,a.MEDIA_HEIGHT)}set mediaHeight(e){z(this,a.MEDIA_HEIGHT,e)}compareRendition(e,t){return this.constructor.compareRendition(e,t)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}formatRendition(e,t){return this.constructor.formatRendition(e,t)}showRenditionBitrate(e){return this.mediaRenditionList.some(t=>t!==e&&t.height===e.height&&t.bitrate!==e.bitrate)}};Ls=new WeakMap;Mn=new WeakMap;Rn=new WeakSet;ws=function(){if(ks(this,Mn).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&ks(this,Mn).mediaHeight===this.mediaHeight)return;ks(this,Mn).mediaRenditionList=JSON.stringify(this.mediaRenditionList),ks(this,Mn).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(s=>s.id===this.mediaRenditionSelected);for(let s of i)s.selected=s===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let s of i){let l=this.formatRendition(s,{showBitrate:this.showRenditionBitrate(s)}),d=Ot({type:"radio",text:l,value:`${s.id}`,checked:s.selected&&!t});d.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(d)}let r=e&&this.showRenditionBitrate(e),n=t?e?this.formatMenuItemText(`${b("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${b("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(b("Auto")),o=Ot({type:"radio",text:n,value:"auto",checked:t});o.dataset.description=n,o.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(o)};Kl=new WeakSet;gu=function(){if(this.value==null)return;let i=new u.CustomEvent(_.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-rendition-menu")||u.customElements.define("media-rendition-menu",ql);var ub=`<svg aria-hidden="true" viewBox="0 0 24 24">
2054
2054
  <path d="M13.5 2.5h2v6h-2v-2h-11v-2h11v-2Zm4 2h4v2h-4v-2Zm-12 4h2v6h-2v-2h-3v-2h3v-2Zm4 2h12v2h-12v-2Zm1 4h2v6h-2v-2h-8v-2h8v-2Zm4 2h7v2h-7v-2Z" />
2055
- </svg>`;function ub(){return`
2055
+ </svg>`;function hb(){return`
2056
2056
  <style>
2057
2057
  :host([aria-expanded="true"]) slot[name=tooltip] {
2058
2058
  display: none;
2059
2059
  }
2060
2060
  </style>
2061
- <slot name="icon">${cb}</slot>
2062
- `}function hb(){return b("Quality")}var xn=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",b("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ne(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return O(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){N(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return q(this,a.MEDIA_HEIGHT)}set mediaHeight(e){z(this,a.MEDIA_HEIGHT,e)}};xn.getSlotTemplateHTML=ub;xn.getTooltipContentHTML=hb;u.customElements.get("media-rendition-menu-button")||u.customElements.define("media-rendition-menu-button",xn);var Tu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$t=(i,e,t)=>(Tu(i,e,"read from private field"),t?t.call(i):e.get(i)),Ht=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},zm=(i,e,t,r)=>(Tu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),it=(i,e,t)=>(Tu(i,e,"access private method"),t),Dn,Is,Xl,br,Pn,Au,Ym,Gl,_u,zl,yu,Qm,Ql,Zl,Yl;function pb(i){return`
2061
+ <slot name="icon">${ub}</slot>
2062
+ `}function pb(){return b("Quality")}var xn=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",b("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ne(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return O(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){N(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return q(this,a.MEDIA_HEIGHT)}set mediaHeight(e){z(this,a.MEDIA_HEIGHT,e)}};xn.getSlotTemplateHTML=hb;xn.getTooltipContentHTML=pb;u.customElements.get("media-rendition-menu-button")||u.customElements.define("media-rendition-menu-button",xn);var Tu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$t=(i,e,t)=>(Tu(i,e,"read from private field"),t?t.call(i):e.get(i)),Ht=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ym=(i,e,t,r)=>(Tu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),it=(i,e,t)=>(Tu(i,e,"access private method"),t),Dn,Is,Xl,br,Pn,Au,Qm,Gl,_u,zl,yu,Zm,Ql,Zl,Yl;function mb(i){return`
2063
2063
  ${ve.getTemplateHTML(i)}
2064
2064
  <style>
2065
2065
  :host {
@@ -2073,7 +2073,7 @@ bp-player[has-error] {
2073
2073
  overflow: hidden;
2074
2074
  }
2075
2075
  </style>
2076
- `}var Cs=class extends ve{constructor(){super(),Ht(this,Is),Ht(this,br),Ht(this,Au),Ht(this,Gl),Ht(this,yu),Ht(this,Dn,!1),Ht(this,zl,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",n=it(this,Gl,_u).call(this,t);(r||n)&&($t(this,Dn)?it(this,br,Pn).call(this):it(this,yu,Qm).call(this,e))}),Ht(this,Ql,e=>{let t=e.target,r=this.contains(t),n=e.button===2,o=(t==null?void 0:t.nodeName)==="VIDEO",s=it(this,Gl,_u).call(this,t);r||n&&(o||s)||it(this,br,Pn).call(this)}),Ht(this,Zl,e=>{e.key==="Escape"&&it(this,br,Pn).call(this)}),Ht(this,Yl,e=>{var t,r;let n=e.target;if((t=n.matches)!=null&&t.call(n,'button[invoke="copy"]')){let o=(r=n.closest("media-context-menu-item"))==null?void 0:r.querySelector('input[slot="copy"]');o&&navigator.clipboard.writeText(o.value)}it(this,br,Pn).call(this)}),this.setAttribute("noautohide",""),it(this,Is,Xl).call(this)}connectedCallback(){super.connectedCallback(),ne(this).addEventListener("contextmenu",$t(this,zl)),this.addEventListener("click",$t(this,Yl))}disconnectedCallback(){super.disconnectedCallback(),ne(this).removeEventListener("contextmenu",$t(this,zl)),this.removeEventListener("click",$t(this,Yl)),document.removeEventListener("mousedown",$t(this,Ql)),document.removeEventListener("keydown",$t(this,Zl))}};Dn=new WeakMap;Is=new WeakSet;Xl=function(){this.hidden=!$t(this,Dn)};br=new WeakSet;Pn=function(){zm(this,Dn,!1),it(this,Is,Xl).call(this)};Au=new WeakSet;Ym=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&it(t=e,br,Pn).call(t)})};Gl=new WeakSet;_u=function(i){return i?i.hasAttribute("slot")&&i.getAttribute("slot")==="media"?!0:i.nodeName.includes("-")&&i.tagName.includes("-")?i.hasAttribute("src")||i.hasAttribute("poster")||i.hasAttribute("preload")||i.hasAttribute("playsinline"):!1:!1};zl=new WeakMap;yu=new WeakSet;Qm=function(i){i.preventDefault(),it(this,Au,Ym).call(this),zm(this,Dn,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,it(this,Is,Xl).call(this),document.addEventListener("mousedown",$t(this,Ql),{once:!0}),document.addEventListener("keydown",$t(this,Zl),{once:!0})};Ql=new WeakMap;Zl=new WeakMap;Yl=new WeakMap;Cs.getTemplateHTML=pb;u.customElements.get("media-context-menu")||u.customElements.define("media-context-menu",Cs);function mb(i){return`
2076
+ `}var Cs=class extends ve{constructor(){super(),Ht(this,Is),Ht(this,br),Ht(this,Au),Ht(this,Gl),Ht(this,yu),Ht(this,Dn,!1),Ht(this,zl,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",n=it(this,Gl,_u).call(this,t);(r||n)&&($t(this,Dn)?it(this,br,Pn).call(this):it(this,yu,Zm).call(this,e))}),Ht(this,Ql,e=>{let t=e.target,r=this.contains(t),n=e.button===2,o=(t==null?void 0:t.nodeName)==="VIDEO",s=it(this,Gl,_u).call(this,t);r||n&&(o||s)||it(this,br,Pn).call(this)}),Ht(this,Zl,e=>{e.key==="Escape"&&it(this,br,Pn).call(this)}),Ht(this,Yl,e=>{var t,r;let n=e.target;if((t=n.matches)!=null&&t.call(n,'button[invoke="copy"]')){let o=(r=n.closest("media-context-menu-item"))==null?void 0:r.querySelector('input[slot="copy"]');o&&navigator.clipboard.writeText(o.value)}it(this,br,Pn).call(this)}),this.setAttribute("noautohide",""),it(this,Is,Xl).call(this)}connectedCallback(){super.connectedCallback(),ne(this).addEventListener("contextmenu",$t(this,zl)),this.addEventListener("click",$t(this,Yl))}disconnectedCallback(){super.disconnectedCallback(),ne(this).removeEventListener("contextmenu",$t(this,zl)),this.removeEventListener("click",$t(this,Yl)),document.removeEventListener("mousedown",$t(this,Ql)),document.removeEventListener("keydown",$t(this,Zl))}};Dn=new WeakMap;Is=new WeakSet;Xl=function(){this.hidden=!$t(this,Dn)};br=new WeakSet;Pn=function(){Ym(this,Dn,!1),it(this,Is,Xl).call(this)};Au=new WeakSet;Qm=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&it(t=e,br,Pn).call(t)})};Gl=new WeakSet;_u=function(i){return i?i.hasAttribute("slot")&&i.getAttribute("slot")==="media"?!0:i.nodeName.includes("-")&&i.tagName.includes("-")?i.hasAttribute("src")||i.hasAttribute("poster")||i.hasAttribute("preload")||i.hasAttribute("playsinline"):!1:!1};zl=new WeakMap;yu=new WeakSet;Zm=function(i){i.preventDefault(),it(this,Au,Qm).call(this),Ym(this,Dn,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,it(this,Is,Xl).call(this),document.addEventListener("mousedown",$t(this,Ql),{once:!0}),document.addEventListener("keydown",$t(this,Zl),{once:!0})};Ql=new WeakMap;Zl=new WeakMap;Yl=new WeakMap;Cs.getTemplateHTML=mb;u.customElements.get("media-context-menu")||u.customElements.define("media-context-menu",Cs);function vb(i){return`
2077
2077
  ${ze.getTemplateHTML.call(this,i)}
2078
2078
  <style>
2079
2079
  ::slotted(*) {
@@ -2086,16 +2086,16 @@ bp-player[has-error] {
2086
2086
  min-height: var(--media-control-height, 24px);
2087
2087
  }
2088
2088
  </style>
2089
- `}var On=class extends ze{};On.shadowRootOptions={mode:"open"};On.getTemplateHTML=mb;u.customElements.get("media-context-menu-item")||u.customElements.define("media-context-menu-item",On);var vb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2089
+ `}var On=class extends ze{};On.shadowRootOptions={mode:"open"};On.getTemplateHTML=vb;u.customElements.get("media-context-menu-item")||u.customElements.define("media-context-menu-item",On);var fb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2090
2090
  <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>
2091
- </svg>`,fb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2092
- <path d="M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h18v8zM9 10v4c0 .55-.45 1-1 1H5v-2h2v-2H5v-2h3c.55 0 1 .45 1 1zm4 4h2v1h-4v-6h2v2h2v1h-2v2zm6-3v1h-2v3h-2v-6h4v2h-2z"/>
2093
2091
  </svg>`,Eb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2092
+ <path d="M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h18v8zM9 10v4c0 .55-.45 1-1 1H5v-2h2v-2H5v-2h3c.55 0 1 .45 1 1zm4 4h2v1h-4v-6h2v2h2v1h-2v2zm6-3v1h-2v3h-2v-6h4v2h-2z"/>
2093
+ </svg>`,gb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2094
2094
  <path d="M24 8.98C20.93 5.9 16.69 4 12 4S3.07 5.9 0 8.98L12 21 24 8.98zM2.92 9.07C5.51 7.08 8.67 6 12 6s6.49 1.08 9.08 3.07l-1.43 1.43C17.5 8.94 14.86 8 12 8s-5.5.94-7.65 2.51L2.92 9.07zM12 18l-6.36-6.36C7.34 10.27 9.58 9.5 12 9.5s4.66.77 6.36 2.14L12 18z"/>
2095
2095
  <line x1="2" y1="2" x2="22" y2="22" stroke="currentColor" stroke-width="2"/>
2096
- </svg>`,gb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2096
+ </svg>`,bb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2097
2097
  <path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>
2098
- </svg>`;function bb(i){switch(i){case"offline":return fb;case"network":return Eb;case"security":return gb;default:return vb}}function _b(i){switch(i){case"offline":return"Stream Unavailable";case"network":return"Connection Error";case"security":return"Access Denied";case"autoplay":return"Playback Blocked";case"media":return"Playback Error";case"setup":return"Configuration Error";default:return"An error occurred"}}var Yt=class extends Oe{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=bb(t),n=_b(t);return Ze`
2098
+ </svg>`;function _b(i){switch(i){case"offline":return Eb;case"network":return gb;case"security":return bb;default:return fb}}function yb(i){switch(i){case"offline":return"Stream Unavailable";case"network":return"Connection Error";case"security":return"Access Denied";case"autoplay":return"Playback Blocked";case"media":return"Playback Error";case"setup":return"Configuration Error";default:return"An error occurred"}}var Yt=class extends Oe{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=_b(t),n=yb(t);return Ze`
2099
2099
  <div part="icon">
2100
2100
  <slot name="icon">${this.renderIcon(r)}</slot>
2101
2101
  </div>
@@ -2174,7 +2174,7 @@ bp-player[has-error] {
2174
2174
  [part="actions"] button {
2175
2175
  cursor: pointer;
2176
2176
  }
2177
- `,B([Z({type:Object})],Yt.prototype,"error",2),B([Z({type:Boolean})],Yt.prototype,"showCode",2),Yt=B([oi("bp-error-display")],Yt);var Zm=`/**
2177
+ `,B([Z({type:Object})],Yt.prototype,"error",2),B([Z({type:Boolean})],Yt.prototype,"showCode",2),Yt=B([oi("bp-error-display")],Yt);var Xm=`/**
2178
2178
  * BP Default UI Styles
2179
2179
  *
2180
2180
  * Layer-based architecture.
@@ -2714,7 +2714,7 @@ bp-default-ui[scaling="crop"] media-poster-image {
2714
2714
  bp-default-ui[scaling="fill"] media-poster-image {
2715
2715
  --media-object-fit: fill;
2716
2716
  }
2717
- `;var Xm=!1;function Tb(){if(Xm||(Xm=!0,document.getElementById("bp-default-ui-styles")))return;Hr();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=Zm,document.head.appendChild(i)}var de=class extends Oe{constructor(){super(...arguments);this.autoplay=!1;this.muted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this.autohide=2;this.hotkeys=!0;this.mobile=!1;this.live=!1;this.fluid=!1;this._player=null;this._providerType=null;this._error=null;this._connectionState="idle";this._showEndedOverlay=!1;this._cleanupListeners=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Tb(),this.detectMobile()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupListeners.forEach(t=>t()),this._cleanupListeners=[]}get player(){return this._player}get mediaController(){return this.querySelector("media-controller")}get bpLive(){var t;return((t=this._player)==null?void 0:t.bpLive)??null}detectMobile(){let t=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.mobile=t}_getPoster(){var t;return((t=this.source)==null?void 0:t.poster)??this.poster??null}firstUpdated(t){super.firstUpdated(t),this.setupPlayer(),this._moveSlottedContent()}willUpdate(t){super.willUpdate(t),t.has("source")&&(this._applySourceHints(),this._error=null,this._showEndedOverlay=!1,_e(this,"has-error",!1))}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug)}_applySourceHints(){var r;let t=(r=this.source)==null?void 0:r.sources;if(t){for(let n of t)if(Gs(n)){if("clipId"in n){if(this.setAttribute("content-type","clip"),this.fluid&&n.preferredOrientation){let o=n.preferredOrientation==="portrait";this.style.setProperty("--bp-video-width",o?"9":"16"),this.style.setProperty("--bp-video-height",o?"16":"9")}}else this.setAttribute("content-type","stream");return}this.setAttribute("content-type","video")}}_updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r))):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"))}_clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}_moveSlottedContent(){let t=this.querySelector("media-controller");if(!t)return;let r=[{from:"top-chrome",to:"top-chrome",marker:"has-custom-top-chrome"},{from:"centered-chrome",to:"centered-chrome",marker:"has-custom-centered-chrome"},{from:"middle-chrome",to:"middle-chrome",marker:"has-custom-middle-chrome"},{from:"bottom-chrome",to:null,marker:"has-custom-bottom-chrome"}];for(let{from:n,to:o,marker:s}of r){let l=this.querySelectorAll(`:scope > [slot="${n}"]`);l.length>0&&this.setAttribute(s,""),l.forEach(d=>{d.parentElement!==t&&(o?d.setAttribute("slot",o):d.removeAttribute("slot"),t.appendChild(d))})}}setupPlayer(){let t=this.querySelector("bp-player");if(!t)return;let r=n=>{n.stopPropagation(),this._player=n.detail,this.setupPlayerListeners(),this.dispatchEvent(Qi(ko,{detail:this._player})),this.requestUpdate()};t.addEventListener("ready",r),this._cleanupListeners.push(()=>t.removeEventListener("ready",r))}setupPlayerListeners(){if(!this._player)return;let t=()=>{var f;let p=((f=this._player)==null?void 0:f.state.error)??null;this._error=p;let g=p!==null&&p.fatal&&p.category!=="offline";_e(this,"has-error",g)},r=()=>{var g;let p=(g=this._player)==null?void 0:g.state;if(p&&(this._connectionState=p.connectionState,this._providerType=p.providerType,this.live=p.streamType==="live",this.setAttribute("content-type",p.contentType),this.setAttribute("stream-type",p.streamType),_e(this,"paused",p.paused),_e(this,"ended",p.ended),_e(this,"waiting",p.waiting),p.error!==this._error)){this._error=p.error;let f=p.error!==null&&p.error.fatal&&p.error.category!=="offline";_e(this,"has-error",f)}},n=()=>{this._error=null,this._showEndedOverlay=!1,_e(this,"has-error",!1)},o=()=>{this.live&&(this._showEndedOverlay=!0)},s=()=>{this._error=null,this._showEndedOverlay=!1,_e(this,"has-error",!1)},l=p=>{this.debug&&console.log("[BPDefaultUI] updateVideoDimensions called",{fluid:this.fluid,...p}),this.fluid&&(this._updateVideoDimensions(p.videoWidth,p.videoHeight),this.debug&&console.log("[BPDefaultUI] Set video dimensions:",{width:p.videoWidth,height:p.videoHeight}))};this._player.addEventListener("error",t),this._player.addEventListener("statechange",r),this._player.addEventListener("playing",n),this._player.addEventListener("ended",o),this._player.addEventListener("sourcechange",s),this._player.addEventListener("resize",l),this._player.addEventListener("loadedmetadata",l);let{videoWidth:d,videoHeight:h}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:d,videoHeight:h,fluid:this.fluid}),d>0&&h>0&&l({videoWidth:d,videoHeight:h}),this._cleanupListeners.push(()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("error",t)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("statechange",r)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("playing",n)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("ended",o)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("sourcechange",s)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("resize",l)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?Ze`
2717
+ `;var jm=!1;function Ab(){if(jm||(jm=!0,document.getElementById("bp-default-ui-styles")))return;Hr();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=Xm,document.head.appendChild(i)}var de=class extends Oe{constructor(){super(...arguments);this.autoplay=!1;this.muted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this.autohide=2;this.hotkeys=!0;this.mobile=!1;this.live=!1;this.fluid=!1;this._player=null;this._providerType=null;this._error=null;this._connectionState="idle";this._showEndedOverlay=!1;this._cleanupListeners=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Ab(),this.detectMobile()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupListeners.forEach(t=>t()),this._cleanupListeners=[]}get player(){return this._player}get mediaController(){return this.querySelector("media-controller")}get bpLive(){var t;return((t=this._player)==null?void 0:t.bpLive)??null}detectMobile(){let t=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.mobile=t}_getPoster(){var t;return((t=this.source)==null?void 0:t.poster)??this.poster??null}firstUpdated(t){super.firstUpdated(t),this.setupPlayer(),this._moveSlottedContent()}willUpdate(t){super.willUpdate(t),t.has("source")&&(this._applySourceHints(),this._error=null,this._showEndedOverlay=!1,_e(this,"has-error",!1))}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug)}_applySourceHints(){var r;let t=(r=this.source)==null?void 0:r.sources;if(t){for(let n of t)if(Gs(n)){if("clipId"in n){if(this.setAttribute("content-type","clip"),this.fluid&&n.preferredOrientation){let o=n.preferredOrientation==="portrait";this.style.setProperty("--bp-video-width",o?"9":"16"),this.style.setProperty("--bp-video-height",o?"16":"9")}}else this.setAttribute("content-type","stream");return}this.setAttribute("content-type","video")}}_updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r))):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"))}_clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}_moveSlottedContent(){let t=this.querySelector("media-controller");if(!t)return;let r=[{from:"top-chrome",to:"top-chrome",marker:"has-custom-top-chrome"},{from:"centered-chrome",to:"centered-chrome",marker:"has-custom-centered-chrome"},{from:"middle-chrome",to:"middle-chrome",marker:"has-custom-middle-chrome"},{from:"bottom-chrome",to:null,marker:"has-custom-bottom-chrome"}];for(let{from:n,to:o,marker:s}of r){let l=this.querySelectorAll(`:scope > [slot="${n}"]`);l.length>0&&this.setAttribute(s,""),l.forEach(d=>{d.parentElement!==t&&(o?d.setAttribute("slot",o):d.removeAttribute("slot"),t.appendChild(d))})}}setupPlayer(){let t=this.querySelector("bp-player");if(!t)return;let r=n=>{n.stopPropagation(),this._player=n.detail,this.setupPlayerListeners(),this.dispatchEvent(Qi(ko,{detail:this._player})),this.requestUpdate()};t.addEventListener("ready",r),this._cleanupListeners.push(()=>t.removeEventListener("ready",r))}setupPlayerListeners(){if(!this._player)return;let t=()=>{var f;let p=((f=this._player)==null?void 0:f.state.error)??null;this._error=p;let g=p!==null&&p.fatal&&p.category!=="offline";_e(this,"has-error",g)},r=()=>{var g;let p=(g=this._player)==null?void 0:g.state;if(p&&(this._connectionState=p.connectionState,this._providerType=p.providerType,this.live=p.streamType==="live",this.setAttribute("content-type",p.contentType),this.setAttribute("stream-type",p.streamType),_e(this,"paused",p.paused),_e(this,"ended",p.ended),_e(this,"waiting",p.waiting),p.error!==this._error)){this._error=p.error;let f=p.error!==null&&p.error.fatal&&p.error.category!=="offline";_e(this,"has-error",f)}},n=()=>{this._error=null,this._showEndedOverlay=!1,_e(this,"has-error",!1)},o=()=>{this.live&&(this._showEndedOverlay=!0)},s=()=>{this._error=null,this._showEndedOverlay=!1,_e(this,"has-error",!1)},l=p=>{this.debug&&console.log("[BPDefaultUI] updateVideoDimensions called",{fluid:this.fluid,...p}),this.fluid&&(this._updateVideoDimensions(p.videoWidth,p.videoHeight),this.debug&&console.log("[BPDefaultUI] Set video dimensions:",{width:p.videoWidth,height:p.videoHeight}))};this._player.addEventListener("error",t),this._player.addEventListener("statechange",r),this._player.addEventListener("playing",n),this._player.addEventListener("ended",o),this._player.addEventListener("sourcechange",s),this._player.addEventListener("resize",l),this._player.addEventListener("loadedmetadata",l);let{videoWidth:d,videoHeight:h}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:d,videoHeight:h,fluid:this.fluid}),d>0&&h>0&&l({videoWidth:d,videoHeight:h}),this._cleanupListeners.push(()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("error",t)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("statechange",r)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("playing",n)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("ended",o)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("sourcechange",s)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("resize",l)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?Ze`
2718
2718
  <media-control-bar>
2719
2719
  <media-play-button notooltip clip-hidden></media-play-button>
2720
2720
  <media-live-button notooltip vod-hidden clip-hidden></media-live-button>
@@ -2743,7 +2743,7 @@ bp-default-ui[scaling="fill"] media-poster-image {
2743
2743
  `}render(){return Ze`
2744
2744
  <!-- Chrome Layer: media-controller with all controls -->
2745
2745
  <div class="bp-layer bp-chrome-layer">
2746
- <media-controller autohide="${this.autohide}" ?hotkeys="${this.hotkeys}">
2746
+ <media-controller autohide="${this.autohide}" ?nohotkeys="${this.hotkeys===!1}">
2747
2747
  <bp-player
2748
2748
  slot="media"
2749
2749
  .source="${this.source}"
@@ -2789,19 +2789,19 @@ bp-default-ui[scaling="fill"] media-poster-image {
2789
2789
  <div class="bp-layer bp-error-layer">
2790
2790
  <bp-error-display .error="${this._error}" ?showCode="${this.debug}"></bp-error-display>
2791
2791
  </div>
2792
- `}};B([Z({converter:$r()})],de.prototype,"source",2),B([Z({type:Boolean})],de.prototype,"autoplay",2),B([Z({type:Boolean})],de.prototype,"muted",2),B([Z({type:Boolean})],de.prototype,"loop",2),B([Z({type:String})],de.prototype,"poster",2),B([Z({type:String,reflect:!0})],de.prototype,"scaling",2),B([Z({type:String,attribute:"aspect-ratio"})],de.prototype,"aspectRatio",2),B([Z({converter:$r()})],de.prototype,"config",2),B([Z({type:Boolean})],de.prototype,"debug",2),B([Z({type:Number})],de.prototype,"autohide",2),B([Z({type:Boolean})],de.prototype,"hotkeys",2),B([Z({type:Boolean,reflect:!0})],de.prototype,"mobile",2),B([Z({type:Boolean,reflect:!0})],de.prototype,"live",2),B([Z({type:Boolean,reflect:!0})],de.prototype,"fluid",2),B([si()],de.prototype,"_player",2),B([si()],de.prototype,"_providerType",2),B([si()],de.prototype,"_error",2),B([si()],de.prototype,"_connectionState",2),B([si()],de.prototype,"_showEndedOverlay",2),de=B([oi("bp-default-ui")],de);var Ab=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2792
+ `}};B([Z({converter:$r()})],de.prototype,"source",2),B([Z({type:Boolean})],de.prototype,"autoplay",2),B([Z({type:Boolean})],de.prototype,"muted",2),B([Z({type:Boolean})],de.prototype,"loop",2),B([Z({type:String})],de.prototype,"poster",2),B([Z({type:String,reflect:!0})],de.prototype,"scaling",2),B([Z({type:String,attribute:"aspect-ratio"})],de.prototype,"aspectRatio",2),B([Z({converter:$r()})],de.prototype,"config",2),B([Z({type:Boolean})],de.prototype,"debug",2),B([Z({type:Number})],de.prototype,"autohide",2),B([Z({converter:xh()})],de.prototype,"hotkeys",2),B([Z({type:Boolean,reflect:!0})],de.prototype,"mobile",2),B([Z({type:Boolean,reflect:!0})],de.prototype,"live",2),B([Z({type:Boolean,reflect:!0})],de.prototype,"fluid",2),B([si()],de.prototype,"_player",2),B([si()],de.prototype,"_providerType",2),B([si()],de.prototype,"_error",2),B([si()],de.prototype,"_connectionState",2),B([si()],de.prototype,"_showEndedOverlay",2),de=B([oi("bp-default-ui")],de);var Sb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2793
2793
  <circle cx="12" cy="12" r="10" stroke-opacity="0.25"/>
2794
2794
  <path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round">
2795
2795
  <animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/>
2796
2796
  </path>
2797
- </svg>`,Sb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2797
+ </svg>`,kb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2798
2798
  <path d="M21 6H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H3V8h18v8z"/>
2799
2799
  <circle cx="12" cy="12" r="3" fill="currentColor"/>
2800
- </svg>`,kb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2801
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
2802
2800
  </svg>`,Lb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2801
+ <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
2802
+ </svg>`,wb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2803
2803
  <path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/>
2804
- </svg>`,Vt=class extends Oe{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return Ab;case"offline":return Sb;case"ended":return this.live?kb:Lb;default:return""}}getDefaultMessage(){switch(this.type){case"loading":return"Loading...";case"offline":return"The live stream hasn't started yet";case"ended":return this.live?"Stream has ended":"Replay";default:return""}}render(){if(this.type==="none")return null;let t=this.getIcon(),r=this.getDefaultMessage();return Ze`
2804
+ </svg>`,Vt=class extends Oe{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return Sb;case"offline":return kb;case"ended":return this.live?Lb:wb;default:return""}}getDefaultMessage(){switch(this.type){case"loading":return"Loading...";case"offline":return"The live stream hasn't started yet";case"ended":return this.live?"Stream has ended":"Replay";default:return""}}render(){if(this.type==="none")return null;let t=this.getIcon(),r=this.getDefaultMessage();return Ze`
2805
2805
  <div part="icon">
2806
2806
  <slot name="icon">${this.renderIcon(t)}</slot>
2807
2807
  </div>
@@ -2882,7 +2882,7 @@ bp-default-ui[scaling="fill"] media-poster-image {
2882
2882
  :host([button-mode]) [part="submessage"] {
2883
2883
  display: none;
2884
2884
  }
2885
- `,B([Z({type:String,reflect:!0})],Vt.prototype,"type",2),B([Z({type:Boolean,reflect:!0})],Vt.prototype,"live",2),B([Z({type:Boolean,reflect:!0,attribute:"button-mode"})],Vt.prototype,"buttonMode",2),Vt=B([oi("bp-overlay")],Vt);var wb=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],jm=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function Ib(i){return`
2885
+ `,B([Z({type:String,reflect:!0})],Vt.prototype,"type",2),B([Z({type:Boolean,reflect:!0})],Vt.prototype,"live",2),B([Z({type:Boolean,reflect:!0,attribute:"button-mode"})],Vt.prototype,"buttonMode",2),Vt=B([oi("bp-overlay")],Vt);var Ib=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],Jm=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function Cb(i){return`
2886
2886
  <style>
2887
2887
  :host {
2888
2888
  display: inline-flex;
@@ -2896,10 +2896,10 @@ bp-default-ui[scaling="fill"] media-poster-image {
2896
2896
  }
2897
2897
  </style>
2898
2898
  <slot name="media">
2899
- <audio${nv(i)}></audio>
2899
+ <audio${ov(i)}></audio>
2900
2900
  </slot>
2901
2901
  <slot></slot>
2902
- `}function Cb(i){return`
2902
+ `}function Rb(i){return`
2903
2903
  <style>
2904
2904
  :host {
2905
2905
  display: inline-block;
@@ -2921,25 +2921,25 @@ bp-default-ui[scaling="fill"] media-poster-image {
2921
2921
  }
2922
2922
  </style>
2923
2923
  <slot name="media">
2924
- <video${nv(i)}></video>
2924
+ <video${ov(i)}></video>
2925
2925
  </slot>
2926
2926
  <slot></slot>
2927
- `}function rv(i,{tag:e,is:t}){var o,s,l,d,h,Jm,g,f,E,T,v,_r,Su,ev,ku,tv,iv;let r=(s=(o=globalThis.document)==null?void 0:o.createElement)==null?void 0:s.call(o,e,{is:t}),n=r?Rb(r):[];return l=class extends i{constructor(){super(...arguments);k(this,v);k(this,g,!1);k(this,f,null);k(this,E,new Map);k(this,T);G(this,"get");G(this,"set");G(this,"call")}static get observedAttributes(){var $,ue;return C($=l,h,Jm).call($),[...((ue=r==null?void 0:r.constructor)==null?void 0:ue.observedAttributes)??[],...jm]}get nativeEl(){var L;return C(this,v,_r).call(this),c(this,f)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((L=this.shadowRoot)==null?void 0:L.querySelector(e))??null}set nativeEl(L){m(this,f,L)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(L){this.toggleAttribute("muted",L)}get src(){return this.getAttribute("src")}set src(L){this.setAttribute("src",`${L}`)}get preload(){var L;return this.getAttribute("preload")??((L=this.nativeEl)==null?void 0:L.preload)}set preload(L){this.setAttribute("preload",`${L}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let L=Mb(this.attributes);t&&(L.is=t),e&&(L.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(L)}this.nativeEl.muted=this.hasAttribute("muted");for(let L of n)C(this,v,tv).call(this,L);m(this,T,new MutationObserver(C(this,v,ev).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>C(this,v,Su).call(this)),C(this,v,Su).call(this);for(let L of this.constructor.Events)this.shadowRoot.addEventListener(L,this,!0)}handleEvent(L){L.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(L.type,{detail:L.detail}))}attributeChangedCallback(L,$,ue){C(this,v,_r).call(this),C(this,v,iv).call(this,L,$,ue)}connectedCallback(){C(this,v,_r).call(this)}},d=new WeakMap,h=new WeakSet,Jm=function(){if(c(this,d))return;m(this,d,!0);let L=new Set(this.observedAttributes);L.delete("muted");for(let $ of n)if(!($ in this.prototype))if(typeof r[$]=="function")this.prototype[$]=function(...ue){return C(this,v,_r).call(this),(()=>{var K;if(this.call)return this.call($,...ue);let Q=(K=this.nativeEl)==null?void 0:K[$];return Q==null?void 0:Q.apply(this.nativeEl,ue)})()};else{let ue={get(){var Q,K;C(this,v,_r).call(this);let re=$.toLowerCase();if(L.has(re)){let Qe=this.getAttribute(re);return Qe===null?!1:Qe===""?!0:Qe}return((Q=this.get)==null?void 0:Q.call(this,$))??((K=this.nativeEl)==null?void 0:K[$])}};$!==$.toUpperCase()&&(ue.set=function(re){C(this,v,_r).call(this);let Q=$.toLowerCase();if(L.has(Q)){re===!0||re===!1||re==null?this.toggleAttribute(Q,!!re):this.setAttribute(Q,re);return}if(this.set){this.set($,re);return}this.nativeEl&&(this.nativeEl[$]=re)}),Object.defineProperty(this.prototype,$,ue)}},g=new WeakMap,f=new WeakMap,E=new WeakMap,T=new WeakMap,v=new WeakSet,_r=function(){c(this,g)||(m(this,g,!0),this.init())},Su=function(){var re;let L=new Map(c(this,E)),$=(re=this.shadowRoot)==null?void 0:re.querySelector("slot:not([name])");($==null?void 0:$.assignedElements({flatten:!0}).filter(Q=>["track","source"].includes(Q.localName))).forEach(Q=>{var Qe,eo;L.delete(Q);let K=c(this,E).get(Q);K||(K=Q.cloneNode(),c(this,E).set(Q,K),(Qe=c(this,T))==null||Qe.observe(Q,{attributes:!0})),(eo=this.nativeEl)==null||eo.append(K),C(this,v,ku).call(this,K)}),L.forEach((Q,K)=>{Q.remove(),c(this,E).delete(K)})},ev=function(L){for(let $ of L)if($.type==="attributes"){let{target:ue,attributeName:re}=$,Q=c(this,E).get(ue);Q&&re&&(Q.setAttribute(re,ue.getAttribute(re)??""),C(this,v,ku).call(this,Q))}},ku=function(L){L&&L.localName==="track"&&L.default&&(L.kind==="chapters"||L.kind==="metadata")&&L.track.mode==="disabled"&&(L.track.mode="hidden")},tv=function(L){if(Object.prototype.hasOwnProperty.call(this,L)){let $=this[L];delete this[L],this[L]=$}},iv=function(L,$,ue){var re,Q,K;["id","class"].includes(L)||!l.observedAttributes.includes(L)&&this.constructor.observedAttributes.includes(L)||(ue===null?(re=this.nativeEl)==null||re.removeAttribute(L):((Q=this.nativeEl)==null?void 0:Q.getAttribute(L))!==ue&&((K=this.nativeEl)==null||K.setAttribute(L,ue)))},k(l,h),G(l,"getTemplateHTML",e.endsWith("audio")?Ib:Cb),G(l,"shadowRootOptions",{mode:"open"}),G(l,"Events",wb),k(l,d,!1),l}function Rb(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function nv(i){let e="";for(let t in i){if(!jm.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function Mb(i){let e={};for(let t of i)e[t.name]=t.value;return e}var We=rv(globalThis.HTMLElement??class{},{tag:"video"}),vC=rv(globalThis.HTMLElement??class{},{tag:"audio"});var Qt=class extends Event{constructor(t,r){super(t);G(this,"track");this.track=r.track}};var Lu=new WeakMap;function w(i){return Lu.get(i)??xb(i,{})}function xb(i,e){let t=Lu.get(i);return t||Lu.set(i,t={}),Object.assign(t,e)}function jl(i,e){let t=i.videoTracks;w(e).media=i,w(e).renditionSet||(w(e).renditionSet=new Set);let r=w(t).trackSet;r.add(e);let n=r.size-1;n in Tr.prototype||Object.defineProperty(Tr.prototype,n,{get(){return[...w(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Qt("addtrack",{track:e}))})}function Jl(i){var r;let e=(r=w(i).media)==null?void 0:r.videoTracks;if(!e)return;w(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Qt("removetrack",{track:i}))})}function ov(i){let e=w(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(w(e).changeRequested)return;w(e).changeRequested=!0,queueMicrotask(()=>{delete w(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var Ai,Si,ki,yr,Rs,Tr=class extends EventTarget{constructor(){super();k(this,yr);k(this,Ai);k(this,Si);k(this,ki);w(this).trackSet=new Set}[Symbol.iterator](){return c(this,yr,Rs).values()}get length(){return c(this,yr,Rs).size}getTrackById(t){return[...c(this,yr,Rs)].find(r=>r.id===t)??null}get selectedIndex(){return[...c(this,yr,Rs)].findIndex(t=>t.selected)}get onaddtrack(){return c(this,Ai)}set onaddtrack(t){c(this,Ai)&&(this.removeEventListener("addtrack",c(this,Ai)),m(this,Ai,void 0)),typeof t=="function"&&(m(this,Ai,t),this.addEventListener("addtrack",t))}get onremovetrack(){return c(this,Si)}set onremovetrack(t){c(this,Si)&&(this.removeEventListener("removetrack",c(this,Si)),m(this,Si,void 0)),typeof t=="function"&&(m(this,Si,t),this.addEventListener("removetrack",t))}get onchange(){return c(this,ki)}set onchange(t){c(this,ki)&&(this.removeEventListener("change",c(this,ki)),m(this,ki,void 0)),typeof t=="function"&&(m(this,ki,t),this.addEventListener("change",t))}};Ai=new WeakMap,Si=new WeakMap,ki=new WeakMap,yr=new WeakSet,Rs=function(){return w(this).trackSet};var Zt=class extends Event{constructor(t,r){super(t);G(this,"rendition");this.rendition=r.rendition}};function sv(i,e){let t=w(i).media.videoRenditions;w(e).media=w(i).media,w(e).track=i;let r=w(i).renditionSet;r.add(e);let n=r.size-1;n in Ar.prototype||Object.defineProperty(Ar.prototype,n,{get(){return Nn(this)[n]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Zt("addrendition",{rendition:e}))})}function av(i){let e=w(i).media.videoRenditions,t=w(i).track;w(t).renditionSet.delete(i),queueMicrotask(()=>{w(i).track.selected&&e.dispatchEvent(new Zt("removerendition",{rendition:i}))})}function lv(i){let e=w(i).media.videoRenditions;!e||w(e).changeRequested||(w(e).changeRequested=!0,queueMicrotask(()=>{delete w(e).changeRequested,w(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Nn(i){return[...w(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...w(t).renditionSet])}var Li,wi,Ii,Ar=class extends EventTarget{constructor(){super(...arguments);k(this,Li);k(this,wi);k(this,Ii)}[Symbol.iterator](){return Nn(this).values()}get length(){return Nn(this).length}getRenditionById(t){return Nn(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Nn(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of Nn(this).entries())n.selected=r===t}get onaddrendition(){return c(this,Li)}set onaddrendition(t){c(this,Li)&&(this.removeEventListener("addrendition",c(this,Li)),m(this,Li,void 0)),typeof t=="function"&&(m(this,Li,t),this.addEventListener("addrendition",t))}get onremoverendition(){return c(this,wi)}set onremoverendition(t){c(this,wi)&&(this.removeEventListener("removerendition",c(this,wi)),m(this,wi,void 0)),typeof t=="function"&&(m(this,wi,t),this.addEventListener("removerendition",t))}get onchange(){return c(this,Ii)}set onchange(t){c(this,Ii)&&(this.removeEventListener("change",c(this,Ii)),m(this,Ii,void 0)),typeof t=="function"&&(m(this,Ii,t),this.addEventListener("change",t))}};Li=new WeakMap,wi=new WeakMap,Ii=new WeakMap;var Un,Ms=class{constructor(){G(this,"src");G(this,"id");G(this,"width");G(this,"height");G(this,"bitrate");G(this,"frameRate");G(this,"codec");k(this,Un,!1)}get selected(){return c(this,Un)}set selected(e){c(this,Un)!==e&&(m(this,Un,e),lv(this))}};Un=new WeakMap;var Hn,$n=class{constructor(){G(this,"id");G(this,"kind");G(this,"label","");G(this,"language","");G(this,"sourceBuffer");k(this,Hn,!1)}addRendition(e,t,r,n,o,s){let l=new Ms;return l.src=e,l.width=t,l.height=r,l.frameRate=s,l.bitrate=o,l.codec=n,sv(this,l),l}removeRendition(e){av(e)}get selected(){return c(this,Hn)}set selected(e){c(this,Hn)!==e&&(m(this,Hn,e),e===!0&&ov(this))}};Hn=new WeakMap;function dv(i,e){let t=w(i).media.audioRenditions;w(e).media=w(i).media,w(e).track=i;let r=w(i).renditionSet;r.add(e);let n=r.size-1;n in Sr.prototype||Object.defineProperty(Sr.prototype,n,{get(){return Vn(this)[n]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Zt("addrendition",{rendition:e}))})}function cv(i){let e=w(i).media.audioRenditions,t=w(i).track;w(t).renditionSet.delete(i),queueMicrotask(()=>{w(i).track.enabled&&e.dispatchEvent(new Zt("removerendition",{rendition:i}))})}function uv(i){let e=w(i).media.audioRenditions;!e||w(e).changeRequested||(w(e).changeRequested=!0,queueMicrotask(()=>{delete w(e).changeRequested,w(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Vn(i){return[...w(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...w(t).renditionSet])}var Ci,Ri,Mi,Sr=class extends EventTarget{constructor(){super(...arguments);k(this,Ci);k(this,Ri);k(this,Mi)}[Symbol.iterator](){return Vn(this).values()}get length(){return Vn(this).length}getRenditionById(t){return Vn(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Vn(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of Vn(this).entries())n.selected=r===t}get onaddrendition(){return c(this,Ci)}set onaddrendition(t){c(this,Ci)&&(this.removeEventListener("addrendition",c(this,Ci)),m(this,Ci,void 0)),typeof t=="function"&&(m(this,Ci,t),this.addEventListener("addrendition",t))}get onremoverendition(){return c(this,Ri)}set onremoverendition(t){c(this,Ri)&&(this.removeEventListener("removerendition",c(this,Ri)),m(this,Ri,void 0)),typeof t=="function"&&(m(this,Ri,t),this.addEventListener("removerendition",t))}get onchange(){return c(this,Mi)}set onchange(t){c(this,Mi)&&(this.removeEventListener("change",c(this,Mi)),m(this,Mi,void 0)),typeof t=="function"&&(m(this,Mi,t),this.addEventListener("change",t))}};Ci=new WeakMap,Ri=new WeakMap,Mi=new WeakMap;var Bn,xs=class{constructor(){G(this,"src");G(this,"id");G(this,"bitrate");G(this,"codec");k(this,Bn,!1)}get selected(){return c(this,Bn)}set selected(e){c(this,Bn)!==e&&(m(this,Bn,e),uv(this))}};Bn=new WeakMap;function td(i,e){let t=i.audioTracks;w(e).media=i,w(e).renditionSet||(w(e).renditionSet=new Set);let r=w(t).trackSet;r.add(e);let n=r.size-1;n in kr.prototype||Object.defineProperty(kr.prototype,n,{get(){return[...w(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Qt("addtrack",{track:e}))})}function id(i){var r;let e=(r=w(i).media)==null?void 0:r.audioTracks;if(!e)return;w(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Qt("removetrack",{track:i}))})}function hv(i){let e=w(i).media.audioTracks;!e||w(e).changeRequested||(w(e).changeRequested=!0,queueMicrotask(()=>{delete w(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var xi,Pi,Di,Wn,ed,kr=class extends EventTarget{constructor(){super();k(this,Wn);k(this,xi);k(this,Pi);k(this,Di);w(this).trackSet=new Set}[Symbol.iterator](){return c(this,Wn,ed).values()}get length(){return c(this,Wn,ed).size}getTrackById(t){return[...c(this,Wn,ed)].find(r=>r.id===t)??null}get onaddtrack(){return c(this,xi)}set onaddtrack(t){c(this,xi)&&(this.removeEventListener("addtrack",c(this,xi)),m(this,xi,void 0)),typeof t=="function"&&(m(this,xi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return c(this,Pi)}set onremovetrack(t){c(this,Pi)&&(this.removeEventListener("removetrack",c(this,Pi)),m(this,Pi,void 0)),typeof t=="function"&&(m(this,Pi,t),this.addEventListener("removetrack",t))}get onchange(){return c(this,Di)}set onchange(t){c(this,Di)&&(this.removeEventListener("change",c(this,Di)),m(this,Di,void 0)),typeof t=="function"&&(m(this,Di,t),this.addEventListener("change",t))}};xi=new WeakMap,Pi=new WeakMap,Di=new WeakMap,Wn=new WeakSet,ed=function(){return w(this).trackSet};var Fn,Kn=class{constructor(){G(this,"id");G(this,"kind");G(this,"label","");G(this,"language","");G(this,"sourceBuffer");k(this,Fn,!1)}addRendition(e,t,r){let n=new xs;return n.src=e,n.codec=t,n.bitrate=r,dv(this,n),n}removeRendition(e){cv(e)}get enabled(){return c(this,Fn)}set enabled(e){c(this,Fn)!==e&&(m(this,Fn,e),hv(this))}};Fn=new WeakMap;var pv=rd(globalThis.HTMLMediaElement,"video"),mv=rd(globalThis.HTMLMediaElement,"audio");function qn(i){if(!(i!=null&&i.prototype))return i;let e=rd(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return Pb(this)}});let t=rd(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return Db(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(o,s="",l=""){let d=new $n;return d.kind=o,d.label=s,d.language=l,jl(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=Jl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(o,s="",l=""){let d=new Kn;return d.kind=o,d.label=s,d.language=l,td(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=id),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=o=>{let s=w(o).videoRenditions;return s||(s=new Ar,w(s).media=o,w(o).videoRenditions=s),s};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return n(this)}});let n=o=>{let s=w(o).audioRenditions;return s||(s=new Sr,w(s).media=o,w(o).audioRenditions=s),s};return i}function rd(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function Pb(i){let e=w(i).videoTracks;if(!e&&(e=new Tr,w(i).videoTracks=e,pv)){let t=pv.call(i.nativeEl??i);for(let r of t)jl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof $n)){for(let n of t)Jl(n);return}jl(i,r.track)}),t.addEventListener("removetrack",r=>{Jl(r.track)})}return e}function Db(i){let e=w(i).audioTracks;if(!e&&(e=new kr,w(i).audioTracks=e,mv)){let t=mv.call(i.nativeEl??i);for(let r of t)td(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof Kn)){for(let n of t)id(n);return}td(i,r.track)}),t.addEventListener("removetrack",r=>{id(r.track)})}return e}var be=Vv(rh("hls.js"),1);var Ob={[be.default.ErrorTypes.NETWORK_ERROR]:Xe.network,[be.default.ErrorTypes.MEDIA_ERROR]:Xe.media,[be.default.ErrorTypes.KEY_SYSTEM_ERROR]:Xe.keySystem},Nb=3e3,Ub=qn(We),Xt,jt,Jt,Oi,Gn,rt,wu,vv,Iu,Ps,fv,Ni=class extends Ub{constructor(){super();k(this,rt);k(this,Xt,null);k(this,jt,null);k(this,Jt,null);k(this,Oi,null);k(this,Gn,!1);this.api=null;k(this,Ps,()=>{var r,n;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(n=this.api)==null||n.startLoad()});C(this,rt,fv).call(this,"config"),this.addEventListener("waiting",()=>{c(this,Oi)&&this.dispatchEvent(Ne(new Error(c(this,Oi).message),c(this,Oi).code))})}static getTemplateHTML(t,r={}){let{src:n,...o}=t;return`
2927
+ `}function nv(i,{tag:e,is:t}){var o,s,l,d,h,ev,g,f,E,T,v,_r,Su,tv,ku,iv,rv;let r=(s=(o=globalThis.document)==null?void 0:o.createElement)==null?void 0:s.call(o,e,{is:t}),n=r?Mb(r):[];return l=class extends i{constructor(){super(...arguments);k(this,v);k(this,g,!1);k(this,f,null);k(this,E,new Map);k(this,T);G(this,"get");G(this,"set");G(this,"call")}static get observedAttributes(){var $,ue;return C($=l,h,ev).call($),[...((ue=r==null?void 0:r.constructor)==null?void 0:ue.observedAttributes)??[],...Jm]}get nativeEl(){var L;return C(this,v,_r).call(this),c(this,f)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((L=this.shadowRoot)==null?void 0:L.querySelector(e))??null}set nativeEl(L){m(this,f,L)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(L){this.toggleAttribute("muted",L)}get src(){return this.getAttribute("src")}set src(L){this.setAttribute("src",`${L}`)}get preload(){var L;return this.getAttribute("preload")??((L=this.nativeEl)==null?void 0:L.preload)}set preload(L){this.setAttribute("preload",`${L}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let L=xb(this.attributes);t&&(L.is=t),e&&(L.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(L)}this.nativeEl.muted=this.hasAttribute("muted");for(let L of n)C(this,v,iv).call(this,L);m(this,T,new MutationObserver(C(this,v,tv).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>C(this,v,Su).call(this)),C(this,v,Su).call(this);for(let L of this.constructor.Events)this.shadowRoot.addEventListener(L,this,!0)}handleEvent(L){L.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(L.type,{detail:L.detail}))}attributeChangedCallback(L,$,ue){C(this,v,_r).call(this),C(this,v,rv).call(this,L,$,ue)}connectedCallback(){C(this,v,_r).call(this)}},d=new WeakMap,h=new WeakSet,ev=function(){if(c(this,d))return;m(this,d,!0);let L=new Set(this.observedAttributes);L.delete("muted");for(let $ of n)if(!($ in this.prototype))if(typeof r[$]=="function")this.prototype[$]=function(...ue){return C(this,v,_r).call(this),(()=>{var K;if(this.call)return this.call($,...ue);let Q=(K=this.nativeEl)==null?void 0:K[$];return Q==null?void 0:Q.apply(this.nativeEl,ue)})()};else{let ue={get(){var Q,K;C(this,v,_r).call(this);let re=$.toLowerCase();if(L.has(re)){let Qe=this.getAttribute(re);return Qe===null?!1:Qe===""?!0:Qe}return((Q=this.get)==null?void 0:Q.call(this,$))??((K=this.nativeEl)==null?void 0:K[$])}};$!==$.toUpperCase()&&(ue.set=function(re){C(this,v,_r).call(this);let Q=$.toLowerCase();if(L.has(Q)){re===!0||re===!1||re==null?this.toggleAttribute(Q,!!re):this.setAttribute(Q,re);return}if(this.set){this.set($,re);return}this.nativeEl&&(this.nativeEl[$]=re)}),Object.defineProperty(this.prototype,$,ue)}},g=new WeakMap,f=new WeakMap,E=new WeakMap,T=new WeakMap,v=new WeakSet,_r=function(){c(this,g)||(m(this,g,!0),this.init())},Su=function(){var re;let L=new Map(c(this,E)),$=(re=this.shadowRoot)==null?void 0:re.querySelector("slot:not([name])");($==null?void 0:$.assignedElements({flatten:!0}).filter(Q=>["track","source"].includes(Q.localName))).forEach(Q=>{var Qe,eo;L.delete(Q);let K=c(this,E).get(Q);K||(K=Q.cloneNode(),c(this,E).set(Q,K),(Qe=c(this,T))==null||Qe.observe(Q,{attributes:!0})),(eo=this.nativeEl)==null||eo.append(K),C(this,v,ku).call(this,K)}),L.forEach((Q,K)=>{Q.remove(),c(this,E).delete(K)})},tv=function(L){for(let $ of L)if($.type==="attributes"){let{target:ue,attributeName:re}=$,Q=c(this,E).get(ue);Q&&re&&(Q.setAttribute(re,ue.getAttribute(re)??""),C(this,v,ku).call(this,Q))}},ku=function(L){L&&L.localName==="track"&&L.default&&(L.kind==="chapters"||L.kind==="metadata")&&L.track.mode==="disabled"&&(L.track.mode="hidden")},iv=function(L){if(Object.prototype.hasOwnProperty.call(this,L)){let $=this[L];delete this[L],this[L]=$}},rv=function(L,$,ue){var re,Q,K;["id","class"].includes(L)||!l.observedAttributes.includes(L)&&this.constructor.observedAttributes.includes(L)||(ue===null?(re=this.nativeEl)==null||re.removeAttribute(L):((Q=this.nativeEl)==null?void 0:Q.getAttribute(L))!==ue&&((K=this.nativeEl)==null||K.setAttribute(L,ue)))},k(l,h),G(l,"getTemplateHTML",e.endsWith("audio")?Cb:Rb),G(l,"shadowRootOptions",{mode:"open"}),G(l,"Events",Ib),k(l,d,!1),l}function Mb(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function ov(i){let e="";for(let t in i){if(!Jm.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function xb(i){let e={};for(let t of i)e[t.name]=t.value;return e}var We=nv(globalThis.HTMLElement??class{},{tag:"video"}),fC=nv(globalThis.HTMLElement??class{},{tag:"audio"});var Qt=class extends Event{constructor(t,r){super(t);G(this,"track");this.track=r.track}};var Lu=new WeakMap;function w(i){return Lu.get(i)??Pb(i,{})}function Pb(i,e){let t=Lu.get(i);return t||Lu.set(i,t={}),Object.assign(t,e)}function jl(i,e){let t=i.videoTracks;w(e).media=i,w(e).renditionSet||(w(e).renditionSet=new Set);let r=w(t).trackSet;r.add(e);let n=r.size-1;n in Tr.prototype||Object.defineProperty(Tr.prototype,n,{get(){return[...w(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Qt("addtrack",{track:e}))})}function Jl(i){var r;let e=(r=w(i).media)==null?void 0:r.videoTracks;if(!e)return;w(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Qt("removetrack",{track:i}))})}function sv(i){let e=w(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(w(e).changeRequested)return;w(e).changeRequested=!0,queueMicrotask(()=>{delete w(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var Ai,Si,ki,yr,Rs,Tr=class extends EventTarget{constructor(){super();k(this,yr);k(this,Ai);k(this,Si);k(this,ki);w(this).trackSet=new Set}[Symbol.iterator](){return c(this,yr,Rs).values()}get length(){return c(this,yr,Rs).size}getTrackById(t){return[...c(this,yr,Rs)].find(r=>r.id===t)??null}get selectedIndex(){return[...c(this,yr,Rs)].findIndex(t=>t.selected)}get onaddtrack(){return c(this,Ai)}set onaddtrack(t){c(this,Ai)&&(this.removeEventListener("addtrack",c(this,Ai)),m(this,Ai,void 0)),typeof t=="function"&&(m(this,Ai,t),this.addEventListener("addtrack",t))}get onremovetrack(){return c(this,Si)}set onremovetrack(t){c(this,Si)&&(this.removeEventListener("removetrack",c(this,Si)),m(this,Si,void 0)),typeof t=="function"&&(m(this,Si,t),this.addEventListener("removetrack",t))}get onchange(){return c(this,ki)}set onchange(t){c(this,ki)&&(this.removeEventListener("change",c(this,ki)),m(this,ki,void 0)),typeof t=="function"&&(m(this,ki,t),this.addEventListener("change",t))}};Ai=new WeakMap,Si=new WeakMap,ki=new WeakMap,yr=new WeakSet,Rs=function(){return w(this).trackSet};var Zt=class extends Event{constructor(t,r){super(t);G(this,"rendition");this.rendition=r.rendition}};function av(i,e){let t=w(i).media.videoRenditions;w(e).media=w(i).media,w(e).track=i;let r=w(i).renditionSet;r.add(e);let n=r.size-1;n in Ar.prototype||Object.defineProperty(Ar.prototype,n,{get(){return Nn(this)[n]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Zt("addrendition",{rendition:e}))})}function lv(i){let e=w(i).media.videoRenditions,t=w(i).track;w(t).renditionSet.delete(i),queueMicrotask(()=>{w(i).track.selected&&e.dispatchEvent(new Zt("removerendition",{rendition:i}))})}function dv(i){let e=w(i).media.videoRenditions;!e||w(e).changeRequested||(w(e).changeRequested=!0,queueMicrotask(()=>{delete w(e).changeRequested,w(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Nn(i){return[...w(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...w(t).renditionSet])}var Li,wi,Ii,Ar=class extends EventTarget{constructor(){super(...arguments);k(this,Li);k(this,wi);k(this,Ii)}[Symbol.iterator](){return Nn(this).values()}get length(){return Nn(this).length}getRenditionById(t){return Nn(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Nn(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of Nn(this).entries())n.selected=r===t}get onaddrendition(){return c(this,Li)}set onaddrendition(t){c(this,Li)&&(this.removeEventListener("addrendition",c(this,Li)),m(this,Li,void 0)),typeof t=="function"&&(m(this,Li,t),this.addEventListener("addrendition",t))}get onremoverendition(){return c(this,wi)}set onremoverendition(t){c(this,wi)&&(this.removeEventListener("removerendition",c(this,wi)),m(this,wi,void 0)),typeof t=="function"&&(m(this,wi,t),this.addEventListener("removerendition",t))}get onchange(){return c(this,Ii)}set onchange(t){c(this,Ii)&&(this.removeEventListener("change",c(this,Ii)),m(this,Ii,void 0)),typeof t=="function"&&(m(this,Ii,t),this.addEventListener("change",t))}};Li=new WeakMap,wi=new WeakMap,Ii=new WeakMap;var Un,Ms=class{constructor(){G(this,"src");G(this,"id");G(this,"width");G(this,"height");G(this,"bitrate");G(this,"frameRate");G(this,"codec");k(this,Un,!1)}get selected(){return c(this,Un)}set selected(e){c(this,Un)!==e&&(m(this,Un,e),dv(this))}};Un=new WeakMap;var Hn,$n=class{constructor(){G(this,"id");G(this,"kind");G(this,"label","");G(this,"language","");G(this,"sourceBuffer");k(this,Hn,!1)}addRendition(e,t,r,n,o,s){let l=new Ms;return l.src=e,l.width=t,l.height=r,l.frameRate=s,l.bitrate=o,l.codec=n,av(this,l),l}removeRendition(e){lv(e)}get selected(){return c(this,Hn)}set selected(e){c(this,Hn)!==e&&(m(this,Hn,e),e===!0&&sv(this))}};Hn=new WeakMap;function cv(i,e){let t=w(i).media.audioRenditions;w(e).media=w(i).media,w(e).track=i;let r=w(i).renditionSet;r.add(e);let n=r.size-1;n in Sr.prototype||Object.defineProperty(Sr.prototype,n,{get(){return Vn(this)[n]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Zt("addrendition",{rendition:e}))})}function uv(i){let e=w(i).media.audioRenditions,t=w(i).track;w(t).renditionSet.delete(i),queueMicrotask(()=>{w(i).track.enabled&&e.dispatchEvent(new Zt("removerendition",{rendition:i}))})}function hv(i){let e=w(i).media.audioRenditions;!e||w(e).changeRequested||(w(e).changeRequested=!0,queueMicrotask(()=>{delete w(e).changeRequested,w(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Vn(i){return[...w(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...w(t).renditionSet])}var Ci,Ri,Mi,Sr=class extends EventTarget{constructor(){super(...arguments);k(this,Ci);k(this,Ri);k(this,Mi)}[Symbol.iterator](){return Vn(this).values()}get length(){return Vn(this).length}getRenditionById(t){return Vn(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Vn(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of Vn(this).entries())n.selected=r===t}get onaddrendition(){return c(this,Ci)}set onaddrendition(t){c(this,Ci)&&(this.removeEventListener("addrendition",c(this,Ci)),m(this,Ci,void 0)),typeof t=="function"&&(m(this,Ci,t),this.addEventListener("addrendition",t))}get onremoverendition(){return c(this,Ri)}set onremoverendition(t){c(this,Ri)&&(this.removeEventListener("removerendition",c(this,Ri)),m(this,Ri,void 0)),typeof t=="function"&&(m(this,Ri,t),this.addEventListener("removerendition",t))}get onchange(){return c(this,Mi)}set onchange(t){c(this,Mi)&&(this.removeEventListener("change",c(this,Mi)),m(this,Mi,void 0)),typeof t=="function"&&(m(this,Mi,t),this.addEventListener("change",t))}};Ci=new WeakMap,Ri=new WeakMap,Mi=new WeakMap;var Bn,xs=class{constructor(){G(this,"src");G(this,"id");G(this,"bitrate");G(this,"codec");k(this,Bn,!1)}get selected(){return c(this,Bn)}set selected(e){c(this,Bn)!==e&&(m(this,Bn,e),hv(this))}};Bn=new WeakMap;function td(i,e){let t=i.audioTracks;w(e).media=i,w(e).renditionSet||(w(e).renditionSet=new Set);let r=w(t).trackSet;r.add(e);let n=r.size-1;n in kr.prototype||Object.defineProperty(kr.prototype,n,{get(){return[...w(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Qt("addtrack",{track:e}))})}function id(i){var r;let e=(r=w(i).media)==null?void 0:r.audioTracks;if(!e)return;w(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Qt("removetrack",{track:i}))})}function pv(i){let e=w(i).media.audioTracks;!e||w(e).changeRequested||(w(e).changeRequested=!0,queueMicrotask(()=>{delete w(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var xi,Pi,Di,Wn,ed,kr=class extends EventTarget{constructor(){super();k(this,Wn);k(this,xi);k(this,Pi);k(this,Di);w(this).trackSet=new Set}[Symbol.iterator](){return c(this,Wn,ed).values()}get length(){return c(this,Wn,ed).size}getTrackById(t){return[...c(this,Wn,ed)].find(r=>r.id===t)??null}get onaddtrack(){return c(this,xi)}set onaddtrack(t){c(this,xi)&&(this.removeEventListener("addtrack",c(this,xi)),m(this,xi,void 0)),typeof t=="function"&&(m(this,xi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return c(this,Pi)}set onremovetrack(t){c(this,Pi)&&(this.removeEventListener("removetrack",c(this,Pi)),m(this,Pi,void 0)),typeof t=="function"&&(m(this,Pi,t),this.addEventListener("removetrack",t))}get onchange(){return c(this,Di)}set onchange(t){c(this,Di)&&(this.removeEventListener("change",c(this,Di)),m(this,Di,void 0)),typeof t=="function"&&(m(this,Di,t),this.addEventListener("change",t))}};xi=new WeakMap,Pi=new WeakMap,Di=new WeakMap,Wn=new WeakSet,ed=function(){return w(this).trackSet};var Fn,Kn=class{constructor(){G(this,"id");G(this,"kind");G(this,"label","");G(this,"language","");G(this,"sourceBuffer");k(this,Fn,!1)}addRendition(e,t,r){let n=new xs;return n.src=e,n.codec=t,n.bitrate=r,cv(this,n),n}removeRendition(e){uv(e)}get enabled(){return c(this,Fn)}set enabled(e){c(this,Fn)!==e&&(m(this,Fn,e),pv(this))}};Fn=new WeakMap;var mv=rd(globalThis.HTMLMediaElement,"video"),vv=rd(globalThis.HTMLMediaElement,"audio");function qn(i){if(!(i!=null&&i.prototype))return i;let e=rd(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return Db(this)}});let t=rd(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return Ob(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(o,s="",l=""){let d=new $n;return d.kind=o,d.label=s,d.language=l,jl(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=Jl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(o,s="",l=""){let d=new Kn;return d.kind=o,d.label=s,d.language=l,td(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=id),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=o=>{let s=w(o).videoRenditions;return s||(s=new Ar,w(s).media=o,w(o).videoRenditions=s),s};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return n(this)}});let n=o=>{let s=w(o).audioRenditions;return s||(s=new Sr,w(s).media=o,w(o).audioRenditions=s),s};return i}function rd(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function Db(i){let e=w(i).videoTracks;if(!e&&(e=new Tr,w(i).videoTracks=e,mv)){let t=mv.call(i.nativeEl??i);for(let r of t)jl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof $n)){for(let n of t)Jl(n);return}jl(i,r.track)}),t.addEventListener("removetrack",r=>{Jl(r.track)})}return e}function Ob(i){let e=w(i).audioTracks;if(!e&&(e=new kr,w(i).audioTracks=e,vv)){let t=vv.call(i.nativeEl??i);for(let r of t)td(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof Kn)){for(let n of t)id(n);return}td(i,r.track)}),t.addEventListener("removetrack",r=>{id(r.track)})}return e}var be=Bv(rh("hls.js"),1);var Nb={[be.default.ErrorTypes.NETWORK_ERROR]:Xe.network,[be.default.ErrorTypes.MEDIA_ERROR]:Xe.media,[be.default.ErrorTypes.KEY_SYSTEM_ERROR]:Xe.keySystem},Ub=3e3,Hb=qn(We),Xt,jt,Jt,Oi,Gn,rt,wu,fv,Iu,Ps,Ev,Ni=class extends Hb{constructor(){super();k(this,rt);k(this,Xt,null);k(this,jt,null);k(this,Jt,null);k(this,Oi,null);k(this,Gn,!1);this.api=null;k(this,Ps,()=>{var r,n;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(n=this.api)==null||n.startLoad()});C(this,rt,Ev).call(this,"config"),this.addEventListener("waiting",()=>{c(this,Oi)&&this.dispatchEvent(Ne(new Error(c(this,Oi).message),c(this,Oi).code))})}static getTemplateHTML(t,r={}){let{src:n,...o}=t;return`
2928
2928
  <script type="application/json" id="config">
2929
2929
  ${JSON.stringify(r.config||{})}
2930
2930
  <\/script>
2931
2931
  ${We.getTemplateHTML(o)}
2932
- `}get config(){return c(this,Jt)}set config(t){m(this,Jt,t)}get activeVideoElement(){return this.nativeEl??null}attributeChangedCallback(t,r,n){t!=="src"&&super.attributeChangedCallback(t,r,n),t==="src"&&r!==n&&this.load()}disconnectedCallback(){var t;C(this,rt,wu).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var n,o,s,l;let t=!this.api&&!c(this,Gn);if(C(this,rt,wu).call(this),m(this,Oi,null),!this.src)return;if(t&&!c(this,Jt))try{m(this,Jt,JSON.parse(((o=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:o.textContent)||"{}"))}catch(d){console.error("[hls-video] Failed to parse config:",d),m(this,Jt,{})}if(!C(this,rt,vv).call(this,this.src)){await Promise.resolve(),m(this,Gn,!0),this.nativeEl.src=this.src;return}if(be.default.isSupported()){await Promise.resolve(),this.api=new be.default({liveDurationInfinity:!0,autoStartLoad:!1,...c(this,Jt)});let d=null,h=0;switch(this.api.on(be.default.Events.ERROR,(T,v)=>{var S,I,F;if(v.type===be.default.ErrorTypes.NETWORK_ERROR&&v.details===be.default.ErrorDetails.FRAG_LOAD_ERROR&&(d=((S=v.frag)==null?void 0:S.level)??null),v.fatal){if(v.type===be.default.ErrorTypes.MEDIA_ERROR){let y=Date.now();if(y-h>Nb){h=y,(I=this.api)==null||I.recoverMediaError();return}}let se=(F=v.response)==null?void 0:F.code,De=se?`${v.details} (HTTP ${se})`:v.details,ii=v.type===be.default.ErrorTypes.NETWORK_ERROR&&(se===401||se===403)?Xe.auth:Ob[v.type]??Xe.other;m(this,Oi,{message:De,code:ii}),this.dispatchEvent(Ne(new Error(De),ii))}}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let T=()=>{var v;return(v=this.api)==null?void 0:v.startLoad()};this.nativeEl.addEventListener("play",T,{once:!0}),this.api.on(be.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",T)});break}case"metadata":{let T=this.api.config.maxBufferLength,v=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let S=()=>{this.api&&(this.api.config.maxBufferLength=T,this.api.config.maxBufferSize=v)};this.nativeEl.addEventListener("play",S,{once:!0}),this.api.on(be.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",S)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",c(this,Ps)),m(this,Xt,document.createElement("source")),c(this,Xt).setAttribute("type","application/x-mpegURL"),c(this,Xt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(c(this,Xt));let g=new WeakMap;this.api.on(be.default.Events.MANIFEST_PARSED,(T,v)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(I=>{console.warn("Autoplay failed:",I)}),C(this,rt,Iu).call(this);let S=this.videoTracks.getTrackById("main");S||(S=this.addVideoTrack("main"),S.id="main",S.selected=!0);for(let[I,F]of v.levels.entries()){let se=S.addRendition(F.url[0],F.width,F.height,F.videoCodec??void 0,F.bitrate);g.set(F,`${I}`),se.id=`${I}`}for(let[I,F]of v.audioTracks.entries()){let se=F.default?"main":"alternative",De=this.addAudioTrack(se,F.name,F.lang);De.id=`${I}`,F.default&&(De.enabled=!0)}}),(s=c(this,jt))==null||s.call(this);let f=()=>{var I,F;let T=[...this.audioTracks].find(se=>se.enabled),v=T?+T.id:void 0,S=((I=this.api)==null?void 0:I.audioTracks.map(se=>se.id))??[];v!==void 0&&v!==((F=this.api)==null?void 0:F.audioTrack)&&S.includes(v)&&this.api&&(this.api.audioTrack=v)};this.audioTracks.addEventListener("change",f),m(this,jt,()=>{this.audioTracks.removeEventListener("change",f)}),this.api.on(be.default.Events.LEVELS_UPDATED,(T,v)=>{let S=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!S)return;let I=v.levels.map(F=>g.get(F));for(let F of this.videoRenditions)F.id&&!I.includes(F.id)&&S.removeRendition(F)}),this.api.on(be.default.Events.LEVEL_SWITCHED,(T,v)=>{let S=v.level;d!==null&&S<d&&(console.warn(`hls.js downgraded quality from level ${d} to ${S} due to fragment load failure.`),this.videoRenditions.selectedIndex=S,d=null)});let E=()=>{let T=this.videoRenditions.selectedIndex;this.api&&T!==this.api.nextLevel&&(this.api.nextLevel=T)};(l=this.videoRenditions)==null||l.addEventListener("change",E),this.api.once(be.default.Events.DESTROYING,()=>{var T,v;C(this,rt,Iu).call(this),(T=this.videoRenditions)==null||T.removeEventListener("change",E),(v=c(this,jt))==null||v.call(this),m(this,jt,null)});return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Xt=new WeakMap,jt=new WeakMap,Jt=new WeakMap,Oi=new WeakMap,Gn=new WeakMap,rt=new WeakSet,wu=function(){var t,r,n;(t=c(this,Xt))==null||t.remove(),m(this,Xt,null),(r=c(this,jt))==null||r.call(this),m(this,jt,null),(n=this.nativeEl)==null||n.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",c(this,Ps)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),m(this,Gn,!1)},vv=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},Iu=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},Ps=new WeakMap,fv=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ni.shadowRootOptions={...We.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",Ni);var Cu=Ni;var Hb="nanoplayer.4.min.js",$b="nanoplayer",Pe={loading:!1,loaded:!1,error:null,callbacks:[]};function Vb(i,e){return new Promise((t,r)=>{if(window.NanoPlayer){Pe.loaded=!0,t();return}if(Pe.loaded){t();return}if(Pe.error){r(Pe.error);return}if(Pe.callbacks.push(s=>{s?r(s):t()}),Pe.loading)return;Pe.loading=!0;let n;e?n=e:n=`${i.endsWith("/")?i:`${i}/`}${$b}/${Hb}`;let o=document.createElement("script");o.src=n,o.async=!0,o.onload=()=>{Pe.loaded=!0,Pe.loading=!1,Pe.callbacks.forEach(s=>s()),Pe.callbacks=[]},o.onerror=()=>{let s=new Error(`Failed to load NanoPlayer script from ${n}`);Pe.error=s,Pe.loading=!1,Pe.callbacks.forEach(l=>l(s)),Pe.callbacks=[]},document.head.appendChild(o)})}var Bb=qn(We),pt,Ui,fe,mt,zn,Le,Ds,Hi,$i,Lr,wr,vt,Ir,Yn,Qn,Ce,Ev,Ru,gv,bv,_v,nd,Vi=class extends Bb{constructor(){super();k(this,Ce);k(this,pt,null);k(this,Ui,null);k(this,fe,null);k(this,mt,null);k(this,zn,"");k(this,Le,null);k(this,Ds,!0);k(this,Hi,[]);k(this,$i,[]);k(this,Lr,[]);k(this,wr,null);k(this,vt,null);k(this,Ir,!1);k(this,Yn,!1);k(this,Qn,null);this.api=null;C(this,Ce,nd).call(this,"config"),C(this,Ce,nd).call(this,"streamid"),C(this,Ce,nd).call(this,"sourceConfig"),C(this,Ce,Ev).call(this)}static get observedAttributes(){return[...We.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:n,"library-location":o,...s}=t;return`
2932
+ `}get config(){return c(this,Jt)}set config(t){m(this,Jt,t)}get activeVideoElement(){return this.nativeEl??null}attributeChangedCallback(t,r,n){t!=="src"&&super.attributeChangedCallback(t,r,n),t==="src"&&r!==n&&this.load()}disconnectedCallback(){var t;C(this,rt,wu).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var n,o,s,l;let t=!this.api&&!c(this,Gn);if(C(this,rt,wu).call(this),m(this,Oi,null),!this.src)return;if(t&&!c(this,Jt))try{m(this,Jt,JSON.parse(((o=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:o.textContent)||"{}"))}catch(d){console.error("[hls-video] Failed to parse config:",d),m(this,Jt,{})}if(!C(this,rt,fv).call(this,this.src)){await Promise.resolve(),m(this,Gn,!0),this.nativeEl.src=this.src;return}if(be.default.isSupported()){await Promise.resolve(),this.api=new be.default({liveDurationInfinity:!0,autoStartLoad:!1,...c(this,Jt)});let d=null,h=0;switch(this.api.on(be.default.Events.ERROR,(T,v)=>{var S,I,F;if(v.type===be.default.ErrorTypes.NETWORK_ERROR&&v.details===be.default.ErrorDetails.FRAG_LOAD_ERROR&&(d=((S=v.frag)==null?void 0:S.level)??null),v.fatal){if(v.type===be.default.ErrorTypes.MEDIA_ERROR){let y=Date.now();if(y-h>Ub){h=y,(I=this.api)==null||I.recoverMediaError();return}}let se=(F=v.response)==null?void 0:F.code,De=se?`${v.details} (HTTP ${se})`:v.details,ii=v.type===be.default.ErrorTypes.NETWORK_ERROR&&(se===401||se===403)?Xe.auth:Nb[v.type]??Xe.other;m(this,Oi,{message:De,code:ii}),this.dispatchEvent(Ne(new Error(De),ii))}}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let T=()=>{var v;return(v=this.api)==null?void 0:v.startLoad()};this.nativeEl.addEventListener("play",T,{once:!0}),this.api.on(be.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",T)});break}case"metadata":{let T=this.api.config.maxBufferLength,v=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let S=()=>{this.api&&(this.api.config.maxBufferLength=T,this.api.config.maxBufferSize=v)};this.nativeEl.addEventListener("play",S,{once:!0}),this.api.on(be.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",S)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",c(this,Ps)),m(this,Xt,document.createElement("source")),c(this,Xt).setAttribute("type","application/x-mpegURL"),c(this,Xt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(c(this,Xt));let g=new WeakMap;this.api.on(be.default.Events.MANIFEST_PARSED,(T,v)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(I=>{console.warn("Autoplay failed:",I)}),C(this,rt,Iu).call(this);let S=this.videoTracks.getTrackById("main");S||(S=this.addVideoTrack("main"),S.id="main",S.selected=!0);for(let[I,F]of v.levels.entries()){let se=S.addRendition(F.url[0],F.width,F.height,F.videoCodec??void 0,F.bitrate);g.set(F,`${I}`),se.id=`${I}`}for(let[I,F]of v.audioTracks.entries()){let se=F.default?"main":"alternative",De=this.addAudioTrack(se,F.name,F.lang);De.id=`${I}`,F.default&&(De.enabled=!0)}}),(s=c(this,jt))==null||s.call(this);let f=()=>{var I,F;let T=[...this.audioTracks].find(se=>se.enabled),v=T?+T.id:void 0,S=((I=this.api)==null?void 0:I.audioTracks.map(se=>se.id))??[];v!==void 0&&v!==((F=this.api)==null?void 0:F.audioTrack)&&S.includes(v)&&this.api&&(this.api.audioTrack=v)};this.audioTracks.addEventListener("change",f),m(this,jt,()=>{this.audioTracks.removeEventListener("change",f)}),this.api.on(be.default.Events.LEVELS_UPDATED,(T,v)=>{let S=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!S)return;let I=v.levels.map(F=>g.get(F));for(let F of this.videoRenditions)F.id&&!I.includes(F.id)&&S.removeRendition(F)}),this.api.on(be.default.Events.LEVEL_SWITCHED,(T,v)=>{let S=v.level;d!==null&&S<d&&(console.warn(`hls.js downgraded quality from level ${d} to ${S} due to fragment load failure.`),this.videoRenditions.selectedIndex=S,d=null)});let E=()=>{let T=this.videoRenditions.selectedIndex;this.api&&T!==this.api.nextLevel&&(this.api.nextLevel=T)};(l=this.videoRenditions)==null||l.addEventListener("change",E),this.api.once(be.default.Events.DESTROYING,()=>{var T,v;C(this,rt,Iu).call(this),(T=this.videoRenditions)==null||T.removeEventListener("change",E),(v=c(this,jt))==null||v.call(this),m(this,jt,null)});return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Xt=new WeakMap,jt=new WeakMap,Jt=new WeakMap,Oi=new WeakMap,Gn=new WeakMap,rt=new WeakSet,wu=function(){var t,r,n;(t=c(this,Xt))==null||t.remove(),m(this,Xt,null),(r=c(this,jt))==null||r.call(this),m(this,jt,null),(n=this.nativeEl)==null||n.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",c(this,Ps)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),m(this,Gn,!1)},fv=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},Iu=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},Ps=new WeakMap,Ev=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ni.shadowRootOptions={...We.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",Ni);var Cu=Ni;var $b="nanoplayer.4.min.js",Vb="nanoplayer",Pe={loading:!1,loaded:!1,error:null,callbacks:[]};function Bb(i,e){return new Promise((t,r)=>{if(window.NanoPlayer){Pe.loaded=!0,t();return}if(Pe.loaded){t();return}if(Pe.error){r(Pe.error);return}if(Pe.callbacks.push(s=>{s?r(s):t()}),Pe.loading)return;Pe.loading=!0;let n;e?n=e:n=`${i.endsWith("/")?i:`${i}/`}${Vb}/${$b}`;let o=document.createElement("script");o.src=n,o.async=!0,o.onload=()=>{Pe.loaded=!0,Pe.loading=!1,Pe.callbacks.forEach(s=>s()),Pe.callbacks=[]},o.onerror=()=>{let s=new Error(`Failed to load NanoPlayer script from ${n}`);Pe.error=s,Pe.loading=!1,Pe.callbacks.forEach(l=>l(s)),Pe.callbacks=[]},document.head.appendChild(o)})}var Wb=qn(We),pt,Ui,fe,mt,zn,Le,Ds,Hi,$i,Lr,wr,vt,Ir,Yn,Qn,Ce,gv,Ru,bv,_v,yv,nd,Vi=class extends Wb{constructor(){super();k(this,Ce);k(this,pt,null);k(this,Ui,null);k(this,fe,null);k(this,mt,null);k(this,zn,"");k(this,Le,null);k(this,Ds,!0);k(this,Hi,[]);k(this,$i,[]);k(this,Lr,[]);k(this,wr,null);k(this,vt,null);k(this,Ir,!1);k(this,Yn,!1);k(this,Qn,null);this.api=null;C(this,Ce,nd).call(this,"config"),C(this,Ce,nd).call(this,"streamid"),C(this,Ce,nd).call(this,"sourceConfig"),C(this,Ce,gv).call(this)}static get observedAttributes(){return[...We.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:n,"library-location":o,...s}=t;return`
2933
2933
  <script type="application/json" id="config">
2934
2934
  ${JSON.stringify(r.config||{})}
2935
2935
  <\/script>
2936
2936
  ${We.getTemplateHTML(s)}
2937
- `}get activeVideoElement(){return c(this,Le)}get config(){return c(this,pt)}set config(t){m(this,pt,t)}get sourceConfig(){return c(this,Ui)}set sourceConfig(t){let r=c(this,Ui)!==t;m(this,Ui,t),r&&t&&this.load()}get streamid(){return this.getAttribute("streamid")}set streamid(t){t?this.setAttribute("streamid",t):this.removeAttribute("streamid")}get libraryLocation(){return this.getAttribute("library-location")||"/vendor/bp-player"}set libraryLocation(t){this.setAttribute("library-location",t)}attributeChangedCallback(t,r,n){t==="streamid"&&r!==n?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,n)}async load(){var s,l,d,h,p,g;let t=!c(this,fe);C(this,Ce,Ru).call(this);let r=this.streamid,n=!!c(this,Ui);if(!r&&!n)return;if(m(this,wr,new Promise(f=>{m(this,vt,f)})),t&&!c(this,pt))try{m(this,pt,JSON.parse(((l=(s=this.shadowRoot)==null?void 0:s.getElementById("config"))==null?void 0:l.textContent)||"{}"))}catch(f){console.error("[nano-video] Failed to parse config:",f),m(this,pt,{})}try{await Vb(this.libraryLocation,(d=c(this,pt))==null?void 0:d.scriptUrl)}catch(f){console.error("[nano-video] Failed to load NanoPlayer script:",f),this.dispatchEvent(Ne(f)),(h=c(this,vt))==null||h.call(this);return}m(this,zn,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),m(this,mt,document.createElement("div")),c(this,mt).id=c(this,zn),c(this,mt).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.nativeEl.style.display="none",this.appendChild(c(this,mt)),m(this,fe,new window.NanoPlayer(c(this,zn))),this.api=c(this,fe);try{let f=C(this,Ce,gv).call(this,r,n?c(this,Ui):void 0),E=await c(this,fe).setup(f);m(this,Lr,((p=E.source.entries)==null?void 0:p.map((T,v)=>({index:v,height:T.info.height??0,width:T.info.width??0,bitrate:T.info.bitrate??0,label:T.info.height?`${T.info.height}p`:v===0?"Source":`Stream ${v+1}`})))??[]),C(this,Ce,_v).call(this)}catch(f){console.error("[nano-video] Failed to setup NanoPlayer:",f),this.dispatchEvent(Ne(f)),(g=c(this,vt))==null||g.call(this)}}async play(){if(c(this,wr)&&await c(this,wr),c(this,fe)){m(this,Ir,!0),c(this,fe).play();return}return super.play()}pause(){if(c(this,fe)){c(this,fe).pause();return}super.pause()}get currentTime(){var t;return((t=c(this,Le))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){c(this,fe)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=c(this,Le))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=c(this,Le))==null?void 0:t.volume)??super.volume}set volume(t){c(this,Le)?c(this,Le).volume=t:super.volume=t}get muted(){var t;return((t=c(this,Le))==null?void 0:t.muted)??super.muted}set muted(t){c(this,Le)&&(c(this,Le).muted=t),c(this,fe)?t?c(this,fe).mute():c(this,fe).unmute():super.muted=t}get videoWidth(){var t;return((t=c(this,Le))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=c(this,Le))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t,r;C(this,Ce,Ru).call(this),(t=c(this,Qn))==null||t.call(this),m(this,Qn,null),(r=super.disconnectedCallback)==null||r.call(this)}};pt=new WeakMap,Ui=new WeakMap,fe=new WeakMap,mt=new WeakMap,zn=new WeakMap,Le=new WeakMap,Ds=new WeakMap,Hi=new WeakMap,$i=new WeakMap,Lr=new WeakMap,wr=new WeakMap,vt=new WeakMap,Ir=new WeakMap,Yn=new WeakMap,Qn=new WeakMap,Ce=new WeakSet,Ev=function(){let t=r=>{var n;r.target!==this&&((n=c(this,mt))!=null&&n.contains(r.target))&&c(this,Ir)&&r.stopImmediatePropagation()};this.addEventListener("pause",t,!0),m(this,Qn,()=>this.removeEventListener("pause",t,!0))},Ru=function(){var t;(t=c(this,vt))==null||t.call(this),m(this,wr,null),m(this,vt,null),c(this,Hi).forEach(r=>r()),m(this,Hi,[]),c(this,$i).forEach(r=>r()),m(this,$i,[]);for(let r of this.videoTracks)this.removeVideoTrack(r);for(let r of this.audioTracks)this.removeAudioTrack(r);c(this,fe)&&(c(this,fe).destroy(),m(this,fe,null),this.api=null),c(this,mt)&&(c(this,mt).remove(),m(this,mt,null)),c(this,Le)&&(m(this,Le,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),m(this,Yn,!1),m(this,Lr,[])},gv=function(t,r){var o,s;return{source:r??{group:{id:t},options:{adaption:{rule:"deviationOfMean2"},switch:{method:"server",pauseOnError:!1,forcePlay:!0,timeout:10}}},playback:{autoplay:this.nativeEl.autoplay,muted:this.nativeEl.muted,reconnect:((o=c(this,pt))==null?void 0:o.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((s=c(this,pt))==null?void 0:s.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(j(Md)),this.dispatchEvent(j(So)),this.dispatchEvent(j(Qs)),(l=c(this,vt))==null||l.call(this)},onPlay:()=>{m(this,Ir,!1),m(this,Yn,!0),this.dispatchEvent(j(yo)),this.dispatchEvent(j(li))},onPause:()=>{this.dispatchEvent(j(ai))},onLoading:()=>{this.dispatchEvent(j(Vr))},onStartBuffering:()=>{this.dispatchEvent(j(Vr))},onStopBuffering:()=>{this.dispatchEvent(j(Qs)),this.dispatchEvent(j(li))},onError:l=>{var p,g;m(this,Ir,!1);let d=l.data.code??-1,h=l.data.message??"NanoPlayer error";if(d===2004&&c(this,Yn)){this.dispatchEvent(j(To)),(p=c(this,vt))==null||p.call(this);return}this.dispatchEvent(Ne(new Error(h),d)),(g=c(this,vt))==null||g.call(this)},onActiveVideoElementChange:l=>{var h;let d=(h=l.data)==null?void 0:h.activeVideoElement;d&&d!==c(this,Le)&&(m(this,Le,d),C(this,Ce,bv).call(this,d),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:d}})))}}}},bv=function(t){c(this,Hi).forEach(n=>n()),m(this,Hi,[]);let r=[Ao,Br,Id,di];for(let n of r){let o=()=>{this.dispatchEvent(j(n))};t.addEventListener(n,o),c(this,Hi).push(()=>t.removeEventListener(n,o))}},_v=function(){c(this,$i).forEach(n=>n()),m(this,$i,[]);for(let n of this.videoTracks)this.removeVideoTrack(n);for(let n of this.audioTracks)this.removeAudioTrack(n);if(c(this,Lr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let n of c(this,Lr)){let o=t.addRendition("",n.width,n.height,void 0,n.bitrate);o.id=`${n.index}`}let r=()=>{var o,s,l;let n=this.videoRenditions.selectedIndex;n<0?(m(this,Ds,!0),(o=c(this,fe))==null||o.setAdaption({rule:"deviationOfMean2"})):(m(this,Ds,!1),(s=c(this,fe))==null||s.switchStream(n).catch(d=>{console.warn("[nano-video] Quality switch failed:",d)}),(l=c(this,fe))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r),c(this,$i).push(()=>{this.videoRenditions.removeEventListener("change",r)})},nd=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Vi.shadowRootOptions={...We.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",Vi);var Mu=Vi;var W=rh("livekit-client");var Wb=qn(We),Ye,H,ce,we,nt,Xn,jn,ft,Cr,Bi,Rr,ei,ti,Et,Jn,U,od,xu,Os,yv,sd,Pu,Zn,Tv,Av,ad,Sv,kv,ld,Ns=class Ns extends Wb{constructor(){super();k(this,U);k(this,Ye,null);k(this,H,null);k(this,ce,null);k(this,we,null);k(this,nt,[]);k(this,Xn,[]);k(this,jn,[]);k(this,ft,"disconnected");k(this,Cr,null);k(this,Bi,null);k(this,Rr,null);k(this,ei,null);k(this,ti,null);k(this,Et,!1);k(this,Jn,!1);this.room=null;C(this,U,ld).call(this,"config"),C(this,U,ld).call(this,"url"),C(this,U,ld).call(this,"token")}static get observedAttributes(){return[...We.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:n,token:o,...s}=t;return`
2937
+ `}get activeVideoElement(){return c(this,Le)}get config(){return c(this,pt)}set config(t){m(this,pt,t)}get sourceConfig(){return c(this,Ui)}set sourceConfig(t){let r=c(this,Ui)!==t;m(this,Ui,t),r&&t&&this.load()}get streamid(){return this.getAttribute("streamid")}set streamid(t){t?this.setAttribute("streamid",t):this.removeAttribute("streamid")}get libraryLocation(){return this.getAttribute("library-location")||"/vendor/bp-player"}set libraryLocation(t){this.setAttribute("library-location",t)}attributeChangedCallback(t,r,n){t==="streamid"&&r!==n?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,n)}async load(){var s,l,d,h,p,g;let t=!c(this,fe);C(this,Ce,Ru).call(this);let r=this.streamid,n=!!c(this,Ui);if(!r&&!n)return;if(m(this,wr,new Promise(f=>{m(this,vt,f)})),t&&!c(this,pt))try{m(this,pt,JSON.parse(((l=(s=this.shadowRoot)==null?void 0:s.getElementById("config"))==null?void 0:l.textContent)||"{}"))}catch(f){console.error("[nano-video] Failed to parse config:",f),m(this,pt,{})}try{await Bb(this.libraryLocation,(d=c(this,pt))==null?void 0:d.scriptUrl)}catch(f){console.error("[nano-video] Failed to load NanoPlayer script:",f),this.dispatchEvent(Ne(f)),(h=c(this,vt))==null||h.call(this);return}m(this,zn,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),m(this,mt,document.createElement("div")),c(this,mt).id=c(this,zn),c(this,mt).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.nativeEl.style.display="none",this.appendChild(c(this,mt)),m(this,fe,new window.NanoPlayer(c(this,zn))),this.api=c(this,fe);try{let f=C(this,Ce,bv).call(this,r,n?c(this,Ui):void 0),E=await c(this,fe).setup(f);m(this,Lr,((p=E.source.entries)==null?void 0:p.map((T,v)=>({index:v,height:T.info.height??0,width:T.info.width??0,bitrate:T.info.bitrate??0,label:T.info.height?`${T.info.height}p`:v===0?"Source":`Stream ${v+1}`})))??[]),C(this,Ce,yv).call(this)}catch(f){console.error("[nano-video] Failed to setup NanoPlayer:",f),this.dispatchEvent(Ne(f)),(g=c(this,vt))==null||g.call(this)}}async play(){if(c(this,wr)&&await c(this,wr),c(this,fe)){m(this,Ir,!0),c(this,fe).play();return}return super.play()}pause(){if(c(this,fe)){c(this,fe).pause();return}super.pause()}get currentTime(){var t;return((t=c(this,Le))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){c(this,fe)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=c(this,Le))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=c(this,Le))==null?void 0:t.volume)??super.volume}set volume(t){c(this,Le)?c(this,Le).volume=t:super.volume=t}get muted(){var t;return((t=c(this,Le))==null?void 0:t.muted)??super.muted}set muted(t){c(this,Le)&&(c(this,Le).muted=t),c(this,fe)?t?c(this,fe).mute():c(this,fe).unmute():super.muted=t}get videoWidth(){var t;return((t=c(this,Le))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=c(this,Le))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t,r;C(this,Ce,Ru).call(this),(t=c(this,Qn))==null||t.call(this),m(this,Qn,null),(r=super.disconnectedCallback)==null||r.call(this)}};pt=new WeakMap,Ui=new WeakMap,fe=new WeakMap,mt=new WeakMap,zn=new WeakMap,Le=new WeakMap,Ds=new WeakMap,Hi=new WeakMap,$i=new WeakMap,Lr=new WeakMap,wr=new WeakMap,vt=new WeakMap,Ir=new WeakMap,Yn=new WeakMap,Qn=new WeakMap,Ce=new WeakSet,gv=function(){let t=r=>{var n;r.target!==this&&((n=c(this,mt))!=null&&n.contains(r.target))&&c(this,Ir)&&r.stopImmediatePropagation()};this.addEventListener("pause",t,!0),m(this,Qn,()=>this.removeEventListener("pause",t,!0))},Ru=function(){var t;(t=c(this,vt))==null||t.call(this),m(this,wr,null),m(this,vt,null),c(this,Hi).forEach(r=>r()),m(this,Hi,[]),c(this,$i).forEach(r=>r()),m(this,$i,[]);for(let r of this.videoTracks)this.removeVideoTrack(r);for(let r of this.audioTracks)this.removeAudioTrack(r);c(this,fe)&&(c(this,fe).destroy(),m(this,fe,null),this.api=null),c(this,mt)&&(c(this,mt).remove(),m(this,mt,null)),c(this,Le)&&(m(this,Le,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),m(this,Yn,!1),m(this,Lr,[])},bv=function(t,r){var o,s;return{source:r??{group:{id:t},options:{adaption:{rule:"deviationOfMean2"},switch:{method:"server",pauseOnError:!1,forcePlay:!0,timeout:10}}},playback:{autoplay:this.nativeEl.autoplay,muted:this.nativeEl.muted,reconnect:((o=c(this,pt))==null?void 0:o.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((s=c(this,pt))==null?void 0:s.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(j(Md)),this.dispatchEvent(j(So)),this.dispatchEvent(j(Qs)),(l=c(this,vt))==null||l.call(this)},onPlay:()=>{m(this,Ir,!1),m(this,Yn,!0),this.dispatchEvent(j(yo)),this.dispatchEvent(j(li))},onPause:()=>{this.dispatchEvent(j(ai))},onLoading:()=>{this.dispatchEvent(j(Vr))},onStartBuffering:()=>{this.dispatchEvent(j(Vr))},onStopBuffering:()=>{this.dispatchEvent(j(Qs)),this.dispatchEvent(j(li))},onError:l=>{var p,g;m(this,Ir,!1);let d=l.data.code??-1,h=l.data.message??"NanoPlayer error";if(d===2004&&c(this,Yn)){this.dispatchEvent(j(To)),(p=c(this,vt))==null||p.call(this);return}this.dispatchEvent(Ne(new Error(h),d)),(g=c(this,vt))==null||g.call(this)},onActiveVideoElementChange:l=>{var h;let d=(h=l.data)==null?void 0:h.activeVideoElement;d&&d!==c(this,Le)&&(m(this,Le,d),C(this,Ce,_v).call(this,d),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:d}})))}}}},_v=function(t){c(this,Hi).forEach(n=>n()),m(this,Hi,[]);let r=[Ao,Br,Id,di];for(let n of r){let o=()=>{this.dispatchEvent(j(n))};t.addEventListener(n,o),c(this,Hi).push(()=>t.removeEventListener(n,o))}},yv=function(){c(this,$i).forEach(n=>n()),m(this,$i,[]);for(let n of this.videoTracks)this.removeVideoTrack(n);for(let n of this.audioTracks)this.removeAudioTrack(n);if(c(this,Lr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let n of c(this,Lr)){let o=t.addRendition("",n.width,n.height,void 0,n.bitrate);o.id=`${n.index}`}let r=()=>{var o,s,l;let n=this.videoRenditions.selectedIndex;n<0?(m(this,Ds,!0),(o=c(this,fe))==null||o.setAdaption({rule:"deviationOfMean2"})):(m(this,Ds,!1),(s=c(this,fe))==null||s.switchStream(n).catch(d=>{console.warn("[nano-video] Quality switch failed:",d)}),(l=c(this,fe))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r),c(this,$i).push(()=>{this.videoRenditions.removeEventListener("change",r)})},nd=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Vi.shadowRootOptions={...We.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",Vi);var Mu=Vi;var W=rh("livekit-client");var Fb=qn(We),Ye,H,ce,we,nt,Xn,jn,ft,Cr,Bi,Rr,ei,ti,Et,Jn,U,od,xu,Os,Tv,sd,Pu,Zn,Av,Sv,ad,kv,Lv,ld,Ns=class Ns extends Fb{constructor(){super();k(this,U);k(this,Ye,null);k(this,H,null);k(this,ce,null);k(this,we,null);k(this,nt,[]);k(this,Xn,[]);k(this,jn,[]);k(this,ft,"disconnected");k(this,Cr,null);k(this,Bi,null);k(this,Rr,null);k(this,ei,null);k(this,ti,null);k(this,Et,!1);k(this,Jn,!1);this.room=null;C(this,U,ld).call(this,"config"),C(this,U,ld).call(this,"url"),C(this,U,ld).call(this,"token")}static get observedAttributes(){return[...We.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:n,token:o,...s}=t;return`
2938
2938
  <script type="application/json" id="config">
2939
2939
  ${JSON.stringify(r.config||{})}
2940
2940
  <\/script>
2941
2941
  ${We.getTemplateHTML(s)}
2942
- `}get activeVideoElement(){return c(this,ce)}get config(){return c(this,Ye)}set config(t){m(this,Ye,t)}get url(){return this.getAttribute("url")}set url(t){t?this.setAttribute("url",t):this.removeAttribute("url")}get token(){return this.getAttribute("token")}set token(t){t?this.setAttribute("token",t):this.removeAttribute("token")}attributeChangedCallback(t,r,n){(t==="url"||t==="token")&&r!==n?this.url&&this.token?this.load():c(this,H)&&C(this,U,od).call(this):t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,n)}async load(){var De,gt,ii;let t=!c(this,H);C(this,U,od).call(this);let r=this.url,n=this.token;if(!r||!n)return;if(m(this,Cr,new Promise(y=>{m(this,Bi,y)})),t&&!c(this,Ye))try{m(this,Ye,JSON.parse(((gt=(De=this.shadowRoot)==null?void 0:De.getElementById("config"))==null?void 0:gt.textContent)||"{}"))}catch(y){console.error("[livekit-video] Failed to parse config:",y),m(this,Ye,{})}let o=C(this,U,Sv).call(this),s=C(this,U,kv).call(this);m(this,H,new W.Room(o)),this.room=c(this,H);let l=()=>{m(this,ft,"connected")},d=y=>{let L=y!=null?W.DisconnectReason[y]??String(y):"undefined";console.log("[livekit-video] Disconnected",{reason:y,reasonName:L,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState}),m(this,ft,"disconnected"),C(this,U,Os).call(this),y==null||y===W.DisconnectReason.UNKNOWN_REASON||y===W.DisconnectReason.ROOM_DELETED||y===W.DisconnectReason.ROOM_CLOSED?c(this,Et)||C(this,U,sd).call(this):this.dispatchEvent(Ne(new Error(`LiveKit disconnected: ${L} (${y})`),4001))},h=()=>{console.log("[livekit-video] Reconnecting",{documentHidden:document.hidden,documentHasFocus:document.hasFocus()}),m(this,ft,"reconnecting"),C(this,U,Pu).call(this),c(this,Et)||this.dispatchEvent(j(Vr))},p=()=>{var L;console.log("[livekit-video] Reconnected"),m(this,ft,"connected");let y=c(this,ce)!=null||[...((L=c(this,H))==null?void 0:L.remoteParticipants.values())??[]].some($=>$.videoTrackPublications.size>0);if(c(this,Jn)&&!y){c(this,Et)||C(this,U,sd).call(this);return}m(this,Et,!1),this.dispatchEvent(j(li))},g=()=>{console.log("[livekit-video] SignalReconnecting")},f=y=>{console.log("[livekit-video] ConnectionStateChanged",y)},E=y=>{console.error("[livekit-video] MediaDevicesError",y)},T=y=>{console.log("[livekit-video] AudioPlaybackStatusChanged",y),y?(C(this,U,Os).call(this),C(this,U,Zn).call(this)):C(this,U,xu).call(this)},v=(y,L,$)=>{console.error("[livekit-video] TrackSubscriptionFailed",{trackSid:y,reason:$})},S=y=>{console.log("[livekit-video] TrackMuted",{sid:y.trackSid,kind:y.kind})},I=y=>{console.log("[livekit-video] TrackUnmuted",{sid:y.trackSid,kind:y.kind})},F=(y,L)=>{var $,ue,re,Q;if(y.kind===W.Track.Kind.Video){let K=y.attach();K.style.width="100%",K.style.height="100%",K.style.position="absolute",K.style.top="0",K.style.left="0",K.playsInline=!0,K.setAttribute("playsinline",""),K.setAttribute("webkit-playsinline",""),this.nativeEl.muted&&(K.muted=!0),this.nativeEl.style.display="none",($=this.shadowRoot)==null||$.appendChild(K),m(this,ce,K),m(this,Et,!1),m(this,Jn,!0),C(this,U,Tv).call(this,K),C(this,U,Av).call(this,L),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:K}})),this.dispatchEvent(j(Rd)),this.dispatchEvent(j(di)),this.dispatchEvent(j(So)),this.dispatchEvent(j(li)),(ue=c(this,Bi))==null||ue.call(this)}else if(y.kind===W.Track.Kind.Audio){let K=y.attach();K.style.display="none",(re=this.shadowRoot)==null||re.appendChild(K),m(this,we,K),C(this,U,Zn).call(this);let Qe=()=>{c(this,we)===K&&C(this,U,Zn).call(this)};K.addEventListener(Br,Qe),(Q=c(this,ei))==null||Q.call(this),m(this,ei,()=>K.removeEventListener(Br,Qe)),c(this,H)&&!c(this,H).canPlaybackAudio&&C(this,U,xu).call(this)}},se=y=>{var L;y.kind===W.Track.Kind.Video?(y.detach(),C(this,U,ad).call(this),c(this,ce)&&(c(this,nt).forEach($=>$()),m(this,nt,[]),c(this,ce).remove(),m(this,ce,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}})),C(this,U,yv).call(this))):y.kind===W.Track.Kind.Audio&&(y.detach(),c(this,we)&&(c(this,we).remove(),m(this,we,null)),(L=c(this,ei))==null||L.call(this),m(this,ei,null),C(this,U,Os).call(this))};c(this,H).on(W.RoomEvent.Connected,l),c(this,H).on(W.RoomEvent.Disconnected,d),c(this,H).on(W.RoomEvent.Reconnecting,h),c(this,H).on(W.RoomEvent.Reconnected,p),c(this,H).on(W.RoomEvent.SignalReconnecting,g),c(this,H).on(W.RoomEvent.ConnectionStateChanged,f),c(this,H).on(W.RoomEvent.MediaDevicesError,E),c(this,H).on(W.RoomEvent.AudioPlaybackStatusChanged,T),c(this,H).on(W.RoomEvent.TrackSubscribed,F),c(this,H).on(W.RoomEvent.TrackUnsubscribed,se),c(this,H).on(W.RoomEvent.TrackSubscriptionFailed,v),c(this,H).on(W.RoomEvent.TrackMuted,S),c(this,H).on(W.RoomEvent.TrackUnmuted,I),m(this,jn,[()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.Connected,l)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.Disconnected,d)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.Reconnecting,h)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.Reconnected,p)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.SignalReconnecting,g)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.ConnectionStateChanged,f)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.MediaDevicesError,E)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.AudioPlaybackStatusChanged,T)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.TrackSubscribed,F)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.TrackUnsubscribed,se)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.TrackSubscriptionFailed,v)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.TrackMuted,S)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.TrackUnmuted,I)}]),m(this,ft,"connecting"),this.dispatchEvent(j(Cd));try{await c(this,H).connect(r,n,s)}catch(y){m(this,ft,"failed"),console.error("[livekit-video] Failed to connect:",y);let L=y instanceof Error?y.message:"Failed to connect to LiveKit room";this.dispatchEvent(Ne(new Error(L),4e3)),(ii=c(this,Bi))==null||ii.call(this)}}async play(){return c(this,Cr)&&await c(this,Cr),c(this,ce)?c(this,ce).play():super.play()}pause(){if(c(this,ce)){c(this,ce).pause();return}super.pause()}get currentTime(){var t;return((t=c(this,ce))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){c(this,H)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=c(this,ce))==null?void 0:t.paused)??super.paused}get volume(){return super.volume}set volume(t){super.volume=t,c(this,ce)&&(c(this,ce).volume=t),c(this,we)&&(c(this,we).volume=t)}get muted(){return super.muted}set muted(t){super.muted=t,c(this,ce)&&(c(this,ce).muted=t),c(this,we)&&(c(this,we).muted=t)}get videoWidth(){var t;return((t=c(this,ce))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=c(this,ce))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;C(this,U,od).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Ye=new WeakMap,H=new WeakMap,ce=new WeakMap,we=new WeakMap,nt=new WeakMap,Xn=new WeakMap,jn=new WeakMap,ft=new WeakMap,Cr=new WeakMap,Bi=new WeakMap,Rr=new WeakMap,ei=new WeakMap,ti=new WeakMap,Et=new WeakMap,Jn=new WeakMap,U=new WeakSet,od=function(){var t,r;(t=c(this,Bi))==null||t.call(this),m(this,Cr,null),m(this,Bi,null),C(this,U,Pu).call(this),m(this,Et,!1),m(this,Jn,!1),c(this,nt).forEach(n=>n()),m(this,nt,[]),C(this,U,ad).call(this),c(this,jn).forEach(n=>n()),m(this,jn,[]),c(this,H)&&(c(this,H).disconnect(),m(this,H,null),this.room=null),c(this,ce)&&(c(this,ce).remove(),m(this,ce,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),c(this,we)&&(c(this,we).remove(),m(this,we,null)),(r=c(this,ei))==null||r.call(this),m(this,ei,null),C(this,U,Os).call(this),m(this,ft,"disconnected")},xu=function(){if(c(this,Rr))return;let t=!1,r=()=>{let n=c(this,H);if(!n)return;let o=n.startAudio();C(this,U,Zn).call(this),o.then(()=>{c(this,H)===n&&C(this,U,Zn).call(this)}).catch(s=>{t||(t=!0,console.warn("[livekit-video] startAudio failed",s))})};document.addEventListener("click",r,{capture:!0}),document.addEventListener("touchend",r,{capture:!0,passive:!0}),document.addEventListener("keydown",r,{capture:!0}),m(this,Rr,()=>{document.removeEventListener("click",r,{capture:!0}),document.removeEventListener("touchend",r,{capture:!0}),document.removeEventListener("keydown",r,{capture:!0})})},Os=function(){var t;(t=c(this,Rr))==null||t.call(this),m(this,Rr,null)},yv=function(){c(this,ti)==null&&m(this,ti,setTimeout(()=>{m(this,ti,null),c(this,ft)==="connected"&&!c(this,ce)&&!c(this,Et)&&C(this,U,sd).call(this)},0))},sd=function(){m(this,Et,!0),this.dispatchEvent(j(ai)),this.dispatchEvent(j(To))},Pu=function(){c(this,ti)!=null&&(clearTimeout(c(this,ti)),m(this,ti,null))},Zn=function(){c(this,we)&&(c(this,we).muted=ud(Ns.prototype,this,"muted"),c(this,we).volume=ud(Ns.prototype,this,"volume"))},Tv=function(t){c(this,nt).forEach(s=>s()),m(this,nt,[]);let r=[Ao,yo,li,ai,di];for(let s of r){let l=()=>{this.dispatchEvent(j(s))};t.addEventListener(s,l),c(this,nt).push(()=>t.removeEventListener(s,l))}let n=()=>{var l,d,h;let s=t.srcObject;console.error("[livekit-video] attached <video> error",{code:(l=t.error)==null?void 0:l.code,message:(d=t.error)==null?void 0:d.message,readyState:t.readyState,networkState:t.networkState,paused:t.paused,srcObjectActive:s==null?void 0:s.active,tracks:s==null?void 0:s.getTracks().map(p=>({kind:p.kind,readyState:p.readyState,muted:p.muted,enabled:p.enabled})),documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState,roomState:(h=c(this,H))==null?void 0:h.state})};t.addEventListener("error",n),c(this,nt).push(()=>t.removeEventListener("error",n));let o=()=>{console.warn("[livekit-video] attached <video> stalled",{readyState:t.readyState,networkState:t.networkState,documentHidden:document.hidden})};t.addEventListener("stalled",o),c(this,nt).push(()=>t.removeEventListener("stalled",o))},Av=function(t){var l;C(this,U,ad).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let n=this.addVideoTrack("main");n.id="main",n.selected=!0;let o=[...r].sort((d,h)=>d.quality-h.quality);for(let d of o){let h=n.addRendition("",d.width,d.height,void 0,d.bitrate);h.id=`${d.quality}`}let s=()=>{let d=this.videoRenditions.selectedIndex;if(d<0)t.setVideoQuality(W.VideoQuality.HIGH);else{let h=o[d];h&&t.setVideoQuality(h.quality)}};this.videoRenditions.addEventListener("change",s),c(this,Xn).push(()=>this.videoRenditions.removeEventListener("change",s))},ad=function(){c(this,Xn).forEach(t=>t()),m(this,Xn,[]);for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},Sv=function(){var t,r,n;return{adaptiveStream:((t=c(this,Ye))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=c(this,Ye))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((n=c(this,Ye))==null?void 0:n.disconnectOnPageLeave)??!1}},kv=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=c(this,Ye))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=c(this,Ye))==null?void 0:r.iceTransportPolicy)??"all"}}},ld=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ns.shadowRootOptions={...We.shadowRootOptions};var Mr=Ns;globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",Mr);var Du=Mr;return Bv(Fb);})();
2942
+ `}get activeVideoElement(){return c(this,ce)}get config(){return c(this,Ye)}set config(t){m(this,Ye,t)}get url(){return this.getAttribute("url")}set url(t){t?this.setAttribute("url",t):this.removeAttribute("url")}get token(){return this.getAttribute("token")}set token(t){t?this.setAttribute("token",t):this.removeAttribute("token")}attributeChangedCallback(t,r,n){(t==="url"||t==="token")&&r!==n?this.url&&this.token?this.load():c(this,H)&&C(this,U,od).call(this):t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,n)}async load(){var De,gt,ii;let t=!c(this,H);C(this,U,od).call(this);let r=this.url,n=this.token;if(!r||!n)return;if(m(this,Cr,new Promise(y=>{m(this,Bi,y)})),t&&!c(this,Ye))try{m(this,Ye,JSON.parse(((gt=(De=this.shadowRoot)==null?void 0:De.getElementById("config"))==null?void 0:gt.textContent)||"{}"))}catch(y){console.error("[livekit-video] Failed to parse config:",y),m(this,Ye,{})}let o=C(this,U,kv).call(this),s=C(this,U,Lv).call(this);m(this,H,new W.Room(o)),this.room=c(this,H);let l=()=>{m(this,ft,"connected")},d=y=>{let L=y!=null?W.DisconnectReason[y]??String(y):"undefined";console.log("[livekit-video] Disconnected",{reason:y,reasonName:L,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState}),m(this,ft,"disconnected"),C(this,U,Os).call(this),y==null||y===W.DisconnectReason.UNKNOWN_REASON||y===W.DisconnectReason.ROOM_DELETED||y===W.DisconnectReason.ROOM_CLOSED?c(this,Et)||C(this,U,sd).call(this):this.dispatchEvent(Ne(new Error(`LiveKit disconnected: ${L} (${y})`),4001))},h=()=>{console.log("[livekit-video] Reconnecting",{documentHidden:document.hidden,documentHasFocus:document.hasFocus()}),m(this,ft,"reconnecting"),C(this,U,Pu).call(this),c(this,Et)||this.dispatchEvent(j(Vr))},p=()=>{var L;console.log("[livekit-video] Reconnected"),m(this,ft,"connected");let y=c(this,ce)!=null||[...((L=c(this,H))==null?void 0:L.remoteParticipants.values())??[]].some($=>$.videoTrackPublications.size>0);if(c(this,Jn)&&!y){c(this,Et)||C(this,U,sd).call(this);return}m(this,Et,!1),this.dispatchEvent(j(li))},g=()=>{console.log("[livekit-video] SignalReconnecting")},f=y=>{console.log("[livekit-video] ConnectionStateChanged",y)},E=y=>{console.error("[livekit-video] MediaDevicesError",y)},T=y=>{console.log("[livekit-video] AudioPlaybackStatusChanged",y),y?(C(this,U,Os).call(this),C(this,U,Zn).call(this)):C(this,U,xu).call(this)},v=(y,L,$)=>{console.error("[livekit-video] TrackSubscriptionFailed",{trackSid:y,reason:$})},S=y=>{console.log("[livekit-video] TrackMuted",{sid:y.trackSid,kind:y.kind})},I=y=>{console.log("[livekit-video] TrackUnmuted",{sid:y.trackSid,kind:y.kind})},F=(y,L)=>{var $,ue,re,Q;if(y.kind===W.Track.Kind.Video){let K=y.attach();K.style.width="100%",K.style.height="100%",K.style.position="absolute",K.style.top="0",K.style.left="0",K.playsInline=!0,K.setAttribute("playsinline",""),K.setAttribute("webkit-playsinline",""),this.nativeEl.muted&&(K.muted=!0),this.nativeEl.style.display="none",($=this.shadowRoot)==null||$.appendChild(K),m(this,ce,K),m(this,Et,!1),m(this,Jn,!0),C(this,U,Av).call(this,K),C(this,U,Sv).call(this,L),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:K}})),this.dispatchEvent(j(Rd)),this.dispatchEvent(j(di)),this.dispatchEvent(j(So)),this.dispatchEvent(j(li)),(ue=c(this,Bi))==null||ue.call(this)}else if(y.kind===W.Track.Kind.Audio){let K=y.attach();K.style.display="none",(re=this.shadowRoot)==null||re.appendChild(K),m(this,we,K),C(this,U,Zn).call(this);let Qe=()=>{c(this,we)===K&&C(this,U,Zn).call(this)};K.addEventListener(Br,Qe),(Q=c(this,ei))==null||Q.call(this),m(this,ei,()=>K.removeEventListener(Br,Qe)),c(this,H)&&!c(this,H).canPlaybackAudio&&C(this,U,xu).call(this)}},se=y=>{var L;y.kind===W.Track.Kind.Video?(y.detach(),C(this,U,ad).call(this),c(this,ce)&&(c(this,nt).forEach($=>$()),m(this,nt,[]),c(this,ce).remove(),m(this,ce,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}})),C(this,U,Tv).call(this))):y.kind===W.Track.Kind.Audio&&(y.detach(),c(this,we)&&(c(this,we).remove(),m(this,we,null)),(L=c(this,ei))==null||L.call(this),m(this,ei,null),C(this,U,Os).call(this))};c(this,H).on(W.RoomEvent.Connected,l),c(this,H).on(W.RoomEvent.Disconnected,d),c(this,H).on(W.RoomEvent.Reconnecting,h),c(this,H).on(W.RoomEvent.Reconnected,p),c(this,H).on(W.RoomEvent.SignalReconnecting,g),c(this,H).on(W.RoomEvent.ConnectionStateChanged,f),c(this,H).on(W.RoomEvent.MediaDevicesError,E),c(this,H).on(W.RoomEvent.AudioPlaybackStatusChanged,T),c(this,H).on(W.RoomEvent.TrackSubscribed,F),c(this,H).on(W.RoomEvent.TrackUnsubscribed,se),c(this,H).on(W.RoomEvent.TrackSubscriptionFailed,v),c(this,H).on(W.RoomEvent.TrackMuted,S),c(this,H).on(W.RoomEvent.TrackUnmuted,I),m(this,jn,[()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.Connected,l)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.Disconnected,d)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.Reconnecting,h)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.Reconnected,p)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.SignalReconnecting,g)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.ConnectionStateChanged,f)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.MediaDevicesError,E)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.AudioPlaybackStatusChanged,T)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.TrackSubscribed,F)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.TrackUnsubscribed,se)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.TrackSubscriptionFailed,v)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.TrackMuted,S)},()=>{var y;return(y=c(this,H))==null?void 0:y.off(W.RoomEvent.TrackUnmuted,I)}]),m(this,ft,"connecting"),this.dispatchEvent(j(Cd));try{await c(this,H).connect(r,n,s)}catch(y){m(this,ft,"failed"),console.error("[livekit-video] Failed to connect:",y);let L=y instanceof Error?y.message:"Failed to connect to LiveKit room";this.dispatchEvent(Ne(new Error(L),4e3)),(ii=c(this,Bi))==null||ii.call(this)}}async play(){return c(this,Cr)&&await c(this,Cr),c(this,ce)?c(this,ce).play():super.play()}pause(){if(c(this,ce)){c(this,ce).pause();return}super.pause()}get currentTime(){var t;return((t=c(this,ce))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){c(this,H)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=c(this,ce))==null?void 0:t.paused)??super.paused}get volume(){return super.volume}set volume(t){super.volume=t,c(this,ce)&&(c(this,ce).volume=t),c(this,we)&&(c(this,we).volume=t)}get muted(){return super.muted}set muted(t){super.muted=t,c(this,ce)&&(c(this,ce).muted=t),c(this,we)&&(c(this,we).muted=t)}get videoWidth(){var t;return((t=c(this,ce))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=c(this,ce))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;C(this,U,od).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Ye=new WeakMap,H=new WeakMap,ce=new WeakMap,we=new WeakMap,nt=new WeakMap,Xn=new WeakMap,jn=new WeakMap,ft=new WeakMap,Cr=new WeakMap,Bi=new WeakMap,Rr=new WeakMap,ei=new WeakMap,ti=new WeakMap,Et=new WeakMap,Jn=new WeakMap,U=new WeakSet,od=function(){var t,r;(t=c(this,Bi))==null||t.call(this),m(this,Cr,null),m(this,Bi,null),C(this,U,Pu).call(this),m(this,Et,!1),m(this,Jn,!1),c(this,nt).forEach(n=>n()),m(this,nt,[]),C(this,U,ad).call(this),c(this,jn).forEach(n=>n()),m(this,jn,[]),c(this,H)&&(c(this,H).disconnect(),m(this,H,null),this.room=null),c(this,ce)&&(c(this,ce).remove(),m(this,ce,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),c(this,we)&&(c(this,we).remove(),m(this,we,null)),(r=c(this,ei))==null||r.call(this),m(this,ei,null),C(this,U,Os).call(this),m(this,ft,"disconnected")},xu=function(){if(c(this,Rr))return;let t=!1,r=()=>{let n=c(this,H);if(!n)return;let o=n.startAudio();C(this,U,Zn).call(this),o.then(()=>{c(this,H)===n&&C(this,U,Zn).call(this)}).catch(s=>{t||(t=!0,console.warn("[livekit-video] startAudio failed",s))})};document.addEventListener("click",r,{capture:!0}),document.addEventListener("touchend",r,{capture:!0,passive:!0}),document.addEventListener("keydown",r,{capture:!0}),m(this,Rr,()=>{document.removeEventListener("click",r,{capture:!0}),document.removeEventListener("touchend",r,{capture:!0}),document.removeEventListener("keydown",r,{capture:!0})})},Os=function(){var t;(t=c(this,Rr))==null||t.call(this),m(this,Rr,null)},Tv=function(){c(this,ti)==null&&m(this,ti,setTimeout(()=>{m(this,ti,null),c(this,ft)==="connected"&&!c(this,ce)&&!c(this,Et)&&C(this,U,sd).call(this)},0))},sd=function(){m(this,Et,!0),this.dispatchEvent(j(ai)),this.dispatchEvent(j(To))},Pu=function(){c(this,ti)!=null&&(clearTimeout(c(this,ti)),m(this,ti,null))},Zn=function(){c(this,we)&&(c(this,we).muted=ud(Ns.prototype,this,"muted"),c(this,we).volume=ud(Ns.prototype,this,"volume"))},Av=function(t){c(this,nt).forEach(s=>s()),m(this,nt,[]);let r=[Ao,yo,li,ai,di];for(let s of r){let l=()=>{this.dispatchEvent(j(s))};t.addEventListener(s,l),c(this,nt).push(()=>t.removeEventListener(s,l))}let n=()=>{var l,d,h;let s=t.srcObject;console.error("[livekit-video] attached <video> error",{code:(l=t.error)==null?void 0:l.code,message:(d=t.error)==null?void 0:d.message,readyState:t.readyState,networkState:t.networkState,paused:t.paused,srcObjectActive:s==null?void 0:s.active,tracks:s==null?void 0:s.getTracks().map(p=>({kind:p.kind,readyState:p.readyState,muted:p.muted,enabled:p.enabled})),documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState,roomState:(h=c(this,H))==null?void 0:h.state})};t.addEventListener("error",n),c(this,nt).push(()=>t.removeEventListener("error",n));let o=()=>{console.warn("[livekit-video] attached <video> stalled",{readyState:t.readyState,networkState:t.networkState,documentHidden:document.hidden})};t.addEventListener("stalled",o),c(this,nt).push(()=>t.removeEventListener("stalled",o))},Sv=function(t){var l;C(this,U,ad).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let n=this.addVideoTrack("main");n.id="main",n.selected=!0;let o=[...r].sort((d,h)=>d.quality-h.quality);for(let d of o){let h=n.addRendition("",d.width,d.height,void 0,d.bitrate);h.id=`${d.quality}`}let s=()=>{let d=this.videoRenditions.selectedIndex;if(d<0)t.setVideoQuality(W.VideoQuality.HIGH);else{let h=o[d];h&&t.setVideoQuality(h.quality)}};this.videoRenditions.addEventListener("change",s),c(this,Xn).push(()=>this.videoRenditions.removeEventListener("change",s))},ad=function(){c(this,Xn).forEach(t=>t()),m(this,Xn,[]);for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},kv=function(){var t,r,n;return{adaptiveStream:((t=c(this,Ye))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=c(this,Ye))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((n=c(this,Ye))==null?void 0:n.disconnectOnPageLeave)??!1}},Lv=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=c(this,Ye))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=c(this,Ye))==null?void 0:r.iceTransportPolicy)??"all"}}},ld=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ns.shadowRootOptions={...We.shadowRootOptions};var Mr=Ns;globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",Mr);var Du=Mr;return Wv(Kb);})();
2943
2943
  /*! Bundled license information:
2944
2944
 
2945
2945
  @lit/reactive-element/css-tag.js: