@broadcastingplatforms/player 0.0.0-dev.5a7dff6 → 0.0.0-dev.69b5249

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 (v0.0.0-dev.5a7dff6)
2
+ * BP Player (v0.0.0-dev.69b5249)
3
3
  * Universal video player web component
4
4
  */
5
- "use strict";var BPPlayer=(()=>{var Om=Object.create;var pr=Object.defineProperty;var ou=Object.getOwnPropertyDescriptor;var Um=Object.getOwnPropertyNames;var Nm=Object.getPrototypeOf,$m=Object.prototype.hasOwnProperty;var nu=i=>{throw TypeError(i)};var Hm=(i,e,t)=>e in i?pr(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var au=(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 Bm=(i,e)=>{for(var t in e)pr(i,t,{get:e[t],enumerable:!0})},su=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Um(e))!$m.call(i,o)&&o!==t&&pr(i,o,{get:()=>e[o],enumerable:!(r=ou(e,o))||r.enumerable});return i};var Vm=(i,e,t)=>(t=i!=null?Om(Nm(i)):{},su(e||!i||!i.__esModule?pr(t,"default",{value:i,enumerable:!0}):t,i)),Wm=i=>su(pr({},"__esModule",{value:!0}),i),x=(i,e,t,r)=>{for(var o=r>1?void 0:r?ou(e,t):e,n=i.length-1,a;n>=0;n--)(a=i[n])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&pr(e,t,o),o};var H=(i,e,t)=>Hm(i,typeof e!="symbol"?e+"":e,t),Al=(i,e,t)=>e.has(i)||nu("Cannot "+t);var u=(i,e,t)=>(Al(i,e,"read from private field"),t?t.call(i):e.get(i)),S=(i,e,t)=>e.has(i)?nu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),_=(i,e,t,r)=>(Al(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),U=(i,e,t)=>(Al(i,e,"access private method"),t);var FE={};Bm(FE,{Attribute:()=>zo,BPDefaultUI:()=>z,BPErrorDisplay:()=>Ht,BPLiveError:()=>at,BPLiveService:()=>fr,BPOverlay:()=>It,BPPlayer:()=>fe,Hls:()=>Se.default,HlsVideo:()=>bi,HlsVideoElement:()=>Pc,LiveKitVideo:()=>Si,LiveKitVideoElement:()=>Nc,NANOPLAYER_NO_REPLAY_CODES:()=>ku,NanoVideo:()=>Ai,NanoVideoElement:()=>Oc,PlayerCoreImpl:()=>Ko,StateReceiverMixin:()=>Iu,StateReceiverProps:()=>Ri,addGlobalStyles:()=>gr,classifyNanoPlayerError:()=>Lu,createInitialState:()=>Wo,createPlayerCore:()=>ca,createTemplate:()=>xu,forEachStateReceiverElement:()=>xi,isBPLiveClipSource:()=>Mi,isBPLiveSource:()=>wu,isBPLiveStreamSource:()=>Fo,isStateReceiverElement:()=>ua,propagateStateToReceiver:()=>qo,removeStateFromReceiver:()=>Go,templateWithStyles:()=>Pu,toggleAttribute:()=>Te});var na=globalThis,aa=na.ShadowRoot&&(na.ShadyCSS===void 0||na.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Sl=Symbol(),lu=new WeakMap,xo=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Sl)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(aa&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=lu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&lu.set(t,e))}return e}toString(){return this.cssText}},du=i=>new xo(typeof i=="string"?i:i+"",void 0,Sl),Po=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,o,n)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[n+1],i[0]);return new xo(t,i,Sl)},cu=(i,e)=>{if(aa)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),o=na.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},kl=aa?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return du(t)})(i):i;var{is:Fm,defineProperty:Km,getOwnPropertyDescriptor:qm,getOwnPropertyNames:Gm,getOwnPropertySymbols:zm,getPrototypeOf:Ym}=Object,Kt=globalThis,uu=Kt.trustedTypes,Qm=uu?uu.emptyScript:"",Ll=Kt.reactiveElementPolyfillSupport,Do=(i,e)=>i,Oo={toAttribute(i,e){switch(e){case Boolean:i=i?Qm: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}},sa=(i,e)=>!Fm(i,e),hu={attribute:!0,type:String,converter:Oo,reflect:!1,useDefault:!1,hasChanged:sa};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Kt.litPropertyMetadata??(Kt.litPropertyMetadata=new WeakMap);var xt=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=hu){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(),o=this.getPropertyDescriptor(e,r,t);o!==void 0&&Km(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:n}=qm(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:o,set(a){let l=o==null?void 0:o.call(this);n==null||n.call(this,a),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??hu}static _$Ei(){if(this.hasOwnProperty(Do("elementProperties")))return;let e=Ym(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Do("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Do("properties"))){let t=this.properties,r=[...Gm(t),...zm(t)];for(let o of r)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,o]of t)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let o=this._$Eu(t,r);o!==void 0&&this._$Eh.set(o,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 o of r)t.unshift(kl(o))}else e!==void 0&&t.push(kl(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 cu(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 n;let r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){let a=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:Oo).toAttribute(t,r.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,t){var n,a;let r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let l=r.getPropertyOptions(o),c=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:Oo;this._$Em=o;let p=c.fromAttribute(t,l.type);this[o]=p??((a=this._$Ej)==null?void 0:a.get(o))??p,this._$Em=null}}requestUpdate(e,t,r){var o;if(e!==void 0){let n=this.constructor,a=this[e];if(r??(r=n.getPropertyOptions(e)),!((r.hasChanged??sa)(a,t)||r.useDefault&&r.reflect&&a===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(n._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:o,wrapped:n},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),n!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),o===!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[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o){let{wrapped:l}=a,c=this[n];l!==!0||this._$AL.has(n)||c===void 0||this.C(n,void 0,a,c)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var o;return(o=r.hostUpdated)==null?void 0:o.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){}};xt.elementStyles=[],xt.shadowRootOptions={mode:"open"},xt[Do("elementProperties")]=new Map,xt[Do("finalized")]=new Map,Ll==null||Ll({ReactiveElement:xt}),(Kt.reactiveElementVersions??(Kt.reactiveElementVersions=[])).push("2.1.1");var No=globalThis,la=No.trustedTypes,pu=la?la.createPolicy("lit-html",{createHTML:i=>i}):void 0,bu="$lit$",qt=`lit$${Math.random().toFixed(9).slice(2)}$`,_u="?"+qt,Zm=`<${_u}>`,wi=document,$o=()=>wi.createComment(""),Ho=i=>i===null||typeof i!="object"&&typeof i!="function",Dl=Array.isArray,Xm=i=>Dl(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",wl=`[
5
+ "use strict";var BPPlayer=(()=>{var Nm=Object.create;var pr=Object.defineProperty;var ou=Object.getOwnPropertyDescriptor;var Hm=Object.getOwnPropertyNames;var $m=Object.getPrototypeOf,Bm=Object.prototype.hasOwnProperty;var nu=i=>{throw TypeError(i)};var Vm=(i,e,t)=>e in i?pr(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var au=(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 Wm=(i,e)=>{for(var t in e)pr(i,t,{get:e[t],enumerable:!0})},su=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Hm(e))!Bm.call(i,o)&&o!==t&&pr(i,o,{get:()=>e[o],enumerable:!(r=ou(e,o))||r.enumerable});return i};var Fm=(i,e,t)=>(t=i!=null?Nm($m(i)):{},su(e||!i||!i.__esModule?pr(t,"default",{value:i,enumerable:!0}):t,i)),Km=i=>su(pr({},"__esModule",{value:!0}),i),x=(i,e,t,r)=>{for(var o=r>1?void 0:r?ou(e,t):e,n=i.length-1,a;n>=0;n--)(a=i[n])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&pr(e,t,o),o};var $=(i,e,t)=>Vm(i,typeof e!="symbol"?e+"":e,t),Al=(i,e,t)=>e.has(i)||nu("Cannot "+t);var u=(i,e,t)=>(Al(i,e,"read from private field"),t?t.call(i):e.get(i)),S=(i,e,t)=>e.has(i)?nu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),_=(i,e,t,r)=>(Al(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),U=(i,e,t)=>(Al(i,e,"access private method"),t);var qE={};Wm(qE,{Attribute:()=>zo,BPDefaultUI:()=>z,BPErrorDisplay:()=>$t,BPLiveError:()=>at,BPLiveService:()=>fr,BPOverlay:()=>Ct,BPPlayer:()=>fe,Hls:()=>Se.default,HlsVideo:()=>bi,HlsVideoElement:()=>Pc,LiveKitVideo:()=>Si,LiveKitVideoElement:()=>Nc,NANOPLAYER_NO_REPLAY_CODES:()=>ku,NanoVideo:()=>Ai,NanoVideoElement:()=>Oc,PlayerCoreImpl:()=>Ko,StateReceiverMixin:()=>Cu,StateReceiverProps:()=>Ri,addGlobalStyles:()=>gr,classifyNanoPlayerError:()=>Lu,createInitialState:()=>Wo,createPlayerCore:()=>ca,createTemplate:()=>xu,forEachStateReceiverElement:()=>xi,isBPLiveClipSource:()=>Mi,isBPLiveSource:()=>wu,isBPLiveStreamSource:()=>Fo,isStateReceiverElement:()=>ua,propagateStateToReceiver:()=>qo,removeStateFromReceiver:()=>Go,templateWithStyles:()=>Pu,toggleAttribute:()=>Te});var na=globalThis,aa=na.ShadowRoot&&(na.ShadyCSS===void 0||na.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Sl=Symbol(),lu=new WeakMap,xo=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Sl)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(aa&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=lu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&lu.set(t,e))}return e}toString(){return this.cssText}},du=i=>new xo(typeof i=="string"?i:i+"",void 0,Sl),Po=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,o,n)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[n+1],i[0]);return new xo(t,i,Sl)},cu=(i,e)=>{if(aa)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),o=na.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},kl=aa?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return du(t)})(i):i;var{is:qm,defineProperty:Gm,getOwnPropertyDescriptor:zm,getOwnPropertyNames:Ym,getOwnPropertySymbols:Qm,getPrototypeOf:Zm}=Object,Kt=globalThis,uu=Kt.trustedTypes,Xm=uu?uu.emptyScript:"",Ll=Kt.reactiveElementPolyfillSupport,Do=(i,e)=>i,Oo={toAttribute(i,e){switch(e){case Boolean:i=i?Xm: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}},sa=(i,e)=>!qm(i,e),hu={attribute:!0,type:String,converter:Oo,reflect:!1,useDefault:!1,hasChanged:sa};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Kt.litPropertyMetadata??(Kt.litPropertyMetadata=new WeakMap);var xt=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=hu){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(),o=this.getPropertyDescriptor(e,r,t);o!==void 0&&Gm(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:n}=zm(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:o,set(a){let l=o==null?void 0:o.call(this);n==null||n.call(this,a),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??hu}static _$Ei(){if(this.hasOwnProperty(Do("elementProperties")))return;let e=Zm(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Do("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Do("properties"))){let t=this.properties,r=[...Ym(t),...Qm(t)];for(let o of r)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,o]of t)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let o=this._$Eu(t,r);o!==void 0&&this._$Eh.set(o,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 o of r)t.unshift(kl(o))}else e!==void 0&&t.push(kl(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 cu(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 n;let r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){let a=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:Oo).toAttribute(t,r.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,t){var n,a;let r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let l=r.getPropertyOptions(o),c=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:Oo;this._$Em=o;let m=c.fromAttribute(t,l.type);this[o]=m??((a=this._$Ej)==null?void 0:a.get(o))??m,this._$Em=null}}requestUpdate(e,t,r){var o;if(e!==void 0){let n=this.constructor,a=this[e];if(r??(r=n.getPropertyOptions(e)),!((r.hasChanged??sa)(a,t)||r.useDefault&&r.reflect&&a===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(n._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:o,wrapped:n},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),n!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),o===!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[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,a]of o){let{wrapped:l}=a,c=this[n];l!==!0||this._$AL.has(n)||c===void 0||this.C(n,void 0,a,c)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var o;return(o=r.hostUpdated)==null?void 0:o.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){}};xt.elementStyles=[],xt.shadowRootOptions={mode:"open"},xt[Do("elementProperties")]=new Map,xt[Do("finalized")]=new Map,Ll==null||Ll({ReactiveElement:xt}),(Kt.reactiveElementVersions??(Kt.reactiveElementVersions=[])).push("2.1.1");var No=globalThis,la=No.trustedTypes,pu=la?la.createPolicy("lit-html",{createHTML:i=>i}):void 0,bu="$lit$",qt=`lit$${Math.random().toFixed(9).slice(2)}$`,_u="?"+qt,Jm=`<${_u}>`,wi=document,Ho=()=>wi.createComment(""),$o=i=>i===null||typeof i!="object"&&typeof i!="function",Dl=Array.isArray,jm=i=>Dl(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",wl=`[
6
6
  \f\r]`,Uo=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,mu=/-->/g,vu=/>/g,ki=RegExp(`>|${wl}(?:([^\\s"'>=/]+)(${wl}*=${wl}*(?:[^
7
- \f\r"'\`<>=]|("|')|))|$)`,"g"),fu=/'/g,gu=/"/g,yu=/^(?:script|style|textarea|title)$/i,Ol=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),He=Ol(1),ZE=Ol(2),XE=Ol(3),Ii=Symbol.for("lit-noChange"),ae=Symbol.for("lit-nothing"),Eu=new WeakMap,Li=wi.createTreeWalker(wi,129);function Tu(i,e){if(!Dl(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return pu!==void 0?pu.createHTML(e):e}var Jm=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",a=Uo;for(let l=0;l<t;l++){let c=i[l],p,h,v=-1,g=0;for(;g<c.length&&(a.lastIndex=g,h=a.exec(c),h!==null);)g=a.lastIndex,a===Uo?h[1]==="!--"?a=mu:h[1]!==void 0?a=vu:h[2]!==void 0?(yu.test(h[2])&&(o=RegExp("</"+h[2],"g")),a=ki):h[3]!==void 0&&(a=ki):a===ki?h[0]===">"?(a=o??Uo,v=-1):h[1]===void 0?v=-2:(v=a.lastIndex-h[2].length,p=h[1],a=h[3]===void 0?ki:h[3]==='"'?gu:fu):a===gu||a===fu?a=ki:a===mu||a===vu?a=Uo:(a=ki,o=void 0);let m=a===ki&&i[l+1].startsWith("/>")?" ":"";n+=a===Uo?c+Zm:v>=0?(r.push(p),c.slice(0,v)+bu+c.slice(v)+qt+m):c+qt+(v===-2?l:m)}return[Tu(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},Bo=class i{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,a=0,l=e.length-1,c=this.parts,[p,h]=Jm(e,t);if(this.el=i.createElement(p,r),Li.currentNode=this.el.content,t===2||t===3){let v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(o=Li.nextNode())!==null&&c.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let v of o.getAttributeNames())if(v.endsWith(bu)){let g=h[a++],m=o.getAttribute(v).split(qt),A=/([.?@])?(.*)/.exec(g);c.push({type:1,index:n,name:A[2],strings:m,ctor:A[1]==="."?Ml:A[1]==="?"?Rl:A[1]==="@"?xl:vr}),o.removeAttribute(v)}else v.startsWith(qt)&&(c.push({type:6,index:n}),o.removeAttribute(v));if(yu.test(o.tagName)){let v=o.textContent.split(qt),g=v.length-1;if(g>0){o.textContent=la?la.emptyScript:"";for(let m=0;m<g;m++)o.append(v[m],$o()),Li.nextNode(),c.push({type:2,index:++n});o.append(v[g],$o())}}}else if(o.nodeType===8)if(o.data===_u)c.push({type:2,index:n});else{let v=-1;for(;(v=o.data.indexOf(qt,v+1))!==-1;)c.push({type:7,index:n}),v+=qt.length-1}n++}}static createElement(e,t){let r=wi.createElement("template");return r.innerHTML=e,r}};function mr(i,e,t=i,r){var a,l;if(e===Ii)return e;let o=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl,n=Ho(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==n&&((l=o==null?void 0:o._$AO)==null||l.call(o,!1),n===void 0?o=void 0:(o=new n(i),o._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=o:t._$Cl=o),o!==void 0&&(e=mr(i,o._$AS(i,e.values),o,r)),e}var Cl=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,o=((e==null?void 0:e.creationScope)??wi).importNode(t,!0);Li.currentNode=o;let n=Li.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let p;c.type===2?p=new Vo(n,n.nextSibling,this,e):c.type===1?p=new c.ctor(n,c.name,c.strings,this,e):c.type===6&&(p=new Pl(n,this,e)),this._$AV.push(p),c=r[++l]}a!==(c==null?void 0:c.index)&&(n=Li.nextNode(),a++)}return Li.currentNode=wi,o}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++}},Vo=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,o){this.type=2,this._$AH=ae,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=o,this._$Cv=(o==null?void 0:o.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=mr(this,e,t),Ho(e)?e===ae||e==null||e===""?(this._$AH!==ae&&this._$AR(),this._$AH=ae):e!==this._$AH&&e!==Ii&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Xm(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&&Ho(this._$AH)?this._$AA.nextSibling.data=e:this.T(wi.createTextNode(e)),this._$AH=e}$(e){var n;let{values:t,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Bo.createElement(Tu(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===o)this._$AH.p(t);else{let a=new Cl(o,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=Eu.get(e.strings);return t===void 0&&Eu.set(e.strings,t=new Bo(e)),t}k(e){Dl(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,o=0;for(let n of e)o===t.length?t.push(r=new i(this.O($o()),this.O($o()),this,this.options)):r=t[o],r._$AI(n),o++;o<t.length&&(this._$AR(r&&r._$AB.nextSibling,o),t.length=o)}_$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 o=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},vr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,n){this.type=1,this._$AH=ae,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=n,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,o){let n=this.strings,a=!1;if(n===void 0)e=mr(this,e,t,0),a=!Ho(e)||e!==this._$AH&&e!==Ii,a&&(this._$AH=e);else{let l=e,c,p;for(e=n[0],c=0;c<n.length-1;c++)p=mr(this,l[r+c],t,c),p===Ii&&(p=this._$AH[c]),a||(a=!Ho(p)||p!==this._$AH[c]),p===ae?e=ae:e!==ae&&(e+=(p??"")+n[c+1]),this._$AH[c]=p}a&&!o&&this.j(e)}j(e){e===ae?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ml=class extends vr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ae?void 0:e}},Rl=class extends vr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ae)}},xl=class extends vr{constructor(e,t,r,o,n){super(e,t,r,o,n),this.type=5}_$AI(e,t=this){if((e=mr(this,e,t,0)??ae)===Ii)return;let r=this._$AH,o=e===ae&&r!==ae||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==ae&&(r===ae||o);o&&this.element.removeEventListener(this.name,this,r),n&&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)}},Pl=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){mr(this,e)}};var Il=No.litHtmlPolyfillSupport;Il==null||Il(Bo,Vo),(No.litHtmlVersions??(No.litHtmlVersions=[])).push("3.3.1");var Au=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,o=r._$litPart$;if(o===void 0){let n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new Vo(e.insertBefore($o(),n),n,void 0,t??{})}return o._$AI(i),o};var Ci=globalThis,Ie=class extends xt{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=Au(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 Ii}},Su;Ie._$litElement$=!0,Ie.finalized=!0,(Su=Ci.litElementHydrateSupport)==null||Su.call(Ci,{LitElement:Ie});var Ul=Ci.litElementPolyfillSupport;Ul==null||Ul({LitElement:Ie});(Ci.litElementVersions??(Ci.litElementVersions=[])).push("4.2.1");var Gt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var jm={attribute:!0,type:String,converter:Oo,reflect:!1,hasChanged:sa},ev=(i=jm,e,t)=>{let{kind:r,metadata:o}=t,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){let{name:a}=t;return{set(l){let c=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,c,i)},init(l){return l!==void 0&&this.C(a,void 0,i,l),l}}}if(r==="setter"){let{name:a}=t;return function(l){let c=this[a];e.call(this,l),this.requestUpdate(a,c,i)}}throw Error("Unsupported decorator location: "+r)};function V(i){return(e,t)=>typeof t=="object"?ev(i,e,t):((r,o,n)=>{let a=o.hasOwnProperty(n);return o.constructor.createProperty(n,r),a?Object.getOwnPropertyDescriptor(o,n):void 0})(i,e,t)}function Ce(i){return V({...i,state:!0,attribute:!1})}var ku=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Lu(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 Wo(){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 Fo(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function Mi(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function wu(i){return Fo(i)||Mi(i)}var at=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},fr=class{constructor(e){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??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 at("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`}});if(!r.ok)throw new at(`HTTP ${r.status}: ${r.statusText}`,"HTTP_ERROR",r.status);return r.json()}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 at(`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 o=r.find(l=>l.orientation===t);if(o)return o;let n=t==="landscape"?"portrait":"landscape",a=r.find(l=>l.orientation===n);return a||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,Fo(e))return this.resolveStreamSource(e);if(Mi(e))return this.resolveClipSource(e);throw new at("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 a,l,c;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=r.player_source??((a=r.active_stream)==null?void 0:a.player_source),n=this.extractStreamPoster(r);if(o)return{source:this.mapPlayerSourceToResolvedSource(o),contentType:"stream",poster:n};if(((c=(l=r.media)==null?void 0:l.vod)==null?void 0:c.length)>0){let p=r.media.vod[0];return{source:{type:"video",url:p.original},contentType:"video",poster:n??p.thumb??void 0}}throw new at("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 o=this.selectClipMedia(r.media,e.preferredOrientation);if(!o)throw new at("No playable media found in clip","NO_MEDIA");let n=o.orientation==="portrait"||e.preferredOrientation==="portrait";return{source:this.mapClipMediaToPlayerSource(o),contentType:"clip",poster:o.thumbnail??void 0,aspectRatio:n?"9 / 16":"16 / 9"}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function tv(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 iv(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var rv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],Ko=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._state=Wo()}get state(){return this._state}get videoElement(){return this._mediaElement}get bpLive(){return this._bpLive}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r)this._listeners.has(o)||this._listeners.set(o,new Set),this._listeners.get(o).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r){let n=this._listeners.get(o);n&&(n.delete(t),n.size===0&&this._listeners.delete(o))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let o of r)try{o(t)}catch(n){console.error(`[PlayerCore] Error in event listener for "${e}":`,n)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}async loadSource(e,t,r){if(!this._destroyed){this.unloadSource(),this._container=t,this.updateState({connectionState:"connecting"}),this.dispatch("sourcechange",{source:e});try{let o=e,n=this._state.contentType,a,l;if(iv(e)){if(r!=null&&r.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new fr(r.bpLive)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let g=await this._bpLive.resolveSource(e);o=g.source,n=g.contentType,a=g.poster,l=g.aspectRatio}let c=tv(o),v=c==="nano"||c==="livekit"||n==="stream"?"live":"vod";return this.updateState({providerType:c,contentType:n,streamType:v}),this._mediaElement=this.createMediaElement(c,o,r),this._mediaElement.style.width="100%",this._mediaElement.style.height="100%",this._mediaElement.style.objectFit="contain",this._state.muted&&(this._mediaElement.muted=!0),this._state.loop&&(this._mediaElement.loop=!0),this.attachMediaElementListeners(this._mediaElement),t.appendChild(this._mediaElement),this.dispatch("videoelementchange",{video:this._mediaElement}),{poster:a,aspectRatio:l}}catch(o){console.error("[PlayerCore] loadSource error:",o);let n={code:-1,message:o instanceof Error?o.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:n,connectionState:"failed"}),this.dispatch("error",n)}}}createMediaElement(e,t,r){switch(e){case"nano":{let o=document.createElement("nano-video"),n=t;return o.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",n.source?o.sourceConfig=n.source:n.streamid&&(o.streamid=n.streamid),r!=null&&r.nano&&(o.config=r.nano),o}case"livekit":{let o=document.createElement("livekit-video"),n=t;return o.url=n.url,o.token=n.token,r!=null&&r.livekit&&(o.config=r.livekit),o}case"video":default:{let o=document.createElement("hls-video"),n=typeof t=="string"?t:t.url;return o.src=n,r!=null&&r.video&&(o.config=r.video),o}}}attachMediaElementListeners(e){for(let t of rv){let r=()=>this.handleMediaEvent(t,e);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}handleMediaEvent(e,t){var r,o;switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let a=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:a}),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({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 a=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:a}),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}),this.dispatch("ended",void 0);break;case"progress":this.updateState({buffered:t.buffered}),this.dispatch("progress",{buffered:t.buffered});break;case"error":let n={code:((r=t.error)==null?void 0:r.code)??-1,message:((o=t.error)==null?void 0:o.message)??"Unknown error",fatal:!0,category:"media"};this.updateState({error:n}),this.dispatch("error",n);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._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null),this.updateState({...Wo(),volume:this._state.volume,muted:this._state.muted,playbackRate:this._state.playbackRate}),this.dispatch("videoelementchange",{video:null}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1}),this.dispatch("play",void 0);try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),this.dispatch("pause",void 0),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this.dispatch("pause",void 0),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)}setFullscreen(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"})}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){this._destroyed||(this._destroyed=!0,this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this.dispatch("destroy",void 0),this._listeners.clear())}};function ca(){return new Ko}var Ri="bpPlayerObservedProperties";function ua(i){return Ri in i&&Array.isArray(i[Ri])}function Iu(i,e){class t extends i{get[Ri](){return e}}return t}function ov(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 xi(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!ua(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),ua(i)&&t(i);let r=ov(i);r.length>0&&await Promise.all(r.map(o=>xi(o,e,t)))}function qo(i,e,t){let r=i[Ri];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 Go(i){i[Ri].includes("player")&&(i.player=void 0)}var Cu=`/**
7
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),fu=/'/g,gu=/"/g,yu=/^(?:script|style|textarea|title)$/i,Ol=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),$e=Ol(1),JE=Ol(2),jE=Ol(3),Ci=Symbol.for("lit-noChange"),ae=Symbol.for("lit-nothing"),Eu=new WeakMap,Li=wi.createTreeWalker(wi,129);function Tu(i,e){if(!Dl(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return pu!==void 0?pu.createHTML(e):e}var ev=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",a=Uo;for(let l=0;l<t;l++){let c=i[l],m,h,v=-1,g=0;for(;g<c.length&&(a.lastIndex=g,h=a.exec(c),h!==null);)g=a.lastIndex,a===Uo?h[1]==="!--"?a=mu:h[1]!==void 0?a=vu:h[2]!==void 0?(yu.test(h[2])&&(o=RegExp("</"+h[2],"g")),a=ki):h[3]!==void 0&&(a=ki):a===ki?h[0]===">"?(a=o??Uo,v=-1):h[1]===void 0?v=-2:(v=a.lastIndex-h[2].length,m=h[1],a=h[3]===void 0?ki:h[3]==='"'?gu:fu):a===gu||a===fu?a=ki:a===mu||a===vu?a=Uo:(a=ki,o=void 0);let p=a===ki&&i[l+1].startsWith("/>")?" ":"";n+=a===Uo?c+Jm:v>=0?(r.push(m),c.slice(0,v)+bu+c.slice(v)+qt+p):c+qt+(v===-2?l:p)}return[Tu(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},Bo=class i{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,a=0,l=e.length-1,c=this.parts,[m,h]=ev(e,t);if(this.el=i.createElement(m,r),Li.currentNode=this.el.content,t===2||t===3){let v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(o=Li.nextNode())!==null&&c.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let v of o.getAttributeNames())if(v.endsWith(bu)){let g=h[a++],p=o.getAttribute(v).split(qt),A=/([.?@])?(.*)/.exec(g);c.push({type:1,index:n,name:A[2],strings:p,ctor:A[1]==="."?Ml:A[1]==="?"?Rl:A[1]==="@"?xl:vr}),o.removeAttribute(v)}else v.startsWith(qt)&&(c.push({type:6,index:n}),o.removeAttribute(v));if(yu.test(o.tagName)){let v=o.textContent.split(qt),g=v.length-1;if(g>0){o.textContent=la?la.emptyScript:"";for(let p=0;p<g;p++)o.append(v[p],Ho()),Li.nextNode(),c.push({type:2,index:++n});o.append(v[g],Ho())}}}else if(o.nodeType===8)if(o.data===_u)c.push({type:2,index:n});else{let v=-1;for(;(v=o.data.indexOf(qt,v+1))!==-1;)c.push({type:7,index:n}),v+=qt.length-1}n++}}static createElement(e,t){let r=wi.createElement("template");return r.innerHTML=e,r}};function mr(i,e,t=i,r){var a,l;if(e===Ci)return e;let o=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl,n=$o(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==n&&((l=o==null?void 0:o._$AO)==null||l.call(o,!1),n===void 0?o=void 0:(o=new n(i),o._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=o:t._$Cl=o),o!==void 0&&(e=mr(i,o._$AS(i,e.values),o,r)),e}var Il=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,o=((e==null?void 0:e.creationScope)??wi).importNode(t,!0);Li.currentNode=o;let n=Li.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let m;c.type===2?m=new Vo(n,n.nextSibling,this,e):c.type===1?m=new c.ctor(n,c.name,c.strings,this,e):c.type===6&&(m=new Pl(n,this,e)),this._$AV.push(m),c=r[++l]}a!==(c==null?void 0:c.index)&&(n=Li.nextNode(),a++)}return Li.currentNode=wi,o}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++}},Vo=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,o){this.type=2,this._$AH=ae,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=o,this._$Cv=(o==null?void 0:o.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=mr(this,e,t),$o(e)?e===ae||e==null||e===""?(this._$AH!==ae&&this._$AR(),this._$AH=ae):e!==this._$AH&&e!==Ci&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):jm(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&&$o(this._$AH)?this._$AA.nextSibling.data=e:this.T(wi.createTextNode(e)),this._$AH=e}$(e){var n;let{values:t,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Bo.createElement(Tu(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===o)this._$AH.p(t);else{let a=new Il(o,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=Eu.get(e.strings);return t===void 0&&Eu.set(e.strings,t=new Bo(e)),t}k(e){Dl(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,o=0;for(let n of e)o===t.length?t.push(r=new i(this.O(Ho()),this.O(Ho()),this,this.options)):r=t[o],r._$AI(n),o++;o<t.length&&(this._$AR(r&&r._$AB.nextSibling,o),t.length=o)}_$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 o=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},vr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,n){this.type=1,this._$AH=ae,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=n,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,o){let n=this.strings,a=!1;if(n===void 0)e=mr(this,e,t,0),a=!$o(e)||e!==this._$AH&&e!==Ci,a&&(this._$AH=e);else{let l=e,c,m;for(e=n[0],c=0;c<n.length-1;c++)m=mr(this,l[r+c],t,c),m===Ci&&(m=this._$AH[c]),a||(a=!$o(m)||m!==this._$AH[c]),m===ae?e=ae:e!==ae&&(e+=(m??"")+n[c+1]),this._$AH[c]=m}a&&!o&&this.j(e)}j(e){e===ae?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ml=class extends vr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ae?void 0:e}},Rl=class extends vr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ae)}},xl=class extends vr{constructor(e,t,r,o,n){super(e,t,r,o,n),this.type=5}_$AI(e,t=this){if((e=mr(this,e,t,0)??ae)===Ci)return;let r=this._$AH,o=e===ae&&r!==ae||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==ae&&(r===ae||o);o&&this.element.removeEventListener(this.name,this,r),n&&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)}},Pl=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){mr(this,e)}};var Cl=No.litHtmlPolyfillSupport;Cl==null||Cl(Bo,Vo),(No.litHtmlVersions??(No.litHtmlVersions=[])).push("3.3.1");var Au=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,o=r._$litPart$;if(o===void 0){let n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new Vo(e.insertBefore(Ho(),n),n,void 0,t??{})}return o._$AI(i),o};var Ii=globalThis,Ce=class extends xt{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=Au(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 Ci}},Su;Ce._$litElement$=!0,Ce.finalized=!0,(Su=Ii.litElementHydrateSupport)==null||Su.call(Ii,{LitElement:Ce});var Ul=Ii.litElementPolyfillSupport;Ul==null||Ul({LitElement:Ce});(Ii.litElementVersions??(Ii.litElementVersions=[])).push("4.2.1");var Gt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var tv={attribute:!0,type:String,converter:Oo,reflect:!1,hasChanged:sa},iv=(i=tv,e,t)=>{let{kind:r,metadata:o}=t,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){let{name:a}=t;return{set(l){let c=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,c,i)},init(l){return l!==void 0&&this.C(a,void 0,i,l),l}}}if(r==="setter"){let{name:a}=t;return function(l){let c=this[a];e.call(this,l),this.requestUpdate(a,c,i)}}throw Error("Unsupported decorator location: "+r)};function V(i){return(e,t)=>typeof t=="object"?iv(i,e,t):((r,o,n)=>{let a=o.hasOwnProperty(n);return o.constructor.createProperty(n,r),a?Object.getOwnPropertyDescriptor(o,n):void 0})(i,e,t)}function Ie(i){return V({...i,state:!0,attribute:!1})}var ku=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Lu(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 Wo(){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 Fo(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function Mi(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function wu(i){return Fo(i)||Mi(i)}var at=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},fr=class{constructor(e){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??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 at("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`}});if(!r.ok)throw new at(`HTTP ${r.status}: ${r.statusText}`,"HTTP_ERROR",r.status);return r.json()}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 at(`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 o=r.find(l=>l.orientation===t);if(o)return o;let n=t==="landscape"?"portrait":"landscape",a=r.find(l=>l.orientation===n);return a||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,Fo(e))return this.resolveStreamSource(e);if(Mi(e))return this.resolveClipSource(e);throw new at("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 a,l,c,m,h;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=r.player_source??((a=r.active_stream)==null?void 0:a.player_source),n=this.extractStreamPoster(r);if(o)return{source:this.mapPlayerSourceToResolvedSource(o),contentType:"stream",poster:n};if(((c=(l=r.media)==null?void 0:l.vod)==null?void 0:c.length)>0){let v=r.media.vod[0];return{source:{type:"video",url:v.original},contentType:"video",poster:n??v.thumb??void 0,videoWidth:(m=v.dimension)==null?void 0:m.width,videoHeight:(h=v.dimension)==null?void 0:h.height}}throw new at("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 o=this.selectClipMedia(r.media,e.preferredOrientation);if(!o)throw new at("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(o),contentType:"clip",poster:o.thumbnail??void 0,videoWidth:o.width,videoHeight:o.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function rv(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 ov(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var nv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],Ko=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._state=Wo()}get state(){return this._state}get videoElement(){return this._mediaElement}get bpLive(){return this._bpLive}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r)this._listeners.has(o)||this._listeners.set(o,new Set),this._listeners.get(o).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r){let n=this._listeners.get(o);n&&(n.delete(t),n.size===0&&this._listeners.delete(o))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let o of r)try{o(t)}catch(n){console.error(`[PlayerCore] Error in event listener for "${e}":`,n)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}async loadSource(e,t,r){if(!this._destroyed){this.unloadSource(),this._container=t,this.updateState({connectionState:"connecting"}),this.dispatch("sourcechange",{source:e});try{let o=e,n=this._state.contentType,a,l,c;if(ov(e)){if(r!=null&&r.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new fr(r.bpLive)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let p=await this._bpLive.resolveSource(e);o=p.source,n=p.contentType,a=p.poster,l=p.videoWidth,c=p.videoHeight}let m=rv(o),g=m==="nano"||m==="livekit"||n==="stream"?"live":"vod";return this.updateState({providerType:m,contentType:n,streamType:g}),this._mediaElement=this.createMediaElement(m,o,r),this._mediaElement.style.width="100%",this._mediaElement.style.height="100%",this._mediaElement.style.objectFit="contain",this._state.muted&&(this._mediaElement.muted=!0),this._state.loop&&(this._mediaElement.loop=!0),this.attachMediaElementListeners(this._mediaElement),t.appendChild(this._mediaElement),this.dispatch("videoelementchange",{video:this._mediaElement}),{poster:a,videoWidth:l,videoHeight:c}}catch(o){console.error("[PlayerCore] loadSource error:",o);let n={code:-1,message:o instanceof Error?o.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:n,connectionState:"failed"}),this.dispatch("error",n)}}}createMediaElement(e,t,r){switch(e){case"nano":{let o=document.createElement("nano-video"),n=t;return o.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",n.source?o.sourceConfig=n.source:n.streamid&&(o.streamid=n.streamid),r!=null&&r.nano&&(o.config=r.nano),o}case"livekit":{let o=document.createElement("livekit-video"),n=t;return o.url=n.url,o.token=n.token,r!=null&&r.livekit&&(o.config=r.livekit),o}case"video":default:{let o=document.createElement("hls-video"),n=typeof t=="string"?t:t.url;return o.src=n,r!=null&&r.video&&(o.config=r.video),o}}}attachMediaElementListeners(e){for(let t of nv){let r=()=>this.handleMediaEvent(t,e);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}handleMediaEvent(e,t){var r,o;switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let a=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:a}),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({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 a=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:a}),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}),this.dispatch("ended",void 0);break;case"progress":this.updateState({buffered:t.buffered}),this.dispatch("progress",{buffered:t.buffered});break;case"error":let n={code:((r=t.error)==null?void 0:r.code)??-1,message:((o=t.error)==null?void 0:o.message)??"Unknown error",fatal:!0,category:"media"};this.updateState({error:n}),this.dispatch("error",n);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._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null),this.updateState({...Wo(),volume:this._state.volume,muted:this._state.muted,playbackRate:this._state.playbackRate}),this.dispatch("videoelementchange",{video:null}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1}),this.dispatch("play",void 0);try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),this.dispatch("pause",void 0),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this.dispatch("pause",void 0),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)}setFullscreen(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"})}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){this._destroyed||(this._destroyed=!0,this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this.dispatch("destroy",void 0),this._listeners.clear())}};function ca(){return new Ko}var Ri="bpPlayerObservedProperties";function ua(i){return Ri in i&&Array.isArray(i[Ri])}function Cu(i,e){class t extends i{get[Ri](){return e}}return t}function av(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 xi(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!ua(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),ua(i)&&t(i);let r=av(i);r.length>0&&await Promise.all(r.map(o=>xi(o,e,t)))}function qo(i,e,t){let r=i[Ri];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 Go(i){i[Ri].includes("player")&&(i.player=void 0)}var Iu=`/**
8
8
  * BP Player CSS Custom Properties
9
9
  *
10
10
  * All styling can be customized by overriding these CSS variables.
@@ -15,11 +15,14 @@
15
15
  :host {
16
16
  /* Container */
17
17
  --bp-background: #000;
18
- --bp-aspect-ratio: 16 / 9;
19
18
  --bp-min-width: 300px;
20
19
  --bp-border-radius: 0;
21
20
  --bp-video-object-fit: contain;
22
21
 
22
+ /* Video Dimensions */
23
+ --bp-video-width: 16;
24
+ --bp-video-height: 9;
25
+
23
26
  /* Typography */
24
27
  --bp-text-color: #fff;
25
28
  --bp-text-font-size: 14px;
@@ -133,7 +136,7 @@ html.bp-player-full-window > body {
133
136
  margin: 0 !important;
134
137
  padding: 0 !important;
135
138
  }
136
- `;var Ru=!1;function gr(){if(Ru)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=Cu+`
139
+ `;var Ru=!1;function gr(){if(Ru)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=Iu+`
137
140
  `+Mu,document.head.appendChild(i),Ru=!0}function xu(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function Pu(i,e){return`<style>${i}</style>${e}`}var zo=(L=>(L.CONFIGURATION="configuration",L.SOURCE="source",L.SOURCES="sources",L.AUTOPLAY="autoplay",L.MUTED="muted",L.LOOP="loop",L.POSTER="poster",L.SCALING="scaling",L.ASPECT_RATIO="aspect-ratio",L.DEBUG="debug",L.AUTOHIDE="autohide",L.HOTKEYS="hotkeys",L.PAUSED="paused",L.PLAYING="playing",L.ENDED="ended",L.SEEKING="seeking",L.WAITING="waiting",L.LOADING="loading",L.READY="ready",L.HAS_ERROR="has-error",L.HAS_FIRST_PLAY="has-first-play",L.FULLSCREEN="fullscreen",L.FULLWINDOW="fullwindow",L.DEVICE_TYPE="device-type",L.MOBILE="mobile",L.TV="tv",L.STREAM_TYPE="stream-type",L.LIVE="live",L.CONTENT_TYPE="content-type",L.USER_IDLE="user-idle",L.USER_IDLE_TIMEOUT="user-idle-timeout",L.MOBILE_ONLY="mobile-only",L.MOBILE_HIDDEN="mobile-hidden",L.TV_ONLY="tv-only",L.TV_HIDDEN="tv-hidden",L.LIVE_ONLY="live-only",L.LIVE_HIDDEN="live-hidden",L.VOD_HIDDEN="vod-hidden",L.CLIP_HIDDEN="clip-hidden",L.NO_AUTO_HIDE="no-auto-hide",L.DISABLED="disabled",L.HIDDEN="hidden",L.NOTOOLTIP="notooltip",L.MENU="menu",L.MENU_OPENED="menu-opened",L.ARIA_LABEL="aria-label",L.ARIA_LIVE="aria-live",L.ARIA_CHECKED="aria-checked",L.VOLUME_LEVEL="volume-level",L.PROVIDER_TYPE="provider-type",L))(zo||{});function Te(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)}var Du=`/**
138
141
  * BP Player Styles
139
142
  *
@@ -148,8 +151,8 @@ bp-player {
148
151
  display: block;
149
152
  width: 100%;
150
153
  height: 100%;
151
- /* Default 16:9 aspect-ratio for width: auto sizing before metadata loads */
152
- aspect-ratio: var(--bp-aspect-ratio, 16 / 9);
154
+ /* Aspect ratio computed from video dimensions */
155
+ aspect-ratio: var(--bp-video-width, 16) / var(--bp-video-height, 9);
153
156
  }
154
157
 
155
158
  bp-player[hidden] {
@@ -247,21 +250,21 @@ bp-player[waiting] {
247
250
  bp-player[has-error] {
248
251
  /* Styles when player has an error */
249
252
  }
250
- `;var Ou=!1;function lv(){if(Ou)return;gr();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=Du,document.head.appendChild(i),Ou=!0}var dv=["play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Nl=class extends EventTarget{constructor(t){super();this._renditions=[];this._cleanup=[];this._player=t}get length(){return this._renditions.length}[Symbol.iterator](){return this._renditions[Symbol.iterator]()}get selectedIndex(){var r;let t=(r=this._player.player)==null?void 0:r.state.targetQuality;return t?this._renditions.findIndex(o=>o.id===String(t.index)):-1}set selectedIndex(t){var r,o,n;if(t<0)(r=this._player.player)==null||r.setQuality(null);else{let l=(((o=this._player.player)==null?void 0:o.state.qualities)??[])[t];l&&((n=this._player.player)==null||n.setQuality(l))}this._updateSelection(),this.dispatchEvent(new Event("change"))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,o)=>{r.selected=o===t})}_syncFromPlayer(){var o,n;let t=((o=this._player.player)==null?void 0:o.state.qualities)??[];if(t.length===0){let a=(n=this._player.player)==null?void 0:n.videoElement;a!=null&&a.videoRenditions&&(t=[...a.videoRenditions].map((l,c)=>({index:c,width:l.width??0,height:l.height??0,bitrate:l.bitrate??0})))}let r=this._renditions.length;for(let a=0;a<r;a++)delete this[a];this._renditions=t.map((a,l)=>({id:String(a.index),width:a.width,height:a.height,bitrate:a.bitrate,selected:!1})),this._renditions.forEach((a,l)=>{this[l]=a}),this._updateSelection();for(let a of this._renditions)this.dispatchEvent(new CustomEvent("addrendition",{detail:a}))}_setupListeners(){let t=this._player.player;if(!t)return;let r=()=>{this._syncFromPlayer()},o=()=>{this._updateSelection(),this.dispatchEvent(new Event("change"))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",o),t.addEventListener("targetqualitychanged",o),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",o),t.removeEventListener("targetqualitychanged",o)});let n=t.videoElement;n!=null&&n.videoRenditions&&(n.videoRenditions.addEventListener("addrendition",r),n.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var a,l;(a=n.videoRenditions)==null||a.removeEventListener("addrendition",r),(l=n.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(t=>t()),this._cleanup=[],this._renditions=[]}},fe=class extends Ie{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this._ready=!1;this._resolvedPoster=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=new Nl(this);this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let o of r.addedNodes)o.nodeType===Node.ELEMENT_NODE&&xi(o,this.providerContainer,this.registerStateReceiver);for(let o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&xi(o,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&qo(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),Go(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),lv(),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),this.defaultMuted=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:()=>0,end:()=>0}}get videoWidth(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.width?r.width:((a=this._playerCore)==null?void 0:a.state.videoWidth)??0}get videoHeight(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.height?r.height:((a=this._playerCore)==null?void 0:a.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}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));let{playableSource:r}=this.resolveSourcesArray();r&&!this._ready&&this.initPlayer()}updated(t){if(super.updated(t),t.has("sources")){let{playableSource:r,posterUrl:o}=this.resolveSourcesArray();this._resolvedPoster=o,r&&this._ready&&this.loadPlayableSource(r)}t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}resolveSourcesArray(){if(!this.sources||this.sources.length===0)return{playableSource:null,posterUrl:null};let t=this.sources.find(o=>o.type==="poster");return{playableSource:this.sources.find(o=>o.type!=="poster")??null,posterUrl:(t==null?void 0:t.url)??null}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)qo(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;for(let l of dv){let c=()=>{var p;this.debug&&!["durationchange","timeupdate"].includes(l)&&console.log(`[BPPlayer] Forwarding event: ${l}`,(p=this._playerCore)==null?void 0:p.state),this.dispatchEvent(new Event(l,{bubbles:!0,composed:!0}))};this._playerCore.addEventListener(l,c),this.eventCleanup.push(()=>{var p;return(p=this._playerCore)==null?void 0:p.removeEventListener(l,c)})}let t=l=>{l.videoWidth&&l.videoHeight&&this.setAspectRatioVariable(`${l.videoWidth} / ${l.videoHeight}`)},{videoWidth:r,videoHeight:o}=this._playerCore.state;r&&o&&this.setAspectRatioVariable(`${r} / ${o}`),this._playerCore.addEventListener("loadedmetadata",t),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener("loadedmetadata",t)});let n=()=>{this.dispatchEvent(new Event("resize",{bubbles:!0,composed:!0}))};this._playerCore.addEventListener("qualitychange",n),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener("qualitychange",n)});let a=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};this._playerCore.addEventListener("statechange",a),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener("statechange",a)})}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;Te(this,"paused",t.paused),Te(this,"playing",t.playing),Te(this,"ended",t.ended),Te(this,"seeking",t.seeking),Te(this,"waiting",t.waiting),Te(this,"has-error",t.error!==null),Te(this,"ready",this._ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}async initPlayer(){var o,n,a;let{playableSource:t,posterUrl:r}=this.resolveSourcesArray();if(!(!t||!this.providerContainer||this._ready)){this._resolvedPoster=r;try{this._playerCore=ca(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this.setupEventForwarding();let l=await this._playerCore.loadSource(t,this.providerContainer,this.config);if(!this._playerCore)return;if(!this._resolvedPoster&&(l!=null&&l.poster)&&(this._resolvedPoster=l.poster),this._ready=!0,xi(this,this.providerContainer,this.registerStateReceiver),this.propagateStateToAllReceivers(),this.autoplay)try{await this._playerCore.play()}catch{}this._videoRenditions._setupListeners(),this.dispatchEvent(new CustomEvent("ready",{detail:this._playerCore,bubbles:!0,composed:!0})),(n=(o=this._playerCore)==null?void 0:o.state)!=null&&n.paused&&this.dispatchEvent(new Event("pause",{bubbles:!0,composed:!0})),this.debug&&console.log("[BPPlayer] Player ready",(a=this._playerCore)==null?void 0:a.state)}catch(l){console.error("[BPPlayer] Failed to initialize player:",l)}}}async loadPlayableSource(t){if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadPlayableSource skipped:",{playerCore:!!this._playerCore,providerContainer:!!this.providerContainer});return}this.debug&&console.log("[BPPlayer] loadPlayableSource:",t);try{let r=await this._playerCore.loadSource(t,this.providerContainer,this.config);if(!this._playerCore){this.debug&&console.log("[BPPlayer] Player was destroyed during source load");return}if(!this._resolvedPoster&&(r!=null&&r.poster)&&(this._resolvedPoster=r.poster),r!=null&&r.aspectRatio&&(this.setAspectRatioVariable(r.aspectRatio),this.debug&&console.log("[BPPlayer] BPLive aspect ratio:",r.aspectRatio)),this.autoplay)try{await this._playerCore.play()}catch{}}catch(r){console.error("[BPPlayer] Failed to load source:",r)}}destroyPlayer(){this.eventCleanup.forEach(t=>t()),this.eventCleanup=[],this._videoRenditions._destroy();for(let t of this.stateReceivers)Go(t);if(this.stateReceivers=[],this._playerCore&&(this._playerCore.destroy(),this._playerCore=null),this.providerContainer)for(;this.providerContainer.firstChild;)this.providerContainer.removeChild(this.providerContainer.firstChild);this._ready=!1}setAspectRatioVariable(t){getComputedStyle(this).getPropertyValue("--bp-aspect-ratio").trim()||(this.style.setProperty("--bp-aspect-ratio",t),this.debug&&console.log("[BPPlayer] Set --bp-aspect-ratio:",t))}getContainerClasses(){return["bp-player-container",`bp-player-container--${this.scaling}`].join(" ")}getPosterClasses(){let t=["bp-player-poster"];return this.scaling==="crop"&&t.push("bp-player-poster--crop"),this.scaling==="fill"&&t.push("bp-player-poster--fill"),t.join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}getEffectivePoster(){return this._resolvedPoster??this.poster??null}render(){let t=this.getEffectivePoster();return He`
253
+ `;var Ou={fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{console.warn("[bp-player] Failed to parse JSON attribute:",i);return}},toAttribute:i=>i==null?null:JSON.stringify(i)},Uu=!1;function cv(){if(Uu)return;gr();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=Du,document.head.appendChild(i),Uu=!0}var uv=["play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Nl=class extends EventTarget{constructor(t){super();this._renditions=[];this._cleanup=[];this._player=t}get length(){return this._renditions.length}[Symbol.iterator](){return this._renditions[Symbol.iterator]()}get selectedIndex(){var r;let t=(r=this._player.player)==null?void 0:r.state.targetQuality;return t?this._renditions.findIndex(o=>o.id===String(t.index)):-1}set selectedIndex(t){var r,o,n;if(t<0)(r=this._player.player)==null||r.setQuality(null);else{let l=(((o=this._player.player)==null?void 0:o.state.qualities)??[])[t];l&&((n=this._player.player)==null||n.setQuality(l))}this._updateSelection(),this.dispatchEvent(new Event("change"))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,o)=>{r.selected=o===t})}_syncFromPlayer(){var o,n;let t=((o=this._player.player)==null?void 0:o.state.qualities)??[];if(t.length===0){let a=(n=this._player.player)==null?void 0:n.videoElement;a!=null&&a.videoRenditions&&(t=[...a.videoRenditions].map((l,c)=>({index:c,width:l.width??0,height:l.height??0,bitrate:l.bitrate??0})))}let r=this._renditions.length;for(let a=0;a<r;a++)delete this[a];this._renditions=t.map((a,l)=>({id:String(a.index),width:a.width,height:a.height,bitrate:a.bitrate,selected:!1})),this._renditions.forEach((a,l)=>{this[l]=a}),this._updateSelection();for(let a of this._renditions)this.dispatchEvent(new CustomEvent("addrendition",{detail:a}))}_setupListeners(){let t=this._player.player;if(!t)return;let r=()=>{this._syncFromPlayer()},o=()=>{this._updateSelection(),this.dispatchEvent(new Event("change"))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",o),t.addEventListener("targetqualitychanged",o),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",o),t.removeEventListener("targetqualitychanged",o)});let n=t.videoElement;n!=null&&n.videoRenditions&&(n.videoRenditions.addEventListener("addrendition",r),n.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var a,l;(a=n.videoRenditions)==null||a.removeEventListener("addrendition",r),(l=n.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(t=>t()),this._cleanup=[],this._renditions=[]}},fe=class extends Ce{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this._ready=!1;this._resolvedPoster=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=new Nl(this);this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let o of r.addedNodes)o.nodeType===Node.ELEMENT_NODE&&xi(o,this.providerContainer,this.registerStateReceiver);for(let o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&xi(o,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&qo(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),Go(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),cv(),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),this.defaultMuted=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:()=>0,end:()=>0}}get videoWidth(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.width?r.width:((a=this._playerCore)==null?void 0:a.state.videoWidth)??0}get videoHeight(){var o,n,a;let t=(o=this._playerCore)==null?void 0:o.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(n=this._playerCore)==null?void 0:n.state.currentQuality;return r!=null&&r.height?r.height:((a=this._playerCore)==null?void 0:a.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}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));let{playableSource:r}=this.resolveSourcesArray();r&&!this._ready&&this.initPlayer()}updated(t){if(super.updated(t),t.has("source")){let{playableSource:r,posterUrl:o}=this.resolveSourcesArray();this._resolvedPoster=o,r&&this._ready&&this.loadPlayableSource(r)}t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}resolveSourcesArray(){var n,a;let t=(n=this.source)==null?void 0:n.sources;if(!t||t.length===0)return{playableSource:null,posterUrl:null};let r=t[0]??null,o=((a=this.source)==null?void 0:a.poster)??null;return{playableSource:r,posterUrl:o}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)qo(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;for(let n of uv){let a=()=>{var l;this.debug&&!["durationchange","timeupdate"].includes(n)&&console.log(`[BPPlayer] Forwarding event: ${n}`,(l=this._playerCore)==null?void 0:l.state),this.dispatchEvent(new Event(n,{bubbles:!0,composed:!0}))};this._playerCore.addEventListener(n,a),this.eventCleanup.push(()=>{var l;return(l=this._playerCore)==null?void 0:l.removeEventListener(n,a)})}let t=()=>{var a;let n=(a=this._playerCore)==null?void 0:a.videoElement;n&&this.updateVideoDimensions(n.videoWidth,n.videoHeight)};this._playerCore.addEventListener("resize",t),this._playerCore.addEventListener("loadedmetadata",t),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("resize",t)}),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("loadedmetadata",t)}),t();let r=()=>{this.dispatchEvent(new Event("resize",{bubbles:!0,composed:!0}))};this._playerCore.addEventListener("qualitychange",r),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("qualitychange",r)});let o=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};this._playerCore.addEventListener("statechange",o),this.eventCleanup.push(()=>{var n;return(n=this._playerCore)==null?void 0:n.removeEventListener("statechange",o)})}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;Te(this,"paused",t.paused),Te(this,"playing",t.playing),Te(this,"ended",t.ended),Te(this,"seeking",t.seeking),Te(this,"waiting",t.waiting),Te(this,"has-error",t.error!==null),Te(this,"ready",this._ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}async initPlayer(){var o,n,a;let{playableSource:t,posterUrl:r}=this.resolveSourcesArray();if(!(!t||!this.providerContainer||this._ready)){this._resolvedPoster=r;try{this._playerCore=ca(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this.setupEventForwarding();let l=await this._playerCore.loadSource(t,this.providerContainer,this.config);if(!this._playerCore)return;if(!this._resolvedPoster&&(l!=null&&l.poster)&&(this._resolvedPoster=l.poster),this._ready=!0,xi(this,this.providerContainer,this.registerStateReceiver),this.propagateStateToAllReceivers(),this.autoplay)try{await this._playerCore.play()}catch{}this._videoRenditions._setupListeners(),this.dispatchEvent(new CustomEvent("ready",{detail:this._playerCore,bubbles:!0,composed:!0})),(n=(o=this._playerCore)==null?void 0:o.state)!=null&&n.paused&&this.dispatchEvent(new Event("pause",{bubbles:!0,composed:!0})),this.debug&&console.log("[BPPlayer] Player ready",(a=this._playerCore)==null?void 0:a.state)}catch(l){console.error("[BPPlayer] Failed to initialize player:",l)}}}async loadPlayableSource(t){if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadPlayableSource skipped:",{playerCore:!!this._playerCore,providerContainer:!!this.providerContainer});return}this.debug&&console.log("[BPPlayer] loadPlayableSource:",t);try{let r=await this._playerCore.loadSource(t,this.providerContainer,this.config);if(!this._playerCore){this.debug&&console.log("[BPPlayer] Player was destroyed during source load");return}if(!this._resolvedPoster&&(r!=null&&r.poster)&&(this._resolvedPoster=r.poster),r!=null&&r.videoWidth&&(r!=null&&r.videoHeight)&&(this.updateVideoDimensions(r.videoWidth,r.videoHeight),this.debug&&console.log("[BPPlayer] BPLive video dimensions:",{width:r.videoWidth,height:r.videoHeight})),this.autoplay)try{await this._playerCore.play()}catch{}}catch(r){console.error("[BPPlayer] Failed to load source:",r)}}destroyPlayer(){this.eventCleanup.forEach(t=>t()),this.eventCleanup=[],this._videoRenditions._destroy();for(let t of this.stateReceivers)Go(t);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._ready=!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(" ")}getPosterClasses(){let t=["bp-player-poster"];return this.scaling==="crop"&&t.push("bp-player-poster--crop"),this.scaling==="fill"&&t.push("bp-player-poster--fill"),t.join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}getPoster(){return this._resolvedPoster??this.poster??null}render(){let t=this.getPoster();return $e`
251
254
  <div
252
255
  class="${this.getContainerClasses()}"
253
256
  style="${this.getContainerStyle()}"
254
257
  >
255
- ${t&&!this._ready?He`<img class="${this.getPosterClasses()}" src="${t}" alt="" />`:null}
258
+ ${t&&!this._ready?$e`<img class="${this.getPosterClasses()}" src="${t}" alt="" />`:null}
256
259
  </div>
257
- `}};x([V({type:Array})],fe.prototype,"sources",2),x([V({type:Boolean})],fe.prototype,"autoplay",2),x([V({type:Boolean,reflect:!0,attribute:"muted"})],fe.prototype,"defaultMuted",2),x([V({type:Boolean})],fe.prototype,"loop",2),x([V({type:String})],fe.prototype,"poster",2),x([V({type:String})],fe.prototype,"scaling",2),x([V({type:String,attribute:"aspect-ratio"})],fe.prototype,"aspectRatio",2),x([V({type:Object})],fe.prototype,"config",2),x([V({type:Boolean})],fe.prototype,"debug",2),x([Ce()],fe.prototype,"_playerCore",2),x([Ce()],fe.prototype,"_ready",2),x([Ce()],fe.prototype,"_resolvedPoster",2),fe=x([Gt("bp-player")],fe);var b={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"},N={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},$l={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"},Uu=Object.entries($l),s=Uu.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),cv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Pi=Uu.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...cv}),s_=Object.entries(Pi).reduce((i,[e,t])=>{let r=s[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),Nu=Object.entries(s).reduce((i,[e,t])=>{let r=Pi[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Me={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},zt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var ha={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Re={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Xe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var $u={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Hu(i){return i==null?void 0:i.map(hv).join(" ")}function Bu(i){return i==null?void 0:i.split(/\s+/).map(pv)}function hv(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function pv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function Vu(i){return i==null?void 0:i.map(mv).join(" ")}function Wu(i){return i==null?void 0:i.split(/\s+/).map(vv)}function mv(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function vv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function Er(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var pa=i=>new Promise(e=>setTimeout(e,i));var Fu=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],fv=(i,e)=>{let t=i===1?Fu[e].singular:Fu[e].plural;return`${i} ${t}`},Di=i=>{if(!Er(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,c)=>l&&fv(l,c)).filter(l=>l).join(", ")}${t?" remaining":""}`};function Je(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),o=Math.floor(i/60%60),n=Math.floor(i/3600),a=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=o=r="0"),n=n>0||l>0?n+":":"",o=((n||a>=10)&&o<10?"0"+o:o)+":",r=r<10?"0"+r:r,(t?"-":"")+n+o+r}var c_=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 Ku={"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 qu,Hl={en:Ku},Bl=((qu=globalThis.navigator)==null?void 0:qu.language)||"en",Gu=i=>{Bl=i};var Ev=i=>{var e,t,r;let[o]=Bl.split("-");return((e=Hl[Bl])==null?void 0:e[i])||((t=Hl[o])==null?void 0:t[i])||((r=Hl.en)==null?void 0:r[i])||i},E=(i,e={})=>Ev(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var ma=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},va=class extends ma{},fa=class extends va{constructor(){super(...arguments),this.role=null}},Vl=class{observe(){}unobserve(){}disconnect(){}},zu={createElement:function(){return new Yo.HTMLElement},createElementNS:function(){return new Yo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Yo={ResizeObserver:Vl,document:zu,Node:va,Element:fa,HTMLElement:class extends fa{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Yo.DocumentFragment}},DocumentFragment:class extends ma{},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}}}}},Yu="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Qu=Object.keys(Yo).every(i=>i in globalThis),d=Yu&&!Qu?Yo:globalThis,ee=Yu&&!Qu?zu:globalThis.document;var Zu=new WeakMap,Wl=i=>{let e=Zu.get(i);return e||Zu.set(i,e=new Set),e},Xu=new d.ResizeObserver(i=>{for(let e of i)for(let t of Wl(e.target))t(e)});function Pt(i,e){Wl(i).add(e),Xu.observe(i)}function Dt(i,e){let t=Wl(i);t.delete(e),t.size||Xu.unobserve(i)}function j(i){let e={};for(let t of i)e[t.name]=t.value;return e}function X(i){var e;return(e=ga(i))!=null?e:st(i,"media-controller")}function ga(i){var e;let{MEDIA_CONTROLLER:t}=N,r=i.getAttribute(t);if(r)return(e=Oi(i))==null?void 0:e.getElementById(r)}var Ea=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},bv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},ba=(i,e)=>bv(i,e)[0],Ae=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Ae(i,e.getRootNode().host),st=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||st(i.getRootNode().host,e)};function Qo(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=Qo(t.shadowRoot))!=null?e:t:null}function Oi(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 _a(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let o=i;for(;o&&e>0;){let n=getComputedStyle(o);if(t&&n.opacity==="0"||r&&n.visibility==="hidden"||n.display==="none")return!1;o=o.parentElement,e--}return!0}function Ju(i,e,t,r){let o=r.x-t.x,n=r.y-t.y,a=o*o+n*n;if(a===0)return 0;let l=((i-t.x)*o+(e-t.y)*n)/a;return Math.max(0,Math.min(1,l))}function J(i,e){let t=_v(i,r=>r===e);return t||Zo(i,e)}function _v(i,e){var t,r;let o;for(o of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(r=o.sheet)==null?void 0:r.cssRules}catch{continue}for(let a of n??[])if(e(a.selectorText))return a}}function Zo(i,e){var t,r;let o=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=o==null?void 0:o[o.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(r=n.sheet.cssRules)==null?void 0:r[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function $(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function B(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}$(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function w(i,e){return i.hasAttribute(e)}function I(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}w(i,e)!=t&&i.toggleAttribute(e,t)}function P(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function D(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;P(i,e,void 0)!==r&&i.setAttribute(e,r)}var ju=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yt=(i,e,t)=>(ju(i,e,"read from private field"),t?t.call(i):e.get(i)),yv=(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)},ya=(i,e,t,r)=>(ju(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),xe;function Tv(i){return`
260
+ `}};x([V({converter:Ou})],fe.prototype,"source",2),x([V({type:Boolean})],fe.prototype,"autoplay",2),x([V({type:Boolean,reflect:!0,attribute:"muted"})],fe.prototype,"defaultMuted",2),x([V({type:Boolean})],fe.prototype,"loop",2),x([V({type:String})],fe.prototype,"poster",2),x([V({type:String})],fe.prototype,"scaling",2),x([V({type:String,attribute:"aspect-ratio"})],fe.prototype,"aspectRatio",2),x([V({converter:Ou})],fe.prototype,"config",2),x([V({type:Boolean})],fe.prototype,"debug",2),x([Ie()],fe.prototype,"_playerCore",2),x([Ie()],fe.prototype,"_ready",2),x([Ie()],fe.prototype,"_resolvedPoster",2),fe=x([Gt("bp-player")],fe);var b={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"},N={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Hl={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"},Nu=Object.entries(Hl),s=Nu.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),hv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Pi=Nu.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...hv}),d_=Object.entries(Pi).reduce((i,[e,t])=>{let r=s[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),Hu=Object.entries(s).reduce((i,[e,t])=>{let r=Pi[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Me={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},zt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var ha={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Re={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Xe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var $u={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Bu(i){return i==null?void 0:i.map(mv).join(" ")}function Vu(i){return i==null?void 0:i.split(/\s+/).map(vv)}function mv(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function vv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function Wu(i){return i==null?void 0:i.map(fv).join(" ")}function Fu(i){return i==null?void 0:i.split(/\s+/).map(gv)}function fv(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function gv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function Er(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var pa=i=>new Promise(e=>setTimeout(e,i));var Ku=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Ev=(i,e)=>{let t=i===1?Ku[e].singular:Ku[e].plural;return`${i} ${t}`},Di=i=>{if(!Er(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,c)=>l&&Ev(l,c)).filter(l=>l).join(", ")}${t?" remaining":""}`};function Je(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),o=Math.floor(i/60%60),n=Math.floor(i/3600),a=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=o=r="0"),n=n>0||l>0?n+":":"",o=((n||a>=10)&&o<10?"0"+o:o)+":",r=r<10?"0"+r:r,(t?"-":"")+n+o+r}var h_=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 qu={"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 Gu,$l={en:qu},Bl=((Gu=globalThis.navigator)==null?void 0:Gu.language)||"en",zu=i=>{Bl=i};var _v=i=>{var e,t,r;let[o]=Bl.split("-");return((e=$l[Bl])==null?void 0:e[i])||((t=$l[o])==null?void 0:t[i])||((r=$l.en)==null?void 0:r[i])||i},E=(i,e={})=>_v(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var ma=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},va=class extends ma{},fa=class extends va{constructor(){super(...arguments),this.role=null}},Vl=class{observe(){}unobserve(){}disconnect(){}},Yu={createElement:function(){return new Yo.HTMLElement},createElementNS:function(){return new Yo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Yo={ResizeObserver:Vl,document:Yu,Node:va,Element:fa,HTMLElement:class extends fa{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Yo.DocumentFragment}},DocumentFragment:class extends ma{},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}}}}},Qu="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Zu=Object.keys(Yo).every(i=>i in globalThis),d=Qu&&!Zu?Yo:globalThis,ee=Qu&&!Zu?Yu:globalThis.document;var Xu=new WeakMap,Wl=i=>{let e=Xu.get(i);return e||Xu.set(i,e=new Set),e},Ju=new d.ResizeObserver(i=>{for(let e of i)for(let t of Wl(e.target))t(e)});function Pt(i,e){Wl(i).add(e),Ju.observe(i)}function Dt(i,e){let t=Wl(i);t.delete(e),t.size||Ju.unobserve(i)}function j(i){let e={};for(let t of i)e[t.name]=t.value;return e}function X(i){var e;return(e=ga(i))!=null?e:st(i,"media-controller")}function ga(i){var e;let{MEDIA_CONTROLLER:t}=N,r=i.getAttribute(t);if(r)return(e=Oi(i))==null?void 0:e.getElementById(r)}var Ea=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},yv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},ba=(i,e)=>yv(i,e)[0],Ae=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Ae(i,e.getRootNode().host),st=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||st(i.getRootNode().host,e)};function Qo(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=Qo(t.shadowRoot))!=null?e:t:null}function Oi(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 _a(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let o=i;for(;o&&e>0;){let n=getComputedStyle(o);if(t&&n.opacity==="0"||r&&n.visibility==="hidden"||n.display==="none")return!1;o=o.parentElement,e--}return!0}function ju(i,e,t,r){let o=r.x-t.x,n=r.y-t.y,a=o*o+n*n;if(a===0)return 0;let l=((i-t.x)*o+(e-t.y)*n)/a;return Math.max(0,Math.min(1,l))}function J(i,e){let t=Tv(i,r=>r===e);return t||Zo(i,e)}function Tv(i,e){var t,r;let o;for(o of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(r=o.sheet)==null?void 0:r.cssRules}catch{continue}for(let a of n??[])if(e(a.selectorText))return a}}function Zo(i,e){var t,r;let o=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=o==null?void 0:o[o.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(r=n.sheet.cssRules)==null?void 0:r[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function H(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function B(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}H(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function w(i,e){return i.hasAttribute(e)}function C(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}w(i,e)!=t&&i.toggleAttribute(e,t)}function P(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function D(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;P(i,e,void 0)!==r&&i.setAttribute(e,r)}var eh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yt=(i,e,t)=>(eh(i,e,"read from private field"),t?t.call(i):e.get(i)),Av=(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)},ya=(i,e,t,r)=>(eh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),xe;function Sv(i){return`
258
261
  <style>
259
262
  :host {
260
263
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
261
264
  box-sizing: border-box;
262
265
  }
263
266
  </style>
264
- `}var br=class extends d.HTMLElement{constructor(){if(super(),yv(this,xe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Yt(this,xe))==null?void 0:o.unassociateElement)==null||n.call(o,this),ya(this,xe,null)),r&&this.isConnected&&(ya(this,xe,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=Yt(this,xe))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r,o;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),ya(this,xe,Av(this)),this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=Yt(this,xe))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=Yt(this,xe))==null||r.addEventListener("pointerdown",this),(o=Yt(this,xe))==null||o.addEventListener("click",this)}disconnectedCallback(){var e,t,r,o;this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=Yt(this,xe))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=Yt(this,xe))==null||r.removeEventListener("pointerdown",this),(o=Yt(this,xe))==null||o.removeEventListener("click",this),ya(this,xe,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:n,clientY:a}=e,{left:l,top:c,width:p,height:h}=this.getBoundingClientRect(),v=n-l,g=a-c;if(v<0||g<0||v>p||g>h||p===0&&h===0)return;let m=this._pointerType||"mouse";if(this._pointerType=void 0,m===ha.TOUCH){this.handleTap(e);return}else if(m===ha.MOUSE||m===ha.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};xe=new WeakMap;br.shadowRootOptions={mode:"open"};br.getTemplateHTML=Tv;function Av(i){var e;let t=i.getAttribute(N.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):st(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",br);var Ta=br;var Gl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ve=(i,e,t)=>(Gl(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)},Ui=(i,e,t,r)=>(Gl(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ke=(i,e,t)=>(Gl(i,e,"access private method"),t),ka,_r,Jo,yr,Aa,Fl,eh,Xo,Sa,Kl,th,ql,ih,jo,La,wa,zl,Tr,en,M={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Sv(i){return`
267
+ `}var br=class extends d.HTMLElement{constructor(){if(super(),Av(this,xe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=Yt(this,xe))==null?void 0:o.unassociateElement)==null||n.call(o,this),ya(this,xe,null)),r&&this.isConnected&&(ya(this,xe,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=Yt(this,xe))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r,o;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),ya(this,xe,kv(this)),this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=Yt(this,xe))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=Yt(this,xe))==null||r.addEventListener("pointerdown",this),(o=Yt(this,xe))==null||o.addEventListener("click",this)}disconnectedCallback(){var e,t,r,o;this.getAttribute(N.MEDIA_CONTROLLER)&&((t=(e=Yt(this,xe))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=Yt(this,xe))==null||r.removeEventListener("pointerdown",this),(o=Yt(this,xe))==null||o.removeEventListener("click",this),ya(this,xe,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:n,clientY:a}=e,{left:l,top:c,width:m,height:h}=this.getBoundingClientRect(),v=n-l,g=a-c;if(v<0||g<0||v>m||g>h||m===0&&h===0)return;let p=this._pointerType||"mouse";if(this._pointerType=void 0,p===ha.TOUCH){this.handleTap(e);return}else if(p===ha.MOUSE||p===ha.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){C(this,s.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};xe=new WeakMap;br.shadowRootOptions={mode:"open"};br.getTemplateHTML=Sv;function kv(i){var e;let t=i.getAttribute(N.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):st(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",br);var Ta=br;var Gl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ve=(i,e,t)=>(Gl(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)},Ui=(i,e,t,r)=>(Gl(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ke=(i,e,t)=>(Gl(i,e,"access private method"),t),ka,_r,Jo,yr,Aa,Fl,th,Xo,Sa,Kl,ih,ql,rh,jo,La,wa,zl,Tr,en,M={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Lv(i){return`
265
268
  <style>
266
269
 
267
270
  :host([${s.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -412,7 +415,7 @@ bp-player[has-error] {
412
415
  <slot part="bottom chrome"></slot>
413
416
  </span>
414
417
  <slot name="dialog" part="layer dialog-layer"></slot>
415
- `}var kv=Object.values(s),Lv="sm:384 md:576 lg:768 xl:960";function wv(i){rh(i.target,i.contentRect.width)}function rh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(M.BREAKPOINTS))!=null?t:Lv,o=Iv(r),n=Cv(o,e),a=!1;if(Object.keys(o).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),a=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),a=!0)}),a){let l=new CustomEvent(Pi.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Pi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Iv(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Cv(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Ni=class extends d.HTMLElement{constructor(){if(super(),Be(this,Fl),Be(this,Kl),Be(this,ql),Be(this,jo),Be(this,wa),Be(this,Tr),Be(this,ka,0),Be(this,_r,null),Be(this,Jo,null),Be(this,yr,void 0),this.breakpointsComputed=!1,Be(this,Aa,new MutationObserver(Ke(this,Fl,eh).bind(this))),Be(this,Xo,!1),Be(this,Sa,t=>{Ve(this,Xo)||(setTimeout(()=>{wv(t),Ui(this,Xo,!1)},0),Ui(this,Xo,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=j(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){Ve(this,_r)&&this.mediaUnsetCallback(Ve(this,_r));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[M.AUTOHIDE,M.GESTURES_DISABLED].concat(kv).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_CHAPTERS_CUES,s.MEDIA_WIDTH,s.MEDIA_HEIGHT,s.MEDIA_ERROR,s.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==M.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&&(Ui(this,_r,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ve(this,Aa).observe(this,{childList:!0,subtree:!0}),Pt(this,Ve(this,Sa));let r=this.getAttribute(M.AUDIO)!=null?E("audio player"):E("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(M.USER_INACTIVE,""),rh(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Ve(this,Aa).disconnect(),Dt(this,Ve(this,Sa)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ui(this,_r,null)}handleEvent(e){switch(e.type){case"pointerdown":Ui(this,ka,e.timeStamp);break;case"pointermove":Ke(this,Kl,th).call(this,e);break;case"pointerup":Ke(this,ql,ih).call(this,e);break;case"mouseleave":Ke(this,jo,La).call(this);break;case"mouseup":this.removeAttribute(M.KEYBOARD_CONTROL);break;case"keyup":Ke(this,Tr,en).call(this),this.setAttribute(M.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ui(this,yr,isNaN(t)?0:t)}get autohide(){return(Ve(this,yr)===void 0?2:Ve(this,yr)).toString()}get breakpoints(){return P(this,M.BREAKPOINTS)}set breakpoints(e){D(this,M.BREAKPOINTS,e)}get audio(){return w(this,M.AUDIO)}set audio(e){I(this,M.AUDIO,e)}get gesturesDisabled(){return w(this,M.GESTURES_DISABLED)}set gesturesDisabled(e){I(this,M.GESTURES_DISABLED,e)}get keyboardControl(){return w(this,M.KEYBOARD_CONTROL)}set keyboardControl(e){I(this,M.KEYBOARD_CONTROL,e)}get noAutohide(){return w(this,M.NO_AUTOHIDE)}set noAutohide(e){I(this,M.NO_AUTOHIDE,e)}get autohideOverControls(){return w(this,M.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){I(this,M.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return w(this,M.USER_INACTIVE)}set userInteractive(e){I(this,M.USER_INACTIVE,e)}};ka=new WeakMap;_r=new WeakMap;Jo=new WeakMap;yr=new WeakMap;Aa=new WeakMap;Fl=new WeakSet;eh=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let o of r){if(o.slot!="media"||t.target!=this)continue;let n=t.previousSibling&&t.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(o);else{let a=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(a=!1);a&&this.mediaUnsetCallback(o)}}if(e)for(let o of t.addedNodes)o===e&&this.handleMediaUpdated(e)}};Xo=new WeakMap;Sa=new WeakMap;Kl=new WeakSet;th=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-Ve(this,ka)<250)return;Ke(this,wa,zl).call(this),clearTimeout(Ve(this,Jo));let e=this.hasAttribute(M.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Ke(this,Tr,en).call(this)};ql=new WeakSet;ih=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(M.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Ke(this,jo,La).call(this):Ke(this,Tr,en).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Ke(this,Tr,en).call(this)};jo=new WeakSet;La=function(){if(Ve(this,yr)<0||this.hasAttribute(M.USER_INACTIVE))return;this.setAttribute(M.USER_INACTIVE,"");let i=new d.CustomEvent(Pi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};wa=new WeakSet;zl=function(){if(!this.hasAttribute(M.USER_INACTIVE))return;this.removeAttribute(M.USER_INACTIVE);let i=new d.CustomEvent(Pi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Tr=new WeakSet;en=function(){Ke(this,wa,zl).call(this),clearTimeout(Ve(this,Jo));let i=parseInt(this.autohide);i<0||Ui(this,Jo,setTimeout(()=>{Ke(this,jo,La).call(this)},i*1e3))};Ni.shadowRootOptions={mode:"open"};Ni.getTemplateHTML=Sv;d.customElements.get("media-container")||d.customElements.define("media-container",Ni);var oh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(oh(i,e,"read from private field"),t?t.call(i):e.get(i)),tn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ia=(i,e,t,r)=>(oh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ar,Sr,Ca,$i,Ot,Qt,Zt=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){tn(this,Ot),tn(this,Ar,void 0),tn(this,Sr,void 0),tn(this,Ca,void 0),tn(this,$i,new Set),Ia(this,Ar,e),Ia(this,Sr,t),Ia(this,Ca,new Set(r))}[Symbol.iterator](){return ge(this,Ot,Qt).values()}get length(){return ge(this,Ot,Qt).size}get value(){var e;return(e=[...ge(this,Ot,Qt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ia(this,$i,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...ge(this,Ot,Qt)][e]}values(){return ge(this,Ot,Qt).values()}forEach(e,t){ge(this,Ot,Qt).forEach(e,t)}add(...e){var t,r;e.forEach(o=>ge(this,$i).add(o)),!(this.value===""&&!((t=ge(this,Ar))!=null&&t.hasAttribute(`${ge(this,Sr)}`)))&&((r=ge(this,Ar))==null||r.setAttribute(`${ge(this,Sr)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>ge(this,$i).delete(r)),(t=ge(this,Ar))==null||t.setAttribute(`${ge(this,Sr)}`,`${this.value}`)}contains(e){return ge(this,Ot,Qt).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}};Ar=new WeakMap;Sr=new WeakMap;Ca=new WeakMap;$i=new WeakMap;Ot=new WeakSet;Qt=function(){return ge(this,$i).size?ge(this,$i):ge(this,Ca)};var Mv=(i="")=>i.split(/\s+/),nh=(i="")=>{let[e,t,r]=i.split(":"),o=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Me.CAPTIONS:Me.SUBTITLES,language:t,label:o}},Hi=(i="",e={})=>Mv(i).map(t=>{let r=nh(t);return{...e,...r}}),Yl=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?nh(e):e):typeof i=="string"?Hi(i):[i]:[],Ma=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Ut=(i=[])=>Array.prototype.map.call(i,Ma).join(" "),Rv=(i,e)=>t=>t[i]===e,ah=i=>{let e=Object.entries(i).map(([t,r])=>Rv(t,r));return t=>e.every(r=>r(t))},Bi=(i,e=[],t=[])=>{let r=Yl(t).map(ah),o=n=>r.some(a=>a(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Vi=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:ah(e);return Array.from(i.textTracks).filter(t)},Ra=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var lh=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let o=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(o){let n=(e=r[o])==null?void 0:e.call(r);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(o){console.error(o)}},sh="exitFullscreen"in ee?"exitFullscreen":"webkitExitFullscreen"in ee?"webkitExitFullscreen":"webkitCancelFullScreen"in ee?"webkitCancelFullScreen":void 0,dh=i=>{var e;let{documentElement:t}=i;if(sh){let r=(e=t==null?void 0:t[sh])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},rn="fullscreenElement"in ee?"fullscreenElement":"webkitFullscreenElement"in ee?"webkitFullscreenElement":void 0,xv=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[rn];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===$u.FULLSCREEN?t:r},ch=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=xv(i);if(!n)return!1;if(n===o||n===t)return!0;if(n.localName.includes("-")){let a=n.shadowRoot;if(!(rn in a))return Ae(n,o);for(;a!=null&&a[rn];){if(a[rn]===o)return!0;a=(e=a[rn])==null?void 0:e.shadowRoot}}return!1},Pv="fullscreenEnabled"in ee?"fullscreenEnabled":"webkitFullscreenEnabled"in ee?"webkitFullscreenEnabled":void 0,uh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[Pv])||t&&"webkitSupportsFullscreen"in t};var xa,Ql=()=>{var i,e;return xa||(xa=(e=(i=ee)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),xa)},hh=async(i=Ql())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([Dv(i,t.signal),Ov(i,e)]);return t.abort(),r},Dv=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),Ov=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await pa(10)}return i.volume!==e},Uv=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),Zl=(i=Ql())=>d.matchMedia("(display-mode: standalone)").matches&&Uv?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Xl=(i=Ql())=>uh({documentElement:ee,media:i}),ph=Xl(),mh=Zl(),vh=!!d.WebKitPlaybackTargetAvailabilityEvent,fh=!!d.chrome;var kr=i=>Vi(i.media,e=>[Me.SUBTITLES,Me.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Jl=i=>Vi(i.media,e=>e.mode===zt.SHOWING&&[Me.SUBTITLES,Me.CAPTIONS].includes(e.kind)),Pa=(i,e)=>{let t=kr(i),r=Jl(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)Bi(zt.DISABLED,t,r);else if(e===!0||!o&&e!==!1){let n=t[0],{options:a}=i;if(!(a!=null&&a.noSubtitlesLangPref)){let h=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),v=h?[h,...globalThis.navigator.languages]:globalThis.navigator.languages,g=t.filter(m=>v.some(A=>m.language.toLowerCase().startsWith(A.split("-")[0]))).sort((m,A)=>{let f=v.findIndex(O=>m.language.toLowerCase().startsWith(O.split("-")[0])),R=v.findIndex(O=>A.language.toLowerCase().startsWith(O.split("-")[0]));return f-R});g[0]&&(n=g[0])}let{language:l,label:c,kind:p}=n;Bi(zt.DISABLED,t,r),Bi(zt.SHOWING,t,[{language:l,label:c,kind:p}])}}},Da=(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)?Nv(i,e):Object.entries(i).every(([t,r])=>t in e&&Da(r,e[t])),Nv=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((o,n)=>Da(o,e[n])):!0};var $v=Object.values(Xe),Oa,Hv=hh().then(i=>(Oa=i,Oa)),gh=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=d.customElements.get(t);r&&e instanceof r||(await d.customElements.whenDefined(t),d.customElements.upgrade(e))}))},Bv=new d.DOMParser,Vv=i=>i&&(Bv.parseFromString(i,"text/html").body.textContent||i),Lr={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:o}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=o==null?void 0:o.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 o=d.localStorage.getItem("media-chrome-pref-muted")!==null,n=t.hasAttribute("muted");if(r){o&&d.localStorage.removeItem("media-chrome-pref-muted");return}if(n&&!o)return;d.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(o){console.debug("Error setting muted pref",o)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let o=d.localStorage.getItem("media-chrome-pref-muted")==="true";Lr.mediaMuted.set(o,e),i(o)}catch(o){console.debug("Error getting muted pref",o)}}]},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?d.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&d.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(o){console.debug("Error setting volume pref",o)}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 o=d.localStorage.getItem("media-chrome-pref-volume");if(o==null)return;Lr.mediaVolume.set(+o,e),i(+o)}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||!Er(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),o=t.seekable.end(t.seekable.length-1);if(!(!r&&!o))return[Number(r.toFixed(3)),Number(o.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((o,n)=>[Number(r.start(n).toFixed(3)),Number(r.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[Xe.LIVE,Xe.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if($v.includes(o))return o===Xe.UNKNOWN?r:o;let n=e.duration;return n===1/0?Xe.LIVE:Number.isFinite(n)?Xe.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=Lr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===Xe.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(!(Lr.mediaStreamType.get(i)===Xe.LIVE))return!1;let o=e.seekable;if(!o)return!0;if(!o.length)return!1;let n=o.end(o.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return kr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Jl(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:o,options:n}=e;if(!o)return;let a=l=>{var c;!n.defaultSubtitles||l&&![Me.CAPTIONS,Me.SUBTITLES].includes((c=l==null?void 0:l.track)==null?void 0:c.kind)||Pa(e,!0)};return o.addEventListener("loadstart",a),(t=o.textTracks)==null||t.addEventListener("addtrack",a),(r=o.textTracks)==null||r.addEventListener("removetrack",a),()=>{var l,c;o.removeEventListener("loadstart",a),(l=o.textTracks)==null||l.removeEventListener("addtrack",a),(c=o.textTracks)==null||c.removeEventListener("removetrack",a)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Vi(t,{kind:Me.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:a})=>({text:Vv(o),startTime:n,endTime:a}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let o=r.querySelector('track[kind="chapters"][default][src]'),n=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return o==null||o.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{o==null||o.removeEventListener("load",i),n==null||n.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:o}=i;if(!r||!o||!o.pictureInPictureElement)return!1;if(o.pictureInPictureElement===r)return!0;if(o.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Ae(r,o.pictureInPictureElement):!1;if(o.pictureInPictureElement.localName.includes("-")){let n=o.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===r)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!ee.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(o=>{if(o.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 n=()=>{t.removeEventListener("loadedmetadata",a),t.preload="none"},a=()=>{t.requestPictureInPicture().catch(r),n()};t.addEventListener("loadedmetadata",a),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),n()},1e3)}else throw o}else throw o})}else ee.pictureInPictureElement&&ee.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:o}=i;return(r=(t=o==null?void 0:o.videoRenditions)==null?void 0:t[(e=o.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,o=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==r);t.videoRenditions.selectedIndex!=o&&(t.videoRenditions.selectedIndex=o)},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(o=>o.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 o of t.audioTracks)o.enabled=r==o.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return ch(i)},set(i,e,t){var r;i?(lh(e),t.detail&&((r=e.media)==null||r.focus())):dh(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:o}=e;if(o&&!(i&&((t=o.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=o.remote)==null?void 0:r.state)!=="connected")){if(typeof o.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}o.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&d.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(!ph||!Xl(e))return Re.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!mh||!Zl(e))return Re.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Re.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(Oa===!1||(e==null?void 0:e.volume)==null)return Re.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{Oa==null&&Hv.then(e=>i(e?void 0:Re.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!fh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Re.UNSUPPORTED;if(!(e==null||e==="available"))return Re.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(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!vh)return Re.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Re.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(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Re.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Re.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Re.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Re.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var Eh={[b.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:a}=e,l=t??void 0,c,p;if(a&&l!=null){let[m]=Vi(a,{kind:Me.METADATA,label:"thumbnails"}),A=Array.prototype.find.call((r=m==null?void 0:m.cues)!=null?r:[],(f,R,O)=>R===0?f.endTime>l:R===O.length-1?f.startTime<=l:f.startTime<=l&&f.endTime>l);if(A){let f=/'^(?:[a-z]+:)?\/\//i.test(A.text)||(o=a==null?void 0:a.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,R=new URL(A.text,f);p=new URLSearchParams(R.hash).get("#xywh").split(",").map(Ne=>+Ne),c=R.href}}let h=i.mediaDuration.get(e),g=(n=i.mediaChaptersCues.get(e).find((m,A,f)=>A===f.length-1&&h===m.endTime?m.startTime<=l&&m.endTime>=l:m.startTime<=l&&m.endTime>l))==null?void 0:n.text;return t!=null&&g==null&&(g=""),{mediaPreviewTime:l,mediaPreviewImage:c,mediaPreviewCoords:p,mediaPreviewChapter:g}},[b.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[b.MEDIA_PLAY_REQUEST](i,e){var t,r,o,n;let a="mediaPaused",c=i.mediaStreamType.get(e)===Xe.LIVE,p=!((t=e.options)!=null&&t.noAutoSeekToLive),h=i.mediaTargetLiveWindow.get(e)>0;if(c&&p&&!h){let v=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(v){let g=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,m=v-g;i.mediaCurrentTime.set(m,e)}}i[a].set(!1,e)},[b.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,e)},[b.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[b.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[b.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[b.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",o=t;o&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(o,e)},[b.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[b.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,o;let n="mediaCurrentTime",a=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(a)))return;let l=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,c=a-l;i[n].set(c,e)},[b.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=kr(e),a=Yl(t),l=(r=a[0])==null?void 0:r.language;l&&!o.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Bi(zt.SHOWING,n,a)},[b.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=kr(e),o=t??[];Bi(zt.DISABLED,r,o)},[b.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){Pa(e,t)},[b.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[b.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,e)},[b.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[b.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)},[b.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[b.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[b.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var bh=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Lr,requestMap:o=Eh,options:n={},monitorStateOwnersOnlyWithSubscriptions:a=!0})=>{let l=[],c={options:{...n}},p=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),h=f=>{f!=null&&(Da(f,p)||(p=Object.freeze({...p,...f}),l.forEach(R=>R(p))))},v=()=>{let f=Object.entries(r).reduce((R,[O,{get:Ne}])=>(R[O]=Ne(c),R),{});h(f)},g={},m,A=async(f,R)=>{var O,Ne,nt,Co,cr,$c,yl,k,K,ne,te,G,pe,Rt,Mo,Hc;let wm=!!m;if(m={...c,...m??{},...f},wm)return;await gh(...Object.values(f));let ur=l.length>0&&R===0&&a,Bc=c.media!==m.media,Vc=((O=c.media)==null?void 0:O.textTracks)!==((Ne=m.media)==null?void 0:Ne.textTracks),Wc=((nt=c.media)==null?void 0:nt.videoRenditions)!==((Co=m.media)==null?void 0:Co.videoRenditions),Fc=((cr=c.media)==null?void 0:cr.audioTracks)!==(($c=m.media)==null?void 0:$c.audioTracks),Kc=((yl=c.media)==null?void 0:yl.remote)!==((k=m.media)==null?void 0:k.remote),qc=c.documentElement!==m.documentElement,Gc=!!c.media&&(Bc||ur),zc=!!((K=c.media)!=null&&K.textTracks)&&(Vc||ur),Yc=!!((ne=c.media)!=null&&ne.videoRenditions)&&(Wc||ur),Qc=!!((te=c.media)!=null&&te.audioTracks)&&(Fc||ur),Zc=!!((G=c.media)!=null&&G.remote)&&(Kc||ur),Xc=!!c.documentElement&&(qc||ur),Tl=Gc||zc||Yc||Qc||Zc||Xc,hr=l.length===0&&R===1&&a,Jc=!!m.media&&(Bc||hr),L=!!((pe=m.media)!=null&&pe.textTracks)&&(Vc||hr),jc=!!((Rt=m.media)!=null&&Rt.videoRenditions)&&(Wc||hr),eu=!!((Mo=m.media)!=null&&Mo.audioTracks)&&(Fc||hr),tu=!!((Hc=m.media)!=null&&Hc.remote)&&(Kc||hr),iu=!!m.documentElement&&(qc||hr),ru=Jc||L||jc||eu||tu||iu;if(!(Tl||ru)){Object.entries(m).forEach(([Y,Ro])=>{c[Y]=Ro}),v(),m=void 0;return}Object.entries(r).forEach(([Y,{get:Ro,mediaEvents:Im=[],textTracksEvents:Cm=[],videoRenditionsEvents:Mm=[],audioTracksEvents:Rm=[],remoteEvents:xm=[],rootEvents:Pm=[],stateOwnersUpdateHandlers:Dm=[]}])=>{g[Y]||(g[Y]={});let $e=ie=>{let ue=Ro(c,ie);h({[Y]:ue})},ve;ve=g[Y].mediaEvents,Im.forEach(ie=>{ve&&Gc&&(c.media.removeEventListener(ie,ve),g[Y].mediaEvents=void 0),Jc&&(m.media.addEventListener(ie,$e),g[Y].mediaEvents=$e)}),ve=g[Y].textTracksEvents,Cm.forEach(ie=>{var ue,Ze;ve&&zc&&((ue=c.media.textTracks)==null||ue.removeEventListener(ie,ve),g[Y].textTracksEvents=void 0),L&&((Ze=m.media.textTracks)==null||Ze.addEventListener(ie,$e),g[Y].textTracksEvents=$e)}),ve=g[Y].videoRenditionsEvents,Mm.forEach(ie=>{var ue,Ze;ve&&Yc&&((ue=c.media.videoRenditions)==null||ue.removeEventListener(ie,ve),g[Y].videoRenditionsEvents=void 0),jc&&((Ze=m.media.videoRenditions)==null||Ze.addEventListener(ie,$e),g[Y].videoRenditionsEvents=$e)}),ve=g[Y].audioTracksEvents,Rm.forEach(ie=>{var ue,Ze;ve&&Qc&&((ue=c.media.audioTracks)==null||ue.removeEventListener(ie,ve),g[Y].audioTracksEvents=void 0),eu&&((Ze=m.media.audioTracks)==null||Ze.addEventListener(ie,$e),g[Y].audioTracksEvents=$e)}),ve=g[Y].remoteEvents,xm.forEach(ie=>{var ue,Ze;ve&&Zc&&((ue=c.media.remote)==null||ue.removeEventListener(ie,ve),g[Y].remoteEvents=void 0),tu&&((Ze=m.media.remote)==null||Ze.addEventListener(ie,$e),g[Y].remoteEvents=$e)}),ve=g[Y].rootEvents,Pm.forEach(ie=>{ve&&Xc&&(c.documentElement.removeEventListener(ie,ve),g[Y].rootEvents=void 0),iu&&(m.documentElement.addEventListener(ie,$e),g[Y].rootEvents=$e)});let oa=g[Y].stateOwnersUpdateHandlers;if(oa&&Tl&&(Array.isArray(oa)?oa:[oa]).forEach(ue=>{typeof ue=="function"&&ue()}),ru){let ie=Dm.map(ue=>ue($e,m)).filter(ue=>typeof ue=="function");g[Y].stateOwnersUpdateHandlers=ie.length===1?ie[0]:ie}else Tl&&(g[Y].stateOwnersUpdateHandlers=void 0)}),Object.entries(m).forEach(([Y,Ro])=>{c[Y]=Ro}),v(),m=void 0};return A({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(f){let{type:R,detail:O}=f;if(o[R]&&p.mediaErrorCode==null){h(o[R](r,c,f));return}R==="mediaelementchangerequest"?A({media:O}):R==="fullscreenelementchangerequest"?A({fullscreenElement:O}):R==="documentelementchangerequest"?A({documentElement:O}):R==="optionschangerequest"&&(Object.entries(O??{}).forEach(([Ne,nt])=>{c.options[Ne]=nt}),v())},getState(){return p},subscribe(f){return A({},l.length+1),l.push(f),f(p),()=>{let R=l.indexOf(f);R>=0&&(A({},l.length-1),l.splice(R,1))}}}};var od=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},C=(i,e,t)=>(od(i,e,"read from private field"),t?t.call(i):e.get(i)),qe=(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)},lt=(i,e,t,r)=>(od(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(od(i,e,"access private method"),t),Xt,on,W,Fi,nn,dt,Ua,an,Na,jl,Ki,wr,$a,ed,td,Lh,wh=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],_h=10,yh=.025,Th=.25,Wv=.25,Fv=2,y={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"},id=class extends Ni{constructor(){super(),qe(this,Na),qe(this,Ki),qe(this,$a),qe(this,td),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,qe(this,Xt,new Zt(this,y.HOTKEYS)),qe(this,on,void 0),qe(this,W,void 0),qe(this,Fi,null),qe(this,nn,void 0),qe(this,dt,void 0),qe(this,Ua,t=>{var r;(r=C(this,W))==null||r.dispatch(t)}),qe(this,an,void 0),this.associateElement(this);let e={};lt(this,nn,t=>{Object.entries(t).forEach(([r,o])=>{if(r in e&&e[r]===o)return;this.propagateMediaState(r,o);let n=r.toLowerCase(),a=new d.CustomEvent(Nu[n],{composed:!0,detail:o});this.dispatchEvent(a)}),e=t}),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(y.NO_HOTKEYS,y.HOTKEYS,y.DEFAULT_STREAM_TYPE,y.DEFAULT_SUBTITLES,y.DEFAULT_DURATION,y.NO_MUTED_PREF,y.NO_VOLUME_PREF,y.LANG,y.LOOP)}get mediaStore(){return C(this,W)}set mediaStore(e){var t,r;if(C(this,W)&&((t=C(this,dt))==null||t.call(this),lt(this,dt,void 0)),lt(this,W,e),!C(this,W)&&!this.hasAttribute(y.NO_DEFAULT_STORE)){ct(this,Na,jl).call(this);return}lt(this,dt,(r=C(this,W))==null?void 0:r.subscribe(C(this,nn)))}get fullscreenElement(){var e;return(e=C(this,on))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(y.FULLSCREEN_ELEMENT)&&this.removeAttribute(y.FULLSCREEN_ELEMENT),lt(this,on,e),(t=C(this,W))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return w(this,y.DEFAULT_SUBTITLES)}set defaultSubtitles(e){I(this,y.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return P(this,y.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){D(this,y.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return $(this,y.DEFAULT_DURATION)}set defaultDuration(e){B(this,y.DEFAULT_DURATION,e)}get noHotkeys(){return w(this,y.NO_HOTKEYS)}set noHotkeys(e){I(this,y.NO_HOTKEYS,e)}get keysUsed(){return P(this,y.KEYS_USED)}set keysUsed(e){D(this,y.KEYS_USED,e)}get liveEdgeOffset(){return $(this,y.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,y.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return w(this,y.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){I(this,y.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return w(this,y.NO_VOLUME_PREF)}set noVolumePref(e){I(this,y.NO_VOLUME_PREF,e)}get noMutedPref(){return w(this,y.NO_MUTED_PREF)}set noMutedPref(e){I(this,y.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return w(this,y.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){I(this,y.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return w(this,y.NO_DEFAULT_STORE)}set noDefaultStore(e){I(this,y.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,a,l,c,p,h,v,g,m,A,f;if(super.attributeChangedCallback(e,t,r),e===y.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(y.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===y.HOTKEYS)C(this,Xt).value=r;else if(e===y.DEFAULT_SUBTITLES&&r!==t)(o=C(this,W))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES)}});else if(e===y.DEFAULT_STREAM_TYPE)(a=C(this,W))==null||a.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===y.LIVE_EDGE_OFFSET)(l=C(this,W))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(y.LIVE_EDGE_OFFSET)}});else if(e===y.SEEK_TO_LIVE_OFFSET)(c=C(this,W))==null||c.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===y.NO_AUTO_SEEK_TO_LIVE)(p=C(this,W))==null||p.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE)}});else if(e===y.FULLSCREEN_ELEMENT){let R=r?(h=this.getRootNode())==null?void 0:h.getElementById(r):void 0;lt(this,on,R),(v=C(this,W))==null||v.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===y.LANG&&r!==t?(Gu(r),(g=C(this,W))==null||g.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===y.LOOP&&r!==t?(m=C(this,W))==null||m.dispatch({type:b.MEDIA_LOOP_REQUEST,detail:r!=null}):e===y.NO_VOLUME_PREF&&r!==t?(A=C(this,W))==null||A.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF)}}):e===y.NO_MUTED_PREF&&r!==t&&((f=C(this,W))==null||f.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(y.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!C(this,W)&&!this.hasAttribute(y.NO_DEFAULT_STORE)&&ct(this,Na,jl).call(this),(e=C(this,W))==null||e.dispatch({type:"documentelementchangerequest",detail:ee}),super.connectedCallback(),C(this,W)&&!C(this,dt)&&lt(this,dt,(t=C(this,W))==null?void 0:t.subscribe(C(this,nn))),C(this,an)!==void 0&&C(this,W)&&this.media&&setTimeout(()=>{var r,o,n;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((n=C(this,W))==null||n.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:C(this,an)}))},0),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,o,n;if((e=super.disconnectedCallback)==null||e.call(this),C(this,W)){let a=C(this,W).getState();lt(this,an,!!((t=a.mediaSubtitlesShowing)!=null&&t.length)),(r=C(this,W))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=C(this,W))==null||o.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}C(this,dt)&&((n=C(this,dt))==null||n.call(this),lt(this,dt,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=C(this,W))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=C(this,W))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){kh(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),o=this.unregisterMediaStateReceiver.bind(this),n=Qv(e,r,o);Object.values(b).forEach(a=>{e.addEventListener(a,C(this,Ua))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(b).forEach(o=>{e.removeEventListener(o,C(this,Ua))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),C(this,W)&&Object.entries(C(this,W).getState()).forEach(([o,n])=>{kh([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",ct(this,$a,ed))}disableHotkeys(){this.removeEventListener("keydown",ct(this,$a,ed)),this.removeEventListener("keyup",ct(this,Ki,wr))}get hotkeys(){return P(this,y.HOTKEYS)}set hotkeys(e){D(this,y.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,a,l,c,p,h;let v=e.target;if(((o=(r=(t=v.getAttribute(y.KEYS_USED))==null?void 0:t.split(" "))!=null?r:v==null?void 0:v.keysUsed)!=null?o:[]).map(O=>O==="Space"?" ":O).filter(Boolean).includes(e.key))return;let m,A,f;if(!(C(this,Xt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&C(this,Xt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&C(this,Xt).contains("noshift+/")))switch(e.key){case" ":case"k":m=C(this,W).getState().mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m=this.mediaStore.getState().mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let O=this.hasAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET):_h;A=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-O,0),f=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowRight":case"l":{let O=this.hasAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET):_h;A=Math.max(((a=this.mediaStore.getState().mediaCurrentTime)!=null?a:0)+O,0),f=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowUp":{let O=this.hasAttribute(y.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_UP_VOLUME_STEP):yh;A=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+O,1),f=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowDown":{let O=this.hasAttribute(y.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_DOWN_VOLUME_STEP):yh;A=Math.max(((c=this.mediaStore.getState().mediaVolume)!=null?c:1)-O,0),f=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"<":{let O=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;A=Math.max(O-Th,Wv).toFixed(2),f=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case">":{let O=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;A=Math.min(O+Th,Fv).toFixed(2),f=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"/":case"?":{e.shiftKey&&ct(this,td,Lh).call(this);break}case"p":{m=this.mediaStore.getState().mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST,f=new d.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(f);break}default:break}}};Xt=new WeakMap;on=new WeakMap;W=new WeakMap;Fi=new WeakMap;nn=new WeakMap;dt=new WeakMap;Ua=new WeakMap;an=new WeakMap;Na=new WeakSet;jl=function(){var i;this.mediaStore=bh({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(y.DEFAULT_DURATION)?+this.getAttribute(y.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(y.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(y.NO_SUBTITLES_LANG_PREF)}})};Ki=new WeakSet;wr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||wh.includes(e))){this.removeEventListener("keyup",ct(this,Ki,wr));return}this.keyboardShortcutHandler(i)};$a=new WeakSet;ed=function(i){var e;let{metaKey:t,altKey:r,key:o,shiftKey:n}=i,a=n&&(o==="/"||o==="?");if(a&&((e=C(this,Fi))!=null&&e.open)){this.removeEventListener("keyup",ct(this,Ki,wr));return}if(t||r||!a&&!wh.includes(o)){this.removeEventListener("keyup",ct(this,Ki,wr));return}let l=i.target,c=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(o)&&!(C(this,Xt).contains(`no${o.toLowerCase()}`)||o===" "&&C(this,Xt).contains("nospace"))&&!c&&i.preventDefault(),this.addEventListener("keyup",ct(this,Ki,wr),{once:!0})};td=new WeakSet;Lh=function(){C(this,Fi)||(lt(this,Fi,ee.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(C(this,Fi))),C(this,Fi).open=!0};var Kv=Object.values(s),qv=Object.values($l),Ih=i=>{var e,t,r,o;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let a=(o=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,N.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:o.call(r,/\s+/);return Array.isArray(n||a)?(n||a).filter(l=>Kv.includes(l)):[]},Gv=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&d.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof d.customElements.get(i.nodeName.toLowerCase()))&&d.customElements.upgrade(i),qv.some(r=>r in i)},rd=i=>Gv(i)||!!Ih(i).length,Ah=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Sh={[s.MEDIA_SUBTITLES_LIST]:Ut,[s.MEDIA_SUBTITLES_SHOWING]:Ut,[s.MEDIA_SEEKABLE]:Ah,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Ah).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:Hu,[s.MEDIA_AUDIO_TRACK_LIST]:Vu},zv=async(i,e,t)=>{var r,o;if(i.isConnected||await pa(0),typeof t=="boolean"||t==null)return I(i,e,t);if(typeof t=="number")return B(i,e,t);if(typeof t=="string")return D(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(o=(r=Sh[e])==null?void 0:r.call(Sh,t))!=null?o:t;return i.setAttribute(e,n)},Yv=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Wi=(i,e)=>{if(Yv(i))return;let t=(o,n)=>{var a,l;rd(o)&&n(o);let{children:c=[]}=o??{},p=(l=(a=o==null?void 0:o.shadowRoot)==null?void 0:a.children)!=null?l:[];[...c,...p].forEach(v=>Wi(v,n))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!rd(i)){d.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},kh=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=Ih(r),n=e.toLowerCase();o.includes(n)&&zv(r,n,t)})},Qv=(i,e,t)=>{Wi(i,e);let r=h=>{var v;let g=(v=h==null?void 0:h.composedPath()[0])!=null?v:h.target;e(g)},o=h=>{var v;let g=(v=h==null?void 0:h.composedPath()[0])!=null?v:h.target;t(g)};i.addEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=h=>{h.forEach(v=>{let{addedNodes:g=[],removedNodes:m=[],type:A,target:f,attributeName:R}=v;A==="childList"?(Array.prototype.forEach.call(g,O=>Wi(O,e)),Array.prototype.forEach.call(m,O=>Wi(O,t))):A==="attributes"&&R===N.MEDIA_CHROME_ATTRIBUTES&&(rd(f)?e(f):t(f))})},a=[],l=h=>{let v=h.target;v.name!=="media"&&(a.forEach(g=>Wi(g,t)),a=[...v.assignedElements({flatten:!0})],a.forEach(g=>Wi(g,e)))};i.addEventListener("slotchange",l);let c=new MutationObserver(n);return c.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Wi(i,t),i.removeEventListener("slotchange",l),c.disconnect(),i.removeEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",id);var Ir={PLACEMENT:"placement",BOUNDS:"bounds"};function Zv(i){return`
418
+ `}var wv=Object.values(s),Cv="sm:384 md:576 lg:768 xl:960";function Iv(i){oh(i.target,i.contentRect.width)}function oh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(M.BREAKPOINTS))!=null?t:Cv,o=Mv(r),n=Rv(o,e),a=!1;if(Object.keys(o).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),a=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),a=!0)}),a){let l=new CustomEvent(Pi.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Pi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Mv(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Rv(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Ni=class extends d.HTMLElement{constructor(){if(super(),Be(this,Fl),Be(this,Kl),Be(this,ql),Be(this,jo),Be(this,wa),Be(this,Tr),Be(this,ka,0),Be(this,_r,null),Be(this,Jo,null),Be(this,yr,void 0),this.breakpointsComputed=!1,Be(this,Aa,new MutationObserver(Ke(this,Fl,th).bind(this))),Be(this,Xo,!1),Be(this,Sa,t=>{Ve(this,Xo)||(setTimeout(()=>{Iv(t),Ui(this,Xo,!1)},0),Ui(this,Xo,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=j(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){Ve(this,_r)&&this.mediaUnsetCallback(Ve(this,_r));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[M.AUTOHIDE,M.GESTURES_DISABLED].concat(wv).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_CHAPTERS_CUES,s.MEDIA_WIDTH,s.MEDIA_HEIGHT,s.MEDIA_ERROR,s.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==M.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&&(Ui(this,_r,e),e.localName.includes("-")&&await d.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ve(this,Aa).observe(this,{childList:!0,subtree:!0}),Pt(this,Ve(this,Sa));let r=this.getAttribute(M.AUDIO)!=null?E("audio player"):E("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(M.USER_INACTIVE,""),oh(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=d.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Ve(this,Aa).disconnect(),Dt(this,Ve(this,Sa)),this.media&&this.mediaUnsetCallback(this.media),(e=d.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ui(this,_r,null)}handleEvent(e){switch(e.type){case"pointerdown":Ui(this,ka,e.timeStamp);break;case"pointermove":Ke(this,Kl,ih).call(this,e);break;case"pointerup":Ke(this,ql,rh).call(this,e);break;case"mouseleave":Ke(this,jo,La).call(this);break;case"mouseup":this.removeAttribute(M.KEYBOARD_CONTROL);break;case"keyup":Ke(this,Tr,en).call(this),this.setAttribute(M.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ui(this,yr,isNaN(t)?0:t)}get autohide(){return(Ve(this,yr)===void 0?2:Ve(this,yr)).toString()}get breakpoints(){return P(this,M.BREAKPOINTS)}set breakpoints(e){D(this,M.BREAKPOINTS,e)}get audio(){return w(this,M.AUDIO)}set audio(e){C(this,M.AUDIO,e)}get gesturesDisabled(){return w(this,M.GESTURES_DISABLED)}set gesturesDisabled(e){C(this,M.GESTURES_DISABLED,e)}get keyboardControl(){return w(this,M.KEYBOARD_CONTROL)}set keyboardControl(e){C(this,M.KEYBOARD_CONTROL,e)}get noAutohide(){return w(this,M.NO_AUTOHIDE)}set noAutohide(e){C(this,M.NO_AUTOHIDE,e)}get autohideOverControls(){return w(this,M.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){C(this,M.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return w(this,M.USER_INACTIVE)}set userInteractive(e){C(this,M.USER_INACTIVE,e)}};ka=new WeakMap;_r=new WeakMap;Jo=new WeakMap;yr=new WeakMap;Aa=new WeakMap;Fl=new WeakSet;th=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let o of r){if(o.slot!="media"||t.target!=this)continue;let n=t.previousSibling&&t.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(o);else{let a=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(a=!1);a&&this.mediaUnsetCallback(o)}}if(e)for(let o of t.addedNodes)o===e&&this.handleMediaUpdated(e)}};Xo=new WeakMap;Sa=new WeakMap;Kl=new WeakSet;ih=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-Ve(this,ka)<250)return;Ke(this,wa,zl).call(this),clearTimeout(Ve(this,Jo));let e=this.hasAttribute(M.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Ke(this,Tr,en).call(this)};ql=new WeakSet;rh=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(M.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Ke(this,jo,La).call(this):Ke(this,Tr,en).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Ke(this,Tr,en).call(this)};jo=new WeakSet;La=function(){if(Ve(this,yr)<0||this.hasAttribute(M.USER_INACTIVE))return;this.setAttribute(M.USER_INACTIVE,"");let i=new d.CustomEvent(Pi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};wa=new WeakSet;zl=function(){if(!this.hasAttribute(M.USER_INACTIVE))return;this.removeAttribute(M.USER_INACTIVE);let i=new d.CustomEvent(Pi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Tr=new WeakSet;en=function(){Ke(this,wa,zl).call(this),clearTimeout(Ve(this,Jo));let i=parseInt(this.autohide);i<0||Ui(this,Jo,setTimeout(()=>{Ke(this,jo,La).call(this)},i*1e3))};Ni.shadowRootOptions={mode:"open"};Ni.getTemplateHTML=Lv;d.customElements.get("media-container")||d.customElements.define("media-container",Ni);var nh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(nh(i,e,"read from private field"),t?t.call(i):e.get(i)),tn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ca=(i,e,t,r)=>(nh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ar,Sr,Ia,Hi,Ot,Qt,Zt=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){tn(this,Ot),tn(this,Ar,void 0),tn(this,Sr,void 0),tn(this,Ia,void 0),tn(this,Hi,new Set),Ca(this,Ar,e),Ca(this,Sr,t),Ca(this,Ia,new Set(r))}[Symbol.iterator](){return ge(this,Ot,Qt).values()}get length(){return ge(this,Ot,Qt).size}get value(){var e;return(e=[...ge(this,Ot,Qt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ca(this,Hi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...ge(this,Ot,Qt)][e]}values(){return ge(this,Ot,Qt).values()}forEach(e,t){ge(this,Ot,Qt).forEach(e,t)}add(...e){var t,r;e.forEach(o=>ge(this,Hi).add(o)),!(this.value===""&&!((t=ge(this,Ar))!=null&&t.hasAttribute(`${ge(this,Sr)}`)))&&((r=ge(this,Ar))==null||r.setAttribute(`${ge(this,Sr)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>ge(this,Hi).delete(r)),(t=ge(this,Ar))==null||t.setAttribute(`${ge(this,Sr)}`,`${this.value}`)}contains(e){return ge(this,Ot,Qt).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}};Ar=new WeakMap;Sr=new WeakMap;Ia=new WeakMap;Hi=new WeakMap;Ot=new WeakSet;Qt=function(){return ge(this,Hi).size?ge(this,Hi):ge(this,Ia)};var xv=(i="")=>i.split(/\s+/),ah=(i="")=>{let[e,t,r]=i.split(":"),o=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Me.CAPTIONS:Me.SUBTITLES,language:t,label:o}},$i=(i="",e={})=>xv(i).map(t=>{let r=ah(t);return{...e,...r}}),Yl=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?ah(e):e):typeof i=="string"?$i(i):[i]:[],Ma=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Ut=(i=[])=>Array.prototype.map.call(i,Ma).join(" "),Pv=(i,e)=>t=>t[i]===e,sh=i=>{let e=Object.entries(i).map(([t,r])=>Pv(t,r));return t=>e.every(r=>r(t))},Bi=(i,e=[],t=[])=>{let r=Yl(t).map(sh),o=n=>r.some(a=>a(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Vi=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:sh(e);return Array.from(i.textTracks).filter(t)},Ra=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var dh=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let o=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(o){let n=(e=r[o])==null?void 0:e.call(r);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(o){console.error(o)}},lh="exitFullscreen"in ee?"exitFullscreen":"webkitExitFullscreen"in ee?"webkitExitFullscreen":"webkitCancelFullScreen"in ee?"webkitCancelFullScreen":void 0,ch=i=>{var e;let{documentElement:t}=i;if(lh){let r=(e=t==null?void 0:t[lh])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},rn="fullscreenElement"in ee?"fullscreenElement":"webkitFullscreenElement"in ee?"webkitFullscreenElement":void 0,Dv=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[rn];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===$u.FULLSCREEN?t:r},uh=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=Dv(i);if(!n)return!1;if(n===o||n===t)return!0;if(n.localName.includes("-")){let a=n.shadowRoot;if(!(rn in a))return Ae(n,o);for(;a!=null&&a[rn];){if(a[rn]===o)return!0;a=(e=a[rn])==null?void 0:e.shadowRoot}}return!1},Ov="fullscreenEnabled"in ee?"fullscreenEnabled":"webkitFullscreenEnabled"in ee?"webkitFullscreenEnabled":void 0,hh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[Ov])||t&&"webkitSupportsFullscreen"in t};var xa,Ql=()=>{var i,e;return xa||(xa=(e=(i=ee)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),xa)},ph=async(i=Ql())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([Uv(i,t.signal),Nv(i,e)]);return t.abort(),r},Uv=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),Nv=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await pa(10)}return i.volume!==e},Hv=/.*Version\/.*Safari\/.*/.test(d.navigator.userAgent),Zl=(i=Ql())=>d.matchMedia("(display-mode: standalone)").matches&&Hv?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Xl=(i=Ql())=>hh({documentElement:ee,media:i}),mh=Xl(),vh=Zl(),fh=!!d.WebKitPlaybackTargetAvailabilityEvent,gh=!!d.chrome;var kr=i=>Vi(i.media,e=>[Me.SUBTITLES,Me.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Jl=i=>Vi(i.media,e=>e.mode===zt.SHOWING&&[Me.SUBTITLES,Me.CAPTIONS].includes(e.kind)),Pa=(i,e)=>{let t=kr(i),r=Jl(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)Bi(zt.DISABLED,t,r);else if(e===!0||!o&&e!==!1){let n=t[0],{options:a}=i;if(!(a!=null&&a.noSubtitlesLangPref)){let h=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),v=h?[h,...globalThis.navigator.languages]:globalThis.navigator.languages,g=t.filter(p=>v.some(A=>p.language.toLowerCase().startsWith(A.split("-")[0]))).sort((p,A)=>{let f=v.findIndex(O=>p.language.toLowerCase().startsWith(O.split("-")[0])),R=v.findIndex(O=>A.language.toLowerCase().startsWith(O.split("-")[0]));return f-R});g[0]&&(n=g[0])}let{language:l,label:c,kind:m}=n;Bi(zt.DISABLED,t,r),Bi(zt.SHOWING,t,[{language:l,label:c,kind:m}])}}},Da=(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)?$v(i,e):Object.entries(i).every(([t,r])=>t in e&&Da(r,e[t])),$v=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((o,n)=>Da(o,e[n])):!0};var Bv=Object.values(Xe),Oa,Vv=ph().then(i=>(Oa=i,Oa)),Eh=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof d.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=d.customElements.get(t);r&&e instanceof r||(await d.customElements.whenDefined(t),d.customElements.upgrade(e))}))},Wv=new d.DOMParser,Fv=i=>i&&(Wv.parseFromString(i,"text/html").body.textContent||i),Lr={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:o}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=o==null?void 0:o.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 o=d.localStorage.getItem("media-chrome-pref-muted")!==null,n=t.hasAttribute("muted");if(r){o&&d.localStorage.removeItem("media-chrome-pref-muted");return}if(n&&!o)return;d.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(o){console.debug("Error setting muted pref",o)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let o=d.localStorage.getItem("media-chrome-pref-muted")==="true";Lr.mediaMuted.set(o,e),i(o)}catch(o){console.debug("Error getting muted pref",o)}}]},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?d.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&d.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(o){console.debug("Error setting volume pref",o)}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 o=d.localStorage.getItem("media-chrome-pref-volume");if(o==null)return;Lr.mediaVolume.set(+o,e),i(+o)}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||!Er(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),o=t.seekable.end(t.seekable.length-1);if(!(!r&&!o))return[Number(r.toFixed(3)),Number(o.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((o,n)=>[Number(r.start(n).toFixed(3)),Number(r.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[Xe.LIVE,Xe.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if(Bv.includes(o))return o===Xe.UNKNOWN?r:o;let n=e.duration;return n===1/0?Xe.LIVE:Number.isFinite(n)?Xe.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=Lr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===Xe.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(!(Lr.mediaStreamType.get(i)===Xe.LIVE))return!1;let o=e.seekable;if(!o)return!0;if(!o.length)return!1;let n=o.end(o.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return kr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Jl(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:o,options:n}=e;if(!o)return;let a=l=>{var c;!n.defaultSubtitles||l&&![Me.CAPTIONS,Me.SUBTITLES].includes((c=l==null?void 0:l.track)==null?void 0:c.kind)||Pa(e,!0)};return o.addEventListener("loadstart",a),(t=o.textTracks)==null||t.addEventListener("addtrack",a),(r=o.textTracks)==null||r.addEventListener("removetrack",a),()=>{var l,c;o.removeEventListener("loadstart",a),(l=o.textTracks)==null||l.removeEventListener("addtrack",a),(c=o.textTracks)==null||c.removeEventListener("removetrack",a)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Vi(t,{kind:Me.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:a})=>({text:Fv(o),startTime:n,endTime:a}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let o=r.querySelector('track[kind="chapters"][default][src]'),n=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return o==null||o.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{o==null||o.removeEventListener("load",i),n==null||n.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:o}=i;if(!r||!o||!o.pictureInPictureElement)return!1;if(o.pictureInPictureElement===r)return!0;if(o.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Ae(r,o.pictureInPictureElement):!1;if(o.pictureInPictureElement.localName.includes("-")){let n=o.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===r)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!ee.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(o=>{if(o.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 n=()=>{t.removeEventListener("loadedmetadata",a),t.preload="none"},a=()=>{t.requestPictureInPicture().catch(r),n()};t.addEventListener("loadedmetadata",a),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),n()},1e3)}else throw o}else throw o})}else ee.pictureInPictureElement&&ee.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:o}=i;return(r=(t=o==null?void 0:o.videoRenditions)==null?void 0:t[(e=o.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,o=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==r);t.videoRenditions.selectedIndex!=o&&(t.videoRenditions.selectedIndex=o)},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(o=>o.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 o of t.audioTracks)o.enabled=r==o.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return uh(i)},set(i,e,t){var r;i?(dh(e),t.detail&&((r=e.media)==null||r.focus())):ch(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:o}=e;if(o&&!(i&&((t=o.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=o.remote)==null?void 0:r.state)!=="connected")){if(typeof o.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}o.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&d.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(!mh||!Xl(e))return Re.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!vh||!Zl(e))return Re.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Re.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(Oa===!1||(e==null?void 0:e.volume)==null)return Re.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{Oa==null&&Vv.then(e=>i(e?void 0:Re.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!gh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Re.UNSUPPORTED;if(!(e==null||e==="available"))return Re.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(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!fh)return Re.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Re.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(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Re.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Re.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Re.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Re.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var bh={[b.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:a}=e,l=t??void 0,c,m;if(a&&l!=null){let[p]=Vi(a,{kind:Me.METADATA,label:"thumbnails"}),A=Array.prototype.find.call((r=p==null?void 0:p.cues)!=null?r:[],(f,R,O)=>R===0?f.endTime>l:R===O.length-1?f.startTime<=l:f.startTime<=l&&f.endTime>l);if(A){let f=/'^(?:[a-z]+:)?\/\//i.test(A.text)||(o=a==null?void 0:a.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,R=new URL(A.text,f);m=new URLSearchParams(R.hash).get("#xywh").split(",").map(Ne=>+Ne),c=R.href}}let h=i.mediaDuration.get(e),g=(n=i.mediaChaptersCues.get(e).find((p,A,f)=>A===f.length-1&&h===p.endTime?p.startTime<=l&&p.endTime>=l:p.startTime<=l&&p.endTime>l))==null?void 0:n.text;return t!=null&&g==null&&(g=""),{mediaPreviewTime:l,mediaPreviewImage:c,mediaPreviewCoords:m,mediaPreviewChapter:g}},[b.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[b.MEDIA_PLAY_REQUEST](i,e){var t,r,o,n;let a="mediaPaused",c=i.mediaStreamType.get(e)===Xe.LIVE,m=!((t=e.options)!=null&&t.noAutoSeekToLive),h=i.mediaTargetLiveWindow.get(e)>0;if(c&&m&&!h){let v=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(v){let g=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,p=v-g;i.mediaCurrentTime.set(p,e)}}i[a].set(!1,e)},[b.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,e)},[b.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[b.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[b.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[b.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",o=t;o&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(o,e)},[b.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[b.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,o;let n="mediaCurrentTime",a=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(a)))return;let l=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,c=a-l;i[n].set(c,e)},[b.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=kr(e),a=Yl(t),l=(r=a[0])==null?void 0:r.language;l&&!o.noSubtitlesLangPref&&d.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Bi(zt.SHOWING,n,a)},[b.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=kr(e),o=t??[];Bi(zt.DISABLED,r,o)},[b.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){Pa(e,t)},[b.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[b.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,e)},[b.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[b.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)},[b.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[b.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[b.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[b.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var _h=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Lr,requestMap:o=bh,options:n={},monitorStateOwnersOnlyWithSubscriptions:a=!0})=>{let l=[],c={options:{...n}},m=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),h=f=>{f!=null&&(Da(f,m)||(m=Object.freeze({...m,...f}),l.forEach(R=>R(m))))},v=()=>{let f=Object.entries(r).reduce((R,[O,{get:Ne}])=>(R[O]=Ne(c),R),{});h(f)},g={},p,A=async(f,R)=>{var O,Ne,nt,Io,cr,Hc,yl,k,K,ne,te,G,pe,Rt,Mo,$c;let Im=!!p;if(p={...c,...p??{},...f},Im)return;await Eh(...Object.values(f));let ur=l.length>0&&R===0&&a,Bc=c.media!==p.media,Vc=((O=c.media)==null?void 0:O.textTracks)!==((Ne=p.media)==null?void 0:Ne.textTracks),Wc=((nt=c.media)==null?void 0:nt.videoRenditions)!==((Io=p.media)==null?void 0:Io.videoRenditions),Fc=((cr=c.media)==null?void 0:cr.audioTracks)!==((Hc=p.media)==null?void 0:Hc.audioTracks),Kc=((yl=c.media)==null?void 0:yl.remote)!==((k=p.media)==null?void 0:k.remote),qc=c.documentElement!==p.documentElement,Gc=!!c.media&&(Bc||ur),zc=!!((K=c.media)!=null&&K.textTracks)&&(Vc||ur),Yc=!!((ne=c.media)!=null&&ne.videoRenditions)&&(Wc||ur),Qc=!!((te=c.media)!=null&&te.audioTracks)&&(Fc||ur),Zc=!!((G=c.media)!=null&&G.remote)&&(Kc||ur),Xc=!!c.documentElement&&(qc||ur),Tl=Gc||zc||Yc||Qc||Zc||Xc,hr=l.length===0&&R===1&&a,Jc=!!p.media&&(Bc||hr),L=!!((pe=p.media)!=null&&pe.textTracks)&&(Vc||hr),jc=!!((Rt=p.media)!=null&&Rt.videoRenditions)&&(Wc||hr),eu=!!((Mo=p.media)!=null&&Mo.audioTracks)&&(Fc||hr),tu=!!(($c=p.media)!=null&&$c.remote)&&(Kc||hr),iu=!!p.documentElement&&(qc||hr),ru=Jc||L||jc||eu||tu||iu;if(!(Tl||ru)){Object.entries(p).forEach(([Y,Ro])=>{c[Y]=Ro}),v(),p=void 0;return}Object.entries(r).forEach(([Y,{get:Ro,mediaEvents:Mm=[],textTracksEvents:Rm=[],videoRenditionsEvents:xm=[],audioTracksEvents:Pm=[],remoteEvents:Dm=[],rootEvents:Om=[],stateOwnersUpdateHandlers:Um=[]}])=>{g[Y]||(g[Y]={});let He=ie=>{let ue=Ro(c,ie);h({[Y]:ue})},ve;ve=g[Y].mediaEvents,Mm.forEach(ie=>{ve&&Gc&&(c.media.removeEventListener(ie,ve),g[Y].mediaEvents=void 0),Jc&&(p.media.addEventListener(ie,He),g[Y].mediaEvents=He)}),ve=g[Y].textTracksEvents,Rm.forEach(ie=>{var ue,Ze;ve&&zc&&((ue=c.media.textTracks)==null||ue.removeEventListener(ie,ve),g[Y].textTracksEvents=void 0),L&&((Ze=p.media.textTracks)==null||Ze.addEventListener(ie,He),g[Y].textTracksEvents=He)}),ve=g[Y].videoRenditionsEvents,xm.forEach(ie=>{var ue,Ze;ve&&Yc&&((ue=c.media.videoRenditions)==null||ue.removeEventListener(ie,ve),g[Y].videoRenditionsEvents=void 0),jc&&((Ze=p.media.videoRenditions)==null||Ze.addEventListener(ie,He),g[Y].videoRenditionsEvents=He)}),ve=g[Y].audioTracksEvents,Pm.forEach(ie=>{var ue,Ze;ve&&Qc&&((ue=c.media.audioTracks)==null||ue.removeEventListener(ie,ve),g[Y].audioTracksEvents=void 0),eu&&((Ze=p.media.audioTracks)==null||Ze.addEventListener(ie,He),g[Y].audioTracksEvents=He)}),ve=g[Y].remoteEvents,Dm.forEach(ie=>{var ue,Ze;ve&&Zc&&((ue=c.media.remote)==null||ue.removeEventListener(ie,ve),g[Y].remoteEvents=void 0),tu&&((Ze=p.media.remote)==null||Ze.addEventListener(ie,He),g[Y].remoteEvents=He)}),ve=g[Y].rootEvents,Om.forEach(ie=>{ve&&Xc&&(c.documentElement.removeEventListener(ie,ve),g[Y].rootEvents=void 0),iu&&(p.documentElement.addEventListener(ie,He),g[Y].rootEvents=He)});let oa=g[Y].stateOwnersUpdateHandlers;if(oa&&Tl&&(Array.isArray(oa)?oa:[oa]).forEach(ue=>{typeof ue=="function"&&ue()}),ru){let ie=Um.map(ue=>ue(He,p)).filter(ue=>typeof ue=="function");g[Y].stateOwnersUpdateHandlers=ie.length===1?ie[0]:ie}else Tl&&(g[Y].stateOwnersUpdateHandlers=void 0)}),Object.entries(p).forEach(([Y,Ro])=>{c[Y]=Ro}),v(),p=void 0};return A({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(f){let{type:R,detail:O}=f;if(o[R]&&m.mediaErrorCode==null){h(o[R](r,c,f));return}R==="mediaelementchangerequest"?A({media:O}):R==="fullscreenelementchangerequest"?A({fullscreenElement:O}):R==="documentelementchangerequest"?A({documentElement:O}):R==="optionschangerequest"&&(Object.entries(O??{}).forEach(([Ne,nt])=>{c.options[Ne]=nt}),v())},getState(){return m},subscribe(f){return A({},l.length+1),l.push(f),f(m),()=>{let R=l.indexOf(f);R>=0&&(A({},l.length-1),l.splice(R,1))}}}};var od=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},I=(i,e,t)=>(od(i,e,"read from private field"),t?t.call(i):e.get(i)),qe=(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)},lt=(i,e,t,r)=>(od(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(od(i,e,"access private method"),t),Xt,on,W,Fi,nn,dt,Ua,an,Na,jl,Ki,wr,Ha,ed,td,wh,Ch=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],yh=10,Th=.025,Ah=.25,Kv=.25,qv=2,y={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"},id=class extends Ni{constructor(){super(),qe(this,Na),qe(this,Ki),qe(this,Ha),qe(this,td),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,qe(this,Xt,new Zt(this,y.HOTKEYS)),qe(this,on,void 0),qe(this,W,void 0),qe(this,Fi,null),qe(this,nn,void 0),qe(this,dt,void 0),qe(this,Ua,t=>{var r;(r=I(this,W))==null||r.dispatch(t)}),qe(this,an,void 0),this.associateElement(this);let e={};lt(this,nn,t=>{Object.entries(t).forEach(([r,o])=>{if(r in e&&e[r]===o)return;this.propagateMediaState(r,o);let n=r.toLowerCase(),a=new d.CustomEvent(Hu[n],{composed:!0,detail:o});this.dispatchEvent(a)}),e=t}),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(y.NO_HOTKEYS,y.HOTKEYS,y.DEFAULT_STREAM_TYPE,y.DEFAULT_SUBTITLES,y.DEFAULT_DURATION,y.NO_MUTED_PREF,y.NO_VOLUME_PREF,y.LANG,y.LOOP)}get mediaStore(){return I(this,W)}set mediaStore(e){var t,r;if(I(this,W)&&((t=I(this,dt))==null||t.call(this),lt(this,dt,void 0)),lt(this,W,e),!I(this,W)&&!this.hasAttribute(y.NO_DEFAULT_STORE)){ct(this,Na,jl).call(this);return}lt(this,dt,(r=I(this,W))==null?void 0:r.subscribe(I(this,nn)))}get fullscreenElement(){var e;return(e=I(this,on))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(y.FULLSCREEN_ELEMENT)&&this.removeAttribute(y.FULLSCREEN_ELEMENT),lt(this,on,e),(t=I(this,W))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return w(this,y.DEFAULT_SUBTITLES)}set defaultSubtitles(e){C(this,y.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return P(this,y.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){D(this,y.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return H(this,y.DEFAULT_DURATION)}set defaultDuration(e){B(this,y.DEFAULT_DURATION,e)}get noHotkeys(){return w(this,y.NO_HOTKEYS)}set noHotkeys(e){C(this,y.NO_HOTKEYS,e)}get keysUsed(){return P(this,y.KEYS_USED)}set keysUsed(e){D(this,y.KEYS_USED,e)}get liveEdgeOffset(){return H(this,y.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,y.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return w(this,y.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){C(this,y.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return w(this,y.NO_VOLUME_PREF)}set noVolumePref(e){C(this,y.NO_VOLUME_PREF,e)}get noMutedPref(){return w(this,y.NO_MUTED_PREF)}set noMutedPref(e){C(this,y.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return w(this,y.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){C(this,y.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return w(this,y.NO_DEFAULT_STORE)}set noDefaultStore(e){C(this,y.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,a,l,c,m,h,v,g,p,A,f;if(super.attributeChangedCallback(e,t,r),e===y.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(y.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===y.HOTKEYS)I(this,Xt).value=r;else if(e===y.DEFAULT_SUBTITLES&&r!==t)(o=I(this,W))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES)}});else if(e===y.DEFAULT_STREAM_TYPE)(a=I(this,W))==null||a.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===y.LIVE_EDGE_OFFSET)(l=I(this,W))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(y.LIVE_EDGE_OFFSET)}});else if(e===y.SEEK_TO_LIVE_OFFSET)(c=I(this,W))==null||c.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===y.NO_AUTO_SEEK_TO_LIVE)(m=I(this,W))==null||m.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE)}});else if(e===y.FULLSCREEN_ELEMENT){let R=r?(h=this.getRootNode())==null?void 0:h.getElementById(r):void 0;lt(this,on,R),(v=I(this,W))==null||v.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===y.LANG&&r!==t?(zu(r),(g=I(this,W))==null||g.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===y.LOOP&&r!==t?(p=I(this,W))==null||p.dispatch({type:b.MEDIA_LOOP_REQUEST,detail:r!=null}):e===y.NO_VOLUME_PREF&&r!==t?(A=I(this,W))==null||A.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF)}}):e===y.NO_MUTED_PREF&&r!==t&&((f=I(this,W))==null||f.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(y.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!I(this,W)&&!this.hasAttribute(y.NO_DEFAULT_STORE)&&ct(this,Na,jl).call(this),(e=I(this,W))==null||e.dispatch({type:"documentelementchangerequest",detail:ee}),super.connectedCallback(),I(this,W)&&!I(this,dt)&&lt(this,dt,(t=I(this,W))==null?void 0:t.subscribe(I(this,nn))),I(this,an)!==void 0&&I(this,W)&&this.media&&setTimeout(()=>{var r,o,n;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((n=I(this,W))==null||n.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:I(this,an)}))},0),this.hasAttribute(y.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,o,n;if((e=super.disconnectedCallback)==null||e.call(this),I(this,W)){let a=I(this,W).getState();lt(this,an,!!((t=a.mediaSubtitlesShowing)!=null&&t.length)),(r=I(this,W))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=I(this,W))==null||o.dispatch({type:b.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}I(this,dt)&&((n=I(this,dt))==null||n.call(this),lt(this,dt,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=I(this,W))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=I(this,W))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){Lh(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),o=this.unregisterMediaStateReceiver.bind(this),n=Xv(e,r,o);Object.values(b).forEach(a=>{e.addEventListener(a,I(this,Ua))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(b).forEach(o=>{e.removeEventListener(o,I(this,Ua))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),I(this,W)&&Object.entries(I(this,W).getState()).forEach(([o,n])=>{Lh([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",ct(this,Ha,ed))}disableHotkeys(){this.removeEventListener("keydown",ct(this,Ha,ed)),this.removeEventListener("keyup",ct(this,Ki,wr))}get hotkeys(){return P(this,y.HOTKEYS)}set hotkeys(e){D(this,y.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,a,l,c,m,h;let v=e.target;if(((o=(r=(t=v.getAttribute(y.KEYS_USED))==null?void 0:t.split(" "))!=null?r:v==null?void 0:v.keysUsed)!=null?o:[]).map(O=>O==="Space"?" ":O).filter(Boolean).includes(e.key))return;let p,A,f;if(!(I(this,Xt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&I(this,Xt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&I(this,Xt).contains("noshift+/")))switch(e.key){case" ":case"k":p=I(this,W).getState().mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"m":p=this.mediaStore.getState().mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"f":p=this.mediaStore.getState().mediaIsFullscreen?b.MEDIA_EXIT_FULLSCREEN_REQUEST:b.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new d.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let O=this.hasAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_BACKWARD_SEEK_OFFSET):yh;A=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-O,0),f=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowRight":case"l":{let O=this.hasAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(y.KEYBOARD_FORWARD_SEEK_OFFSET):yh;A=Math.max(((a=this.mediaStore.getState().mediaCurrentTime)!=null?a:0)+O,0),f=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowUp":{let O=this.hasAttribute(y.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_UP_VOLUME_STEP):Th;A=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+O,1),f=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"ArrowDown":{let O=this.hasAttribute(y.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(y.KEYBOARD_DOWN_VOLUME_STEP):Th;A=Math.max(((c=this.mediaStore.getState().mediaVolume)!=null?c:1)-O,0),f=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"<":{let O=(m=this.mediaStore.getState().mediaPlaybackRate)!=null?m:1;A=Math.max(O-Ah,Kv).toFixed(2),f=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case">":{let O=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;A=Math.min(O+Ah,qv).toFixed(2),f=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:A}),this.dispatchEvent(f);break}case"/":case"?":{e.shiftKey&&ct(this,td,wh).call(this);break}case"p":{p=this.mediaStore.getState().mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST,f=new d.CustomEvent(p,{composed:!0,bubbles:!0}),this.dispatchEvent(f);break}default:break}}};Xt=new WeakMap;on=new WeakMap;W=new WeakMap;Fi=new WeakMap;nn=new WeakMap;dt=new WeakMap;Ua=new WeakMap;an=new WeakMap;Na=new WeakSet;jl=function(){var i;this.mediaStore=_h({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(y.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(y.DEFAULT_DURATION)?+this.getAttribute(y.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(y.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(y.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(y.SEEK_TO_LIVE_OFFSET):this.hasAttribute(y.LIVE_EDGE_OFFSET)?+this.getAttribute(y.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(y.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(y.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(y.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(y.NO_SUBTITLES_LANG_PREF)}})};Ki=new WeakSet;wr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||Ch.includes(e))){this.removeEventListener("keyup",ct(this,Ki,wr));return}this.keyboardShortcutHandler(i)};Ha=new WeakSet;ed=function(i){var e;let{metaKey:t,altKey:r,key:o,shiftKey:n}=i,a=n&&(o==="/"||o==="?");if(a&&((e=I(this,Fi))!=null&&e.open)){this.removeEventListener("keyup",ct(this,Ki,wr));return}if(t||r||!a&&!Ch.includes(o)){this.removeEventListener("keyup",ct(this,Ki,wr));return}let l=i.target,c=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(o)&&!(I(this,Xt).contains(`no${o.toLowerCase()}`)||o===" "&&I(this,Xt).contains("nospace"))&&!c&&i.preventDefault(),this.addEventListener("keyup",ct(this,Ki,wr),{once:!0})};td=new WeakSet;wh=function(){I(this,Fi)||(lt(this,Fi,ee.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(I(this,Fi))),I(this,Fi).open=!0};var Gv=Object.values(s),zv=Object.values(Hl),Ih=i=>{var e,t,r,o;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let a=(o=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,N.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:o.call(r,/\s+/);return Array.isArray(n||a)?(n||a).filter(l=>Gv.includes(l)):[]},Yv=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&d.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof d.customElements.get(i.nodeName.toLowerCase()))&&d.customElements.upgrade(i),zv.some(r=>r in i)},rd=i=>Yv(i)||!!Ih(i).length,Sh=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},kh={[s.MEDIA_SUBTITLES_LIST]:Ut,[s.MEDIA_SUBTITLES_SHOWING]:Ut,[s.MEDIA_SEEKABLE]:Sh,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Sh).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:Bu,[s.MEDIA_AUDIO_TRACK_LIST]:Wu},Qv=async(i,e,t)=>{var r,o;if(i.isConnected||await pa(0),typeof t=="boolean"||t==null)return C(i,e,t);if(typeof t=="number")return B(i,e,t);if(typeof t=="string")return D(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(o=(r=kh[e])==null?void 0:r.call(kh,t))!=null?o:t;return i.setAttribute(e,n)},Zv=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Wi=(i,e)=>{if(Zv(i))return;let t=(o,n)=>{var a,l;rd(o)&&n(o);let{children:c=[]}=o??{},m=(l=(a=o==null?void 0:o.shadowRoot)==null?void 0:a.children)!=null?l:[];[...c,...m].forEach(v=>Wi(v,n))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!rd(i)){d.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},Lh=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=Ih(r),n=e.toLowerCase();o.includes(n)&&Qv(r,n,t)})},Xv=(i,e,t)=>{Wi(i,e);let r=h=>{var v;let g=(v=h==null?void 0:h.composedPath()[0])!=null?v:h.target;e(g)},o=h=>{var v;let g=(v=h==null?void 0:h.composedPath()[0])!=null?v:h.target;t(g)};i.addEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=h=>{h.forEach(v=>{let{addedNodes:g=[],removedNodes:p=[],type:A,target:f,attributeName:R}=v;A==="childList"?(Array.prototype.forEach.call(g,O=>Wi(O,e)),Array.prototype.forEach.call(p,O=>Wi(O,t))):A==="attributes"&&R===N.MEDIA_CHROME_ATTRIBUTES&&(rd(f)?e(f):t(f))})},a=[],l=h=>{let v=h.target;v.name!=="media"&&(a.forEach(g=>Wi(g,t)),a=[...v.assignedElements({flatten:!0})],a.forEach(g=>Wi(g,e)))};i.addEventListener("slotchange",l);let c=new MutationObserver(n);return c.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Wi(i,t),i.removeEventListener("slotchange",l),c.disconnect(),i.removeEventListener(b.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(b.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",id);var Cr={PLACEMENT:"placement",BOUNDS:"bounds"};function Jv(i){return`
416
419
  <style>
417
420
  :host {
418
421
  --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
@@ -521,7 +524,7 @@ bp-player[has-error] {
521
524
  </style>
522
525
  <slot></slot>
523
526
  <div id="arrow"></div>
524
- `}var Cr=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!_a(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),o=(e=st(this,"#"+this.bounds))!=null?e:X(this);if(!o)return;let{x:n,width:a}=o.getBoundingClientRect(),{x:l,width:c}=this.getBoundingClientRect(),p=l+c,h=n+a,v=r.getPropertyValue("--media-tooltip-offset-x"),g=v?parseFloat(v.replace("px","")):0,m=r.getPropertyValue("--media-tooltip-container-margin"),A=m?parseFloat(m.replace("px","")):0,f=l-n+g-A,R=p-h+g+A;if(f<0){this.style.setProperty("--media-tooltip-offset-x",`${f}px`);return}if(R>0){this.style.setProperty("--media-tooltip-offset-x",`${R}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(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[Ir.PLACEMENT,Ir.BOUNDS]}get placement(){return P(this,Ir.PLACEMENT)}set placement(e){D(this,Ir.PLACEMENT,e)}get bounds(){return P(this,Ir.BOUNDS)}set bounds(e){D(this,Ir.BOUNDS,e)}};Cr.shadowRootOptions={mode:"open"};Cr.getTemplateHTML=Zv;d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",Cr);var Ha=Cr;var ad=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},he=(i,e,t)=>(ad(i,e,"read from private field"),t?t.call(i):e.get(i)),Mr=(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)=>(ad(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Xv=(i,e,t)=>(ad(i,e,"access private method"),t),ut,xr,jt,Rr,Va,nd,Ch,Jt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Jv(i,e={}){return`
527
+ `}var Ir=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!_a(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),o=(e=st(this,"#"+this.bounds))!=null?e:X(this);if(!o)return;let{x:n,width:a}=o.getBoundingClientRect(),{x:l,width:c}=this.getBoundingClientRect(),m=l+c,h=n+a,v=r.getPropertyValue("--media-tooltip-offset-x"),g=v?parseFloat(v.replace("px","")):0,p=r.getPropertyValue("--media-tooltip-container-margin"),A=p?parseFloat(p.replace("px","")):0,f=l-n+g-A,R=m-h+g+A;if(f<0){this.style.setProperty("--media-tooltip-offset-x",`${f}px`);return}if(R>0){this.style.setProperty("--media-tooltip-offset-x",`${R}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(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[Cr.PLACEMENT,Cr.BOUNDS]}get placement(){return P(this,Cr.PLACEMENT)}set placement(e){D(this,Cr.PLACEMENT,e)}get bounds(){return P(this,Cr.BOUNDS)}set bounds(e){D(this,Cr.BOUNDS,e)}};Ir.shadowRootOptions={mode:"open"};Ir.getTemplateHTML=Jv;d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",Ir);var $a=Ir;var ad=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},he=(i,e,t)=>(ad(i,e,"read from private field"),t?t.call(i):e.get(i)),Mr=(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)=>(ad(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),jv=(i,e,t)=>(ad(i,e,"access private method"),t),ut,xr,jt,Rr,Va,nd,Mh,Jt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function ef(i,e={}){return`
525
528
  <style>
526
529
  :host {
527
530
  position: relative;
@@ -595,20 +598,20 @@ bp-player[has-error] {
595
598
 
596
599
  <slot name="tooltip">
597
600
  <media-tooltip part="tooltip" aria-hidden="true">
598
- <template shadowrootmode="${Ha.shadowRootOptions.mode}">
599
- ${Ha.getTemplateHTML({})}
601
+ <template shadowrootmode="${$a.shadowRootOptions.mode}">
602
+ ${$a.getTemplateHTML({})}
600
603
  </template>
601
604
  <slot name="tooltip-content">
602
605
  ${this.getTooltipContentHTML(i)}
603
606
  </slot>
604
607
  </media-tooltip>
605
608
  </slot>
606
- `}function jv(i,e){return`
609
+ `}function tf(i,e){return`
607
610
  <slot></slot>
608
- `}function ef(){return""}var F=class extends d.HTMLElement{constructor(){if(super(),Mr(this,nd),Mr(this,ut,void 0),this.preventClick=!1,this.tooltipEl=null,Mr(this,xr,e=>{this.preventClick||this.handleClick(e),setTimeout(he(this,jt),0)}),Mr(this,jt,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Mr(this,Rr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",he(this,Rr));return}this.preventClick||this.handleClick(e)}),Mr(this,Va,e=>{let{metaKey:t,altKey:r,key:o}=e;if(t||r||!this.keysUsed.includes(o)){this.removeEventListener("keyup",he(this,Rr));return}this.addEventListener("keyup",he(this,Rr),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(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",Jt.TOOLTIP_PLACEMENT,N.MEDIA_CONTROLLER,s.MEDIA_LANG]}enable(){this.addEventListener("click",he(this,xr)),this.addEventListener("keydown",he(this,Va)),this.tabIndex=0}disable(){this.removeEventListener("click",he(this,xr)),this.removeEventListener("keydown",he(this,Va)),this.removeEventListener("keyup",he(this,Rr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER?(t&&((n=(o=he(this,ut))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ba(this,ut,null)),r&&this.isConnected&&(Ba(this,ut,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=he(this,ut))==null?void 0:l.associateElement)==null||c.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===Jt.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===s.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),he(this,jt).call(this)}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(Ba(this,ut,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=he(this,ut))==null?void 0:t.associateElement)==null||r.call(t,this)),d.customElements.whenDefined("media-tooltip").then(()=>Xv(this,nd,Ch).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=he(this,ut))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ba(this,ut,null),this.removeEventListener("mouseenter",he(this,jt)),this.removeEventListener("focus",he(this,jt)),this.removeEventListener("click",he(this,xr))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return P(this,Jt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){D(this,Jt.TOOLTIP_PLACEMENT,e)}get mediaController(){return P(this,N.MEDIA_CONTROLLER)}set mediaController(e){D(this,N.MEDIA_CONTROLLER,e)}get disabled(){return w(this,Jt.DISABLED)}set disabled(e){I(this,Jt.DISABLED,e)}get noTooltip(){return w(this,Jt.NO_TOOLTIP)}set noTooltip(e){I(this,Jt.NO_TOOLTIP,e)}handleClick(e){}};ut=new WeakMap;xr=new WeakMap;jt=new WeakMap;Rr=new WeakMap;Va=new WeakMap;nd=new WeakSet;Ch=function(){this.addEventListener("mouseenter",he(this,jt)),this.addEventListener("focus",he(this,jt)),this.addEventListener("click",he(this,xr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};F.shadowRootOptions={mode:"open"};F.getTemplateHTML=Jv;F.getSlotTemplateHTML=jv;F.getTooltipContentHTML=ef;d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",F);var Mh=`<svg aria-hidden="true" viewBox="0 0 26 24">
611
+ `}function rf(){return""}var F=class extends d.HTMLElement{constructor(){if(super(),Mr(this,nd),Mr(this,ut,void 0),this.preventClick=!1,this.tooltipEl=null,Mr(this,xr,e=>{this.preventClick||this.handleClick(e),setTimeout(he(this,jt),0)}),Mr(this,jt,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Mr(this,Rr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",he(this,Rr));return}this.preventClick||this.handleClick(e)}),Mr(this,Va,e=>{let{metaKey:t,altKey:r,key:o}=e;if(t||r||!this.keysUsed.includes(o)){this.removeEventListener("keyup",he(this,Rr));return}this.addEventListener("keyup",he(this,Rr),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(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",Jt.TOOLTIP_PLACEMENT,N.MEDIA_CONTROLLER,s.MEDIA_LANG]}enable(){this.addEventListener("click",he(this,xr)),this.addEventListener("keydown",he(this,Va)),this.tabIndex=0}disable(){this.removeEventListener("click",he(this,xr)),this.removeEventListener("keydown",he(this,Va)),this.removeEventListener("keyup",he(this,Rr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER?(t&&((n=(o=he(this,ut))==null?void 0:o.unassociateElement)==null||n.call(o,this),Ba(this,ut,null)),r&&this.isConnected&&(Ba(this,ut,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=he(this,ut))==null?void 0:l.associateElement)==null||c.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===Jt.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===s.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),he(this,jt).call(this)}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(Ba(this,ut,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=he(this,ut))==null?void 0:t.associateElement)==null||r.call(t,this)),d.customElements.whenDefined("media-tooltip").then(()=>jv(this,nd,Mh).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=he(this,ut))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ba(this,ut,null),this.removeEventListener("mouseenter",he(this,jt)),this.removeEventListener("focus",he(this,jt)),this.removeEventListener("click",he(this,xr))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return P(this,Jt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){D(this,Jt.TOOLTIP_PLACEMENT,e)}get mediaController(){return P(this,N.MEDIA_CONTROLLER)}set mediaController(e){D(this,N.MEDIA_CONTROLLER,e)}get disabled(){return w(this,Jt.DISABLED)}set disabled(e){C(this,Jt.DISABLED,e)}get noTooltip(){return w(this,Jt.NO_TOOLTIP)}set noTooltip(e){C(this,Jt.NO_TOOLTIP,e)}handleClick(e){}};ut=new WeakMap;xr=new WeakMap;jt=new WeakMap;Rr=new WeakMap;Va=new WeakMap;nd=new WeakSet;Mh=function(){this.addEventListener("mouseenter",he(this,jt)),this.addEventListener("focus",he(this,jt)),this.addEventListener("click",he(this,xr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};F.shadowRootOptions={mode:"open"};F.getTemplateHTML=ef;F.getSlotTemplateHTML=tf;F.getTooltipContentHTML=rf;d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",F);var Rh=`<svg aria-hidden="true" viewBox="0 0 26 24">
609
612
  <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"/>
610
613
  </svg>
611
- `;function tf(i){return`
614
+ `;function of(i){return`
612
615
  <style>
613
616
  :host([${s.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
614
617
  display: none !important;
@@ -626,17 +629,17 @@ bp-player[has-error] {
626
629
  </style>
627
630
 
628
631
  <slot name="icon">
629
- <slot name="enter">${Mh}</slot>
630
- <slot name="exit">${Mh}</slot>
632
+ <slot name="enter">${Rh}</slot>
633
+ <slot name="exit">${Rh}</slot>
631
634
  </slot>
632
- `}function rf(){return`
635
+ `}function nf(){return`
633
636
  <slot name="tooltip-enter">${E("start airplay")}</slot>
634
637
  <slot name="tooltip-exit">${E("stop airplay")}</slot>
635
- `}var Rh=i=>{let e=i.mediaIsAirplaying?E("stop airplay"):E("start airplay");i.setAttribute("aria-label",e)},sn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_AIRPLAYING,s.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Rh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_AIRPLAYING&&Rh(this)}get mediaIsAirplaying(){return w(this,s.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){I(this,s.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return P(this,s.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){D(this,s.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(b.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};sn.getSlotTemplateHTML=tf;sn.getTooltipContentHTML=rf;d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",sn);var of=`<svg aria-hidden="true" viewBox="0 0 26 24">
638
+ `}var xh=i=>{let e=i.mediaIsAirplaying?E("stop airplay"):E("start airplay");i.setAttribute("aria-label",e)},sn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_AIRPLAYING,s.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),xh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_AIRPLAYING&&xh(this)}get mediaIsAirplaying(){return w(this,s.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){C(this,s.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return P(this,s.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){D(this,s.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new d.CustomEvent(b.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};sn.getSlotTemplateHTML=of;sn.getTooltipContentHTML=nf;d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",sn);var af=`<svg aria-hidden="true" viewBox="0 0 26 24">
636
639
  <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"/>
637
- </svg>`,nf=`<svg aria-hidden="true" viewBox="0 0 26 24">
640
+ </svg>`,sf=`<svg aria-hidden="true" viewBox="0 0 26 24">
638
641
  <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"/>
639
- </svg>`;function af(i){return`
642
+ </svg>`;function lf(i){return`
640
643
  <style>
641
644
  :host([aria-checked="true"]) slot[name=off] {
642
645
  display: none !important;
@@ -654,13 +657,13 @@ bp-player[has-error] {
654
657
  </style>
655
658
 
656
659
  <slot name="icon">
657
- <slot name="on">${of}</slot>
658
- <slot name="off">${nf}</slot>
660
+ <slot name="on">${af}</slot>
661
+ <slot name="off">${sf}</slot>
659
662
  </slot>
660
- `}function sf(){return`
663
+ `}function df(){return`
661
664
  <slot name="tooltip-enable">${E("Enable captions")}</slot>
662
665
  <slot name="tooltip-disable">${E("Disable captions")}</slot>
663
- `}var xh=i=>{i.setAttribute("aria-checked",Ra(i).toString())},ln=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",E("closed captions")),xh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING&&xh(this)}get mediaSubtitlesList(){return Ph(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Dh(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Ph(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Dh(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};ln.getSlotTemplateHTML=af;ln.getTooltipContentHTML=sf;var Ph=(i,e)=>{let t=i.getAttribute(e);return t?Hi(t):[]},Dh=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Ut(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",ln);var lf='<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>',df='<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 cf(i){return`
666
+ `}var Ph=i=>{i.setAttribute("aria-checked",Ra(i).toString())},ln=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",E("closed captions")),Ph(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING&&Ph(this)}get mediaSubtitlesList(){return Dh(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Oh(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Dh(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Oh(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new d.CustomEvent(b.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};ln.getSlotTemplateHTML=lf;ln.getTooltipContentHTML=df;var Dh=(i,e)=>{let t=i.getAttribute(e);return t?$i(t):[]},Oh=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Ut(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",ln);var cf='<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>',uf='<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 hf(i){return`
664
667
  <style>
665
668
  :host([${s.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
666
669
  display: none !important;
@@ -678,13 +681,13 @@ bp-player[has-error] {
678
681
  </style>
679
682
 
680
683
  <slot name="icon">
681
- <slot name="enter">${lf}</slot>
682
- <slot name="exit">${df}</slot>
684
+ <slot name="enter">${cf}</slot>
685
+ <slot name="exit">${uf}</slot>
683
686
  </slot>
684
- `}function uf(){return`
687
+ `}function pf(){return`
685
688
  <slot name="tooltip-enter">${E("Start casting")}</slot>
686
689
  <slot name="tooltip-exit">${E("Stop casting")}</slot>
687
- `}var Oh=i=>{let e=i.mediaIsCasting?E("stop casting"):E("start casting");i.setAttribute("aria-label",e)},dn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Oh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_CASTING&&Oh(this)}get mediaIsCasting(){return w(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){I(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return P(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){D(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?b.MEDIA_EXIT_CAST_REQUEST:b.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};dn.getSlotTemplateHTML=cf;dn.getTooltipContentHTML=uf;d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",dn);var pd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Gi=(i,e,t)=>(pd(i,e,"read from private field"),t?t.call(i):e.get(i)),Nt=(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)},md=(i,e,t,r)=>(pd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),qi=(i,e,t)=>(pd(i,e,"access private method"),t),Fa,un,zi,Wa,sd,ld,Uh,dd,Nh,cd,$h,ud,Hh,hd,Bh;function hf(i){return`
690
+ `}var Uh=i=>{let e=i.mediaIsCasting?E("stop casting"):E("start casting");i.setAttribute("aria-label",e)},dn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Uh(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_CASTING&&Uh(this)}get mediaIsCasting(){return w(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){C(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return P(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){D(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?b.MEDIA_EXIT_CAST_REQUEST:b.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};dn.getSlotTemplateHTML=hf;dn.getTooltipContentHTML=pf;d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",dn);var pd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Gi=(i,e,t)=>(pd(i,e,"read from private field"),t?t.call(i):e.get(i)),Nt=(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)},md=(i,e,t,r)=>(pd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),qi=(i,e,t)=>(pd(i,e,"access private method"),t),Fa,un,zi,Wa,sd,ld,Nh,dd,Hh,cd,$h,ud,Bh,hd,Vh;function mf(i){return`
688
691
  <style>
689
692
  :host {
690
693
  font: var(--media-font,
@@ -725,9 +728,9 @@ bp-player[has-error] {
725
728
  }
726
729
  </style>
727
730
  ${this.getSlotTemplateHTML(i)}
728
- `}function pf(i){return`
731
+ `}function vf(i){return`
729
732
  <slot id="content"></slot>
730
- `}var cn={OPEN:"open",ANCHOR:"anchor"},ht=class extends d.HTMLElement{constructor(){super(),Nt(this,Wa),Nt(this,ld),Nt(this,dd),Nt(this,cd),Nt(this,ud),Nt(this,hd),Nt(this,Fa,!1),Nt(this,un,null),Nt(this,zi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[cn.OPEN,cn.ANCHOR]}get open(){return w(this,cn.OPEN)}set open(e){I(this,cn.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":qi(this,cd,$h).call(this,e);break;case"focusout":qi(this,ud,Hh).call(this,e);break;case"keydown":qi(this,hd,Bh).call(this,e);break}}connectedCallback(){qi(this,Wa,sd).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){qi(this,Wa,sd).call(this),e===cn.OPEN&&r!==t&&(this.open?qi(this,ld,Uh).call(this):qi(this,dd,Nh).call(this))}focus(){md(this,un,Qo());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"]}};Fa=new WeakMap;un=new WeakMap;zi=new WeakMap;Wa=new WeakSet;sd=function(){if(!Gi(this,Fa)&&(md(this,Fa,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=J(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};ld=new WeakSet;Uh=function(){var i;(i=Gi(this,zi))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};dd=new WeakSet;Nh=function(){var i;(i=Gi(this,zi))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};cd=new WeakSet;$h=function(i){md(this,zi,i.relatedTarget),Ae(this,i.relatedTarget)||(this.open=!this.open)};ud=new WeakSet;Hh=function(i){var e;Ae(this,i.relatedTarget)||((e=Gi(this,un))==null||e.focus(),Gi(this,zi)&&Gi(this,zi)!==i.relatedTarget&&this.open&&(this.open=!1))};hd=new WeakSet;Bh=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:c,metaKey:p}=i;l||c||p||this.keysUsed.includes(a)&&(i.preventDefault(),i.stopPropagation(),a==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()):a==="Escape"&&((n=Gi(this,un))==null||n.focus(),this.open=!1))};ht.shadowRootOptions={mode:"open"};ht.getTemplateHTML=hf;ht.getSlotTemplateHTML=pf;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",ht);var yd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oe=(i,e,t)=>(yd(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)},ei=(i,e,t,r)=>(yd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),je=(i,e,t)=>(yd(i,e,"access private method"),t),pt,ja,Ka,qa,et,Xa,Ga,za,Ya,Td,Vh,Qa,vd,Za,fd,Ja,Ad,gd,Wh,Ed,Fh,bd,Kh,_d,qh;function mf(i){return`
733
+ `}var cn={OPEN:"open",ANCHOR:"anchor"},ht=class extends d.HTMLElement{constructor(){super(),Nt(this,Wa),Nt(this,ld),Nt(this,dd),Nt(this,cd),Nt(this,ud),Nt(this,hd),Nt(this,Fa,!1),Nt(this,un,null),Nt(this,zi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[cn.OPEN,cn.ANCHOR]}get open(){return w(this,cn.OPEN)}set open(e){C(this,cn.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":qi(this,cd,$h).call(this,e);break;case"focusout":qi(this,ud,Bh).call(this,e);break;case"keydown":qi(this,hd,Vh).call(this,e);break}}connectedCallback(){qi(this,Wa,sd).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){qi(this,Wa,sd).call(this),e===cn.OPEN&&r!==t&&(this.open?qi(this,ld,Nh).call(this):qi(this,dd,Hh).call(this))}focus(){md(this,un,Qo());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"]}};Fa=new WeakMap;un=new WeakMap;zi=new WeakMap;Wa=new WeakSet;sd=function(){if(!Gi(this,Fa)&&(md(this,Fa,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=J(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};ld=new WeakSet;Nh=function(){var i;(i=Gi(this,zi))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};dd=new WeakSet;Hh=function(){var i;(i=Gi(this,zi))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};cd=new WeakSet;$h=function(i){md(this,zi,i.relatedTarget),Ae(this,i.relatedTarget)||(this.open=!this.open)};ud=new WeakSet;Bh=function(i){var e;Ae(this,i.relatedTarget)||((e=Gi(this,un))==null||e.focus(),Gi(this,zi)&&Gi(this,zi)!==i.relatedTarget&&this.open&&(this.open=!1))};hd=new WeakSet;Vh=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:c,metaKey:m}=i;l||c||m||this.keysUsed.includes(a)&&(i.preventDefault(),i.stopPropagation(),a==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()):a==="Escape"&&((n=Gi(this,un))==null||n.focus(),this.open=!1))};ht.shadowRootOptions={mode:"open"};ht.getTemplateHTML=mf;ht.getSlotTemplateHTML=vf;d.customElements.get("media-chrome-dialog")||d.customElements.define("media-chrome-dialog",ht);var yd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oe=(i,e,t)=>(yd(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)},ei=(i,e,t,r)=>(yd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),je=(i,e,t)=>(yd(i,e,"access private method"),t),pt,ja,Ka,qa,et,Xa,Ga,za,Ya,Td,Wh,Qa,vd,Za,fd,Ja,Ad,gd,Fh,Ed,Kh,bd,qh,_d,Gh;function ff(i){return`
731
734
  <style>
732
735
  :host {
733
736
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -957,7 +960,7 @@ bp-player[has-error] {
957
960
  ${this.getContainerTemplateHTML(i)}
958
961
  </div>
959
962
  <div id="rightgap"></div>
960
- `}function vf(i){return""}var mt=class extends d.HTMLElement{constructor(){if(super(),be(this,Td),be(this,Qa),be(this,Za),be(this,Ja),be(this,gd),be(this,Ed),be(this,bd),be(this,_d),be(this,pt,void 0),be(this,ja,void 0),be(this,Ka,void 0),be(this,qa,void 0),be(this,et,{}),be(this,Xa,[]),be(this,Ga,()=>{if(this.range.matches(":focus-visible")){let{style:e}=J(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),be(this,za,()=>{let{style:e}=J(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),be(this,Ya,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(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,Ka,this.shadowRoot.querySelector("#startpoint")),ei(this,qa,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER?(t&&((n=(o=oe(this,pt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ei(this,pt,null)),r&&this.isConnected&&(ei(this,pt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=oe(this,pt))==null?void 0:l.associateElement)==null||c.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),je(this,Qa,vd).call(this)):(this.range.setAttribute(e,r),je(this,Za,fd).call(this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),oe(this,et).pointer=J(this.shadowRoot,"#pointer"),oe(this,et).progress=J(this.shadowRoot,"#progress"),oe(this,et).thumb=J(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),oe(this,et).activeSegment=J(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(ei(this,pt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=oe(this,pt))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",oe(this,Ga)),this.shadowRoot.addEventListener("focusout",oe(this,za)),je(this,Qa,vd).call(this),Pt(this.container,oe(this,Ya))}disconnectedCallback(){var e,t;je(this,Za,fd).call(this),(t=(e=oe(this,pt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ei(this,pt,null),this.shadowRoot.removeEventListener("focusin",oe(this,Ga)),this.shadowRoot.removeEventListener("focusout",oe(this,za)),Dt(this.container,oe(this,Ya))}updatePointerBar(e){var t;(t=oe(this,et).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=oe(this,et).progress)==null||e.style.setProperty("width",`${r}%`),(t=oe(this,et).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(n=>[n.start,n.end]),+this.range.max])];ei(this,Xa,[...r]);let o=r.pop();for(let[n,a]of r.entries()){let[l,c]=[n===0,n===r.length-1],p=l?"calc(var(--segments-gap) / -1)":`${a*100}%`,v=`calc(${((c?o:r[n+1])-a)*100}%${l||c?"":" - var(--segments-gap)"})`,g=ee.createElementNS("http://www.w3.org/2000/svg","rect"),m=Zo(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);m.style.setProperty("x",p),m.style.setProperty("width",v),t.append(g)}}getPointerRatio(e){return Ju(e.clientX,e.clientY,oe(this,Ka).getBoundingClientRect(),oe(this,qa).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":je(this,_d,qh).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":je(this,gd,Wh).call(this,e);break;case"pointerdown":je(this,Ja,Ad).call(this,e);break;case"pointerup":je(this,Ed,Fh).call(this);break;case"pointerleave":je(this,bd,Kh).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};pt=new WeakMap;ja=new WeakMap;Ka=new WeakMap;qa=new WeakMap;et=new WeakMap;Xa=new WeakMap;Ga=new WeakMap;za=new WeakMap;Ya=new WeakMap;Td=new WeakSet;Vh=function(i){let e=oe(this,et).activeSegment;if(!e)return;let t=this.getPointerRatio(i),o=`#segments-clipping rect:nth-child(${oe(this,Xa).findIndex((n,a,l)=>{let c=l[a+1];return c!=null&&t>=n&&t<=c})+1})`;(e.selectorText!=o||!e.style.transform)&&(e.selectorText=o,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Qa=new WeakSet;vd=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Za=new WeakSet;fd=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=d.window)==null||i.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};Ja=new WeakSet;Ad=function(i){var e;ei(this,ja,i.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};gd=new WeakSet;Wh=function(i){var e;i.pointerType!=="mouse"&&je(this,Ja,Ad).call(this,i),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};Ed=new WeakSet;Fh=function(){var i;(i=d.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};bd=new WeakSet;Kh=function(){var i,e;this.removeEventListener("pointerleave",this),(i=d.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=oe(this,et).activeSegment)==null||e.style.removeProperty("transform")};_d=new WeakSet;qh=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),je(this,Td,Vh).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!oe(this,ja))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};mt.shadowRootOptions={mode:"open"};mt.getTemplateHTML=mf;mt.getContainerTemplateHTML=vf;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",mt);var Gh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},es=(i,e,t)=>(Gh(i,e,"read from private field"),t?t.call(i):e.get(i)),ff=(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)},ts=(i,e,t,r)=>(Gh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),vt;function gf(i){return`
963
+ `}function gf(i){return""}var mt=class extends d.HTMLElement{constructor(){if(super(),be(this,Td),be(this,Qa),be(this,Za),be(this,Ja),be(this,gd),be(this,Ed),be(this,bd),be(this,_d),be(this,pt,void 0),be(this,ja,void 0),be(this,Ka,void 0),be(this,qa,void 0),be(this,et,{}),be(this,Xa,[]),be(this,Ga,()=>{if(this.range.matches(":focus-visible")){let{style:e}=J(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),be(this,za,()=>{let{style:e}=J(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),be(this,Ya,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(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,Ka,this.shadowRoot.querySelector("#startpoint")),ei(this,qa,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER?(t&&((n=(o=oe(this,pt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ei(this,pt,null)),r&&this.isConnected&&(ei(this,pt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=oe(this,pt))==null?void 0:l.associateElement)==null||c.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),je(this,Qa,vd).call(this)):(this.range.setAttribute(e,r),je(this,Za,fd).call(this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),oe(this,et).pointer=J(this.shadowRoot,"#pointer"),oe(this,et).progress=J(this.shadowRoot,"#progress"),oe(this,et).thumb=J(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),oe(this,et).activeSegment=J(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(ei(this,pt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=oe(this,pt))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",oe(this,Ga)),this.shadowRoot.addEventListener("focusout",oe(this,za)),je(this,Qa,vd).call(this),Pt(this.container,oe(this,Ya))}disconnectedCallback(){var e,t;je(this,Za,fd).call(this),(t=(e=oe(this,pt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ei(this,pt,null),this.shadowRoot.removeEventListener("focusin",oe(this,Ga)),this.shadowRoot.removeEventListener("focusout",oe(this,za)),Dt(this.container,oe(this,Ya))}updatePointerBar(e){var t;(t=oe(this,et).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=oe(this,et).progress)==null||e.style.setProperty("width",`${r}%`),(t=oe(this,et).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(n=>[n.start,n.end]),+this.range.max])];ei(this,Xa,[...r]);let o=r.pop();for(let[n,a]of r.entries()){let[l,c]=[n===0,n===r.length-1],m=l?"calc(var(--segments-gap) / -1)":`${a*100}%`,v=`calc(${((c?o:r[n+1])-a)*100}%${l||c?"":" - var(--segments-gap)"})`,g=ee.createElementNS("http://www.w3.org/2000/svg","rect"),p=Zo(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);p.style.setProperty("x",m),p.style.setProperty("width",v),t.append(g)}}getPointerRatio(e){return ju(e.clientX,e.clientY,oe(this,Ka).getBoundingClientRect(),oe(this,qa).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":je(this,_d,Gh).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":je(this,gd,Fh).call(this,e);break;case"pointerdown":je(this,Ja,Ad).call(this,e);break;case"pointerup":je(this,Ed,Kh).call(this);break;case"pointerleave":je(this,bd,qh).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};pt=new WeakMap;ja=new WeakMap;Ka=new WeakMap;qa=new WeakMap;et=new WeakMap;Xa=new WeakMap;Ga=new WeakMap;za=new WeakMap;Ya=new WeakMap;Td=new WeakSet;Wh=function(i){let e=oe(this,et).activeSegment;if(!e)return;let t=this.getPointerRatio(i),o=`#segments-clipping rect:nth-child(${oe(this,Xa).findIndex((n,a,l)=>{let c=l[a+1];return c!=null&&t>=n&&t<=c})+1})`;(e.selectorText!=o||!e.style.transform)&&(e.selectorText=o,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Qa=new WeakSet;vd=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Za=new WeakSet;fd=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=d.window)==null||i.removeEventListener("pointerup",this),(e=d.window)==null||e.removeEventListener("pointermove",this)};Ja=new WeakSet;Ad=function(i){var e;ei(this,ja,i.composedPath().includes(this.range)),(e=d.window)==null||e.addEventListener("pointerup",this)};gd=new WeakSet;Fh=function(i){var e;i.pointerType!=="mouse"&&je(this,Ja,Ad).call(this,i),this.addEventListener("pointerleave",this),(e=d.window)==null||e.addEventListener("pointermove",this)};Ed=new WeakSet;Kh=function(){var i;(i=d.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};bd=new WeakSet;qh=function(){var i,e;this.removeEventListener("pointerleave",this),(i=d.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=oe(this,et).activeSegment)==null||e.style.removeProperty("transform")};_d=new WeakSet;Gh=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),je(this,Td,Wh).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!oe(this,ja))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};mt.shadowRootOptions={mode:"open"};mt.getTemplateHTML=ff;mt.getContainerTemplateHTML=gf;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",mt);var zh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},es=(i,e,t)=>(zh(i,e,"read from private field"),t?t.call(i):e.get(i)),Ef=(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)},ts=(i,e,t,r)=>(zh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),vt;function bf(i){return`
961
964
  <style>
962
965
  :host {
963
966
 
@@ -983,7 +986,7 @@ bp-player[has-error] {
983
986
  </style>
984
987
 
985
988
  <slot></slot>
986
- `}var hn=class extends d.HTMLElement{constructor(){if(super(),ff(this,vt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=es(this,vt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ts(this,vt,null)),r&&this.isConnected&&(ts(this,vt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=es(this,vt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(ts(this,vt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=es(this,vt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=es(this,vt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ts(this,vt,null)}};vt=new WeakMap;hn.shadowRootOptions={mode:"open"};hn.getTemplateHTML=gf;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",hn);var zh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},is=(i,e,t)=>(zh(i,e,"read from private field"),t?t.call(i):e.get(i)),Ef=(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)},rs=(i,e,t,r)=>(zh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ft;function bf(i,e={}){return`
989
+ `}var hn=class extends d.HTMLElement{constructor(){if(super(),Ef(this,vt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=es(this,vt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ts(this,vt,null)),r&&this.isConnected&&(ts(this,vt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=es(this,vt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(ts(this,vt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=es(this,vt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=es(this,vt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ts(this,vt,null)}};vt=new WeakMap;hn.shadowRootOptions={mode:"open"};hn.getTemplateHTML=bf;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",hn);var Yh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},is=(i,e,t)=>(Yh(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)},rs=(i,e,t,r)=>(Yh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ft;function yf(i,e={}){return`
987
990
  <style>
988
991
  :host {
989
992
  font: var(--media-font,
@@ -1017,11 +1020,11 @@ bp-player[has-error] {
1017
1020
  </style>
1018
1021
 
1019
1022
  ${this.getSlotTemplateHTML(i,e)}
1020
- `}function _f(i,e){return`
1023
+ `}function Tf(i,e){return`
1021
1024
  <slot></slot>
1022
- `}var Pe=class extends d.HTMLElement{constructor(){if(super(),Ef(this,ft,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=is(this,ft))==null?void 0:o.unassociateElement)==null||n.call(o,this),rs(this,ft,null)),r&&this.isConnected&&(rs(this,ft,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=is(this,ft))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(rs(this,ft,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=is(this,ft))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=is(this,ft))==null?void 0:e.unassociateElement)==null||t.call(e,this),rs(this,ft,null)}};ft=new WeakMap;Pe.shadowRootOptions={mode:"open"};Pe.getTemplateHTML=bf;Pe.getSlotTemplateHTML=_f;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",Pe);var Qh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yh=(i,e,t)=>(Qh(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)},Tf=(i,e,t,r)=>(Qh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),pn;function Af(i,e){return`
1025
+ `}var Pe=class extends d.HTMLElement{constructor(){if(super(),_f(this,ft,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===N.MEDIA_CONTROLLER&&(t&&((n=(o=is(this,ft))==null?void 0:o.unassociateElement)==null||n.call(o,this),rs(this,ft,null)),r&&this.isConnected&&(rs(this,ft,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=is(this,ft))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let{style:o}=J(this.shadowRoot,":host");o.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(N.MEDIA_CONTROLLER);n&&(rs(this,ft,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=is(this,ft))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=is(this,ft))==null?void 0:e.unassociateElement)==null||t.call(e,this),rs(this,ft,null)}};ft=new WeakMap;Pe.shadowRootOptions={mode:"open"};Pe.getTemplateHTML=yf;Pe.getSlotTemplateHTML=Tf;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",Pe);var Zh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qh=(i,e,t)=>(Zh(i,e,"read from private field"),t?t.call(i):e.get(i)),Af=(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)},Sf=(i,e,t,r)=>(Zh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),pn;function kf(i,e){return`
1023
1026
  <slot>${Je(e.mediaDuration)}</slot>
1024
- `}var os=class extends Pe{constructor(){var e;super(),yf(this,pn,void 0),Tf(this,pn,this.shadowRoot.querySelector("slot")),Yh(this,pn).textContent=Je((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===s.MEDIA_DURATION&&(Yh(this,pn).textContent=Je(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return $(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}};pn=new WeakMap;os.getSlotTemplateHTML=Af;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",os);var Sf={2:E("Network Error"),3:E("Decode Error"),4:E("Source Not Supported"),5:E("Encryption Error")},kf={2:E("A network error caused the media download to fail."),3:E("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:E("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:E("The media is encrypted and there are no keys to decrypt it.")},Sd=i=>{var e,t;return i.code===1?null:{title:(e=Sf[i.code])!=null?e:`Error ${i.code}`,message:(t=kf[i.code])!=null?t:i.message}};var Xh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Lf=(i,e,t)=>(Xh(i,e,"read from private field"),t?t.call(i):e.get(i)),wf=(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)},If=(i,e,t,r)=>(Xh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ns;function Cf(i){return`
1027
+ `}var os=class extends Pe{constructor(){var e;super(),Af(this,pn,void 0),Sf(this,pn,this.shadowRoot.querySelector("slot")),Qh(this,pn).textContent=Je((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===s.MEDIA_DURATION&&(Qh(this,pn).textContent=Je(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return H(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}};pn=new WeakMap;os.getSlotTemplateHTML=kf;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",os);var Lf={2:E("Network Error"),3:E("Decode Error"),4:E("Source Not Supported"),5:E("Encryption Error")},wf={2:E("A network error caused the media download to fail."),3:E("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:E("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:E("The media is encrypted and there are no keys to decrypt it.")},Sd=i=>{var e,t;return i.code===1?null:{title:(e=Lf[i.code])!=null?e:`Error ${i.code}`,message:(t=wf[i.code])!=null?t:i.message}};var Jh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Cf=(i,e,t)=>(Jh(i,e,"read from private field"),t?t.call(i):e.get(i)),If=(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)},Mf=(i,e,t,r)=>(Jh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ns;function Rf(i){return`
1025
1028
  <style>
1026
1029
  :host {
1027
1030
  background: rgb(20 20 30 / .8);
@@ -1038,9 +1041,9 @@ bp-player[has-error] {
1038
1041
  }
1039
1042
  </style>
1040
1043
  <slot name="error-${i.mediaerrorcode}" id="content">
1041
- ${Jh({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1044
+ ${jh({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1042
1045
  </slot>
1043
- `}function Mf(i){return i.code&&Sd(i)!==null}function Jh(i){var e;let{title:t,message:r}=(e=Sd(i))!=null?e:{},o="";return t&&(o+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(o+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),o}var Zh=[s.MEDIA_ERROR_CODE,s.MEDIA_ERROR_MESSAGE],mn=class extends ht{constructor(){super(...arguments),wf(this,ns,null)}static get observedAttributes(){return[...super.observedAttributes,...Zh]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var o;if(super.attributeChangedCallback(e,t,r),!Zh.includes(e))return;let n=(o=this.mediaError)!=null?o:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Mf(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return Lf(this,ns)}set mediaError(e){If(this,ns,e)}get mediaErrorCode(){return $(this,"mediaerrorcode")}set mediaErrorCode(e){B(this,"mediaerrorcode",e)}get mediaErrorMessage(){return P(this,"mediaerrormessage")}set mediaErrorMessage(e){D(this,"mediaerrormessage",e)}};ns=new WeakMap;mn.getSlotTemplateHTML=Cf;mn.formatErrorMessage=Jh;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",mn);var Rf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ti=(i,e,t)=>(Rf(i,e,"read from private field"),t?t.call(i):e.get(i)),jh=(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)},Pr,Dr;function xf(i){return`
1046
+ `}function xf(i){return i.code&&Sd(i)!==null}function jh(i){var e;let{title:t,message:r}=(e=Sd(i))!=null?e:{},o="";return t&&(o+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(o+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),o}var Xh=[s.MEDIA_ERROR_CODE,s.MEDIA_ERROR_MESSAGE],mn=class extends ht{constructor(){super(...arguments),If(this,ns,null)}static get observedAttributes(){return[...super.observedAttributes,...Xh]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var o;if(super.attributeChangedCallback(e,t,r),!Xh.includes(e))return;let n=(o=this.mediaError)!=null?o:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=xf(n),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(n))}get mediaError(){return Cf(this,ns)}set mediaError(e){Mf(this,ns,e)}get mediaErrorCode(){return H(this,"mediaerrorcode")}set mediaErrorCode(e){B(this,"mediaerrorcode",e)}get mediaErrorMessage(){return P(this,"mediaerrormessage")}set mediaErrorMessage(e){D(this,"mediaerrormessage",e)}};ns=new WeakMap;mn.getSlotTemplateHTML=Rf;mn.formatErrorMessage=jh;d.customElements.get("media-error-dialog")||d.customElements.define("media-error-dialog",mn);var Pf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ti=(i,e,t)=>(Pf(i,e,"read from private field"),t?t.call(i):e.get(i)),ep=(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)},Pr,Dr;function Df(i){return`
1044
1047
  <style>
1045
1048
  :host {
1046
1049
  position: fixed;
@@ -1125,9 +1128,9 @@ bp-player[has-error] {
1125
1128
  }
1126
1129
  </style>
1127
1130
  <slot id="content">
1128
- ${Pf()}
1131
+ ${Of()}
1129
1132
  </slot>
1130
- `}function Pf(){return`
1133
+ `}function Of(){return`
1131
1134
  <h2>Keyboard Shortcuts</h2>
1132
1135
  <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})=>`
1133
1136
  <tr>
@@ -1137,11 +1140,11 @@ bp-player[has-error] {
1137
1140
  <td class="description">${r}</td>
1138
1141
  </tr>
1139
1142
  `).join("")}</table>
1140
- `}var as=class extends ht{constructor(){super(...arguments),jh(this,Pr,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let o=e.composedPath(),n=o[0]===this||o.includes(this),a=o.includes(r);n&&!a&&(this.open=!1)}),jh(this,Dr,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",ti(this,Pr)),document.addEventListener("keydown",ti(this,Dr)))}disconnectedCallback(){this.removeEventListener("click",ti(this,Pr)),document.removeEventListener("keydown",ti(this,Dr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",ti(this,Pr)),document.addEventListener("keydown",ti(this,Dr))):(this.removeEventListener("click",ti(this,Pr)),document.removeEventListener("keydown",ti(this,Dr))))}};Pr=new WeakMap;Dr=new WeakMap;as.getSlotTemplateHTML=xf;d.customElements.get("media-keyboard-shortcuts-dialog")||d.customElements.define("media-keyboard-shortcuts-dialog",as);var tp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Df=(i,e,t)=>(tp(i,e,"read from private field"),t?t.call(i):e.get(i)),Of=(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)},Uf=(i,e,t,r)=>(tp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ss,Nf=`<svg aria-hidden="true" viewBox="0 0 26 24">
1143
+ `}var as=class extends ht{constructor(){super(...arguments),ep(this,Pr,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let o=e.composedPath(),n=o[0]===this||o.includes(this),a=o.includes(r);n&&!a&&(this.open=!1)}),ep(this,Dr,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",ti(this,Pr)),document.addEventListener("keydown",ti(this,Dr)))}disconnectedCallback(){this.removeEventListener("click",ti(this,Pr)),document.removeEventListener("keydown",ti(this,Dr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",ti(this,Pr)),document.addEventListener("keydown",ti(this,Dr))):(this.removeEventListener("click",ti(this,Pr)),document.removeEventListener("keydown",ti(this,Dr))))}};Pr=new WeakMap;Dr=new WeakMap;as.getSlotTemplateHTML=Df;d.customElements.get("media-keyboard-shortcuts-dialog")||d.customElements.define("media-keyboard-shortcuts-dialog",as);var ip=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Uf=(i,e,t)=>(ip(i,e,"read from private field"),t?t.call(i):e.get(i)),Nf=(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)},Hf=(i,e,t,r)=>(ip(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ss,$f=`<svg aria-hidden="true" viewBox="0 0 26 24">
1141
1144
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
1142
- </svg>`,$f=`<svg aria-hidden="true" viewBox="0 0 26 24">
1145
+ </svg>`,Bf=`<svg aria-hidden="true" viewBox="0 0 26 24">
1143
1146
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
1144
- </svg>`;function Hf(i){return`
1147
+ </svg>`;function Vf(i){return`
1145
1148
  <style>
1146
1149
  :host([${s.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
1147
1150
  display: none !important;
@@ -1159,13 +1162,13 @@ bp-player[has-error] {
1159
1162
  </style>
1160
1163
 
1161
1164
  <slot name="icon">
1162
- <slot name="enter">${Nf}</slot>
1163
- <slot name="exit">${$f}</slot>
1165
+ <slot name="enter">${$f}</slot>
1166
+ <slot name="exit">${Bf}</slot>
1164
1167
  </slot>
1165
- `}function Bf(){return`
1168
+ `}function Wf(){return`
1166
1169
  <slot name="tooltip-enter">${E("Enter fullscreen mode")}</slot>
1167
1170
  <slot name="tooltip-exit">${E("Exit fullscreen mode")}</slot>
1168
- `}var ep=i=>{let e=i.mediaIsFullscreen?E("exit fullscreen mode"):E("enter fullscreen mode");i.setAttribute("aria-label",e)},vn=class extends F{constructor(){super(...arguments),Of(this,ss,null)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_FULLSCREEN,s.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),ep(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_FULLSCREEN&&ep(this)}get mediaFullscreenUnavailable(){return P(this,s.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){D(this,s.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return w(this,s.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){I(this,s.MEDIA_IS_FULLSCREEN,e)}handleClick(e){Uf(this,ss,e);let t=Df(this,ss)instanceof PointerEvent,r=this.mediaIsFullscreen?new d.CustomEvent(b.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new d.CustomEvent(b.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};ss=new WeakMap;vn.getSlotTemplateHTML=Hf;vn.getTooltipContentHTML=Bf;d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",vn);var{MEDIA_TIME_IS_LIVE:ls,MEDIA_PAUSED:fn}=s,{MEDIA_SEEK_TO_LIVE_REQUEST:Vf,MEDIA_PLAY_REQUEST:Wf}=b,Ff='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function Kf(i){return`
1171
+ `}var tp=i=>{let e=i.mediaIsFullscreen?E("exit fullscreen mode"):E("enter fullscreen mode");i.setAttribute("aria-label",e)},vn=class extends F{constructor(){super(...arguments),Nf(this,ss,null)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_FULLSCREEN,s.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),tp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_FULLSCREEN&&tp(this)}get mediaFullscreenUnavailable(){return P(this,s.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){D(this,s.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return w(this,s.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){C(this,s.MEDIA_IS_FULLSCREEN,e)}handleClick(e){Hf(this,ss,e);let t=Uf(this,ss)instanceof PointerEvent,r=this.mediaIsFullscreen?new d.CustomEvent(b.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new d.CustomEvent(b.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};ss=new WeakMap;vn.getSlotTemplateHTML=Vf;vn.getTooltipContentHTML=Wf;d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",vn);var{MEDIA_TIME_IS_LIVE:ls,MEDIA_PAUSED:fn}=s,{MEDIA_SEEK_TO_LIVE_REQUEST:Ff,MEDIA_PLAY_REQUEST:Kf}=b,qf='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function Gf(i){return`
1169
1172
  <style>
1170
1173
  :host { --media-tooltip-display: none; }
1171
1174
 
@@ -1193,10 +1196,10 @@ bp-player[has-error] {
1193
1196
 
1194
1197
  </style>
1195
1198
 
1196
- <slot name="indicator">${Ff}</slot>
1199
+ <slot name="indicator">${qf}</slot>
1197
1200
 
1198
1201
  <slot name="spacer">&nbsp;</slot><slot name="text">${E("live")}</slot>
1199
- `}var ip=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?E("seek to live"):E("playing live");i.setAttribute("aria-label",r);let o=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');o&&(o.textContent=E("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},ds=class extends F{static get observedAttributes(){return[...super.observedAttributes,ls,fn]}connectedCallback(){super.connectedCallback(),ip(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),ip(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return w(this,s.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){I(this,s.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Vf,{composed:!0,bubbles:!0})),this.hasAttribute(fn)&&this.dispatchEvent(new d.CustomEvent(Wf,{composed:!0,bubbles:!0})))}};ds.getSlotTemplateHTML=Kf;d.customElements.get("media-live-button")||d.customElements.define("media-live-button",ds);var op=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gn=(i,e,t)=>(op(i,e,"read from private field"),t?t.call(i):e.get(i)),rp=(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)},En=(i,e,t,r)=>(op(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),gt,us,cs={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},np=500,qf=`
1202
+ `}var rp=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?E("seek to live"):E("playing live");i.setAttribute("aria-label",r);let o=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');o&&(o.textContent=E("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},ds=class extends F{static get observedAttributes(){return[...super.observedAttributes,ls,fn]}connectedCallback(){super.connectedCallback(),rp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),rp(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){C(this,s.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return w(this,s.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){C(this,s.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new d.CustomEvent(Ff,{composed:!0,bubbles:!0})),this.hasAttribute(fn)&&this.dispatchEvent(new d.CustomEvent(Kf,{composed:!0,bubbles:!0})))}};ds.getSlotTemplateHTML=Gf;d.customElements.get("media-live-button")||d.customElements.define("media-live-button",ds);var np=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gn=(i,e,t)=>(np(i,e,"read from private field"),t?t.call(i):e.get(i)),op=(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)},En=(i,e,t,r)=>(np(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),gt,us,cs={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},ap=500,zf=`
1200
1203
  <svg aria-hidden="true" viewBox="0 0 100 100">
1201
1204
  <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">
1202
1205
  <animateTransform
@@ -1209,13 +1212,13 @@ bp-player[has-error] {
1209
1212
  repeatCount="indefinite" />
1210
1213
  </path>
1211
1214
  </svg>
1212
- `;function Gf(i){return`
1215
+ `;function Yf(i){return`
1213
1216
  <style>
1214
1217
  :host {
1215
1218
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
1216
1219
  vertical-align: middle;
1217
1220
  box-sizing: border-box;
1218
- --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${np}ms);
1221
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${ap}ms);
1219
1222
  }
1220
1223
 
1221
1224
  #status {
@@ -1254,15 +1257,15 @@ bp-player[has-error] {
1254
1257
  }
1255
1258
  </style>
1256
1259
 
1257
- <slot name="icon">${qf}</slot>
1260
+ <slot name="icon">${zf}</slot>
1258
1261
  <div id="status" role="status" aria-live="polite">${E("media loading")}</div>
1259
- `}var bn=class extends d.HTMLElement{constructor(){if(super(),rp(this,gt,void 0),rp(this,us,np),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,cs.LOADING_DELAY]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===cs.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===N.MEDIA_CONTROLLER&&(t&&((n=(o=gn(this,gt))==null?void 0:o.unassociateElement)==null||n.call(o,this),En(this,gt,null)),r&&this.isConnected&&(En(this,gt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=gn(this,gt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(En(this,gt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=gn(this,gt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=gn(this,gt))==null?void 0:e.unassociateElement)==null||t.call(e,this),En(this,gt,null)}get loadingDelay(){return gn(this,us)}set loadingDelay(e){En(this,us,e);let{style:t}=J(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,s.MEDIA_LOADING)}set mediaLoading(e){I(this,s.MEDIA_LOADING,e)}get mediaController(){return P(this,N.MEDIA_CONTROLLER)}set mediaController(e){D(this,N.MEDIA_CONTROLLER,e)}get noAutohide(){return w(this,cs.NO_AUTOHIDE)}set noAutohide(e){I(this,cs.NO_AUTOHIDE,e)}};gt=new WeakMap;us=new WeakMap;bn.shadowRootOptions={mode:"open"};bn.getTemplateHTML=Gf;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",bn);var zf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1262
+ `}var bn=class extends d.HTMLElement{constructor(){if(super(),op(this,gt,void 0),op(this,us,ap),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,cs.LOADING_DELAY]}attributeChangedCallback(e,t,r){var o,n,a,l,c;e===cs.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===N.MEDIA_CONTROLLER&&(t&&((n=(o=gn(this,gt))==null?void 0:o.unassociateElement)==null||n.call(o,this),En(this,gt,null)),r&&this.isConnected&&(En(this,gt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=gn(this,gt))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(En(this,gt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=gn(this,gt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=gn(this,gt))==null?void 0:e.unassociateElement)==null||t.call(e,this),En(this,gt,null)}get loadingDelay(){return gn(this,us)}set loadingDelay(e){En(this,us,e);let{style:t}=J(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){C(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,s.MEDIA_LOADING)}set mediaLoading(e){C(this,s.MEDIA_LOADING,e)}get mediaController(){return P(this,N.MEDIA_CONTROLLER)}set mediaController(e){D(this,N.MEDIA_CONTROLLER,e)}get noAutohide(){return w(this,cs.NO_AUTOHIDE)}set noAutohide(e){C(this,cs.NO_AUTOHIDE,e)}};gt=new WeakMap;us=new WeakMap;bn.shadowRootOptions={mode:"open"};bn.getTemplateHTML=Yf;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",bn);var Qf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1260
1263
  <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"/>
1261
- </svg>`,ap=`<svg aria-hidden="true" viewBox="0 0 24 24">
1264
+ </svg>`,sp=`<svg aria-hidden="true" viewBox="0 0 24 24">
1262
1265
  <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"/>
1263
- </svg>`,Yf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1266
+ </svg>`,Zf=`<svg aria-hidden="true" viewBox="0 0 24 24">
1264
1267
  <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"/>
1265
- </svg>`;function Qf(i){return`
1268
+ </svg>`;function Xf(i){return`
1266
1269
  <style>
1267
1270
  :host(:not([${s.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
1268
1271
  :host([${s.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
@@ -1288,17 +1291,17 @@ bp-player[has-error] {
1288
1291
  </style>
1289
1292
 
1290
1293
  <slot name="icon">
1291
- <slot name="off">${zf}</slot>
1292
- <slot name="low">${ap}</slot>
1293
- <slot name="medium">${ap}</slot>
1294
- <slot name="high">${Yf}</slot>
1294
+ <slot name="off">${Qf}</slot>
1295
+ <slot name="low">${sp}</slot>
1296
+ <slot name="medium">${sp}</slot>
1297
+ <slot name="high">${Zf}</slot>
1295
1298
  </slot>
1296
- `}function Zf(){return`
1299
+ `}function Jf(){return`
1297
1300
  <slot name="tooltip-mute">${E("Mute")}</slot>
1298
1301
  <slot name="tooltip-unmute">${E("Unmute")}</slot>
1299
- `}var sp=i=>{let t=i.mediaVolumeLevel==="off"?E("unmute"):E("mute");i.setAttribute("aria-label",t)},_n=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),sp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_VOLUME_LEVEL&&sp(this)}get mediaVolumeLevel(){return P(this,s.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){D(this,s.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};_n.getSlotTemplateHTML=Qf;_n.getTooltipContentHTML=Zf;d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",_n);var lp=`<svg aria-hidden="true" viewBox="0 0 28 24">
1302
+ `}var lp=i=>{let t=i.mediaVolumeLevel==="off"?E("unmute"):E("mute");i.setAttribute("aria-label",t)},_n=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),lp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_VOLUME_LEVEL&&lp(this)}get mediaVolumeLevel(){return P(this,s.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){D(this,s.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?b.MEDIA_UNMUTE_REQUEST:b.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};_n.getSlotTemplateHTML=Xf;_n.getTooltipContentHTML=Jf;d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",_n);var dp=`<svg aria-hidden="true" viewBox="0 0 28 24">
1300
1303
  <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"/>
1301
- </svg>`;function Xf(i){return`
1304
+ </svg>`;function jf(i){return`
1302
1305
  <style>
1303
1306
  :host([${s.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
1304
1307
  display: none !important;
@@ -1315,13 +1318,13 @@ bp-player[has-error] {
1315
1318
  </style>
1316
1319
 
1317
1320
  <slot name="icon">
1318
- <slot name="enter">${lp}</slot>
1319
- <slot name="exit">${lp}</slot>
1321
+ <slot name="enter">${dp}</slot>
1322
+ <slot name="exit">${dp}</slot>
1320
1323
  </slot>
1321
- `}function Jf(){return`
1324
+ `}function eg(){return`
1322
1325
  <slot name="tooltip-enter">${E("Enter picture in picture mode")}</slot>
1323
1326
  <slot name="tooltip-exit">${E("Exit picture in picture mode")}</slot>
1324
- `}var dp=i=>{let e=i.mediaIsPip?E("exit picture in picture mode"):E("enter picture in picture mode");i.setAttribute("aria-label",e)},yn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_PIP,s.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),dp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_PIP&&dp(this)}get mediaPipUnavailable(){return P(this,s.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){D(this,s.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return w(this,s.MEDIA_IS_PIP)}set mediaIsPip(e){I(this,s.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};yn.getSlotTemplateHTML=Xf;yn.getTooltipContentHTML=Jf;d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",yn);var jf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Or=(i,e,t)=>(jf(i,e,"read from private field"),t?t.call(i):e.get(i)),eg=(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)},ii,kd={RATES:"rates"},Ld=[1,1.2,1.5,1.7,2],Yi=1;function tg(i){return`
1327
+ `}var cp=i=>{let e=i.mediaIsPip?E("exit picture in picture mode"):E("enter picture in picture mode");i.setAttribute("aria-label",e)},yn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_PIP,s.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),cp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_IS_PIP&&cp(this)}get mediaPipUnavailable(){return P(this,s.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){D(this,s.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return w(this,s.MEDIA_IS_PIP)}set mediaIsPip(e){C(this,s.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?b.MEDIA_EXIT_PIP_REQUEST:b.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};yn.getSlotTemplateHTML=jf;yn.getTooltipContentHTML=eg;d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",yn);var tg=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Or=(i,e,t)=>(tg(i,e,"read from private field"),t?t.call(i):e.get(i)),ig=(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)},ii,kd={RATES:"rates"},Ld=[1,1.2,1.5,1.7,2],Yi=1;function rg(i){return`
1325
1328
  <style>
1326
1329
  :host {
1327
1330
  min-width: 5ch;
@@ -1329,11 +1332,11 @@ bp-player[has-error] {
1329
1332
  }
1330
1333
  </style>
1331
1334
  <slot name="icon">${i.mediaplaybackrate||Yi}x</slot>
1332
- `}function ig(){return E("Playback rate")}var Tn=class extends F{constructor(){var e;super(),eg(this,ii,new Zt(this,kd.RATES,{defaultValue:Ld})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Yi}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,kd.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===kd.RATES&&(Or(this,ii).value=r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?Yi:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",E("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return Or(this,ii)}set rates(e){e?Array.isArray(e)?Or(this,ii).value=e.join(" "):typeof e=="string"&&(Or(this,ii).value=e):Or(this,ii).value=""}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,Yi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(Or(this,ii).values(),a=>+a).sort((a,l)=>a-l),o=(t=(e=r.find(a=>a>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:Yi,n=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(n)}};ii=new WeakMap;Tn.getSlotTemplateHTML=tg;Tn.getTooltipContentHTML=ig;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Tn);var rg=`<svg aria-hidden="true" viewBox="0 0 24 24">
1335
+ `}function og(){return E("Playback rate")}var Tn=class extends F{constructor(){var e;super(),ig(this,ii,new Zt(this,kd.RATES,{defaultValue:Ld})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Yi}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,kd.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===kd.RATES&&(Or(this,ii).value=r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?Yi:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",E("Playback rate {playbackRate}",{playbackRate:n}))}}get rates(){return Or(this,ii)}set rates(e){e?Array.isArray(e)?Or(this,ii).value=e.join(" "):typeof e=="string"&&(Or(this,ii).value=e):Or(this,ii).value=""}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,Yi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(Or(this,ii).values(),a=>+a).sort((a,l)=>a-l),o=(t=(e=r.find(a=>a>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:Yi,n=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(n)}};ii=new WeakMap;Tn.getSlotTemplateHTML=rg;Tn.getTooltipContentHTML=og;d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Tn);var ng=`<svg aria-hidden="true" viewBox="0 0 24 24">
1333
1336
  <path d="m6 21 15-9L6 3v18Z"/>
1334
- </svg>`,og=`<svg aria-hidden="true" viewBox="0 0 24 24">
1337
+ </svg>`,ag=`<svg aria-hidden="true" viewBox="0 0 24 24">
1335
1338
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
1336
- </svg>`;function ng(i){return`
1339
+ </svg>`;function sg(i){return`
1337
1340
  <style>
1338
1341
  :host([${s.MEDIA_PAUSED}]) slot[name=pause],
1339
1342
  :host(:not([${s.MEDIA_PAUSED}])) slot[name=play] {
@@ -1347,13 +1350,13 @@ bp-player[has-error] {
1347
1350
  </style>
1348
1351
 
1349
1352
  <slot name="icon">
1350
- <slot name="play">${rg}</slot>
1351
- <slot name="pause">${og}</slot>
1353
+ <slot name="play">${ng}</slot>
1354
+ <slot name="pause">${ag}</slot>
1352
1355
  </slot>
1353
- `}function ag(){return`
1356
+ `}function lg(){return`
1354
1357
  <slot name="tooltip-play">${E("Play")}</slot>
1355
1358
  <slot name="tooltip-pause">${E("Pause")}</slot>
1356
- `}var cp=i=>{let e=i.mediaPaused?E("play"):E("pause");i.setAttribute("aria-label",e)},An=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),cp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PAUSED||e===s.MEDIA_LANG)&&cp(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};An.getSlotTemplateHTML=ng;An.getTooltipContentHTML=ag;d.customElements.get("media-play-button")||d.customElements.define("media-play-button",An);var Et={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function sg(i){return`
1359
+ `}var up=i=>{let e=i.mediaPaused?E("play"):E("pause");i.setAttribute("aria-label",e)},An=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),up(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PAUSED||e===s.MEDIA_LANG)&&up(this)}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){C(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?b.MEDIA_PLAY_REQUEST:b.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};An.getSlotTemplateHTML=sg;An.getTooltipContentHTML=lg;d.customElements.get("media-play-button")||d.customElements.define("media-play-button",An);var Et={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function dg(i){return`
1357
1360
  <style>
1358
1361
  :host {
1359
1362
  pointer-events: none;
@@ -1375,7 +1378,7 @@ bp-player[has-error] {
1375
1378
  </style>
1376
1379
 
1377
1380
  <img part="poster img" aria-hidden="true" id="image"/>
1378
- `}var lg=i=>{i.style.removeProperty("background-image")},dg=(i,e)=>{i.style["background-image"]=`url('${e}')`},Sn=class extends d.HTMLElement{static get observedAttributes(){return[Et.PLACEHOLDER_SRC,Et.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===Et.SRC&&(r==null?this.image.removeAttribute(Et.SRC):this.image.setAttribute(Et.SRC,r)),e===Et.PLACEHOLDER_SRC&&(r==null?lg(this.image):dg(this.image,r))}get placeholderSrc(){return P(this,Et.PLACEHOLDER_SRC)}set placeholderSrc(e){D(this,Et.SRC,e)}get src(){return P(this,Et.SRC)}set src(e){D(this,Et.SRC,e)}};Sn.shadowRootOptions={mode:"open"};Sn.getTemplateHTML=sg;d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Sn);var up=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},cg=(i,e,t)=>(up(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)},hg=(i,e,t,r)=>(up(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),hs,wd=class extends Pe{constructor(){super(),ug(this,hs,void 0),hg(this,hs,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PREVIEW_CHAPTER||e===s.MEDIA_LANG)&&r!==t&&r!=null)if(cg(this,hs).textContent=r,r!==""){let o=E("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",o)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return P(this,s.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){D(this,s.MEDIA_PREVIEW_CHAPTER,e)}};hs=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",wd);var hp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ps=(i,e,t)=>(hp(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)},ms=(i,e,t,r)=>(hp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bt;function mg(i){return`
1381
+ `}var cg=i=>{i.style.removeProperty("background-image")},ug=(i,e)=>{i.style["background-image"]=`url('${e}')`},Sn=class extends d.HTMLElement{static get observedAttributes(){return[Et.PLACEHOLDER_SRC,Et.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===Et.SRC&&(r==null?this.image.removeAttribute(Et.SRC):this.image.setAttribute(Et.SRC,r)),e===Et.PLACEHOLDER_SRC&&(r==null?cg(this.image):ug(this.image,r))}get placeholderSrc(){return P(this,Et.PLACEHOLDER_SRC)}set placeholderSrc(e){D(this,Et.SRC,e)}get src(){return P(this,Et.SRC)}set src(e){D(this,Et.SRC,e)}};Sn.shadowRootOptions={mode:"open"};Sn.getTemplateHTML=dg;d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Sn);var hp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},hg=(i,e,t)=>(hp(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)=>(hp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),hs,wd=class extends Pe{constructor(){super(),pg(this,hs,void 0),mg(this,hs,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===s.MEDIA_PREVIEW_CHAPTER||e===s.MEDIA_LANG)&&r!==t&&r!=null)if(hg(this,hs).textContent=r,r!==""){let o=E("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",o)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return P(this,s.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){D(this,s.MEDIA_PREVIEW_CHAPTER,e)}};hs=new WeakMap;d.customElements.get("media-preview-chapter-display")||d.customElements.define("media-preview-chapter-display",wd);var pp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ps=(i,e,t)=>(pp(i,e,"read from private field"),t?t.call(i):e.get(i)),vg=(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)},ms=(i,e,t,r)=>(pp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bt;function fg(i){return`
1379
1382
  <style>
1380
1383
  :host {
1381
1384
  box-sizing: border-box;
@@ -1389,27 +1392,27 @@ bp-player[has-error] {
1389
1392
  }
1390
1393
  </style>
1391
1394
  <img crossorigin loading="eager" decoding="async">
1392
- `}var Ur=class extends d.HTMLElement{constructor(){if(super(),pg(this,bt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(ms(this,bt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=ps(this,bt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ps(this,bt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ms(this,bt,null)}attributeChangedCallback(e,t,r){var o,n,a,l,c;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===N.MEDIA_CONTROLLER&&(t&&((n=(o=ps(this,bt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ms(this,bt,null)),r&&this.isConnected&&(ms(this,bt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=ps(this,bt))==null?void 0:l.associateElement)==null||c.call(l,this)))}get mediaPreviewImage(){return P(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){D(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,o,n,a]=e,l=t.split("#")[0],c=getComputedStyle(this),{maxWidth:p,maxHeight:h,minWidth:v,minHeight:g}=c,m=Math.min(parseInt(p)/n,parseInt(h)/a),A=Math.max(parseInt(v)/n,parseInt(g)/a),f=m<1,R=f?m:A>1?A:1,{style:O}=J(this.shadowRoot,":host"),Ne=J(this.shadowRoot,"img").style,nt=this.shadowRoot.querySelector("img"),Co=f?"min":"max";O.setProperty(`${Co}-width`,"initial","important"),O.setProperty(`${Co}-height`,"initial","important"),O.width=`${n*R}px`,O.height=`${a*R}px`;let cr=()=>{Ne.width=`${this.imgWidth*R}px`,Ne.height=`${this.imgHeight*R}px`,Ne.display="block"};nt.src!==l&&(nt.onload=()=>{this.imgWidth=nt.naturalWidth,this.imgHeight=nt.naturalHeight,cr()},nt.src=l,cr()),cr(),Ne.transform=`translate(-${r*R}px, -${o*R}px)`}};bt=new WeakMap;Ur.shadowRootOptions={mode:"open"};Ur.getTemplateHTML=mg;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Ur);var vs=Ur;var mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pp=(i,e,t)=>(mp(i,e,"read from private field"),t?t.call(i):e.get(i)),vg=(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)},fg=(i,e,t,r)=>(mp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),kn,Id=class extends Pe{constructor(){super(),vg(this,kn,void 0),fg(this,kn,this.shadowRoot.querySelector("slot")),pp(this,kn).textContent=Je(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PREVIEW_TIME&&r!=null&&(pp(this,kn).textContent=Je(parseFloat(r)))}get mediaPreviewTime(){return $(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}};kn=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Id);var Nr={SEEK_OFFSET:"seekoffset"},Cd=30,gg=i=>`
1395
+ `}var Ur=class extends d.HTMLElement{constructor(){if(super(),vg(this,bt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[N.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let o=this.getAttribute(N.MEDIA_CONTROLLER);o&&(ms(this,bt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=ps(this,bt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ps(this,bt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ms(this,bt,null)}attributeChangedCallback(e,t,r){var o,n,a,l,c;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===N.MEDIA_CONTROLLER&&(t&&((n=(o=ps(this,bt))==null?void 0:o.unassociateElement)==null||n.call(o,this),ms(this,bt,null)),r&&this.isConnected&&(ms(this,bt,(a=this.getRootNode())==null?void 0:a.getElementById(r)),(c=(l=ps(this,bt))==null?void 0:l.associateElement)==null||c.call(l,this)))}get mediaPreviewImage(){return P(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){D(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,o,n,a]=e,l=t.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:h,minWidth:v,minHeight:g}=c,p=Math.min(parseInt(m)/n,parseInt(h)/a),A=Math.max(parseInt(v)/n,parseInt(g)/a),f=p<1,R=f?p:A>1?A:1,{style:O}=J(this.shadowRoot,":host"),Ne=J(this.shadowRoot,"img").style,nt=this.shadowRoot.querySelector("img"),Io=f?"min":"max";O.setProperty(`${Io}-width`,"initial","important"),O.setProperty(`${Io}-height`,"initial","important"),O.width=`${n*R}px`,O.height=`${a*R}px`;let cr=()=>{Ne.width=`${this.imgWidth*R}px`,Ne.height=`${this.imgHeight*R}px`,Ne.display="block"};nt.src!==l&&(nt.onload=()=>{this.imgWidth=nt.naturalWidth,this.imgHeight=nt.naturalHeight,cr()},nt.src=l,cr()),cr(),Ne.transform=`translate(-${r*R}px, -${o*R}px)`}};bt=new WeakMap;Ur.shadowRootOptions={mode:"open"};Ur.getTemplateHTML=fg;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Ur);var vs=Ur;var vp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},mp=(i,e,t)=>(vp(i,e,"read from private field"),t?t.call(i):e.get(i)),gg=(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)},Eg=(i,e,t,r)=>(vp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),kn,Cd=class extends Pe{constructor(){super(),gg(this,kn,void 0),Eg(this,kn,this.shadowRoot.querySelector("slot")),mp(this,kn).textContent=Je(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PREVIEW_TIME&&r!=null&&(mp(this,kn).textContent=Je(parseFloat(r)))}get mediaPreviewTime(){return H(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}};kn=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Cd);var Nr={SEEK_OFFSET:"seekoffset"},Id=30,bg=i=>`
1393
1396
  <svg aria-hidden="true" viewBox="0 0 20 24">
1394
1397
  <defs>
1395
1398
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
1396
1399
  </defs>
1397
1400
  <text class="text value" transform="translate(2.18 19.87)">${i}</text>
1398
1401
  <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"/>
1399
- </svg>`;function Eg(i,e){return`
1400
- <slot name="icon">${gg(e.seekOffset)}</slot>
1401
- `}function bg(){return E("Seek backward")}var _g=0,Ln=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Nr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=$(this,Nr.SEEK_OFFSET,Cd)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Nr.SEEK_OFFSET&&(this.seekOffset=$(this,Nr.SEEK_OFFSET,Cd))}get seekOffset(){return $(this,Nr.SEEK_OFFSET,Cd)}set seekOffset(e){B(this,Nr.SEEK_OFFSET,e),this.setAttribute("aria-label",E("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Ea(ba(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME,_g)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Ln.getSlotTemplateHTML=Eg;Ln.getTooltipContentHTML=bg;d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Ln);var $r={SEEK_OFFSET:"seekoffset"},Md=30,yg=i=>`
1402
+ </svg>`;function _g(i,e){return`
1403
+ <slot name="icon">${bg(e.seekOffset)}</slot>
1404
+ `}function yg(){return E("Seek backward")}var Tg=0,Ln=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Nr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Nr.SEEK_OFFSET,Id)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Nr.SEEK_OFFSET&&(this.seekOffset=H(this,Nr.SEEK_OFFSET,Id))}get seekOffset(){return H(this,Nr.SEEK_OFFSET,Id)}set seekOffset(e){B(this,Nr.SEEK_OFFSET,e),this.setAttribute("aria-label",E("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Ea(ba(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,Tg)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Ln.getSlotTemplateHTML=_g;Ln.getTooltipContentHTML=yg;d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Ln);var Hr={SEEK_OFFSET:"seekoffset"},Md=30,Ag=i=>`
1402
1405
  <svg aria-hidden="true" viewBox="0 0 20 24">
1403
1406
  <defs>
1404
1407
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
1405
1408
  </defs>
1406
1409
  <text class="text value" transform="translate(8.9 19.87)">${i}</text>
1407
1410
  <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"/>
1408
- </svg>`;function Tg(i,e){return`
1409
- <slot name="icon">${yg(e.seekOffset)}</slot>
1410
- `}function Ag(){return E("Seek forward")}var Sg=0,wn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,$r.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=$(this,$r.SEEK_OFFSET,Md)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===$r.SEEK_OFFSET&&(this.seekOffset=$(this,$r.SEEK_OFFSET,Md))}get seekOffset(){return $(this,$r.SEEK_OFFSET,Md)}set seekOffset(e){B(this,$r.SEEK_OFFSET,e),this.setAttribute("aria-label",E("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Ea(ba(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME,Sg)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};wn.getSlotTemplateHTML=Tg;wn.getTooltipContentHTML=Ag;d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",wn);var gp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Rd=(i,e,t)=>(gp(i,e,"read from private field"),t?t.call(i):e.get(i)),kg=(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)},Lg=(i,e,t,r)=>(gp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Hr,Qi={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},vp=[...Object.values(Qi),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],fp=["Enter"," "],wg="&nbsp;/&nbsp;",xd=(i,{timesSep:e=wg}={})=>{var t,r;let o=(t=i.mediaCurrentTime)!=null?t:0,[,n]=(r=i.mediaSeekable)!=null?r:[],a=0;Number.isFinite(i.mediaDuration)?a=i.mediaDuration:Number.isFinite(n)&&(a=n);let l=i.remaining?Je(0-(a-o)):Je(o);return i.showDuration?`${l}${e}${Je(a)}`:l},Ig="video not loaded, unknown time.",Cg=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],o=null;if(Number.isFinite(i.mediaDuration)?o=i.mediaDuration:Number.isFinite(r)&&(o=r),t==null||o===null){i.setAttribute("aria-valuetext",Ig);return}let n=i.remaining?Di(0-(o-t)):Di(t);if(!i.showDuration){i.setAttribute("aria-valuetext",n);return}let a=Di(o),l=`${n} of ${a}`;i.setAttribute("aria-valuetext",l)};function Mg(i,e){return`
1411
+ </svg>`;function Sg(i,e){return`
1412
+ <slot name="icon">${Ag(e.seekOffset)}</slot>
1413
+ `}function kg(){return E("Seek forward")}var Lg=0,wn=class extends F{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Hr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=H(this,Hr.SEEK_OFFSET,Md)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Hr.SEEK_OFFSET&&(this.seekOffset=H(this,Hr.SEEK_OFFSET,Md))}get seekOffset(){return H(this,Hr.SEEK_OFFSET,Md)}set seekOffset(e){B(this,Hr.SEEK_OFFSET,e),this.setAttribute("aria-label",E("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Ea(ba(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME,Lg)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};wn.getSlotTemplateHTML=Sg;wn.getTooltipContentHTML=kg;d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",wn);var Ep=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Rd=(i,e,t)=>(Ep(i,e,"read from private field"),t?t.call(i):e.get(i)),wg=(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)=>(Ep(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$r,Qi={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},fp=[...Object.values(Qi),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],gp=["Enter"," "],Ig="&nbsp;/&nbsp;",xd=(i,{timesSep:e=Ig}={})=>{var t,r;let o=(t=i.mediaCurrentTime)!=null?t:0,[,n]=(r=i.mediaSeekable)!=null?r:[],a=0;Number.isFinite(i.mediaDuration)?a=i.mediaDuration:Number.isFinite(n)&&(a=n);let l=i.remaining?Je(0-(a-o)):Je(o);return i.showDuration?`${l}${e}${Je(a)}`:l},Mg="video not loaded, unknown time.",Rg=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],o=null;if(Number.isFinite(i.mediaDuration)?o=i.mediaDuration:Number.isFinite(r)&&(o=r),t==null||o===null){i.setAttribute("aria-valuetext",Mg);return}let n=i.remaining?Di(0-(o-t)):Di(t);if(!i.showDuration){i.setAttribute("aria-valuetext",n);return}let a=Di(o),l=`${n} of ${a}`;i.setAttribute("aria-valuetext",l)};function xg(i,e){return`
1411
1414
  <slot>${xd(e)}</slot>
1412
- `}var fs=class extends Pe{constructor(){super(),kg(this,Hr,void 0),Lg(this,Hr,this.shadowRoot.querySelector("slot")),Rd(this,Hr).innerHTML=`${xd(this)}`}static get observedAttributes(){return[...super.observedAttributes,...vp,"disabled"]}connectedCallback(){let{style:e}=J(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",E("playback time"));let t=r=>{let{key:o}=r;if(!fp.includes(o)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:o,altKey:n,key:a}=r;if(o||n||!fp.includes(a)){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){vp.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 w(this,Qi.REMAINING)}set remaining(e){I(this,Qi.REMAINING,e)}get showDuration(){return w(this,Qi.SHOW_DURATION)}set showDuration(e){I(this,Qi.SHOW_DURATION,e)}get noToggle(){return w(this,Qi.NO_TOGGLE)}set noToggle(e){I(this,Qi.NO_TOGGLE,e)}get mediaDuration(){return $(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}update(){let e=xd(this);Cg(this),e!==Rd(this,Hr).innerHTML&&(Rd(this,Hr).innerHTML=e)}};Hr=new WeakMap;fs.getSlotTemplateHTML=Mg;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",fs);var Ep=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ee=(i,e,t)=>(Ep(i,e,"read from private field"),t?t.call(i):e.get(i)),_t=(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)=>(Ep(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Rg=(i,e,t,r)=>({set _(o){We(i,e,o,t)},get _(){return Ee(i,e,r)}}),Br,gs,Vr,In,Es,bs,_s,Wr,Zi,ys,Ts=class{constructor(e,t,r){_t(this,Br,void 0),_t(this,gs,void 0),_t(this,Vr,void 0),_t(this,In,void 0),_t(this,Es,void 0),_t(this,bs,void 0),_t(this,_s,void 0),_t(this,Wr,void 0),_t(this,Zi,0),_t(this,ys,(o=performance.now())=>{We(this,Zi,requestAnimationFrame(Ee(this,ys))),We(this,In,performance.now()-Ee(this,Vr));let n=1e3/this.fps;if(Ee(this,In)>n){We(this,Vr,o-Ee(this,In)%n);let a=1e3/((o-Ee(this,gs))/++Rg(this,Es)._),l=(o-Ee(this,bs))/1e3/this.duration,c=Ee(this,_s)+l*this.playbackRate;c-Ee(this,Br).valueAsNumber>0?We(this,Wr,this.playbackRate/this.duration/a):(We(this,Wr,.995*Ee(this,Wr)),c=Ee(this,Br).valueAsNumber+Ee(this,Wr)),this.callback(c)}}),We(this,Br,e),this.callback=t,this.fps=r}start(){Ee(this,Zi)===0&&(We(this,Vr,performance.now()),We(this,gs,Ee(this,Vr)),We(this,Es,0),Ee(this,ys).call(this))}stop(){Ee(this,Zi)!==0&&(cancelAnimationFrame(Ee(this,Zi)),We(this,Zi,0))}update({start:e,duration:t,playbackRate:r}){let o=e-Ee(this,Br).valueAsNumber,n=Math.abs(t-this.duration);(o>0||o<-.03||n>=.5)&&this.callback(e),We(this,_s,e),We(this,bs,performance.now()),this.duration=t,this.playbackRate=r}};Br=new WeakMap;gs=new WeakMap;Vr=new WeakMap;In=new WeakMap;Es=new WeakMap;bs=new WeakMap;_s=new WeakMap;Wr=new WeakMap;Zi=new WeakMap;ys=new WeakMap;var Ud=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},se=(i,e,t)=>(Ud(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)},Ge=(i,e,t,r)=>(Ud(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ye=(i,e,t)=>(Ud(i,e,"access private method"),t),Fr,Xi,ks,Mn,Ls,Ss,Rn,xn,Kr,qr,Gr,Cn,Nd,bp,Pd,ws,$d,Is,Hd,Cs,Bd,Dd,_p,Pn,Ms,Od,yp,xg="video not loaded, unknown time.",Pg=i=>{let e=i.range,t=Di(+Tp(i)),r=Di(+i.mediaSeekableEnd),o=t&&r?`${t} of ${r}`:xg;e.setAttribute("aria-valuetext",o)};function Dg(i){return`
1415
+ `}var fs=class extends Pe{constructor(){super(),wg(this,$r,void 0),Cg(this,$r,this.shadowRoot.querySelector("slot")),Rd(this,$r).innerHTML=`${xd(this)}`}static get observedAttributes(){return[...super.observedAttributes,...fp,"disabled"]}connectedCallback(){let{style:e}=J(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",E("playback time"));let t=r=>{let{key:o}=r;if(!gp.includes(o)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:o,altKey:n,key:a}=r;if(o||n||!gp.includes(a)){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){fp.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 w(this,Qi.REMAINING)}set remaining(e){C(this,Qi.REMAINING,e)}get showDuration(){return w(this,Qi.SHOW_DURATION)}set showDuration(e){C(this,Qi.SHOW_DURATION,e)}get noToggle(){return w(this,Qi.NO_TOGGLE)}set noToggle(e){C(this,Qi.NO_TOGGLE,e)}get mediaDuration(){return H(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}update(){let e=xd(this);Rg(this),e!==Rd(this,$r).innerHTML&&(Rd(this,$r).innerHTML=e)}};$r=new WeakMap;fs.getSlotTemplateHTML=xg;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",fs);var bp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ee=(i,e,t)=>(bp(i,e,"read from private field"),t?t.call(i):e.get(i)),_t=(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)=>(bp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Pg=(i,e,t,r)=>({set _(o){We(i,e,o,t)},get _(){return Ee(i,e,r)}}),Br,gs,Vr,Cn,Es,bs,_s,Wr,Zi,ys,Ts=class{constructor(e,t,r){_t(this,Br,void 0),_t(this,gs,void 0),_t(this,Vr,void 0),_t(this,Cn,void 0),_t(this,Es,void 0),_t(this,bs,void 0),_t(this,_s,void 0),_t(this,Wr,void 0),_t(this,Zi,0),_t(this,ys,(o=performance.now())=>{We(this,Zi,requestAnimationFrame(Ee(this,ys))),We(this,Cn,performance.now()-Ee(this,Vr));let n=1e3/this.fps;if(Ee(this,Cn)>n){We(this,Vr,o-Ee(this,Cn)%n);let a=1e3/((o-Ee(this,gs))/++Pg(this,Es)._),l=(o-Ee(this,bs))/1e3/this.duration,c=Ee(this,_s)+l*this.playbackRate;c-Ee(this,Br).valueAsNumber>0?We(this,Wr,this.playbackRate/this.duration/a):(We(this,Wr,.995*Ee(this,Wr)),c=Ee(this,Br).valueAsNumber+Ee(this,Wr)),this.callback(c)}}),We(this,Br,e),this.callback=t,this.fps=r}start(){Ee(this,Zi)===0&&(We(this,Vr,performance.now()),We(this,gs,Ee(this,Vr)),We(this,Es,0),Ee(this,ys).call(this))}stop(){Ee(this,Zi)!==0&&(cancelAnimationFrame(Ee(this,Zi)),We(this,Zi,0))}update({start:e,duration:t,playbackRate:r}){let o=e-Ee(this,Br).valueAsNumber,n=Math.abs(t-this.duration);(o>0||o<-.03||n>=.5)&&this.callback(e),We(this,_s,e),We(this,bs,performance.now()),this.duration=t,this.playbackRate=r}};Br=new WeakMap;gs=new WeakMap;Vr=new WeakMap;Cn=new WeakMap;Es=new WeakMap;bs=new WeakMap;_s=new WeakMap;Wr=new WeakMap;Zi=new WeakMap;ys=new WeakMap;var Ud=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},se=(i,e,t)=>(Ud(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)},Ge=(i,e,t,r)=>(Ud(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ye=(i,e,t)=>(Ud(i,e,"access private method"),t),Fr,Xi,ks,Mn,Ls,Ss,Rn,xn,Kr,qr,Gr,In,Nd,_p,Pd,ws,Hd,Cs,$d,Is,Bd,Dd,yp,Pn,Ms,Od,Tp,Dg="video not loaded, unknown time.",Og=i=>{let e=i.range,t=Di(+Ap(i)),r=Di(+i.mediaSeekableEnd),o=t&&r?`${t} of ${r}`:Dg;e.setAttribute("aria-valuetext",o)};function Ug(i){return`
1413
1416
  <style>
1414
1417
  :host {
1415
1418
  --media-box-border-radius: 4px;
@@ -1626,7 +1629,7 @@ bp-player[has-error] {
1626
1629
 
1627
1630
  </slot>
1628
1631
  </div>
1629
- `}var As=(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 o=(e-t)/(r-t);return Math.max(0,Math.min(o,1))},Tp=(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},Dn=class extends mt{constructor(){super(),me(this,Gr),me(this,Nd),me(this,ws),me(this,Is),me(this,Cs),me(this,Dd),me(this,Pn),me(this,Od),me(this,Fr,void 0),me(this,Xi,void 0),me(this,ks,void 0),me(this,Mn,void 0),me(this,Ls,void 0),me(this,Ss,void 0),me(this,Rn,void 0),me(this,xn,void 0),me(this,Kr,void 0),me(this,qr,void 0),me(this,Pd,r=>{this.dragging||(Er(r)&&(this.range.valueAsNumber=r),se(this,qr)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ge(this,ks,this.shadowRoot.querySelectorAll('[part~="box"]')),Ge(this,Ls,this.shadowRoot.querySelector('[part~="preview-box"]')),Ge(this,Ss,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Ge(this,Rn,parseInt(t.getPropertyValue("--media-box-padding-left"))),Ge(this,xn,parseInt(t.getPropertyValue("--media-box-padding-right"))),Ge(this,Xi,new Ts(this.range,se(this,Pd),60))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_DURATION,s.MEDIA_SEEKABLE,s.MEDIA_CURRENT_TIME,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_TIME,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_BUFFERED,s.MEDIA_PLAYBACK_RATE,s.MEDIA_LOADING,s.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",E("seek")),ye(this,Gr,Cn).call(this),Ge(this,Fr,this.getRootNode()),(e=se(this,Fr))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),ye(this,Gr,Cn).call(this),(e=se(this,Fr))==null||e.removeEventListener("transitionstart",this),Ge(this,Fr,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(e===s.MEDIA_CURRENT_TIME||e===s.MEDIA_PAUSED||e===s.MEDIA_ENDED||e===s.MEDIA_LOADING||e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE?(se(this,Xi).update({start:As(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),ye(this,Gr,Cn).call(this),Pg(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=se(this,Kr),this.updateBar()))}get mediaChaptersCues(){return se(this,Kr)}set mediaChaptersCues(e){var t;Ge(this,Kr,e),this.updateSegments((t=se(this,Kr))==null?void 0:t.map(r=>({start:As(this,r.startTime),end:As(this,r.endTime)})))}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){I(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,s.MEDIA_LOADING)}set mediaLoading(e){I(this,s.MEDIA_LOADING,e)}get mediaDuration(){return $(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return $(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(s.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(s.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(s.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.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 P(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){D(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return $(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return w(this,s.MEDIA_ENDED)}set mediaEnded(e){I(this,s.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 n=this.mediaCurrentTime,[,a=this.mediaSeekableStart]=(e=t.find(([l,c])=>l<=n&&n<=c))!=null?e:[];r=As(this,a)}let{style:o}=J(this.shadowRoot,"#buffered");o.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=J(this.shadowRoot,"#current-rail"),r=J(this.shadowRoot,'[part~="current-box"]'),o=ye(this,ws,$d).call(this,se(this,Ss)),n=ye(this,Is,Hd).call(this,o,this.range.valueAsNumber),a=ye(this,Cs,Bd).call(this,o,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${a}`),r.style.setProperty("--_box-width",`${o.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":ye(this,Od,yp).call(this);break;case"pointermove":ye(this,Dd,_p).call(this,e);break;case"pointerup":se(this,qr)&&Ge(this,qr,!1);break;case"pointerdown":Ge(this,qr,!0);break;case"pointerleave":ye(this,Pn,Ms).call(this,null);break;case"transitionstart":Ae(e.target,this)&&setTimeout(()=>ye(this,Gr,Cn).call(this),0);break}}};Fr=new WeakMap;Xi=new WeakMap;ks=new WeakMap;Mn=new WeakMap;Ls=new WeakMap;Ss=new WeakMap;Rn=new WeakMap;xn=new WeakMap;Kr=new WeakMap;qr=new WeakMap;Gr=new WeakSet;Cn=function(){ye(this,Nd,bp).call(this)?se(this,Xi).start():se(this,Xi).stop()};Nd=new WeakSet;bp=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&_a(this)};Pd=new WeakMap;ws=new WeakSet;$d=function(i){var e;let r=((e=this.getAttribute("bounds")?st(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),o=this.range.getBoundingClientRect(),n=i.offsetWidth,a=-(o.left-r.left-n/2),l=r.right-o.left-n/2;return{box:{width:n,min:a,max:l},bounds:r,range:o}};Is=new WeakSet;Hd=function(i,e){let t=`${e*100}%`,{width:r,min:o,max:n}=i.box;if(!r)return t;if(Number.isNaN(o)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${o}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};Cs=new WeakSet;Bd=function(i,e){let{width:t,min:r,max:o}=i.box,n=e*i.range.width;if(n<r+se(this,Rn)){let a=i.range.left-i.bounds.left-se(this,Rn);return`${n-t/2+a}px`}if(n>o-se(this,xn)){let a=i.bounds.right-i.range.right-se(this,xn);return`${n+t/2-a-i.range.width}px`}return 0};Dd=new WeakSet;_p=function(i){let e=[...se(this,ks)].some(h=>i.composedPath().includes(h));if(!this.dragging&&(e||!i.composedPath().includes(this))){ye(this,Pn,Ms).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=J(this.shadowRoot,"#preview-rail"),o=J(this.shadowRoot,'[part~="preview-box"]'),n=ye(this,ws,$d).call(this,se(this,Ls)),a=(i.clientX-n.range.left)/n.range.width;a=Math.max(0,Math.min(1,a));let l=ye(this,Is,Hd).call(this,n,a),c=ye(this,Cs,Bd).call(this,n,a);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${n.range.width}`),o.style.setProperty("--_box-shift",`${c}`),o.style.setProperty("--_box-width",`${n.box.width}px`);let p=Math.round(se(this,Mn))-Math.round(a*t);Math.abs(p)<1&&a>.01&&a<.99||(Ge(this,Mn,a*t),ye(this,Pn,Ms).call(this,se(this,Mn)))};Pn=new WeakSet;Ms=function(i){this.dispatchEvent(new d.CustomEvent(b.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Od=new WeakSet;yp=function(){se(this,Xi).stop();let i=Tp(this);this.dispatchEvent(new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Dn.shadowRootOptions={mode:"open"};Dn.getContainerTemplateHTML=Dg;d.customElements.get("media-time-range")||d.customElements.define("media-time-range",Dn);var Og=1,Ug=i=>i.mediaMuted?0:i.mediaVolume,Ng=i=>`${Math.round(i*100)}%`,Vd=class extends mt{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME,s.MEDIA_MUTED,s.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",E("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=Ug(this),this.range.setAttribute("aria-valuetext",Ng(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return $(this,s.MEDIA_VOLUME,Og)}set mediaVolume(e){B(this,s.MEDIA_VOLUME,e)}get mediaMuted(){return w(this,s.MEDIA_MUTED)}set mediaMuted(e){I(this,s.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return P(this,s.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){D(this,s.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",Vd);function $g(i){return`
1632
+ `}var As=(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 o=(e-t)/(r-t);return Math.max(0,Math.min(o,1))},Ap=(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},Dn=class extends mt{constructor(){super(),me(this,Gr),me(this,Nd),me(this,ws),me(this,Cs),me(this,Is),me(this,Dd),me(this,Pn),me(this,Od),me(this,Fr,void 0),me(this,Xi,void 0),me(this,ks,void 0),me(this,Mn,void 0),me(this,Ls,void 0),me(this,Ss,void 0),me(this,Rn,void 0),me(this,xn,void 0),me(this,Kr,void 0),me(this,qr,void 0),me(this,Pd,r=>{this.dragging||(Er(r)&&(this.range.valueAsNumber=r),se(this,qr)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ge(this,ks,this.shadowRoot.querySelectorAll('[part~="box"]')),Ge(this,Ls,this.shadowRoot.querySelector('[part~="preview-box"]')),Ge(this,Ss,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Ge(this,Rn,parseInt(t.getPropertyValue("--media-box-padding-left"))),Ge(this,xn,parseInt(t.getPropertyValue("--media-box-padding-right"))),Ge(this,Xi,new Ts(this.range,se(this,Pd),60))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_DURATION,s.MEDIA_SEEKABLE,s.MEDIA_CURRENT_TIME,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_TIME,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_BUFFERED,s.MEDIA_PLAYBACK_RATE,s.MEDIA_LOADING,s.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",E("seek")),ye(this,Gr,In).call(this),Ge(this,Fr,this.getRootNode()),(e=se(this,Fr))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),ye(this,Gr,In).call(this),(e=se(this,Fr))==null||e.removeEventListener("transitionstart",this),Ge(this,Fr,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(e===s.MEDIA_CURRENT_TIME||e===s.MEDIA_PAUSED||e===s.MEDIA_ENDED||e===s.MEDIA_LOADING||e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE?(se(this,Xi).update({start:As(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),ye(this,Gr,In).call(this),Og(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=se(this,Kr),this.updateBar()))}get mediaChaptersCues(){return se(this,Kr)}set mediaChaptersCues(e){var t;Ge(this,Kr,e),this.updateSegments((t=se(this,Kr))==null?void 0:t.map(r=>({start:As(this,r.startTime),end:As(this,r.endTime)})))}get mediaPaused(){return w(this,s.MEDIA_PAUSED)}set mediaPaused(e){C(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,s.MEDIA_LOADING)}set mediaLoading(e){C(this,s.MEDIA_LOADING,e)}get mediaDuration(){return H(this,s.MEDIA_DURATION)}set mediaDuration(e){B(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return H(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){B(this,s.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(s.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(s.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(s.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.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 P(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){D(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return H(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){B(this,s.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return w(this,s.MEDIA_ENDED)}set mediaEnded(e){C(this,s.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 n=this.mediaCurrentTime,[,a=this.mediaSeekableStart]=(e=t.find(([l,c])=>l<=n&&n<=c))!=null?e:[];r=As(this,a)}let{style:o}=J(this.shadowRoot,"#buffered");o.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=J(this.shadowRoot,"#current-rail"),r=J(this.shadowRoot,'[part~="current-box"]'),o=ye(this,ws,Hd).call(this,se(this,Ss)),n=ye(this,Cs,$d).call(this,o,this.range.valueAsNumber),a=ye(this,Is,Bd).call(this,o,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${a}`),r.style.setProperty("--_box-width",`${o.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":ye(this,Od,Tp).call(this);break;case"pointermove":ye(this,Dd,yp).call(this,e);break;case"pointerup":se(this,qr)&&Ge(this,qr,!1);break;case"pointerdown":Ge(this,qr,!0);break;case"pointerleave":ye(this,Pn,Ms).call(this,null);break;case"transitionstart":Ae(e.target,this)&&setTimeout(()=>ye(this,Gr,In).call(this),0);break}}};Fr=new WeakMap;Xi=new WeakMap;ks=new WeakMap;Mn=new WeakMap;Ls=new WeakMap;Ss=new WeakMap;Rn=new WeakMap;xn=new WeakMap;Kr=new WeakMap;qr=new WeakMap;Gr=new WeakSet;In=function(){ye(this,Nd,_p).call(this)?se(this,Xi).start():se(this,Xi).stop()};Nd=new WeakSet;_p=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&_a(this)};Pd=new WeakMap;ws=new WeakSet;Hd=function(i){var e;let r=((e=this.getAttribute("bounds")?st(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),o=this.range.getBoundingClientRect(),n=i.offsetWidth,a=-(o.left-r.left-n/2),l=r.right-o.left-n/2;return{box:{width:n,min:a,max:l},bounds:r,range:o}};Cs=new WeakSet;$d=function(i,e){let t=`${e*100}%`,{width:r,min:o,max:n}=i.box;if(!r)return t;if(Number.isNaN(o)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${o}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let l=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};Is=new WeakSet;Bd=function(i,e){let{width:t,min:r,max:o}=i.box,n=e*i.range.width;if(n<r+se(this,Rn)){let a=i.range.left-i.bounds.left-se(this,Rn);return`${n-t/2+a}px`}if(n>o-se(this,xn)){let a=i.bounds.right-i.range.right-se(this,xn);return`${n+t/2-a-i.range.width}px`}return 0};Dd=new WeakSet;yp=function(i){let e=[...se(this,ks)].some(h=>i.composedPath().includes(h));if(!this.dragging&&(e||!i.composedPath().includes(this))){ye(this,Pn,Ms).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=J(this.shadowRoot,"#preview-rail"),o=J(this.shadowRoot,'[part~="preview-box"]'),n=ye(this,ws,Hd).call(this,se(this,Ls)),a=(i.clientX-n.range.left)/n.range.width;a=Math.max(0,Math.min(1,a));let l=ye(this,Cs,$d).call(this,n,a),c=ye(this,Is,Bd).call(this,n,a);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${n.range.width}`),o.style.setProperty("--_box-shift",`${c}`),o.style.setProperty("--_box-width",`${n.box.width}px`);let m=Math.round(se(this,Mn))-Math.round(a*t);Math.abs(m)<1&&a>.01&&a<.99||(Ge(this,Mn,a*t),ye(this,Pn,Ms).call(this,se(this,Mn)))};Pn=new WeakSet;Ms=function(i){this.dispatchEvent(new d.CustomEvent(b.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Od=new WeakSet;Tp=function(){se(this,Xi).stop();let i=Ap(this);this.dispatchEvent(new d.CustomEvent(b.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Dn.shadowRootOptions={mode:"open"};Dn.getContainerTemplateHTML=Ug;d.customElements.get("media-time-range")||d.customElements.define("media-time-range",Dn);var Ng=1,Hg=i=>i.mediaMuted?0:i.mediaVolume,$g=i=>`${Math.round(i*100)}%`,Vd=class extends mt{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME,s.MEDIA_MUTED,s.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new d.CustomEvent(b.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",E("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=Hg(this),this.range.setAttribute("aria-valuetext",$g(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return H(this,s.MEDIA_VOLUME,Ng)}set mediaVolume(e){B(this,s.MEDIA_VOLUME,e)}get mediaMuted(){return w(this,s.MEDIA_MUTED)}set mediaMuted(e){C(this,s.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return P(this,s.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){D(this,s.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",Vd);function Bg(i){return`
1630
1633
  <style>
1631
1634
  :host {
1632
1635
  min-width: 4ch;
@@ -1655,7 +1658,7 @@ bp-player[has-error] {
1655
1658
  <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"/>
1656
1659
  </svg>
1657
1660
  </div>
1658
- `}function Hg(){return E("Loop")}var On=class extends F{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=E("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return w(this,s.MEDIA_LOOP)}set mediaLoop(e){I(this,s.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new d.CustomEvent(b.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};On.getSlotTemplateHTML=$g;On.getTooltipContentHTML=Hg;d.customElements.get("media-loop-button")||d.customElements.define("media-loop-button",On);function Ap({anchor:i,floating:e,placement:t}){let r=Bg({anchor:i,floating:e}),{x:o,y:n}=Wg(r,t);return{x:o,y:n}}function Bg({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(),o=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}function Wg({anchor:i,floating:e},t){let r=Fg(t)==="x"?"y":"x",o=r==="y"?"height":"width",n=Sp(t),a=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,c=i[o]/2-e[o]/2,p;switch(n){case"top":p={x:a,y:i.y-e.height};break;case"bottom":p={x:a,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:l};break;case"left":p={x:i.x-e.width,y:l};break;default:p={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":p[r]-=c;break;case"end":p[r]+=c;break}return p}function Sp(i){return i.split("-")[0]}function Fg(i){return["top","bottom"].includes(Sp(i))?"y":"x"}var ri=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},Rs=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var jd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},q=(i,e,t)=>(jd(i,e,"read from private field"),t?t.call(i):e.get(i)),Q=(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)},yt=(i,e,t,r)=>(jd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Z=(i,e,t)=>(jd(i,e,"access private method"),t),Tt,ji,oi,xs,Ps,er,$n,Wd,kp,Us,ec,Ns,Ds,Fd,Kd,Lp,qd,wp,Gd,Ip,zr,Yr,Qr,Hn,$s,tc,zd,Cp,ic,Mp,Yd,Rp,rc,xp,Qd,Pp,Zd,Dp,Un,Hs,Xd,Op,Nn,Bs,Os,Jd;function At({type:i,text:e,value:t,checked:r}){let o=ee.createElement("media-chrome-menu-item");o.type=i??"",o.part.add("menu-item"),i&&o.part.add(i),o.value=t,o.checked=r;let n=ee.createElement("span");return n.textContent=e,o.append(n),o}function tt(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 Kg(i){return`
1661
+ `}function Vg(){return E("Loop")}var On=class extends F{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=E("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return w(this,s.MEDIA_LOOP)}set mediaLoop(e){C(this,s.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new d.CustomEvent(b.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};On.getSlotTemplateHTML=Bg;On.getTooltipContentHTML=Vg;d.customElements.get("media-loop-button")||d.customElements.define("media-loop-button",On);function Sp({anchor:i,floating:e,placement:t}){let r=Wg({anchor:i,floating:e}),{x:o,y:n}=Kg(r,t);return{x:o,y:n}}function Wg({anchor:i,floating:e}){return{anchor:Fg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Fg(i,e){var t;let r=i.getBoundingClientRect(),o=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}function Kg({anchor:i,floating:e},t){let r=qg(t)==="x"?"y":"x",o=r==="y"?"height":"width",n=kp(t),a=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,c=i[o]/2-e[o]/2,m;switch(n){case"top":m={x:a,y:i.y-e.height};break;case"bottom":m={x:a,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:l};break;case"left":m={x:i.x-e.width,y:l};break;default:m={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":m[r]-=c;break;case"end":m[r]+=c;break}return m}function kp(i){return i.split("-")[0]}function qg(i){return["top","bottom"].includes(kp(i))?"y":"x"}var ri=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},Rs=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var jd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},q=(i,e,t)=>(jd(i,e,"read from private field"),t?t.call(i):e.get(i)),Q=(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)},yt=(i,e,t,r)=>(jd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Z=(i,e,t)=>(jd(i,e,"access private method"),t),Tt,ji,oi,xs,Ps,er,Hn,Wd,Lp,Us,ec,Ns,Ds,Fd,Kd,wp,qd,Cp,Gd,Ip,zr,Yr,Qr,$n,Hs,tc,zd,Mp,ic,Rp,Yd,xp,rc,Pp,Qd,Dp,Zd,Op,Un,$s,Xd,Up,Nn,Bs,Os,Jd;function At({type:i,text:e,value:t,checked:r}){let o=ee.createElement("media-chrome-menu-item");o.type=i??"",o.part.add("menu-item"),i&&o.part.add(i),o.value=t,o.checked=r;let n=ee.createElement("span");return n.textContent=e,o.append(n),o}function tt(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 Gg(i){return`
1659
1662
  <style>
1660
1663
  :host {
1661
1664
  font: var(--media-font,
@@ -1830,7 +1833,7 @@ bp-player[has-error] {
1830
1833
  <slot></slot>
1831
1834
  </div>
1832
1835
  <slot name="checked-indicator" hidden></slot>
1833
- `}var Ji={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},le=class extends d.HTMLElement{constructor(){if(super(),Q(this,Wd),Q(this,Us),Q(this,Ds),Q(this,Kd),Q(this,qd),Q(this,Gd),Q(this,Qr),Q(this,$s),Q(this,zd),Q(this,ic),Q(this,Yd),Q(this,rc),Q(this,Qd),Q(this,Zd),Q(this,Un),Q(this,Xd),Q(this,Nn),Q(this,Os),Q(this,Tt,null),Q(this,ji,null),Q(this,oi,null),Q(this,xs,new Set),Q(this,Ps,void 0),Q(this,er,!1),Q(this,$n,null),Q(this,Ns,()=>{let e=q(this,xs),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}));yt(this,xs,t)}),Q(this,zr,()=>{Z(this,Qr,Hn).call(this),Z(this,$s,tc).call(this,!1)}),Q(this,Yr,()=>{Z(this,Qr,Hn).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(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),yt(this,Ps,new MutationObserver(q(this,Ns))),q(this,Ps).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[Ji.DISABLED,Ji.HIDDEN,Ji.STYLE,Ji.ANCHOR,N.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":Z(this,Wd,kp).call(this,e);break;case"invoke":Z(this,Kd,Lp).call(this,e);break;case"click":Z(this,zd,Cp).call(this,e);break;case"toggle":Z(this,Yd,Rp).call(this,e);break;case"focusout":Z(this,Qd,Pp).call(this,e);break;case"keydown":Z(this,Zd,Dp).call(this,e);break}}connectedCallback(){var e,t;yt(this,$n,Zo(this.shadowRoot,":host")),Z(this,Ds,Fd).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),yt(this,Tt,ga(this)),(t=(e=q(this,Tt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Pt(Bn(this),q(this,zr)),Pt(this,q(this,Yr))),Z(this,Us,ec).call(this)}disconnectedCallback(){var e,t;Dt(Bn(this),q(this,zr)),Dt(this,q(this,Yr)),this.disable(),(t=(e=q(this,Tt))==null?void 0:e.unassociateElement)==null||t.call(e,this),yt(this,Tt,null)}attributeChangedCallback(e,t,r){var o,n,a,l;e===Ji.HIDDEN&&r!==t?(q(this,er)||yt(this,er,!0),this.hidden?Z(this,Gd,Ip).call(this):Z(this,qd,wp).call(this),this.dispatchEvent(new Rs({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===N.MEDIA_CONTROLLER?(t&&((n=(o=q(this,Tt))==null?void 0:o.unassociateElement)==null||n.call(o,this),yt(this,Tt,null)),r&&this.isConnected&&(yt(this,Tt,ga(this)),(l=(a=q(this,Tt))==null?void 0:a.associateElement)==null||l.call(a,this))):e===Ji.DISABLED&&r!==t?r==null?this.enable():this.disable():e===Ji.STYLE&&r!==t&&Z(this,Ds,Fd).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=Oi(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(qg)}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&&Z(this,Os,Jd).call(this,t)}focus(){if(yt(this,ji,Qo()),this.items.length){Z(this,Nn,Bs).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=Z(this,Un,Hs).call(this,e);r&&(Z(this,Os,Jd).call(this,r,r.type==="checkbox"),q(this,oi)&&!this.hidden&&((t=q(this,ji))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:o}=e,n=this.items,a=(r=(t=Z(this,Un,Hs).call(this,e))!=null?t:Z(this,Xd,Op).call(this))!=null?r:n[0],l=n.indexOf(a),c=Math.max(0,l);o==="ArrowDown"?c++:o==="ArrowUp"?c--:e.key==="Home"?c=0:e.key==="End"&&(c=n.length-1),c<0&&(c=n.length-1),c>n.length-1&&(c=0),Z(this,Nn,Bs).call(this,n[c]),n[c].focus()}};Tt=new WeakMap;ji=new WeakMap;oi=new WeakMap;xs=new WeakMap;Ps=new WeakMap;er=new WeakMap;$n=new WeakMap;Wd=new WeakSet;kp=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)&&Z(this,Us,ec).call(this),e.name||q(this,Ns).call(this)};Us=new WeakSet;ec=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};Ns=new WeakMap;Ds=new WeakSet;Fd=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")};Kd=new WeakSet;Lp=function(i){yt(this,oi,i.relatedTarget),Ae(this,i.relatedTarget)||(this.hidden=!this.hidden)};qd=new WeakSet;wp=function(){var i;(i=q(this,oi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Pt(Bn(this),q(this,zr)),Pt(this,q(this,Yr))};Gd=new WeakSet;Ip=function(){var i;(i=q(this,oi))==null||i.setAttribute("aria-expanded","false"),Dt(Bn(this),q(this,zr)),Dt(this,q(this,Yr))};zr=new WeakMap;Yr=new WeakMap;Qr=new WeakSet;Hn=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=Ap({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let o=Bn(this).getBoundingClientRect(),n=o.width-e-i,a=o.height-t-this.offsetHeight,{style:l}=q(this,$n);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${a}px`);let c=getComputedStyle(this),h=l.getPropertyValue("--_menu-bottom")===c.bottom?a:parseFloat(c.bottom),v=o.height-h-parseFloat(c.marginBottom);this.style.setProperty("--_menu-max-height",`${v}px`)};$s=new WeakSet;tc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=q(this,$n);if(i||r.setProperty("--media-menu-transition-in","none"),t){let o=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${o}px`),Z(this,Qr,Hn).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Z(this,Qr,Hn).call(this);r.removeProperty("--media-menu-transition-in")};zd=new WeakSet;Cp=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(q(this,ic,Mp))){(e=q(this,ji))==null||e.focus(),this.hidden=!0;return}let t=Z(this,Un,Hs).call(this,i);!t||t.hasAttribute("disabled")||(Z(this,Nn,Bs).call(this,t),this.handleSelect(i))};ic=new WeakSet;Mp=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"]'))};Yd=new WeakSet;Rp=function(i){if(i.target===this)return;Z(this,rc,xp).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 ri({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Z(this,$s,tc).call(this,!0)};rc=new WeakSet;xp=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Qd=new WeakSet;Pp=function(i){var e;Ae(this,i.relatedTarget)||(q(this,er)&&((e=q(this,ji))==null||e.focus()),q(this,oi)&&q(this,oi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Zd=new WeakSet;Dp=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:c,metaKey:p}=i;if(!(l||c||p)&&this.keysUsed.includes(a))if(i.preventDefault(),i.stopPropagation(),a==="Tab"){if(q(this,er)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()}else a==="Escape"?((n=q(this,ji))==null||n.focus(),q(this,er)&&(this.hidden=!0)):a==="Enter"||a===" "?this.handleSelect(i):this.handleMove(i)};Un=new WeakSet;Hs=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Xd=new WeakSet;Op=function(){return this.items.find(i=>i.tabIndex===0)};Nn=new WeakSet;Bs=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};Os=new WeakSet;Jd=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,o)=>r!=t[o])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};le.shadowRootOptions={mode:"open"};le.getTemplateHTML=Kg;function qg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Bn(i){var e;return(e=i.getAttribute("bounds")?st(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",le);var dc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},St=(i,e,t)=>(dc(i,e,"read from private field"),t?t.call(i):e.get(i)),$t=(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)},oc=(i,e,t,r)=>(dc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),it=(i,e,t)=>(dc(i,e,"access private method"),t),Vs,Wn,nc,Up,Fs,cc,uc,Np,kt,Zr,Fn,ac,$p,Ws,sc;function Gg(i){return`
1836
+ `}var Ji={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},le=class extends d.HTMLElement{constructor(){if(super(),Q(this,Wd),Q(this,Us),Q(this,Ds),Q(this,Kd),Q(this,qd),Q(this,Gd),Q(this,Qr),Q(this,Hs),Q(this,zd),Q(this,ic),Q(this,Yd),Q(this,rc),Q(this,Qd),Q(this,Zd),Q(this,Un),Q(this,Xd),Q(this,Nn),Q(this,Os),Q(this,Tt,null),Q(this,ji,null),Q(this,oi,null),Q(this,xs,new Set),Q(this,Ps,void 0),Q(this,er,!1),Q(this,Hn,null),Q(this,Ns,()=>{let e=q(this,xs),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}));yt(this,xs,t)}),Q(this,zr,()=>{Z(this,Qr,$n).call(this),Z(this,Hs,tc).call(this,!1)}),Q(this,Yr,()=>{Z(this,Qr,$n).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(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),yt(this,Ps,new MutationObserver(q(this,Ns))),q(this,Ps).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[Ji.DISABLED,Ji.HIDDEN,Ji.STYLE,Ji.ANCHOR,N.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":Z(this,Wd,Lp).call(this,e);break;case"invoke":Z(this,Kd,wp).call(this,e);break;case"click":Z(this,zd,Mp).call(this,e);break;case"toggle":Z(this,Yd,xp).call(this,e);break;case"focusout":Z(this,Qd,Dp).call(this,e);break;case"keydown":Z(this,Zd,Op).call(this,e);break}}connectedCallback(){var e,t;yt(this,Hn,Zo(this.shadowRoot,":host")),Z(this,Ds,Fd).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),yt(this,Tt,ga(this)),(t=(e=q(this,Tt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Pt(Bn(this),q(this,zr)),Pt(this,q(this,Yr))),Z(this,Us,ec).call(this)}disconnectedCallback(){var e,t;Dt(Bn(this),q(this,zr)),Dt(this,q(this,Yr)),this.disable(),(t=(e=q(this,Tt))==null?void 0:e.unassociateElement)==null||t.call(e,this),yt(this,Tt,null)}attributeChangedCallback(e,t,r){var o,n,a,l;e===Ji.HIDDEN&&r!==t?(q(this,er)||yt(this,er,!0),this.hidden?Z(this,Gd,Ip).call(this):Z(this,qd,Cp).call(this),this.dispatchEvent(new Rs({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===N.MEDIA_CONTROLLER?(t&&((n=(o=q(this,Tt))==null?void 0:o.unassociateElement)==null||n.call(o,this),yt(this,Tt,null)),r&&this.isConnected&&(yt(this,Tt,ga(this)),(l=(a=q(this,Tt))==null?void 0:a.associateElement)==null||l.call(a,this))):e===Ji.DISABLED&&r!==t?r==null?this.enable():this.disable():e===Ji.STYLE&&r!==t&&Z(this,Ds,Fd).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=Oi(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(zg)}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&&Z(this,Os,Jd).call(this,t)}focus(){if(yt(this,ji,Qo()),this.items.length){Z(this,Nn,Bs).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=Z(this,Un,$s).call(this,e);r&&(Z(this,Os,Jd).call(this,r,r.type==="checkbox"),q(this,oi)&&!this.hidden&&((t=q(this,ji))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:o}=e,n=this.items,a=(r=(t=Z(this,Un,$s).call(this,e))!=null?t:Z(this,Xd,Up).call(this))!=null?r:n[0],l=n.indexOf(a),c=Math.max(0,l);o==="ArrowDown"?c++:o==="ArrowUp"?c--:e.key==="Home"?c=0:e.key==="End"&&(c=n.length-1),c<0&&(c=n.length-1),c>n.length-1&&(c=0),Z(this,Nn,Bs).call(this,n[c]),n[c].focus()}};Tt=new WeakMap;ji=new WeakMap;oi=new WeakMap;xs=new WeakMap;Ps=new WeakMap;er=new WeakMap;Hn=new WeakMap;Wd=new WeakSet;Lp=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)&&Z(this,Us,ec).call(this),e.name||q(this,Ns).call(this)};Us=new WeakSet;ec=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};Ns=new WeakMap;Ds=new WeakSet;Fd=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")};Kd=new WeakSet;wp=function(i){yt(this,oi,i.relatedTarget),Ae(this,i.relatedTarget)||(this.hidden=!this.hidden)};qd=new WeakSet;Cp=function(){var i;(i=q(this,oi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Pt(Bn(this),q(this,zr)),Pt(this,q(this,Yr))};Gd=new WeakSet;Ip=function(){var i;(i=q(this,oi))==null||i.setAttribute("aria-expanded","false"),Dt(Bn(this),q(this,zr)),Dt(this,q(this,Yr))};zr=new WeakMap;Yr=new WeakMap;Qr=new WeakSet;$n=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=Sp({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let o=Bn(this).getBoundingClientRect(),n=o.width-e-i,a=o.height-t-this.offsetHeight,{style:l}=q(this,Hn);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${a}px`);let c=getComputedStyle(this),h=l.getPropertyValue("--_menu-bottom")===c.bottom?a:parseFloat(c.bottom),v=o.height-h-parseFloat(c.marginBottom);this.style.setProperty("--_menu-max-height",`${v}px`)};Hs=new WeakSet;tc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=q(this,Hn);if(i||r.setProperty("--media-menu-transition-in","none"),t){let o=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${o}px`),Z(this,Qr,$n).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Z(this,Qr,$n).call(this);r.removeProperty("--media-menu-transition-in")};zd=new WeakSet;Mp=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(q(this,ic,Rp))){(e=q(this,ji))==null||e.focus(),this.hidden=!0;return}let t=Z(this,Un,$s).call(this,i);!t||t.hasAttribute("disabled")||(Z(this,Nn,Bs).call(this,t),this.handleSelect(i))};ic=new WeakSet;Rp=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"]'))};Yd=new WeakSet;xp=function(i){if(i.target===this)return;Z(this,rc,Pp).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 ri({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Z(this,Hs,tc).call(this,!0)};rc=new WeakSet;Pp=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Qd=new WeakSet;Dp=function(i){var e;Ae(this,i.relatedTarget)||(q(this,er)&&((e=q(this,ji))==null||e.focus()),q(this,oi)&&q(this,oi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Zd=new WeakSet;Op=function(i){var e,t,r,o,n;let{key:a,ctrlKey:l,altKey:c,metaKey:m}=i;if(!(l||c||m)&&this.keysUsed.includes(a))if(i.preventDefault(),i.stopPropagation(),a==="Tab"){if(q(this,er)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()}else a==="Escape"?((n=q(this,ji))==null||n.focus(),q(this,er)&&(this.hidden=!0)):a==="Enter"||a===" "?this.handleSelect(i):this.handleMove(i)};Un=new WeakSet;$s=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Xd=new WeakSet;Up=function(){return this.items.find(i=>i.tabIndex===0)};Nn=new WeakSet;Bs=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};Os=new WeakSet;Jd=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,o)=>r!=t[o])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};le.shadowRootOptions={mode:"open"};le.getTemplateHTML=Gg;function zg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Bn(i){var e;return(e=i.getAttribute("bounds")?st(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}d.customElements.get("media-chrome-menu")||d.customElements.define("media-chrome-menu",le);var dc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},St=(i,e,t)=>(dc(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)},oc=(i,e,t,r)=>(dc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),it=(i,e,t)=>(dc(i,e,"access private method"),t),Vs,Wn,nc,Np,Fs,cc,uc,Hp,kt,Zr,Fn,ac,$p,Ws,sc;function Yg(i){return`
1834
1837
  <style>
1835
1838
  :host {
1836
1839
  transition: var(--media-menu-item-transition,
@@ -1948,7 +1951,7 @@ bp-player[has-error] {
1948
1951
  ${this.getSuffixSlotInnerHTML(i)}
1949
1952
  </slot>
1950
1953
  <slot name="submenu"></slot>
1951
- `}function zg(i){return""}var ze={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Fe=class extends d.HTMLElement{constructor(){if(super(),$t(this,nc),$t(this,Fs),$t(this,uc),$t(this,Zr),$t(this,ac),$t(this,Ws),$t(this,Vs,!1),$t(this,Wn,void 0),$t(this,kt,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),o=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(t=o==null?void 0:o.dataset.description)!=null?t:o==null?void 0:o.text,a=ee.createElement("span");a.textContent=n??"",r.replaceChildren(a)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[ze.TYPE,ze.DISABLED,ze.CHECKED,ze.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Vn(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":it(this,nc,Up).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":it(this,ac,$p).call(this,e);break;case"keyup":it(this,Zr,Fn).call(this,e);break}}attributeChangedCallback(e,t,r){e===ze.CHECKED&&Vn(this)&&!St(this,Vs)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===ze.TYPE&&r!==t?this.role="menuitem"+r:e===ze.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(ze.DISABLED)||this.enable(),this.role="menuitem"+this.type,oc(this,Wn,lc(this,this.parentNode)),it(this,Ws,sc).call(this),this.submenuElement&&it(this,Fs,cc).call(this)}disconnectedCallback(){this.disable(),it(this,Ws,sc).call(this),oc(this,Wn,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Oi(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(ze.TYPE))!=null?e:""}set type(e){this.setAttribute(ze.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(ze.VALUE))!=null?e:this.text}set value(e){this.setAttribute(ze.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Vn(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Vn(this)&&(oc(this,Vs,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Vn(this)||this.invokeTargetElement&&Ae(this,e.target)&&this.invokeTargetElement.dispatchEvent(new ri({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};Vs=new WeakMap;Wn=new WeakMap;nc=new WeakSet;Up=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?it(this,Fs,cc).call(this):it(this,uc,Np).call(this))};Fs=new WeakSet;cc=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",St(this,kt)),this.submenuElement.addEventListener("addmenuitem",St(this,kt)),this.submenuElement.addEventListener("removemenuitem",St(this,kt)),St(this,kt).call(this)};uc=new WeakSet;Np=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",St(this,kt)),this.submenuElement.removeEventListener("addmenuitem",St(this,kt)),this.submenuElement.removeEventListener("removemenuitem",St(this,kt)),St(this,kt).call(this)};kt=new WeakMap;Zr=new WeakSet;Fn=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",it(this,Zr,Fn));return}this.handleClick(i)};ac=new WeakSet;$p=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",it(this,Zr,Fn));return}this.addEventListener("keyup",it(this,Zr,Fn),{once:!0})};Ws=new WeakSet;sc=function(){var i;let e=(i=St(this,Wn))==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")};Fe.shadowRootOptions={mode:"open"};Fe.getTemplateHTML=Gg;Fe.getSuffixSlotInnerHTML=zg;function Vn(i){return i.type==="radio"||i.type==="checkbox"}function lc(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?lc(i,t):e!=null&&e.items?e:lc(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",Fe);function Yg(i){return`
1954
+ `}function Qg(i){return""}var ze={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Fe=class extends d.HTMLElement{constructor(){if(super(),Ht(this,nc),Ht(this,Fs),Ht(this,uc),Ht(this,Zr),Ht(this,ac),Ht(this,Ws),Ht(this,Vs,!1),Ht(this,Wn,void 0),Ht(this,kt,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),o=(e=this.submenuElement.checkedItems)==null?void 0:e[0],n=(t=o==null?void 0:o.dataset.description)!=null?t:o==null?void 0:o.text,a=ee.createElement("span");a.textContent=n??"",r.replaceChildren(a)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[ze.TYPE,ze.DISABLED,ze.CHECKED,ze.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Vn(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":it(this,nc,Np).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":it(this,ac,$p).call(this,e);break;case"keyup":it(this,Zr,Fn).call(this,e);break}}attributeChangedCallback(e,t,r){e===ze.CHECKED&&Vn(this)&&!St(this,Vs)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===ze.TYPE&&r!==t?this.role="menuitem"+r:e===ze.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(ze.DISABLED)||this.enable(),this.role="menuitem"+this.type,oc(this,Wn,lc(this,this.parentNode)),it(this,Ws,sc).call(this),this.submenuElement&&it(this,Fs,cc).call(this)}disconnectedCallback(){this.disable(),it(this,Ws,sc).call(this),oc(this,Wn,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Oi(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(ze.TYPE))!=null?e:""}set type(e){this.setAttribute(ze.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(ze.VALUE))!=null?e:this.text}set value(e){this.setAttribute(ze.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(Vn(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Vn(this)&&(oc(this,Vs,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Vn(this)||this.invokeTargetElement&&Ae(this,e.target)&&this.invokeTargetElement.dispatchEvent(new ri({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};Vs=new WeakMap;Wn=new WeakMap;nc=new WeakSet;Np=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?it(this,Fs,cc).call(this):it(this,uc,Hp).call(this))};Fs=new WeakSet;cc=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",St(this,kt)),this.submenuElement.addEventListener("addmenuitem",St(this,kt)),this.submenuElement.addEventListener("removemenuitem",St(this,kt)),St(this,kt).call(this)};uc=new WeakSet;Hp=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",St(this,kt)),this.submenuElement.removeEventListener("addmenuitem",St(this,kt)),this.submenuElement.removeEventListener("removemenuitem",St(this,kt)),St(this,kt).call(this)};kt=new WeakMap;Zr=new WeakSet;Fn=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",it(this,Zr,Fn));return}this.handleClick(i)};ac=new WeakSet;$p=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",it(this,Zr,Fn));return}this.addEventListener("keyup",it(this,Zr,Fn),{once:!0})};Ws=new WeakSet;sc=function(){var i;let e=(i=St(this,Wn))==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")};Fe.shadowRootOptions={mode:"open"};Fe.getTemplateHTML=Yg;Fe.getSuffixSlotInnerHTML=Qg;function Vn(i){return i.type==="radio"||i.type==="checkbox"}function lc(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?lc(i,t):e!=null&&e.items?e:lc(e,e==null?void 0:e.parentNode)}d.customElements.get("media-chrome-menu-item")||d.customElements.define("media-chrome-menu-item",Fe);function Zg(i){return`
1952
1955
  ${le.getTemplateHTML(i)}
1953
1956
  <style>
1954
1957
  :host {
@@ -1983,7 +1986,7 @@ bp-player[has-error] {
1983
1986
  --media-settings-menu-item-opacity: 0;
1984
1987
  }
1985
1988
  </style>
1986
- `}var Kn=class extends le{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-settings-menu-button")}};Kn.getTemplateHTML=Yg;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",Kn);function Qg(i){return`
1989
+ `}var Kn=class extends le{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-settings-menu-button")}};Kn.getTemplateHTML=Zg;d.customElements.get("media-settings-menu")||d.customElements.define("media-settings-menu",Kn);function Xg(i){return`
1987
1990
  ${Fe.getTemplateHTML.call(this,i)}
1988
1991
  <style>
1989
1992
  slot:not([name="submenu"]) {
@@ -1994,11 +1997,11 @@ bp-player[has-error] {
1994
1997
  background: transparent;
1995
1998
  }
1996
1999
  </style>
1997
- `}function Zg(i){return`
2000
+ `}function Jg(i){return`
1998
2001
  <svg aria-hidden="true" viewBox="0 0 20 24">
1999
2002
  <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"/>
2000
2003
  </svg>
2001
- `}var tr=class extends Fe{};tr.shadowRootOptions={mode:"open"};tr.getTemplateHTML=Qg;tr.getSuffixSlotInnerHTML=Zg;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",tr);var De=class extends F{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Oi(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new ri({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",De);function Xg(){return`
2004
+ `}var tr=class extends Fe{};tr.shadowRootOptions={mode:"open"};tr.getTemplateHTML=Xg;tr.getSuffixSlotInnerHTML=Jg;d.customElements.get("media-settings-menu-item")||d.customElements.define("media-settings-menu-item",tr);var De=class extends F{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Oi(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new ri({relatedTarget:this}))}};d.customElements.get("media-chrome-menu-button")||d.customElements.define("media-chrome-menu-button",De);function jg(){return`
2002
2005
  <style>
2003
2006
  :host([aria-expanded="true"]) slot[name=tooltip] {
2004
2007
  display: none;
@@ -2009,27 +2012,27 @@ bp-player[has-error] {
2009
2012
  <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"/>
2010
2013
  </svg>
2011
2014
  </slot>
2012
- `}function Jg(){return E("Settings")}var Xr=class extends De{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",E("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};Xr.getSlotTemplateHTML=Xg;Xr.getTooltipContentHTML=Jg;d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",Xr);var vc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hp=(i,e,t)=>(vc(i,e,"read from private field"),t?t.call(i):e.get(i)),Ks=(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)},hc=(i,e,t,r)=>(vc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),qs=(i,e,t)=>(vc(i,e,"access private method"),t),qn,Ys,Gs,pc,zs,mc,Qs=class extends le{constructor(){super(...arguments),Ks(this,Gs),Ks(this,zs),Ks(this,qn,[]),Ks(this,Ys,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(hc(this,qn,Wu(r??"")),qs(this,Gs,pc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",qs(this,zs,mc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",qs(this,zs,mc))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Hp(this,qn)}set mediaAudioTrackList(e){hc(this,qn,e),qs(this,Gs,pc).call(this)}get mediaAudioTrackEnabled(){var e;return(e=P(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){D(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};qn=new WeakMap;Ys=new WeakMap;Gs=new WeakSet;pc=function(){if(Hp(this,Ys)===JSON.stringify(this.mediaAudioTrackList))return;hc(this,Ys,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=At({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(r)}};zs=new WeakSet;mc=function(){if(this.value==null)return;let i=new d.CustomEvent(b.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",Qs);var jg=`<svg aria-hidden="true" viewBox="0 0 24 24">
2015
+ `}function eE(){return E("Settings")}var Xr=class extends De{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",E("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};Xr.getSlotTemplateHTML=jg;Xr.getTooltipContentHTML=eE;d.customElements.get("media-settings-menu-button")||d.customElements.define("media-settings-menu-button",Xr);var vc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Bp=(i,e,t)=>(vc(i,e,"read from private field"),t?t.call(i):e.get(i)),Ks=(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)},hc=(i,e,t,r)=>(vc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),qs=(i,e,t)=>(vc(i,e,"access private method"),t),qn,Ys,Gs,pc,zs,mc,Qs=class extends le{constructor(){super(...arguments),Ks(this,Gs),Ks(this,zs),Ks(this,qn,[]),Ks(this,Ys,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(hc(this,qn,Fu(r??"")),qs(this,Gs,pc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",qs(this,zs,mc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",qs(this,zs,mc))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Bp(this,qn)}set mediaAudioTrackList(e){hc(this,qn,e),qs(this,Gs,pc).call(this)}get mediaAudioTrackEnabled(){var e;return(e=P(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){D(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};qn=new WeakMap;Ys=new WeakMap;Gs=new WeakSet;pc=function(){if(Bp(this,Ys)===JSON.stringify(this.mediaAudioTrackList))return;hc(this,Ys,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=At({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(r)}};zs=new WeakSet;mc=function(){if(this.value==null)return;let i=new d.CustomEvent(b.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-audio-track-menu")||d.customElements.define("media-audio-track-menu",Qs);var tE=`<svg aria-hidden="true" viewBox="0 0 24 24">
2013
2016
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
2014
2017
  <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"/>
2015
- </svg>`;function eE(){return`
2018
+ </svg>`;function iE(){return`
2016
2019
  <style>
2017
2020
  :host([aria-expanded="true"]) slot[name=tooltip] {
2018
2021
  display: none;
2019
2022
  }
2020
2023
  </style>
2021
- <slot name="icon">${jg}</slot>
2022
- `}function tE(){return E("Audio")}var Bp=i=>{let e=E("Audio");i.setAttribute("aria-label",e)},Jr=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Bp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LANG&&Bp(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=P(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){D(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};Jr.getSlotTemplateHTML=eE;Jr.getTooltipContentHTML=tE;d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",Jr);var bc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},iE=(i,e,t)=>(bc(i,e,"read from private field"),t?t.call(i):e.get(i)),fc=(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)},rE=(i,e,t,r)=>(bc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Zs=(i,e,t)=>(bc(i,e,"access private method"),t),js,Xs,gc,Js,Ec,oE=`
2024
+ <slot name="icon">${tE}</slot>
2025
+ `}function rE(){return E("Audio")}var Vp=i=>{let e=E("Audio");i.setAttribute("aria-label",e)},Jr=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Vp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_LANG&&Vp(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=P(this,s.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){D(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};Jr.getSlotTemplateHTML=iE;Jr.getTooltipContentHTML=rE;d.customElements.get("media-audio-track-menu-button")||d.customElements.define("media-audio-track-menu-button",Jr);var bc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oE=(i,e,t)=>(bc(i,e,"read from private field"),t?t.call(i):e.get(i)),fc=(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)},nE=(i,e,t,r)=>(bc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Zs=(i,e,t)=>(bc(i,e,"access private method"),t),js,Xs,gc,Js,Ec,aE=`
2023
2026
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
2024
2027
  <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"/>
2025
- </svg>`;function nE(i){return`
2028
+ </svg>`;function sE(i){return`
2026
2029
  ${le.getTemplateHTML(i)}
2027
- <slot name="captions-indicator" hidden>${oE}</slot>
2028
- `}var Gn=class extends le{constructor(){super(...arguments),fc(this,Xs),fc(this,Js),fc(this,js,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_LIST&&t!==r?Zs(this,Xs,gc).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",Zs(this,Xs,gc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Zs(this,Js,Ec))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Zs(this,Js,Ec))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Vp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Wp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Vp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Wp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};js=new WeakMap;Xs=new WeakSet;gc=function(){var i;let e=iE(this,js)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(s.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;rE(this,js,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,o=At({type:"radio",text:this.formatMenuItemText(E("Off")),value:"off",checked:r});o.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(o);let n=this.mediaSubtitlesList;for(let a of n){let l=At({type:"radio",text:this.formatMenuItemText(a.label,a),value:Ma(a),checked:this.value==Ma(a)});l.prepend(tt(this,"checked-indicator")),((i=a.kind)!=null?i:"subs")==="captions"&&l.append(tt(this,"captions-indicator")),this.defaultSlot.append(l)}};Js=new WeakSet;Ec=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new d.CustomEvent(b.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new d.CustomEvent(b.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};Gn.getTemplateHTML=nE;var Vp=(i,e)=>{let t=i.getAttribute(e);return t?Hi(t):[]},Wp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Ut(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",Gn);var aE=`<svg aria-hidden="true" viewBox="0 0 26 24">
2030
+ <slot name="captions-indicator" hidden>${aE}</slot>
2031
+ `}var Gn=class extends le{constructor(){super(...arguments),fc(this,Xs),fc(this,Js),fc(this,js,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_LIST&&t!==r?Zs(this,Xs,gc).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",Zs(this,Xs,gc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Zs(this,Js,Ec))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Zs(this,Js,Ec))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Wp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Fp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Wp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Fp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};js=new WeakMap;Xs=new WeakSet;gc=function(){var i;let e=oE(this,js)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(s.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;nE(this,js,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,o=At({type:"radio",text:this.formatMenuItemText(E("Off")),value:"off",checked:r});o.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(o);let n=this.mediaSubtitlesList;for(let a of n){let l=At({type:"radio",text:this.formatMenuItemText(a.label,a),value:Ma(a),checked:this.value==Ma(a)});l.prepend(tt(this,"checked-indicator")),((i=a.kind)!=null?i:"subs")==="captions"&&l.append(tt(this,"captions-indicator")),this.defaultSlot.append(l)}};Js=new WeakSet;Ec=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new d.CustomEvent(b.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new d.CustomEvent(b.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};Gn.getTemplateHTML=sE;var Wp=(i,e)=>{let t=i.getAttribute(e);return t?$i(t):[]},Fp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Ut(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-menu")||d.customElements.define("media-captions-menu",Gn);var lE=`<svg aria-hidden="true" viewBox="0 0 26 24">
2029
2032
  <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"/>
2030
- </svg>`,sE=`<svg aria-hidden="true" viewBox="0 0 26 24">
2033
+ </svg>`,dE=`<svg aria-hidden="true" viewBox="0 0 26 24">
2031
2034
  <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"/>
2032
- </svg>`;function lE(){return`
2035
+ </svg>`;function cE(){return`
2033
2036
  <style>
2034
2037
  :host([data-captions-enabled="true"]) slot[name=off] {
2035
2038
  display: none !important;
@@ -2046,10 +2049,10 @@ bp-player[has-error] {
2046
2049
  </style>
2047
2050
 
2048
2051
  <slot name="icon">
2049
- <slot name="on">${aE}</slot>
2050
- <slot name="off">${sE}</slot>
2052
+ <slot name="on">${lE}</slot>
2053
+ <slot name="off">${dE}</slot>
2051
2054
  </slot>
2052
- `}function dE(){return E("Captions")}var Fp=i=>{i.setAttribute("data-captions-enabled",Ra(i).toString())},Kp=i=>{i.setAttribute("aria-label",E("closed captions"))},jr=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING,s.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),Kp(this),Fp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING?Fp(this):e===s.MEDIA_LANG&&Kp(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return qp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Gp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return qp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Gp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};jr.getSlotTemplateHTML=lE;jr.getTooltipContentHTML=dE;var qp=(i,e)=>{let t=i.getAttribute(e);return t?Hi(t):[]},Gp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Ut(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",jr);var zp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},to=(i,e,t)=>(zp(i,e,"read from private field"),t?t.call(i):e.get(i)),_c=(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)},eo=(i,e,t)=>(zp(i,e,"access private method"),t),ni,io,zn,el,Tc,yc={RATES:"rates"},tl=class extends le{constructor(){super(),_c(this,io),_c(this,el),_c(this,ni,new Zt(this,yc.RATES,{defaultValue:Ld})),eo(this,io,zn).call(this)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,yc.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,eo(this,io,zn).call(this)):e===yc.RATES&&t!=r&&(to(this,ni).value=r,eo(this,io,zn).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",eo(this,el,Tc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",eo(this,el,Tc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return to(this,ni)}set rates(e){e?Array.isArray(e)?to(this,ni).value=e.join(" "):typeof e=="string"&&(to(this,ni).value=e):to(this,ni).value="",eo(this,io,zn).call(this)}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,Yi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};ni=new WeakMap;io=new WeakSet;zn=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(to(this,ni)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,o)=>r-o);for(let r of t){let o=At({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});o.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(o)}};el=new WeakSet;Tc=function(){if(!this.value)return;let i=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",tl);var il=1;function cE(i){return`
2055
+ `}function uE(){return E("Captions")}var Kp=i=>{i.setAttribute("data-captions-enabled",Ra(i).toString())},qp=i=>{i.setAttribute("aria-label",E("closed captions"))},jr=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING,s.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),qp(this),Kp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_SUBTITLES_SHOWING?Kp(this):e===s.MEDIA_LANG&&qp(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=X(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Gp(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){zp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Gp(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){zp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};jr.getSlotTemplateHTML=cE;jr.getTooltipContentHTML=uE;var Gp=(i,e)=>{let t=i.getAttribute(e);return t?$i(t):[]},zp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Ut(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};d.customElements.get("media-captions-menu-button")||d.customElements.define("media-captions-menu-button",jr);var Yp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},to=(i,e,t)=>(Yp(i,e,"read from private field"),t?t.call(i):e.get(i)),_c=(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)},eo=(i,e,t)=>(Yp(i,e,"access private method"),t),ni,io,zn,el,Tc,yc={RATES:"rates"},tl=class extends le{constructor(){super(),_c(this,io),_c(this,el),_c(this,ni,new Zt(this,yc.RATES,{defaultValue:Ld})),eo(this,io,zn).call(this)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,yc.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,eo(this,io,zn).call(this)):e===yc.RATES&&t!=r&&(to(this,ni).value=r,eo(this,io,zn).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",eo(this,el,Tc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",eo(this,el,Tc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return to(this,ni)}set rates(e){e?Array.isArray(e)?to(this,ni).value=e.join(" "):typeof e=="string"&&(to(this,ni).value=e):to(this,ni).value="",eo(this,io,zn).call(this)}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,Yi)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};ni=new WeakMap;io=new WeakSet;zn=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(to(this,ni)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,o)=>r-o);for(let r of t){let o=At({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});o.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(o)}};el=new WeakSet;Tc=function(){if(!this.value)return;let i=new d.CustomEvent(b.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-playback-rate-menu")||d.customElements.define("media-playback-rate-menu",tl);var il=1;function hE(i){return`
2053
2056
  <style>
2054
2057
  :host {
2055
2058
  min-width: 5ch;
@@ -2065,16 +2068,16 @@ bp-player[has-error] {
2065
2068
  }
2066
2069
  </style>
2067
2070
  <slot name="icon">${i.mediaplaybackrate||il}x</slot>
2068
- `}function uE(){return E("Playback rate")}var ro=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:il}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?il:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",E("Playback rate {playbackRate}",{playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return $(this,s.MEDIA_PLAYBACK_RATE,il)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};ro.getSlotTemplateHTML=cE;ro.getTooltipContentHTML=uE;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",ro);var Sc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yn=(i,e,t)=>(Sc(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)},Yp=(i,e,t,r)=>(Sc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),oo=(i,e,t)=>(Sc(i,e,"access private method"),t),Qn,ao,no,Zn,ol,Ac,nl=class extends le{constructor(){super(...arguments),rl(this,no),rl(this,ol),rl(this,Qn,[]),rl(this,ao,{})}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.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 o=e.bitrate/1e6,n=`${o.toFixed(o<1?1:0)} Mbps`;return`${r} (${n})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,o;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((o=e.bitrate)!=null?o:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",oo(this,no,Zn).call(this)):e===s.MEDIA_RENDITION_LIST&&t!==r?(Yp(this,Qn,Bu(r)),oo(this,no,Zn).call(this)):e===s.MEDIA_HEIGHT&&t!==r&&oo(this,no,Zn).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",oo(this,ol,Ac))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",oo(this,ol,Ac))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return Yn(this,Qn)}set mediaRenditionList(e){Yp(this,Qn,e),oo(this,no,Zn).call(this)}get mediaRenditionSelected(){return P(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){D(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return $(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.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)}};Qn=new WeakMap;ao=new WeakMap;no=new WeakSet;Zn=function(){if(Yn(this,ao).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&Yn(this,ao).mediaHeight===this.mediaHeight)return;Yn(this,ao).mediaRenditionList=JSON.stringify(this.mediaRenditionList),Yn(this,ao).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(a=>a.id===this.mediaRenditionSelected);for(let a of i)a.selected=a===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let a of i){let l=this.formatRendition(a,{showBitrate:this.showRenditionBitrate(a)}),c=At({type:"radio",text:l,value:`${a.id}`,checked:a.selected&&!t});c.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(c)}let r=e&&this.showRenditionBitrate(e),o=t?e?this.formatMenuItemText(`${E("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${E("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(E("Auto")),n=At({type:"radio",text:o,value:"auto",checked:t});n.dataset.description=o,n.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(n)};ol=new WeakSet;Ac=function(){if(this.value==null)return;let i=new d.CustomEvent(b.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",nl);var hE=`<svg aria-hidden="true" viewBox="0 0 24 24">
2071
+ `}function pE(){return E("Playback rate")}var ro=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:il}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===s.MEDIA_PLAYBACK_RATE){let o=r?+r:Number.NaN,n=Number.isNaN(o)?il:o;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",E("Playback rate {playbackRate}",{playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return H(this,s.MEDIA_PLAYBACK_RATE,il)}set mediaPlaybackRate(e){B(this,s.MEDIA_PLAYBACK_RATE,e)}};ro.getSlotTemplateHTML=hE;ro.getTooltipContentHTML=pE;d.customElements.get("media-playback-rate-menu-button")||d.customElements.define("media-playback-rate-menu-button",ro);var Sc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yn=(i,e,t)=>(Sc(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)},Qp=(i,e,t,r)=>(Sc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),oo=(i,e,t)=>(Sc(i,e,"access private method"),t),Qn,ao,no,Zn,ol,Ac,nl=class extends le{constructor(){super(...arguments),rl(this,no),rl(this,ol),rl(this,Qn,[]),rl(this,ao,{})}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.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 o=e.bitrate/1e6,n=`${o.toFixed(o<1?1:0)} Mbps`;return`${r} (${n})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,o;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((o=e.bitrate)!=null?o:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===s.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",oo(this,no,Zn).call(this)):e===s.MEDIA_RENDITION_LIST&&t!==r?(Qp(this,Qn,Vu(r)),oo(this,no,Zn).call(this)):e===s.MEDIA_HEIGHT&&t!==r&&oo(this,no,Zn).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",oo(this,ol,Ac))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",oo(this,ol,Ac))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return Yn(this,Qn)}set mediaRenditionList(e){Qp(this,Qn,e),oo(this,no,Zn).call(this)}get mediaRenditionSelected(){return P(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){D(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return H(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.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)}};Qn=new WeakMap;ao=new WeakMap;no=new WeakSet;Zn=function(){if(Yn(this,ao).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&Yn(this,ao).mediaHeight===this.mediaHeight)return;Yn(this,ao).mediaRenditionList=JSON.stringify(this.mediaRenditionList),Yn(this,ao).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(a=>a.id===this.mediaRenditionSelected);for(let a of i)a.selected=a===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let a of i){let l=this.formatRendition(a,{showBitrate:this.showRenditionBitrate(a)}),c=At({type:"radio",text:l,value:`${a.id}`,checked:a.selected&&!t});c.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(c)}let r=e&&this.showRenditionBitrate(e),o=t?e?this.formatMenuItemText(`${E("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${E("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(E("Auto")),n=At({type:"radio",text:o,value:"auto",checked:t});n.dataset.description=o,n.prepend(tt(this,"checked-indicator")),this.defaultSlot.append(n)};ol=new WeakSet;Ac=function(){if(this.value==null)return;let i=new d.CustomEvent(b.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};d.customElements.get("media-rendition-menu")||d.customElements.define("media-rendition-menu",nl);var mE=`<svg aria-hidden="true" viewBox="0 0 24 24">
2069
2072
  <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" />
2070
- </svg>`;function pE(){return`
2073
+ </svg>`;function vE(){return`
2071
2074
  <style>
2072
2075
  :host([aria-expanded="true"]) slot[name=tooltip] {
2073
2076
  display: none;
2074
2077
  }
2075
2078
  </style>
2076
- <slot name="icon">${hE}</slot>
2077
- `}function mE(){return E("Quality")}var so=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",E("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return P(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){D(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return $(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.MEDIA_HEIGHT,e)}};so.getSlotTemplateHTML=pE;so.getTooltipContentHTML=mE;d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",so);var wc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wt=(i,e,t)=>(wc(i,e,"read from private field"),t?t.call(i):e.get(i)),Lt=(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)},Qp=(i,e,t,r)=>(wc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ye=(i,e,t)=>(wc(i,e,"access private method"),t),co,Xn,ul,ir,lo,Ic,Zp,al,kc,sl,Lc,Xp,dl,cl,ll;function vE(i){return`
2079
+ <slot name="icon">${mE}</slot>
2080
+ `}function fE(){return E("Quality")}var so=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE,s.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",E("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return P(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){D(this,s.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return H(this,s.MEDIA_HEIGHT)}set mediaHeight(e){B(this,s.MEDIA_HEIGHT,e)}};so.getSlotTemplateHTML=vE;so.getTooltipContentHTML=fE;d.customElements.get("media-rendition-menu-button")||d.customElements.define("media-rendition-menu-button",so);var wc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wt=(i,e,t)=>(wc(i,e,"read from private field"),t?t.call(i):e.get(i)),Lt=(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)},Zp=(i,e,t,r)=>(wc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ye=(i,e,t)=>(wc(i,e,"access private method"),t),co,Xn,ul,ir,lo,Cc,Xp,al,kc,sl,Lc,Jp,dl,cl,ll;function gE(i){return`
2078
2081
  ${le.getTemplateHTML(i)}
2079
2082
  <style>
2080
2083
  :host {
@@ -2088,7 +2091,7 @@ bp-player[has-error] {
2088
2091
  overflow: hidden;
2089
2092
  }
2090
2093
  </style>
2091
- `}var Jn=class extends le{constructor(){super(),Lt(this,Xn),Lt(this,ir),Lt(this,Ic),Lt(this,al),Lt(this,Lc),Lt(this,co,!1),Lt(this,sl,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",o=Ye(this,al,kc).call(this,t);(r||o)&&(wt(this,co)?Ye(this,ir,lo).call(this):Ye(this,Lc,Xp).call(this,e))}),Lt(this,dl,e=>{let t=e.target,r=this.contains(t),o=e.button===2,n=(t==null?void 0:t.nodeName)==="VIDEO",a=Ye(this,al,kc).call(this,t);r||o&&(n||a)||Ye(this,ir,lo).call(this)}),Lt(this,cl,e=>{e.key==="Escape"&&Ye(this,ir,lo).call(this)}),Lt(this,ll,e=>{var t,r;let o=e.target;if((t=o.matches)!=null&&t.call(o,'button[invoke="copy"]')){let n=(r=o.closest("media-context-menu-item"))==null?void 0:r.querySelector('input[slot="copy"]');n&&navigator.clipboard.writeText(n.value)}Ye(this,ir,lo).call(this)}),this.setAttribute("noautohide",""),Ye(this,Xn,ul).call(this)}connectedCallback(){super.connectedCallback(),X(this).addEventListener("contextmenu",wt(this,sl)),this.addEventListener("click",wt(this,ll))}disconnectedCallback(){super.disconnectedCallback(),X(this).removeEventListener("contextmenu",wt(this,sl)),this.removeEventListener("click",wt(this,ll)),document.removeEventListener("mousedown",wt(this,dl)),document.removeEventListener("keydown",wt(this,cl))}};co=new WeakMap;Xn=new WeakSet;ul=function(){this.hidden=!wt(this,co)};ir=new WeakSet;lo=function(){Qp(this,co,!1),Ye(this,Xn,ul).call(this)};Ic=new WeakSet;Zp=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&Ye(t=e,ir,lo).call(t)})};al=new WeakSet;kc=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};sl=new WeakMap;Lc=new WeakSet;Xp=function(i){i.preventDefault(),Ye(this,Ic,Zp).call(this),Qp(this,co,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,Ye(this,Xn,ul).call(this),document.addEventListener("mousedown",wt(this,dl),{once:!0}),document.addEventListener("keydown",wt(this,cl),{once:!0})};dl=new WeakMap;cl=new WeakMap;ll=new WeakMap;Jn.getTemplateHTML=vE;d.customElements.get("media-context-menu")||d.customElements.define("media-context-menu",Jn);function fE(i){return`
2094
+ `}var Jn=class extends le{constructor(){super(),Lt(this,Xn),Lt(this,ir),Lt(this,Cc),Lt(this,al),Lt(this,Lc),Lt(this,co,!1),Lt(this,sl,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",o=Ye(this,al,kc).call(this,t);(r||o)&&(wt(this,co)?Ye(this,ir,lo).call(this):Ye(this,Lc,Jp).call(this,e))}),Lt(this,dl,e=>{let t=e.target,r=this.contains(t),o=e.button===2,n=(t==null?void 0:t.nodeName)==="VIDEO",a=Ye(this,al,kc).call(this,t);r||o&&(n||a)||Ye(this,ir,lo).call(this)}),Lt(this,cl,e=>{e.key==="Escape"&&Ye(this,ir,lo).call(this)}),Lt(this,ll,e=>{var t,r;let o=e.target;if((t=o.matches)!=null&&t.call(o,'button[invoke="copy"]')){let n=(r=o.closest("media-context-menu-item"))==null?void 0:r.querySelector('input[slot="copy"]');n&&navigator.clipboard.writeText(n.value)}Ye(this,ir,lo).call(this)}),this.setAttribute("noautohide",""),Ye(this,Xn,ul).call(this)}connectedCallback(){super.connectedCallback(),X(this).addEventListener("contextmenu",wt(this,sl)),this.addEventListener("click",wt(this,ll))}disconnectedCallback(){super.disconnectedCallback(),X(this).removeEventListener("contextmenu",wt(this,sl)),this.removeEventListener("click",wt(this,ll)),document.removeEventListener("mousedown",wt(this,dl)),document.removeEventListener("keydown",wt(this,cl))}};co=new WeakMap;Xn=new WeakSet;ul=function(){this.hidden=!wt(this,co)};ir=new WeakSet;lo=function(){Zp(this,co,!1),Ye(this,Xn,ul).call(this)};Cc=new WeakSet;Xp=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&Ye(t=e,ir,lo).call(t)})};al=new WeakSet;kc=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};sl=new WeakMap;Lc=new WeakSet;Jp=function(i){i.preventDefault(),Ye(this,Cc,Xp).call(this),Zp(this,co,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,Ye(this,Xn,ul).call(this),document.addEventListener("mousedown",wt(this,dl),{once:!0}),document.addEventListener("keydown",wt(this,cl),{once:!0})};dl=new WeakMap;cl=new WeakMap;ll=new WeakMap;Jn.getTemplateHTML=gE;d.customElements.get("media-context-menu")||d.customElements.define("media-context-menu",Jn);function EE(i){return`
2092
2095
  ${Fe.getTemplateHTML.call(this,i)}
2093
2096
  <style>
2094
2097
  ::slotted(*) {
@@ -2101,16 +2104,16 @@ bp-player[has-error] {
2101
2104
  min-height: var(--media-control-height, 24px);
2102
2105
  }
2103
2106
  </style>
2104
- `}var uo=class extends Fe{};uo.shadowRootOptions={mode:"open"};uo.getTemplateHTML=fE;d.customElements.get("media-context-menu-item")||d.customElements.define("media-context-menu-item",uo);var gE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2107
+ `}var uo=class extends Fe{};uo.shadowRootOptions={mode:"open"};uo.getTemplateHTML=EE;d.customElements.get("media-context-menu-item")||d.customElements.define("media-context-menu-item",uo);var bE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2105
2108
  <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"/>
2106
- </svg>`,EE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2109
+ </svg>`,_E=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2107
2110
  <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"/>
2108
- </svg>`,bE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2111
+ </svg>`,yE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2109
2112
  <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"/>
2110
2113
  <line x1="2" y1="2" x2="22" y2="22" stroke="currentColor" stroke-width="2"/>
2111
- </svg>`,_E=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2114
+ </svg>`,TE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2112
2115
  <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"/>
2113
- </svg>`;function yE(i){switch(i){case"offline":return EE;case"network":return bE;case"security":return _E;default:return gE}}function TE(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 Ht=class extends Ie{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=yE(t),o=TE(t);return He`
2116
+ </svg>`;function AE(i){switch(i){case"offline":return _E;case"network":return yE;case"security":return TE;default:return bE}}function SE(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 $t=class extends Ce{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=AE(t),o=SE(t);return $e`
2114
2117
  <div part="icon">
2115
2118
  <slot name="icon">${this.renderIcon(r)}</slot>
2116
2119
  </div>
@@ -2120,12 +2123,12 @@ bp-player[has-error] {
2120
2123
  <p part="message">
2121
2124
  <slot name="message">${this.error.message}</slot>
2122
2125
  </p>
2123
- ${this.showCode?He`
2126
+ ${this.showCode?$e`
2124
2127
  <span part="code">
2125
2128
  <slot name="code">Error ${this.error.code}</slot>
2126
2129
  </span>
2127
2130
  `:null}
2128
- `}renderIcon(t){let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Ht.styles=Po`
2131
+ `}renderIcon(t){let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};$t.styles=Po`
2129
2132
  :host {
2130
2133
  display: flex;
2131
2134
  flex-direction: column;
@@ -2175,19 +2178,19 @@ bp-player[has-error] {
2175
2178
  opacity: var(--bp-error-code-opacity, 0.5);
2176
2179
  font-family: var(--bp-error-code-font-family, monospace);
2177
2180
  }
2178
- `,x([V({type:Object})],Ht.prototype,"error",2),x([V({type:Boolean})],Ht.prototype,"showCode",2),Ht=x([Gt("bp-error-display")],Ht);var AE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2181
+ `,x([V({type:Object})],$t.prototype,"error",2),x([V({type:Boolean})],$t.prototype,"showCode",2),$t=x([Gt("bp-error-display")],$t);var kE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2179
2182
  <circle cx="12" cy="12" r="10" stroke-opacity="0.25"/>
2180
2183
  <path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round">
2181
2184
  <animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/>
2182
2185
  </path>
2183
- </svg>`,SE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2186
+ </svg>`,LE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2184
2187
  <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"/>
2185
2188
  <circle cx="12" cy="12" r="3" fill="currentColor"/>
2186
- </svg>`,kE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2189
+ </svg>`,wE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2187
2190
  <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"/>
2188
- </svg>`,LE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2191
+ </svg>`,CE=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2189
2192
  <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"/>
2190
- </svg>`,It=class extends Ie{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return AE;case"offline":return SE;case"ended":return this.live?kE:LE;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 He`
2193
+ </svg>`,Ct=class extends Ce{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return kE;case"offline":return LE;case"ended":return this.live?wE:CE;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 $e`
2191
2194
  <div part="icon">
2192
2195
  <slot name="icon">${this.renderIcon(t)}</slot>
2193
2196
  </div>
@@ -2197,7 +2200,7 @@ bp-player[has-error] {
2197
2200
  <p part="submessage">
2198
2201
  <slot name="submessage"></slot>
2199
2202
  </p>
2200
- `}renderIcon(t){if(!t)return null;let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};It.styles=Po`
2203
+ `}renderIcon(t){if(!t)return null;let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Ct.styles=Po`
2201
2204
  :host {
2202
2205
  display: flex;
2203
2206
  flex-direction: column;
@@ -2268,7 +2271,7 @@ bp-player[has-error] {
2268
2271
  :host([button-mode]) [part="submessage"] {
2269
2272
  display: none;
2270
2273
  }
2271
- `,x([V({type:String,reflect:!0})],It.prototype,"type",2),x([V({type:Boolean,reflect:!0})],It.prototype,"live",2),x([V({type:Boolean,reflect:!0,attribute:"button-mode"})],It.prototype,"buttonMode",2),It=x([Gt("bp-overlay")],It);var Jp=`/**
2274
+ `,x([V({type:String,reflect:!0})],Ct.prototype,"type",2),x([V({type:Boolean,reflect:!0})],Ct.prototype,"live",2),x([V({type:Boolean,reflect:!0,attribute:"button-mode"})],Ct.prototype,"buttonMode",2),Ct=x([Gt("bp-overlay")],Ct);var jp=`/**
2272
2275
  * BP Default UI Styles
2273
2276
  *
2274
2277
  * All values use CSS custom properties for easy theming.
@@ -2298,7 +2301,7 @@ bp-default-ui[fluid] {
2298
2301
  width: auto;
2299
2302
  height: 100%;
2300
2303
  max-width: 100%;
2301
- aspect-ratio: var(--bp-aspect-ratio, 16 / 9);
2304
+ aspect-ratio: var(--bp-video-width, 16) / var(--bp-video-height, 9);
2302
2305
  }
2303
2306
 
2304
2307
  bp-default-ui[hidden] {
@@ -2661,7 +2664,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2661
2664
  outline: 2px solid rgba(0, 255, 0, 1) !important;
2662
2665
  background: rgba(0, 255, 0, 0.3) !important;
2663
2666
  }
2664
- `;var jp=!1;function IE(){if(jp)return;gr();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=Jp,document.head.appendChild(i),jp=!0}var z=class extends Ie{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._overlayType="none";this._connectionState="idle";this._hasError=!1;this._hasCustomTopChrome=!1;this._hasCustomCenteredChrome=!1;this._hasCustomBottomChrome=!1;this._cleanupListeners=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),IE(),this.detectMobile(),this._detectCustomChrome()}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}_detectCustomChrome(){this._hasCustomTopChrome=this.querySelector(':scope > [slot="top-chrome"]')!==null,this._hasCustomCenteredChrome=this.querySelector(':scope > [slot="centered-chrome"]')!==null,this._hasCustomBottomChrome=this.querySelector(':scope > [slot="bottom-chrome"]')!==null}detectMobile(){let t=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.mobile=t}firstUpdated(t){super.firstUpdated(t),this.setupPlayer(),this._moveSlottedContent(),this.fluid&&this._setInitialAspectRatioFromSources()}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug),t.has("sources")&&this.fluid&&this._setInitialAspectRatioFromSources()}_setInitialAspectRatioFromSources(){if(this.sources){for(let t of this.sources)if(Mi(t)&&t.preferredOrientation){let r=t.preferredOrientation==="portrait"?"9 / 16":"16 / 9";this.style.setProperty("--bp-aspect-ratio",r),this.debug&&console.log("[BPDefaultUI] Set initial --bp-aspect-ratio from preferredOrientation:",r);break}}}_moveSlottedContent(){let t=this.querySelector("media-controller");if(!t)return;let r=[{from:"top-chrome",to:"top-chrome"},{from:"centered-chrome",to:"centered-chrome"},{from:"bottom-chrome",to:null}];for(let{from:o,to:n}of r)this.querySelectorAll(`:scope > [slot="${o}"]`).forEach(l=>{l.parentElement!==t&&(n?l.setAttribute("slot",n):l.removeAttribute("slot"),t.appendChild(l))})}setupPlayer(){let t=this.querySelector("bp-player");t&&t.addEventListener("ready",r=>{this._player=r.detail,this._providerType=t.providerType,this.live=this._player.state.streamType==="live",this.setupPlayerListeners(),this.dispatchEvent(new CustomEvent("ready",{detail:this._player,bubbles:!0,composed:!0})),this.requestUpdate()})}setupPlayerListeners(){if(!this._player)return;let t=()=>{var v;let h=((v=this._player)==null?void 0:v.state.error)??null;this._error=h,this._hasError=h!==null&&h.category!=="offline",(h==null?void 0:h.category)==="offline"&&(this._overlayType="offline")},r=()=>{var v;let h=(v=this._player)==null?void 0:v.state;h&&(this._connectionState=h.connectionState,this.live=h.streamType==="live",this.setAttribute("content-type",h.contentType),this.setAttribute("stream-type",h.streamType),Te(this,"paused",h.paused),Te(this,"ended",h.ended),Te(this,"waiting",h.waiting),Te(this,"has-error",this._hasError),h.connectionState==="connecting"?(this._overlayType="loading",this._error=null,this._hasError=!1):h.connectionState==="connected"&&h.playing?(this._overlayType="none",this._error=null,this._hasError=!1):h.ended&&(this._overlayType="ended"))},o=()=>{this._error=null,this._overlayType="none",this._hasError=!1},n=()=>{this._overlayType="loading"},a=()=>{this._overlayType="ended"},l=h=>{if(this.debug&&console.log("[BPDefaultUI] updateAspectRatio called",{fluid:this.fluid,...h}),this.fluid&&h.videoWidth>0&&h.videoHeight>0){let v=`${h.videoWidth} / ${h.videoHeight}`;this.style.setProperty("--bp-aspect-ratio",v),this.debug&&console.log("[BPDefaultUI] Set --bp-aspect-ratio:",v)}};this._player.addEventListener("error",t),this._player.addEventListener("statechange",r),this._player.addEventListener("playing",o),this._player.addEventListener("waiting",n),this._player.addEventListener("ended",a),this._player.addEventListener("resize",l),this._player.addEventListener("loadedmetadata",l);let{videoWidth:c,videoHeight:p}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:c,videoHeight:p,fluid:this.fluid}),c>0&&p>0&&l({videoWidth:c,videoHeight:p}),this._cleanupListeners.push(()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("error",t)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("statechange",r)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("playing",o)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("waiting",n)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("ended",a)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("resize",l)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?He`
2667
+ `;var em={fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{console.warn("[bp-default-ui] Failed to parse JSON attribute:",i);return}},toAttribute:i=>i==null?null:JSON.stringify(i)},tm=!1;function ME(){if(tm)return;gr();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=jp,document.head.appendChild(i),tm=!0}var z=class extends Ce{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._overlayType="none";this._connectionState="idle";this._hasError=!1;this._hasCustomTopChrome=!1;this._hasCustomCenteredChrome=!1;this._hasCustomBottomChrome=!1;this._cleanupListeners=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),ME(),this.detectMobile(),this._detectCustomChrome()}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}_detectCustomChrome(){this._hasCustomTopChrome=this.querySelector(':scope > [slot="top-chrome"]')!==null,this._hasCustomCenteredChrome=this.querySelector(':scope > [slot="centered-chrome"]')!==null,this._hasCustomBottomChrome=this.querySelector(':scope > [slot="bottom-chrome"]')!==null}detectMobile(){let t=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.mobile=t}firstUpdated(t){super.firstUpdated(t),this.setupPlayer(),this._moveSlottedContent(),this.fluid&&this._setInitialVideoDimensionsFromSources()}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug),t.has("source")&&this.fluid&&this._setInitialVideoDimensionsFromSources()}_setInitialVideoDimensionsFromSources(){var r;let t=(r=this.source)==null?void 0:r.sources;if(t){for(let o of t)if(Mi(o)&&o.preferredOrientation){o.preferredOrientation==="portrait"?(this.style.setProperty("--bp-video-width","9"),this.style.setProperty("--bp-video-height","16")):(this.style.setProperty("--bp-video-width","16"),this.style.setProperty("--bp-video-height","9")),this.debug&&console.log("[BPDefaultUI] Set initial video dimensions from preferredOrientation:",o.preferredOrientation);break}}}_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"},{from:"centered-chrome",to:"centered-chrome"},{from:"bottom-chrome",to:null}];for(let{from:o,to:n}of r)this.querySelectorAll(`:scope > [slot="${o}"]`).forEach(l=>{l.parentElement!==t&&(n?l.setAttribute("slot",n):l.removeAttribute("slot"),t.appendChild(l))})}setupPlayer(){let t=this.querySelector("bp-player");t&&t.addEventListener("ready",r=>{this._player=r.detail,this._providerType=t.providerType,this.live=this._player.state.streamType==="live",this.setupPlayerListeners(),this.dispatchEvent(new CustomEvent("ready",{detail:this._player,bubbles:!0,composed:!0})),this.requestUpdate()})}setupPlayerListeners(){if(!this._player)return;let t=()=>{var v;let h=((v=this._player)==null?void 0:v.state.error)??null;this._error=h,this._hasError=h!==null&&h.category!=="offline",(h==null?void 0:h.category)==="offline"&&(this._overlayType="offline")},r=()=>{var v;let h=(v=this._player)==null?void 0:v.state;h&&(this._connectionState=h.connectionState,this.live=h.streamType==="live",this.setAttribute("content-type",h.contentType),this.setAttribute("stream-type",h.streamType),Te(this,"paused",h.paused),Te(this,"ended",h.ended),Te(this,"waiting",h.waiting),Te(this,"has-error",this._hasError),h.connectionState==="connecting"?(this._overlayType="loading",this._error=null,this._hasError=!1):h.connectionState==="connected"&&h.playing?(this._overlayType="none",this._error=null,this._hasError=!1):h.ended&&(this._overlayType="ended"))},o=()=>{this._error=null,this._overlayType="none",this._hasError=!1},n=()=>{this._overlayType="loading"},a=()=>{this._overlayType="ended"},l=h=>{this.debug&&console.log("[BPDefaultUI] updateVideoDimensions called",{fluid:this.fluid,...h}),this.fluid&&(this._updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPDefaultUI] Set video dimensions:",{width:h.videoWidth,height:h.videoHeight}))};this._player.addEventListener("error",t),this._player.addEventListener("statechange",r),this._player.addEventListener("playing",o),this._player.addEventListener("waiting",n),this._player.addEventListener("ended",a),this._player.addEventListener("resize",l),this._player.addEventListener("loadedmetadata",l);let{videoWidth:c,videoHeight:m}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:c,videoHeight:m,fluid:this.fluid}),c>0&&m>0&&l({videoWidth:c,videoHeight:m}),this._cleanupListeners.push(()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("error",t)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("statechange",r)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("playing",o)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("waiting",n)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("ended",a)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("resize",l)},()=>{var h;return(h=this._player)==null?void 0:h.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?$e`
2665
2668
  <media-control-bar>
2666
2669
  <media-play-button notooltip clip-hidden></media-play-button>
2667
2670
  <media-live-button notooltip vod-hidden clip-hidden></media-live-button>
@@ -2671,7 +2674,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2671
2674
  <media-rendition-menu-button notooltip clip-hidden></media-rendition-menu-button>
2672
2675
  <media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
2673
2676
  </media-control-bar>
2674
- `:He`
2677
+ `:$e`
2675
2678
  <media-control-bar>
2676
2679
  <media-play-button notooltip clip-hidden></media-play-button>
2677
2680
  <media-live-button notooltip vod-hidden clip-hidden></media-live-button>
@@ -2687,11 +2690,11 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2687
2690
  <media-pip-button notooltip clip-hidden></media-pip-button>
2688
2691
  <media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
2689
2692
  </media-control-bar>
2690
- `}render(){return He`
2693
+ `}render(){return $e`
2691
2694
  <media-controller autohide="${this.autohide}" ?hotkeys="${this.hotkeys}">
2692
2695
  <bp-player
2693
2696
  slot="media"
2694
- .sources="${this.sources}"
2697
+ .source="${this.source}"
2695
2698
  ?autoplay="${this.autoplay}"
2696
2699
  ?muted="${this.muted}"
2697
2700
  ?loop="${this.loop}"
@@ -2717,7 +2720,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2717
2720
  </div>
2718
2721
 
2719
2722
  <!-- Center play button (default centered chrome, hidden if user provides custom) -->
2720
- ${this._hasCustomCenteredChrome?ae:He`<media-play-button class="bp-center-play" slot="centered-chrome" notooltip></media-play-button>`}
2723
+ ${this._hasCustomCenteredChrome?ae:$e`<media-play-button class="bp-center-play" slot="centered-chrome" notooltip></media-play-button>`}
2721
2724
 
2722
2725
  <!-- Error overlay -->
2723
2726
  <div class="bp-error-overlay" ?hidden="${!this._hasError}">
@@ -2727,7 +2730,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2727
2730
  <!-- Default controls (only if no custom bottom-chrome) -->
2728
2731
  ${this._hasCustomBottomChrome?ae:this.renderDefaultControls()}
2729
2732
  </media-controller>
2730
- `}};x([V({type:Array})],z.prototype,"sources",2),x([V({type:Boolean})],z.prototype,"autoplay",2),x([V({type:Boolean})],z.prototype,"muted",2),x([V({type:Boolean})],z.prototype,"loop",2),x([V({type:String})],z.prototype,"poster",2),x([V({type:String})],z.prototype,"scaling",2),x([V({type:String,attribute:"aspect-ratio"})],z.prototype,"aspectRatio",2),x([V({type:Object})],z.prototype,"config",2),x([V({type:Boolean})],z.prototype,"debug",2),x([V({type:Number})],z.prototype,"autohide",2),x([V({type:Boolean})],z.prototype,"hotkeys",2),x([V({type:Boolean,reflect:!0})],z.prototype,"mobile",2),x([V({type:Boolean,reflect:!0})],z.prototype,"live",2),x([V({type:Boolean,reflect:!0})],z.prototype,"fluid",2),x([Ce()],z.prototype,"_player",2),x([Ce()],z.prototype,"_providerType",2),x([Ce()],z.prototype,"_error",2),x([Ce()],z.prototype,"_overlayType",2),x([Ce()],z.prototype,"_connectionState",2),x([Ce()],z.prototype,"_hasError",2),x([Ce()],z.prototype,"_hasCustomTopChrome",2),x([Ce()],z.prototype,"_hasCustomCenteredChrome",2),x([Ce()],z.prototype,"_hasCustomBottomChrome",2),z=x([Gt("bp-default-ui")],z);var CE=["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"],em=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function ME(i){return`
2733
+ `}};x([V({converter:em})],z.prototype,"source",2),x([V({type:Boolean})],z.prototype,"autoplay",2),x([V({type:Boolean})],z.prototype,"muted",2),x([V({type:Boolean})],z.prototype,"loop",2),x([V({type:String})],z.prototype,"poster",2),x([V({type:String})],z.prototype,"scaling",2),x([V({type:String,attribute:"aspect-ratio"})],z.prototype,"aspectRatio",2),x([V({converter:em})],z.prototype,"config",2),x([V({type:Boolean})],z.prototype,"debug",2),x([V({type:Number})],z.prototype,"autohide",2),x([V({type:Boolean})],z.prototype,"hotkeys",2),x([V({type:Boolean,reflect:!0})],z.prototype,"mobile",2),x([V({type:Boolean,reflect:!0})],z.prototype,"live",2),x([V({type:Boolean,reflect:!0})],z.prototype,"fluid",2),x([Ie()],z.prototype,"_player",2),x([Ie()],z.prototype,"_providerType",2),x([Ie()],z.prototype,"_error",2),x([Ie()],z.prototype,"_overlayType",2),x([Ie()],z.prototype,"_connectionState",2),x([Ie()],z.prototype,"_hasError",2),x([Ie()],z.prototype,"_hasCustomTopChrome",2),x([Ie()],z.prototype,"_hasCustomCenteredChrome",2),x([Ie()],z.prototype,"_hasCustomBottomChrome",2),z=x([Gt("bp-default-ui")],z);var RE=["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"],im=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function xE(i){return`
2731
2734
  <style>
2732
2735
  :host {
2733
2736
  display: inline-flex;
@@ -2741,10 +2744,10 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2741
2744
  }
2742
2745
  </style>
2743
2746
  <slot name="media">
2744
- <audio${am(i)}></audio>
2747
+ <audio${lm(i)}></audio>
2745
2748
  </slot>
2746
2749
  <slot></slot>
2747
- `}function RE(i){return`
2750
+ `}function PE(i){return`
2748
2751
  <style>
2749
2752
  :host {
2750
2753
  display: inline-block;
@@ -2766,25 +2769,25 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2766
2769
  }
2767
2770
  </style>
2768
2771
  <slot name="media">
2769
- <video${am(i)}></video>
2772
+ <video${lm(i)}></video>
2770
2773
  </slot>
2771
2774
  <slot></slot>
2772
- `}function nm(i,{tag:e,is:t}){var n,a,l,c,p,tm,v,g,m,A,f,rr,Cc,im,Mc,rm,om;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),o=r?xE(r):[];return l=class extends i{constructor(){super(...arguments);S(this,f);S(this,v,!1);S(this,g,null);S(this,m,new Map);S(this,A);H(this,"get");H(this,"set");H(this,"call")}static get observedAttributes(){var K,ne;return U(K=l,p,tm).call(K),[...((ne=r==null?void 0:r.constructor)==null?void 0:ne.observedAttributes)??[],...em]}get nativeEl(){var k;return U(this,f,rr).call(this),u(this,g)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((k=this.shadowRoot)==null?void 0:k.querySelector(e))??null}set nativeEl(k){_(this,g,k)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(k){this.toggleAttribute("muted",k)}get src(){return this.getAttribute("src")}set src(k){this.setAttribute("src",`${k}`)}get preload(){var k;return this.getAttribute("preload")??((k=this.nativeEl)==null?void 0:k.preload)}set preload(k){this.setAttribute("preload",`${k}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let k=PE(this.attributes);t&&(k.is=t),e&&(k.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(k)}this.nativeEl.muted=this.hasAttribute("muted");for(let k of o)U(this,f,rm).call(this,k);_(this,A,new MutationObserver(U(this,f,im).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>U(this,f,Cc).call(this)),U(this,f,Cc).call(this);for(let k of this.constructor.Events)this.shadowRoot.addEventListener(k,this,!0)}handleEvent(k){k.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(k.type,{detail:k.detail}))}attributeChangedCallback(k,K,ne){U(this,f,rr).call(this),U(this,f,om).call(this,k,K,ne)}connectedCallback(){U(this,f,rr).call(this)}},c=new WeakMap,p=new WeakSet,tm=function(){if(u(this,c))return;_(this,c,!0);let k=new Set(this.observedAttributes);k.delete("muted");for(let K of o)if(!(K in this.prototype))if(typeof r[K]=="function")this.prototype[K]=function(...ne){return U(this,f,rr).call(this),(()=>{var pe;if(this.call)return this.call(K,...ne);let G=(pe=this.nativeEl)==null?void 0:pe[K];return G==null?void 0:G.apply(this.nativeEl,ne)})()};else{let ne={get(){var G,pe;U(this,f,rr).call(this);let te=K.toLowerCase();if(k.has(te)){let Rt=this.getAttribute(te);return Rt===null?!1:Rt===""?!0:Rt}return((G=this.get)==null?void 0:G.call(this,K))??((pe=this.nativeEl)==null?void 0:pe[K])}};K!==K.toUpperCase()&&(ne.set=function(te){U(this,f,rr).call(this);let G=K.toLowerCase();if(k.has(G)){te===!0||te===!1||te==null?this.toggleAttribute(G,!!te):this.setAttribute(G,te);return}if(this.set){this.set(K,te);return}this.nativeEl&&(this.nativeEl[K]=te)}),Object.defineProperty(this.prototype,K,ne)}},v=new WeakMap,g=new WeakMap,m=new WeakMap,A=new WeakMap,f=new WeakSet,rr=function(){u(this,v)||(_(this,v,!0),this.init())},Cc=function(){var te;let k=new Map(u(this,m)),K=(te=this.shadowRoot)==null?void 0:te.querySelector("slot:not([name])");(K==null?void 0:K.assignedElements({flatten:!0}).filter(G=>["track","source"].includes(G.localName))).forEach(G=>{var Rt,Mo;k.delete(G);let pe=u(this,m).get(G);pe||(pe=G.cloneNode(),u(this,m).set(G,pe),(Rt=u(this,A))==null||Rt.observe(G,{attributes:!0})),(Mo=this.nativeEl)==null||Mo.append(pe),U(this,f,Mc).call(this,pe)}),k.forEach((G,pe)=>{G.remove(),u(this,m).delete(pe)})},im=function(k){for(let K of k)if(K.type==="attributes"){let{target:ne,attributeName:te}=K,G=u(this,m).get(ne);G&&te&&(G.setAttribute(te,ne.getAttribute(te)??""),U(this,f,Mc).call(this,G))}},Mc=function(k){k&&k.localName==="track"&&k.default&&(k.kind==="chapters"||k.kind==="metadata")&&k.track.mode==="disabled"&&(k.track.mode="hidden")},rm=function(k){if(Object.prototype.hasOwnProperty.call(this,k)){let K=this[k];delete this[k],this[k]=K}},om=function(k,K,ne){var te,G,pe;["id","class"].includes(k)||!l.observedAttributes.includes(k)&&this.constructor.observedAttributes.includes(k)||(ne===null?(te=this.nativeEl)==null||te.removeAttribute(k):((G=this.nativeEl)==null?void 0:G.getAttribute(k))!==ne&&((pe=this.nativeEl)==null||pe.setAttribute(k,ne)))},S(l,p),H(l,"getTemplateHTML",e.endsWith("audio")?ME:RE),H(l,"shadowRootOptions",{mode:"open"}),H(l,"Events",CE),S(l,c,!1),l}function xE(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 am(i){let e="";for(let t in i){if(!em.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function PE(i){let e={};for(let t of i)e[t.name]=t.value;return e}var Oe=nm(globalThis.HTMLElement??class{},{tag:"video"}),iw=nm(globalThis.HTMLElement??class{},{tag:"audio"});var Bt=class extends Event{constructor(t,r){super(t);H(this,"track");this.track=r.track}};var Rc=new WeakMap;function T(i){return Rc.get(i)??DE(i,{})}function DE(i,e){let t=Rc.get(i);return t||Rc.set(i,t={}),Object.assign(t,e)}function hl(i,e){let t=i.videoTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in nr.prototype||Object.defineProperty(nr.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Bt("addtrack",{track:e}))})}function pl(i){var r;let e=(r=T(i).media)==null?void 0:r.videoTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Bt("removetrack",{track:i}))})}function sm(i){let e=T(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(T(e).changeRequested)return;T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var ai,si,li,or,jn,nr=class extends EventTarget{constructor(){super();S(this,or);S(this,ai);S(this,si);S(this,li);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,or,jn).values()}get length(){return u(this,or,jn).size}getTrackById(t){return[...u(this,or,jn)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,or,jn)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,ai)}set onaddtrack(t){u(this,ai)&&(this.removeEventListener("addtrack",u(this,ai)),_(this,ai,void 0)),typeof t=="function"&&(_(this,ai,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,si)}set onremovetrack(t){u(this,si)&&(this.removeEventListener("removetrack",u(this,si)),_(this,si,void 0)),typeof t=="function"&&(_(this,si,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,li)}set onchange(t){u(this,li)&&(this.removeEventListener("change",u(this,li)),_(this,li,void 0)),typeof t=="function"&&(_(this,li,t),this.addEventListener("change",t))}};ai=new WeakMap,si=new WeakMap,li=new WeakMap,or=new WeakSet,jn=function(){return T(this).trackSet};var Vt=class extends Event{constructor(t,r){super(t);H(this,"rendition");this.rendition=r.rendition}};function lm(i,e){let t=T(i).media.videoRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in ar.prototype||Object.defineProperty(ar.prototype,o,{get(){return ho(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Vt("addrendition",{rendition:e}))})}function dm(i){let e=T(i).media.videoRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.selected&&e.dispatchEvent(new Vt("removerendition",{rendition:i}))})}function cm(i){let e=T(i).media.videoRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function ho(i){return[...T(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...T(t).renditionSet])}var di,ci,ui,ar=class extends EventTarget{constructor(){super(...arguments);S(this,di);S(this,ci);S(this,ui)}[Symbol.iterator](){return ho(this).values()}get length(){return ho(this).length}getRenditionById(t){return ho(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return ho(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of ho(this).entries())o.selected=r===t}get onaddrendition(){return u(this,di)}set onaddrendition(t){u(this,di)&&(this.removeEventListener("addrendition",u(this,di)),_(this,di,void 0)),typeof t=="function"&&(_(this,di,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,ci)}set onremoverendition(t){u(this,ci)&&(this.removeEventListener("removerendition",u(this,ci)),_(this,ci,void 0)),typeof t=="function"&&(_(this,ci,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,ui)}set onchange(t){u(this,ui)&&(this.removeEventListener("change",u(this,ui)),_(this,ui,void 0)),typeof t=="function"&&(_(this,ui,t),this.addEventListener("change",t))}};di=new WeakMap,ci=new WeakMap,ui=new WeakMap;var po,ea=class{constructor(){H(this,"src");H(this,"id");H(this,"width");H(this,"height");H(this,"bitrate");H(this,"frameRate");H(this,"codec");S(this,po,!1)}get selected(){return u(this,po)}set selected(e){u(this,po)!==e&&(_(this,po,e),cm(this))}};po=new WeakMap;var mo,vo=class{constructor(){H(this,"id");H(this,"kind");H(this,"label","");H(this,"language","");H(this,"sourceBuffer");S(this,mo,!1)}addRendition(e,t,r,o,n,a){let l=new ea;return l.src=e,l.width=t,l.height=r,l.frameRate=a,l.bitrate=n,l.codec=o,lm(this,l),l}removeRendition(e){dm(e)}get selected(){return u(this,mo)}set selected(e){u(this,mo)!==e&&(_(this,mo,e),e===!0&&sm(this))}};mo=new WeakMap;function um(i,e){let t=T(i).media.audioRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in sr.prototype||Object.defineProperty(sr.prototype,o,{get(){return fo(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Vt("addrendition",{rendition:e}))})}function hm(i){let e=T(i).media.audioRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.enabled&&e.dispatchEvent(new Vt("removerendition",{rendition:i}))})}function pm(i){let e=T(i).media.audioRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function fo(i){return[...T(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...T(t).renditionSet])}var hi,pi,mi,sr=class extends EventTarget{constructor(){super(...arguments);S(this,hi);S(this,pi);S(this,mi)}[Symbol.iterator](){return fo(this).values()}get length(){return fo(this).length}getRenditionById(t){return fo(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return fo(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of fo(this).entries())o.selected=r===t}get onaddrendition(){return u(this,hi)}set onaddrendition(t){u(this,hi)&&(this.removeEventListener("addrendition",u(this,hi)),_(this,hi,void 0)),typeof t=="function"&&(_(this,hi,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,pi)}set onremoverendition(t){u(this,pi)&&(this.removeEventListener("removerendition",u(this,pi)),_(this,pi,void 0)),typeof t=="function"&&(_(this,pi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,mi)}set onchange(t){u(this,mi)&&(this.removeEventListener("change",u(this,mi)),_(this,mi,void 0)),typeof t=="function"&&(_(this,mi,t),this.addEventListener("change",t))}};hi=new WeakMap,pi=new WeakMap,mi=new WeakMap;var go,ta=class{constructor(){H(this,"src");H(this,"id");H(this,"bitrate");H(this,"codec");S(this,go,!1)}get selected(){return u(this,go)}set selected(e){u(this,go)!==e&&(_(this,go,e),pm(this))}};go=new WeakMap;function vl(i,e){let t=i.audioTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in lr.prototype||Object.defineProperty(lr.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Bt("addtrack",{track:e}))})}function fl(i){var r;let e=(r=T(i).media)==null?void 0:r.audioTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Bt("removetrack",{track:i}))})}function mm(i){let e=T(i).media.audioTracks;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vi,fi,gi,Eo,ml,lr=class extends EventTarget{constructor(){super();S(this,Eo);S(this,vi);S(this,fi);S(this,gi);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,Eo,ml).values()}get length(){return u(this,Eo,ml).size}getTrackById(t){return[...u(this,Eo,ml)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,vi)}set onaddtrack(t){u(this,vi)&&(this.removeEventListener("addtrack",u(this,vi)),_(this,vi,void 0)),typeof t=="function"&&(_(this,vi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,fi)}set onremovetrack(t){u(this,fi)&&(this.removeEventListener("removetrack",u(this,fi)),_(this,fi,void 0)),typeof t=="function"&&(_(this,fi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,gi)}set onchange(t){u(this,gi)&&(this.removeEventListener("change",u(this,gi)),_(this,gi,void 0)),typeof t=="function"&&(_(this,gi,t),this.addEventListener("change",t))}};vi=new WeakMap,fi=new WeakMap,gi=new WeakMap,Eo=new WeakSet,ml=function(){return T(this).trackSet};var bo,_o=class{constructor(){H(this,"id");H(this,"kind");H(this,"label","");H(this,"language","");H(this,"sourceBuffer");S(this,bo,!1)}addRendition(e,t,r){let o=new ta;return o.src=e,o.codec=t,o.bitrate=r,um(this,o),o}removeRendition(e){hm(e)}get enabled(){return u(this,bo)}set enabled(e){u(this,bo)!==e&&(_(this,bo,e),mm(this))}};bo=new WeakMap;var vm=gl(globalThis.HTMLMediaElement,"video"),fm=gl(globalThis.HTMLMediaElement,"audio");function yo(i){if(!(i!=null&&i.prototype))return i;let e=gl(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return OE(this)}});let t=gl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return UE(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",l=""){let c=new vo;return c.kind=n,c.label=a,c.language=l,hl(this,c),c}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=pl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",l=""){let c=new _o;return c.kind=n,c.label=a,c.language=l,vl(this,c),c}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=fl),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=T(n).videoRenditions;return a||(a=new ar,T(a).media=n,T(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return o(this)}});let o=n=>{let a=T(n).audioRenditions;return a||(a=new sr,T(a).media=n,T(n).audioRenditions=a),a};return i}function gl(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function OE(i){let e=T(i).videoTracks;if(!e&&(e=new nr,T(i).videoTracks=e,vm)){let t=vm.call(i.nativeEl??i);for(let r of t)hl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof vo)){for(let o of t)pl(o);return}hl(i,r.track)}),t.addEventListener("removetrack",r=>{pl(r.track)})}return e}function UE(i){let e=T(i).audioTracks;if(!e&&(e=new lr,T(i).audioTracks=e,fm)){let t=fm.call(i.nativeEl??i);for(let r of t)vl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof _o)){for(let o of t)fl(o);return}vl(i,r.track)}),t.addEventListener("removetrack",r=>{fl(r.track)})}return e}var Se=Vm(au("hls.js"),1);var NE=yo(Oe),Wt,Ei,To,rt,gm,Em,xc,ia,bm,bi=class extends NE{constructor(){super();S(this,rt);S(this,Wt,null);S(this,Ei,null);S(this,To,!1);this.api=null;S(this,ia,()=>{var r,o;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(o=this.api)==null||o.startLoad()});U(this,rt,bm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
2775
+ `}function sm(i,{tag:e,is:t}){var n,a,l,c,m,rm,v,g,p,A,f,rr,Ic,om,Mc,nm,am;let r=(a=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:a.call(n,e,{is:t}),o=r?DE(r):[];return l=class extends i{constructor(){super(...arguments);S(this,f);S(this,v,!1);S(this,g,null);S(this,p,new Map);S(this,A);$(this,"get");$(this,"set");$(this,"call")}static get observedAttributes(){var K,ne;return U(K=l,m,rm).call(K),[...((ne=r==null?void 0:r.constructor)==null?void 0:ne.observedAttributes)??[],...im]}get nativeEl(){var k;return U(this,f,rr).call(this),u(this,g)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((k=this.shadowRoot)==null?void 0:k.querySelector(e))??null}set nativeEl(k){_(this,g,k)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(k){this.toggleAttribute("muted",k)}get src(){return this.getAttribute("src")}set src(k){this.setAttribute("src",`${k}`)}get preload(){var k;return this.getAttribute("preload")??((k=this.nativeEl)==null?void 0:k.preload)}set preload(k){this.setAttribute("preload",`${k}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let k=OE(this.attributes);t&&(k.is=t),e&&(k.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(k)}this.nativeEl.muted=this.hasAttribute("muted");for(let k of o)U(this,f,nm).call(this,k);_(this,A,new MutationObserver(U(this,f,om).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>U(this,f,Ic).call(this)),U(this,f,Ic).call(this);for(let k of this.constructor.Events)this.shadowRoot.addEventListener(k,this,!0)}handleEvent(k){k.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(k.type,{detail:k.detail}))}attributeChangedCallback(k,K,ne){U(this,f,rr).call(this),U(this,f,am).call(this,k,K,ne)}connectedCallback(){U(this,f,rr).call(this)}},c=new WeakMap,m=new WeakSet,rm=function(){if(u(this,c))return;_(this,c,!0);let k=new Set(this.observedAttributes);k.delete("muted");for(let K of o)if(!(K in this.prototype))if(typeof r[K]=="function")this.prototype[K]=function(...ne){return U(this,f,rr).call(this),(()=>{var pe;if(this.call)return this.call(K,...ne);let G=(pe=this.nativeEl)==null?void 0:pe[K];return G==null?void 0:G.apply(this.nativeEl,ne)})()};else{let ne={get(){var G,pe;U(this,f,rr).call(this);let te=K.toLowerCase();if(k.has(te)){let Rt=this.getAttribute(te);return Rt===null?!1:Rt===""?!0:Rt}return((G=this.get)==null?void 0:G.call(this,K))??((pe=this.nativeEl)==null?void 0:pe[K])}};K!==K.toUpperCase()&&(ne.set=function(te){U(this,f,rr).call(this);let G=K.toLowerCase();if(k.has(G)){te===!0||te===!1||te==null?this.toggleAttribute(G,!!te):this.setAttribute(G,te);return}if(this.set){this.set(K,te);return}this.nativeEl&&(this.nativeEl[K]=te)}),Object.defineProperty(this.prototype,K,ne)}},v=new WeakMap,g=new WeakMap,p=new WeakMap,A=new WeakMap,f=new WeakSet,rr=function(){u(this,v)||(_(this,v,!0),this.init())},Ic=function(){var te;let k=new Map(u(this,p)),K=(te=this.shadowRoot)==null?void 0:te.querySelector("slot:not([name])");(K==null?void 0:K.assignedElements({flatten:!0}).filter(G=>["track","source"].includes(G.localName))).forEach(G=>{var Rt,Mo;k.delete(G);let pe=u(this,p).get(G);pe||(pe=G.cloneNode(),u(this,p).set(G,pe),(Rt=u(this,A))==null||Rt.observe(G,{attributes:!0})),(Mo=this.nativeEl)==null||Mo.append(pe),U(this,f,Mc).call(this,pe)}),k.forEach((G,pe)=>{G.remove(),u(this,p).delete(pe)})},om=function(k){for(let K of k)if(K.type==="attributes"){let{target:ne,attributeName:te}=K,G=u(this,p).get(ne);G&&te&&(G.setAttribute(te,ne.getAttribute(te)??""),U(this,f,Mc).call(this,G))}},Mc=function(k){k&&k.localName==="track"&&k.default&&(k.kind==="chapters"||k.kind==="metadata")&&k.track.mode==="disabled"&&(k.track.mode="hidden")},nm=function(k){if(Object.prototype.hasOwnProperty.call(this,k)){let K=this[k];delete this[k],this[k]=K}},am=function(k,K,ne){var te,G,pe;["id","class"].includes(k)||!l.observedAttributes.includes(k)&&this.constructor.observedAttributes.includes(k)||(ne===null?(te=this.nativeEl)==null||te.removeAttribute(k):((G=this.nativeEl)==null?void 0:G.getAttribute(k))!==ne&&((pe=this.nativeEl)==null||pe.setAttribute(k,ne)))},S(l,m),$(l,"getTemplateHTML",e.endsWith("audio")?xE:PE),$(l,"shadowRootOptions",{mode:"open"}),$(l,"Events",RE),S(l,c,!1),l}function DE(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 lm(i){let e="";for(let t in i){if(!im.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function OE(i){let e={};for(let t of i)e[t.name]=t.value;return e}var Oe=sm(globalThis.HTMLElement??class{},{tag:"video"}),ow=sm(globalThis.HTMLElement??class{},{tag:"audio"});var Bt=class extends Event{constructor(t,r){super(t);$(this,"track");this.track=r.track}};var Rc=new WeakMap;function T(i){return Rc.get(i)??UE(i,{})}function UE(i,e){let t=Rc.get(i);return t||Rc.set(i,t={}),Object.assign(t,e)}function hl(i,e){let t=i.videoTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in nr.prototype||Object.defineProperty(nr.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Bt("addtrack",{track:e}))})}function pl(i){var r;let e=(r=T(i).media)==null?void 0:r.videoTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Bt("removetrack",{track:i}))})}function dm(i){let e=T(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(T(e).changeRequested)return;T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var ai,si,li,or,jn,nr=class extends EventTarget{constructor(){super();S(this,or);S(this,ai);S(this,si);S(this,li);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,or,jn).values()}get length(){return u(this,or,jn).size}getTrackById(t){return[...u(this,or,jn)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,or,jn)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,ai)}set onaddtrack(t){u(this,ai)&&(this.removeEventListener("addtrack",u(this,ai)),_(this,ai,void 0)),typeof t=="function"&&(_(this,ai,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,si)}set onremovetrack(t){u(this,si)&&(this.removeEventListener("removetrack",u(this,si)),_(this,si,void 0)),typeof t=="function"&&(_(this,si,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,li)}set onchange(t){u(this,li)&&(this.removeEventListener("change",u(this,li)),_(this,li,void 0)),typeof t=="function"&&(_(this,li,t),this.addEventListener("change",t))}};ai=new WeakMap,si=new WeakMap,li=new WeakMap,or=new WeakSet,jn=function(){return T(this).trackSet};var Vt=class extends Event{constructor(t,r){super(t);$(this,"rendition");this.rendition=r.rendition}};function cm(i,e){let t=T(i).media.videoRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in ar.prototype||Object.defineProperty(ar.prototype,o,{get(){return ho(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Vt("addrendition",{rendition:e}))})}function um(i){let e=T(i).media.videoRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.selected&&e.dispatchEvent(new Vt("removerendition",{rendition:i}))})}function hm(i){let e=T(i).media.videoRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function ho(i){return[...T(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...T(t).renditionSet])}var di,ci,ui,ar=class extends EventTarget{constructor(){super(...arguments);S(this,di);S(this,ci);S(this,ui)}[Symbol.iterator](){return ho(this).values()}get length(){return ho(this).length}getRenditionById(t){return ho(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return ho(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of ho(this).entries())o.selected=r===t}get onaddrendition(){return u(this,di)}set onaddrendition(t){u(this,di)&&(this.removeEventListener("addrendition",u(this,di)),_(this,di,void 0)),typeof t=="function"&&(_(this,di,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,ci)}set onremoverendition(t){u(this,ci)&&(this.removeEventListener("removerendition",u(this,ci)),_(this,ci,void 0)),typeof t=="function"&&(_(this,ci,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,ui)}set onchange(t){u(this,ui)&&(this.removeEventListener("change",u(this,ui)),_(this,ui,void 0)),typeof t=="function"&&(_(this,ui,t),this.addEventListener("change",t))}};di=new WeakMap,ci=new WeakMap,ui=new WeakMap;var po,ea=class{constructor(){$(this,"src");$(this,"id");$(this,"width");$(this,"height");$(this,"bitrate");$(this,"frameRate");$(this,"codec");S(this,po,!1)}get selected(){return u(this,po)}set selected(e){u(this,po)!==e&&(_(this,po,e),hm(this))}};po=new WeakMap;var mo,vo=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");S(this,mo,!1)}addRendition(e,t,r,o,n,a){let l=new ea;return l.src=e,l.width=t,l.height=r,l.frameRate=a,l.bitrate=n,l.codec=o,cm(this,l),l}removeRendition(e){um(e)}get selected(){return u(this,mo)}set selected(e){u(this,mo)!==e&&(_(this,mo,e),e===!0&&dm(this))}};mo=new WeakMap;function pm(i,e){let t=T(i).media.audioRenditions;T(e).media=T(i).media,T(e).track=i;let r=T(i).renditionSet;r.add(e);let o=r.size-1;o in sr.prototype||Object.defineProperty(sr.prototype,o,{get(){return fo(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Vt("addrendition",{rendition:e}))})}function mm(i){let e=T(i).media.audioRenditions,t=T(i).track;T(t).renditionSet.delete(i),queueMicrotask(()=>{T(i).track.enabled&&e.dispatchEvent(new Vt("removerendition",{rendition:i}))})}function vm(i){let e=T(i).media.audioRenditions;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,T(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function fo(i){return[...T(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...T(t).renditionSet])}var hi,pi,mi,sr=class extends EventTarget{constructor(){super(...arguments);S(this,hi);S(this,pi);S(this,mi)}[Symbol.iterator](){return fo(this).values()}get length(){return fo(this).length}getRenditionById(t){return fo(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return fo(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of fo(this).entries())o.selected=r===t}get onaddrendition(){return u(this,hi)}set onaddrendition(t){u(this,hi)&&(this.removeEventListener("addrendition",u(this,hi)),_(this,hi,void 0)),typeof t=="function"&&(_(this,hi,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,pi)}set onremoverendition(t){u(this,pi)&&(this.removeEventListener("removerendition",u(this,pi)),_(this,pi,void 0)),typeof t=="function"&&(_(this,pi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,mi)}set onchange(t){u(this,mi)&&(this.removeEventListener("change",u(this,mi)),_(this,mi,void 0)),typeof t=="function"&&(_(this,mi,t),this.addEventListener("change",t))}};hi=new WeakMap,pi=new WeakMap,mi=new WeakMap;var go,ta=class{constructor(){$(this,"src");$(this,"id");$(this,"bitrate");$(this,"codec");S(this,go,!1)}get selected(){return u(this,go)}set selected(e){u(this,go)!==e&&(_(this,go,e),vm(this))}};go=new WeakMap;function vl(i,e){let t=i.audioTracks;T(e).media=i,T(e).renditionSet||(T(e).renditionSet=new Set);let r=T(t).trackSet;r.add(e);let o=r.size-1;o in lr.prototype||Object.defineProperty(lr.prototype,o,{get(){return[...T(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new Bt("addtrack",{track:e}))})}function fl(i){var r;let e=(r=T(i).media)==null?void 0:r.audioTracks;if(!e)return;T(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Bt("removetrack",{track:i}))})}function fm(i){let e=T(i).media.audioTracks;!e||T(e).changeRequested||(T(e).changeRequested=!0,queueMicrotask(()=>{delete T(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vi,fi,gi,Eo,ml,lr=class extends EventTarget{constructor(){super();S(this,Eo);S(this,vi);S(this,fi);S(this,gi);T(this).trackSet=new Set}[Symbol.iterator](){return u(this,Eo,ml).values()}get length(){return u(this,Eo,ml).size}getTrackById(t){return[...u(this,Eo,ml)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,vi)}set onaddtrack(t){u(this,vi)&&(this.removeEventListener("addtrack",u(this,vi)),_(this,vi,void 0)),typeof t=="function"&&(_(this,vi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,fi)}set onremovetrack(t){u(this,fi)&&(this.removeEventListener("removetrack",u(this,fi)),_(this,fi,void 0)),typeof t=="function"&&(_(this,fi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,gi)}set onchange(t){u(this,gi)&&(this.removeEventListener("change",u(this,gi)),_(this,gi,void 0)),typeof t=="function"&&(_(this,gi,t),this.addEventListener("change",t))}};vi=new WeakMap,fi=new WeakMap,gi=new WeakMap,Eo=new WeakSet,ml=function(){return T(this).trackSet};var bo,_o=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");S(this,bo,!1)}addRendition(e,t,r){let o=new ta;return o.src=e,o.codec=t,o.bitrate=r,pm(this,o),o}removeRendition(e){mm(e)}get enabled(){return u(this,bo)}set enabled(e){u(this,bo)!==e&&(_(this,bo,e),fm(this))}};bo=new WeakMap;var gm=gl(globalThis.HTMLMediaElement,"video"),Em=gl(globalThis.HTMLMediaElement,"audio");function yo(i){if(!(i!=null&&i.prototype))return i;let e=gl(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return NE(this)}});let t=gl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return HE(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",l=""){let c=new vo;return c.kind=n,c.label=a,c.language=l,hl(this,c),c}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=pl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",l=""){let c=new _o;return c.kind=n,c.label=a,c.language=l,vl(this,c),c}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=fl),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=T(n).videoRenditions;return a||(a=new ar,T(a).media=n,T(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return o(this)}});let o=n=>{let a=T(n).audioRenditions;return a||(a=new sr,T(a).media=n,T(n).audioRenditions=a),a};return i}function gl(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function NE(i){let e=T(i).videoTracks;if(!e&&(e=new nr,T(i).videoTracks=e,gm)){let t=gm.call(i.nativeEl??i);for(let r of t)hl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof vo)){for(let o of t)pl(o);return}hl(i,r.track)}),t.addEventListener("removetrack",r=>{pl(r.track)})}return e}function HE(i){let e=T(i).audioTracks;if(!e&&(e=new lr,T(i).audioTracks=e,Em)){let t=Em.call(i.nativeEl??i);for(let r of t)vl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof _o)){for(let o of t)fl(o);return}vl(i,r.track)}),t.addEventListener("removetrack",r=>{fl(r.track)})}return e}var Se=Fm(au("hls.js"),1);var $E=yo(Oe),Wt,Ei,To,rt,bm,_m,xc,ia,ym,bi=class extends $E{constructor(){super();S(this,rt);S(this,Wt,null);S(this,Ei,null);S(this,To,!1);this.api=null;S(this,ia,()=>{var r,o;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(o=this.api)==null||o.startLoad()});U(this,rt,ym).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
2773
2776
  <script type="application/json" id="config">
2774
2777
  ${JSON.stringify(r.config||{})}
2775
2778
  <\/script>
2776
2779
  ${Oe.getTemplateHTML(n)}
2777
- `}get config(){return u(this,Ei)}set config(t){_(this,Ei,t)}attributeChangedCallback(t,r,o){t!=="src"&&super.attributeChangedCallback(t,r,o),t==="src"&&r!==o&&this.load()}async load(){var o,n,a;let t=!this.api&&!u(this,To);if(U(this,rt,gm).call(this),!this.src)return;if(t&&!u(this,Ei)&&_(this,Ei,JSON.parse(((n=(o=this.shadowRoot)==null?void 0:o.getElementById("config"))==null?void 0:n.textContent)||"{}")),!U(this,rt,Em).call(this,this.src)){await Promise.resolve(),_(this,To,!0),this.nativeEl.src=this.src;return}if(Se.default.isSupported()){switch(await Promise.resolve(),this.api=new Se.default({liveDurationInfinity:!0,autoStartLoad:!1,...u(this,Ei)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let v=()=>{var g;return(g=this.api)==null?void 0:g.startLoad()};this.nativeEl.addEventListener("play",v,{once:!0}),this.api.on(Se.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",v)});break}case"metadata":{let v=this.api.config.maxBufferLength,g=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let m=()=>{this.api&&(this.api.config.maxBufferLength=v,this.api.config.maxBufferSize=g)};this.nativeEl.addEventListener("play",m,{once:!0}),this.api.on(Se.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",m)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,ia)),_(this,Wt,document.createElement("source")),u(this,Wt).setAttribute("type","application/x-mpegURL"),u(this,Wt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,Wt));let c=new WeakMap;this.api.on(Se.default.Events.MANIFEST_PARSED,(v,g)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(A=>{console.warn("Autoplay failed:",A)}),U(this,rt,xc).call(this);let m=this.videoTracks.getTrackById("main");m||(m=this.addVideoTrack("main"),m.id="main",m.selected=!0);for(let[A,f]of g.levels.entries()){let R=m.addRendition(f.url[0],f.width,f.height,f.videoCodec??void 0,f.bitrate);c.set(f,`${A}`),R.id=`${A}`}for(let[A,f]of g.audioTracks.entries()){let R=f.default?"main":"alternative",O=this.addAudioTrack(R,f.name,f.lang);O.id=`${A}`,f.default&&(O.enabled=!0)}}),this.audioTracks.addEventListener("change",()=>{var A,f;let v=[...this.audioTracks].find(R=>R.enabled),g=v?+v.id:void 0,m=((A=this.api)==null?void 0:A.audioTracks.map(R=>R.id))??[];g!==void 0&&g!==((f=this.api)==null?void 0:f.audioTrack)&&m.includes(g)&&this.api&&(this.api.audioTrack=g)}),this.api.on(Se.default.Events.LEVELS_UPDATED,(v,g)=>{let m=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!m)return;let A=g.levels.map(f=>c.get(f));for(let f of this.videoRenditions)f.id&&!A.includes(f.id)&&m.removeRendition(f)});let p=null;this.api.on(Se.default.Events.ERROR,(v,g)=>{var m;g.type===Se.default.ErrorTypes.NETWORK_ERROR&&g.details===Se.default.ErrorDetails.FRAG_LOAD_ERROR&&(p=((m=g.frag)==null?void 0:m.level)??null)}),this.api.on(Se.default.Events.LEVEL_SWITCHED,(v,g)=>{let m=g.level;p!==null&&m<p&&(console.warn(`hls.js downgraded quality from level ${p} to ${m} due to fragment load failure.`),this.videoRenditions.selectedIndex=m,p=null)});let h=()=>{let v=this.videoRenditions.selectedIndex;this.api&&v!==this.api.nextLevel&&(this.api.nextLevel=v)};(a=this.videoRenditions)==null||a.addEventListener("change",h),this.api.once(Se.default.Events.DESTROYING,()=>U(this,rt,xc).call(this));return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Wt=new WeakMap,Ei=new WeakMap,To=new WeakMap,rt=new WeakSet,gm=function(){var t,r;(t=u(this,Wt))==null||t.remove(),_(this,Wt,null),(r=this.nativeEl)==null||r.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,ia)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),_(this,To,!1)},Em=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},xc=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},ia=new WeakMap,bm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},bi.shadowRootOptions={...Oe.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",bi);var Pc=bi;var $E="nanoplayer.4.min.js",HE="nanoplayer",ke={loading:!1,loaded:!1,error:null,callbacks:[]};function BE(i){return new Promise((e,t)=>{if(window.NanoPlayer){ke.loaded=!0,e();return}if(ke.loaded){e();return}if(ke.error){t(ke.error);return}if(ke.callbacks.push(a=>{a?t(a):e()}),ke.loading)return;ke.loading=!0;let o=`${i.endsWith("/")?i:`${i}/`}${HE}/${$E}`,n=document.createElement("script");n.src=o,n.async=!0,n.onload=()=>{ke.loaded=!0,ke.loading=!1,ke.callbacks.forEach(a=>a()),ke.callbacks=[]},n.onerror=()=>{let a=new Error(`Failed to load NanoPlayer script from ${o}`);ke.error=a,ke.loading=!1,ke.callbacks.forEach(l=>l(a)),ke.callbacks=[]},document.head.appendChild(n)})}var VE=yo(Oe),Ft,_i,de,ot,Ao,Le,ra,yi,dr,So,Ti,ko,we,Dc,_m,ym,Tm,El,Ai=class extends VE{constructor(){super();S(this,we);S(this,Ft,null);S(this,_i,null);S(this,de,null);S(this,ot,null);S(this,Ao,"");S(this,Le,null);S(this,ra,!0);S(this,yi,[]);S(this,dr,[]);S(this,So,null);S(this,Ti,null);S(this,ko,!1);this.api=null;U(this,we,El).call(this,"config"),U(this,we,El).call(this,"streamid"),U(this,we,El).call(this,"sourceConfig")}static get observedAttributes(){return[...Oe.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:o,"library-location":n,...a}=t;return`
2780
+ `}get config(){return u(this,Ei)}set config(t){_(this,Ei,t)}attributeChangedCallback(t,r,o){t!=="src"&&super.attributeChangedCallback(t,r,o),t==="src"&&r!==o&&this.load()}async load(){var o,n,a;let t=!this.api&&!u(this,To);if(U(this,rt,bm).call(this),!this.src)return;if(t&&!u(this,Ei)&&_(this,Ei,JSON.parse(((n=(o=this.shadowRoot)==null?void 0:o.getElementById("config"))==null?void 0:n.textContent)||"{}")),!U(this,rt,_m).call(this,this.src)){await Promise.resolve(),_(this,To,!0),this.nativeEl.src=this.src;return}if(Se.default.isSupported()){switch(await Promise.resolve(),this.api=new Se.default({liveDurationInfinity:!0,autoStartLoad:!1,...u(this,Ei)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let v=()=>{var g;return(g=this.api)==null?void 0:g.startLoad()};this.nativeEl.addEventListener("play",v,{once:!0}),this.api.on(Se.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",v)});break}case"metadata":{let v=this.api.config.maxBufferLength,g=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let p=()=>{this.api&&(this.api.config.maxBufferLength=v,this.api.config.maxBufferSize=g)};this.nativeEl.addEventListener("play",p,{once:!0}),this.api.on(Se.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",p)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,ia)),_(this,Wt,document.createElement("source")),u(this,Wt).setAttribute("type","application/x-mpegURL"),u(this,Wt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,Wt));let c=new WeakMap;this.api.on(Se.default.Events.MANIFEST_PARSED,(v,g)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(A=>{console.warn("Autoplay failed:",A)}),U(this,rt,xc).call(this);let p=this.videoTracks.getTrackById("main");p||(p=this.addVideoTrack("main"),p.id="main",p.selected=!0);for(let[A,f]of g.levels.entries()){let R=p.addRendition(f.url[0],f.width,f.height,f.videoCodec??void 0,f.bitrate);c.set(f,`${A}`),R.id=`${A}`}for(let[A,f]of g.audioTracks.entries()){let R=f.default?"main":"alternative",O=this.addAudioTrack(R,f.name,f.lang);O.id=`${A}`,f.default&&(O.enabled=!0)}}),this.audioTracks.addEventListener("change",()=>{var A,f;let v=[...this.audioTracks].find(R=>R.enabled),g=v?+v.id:void 0,p=((A=this.api)==null?void 0:A.audioTracks.map(R=>R.id))??[];g!==void 0&&g!==((f=this.api)==null?void 0:f.audioTrack)&&p.includes(g)&&this.api&&(this.api.audioTrack=g)}),this.api.on(Se.default.Events.LEVELS_UPDATED,(v,g)=>{let p=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!p)return;let A=g.levels.map(f=>c.get(f));for(let f of this.videoRenditions)f.id&&!A.includes(f.id)&&p.removeRendition(f)});let m=null;this.api.on(Se.default.Events.ERROR,(v,g)=>{var p;g.type===Se.default.ErrorTypes.NETWORK_ERROR&&g.details===Se.default.ErrorDetails.FRAG_LOAD_ERROR&&(m=((p=g.frag)==null?void 0:p.level)??null)}),this.api.on(Se.default.Events.LEVEL_SWITCHED,(v,g)=>{let p=g.level;m!==null&&p<m&&(console.warn(`hls.js downgraded quality from level ${m} to ${p} due to fragment load failure.`),this.videoRenditions.selectedIndex=p,m=null)});let h=()=>{let v=this.videoRenditions.selectedIndex;this.api&&v!==this.api.nextLevel&&(this.api.nextLevel=v)};(a=this.videoRenditions)==null||a.addEventListener("change",h),this.api.once(Se.default.Events.DESTROYING,()=>U(this,rt,xc).call(this));return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Wt=new WeakMap,Ei=new WeakMap,To=new WeakMap,rt=new WeakSet,bm=function(){var t,r;(t=u(this,Wt))==null||t.remove(),_(this,Wt,null),(r=this.nativeEl)==null||r.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,ia)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),_(this,To,!1)},_m=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},xc=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},ia=new WeakMap,ym=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},bi.shadowRootOptions={...Oe.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",bi);var Pc=bi;var BE="nanoplayer.4.min.js",VE="nanoplayer",ke={loading:!1,loaded:!1,error:null,callbacks:[]};function WE(i){return new Promise((e,t)=>{if(window.NanoPlayer){ke.loaded=!0,e();return}if(ke.loaded){e();return}if(ke.error){t(ke.error);return}if(ke.callbacks.push(a=>{a?t(a):e()}),ke.loading)return;ke.loading=!0;let o=`${i.endsWith("/")?i:`${i}/`}${VE}/${BE}`,n=document.createElement("script");n.src=o,n.async=!0,n.onload=()=>{ke.loaded=!0,ke.loading=!1,ke.callbacks.forEach(a=>a()),ke.callbacks=[]},n.onerror=()=>{let a=new Error(`Failed to load NanoPlayer script from ${o}`);ke.error=a,ke.loading=!1,ke.callbacks.forEach(l=>l(a)),ke.callbacks=[]},document.head.appendChild(n)})}var FE=yo(Oe),Ft,_i,de,ot,Ao,Le,ra,yi,dr,So,Ti,ko,we,Dc,Tm,Am,Sm,El,Ai=class extends FE{constructor(){super();S(this,we);S(this,Ft,null);S(this,_i,null);S(this,de,null);S(this,ot,null);S(this,Ao,"");S(this,Le,null);S(this,ra,!0);S(this,yi,[]);S(this,dr,[]);S(this,So,null);S(this,Ti,null);S(this,ko,!1);this.api=null;U(this,we,El).call(this,"config"),U(this,we,El).call(this,"streamid"),U(this,we,El).call(this,"sourceConfig")}static get observedAttributes(){return[...Oe.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:o,"library-location":n,...a}=t;return`
2778
2781
  <script type="application/json" id="config">
2779
2782
  ${JSON.stringify(r.config||{})}
2780
2783
  <\/script>
2781
2784
  ${Oe.getTemplateHTML(a)}
2782
- `}get config(){return u(this,Ft)}set config(t){_(this,Ft,t)}get sourceConfig(){return u(this,_i)}set sourceConfig(t){let r=u(this,_i)!==t;_(this,_i,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,o){t==="streamid"&&r!==o?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,o)}async load(){var n,a,l,c,p;let t=!u(this,de);U(this,we,Dc).call(this);let r=this.streamid,o=!!u(this,_i);if(!(!r&&!o)){_(this,So,new Promise(h=>{_(this,Ti,h)})),t&&!u(this,Ft)&&_(this,Ft,JSON.parse(((a=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:a.textContent)||"{}"));try{await BE(this.libraryLocation)}catch(h){console.error("[nano-video] Failed to load NanoPlayer script:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:"Failed to load NanoPlayer script"})),(l=u(this,Ti))==null||l.call(this);return}_(this,Ao,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),_(this,ot,document.createElement("div")),u(this,ot).id=u(this,Ao),u(this,ot).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.addEventListener("pause",h=>{var v;h.target!==this&&((v=u(this,ot))!=null&&v.contains(h.target))&&u(this,ko)&&h.stopImmediatePropagation()},!0),this.style.position="relative",this.nativeEl.style.display="none",this.appendChild(u(this,ot)),_(this,de,new window.NanoPlayer(u(this,Ao))),this.api=u(this,de);try{let h=U(this,we,_m).call(this,r,o?u(this,_i):void 0),v=await u(this,de).setup(h);_(this,dr,((c=v.source.entries)==null?void 0:c.map((g,m)=>({index:m,height:g.info.height??0,width:g.info.width??0,bitrate:g.info.bitrate??0,label:g.info.height?`${g.info.height}p`:m===0?"Source":`Stream ${m+1}`})))??[]),U(this,we,Tm).call(this)}catch(h){console.error("[nano-video] Failed to setup NanoPlayer:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:"Failed to setup NanoPlayer"})),(p=u(this,Ti))==null||p.call(this)}}}async play(){if(u(this,So)&&await u(this,So),u(this,de)){_(this,ko,!0),u(this,de).play();return}return super.play()}pause(){if(u(this,de)){u(this,de).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,Le))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,de)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,Le))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,Le))==null?void 0:t.volume)??super.volume}set volume(t){u(this,Le)?u(this,Le).volume=t:super.volume=t}get muted(){var t;return((t=u(this,Le))==null?void 0:t.muted)??super.muted}set muted(t){u(this,Le)&&(u(this,Le).muted=t),u(this,de)?t?u(this,de).mute():u(this,de).unmute():super.muted=t}get videoWidth(){var t;return((t=u(this,Le))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,Le))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;U(this,we,Dc).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Ft=new WeakMap,_i=new WeakMap,de=new WeakMap,ot=new WeakMap,Ao=new WeakMap,Le=new WeakMap,ra=new WeakMap,yi=new WeakMap,dr=new WeakMap,So=new WeakMap,Ti=new WeakMap,ko=new WeakMap,we=new WeakSet,Dc=function(){u(this,yi).forEach(t=>t()),_(this,yi,[]),u(this,de)&&(u(this,de).destroy(),_(this,de,null),this.api=null),u(this,ot)&&(u(this,ot).remove(),_(this,ot,null)),_(this,Le,null),_(this,dr,[])},_m=function(t,r){var n,a;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:((n=u(this,Ft))==null?void 0:n.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((a=u(this,Ft))==null?void 0:a.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(new Event("loadeddata",{bubbles:!0})),this.dispatchEvent(new Event("canplay",{bubbles:!0})),this.dispatchEvent(new Event("canplaythrough",{bubbles:!0})),(l=u(this,Ti))==null||l.call(this)},onPlay:()=>{_(this,ko,!1),this.dispatchEvent(new Event("play",{bubbles:!0})),this.dispatchEvent(new Event("playing",{bubbles:!0}))},onPause:()=>{this.dispatchEvent(new Event("pause",{bubbles:!0}))},onLoading:()=>{this.dispatchEvent(new Event("waiting",{bubbles:!0}))},onStartBuffering:()=>{this.dispatchEvent(new Event("waiting",{bubbles:!0}))},onStopBuffering:()=>{this.dispatchEvent(new Event("canplaythrough",{bubbles:!0})),this.dispatchEvent(new Event("playing",{bubbles:!0}))},onError:l=>{var p;let c=new Error(l.data.message??"NanoPlayer error");this.dispatchEvent(new ErrorEvent("error",{error:c,message:l.data.message,bubbles:!0})),(p=u(this,Ti))==null||p.call(this)},onActiveVideoElementChange:l=>{var p;let c=(p=l.data)==null?void 0:p.activeVideoElement;c&&(_(this,Le,c),U(this,we,ym).call(this,c))}}}},ym=function(t){u(this,yi).forEach(o=>o()),_(this,yi,[]);let r=["timeupdate","volumechange","durationchange","resize"];for(let o of r){let n=()=>{this.dispatchEvent(new Event(o,{bubbles:!0}))};t.addEventListener(o,n),u(this,yi).push(()=>t.removeEventListener(o,n))}},Tm=function(){for(let o of this.videoTracks)this.removeVideoTrack(o);if(u(this,dr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let o of u(this,dr)){let n=t.addRendition("",o.width,o.height,void 0,o.bitrate);n.id=`${o.index}`}let r=()=>{var n,a,l;let o=this.videoRenditions.selectedIndex;o<0?(_(this,ra,!0),(n=u(this,de))==null||n.setAdaption({rule:"deviationOfMean2"})):(_(this,ra,!1),(a=u(this,de))==null||a.switchStream(o).catch(()=>{}),(l=u(this,de))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r)},El=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ai.shadowRootOptions={...Oe.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",Ai);var Oc=Ai;var Ue=au("livekit-client");var WE=yo(Oe),Qe,_e,re,Ct,Lo,Mt,wo,Io,ce,Uc,Am,Sm,bl,km,Lm,_l,Si=class extends WE{constructor(){super();S(this,ce);S(this,Qe,null);S(this,_e,null);S(this,re,null);S(this,Ct,[]);S(this,Lo,[]);S(this,Mt,"disconnected");S(this,wo,null);S(this,Io,null);this.room=null;U(this,ce,_l).call(this,"config"),U(this,ce,_l).call(this,"url"),U(this,ce,_l).call(this,"token")}static get observedAttributes(){return[...Oe.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:o,token:n,...a}=t;return`
2785
+ `}get config(){return u(this,Ft)}set config(t){_(this,Ft,t)}get sourceConfig(){return u(this,_i)}set sourceConfig(t){let r=u(this,_i)!==t;_(this,_i,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,o){t==="streamid"&&r!==o?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,o)}async load(){var n,a,l,c,m;let t=!u(this,de);U(this,we,Dc).call(this);let r=this.streamid,o=!!u(this,_i);if(!(!r&&!o)){_(this,So,new Promise(h=>{_(this,Ti,h)})),t&&!u(this,Ft)&&_(this,Ft,JSON.parse(((a=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:a.textContent)||"{}"));try{await WE(this.libraryLocation)}catch(h){console.error("[nano-video] Failed to load NanoPlayer script:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:"Failed to load NanoPlayer script"})),(l=u(this,Ti))==null||l.call(this);return}_(this,Ao,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),_(this,ot,document.createElement("div")),u(this,ot).id=u(this,Ao),u(this,ot).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.addEventListener("pause",h=>{var v;h.target!==this&&((v=u(this,ot))!=null&&v.contains(h.target))&&u(this,ko)&&h.stopImmediatePropagation()},!0),this.style.position="relative",this.nativeEl.style.display="none",this.appendChild(u(this,ot)),_(this,de,new window.NanoPlayer(u(this,Ao))),this.api=u(this,de);try{let h=U(this,we,Tm).call(this,r,o?u(this,_i):void 0),v=await u(this,de).setup(h);_(this,dr,((c=v.source.entries)==null?void 0:c.map((g,p)=>({index:p,height:g.info.height??0,width:g.info.width??0,bitrate:g.info.bitrate??0,label:g.info.height?`${g.info.height}p`:p===0?"Source":`Stream ${p+1}`})))??[]),U(this,we,Sm).call(this)}catch(h){console.error("[nano-video] Failed to setup NanoPlayer:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:"Failed to setup NanoPlayer"})),(m=u(this,Ti))==null||m.call(this)}}}async play(){if(u(this,So)&&await u(this,So),u(this,de)){_(this,ko,!0),u(this,de).play();return}return super.play()}pause(){if(u(this,de)){u(this,de).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,Le))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,de)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,Le))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,Le))==null?void 0:t.volume)??super.volume}set volume(t){u(this,Le)?u(this,Le).volume=t:super.volume=t}get muted(){var t;return((t=u(this,Le))==null?void 0:t.muted)??super.muted}set muted(t){u(this,Le)&&(u(this,Le).muted=t),u(this,de)?t?u(this,de).mute():u(this,de).unmute():super.muted=t}get videoWidth(){var t;return((t=u(this,Le))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,Le))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;U(this,we,Dc).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Ft=new WeakMap,_i=new WeakMap,de=new WeakMap,ot=new WeakMap,Ao=new WeakMap,Le=new WeakMap,ra=new WeakMap,yi=new WeakMap,dr=new WeakMap,So=new WeakMap,Ti=new WeakMap,ko=new WeakMap,we=new WeakSet,Dc=function(){u(this,yi).forEach(t=>t()),_(this,yi,[]),u(this,de)&&(u(this,de).destroy(),_(this,de,null),this.api=null),u(this,ot)&&(u(this,ot).remove(),_(this,ot,null)),_(this,Le,null),_(this,dr,[])},Tm=function(t,r){var n,a;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:((n=u(this,Ft))==null?void 0:n.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((a=u(this,Ft))==null?void 0:a.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(new Event("loadeddata",{bubbles:!0})),this.dispatchEvent(new Event("canplay",{bubbles:!0})),this.dispatchEvent(new Event("canplaythrough",{bubbles:!0})),(l=u(this,Ti))==null||l.call(this)},onPlay:()=>{_(this,ko,!1),this.dispatchEvent(new Event("play",{bubbles:!0})),this.dispatchEvent(new Event("playing",{bubbles:!0}))},onPause:()=>{this.dispatchEvent(new Event("pause",{bubbles:!0}))},onLoading:()=>{this.dispatchEvent(new Event("waiting",{bubbles:!0}))},onStartBuffering:()=>{this.dispatchEvent(new Event("waiting",{bubbles:!0}))},onStopBuffering:()=>{this.dispatchEvent(new Event("canplaythrough",{bubbles:!0})),this.dispatchEvent(new Event("playing",{bubbles:!0}))},onError:l=>{var m;let c=new Error(l.data.message??"NanoPlayer error");this.dispatchEvent(new ErrorEvent("error",{error:c,message:l.data.message,bubbles:!0})),(m=u(this,Ti))==null||m.call(this)},onActiveVideoElementChange:l=>{var m;let c=(m=l.data)==null?void 0:m.activeVideoElement;c&&(_(this,Le,c),U(this,we,Am).call(this,c))}}}},Am=function(t){u(this,yi).forEach(o=>o()),_(this,yi,[]);let r=["timeupdate","volumechange","durationchange","resize"];for(let o of r){let n=()=>{this.dispatchEvent(new Event(o,{bubbles:!0}))};t.addEventListener(o,n),u(this,yi).push(()=>t.removeEventListener(o,n))}},Sm=function(){for(let o of this.videoTracks)this.removeVideoTrack(o);if(u(this,dr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let o of u(this,dr)){let n=t.addRendition("",o.width,o.height,void 0,o.bitrate);n.id=`${o.index}`}let r=()=>{var n,a,l;let o=this.videoRenditions.selectedIndex;o<0?(_(this,ra,!0),(n=u(this,de))==null||n.setAdaption({rule:"deviationOfMean2"})):(_(this,ra,!1),(a=u(this,de))==null||a.switchStream(o).catch(()=>{}),(l=u(this,de))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r)},El=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ai.shadowRootOptions={...Oe.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",Ai);var Oc=Ai;var Ue=au("livekit-client");var KE=yo(Oe),Qe,_e,re,It,Lo,Mt,wo,Co,ce,Uc,km,Lm,bl,wm,Cm,_l,Si=class extends KE{constructor(){super();S(this,ce);S(this,Qe,null);S(this,_e,null);S(this,re,null);S(this,It,[]);S(this,Lo,[]);S(this,Mt,"disconnected");S(this,wo,null);S(this,Co,null);this.room=null;U(this,ce,_l).call(this,"config"),U(this,ce,_l).call(this,"url"),U(this,ce,_l).call(this,"token")}static get observedAttributes(){return[...Oe.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:o,token:n,...a}=t;return`
2783
2786
  <script type="application/json" id="config">
2784
2787
  ${JSON.stringify(r.config||{})}
2785
2788
  <\/script>
2786
2789
  ${Oe.getTemplateHTML(a)}
2787
- `}get config(){return u(this,Qe)}set config(t){_(this,Qe,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,o){(t==="url"||t==="token")&&r!==o?this.url&&this.token&&this.load():t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,o)}async load(){var l,c,p;let t=!u(this,_e);U(this,ce,Uc).call(this);let r=this.url,o=this.token;if(!r||!o)return;_(this,wo,new Promise(h=>{_(this,Io,h)})),t&&!u(this,Qe)&&_(this,Qe,JSON.parse(((c=(l=this.shadowRoot)==null?void 0:l.getElementById("config"))==null?void 0:c.textContent)||"{}"));let n=U(this,ce,km).call(this),a=U(this,ce,Lm).call(this);_(this,_e,new Ue.Room(n)),this.room=u(this,_e),u(this,_e).on(Ue.RoomEvent.Connected,()=>{_(this,Mt,"connected")}),u(this,_e).on(Ue.RoomEvent.Disconnected,()=>{_(this,Mt,"disconnected"),this.dispatchEvent(new Event("ended"))}),u(this,_e).on(Ue.RoomEvent.Reconnecting,()=>{_(this,Mt,"reconnecting"),this.dispatchEvent(new Event("waiting"))}),u(this,_e).on(Ue.RoomEvent.Reconnected,()=>{_(this,Mt,"connected"),this.dispatchEvent(new Event("playing"))}),u(this,_e).on(Ue.RoomEvent.TrackSubscribed,(h,v,g)=>{var m,A;if(h.kind===Ue.Track.Kind.Video){let f=h.attach();f.style.width="100%",f.style.height="100%",f.style.objectFit="contain",f.style.position="absolute",f.style.top="0",f.style.left="0",this.nativeEl.muted&&(f.muted=!0),this.nativeEl.style.display="none",(m=this.shadowRoot)==null||m.appendChild(f),_(this,re,f),U(this,ce,Am).call(this,f),U(this,ce,Sm).call(this,v),this.dispatchEvent(new Event("loadedmetadata")),this.dispatchEvent(new Event("resize")),this.dispatchEvent(new Event("canplay")),this.dispatchEvent(new Event("playing")),(A=u(this,Io))==null||A.call(this)}}),u(this,_e).on(Ue.RoomEvent.TrackUnsubscribed,h=>{h.kind===Ue.Track.Kind.Video&&(h.detach(),U(this,ce,bl).call(this),u(this,re)&&(u(this,Ct).forEach(v=>v()),_(this,Ct,[]),u(this,re).remove(),_(this,re,null)))}),_(this,Mt,"connecting"),this.dispatchEvent(new Event("loadstart"));try{await u(this,_e).connect(r,o,a)}catch(h){_(this,Mt,"failed"),console.error("[livekit-video] Failed to connect:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:h instanceof Error?h.message:"Failed to connect to LiveKit room"})),(p=u(this,Io))==null||p.call(this)}}async play(){return u(this,wo)&&await u(this,wo),u(this,re)?u(this,re).play():super.play()}pause(){if(u(this,re)){u(this,re).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,re))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,_e)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,re))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,re))==null?void 0:t.volume)??super.volume}set volume(t){u(this,re)?u(this,re).volume=t:super.volume=t}get muted(){var t;return((t=u(this,re))==null?void 0:t.muted)??super.muted}set muted(t){u(this,re)?u(this,re).muted=t:super.muted=t}get videoWidth(){var t;return((t=u(this,re))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,re))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;U(this,ce,Uc).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Qe=new WeakMap,_e=new WeakMap,re=new WeakMap,Ct=new WeakMap,Lo=new WeakMap,Mt=new WeakMap,wo=new WeakMap,Io=new WeakMap,ce=new WeakSet,Uc=function(){u(this,Ct).forEach(t=>t()),_(this,Ct,[]),U(this,ce,bl).call(this),u(this,_e)&&(u(this,_e).disconnect(),_(this,_e,null),this.room=null),u(this,re)&&(u(this,re).remove(),_(this,re,null)),_(this,Mt,"disconnected")},Am=function(t){u(this,Ct).forEach(o=>o()),_(this,Ct,[]);let r=["timeupdate","volumechange","play","playing","pause","resize"];for(let o of r){let n=()=>{this.dispatchEvent(new Event(o))};t.addEventListener(o,n),u(this,Ct).push(()=>t.removeEventListener(o,n))}},Sm=function(t){var l;U(this,ce,bl).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let o=this.addVideoTrack("main");o.id="main",o.selected=!0;let n=[...r].sort((c,p)=>c.quality-p.quality);for(let c of n){let p=o.addRendition("",c.width,c.height,void 0,c.bitrate);p.id=`${c.quality}`}let a=()=>{let c=this.videoRenditions.selectedIndex;if(c<0)t.setVideoQuality(Ue.VideoQuality.HIGH);else{let p=n[c];p&&t.setVideoQuality(p.quality)}};this.videoRenditions.addEventListener("change",a),u(this,Lo).push(()=>this.videoRenditions.removeEventListener("change",a))},bl=function(){u(this,Lo).forEach(t=>t()),_(this,Lo,[]);for(let t of this.videoTracks)this.removeVideoTrack(t)},km=function(){var t,r,o;return{adaptiveStream:((t=u(this,Qe))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,Qe))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((o=u(this,Qe))==null?void 0:o.disconnectOnPageLeave)??!1}},Lm=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,Qe))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,Qe))==null?void 0:r.iceTransportPolicy)??"relay"}}},_l=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Si.shadowRootOptions={...Oe.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",Si);var Nc=Si;return Wm(FE);})();
2790
+ `}get config(){return u(this,Qe)}set config(t){_(this,Qe,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,o){(t==="url"||t==="token")&&r!==o?this.url&&this.token&&this.load():t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,o)}async load(){var l,c,m;let t=!u(this,_e);U(this,ce,Uc).call(this);let r=this.url,o=this.token;if(!r||!o)return;_(this,wo,new Promise(h=>{_(this,Co,h)})),t&&!u(this,Qe)&&_(this,Qe,JSON.parse(((c=(l=this.shadowRoot)==null?void 0:l.getElementById("config"))==null?void 0:c.textContent)||"{}"));let n=U(this,ce,wm).call(this),a=U(this,ce,Cm).call(this);_(this,_e,new Ue.Room(n)),this.room=u(this,_e),u(this,_e).on(Ue.RoomEvent.Connected,()=>{_(this,Mt,"connected")}),u(this,_e).on(Ue.RoomEvent.Disconnected,()=>{_(this,Mt,"disconnected"),this.dispatchEvent(new Event("ended"))}),u(this,_e).on(Ue.RoomEvent.Reconnecting,()=>{_(this,Mt,"reconnecting"),this.dispatchEvent(new Event("waiting"))}),u(this,_e).on(Ue.RoomEvent.Reconnected,()=>{_(this,Mt,"connected"),this.dispatchEvent(new Event("playing"))}),u(this,_e).on(Ue.RoomEvent.TrackSubscribed,(h,v,g)=>{var p,A;if(h.kind===Ue.Track.Kind.Video){let f=h.attach();f.style.width="100%",f.style.height="100%",f.style.objectFit="contain",f.style.position="absolute",f.style.top="0",f.style.left="0",this.nativeEl.muted&&(f.muted=!0),this.nativeEl.style.display="none",(p=this.shadowRoot)==null||p.appendChild(f),_(this,re,f),U(this,ce,km).call(this,f),U(this,ce,Lm).call(this,v),this.dispatchEvent(new Event("loadedmetadata")),this.dispatchEvent(new Event("resize")),this.dispatchEvent(new Event("canplay")),this.dispatchEvent(new Event("playing")),(A=u(this,Co))==null||A.call(this)}}),u(this,_e).on(Ue.RoomEvent.TrackUnsubscribed,h=>{h.kind===Ue.Track.Kind.Video&&(h.detach(),U(this,ce,bl).call(this),u(this,re)&&(u(this,It).forEach(v=>v()),_(this,It,[]),u(this,re).remove(),_(this,re,null)))}),_(this,Mt,"connecting"),this.dispatchEvent(new Event("loadstart"));try{await u(this,_e).connect(r,o,a)}catch(h){_(this,Mt,"failed"),console.error("[livekit-video] Failed to connect:",h),this.dispatchEvent(new ErrorEvent("error",{error:h,message:h instanceof Error?h.message:"Failed to connect to LiveKit room"})),(m=u(this,Co))==null||m.call(this)}}async play(){return u(this,wo)&&await u(this,wo),u(this,re)?u(this,re).play():super.play()}pause(){if(u(this,re)){u(this,re).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,re))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,_e)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,re))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,re))==null?void 0:t.volume)??super.volume}set volume(t){u(this,re)?u(this,re).volume=t:super.volume=t}get muted(){var t;return((t=u(this,re))==null?void 0:t.muted)??super.muted}set muted(t){u(this,re)?u(this,re).muted=t:super.muted=t}get videoWidth(){var t;return((t=u(this,re))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,re))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;U(this,ce,Uc).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Qe=new WeakMap,_e=new WeakMap,re=new WeakMap,It=new WeakMap,Lo=new WeakMap,Mt=new WeakMap,wo=new WeakMap,Co=new WeakMap,ce=new WeakSet,Uc=function(){u(this,It).forEach(t=>t()),_(this,It,[]),U(this,ce,bl).call(this),u(this,_e)&&(u(this,_e).disconnect(),_(this,_e,null),this.room=null),u(this,re)&&(u(this,re).remove(),_(this,re,null)),_(this,Mt,"disconnected")},km=function(t){u(this,It).forEach(o=>o()),_(this,It,[]);let r=["timeupdate","volumechange","play","playing","pause","resize"];for(let o of r){let n=()=>{this.dispatchEvent(new Event(o))};t.addEventListener(o,n),u(this,It).push(()=>t.removeEventListener(o,n))}},Lm=function(t){var l;U(this,ce,bl).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let o=this.addVideoTrack("main");o.id="main",o.selected=!0;let n=[...r].sort((c,m)=>c.quality-m.quality);for(let c of n){let m=o.addRendition("",c.width,c.height,void 0,c.bitrate);m.id=`${c.quality}`}let a=()=>{let c=this.videoRenditions.selectedIndex;if(c<0)t.setVideoQuality(Ue.VideoQuality.HIGH);else{let m=n[c];m&&t.setVideoQuality(m.quality)}};this.videoRenditions.addEventListener("change",a),u(this,Lo).push(()=>this.videoRenditions.removeEventListener("change",a))},bl=function(){u(this,Lo).forEach(t=>t()),_(this,Lo,[]);for(let t of this.videoTracks)this.removeVideoTrack(t)},wm=function(){var t,r,o;return{adaptiveStream:((t=u(this,Qe))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,Qe))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((o=u(this,Qe))==null?void 0:o.disconnectOnPageLeave)??!1}},Cm=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,Qe))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,Qe))==null?void 0:r.iceTransportPolicy)??"relay"}}},_l=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Si.shadowRootOptions={...Oe.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",Si);var Nc=Si;return Km(qE);})();
2788
2791
  /*! Bundled license information:
2789
2792
 
2790
2793
  @lit/reactive-element/css-tag.js: