@broadcastingplatforms/player 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bp-player.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * BP Player (v1.5.0)
2
+ * BP Player (v1.5.1)
3
3
  * Universal video player web component
4
4
  */
5
- "use strict";var BPPlayer=(()=>{var kv=Object.create;var Cr=Object.defineProperty;var Gu=Object.getOwnPropertyDescriptor;var Lv=Object.getOwnPropertyNames;var zu=Object.getPrototypeOf,wv=Object.prototype.hasOwnProperty;var Iv=Reflect.get;var Yu=i=>{throw TypeError(i)};var Cv=(i,e,t)=>e in i?Cr(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Qu=(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 Rv=(i,e)=>{for(var t in e)Cr(i,t,{get:e[t],enumerable:!0})},Zu=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Lv(e))!wv.call(i,n)&&n!==t&&Cr(i,n,{get:()=>e[n],enumerable:!(r=Gu(e,n))||r.enumerable});return i};var Mv=(i,e,t)=>(t=i!=null?kv(zu(i)):{},Zu(e||!i||!i.__esModule?Cr(t,"default",{value:i,enumerable:!0}):t,i)),xv=i=>Zu(Cr({},"__esModule",{value:!0}),i),V=(i,e,t,r)=>{for(var n=r>1?void 0:r?Gu(e,t):e,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&Cr(e,t,n),n};var q=(i,e,t)=>Cv(i,typeof e!="symbol"?e+"":e,t),rd=(i,e,t)=>e.has(i)||Yu("Cannot "+t);var c=(i,e,t)=>(rd(i,e,"read from private field"),t?t.call(i):e.get(i)),k=(i,e,t)=>e.has(i)?Yu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),v=(i,e,t,r)=>(rd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),C=(i,e,t)=>(rd(i,e,"access private method"),t);var nd=(i,e,t)=>Iv(zu(i),t,e);var xb={};Rv(xb,{Attribute:()=>vo,BPDefaultUI:()=>ae,BPErrorDisplay:()=>Kt,BPLiveError:()=>rt,BPLiveService:()=>xr,BPOverlay:()=>Ot,BPPlayer:()=>Re,Hls:()=>xe.default,HlsVideo:()=>Ri,HlsVideoElement:()=>Tu,LiveKitVideo:()=>Lr,LiveKitVideoElement:()=>Lu,NANOPLAYER_NO_REPLAY_CODES:()=>vh,NanoVideo:()=>Di,NanoVideoElement:()=>Su,StateReceiverMixin:()=>gh,StateReceiverProps:()=>Bi,addGlobalStyles:()=>Pr,classifyLiveKitError:()=>$s,classifyNanoPlayerError:()=>Hs,createInitialState:()=>ao,createPlayerCore:()=>Bs,createTemplate:()=>Th,forEachStateReceiverElement:()=>Wi,isBPLiveClipSource:()=>co,isBPLiveSource:()=>Vs,isBPLiveStreamSource:()=>lo,isStateReceiverElement:()=>Ws,propagateStateToReceiver:()=>po,removeStateFromReceiver:()=>mo,templateWithStyles:()=>Ah,toggleAttribute:()=>ge});var Ps=globalThis,Ds=Ps.ShadowRoot&&(Ps.ShadyCSS===void 0||Ps.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,od=Symbol(),Xu=new WeakMap,Xn=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==od)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(Ds&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Xu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Xu.set(t,e))}return e}toString(){return this.cssText}},ju=i=>new Xn(typeof i=="string"?i:i+"",void 0,od),jn=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1],i[0]);return new Xn(t,i,od)},Ju=(i,e)=>{if(Ds)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=Ps.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},sd=Ds?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return ju(t)})(i):i;var{is:Pv,defineProperty:Dv,getOwnPropertyDescriptor:Ov,getOwnPropertyNames:Nv,getOwnPropertySymbols:Uv,getPrototypeOf:Hv}=Object,Jt=globalThis,eh=Jt.trustedTypes,$v=eh?eh.emptyScript:"",ad=Jt.reactiveElementPolyfillSupport,Jn=(i,e)=>i,eo={toAttribute(i,e){switch(e){case Boolean:i=i?$v: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}},Os=(i,e)=>!Pv(i,e),th={attribute:!0,type:String,converter:eo,reflect:!1,useDefault:!1,hasChanged:Os};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Jt.litPropertyMetadata??(Jt.litPropertyMetadata=new WeakMap);var Ht=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=th){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Dv(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:o}=Ov(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:n,set(s){let l=n==null?void 0:n.call(this);o==null||o.call(this,s),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??th}static _$Ei(){if(this.hasOwnProperty(Jn("elementProperties")))return;let e=Hv(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Jn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Jn("properties"))){let t=this.properties,r=[...Nv(t),...Uv(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(sd(n))}else e!==void 0&&t.push(sd(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 Ju(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var o;let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let s=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:eo).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){var o,s;let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let l=r.getPropertyOptions(n),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((o=l.converter)==null?void 0:o.fromAttribute)!==void 0?l.converter:eo;this._$Em=n;let h=d.fromAttribute(t,l.type);this[n]=h??((s=this._$Ej)==null?void 0:s.get(n))??h,this._$Em=null}}requestUpdate(e,t,r,n=!1,o){var s;if(e!==void 0){let l=this.constructor;if(n===!1&&(o=this[e]),r??(r=l.getPropertyOptions(e)),!((r.hasChanged??Os)(o,t)||r.useDefault&&r.reflect&&o===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:o},s){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,s??t??this[e]),o!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[o,s]of n){let{wrapped:l}=s,d=this[o];l!==!0||this._$AL.has(o)||d===void 0||this.C(o,void 0,s,d)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var n;return(n=r.hostUpdated)==null?void 0:n.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Ht.elementStyles=[],Ht.shadowRootOptions={mode:"open"},Ht[Jn("elementProperties")]=new Map,Ht[Jn("finalized")]=new Map,ad==null||ad({ReactiveElement:Ht}),(Jt.reactiveElementVersions??(Jt.reactiveElementVersions=[])).push("2.1.2");var io=globalThis,ih=i=>i,Ns=io.trustedTypes,rh=Ns?Ns.createPolicy("lit-html",{createHTML:i=>i}):void 0,dh="$lit$",ei=`lit$${Math.random().toFixed(9).slice(2)}$`,ch="?"+ei,Vv=`<${ch}>`,Hi=document,ro=()=>Hi.createComment(""),no=i=>i===null||typeof i!="object"&&typeof i!="function",vd=Array.isArray,Bv=i=>vd(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",ld=`[
6
- \f\r]`,to=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nh=/-->/g,oh=/>/g,Ni=RegExp(`>|${ld}(?:([^\\s"'>=/]+)(${ld}*=${ld}*(?:[^
7
- \f\r"'\`<>=]|("|')|))|$)`,"g"),sh=/'/g,ah=/"/g,uh=/^(?:script|style|textarea|title)$/i,fd=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ye=fd(1),$b=fd(2),Vb=fd(3),$i=Symbol.for("lit-noChange"),ye=Symbol.for("lit-nothing"),lh=new WeakMap,Ui=Hi.createTreeWalker(Hi,129);function hh(i,e){if(!vd(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return rh!==void 0?rh.createHTML(e):e}var Wv=(i,e)=>{let t=i.length-1,r=[],n,o=e===2?"<svg>":e===3?"<math>":"",s=to;for(let l=0;l<t;l++){let d=i[l],h,p,f=-1,E=0;for(;E<d.length&&(s.lastIndex=E,p=s.exec(d),p!==null);)E=s.lastIndex,s===to?p[1]==="!--"?s=nh:p[1]!==void 0?s=oh:p[2]!==void 0?(uh.test(p[2])&&(n=RegExp("</"+p[2],"g")),s=Ni):p[3]!==void 0&&(s=Ni):s===Ni?p[0]===">"?(s=n??to,f=-1):p[1]===void 0?f=-2:(f=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?Ni:p[3]==='"'?ah:sh):s===ah||s===sh?s=Ni:s===nh||s===oh?s=to:(s=Ni,n=void 0);let m=s===Ni&&i[l+1].startsWith("/>")?" ":"";o+=s===to?d+Vv:f>=0?(r.push(h),d.slice(0,f)+dh+d.slice(f)+ei+m):d+ei+(f===-2?l:m)}return[hh(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},oo=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,s=0,l=e.length-1,d=this.parts,[h,p]=Wv(e,t);if(this.el=i.createElement(h,r),Ui.currentNode=this.el.content,t===2||t===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(n=Ui.nextNode())!==null&&d.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let f of n.getAttributeNames())if(f.endsWith(dh)){let E=p[s++],m=n.getAttribute(f).split(ei),_=/([.?@])?(.*)/.exec(E);d.push({type:1,index:o,name:_[2],strings:m,ctor:_[1]==="."?ud:_[1]==="?"?hd:_[1]==="@"?pd:Mr}),n.removeAttribute(f)}else f.startsWith(ei)&&(d.push({type:6,index:o}),n.removeAttribute(f));if(uh.test(n.tagName)){let f=n.textContent.split(ei),E=f.length-1;if(E>0){n.textContent=Ns?Ns.emptyScript:"";for(let m=0;m<E;m++)n.append(f[m],ro()),Ui.nextNode(),d.push({type:2,index:++o});n.append(f[E],ro())}}}else if(n.nodeType===8)if(n.data===ch)d.push({type:2,index:o});else{let f=-1;for(;(f=n.data.indexOf(ei,f+1))!==-1;)d.push({type:7,index:o}),f+=ei.length-1}o++}}static createElement(e,t){let r=Hi.createElement("template");return r.innerHTML=e,r}};function Rr(i,e,t=i,r){var s,l;if(e===$i)return e;let n=r!==void 0?(s=t._$Co)==null?void 0:s[r]:t._$Cl,o=no(e)?void 0:e._$litDirective$;return(n==null?void 0:n.constructor)!==o&&((l=n==null?void 0:n._$AO)==null||l.call(n,!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=n:t._$Cl=n),n!==void 0&&(e=Rr(i,n._$AS(i,e.values),n,r)),e}var cd=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,n=((e==null?void 0:e.creationScope)??Hi).importNode(t,!0);Ui.currentNode=n;let o=Ui.nextNode(),s=0,l=0,d=r[0];for(;d!==void 0;){if(s===d.index){let h;d.type===2?h=new so(o,o.nextSibling,this,e):d.type===1?h=new d.ctor(o,d.name,d.strings,this,e):d.type===6&&(h=new md(o,this,e)),this._$AV.push(h),d=r[++l]}s!==(d==null?void 0:d.index)&&(o=Ui.nextNode(),s++)}return Ui.currentNode=Hi,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},so=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=ye,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Rr(this,e,t),no(e)?e===ye||e==null||e===""?(this._$AH!==ye&&this._$AR(),this._$AH=ye):e!==this._$AH&&e!==$i&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Bv(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!==ye&&no(this._$AH)?this._$AA.nextSibling.data=e:this.T(Hi.createTextNode(e)),this._$AH=e}$(e){var o;let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=oo.createElement(hh(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===n)this._$AH.p(t);else{let s=new cd(n,this),l=s.u(this.options);s.p(t),this.T(l),this._$AH=s}}_$AC(e){let t=lh.get(e.strings);return t===void 0&&lh.set(e.strings,t=new oo(e)),t}k(e){vd(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let o of e)n===t.length?t.push(r=new i(this.O(ro()),this.O(ro()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let n=ih(e).nextSibling;ih(e).remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Mr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=ye,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ye}_$AI(e,t=this,r,n){let o=this.strings,s=!1;if(o===void 0)e=Rr(this,e,t,0),s=!no(e)||e!==this._$AH&&e!==$i,s&&(this._$AH=e);else{let l=e,d,h;for(e=o[0],d=0;d<o.length-1;d++)h=Rr(this,l[r+d],t,d),h===$i&&(h=this._$AH[d]),s||(s=!no(h)||h!==this._$AH[d]),h===ye?e=ye:e!==ye&&(e+=(h??"")+o[d+1]),this._$AH[d]=h}s&&!n&&this.j(e)}j(e){e===ye?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ud=class extends Mr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ye?void 0:e}},hd=class extends Mr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ye)}},pd=class extends Mr{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=Rr(this,e,t,0)??ye)===$i)return;let r=this._$AH,n=e===ye&&r!==ye||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==ye&&(r===ye||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},md=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){Rr(this,e)}};var dd=io.litHtmlPolyfillSupport;dd==null||dd(oo,so),(io.litHtmlVersions??(io.litHtmlVersions=[])).push("3.3.2");var ph=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,n=r._$litPart$;if(n===void 0){let o=(t==null?void 0:t.renderBefore)??null;r._$litPart$=n=new so(e.insertBefore(ro(),o),o,void 0,t??{})}return n._$AI(i),n};var Vi=globalThis,De=class extends Ht{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=ph(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 $i}},mh;De._$litElement$=!0,De.finalized=!0,(mh=Vi.litElementHydrateSupport)==null||mh.call(Vi,{LitElement:De});var Ed=Vi.litElementPolyfillSupport;Ed==null||Ed({LitElement:De});(Vi.litElementVersions??(Vi.litElementVersions=[])).push("4.2.2");var ti=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Fv={attribute:!0,type:String,converter:eo,reflect:!1,hasChanged:Os},qv=(i=Fv,e,t)=>{let{kind:r,metadata:n}=t,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(t.name,i),r==="accessor"){let{name:s}=t;return{set(l){let d=e.get.call(this);e.set.call(this,l),this.requestUpdate(s,d,i,!0,l)},init(l){return l!==void 0&&this.C(s,void 0,i,l),l}}}if(r==="setter"){let{name:s}=t;return function(l){let d=this[s];e.call(this,l),this.requestUpdate(s,d,i,!0,l)}}throw Error("Unsupported decorator location: "+r)};function Q(i){return(e,t)=>typeof t=="object"?qv(i,e,t):((r,n,o)=>{let s=n.hasOwnProperty(o);return n.constructor.createProperty(o,r),s?Object.getOwnPropertyDescriptor(n,o):void 0})(i,e,t)}function ii(i){return Q({...i,state:!0,attribute:!1})}var vh=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Hs(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 $s(i){return i===4e3||i===4001?"network":"unknown"}function ao(){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 lo(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function co(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function Vs(i){return lo(i)||co(i)}var rt=class extends Error{constructor(t,r,n){super(t);this.code=r;this.status=n;this.name="BPLiveError"}},xr=class{constructor(e,t){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null,this._network=t??null}get config(){return this._config}get authToken(){return this._authToken}get stream(){return this._stream}get clip(){return this._clip}async fetch(e){if(!this._authToken)throw new rt("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r={"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`};if(this._network){let s=await this._network.intercept({url:t,method:"GET",type:"api",headers:r});if(s.response)return s.response.body;t=s.url,r=s.headers}let n=new AbortController,o=setTimeout(()=>n.abort(),3e4);try{let s=await fetch(t,{method:"GET",headers:r,signal:n.signal});if(!s.ok)throw new rt(`HTTP ${s.status}: ${s.statusText}`,"HTTP_ERROR",s.status);let l=await s.json();return this._network&&(l=(await this._network.interceptResponse({url:t,status:s.status,headers:Object.fromEntries(s.headers),body:l})).body),l}catch(s){throw s instanceof Error&&s.name==="AbortError"?new rt("Request timeout after 30s","TIMEOUT"):s}finally{clearTimeout(o)}}async getStream(e){return this.fetch(`/streams/${e}`)}async getClip(e){return this.fetch(`/clips/${e}`)}mapPlayerSourceToResolvedSource(e){if(e.provider==="livekit")return{type:"livekit",url:e.url,token:e.token,room:e.room};if(e.provider==="nanoplayer"){let{provider:t,...r}=e;return{type:"nano",source:r}}throw new rt(`Unknown player source provider: ${e.provider}`,"UNKNOWN_PROVIDER")}selectClipMedia(e,t="landscape"){let r=e.filter(l=>l.type==="clip");if(r.length===0)return null;let n=r.find(l=>l.orientation===t);if(n)return n;let o=t==="landscape"?"portrait":"landscape",s=r.find(l=>l.orientation===o);return s||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,lo(e))return this.resolveStreamSource(e);if(co(e))return this.resolveClipSource(e);throw new rt("Invalid BPLive source","INVALID_SOURCE")}extractStreamPoster(e){var t;return e.cover_photo??((t=e.channel)==null?void 0:t.cover_image)??void 0}async resolveStreamSource(e){var l,d,h,p,f,E,m,_,g;let r=(await this.getStream(e.streamId)).data;this._stream=r;let n=this.extractStreamPoster(r);if(!!r.ended_at&&((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let I=r.media.vod[0];return{source:{type:"video",url:I.original},contentType:"video",poster:n??I.thumb??void 0,videoWidth:(h=I.dimension)==null?void 0:h.width,videoHeight:(p=I.dimension)==null?void 0:p.height}}let s=r.player_source??((f=r.active_stream)==null?void 0:f.player_source);if(s)return{source:this.mapPlayerSourceToResolvedSource(s),contentType:"stream",poster:n};if(((m=(E=r.media)==null?void 0:E.vod)==null?void 0:m.length)>0){let I=r.media.vod[0];return{source:{type:"video",url:I.original},contentType:"video",poster:n??I.thumb??void 0,videoWidth:(_=I.dimension)==null?void 0:_.width,videoHeight:(g=I.dimension)==null?void 0:g.height}}throw new rt("Stream is not live and has no VOD content","STREAM_OFFLINE")}async resolveClipSource(e){let r=(await this.getClip(e.clipId)).data;this._clip=r;let n=this.selectClipMedia(r.media,e.preferredOrientation);if(!n)throw new rt("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(n),contentType:"clip",poster:n.thumbnail??void 0,videoWidth:n.width,videoHeight:n.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function uo(i){return i!=null&&typeof i.then=="function"}function fh(i){return new Promise((e,t)=>{let r=!1,n=o=>{r||(r=!0,o?t(o):e())};try{let o=i(n);uo(o)&&(r=!0,o.then(()=>e(),t))}catch(o){n(o)}})}var gd=class{constructor(e,t,r){this._closed=!1;this._pendingCount=0;this._firstError=null;this._redirectResult=null;this._responseResult=null;this.promise=new Promise((n,o)=>{this._resolve=n,this._reject=o}),this._state=e,this._interceptor=t,this._canModify=r,this._start()}get redirectResult(){return this._redirectResult}get responseResult(){return this._responseResult}get _open(){return this._canModify&&!this._closed}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());uo(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get method(){return e._state.method},get type(){return e._state.type},get headers(){return{...e._state.headers}},get closed(){return!e._open},redirect(t){e._redirect(t)},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_redirect(e){if(!this._open)throw new Error("Request is closed");let t=typeof e=="string"?{url:e}:e;this._redirectResult={url:t.url??this._state.url,method:t.method??this._state.method,type:this._state.type,headers:t.headers??{...this._state.headers}},this._close()}_respondWith(e){if(!this._open)throw new Error("Request is closed");this._responseResult=e,this._close()}_waitUntil(e){if(!this._open)throw new Error("Request is closed");uo(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(fh(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},bd=class{constructor(e,t){this._closed=!1;this._pendingCount=0;this._firstError=null;this._responseResult=null;this.promise=new Promise((r,n)=>{this._resolve=r,this._reject=n}),this._state=e,this._interceptor=t,this._start()}get responseResult(){return this._responseResult}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());uo(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get status(){return e._state.status},get headers(){return{...e._state.headers}},get body(){return e._state.body},get closed(){return e._closed},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_respondWith(e){if(this._closed)throw new Error("Response is closed");this._responseResult=e,this._close()}_waitUntil(e){if(this._closed)throw new Error("Response is closed");uo(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(fh(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},ho=class{constructor(){this._requestInterceptors=[];this._responseInterceptors=[]}addRequestInterceptor(e){this._requestInterceptors.unshift(e)}removeRequestInterceptor(e){let t=this._requestInterceptors.indexOf(e);t>=0&&this._requestInterceptors.splice(t,1)}addResponseInterceptor(e){this._responseInterceptors.unshift(e)}removeResponseInterceptor(e){let t=this._responseInterceptors.indexOf(e);t>=0&&this._responseInterceptors.splice(t,1)}async intercept(e){let t={...e,headers:{...e.headers}},r=!1,n=null;for(let o of this._requestInterceptors.slice()){let s=new gd(t,o,!r);try{await s.promise}catch{continue}s.responseResult&&!r&&(r=!0,n=s.responseResult),s.redirectResult&&!r&&(t=s.redirectResult)}return{url:t.url,headers:t.headers,response:n}}async interceptResponse(e){let t={...e,headers:{...e.headers}};for(let r of this._responseInterceptors.slice()){let n=new bd(t,r);try{await n.promise}catch{continue}n.responseResult&&(t={...t,status:n.responseResult.status!==void 0?n.responseResult.status:t.status,headers:n.responseResult.headers!==void 0?n.responseResult.headers:t.headers,body:"body"in n.responseResult?n.responseResult.body:t.body})}return{status:t.status,headers:t.headers,body:t.body}}};function Kv(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 Eh(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var Gv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],_d=class{constructor(){this._mediaElement=null;this._container=null;this._webkitFullscreen=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._network=new ho;this._currentProviderType=null;this._ready=!1;this._loadGeneration=0;this._state=ao()}get state(){return this._state}get videoElement(){return this._mediaElement}get activeVideoElement(){let e=this._mediaElement;return(e==null?void 0:e.activeVideoElement)??null}get bpLive(){return this._bpLive}get network(){return this._network}get ready(){return this._ready}get providerType(){return this._currentProviderType}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r)this._listeners.has(n)||this._listeners.set(n,new Set),this._listeners.get(n).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r){let o=this._listeners.get(n);o&&(o.delete(t),o.size===0&&this._listeners.delete(n))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let n of r)try{n(t)}catch(o){console.error(`[PlayerCore] Error in event listener for "${e}":`,o)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}attach(e,t){this._destroyed||(this._container=e,this._config=t,this._ready=!0)}async loadSource(e,t,r){if(this._destroyed)return;let n=++this._loadGeneration,o=t??this._container,s=r??this._config;if(!o){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=o,s&&(this._config=s);let l=Eh(e)?"clipId"in e?"clip":"stream":void 0;this.updateState({error:null,connectionState:"connecting",ended:!1,...l&&{contentType:l}}),this.dispatch("sourcechange",{source:e});try{let d=e,h=this._state.contentType,p,f,E;if(Eh(e)){if(s!=null&&s.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new xr(s.bpLive,this._network)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let L=await this._bpLive.resolveSource(e);if(n!==this._loadGeneration)return;d=L.source,h=L.contentType,p=L.poster,f=L.videoWidth,E=L.videoHeight}let m=Kv(d),I=m==="nano"||m==="livekit"||h==="stream"?"live":"vod";return this._mediaElement&&this.destroyMediaElement(),this._currentProviderType=m,this.updateState({providerType:m,contentType:h,streamType:I,paused:!0,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this._mediaElement=this.createMediaElement(m,d,s),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),this.attachActiveVideoElementForwarding(this._mediaElement),o.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),this.dispatch("activevideoelementchange",{video:this.activeVideoElement}),{poster:p,videoWidth:f,videoHeight:E}}catch(d){if(n!==this._loadGeneration)return;console.error("[PlayerCore] loadSource error:",d);let h={code:-1,message:d instanceof Error?d.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:h,connectionState:"failed"}),this.dispatch("error",h)}}destroyMediaElement(){if(this._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null,this.dispatch("emptied",void 0),this.dispatch("videoelementchange",{video:null}),this.dispatch("activevideoelementchange",{video:null})),this._container)for(;this._container.firstChild;)this._container.removeChild(this._container.firstChild)}createMediaElement(e,t,r){switch(e){case"nano":{let n=document.createElement("nano-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=t;return n.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",o.source?n.sourceConfig=o.source:o.streamid&&(n.streamid=o.streamid),r!=null&&r.nano&&(n.config=r.nano),n}case"livekit":{let n=document.createElement("livekit-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=t;return n.url=o.url,n.token=o.token,r!=null&&r.livekit&&(n.config=r.livekit),n}case"video":default:{let n=document.createElement("hls-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=typeof t=="string"?t:t.url;n.src=o;let s={...r==null?void 0:r.video},l=this._network,d=s.xhrSetup;return s.xhrSetup=async(h,p)=>{let f=p.includes(".m3u8")?"manifest":p.includes(".ts")||p.includes(".m4s")||p.includes(".fmp4")?"segment":"other",E=await l.intercept({url:p,method:"GET",type:f,headers:{}});E.url!==p&&h.open("GET",E.url,!0);for(let[m,_]of Object.entries(E.headers))h.setRequestHeader(m,_);d&&await d(h,E.url)},n.config=s,n}}}attachMediaElementListeners(e){for(let t of Gv){let r=n=>this.handleMediaEvent(t,e,n);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}attachActiveVideoElementForwarding(e){let t=r=>{let n=r.detail;this.dispatch("activevideoelementchange",{video:(n==null?void 0:n.video)??null})};e.addEventListener("activevideoelementchange",t),this._eventCleanup.push(()=>e.removeEventListener("activevideoelementchange",t))}handleMediaEvent(e,t,r){var n,o,s,l;switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:d}),this.dispatch("loadedmetadata",{duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight});break}case"loadeddata":this.updateState({readyState:2}),this.dispatch("loadeddata",void 0);break;case"canplay":this.updateState({readyState:3,connectionState:"connected"}),this.dispatch("canplay",void 0),this.dispatch("connectionstatechange",{state:"connected"});break;case"canplaythrough":this.updateState({readyState:4}),this.dispatch("canplaythrough",void 0);break;case"play":this.updateState({paused:!1,ended:!1}),this.dispatch("play",void 0);break;case"playing":this.updateState({paused:!1,playing:!0,ended:!1,waiting:!1,readyState:4}),this.dispatch("playing",void 0);break;case"pause":this.updateState({paused:!0,playing:!1,waiting:!1}),this.dispatch("pause",void 0);break;case"waiting":this.updateState({playing:!1,waiting:!0,readyState:2}),this.dispatch("waiting",void 0);break;case"seeking":this.updateState({seeking:!0,currentTime:t.currentTime}),this.dispatch("seeking",{currentTime:t.currentTime});break;case"seeked":this.updateState({seeking:!1,currentTime:t.currentTime}),this.dispatch("seeked",{currentTime:t.currentTime});break;case"timeupdate":this.updateState({currentTime:t.currentTime,duration:t.duration}),this.dispatch("timeupdate",{currentTime:t.currentTime,duration:t.duration});break;case"durationchange":{let d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:d}),this.dispatch("durationchange",{duration:t.duration}),this.dispatch("streamtypechange",{streamType:this._state.streamType});break}case"ratechange":this.updateState({playbackRate:t.playbackRate}),this.dispatch("ratechange",{playbackRate:t.playbackRate});break;case"volumechange":this.updateState({volume:t.volume,muted:t.muted}),this.dispatch("volumechange",{volume:t.volume,muted:t.muted});break;case"ended":this.updateState({ended:!0,paused:!0,playing:!1}),this.dispatch("ended",void 0);break;case"progress":this.updateState({buffered:t.buffered}),this.dispatch("progress",{buffered:t.buffered});break;case"error":{let d=-1,h="Unknown error",p="none";r instanceof ErrorEvent&&r.error?(d=r.error.code??-1,h=r.error.message??r.message??"Unknown error",p="ErrorEvent"):t.error&&(d=t.error.code??-1,h=t.error.message??"Unknown error",p="element.error");let f=t.nativeEl;console.error("[PlayerCore] error event",{providerType:this._state.providerType,elementTag:t.tagName,eventTarget:(n=r.target)==null?void 0:n.tagName,source:p,code:d,message:h,eventIsErrorEvent:r instanceof ErrorEvent,eventErrorCode:r instanceof ErrorEvent?(o=r.error)==null?void 0:o.code:void 0,elementErrorCode:(s=t.error)==null?void 0:s.code,nativeElTag:f==null?void 0:f.tagName,nativeElErrorCode:(l=f==null?void 0:f.error)==null?void 0:l.code,nativeElSrc:f==null?void 0:f.currentSrc,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState});let E="media",m=!0;this._state.providerType==="nano"&&d>0?(E=Hs(d),m=E!=="offline"&&E!=="autoplay"):this._state.providerType==="livekit"&&d>0&&(E=$s(d),m=!0);let _={code:d,message:h,fatal:m,category:E};this.updateState({error:_}),this.dispatch("error",_);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.destroyMediaElement(),this._currentProviderType=null,this.updateState({...ao(),volume:this._state.volume,muted:this._state.muted,loop:this._state.loop,playbackRate:this._state.playbackRate}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1});try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this._mediaElement.pause())}seek(e){this._mediaElement&&(this._mediaElement.currentTime=e)}setVolume(e){let t=Math.max(0,Math.min(1,e));this.updateState({volume:t}),this._mediaElement&&(this._mediaElement.volume=t),this.dispatch("volumechange",{volume:t,muted:this._state.muted})}setMuted(e){this.updateState({muted:e}),this._mediaElement&&(this._mediaElement.muted=e),this.dispatch("volumechange",{volume:this._state.volume,muted:e})}setLoop(e){this.updateState({loop:e}),this._mediaElement&&(this._mediaElement.loop=e)}setPlaybackRate(e){this.updateState({playbackRate:e}),this._mediaElement&&(this._mediaElement.playbackRate=e),this.dispatch("ratechange",{playbackRate:e})}setTargetQuality(e){this.updateState({targetQuality:e}),this.dispatch("targetqualitychanged",{quality:e});let t=this._mediaElement;t!=null&&t.videoRenditions&&(t.videoRenditions.selectedIndex=(e==null?void 0:e.index)??-1)}setQuality(e){this.setTargetQuality(e)}_getFullscreenTarget(){return this._container?this._container.closest("media-controller")??this._container.parentElement:null}async setFullscreen(e){var t;if(this._applyFullscreenState(e),e){let r=this._getFullscreenTarget();if(!r){this._applyFullscreenState(!1);return}if(document.fullscreenElement){document.fullscreenElement!==r&&this._applyFullscreenState(!1);return}if(typeof r.requestFullscreen=="function")try{await r.requestFullscreen()}catch(n){throw this._applyFullscreenState(!1),n}else this._enterWebkitVideoFullscreen()}else if(document.fullscreenElement)await document.exitFullscreen();else{let r=this._webkitFullscreen,n=(r==null?void 0:r.video)??this.activeVideoElement;n!=null&&n.webkitDisplayingFullscreen&&(r==null||r.disarm(),(t=n.webkitExitFullscreen)==null||t.call(n))}}_applyFullscreenState(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"})}_enterWebkitVideoFullscreen(){var n;let e=this.activeVideoElement;if(!(e!=null&&e.webkitEnterFullscreen)){this._applyFullscreenState(!1);return}(n=this._webkitFullscreen)==null||n.disarm();let t=()=>{this._webkitFullscreen=null,this._applyFullscreenState(!1)};e.addEventListener("webkitendfullscreen",t,{once:!0});let r={video:e,disarm:()=>{this._webkitFullscreen=null,e.removeEventListener("webkitendfullscreen",t)}};if(this._webkitFullscreen=r,!e.webkitDisplayingFullscreen)try{e.webkitEnterFullscreen()}catch(o){throw r.disarm(),this._applyFullscreenState(!1),o}}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){var e;this._destroyed||(this._destroyed=!0,(e=this._webkitFullscreen)==null||e.disarm(),this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function Bs(){return new _d}var Bi="bpPlayerObservedProperties";function Ws(i){return Bi in i&&Array.isArray(i[Bi])}function gh(i,e){class t extends i{get[Bi](){return e}}return t}function zv(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 Wi(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!Ws(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),Ws(i)&&t(i);let r=zv(i);r.length>0&&await Promise.all(r.map(n=>Wi(n,e,t)))}function po(i,e,t){let r=i[Bi];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 mo(i){i[Bi].includes("player")&&(i.player=void 0)}var bh=`/**
5
+ "use strict";var BPPlayer=(()=>{var Iv=Object.create;var xr=Object.defineProperty;var Qu=Object.getOwnPropertyDescriptor;var Cv=Object.getOwnPropertyNames;var Zu=Object.getPrototypeOf,Rv=Object.prototype.hasOwnProperty;var Mv=Reflect.get;var Xu=i=>{throw TypeError(i)};var xv=(i,e,t)=>e in i?xr(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var ju=(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 Pv=(i,e)=>{for(var t in e)xr(i,t,{get:e[t],enumerable:!0})},Ju=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Cv(e))!Rv.call(i,n)&&n!==t&&xr(i,n,{get:()=>e[n],enumerable:!(r=Qu(e,n))||r.enumerable});return i};var Dv=(i,e,t)=>(t=i!=null?Iv(Zu(i)):{},Ju(e||!i||!i.__esModule?xr(t,"default",{value:i,enumerable:!0}):t,i)),Ov=i=>Ju(xr({},"__esModule",{value:!0}),i),V=(i,e,t,r)=>{for(var n=r>1?void 0:r?Qu(e,t):e,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&xr(e,t,n),n};var q=(i,e,t)=>xv(i,typeof e!="symbol"?e+"":e,t),sd=(i,e,t)=>e.has(i)||Xu("Cannot "+t);var c=(i,e,t)=>(sd(i,e,"read from private field"),t?t.call(i):e.get(i)),k=(i,e,t)=>e.has(i)?Xu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),m=(i,e,t,r)=>(sd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),C=(i,e,t)=>(sd(i,e,"access private method"),t);var ad=(i,e,t)=>Mv(Zu(i),t,e);var Ub={};Pv(Ub,{Attribute:()=>Eo,BPDefaultUI:()=>de,BPErrorDisplay:()=>zt,BPLiveError:()=>st,BPLiveService:()=>Or,BPOverlay:()=>Ht,BPPlayer:()=>Me,HLS_ERROR_CODES:()=>Xe,Hls:()=>be.default,HlsVideo:()=>Pi,HlsVideoElement:()=>ku,LiveKitVideo:()=>Cr,LiveKitVideoElement:()=>Cu,NANOPLAYER_NO_REPLAY_CODES:()=>gh,NanoVideo:()=>Ui,NanoVideoElement:()=>wu,StateReceiverMixin:()=>yh,StateReceiverProps:()=>Ki,addGlobalStyles:()=>Nr,classifyHlsError:()=>Ws,classifyLiveKitError:()=>Bs,classifyNanoPlayerError:()=>Vs,createInitialState:()=>co,createPlayerCore:()=>Ks,createTemplate:()=>kh,forEachStateReceiverElement:()=>qi,isBPLiveClipSource:()=>ho,isBPLiveSource:()=>Fs,isBPLiveStreamSource:()=>uo,isStateReceiverElement:()=>qs,propagateStateToReceiver:()=>vo,removeStateFromReceiver:()=>fo,templateWithStyles:()=>Lh,toggleAttribute:()=>_e});var Os=globalThis,Ns=Os.ShadowRoot&&(Os.ShadyCSS===void 0||Os.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ld=Symbol(),eh=new WeakMap,Jn=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==ld)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(Ns&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=eh.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&eh.set(t,e))}return e}toString(){return this.cssText}},th=i=>new Jn(typeof i=="string"?i:i+"",void 0,ld),eo=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1],i[0]);return new Jn(t,i,ld)},ih=(i,e)=>{if(Ns)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=Os.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},dd=Ns?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return th(t)})(i):i;var{is:Nv,defineProperty:Uv,getOwnPropertyDescriptor:Hv,getOwnPropertyNames:$v,getOwnPropertySymbols:Vv,getPrototypeOf:Bv}=Object,ti=globalThis,rh=ti.trustedTypes,Wv=rh?rh.emptyScript:"",cd=ti.reactiveElementPolyfillSupport,to=(i,e)=>i,io={toAttribute(i,e){switch(e){case Boolean:i=i?Wv: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}},Us=(i,e)=>!Nv(i,e),nh={attribute:!0,type:String,converter:io,reflect:!1,useDefault:!1,hasChanged:Us};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ti.litPropertyMetadata??(ti.litPropertyMetadata=new WeakMap);var Vt=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=nh){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Uv(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:o}=Hv(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:n,set(s){let l=n==null?void 0:n.call(this);o==null||o.call(this,s),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??nh}static _$Ei(){if(this.hasOwnProperty(to("elementProperties")))return;let e=Bv(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(to("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(to("properties"))){let t=this.properties,r=[...$v(t),...Vv(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(dd(n))}else e!==void 0&&t.push(dd(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 ih(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var o;let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let s=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:io).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,t){var o,s;let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let l=r.getPropertyOptions(n),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((o=l.converter)==null?void 0:o.fromAttribute)!==void 0?l.converter:io;this._$Em=n;let h=d.fromAttribute(t,l.type);this[n]=h??((s=this._$Ej)==null?void 0:s.get(n))??h,this._$Em=null}}requestUpdate(e,t,r,n=!1,o){var s;if(e!==void 0){let l=this.constructor;if(n===!1&&(o=this[e]),r??(r=l.getPropertyOptions(e)),!((r.hasChanged??Us)(o,t)||r.useDefault&&r.reflect&&o===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(l._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:o},s){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,s??t??this[e]),o!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[o,s]of n){let{wrapped:l}=s,d=this[o];l!==!0||this._$AL.has(o)||d===void 0||this.C(o,void 0,s,d)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var n;return(n=r.hostUpdated)==null?void 0:n.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Vt.elementStyles=[],Vt.shadowRootOptions={mode:"open"},Vt[to("elementProperties")]=new Map,Vt[to("finalized")]=new Map,cd==null||cd({ReactiveElement:Vt}),(ti.reactiveElementVersions??(ti.reactiveElementVersions=[])).push("2.1.2");var no=globalThis,oh=i=>i,Hs=no.trustedTypes,sh=Hs?Hs.createPolicy("lit-html",{createHTML:i=>i}):void 0,hh="$lit$",ii=`lit$${Math.random().toFixed(9).slice(2)}$`,ph="?"+ii,Fv=`<${ph}>`,Bi=document,oo=()=>Bi.createComment(""),so=i=>i===null||typeof i!="object"&&typeof i!="function",gd=Array.isArray,Kv=i=>gd(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",ud=`[
6
+ \f\r]`,ro=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ah=/-->/g,lh=/>/g,$i=RegExp(`>|${ud}(?:([^\\s"'>=/]+)(${ud}*=${ud}*(?:[^
7
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),dh=/'/g,ch=/"/g,mh=/^(?:script|style|textarea|title)$/i,bd=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ze=bd(1),Kb=bd(2),qb=bd(3),Wi=Symbol.for("lit-noChange"),Ae=Symbol.for("lit-nothing"),uh=new WeakMap,Vi=Bi.createTreeWalker(Bi,129);function vh(i,e){if(!gd(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return sh!==void 0?sh.createHTML(e):e}var qv=(i,e)=>{let t=i.length-1,r=[],n,o=e===2?"<svg>":e===3?"<math>":"",s=ro;for(let l=0;l<t;l++){let d=i[l],h,p,g=-1,f=0;for(;f<d.length&&(s.lastIndex=f,p=s.exec(d),p!==null);)f=s.lastIndex,s===ro?p[1]==="!--"?s=ah:p[1]!==void 0?s=lh:p[2]!==void 0?(mh.test(p[2])&&(n=RegExp("</"+p[2],"g")),s=$i):p[3]!==void 0&&(s=$i):s===$i?p[0]===">"?(s=n??ro,g=-1):p[1]===void 0?g=-2:(g=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?$i:p[3]==='"'?ch:dh):s===ch||s===dh?s=$i:s===ah||s===lh?s=ro:(s=$i,n=void 0);let E=s===$i&&i[l+1].startsWith("/>")?" ":"";o+=s===ro?d+Fv:g>=0?(r.push(h),d.slice(0,g)+hh+d.slice(g)+ii+E):d+ii+(g===-2?l:E)}return[vh(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ao=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,s=0,l=e.length-1,d=this.parts,[h,p]=qv(e,t);if(this.el=i.createElement(h,r),Vi.currentNode=this.el.content,t===2||t===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(n=Vi.nextNode())!==null&&d.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let g of n.getAttributeNames())if(g.endsWith(hh)){let f=p[s++],E=n.getAttribute(g).split(ii),y=/([.?@])?(.*)/.exec(f);d.push({type:1,index:o,name:y[2],strings:E,ctor:y[1]==="."?md:y[1]==="?"?vd:y[1]==="@"?fd:Dr}),n.removeAttribute(g)}else g.startsWith(ii)&&(d.push({type:6,index:o}),n.removeAttribute(g));if(mh.test(n.tagName)){let g=n.textContent.split(ii),f=g.length-1;if(f>0){n.textContent=Hs?Hs.emptyScript:"";for(let E=0;E<f;E++)n.append(g[E],oo()),Vi.nextNode(),d.push({type:2,index:++o});n.append(g[f],oo())}}}else if(n.nodeType===8)if(n.data===ph)d.push({type:2,index:o});else{let g=-1;for(;(g=n.data.indexOf(ii,g+1))!==-1;)d.push({type:7,index:o}),g+=ii.length-1}o++}}static createElement(e,t){let r=Bi.createElement("template");return r.innerHTML=e,r}};function Pr(i,e,t=i,r){var s,l;if(e===Wi)return e;let n=r!==void 0?(s=t._$Co)==null?void 0:s[r]:t._$Cl,o=so(e)?void 0:e._$litDirective$;return(n==null?void 0:n.constructor)!==o&&((l=n==null?void 0:n._$AO)==null||l.call(n,!1),o===void 0?n=void 0:(n=new o(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=n:t._$Cl=n),n!==void 0&&(e=Pr(i,n._$AS(i,e.values),n,r)),e}var pd=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,n=((e==null?void 0:e.creationScope)??Bi).importNode(t,!0);Vi.currentNode=n;let o=Vi.nextNode(),s=0,l=0,d=r[0];for(;d!==void 0;){if(s===d.index){let h;d.type===2?h=new lo(o,o.nextSibling,this,e):d.type===1?h=new d.ctor(o,d.name,d.strings,this,e):d.type===6&&(h=new Ed(o,this,e)),this._$AV.push(h),d=r[++l]}s!==(d==null?void 0:d.index)&&(o=Vi.nextNode(),s++)}return Vi.currentNode=Bi,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},lo=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=Ae,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Pr(this,e,t),so(e)?e===Ae||e==null||e===""?(this._$AH!==Ae&&this._$AR(),this._$AH=Ae):e!==this._$AH&&e!==Wi&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Kv(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&&so(this._$AH)?this._$AA.nextSibling.data=e:this.T(Bi.createTextNode(e)),this._$AH=e}$(e){var o;let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ao.createElement(vh(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===n)this._$AH.p(t);else{let s=new pd(n,this),l=s.u(this.options);s.p(t),this.T(l),this._$AH=s}}_$AC(e){let t=uh.get(e.strings);return t===void 0&&uh.set(e.strings,t=new ao(e)),t}k(e){gd(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let o of e)n===t.length?t.push(r=new i(this.O(oo()),this.O(oo()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let n=oh(e).nextSibling;oh(e).remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Dr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=Ae,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Ae}_$AI(e,t=this,r,n){let o=this.strings,s=!1;if(o===void 0)e=Pr(this,e,t,0),s=!so(e)||e!==this._$AH&&e!==Wi,s&&(this._$AH=e);else{let l=e,d,h;for(e=o[0],d=0;d<o.length-1;d++)h=Pr(this,l[r+d],t,d),h===Wi&&(h=this._$AH[d]),s||(s=!so(h)||h!==this._$AH[d]),h===Ae?e=Ae:e!==Ae&&(e+=(h??"")+o[d+1]),this._$AH[d]=h}s&&!n&&this.j(e)}j(e){e===Ae?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},md=class extends Dr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ae?void 0:e}},vd=class extends Dr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Ae)}},fd=class extends Dr{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=Pr(this,e,t,0)??Ae)===Wi)return;let r=this._$AH,n=e===Ae&&r!==Ae||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==Ae&&(r===Ae||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},Ed=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){Pr(this,e)}};var hd=no.litHtmlPolyfillSupport;hd==null||hd(ao,lo),(no.litHtmlVersions??(no.litHtmlVersions=[])).push("3.3.2");var fh=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,n=r._$litPart$;if(n===void 0){let o=(t==null?void 0:t.renderBefore)??null;r._$litPart$=n=new lo(e.insertBefore(oo(),o),o,void 0,t??{})}return n._$AI(i),n};var Fi=globalThis,Oe=class extends Vt{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=fh(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 Wi}},Eh;Oe._$litElement$=!0,Oe.finalized=!0,(Eh=Fi.litElementHydrateSupport)==null||Eh.call(Fi,{LitElement:Oe});var _d=Fi.litElementPolyfillSupport;_d==null||_d({LitElement:Oe});(Fi.litElementVersions??(Fi.litElementVersions=[])).push("4.2.2");var ri=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Gv={attribute:!0,type:String,converter:io,reflect:!1,hasChanged:Us},zv=(i=Gv,e,t)=>{let{kind:r,metadata:n}=t,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(t.name,i),r==="accessor"){let{name:s}=t;return{set(l){let d=e.get.call(this);e.set.call(this,l),this.requestUpdate(s,d,i,!0,l)},init(l){return l!==void 0&&this.C(s,void 0,i,l),l}}}if(r==="setter"){let{name:s}=t;return function(l){let d=this[s];e.call(this,l),this.requestUpdate(s,d,i,!0,l)}}throw Error("Unsupported decorator location: "+r)};function Z(i){return(e,t)=>typeof t=="object"?zv(i,e,t):((r,n,o)=>{let s=n.hasOwnProperty(o);return n.constructor.createProperty(o,r),s?Object.getOwnPropertyDescriptor(n,o):void 0})(i,e,t)}function ni(i){return Z({...i,state:!0,attribute:!1})}var gh=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Vs(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 Bs(i){return i===4e3||i===4001?"network":"unknown"}var Xe={network:6001,media:6002,keySystem:6003,other:6004,auth:6005};function Ws(i){switch(i){case Xe.network:return"network";case Xe.media:return"media";case Xe.keySystem:case Xe.auth:return"security";default:return"unknown"}}function co(){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 uo(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function ho(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function Fs(i){return uo(i)||ho(i)}var st=class extends Error{constructor(t,r,n){super(t);this.code=r;this.status=n;this.name="BPLiveError"}},Or=class{constructor(e,t){this._authToken=null;this._stream=null;this._clip=null;this._config=e,this._authToken=e.authToken??null,this._network=t??null}get config(){return this._config}get authToken(){return this._authToken}get stream(){return this._stream}get clip(){return this._clip}async fetch(e){if(!this._authToken)throw new st("No auth token provided. Ensure config.bpLive.authToken is set before loading a BPLive source.","AUTH_REQUIRED");let t=`${this._config.discoveryUrl}${e}`,r={"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this._authToken}`};if(this._network){let s=await this._network.intercept({url:t,method:"GET",type:"api",headers:r});if(s.response)return s.response.body;t=s.url,r=s.headers}let n=new AbortController,o=setTimeout(()=>n.abort(),3e4);try{let s=await fetch(t,{method:"GET",headers:r,signal:n.signal});if(!s.ok)throw new st(`HTTP ${s.status}: ${s.statusText}`,"HTTP_ERROR",s.status);let l=await s.json();return this._network&&(l=(await this._network.interceptResponse({url:t,status:s.status,headers:Object.fromEntries(s.headers),body:l})).body),l}catch(s){throw s instanceof Error&&s.name==="AbortError"?new st("Request timeout after 30s","TIMEOUT"):s}finally{clearTimeout(o)}}async getStream(e){return this.fetch(`/streams/${e}`)}async getClip(e){return this.fetch(`/clips/${e}`)}mapPlayerSourceToResolvedSource(e){if(e.provider==="livekit")return{type:"livekit",url:e.url,token:e.token,room:e.room};if(e.provider==="nanoplayer"){let{provider:t,...r}=e;return{type:"nano",source:r}}throw new st(`Unknown player source provider: ${e.provider}`,"UNKNOWN_PROVIDER")}selectClipMedia(e,t="landscape"){let r=e.filter(l=>l.type==="clip");if(r.length===0)return null;let n=r.find(l=>l.orientation===t);if(n)return n;let o=t==="landscape"?"portrait":"landscape",s=r.find(l=>l.orientation===o);return s||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,uo(e))return this.resolveStreamSource(e);if(ho(e))return this.resolveClipSource(e);throw new st("Invalid BPLive source","INVALID_SOURCE")}extractStreamPoster(e){var t;return e.cover_photo??((t=e.channel)==null?void 0:t.cover_image)??void 0}async resolveStreamSource(e){var l,d,h,p,g,f,E,y,v;let r=(await this.getStream(e.streamId)).data;this._stream=r;let n=this.extractStreamPoster(r);if(!!r.ended_at&&((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let S=r.media.vod[0];return{source:{type:"video",url:S.original},contentType:"video",poster:n??S.thumb??void 0,videoWidth:(h=S.dimension)==null?void 0:h.width,videoHeight:(p=S.dimension)==null?void 0:p.height}}let s=r.player_source??((g=r.active_stream)==null?void 0:g.player_source);if(s)return{source:this.mapPlayerSourceToResolvedSource(s),contentType:"stream",poster:n};if(((E=(f=r.media)==null?void 0:f.vod)==null?void 0:E.length)>0){let S=r.media.vod[0];return{source:{type:"video",url:S.original},contentType:"video",poster:n??S.thumb??void 0,videoWidth:(y=S.dimension)==null?void 0:y.width,videoHeight:(v=S.dimension)==null?void 0:v.height}}throw new st("Stream is not live and has no VOD content","STREAM_OFFLINE")}async resolveClipSource(e){let r=(await this.getClip(e.clipId)).data;this._clip=r;let n=this.selectClipMedia(r.media,e.preferredOrientation);if(!n)throw new st("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(n),contentType:"clip",poster:n.thumbnail??void 0,videoWidth:n.width,videoHeight:n.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function po(i){return i!=null&&typeof i.then=="function"}function bh(i){return new Promise((e,t)=>{let r=!1,n=o=>{r||(r=!0,o?t(o):e())};try{let o=i(n);po(o)&&(r=!0,o.then(()=>e(),t))}catch(o){n(o)}})}var yd=class{constructor(e,t,r){this._closed=!1;this._pendingCount=0;this._firstError=null;this._redirectResult=null;this._responseResult=null;this.promise=new Promise((n,o)=>{this._resolve=n,this._reject=o}),this._state=e,this._interceptor=t,this._canModify=r,this._start()}get redirectResult(){return this._redirectResult}get responseResult(){return this._responseResult}get _open(){return this._canModify&&!this._closed}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());po(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get method(){return e._state.method},get type(){return e._state.type},get headers(){return{...e._state.headers}},get closed(){return!e._open},redirect(t){e._redirect(t)},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_redirect(e){if(!this._open)throw new Error("Request is closed");let t=typeof e=="string"?{url:e}:e;this._redirectResult={url:t.url??this._state.url,method:t.method??this._state.method,type:this._state.type,headers:t.headers??{...this._state.headers}},this._close()}_respondWith(e){if(!this._open)throw new Error("Request is closed");this._responseResult=e,this._close()}_waitUntil(e){if(!this._open)throw new Error("Request is closed");po(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(bh(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},Td=class{constructor(e,t){this._closed=!1;this._pendingCount=0;this._firstError=null;this._responseResult=null;this.promise=new Promise((r,n)=>{this._resolve=r,this._reject=n}),this._state=e,this._interceptor=t,this._start()}get responseResult(){return this._responseResult}_close(){this._closed=!0,this._resolve()}_error(e){this._closed=!0,this._reject(e)}_start(){try{let e=this._interceptor(this._createFacade());po(e)?this._handleWaitUntil(e):!this._pendingCount&&!this._closed&&this._close()}catch(e){this._error(e)}}_createFacade(){let e=this;return{get url(){return e._state.url},get status(){return e._state.status},get headers(){return{...e._state.headers}},get body(){return e._state.body},get closed(){return e._closed},respondWith(t){e._respondWith(t)},waitUntil(t){e._waitUntil(t)}}}_respondWith(e){if(this._closed)throw new Error("Response is closed");this._responseResult=e,this._close()}_waitUntil(e){if(this._closed)throw new Error("Response is closed");po(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(bh(e))}async _handleWaitUntil(e){this._pendingCount++;try{await e}catch(t){this._firstError||(this._firstError=t)}this._pendingCount--,!this._pendingCount&&!this._closed&&(this._firstError?this._error(this._firstError):this._close())}},mo=class{constructor(){this._requestInterceptors=[];this._responseInterceptors=[]}addRequestInterceptor(e){this._requestInterceptors.unshift(e)}removeRequestInterceptor(e){let t=this._requestInterceptors.indexOf(e);t>=0&&this._requestInterceptors.splice(t,1)}addResponseInterceptor(e){this._responseInterceptors.unshift(e)}removeResponseInterceptor(e){let t=this._responseInterceptors.indexOf(e);t>=0&&this._responseInterceptors.splice(t,1)}async intercept(e){let t={...e,headers:{...e.headers}},r=!1,n=null;for(let o of this._requestInterceptors.slice()){let s=new yd(t,o,!r);try{await s.promise}catch{continue}s.responseResult&&!r&&(r=!0,n=s.responseResult),s.redirectResult&&!r&&(t=s.redirectResult)}return{url:t.url,headers:t.headers,response:n}}async interceptResponse(e){let t={...e,headers:{...e.headers}};for(let r of this._responseInterceptors.slice()){let n=new Td(t,r);try{await n.promise}catch{continue}n.responseResult&&(t={...t,status:n.responseResult.status!==void 0?n.responseResult.status:t.status,headers:n.responseResult.headers!==void 0?n.responseResult.headers:t.headers,body:"body"in n.responseResult?n.responseResult.body:t.body})}return{status:t.status,headers:t.headers,body:t.body}}};function Yv(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 _h(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var Qv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],Ad=class{constructor(){this._mediaElement=null;this._container=null;this._webkitFullscreen=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._network=new mo;this._currentProviderType=null;this._ready=!1;this._loadGeneration=0;this._attachedElementGeneration=0;this._state=co()}get state(){return this._state}get videoElement(){return this._mediaElement}get activeVideoElement(){let e=this._mediaElement;return(e==null?void 0:e.activeVideoElement)??null}get bpLive(){return this._bpLive}get network(){return this._network}get ready(){return this._ready}get providerType(){return this._currentProviderType}addEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r)this._listeners.has(n)||this._listeners.set(n,new Set),this._listeners.get(n).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let n of r){let o=this._listeners.get(n);o&&(o.delete(t),o.size===0&&this._listeners.delete(n))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let n of r)try{n(t)}catch(o){console.error(`[PlayerCore] Error in event listener for "${e}":`,o)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}attach(e,t){this._destroyed||(this._container=e,this._config=t,this._ready=!0)}async loadSource(e,t,r){if(this._destroyed)return;let n=++this._loadGeneration,o=t??this._container,s=r??this._config;if(!o){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=o,s&&(this._config=s);let l=_h(e)?"clipId"in e?"clip":"stream":void 0;this.updateState({error:null,connectionState:"connecting",ended:!1,...l&&{contentType:l}}),this.dispatch("sourcechange",{source:e});try{let d=e,h=this._state.contentType,p,g,f;if(_h(e)){if(s!=null&&s.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new Or(s.bpLive,this._network)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let I=await this._bpLive.resolveSource(e);if(n!==this._loadGeneration)return;d=I.source,h=I.contentType,p=I.poster,g=I.videoWidth,f=I.videoHeight}let E=Yv(d),S=E==="nano"||E==="livekit"||h==="stream"?"live":"vod";return this._mediaElement&&this.destroyMediaElement(),this._currentProviderType=E,this.updateState({providerType:E,contentType:h,streamType:S,error:null,paused:!0,playing:!1,waiting:!1,seeking:!1,readyState:0,currentTime:0,duration:NaN,buffered:null}),this._mediaElement=this.createMediaElement(E,d,s),this._mediaElement.style.width="100%",this._mediaElement.style.height="100%",this._mediaElement.style.objectFit="contain",this._state.muted&&(this._mediaElement.muted=!0),this._state.loop&&(this._mediaElement.loop=!0),this.attachMediaElementListeners(this._mediaElement),this.attachActiveVideoElementForwarding(this._mediaElement),o.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),this.dispatch("activevideoelementchange",{video:this.activeVideoElement}),{poster:p,videoWidth:g,videoHeight:f}}catch(d){if(n!==this._loadGeneration)return;this._attachedElementGeneration=this._loadGeneration,console.error("[PlayerCore] loadSource error:",d);let h={code:-1,message:d instanceof Error?d.message:"Failed to load source",fatal:!0,category:"setup"};this.updateState({error:h,connectionState:"failed"}),this.dispatch("error",h)}}destroyMediaElement(){if(this._eventCleanup.forEach(e=>e()),this._eventCleanup=[],this._mediaElement&&(this._mediaElement.remove(),this._mediaElement=null,this.dispatch("emptied",void 0),this.dispatch("videoelementchange",{video:null}),this.dispatch("activevideoelementchange",{video:null})),this._container)for(;this._container.firstChild;)this._container.removeChild(this._container.firstChild)}createMediaElement(e,t,r){switch(e){case"nano":{let n=document.createElement("nano-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=t;return n.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",o.source?n.sourceConfig=o.source:o.streamid&&(n.streamid=o.streamid),r!=null&&r.nano&&(n.config=r.nano),n}case"livekit":{let n=document.createElement("livekit-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=t;return n.url=o.url,n.token=o.token,r!=null&&r.livekit&&(n.config=r.livekit),n}case"video":default:{let n=document.createElement("hls-video");n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline","");let o=typeof t=="string"?t:t.url;n.src=o;let s={...r==null?void 0:r.video},l=this._network,d=s.xhrSetup;return s.xhrSetup=async(h,p)=>{let g=p.includes(".m3u8")?"manifest":p.includes(".ts")||p.includes(".m4s")||p.includes(".fmp4")?"segment":"other",f=await l.intercept({url:p,method:"GET",type:g,headers:{}});f.url!==p&&h.open("GET",f.url,!0);for(let[E,y]of Object.entries(f.headers))h.setRequestHeader(E,y);d&&await d(h,f.url)},n.config=s,n}}}attachMediaElementListeners(e){this._attachedElementGeneration=this._loadGeneration;for(let t of Qv){let r=n=>{t==="error"&&this._attachedElementGeneration!==this._loadGeneration||this.handleMediaEvent(t,e,n)};e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}attachActiveVideoElementForwarding(e){let t=r=>{let n=r.detail;this.dispatch("activevideoelementchange",{video:(n==null?void 0:n.video)??null})};e.addEventListener("activevideoelementchange",t),this._eventCleanup.push(()=>e.removeEventListener("activevideoelementchange",t))}handleMediaEvent(e,t,r){var n,o,s,l;switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:d}),this.dispatch("loadedmetadata",{duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight});break}case"loadeddata":this.updateState({readyState:2}),this.dispatch("loadeddata",void 0);break;case"canplay":this.updateState({readyState:3,connectionState:"connected"}),this.dispatch("canplay",void 0),this.dispatch("connectionstatechange",{state:"connected"});break;case"canplaythrough":this.updateState({readyState:4}),this.dispatch("canplaythrough",void 0);break;case"play":this.updateState({paused:!1,ended:!1}),this.dispatch("play",void 0);break;case"playing":this.updateState({paused:!1,playing:!0,ended:!1,waiting:!1,readyState:4}),this.dispatch("playing",void 0);break;case"pause":this.updateState({paused:!0,playing:!1,waiting:!1}),this.dispatch("pause",void 0);break;case"waiting":this.updateState({playing:!1,waiting:!0,readyState:2}),this.dispatch("waiting",void 0);break;case"seeking":this.updateState({seeking:!0,currentTime:t.currentTime}),this.dispatch("seeking",{currentTime:t.currentTime});break;case"seeked":this.updateState({seeking:!1,currentTime:t.currentTime}),this.dispatch("seeked",{currentTime:t.currentTime});break;case"timeupdate":this.updateState({currentTime:t.currentTime,duration:t.duration}),this.dispatch("timeupdate",{currentTime:t.currentTime,duration:t.duration});break;case"durationchange":{let d=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:d}),this.dispatch("durationchange",{duration:t.duration}),this.dispatch("streamtypechange",{streamType:this._state.streamType});break}case"ratechange":this.updateState({playbackRate:t.playbackRate}),this.dispatch("ratechange",{playbackRate:t.playbackRate});break;case"volumechange":this.updateState({volume:t.volume,muted:t.muted}),this.dispatch("volumechange",{volume:t.volume,muted:t.muted});break;case"ended":this.updateState({ended:!0,paused:!0,playing:!1}),this.dispatch("ended",void 0);break;case"progress":this.updateState({buffered:t.buffered}),this.dispatch("progress",{buffered:t.buffered});break;case"error":{let d=-1,h="Unknown error",p="none";r instanceof ErrorEvent&&r.error?(d=r.error.code??-1,h=r.error.message??r.message??"Unknown error",p="ErrorEvent"):t.error&&(d=t.error.code??-1,h=t.error.message??"Unknown error",p="element.error");let g=t.nativeEl;console.error("[PlayerCore] error event",{providerType:this._state.providerType,elementTag:t.tagName,eventTarget:(n=r.target)==null?void 0:n.tagName,source:p,code:d,message:h,eventIsErrorEvent:r instanceof ErrorEvent,eventErrorCode:r instanceof ErrorEvent?(o=r.error)==null?void 0:o.code:void 0,elementErrorCode:(s=t.error)==null?void 0:s.code,nativeElTag:g==null?void 0:g.tagName,nativeElErrorCode:(l=g==null?void 0:g.error)==null?void 0:l.code,nativeElSrc:g==null?void 0:g.currentSrc,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState});let f="media",E=!0;this._state.providerType==="nano"&&d>0?(f=Vs(d),E=f!=="offline"&&f!=="autoplay"):this._state.providerType==="livekit"&&d>0?(f=Bs(d),E=!0):this._state.providerType==="video"&&d>=6e3&&(f=Ws(d),E=!0);let y={code:d,message:h,fatal:E,category:f};this.updateState({error:y}),this.dispatch("error",y);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.destroyMediaElement(),this._currentProviderType=null,this.updateState({...co(),volume:this._state.volume,muted:this._state.muted,loop:this._state.loop,playbackRate:this._state.playbackRate}),this.dispatch("sourcechange",{source:null})}async play(){if(this._mediaElement){this.updateState({paused:!1});try{await this._mediaElement.play()}catch(e){throw this.updateState({paused:!0}),e}}}pause(){this._mediaElement&&(this.updateState({paused:!0,playing:!1}),this._mediaElement.pause())}seek(e){this._mediaElement&&(this._mediaElement.currentTime=e)}setVolume(e){let t=Math.max(0,Math.min(1,e));this.updateState({volume:t}),this._mediaElement&&(this._mediaElement.volume=t),this.dispatch("volumechange",{volume:t,muted:this._state.muted})}setMuted(e){this.updateState({muted:e}),this._mediaElement&&(this._mediaElement.muted=e),this.dispatch("volumechange",{volume:this._state.volume,muted:e})}setLoop(e){this.updateState({loop:e}),this._mediaElement&&(this._mediaElement.loop=e)}setPlaybackRate(e){this.updateState({playbackRate:e}),this._mediaElement&&(this._mediaElement.playbackRate=e),this.dispatch("ratechange",{playbackRate:e})}setTargetQuality(e){this.updateState({targetQuality:e}),this.dispatch("targetqualitychanged",{quality:e});let t=this._mediaElement;t!=null&&t.videoRenditions&&(t.videoRenditions.selectedIndex=(e==null?void 0:e.index)??-1)}setQuality(e){this.setTargetQuality(e)}_getFullscreenTarget(){return this._container?this._container.closest("media-controller")??this._container.parentElement:null}async setFullscreen(e){var t;if(this._applyFullscreenState(e),e){let r=this._getFullscreenTarget();if(!r){this._applyFullscreenState(!1);return}if(document.fullscreenElement){document.fullscreenElement!==r&&this._applyFullscreenState(!1);return}if(typeof r.requestFullscreen=="function")try{await r.requestFullscreen()}catch(n){throw this._applyFullscreenState(!1),n}else this._enterWebkitVideoFullscreen()}else if(document.fullscreenElement)await document.exitFullscreen();else{let r=this._webkitFullscreen,n=(r==null?void 0:r.video)??this.activeVideoElement;n!=null&&n.webkitDisplayingFullscreen&&(r==null||r.disarm(),(t=n.webkitExitFullscreen)==null||t.call(n))}}_applyFullscreenState(e){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"})}_enterWebkitVideoFullscreen(){var n;let e=this.activeVideoElement;if(!(e!=null&&e.webkitEnterFullscreen)){this._applyFullscreenState(!1);return}(n=this._webkitFullscreen)==null||n.disarm();let t=()=>{this._webkitFullscreen=null,this._applyFullscreenState(!1)};e.addEventListener("webkitendfullscreen",t,{once:!0});let r={video:e,disarm:()=>{this._webkitFullscreen=null,e.removeEventListener("webkitendfullscreen",t)}};if(this._webkitFullscreen=r,!e.webkitDisplayingFullscreen)try{e.webkitEnterFullscreen()}catch(o){throw r.disarm(),this._applyFullscreenState(!1),o}}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){var e;this._destroyed||(this._destroyed=!0,(e=this._webkitFullscreen)==null||e.disarm(),this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function Ks(){return new Ad}var Ki="bpPlayerObservedProperties";function qs(i){return Ki in i&&Array.isArray(i[Ki])}function yh(i,e){class t extends i{get[Ki](){return e}}return t}function Zv(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 qi(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!qs(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),qs(i)&&t(i);let r=Zv(i);r.length>0&&await Promise.all(r.map(n=>qi(n,e,t)))}function vo(i,e,t){let r=i[Ki];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 fo(i){i[Ki].includes("player")&&(i.player=void 0)}var Th=`/**
8
8
  * BP Player CSS Custom Properties
9
9
  *
10
10
  * All styling can be customized by overriding these CSS variables.
@@ -116,7 +116,7 @@
116
116
  /* Mobile */
117
117
  --bp-mobile-control-backdrop-background: rgba(0, 0, 0, 0.5);
118
118
  }
119
- `;var _h=`/**
119
+ `;var Ah=`/**
120
120
  * BP Player Global Styles
121
121
  *
122
122
  * Base styles and resets for the player components.
@@ -136,8 +136,8 @@ html.bp-player-full-window > body {
136
136
  margin: 0 !important;
137
137
  padding: 0 !important;
138
138
  }
139
- `;var yh=!1;function Pr(){if(yh)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=bh+`
140
- `+_h,document.head.appendChild(i),yh=!0}function Th(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function Ah(i,e){return`<style>${i}</style>${e}`}var vo=(R=>(R.CONFIGURATION="configuration",R.SOURCE="source",R.SOURCES="sources",R.AUTOPLAY="autoplay",R.MUTED="muted",R.LOOP="loop",R.SCALING="scaling",R.ASPECT_RATIO="aspect-ratio",R.DEBUG="debug",R.AUTOHIDE="autohide",R.HOTKEYS="hotkeys",R.PAUSED="paused",R.PLAYING="playing",R.ENDED="ended",R.SEEKING="seeking",R.WAITING="waiting",R.LOADING="loading",R.READY="ready",R.HAS_ERROR="has-error",R.HAS_FIRST_PLAY="has-first-play",R.FULLSCREEN="fullscreen",R.FULLWINDOW="fullwindow",R.DEVICE_TYPE="device-type",R.MOBILE="mobile",R.TV="tv",R.STREAM_TYPE="stream-type",R.LIVE="live",R.CONTENT_TYPE="content-type",R.USER_IDLE="user-idle",R.USER_IDLE_TIMEOUT="user-idle-timeout",R.MOBILE_ONLY="mobile-only",R.MOBILE_HIDDEN="mobile-hidden",R.TV_ONLY="tv-only",R.TV_HIDDEN="tv-hidden",R.LIVE_ONLY="live-only",R.LIVE_HIDDEN="live-hidden",R.VOD_HIDDEN="vod-hidden",R.CLIP_HIDDEN="clip-hidden",R.NO_AUTO_HIDE="no-auto-hide",R.DISABLED="disabled",R.HIDDEN="hidden",R.NOTOOLTIP="notooltip",R.MENU="menu",R.MENU_OPENED="menu-opened",R.ARIA_LABEL="aria-label",R.ARIA_LIVE="aria-live",R.ARIA_CHECKED="aria-checked",R.VOLUME_LEVEL="volume-level",R.PROVIDER_TYPE="provider-type",R))(vo||{});function ge(i,e,t){return t!==void 0?t?(i.setAttribute(e,""),!0):(i.removeAttribute(e),!1):i.hasAttribute(e)?(i.removeAttribute(e),!1):(i.setAttribute(e,""),!0)}function Dr(){return{fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{return}},toAttribute:i=>i==null?null:JSON.stringify(i)}}var j=(i,e)=>new Event(i,{bubbles:!0,composed:!0,...e}),Fi=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function nt(i,e){let t=e!==void 0?Object.assign(i,{code:e}):i;return new ErrorEvent("error",{error:t,message:i.message,bubbles:!0,composed:!0})}var fo="play";var qi="pause";var ri="playing";var Or="waiting";var Eo="ended";var go="timeupdate";var yd="durationchange";var Td="loadstart";var Ad="loadedmetadata";var Sd="loadeddata";var bo="canplay";var Fs="canplaythrough";var Nr="volumechange";var ni="resize";var _o="ready";var qs="change";var kd="addrendition";var Ks=class extends EventTarget{constructor(t){super();this._renditions=[];this._cleanup=[];this._host=t}get length(){return this._renditions.length}[Symbol.iterator](){return this._renditions[Symbol.iterator]()}get selectedIndex(){var r;let t=(r=this._host.player)==null?void 0:r.state.targetQuality;return t?this._renditions.findIndex(n=>n.id===String(t.index)):-1}set selectedIndex(t){var r,n,o;if(t<0)(r=this._host.player)==null||r.setQuality(null);else{let l=(((n=this._host.player)==null?void 0:n.state.qualities)??[])[t];l&&((o=this._host.player)==null||o.setQuality(l))}this._updateSelection(),this.dispatchEvent(j(qs))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,n)=>{r.selected=n===t})}_syncFromPlayer(){var n,o;let t=((n=this._host.player)==null?void 0:n.state.qualities)??[];if(t.length===0){let s=(o=this._host.player)==null?void 0:o.videoElement;s!=null&&s.videoRenditions&&(t=[...s.videoRenditions].map((l,d)=>({index:d,width:l.width??0,height:l.height??0,bitrate:l.bitrate??0})))}let r=this._renditions.length;for(let s=0;s<r;s++)delete this[s];this._renditions=t.map(s=>({id:String(s.index),width:s.width,height:s.height,bitrate:s.bitrate,selected:!1})),this._renditions.forEach((s,l)=>{this[l]=s}),this._updateSelection();for(let s of this._renditions)this.dispatchEvent(Fi(kd,{detail:s}))}_setupListeners(){this._cleanup.forEach(s=>s()),this._cleanup=[];let t=this._host.player;if(!t)return;let r=()=>{this._syncFromPlayer()},n=()=>{this._updateSelection(),this.dispatchEvent(j(qs))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",n),t.addEventListener("targetqualitychanged",n),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",n),t.removeEventListener("targetqualitychanged",n)});let o=t.videoElement;o!=null&&o.videoRenditions&&(o.videoRenditions.addEventListener("addrendition",r),o.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var s,l;(s=o.videoRenditions)==null||s.removeEventListener("addrendition",r),(l=o.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(r=>r()),this._cleanup=[];let t=this._renditions.length;this._renditions=[];for(let r=0;r<t;r++)delete this[r]}};var Sh=`/**
139
+ `;var Sh=!1;function Nr(){if(Sh)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=Th+`
140
+ `+Ah,document.head.appendChild(i),Sh=!0}function kh(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function Lh(i,e){return`<style>${i}</style>${e}`}var Eo=(R=>(R.CONFIGURATION="configuration",R.SOURCE="source",R.SOURCES="sources",R.AUTOPLAY="autoplay",R.MUTED="muted",R.LOOP="loop",R.SCALING="scaling",R.ASPECT_RATIO="aspect-ratio",R.DEBUG="debug",R.AUTOHIDE="autohide",R.HOTKEYS="hotkeys",R.PAUSED="paused",R.PLAYING="playing",R.ENDED="ended",R.SEEKING="seeking",R.WAITING="waiting",R.LOADING="loading",R.READY="ready",R.HAS_ERROR="has-error",R.HAS_FIRST_PLAY="has-first-play",R.FULLSCREEN="fullscreen",R.FULLWINDOW="fullwindow",R.DEVICE_TYPE="device-type",R.MOBILE="mobile",R.TV="tv",R.STREAM_TYPE="stream-type",R.LIVE="live",R.CONTENT_TYPE="content-type",R.USER_IDLE="user-idle",R.USER_IDLE_TIMEOUT="user-idle-timeout",R.MOBILE_ONLY="mobile-only",R.MOBILE_HIDDEN="mobile-hidden",R.TV_ONLY="tv-only",R.TV_HIDDEN="tv-hidden",R.LIVE_ONLY="live-only",R.LIVE_HIDDEN="live-hidden",R.VOD_HIDDEN="vod-hidden",R.CLIP_HIDDEN="clip-hidden",R.NO_AUTO_HIDE="no-auto-hide",R.DISABLED="disabled",R.HIDDEN="hidden",R.NOTOOLTIP="notooltip",R.MENU="menu",R.MENU_OPENED="menu-opened",R.ARIA_LABEL="aria-label",R.ARIA_LIVE="aria-live",R.ARIA_CHECKED="aria-checked",R.VOLUME_LEVEL="volume-level",R.PROVIDER_TYPE="provider-type",R))(Eo||{});function _e(i,e,t){return t!==void 0?t?(i.setAttribute(e,""),!0):(i.removeAttribute(e),!1):i.hasAttribute(e)?(i.removeAttribute(e),!1):(i.setAttribute(e,""),!0)}function Ur(){return{fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{return}},toAttribute:i=>i==null?null:JSON.stringify(i)}}var J=(i,e)=>new Event(i,{bubbles:!0,composed:!0,...e}),Gi=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function Ne(i,e){let t=e!==void 0?Object.assign(i,{code:e}):i;return new ErrorEvent("error",{error:t,message:i.message,bubbles:!0,composed:!0})}var go="play";var zi="pause";var oi="playing";var Hr="waiting";var bo="ended";var _o="timeupdate";var Sd="durationchange";var kd="loadstart";var Ld="loadedmetadata";var wd="loadeddata";var yo="canplay";var Gs="canplaythrough";var $r="volumechange";var si="resize";var To="ready";var zs="change";var Id="addrendition";var Ys=class extends EventTarget{constructor(t){super();this._renditions=[];this._cleanup=[];this._host=t}get length(){return this._renditions.length}[Symbol.iterator](){return this._renditions[Symbol.iterator]()}get selectedIndex(){var r;let t=(r=this._host.player)==null?void 0:r.state.targetQuality;return t?this._renditions.findIndex(n=>n.id===String(t.index)):-1}set selectedIndex(t){var r,n,o;if(t<0)(r=this._host.player)==null||r.setQuality(null);else{let l=(((n=this._host.player)==null?void 0:n.state.qualities)??[])[t];l&&((o=this._host.player)==null||o.setQuality(l))}this._updateSelection(),this.dispatchEvent(J(zs))}_updateSelection(){let t=this.selectedIndex;this._renditions.forEach((r,n)=>{r.selected=n===t})}_syncFromPlayer(){var n,o;let t=((n=this._host.player)==null?void 0:n.state.qualities)??[];if(t.length===0){let s=(o=this._host.player)==null?void 0:o.videoElement;s!=null&&s.videoRenditions&&(t=[...s.videoRenditions].map((l,d)=>({index:d,width:l.width??0,height:l.height??0,bitrate:l.bitrate??0})))}let r=this._renditions.length;for(let s=0;s<r;s++)delete this[s];this._renditions=t.map(s=>({id:String(s.index),width:s.width,height:s.height,bitrate:s.bitrate,selected:!1})),this._renditions.forEach((s,l)=>{this[l]=s}),this._updateSelection();for(let s of this._renditions)this.dispatchEvent(Gi(Id,{detail:s}))}_setupListeners(){this._cleanup.forEach(s=>s()),this._cleanup=[];let t=this._host.player;if(!t)return;let r=()=>{this._syncFromPlayer()},n=()=>{this._updateSelection(),this.dispatchEvent(J(zs))};t.addEventListener("qualitieschange",r),t.addEventListener("qualitychange",n),t.addEventListener("targetqualitychanged",n),this._cleanup.push(()=>{t.removeEventListener("qualitieschange",r),t.removeEventListener("qualitychange",n),t.removeEventListener("targetqualitychanged",n)});let o=t.videoElement;o!=null&&o.videoRenditions&&(o.videoRenditions.addEventListener("addrendition",r),o.videoRenditions.addEventListener("removerendition",r),this._cleanup.push(()=>{var s,l;(s=o.videoRenditions)==null||s.removeEventListener("addrendition",r),(l=o.videoRenditions)==null||l.removeEventListener("removerendition",r)})),this._syncFromPlayer()}_destroy(){this._cleanup.forEach(r=>r()),this._cleanup=[];let t=this._renditions.length;this._renditions=[];for(let r=0;r<t;r++)delete this[r]}};var wh=`/**
141
141
  * BP Player Styles
142
142
  *
143
143
  * Core player component styles using CSS custom properties.
@@ -227,20 +227,20 @@ bp-player[waiting] {
227
227
  bp-player[has-error] {
228
228
  /* Styles when player has an error */
229
229
  }
230
- `;var kh=!1;function Xv(){if(kh||(kh=!0,document.getElementById("bp-player-styles")))return;Pr();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=Sh,document.head.appendChild(i)}var jv=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Re=class extends De{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=null;this._hasDispatchedReady=!1;this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let n of r.addedNodes)n.nodeType===Node.ELEMENT_NODE&&Wi(n,this.providerContainer,this.registerStateReceiver);for(let n of r.removedNodes)n.nodeType===Node.ELEMENT_NODE&&Wi(n,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&po(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),mo(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Xv(),this._mutationObserver=new MutationObserver(this.handleMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}get player(){return this._playerCore}get playerState(){var t;return((t=this._playerCore)==null?void 0:t.state)??null}get bpLive(){var t;return((t=this._playerCore)==null?void 0:t.bpLive)??null}async play(){var t;this.debug&&console.log("[BPPlayer] play() called"),await((t=this._playerCore)==null?void 0:t.play())}pause(){var t;this.debug&&console.log("[BPPlayer] pause() called"),(t=this._playerCore)==null||t.pause()}get paused(){var r;let t=((r=this._playerCore)==null?void 0:r.state.paused)??!0;return this.debug&&console.log("[BPPlayer] paused getter:",t),t}get ended(){var t;return((t=this._playerCore)==null?void 0:t.state.ended)??!1}get seeking(){var t;return((t=this._playerCore)==null?void 0:t.state.seeking)??!1}get waiting(){var t;return((t=this._playerCore)==null?void 0:t.state.waiting)??!1}get currentTime(){var t;return((t=this._playerCore)==null?void 0:t.state.currentTime)??0}set currentTime(t){var r;(r=this._playerCore)==null||r.seek(t)}get duration(){var t;return((t=this._playerCore)==null?void 0:t.state.duration)??NaN}get volume(){var t;return((t=this._playerCore)==null?void 0:t.state.volume)??1}set volume(t){var r;(r=this._playerCore)==null||r.setVolume(t)}get muted(){var t;return((t=this._playerCore)==null?void 0:t.state.muted)??this.defaultMuted}set muted(t){var r;(r=this._playerCore)==null||r.setMuted(t)}get playbackRate(){var t;return((t=this._playerCore)==null?void 0:t.state.playbackRate)??1}set playbackRate(t){var r;(r=this._playerCore)==null||r.setPlaybackRate(t)}get readyState(){var t;return((t=this._playerCore)==null?void 0:t.state.readyState)??0}get buffered(){var r;let t=(r=this._playerCore)==null?void 0:r.state.buffered;return t||{length:0,start:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")},end:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")}}}get videoWidth(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.width?r.width:((s=this._playerCore)==null?void 0:s.state.videoWidth)??0}get videoHeight(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.height?r.height:((s=this._playerCore)==null?void 0:s.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}webkitEnterFullscreen(){var r,n;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;(n=t==null?void 0:t.webkitEnterFullscreen)==null||n.call(t)}get webkitDisplayingFullscreen(){var r;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;return(t==null?void 0:t.webkitDisplayingFullscreen)??!1}get webkitPresentationMode(){var r;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;return(t==null?void 0:t.webkitPresentationMode)??"inline"}get providerType(){var t;return((t=this._playerCore)==null?void 0:t.state.providerType)??null}get videoRenditions(){return this._videoRenditions}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._mutationObserver)==null||t.disconnect(),this.destroyPlayer()}firstUpdated(t){super.firstUpdated(t),this.containerRef=this.renderRoot.querySelector(".bp-player-container"),this.containerRef&&!this.providerContainer&&(this.providerContainer=document.createElement("div"),this.providerContainer.className="bp-player-provider",this.providerContainer.style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.containerRef.appendChild(this.providerContainer)),this.initPlayerCore()}updated(t){super.updated(t),t.has("source")&&this.loadSource(),t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}initPlayerCore(){var t;if(!(this._playerCore||!this.providerContainer))try{this._playerCore=Bs(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new Ks(this),this._hasDispatchedReady||(this._hasDispatchedReady=!0,Wi(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent(Fi(_o,{detail:this._playerCore})),this.debug&&console.log("[BPPlayer] Player ready",(t=this._playerCore)==null?void 0:t.state))}catch(r){console.error("[BPPlayer] Failed to initialize player:",r),this.dispatchEvent(nt(r instanceof Error?r:new Error(String(r))))}}async loadSource(){var r,n,o,s,l,d;let t=(n=(r=this.source)==null?void 0:r.sources)==null?void 0:n[0];if(!t){(o=this._playerCore)!=null&&o.ready&&this._playerCore.unloadSource();return}if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadSource skipped - player not initialized");return}this.debug&&console.log("[BPPlayer] loadSource:",t);try{let h=await this._playerCore.loadSource(t);if(!this._playerCore)return;if(h!=null&&h.videoWidth&&(h!=null&&h.videoHeight)&&(this.updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPPlayer] Source video dimensions:",{width:h.videoWidth,height:h.videoHeight})),(s=this._videoRenditions)==null||s._setupListeners(),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(d=(l=this._playerCore)==null?void 0:l.state)!=null&&d.paused&&this.dispatchEvent(j(qi)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h),this.dispatchEvent(nt(h instanceof Error?h:new Error(String(h))))}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)po(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;let t=this._playerCore;for(let d of jv){let h=()=>{this.debug&&!["durationchange","timeupdate"].includes(d)&&console.log(`[BPPlayer] Forwarding event: ${d}`,t.state),this.dispatchEvent(j(d))};t.addEventListener(d,h),this.eventCleanup.push(()=>t.removeEventListener(d,h))}let r=()=>{let d=t.videoElement;d&&this.updateVideoDimensions(d.videoWidth,d.videoHeight)};t.addEventListener("resize",r),t.addEventListener("loadedmetadata",r),this.eventCleanup.push(()=>t.removeEventListener("resize",r)),this.eventCleanup.push(()=>t.removeEventListener("loadedmetadata",r)),r();let n=()=>{this.dispatchEvent(j(ni))};t.addEventListener("qualitychange",n),this.eventCleanup.push(()=>t.removeEventListener("qualitychange",n));let o=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};t.addEventListener("statechange",o),this.eventCleanup.push(()=>t.removeEventListener("statechange",o));let s=[],l=()=>{s.forEach(h=>h()),s=[];let d=t.activeVideoElement;if(d)for(let h of["webkitbeginfullscreen","webkitendfullscreen"]){let p=()=>this.dispatchEvent(new Event(h));d.addEventListener(h,p),s.push(()=>d.removeEventListener(h,p))}};l(),t.addEventListener("activevideoelementchange",l),this.eventCleanup.push(()=>t.removeEventListener("activevideoelementchange",l)),this.eventCleanup.push(()=>s.forEach(d=>d()))}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;ge(this,"paused",t.paused),ge(this,"playing",t.playing),ge(this,"ended",t.ended),ge(this,"seeking",t.seeking),ge(this,"waiting",t.waiting),ge(this,"has-error",t.error!==null),ge(this,"ready",this._playerCore.ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}destroyPlayer(){var t;this.eventCleanup.forEach(r=>r()),this.eventCleanup=[],(t=this._videoRenditions)==null||t._destroy(),this._videoRenditions=null;for(let r of this.stateReceivers)mo(r);if(this.stateReceivers=[],this._playerCore&&(this._playerCore.destroy(),this._playerCore=null),this.providerContainer)for(;this.providerContainer.firstChild;)this.providerContainer.removeChild(this.providerContainer.firstChild);this.clearVideoDimensions(),this._hasDispatchedReady=!1}updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r)),this.debug&&console.log("[BPPlayer] Set video dimensions:",{width:t,height:r})):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"),this.debug&&console.log("[BPPlayer] Cleared video dimensions"))}clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}getContainerClasses(){return["bp-player-container",`bp-player-container--${this.scaling}`].join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}render(){return Ye`
230
+ `;var Ih=!1;function ef(){if(Ih||(Ih=!0,document.getElementById("bp-player-styles")))return;Nr();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=wh,document.head.appendChild(i)}var tf=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Me=class extends Oe{constructor(){super(...arguments);this.autoplay=!1;this.defaultMuted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this._playerCore=null;this.containerRef=null;this.providerContainer=null;this.eventCleanup=[];this.stateReceivers=[];this._mutationObserver=null;this._videoRenditions=null;this._hasDispatchedReady=!1;this.handleMutation=t=>{for(let r of t)if(r.type==="childList"){for(let n of r.addedNodes)n.nodeType===Node.ELEMENT_NODE&&qi(n,this.providerContainer,this.registerStateReceiver);for(let n of r.removedNodes)n.nodeType===Node.ELEMENT_NODE&&qi(n,this.providerContainer,this.unregisterStateReceiver)}};this.registerStateReceiver=t=>{this.stateReceivers.includes(t)||(this.stateReceivers.push(t),this._playerCore&&vo(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),fo(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),ef(),this._mutationObserver=new MutationObserver(this.handleMutation),this._mutationObserver.observe(this,{childList:!0,subtree:!0})}get player(){return this._playerCore}get playerState(){var t;return((t=this._playerCore)==null?void 0:t.state)??null}get bpLive(){var t;return((t=this._playerCore)==null?void 0:t.bpLive)??null}async play(){var t;this.debug&&console.log("[BPPlayer] play() called"),await((t=this._playerCore)==null?void 0:t.play())}pause(){var t;this.debug&&console.log("[BPPlayer] pause() called"),(t=this._playerCore)==null||t.pause()}get paused(){var r;let t=((r=this._playerCore)==null?void 0:r.state.paused)??!0;return this.debug&&console.log("[BPPlayer] paused getter:",t),t}get ended(){var t;return((t=this._playerCore)==null?void 0:t.state.ended)??!1}get seeking(){var t;return((t=this._playerCore)==null?void 0:t.state.seeking)??!1}get waiting(){var t;return((t=this._playerCore)==null?void 0:t.state.waiting)??!1}get currentTime(){var t;return((t=this._playerCore)==null?void 0:t.state.currentTime)??0}set currentTime(t){var r;(r=this._playerCore)==null||r.seek(t)}get duration(){var t;return((t=this._playerCore)==null?void 0:t.state.duration)??NaN}get volume(){var t;return((t=this._playerCore)==null?void 0:t.state.volume)??1}set volume(t){var r;(r=this._playerCore)==null||r.setVolume(t)}get muted(){var t;return((t=this._playerCore)==null?void 0:t.state.muted)??this.defaultMuted}set muted(t){var r;(r=this._playerCore)==null||r.setMuted(t)}get playbackRate(){var t;return((t=this._playerCore)==null?void 0:t.state.playbackRate)??1}set playbackRate(t){var r;(r=this._playerCore)==null||r.setPlaybackRate(t)}get readyState(){var t;return((t=this._playerCore)==null?void 0:t.state.readyState)??0}get buffered(){var r;let t=(r=this._playerCore)==null?void 0:r.state.buffered;return t||{length:0,start:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")},end:n=>{throw new DOMException(`Index ${n} is out of bounds`,"IndexSizeError")}}}get videoWidth(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoWidth)return t.videoWidth;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.width?r.width:((s=this._playerCore)==null?void 0:s.state.videoWidth)??0}get videoHeight(){var n,o,s;let t=(n=this._playerCore)==null?void 0:n.videoElement;if(t!=null&&t.videoHeight)return t.videoHeight;let r=(o=this._playerCore)==null?void 0:o.state.currentQuality;return r!=null&&r.height?r.height:((s=this._playerCore)==null?void 0:s.state.videoHeight)??0}get videoElement(){var t;return((t=this._playerCore)==null?void 0:t.videoElement)??null}webkitEnterFullscreen(){var r,n;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;(n=t==null?void 0:t.webkitEnterFullscreen)==null||n.call(t)}get webkitDisplayingFullscreen(){var r;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;return(t==null?void 0:t.webkitDisplayingFullscreen)??!1}get webkitPresentationMode(){var r;let t=(r=this._playerCore)==null?void 0:r.activeVideoElement;return(t==null?void 0:t.webkitPresentationMode)??"inline"}get providerType(){var t;return((t=this._playerCore)==null?void 0:t.state.providerType)??null}get videoRenditions(){return this._videoRenditions}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._mutationObserver)==null||t.disconnect(),this.destroyPlayer()}firstUpdated(t){super.firstUpdated(t),this.containerRef=this.renderRoot.querySelector(".bp-player-container"),this.containerRef&&!this.providerContainer&&(this.providerContainer=document.createElement("div"),this.providerContainer.className="bp-player-provider",this.providerContainer.style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",this.containerRef.appendChild(this.providerContainer)),this.initPlayerCore()}updated(t){super.updated(t),t.has("source")&&this.loadSource(),t.has("defaultMuted")&&this._playerCore&&this._playerCore.setMuted(this.defaultMuted),t.has("loop")&&this._playerCore&&this._playerCore.setLoop(this.loop)}initPlayerCore(){var t;if(!(this._playerCore||!this.providerContainer))try{this._playerCore=Ks(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new Ys(this),this._hasDispatchedReady||(this._hasDispatchedReady=!0,qi(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent(Gi(To,{detail:this._playerCore})),this.debug&&console.log("[BPPlayer] Player ready",(t=this._playerCore)==null?void 0:t.state))}catch(r){console.error("[BPPlayer] Failed to initialize player:",r),this.dispatchEvent(Ne(r instanceof Error?r:new Error(String(r))))}}async loadSource(){var r,n,o,s,l,d;let t=(n=(r=this.source)==null?void 0:r.sources)==null?void 0:n[0];if(!t){(o=this._playerCore)!=null&&o.ready&&this._playerCore.unloadSource();return}if(!this._playerCore||!this.providerContainer){this.debug&&console.log("[BPPlayer] loadSource skipped - player not initialized");return}this.debug&&console.log("[BPPlayer] loadSource:",t);try{let h=await this._playerCore.loadSource(t);if(!this._playerCore)return;if(h!=null&&h.videoWidth&&(h!=null&&h.videoHeight)&&(this.updateVideoDimensions(h.videoWidth,h.videoHeight),this.debug&&console.log("[BPPlayer] Source video dimensions:",{width:h.videoWidth,height:h.videoHeight})),(s=this._videoRenditions)==null||s._setupListeners(),this.propagateStateToAllReceivers(),this.updateStateAttributes(),(d=(l=this._playerCore)==null?void 0:l.state)!=null&&d.paused&&this.dispatchEvent(J(zi)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h),this.dispatchEvent(Ne(h instanceof Error?h:new Error(String(h))))}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)vo(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;let t=this._playerCore;for(let d of tf){let h=()=>{this.debug&&!["durationchange","timeupdate"].includes(d)&&console.log(`[BPPlayer] Forwarding event: ${d}`,t.state),this.dispatchEvent(J(d))};t.addEventListener(d,h),this.eventCleanup.push(()=>t.removeEventListener(d,h))}let r=()=>{let d=t.videoElement;d&&this.updateVideoDimensions(d.videoWidth,d.videoHeight)};t.addEventListener("resize",r),t.addEventListener("loadedmetadata",r),this.eventCleanup.push(()=>t.removeEventListener("resize",r)),this.eventCleanup.push(()=>t.removeEventListener("loadedmetadata",r)),r();let n=()=>{this.dispatchEvent(J(si))};t.addEventListener("qualitychange",n),this.eventCleanup.push(()=>t.removeEventListener("qualitychange",n));let o=()=>{this.propagateStateToAllReceivers(),this.updateStateAttributes()};t.addEventListener("statechange",o),this.eventCleanup.push(()=>t.removeEventListener("statechange",o));let s=[],l=()=>{s.forEach(h=>h()),s=[];let d=t.activeVideoElement;if(d)for(let h of["webkitbeginfullscreen","webkitendfullscreen"]){let p=()=>this.dispatchEvent(new Event(h));d.addEventListener(h,p),s.push(()=>d.removeEventListener(h,p))}};l(),t.addEventListener("activevideoelementchange",l),this.eventCleanup.push(()=>t.removeEventListener("activevideoelementchange",l)),this.eventCleanup.push(()=>s.forEach(d=>d()))}updateStateAttributes(){if(!this._playerCore)return;let t=this._playerCore.state;_e(this,"paused",t.paused),_e(this,"playing",t.playing),_e(this,"ended",t.ended),_e(this,"seeking",t.seeking),_e(this,"waiting",t.waiting),_e(this,"has-error",t.error!==null),_e(this,"ready",this._playerCore.ready),this.setAttribute("stream-type",t.streamType),this.setAttribute("content-type",t.contentType),t.providerType&&this.setAttribute("provider-type",t.providerType)}destroyPlayer(){var t;this.eventCleanup.forEach(r=>r()),this.eventCleanup=[],(t=this._videoRenditions)==null||t._destroy(),this._videoRenditions=null;for(let r of this.stateReceivers)fo(r);if(this.stateReceivers=[],this._playerCore&&(this._playerCore.destroy(),this._playerCore=null),this.providerContainer)for(;this.providerContainer.firstChild;)this.providerContainer.removeChild(this.providerContainer.firstChild);this.clearVideoDimensions(),this._hasDispatchedReady=!1}updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r)),this.debug&&console.log("[BPPlayer] Set video dimensions:",{width:t,height:r})):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"),this.debug&&console.log("[BPPlayer] Cleared video dimensions"))}clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}getContainerClasses(){return["bp-player-container",`bp-player-container--${this.scaling}`].join(" ")}getContainerStyle(){return this.aspectRatio?`aspect-ratio: ${this.aspectRatio}`:""}render(){return Ze`
231
231
  <div
232
232
  class="${this.getContainerClasses()}"
233
233
  style="${this.getContainerStyle()}"
234
234
  >
235
235
  </div>
236
- `}};V([Q({converter:Dr()})],Re.prototype,"source",2),V([Q({type:Boolean})],Re.prototype,"autoplay",2),V([Q({type:Boolean,reflect:!0,attribute:"muted"})],Re.prototype,"defaultMuted",2),V([Q({type:Boolean})],Re.prototype,"loop",2),V([Q({type:String})],Re.prototype,"scaling",2),V([Q({type:String,attribute:"aspect-ratio"})],Re.prototype,"aspectRatio",2),V([Q({converter:Dr()})],Re.prototype,"config",2),V([Q({type:Boolean})],Re.prototype,"debug",2),V([ii()],Re.prototype,"_playerCore",2),Re=V([ti("bp-player")],Re);var y={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"},H={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Ld={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"},Lh=Object.entries(Ld),a=Lh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),Jv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Ki=Lh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...Jv}),dT=Object.entries(Ki).reduce((i,[e,t])=>{let r=a[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),wh=Object.entries(a).reduce((i,[e,t])=>{let r=Ki[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Oe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},oi={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Gs={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Ne={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},ot={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Ih={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Ch(i){return i==null?void 0:i.map(tf).join(" ")}function Rh(i){return i==null?void 0:i.split(/\s+/).map(rf)}function tf(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(n=>n!=null).join(":")}}function rf(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function Mh(i){return i==null?void 0:i.map(nf).join(" ")}function xh(i){return i==null?void 0:i.split(/\s+/).map(of)}function nf(i){if(i){let{id:e,kind:t,language:r,label:n}=i;return[e,t,r,n].filter(o=>o!=null).join(":")}}function of(i){if(i){let[e,t,r,n]=i.split(":");return{id:e,kind:t,language:r,label:n}}}function Ur(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var zs=i=>new Promise(e=>setTimeout(e,i));var Ph=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],sf=(i,e)=>{let t=i===1?Ph[e].singular:Ph[e].plural;return`${i} ${t}`},Gi=i=>{if(!Ur(i))return"";let e=Math.abs(i),t=e!==i,r=new Date(0,0,0,0,0,e,0);return`${[r.getHours(),r.getMinutes(),r.getSeconds()].map((l,d)=>l&&sf(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function st(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),n=Math.floor(i/60%60),o=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(o=n=r="0"),o=o>0||l>0?o+":":"",n=((o||s>=10)&&n<10?"0"+n:n)+":",r=r<10?"0"+r:r,(t?"-":"")+o+n+r}var hT=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 Dh={"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 Oh,wd={en:Dh},Id=((Oh=globalThis.navigator)==null?void 0:Oh.language)||"en",Nh=i=>{Id=i};var lf=i=>{var e,t,r;let[n]=Id.split("-");return((e=wd[Id])==null?void 0:e[i])||((t=wd[n])==null?void 0:t[i])||((r=wd.en)==null?void 0:r[i])||i},b=(i,e={})=>lf(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var Ys=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Qs=class extends Ys{},Zs=class extends Qs{constructor(){super(...arguments),this.role=null}},Cd=class{observe(){}unobserve(){}disconnect(){}},Uh={createElement:function(){return new yo.HTMLElement},createElementNS:function(){return new yo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},yo={ResizeObserver:Cd,document:Uh,Node:Qs,Element:Zs,HTMLElement:class extends Zs{constructor(){super(...arguments),this.innerHTML=""}get content(){return new yo.DocumentFragment}},DocumentFragment:class extends Ys{},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}}}}},Hh="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",$h=Object.keys(yo).every(i=>i in globalThis),u=Hh&&!$h?yo:globalThis,se=Hh&&!$h?Uh:globalThis.document;var Vh=new WeakMap,Rd=i=>{let e=Vh.get(i);return e||Vh.set(i,e=new Set),e},Bh=new u.ResizeObserver(i=>{for(let e of i)for(let t of Rd(e.target))t(e)});function $t(i,e){Rd(i).add(e),Bh.observe(i)}function Vt(i,e){let t=Rd(i);t.delete(e),t.size||Bh.unobserve(i)}function oe(i){let e={};for(let t of i)e[t.name]=t.value;return e}function re(i){var e;return(e=Xs(i))!=null?e:mt(i,"media-controller")}function Xs(i){var e;let{MEDIA_CONTROLLER:t}=H,r=i.getAttribute(t);if(r)return(e=zi(i))==null?void 0:e.getElementById(r)}var js=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},df=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},Js=(i,e)=>df(i,e)[0],Me=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Me(i,e.getRootNode().host),mt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||mt(i.getRootNode().host,e)};function To(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=To(t.shadowRoot))!=null?e:t:null}function zi(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 ea(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let n=i;for(;n&&e>0;){let o=getComputedStyle(n);if(t&&o.opacity==="0"||r&&o.visibility==="hidden"||o.display==="none")return!1;n=n.parentElement,e--}return!0}function Wh(i,e,t,r){let n=r.x-t.x,o=r.y-t.y,s=n*n+o*o;if(s===0)return 0;let l=((i-t.x)*n+(e-t.y)*o)/s;return Math.max(0,Math.min(1,l))}function ne(i,e){let t=cf(i,r=>r===e);return t||Ao(i,e)}function cf(i,e){var t,r;let n;for(n of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let o;try{o=(r=n.sheet)==null?void 0:r.cssRules}catch{continue}for(let s of o??[])if(e(s.selectorText))return s}}function Ao(i,e){var t,r;let n=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],o=n==null?void 0:n[n.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(r=o.sheet.cssRules)==null?void 0:r[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function B(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function K(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}B(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function M(i,e){return i.hasAttribute(e)}function x(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}M(i,e)!=t&&i.toggleAttribute(e,t)}function O(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function N(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;O(i,e,void 0)!==r&&i.setAttribute(e,r)}var Fh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},si=(i,e,t)=>(Fh(i,e,"read from private field"),t?t.call(i):e.get(i)),uf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ta=(i,e,t,r)=>(Fh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ue;function hf(i){return`
236
+ `}};V([Z({converter:Ur()})],Me.prototype,"source",2),V([Z({type:Boolean})],Me.prototype,"autoplay",2),V([Z({type:Boolean,reflect:!0,attribute:"muted"})],Me.prototype,"defaultMuted",2),V([Z({type:Boolean})],Me.prototype,"loop",2),V([Z({type:String})],Me.prototype,"scaling",2),V([Z({type:String,attribute:"aspect-ratio"})],Me.prototype,"aspectRatio",2),V([Z({converter:Ur()})],Me.prototype,"config",2),V([Z({type:Boolean})],Me.prototype,"debug",2),V([ni()],Me.prototype,"_playerCore",2),Me=V([ri("bp-player")],Me);var _={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},H={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Cd={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"},Ch=Object.entries(Cd),a=Ch.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),rf={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Yi=Ch.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...rf}),m0=Object.entries(Yi).reduce((i,[e,t])=>{let r=a[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),Rh=Object.entries(a).reduce((i,[e,t])=>{let r=Yi[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),Ue={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ai={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Qs={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},He={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},at={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Mh={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function xh(i){return i==null?void 0:i.map(of).join(" ")}function Ph(i){return i==null?void 0:i.split(/\s+/).map(sf)}function of(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(n=>n!=null).join(":")}}function sf(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function Dh(i){return i==null?void 0:i.map(af).join(" ")}function Oh(i){return i==null?void 0:i.split(/\s+/).map(lf)}function af(i){if(i){let{id:e,kind:t,language:r,label:n}=i;return[e,t,r,n].filter(o=>o!=null).join(":")}}function lf(i){if(i){let[e,t,r,n]=i.split(":");return{id:e,kind:t,language:r,label:n}}}function Vr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var Zs=i=>new Promise(e=>setTimeout(e,i));var Nh=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],df=(i,e)=>{let t=i===1?Nh[e].singular:Nh[e].plural;return`${i} ${t}`},Qi=i=>{if(!Vr(i))return"";let e=Math.abs(i),t=e!==i,r=new Date(0,0,0,0,0,e,0);return`${[r.getHours(),r.getMinutes(),r.getSeconds()].map((l,d)=>l&&df(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function lt(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),n=Math.floor(i/60%60),o=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(o=n=r="0"),o=o>0||l>0?o+":":"",n=((o||s>=10)&&n<10?"0"+n:n)+":",r=r<10?"0"+r:r,(t?"-":"")+o+n+r}var E0=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 Uh={"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 Hh,Rd={en:Uh},Md=((Hh=globalThis.navigator)==null?void 0:Hh.language)||"en",$h=i=>{Md=i};var uf=i=>{var e,t,r;let[n]=Md.split("-");return((e=Rd[Md])==null?void 0:e[i])||((t=Rd[n])==null?void 0:t[i])||((r=Rd.en)==null?void 0:r[i])||i},b=(i,e={})=>uf(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var Xs=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},js=class extends Xs{},Js=class extends js{constructor(){super(...arguments),this.role=null}},xd=class{observe(){}unobserve(){}disconnect(){}},Vh={createElement:function(){return new Ao.HTMLElement},createElementNS:function(){return new Ao.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Ao={ResizeObserver:xd,document:Vh,Node:js,Element:Js,HTMLElement:class extends Js{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Ao.DocumentFragment}},DocumentFragment:class extends Xs{},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}}}}},Bh="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Wh=Object.keys(Ao).every(i=>i in globalThis),u=Bh&&!Wh?Ao:globalThis,le=Bh&&!Wh?Vh:globalThis.document;var Fh=new WeakMap,Pd=i=>{let e=Fh.get(i);return e||Fh.set(i,e=new Set),e},Kh=new u.ResizeObserver(i=>{for(let e of i)for(let t of Pd(e.target))t(e)});function Bt(i,e){Pd(i).add(e),Kh.observe(i)}function Wt(i,e){let t=Pd(i);t.delete(e),t.size||Kh.unobserve(i)}function ae(i){let e={};for(let t of i)e[t.name]=t.value;return e}function ne(i){var e;return(e=ea(i))!=null?e:Et(i,"media-controller")}function ea(i){var e;let{MEDIA_CONTROLLER:t}=H,r=i.getAttribute(t);if(r)return(e=Zi(i))==null?void 0:e.getElementById(r)}var ta=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},hf=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},ia=(i,e)=>hf(i,e)[0],xe=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:xe(i,e.getRootNode().host),Et=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Et(i.getRootNode().host,e)};function So(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=So(t.shadowRoot))!=null?e:t:null}function Zi(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 ra(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let n=i;for(;n&&e>0;){let o=getComputedStyle(n);if(t&&o.opacity==="0"||r&&o.visibility==="hidden"||o.display==="none")return!1;n=n.parentElement,e--}return!0}function qh(i,e,t,r){let n=r.x-t.x,o=r.y-t.y,s=n*n+o*o;if(s===0)return 0;let l=((i-t.x)*n+(e-t.y)*o)/s;return Math.max(0,Math.min(1,l))}function oe(i,e){let t=pf(i,r=>r===e);return t||ko(i,e)}function pf(i,e){var t,r;let n;for(n of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let o;try{o=(r=n.sheet)==null?void 0:r.cssRules}catch{continue}for(let s of o??[])if(e(s.selectorText))return s}}function ko(i,e){var t,r;let n=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],o=n==null?void 0:n[n.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(r=o.sheet.cssRules)==null?void 0:r[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function W(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function G(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}W(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function M(i,e){return i.hasAttribute(e)}function x(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}M(i,e)!=t&&i.toggleAttribute(e,t)}function O(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function N(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;O(i,e,void 0)!==r&&i.setAttribute(e,r)}var Gh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},li=(i,e,t)=>(Gh(i,e,"read from private field"),t?t.call(i):e.get(i)),mf=(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)},na=(i,e,t,r)=>(Gh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$e;function vf(i){return`
237
237
  <style>
238
238
  :host {
239
239
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
240
240
  box-sizing: border-box;
241
241
  }
242
242
  </style>
243
- `}var Hr=class extends u.HTMLElement{constructor(){if(super(),uf(this,Ue,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=oe(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER,a.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER&&(t&&((o=(n=si(this,Ue))==null?void 0:n.unassociateElement)==null||o.call(n,this),ta(this,Ue,null)),r&&this.isConnected&&(ta(this,Ue,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=si(this,Ue))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r,n;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),ta(this,Ue,pf(this)),this.getAttribute(H.MEDIA_CONTROLLER)&&((t=(e=si(this,Ue))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=si(this,Ue))==null||r.addEventListener("pointerdown",this),(n=si(this,Ue))==null||n.addEventListener("click",this)}disconnectedCallback(){var e,t,r,n;this.getAttribute(H.MEDIA_CONTROLLER)&&((t=(e=si(this,Ue))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=si(this,Ue))==null||r.removeEventListener("pointerdown",this),(n=si(this,Ue))==null||n.removeEventListener("click",this),ta(this,Ue,null)}handleEvent(e){var t;let r=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(r==null?void 0:r.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:o,clientY:s}=e,{left:l,top:d,width:h,height:p}=this.getBoundingClientRect(),f=o-l,E=s-d;if(f<0||E<0||f>h||E>p||h===0&&p===0)return;let m=this._pointerType||"mouse";if(this._pointerType=void 0,m===Gs.TOUCH){this.handleTap(e);return}else if(m===Gs.MOUSE||m===Gs.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(t,{composed:!0,bubbles:!0}))}};Ue=new WeakMap;Hr.shadowRootOptions={mode:"open"};Hr.getTemplateHTML=hf;function pf(i){var e;let t=i.getAttribute(H.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):mt(i,"media-controller")}u.customElements.get("media-gesture-receiver")||u.customElements.define("media-gesture-receiver",Hr);var ia=Hr;var Dd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fe=(i,e,t)=>(Dd(i,e,"read from private field"),t?t.call(i):e.get(i)),We=(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)},Yi=(i,e,t,r)=>(Dd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Qe=(i,e,t)=>(Dd(i,e,"access private method"),t),oa,$r,ko,Vr,ra,Md,qh,So,na,xd,Kh,Pd,Gh,Lo,sa,aa,Od,Br,wo,D={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function mf(i){return`
243
+ `}var Br=class extends u.HTMLElement{constructor(){if(super(),mf(this,$e,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER,a.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER&&(t&&((o=(n=li(this,$e))==null?void 0:n.unassociateElement)==null||o.call(n,this),na(this,$e,null)),r&&this.isConnected&&(na(this,$e,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=li(this,$e))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r,n;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),na(this,$e,ff(this)),this.getAttribute(H.MEDIA_CONTROLLER)&&((t=(e=li(this,$e))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=li(this,$e))==null||r.addEventListener("pointerdown",this),(n=li(this,$e))==null||n.addEventListener("click",this)}disconnectedCallback(){var e,t,r,n;this.getAttribute(H.MEDIA_CONTROLLER)&&((t=(e=li(this,$e))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=li(this,$e))==null||r.removeEventListener("pointerdown",this),(n=li(this,$e))==null||n.removeEventListener("click",this),na(this,$e,null)}handleEvent(e){var t;let r=(t=e.composedPath())==null?void 0:t[0];if(["video","media-controller"].includes(r==null?void 0:r.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:o,clientY:s}=e,{left:l,top:d,width:h,height:p}=this.getBoundingClientRect(),g=o-l,f=s-d;if(g<0||f<0||g>h||f>p||h===0&&p===0)return;let E=this._pointerType||"mouse";if(this._pointerType=void 0,E===Qs.TOUCH){this.handleTap(e);return}else if(E===Qs.MOUSE||E===Qs.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?_.MEDIA_PLAY_REQUEST:_.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(t,{composed:!0,bubbles:!0}))}};$e=new WeakMap;Br.shadowRootOptions={mode:"open"};Br.getTemplateHTML=vf;function ff(i){var e;let t=i.getAttribute(H.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Et(i,"media-controller")}u.customElements.get("media-gesture-receiver")||u.customElements.define("media-gesture-receiver",Br);var oa=Br;var Ud=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qe=(i,e,t)=>(Ud(i,e,"read from private field"),t?t.call(i):e.get(i)),Ke=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xi=(i,e,t,r)=>(Ud(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),je=(i,e,t)=>(Ud(i,e,"access private method"),t),la,Wr,wo,Fr,sa,Dd,zh,Lo,aa,Od,Yh,Nd,Qh,Io,da,ca,Hd,Kr,Co,D={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Ef(i){return`
244
244
  <style>
245
245
 
246
246
  :host([${a.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -378,8 +378,8 @@ bp-player[has-error] {
378
378
  <slot name="poster" part="layer poster-layer"></slot>
379
379
  <slot name="gestures-chrome" part="layer gesture-layer">
380
380
  <media-gesture-receiver slot="gestures-chrome">
381
- <template shadowrootmode="${ia.shadowRootOptions.mode}">
382
- ${ia.getTemplateHTML({})}
381
+ <template shadowrootmode="${oa.shadowRootOptions.mode}">
382
+ ${oa.getTemplateHTML({})}
383
383
  </template>
384
384
  </media-gesture-receiver>
385
385
  </slot>
@@ -391,7 +391,7 @@ bp-player[has-error] {
391
391
  <slot part="bottom chrome"></slot>
392
392
  </span>
393
393
  <slot name="dialog" part="layer dialog-layer"></slot>
394
- `}var vf=Object.values(a),ff="sm:384 md:576 lg:768 xl:960";function Ef(i){zh(i.target,i.contentRect.width)}function zh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(D.BREAKPOINTS))!=null?t:ff,n=gf(r),o=bf(n,e),s=!1;if(Object.keys(n).forEach(l=>{if(o.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Ki.BREAKPOINTS_CHANGE,{detail:o});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Ki.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function gf(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function bf(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Qi=class extends u.HTMLElement{constructor(){if(super(),We(this,Md),We(this,xd),We(this,Pd),We(this,Lo),We(this,aa),We(this,Br),We(this,oa,0),We(this,$r,null),We(this,ko,null),We(this,Vr,void 0),this.breakpointsComputed=!1,We(this,ra,new MutationObserver(Qe(this,Md,qh).bind(this))),We(this,So,!1),We(this,na,t=>{Fe(this,So)||(setTimeout(()=>{Ef(t),Yi(this,So,!1)},0),Yi(this,So,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=oe(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){Fe(this,$r)&&this.mediaUnsetCallback(Fe(this,$r));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[D.AUTOHIDE,D.GESTURES_DISABLED].concat(vf).filter(e=>![a.MEDIA_RENDITION_LIST,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_CHAPTERS_CUES,a.MEDIA_WIDTH,a.MEDIA_HEIGHT,a.MEDIA_ERROR,a.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==D.AUTOHIDE&&(this.autohide=r)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Yi(this,$r,e),e.localName.includes("-")&&await u.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Fe(this,ra).observe(this,{childList:!0,subtree:!0}),$t(this,Fe(this,na));let r=this.getAttribute(D.AUDIO)!=null?b("audio player"):b("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(D.USER_INACTIVE,""),zh(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=u.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Fe(this,ra).disconnect(),Vt(this,Fe(this,na)),this.media&&this.mediaUnsetCallback(this.media),(e=u.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Yi(this,$r,null)}handleEvent(e){switch(e.type){case"pointerdown":Yi(this,oa,e.timeStamp);break;case"pointermove":Qe(this,xd,Kh).call(this,e);break;case"pointerup":Qe(this,Pd,Gh).call(this,e);break;case"mouseleave":Qe(this,Lo,sa).call(this);break;case"mouseup":this.removeAttribute(D.KEYBOARD_CONTROL);break;case"keyup":Qe(this,Br,wo).call(this),this.setAttribute(D.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Yi(this,Vr,isNaN(t)?0:t)}get autohide(){return(Fe(this,Vr)===void 0?2:Fe(this,Vr)).toString()}get breakpoints(){return O(this,D.BREAKPOINTS)}set breakpoints(e){N(this,D.BREAKPOINTS,e)}get audio(){return M(this,D.AUDIO)}set audio(e){x(this,D.AUDIO,e)}get gesturesDisabled(){return M(this,D.GESTURES_DISABLED)}set gesturesDisabled(e){x(this,D.GESTURES_DISABLED,e)}get keyboardControl(){return M(this,D.KEYBOARD_CONTROL)}set keyboardControl(e){x(this,D.KEYBOARD_CONTROL,e)}get noAutohide(){return M(this,D.NO_AUTOHIDE)}set noAutohide(e){x(this,D.NO_AUTOHIDE,e)}get autohideOverControls(){return M(this,D.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){x(this,D.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return M(this,D.USER_INACTIVE)}set userInteractive(e){x(this,D.USER_INACTIVE,e)}};oa=new WeakMap;$r=new WeakMap;ko=new WeakMap;Vr=new WeakMap;ra=new WeakMap;Md=new WeakSet;qh=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let n of r){if(n.slot!="media"||t.target!=this)continue;let o=t.previousSibling&&t.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(n);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(n)}}if(e)for(let n of t.addedNodes)n===e&&this.handleMediaUpdated(e)}};So=new WeakMap;na=new WeakMap;xd=new WeakSet;Kh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-Fe(this,oa)<250)return;Qe(this,aa,Od).call(this),clearTimeout(Fe(this,ko));let e=this.hasAttribute(D.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Qe(this,Br,wo).call(this)};Pd=new WeakSet;Gh=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(D.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Qe(this,Lo,sa).call(this):Qe(this,Br,wo).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Qe(this,Br,wo).call(this)};Lo=new WeakSet;sa=function(){if(Fe(this,Vr)<0||this.hasAttribute(D.USER_INACTIVE))return;this.setAttribute(D.USER_INACTIVE,"");let i=new u.CustomEvent(Ki.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};aa=new WeakSet;Od=function(){if(!this.hasAttribute(D.USER_INACTIVE))return;this.removeAttribute(D.USER_INACTIVE);let i=new u.CustomEvent(Ki.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Br=new WeakSet;wo=function(){Qe(this,aa,Od).call(this),clearTimeout(Fe(this,ko));let i=parseInt(this.autohide);i<0||Yi(this,ko,setTimeout(()=>{Qe(this,Lo,sa).call(this)},i*1e3))};Qi.shadowRootOptions={mode:"open"};Qi.getTemplateHTML=mf;u.customElements.get("media-container")||u.customElements.define("media-container",Qi);var Yh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Te=(i,e,t)=>(Yh(i,e,"read from private field"),t?t.call(i):e.get(i)),Io=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},la=(i,e,t,r)=>(Yh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Wr,Fr,da,Zi,Bt,ai,li=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){Io(this,Bt),Io(this,Wr,void 0),Io(this,Fr,void 0),Io(this,da,void 0),Io(this,Zi,new Set),la(this,Wr,e),la(this,Fr,t),la(this,da,new Set(r))}[Symbol.iterator](){return Te(this,Bt,ai).values()}get length(){return Te(this,Bt,ai).size}get value(){var e;return(e=[...Te(this,Bt,ai)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(la(this,Zi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...Te(this,Bt,ai)][e]}values(){return Te(this,Bt,ai).values()}forEach(e,t){Te(this,Bt,ai).forEach(e,t)}add(...e){var t,r;e.forEach(n=>Te(this,Zi).add(n)),!(this.value===""&&!((t=Te(this,Wr))!=null&&t.hasAttribute(`${Te(this,Fr)}`)))&&((r=Te(this,Wr))==null||r.setAttribute(`${Te(this,Fr)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>Te(this,Zi).delete(r)),(t=Te(this,Wr))==null||t.setAttribute(`${Te(this,Fr)}`,`${this.value}`)}contains(e){return Te(this,Bt,ai).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}};Wr=new WeakMap;Fr=new WeakMap;da=new WeakMap;Zi=new WeakMap;Bt=new WeakSet;ai=function(){return Te(this,Zi).size?Te(this,Zi):Te(this,da)};var _f=(i="")=>i.split(/\s+/),Qh=(i="")=>{let[e,t,r]=i.split(":"),n=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Oe.CAPTIONS:Oe.SUBTITLES,language:t,label:n}},Xi=(i="",e={})=>_f(i).map(t=>{let r=Qh(t);return{...e,...r}}),Nd=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Qh(e):e):typeof i=="string"?Xi(i):[i]:[],ca=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Wt=(i=[])=>Array.prototype.map.call(i,ca).join(" "),yf=(i,e)=>t=>t[i]===e,Zh=i=>{let e=Object.entries(i).map(([t,r])=>yf(t,r));return t=>e.every(r=>r(t))},ji=(i,e=[],t=[])=>{let r=Nd(t).map(Zh),n=o=>r.some(s=>s(o));Array.from(e).filter(n).forEach(o=>{o.mode=i})},Ji=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Zh(e);return Array.from(i.textTracks).filter(t)},ua=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(a.MEDIA_SUBTITLES_SHOWING)};var jh=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let n=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(n){let o=(e=r[n])==null?void 0:e.call(r);if(o instanceof Promise)return o.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(n){console.error(n)}},Xh="exitFullscreen"in se?"exitFullscreen":"webkitExitFullscreen"in se?"webkitExitFullscreen":"webkitCancelFullScreen"in se?"webkitCancelFullScreen":void 0,Jh=i=>{var e;let{documentElement:t}=i;if(Xh){let r=(e=t==null?void 0:t[Xh])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},Co="fullscreenElement"in se?"fullscreenElement":"webkitFullscreenElement"in se?"webkitFullscreenElement":void 0,Tf=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[Co];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===Ih.FULLSCREEN?t:r},ep=i=>{var e;let{media:t,documentElement:r,fullscreenElement:n=t}=i;if(!t||!r)return!1;let o=Tf(i);if(!o)return!1;if(o===n||o===t)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(Co in s))return Me(o,n);for(;s!=null&&s[Co];){if(s[Co]===n)return!0;s=(e=s[Co])==null?void 0:e.shadowRoot}}return!1},Af="fullscreenEnabled"in se?"fullscreenEnabled":"webkitFullscreenEnabled"in se?"webkitFullscreenEnabled":void 0,tp=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[Af])||t&&"webkitSupportsFullscreen"in t};var ha,Ud=()=>{var i,e;return ha||(ha=(e=(i=se)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),ha)},ip=async(i=Ud())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([Sf(i,t.signal),kf(i,e)]);return t.abort(),r},Sf=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),kf=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await zs(10)}return i.volume!==e},Lf=/.*Version\/.*Safari\/.*/.test(u.navigator.userAgent),Hd=(i=Ud())=>u.matchMedia("(display-mode: standalone)").matches&&Lf?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",$d=(i=Ud())=>tp({documentElement:se,media:i}),rp=$d(),np=Hd(),op=!!u.WebKitPlaybackTargetAvailabilityEvent,sp=!!u.chrome;var qr=i=>Ji(i.media,e=>[Oe.SUBTITLES,Oe.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Vd=i=>Ji(i.media,e=>e.mode===oi.SHOWING&&[Oe.SUBTITLES,Oe.CAPTIONS].includes(e.kind)),pa=(i,e)=>{let t=qr(i),r=Vd(i),n=!!r.length;if(t.length){if(e===!1||n&&e!==!0)ji(oi.DISABLED,t,r);else if(e===!0||!n&&e!==!1){let o=t[0],{options:s}=i;if(!(s!=null&&s.noSubtitlesLangPref)){let p=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),f=p?[p,...globalThis.navigator.languages]:globalThis.navigator.languages,E=t.filter(m=>f.some(_=>m.language.toLowerCase().startsWith(_.split("-")[0]))).sort((m,_)=>{let g=f.findIndex(L=>m.language.toLowerCase().startsWith(L.split("-")[0])),I=f.findIndex(L=>_.language.toLowerCase().startsWith(L.split("-")[0]));return g-I});E[0]&&(o=E[0])}let{language:l,label:d,kind:h}=o;ji(oi.DISABLED,t,r),ji(oi.SHOWING,t,[{language:l,label:d,kind:h}])}}},ma=(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)?wf(i,e):Object.entries(i).every(([t,r])=>t in e&&ma(r,e[t])),wf=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((n,o)=>ma(n,e[o])):!0};var If=Object.values(ot),va,Cf=ip().then(i=>(va=i,va)),ap=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof u.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=u.customElements.get(t);r&&e instanceof r||(await u.customElements.whenDefined(t),u.customElements.upgrade(e))}))},Rf=new u.DOMParser,Mf=i=>i&&(Rf.parseFromString(i,"text/html").body.textContent||i),Kr={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(t=r==null?void 0:r.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,r;let{media:n}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=n==null?void 0:n.error)==null?void 0:t.message)!=null?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:r}=e;r&&(i?r.pause():(t=r.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t,options:{noMutedPref:r}={}}=e;if(t){t.muted=i;try{let n=u.localStorage.getItem("media-chrome-pref-muted")!==null,o=t.hasAttribute("muted");if(r){n&&u.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!n)return;u.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(n){console.debug("Error setting muted pref",n)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let n=u.localStorage.getItem("media-chrome-pref-muted")==="true";Kr.mediaMuted.set(n,e),i(n)}catch(n){console.debug("Error getting muted pref",n)}}]},mediaLoop:{get(i){let{media:e}=i;return e==null?void 0:e.loop},set(i,e){let{media:t}=e;t&&(t.loop=i)},mediaEvents:["medialooprequest"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t,options:{noVolumePref:r}={}}=e;if(t){try{i==null?u.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&u.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(n){console.debug("Error setting volume pref",n)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:r}=e;if(!r)return;let n=u.localStorage.getItem("media-chrome-pref-volume");if(n==null)return;Kr.mediaVolume.set(+n,e),i(+n)}catch(r){console.debug("Error getting volume pref",r)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!Ur(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let r=t.seekable.start(0),n=t.seekable.end(t.seekable.length-1);if(!(!r&&!n))return[Number(r.toFixed(3)),Number(n.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,r=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(r).map((n,o)=>[Number(r.start(o).toFixed(3)),Number(r.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[ot.LIVE,ot.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:n}=e;if(If.includes(n))return n===ot.UNKNOWN?r:n;let o=e.duration;return o===1/0?ot.LIVE:Number.isFinite(o)?ot.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=Kr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===ot.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(!(Kr.mediaStreamType.get(i)===ot.LIVE))return!1;let n=e.seekable;if(!n)return!0;if(!n.length)return!1;let o=n.end(n.length-1)-t;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return qr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Vd(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,r;let{media:n,options:o}=e;if(!n)return;let s=l=>{var d;!o.defaultSubtitles||l&&![Oe.CAPTIONS,Oe.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||pa(e,!0)};return n.addEventListener("loadstart",s),(t=n.textTracks)==null||t.addEventListener("addtrack",s),(r=n.textTracks)==null||r.addEventListener("removetrack",s),()=>{var l,d;n.removeEventListener("loadstart",s),(l=n.textTracks)==null||l.removeEventListener("addtrack",s),(d=n.textTracks)==null||d.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Ji(t,{kind:Oe.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:n,startTime:o,endTime:s})=>({text:Mf(n),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let n=r.querySelector('track[kind="chapters"][default][src]'),o=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return n==null||n.addEventListener("load",i),o==null||o.addEventListener("load",i),()=>{n==null||n.removeEventListener("load",i),o==null||o.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:n}=i;if(!r||!n||!n.pictureInPictureElement)return!1;if(n.pictureInPictureElement===r)return!0;if(n.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Me(r,n.pictureInPictureElement):!1;if(n.pictureInPictureElement.localName.includes("-")){let o=n.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===r)return!0;o=(t=o.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!se.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let r=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(n=>{if(n.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let o=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(r),o()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),o()},1e3)}else throw n}else throw n})}else se.pictureInPictureElement&&se.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(r=>({...r}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,r;let{media:n}=i;return(r=(t=n==null?void 0:n.videoRenditions)==null?void 0:t[(e=n.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:r.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let r=i,n=Array.prototype.findIndex.call(t.videoRenditions,o=>o.id==r);t.videoRenditions.selectedIndex!=n&&(t.videoRenditions.selectedIndex=n)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:r}=i;return(t=[...(e=r==null?void 0:r.audioTracks)!=null?e:[]].find(n=>n.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let r=i;for(let n of t.audioTracks)n.enabled=r==n.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return ep(i)},set(i,e,t){var r;i?(jh(e),t.detail&&((r=e.media)==null||r.focus())):Jh(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,r;let{media:n}=e;if(n&&!(i&&((t=n.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=n.remote)==null?void 0:r.state)!=="connected")){if(typeof n.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}n.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&u.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!rp||!$d(e))return Ne.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!np||!Hd(e))return Ne.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Ne.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(va===!1||(e==null?void 0:e.volume)==null)return Ne.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{va==null&&Cf.then(e=>i(e?void 0:Ne.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!sp||!((t=r==null?void 0:r.remote)!=null&&t.state))return Ne.UNSUPPORTED;if(!(e==null||e==="available"))return Ne.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!op)return Ne.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Ne.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Ne.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Ne.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Ne.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Ne.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var lp={[y.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,n,o;let{media:s}=e,l=t??void 0,d,h;if(s&&l!=null){let[m]=Ji(s,{kind:Oe.METADATA,label:"thumbnails"}),_=Array.prototype.find.call((r=m==null?void 0:m.cues)!=null?r:[],(g,I,L)=>I===0?g.endTime>l:I===L.length-1?g.startTime<=l:g.startTime<=l&&g.endTime>l);if(_){let g=/'^(?:[a-z]+:)?\/\//i.test(_.text)||(n=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:n.src,I=new URL(_.text,g);h=new URLSearchParams(I.hash).get("#xywh").split(",").map(le=>+le),d=I.href}}let p=i.mediaDuration.get(e),E=(o=i.mediaChaptersCues.get(e).find((m,_,g)=>_===g.length-1&&p===m.endTime?m.startTime<=l&&m.endTime>=l:m.startTime<=l&&m.endTime>l))==null?void 0:o.text;return t!=null&&E==null&&(E=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:h,mediaPreviewChapter:E}},[y.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[y.MEDIA_PLAY_REQUEST](i,e){var t,r,n,o;let s="mediaPaused",d=i.mediaStreamType.get(e)===ot.LIVE,h=!((t=e.options)!=null&&t.noAutoSeekToLive),p=i.mediaTargetLiveWindow.get(e)>0;if(d&&h&&!p){let f=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(f){let E=(o=(n=e.options)==null?void 0:n.seekToLiveOffset)!=null?o:0,m=f-E;i.mediaCurrentTime.set(m,e)}}i[s].set(!1,e)},[y.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",n=t;i[r].set(n,e)},[y.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[y.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[y.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",n=!!t;return i[r].set(n,e),{mediaLoop:n}},[y.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",n=t;n&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(n,e)},[y.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",n=t;i[r].set(n,e)},[y.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,n;let o="mediaCurrentTime",s=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(s)))return;let l=(n=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?n:0,d=s-l;i[o].set(d,e)},[y.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:n}=e,o=qr(e),s=Nd(t),l=(r=s[0])==null?void 0:r.language;l&&!n.noSubtitlesLangPref&&u.localStorage.setItem("media-chrome-pref-subtitles-lang",l),ji(oi.SHOWING,o,s)},[y.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=qr(e),n=t??[];ji(oi.DISABLED,r,n)},[y.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){pa(e,t)},[y.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",n=t;i[r].set(n,e)},[y.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",n=t;i[r].set(n,e)},[y.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[y.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)},[y.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[y.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[y.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[y.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var dp=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Kr,requestMap:n=lp,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],d={options:{...o}},h=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),p=g=>{g!=null&&(ma(g,h)||(h=Object.freeze({...h,...g}),l.forEach(I=>I(h))))},f=()=>{let g=Object.entries(r).reduce((I,[L,{get:le}])=>(I[L]=le(d),I),{});p(g)},E={},m,_=async(g,I)=>{var L,le,Ie,jt,Ut,Yn,A,w,W,de,ie,Y,$,ze,Qn,wu;let Ev=!!m;if(m={...d,...m??{},...g},Ev)return;await ap(...Object.values(g));let wr=l.length>0&&I===0&&s,Iu=d.media!==m.media,Cu=((L=d.media)==null?void 0:L.textTracks)!==((le=m.media)==null?void 0:le.textTracks),Ru=((Ie=d.media)==null?void 0:Ie.videoRenditions)!==((jt=m.media)==null?void 0:jt.videoRenditions),Mu=((Ut=d.media)==null?void 0:Ut.audioTracks)!==((Yn=m.media)==null?void 0:Yn.audioTracks),xu=((A=d.media)==null?void 0:A.remote)!==((w=m.media)==null?void 0:w.remote),Pu=d.documentElement!==m.documentElement,Du=!!d.media&&(Iu||wr),Ou=!!((W=d.media)!=null&&W.textTracks)&&(Cu||wr),Nu=!!((de=d.media)!=null&&de.videoRenditions)&&(Ru||wr),Uu=!!((ie=d.media)!=null&&ie.audioTracks)&&(Mu||wr),Hu=!!((Y=d.media)!=null&&Y.remote)&&(xu||wr),$u=!!d.documentElement&&(Pu||wr),id=Du||Ou||Nu||Uu||Hu||$u,Ir=l.length===0&&I===1&&s,R=!!m.media&&(Iu||Ir),Vu=!!(($=m.media)!=null&&$.textTracks)&&(Cu||Ir),Bu=!!((ze=m.media)!=null&&ze.videoRenditions)&&(Ru||Ir),Wu=!!((Qn=m.media)!=null&&Qn.audioTracks)&&(Mu||Ir),Fu=!!((wu=m.media)!=null&&wu.remote)&&(xu||Ir),qu=!!m.documentElement&&(Pu||Ir),Ku=R||Vu||Bu||Wu||Fu||qu;if(!(id||Ku)){Object.entries(m).forEach(([J,Zn])=>{d[J]=Zn}),f(),m=void 0;return}Object.entries(r).forEach(([J,{get:Zn,mediaEvents:gv=[],textTracksEvents:bv=[],videoRenditionsEvents:_v=[],audioTracksEvents:yv=[],remoteEvents:Tv=[],rootEvents:Av=[],stateOwnersUpdateHandlers:Sv=[]}])=>{E[J]||(E[J]={});let Be=ce=>{let fe=Zn(d,ce);p({[J]:fe})},_e;_e=E[J].mediaEvents,gv.forEach(ce=>{_e&&Du&&(d.media.removeEventListener(ce,_e),E[J].mediaEvents=void 0),R&&(m.media.addEventListener(ce,Be),E[J].mediaEvents=Be)}),_e=E[J].textTracksEvents,bv.forEach(ce=>{var fe,it;_e&&Ou&&((fe=d.media.textTracks)==null||fe.removeEventListener(ce,_e),E[J].textTracksEvents=void 0),Vu&&((it=m.media.textTracks)==null||it.addEventListener(ce,Be),E[J].textTracksEvents=Be)}),_e=E[J].videoRenditionsEvents,_v.forEach(ce=>{var fe,it;_e&&Nu&&((fe=d.media.videoRenditions)==null||fe.removeEventListener(ce,_e),E[J].videoRenditionsEvents=void 0),Bu&&((it=m.media.videoRenditions)==null||it.addEventListener(ce,Be),E[J].videoRenditionsEvents=Be)}),_e=E[J].audioTracksEvents,yv.forEach(ce=>{var fe,it;_e&&Uu&&((fe=d.media.audioTracks)==null||fe.removeEventListener(ce,_e),E[J].audioTracksEvents=void 0),Wu&&((it=m.media.audioTracks)==null||it.addEventListener(ce,Be),E[J].audioTracksEvents=Be)}),_e=E[J].remoteEvents,Tv.forEach(ce=>{var fe,it;_e&&Hu&&((fe=d.media.remote)==null||fe.removeEventListener(ce,_e),E[J].remoteEvents=void 0),Fu&&((it=m.media.remote)==null||it.addEventListener(ce,Be),E[J].remoteEvents=Be)}),_e=E[J].rootEvents,Av.forEach(ce=>{_e&&$u&&(d.documentElement.removeEventListener(ce,_e),E[J].rootEvents=void 0),qu&&(m.documentElement.addEventListener(ce,Be),E[J].rootEvents=Be)});let xs=E[J].stateOwnersUpdateHandlers;if(xs&&id&&(Array.isArray(xs)?xs:[xs]).forEach(fe=>{typeof fe=="function"&&fe()}),Ku){let ce=Sv.map(fe=>fe(Be,m)).filter(fe=>typeof fe=="function");E[J].stateOwnersUpdateHandlers=ce.length===1?ce[0]:ce}else id&&(E[J].stateOwnersUpdateHandlers=void 0)}),Object.entries(m).forEach(([J,Zn])=>{d[J]=Zn}),f(),m=void 0};return _({media:i,fullscreenElement:e,documentElement:t,options:o}),{dispatch(g){let{type:I,detail:L}=g;if(n[I]&&h.mediaErrorCode==null){p(n[I](r,d,g));return}I==="mediaelementchangerequest"?_({media:L}):I==="fullscreenelementchangerequest"?_({fullscreenElement:L}):I==="documentelementchangerequest"?_({documentElement:L}):I==="optionschangerequest"&&(Object.entries(L??{}).forEach(([le,Ie])=>{d.options[le]=Ie}),f())},getState(){return h},subscribe(g){return _({},l.length+1),l.push(g),g(h),()=>{let I=l.indexOf(g);I>=0&&(_({},l.length-1),l.splice(I,1))}}}};var Gd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},P=(i,e,t)=>(Gd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ze=(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)},vt=(i,e,t,r)=>(Gd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Et=(i,e,t)=>(Gd(i,e,"access private method"),t),di,Ro,z,tr,Mo,ft,fa,xo,Ea,Bd,ir,Gr,ga,Wd,Fd,fp,Ep=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],cp=10,up=.025,hp=.25,xf=.25,Pf=2,T={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"},qd=class extends Qi{constructor(){super(),Ze(this,Ea),Ze(this,ir),Ze(this,ga),Ze(this,Fd),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ze(this,di,new li(this,T.HOTKEYS)),Ze(this,Ro,void 0),Ze(this,z,void 0),Ze(this,tr,null),Ze(this,Mo,void 0),Ze(this,ft,void 0),Ze(this,fa,t=>{var r;(r=P(this,z))==null||r.dispatch(t)}),Ze(this,xo,void 0),this.associateElement(this);let e={};vt(this,Mo,t=>{Object.entries(t).forEach(([r,n])=>{if(r in e&&e[r]===n)return;this.propagateMediaState(r,n);let o=r.toLowerCase(),s=new u.CustomEvent(wh[o],{composed:!0,detail:n});this.dispatchEvent(s)}),e=t}),this.hasAttribute(T.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(T.NO_HOTKEYS,T.HOTKEYS,T.DEFAULT_STREAM_TYPE,T.DEFAULT_SUBTITLES,T.DEFAULT_DURATION,T.NO_MUTED_PREF,T.NO_VOLUME_PREF,T.LANG,T.LOOP)}get mediaStore(){return P(this,z)}set mediaStore(e){var t,r;if(P(this,z)&&((t=P(this,ft))==null||t.call(this),vt(this,ft,void 0)),vt(this,z,e),!P(this,z)&&!this.hasAttribute(T.NO_DEFAULT_STORE)){Et(this,Ea,Bd).call(this);return}vt(this,ft,(r=P(this,z))==null?void 0:r.subscribe(P(this,Mo)))}get fullscreenElement(){var e;return(e=P(this,Ro))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(T.FULLSCREEN_ELEMENT)&&this.removeAttribute(T.FULLSCREEN_ELEMENT),vt(this,Ro,e),(t=P(this,z))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return M(this,T.DEFAULT_SUBTITLES)}set defaultSubtitles(e){x(this,T.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return O(this,T.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){N(this,T.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return B(this,T.DEFAULT_DURATION)}set defaultDuration(e){K(this,T.DEFAULT_DURATION,e)}get noHotkeys(){return M(this,T.NO_HOTKEYS)}set noHotkeys(e){x(this,T.NO_HOTKEYS,e)}get keysUsed(){return O(this,T.KEYS_USED)}set keysUsed(e){N(this,T.KEYS_USED,e)}get liveEdgeOffset(){return B(this,T.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){K(this,T.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return M(this,T.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){x(this,T.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return M(this,T.NO_VOLUME_PREF)}set noVolumePref(e){x(this,T.NO_VOLUME_PREF,e)}get noMutedPref(){return M(this,T.NO_MUTED_PREF)}set noMutedPref(e){x(this,T.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return M(this,T.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){x(this,T.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return M(this,T.NO_DEFAULT_STORE)}set noDefaultStore(e){x(this,T.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var n,o,s,l,d,h,p,f,E,m,_,g;if(super.attributeChangedCallback(e,t,r),e===T.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(T.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===T.HOTKEYS)P(this,di).value=r;else if(e===T.DEFAULT_SUBTITLES&&r!==t)(n=P(this,z))==null||n.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES)}});else if(e===T.DEFAULT_STREAM_TYPE)(s=P(this,z))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===T.LIVE_EDGE_OFFSET)(l=P(this,z))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(T.LIVE_EDGE_OFFSET)}});else if(e===T.SEEK_TO_LIVE_OFFSET)(d=P(this,z))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(T.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===T.NO_AUTO_SEEK_TO_LIVE)(h=P(this,z))==null||h.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(T.NO_AUTO_SEEK_TO_LIVE)}});else if(e===T.FULLSCREEN_ELEMENT){let I=r?(p=this.getRootNode())==null?void 0:p.getElementById(r):void 0;vt(this,Ro,I),(f=P(this,z))==null||f.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===T.LANG&&r!==t?(Nh(r),(E=P(this,z))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===T.LOOP&&r!==t?(m=P(this,z))==null||m.dispatch({type:y.MEDIA_LOOP_REQUEST,detail:r!=null}):e===T.NO_VOLUME_PREF&&r!==t?(_=P(this,z))==null||_.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF)}}):e===T.NO_MUTED_PREF&&r!==t&&((g=P(this,z))==null||g.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(T.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!P(this,z)&&!this.hasAttribute(T.NO_DEFAULT_STORE)&&Et(this,Ea,Bd).call(this),(e=P(this,z))==null||e.dispatch({type:"documentelementchangerequest",detail:se}),super.connectedCallback(),P(this,z)&&!P(this,ft)&&vt(this,ft,(t=P(this,z))==null?void 0:t.subscribe(P(this,Mo))),P(this,xo)!==void 0&&P(this,z)&&this.media&&setTimeout(()=>{var r,n,o;(n=(r=this.media)==null?void 0:r.textTracks)!=null&&n.length&&((o=P(this,z))==null||o.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:P(this,xo)}))},0),this.hasAttribute(T.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,n,o;if((e=super.disconnectedCallback)==null||e.call(this),P(this,z)){let s=P(this,z).getState();vt(this,xo,!!((t=s.mediaSubtitlesShowing)!=null&&t.length)),(r=P(this,z))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(n=P(this,z))==null||n.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}P(this,ft)&&((o=P(this,ft))==null||o.call(this),vt(this,ft,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=P(this,z))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=P(this,z))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){vp(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),n=this.unregisterMediaStateReceiver.bind(this),o=$f(e,r,n);Object.values(y).forEach(s=>{e.addEventListener(s,P(this,fa))}),t.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(y).forEach(n=>{e.removeEventListener(n,P(this,fa))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),P(this,z)&&Object.entries(P(this,z).getState()).forEach(([n,o])=>{vp([e],n,o)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",Et(this,ga,Wd))}disableHotkeys(){this.removeEventListener("keydown",Et(this,ga,Wd)),this.removeEventListener("keyup",Et(this,ir,Gr))}get hotkeys(){return O(this,T.HOTKEYS)}set hotkeys(e){N(this,T.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,n,o,s,l,d,h,p;let f=e.target;if(((n=(r=(t=f.getAttribute(T.KEYS_USED))==null?void 0:t.split(" "))!=null?r:f==null?void 0:f.keysUsed)!=null?n:[]).map(L=>L==="Space"?" ":L).filter(Boolean).includes(e.key))return;let m,_,g;if(!(P(this,di).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&P(this,di).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&P(this,di).contains("noshift+/")))switch(e.key){case" ":case"k":m=P(this,z).getState().mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new u.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m=this.mediaStore.getState().mediaVolumeLevel==="off"?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST,this.dispatchEvent(new u.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?y.MEDIA_EXIT_FULLSCREEN_REQUEST:y.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new u.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new u.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let L=this.hasAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET):cp;_=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-L,0),g=new u.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowRight":case"l":{let L=this.hasAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET):cp;_=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+L,0),g=new u.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowUp":{let L=this.hasAttribute(T.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(T.KEYBOARD_UP_VOLUME_STEP):up;_=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+L,1),g=new u.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowDown":{let L=this.hasAttribute(T.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(T.KEYBOARD_DOWN_VOLUME_STEP):up;_=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-L,0),g=new u.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"<":{let L=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;_=Math.max(L-hp,xf).toFixed(2),g=new u.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case">":{let L=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;_=Math.min(L+hp,Pf).toFixed(2),g=new u.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"/":case"?":{e.shiftKey&&Et(this,Fd,fp).call(this);break}case"p":{m=this.mediaStore.getState().mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST,g=new u.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(g);break}default:break}}};di=new WeakMap;Ro=new WeakMap;z=new WeakMap;tr=new WeakMap;Mo=new WeakMap;ft=new WeakMap;fa=new WeakMap;xo=new WeakMap;Ea=new WeakSet;Bd=function(){var i;this.mediaStore=dp({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(T.DEFAULT_DURATION)?+this.getAttribute(T.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(T.SEEK_TO_LIVE_OFFSET):this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(T.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(T.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(T.NO_SUBTITLES_LANG_PREF)}})};ir=new WeakSet;Gr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||Ep.includes(e))){this.removeEventListener("keyup",Et(this,ir,Gr));return}this.keyboardShortcutHandler(i)};ga=new WeakSet;Wd=function(i){var e;let{metaKey:t,altKey:r,key:n,shiftKey:o}=i,s=o&&(n==="/"||n==="?");if(s&&((e=P(this,tr))!=null&&e.open)){this.removeEventListener("keyup",Et(this,ir,Gr));return}if(t||r||!s&&!Ep.includes(n)){this.removeEventListener("keyup",Et(this,ir,Gr));return}let l=i.target,d=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(n)&&!(P(this,di).contains(`no${n.toLowerCase()}`)||n===" "&&P(this,di).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",Et(this,ir,Gr),{once:!0})};Fd=new WeakSet;fp=function(){P(this,tr)||(vt(this,tr,se.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(P(this,tr))),P(this,tr).open=!0};var Df=Object.values(a),Of=Object.values(Ld),gp=i=>{var e,t,r,n;let{observedAttributes:o}=i.constructor;!o&&((e=i.nodeName)!=null&&e.includes("-"))&&(u.customElements.upgrade(i),{observedAttributes:o}=i.constructor);let s=(n=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,H.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:n.call(r,/\s+/);return Array.isArray(o||s)?(o||s).filter(l=>Df.includes(l)):[]},Nf=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&u.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof u.customElements.get(i.nodeName.toLowerCase()))&&u.customElements.upgrade(i),Of.some(r=>r in i)},Kd=i=>Nf(i)||!!gp(i).length,pp=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},mp={[a.MEDIA_SUBTITLES_LIST]:Wt,[a.MEDIA_SUBTITLES_SHOWING]:Wt,[a.MEDIA_SEEKABLE]:pp,[a.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(pp).join(" "),[a.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[a.MEDIA_RENDITION_LIST]:Ch,[a.MEDIA_AUDIO_TRACK_LIST]:Mh},Uf=async(i,e,t)=>{var r,n;if(i.isConnected||await zs(0),typeof t=="boolean"||t==null)return x(i,e,t);if(typeof t=="number")return K(i,e,t);if(typeof t=="string")return N(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let o=(n=(r=mp[e])==null?void 0:r.call(mp,t))!=null?n:t;return i.setAttribute(e,o)},Hf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},er=(i,e)=>{if(Hf(i))return;let t=(n,o)=>{var s,l;Kd(n)&&o(n);let{children:d=[]}=n??{},h=(l=(s=n==null?void 0:n.shadowRoot)==null?void 0:s.children)!=null?l:[];[...d,...h].forEach(f=>er(f,o))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!Kd(i)){u.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},vp=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let n=gp(r),o=e.toLowerCase();n.includes(o)&&Uf(r,o,t)})},$f=(i,e,t)=>{er(i,e);let r=p=>{var f;let E=(f=p==null?void 0:p.composedPath()[0])!=null?f:p.target;e(E)},n=p=>{var f;let E=(f=p==null?void 0:p.composedPath()[0])!=null?f:p.target;t(E)};i.addEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,n);let o=p=>{p.forEach(f=>{let{addedNodes:E=[],removedNodes:m=[],type:_,target:g,attributeName:I}=f;_==="childList"?(Array.prototype.forEach.call(E,L=>er(L,e)),Array.prototype.forEach.call(m,L=>er(L,t))):_==="attributes"&&I===H.MEDIA_CHROME_ATTRIBUTES&&(Kd(g)?e(g):t(g))})},s=[],l=p=>{let f=p.target;f.name!=="media"&&(s.forEach(E=>er(E,t)),s=[...f.assignedElements({flatten:!0})],s.forEach(E=>er(E,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(o);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{er(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,n)}};u.customElements.get("media-controller")||u.customElements.define("media-controller",qd);var zr={PLACEMENT:"placement",BOUNDS:"bounds"};function Vf(i){return`
394
+ `}var gf=Object.values(a),bf="sm:384 md:576 lg:768 xl:960";function _f(i){Zh(i.target,i.contentRect.width)}function Zh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(D.BREAKPOINTS))!=null?t:bf,n=yf(r),o=Tf(n,e),s=!1;if(Object.keys(n).forEach(l=>{if(o.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Yi.BREAKPOINTS_CHANGE,{detail:o});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Yi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function yf(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Tf(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var ji=class extends u.HTMLElement{constructor(){if(super(),Ke(this,Dd),Ke(this,Od),Ke(this,Nd),Ke(this,Io),Ke(this,ca),Ke(this,Kr),Ke(this,la,0),Ke(this,Wr,null),Ke(this,wo,null),Ke(this,Fr,void 0),this.breakpointsComputed=!1,Ke(this,sa,new MutationObserver(je(this,Dd,zh).bind(this))),Ke(this,Lo,!1),Ke(this,aa,t=>{qe(this,Lo)||(setTimeout(()=>{_f(t),Xi(this,Lo,!1)},0),Xi(this,Lo,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=ae(this.attributes),r=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(r):this.shadowRoot.innerHTML=r}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){qe(this,Wr)&&this.mediaUnsetCallback(qe(this,Wr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[D.AUTOHIDE,D.GESTURES_DISABLED].concat(gf).filter(e=>![a.MEDIA_RENDITION_LIST,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_CHAPTERS_CUES,a.MEDIA_WIDTH,a.MEDIA_HEIGHT,a.MEDIA_ERROR,a.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==D.AUTOHIDE&&(this.autohide=r)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Xi(this,Wr,e),e.localName.includes("-")&&await u.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;qe(this,sa).observe(this,{childList:!0,subtree:!0}),Bt(this,qe(this,aa));let r=this.getAttribute(D.AUDIO)!=null?b("audio player"):b("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(D.USER_INACTIVE,""),Zh(this,this.getBoundingClientRect().width),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=u.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;qe(this,sa).disconnect(),Wt(this,qe(this,aa)),this.media&&this.mediaUnsetCallback(this.media),(e=u.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Xi(this,Wr,null)}handleEvent(e){switch(e.type){case"pointerdown":Xi(this,la,e.timeStamp);break;case"pointermove":je(this,Od,Yh).call(this,e);break;case"pointerup":je(this,Nd,Qh).call(this,e);break;case"mouseleave":je(this,Io,da).call(this);break;case"mouseup":this.removeAttribute(D.KEYBOARD_CONTROL);break;case"keyup":je(this,Kr,Co).call(this),this.setAttribute(D.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Xi(this,Fr,isNaN(t)?0:t)}get autohide(){return(qe(this,Fr)===void 0?2:qe(this,Fr)).toString()}get breakpoints(){return O(this,D.BREAKPOINTS)}set breakpoints(e){N(this,D.BREAKPOINTS,e)}get audio(){return M(this,D.AUDIO)}set audio(e){x(this,D.AUDIO,e)}get gesturesDisabled(){return M(this,D.GESTURES_DISABLED)}set gesturesDisabled(e){x(this,D.GESTURES_DISABLED,e)}get keyboardControl(){return M(this,D.KEYBOARD_CONTROL)}set keyboardControl(e){x(this,D.KEYBOARD_CONTROL,e)}get noAutohide(){return M(this,D.NO_AUTOHIDE)}set noAutohide(e){x(this,D.NO_AUTOHIDE,e)}get autohideOverControls(){return M(this,D.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){x(this,D.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return M(this,D.USER_INACTIVE)}set userInteractive(e){x(this,D.USER_INACTIVE,e)}};la=new WeakMap;Wr=new WeakMap;wo=new WeakMap;Fr=new WeakMap;sa=new WeakMap;Dd=new WeakSet;zh=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let n of r){if(n.slot!="media"||t.target!=this)continue;let o=t.previousSibling&&t.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(n);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(n)}}if(e)for(let n of t.addedNodes)n===e&&this.handleMediaUpdated(e)}};Lo=new WeakMap;aa=new WeakMap;Od=new WeakSet;Yh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-qe(this,la)<250)return;je(this,ca,Hd).call(this),clearTimeout(qe(this,wo));let e=this.hasAttribute(D.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&je(this,Kr,Co).call(this)};Nd=new WeakSet;Qh=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(D.USER_INACTIVE);[this,this.media].includes(i.target)&&e?je(this,Io,da).call(this):je(this,Kr,Co).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&je(this,Kr,Co).call(this)};Io=new WeakSet;da=function(){if(qe(this,Fr)<0||this.hasAttribute(D.USER_INACTIVE))return;this.setAttribute(D.USER_INACTIVE,"");let i=new u.CustomEvent(Yi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};ca=new WeakSet;Hd=function(){if(!this.hasAttribute(D.USER_INACTIVE))return;this.removeAttribute(D.USER_INACTIVE);let i=new u.CustomEvent(Yi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Kr=new WeakSet;Co=function(){je(this,ca,Hd).call(this),clearTimeout(qe(this,wo));let i=parseInt(this.autohide);i<0||Xi(this,wo,setTimeout(()=>{je(this,Io,da).call(this)},i*1e3))};ji.shadowRootOptions={mode:"open"};ji.getTemplateHTML=Ef;u.customElements.get("media-container")||u.customElements.define("media-container",ji);var Xh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Se=(i,e,t)=>(Xh(i,e,"read from private field"),t?t.call(i):e.get(i)),Ro=(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)},ua=(i,e,t,r)=>(Xh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),qr,Gr,ha,Ji,Ft,di,ci=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){Ro(this,Ft),Ro(this,qr,void 0),Ro(this,Gr,void 0),Ro(this,ha,void 0),Ro(this,Ji,new Set),ua(this,qr,e),ua(this,Gr,t),ua(this,ha,new Set(r))}[Symbol.iterator](){return Se(this,Ft,di).values()}get length(){return Se(this,Ft,di).size}get value(){var e;return(e=[...Se(this,Ft,di)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(ua(this,Ji,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...Se(this,Ft,di)][e]}values(){return Se(this,Ft,di).values()}forEach(e,t){Se(this,Ft,di).forEach(e,t)}add(...e){var t,r;e.forEach(n=>Se(this,Ji).add(n)),!(this.value===""&&!((t=Se(this,qr))!=null&&t.hasAttribute(`${Se(this,Gr)}`)))&&((r=Se(this,qr))==null||r.setAttribute(`${Se(this,Gr)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>Se(this,Ji).delete(r)),(t=Se(this,qr))==null||t.setAttribute(`${Se(this,Gr)}`,`${this.value}`)}contains(e){return Se(this,Ft,di).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}};qr=new WeakMap;Gr=new WeakMap;ha=new WeakMap;Ji=new WeakMap;Ft=new WeakSet;di=function(){return Se(this,Ji).size?Se(this,Ji):Se(this,ha)};var Af=(i="")=>i.split(/\s+/),jh=(i="")=>{let[e,t,r]=i.split(":"),n=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?Ue.CAPTIONS:Ue.SUBTITLES,language:t,label:n}},er=(i="",e={})=>Af(i).map(t=>{let r=jh(t);return{...e,...r}}),$d=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?jh(e):e):typeof i=="string"?er(i):[i]:[],pa=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Kt=(i=[])=>Array.prototype.map.call(i,pa).join(" "),Sf=(i,e)=>t=>t[i]===e,Jh=i=>{let e=Object.entries(i).map(([t,r])=>Sf(t,r));return t=>e.every(r=>r(t))},tr=(i,e=[],t=[])=>{let r=$d(t).map(Jh),n=o=>r.some(s=>s(o));Array.from(e).filter(n).forEach(o=>{o.mode=i})},ir=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Jh(e);return Array.from(i.textTracks).filter(t)},ma=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(a.MEDIA_SUBTITLES_SHOWING)};var tp=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let n=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(n){let o=(e=r[n])==null?void 0:e.call(r);if(o instanceof Promise)return o.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(n){console.error(n)}},ep="exitFullscreen"in le?"exitFullscreen":"webkitExitFullscreen"in le?"webkitExitFullscreen":"webkitCancelFullScreen"in le?"webkitCancelFullScreen":void 0,ip=i=>{var e;let{documentElement:t}=i;if(ep){let r=(e=t==null?void 0:t[ep])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},Mo="fullscreenElement"in le?"fullscreenElement":"webkitFullscreenElement"in le?"webkitFullscreenElement":void 0,kf=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[Mo];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===Mh.FULLSCREEN?t:r},rp=i=>{var e;let{media:t,documentElement:r,fullscreenElement:n=t}=i;if(!t||!r)return!1;let o=kf(i);if(!o)return!1;if(o===n||o===t)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(Mo in s))return xe(o,n);for(;s!=null&&s[Mo];){if(s[Mo]===n)return!0;s=(e=s[Mo])==null?void 0:e.shadowRoot}}return!1},Lf="fullscreenEnabled"in le?"fullscreenEnabled":"webkitFullscreenEnabled"in le?"webkitFullscreenEnabled":void 0,np=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[Lf])||t&&"webkitSupportsFullscreen"in t};var va,Vd=()=>{var i,e;return va||(va=(e=(i=le)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),va)},op=async(i=Vd())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([wf(i,t.signal),If(i,e)]);return t.abort(),r},wf=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),If=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await Zs(10)}return i.volume!==e},Cf=/.*Version\/.*Safari\/.*/.test(u.navigator.userAgent),Bd=(i=Vd())=>u.matchMedia("(display-mode: standalone)").matches&&Cf?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Wd=(i=Vd())=>np({documentElement:le,media:i}),sp=Wd(),ap=Bd(),lp=!!u.WebKitPlaybackTargetAvailabilityEvent,dp=!!u.chrome;var zr=i=>ir(i.media,e=>[Ue.SUBTITLES,Ue.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Fd=i=>ir(i.media,e=>e.mode===ai.SHOWING&&[Ue.SUBTITLES,Ue.CAPTIONS].includes(e.kind)),fa=(i,e)=>{let t=zr(i),r=Fd(i),n=!!r.length;if(t.length){if(e===!1||n&&e!==!0)tr(ai.DISABLED,t,r);else if(e===!0||!n&&e!==!1){let o=t[0],{options:s}=i;if(!(s!=null&&s.noSubtitlesLangPref)){let p=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=p?[p,...globalThis.navigator.languages]:globalThis.navigator.languages,f=t.filter(E=>g.some(y=>E.language.toLowerCase().startsWith(y.split("-")[0]))).sort((E,y)=>{let v=g.findIndex(I=>E.language.toLowerCase().startsWith(I.split("-")[0])),S=g.findIndex(I=>y.language.toLowerCase().startsWith(I.split("-")[0]));return v-S});f[0]&&(o=f[0])}let{language:l,label:d,kind:h}=o;tr(ai.DISABLED,t,r),tr(ai.SHOWING,t,[{language:l,label:d,kind:h}])}}},Ea=(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)?Rf(i,e):Object.entries(i).every(([t,r])=>t in e&&Ea(r,e[t])),Rf=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((n,o)=>Ea(n,e[o])):!0};var Mf=Object.values(at),ga,xf=op().then(i=>(ga=i,ga)),cp=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof u.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=u.customElements.get(t);r&&e instanceof r||(await u.customElements.whenDefined(t),u.customElements.upgrade(e))}))},Pf=new u.DOMParser,Df=i=>i&&(Pf.parseFromString(i,"text/html").body.textContent||i),Yr={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(t=r==null?void 0:r.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,r;let{media:n}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=n==null?void 0:n.error)==null?void 0:t.message)!=null?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:r}=e;r&&(i?r.pause():(t=r.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t,options:{noMutedPref:r}={}}=e;if(t){t.muted=i;try{let n=u.localStorage.getItem("media-chrome-pref-muted")!==null,o=t.hasAttribute("muted");if(r){n&&u.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!n)return;u.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(n){console.debug("Error setting muted pref",n)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let n=u.localStorage.getItem("media-chrome-pref-muted")==="true";Yr.mediaMuted.set(n,e),i(n)}catch(n){console.debug("Error getting muted pref",n)}}]},mediaLoop:{get(i){let{media:e}=i;return e==null?void 0:e.loop},set(i,e){let{media:t}=e;t&&(t.loop=i)},mediaEvents:["medialooprequest"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t,options:{noVolumePref:r}={}}=e;if(t){try{i==null?u.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&u.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(n){console.debug("Error setting volume pref",n)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:r}=e;if(!r)return;let n=u.localStorage.getItem("media-chrome-pref-volume");if(n==null)return;Yr.mediaVolume.set(+n,e),i(+n)}catch(r){console.debug("Error getting volume pref",r)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!Vr(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let r=t.seekable.start(0),n=t.seekable.end(t.seekable.length-1);if(!(!r&&!n))return[Number(r.toFixed(3)),Number(n.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,r=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(r).map((n,o)=>[Number(r.start(o).toFixed(3)),Number(r.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[at.LIVE,at.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:n}=e;if(Mf.includes(n))return n===at.UNKNOWN?r:n;let o=e.duration;return o===1/0?at.LIVE:Number.isFinite(o)?at.ON_DEMAND:r},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,r=Yr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===at.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Yr.mediaStreamType.get(i)===at.LIVE))return!1;let n=e.seekable;if(!n)return!0;if(!n.length)return!1;let o=n.end(n.length-1)-t;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return zr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Fd(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,r;let{media:n,options:o}=e;if(!n)return;let s=l=>{var d;!o.defaultSubtitles||l&&![Ue.CAPTIONS,Ue.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||fa(e,!0)};return n.addEventListener("loadstart",s),(t=n.textTracks)==null||t.addEventListener("addtrack",s),(r=n.textTracks)==null||r.addEventListener("removetrack",s),()=>{var l,d;n.removeEventListener("loadstart",s),(l=n.textTracks)==null||l.removeEventListener("addtrack",s),(d=n.textTracks)==null||d.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=ir(t,{kind:Ue.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:n,startTime:o,endTime:s})=>({text:Df(n),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let n=r.querySelector('track[kind="chapters"][default][src]'),o=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return n==null||n.addEventListener("load",i),o==null||o.addEventListener("load",i),()=>{n==null||n.removeEventListener("load",i),o==null||o.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:n}=i;if(!r||!n||!n.pictureInPictureElement)return!1;if(n.pictureInPictureElement===r)return!0;if(n.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?xe(r,n.pictureInPictureElement):!1;if(n.pictureInPictureElement.localName.includes("-")){let o=n.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===r)return!0;o=(t=o.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!le.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let r=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(n=>{if(n.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let o=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(r),o()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),o()},1e3)}else throw n}else throw n})}else le.pictureInPictureElement&&le.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(r=>({...r}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,r;let{media:n}=i;return(r=(t=n==null?void 0:n.videoRenditions)==null?void 0:t[(e=n.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:r.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let r=i,n=Array.prototype.findIndex.call(t.videoRenditions,o=>o.id==r);t.videoRenditions.selectedIndex!=n&&(t.videoRenditions.selectedIndex=n)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:r}=i;return(t=[...(e=r==null?void 0:r.audioTracks)!=null?e:[]].find(n=>n.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let r=i;for(let n of t.audioTracks)n.enabled=r==n.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return rp(i)},set(i,e,t){var r;i?(tp(e),t.detail&&((r=e.media)==null||r.focus())):ip(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,r;let{media:n}=e;if(n&&!(i&&((t=n.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=n.remote)==null?void 0:r.state)!=="connected")){if(typeof n.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}n.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&u.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!sp||!Wd(e))return He.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!ap||!Bd(e))return He.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return He.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(ga===!1||(e==null?void 0:e.volume)==null)return He.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{ga==null&&xf.then(e=>i(e?void 0:He.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!dp||!((t=r==null?void 0:r.remote)!=null&&t.state))return He.UNSUPPORTED;if(!(e==null||e==="available"))return He.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!lp)return He.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return He.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(o=>{i({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var o;(o=r==null?void 0:r.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return He.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return He.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return He.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return He.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var up={[_.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,n,o;let{media:s}=e,l=t??void 0,d,h;if(s&&l!=null){let[E]=ir(s,{kind:Ue.METADATA,label:"thumbnails"}),y=Array.prototype.find.call((r=E==null?void 0:E.cues)!=null?r:[],(v,S,I)=>S===0?v.endTime>l:S===I.length-1?v.startTime<=l:v.startTime<=l&&v.endTime>l);if(y){let v=/'^(?:[a-z]+:)?\/\//i.test(y.text)||(n=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:n.src,S=new URL(y.text,v);h=new URLSearchParams(S.hash).get("#xywh").split(",").map(B=>+B),d=S.href}}let p=i.mediaDuration.get(e),f=(o=i.mediaChaptersCues.get(e).find((E,y,v)=>y===v.length-1&&p===E.endTime?E.startTime<=l&&E.endTime>=l:E.startTime<=l&&E.endTime>l))==null?void 0:o.text;return t!=null&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:h,mediaPreviewChapter:f}},[_.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[_.MEDIA_PLAY_REQUEST](i,e){var t,r,n,o;let s="mediaPaused",d=i.mediaStreamType.get(e)===at.LIVE,h=!((t=e.options)!=null&&t.noAutoSeekToLive),p=i.mediaTargetLiveWindow.get(e)>0;if(d&&h&&!p){let g=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(g){let f=(o=(n=e.options)==null?void 0:n.seekToLiveOffset)!=null?o:0,E=g-f;i.mediaCurrentTime.set(E,e)}}i[s].set(!1,e)},[_.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",n=t;i[r].set(n,e)},[_.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[_.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[_.MEDIA_LOOP_REQUEST](i,e,{detail:t}){let r="mediaLoop",n=!!t;return i[r].set(n,e),{mediaLoop:n}},[_.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",n=t;n&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(n,e)},[_.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",n=t;i[r].set(n,e)},[_.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,n;let o="mediaCurrentTime",s=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(s)))return;let l=(n=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?n:0,d=s-l;i[o].set(d,e)},[_.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:n}=e,o=zr(e),s=$d(t),l=(r=s[0])==null?void 0:r.language;l&&!n.noSubtitlesLangPref&&u.localStorage.setItem("media-chrome-pref-subtitles-lang",l),tr(ai.SHOWING,o,s)},[_.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=zr(e),n=t??[];tr(ai.DISABLED,r,n)},[_.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){fa(e,t)},[_.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",n=t;i[r].set(n,e)},[_.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",n=t;i[r].set(n,e)},[_.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[_.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[_.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e,t){let r="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[r].set(!0,e,t)},[_.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[_.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[_.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[_.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var hp=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Yr,requestMap:n=up,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],d={options:{...o}},h=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),p=v=>{v!=null&&(Ea(v,h)||(h=Object.freeze({...h,...v}),l.forEach(S=>S(h))))},g=()=>{let v=Object.entries(r).reduce((S,[I,{get:B}])=>(S[I]=B(d),S),{});p(v)},f={},E,y=async(v,S)=>{var I,B,se,De,ft,ei,A,w,F,ce,re,Q,$,Qe,Xn,Ru;let _v=!!E;if(E={...d,...E??{},...v},_v)return;await cp(...Object.values(v));let Rr=l.length>0&&S===0&&s,Mu=d.media!==E.media,xu=((I=d.media)==null?void 0:I.textTracks)!==((B=E.media)==null?void 0:B.textTracks),Pu=((se=d.media)==null?void 0:se.videoRenditions)!==((De=E.media)==null?void 0:De.videoRenditions),Du=((ft=d.media)==null?void 0:ft.audioTracks)!==((ei=E.media)==null?void 0:ei.audioTracks),Ou=((A=d.media)==null?void 0:A.remote)!==((w=E.media)==null?void 0:w.remote),Nu=d.documentElement!==E.documentElement,Uu=!!d.media&&(Mu||Rr),Hu=!!((F=d.media)!=null&&F.textTracks)&&(xu||Rr),$u=!!((ce=d.media)!=null&&ce.videoRenditions)&&(Pu||Rr),Vu=!!((re=d.media)!=null&&re.audioTracks)&&(Du||Rr),Bu=!!((Q=d.media)!=null&&Q.remote)&&(Ou||Rr),Wu=!!d.documentElement&&(Nu||Rr),od=Uu||Hu||$u||Vu||Bu||Wu,Mr=l.length===0&&S===1&&s,R=!!E.media&&(Mu||Mr),Fu=!!(($=E.media)!=null&&$.textTracks)&&(xu||Mr),Ku=!!((Qe=E.media)!=null&&Qe.videoRenditions)&&(Pu||Mr),qu=!!((Xn=E.media)!=null&&Xn.audioTracks)&&(Du||Mr),Gu=!!((Ru=E.media)!=null&&Ru.remote)&&(Ou||Mr),zu=!!E.documentElement&&(Nu||Mr),Yu=R||Fu||Ku||qu||Gu||zu;if(!(od||Yu)){Object.entries(E).forEach(([ee,jn])=>{d[ee]=jn}),g(),E=void 0;return}Object.entries(r).forEach(([ee,{get:jn,mediaEvents:yv=[],textTracksEvents:Tv=[],videoRenditionsEvents:Av=[],audioTracksEvents:Sv=[],remoteEvents:kv=[],rootEvents:Lv=[],stateOwnersUpdateHandlers:wv=[]}])=>{f[ee]||(f[ee]={});let Fe=ue=>{let Ee=jn(d,ue);p({[ee]:Ee})},Te;Te=f[ee].mediaEvents,yv.forEach(ue=>{Te&&Uu&&(d.media.removeEventListener(ue,Te),f[ee].mediaEvents=void 0),R&&(E.media.addEventListener(ue,Fe),f[ee].mediaEvents=Fe)}),Te=f[ee].textTracksEvents,Tv.forEach(ue=>{var Ee,ot;Te&&Hu&&((Ee=d.media.textTracks)==null||Ee.removeEventListener(ue,Te),f[ee].textTracksEvents=void 0),Fu&&((ot=E.media.textTracks)==null||ot.addEventListener(ue,Fe),f[ee].textTracksEvents=Fe)}),Te=f[ee].videoRenditionsEvents,Av.forEach(ue=>{var Ee,ot;Te&&$u&&((Ee=d.media.videoRenditions)==null||Ee.removeEventListener(ue,Te),f[ee].videoRenditionsEvents=void 0),Ku&&((ot=E.media.videoRenditions)==null||ot.addEventListener(ue,Fe),f[ee].videoRenditionsEvents=Fe)}),Te=f[ee].audioTracksEvents,Sv.forEach(ue=>{var Ee,ot;Te&&Vu&&((Ee=d.media.audioTracks)==null||Ee.removeEventListener(ue,Te),f[ee].audioTracksEvents=void 0),qu&&((ot=E.media.audioTracks)==null||ot.addEventListener(ue,Fe),f[ee].audioTracksEvents=Fe)}),Te=f[ee].remoteEvents,kv.forEach(ue=>{var Ee,ot;Te&&Bu&&((Ee=d.media.remote)==null||Ee.removeEventListener(ue,Te),f[ee].remoteEvents=void 0),Gu&&((ot=E.media.remote)==null||ot.addEventListener(ue,Fe),f[ee].remoteEvents=Fe)}),Te=f[ee].rootEvents,Lv.forEach(ue=>{Te&&Wu&&(d.documentElement.removeEventListener(ue,Te),f[ee].rootEvents=void 0),zu&&(E.documentElement.addEventListener(ue,Fe),f[ee].rootEvents=Fe)});let Ds=f[ee].stateOwnersUpdateHandlers;if(Ds&&od&&(Array.isArray(Ds)?Ds:[Ds]).forEach(Ee=>{typeof Ee=="function"&&Ee()}),Yu){let ue=wv.map(Ee=>Ee(Fe,E)).filter(Ee=>typeof Ee=="function");f[ee].stateOwnersUpdateHandlers=ue.length===1?ue[0]:ue}else od&&(f[ee].stateOwnersUpdateHandlers=void 0)}),Object.entries(E).forEach(([ee,jn])=>{d[ee]=jn}),g(),E=void 0};return y({media:i,fullscreenElement:e,documentElement:t,options:o}),{dispatch(v){let{type:S,detail:I}=v;if(n[S]&&h.mediaErrorCode==null){p(n[S](r,d,v));return}S==="mediaelementchangerequest"?y({media:I}):S==="fullscreenelementchangerequest"?y({fullscreenElement:I}):S==="documentelementchangerequest"?y({documentElement:I}):S==="optionschangerequest"&&(Object.entries(I??{}).forEach(([B,se])=>{d.options[B]=se}),g())},getState(){return h},subscribe(v){return y({},l.length+1),l.push(v),v(h),()=>{let S=l.indexOf(v);S>=0&&(y({},l.length-1),l.splice(S,1))}}}};var Qd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},P=(i,e,t)=>(Qd(i,e,"read from private field"),t?t.call(i):e.get(i)),Je=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},gt=(i,e,t,r)=>(Qd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),_t=(i,e,t)=>(Qd(i,e,"access private method"),t),ui,xo,Y,nr,Po,bt,ba,Do,_a,Kd,or,Qr,ya,qd,Gd,bp,_p=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],pp=10,mp=.025,vp=.25,Of=.25,Nf=2,T={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"},zd=class extends ji{constructor(){super(),Je(this,_a),Je(this,or),Je(this,ya),Je(this,Gd),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Je(this,ui,new ci(this,T.HOTKEYS)),Je(this,xo,void 0),Je(this,Y,void 0),Je(this,nr,null),Je(this,Po,void 0),Je(this,bt,void 0),Je(this,ba,t=>{var r;(r=P(this,Y))==null||r.dispatch(t)}),Je(this,Do,void 0),this.associateElement(this);let e={};gt(this,Po,t=>{Object.entries(t).forEach(([r,n])=>{if(r in e&&e[r]===n)return;this.propagateMediaState(r,n);let o=r.toLowerCase(),s=new u.CustomEvent(Rh[o],{composed:!0,detail:n});this.dispatchEvent(s)}),e=t}),this.hasAttribute(T.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(T.NO_HOTKEYS,T.HOTKEYS,T.DEFAULT_STREAM_TYPE,T.DEFAULT_SUBTITLES,T.DEFAULT_DURATION,T.NO_MUTED_PREF,T.NO_VOLUME_PREF,T.LANG,T.LOOP)}get mediaStore(){return P(this,Y)}set mediaStore(e){var t,r;if(P(this,Y)&&((t=P(this,bt))==null||t.call(this),gt(this,bt,void 0)),gt(this,Y,e),!P(this,Y)&&!this.hasAttribute(T.NO_DEFAULT_STORE)){_t(this,_a,Kd).call(this);return}gt(this,bt,(r=P(this,Y))==null?void 0:r.subscribe(P(this,Po)))}get fullscreenElement(){var e;return(e=P(this,xo))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(T.FULLSCREEN_ELEMENT)&&this.removeAttribute(T.FULLSCREEN_ELEMENT),gt(this,xo,e),(t=P(this,Y))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return M(this,T.DEFAULT_SUBTITLES)}set defaultSubtitles(e){x(this,T.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return O(this,T.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){N(this,T.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return W(this,T.DEFAULT_DURATION)}set defaultDuration(e){G(this,T.DEFAULT_DURATION,e)}get noHotkeys(){return M(this,T.NO_HOTKEYS)}set noHotkeys(e){x(this,T.NO_HOTKEYS,e)}get keysUsed(){return O(this,T.KEYS_USED)}set keysUsed(e){N(this,T.KEYS_USED,e)}get liveEdgeOffset(){return W(this,T.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){G(this,T.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return M(this,T.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){x(this,T.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return M(this,T.NO_VOLUME_PREF)}set noVolumePref(e){x(this,T.NO_VOLUME_PREF,e)}get noMutedPref(){return M(this,T.NO_MUTED_PREF)}set noMutedPref(e){x(this,T.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return M(this,T.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){x(this,T.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return M(this,T.NO_DEFAULT_STORE)}set noDefaultStore(e){x(this,T.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var n,o,s,l,d,h,p,g,f,E,y,v;if(super.attributeChangedCallback(e,t,r),e===T.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(T.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===T.HOTKEYS)P(this,ui).value=r;else if(e===T.DEFAULT_SUBTITLES&&r!==t)(n=P(this,Y))==null||n.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES)}});else if(e===T.DEFAULT_STREAM_TYPE)(s=P(this,Y))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===T.LIVE_EDGE_OFFSET)(l=P(this,Y))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(T.LIVE_EDGE_OFFSET)}});else if(e===T.SEEK_TO_LIVE_OFFSET)(d=P(this,Y))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(T.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===T.NO_AUTO_SEEK_TO_LIVE)(h=P(this,Y))==null||h.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(T.NO_AUTO_SEEK_TO_LIVE)}});else if(e===T.FULLSCREEN_ELEMENT){let S=r?(p=this.getRootNode())==null?void 0:p.getElementById(r):void 0;gt(this,xo,S),(g=P(this,Y))==null||g.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===T.LANG&&r!==t?($h(r),(f=P(this,Y))==null||f.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===T.LOOP&&r!==t?(E=P(this,Y))==null||E.dispatch({type:_.MEDIA_LOOP_REQUEST,detail:r!=null}):e===T.NO_VOLUME_PREF&&r!==t?(y=P(this,Y))==null||y.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF)}}):e===T.NO_MUTED_PREF&&r!==t&&((v=P(this,Y))==null||v.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(T.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!P(this,Y)&&!this.hasAttribute(T.NO_DEFAULT_STORE)&&_t(this,_a,Kd).call(this),(e=P(this,Y))==null||e.dispatch({type:"documentelementchangerequest",detail:le}),super.connectedCallback(),P(this,Y)&&!P(this,bt)&&gt(this,bt,(t=P(this,Y))==null?void 0:t.subscribe(P(this,Po))),P(this,Do)!==void 0&&P(this,Y)&&this.media&&setTimeout(()=>{var r,n,o;(n=(r=this.media)==null?void 0:r.textTracks)!=null&&n.length&&((o=P(this,Y))==null||o.dispatch({type:_.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:P(this,Do)}))},0),this.hasAttribute(T.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,n,o;if((e=super.disconnectedCallback)==null||e.call(this),P(this,Y)){let s=P(this,Y).getState();gt(this,Do,!!((t=s.mediaSubtitlesShowing)!=null&&t.length)),(r=P(this,Y))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(n=P(this,Y))==null||n.dispatch({type:_.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}P(this,bt)&&((o=P(this,bt))==null||o.call(this),gt(this,bt,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=P(this,Y))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=P(this,Y))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){gp(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),n=this.unregisterMediaStateReceiver.bind(this),o=Wf(e,r,n);Object.values(_).forEach(s=>{e.addEventListener(s,P(this,ba))}),t.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(_).forEach(n=>{e.removeEventListener(n,P(this,ba))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),P(this,Y)&&Object.entries(P(this,Y).getState()).forEach(([n,o])=>{gp([e],n,o)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",_t(this,ya,qd))}disableHotkeys(){this.removeEventListener("keydown",_t(this,ya,qd)),this.removeEventListener("keyup",_t(this,or,Qr))}get hotkeys(){return O(this,T.HOTKEYS)}set hotkeys(e){N(this,T.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,n,o,s,l,d,h,p;let g=e.target;if(((n=(r=(t=g.getAttribute(T.KEYS_USED))==null?void 0:t.split(" "))!=null?r:g==null?void 0:g.keysUsed)!=null?n:[]).map(I=>I==="Space"?" ":I).filter(Boolean).includes(e.key))return;let E,y,v;if(!(P(this,ui).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&P(this,ui).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&P(this,ui).contains("noshift+/")))switch(e.key){case" ":case"k":E=P(this,Y).getState().mediaPaused?_.MEDIA_PLAY_REQUEST:_.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new u.CustomEvent(E,{composed:!0,bubbles:!0}));break;case"m":E=this.mediaStore.getState().mediaVolumeLevel==="off"?_.MEDIA_UNMUTE_REQUEST:_.MEDIA_MUTE_REQUEST,this.dispatchEvent(new u.CustomEvent(E,{composed:!0,bubbles:!0}));break;case"f":E=this.mediaStore.getState().mediaIsFullscreen?_.MEDIA_EXIT_FULLSCREEN_REQUEST:_.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new u.CustomEvent(E,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new u.CustomEvent(_.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let I=this.hasAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET):pp;y=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-I,0),v=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:y}),this.dispatchEvent(v);break}case"ArrowRight":case"l":{let I=this.hasAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET):pp;y=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+I,0),v=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:y}),this.dispatchEvent(v);break}case"ArrowUp":{let I=this.hasAttribute(T.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(T.KEYBOARD_UP_VOLUME_STEP):mp;y=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+I,1),v=new u.CustomEvent(_.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:y}),this.dispatchEvent(v);break}case"ArrowDown":{let I=this.hasAttribute(T.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(T.KEYBOARD_DOWN_VOLUME_STEP):mp;y=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-I,0),v=new u.CustomEvent(_.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:y}),this.dispatchEvent(v);break}case"<":{let I=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;y=Math.max(I-vp,Of).toFixed(2),v=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:y}),this.dispatchEvent(v);break}case">":{let I=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;y=Math.min(I+vp,Nf).toFixed(2),v=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:y}),this.dispatchEvent(v);break}case"/":case"?":{e.shiftKey&&_t(this,Gd,bp).call(this);break}case"p":{E=this.mediaStore.getState().mediaIsPip?_.MEDIA_EXIT_PIP_REQUEST:_.MEDIA_ENTER_PIP_REQUEST,v=new u.CustomEvent(E,{composed:!0,bubbles:!0}),this.dispatchEvent(v);break}default:break}}};ui=new WeakMap;xo=new WeakMap;Y=new WeakMap;nr=new WeakMap;Po=new WeakMap;bt=new WeakMap;ba=new WeakMap;Do=new WeakMap;_a=new WeakSet;Kd=function(){var i;this.mediaStore=hp({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(T.DEFAULT_DURATION)?+this.getAttribute(T.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(T.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(T.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(T.SEEK_TO_LIVE_OFFSET):this.hasAttribute(T.LIVE_EDGE_OFFSET)?+this.getAttribute(T.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(T.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(T.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(T.NO_SUBTITLES_LANG_PREF)}})};or=new WeakSet;Qr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||_p.includes(e))){this.removeEventListener("keyup",_t(this,or,Qr));return}this.keyboardShortcutHandler(i)};ya=new WeakSet;qd=function(i){var e;let{metaKey:t,altKey:r,key:n,shiftKey:o}=i,s=o&&(n==="/"||n==="?");if(s&&((e=P(this,nr))!=null&&e.open)){this.removeEventListener("keyup",_t(this,or,Qr));return}if(t||r||!s&&!_p.includes(n)){this.removeEventListener("keyup",_t(this,or,Qr));return}let l=i.target,d=l instanceof HTMLElement&&(l.tagName.toLowerCase()==="media-volume-range"||l.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(n)&&!(P(this,ui).contains(`no${n.toLowerCase()}`)||n===" "&&P(this,ui).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",_t(this,or,Qr),{once:!0})};Gd=new WeakSet;bp=function(){P(this,nr)||(gt(this,nr,le.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(P(this,nr))),P(this,nr).open=!0};var Uf=Object.values(a),Hf=Object.values(Cd),yp=i=>{var e,t,r,n;let{observedAttributes:o}=i.constructor;!o&&((e=i.nodeName)!=null&&e.includes("-"))&&(u.customElements.upgrade(i),{observedAttributes:o}=i.constructor);let s=(n=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,H.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:n.call(r,/\s+/);return Array.isArray(o||s)?(o||s).filter(l=>Uf.includes(l)):[]},$f=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&u.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof u.customElements.get(i.nodeName.toLowerCase()))&&u.customElements.upgrade(i),Hf.some(r=>r in i)},Yd=i=>$f(i)||!!yp(i).length,fp=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Ep={[a.MEDIA_SUBTITLES_LIST]:Kt,[a.MEDIA_SUBTITLES_SHOWING]:Kt,[a.MEDIA_SEEKABLE]:fp,[a.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(fp).join(" "),[a.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[a.MEDIA_RENDITION_LIST]:xh,[a.MEDIA_AUDIO_TRACK_LIST]:Dh},Vf=async(i,e,t)=>{var r,n;if(i.isConnected||await Zs(0),typeof t=="boolean"||t==null)return x(i,e,t);if(typeof t=="number")return G(i,e,t);if(typeof t=="string")return N(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let o=(n=(r=Ep[e])==null?void 0:r.call(Ep,t))!=null?n:t;return i.setAttribute(e,o)},Bf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},rr=(i,e)=>{if(Bf(i))return;let t=(n,o)=>{var s,l;Yd(n)&&o(n);let{children:d=[]}=n??{},h=(l=(s=n==null?void 0:n.shadowRoot)==null?void 0:s.children)!=null?l:[];[...d,...h].forEach(g=>rr(g,o))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!Yd(i)){u.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},gp=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let n=yp(r),o=e.toLowerCase();n.includes(o)&&Vf(r,o,t)})},Wf=(i,e,t)=>{rr(i,e);let r=p=>{var g;let f=(g=p==null?void 0:p.composedPath()[0])!=null?g:p.target;e(f)},n=p=>{var g;let f=(g=p==null?void 0:p.composedPath()[0])!=null?g:p.target;t(f)};i.addEventListener(_.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(_.UNREGISTER_MEDIA_STATE_RECEIVER,n);let o=p=>{p.forEach(g=>{let{addedNodes:f=[],removedNodes:E=[],type:y,target:v,attributeName:S}=g;y==="childList"?(Array.prototype.forEach.call(f,I=>rr(I,e)),Array.prototype.forEach.call(E,I=>rr(I,t))):y==="attributes"&&S===H.MEDIA_CHROME_ATTRIBUTES&&(Yd(v)?e(v):t(v))})},s=[],l=p=>{let g=p.target;g.name!=="media"&&(s.forEach(f=>rr(f,t)),s=[...g.assignedElements({flatten:!0})],s.forEach(f=>rr(f,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(o);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{rr(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(_.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(_.UNREGISTER_MEDIA_STATE_RECEIVER,n)}};u.customElements.get("media-controller")||u.customElements.define("media-controller",zd);var Zr={PLACEMENT:"placement",BOUNDS:"bounds"};function Ff(i){return`
395
395
  <style>
396
396
  :host {
397
397
  --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
@@ -500,7 +500,7 @@ bp-player[has-error] {
500
500
  </style>
501
501
  <slot></slot>
502
502
  <div id="arrow"></div>
503
- `}var Yr=class extends u.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!ea(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let r=getComputedStyle(this),n=(e=mt(this,"#"+this.bounds))!=null?e:re(this);if(!n)return;let{x:o,width:s}=n.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),h=l+d,p=o+s,f=r.getPropertyValue("--media-tooltip-offset-x"),E=f?parseFloat(f.replace("px","")):0,m=r.getPropertyValue("--media-tooltip-container-margin"),_=m?parseFloat(m.replace("px","")):0,g=l-o+E-_,I=h-p+E+_;if(g<0){this.style.setProperty("--media-tooltip-offset-x",`${g}px`);return}if(I>0){this.style.setProperty("--media-tooltip-offset-x",`${I}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=oe(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[zr.PLACEMENT,zr.BOUNDS]}get placement(){return O(this,zr.PLACEMENT)}set placement(e){N(this,zr.PLACEMENT,e)}get bounds(){return O(this,zr.BOUNDS)}set bounds(e){N(this,zr.BOUNDS,e)}};Yr.shadowRootOptions={mode:"open"};Yr.getTemplateHTML=Vf;u.customElements.get("media-tooltip")||u.customElements.define("media-tooltip",Yr);var ba=Yr;var Yd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ee=(i,e,t)=>(Yd(i,e,"read from private field"),t?t.call(i):e.get(i)),Qr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_a=(i,e,t,r)=>(Yd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Bf=(i,e,t)=>(Yd(i,e,"access private method"),t),gt,Xr,ui,Zr,ya,zd,bp,ci={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Wf(i,e={}){return`
503
+ `}var Xr=class extends u.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!ra(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let r=getComputedStyle(this),n=(e=Et(this,"#"+this.bounds))!=null?e:ne(this);if(!n)return;let{x:o,width:s}=n.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),h=l+d,p=o+s,g=r.getPropertyValue("--media-tooltip-offset-x"),f=g?parseFloat(g.replace("px","")):0,E=r.getPropertyValue("--media-tooltip-container-margin"),y=E?parseFloat(E.replace("px","")):0,v=l-o+f-y,S=h-p+f+y;if(v<0){this.style.setProperty("--media-tooltip-offset-x",`${v}px`);return}if(S>0){this.style.setProperty("--media-tooltip-offset-x",`${S}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Zr.PLACEMENT,Zr.BOUNDS]}get placement(){return O(this,Zr.PLACEMENT)}set placement(e){N(this,Zr.PLACEMENT,e)}get bounds(){return O(this,Zr.BOUNDS)}set bounds(e){N(this,Zr.BOUNDS,e)}};Xr.shadowRootOptions={mode:"open"};Xr.getTemplateHTML=Ff;u.customElements.get("media-tooltip")||u.customElements.define("media-tooltip",Xr);var Ta=Xr;var Xd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(Xd(i,e,"read from private field"),t?t.call(i):e.get(i)),jr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Aa=(i,e,t,r)=>(Xd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Kf=(i,e,t)=>(Xd(i,e,"access private method"),t),yt,en,pi,Jr,Sa,Zd,Tp,hi={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function qf(i,e={}){return`
504
504
  <style>
505
505
  :host {
506
506
  position: relative;
@@ -574,20 +574,20 @@ bp-player[has-error] {
574
574
 
575
575
  <slot name="tooltip">
576
576
  <media-tooltip part="tooltip" aria-hidden="true">
577
- <template shadowrootmode="${ba.shadowRootOptions.mode}">
578
- ${ba.getTemplateHTML({})}
577
+ <template shadowrootmode="${Ta.shadowRootOptions.mode}">
578
+ ${Ta.getTemplateHTML({})}
579
579
  </template>
580
580
  <slot name="tooltip-content">
581
581
  ${this.getTooltipContentHTML(i)}
582
582
  </slot>
583
583
  </media-tooltip>
584
584
  </slot>
585
- `}function Ff(i,e){return`
585
+ `}function Gf(i,e){return`
586
586
  <slot></slot>
587
- `}function qf(){return""}var Z=class extends u.HTMLElement{constructor(){if(super(),Qr(this,zd),Qr(this,gt,void 0),this.preventClick=!1,this.tooltipEl=null,Qr(this,Xr,e=>{this.preventClick||this.handleClick(e),setTimeout(Ee(this,ui),0)}),Qr(this,ui,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Qr(this,Zr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",Ee(this,Zr));return}this.preventClick||this.handleClick(e)}),Qr(this,ya,e=>{let{metaKey:t,altKey:r,key:n}=e;if(t||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",Ee(this,Zr));return}this.addEventListener("keyup",Ee(this,Zr),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=oe(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",ci.TOOLTIP_PLACEMENT,H.MEDIA_CONTROLLER,a.MEDIA_LANG]}enable(){this.addEventListener("click",Ee(this,Xr)),this.addEventListener("keydown",Ee(this,ya)),this.tabIndex=0}disable(){this.removeEventListener("click",Ee(this,Xr)),this.removeEventListener("keydown",Ee(this,ya)),this.removeEventListener("keyup",Ee(this,Zr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER?(t&&((o=(n=Ee(this,gt))==null?void 0:n.unassociateElement)==null||o.call(n,this),_a(this,gt,null)),r&&this.isConnected&&(_a(this,gt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Ee(this,gt))==null?void 0:l.associateElement)==null||d.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===ci.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===a.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),Ee(this,ui).call(this)}connectedCallback(){var e,t,r;let{style:n}=ne(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let o=this.getAttribute(H.MEDIA_CONTROLLER);o&&(_a(this,gt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Ee(this,gt))==null?void 0:t.associateElement)==null||r.call(t,this)),u.customElements.whenDefined("media-tooltip").then(()=>Bf(this,zd,bp).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=Ee(this,gt))==null?void 0:e.unassociateElement)==null||t.call(e,this),_a(this,gt,null),this.removeEventListener("mouseenter",Ee(this,ui)),this.removeEventListener("focus",Ee(this,ui)),this.removeEventListener("click",Ee(this,Xr))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return O(this,ci.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){N(this,ci.TOOLTIP_PLACEMENT,e)}get mediaController(){return O(this,H.MEDIA_CONTROLLER)}set mediaController(e){N(this,H.MEDIA_CONTROLLER,e)}get disabled(){return M(this,ci.DISABLED)}set disabled(e){x(this,ci.DISABLED,e)}get noTooltip(){return M(this,ci.NO_TOOLTIP)}set noTooltip(e){x(this,ci.NO_TOOLTIP,e)}handleClick(e){}};gt=new WeakMap;Xr=new WeakMap;ui=new WeakMap;Zr=new WeakMap;ya=new WeakMap;zd=new WeakSet;bp=function(){this.addEventListener("mouseenter",Ee(this,ui)),this.addEventListener("focus",Ee(this,ui)),this.addEventListener("click",Ee(this,Xr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};Z.shadowRootOptions={mode:"open"};Z.getTemplateHTML=Wf;Z.getSlotTemplateHTML=Ff;Z.getTooltipContentHTML=qf;u.customElements.get("media-chrome-button")||u.customElements.define("media-chrome-button",Z);var _p=`<svg aria-hidden="true" viewBox="0 0 26 24">
587
+ `}function zf(){return""}var X=class extends u.HTMLElement{constructor(){if(super(),jr(this,Zd),jr(this,yt,void 0),this.preventClick=!1,this.tooltipEl=null,jr(this,en,e=>{this.preventClick||this.handleClick(e),setTimeout(ge(this,pi),0)}),jr(this,pi,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),jr(this,Jr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",ge(this,Jr));return}this.preventClick||this.handleClick(e)}),jr(this,Sa,e=>{let{metaKey:t,altKey:r,key:n}=e;if(t||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",ge(this,Jr));return}this.addEventListener("keyup",ge(this,Jr),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",hi.TOOLTIP_PLACEMENT,H.MEDIA_CONTROLLER,a.MEDIA_LANG]}enable(){this.addEventListener("click",ge(this,en)),this.addEventListener("keydown",ge(this,Sa)),this.tabIndex=0}disable(){this.removeEventListener("click",ge(this,en)),this.removeEventListener("keydown",ge(this,Sa)),this.removeEventListener("keyup",ge(this,Jr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER?(t&&((o=(n=ge(this,yt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Aa(this,yt,null)),r&&this.isConnected&&(Aa(this,yt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ge(this,yt))==null?void 0:l.associateElement)==null||d.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===hi.TOOLTIP_PLACEMENT&&this.tooltipEl&&r!==t?this.tooltipEl.placement=r:e===a.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),ge(this,pi).call(this)}connectedCallback(){var e,t,r;let{style:n}=oe(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let o=this.getAttribute(H.MEDIA_CONTROLLER);o&&(Aa(this,yt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=ge(this,yt))==null?void 0:t.associateElement)==null||r.call(t,this)),u.customElements.whenDefined("media-tooltip").then(()=>Kf(this,Zd,Tp).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=ge(this,yt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Aa(this,yt,null),this.removeEventListener("mouseenter",ge(this,pi)),this.removeEventListener("focus",ge(this,pi)),this.removeEventListener("click",ge(this,en))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return O(this,hi.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){N(this,hi.TOOLTIP_PLACEMENT,e)}get mediaController(){return O(this,H.MEDIA_CONTROLLER)}set mediaController(e){N(this,H.MEDIA_CONTROLLER,e)}get disabled(){return M(this,hi.DISABLED)}set disabled(e){x(this,hi.DISABLED,e)}get noTooltip(){return M(this,hi.NO_TOOLTIP)}set noTooltip(e){x(this,hi.NO_TOOLTIP,e)}handleClick(e){}};yt=new WeakMap;en=new WeakMap;pi=new WeakMap;Jr=new WeakMap;Sa=new WeakMap;Zd=new WeakSet;Tp=function(){this.addEventListener("mouseenter",ge(this,pi)),this.addEventListener("focus",ge(this,pi)),this.addEventListener("click",ge(this,en));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};X.shadowRootOptions={mode:"open"};X.getTemplateHTML=qf;X.getSlotTemplateHTML=Gf;X.getTooltipContentHTML=zf;u.customElements.get("media-chrome-button")||u.customElements.define("media-chrome-button",X);var Ap=`<svg aria-hidden="true" viewBox="0 0 26 24">
588
588
  <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"/>
589
589
  </svg>
590
- `;function Kf(i){return`
590
+ `;function Yf(i){return`
591
591
  <style>
592
592
  :host([${a.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
593
593
  display: none !important;
@@ -605,17 +605,17 @@ bp-player[has-error] {
605
605
  </style>
606
606
 
607
607
  <slot name="icon">
608
- <slot name="enter">${_p}</slot>
609
- <slot name="exit">${_p}</slot>
608
+ <slot name="enter">${Ap}</slot>
609
+ <slot name="exit">${Ap}</slot>
610
610
  </slot>
611
- `}function Gf(){return`
611
+ `}function Qf(){return`
612
612
  <slot name="tooltip-enter">${b("start airplay")}</slot>
613
613
  <slot name="tooltip-exit">${b("stop airplay")}</slot>
614
- `}var yp=i=>{let e=i.mediaIsAirplaying?b("stop airplay"):b("start airplay");i.setAttribute("aria-label",e)},Po=class extends Z{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_AIRPLAYING,a.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),yp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_AIRPLAYING&&yp(this)}get mediaIsAirplaying(){return M(this,a.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){x(this,a.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return O(this,a.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){N(this,a.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new u.CustomEvent(y.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};Po.getSlotTemplateHTML=Kf;Po.getTooltipContentHTML=Gf;u.customElements.get("media-airplay-button")||u.customElements.define("media-airplay-button",Po);var zf=`<svg aria-hidden="true" viewBox="0 0 26 24">
614
+ `}var Sp=i=>{let e=i.mediaIsAirplaying?b("stop airplay"):b("start airplay");i.setAttribute("aria-label",e)},Oo=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_AIRPLAYING,a.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Sp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_AIRPLAYING&&Sp(this)}get mediaIsAirplaying(){return M(this,a.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){x(this,a.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return O(this,a.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){N(this,a.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new u.CustomEvent(_.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};Oo.getSlotTemplateHTML=Yf;Oo.getTooltipContentHTML=Qf;u.customElements.get("media-airplay-button")||u.customElements.define("media-airplay-button",Oo);var Zf=`<svg aria-hidden="true" viewBox="0 0 26 24">
615
615
  <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"/>
616
- </svg>`,Yf=`<svg aria-hidden="true" viewBox="0 0 26 24">
616
+ </svg>`,Xf=`<svg aria-hidden="true" viewBox="0 0 26 24">
617
617
  <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"/>
618
- </svg>`;function Qf(i){return`
618
+ </svg>`;function jf(i){return`
619
619
  <style>
620
620
  :host([aria-checked="true"]) slot[name=off] {
621
621
  display: none !important;
@@ -633,13 +633,13 @@ bp-player[has-error] {
633
633
  </style>
634
634
 
635
635
  <slot name="icon">
636
- <slot name="on">${zf}</slot>
637
- <slot name="off">${Yf}</slot>
636
+ <slot name="on">${Zf}</slot>
637
+ <slot name="off">${Xf}</slot>
638
638
  </slot>
639
- `}function Zf(){return`
639
+ `}function Jf(){return`
640
640
  <slot name="tooltip-enable">${b("Enable captions")}</slot>
641
641
  <slot name="tooltip-disable">${b("Disable captions")}</slot>
642
- `}var Tp=i=>{i.setAttribute("aria-checked",ua(i).toString())},Do=class extends Z{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",b("closed captions")),Tp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING&&Tp(this)}get mediaSubtitlesList(){return Ap(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Sp(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Ap(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Sp(this,a.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new u.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};Do.getSlotTemplateHTML=Qf;Do.getTooltipContentHTML=Zf;var Ap=(i,e)=>{let t=i.getAttribute(e);return t?Xi(t):[]},Sp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Wt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-button")||u.customElements.define("media-captions-button",Do);var Xf='<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>',jf='<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 Jf(i){return`
642
+ `}var kp=i=>{i.setAttribute("aria-checked",ma(i).toString())},No=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",b("closed captions")),kp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING&&kp(this)}get mediaSubtitlesList(){return Lp(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){wp(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Lp(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){wp(this,a.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new u.CustomEvent(_.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};No.getSlotTemplateHTML=jf;No.getTooltipContentHTML=Jf;var Lp=(i,e)=>{let t=i.getAttribute(e);return t?er(t):[]},wp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Kt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-button")||u.customElements.define("media-captions-button",No);var eE='<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>',tE='<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 iE(i){return`
643
643
  <style>
644
644
  :host([${a.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
645
645
  display: none !important;
@@ -657,13 +657,13 @@ bp-player[has-error] {
657
657
  </style>
658
658
 
659
659
  <slot name="icon">
660
- <slot name="enter">${Xf}</slot>
661
- <slot name="exit">${jf}</slot>
660
+ <slot name="enter">${eE}</slot>
661
+ <slot name="exit">${tE}</slot>
662
662
  </slot>
663
- `}function eE(){return`
663
+ `}function rE(){return`
664
664
  <slot name="tooltip-enter">${b("Start casting")}</slot>
665
665
  <slot name="tooltip-exit">${b("Stop casting")}</slot>
666
- `}var kp=i=>{let e=i.mediaIsCasting?b("stop casting"):b("start casting");i.setAttribute("aria-label",e)},Oo=class extends Z{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_CASTING,a.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),kp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_CASTING&&kp(this)}get mediaIsCasting(){return M(this,a.MEDIA_IS_CASTING)}set mediaIsCasting(e){x(this,a.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return O(this,a.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){N(this,a.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?y.MEDIA_EXIT_CAST_REQUEST:y.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};Oo.getSlotTemplateHTML=Jf;Oo.getTooltipContentHTML=eE;u.customElements.get("media-cast-button")||u.customElements.define("media-cast-button",Oo);var tc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},nr=(i,e,t)=>(tc(i,e,"read from private field"),t?t.call(i):e.get(i)),Ft=(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)},ic=(i,e,t,r)=>(tc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),rr=(i,e,t)=>(tc(i,e,"access private method"),t),Aa,Uo,or,Ta,Qd,Zd,Lp,Xd,wp,jd,Ip,Jd,Cp,ec,Rp;function tE(i){return`
666
+ `}var Ip=i=>{let e=i.mediaIsCasting?b("stop casting"):b("start casting");i.setAttribute("aria-label",e)},Uo=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_CASTING,a.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Ip(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_CASTING&&Ip(this)}get mediaIsCasting(){return M(this,a.MEDIA_IS_CASTING)}set mediaIsCasting(e){x(this,a.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return O(this,a.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){N(this,a.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?_.MEDIA_EXIT_CAST_REQUEST:_.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};Uo.getSlotTemplateHTML=iE;Uo.getTooltipContentHTML=rE;u.customElements.get("media-cast-button")||u.customElements.define("media-cast-button",Uo);var nc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ar=(i,e,t)=>(nc(i,e,"read from private field"),t?t.call(i):e.get(i)),qt=(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)=>(nc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),sr=(i,e,t)=>(nc(i,e,"access private method"),t),La,$o,lr,ka,jd,Jd,Cp,ec,Rp,tc,Mp,ic,xp,rc,Pp;function nE(i){return`
667
667
  <style>
668
668
  :host {
669
669
  font: var(--media-font,
@@ -704,9 +704,9 @@ bp-player[has-error] {
704
704
  }
705
705
  </style>
706
706
  ${this.getSlotTemplateHTML(i)}
707
- `}function iE(i){return`
707
+ `}function oE(i){return`
708
708
  <slot id="content"></slot>
709
- `}var No={OPEN:"open",ANCHOR:"anchor"},bt=class extends u.HTMLElement{constructor(){super(),Ft(this,Ta),Ft(this,Zd),Ft(this,Xd),Ft(this,jd),Ft(this,Jd),Ft(this,ec),Ft(this,Aa,!1),Ft(this,Uo,null),Ft(this,or,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[No.OPEN,No.ANCHOR]}get open(){return M(this,No.OPEN)}set open(e){x(this,No.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":rr(this,jd,Ip).call(this,e);break;case"focusout":rr(this,Jd,Cp).call(this,e);break;case"keydown":rr(this,ec,Rp).call(this,e);break}}connectedCallback(){rr(this,Ta,Qd).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){rr(this,Ta,Qd).call(this),e===No.OPEN&&r!==t&&(this.open?rr(this,Zd,Lp).call(this):rr(this,Xd,wp).call(this))}focus(){ic(this,Uo,To());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"]}};Aa=new WeakMap;Uo=new WeakMap;or=new WeakMap;Ta=new WeakSet;Qd=function(){if(!nr(this,Aa)&&(ic(this,Aa,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=oe(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=ne(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};Zd=new WeakSet;Lp=function(){var i;(i=nr(this,or))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};Xd=new WeakSet;wp=function(){var i;(i=nr(this,or))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};jd=new WeakSet;Ip=function(i){ic(this,or,i.relatedTarget),Me(this,i.relatedTarget)||(this.open=!this.open)};Jd=new WeakSet;Cp=function(i){var e;Me(this,i.relatedTarget)||((e=nr(this,Uo))==null||e.focus(),nr(this,or)&&nr(this,or)!==i.relatedTarget&&this.open&&(this.open=!1))};ec=new WeakSet;Rp=function(i){var e,t,r,n,o;let{key:s,ctrlKey:l,altKey:d,metaKey:h}=i;l||d||h||this.keysUsed.includes(s)&&(i.preventDefault(),i.stopPropagation(),s==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(n=(r=this.nextElementSibling)==null?void 0:r.focus)==null||n.call(r),this.blur()):s==="Escape"&&((o=nr(this,Uo))==null||o.focus(),this.open=!1))};bt.shadowRootOptions={mode:"open"};bt.getTemplateHTML=tE;bt.getSlotTemplateHTML=iE;u.customElements.get("media-chrome-dialog")||u.customElements.define("media-chrome-dialog",bt);var dc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ue=(i,e,t)=>(dc(i,e,"read from private field"),t?t.call(i):e.get(i)),Le=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},hi=(i,e,t,r)=>(dc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),at=(i,e,t)=>(dc(i,e,"access private method"),t),_t,Pa,Sa,ka,lt,Ma,La,wa,Ia,cc,Mp,Ca,rc,Ra,nc,xa,uc,oc,xp,sc,Pp,ac,Dp,lc,Op;function rE(i){return`
709
+ `}var Ho={OPEN:"open",ANCHOR:"anchor"},Tt=class extends u.HTMLElement{constructor(){super(),qt(this,ka),qt(this,Jd),qt(this,ec),qt(this,tc),qt(this,ic),qt(this,rc),qt(this,La,!1),qt(this,$o,null),qt(this,lr,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Ho.OPEN,Ho.ANCHOR]}get open(){return M(this,Ho.OPEN)}set open(e){x(this,Ho.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":sr(this,tc,Mp).call(this,e);break;case"focusout":sr(this,ic,xp).call(this,e);break;case"keydown":sr(this,rc,Pp).call(this,e);break}}connectedCallback(){sr(this,ka,jd).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){sr(this,ka,jd).call(this),e===Ho.OPEN&&r!==t&&(this.open?sr(this,Jd,Cp).call(this):sr(this,ec,Rp).call(this))}focus(){oc(this,$o,So());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"]}};La=new WeakMap;$o=new WeakMap;lr=new WeakMap;ka=new WeakSet;jd=function(){if(!ar(this,La)&&(oc(this,La,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=oe(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};Jd=new WeakSet;Cp=function(){var i;(i=ar(this,lr))==null||i.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};ec=new WeakSet;Rp=function(){var i;(i=ar(this,lr))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};tc=new WeakSet;Mp=function(i){oc(this,lr,i.relatedTarget),xe(this,i.relatedTarget)||(this.open=!this.open)};ic=new WeakSet;xp=function(i){var e;xe(this,i.relatedTarget)||((e=ar(this,$o))==null||e.focus(),ar(this,lr)&&ar(this,lr)!==i.relatedTarget&&this.open&&(this.open=!1))};rc=new WeakSet;Pp=function(i){var e,t,r,n,o;let{key:s,ctrlKey:l,altKey:d,metaKey:h}=i;l||d||h||this.keysUsed.includes(s)&&(i.preventDefault(),i.stopPropagation(),s==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(n=(r=this.nextElementSibling)==null?void 0:r.focus)==null||n.call(r),this.blur()):s==="Escape"&&((o=ar(this,$o))==null||o.focus(),this.open=!1))};Tt.shadowRootOptions={mode:"open"};Tt.getTemplateHTML=nE;Tt.getSlotTemplateHTML=oE;u.customElements.get("media-chrome-dialog")||u.customElements.define("media-chrome-dialog",Tt);var hc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},he=(i,e,t)=>(hc(i,e,"read from private field"),t?t.call(i):e.get(i)),Ie=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mi=(i,e,t,r)=>(hc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),dt=(i,e,t)=>(hc(i,e,"access private method"),t),At,Na,wa,Ia,ct,Da,Ca,Ra,Ma,pc,Dp,xa,sc,Pa,ac,Oa,mc,lc,Op,dc,Np,cc,Up,uc,Hp;function sE(i){return`
710
710
  <style>
711
711
  :host {
712
712
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -936,7 +936,7 @@ bp-player[has-error] {
936
936
  ${this.getContainerTemplateHTML(i)}
937
937
  </div>
938
938
  <div id="rightgap"></div>
939
- `}function nE(i){return""}var yt=class extends u.HTMLElement{constructor(){if(super(),Le(this,cc),Le(this,Ca),Le(this,Ra),Le(this,xa),Le(this,oc),Le(this,sc),Le(this,ac),Le(this,lc),Le(this,_t,void 0),Le(this,Pa,void 0),Le(this,Sa,void 0),Le(this,ka,void 0),Le(this,lt,{}),Le(this,Ma,[]),Le(this,La,()=>{if(this.range.matches(":focus-visible")){let{style:e}=ne(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),Le(this,wa,()=>{let{style:e}=ne(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),Le(this,Ia,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=oe(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),hi(this,Sa,this.shadowRoot.querySelector("#startpoint")),hi(this,ka,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",H.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER?(t&&((o=(n=ue(this,_t))==null?void 0:n.unassociateElement)==null||o.call(n,this),hi(this,_t,null)),r&&this.isConnected&&(hi(this,_t,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ue(this,_t))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),at(this,Ca,rc).call(this)):(this.range.setAttribute(e,r),at(this,Ra,nc).call(this)))}connectedCallback(){var e,t,r;let{style:n}=ne(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),ue(this,lt).pointer=ne(this.shadowRoot,"#pointer"),ue(this,lt).progress=ne(this.shadowRoot,"#progress"),ue(this,lt).thumb=ne(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),ue(this,lt).activeSegment=ne(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(H.MEDIA_CONTROLLER);o&&(hi(this,_t,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=ue(this,_t))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ue(this,La)),this.shadowRoot.addEventListener("focusout",ue(this,wa)),at(this,Ca,rc).call(this),$t(this.container,ue(this,Ia))}disconnectedCallback(){var e,t;at(this,Ra,nc).call(this),(t=(e=ue(this,_t))==null?void 0:e.unassociateElement)==null||t.call(e,this),hi(this,_t,null),this.shadowRoot.removeEventListener("focusin",ue(this,La)),this.shadowRoot.removeEventListener("focusout",ue(this,wa)),Vt(this.container,ue(this,Ia))}updatePointerBar(e){var t;(t=ue(this,lt).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=ue(this,lt).progress)==null||e.style.setProperty("width",`${r}%`),(t=ue(this,lt).thumb)==null||t.style.setProperty("left",`${r}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let r=[...new Set([+this.range.min,...e.flatMap(o=>[o.start,o.end]),+this.range.max])];hi(this,Ma,[...r]);let n=r.pop();for(let[o,s]of r.entries()){let[l,d]=[o===0,o===r.length-1],h=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,f=`calc(${((d?n:r[o+1])-s)*100}%${l||d?"":" - var(--segments-gap)"})`,E=se.createElementNS("http://www.w3.org/2000/svg","rect"),m=Ao(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);m.style.setProperty("x",h),m.style.setProperty("width",f),t.append(E)}}getPointerRatio(e){return Wh(e.clientX,e.clientY,ue(this,Sa).getBoundingClientRect(),ue(this,ka).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":at(this,lc,Op).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":at(this,oc,xp).call(this,e);break;case"pointerdown":at(this,xa,uc).call(this,e);break;case"pointerup":at(this,sc,Pp).call(this);break;case"pointerleave":at(this,ac,Dp).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};_t=new WeakMap;Pa=new WeakMap;Sa=new WeakMap;ka=new WeakMap;lt=new WeakMap;Ma=new WeakMap;La=new WeakMap;wa=new WeakMap;Ia=new WeakMap;cc=new WeakSet;Mp=function(i){let e=ue(this,lt).activeSegment;if(!e)return;let t=this.getPointerRatio(i),n=`#segments-clipping rect:nth-child(${ue(this,Ma).findIndex((o,s,l)=>{let d=l[s+1];return d!=null&&t>=o&&t<=d})+1})`;(e.selectorText!=n||!e.style.transform)&&(e.selectorText=n,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Ca=new WeakSet;rc=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Ra=new WeakSet;nc=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=u.window)==null||i.removeEventListener("pointerup",this),(e=u.window)==null||e.removeEventListener("pointermove",this)};xa=new WeakSet;uc=function(i){var e;hi(this,Pa,i.composedPath().includes(this.range)),(e=u.window)==null||e.addEventListener("pointerup",this)};oc=new WeakSet;xp=function(i){var e;i.pointerType!=="mouse"&&at(this,xa,uc).call(this,i),this.addEventListener("pointerleave",this),(e=u.window)==null||e.addEventListener("pointermove",this)};sc=new WeakSet;Pp=function(){var i;(i=u.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};ac=new WeakSet;Dp=function(){var i,e;this.removeEventListener("pointerleave",this),(i=u.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=ue(this,lt).activeSegment)==null||e.style.removeProperty("transform")};lc=new WeakSet;Op=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),at(this,cc,Mp).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!ue(this,Pa))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};yt.shadowRootOptions={mode:"open"};yt.getTemplateHTML=rE;yt.getContainerTemplateHTML=nE;u.customElements.get("media-chrome-range")||u.customElements.define("media-chrome-range",yt);var Np=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Da=(i,e,t)=>(Np(i,e,"read from private field"),t?t.call(i):e.get(i)),oE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Oa=(i,e,t,r)=>(Np(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Tt;function sE(i){return`
939
+ `}function aE(i){return""}var St=class extends u.HTMLElement{constructor(){if(super(),Ie(this,pc),Ie(this,xa),Ie(this,Pa),Ie(this,Oa),Ie(this,lc),Ie(this,dc),Ie(this,cc),Ie(this,uc),Ie(this,At,void 0),Ie(this,Na,void 0),Ie(this,wa,void 0),Ie(this,Ia,void 0),Ie(this,ct,{}),Ie(this,Da,[]),Ie(this,Ca,()=>{if(this.range.matches(":focus-visible")){let{style:e}=oe(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),Ie(this,Ra,()=>{let{style:e}=oe(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),Ie(this,Ma,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),mi(this,wa,this.shadowRoot.querySelector("#startpoint")),mi(this,Ia,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",H.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER?(t&&((o=(n=he(this,At))==null?void 0:n.unassociateElement)==null||o.call(n,this),mi(this,At,null)),r&&this.isConnected&&(mi(this,At,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=he(this,At))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),dt(this,xa,sc).call(this)):(this.range.setAttribute(e,r),dt(this,Pa,ac).call(this)))}connectedCallback(){var e,t,r;let{style:n}=oe(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),he(this,ct).pointer=oe(this.shadowRoot,"#pointer"),he(this,ct).progress=oe(this.shadowRoot,"#progress"),he(this,ct).thumb=oe(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),he(this,ct).activeSegment=oe(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(H.MEDIA_CONTROLLER);o&&(mi(this,At,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=he(this,At))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",he(this,Ca)),this.shadowRoot.addEventListener("focusout",he(this,Ra)),dt(this,xa,sc).call(this),Bt(this.container,he(this,Ma))}disconnectedCallback(){var e,t;dt(this,Pa,ac).call(this),(t=(e=he(this,At))==null?void 0:e.unassociateElement)==null||t.call(e,this),mi(this,At,null),this.shadowRoot.removeEventListener("focusin",he(this,Ca)),this.shadowRoot.removeEventListener("focusout",he(this,Ra)),Wt(this.container,he(this,Ma))}updatePointerBar(e){var t;(t=he(this,ct).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=he(this,ct).progress)==null||e.style.setProperty("width",`${r}%`),(t=he(this,ct).thumb)==null||t.style.setProperty("left",`${r}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let r=[...new Set([+this.range.min,...e.flatMap(o=>[o.start,o.end]),+this.range.max])];mi(this,Da,[...r]);let n=r.pop();for(let[o,s]of r.entries()){let[l,d]=[o===0,o===r.length-1],h=l?"calc(var(--segments-gap) / -1)":`${s*100}%`,g=`calc(${((d?n:r[o+1])-s)*100}%${l||d?"":" - var(--segments-gap)"})`,f=le.createElementNS("http://www.w3.org/2000/svg","rect"),E=ko(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);E.style.setProperty("x",h),E.style.setProperty("width",g),t.append(f)}}getPointerRatio(e){return qh(e.clientX,e.clientY,he(this,wa).getBoundingClientRect(),he(this,Ia).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":dt(this,uc,Hp).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":dt(this,lc,Op).call(this,e);break;case"pointerdown":dt(this,Oa,mc).call(this,e);break;case"pointerup":dt(this,dc,Np).call(this);break;case"pointerleave":dt(this,cc,Up).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};At=new WeakMap;Na=new WeakMap;wa=new WeakMap;Ia=new WeakMap;ct=new WeakMap;Da=new WeakMap;Ca=new WeakMap;Ra=new WeakMap;Ma=new WeakMap;pc=new WeakSet;Dp=function(i){let e=he(this,ct).activeSegment;if(!e)return;let t=this.getPointerRatio(i),n=`#segments-clipping rect:nth-child(${he(this,Da).findIndex((o,s,l)=>{let d=l[s+1];return d!=null&&t>=o&&t<=d})+1})`;(e.selectorText!=n||!e.style.transform)&&(e.selectorText=n,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};xa=new WeakSet;sc=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Pa=new WeakSet;ac=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=u.window)==null||i.removeEventListener("pointerup",this),(e=u.window)==null||e.removeEventListener("pointermove",this)};Oa=new WeakSet;mc=function(i){var e;mi(this,Na,i.composedPath().includes(this.range)),(e=u.window)==null||e.addEventListener("pointerup",this)};lc=new WeakSet;Op=function(i){var e;i.pointerType!=="mouse"&&dt(this,Oa,mc).call(this,i),this.addEventListener("pointerleave",this),(e=u.window)==null||e.addEventListener("pointermove",this)};dc=new WeakSet;Np=function(){var i;(i=u.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};cc=new WeakSet;Up=function(){var i,e;this.removeEventListener("pointerleave",this),(i=u.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=he(this,ct).activeSegment)==null||e.style.removeProperty("transform")};uc=new WeakSet;Hp=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),dt(this,pc,Dp).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!he(this,Na))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};St.shadowRootOptions={mode:"open"};St.getTemplateHTML=sE;St.getContainerTemplateHTML=aE;u.customElements.get("media-chrome-range")||u.customElements.define("media-chrome-range",St);var $p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ua=(i,e,t)=>($p(i,e,"read from private field"),t?t.call(i):e.get(i)),lE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ha=(i,e,t,r)=>($p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),kt;function dE(i){return`
940
940
  <style>
941
941
  :host {
942
942
 
@@ -962,7 +962,7 @@ bp-player[has-error] {
962
962
  </style>
963
963
 
964
964
  <slot></slot>
965
- `}var Ho=class extends u.HTMLElement{constructor(){if(super(),oE(this,Tt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=oe(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER&&(t&&((o=(n=Da(this,Tt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Oa(this,Tt,null)),r&&this.isConnected&&(Oa(this,Tt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Da(this,Tt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let n=this.getAttribute(H.MEDIA_CONTROLLER);n&&(Oa(this,Tt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Da(this,Tt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Da(this,Tt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Oa(this,Tt,null)}};Tt=new WeakMap;Ho.shadowRootOptions={mode:"open"};Ho.getTemplateHTML=sE;u.customElements.get("media-control-bar")||u.customElements.define("media-control-bar",Ho);var Up=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Na=(i,e,t)=>(Up(i,e,"read from private field"),t?t.call(i):e.get(i)),aE=(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)},Ua=(i,e,t,r)=>(Up(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),At;function lE(i,e={}){return`
965
+ `}var Vo=class extends u.HTMLElement{constructor(){if(super(),lE(this,kt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER&&(t&&((o=(n=Ua(this,kt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ha(this,kt,null)),r&&this.isConnected&&(Ha(this,kt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Ua(this,kt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let n=this.getAttribute(H.MEDIA_CONTROLLER);n&&(Ha(this,kt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Ua(this,kt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ua(this,kt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ha(this,kt,null)}};kt=new WeakMap;Vo.shadowRootOptions={mode:"open"};Vo.getTemplateHTML=dE;u.customElements.get("media-control-bar")||u.customElements.define("media-control-bar",Vo);var Vp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$a=(i,e,t)=>(Vp(i,e,"read from private field"),t?t.call(i):e.get(i)),cE=(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)},Va=(i,e,t,r)=>(Vp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Lt;function uE(i,e={}){return`
966
966
  <style>
967
967
  :host {
968
968
  font: var(--media-font,
@@ -996,11 +996,11 @@ bp-player[has-error] {
996
996
  </style>
997
997
 
998
998
  ${this.getSlotTemplateHTML(i,e)}
999
- `}function dE(i,e){return`
999
+ `}function hE(i,e){return`
1000
1000
  <slot></slot>
1001
- `}var He=class extends u.HTMLElement{constructor(){if(super(),aE(this,At,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=oe(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER&&(t&&((o=(n=Na(this,At))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ua(this,At,null)),r&&this.isConnected&&(Ua(this,At,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Na(this,At))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let{style:n}=ne(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let o=this.getAttribute(H.MEDIA_CONTROLLER);o&&(Ua(this,At,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Na(this,At))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Na(this,At))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ua(this,At,null)}};At=new WeakMap;He.shadowRootOptions={mode:"open"};He.getTemplateHTML=lE;He.getSlotTemplateHTML=dE;u.customElements.get("media-text-display")||u.customElements.define("media-text-display",He);var $p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hp=(i,e,t)=>($p(i,e,"read from private field"),t?t.call(i):e.get(i)),cE=(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)},uE=(i,e,t,r)=>($p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$o;function hE(i,e){return`
1002
- <slot>${st(e.mediaDuration)}</slot>
1003
- `}var Ha=class extends He{constructor(){var e;super(),cE(this,$o,void 0),uE(this,$o,this.shadowRoot.querySelector("slot")),Hp(this,$o).textContent=st((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===a.MEDIA_DURATION&&(Hp(this,$o).textContent=st(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return B(this,a.MEDIA_DURATION)}set mediaDuration(e){K(this,a.MEDIA_DURATION,e)}};$o=new WeakMap;Ha.getSlotTemplateHTML=hE;u.customElements.get("media-duration-display")||u.customElements.define("media-duration-display",Ha);var pE={2:b("Network Error"),3:b("Decode Error"),4:b("Source Not Supported"),5:b("Encryption Error")},mE={2:b("A network error caused the media download to fail."),3:b("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:b("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:b("The media is encrypted and there are no keys to decrypt it.")},hc=i=>{var e,t;return i.code===1?null:{title:(e=pE[i.code])!=null?e:`Error ${i.code}`,message:(t=mE[i.code])!=null?t:i.message}};var Bp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},vE=(i,e,t)=>(Bp(i,e,"read from private field"),t?t.call(i):e.get(i)),fE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},EE=(i,e,t,r)=>(Bp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$a;function gE(i){return`
1001
+ `}var Ve=class extends u.HTMLElement{constructor(){if(super(),cE(this,Lt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===H.MEDIA_CONTROLLER&&(t&&((o=(n=$a(this,Lt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Va(this,Lt,null)),r&&this.isConnected&&(Va(this,Lt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=$a(this,Lt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let{style:n}=oe(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let o=this.getAttribute(H.MEDIA_CONTROLLER);o&&(Va(this,Lt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=$a(this,Lt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=$a(this,Lt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Va(this,Lt,null)}};Lt=new WeakMap;Ve.shadowRootOptions={mode:"open"};Ve.getTemplateHTML=uE;Ve.getSlotTemplateHTML=hE;u.customElements.get("media-text-display")||u.customElements.define("media-text-display",Ve);var Wp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Bp=(i,e,t)=>(Wp(i,e,"read from private field"),t?t.call(i):e.get(i)),pE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mE=(i,e,t,r)=>(Wp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Bo;function vE(i,e){return`
1002
+ <slot>${lt(e.mediaDuration)}</slot>
1003
+ `}var Ba=class extends Ve{constructor(){var e;super(),pE(this,Bo,void 0),mE(this,Bo,this.shadowRoot.querySelector("slot")),Bp(this,Bo).textContent=lt((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===a.MEDIA_DURATION&&(Bp(this,Bo).textContent=lt(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return W(this,a.MEDIA_DURATION)}set mediaDuration(e){G(this,a.MEDIA_DURATION,e)}};Bo=new WeakMap;Ba.getSlotTemplateHTML=vE;u.customElements.get("media-duration-display")||u.customElements.define("media-duration-display",Ba);var fE={2:b("Network Error"),3:b("Decode Error"),4:b("Source Not Supported"),5:b("Encryption Error")},EE={2:b("A network error caused the media download to fail."),3:b("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:b("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:b("The media is encrypted and there are no keys to decrypt it.")},vc=i=>{var e,t;return i.code===1?null:{title:(e=fE[i.code])!=null?e:`Error ${i.code}`,message:(t=EE[i.code])!=null?t:i.message}};var Kp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gE=(i,e,t)=>(Kp(i,e,"read from private field"),t?t.call(i):e.get(i)),bE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_E=(i,e,t,r)=>(Kp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Wa;function yE(i){return`
1004
1004
  <style>
1005
1005
  :host {
1006
1006
  background: rgb(20 20 30 / .8);
@@ -1017,9 +1017,9 @@ bp-player[has-error] {
1017
1017
  }
1018
1018
  </style>
1019
1019
  <slot name="error-${i.mediaerrorcode}" id="content">
1020
- ${Wp({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1020
+ ${qp({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
1021
1021
  </slot>
1022
- `}function bE(i){return i.code&&hc(i)!==null}function Wp(i){var e;let{title:t,message:r}=(e=hc(i))!=null?e:{},n="";return t&&(n+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(n+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),n}var Vp=[a.MEDIA_ERROR_CODE,a.MEDIA_ERROR_MESSAGE],Vo=class extends bt{constructor(){super(...arguments),fE(this,$a,null)}static get observedAttributes(){return[...super.observedAttributes,...Vp]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var n;if(super.attributeChangedCallback(e,t,r),!Vp.includes(e))return;let o=(n=this.mediaError)!=null?n:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=bE(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o))}get mediaError(){return vE(this,$a)}set mediaError(e){EE(this,$a,e)}get mediaErrorCode(){return B(this,"mediaerrorcode")}set mediaErrorCode(e){K(this,"mediaerrorcode",e)}get mediaErrorMessage(){return O(this,"mediaerrormessage")}set mediaErrorMessage(e){N(this,"mediaerrormessage",e)}};$a=new WeakMap;Vo.getSlotTemplateHTML=gE;Vo.formatErrorMessage=Wp;u.customElements.get("media-error-dialog")||u.customElements.define("media-error-dialog",Vo);var _E=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pi=(i,e,t)=>(_E(i,e,"read from private field"),t?t.call(i):e.get(i)),Fp=(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)},jr,Jr;function yE(i){return`
1022
+ `}function TE(i){return i.code&&vc(i)!==null}function qp(i){var e;let{title:t,message:r}=(e=vc(i))!=null?e:{},n="";return t&&(n+=`<slot name="error-${i.code}-title"><h3>${t}</h3></slot>`),r&&(n+=`<slot name="error-${i.code}-message"><p>${r}</p></slot>`),n}var Fp=[a.MEDIA_ERROR_CODE,a.MEDIA_ERROR_MESSAGE],Wo=class extends Tt{constructor(){super(...arguments),bE(this,Wa,null)}static get observedAttributes(){return[...super.observedAttributes,...Fp]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var n;if(super.attributeChangedCallback(e,t,r),!Fp.includes(e))return;let o=(n=this.mediaError)!=null?n:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=TE(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o))}get mediaError(){return gE(this,Wa)}set mediaError(e){_E(this,Wa,e)}get mediaErrorCode(){return W(this,"mediaerrorcode")}set mediaErrorCode(e){G(this,"mediaerrorcode",e)}get mediaErrorMessage(){return O(this,"mediaerrormessage")}set mediaErrorMessage(e){N(this,"mediaerrormessage",e)}};Wa=new WeakMap;Wo.getSlotTemplateHTML=yE;Wo.formatErrorMessage=qp;u.customElements.get("media-error-dialog")||u.customElements.define("media-error-dialog",Wo);var AE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},vi=(i,e,t)=>(AE(i,e,"read from private field"),t?t.call(i):e.get(i)),Gp=(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)},tn,rn;function SE(i){return`
1023
1023
  <style>
1024
1024
  :host {
1025
1025
  position: fixed;
@@ -1104,9 +1104,9 @@ bp-player[has-error] {
1104
1104
  }
1105
1105
  </style>
1106
1106
  <slot id="content">
1107
- ${TE()}
1107
+ ${kE()}
1108
1108
  </slot>
1109
- `}function TE(){return`
1109
+ `}function kE(){return`
1110
1110
  <h2>Keyboard Shortcuts</h2>
1111
1111
  <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})=>`
1112
1112
  <tr>
@@ -1116,11 +1116,11 @@ bp-player[has-error] {
1116
1116
  <td class="description">${r}</td>
1117
1117
  </tr>
1118
1118
  `).join("")}</table>
1119
- `}var Va=class extends bt{constructor(){super(...arguments),Fp(this,jr,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let n=e.composedPath(),o=n[0]===this||n.includes(this),s=n.includes(r);o&&!s&&(this.open=!1)}),Fp(this,Jr,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",pi(this,jr)),document.addEventListener("keydown",pi(this,Jr)))}disconnectedCallback(){this.removeEventListener("click",pi(this,jr)),document.removeEventListener("keydown",pi(this,Jr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",pi(this,jr)),document.addEventListener("keydown",pi(this,Jr))):(this.removeEventListener("click",pi(this,jr)),document.removeEventListener("keydown",pi(this,Jr))))}};jr=new WeakMap;Jr=new WeakMap;Va.getSlotTemplateHTML=yE;u.customElements.get("media-keyboard-shortcuts-dialog")||u.customElements.define("media-keyboard-shortcuts-dialog",Va);var Kp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},AE=(i,e,t)=>(Kp(i,e,"read from private field"),t?t.call(i):e.get(i)),SE=(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)},kE=(i,e,t,r)=>(Kp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ba,LE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1119
+ `}var Fa=class extends Tt{constructor(){super(...arguments),Gp(this,tn,e=>{var t;if(!this.open)return;let r=(t=this.shadowRoot)==null?void 0:t.querySelector("#content");if(!r)return;let n=e.composedPath(),o=n[0]===this||n.includes(this),s=n.includes(r);o&&!s&&(this.open=!1)}),Gp(this,rn,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",vi(this,tn)),document.addEventListener("keydown",vi(this,rn)))}disconnectedCallback(){this.removeEventListener("click",vi(this,tn)),document.removeEventListener("keydown",vi(this,rn))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",vi(this,tn)),document.addEventListener("keydown",vi(this,rn))):(this.removeEventListener("click",vi(this,tn)),document.removeEventListener("keydown",vi(this,rn))))}};tn=new WeakMap;rn=new WeakMap;Fa.getSlotTemplateHTML=SE;u.customElements.get("media-keyboard-shortcuts-dialog")||u.customElements.define("media-keyboard-shortcuts-dialog",Fa);var Yp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},LE=(i,e,t)=>(Yp(i,e,"read from private field"),t?t.call(i):e.get(i)),wE=(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)},IE=(i,e,t,r)=>(Yp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ka,CE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1120
1120
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
1121
- </svg>`,wE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1121
+ </svg>`,RE=`<svg aria-hidden="true" viewBox="0 0 26 24">
1122
1122
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
1123
- </svg>`;function IE(i){return`
1123
+ </svg>`;function ME(i){return`
1124
1124
  <style>
1125
1125
  :host([${a.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
1126
1126
  display: none !important;
@@ -1138,13 +1138,13 @@ bp-player[has-error] {
1138
1138
  </style>
1139
1139
 
1140
1140
  <slot name="icon">
1141
- <slot name="enter">${LE}</slot>
1142
- <slot name="exit">${wE}</slot>
1141
+ <slot name="enter">${CE}</slot>
1142
+ <slot name="exit">${RE}</slot>
1143
1143
  </slot>
1144
- `}function CE(){return`
1144
+ `}function xE(){return`
1145
1145
  <slot name="tooltip-enter">${b("Enter fullscreen mode")}</slot>
1146
1146
  <slot name="tooltip-exit">${b("Exit fullscreen mode")}</slot>
1147
- `}var qp=i=>{let e=i.mediaIsFullscreen?b("exit fullscreen mode"):b("enter fullscreen mode");i.setAttribute("aria-label",e)},Bo=class extends Z{constructor(){super(...arguments),SE(this,Ba,null)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_FULLSCREEN,a.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),qp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_FULLSCREEN&&qp(this)}get mediaFullscreenUnavailable(){return O(this,a.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){N(this,a.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return M(this,a.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){x(this,a.MEDIA_IS_FULLSCREEN,e)}handleClick(e){kE(this,Ba,e);let t=AE(this,Ba)instanceof PointerEvent,r=this.mediaIsFullscreen?new u.CustomEvent(y.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new u.CustomEvent(y.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};Ba=new WeakMap;Bo.getSlotTemplateHTML=IE;Bo.getTooltipContentHTML=CE;u.customElements.get("media-fullscreen-button")||u.customElements.define("media-fullscreen-button",Bo);var{MEDIA_TIME_IS_LIVE:Wa,MEDIA_PAUSED:Wo}=a,{MEDIA_SEEK_TO_LIVE_REQUEST:RE,MEDIA_PLAY_REQUEST:ME}=y,xE='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function PE(i){return`
1147
+ `}var zp=i=>{let e=i.mediaIsFullscreen?b("exit fullscreen mode"):b("enter fullscreen mode");i.setAttribute("aria-label",e)},Fo=class extends X{constructor(){super(...arguments),wE(this,Ka,null)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_FULLSCREEN,a.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),zp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_FULLSCREEN&&zp(this)}get mediaFullscreenUnavailable(){return O(this,a.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){N(this,a.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return M(this,a.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){x(this,a.MEDIA_IS_FULLSCREEN,e)}handleClick(e){IE(this,Ka,e);let t=LE(this,Ka)instanceof PointerEvent,r=this.mediaIsFullscreen?new u.CustomEvent(_.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new u.CustomEvent(_.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};Ka=new WeakMap;Fo.getSlotTemplateHTML=ME;Fo.getTooltipContentHTML=xE;u.customElements.get("media-fullscreen-button")||u.customElements.define("media-fullscreen-button",Fo);var{MEDIA_TIME_IS_LIVE:qa,MEDIA_PAUSED:Ko}=a,{MEDIA_SEEK_TO_LIVE_REQUEST:PE,MEDIA_PLAY_REQUEST:DE}=_,OE='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function NE(i){return`
1148
1148
  <style>
1149
1149
  :host { --media-tooltip-display: none; }
1150
1150
 
@@ -1156,13 +1156,13 @@ bp-player[has-error] {
1156
1156
  color: var(--media-live-button-icon-color, rgb(140, 140, 140));
1157
1157
  }
1158
1158
 
1159
- :host([${Wa}]:not([${Wo}])) slot[name=indicator] > *,
1160
- :host([${Wa}]:not([${Wo}])) ::slotted([slot=indicator]) {
1159
+ :host([${qa}]:not([${Ko}])) slot[name=indicator] > *,
1160
+ :host([${qa}]:not([${Ko}])) ::slotted([slot=indicator]) {
1161
1161
  fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
1162
1162
  color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
1163
1163
  }
1164
1164
 
1165
- :host([${Wa}]:not([${Wo}])) {
1165
+ :host([${qa}]:not([${Ko}])) {
1166
1166
  cursor: var(--media-cursor, not-allowed);
1167
1167
  }
1168
1168
 
@@ -1172,10 +1172,10 @@ bp-player[has-error] {
1172
1172
 
1173
1173
  </style>
1174
1174
 
1175
- <slot name="indicator">${xE}</slot>
1175
+ <slot name="indicator">${OE}</slot>
1176
1176
 
1177
1177
  <slot name="spacer">&nbsp;</slot><slot name="text">${b("live")}</slot>
1178
- `}var Gp=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?b("seek to live"):b("playing live");i.setAttribute("aria-label",r);let n=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');n&&(n.textContent=b("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},Fa=class extends Z{static get observedAttributes(){return[...super.observedAttributes,Wa,Wo]}connectedCallback(){super.connectedCallback(),Gp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),Gp(this)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return M(this,a.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){x(this,a.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new u.CustomEvent(RE,{composed:!0,bubbles:!0})),this.hasAttribute(Wo)&&this.dispatchEvent(new u.CustomEvent(ME,{composed:!0,bubbles:!0})))}};Fa.getSlotTemplateHTML=PE;u.customElements.get("media-live-button")||u.customElements.define("media-live-button",Fa);var Yp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fo=(i,e,t)=>(Yp(i,e,"read from private field"),t?t.call(i):e.get(i)),zp=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},qo=(i,e,t,r)=>(Yp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),St,Ka,qa={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},Qp=500,DE=`
1178
+ `}var Qp=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?b("seek to live"):b("playing live");i.setAttribute("aria-label",r);let n=(e=i.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');n&&(n.textContent=b("live")),t?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},Ga=class extends X{static get observedAttributes(){return[...super.observedAttributes,qa,Ko]}connectedCallback(){super.connectedCallback(),Qp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),Qp(this)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return M(this,a.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){x(this,a.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new u.CustomEvent(PE,{composed:!0,bubbles:!0})),this.hasAttribute(Ko)&&this.dispatchEvent(new u.CustomEvent(DE,{composed:!0,bubbles:!0})))}};Ga.getSlotTemplateHTML=NE;u.customElements.get("media-live-button")||u.customElements.define("media-live-button",Ga);var Xp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qo=(i,e,t)=>(Xp(i,e,"read from private field"),t?t.call(i):e.get(i)),Zp=(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)},Go=(i,e,t,r)=>(Xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),wt,Ya,za={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},jp=500,UE=`
1179
1179
  <svg aria-hidden="true" viewBox="0 0 100 100">
1180
1180
  <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">
1181
1181
  <animateTransform
@@ -1188,13 +1188,13 @@ bp-player[has-error] {
1188
1188
  repeatCount="indefinite" />
1189
1189
  </path>
1190
1190
  </svg>
1191
- `;function OE(i){return`
1191
+ `;function HE(i){return`
1192
1192
  <style>
1193
1193
  :host {
1194
1194
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
1195
1195
  vertical-align: middle;
1196
1196
  box-sizing: border-box;
1197
- --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${Qp}ms);
1197
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${jp}ms);
1198
1198
  }
1199
1199
 
1200
1200
  #status {
@@ -1233,15 +1233,15 @@ bp-player[has-error] {
1233
1233
  }
1234
1234
  </style>
1235
1235
 
1236
- <slot name="icon">${DE}</slot>
1236
+ <slot name="icon">${UE}</slot>
1237
1237
  <div id="status" role="status" aria-live="polite">${b("media loading")}</div>
1238
- `}var Ko=class extends u.HTMLElement{constructor(){if(super(),zp(this,St,void 0),zp(this,Ka,Qp),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=oe(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER,a.MEDIA_PAUSED,a.MEDIA_LOADING,qa.LOADING_DELAY]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===qa.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===H.MEDIA_CONTROLLER&&(t&&((o=(n=Fo(this,St))==null?void 0:n.unassociateElement)==null||o.call(n,this),qo(this,St,null)),r&&this.isConnected&&(qo(this,St,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Fo(this,St))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let n=this.getAttribute(H.MEDIA_CONTROLLER);n&&(qo(this,St,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Fo(this,St))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Fo(this,St))==null?void 0:e.unassociateElement)==null||t.call(e,this),qo(this,St,null)}get loadingDelay(){return Fo(this,Ka)}set loadingDelay(e){qo(this,Ka,e);let{style:t}=ne(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,a.MEDIA_LOADING)}set mediaLoading(e){x(this,a.MEDIA_LOADING,e)}get mediaController(){return O(this,H.MEDIA_CONTROLLER)}set mediaController(e){N(this,H.MEDIA_CONTROLLER,e)}get noAutohide(){return M(this,qa.NO_AUTOHIDE)}set noAutohide(e){x(this,qa.NO_AUTOHIDE,e)}};St=new WeakMap;Ka=new WeakMap;Ko.shadowRootOptions={mode:"open"};Ko.getTemplateHTML=OE;u.customElements.get("media-loading-indicator")||u.customElements.define("media-loading-indicator",Ko);var NE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1238
+ `}var zo=class extends u.HTMLElement{constructor(){if(super(),Zp(this,wt,void 0),Zp(this,Ya,jp),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER,a.MEDIA_PAUSED,a.MEDIA_LOADING,za.LOADING_DELAY]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===za.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===H.MEDIA_CONTROLLER&&(t&&((o=(n=qo(this,wt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Go(this,wt,null)),r&&this.isConnected&&(Go(this,wt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=qo(this,wt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let n=this.getAttribute(H.MEDIA_CONTROLLER);n&&(Go(this,wt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=qo(this,wt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=qo(this,wt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Go(this,wt,null)}get loadingDelay(){return qo(this,Ya)}set loadingDelay(e){Go(this,Ya,e);let{style:t}=oe(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,a.MEDIA_LOADING)}set mediaLoading(e){x(this,a.MEDIA_LOADING,e)}get mediaController(){return O(this,H.MEDIA_CONTROLLER)}set mediaController(e){N(this,H.MEDIA_CONTROLLER,e)}get noAutohide(){return M(this,za.NO_AUTOHIDE)}set noAutohide(e){x(this,za.NO_AUTOHIDE,e)}};wt=new WeakMap;Ya=new WeakMap;zo.shadowRootOptions={mode:"open"};zo.getTemplateHTML=HE;u.customElements.get("media-loading-indicator")||u.customElements.define("media-loading-indicator",zo);var $E=`<svg aria-hidden="true" viewBox="0 0 24 24">
1239
1239
  <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"/>
1240
- </svg>`,Zp=`<svg aria-hidden="true" viewBox="0 0 24 24">
1240
+ </svg>`,Jp=`<svg aria-hidden="true" viewBox="0 0 24 24">
1241
1241
  <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"/>
1242
- </svg>`,UE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1242
+ </svg>`,VE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1243
1243
  <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"/>
1244
- </svg>`;function HE(i){return`
1244
+ </svg>`;function BE(i){return`
1245
1245
  <style>
1246
1246
  :host(:not([${a.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
1247
1247
  :host([${a.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
@@ -1267,17 +1267,17 @@ bp-player[has-error] {
1267
1267
  </style>
1268
1268
 
1269
1269
  <slot name="icon">
1270
- <slot name="off">${NE}</slot>
1271
- <slot name="low">${Zp}</slot>
1272
- <slot name="medium">${Zp}</slot>
1273
- <slot name="high">${UE}</slot>
1270
+ <slot name="off">${$E}</slot>
1271
+ <slot name="low">${Jp}</slot>
1272
+ <slot name="medium">${Jp}</slot>
1273
+ <slot name="high">${VE}</slot>
1274
1274
  </slot>
1275
- `}function $E(){return`
1275
+ `}function WE(){return`
1276
1276
  <slot name="tooltip-mute">${b("Mute")}</slot>
1277
1277
  <slot name="tooltip-unmute">${b("Unmute")}</slot>
1278
- `}var Xp=i=>{let t=i.mediaVolumeLevel==="off"?b("unmute"):b("mute");i.setAttribute("aria-label",t)},Go=class extends Z{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Xp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_VOLUME_LEVEL&&Xp(this)}get mediaVolumeLevel(){return O(this,a.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){N(this,a.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};Go.getSlotTemplateHTML=HE;Go.getTooltipContentHTML=$E;u.customElements.get("media-mute-button")||u.customElements.define("media-mute-button",Go);var jp=`<svg aria-hidden="true" viewBox="0 0 28 24">
1278
+ `}var em=i=>{let t=i.mediaVolumeLevel==="off"?b("unmute"):b("mute");i.setAttribute("aria-label",t)},Yo=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),em(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_VOLUME_LEVEL&&em(this)}get mediaVolumeLevel(){return O(this,a.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){N(this,a.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?_.MEDIA_UNMUTE_REQUEST:_.MEDIA_MUTE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};Yo.getSlotTemplateHTML=BE;Yo.getTooltipContentHTML=WE;u.customElements.get("media-mute-button")||u.customElements.define("media-mute-button",Yo);var tm=`<svg aria-hidden="true" viewBox="0 0 28 24">
1279
1279
  <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"/>
1280
- </svg>`;function VE(i){return`
1280
+ </svg>`;function FE(i){return`
1281
1281
  <style>
1282
1282
  :host([${a.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
1283
1283
  display: none !important;
@@ -1294,25 +1294,25 @@ bp-player[has-error] {
1294
1294
  </style>
1295
1295
 
1296
1296
  <slot name="icon">
1297
- <slot name="enter">${jp}</slot>
1298
- <slot name="exit">${jp}</slot>
1297
+ <slot name="enter">${tm}</slot>
1298
+ <slot name="exit">${tm}</slot>
1299
1299
  </slot>
1300
- `}function BE(){return`
1300
+ `}function KE(){return`
1301
1301
  <slot name="tooltip-enter">${b("Enter picture in picture mode")}</slot>
1302
1302
  <slot name="tooltip-exit">${b("Exit picture in picture mode")}</slot>
1303
- `}var Jp=i=>{let e=i.mediaIsPip?b("exit picture in picture mode"):b("enter picture in picture mode");i.setAttribute("aria-label",e)},zo=class extends Z{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_PIP,a.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Jp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_PIP&&Jp(this)}get mediaPipUnavailable(){return O(this,a.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){N(this,a.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return M(this,a.MEDIA_IS_PIP)}set mediaIsPip(e){x(this,a.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};zo.getSlotTemplateHTML=VE;zo.getTooltipContentHTML=BE;u.customElements.get("media-pip-button")||u.customElements.define("media-pip-button",zo);var WE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},en=(i,e,t)=>(WE(i,e,"read from private field"),t?t.call(i):e.get(i)),FE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mi,pc={RATES:"rates"},mc=[1,1.2,1.5,1.7,2],sr=1;function qE(i){return`
1303
+ `}var im=i=>{let e=i.mediaIsPip?b("exit picture in picture mode"):b("enter picture in picture mode");i.setAttribute("aria-label",e)},Qo=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_PIP,a.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),im(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_PIP&&im(this)}get mediaPipUnavailable(){return O(this,a.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){N(this,a.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return M(this,a.MEDIA_IS_PIP)}set mediaIsPip(e){x(this,a.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?_.MEDIA_EXIT_PIP_REQUEST:_.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};Qo.getSlotTemplateHTML=FE;Qo.getTooltipContentHTML=KE;u.customElements.get("media-pip-button")||u.customElements.define("media-pip-button",Qo);var qE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},nn=(i,e,t)=>(qE(i,e,"read from private field"),t?t.call(i):e.get(i)),GE=(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)},fi,fc={RATES:"rates"},Ec=[1,1.2,1.5,1.7,2],dr=1;function zE(i){return`
1304
1304
  <style>
1305
1305
  :host {
1306
1306
  min-width: 5ch;
1307
1307
  padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
1308
1308
  }
1309
1309
  </style>
1310
- <slot name="icon">${i.mediaplaybackrate||sr}x</slot>
1311
- `}function KE(){return b("Playback rate")}var Yo=class extends Z{constructor(){var e;super(),FE(this,mi,new li(this,pc.RATES,{defaultValue:mc})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:sr}x`}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,pc.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===pc.RATES&&(en(this,mi).value=r),e===a.MEDIA_PLAYBACK_RATE){let n=r?+r:Number.NaN,o=Number.isNaN(n)?sr:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return en(this,mi)}set rates(e){e?Array.isArray(e)?en(this,mi).value=e.join(" "):typeof e=="string"&&(en(this,mi).value=e):en(this,mi).value=""}get mediaPlaybackRate(){return B(this,a.MEDIA_PLAYBACK_RATE,sr)}set mediaPlaybackRate(e){K(this,a.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(en(this,mi).values(),s=>+s).sort((s,l)=>s-l),n=(t=(e=r.find(s=>s>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:sr,o=new u.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(o)}};mi=new WeakMap;Yo.getSlotTemplateHTML=qE;Yo.getTooltipContentHTML=KE;u.customElements.get("media-playback-rate-button")||u.customElements.define("media-playback-rate-button",Yo);var GE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1310
+ <slot name="icon">${i.mediaplaybackrate||dr}x</slot>
1311
+ `}function YE(){return b("Playback rate")}var Zo=class extends X{constructor(){var e;super(),GE(this,fi,new ci(this,fc.RATES,{defaultValue:Ec})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:dr}x`}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,fc.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===fc.RATES&&(nn(this,fi).value=r),e===a.MEDIA_PLAYBACK_RATE){let n=r?+r:Number.NaN,o=Number.isNaN(n)?dr:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return nn(this,fi)}set rates(e){e?Array.isArray(e)?nn(this,fi).value=e.join(" "):typeof e=="string"&&(nn(this,fi).value=e):nn(this,fi).value=""}get mediaPlaybackRate(){return W(this,a.MEDIA_PLAYBACK_RATE,dr)}set mediaPlaybackRate(e){G(this,a.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(nn(this,fi).values(),s=>+s).sort((s,l)=>s-l),n=(t=(e=r.find(s=>s>this.mediaPlaybackRate))!=null?e:r[0])!=null?t:dr,o=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(o)}};fi=new WeakMap;Zo.getSlotTemplateHTML=zE;Zo.getTooltipContentHTML=YE;u.customElements.get("media-playback-rate-button")||u.customElements.define("media-playback-rate-button",Zo);var QE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1312
1312
  <path d="m6 21 15-9L6 3v18Z"/>
1313
- </svg>`,zE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1313
+ </svg>`,ZE=`<svg aria-hidden="true" viewBox="0 0 24 24">
1314
1314
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
1315
- </svg>`;function YE(i){return`
1315
+ </svg>`;function XE(i){return`
1316
1316
  <style>
1317
1317
  :host([${a.MEDIA_PAUSED}]) slot[name=pause],
1318
1318
  :host(:not([${a.MEDIA_PAUSED}])) slot[name=play] {
@@ -1326,13 +1326,13 @@ bp-player[has-error] {
1326
1326
  </style>
1327
1327
 
1328
1328
  <slot name="icon">
1329
- <slot name="play">${GE}</slot>
1330
- <slot name="pause">${zE}</slot>
1329
+ <slot name="play">${QE}</slot>
1330
+ <slot name="pause">${ZE}</slot>
1331
1331
  </slot>
1332
- `}function QE(){return`
1332
+ `}function jE(){return`
1333
1333
  <slot name="tooltip-play">${b("Play")}</slot>
1334
1334
  <slot name="tooltip-pause">${b("Pause")}</slot>
1335
- `}var em=i=>{let e=i.mediaPaused?b("play"):b("pause");i.setAttribute("aria-label",e)},Qo=class extends Z{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),em(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PAUSED||e===a.MEDIA_LANG)&&em(this)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};Qo.getSlotTemplateHTML=YE;Qo.getTooltipContentHTML=QE;u.customElements.get("media-play-button")||u.customElements.define("media-play-button",Qo);var kt={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function ZE(i){return`
1335
+ `}var rm=i=>{let e=i.mediaPaused?b("play"):b("pause");i.setAttribute("aria-label",e)},Xo=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),rm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PAUSED||e===a.MEDIA_LANG)&&rm(this)}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?_.MEDIA_PLAY_REQUEST:_.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new u.CustomEvent(e,{composed:!0,bubbles:!0}))}};Xo.getSlotTemplateHTML=XE;Xo.getTooltipContentHTML=jE;u.customElements.get("media-play-button")||u.customElements.define("media-play-button",Xo);var It={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function JE(i){return`
1336
1336
  <style>
1337
1337
  :host {
1338
1338
  pointer-events: none;
@@ -1354,7 +1354,7 @@ bp-player[has-error] {
1354
1354
  </style>
1355
1355
 
1356
1356
  <img part="poster img" aria-hidden="true" id="image"/>
1357
- `}var XE=i=>{i.style.removeProperty("background-image")},jE=(i,e)=>{i.style["background-image"]=`url('${e}')`},Zo=class extends u.HTMLElement{static get observedAttributes(){return[kt.PLACEHOLDER_SRC,kt.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=oe(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===kt.SRC&&(r==null?this.image.removeAttribute(kt.SRC):this.image.setAttribute(kt.SRC,r)),e===kt.PLACEHOLDER_SRC&&(r==null?XE(this.image):jE(this.image,r))}get placeholderSrc(){return O(this,kt.PLACEHOLDER_SRC)}set placeholderSrc(e){N(this,kt.SRC,e)}get src(){return O(this,kt.SRC)}set src(e){N(this,kt.SRC,e)}};Zo.shadowRootOptions={mode:"open"};Zo.getTemplateHTML=ZE;u.customElements.get("media-poster-image")||u.customElements.define("media-poster-image",Zo);var tm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},JE=(i,e,t)=>(tm(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)},tg=(i,e,t,r)=>(tm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ga,vc=class extends He{constructor(){super(),eg(this,Ga,void 0),tg(this,Ga,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PREVIEW_CHAPTER||e===a.MEDIA_LANG)&&r!==t&&r!=null)if(JE(this,Ga).textContent=r,r!==""){let n=b("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",n)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return O(this,a.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){N(this,a.MEDIA_PREVIEW_CHAPTER,e)}};Ga=new WeakMap;u.customElements.get("media-preview-chapter-display")||u.customElements.define("media-preview-chapter-display",vc);var im=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},za=(i,e,t)=>(im(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)},Ya=(i,e,t,r)=>(im(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Lt;function rg(i){return`
1357
+ `}var eg=i=>{i.style.removeProperty("background-image")},tg=(i,e)=>{i.style["background-image"]=`url('${e}')`},jo=class extends u.HTMLElement{static get observedAttributes(){return[It.PLACEHOLDER_SRC,It.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===It.SRC&&(r==null?this.image.removeAttribute(It.SRC):this.image.setAttribute(It.SRC,r)),e===It.PLACEHOLDER_SRC&&(r==null?eg(this.image):tg(this.image,r))}get placeholderSrc(){return O(this,It.PLACEHOLDER_SRC)}set placeholderSrc(e){N(this,It.SRC,e)}get src(){return O(this,It.SRC)}set src(e){N(this,It.SRC,e)}};jo.shadowRootOptions={mode:"open"};jo.getTemplateHTML=JE;u.customElements.get("media-poster-image")||u.customElements.define("media-poster-image",jo);var nm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ig=(i,e,t)=>(nm(i,e,"read from private field"),t?t.call(i):e.get(i)),rg=(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)},ng=(i,e,t,r)=>(nm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Qa,gc=class extends Ve{constructor(){super(),rg(this,Qa,void 0),ng(this,Qa,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_LANG]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PREVIEW_CHAPTER||e===a.MEDIA_LANG)&&r!==t&&r!=null)if(ig(this,Qa).textContent=r,r!==""){let n=b("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",n)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return O(this,a.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){N(this,a.MEDIA_PREVIEW_CHAPTER,e)}};Qa=new WeakMap;u.customElements.get("media-preview-chapter-display")||u.customElements.define("media-preview-chapter-display",gc);var om=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Za=(i,e,t)=>(om(i,e,"read from private field"),t?t.call(i):e.get(i)),og=(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)},Xa=(i,e,t,r)=>(om(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ct;function sg(i){return`
1358
1358
  <style>
1359
1359
  :host {
1360
1360
  box-sizing: border-box;
@@ -1368,27 +1368,27 @@ bp-player[has-error] {
1368
1368
  }
1369
1369
  </style>
1370
1370
  <img crossorigin loading="eager" decoding="async">
1371
- `}var tn=class extends u.HTMLElement{constructor(){if(super(),ig(this,Lt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=oe(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let n=this.getAttribute(H.MEDIA_CONTROLLER);n&&(Ya(this,Lt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=za(this,Lt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=za(this,Lt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ya(this,Lt,null)}attributeChangedCallback(e,t,r){var n,o,s,l,d;[a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===H.MEDIA_CONTROLLER&&(t&&((o=(n=za(this,Lt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ya(this,Lt,null)),r&&this.isConnected&&(Ya(this,Lt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=za(this,Lt))==null?void 0:l.associateElement)==null||d.call(l,this)))}get mediaPreviewImage(){return O(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){N(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(a.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(a.MEDIA_PREVIEW_COORDS);return}this.setAttribute(a.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,n,o,s]=e,l=t.split("#")[0],d=getComputedStyle(this),{maxWidth:h,maxHeight:p,minWidth:f,minHeight:E}=d,m=Math.min(parseInt(h)/o,parseInt(p)/s),_=Math.max(parseInt(f)/o,parseInt(E)/s),g=m<1,I=g?m:_>1?_:1,{style:L}=ne(this.shadowRoot,":host"),le=ne(this.shadowRoot,"img").style,Ie=this.shadowRoot.querySelector("img"),jt=g?"min":"max";L.setProperty(`${jt}-width`,"initial","important"),L.setProperty(`${jt}-height`,"initial","important"),L.width=`${o*I}px`,L.height=`${s*I}px`;let Ut=()=>{le.width=`${this.imgWidth*I}px`,le.height=`${this.imgHeight*I}px`,le.display="block"};Ie.src!==l&&(Ie.onload=()=>{this.imgWidth=Ie.naturalWidth,this.imgHeight=Ie.naturalHeight,Ut()},Ie.src=l,Ut()),Ut(),le.transform=`translate(-${r*I}px, -${n*I}px)`}};Lt=new WeakMap;tn.shadowRootOptions={mode:"open"};tn.getTemplateHTML=rg;u.customElements.get("media-preview-thumbnail")||u.customElements.define("media-preview-thumbnail",tn);var Qa=tn;var nm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},rm=(i,e,t)=>(nm(i,e,"read from private field"),t?t.call(i):e.get(i)),ng=(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)},og=(i,e,t,r)=>(nm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Xo,fc=class extends He{constructor(){super(),ng(this,Xo,void 0),og(this,Xo,this.shadowRoot.querySelector("slot")),rm(this,Xo).textContent=st(0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PREVIEW_TIME&&r!=null&&(rm(this,Xo).textContent=st(parseFloat(r)))}get mediaPreviewTime(){return B(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){K(this,a.MEDIA_PREVIEW_TIME,e)}};Xo=new WeakMap;u.customElements.get("media-preview-time-display")||u.customElements.define("media-preview-time-display",fc);var rn={SEEK_OFFSET:"seekoffset"},Ec=30,sg=i=>`
1371
+ `}var on=class extends u.HTMLElement{constructor(){if(super(),og(this,Ct,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[H.MEDIA_CONTROLLER,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let n=this.getAttribute(H.MEDIA_CONTROLLER);n&&(Xa(this,Ct,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Za(this,Ct))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Za(this,Ct))==null?void 0:e.unassociateElement)==null||t.call(e,this),Xa(this,Ct,null)}attributeChangedCallback(e,t,r){var n,o,s,l,d;[a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===H.MEDIA_CONTROLLER&&(t&&((o=(n=Za(this,Ct))==null?void 0:n.unassociateElement)==null||o.call(n,this),Xa(this,Ct,null)),r&&this.isConnected&&(Xa(this,Ct,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Za(this,Ct))==null?void 0:l.associateElement)==null||d.call(l,this)))}get mediaPreviewImage(){return O(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){N(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(a.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(a.MEDIA_PREVIEW_COORDS);return}this.setAttribute(a.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[r,n,o,s]=e,l=t.split("#")[0],d=getComputedStyle(this),{maxWidth:h,maxHeight:p,minWidth:g,minHeight:f}=d,E=Math.min(parseInt(h)/o,parseInt(p)/s),y=Math.max(parseInt(g)/o,parseInt(f)/s),v=E<1,S=v?E:y>1?y:1,{style:I}=oe(this.shadowRoot,":host"),B=oe(this.shadowRoot,"img").style,se=this.shadowRoot.querySelector("img"),De=v?"min":"max";I.setProperty(`${De}-width`,"initial","important"),I.setProperty(`${De}-height`,"initial","important"),I.width=`${o*S}px`,I.height=`${s*S}px`;let ft=()=>{B.width=`${this.imgWidth*S}px`,B.height=`${this.imgHeight*S}px`,B.display="block"};se.src!==l&&(se.onload=()=>{this.imgWidth=se.naturalWidth,this.imgHeight=se.naturalHeight,ft()},se.src=l,ft()),ft(),B.transform=`translate(-${r*S}px, -${n*S}px)`}};Ct=new WeakMap;on.shadowRootOptions={mode:"open"};on.getTemplateHTML=sg;u.customElements.get("media-preview-thumbnail")||u.customElements.define("media-preview-thumbnail",on);var ja=on;var am=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},sm=(i,e,t)=>(am(i,e,"read from private field"),t?t.call(i):e.get(i)),ag=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},lg=(i,e,t,r)=>(am(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Jo,bc=class extends Ve{constructor(){super(),ag(this,Jo,void 0),lg(this,Jo,this.shadowRoot.querySelector("slot")),sm(this,Jo).textContent=lt(0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PREVIEW_TIME&&r!=null&&(sm(this,Jo).textContent=lt(parseFloat(r)))}get mediaPreviewTime(){return W(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){G(this,a.MEDIA_PREVIEW_TIME,e)}};Jo=new WeakMap;u.customElements.get("media-preview-time-display")||u.customElements.define("media-preview-time-display",bc);var sn={SEEK_OFFSET:"seekoffset"},_c=30,dg=i=>`
1372
1372
  <svg aria-hidden="true" viewBox="0 0 20 24">
1373
1373
  <defs>
1374
1374
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
1375
1375
  </defs>
1376
1376
  <text class="text value" transform="translate(2.18 19.87)">${i}</text>
1377
1377
  <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"/>
1378
- </svg>`;function ag(i,e){return`
1379
- <slot name="icon">${sg(e.seekOffset)}</slot>
1380
- `}function lg(){return b("Seek backward")}var dg=0,jo=class extends Z{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,rn.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=B(this,rn.SEEK_OFFSET,Ec)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===rn.SEEK_OFFSET&&(this.seekOffset=B(this,rn.SEEK_OFFSET,Ec))}get seekOffset(){return B(this,rn.SEEK_OFFSET,Ec)}set seekOffset(e){K(this,rn.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),js(Js(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return B(this,a.MEDIA_CURRENT_TIME,dg)}set mediaCurrentTime(e){K(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new u.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};jo.getSlotTemplateHTML=ag;jo.getTooltipContentHTML=lg;u.customElements.get("media-seek-backward-button")||u.customElements.define("media-seek-backward-button",jo);var nn={SEEK_OFFSET:"seekoffset"},gc=30,cg=i=>`
1378
+ </svg>`;function cg(i,e){return`
1379
+ <slot name="icon">${dg(e.seekOffset)}</slot>
1380
+ `}function ug(){return b("Seek backward")}var hg=0,es=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,sn.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=W(this,sn.SEEK_OFFSET,_c)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===sn.SEEK_OFFSET&&(this.seekOffset=W(this,sn.SEEK_OFFSET,_c))}get seekOffset(){return W(this,sn.SEEK_OFFSET,_c)}set seekOffset(e){G(this,sn.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),ta(ia(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return W(this,a.MEDIA_CURRENT_TIME,hg)}set mediaCurrentTime(e){G(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};es.getSlotTemplateHTML=cg;es.getTooltipContentHTML=ug;u.customElements.get("media-seek-backward-button")||u.customElements.define("media-seek-backward-button",es);var an={SEEK_OFFSET:"seekoffset"},yc=30,pg=i=>`
1381
1381
  <svg aria-hidden="true" viewBox="0 0 20 24">
1382
1382
  <defs>
1383
1383
  <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
1384
1384
  </defs>
1385
1385
  <text class="text value" transform="translate(8.9 19.87)">${i}</text>
1386
1386
  <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"/>
1387
- </svg>`;function ug(i,e){return`
1388
- <slot name="icon">${cg(e.seekOffset)}</slot>
1389
- `}function hg(){return b("Seek forward")}var pg=0,Jo=class extends Z{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,nn.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=B(this,nn.SEEK_OFFSET,gc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===nn.SEEK_OFFSET&&(this.seekOffset=B(this,nn.SEEK_OFFSET,gc))}get seekOffset(){return B(this,nn.SEEK_OFFSET,gc)}set seekOffset(e){K(this,nn.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),js(Js(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return B(this,a.MEDIA_CURRENT_TIME,pg)}set mediaCurrentTime(e){K(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new u.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Jo.getSlotTemplateHTML=ug;Jo.getTooltipContentHTML=hg;u.customElements.get("media-seek-forward-button")||u.customElements.define("media-seek-forward-button",Jo);var am=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},bc=(i,e,t)=>(am(i,e,"read from private field"),t?t.call(i):e.get(i)),mg=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},vg=(i,e,t,r)=>(am(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),on,ar={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},om=[...Object.values(ar),a.MEDIA_CURRENT_TIME,a.MEDIA_DURATION,a.MEDIA_SEEKABLE],sm=["Enter"," "],fg="&nbsp;/&nbsp;",_c=(i,{timesSep:e=fg}={})=>{var t,r;let n=(t=i.mediaCurrentTime)!=null?t:0,[,o]=(r=i.mediaSeekable)!=null?r:[],s=0;Number.isFinite(i.mediaDuration)?s=i.mediaDuration:Number.isFinite(o)&&(s=o);let l=i.remaining?st(0-(s-n)):st(n);return i.showDuration?`${l}${e}${st(s)}`:l},Eg="video not loaded, unknown time.",gg=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],n=null;if(Number.isFinite(i.mediaDuration)?n=i.mediaDuration:Number.isFinite(r)&&(n=r),t==null||n===null){i.setAttribute("aria-valuetext",Eg);return}let o=i.remaining?Gi(0-(n-t)):Gi(t);if(!i.showDuration){i.setAttribute("aria-valuetext",o);return}let s=Gi(n),l=`${o} of ${s}`;i.setAttribute("aria-valuetext",l)};function bg(i,e){return`
1390
- <slot>${_c(e)}</slot>
1391
- `}var Za=class extends He{constructor(){super(),mg(this,on,void 0),vg(this,on,this.shadowRoot.querySelector("slot")),bc(this,on).innerHTML=`${_c(this)}`}static get observedAttributes(){return[...super.observedAttributes,...om,"disabled"]}connectedCallback(){let{style:e}=ne(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",b("playback time"));let t=r=>{let{key:n}=r;if(!sm.includes(n)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:n,altKey:o,key:s}=r;if(n||o||!sm.includes(s)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,r){om.includes(e)?this.update():e==="disabled"&&r!==t&&(r==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,r)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return M(this,ar.REMAINING)}set remaining(e){x(this,ar.REMAINING,e)}get showDuration(){return M(this,ar.SHOW_DURATION)}set showDuration(e){x(this,ar.SHOW_DURATION,e)}get noToggle(){return M(this,ar.NO_TOGGLE)}set noToggle(e){x(this,ar.NO_TOGGLE,e)}get mediaDuration(){return B(this,a.MEDIA_DURATION)}set mediaDuration(e){K(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return B(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){K(this,a.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.MEDIA_SEEKABLE,e.join(":"))}update(){let e=_c(this);gg(this),e!==bc(this,on).innerHTML&&(bc(this,on).innerHTML=e)}};on=new WeakMap;Za.getSlotTemplateHTML=bg;u.customElements.get("media-time-display")||u.customElements.define("media-time-display",Za);var lm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ae=(i,e,t)=>(lm(i,e,"read from private field"),t?t.call(i):e.get(i)),wt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},qe=(i,e,t,r)=>(lm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),_g=(i,e,t,r)=>({set _(n){qe(i,e,n,t)},get _(){return Ae(i,e,r)}}),sn,Xa,an,es,ja,Ja,el,ln,lr,tl,il=class{constructor(e,t,r){wt(this,sn,void 0),wt(this,Xa,void 0),wt(this,an,void 0),wt(this,es,void 0),wt(this,ja,void 0),wt(this,Ja,void 0),wt(this,el,void 0),wt(this,ln,void 0),wt(this,lr,0),wt(this,tl,(n=performance.now())=>{qe(this,lr,requestAnimationFrame(Ae(this,tl))),qe(this,es,performance.now()-Ae(this,an));let o=1e3/this.fps;if(Ae(this,es)>o){qe(this,an,n-Ae(this,es)%o);let s=1e3/((n-Ae(this,Xa))/++_g(this,ja)._),l=(n-Ae(this,Ja))/1e3/this.duration,d=Ae(this,el)+l*this.playbackRate;d-Ae(this,sn).valueAsNumber>0?qe(this,ln,this.playbackRate/this.duration/s):(qe(this,ln,.995*Ae(this,ln)),d=Ae(this,sn).valueAsNumber+Ae(this,ln)),this.callback(d)}}),qe(this,sn,e),this.callback=t,this.fps=r}start(){Ae(this,lr)===0&&(qe(this,an,performance.now()),qe(this,Xa,Ae(this,an)),qe(this,ja,0),Ae(this,tl).call(this))}stop(){Ae(this,lr)!==0&&(cancelAnimationFrame(Ae(this,lr)),qe(this,lr,0))}update({start:e,duration:t,playbackRate:r}){let n=e-Ae(this,sn).valueAsNumber,o=Math.abs(t-this.duration);(n>0||n<-.03||o>=.5)&&this.callback(e),qe(this,el,e),qe(this,Ja,performance.now()),this.duration=t,this.playbackRate=r}};sn=new WeakMap;Xa=new WeakMap;an=new WeakMap;es=new WeakMap;ja=new WeakMap;Ja=new WeakMap;el=new WeakMap;ln=new WeakMap;lr=new WeakMap;tl=new WeakMap;var Sc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pe=(i,e,t)=>(Sc(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)},Xe=(i,e,t,r)=>(Sc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ce=(i,e,t)=>(Sc(i,e,"access private method"),t),dn,dr,ol,is,sl,nl,rs,ns,cn,un,hn,ts,kc,dm,yc,al,Lc,ll,wc,dl,Ic,Tc,cm,os,cl,Ac,um,yg="video not loaded, unknown time.",Tg=i=>{let e=i.range,t=Gi(+hm(i)),r=Gi(+i.mediaSeekableEnd),n=t&&r?`${t} of ${r}`:yg;e.setAttribute("aria-valuetext",n)};function Ag(i){return`
1387
+ </svg>`;function mg(i,e){return`
1388
+ <slot name="icon">${pg(e.seekOffset)}</slot>
1389
+ `}function vg(){return b("Seek forward")}var fg=0,ts=class extends X{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,an.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=W(this,an.SEEK_OFFSET,yc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===an.SEEK_OFFSET&&(this.seekOffset=W(this,an.SEEK_OFFSET,yc))}get seekOffset(){return W(this,an.SEEK_OFFSET,yc)}set seekOffset(e){G(this,an.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),ta(ia(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return W(this,a.MEDIA_CURRENT_TIME,fg)}set mediaCurrentTime(e){G(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};ts.getSlotTemplateHTML=mg;ts.getTooltipContentHTML=vg;u.customElements.get("media-seek-forward-button")||u.customElements.define("media-seek-forward-button",ts);var cm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Tc=(i,e,t)=>(cm(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)},gg=(i,e,t,r)=>(cm(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ln,cr={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},lm=[...Object.values(cr),a.MEDIA_CURRENT_TIME,a.MEDIA_DURATION,a.MEDIA_SEEKABLE],dm=["Enter"," "],bg="&nbsp;/&nbsp;",Ac=(i,{timesSep:e=bg}={})=>{var t,r;let n=(t=i.mediaCurrentTime)!=null?t:0,[,o]=(r=i.mediaSeekable)!=null?r:[],s=0;Number.isFinite(i.mediaDuration)?s=i.mediaDuration:Number.isFinite(o)&&(s=o);let l=i.remaining?lt(0-(s-n)):lt(n);return i.showDuration?`${l}${e}${lt(s)}`:l},_g="video not loaded, unknown time.",yg=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],n=null;if(Number.isFinite(i.mediaDuration)?n=i.mediaDuration:Number.isFinite(r)&&(n=r),t==null||n===null){i.setAttribute("aria-valuetext",_g);return}let o=i.remaining?Qi(0-(n-t)):Qi(t);if(!i.showDuration){i.setAttribute("aria-valuetext",o);return}let s=Qi(n),l=`${o} of ${s}`;i.setAttribute("aria-valuetext",l)};function Tg(i,e){return`
1390
+ <slot>${Ac(e)}</slot>
1391
+ `}var Ja=class extends Ve{constructor(){super(),Eg(this,ln,void 0),gg(this,ln,this.shadowRoot.querySelector("slot")),Tc(this,ln).innerHTML=`${Ac(this)}`}static get observedAttributes(){return[...super.observedAttributes,...lm,"disabled"]}connectedCallback(){let{style:e}=oe(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-cursor, pointer)"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",b("playback time"));let t=r=>{let{key:n}=r;if(!dm.includes(n)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:n,altKey:o,key:s}=r;if(n||o||!dm.includes(s)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,r){lm.includes(e)?this.update():e==="disabled"&&r!==t&&(r==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,r)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return M(this,cr.REMAINING)}set remaining(e){x(this,cr.REMAINING,e)}get showDuration(){return M(this,cr.SHOW_DURATION)}set showDuration(e){x(this,cr.SHOW_DURATION,e)}get noToggle(){return M(this,cr.NO_TOGGLE)}set noToggle(e){x(this,cr.NO_TOGGLE,e)}get mediaDuration(){return W(this,a.MEDIA_DURATION)}set mediaDuration(e){G(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return W(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){G(this,a.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Ac(this);yg(this),e!==Tc(this,ln).innerHTML&&(Tc(this,ln).innerHTML=e)}};ln=new WeakMap;Ja.getSlotTemplateHTML=Tg;u.customElements.get("media-time-display")||u.customElements.define("media-time-display",Ja);var um=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ke=(i,e,t)=>(um(i,e,"read from private field"),t?t.call(i):e.get(i)),Rt=(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)=>(um(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ag=(i,e,t,r)=>({set _(n){Ge(i,e,n,t)},get _(){return ke(i,e,r)}}),dn,el,cn,is,tl,il,rl,un,ur,nl,ol=class{constructor(e,t,r){Rt(this,dn,void 0),Rt(this,el,void 0),Rt(this,cn,void 0),Rt(this,is,void 0),Rt(this,tl,void 0),Rt(this,il,void 0),Rt(this,rl,void 0),Rt(this,un,void 0),Rt(this,ur,0),Rt(this,nl,(n=performance.now())=>{Ge(this,ur,requestAnimationFrame(ke(this,nl))),Ge(this,is,performance.now()-ke(this,cn));let o=1e3/this.fps;if(ke(this,is)>o){Ge(this,cn,n-ke(this,is)%o);let s=1e3/((n-ke(this,el))/++Ag(this,tl)._),l=(n-ke(this,il))/1e3/this.duration,d=ke(this,rl)+l*this.playbackRate;d-ke(this,dn).valueAsNumber>0?Ge(this,un,this.playbackRate/this.duration/s):(Ge(this,un,.995*ke(this,un)),d=ke(this,dn).valueAsNumber+ke(this,un)),this.callback(d)}}),Ge(this,dn,e),this.callback=t,this.fps=r}start(){ke(this,ur)===0&&(Ge(this,cn,performance.now()),Ge(this,el,ke(this,cn)),Ge(this,tl,0),ke(this,nl).call(this))}stop(){ke(this,ur)!==0&&(cancelAnimationFrame(ke(this,ur)),Ge(this,ur,0))}update({start:e,duration:t,playbackRate:r}){let n=e-ke(this,dn).valueAsNumber,o=Math.abs(t-this.duration);(n>0||n<-.03||o>=.5)&&this.callback(e),Ge(this,rl,e),Ge(this,il,performance.now()),this.duration=t,this.playbackRate=r}};dn=new WeakMap;el=new WeakMap;cn=new WeakMap;is=new WeakMap;tl=new WeakMap;il=new WeakMap;rl=new WeakMap;un=new WeakMap;ur=new WeakMap;nl=new WeakMap;var wc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},me=(i,e,t)=>(wc(i,e,"read from private field"),t?t.call(i):e.get(i)),ye=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},et=(i,e,t,r)=>(wc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Re=(i,e,t)=>(wc(i,e,"access private method"),t),hn,hr,ll,ns,dl,al,os,ss,pn,mn,vn,rs,Ic,hm,Sc,cl,Cc,ul,Rc,hl,Mc,kc,pm,as,pl,Lc,mm,Sg="video not loaded, unknown time.",kg=i=>{let e=i.range,t=Qi(+vm(i)),r=Qi(+i.mediaSeekableEnd),n=t&&r?`${t} of ${r}`:Sg;e.setAttribute("aria-valuetext",n)};function Lg(i){return`
1392
1392
  <style>
1393
1393
  :host {
1394
1394
  --media-box-border-radius: 4px;
@@ -1591,8 +1591,8 @@ bp-player[has-error] {
1591
1591
  <div id="preview-rail">
1592
1592
  <slot name="preview" part="box preview-box">
1593
1593
  <media-preview-thumbnail>
1594
- <template shadowrootmode="${Qa.shadowRootOptions.mode}">
1595
- ${Qa.getTemplateHTML({})}
1594
+ <template shadowrootmode="${ja.shadowRootOptions.mode}">
1595
+ ${ja.getTemplateHTML({})}
1596
1596
  </template>
1597
1597
  </media-preview-thumbnail>
1598
1598
  <media-preview-chapter-display></media-preview-chapter-display>
@@ -1605,7 +1605,7 @@ bp-player[has-error] {
1605
1605
 
1606
1606
  </slot>
1607
1607
  </div>
1608
- `}var rl=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(r))return 0;let n=(e-t)/(r-t);return Math.max(0,Math.min(n,1))},hm=(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},ss=class extends yt{constructor(){super(),be(this,hn),be(this,kc),be(this,al),be(this,ll),be(this,dl),be(this,Tc),be(this,os),be(this,Ac),be(this,dn,void 0),be(this,dr,void 0),be(this,ol,void 0),be(this,is,void 0),be(this,sl,void 0),be(this,nl,void 0),be(this,rs,void 0),be(this,ns,void 0),be(this,cn,void 0),be(this,un,void 0),be(this,yc,r=>{this.dragging||(Ur(r)&&(this.range.valueAsNumber=r),pe(this,un)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Xe(this,ol,this.shadowRoot.querySelectorAll('[part~="box"]')),Xe(this,sl,this.shadowRoot.querySelector('[part~="preview-box"]')),Xe(this,nl,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Xe(this,rs,parseInt(t.getPropertyValue("--media-box-padding-left"))),Xe(this,ns,parseInt(t.getPropertyValue("--media-box-padding-right"))),Xe(this,dr,new il(this.range,pe(this,yc),60))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_DURATION,a.MEDIA_SEEKABLE,a.MEDIA_CURRENT_TIME,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_TIME,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_BUFFERED,a.MEDIA_PLAYBACK_RATE,a.MEDIA_LOADING,a.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",b("seek")),Ce(this,hn,ts).call(this),Xe(this,dn,this.getRootNode()),(e=pe(this,dn))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),Ce(this,hn,ts).call(this),(e=pe(this,dn))==null||e.removeEventListener("transitionstart",this),Xe(this,dn,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(e===a.MEDIA_CURRENT_TIME||e===a.MEDIA_PAUSED||e===a.MEDIA_ENDED||e===a.MEDIA_LOADING||e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE?(pe(this,dr).update({start:rl(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),Ce(this,hn,ts).call(this),Tg(this)):e===a.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=pe(this,cn),this.updateBar()))}get mediaChaptersCues(){return pe(this,cn)}set mediaChaptersCues(e){var t;Xe(this,cn,e),this.updateSegments((t=pe(this,cn))==null?void 0:t.map(r=>({start:rl(this,r.startTime),end:rl(this,r.endTime)})))}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,a.MEDIA_LOADING)}set mediaLoading(e){x(this,a.MEDIA_LOADING,e)}get mediaDuration(){return B(this,a.MEDIA_DURATION)}set mediaDuration(e){K(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return B(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){K(this,a.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return B(this,a.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){K(this,a.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(a.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(a.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(a.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return O(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){N(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return B(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){K(this,a.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return M(this,a.MEDIA_ENDED)}set mediaEnded(e){x(this,a.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let r;if(this.mediaEnded)r=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=t.find(([l,d])=>l<=o&&o<=d))!=null?e:[];r=rl(this,s)}let{style:n}=ne(this.shadowRoot,"#buffered");n.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=ne(this.shadowRoot,"#current-rail"),r=ne(this.shadowRoot,'[part~="current-box"]'),n=Ce(this,al,Lc).call(this,pe(this,nl)),o=Ce(this,ll,wc).call(this,n,this.range.valueAsNumber),s=Ce(this,dl,Ic).call(this,n,this.range.valueAsNumber);t.style.transform=`translateX(${o})`,t.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${s}`),r.style.setProperty("--_box-width",`${n.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":Ce(this,Ac,um).call(this);break;case"pointermove":Ce(this,Tc,cm).call(this,e);break;case"pointerup":pe(this,un)&&Xe(this,un,!1);break;case"pointerdown":Xe(this,un,!0);break;case"pointerleave":Ce(this,os,cl).call(this,null);break;case"transitionstart":Me(e.target,this)&&setTimeout(()=>Ce(this,hn,ts).call(this),0);break}}};dn=new WeakMap;dr=new WeakMap;ol=new WeakMap;is=new WeakMap;sl=new WeakMap;nl=new WeakMap;rs=new WeakMap;ns=new WeakMap;cn=new WeakMap;un=new WeakMap;hn=new WeakSet;ts=function(){Ce(this,kc,dm).call(this)?pe(this,dr).start():pe(this,dr).stop()};kc=new WeakSet;dm=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&ea(this)};yc=new WeakMap;al=new WeakSet;Lc=function(i){var e;let r=((e=this.getAttribute("bounds")?mt(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),n=this.range.getBoundingClientRect(),o=i.offsetWidth,s=-(n.left-r.left-o/2),l=r.right-n.left-o/2;return{box:{width:o,min:s,max:l},bounds:r,range:n}};ll=new WeakSet;wc=function(i,e){let t=`${e*100}%`,{width:r,min:n,max:o}=i.box;if(!r)return t;if(Number.isNaN(n)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${n}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(o)){let l=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};dl=new WeakSet;Ic=function(i,e){let{width:t,min:r,max:n}=i.box,o=e*i.range.width;if(o<r+pe(this,rs)){let s=i.range.left-i.bounds.left-pe(this,rs);return`${o-t/2+s}px`}if(o>n-pe(this,ns)){let s=i.bounds.right-i.range.right-pe(this,ns);return`${o+t/2-s-i.range.width}px`}return 0};Tc=new WeakSet;cm=function(i){let e=[...pe(this,ol)].some(p=>i.composedPath().includes(p));if(!this.dragging&&(e||!i.composedPath().includes(this))){Ce(this,os,cl).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=ne(this.shadowRoot,"#preview-rail"),n=ne(this.shadowRoot,'[part~="preview-box"]'),o=Ce(this,al,Lc).call(this,pe(this,sl)),s=(i.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=Ce(this,ll,wc).call(this,o,s),d=Ce(this,dl,Ic).call(this,o,s);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${o.range.width}`),n.style.setProperty("--_box-shift",`${d}`),n.style.setProperty("--_box-width",`${o.box.width}px`);let h=Math.round(pe(this,is))-Math.round(s*t);Math.abs(h)<1&&s>.01&&s<.99||(Xe(this,is,s*t),Ce(this,os,cl).call(this,pe(this,is)))};os=new WeakSet;cl=function(i){this.dispatchEvent(new u.CustomEvent(y.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Ac=new WeakSet;um=function(){pe(this,dr).stop();let i=hm(this);this.dispatchEvent(new u.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};ss.shadowRootOptions={mode:"open"};ss.getContainerTemplateHTML=Ag;u.customElements.get("media-time-range")||u.customElements.define("media-time-range",ss);var Sg=1,kg=i=>i.mediaMuted?0:i.mediaVolume,Lg=i=>`${Math.round(i*100)}%`,Cc=class extends yt{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME,a.MEDIA_MUTED,a.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new u.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",b("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_VOLUME||e===a.MEDIA_MUTED)&&(this.range.valueAsNumber=kg(this),this.range.setAttribute("aria-valuetext",Lg(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return B(this,a.MEDIA_VOLUME,Sg)}set mediaVolume(e){K(this,a.MEDIA_VOLUME,e)}get mediaMuted(){return M(this,a.MEDIA_MUTED)}set mediaMuted(e){x(this,a.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return O(this,a.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){N(this,a.MEDIA_VOLUME_UNAVAILABLE,e)}};u.customElements.get("media-volume-range")||u.customElements.define("media-volume-range",Cc);function wg(i){return`
1608
+ `}var sl=(i,e=i.mediaCurrentTime)=>{let t=Number.isFinite(i.mediaSeekableStart)?i.mediaSeekableStart:0,r=Number.isFinite(i.mediaDuration)?i.mediaDuration:i.mediaSeekableEnd;if(Number.isNaN(r))return 0;let n=(e-t)/(r-t);return Math.max(0,Math.min(n,1))},vm=(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},ls=class extends St{constructor(){super(),ye(this,vn),ye(this,Ic),ye(this,cl),ye(this,ul),ye(this,hl),ye(this,kc),ye(this,as),ye(this,Lc),ye(this,hn,void 0),ye(this,hr,void 0),ye(this,ll,void 0),ye(this,ns,void 0),ye(this,dl,void 0),ye(this,al,void 0),ye(this,os,void 0),ye(this,ss,void 0),ye(this,pn,void 0),ye(this,mn,void 0),ye(this,Sc,r=>{this.dragging||(Vr(r)&&(this.range.valueAsNumber=r),me(this,mn)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),et(this,ll,this.shadowRoot.querySelectorAll('[part~="box"]')),et(this,dl,this.shadowRoot.querySelector('[part~="preview-box"]')),et(this,al,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);et(this,os,parseInt(t.getPropertyValue("--media-box-padding-left"))),et(this,ss,parseInt(t.getPropertyValue("--media-box-padding-right"))),et(this,hr,new ol(this.range,me(this,Sc),60))}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_DURATION,a.MEDIA_SEEKABLE,a.MEDIA_CURRENT_TIME,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_TIME,a.MEDIA_PREVIEW_CHAPTER,a.MEDIA_BUFFERED,a.MEDIA_PLAYBACK_RATE,a.MEDIA_LOADING,a.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",b("seek")),Re(this,vn,rs).call(this),et(this,hn,this.getRootNode()),(e=me(this,hn))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),Re(this,vn,rs).call(this),(e=me(this,hn))==null||e.removeEventListener("transitionstart",this),et(this,hn,null)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),t!=r&&(e===a.MEDIA_CURRENT_TIME||e===a.MEDIA_PAUSED||e===a.MEDIA_ENDED||e===a.MEDIA_LOADING||e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE?(me(this,hr).update({start:sl(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),Re(this,vn,rs).call(this),kg(this)):e===a.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=me(this,pn),this.updateBar()))}get mediaChaptersCues(){return me(this,pn)}set mediaChaptersCues(e){var t;et(this,pn,e),this.updateSegments((t=me(this,pn))==null?void 0:t.map(r=>({start:sl(this,r.startTime),end:sl(this,r.endTime)})))}get mediaPaused(){return M(this,a.MEDIA_PAUSED)}set mediaPaused(e){x(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,a.MEDIA_LOADING)}set mediaLoading(e){x(this,a.MEDIA_LOADING,e)}get mediaDuration(){return W(this,a.MEDIA_DURATION)}set mediaDuration(e){G(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return W(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){G(this,a.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return W(this,a.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){G(this,a.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(a.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(r=>+r)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(a.MEDIA_BUFFERED);return}let t=e.map(r=>r.join(":")).join(" ");this.setAttribute(a.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(a.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(a.MEDIA_SEEKABLE);return}this.setAttribute(a.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return O(this,a.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){N(this,a.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return W(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){G(this,a.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return M(this,a.MEDIA_ENDED)}set mediaEnded(e){x(this,a.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let r;if(this.mediaEnded)r=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=t.find(([l,d])=>l<=o&&o<=d))!=null?e:[];r=sl(this,s)}let{style:n}=oe(this.shadowRoot,"#buffered");n.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=oe(this.shadowRoot,"#current-rail"),r=oe(this.shadowRoot,'[part~="current-box"]'),n=Re(this,cl,Cc).call(this,me(this,al)),o=Re(this,ul,Rc).call(this,n,this.range.valueAsNumber),s=Re(this,hl,Mc).call(this,n,this.range.valueAsNumber);t.style.transform=`translateX(${o})`,t.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${s}`),r.style.setProperty("--_box-width",`${n.box.width}px`),r.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":Re(this,Lc,mm).call(this);break;case"pointermove":Re(this,kc,pm).call(this,e);break;case"pointerup":me(this,mn)&&et(this,mn,!1);break;case"pointerdown":et(this,mn,!0);break;case"pointerleave":Re(this,as,pl).call(this,null);break;case"transitionstart":xe(e.target,this)&&setTimeout(()=>Re(this,vn,rs).call(this),0);break}}};hn=new WeakMap;hr=new WeakMap;ll=new WeakMap;ns=new WeakMap;dl=new WeakMap;al=new WeakMap;os=new WeakMap;ss=new WeakMap;pn=new WeakMap;mn=new WeakMap;vn=new WeakSet;rs=function(){Re(this,Ic,hm).call(this)?me(this,hr).start():me(this,hr).stop()};Ic=new WeakSet;hm=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&ra(this)};Sc=new WeakMap;cl=new WeakSet;Cc=function(i){var e;let r=((e=this.getAttribute("bounds")?Et(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),n=this.range.getBoundingClientRect(),o=i.offsetWidth,s=-(n.left-r.left-o/2),l=r.right-n.left-o/2;return{box:{width:o,min:s,max:l},bounds:r,range:n}};ul=new WeakSet;Rc=function(i,e){let t=`${e*100}%`,{width:r,min:n,max:o}=i.box;if(!r)return t;if(Number.isNaN(n)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${n}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(o)){let l=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;t=`min(${t}, ${l})`}return t};hl=new WeakSet;Mc=function(i,e){let{width:t,min:r,max:n}=i.box,o=e*i.range.width;if(o<r+me(this,os)){let s=i.range.left-i.bounds.left-me(this,os);return`${o-t/2+s}px`}if(o>n-me(this,ss)){let s=i.bounds.right-i.range.right-me(this,ss);return`${o+t/2-s-i.range.width}px`}return 0};kc=new WeakSet;pm=function(i){let e=[...me(this,ll)].some(p=>i.composedPath().includes(p));if(!this.dragging&&(e||!i.composedPath().includes(this))){Re(this,as,pl).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=oe(this.shadowRoot,"#preview-rail"),n=oe(this.shadowRoot,'[part~="preview-box"]'),o=Re(this,cl,Cc).call(this,me(this,dl)),s=(i.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=Re(this,ul,Rc).call(this,o,s),d=Re(this,hl,Mc).call(this,o,s);r.style.transform=`translateX(${l})`,r.style.setProperty("--_range-width",`${o.range.width}`),n.style.setProperty("--_box-shift",`${d}`),n.style.setProperty("--_box-width",`${o.box.width}px`);let h=Math.round(me(this,ns))-Math.round(s*t);Math.abs(h)<1&&s>.01&&s<.99||(et(this,ns,s*t),Re(this,as,pl).call(this,me(this,ns)))};as=new WeakSet;pl=function(i){this.dispatchEvent(new u.CustomEvent(_.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Lc=new WeakSet;mm=function(){me(this,hr).stop();let i=vm(this);this.dispatchEvent(new u.CustomEvent(_.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};ls.shadowRootOptions={mode:"open"};ls.getContainerTemplateHTML=Lg;u.customElements.get("media-time-range")||u.customElements.define("media-time-range",ls);var wg=1,Ig=i=>i.mediaMuted?0:i.mediaVolume,Cg=i=>`${Math.round(i*100)}%`,xc=class extends St{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME,a.MEDIA_MUTED,a.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new u.CustomEvent(_.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",b("volume"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_VOLUME||e===a.MEDIA_MUTED)&&(this.range.valueAsNumber=Ig(this),this.range.setAttribute("aria-valuetext",Cg(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return W(this,a.MEDIA_VOLUME,wg)}set mediaVolume(e){G(this,a.MEDIA_VOLUME,e)}get mediaMuted(){return M(this,a.MEDIA_MUTED)}set mediaMuted(e){x(this,a.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return O(this,a.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){N(this,a.MEDIA_VOLUME_UNAVAILABLE,e)}};u.customElements.get("media-volume-range")||u.customElements.define("media-volume-range",xc);function Rg(i){return`
1609
1609
  <style>
1610
1610
  :host {
1611
1611
  min-width: 4ch;
@@ -1634,7 +1634,7 @@ bp-player[has-error] {
1634
1634
  <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"/>
1635
1635
  </svg>
1636
1636
  </div>
1637
- `}function Ig(){return b("Loop")}var as=class extends Z{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=b("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return M(this,a.MEDIA_LOOP)}set mediaLoop(e){x(this,a.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new u.CustomEvent(y.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};as.getSlotTemplateHTML=wg;as.getTooltipContentHTML=Ig;u.customElements.get("media-loop-button")||u.customElements.define("media-loop-button",as);function pm({anchor:i,floating:e,placement:t}){let r=Cg({anchor:i,floating:e}),{x:n,y:o}=Mg(r,t);return{x:n,y:o}}function Cg({anchor:i,floating:e}){return{anchor:Rg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Rg(i,e){var t;let r=i.getBoundingClientRect(),n=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-n.x,y:r.y-n.y,width:r.width,height:r.height}}function Mg({anchor:i,floating:e},t){let r=xg(t)==="x"?"y":"x",n=r==="y"?"height":"width",o=mm(t),s=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,d=i[n]/2-e[n]/2,h;switch(o){case"top":h={x:s,y:i.y-e.height};break;case"bottom":h={x:s,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:l};break;case"left":h={x:i.x-e.width,y:l};break;default:h={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":h[r]-=d;break;case"end":h[r]+=d;break}return h}function mm(i){return i.split("-")[0]}function xg(i){return["top","bottom"].includes(mm(i))?"y":"x"}var vi=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},ul=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var Bc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},X=(i,e,t)=>(Bc(i,e,"read from private field"),t?t.call(i):e.get(i)),ee=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},It=(i,e,t,r)=>(Bc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),te=(i,e,t)=>(Bc(i,e,"access private method"),t),Ct,ur,fi,hl,pl,hr,cs,Rc,vm,fl,Wc,El,ml,Mc,xc,fm,Pc,Em,Dc,gm,pn,mn,vn,us,gl,Fc,Oc,bm,qc,_m,Nc,ym,Kc,Tm,Uc,Am,Hc,Sm,ls,bl,$c,km,ds,_l,vl,Vc;function Rt({type:i,text:e,value:t,checked:r}){let n=se.createElement("media-chrome-menu-item");n.type=i??"",n.part.add("menu-item"),i&&n.part.add(i),n.value=t,n.checked=r;let o=se.createElement("span");return o.textContent=e,n.append(o),n}function dt(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 Pg(i){return`
1637
+ `}function Mg(){return b("Loop")}var ds=class extends X{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=b("Loop"))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return M(this,a.MEDIA_LOOP)}set mediaLoop(e){x(this,a.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new u.CustomEvent(_.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};ds.getSlotTemplateHTML=Rg;ds.getTooltipContentHTML=Mg;u.customElements.get("media-loop-button")||u.customElements.define("media-loop-button",ds);function fm({anchor:i,floating:e,placement:t}){let r=xg({anchor:i,floating:e}),{x:n,y:o}=Dg(r,t);return{x:n,y:o}}function xg({anchor:i,floating:e}){return{anchor:Pg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Pg(i,e){var t;let r=i.getBoundingClientRect(),n=(t=e==null?void 0:e.getBoundingClientRect())!=null?t:{x:0,y:0};return{x:r.x-n.x,y:r.y-n.y,width:r.width,height:r.height}}function Dg({anchor:i,floating:e},t){let r=Og(t)==="x"?"y":"x",n=r==="y"?"height":"width",o=Em(t),s=i.x+i.width/2-e.width/2,l=i.y+i.height/2-e.height/2,d=i[n]/2-e[n]/2,h;switch(o){case"top":h={x:s,y:i.y-e.height};break;case"bottom":h={x:s,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:l};break;case"left":h={x:i.x-e.width,y:l};break;default:h={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":h[r]-=d;break;case"end":h[r]+=d;break}return h}function Em(i){return i.split("-")[0]}function Og(i){return["top","bottom"].includes(Em(i))?"y":"x"}var Ei=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},ml=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var Kc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},j=(i,e,t)=>(Kc(i,e,"read from private field"),t?t.call(i):e.get(i)),te=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Mt=(i,e,t,r)=>(Kc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ie=(i,e,t)=>(Kc(i,e,"access private method"),t),xt,mr,gi,vl,fl,vr,hs,Pc,gm,bl,qc,_l,El,Dc,Oc,bm,Nc,_m,Uc,ym,fn,En,gn,ps,yl,Gc,Hc,Tm,zc,Am,$c,Sm,Yc,km,Vc,Lm,Bc,wm,cs,Tl,Wc,Im,us,Al,gl,Fc;function Pt({type:i,text:e,value:t,checked:r}){let n=le.createElement("media-chrome-menu-item");n.type=i??"",n.part.add("menu-item"),i&&n.part.add(i),n.value=t,n.checked=r;let o=le.createElement("span");return o.textContent=e,n.append(o),n}function ut(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let r=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return r?r.cloneNode(!0):""}function Ng(i){return`
1638
1638
  <style>
1639
1639
  :host {
1640
1640
  font: var(--media-font,
@@ -1809,7 +1809,7 @@ bp-player[has-error] {
1809
1809
  <slot></slot>
1810
1810
  </div>
1811
1811
  <slot name="checked-indicator" hidden></slot>
1812
- `}var cr={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},me=class extends u.HTMLElement{constructor(){if(super(),ee(this,Rc),ee(this,fl),ee(this,ml),ee(this,xc),ee(this,Pc),ee(this,Dc),ee(this,vn),ee(this,gl),ee(this,Oc),ee(this,qc),ee(this,Nc),ee(this,Kc),ee(this,Uc),ee(this,Hc),ee(this,ls),ee(this,$c),ee(this,ds),ee(this,vl),ee(this,Ct,null),ee(this,ur,null),ee(this,fi,null),ee(this,hl,new Set),ee(this,pl,void 0),ee(this,hr,!1),ee(this,cs,null),ee(this,El,()=>{let e=X(this,hl),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}));It(this,hl,t)}),ee(this,pn,()=>{te(this,vn,us).call(this),te(this,gl,Fc).call(this,!1)}),ee(this,mn,()=>{te(this,vn,us).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=oe(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),It(this,pl,new MutationObserver(X(this,El))),X(this,pl).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[cr.DISABLED,cr.HIDDEN,cr.STYLE,cr.ANCHOR,H.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":te(this,Rc,vm).call(this,e);break;case"invoke":te(this,xc,fm).call(this,e);break;case"click":te(this,Oc,bm).call(this,e);break;case"toggle":te(this,Nc,ym).call(this,e);break;case"focusout":te(this,Uc,Am).call(this,e);break;case"keydown":te(this,Hc,Sm).call(this,e);break}}connectedCallback(){var e,t;It(this,cs,Ao(this.shadowRoot,":host")),te(this,ml,Mc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),It(this,Ct,Xs(this)),(t=(e=X(this,Ct))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||($t(hs(this),X(this,pn)),$t(this,X(this,mn))),te(this,fl,Wc).call(this)}disconnectedCallback(){var e,t;Vt(hs(this),X(this,pn)),Vt(this,X(this,mn)),this.disable(),(t=(e=X(this,Ct))==null?void 0:e.unassociateElement)==null||t.call(e,this),It(this,Ct,null)}attributeChangedCallback(e,t,r){var n,o,s,l;e===cr.HIDDEN&&r!==t?(X(this,hr)||It(this,hr,!0),this.hidden?te(this,Dc,gm).call(this):te(this,Pc,Em).call(this),this.dispatchEvent(new ul({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===H.MEDIA_CONTROLLER?(t&&((o=(n=X(this,Ct))==null?void 0:n.unassociateElement)==null||o.call(n,this),It(this,Ct,null)),r&&this.isConnected&&(It(this,Ct,Xs(this)),(l=(s=X(this,Ct))==null?void 0:s.associateElement)==null||l.call(s,this))):e===cr.DISABLED&&r!==t?r==null?this.enable():this.disable():e===cr.STYLE&&r!==t&&te(this,ml,Mc).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=zi(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Dg)}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&&te(this,vl,Vc).call(this,t)}focus(){if(It(this,ur,To()),this.items.length){te(this,ds,_l).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=te(this,ls,bl).call(this,e);r&&(te(this,vl,Vc).call(this,r,r.type==="checkbox"),X(this,fi)&&!this.hidden&&((t=X(this,ur))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:n}=e,o=this.items,s=(r=(t=te(this,ls,bl).call(this,e))!=null?t:te(this,$c,km).call(this))!=null?r:o[0],l=o.indexOf(s),d=Math.max(0,l);n==="ArrowDown"?d++:n==="ArrowUp"?d--:e.key==="Home"?d=0:e.key==="End"&&(d=o.length-1),d<0&&(d=o.length-1),d>o.length-1&&(d=0),te(this,ds,_l).call(this,o[d]),o[d].focus()}};Ct=new WeakMap;ur=new WeakMap;fi=new WeakMap;hl=new WeakMap;pl=new WeakMap;hr=new WeakMap;cs=new WeakMap;Rc=new WeakSet;vm=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)&&te(this,fl,Wc).call(this),e.name||X(this,El).call(this)};fl=new WeakSet;Wc=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};El=new WeakMap;ml=new WeakSet;Mc=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")};xc=new WeakSet;fm=function(i){It(this,fi,i.relatedTarget),Me(this,i.relatedTarget)||(this.hidden=!this.hidden)};Pc=new WeakSet;Em=function(){var i;(i=X(this,fi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),$t(hs(this),X(this,pn)),$t(this,X(this,mn))};Dc=new WeakSet;gm=function(){var i;(i=X(this,fi))==null||i.setAttribute("aria-expanded","false"),Vt(hs(this),X(this,pn)),Vt(this,X(this,mn))};pn=new WeakMap;mn=new WeakMap;vn=new WeakSet;us=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=pm({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let n=hs(this).getBoundingClientRect(),o=n.width-e-i,s=n.height-t-this.offsetHeight,{style:l}=X(this,cs);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,o)}px`),l.setProperty("--_menu-bottom",`${s}px`);let d=getComputedStyle(this),p=l.getPropertyValue("--_menu-bottom")===d.bottom?s:parseFloat(d.bottom),f=n.height-p-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${f}px`)};gl=new WeakSet;Fc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=X(this,cs);if(i||r.setProperty("--media-menu-transition-in","none"),t){let n=t.offsetHeight,o=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${n}px`),te(this,vn,us).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),te(this,vn,us).call(this);r.removeProperty("--media-menu-transition-in")};Oc=new WeakSet;bm=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(X(this,qc,_m))){(e=X(this,ur))==null||e.focus(),this.hidden=!0;return}let t=te(this,ls,bl).call(this,i);!t||t.hasAttribute("disabled")||(te(this,ds,_l).call(this,t),this.handleSelect(i))};qc=new WeakSet;_m=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"]'))};Nc=new WeakSet;ym=function(i){if(i.target===this)return;te(this,Kc,Tm).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 vi({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);te(this,gl,Fc).call(this,!0)};Kc=new WeakSet;Tm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Uc=new WeakSet;Am=function(i){var e;Me(this,i.relatedTarget)||(X(this,hr)&&((e=X(this,ur))==null||e.focus()),X(this,fi)&&X(this,fi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Hc=new WeakSet;Sm=function(i){var e,t,r,n,o;let{key:s,ctrlKey:l,altKey:d,metaKey:h}=i;if(!(l||d||h)&&this.keysUsed.includes(s))if(i.preventDefault(),i.stopPropagation(),s==="Tab"){if(X(this,hr)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(n=(r=this.nextElementSibling)==null?void 0:r.focus)==null||n.call(r),this.blur()}else s==="Escape"?((o=X(this,ur))==null||o.focus(),X(this,hr)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};ls=new WeakSet;bl=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};$c=new WeakSet;km=function(){return this.items.find(i=>i.tabIndex===0)};ds=new WeakSet;_l=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};vl=new WeakSet;Vc=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(r=>r.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((r,n)=>r!=t[n])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};me.shadowRootOptions={mode:"open"};me.getTemplateHTML=Pg;function Dg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function hs(i){var e;return(e=i.getAttribute("bounds")?mt(i,`#${i.getAttribute("bounds")}`):re(i)||i.parentElement)!=null?e:i}u.customElements.get("media-chrome-menu")||u.customElements.define("media-chrome-menu",me);var Xc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Mt=(i,e,t)=>(Xc(i,e,"read from private field"),t?t.call(i):e.get(i)),qt=(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)},Gc=(i,e,t,r)=>(Xc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ct=(i,e,t)=>(Xc(i,e,"access private method"),t),yl,ms,zc,Lm,Al,jc,Jc,wm,xt,fn,vs,Yc,Im,Tl,Qc;function Og(i){return`
1812
+ `}var pr={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ve=class extends u.HTMLElement{constructor(){if(super(),te(this,Pc),te(this,bl),te(this,El),te(this,Oc),te(this,Nc),te(this,Uc),te(this,gn),te(this,yl),te(this,Hc),te(this,zc),te(this,$c),te(this,Yc),te(this,Vc),te(this,Bc),te(this,cs),te(this,Wc),te(this,us),te(this,gl),te(this,xt,null),te(this,mr,null),te(this,gi,null),te(this,vl,new Set),te(this,fl,void 0),te(this,vr,!1),te(this,hs,null),te(this,_l,()=>{let e=j(this,vl),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}));Mt(this,vl,t)}),te(this,fn,()=>{ie(this,gn,ps).call(this),ie(this,yl,Gc).call(this,!1)}),te(this,En,()=>{ie(this,gn,ps).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),Mt(this,fl,new MutationObserver(j(this,_l))),j(this,fl).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[pr.DISABLED,pr.HIDDEN,pr.STYLE,pr.ANCHOR,H.MEDIA_CONTROLLER]}static formatMenuItemText(e,t){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":ie(this,Pc,gm).call(this,e);break;case"invoke":ie(this,Oc,bm).call(this,e);break;case"click":ie(this,Hc,Tm).call(this,e);break;case"toggle":ie(this,$c,Sm).call(this,e);break;case"focusout":ie(this,Vc,Lm).call(this,e);break;case"keydown":ie(this,Bc,wm).call(this,e);break}}connectedCallback(){var e,t;Mt(this,hs,ko(this.shadowRoot,":host")),ie(this,El,Dc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Mt(this,xt,ea(this)),(t=(e=j(this,xt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Bt(ms(this),j(this,fn)),Bt(this,j(this,En))),ie(this,bl,qc).call(this)}disconnectedCallback(){var e,t;Wt(ms(this),j(this,fn)),Wt(this,j(this,En)),this.disable(),(t=(e=j(this,xt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Mt(this,xt,null)}attributeChangedCallback(e,t,r){var n,o,s,l;e===pr.HIDDEN&&r!==t?(j(this,vr)||Mt(this,vr,!0),this.hidden?ie(this,Uc,ym).call(this):ie(this,Nc,_m).call(this),this.dispatchEvent(new ml({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===H.MEDIA_CONTROLLER?(t&&((o=(n=j(this,xt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Mt(this,xt,null)),r&&this.isConnected&&(Mt(this,xt,ea(this)),(l=(s=j(this,xt))==null?void 0:s.associateElement)==null||l.call(s,this))):e===pr.DISABLED&&r!==t?r==null?this.enable():this.disable():e===pr.STYLE&&r!==t&&ie(this,El,Dc).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=Zi(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Ug)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(r=>r.value===e);t&&ie(this,gl,Fc).call(this,t)}focus(){if(Mt(this,mr,So()),this.items.length){ie(this,us,Al).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let r=ie(this,cs,Tl).call(this,e);r&&(ie(this,gl,Fc).call(this,r,r.type==="checkbox"),j(this,gi)&&!this.hidden&&((t=j(this,mr))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:n}=e,o=this.items,s=(r=(t=ie(this,cs,Tl).call(this,e))!=null?t:ie(this,Wc,Im).call(this))!=null?r:o[0],l=o.indexOf(s),d=Math.max(0,l);n==="ArrowDown"?d++:n==="ArrowUp"?d--:e.key==="Home"?d=0:e.key==="End"&&(d=o.length-1),d<0&&(d=o.length-1),d>o.length-1&&(d=0),ie(this,us,Al).call(this,o[d]),o[d].focus()}};xt=new WeakMap;mr=new WeakMap;gi=new WeakMap;vl=new WeakMap;fl=new WeakMap;vr=new WeakMap;hs=new WeakMap;Pc=new WeakSet;gm=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();["header","title"].includes(e.name)&&ie(this,bl,qc).call(this),e.name||j(this,_l).call(this)};bl=new WeakSet;qc=function(){let i=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');i.hidden=e.assignedNodes().length===0&&i.assignedNodes().length===0};_l=new WeakMap;El=new WeakSet;Dc=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")};Oc=new WeakSet;bm=function(i){Mt(this,gi,i.relatedTarget),xe(this,i.relatedTarget)||(this.hidden=!this.hidden)};Nc=new WeakSet;_m=function(){var i;(i=j(this,gi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Bt(ms(this),j(this,fn)),Bt(this,j(this,En))};Uc=new WeakSet;ym=function(){var i;(i=j(this,gi))==null||i.setAttribute("aria-expanded","false"),Wt(ms(this),j(this,fn)),Wt(this,j(this,En))};fn=new WeakMap;En=new WeakMap;gn=new WeakSet;ps=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=fm({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let n=ms(this).getBoundingClientRect(),o=n.width-e-i,s=n.height-t-this.offsetHeight,{style:l}=j(this,hs);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,o)}px`),l.setProperty("--_menu-bottom",`${s}px`);let d=getComputedStyle(this),p=l.getPropertyValue("--_menu-bottom")===d.bottom?s:parseFloat(d.bottom),g=n.height-p-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};yl=new WeakSet;Gc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=j(this,hs);if(i||r.setProperty("--media-menu-transition-in","none"),t){let n=t.offsetHeight,o=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${n}px`),ie(this,gn,ps).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),ie(this,gn,ps).call(this);r.removeProperty("--media-menu-transition-in")};Hc=new WeakSet;Tm=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(j(this,zc,Am))){(e=j(this,mr))==null||e.focus(),this.hidden=!0;return}let t=ie(this,cs,Tl).call(this,i);!t||t.hasAttribute("disabled")||(ie(this,us,Al).call(this,t),this.handleSelect(i))};zc=new WeakSet;Am=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"]'))};$c=new WeakSet;Sm=function(i){if(i.target===this)return;ie(this,Yc,km).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 Ei({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);ie(this,yl,Gc).call(this,!0)};Yc=new WeakSet;km=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Vc=new WeakSet;Lm=function(i){var e;xe(this,i.relatedTarget)||(j(this,vr)&&((e=j(this,mr))==null||e.focus()),j(this,gi)&&j(this,gi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Bc=new WeakSet;wm=function(i){var e,t,r,n,o;let{key:s,ctrlKey:l,altKey:d,metaKey:h}=i;if(!(l||d||h)&&this.keysUsed.includes(s))if(i.preventDefault(),i.stopPropagation(),s==="Tab"){if(j(this,vr)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(n=(r=this.nextElementSibling)==null?void 0:r.focus)==null||n.call(r),this.blur()}else s==="Escape"?((o=j(this,mr))==null||o.focus(),j(this,vr)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};cs=new WeakSet;Tl=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Wc=new WeakSet;Im=function(){return this.items.find(i=>i.tabIndex===0)};us=new WeakSet;Al=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};gl=new WeakSet;Fc=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(r=>r.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((r,n)=>r!=t[n])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};ve.shadowRootOptions={mode:"open"};ve.getTemplateHTML=Ng;function Ug(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function ms(i){var e;return(e=i.getAttribute("bounds")?Et(i,`#${i.getAttribute("bounds")}`):ne(i)||i.parentElement)!=null?e:i}u.customElements.get("media-chrome-menu")||u.customElements.define("media-chrome-menu",ve);var eu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Dt=(i,e,t)=>(eu(i,e,"read from private field"),t?t.call(i):e.get(i)),Gt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qc=(i,e,t,r)=>(eu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ht=(i,e,t)=>(eu(i,e,"access private method"),t),Sl,fs,Zc,Cm,Ll,tu,iu,Rm,Ot,bn,Es,Xc,Mm,kl,jc;function Hg(i){return`
1813
1813
  <style>
1814
1814
  :host {
1815
1815
  transition: var(--media-menu-item-transition,
@@ -1927,8 +1927,8 @@ bp-player[has-error] {
1927
1927
  ${this.getSuffixSlotInnerHTML(i)}
1928
1928
  </slot>
1929
1929
  <slot name="submenu"></slot>
1930
- `}function Ng(i){return""}var je={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ke=class extends u.HTMLElement{constructor(){if(super(),qt(this,zc),qt(this,Al),qt(this,Jc),qt(this,fn),qt(this,Yc),qt(this,Tl),qt(this,yl,!1),qt(this,ms,void 0),qt(this,xt,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),n=(e=this.submenuElement.checkedItems)==null?void 0:e[0],o=(t=n==null?void 0:n.dataset.description)!=null?t:n==null?void 0:n.text,s=se.createElement("span");s.textContent=o??"",r.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=oe(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[je.TYPE,je.DISABLED,je.CHECKED,je.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),ps(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":ct(this,zc,Lm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":ct(this,Yc,Im).call(this,e);break;case"keyup":ct(this,fn,vs).call(this,e);break}}attributeChangedCallback(e,t,r){e===je.CHECKED&&ps(this)&&!Mt(this,yl)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===je.TYPE&&r!==t?this.role="menuitem"+r:e===je.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(je.DISABLED)||this.enable(),this.role="menuitem"+this.type,Gc(this,ms,Zc(this,this.parentNode)),ct(this,Tl,Qc).call(this),this.submenuElement&&ct(this,Al,jc).call(this)}disconnectedCallback(){this.disable(),ct(this,Tl,Qc).call(this),Gc(this,ms,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=zi(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(je.TYPE))!=null?e:""}set type(e){this.setAttribute(je.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(je.VALUE))!=null?e:this.text}set value(e){this.setAttribute(je.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(ps(this))return this.getAttribute("aria-checked")==="true"}set checked(e){ps(this)&&(Gc(this,yl,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){ps(this)||this.invokeTargetElement&&Me(this,e.target)&&this.invokeTargetElement.dispatchEvent(new vi({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};yl=new WeakMap;ms=new WeakMap;zc=new WeakSet;Lm=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?ct(this,Al,jc).call(this):ct(this,Jc,wm).call(this))};Al=new WeakSet;jc=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",Mt(this,xt)),this.submenuElement.addEventListener("addmenuitem",Mt(this,xt)),this.submenuElement.addEventListener("removemenuitem",Mt(this,xt)),Mt(this,xt).call(this)};Jc=new WeakSet;wm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Mt(this,xt)),this.submenuElement.removeEventListener("addmenuitem",Mt(this,xt)),this.submenuElement.removeEventListener("removemenuitem",Mt(this,xt)),Mt(this,xt).call(this)};xt=new WeakMap;fn=new WeakSet;vs=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",ct(this,fn,vs));return}this.handleClick(i)};Yc=new WeakSet;Im=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",ct(this,fn,vs));return}this.addEventListener("keyup",ct(this,fn,vs),{once:!0})};Tl=new WeakSet;Qc=function(){var i;let e=(i=Mt(this,ms))==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")};Ke.shadowRootOptions={mode:"open"};Ke.getTemplateHTML=Og;Ke.getSuffixSlotInnerHTML=Ng;function ps(i){return i.type==="radio"||i.type==="checkbox"}function Zc(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Zc(i,t):e!=null&&e.items?e:Zc(e,e==null?void 0:e.parentNode)}u.customElements.get("media-chrome-menu-item")||u.customElements.define("media-chrome-menu-item",Ke);function Ug(i){return`
1931
- ${me.getTemplateHTML(i)}
1930
+ `}function $g(i){return""}var tt={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},ze=class extends u.HTMLElement{constructor(){if(super(),Gt(this,Zc),Gt(this,Ll),Gt(this,iu),Gt(this,bn),Gt(this,Xc),Gt(this,kl),Gt(this,Sl,!1),Gt(this,fs,void 0),Gt(this,Ot,()=>{var e,t;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let r=this.shadowRoot.querySelector('slot[name="description"]'),n=(e=this.submenuElement.checkedItems)==null?void 0:e[0],o=(t=n==null?void 0:n.dataset.description)!=null?t:n==null?void 0:n.text,s=le.createElement("span");s.textContent=o??"",r.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[tt.TYPE,tt.DISABLED,tt.CHECKED,tt.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),vs(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":ht(this,Zc,Cm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":ht(this,Xc,Mm).call(this,e);break;case"keyup":ht(this,bn,Es).call(this,e);break}}attributeChangedCallback(e,t,r){e===tt.CHECKED&&vs(this)&&!Dt(this,Sl)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===tt.TYPE&&r!==t?this.role="menuitem"+r:e===tt.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(tt.DISABLED)||this.enable(),this.role="menuitem"+this.type,Qc(this,fs,Jc(this,this.parentNode)),ht(this,kl,jc).call(this),this.submenuElement&&ht(this,Ll,tu).call(this)}disconnectedCallback(){this.disable(),ht(this,kl,jc).call(this),Qc(this,fs,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Zi(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(tt.TYPE))!=null?e:""}set type(e){this.setAttribute(tt.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(tt.VALUE))!=null?e:this.text}set value(e){this.setAttribute(tt.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(vs(this))return this.getAttribute("aria-checked")==="true"}set checked(e){vs(this)&&(Qc(this,Sl,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){vs(this)||this.invokeTargetElement&&xe(this,e.target)&&this.invokeTargetElement.dispatchEvent(new Ei({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};Sl=new WeakMap;fs=new WeakMap;Zc=new WeakSet;Cm=function(i){let e=i.target;if(!(e!=null&&e.name))for(let r of e.assignedNodes({flatten:!0}))r instanceof Text&&r.textContent.trim()===""&&r.remove();e.name==="submenu"&&(this.submenuElement?ht(this,Ll,tu).call(this):ht(this,iu,Rm).call(this))};Ll=new WeakSet;tu=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",Dt(this,Ot)),this.submenuElement.addEventListener("addmenuitem",Dt(this,Ot)),this.submenuElement.addEventListener("removemenuitem",Dt(this,Ot)),Dt(this,Ot).call(this)};iu=new WeakSet;Rm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Dt(this,Ot)),this.submenuElement.removeEventListener("addmenuitem",Dt(this,Ot)),this.submenuElement.removeEventListener("removemenuitem",Dt(this,Ot)),Dt(this,Ot).call(this)};Ot=new WeakMap;bn=new WeakSet;Es=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",ht(this,bn,Es));return}this.handleClick(i)};Xc=new WeakSet;Mm=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",ht(this,bn,Es));return}this.addEventListener("keyup",ht(this,bn,Es),{once:!0})};kl=new WeakSet;jc=function(){var i;let e=(i=Dt(this,fs))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(r=>r.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let r of e)r.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};ze.shadowRootOptions={mode:"open"};ze.getTemplateHTML=Hg;ze.getSuffixSlotInnerHTML=$g;function vs(i){return i.type==="radio"||i.type==="checkbox"}function Jc(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Jc(i,t):e!=null&&e.items?e:Jc(e,e==null?void 0:e.parentNode)}u.customElements.get("media-chrome-menu-item")||u.customElements.define("media-chrome-menu-item",ze);function Vg(i){return`
1931
+ ${ve.getTemplateHTML(i)}
1932
1932
  <style>
1933
1933
  :host {
1934
1934
  --_menu-bg: rgb(20 20 30 / .8);
@@ -1962,8 +1962,8 @@ bp-player[has-error] {
1962
1962
  --media-settings-menu-item-opacity: 0;
1963
1963
  }
1964
1964
  </style>
1965
- `}var fs=class extends me{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:re(this).querySelector("media-settings-menu-button")}};fs.getTemplateHTML=Ug;u.customElements.get("media-settings-menu")||u.customElements.define("media-settings-menu",fs);function Hg(i){return`
1966
- ${Ke.getTemplateHTML.call(this,i)}
1965
+ `}var gs=class extends ve{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-settings-menu-button")}};gs.getTemplateHTML=Vg;u.customElements.get("media-settings-menu")||u.customElements.define("media-settings-menu",gs);function Bg(i){return`
1966
+ ${ze.getTemplateHTML.call(this,i)}
1967
1967
  <style>
1968
1968
  slot:not([name="submenu"]) {
1969
1969
  opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
@@ -1973,11 +1973,11 @@ bp-player[has-error] {
1973
1973
  background: transparent;
1974
1974
  }
1975
1975
  </style>
1976
- `}function $g(i){return`
1976
+ `}function Wg(i){return`
1977
1977
  <svg aria-hidden="true" viewBox="0 0 20 24">
1978
1978
  <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"/>
1979
1979
  </svg>
1980
- `}var pr=class extends Ke{};pr.shadowRootOptions={mode:"open"};pr.getTemplateHTML=Hg;pr.getSuffixSlotInnerHTML=$g;u.customElements.get("media-settings-menu-item")||u.customElements.define("media-settings-menu-item",pr);var $e=class extends Z{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=zi(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new vi({relatedTarget:this}))}};u.customElements.get("media-chrome-menu-button")||u.customElements.define("media-chrome-menu-button",$e);function Vg(){return`
1980
+ `}var fr=class extends ze{};fr.shadowRootOptions={mode:"open"};fr.getTemplateHTML=Bg;fr.getSuffixSlotInnerHTML=Wg;u.customElements.get("media-settings-menu-item")||u.customElements.define("media-settings-menu-item",fr);var Be=class extends X{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=Zi(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new Ei({relatedTarget:this}))}};u.customElements.get("media-chrome-menu-button")||u.customElements.define("media-chrome-menu-button",Be);function Fg(){return`
1981
1981
  <style>
1982
1982
  :host([aria-expanded="true"]) slot[name=tooltip] {
1983
1983
  display: none;
@@ -1988,27 +1988,27 @@ bp-player[has-error] {
1988
1988
  <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"/>
1989
1989
  </svg>
1990
1990
  </slot>
1991
- `}function Bg(){return b("Settings")}var En=class extends $e{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",b("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:re(this).querySelector("media-settings-menu")}};En.getSlotTemplateHTML=Vg;En.getTooltipContentHTML=Bg;u.customElements.get("media-settings-menu-button")||u.customElements.define("media-settings-menu-button",En);var ru=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Cm=(i,e,t)=>(ru(i,e,"read from private field"),t?t.call(i):e.get(i)),Sl=(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)},eu=(i,e,t,r)=>(ru(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),kl=(i,e,t)=>(ru(i,e,"access private method"),t),Es,Il,Ll,tu,wl,iu,Cl=class extends me{constructor(){super(...arguments),Sl(this,Ll),Sl(this,wl),Sl(this,Es,[]),Sl(this,Il,void 0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===a.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(eu(this,Es,xh(r??"")),kl(this,Ll,tu).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",kl(this,wl,iu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",kl(this,wl,iu))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=re(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Cm(this,Es)}set mediaAudioTrackList(e){eu(this,Es,e),kl(this,Ll,tu).call(this)}get mediaAudioTrackEnabled(){var e;return(e=O(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){N(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};Es=new WeakMap;Il=new WeakMap;Ll=new WeakSet;tu=function(){if(Cm(this,Il)===JSON.stringify(this.mediaAudioTrackList))return;eu(this,Il,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=Rt({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(dt(this,"checked-indicator")),this.defaultSlot.append(r)}};wl=new WeakSet;iu=function(){if(this.value==null)return;let i=new u.CustomEvent(y.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-audio-track-menu")||u.customElements.define("media-audio-track-menu",Cl);var Wg=`<svg aria-hidden="true" viewBox="0 0 24 24">
1991
+ `}function Kg(){return b("Settings")}var _n=class extends Be{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",b("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ne(this).querySelector("media-settings-menu")}};_n.getSlotTemplateHTML=Fg;_n.getTooltipContentHTML=Kg;u.customElements.get("media-settings-menu-button")||u.customElements.define("media-settings-menu-button",_n);var su=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},xm=(i,e,t)=>(su(i,e,"read from private field"),t?t.call(i):e.get(i)),wl=(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)},ru=(i,e,t,r)=>(su(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Il=(i,e,t)=>(su(i,e,"access private method"),t),bs,Ml,Cl,nu,Rl,ou,xl=class extends ve{constructor(){super(...arguments),wl(this,Cl),wl(this,Rl),wl(this,bs,[]),wl(this,Ml,void 0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_AUDIO_TRACK_ENABLED&&t!==r?this.value=r:e===a.MEDIA_AUDIO_TRACK_LIST&&t!==r&&(ru(this,bs,Oh(r??"")),Il(this,Cl,nu).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Il(this,Rl,ou))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Il(this,Rl,ou))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=ne(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return xm(this,bs)}set mediaAudioTrackList(e){ru(this,bs,e),Il(this,Cl,nu).call(this)}get mediaAudioTrackEnabled(){var e;return(e=O(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){N(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};bs=new WeakMap;Ml=new WeakMap;Cl=new WeakSet;nu=function(){if(xm(this,Ml)===JSON.stringify(this.mediaAudioTrackList))return;ru(this,Ml,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=Pt({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(r)}};Rl=new WeakSet;ou=function(){if(this.value==null)return;let i=new u.CustomEvent(_.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-audio-track-menu")||u.customElements.define("media-audio-track-menu",xl);var qg=`<svg aria-hidden="true" viewBox="0 0 24 24">
1992
1992
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
1993
1993
  <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"/>
1994
- </svg>`;function Fg(){return`
1994
+ </svg>`;function Gg(){return`
1995
1995
  <style>
1996
1996
  :host([aria-expanded="true"]) slot[name=tooltip] {
1997
1997
  display: none;
1998
1998
  }
1999
1999
  </style>
2000
- <slot name="icon">${Wg}</slot>
2001
- `}function qg(){return b("Audio")}var Rm=i=>{let e=b("Audio");i.setAttribute("aria-label",e)},gn=class extends $e{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Rm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LANG&&Rm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=re(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=O(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){N(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};gn.getSlotTemplateHTML=Fg;gn.getTooltipContentHTML=qg;u.customElements.get("media-audio-track-menu-button")||u.customElements.define("media-audio-track-menu-button",gn);var au=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Kg=(i,e,t)=>(au(i,e,"read from private field"),t?t.call(i):e.get(i)),nu=(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)},Gg=(i,e,t,r)=>(au(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Rl=(i,e,t)=>(au(i,e,"access private method"),t),Pl,Ml,ou,xl,su,zg=`
2000
+ <slot name="icon">${qg}</slot>
2001
+ `}function zg(){return b("Audio")}var Pm=i=>{let e=b("Audio");i.setAttribute("aria-label",e)},yn=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Pm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LANG&&Pm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=ne(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=O(this,a.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){N(this,a.MEDIA_AUDIO_TRACK_ENABLED,e)}};yn.getSlotTemplateHTML=Gg;yn.getTooltipContentHTML=zg;u.customElements.get("media-audio-track-menu-button")||u.customElements.define("media-audio-track-menu-button",yn);var cu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yg=(i,e,t)=>(cu(i,e,"read from private field"),t?t.call(i):e.get(i)),au=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qg=(i,e,t,r)=>(cu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Pl=(i,e,t)=>(cu(i,e,"access private method"),t),Nl,Dl,lu,Ol,du,Zg=`
2002
2002
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
2003
2003
  <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"/>
2004
- </svg>`;function Yg(i){return`
2005
- ${me.getTemplateHTML(i)}
2006
- <slot name="captions-indicator" hidden>${zg}</slot>
2007
- `}var gs=class extends me{constructor(){super(...arguments),nu(this,Ml),nu(this,xl),nu(this,Pl,void 0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_LIST&&t!==r?Rl(this,Ml,ou).call(this):e===a.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",Rl(this,Ml,ou).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Rl(this,xl,su))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Rl(this,xl,su))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:re(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Mm(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){xm(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Mm(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){xm(this,a.MEDIA_SUBTITLES_SHOWING,e)}};Pl=new WeakMap;Ml=new WeakSet;ou=function(){var i;let e=Kg(this,Pl)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(a.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;Gg(this,Pl,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,n=Rt({type:"radio",text:this.formatMenuItemText(b("Off")),value:"off",checked:r});n.prepend(dt(this,"checked-indicator")),this.defaultSlot.append(n);let o=this.mediaSubtitlesList;for(let s of o){let l=Rt({type:"radio",text:this.formatMenuItemText(s.label,s),value:ca(s),checked:this.value==ca(s)});l.prepend(dt(this,"checked-indicator")),((i=s.kind)!=null?i:"subs")==="captions"&&l.append(dt(this,"captions-indicator")),this.defaultSlot.append(l)}};xl=new WeakSet;su=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(a.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new u.CustomEvent(y.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new u.CustomEvent(y.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};gs.getTemplateHTML=Yg;var Mm=(i,e)=>{let t=i.getAttribute(e);return t?Xi(t):[]},xm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Wt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-menu")||u.customElements.define("media-captions-menu",gs);var Qg=`<svg aria-hidden="true" viewBox="0 0 26 24">
2004
+ </svg>`;function Xg(i){return`
2005
+ ${ve.getTemplateHTML(i)}
2006
+ <slot name="captions-indicator" hidden>${Zg}</slot>
2007
+ `}var _s=class extends ve{constructor(){super(...arguments),au(this,Dl),au(this,Ol),au(this,Nl,void 0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_LIST&&t!==r?Pl(this,Dl,lu).call(this):e===a.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",Pl(this,Dl,lu).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Pl(this,Ol,du))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Pl(this,Ol,du))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Dm(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Om(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Dm(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Om(this,a.MEDIA_SUBTITLES_SHOWING,e)}};Nl=new WeakMap;Dl=new WeakSet;lu=function(){var i;let e=Yg(this,Nl)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(a.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;Qg(this,Nl,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,n=Pt({type:"radio",text:this.formatMenuItemText(b("Off")),value:"off",checked:r});n.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(n);let o=this.mediaSubtitlesList;for(let s of o){let l=Pt({type:"radio",text:this.formatMenuItemText(s.label,s),value:pa(s),checked:this.value==pa(s)});l.prepend(ut(this,"checked-indicator")),((i=s.kind)!=null?i:"subs")==="captions"&&l.append(ut(this,"captions-indicator")),this.defaultSlot.append(l)}};Ol=new WeakSet;du=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(a.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new u.CustomEvent(_.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new u.CustomEvent(_.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};_s.getTemplateHTML=Xg;var Dm=(i,e)=>{let t=i.getAttribute(e);return t?er(t):[]},Om=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Kt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-menu")||u.customElements.define("media-captions-menu",_s);var jg=`<svg aria-hidden="true" viewBox="0 0 26 24">
2008
2008
  <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"/>
2009
- </svg>`,Zg=`<svg aria-hidden="true" viewBox="0 0 26 24">
2009
+ </svg>`,Jg=`<svg aria-hidden="true" viewBox="0 0 26 24">
2010
2010
  <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"/>
2011
- </svg>`;function Xg(){return`
2011
+ </svg>`;function eb(){return`
2012
2012
  <style>
2013
2013
  :host([data-captions-enabled="true"]) slot[name=off] {
2014
2014
  display: none !important;
@@ -2025,10 +2025,10 @@ bp-player[has-error] {
2025
2025
  </style>
2026
2026
 
2027
2027
  <slot name="icon">
2028
- <slot name="on">${Qg}</slot>
2029
- <slot name="off">${Zg}</slot>
2028
+ <slot name="on">${jg}</slot>
2029
+ <slot name="off">${Jg}</slot>
2030
2030
  </slot>
2031
- `}function jg(){return b("Captions")}var Pm=i=>{i.setAttribute("data-captions-enabled",ua(i).toString())},Dm=i=>{i.setAttribute("aria-label",b("closed captions"))},bn=class extends $e{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING,a.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),Dm(this),Pm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING?Pm(this):e===a.MEDIA_LANG&&Dm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=re(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Om(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Nm(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Om(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Nm(this,a.MEDIA_SUBTITLES_SHOWING,e)}};bn.getSlotTemplateHTML=Xg;bn.getTooltipContentHTML=jg;var Om=(i,e)=>{let t=i.getAttribute(e);return t?Xi(t):[]},Nm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Wt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-menu-button")||u.customElements.define("media-captions-menu-button",bn);var Um=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},yn=(i,e,t)=>(Um(i,e,"read from private field"),t?t.call(i):e.get(i)),lu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},_n=(i,e,t)=>(Um(i,e,"access private method"),t),Ei,Tn,bs,Dl,cu,du={RATES:"rates"},Ol=class extends me{constructor(){super(),lu(this,Tn),lu(this,Dl),lu(this,Ei,new li(this,du.RATES,{defaultValue:mc})),_n(this,Tn,bs).call(this)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,du.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,_n(this,Tn,bs).call(this)):e===du.RATES&&t!=r&&(yn(this,Ei).value=r,_n(this,Tn,bs).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",_n(this,Dl,cu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",_n(this,Dl,cu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:re(this).querySelector("media-playback-rate-menu-button")}get rates(){return yn(this,Ei)}set rates(e){e?Array.isArray(e)?yn(this,Ei).value=e.join(" "):typeof e=="string"&&(yn(this,Ei).value=e):yn(this,Ei).value="",_n(this,Tn,bs).call(this)}get mediaPlaybackRate(){return B(this,a.MEDIA_PLAYBACK_RATE,sr)}set mediaPlaybackRate(e){K(this,a.MEDIA_PLAYBACK_RATE,e)}};Ei=new WeakMap;Tn=new WeakSet;bs=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(yn(this,Ei)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,n)=>r-n);for(let r of t){let n=Rt({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});n.prepend(dt(this,"checked-indicator")),this.defaultSlot.append(n)}};Dl=new WeakSet;cu=function(){if(!this.value)return;let i=new u.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-playback-rate-menu")||u.customElements.define("media-playback-rate-menu",Ol);var Nl=1;function Jg(i){return`
2031
+ `}function tb(){return b("Captions")}var Nm=i=>{i.setAttribute("data-captions-enabled",ma(i).toString())},Um=i=>{i.setAttribute("aria-label",b("closed captions"))},Tn=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING,a.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),Um(this),Nm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING?Nm(this):e===a.MEDIA_LANG&&Um(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=ne(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Hm(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){$m(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Hm(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){$m(this,a.MEDIA_SUBTITLES_SHOWING,e)}};Tn.getSlotTemplateHTML=eb;Tn.getTooltipContentHTML=tb;var Hm=(i,e)=>{let t=i.getAttribute(e);return t?er(t):[]},$m=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Kt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};u.customElements.get("media-captions-menu-button")||u.customElements.define("media-captions-menu-button",Tn);var Vm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Sn=(i,e,t)=>(Vm(i,e,"read from private field"),t?t.call(i):e.get(i)),uu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},An=(i,e,t)=>(Vm(i,e,"access private method"),t),bi,kn,ys,Ul,pu,hu={RATES:"rates"},Hl=class extends ve{constructor(){super(),uu(this,kn),uu(this,Ul),uu(this,bi,new ci(this,hu.RATES,{defaultValue:Ec})),An(this,kn,ys).call(this)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,hu.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,An(this,kn,ys).call(this)):e===hu.RATES&&t!=r&&(Sn(this,bi).value=r,An(this,kn,ys).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",An(this,Ul,pu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",An(this,Ul,pu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-playback-rate-menu-button")}get rates(){return Sn(this,bi)}set rates(e){e?Array.isArray(e)?Sn(this,bi).value=e.join(" "):typeof e=="string"&&(Sn(this,bi).value=e):Sn(this,bi).value="",An(this,kn,ys).call(this)}get mediaPlaybackRate(){return W(this,a.MEDIA_PLAYBACK_RATE,dr)}set mediaPlaybackRate(e){G(this,a.MEDIA_PLAYBACK_RATE,e)}};bi=new WeakMap;kn=new WeakSet;ys=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(Sn(this,bi)).map(r=>Number(r)));i>0&&!e.has(i)&&e.add(i);let t=Array.from(e).sort((r,n)=>r-n);for(let r of t){let n=Pt({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});n.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(n)}};Ul=new WeakSet;pu=function(){if(!this.value)return;let i=new u.CustomEvent(_.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-playback-rate-menu")||u.customElements.define("media-playback-rate-menu",Hl);var $l=1;function ib(i){return`
2032
2032
  <style>
2033
2033
  :host {
2034
2034
  min-width: 5ch;
@@ -2043,18 +2043,18 @@ bp-player[has-error] {
2043
2043
  display: none;
2044
2044
  }
2045
2045
  </style>
2046
- <slot name="icon">${i.mediaplaybackrate||Nl}x</slot>
2047
- `}function eb(){return b("Playback rate")}var An=class extends $e{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Nl}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE){let n=r?+r:Number.NaN,o=Number.isNaN(n)?Nl:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:re(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return B(this,a.MEDIA_PLAYBACK_RATE,Nl)}set mediaPlaybackRate(e){K(this,a.MEDIA_PLAYBACK_RATE,e)}};An.getSlotTemplateHTML=Jg;An.getTooltipContentHTML=eb;u.customElements.get("media-playback-rate-menu-button")||u.customElements.define("media-playback-rate-menu-button",An);var hu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_s=(i,e,t)=>(hu(i,e,"read from private field"),t?t.call(i):e.get(i)),Ul=(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)},Hm=(i,e,t,r)=>(hu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Sn=(i,e,t)=>(hu(i,e,"access private method"),t),ys,Ln,kn,Ts,Hl,uu,$l=class extends me{constructor(){super(...arguments),Ul(this,kn),Ul(this,Hl),Ul(this,ys,[]),Ul(this,Ln,{})}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_LIST,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.MEDIA_HEIGHT]}static formatMenuItemText(e,t){return super.formatMenuItemText(e,t)}static formatRendition(e,{showBitrate:t=!1}={}){let r=`${Math.min(e.width,e.height)}p`;if(t&&e.bitrate){let n=e.bitrate/1e6,o=`${n.toFixed(n<1?1:0)} Mbps`;return`${r} (${o})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,n;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((n=e.bitrate)!=null?n:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",Sn(this,kn,Ts).call(this)):e===a.MEDIA_RENDITION_LIST&&t!==r?(Hm(this,ys,Rh(r)),Sn(this,kn,Ts).call(this)):e===a.MEDIA_HEIGHT&&t!==r&&Sn(this,kn,Ts).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Sn(this,Hl,uu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Sn(this,Hl,uu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:re(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return _s(this,ys)}set mediaRenditionList(e){Hm(this,ys,e),Sn(this,kn,Ts).call(this)}get mediaRenditionSelected(){return O(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){N(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return B(this,a.MEDIA_HEIGHT)}set mediaHeight(e){K(this,a.MEDIA_HEIGHT,e)}compareRendition(e,t){return this.constructor.compareRendition(e,t)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}formatRendition(e,t){return this.constructor.formatRendition(e,t)}showRenditionBitrate(e){return this.mediaRenditionList.some(t=>t!==e&&t.height===e.height&&t.bitrate!==e.bitrate)}};ys=new WeakMap;Ln=new WeakMap;kn=new WeakSet;Ts=function(){if(_s(this,Ln).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&_s(this,Ln).mediaHeight===this.mediaHeight)return;_s(this,Ln).mediaRenditionList=JSON.stringify(this.mediaRenditionList),_s(this,Ln).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(s=>s.id===this.mediaRenditionSelected);for(let s of i)s.selected=s===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let s of i){let l=this.formatRendition(s,{showBitrate:this.showRenditionBitrate(s)}),d=Rt({type:"radio",text:l,value:`${s.id}`,checked:s.selected&&!t});d.prepend(dt(this,"checked-indicator")),this.defaultSlot.append(d)}let r=e&&this.showRenditionBitrate(e),n=t?e?this.formatMenuItemText(`${b("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${b("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(b("Auto")),o=Rt({type:"radio",text:n,value:"auto",checked:t});o.dataset.description=n,o.prepend(dt(this,"checked-indicator")),this.defaultSlot.append(o)};Hl=new WeakSet;uu=function(){if(this.value==null)return;let i=new u.CustomEvent(y.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-rendition-menu")||u.customElements.define("media-rendition-menu",$l);var tb=`<svg aria-hidden="true" viewBox="0 0 24 24">
2046
+ <slot name="icon">${i.mediaplaybackrate||$l}x</slot>
2047
+ `}function rb(){return b("Playback rate")}var Ln=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:$l}x`}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE){let n=r?+r:Number.NaN,o=Number.isNaN(n)?$l:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ne(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return W(this,a.MEDIA_PLAYBACK_RATE,$l)}set mediaPlaybackRate(e){G(this,a.MEDIA_PLAYBACK_RATE,e)}};Ln.getSlotTemplateHTML=ib;Ln.getTooltipContentHTML=rb;u.customElements.get("media-playback-rate-menu-button")||u.customElements.define("media-playback-rate-menu-button",Ln);var vu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ts=(i,e,t)=>(vu(i,e,"read from private field"),t?t.call(i):e.get(i)),Vl=(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)},Bm=(i,e,t,r)=>(vu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),wn=(i,e,t)=>(vu(i,e,"access private method"),t),As,Cn,In,Ss,Bl,mu,Wl=class extends ve{constructor(){super(...arguments),Vl(this,In),Vl(this,Bl),Vl(this,As,[]),Vl(this,Cn,{})}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_LIST,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.MEDIA_HEIGHT]}static formatMenuItemText(e,t){return super.formatMenuItemText(e,t)}static formatRendition(e,{showBitrate:t=!1}={}){let r=`${Math.min(e.width,e.height)}p`;if(t&&e.bitrate){let n=e.bitrate/1e6,o=`${n.toFixed(n<1?1:0)} Mbps`;return`${r} (${o})`}return this.formatMenuItemText(r,e)}static compareRendition(e,t){var r,n;return t.height===e.height?((r=t.bitrate)!=null?r:0)-((n=e.bitrate)!=null?n:0):t.height-e.height}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_RENDITION_SELECTED&&t!==r?(this.value=r??"auto",wn(this,In,Ss).call(this)):e===a.MEDIA_RENDITION_LIST&&t!==r?(Bm(this,As,Ph(r)),wn(this,In,Ss).call(this)):e===a.MEDIA_HEIGHT&&t!==r&&wn(this,In,Ss).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",wn(this,Bl,mu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",wn(this,Bl,mu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:ne(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return Ts(this,As)}set mediaRenditionList(e){Bm(this,As,e),wn(this,In,Ss).call(this)}get mediaRenditionSelected(){return O(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){N(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return W(this,a.MEDIA_HEIGHT)}set mediaHeight(e){G(this,a.MEDIA_HEIGHT,e)}compareRendition(e,t){return this.constructor.compareRendition(e,t)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}formatRendition(e,t){return this.constructor.formatRendition(e,t)}showRenditionBitrate(e){return this.mediaRenditionList.some(t=>t!==e&&t.height===e.height&&t.bitrate!==e.bitrate)}};As=new WeakMap;Cn=new WeakMap;In=new WeakSet;Ss=function(){if(Ts(this,Cn).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&Ts(this,Cn).mediaHeight===this.mediaHeight)return;Ts(this,Cn).mediaRenditionList=JSON.stringify(this.mediaRenditionList),Ts(this,Cn).mediaHeight=this.mediaHeight;let i=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=i.find(s=>s.id===this.mediaRenditionSelected);for(let s of i)s.selected=s===e;this.defaultSlot.textContent="";let t=!this.mediaRenditionSelected;for(let s of i){let l=this.formatRendition(s,{showBitrate:this.showRenditionBitrate(s)}),d=Pt({type:"radio",text:l,value:`${s.id}`,checked:s.selected&&!t});d.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(d)}let r=e&&this.showRenditionBitrate(e),n=t?e?this.formatMenuItemText(`${b("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:r})}`,e):this.formatMenuItemText(`${b("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(b("Auto")),o=Pt({type:"radio",text:n,value:"auto",checked:t});o.dataset.description=n,o.prepend(ut(this,"checked-indicator")),this.defaultSlot.append(o)};Bl=new WeakSet;mu=function(){if(this.value==null)return;let i=new u.CustomEvent(_.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};u.customElements.get("media-rendition-menu")||u.customElements.define("media-rendition-menu",Wl);var nb=`<svg aria-hidden="true" viewBox="0 0 24 24">
2048
2048
  <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" />
2049
- </svg>`;function ib(){return`
2049
+ </svg>`;function ob(){return`
2050
2050
  <style>
2051
2051
  :host([aria-expanded="true"]) slot[name=tooltip] {
2052
2052
  display: none;
2053
2053
  }
2054
2054
  </style>
2055
- <slot name="icon">${tb}</slot>
2056
- `}function rb(){return b("Quality")}var wn=class extends $e{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",b("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:re(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return O(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){N(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return B(this,a.MEDIA_HEIGHT)}set mediaHeight(e){K(this,a.MEDIA_HEIGHT,e)}};wn.getSlotTemplateHTML=ib;wn.getTooltipContentHTML=rb;u.customElements.get("media-rendition-menu-button")||u.customElements.define("media-rendition-menu-button",wn);var vu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Dt=(i,e,t)=>(vu(i,e,"read from private field"),t?t.call(i):e.get(i)),Pt=(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)},$m=(i,e,t,r)=>(vu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Je=(i,e,t)=>(vu(i,e,"access private method"),t),Cn,As,Kl,mr,In,fu,Vm,Vl,pu,Bl,mu,Bm,Fl,ql,Wl;function nb(i){return`
2057
- ${me.getTemplateHTML(i)}
2055
+ <slot name="icon">${nb}</slot>
2056
+ `}function sb(){return b("Quality")}var Rn=class extends Be{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_RENDITION_SELECTED,a.MEDIA_RENDITION_UNAVAILABLE,a.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",b("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:ne(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return O(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){N(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return W(this,a.MEDIA_HEIGHT)}set mediaHeight(e){G(this,a.MEDIA_HEIGHT,e)}};Rn.getSlotTemplateHTML=ob;Rn.getTooltipContentHTML=sb;u.customElements.get("media-rendition-menu-button")||u.customElements.define("media-rendition-menu-button",Rn);var gu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ut=(i,e,t)=>(gu(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)},Wm=(i,e,t,r)=>(gu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),it=(i,e,t)=>(gu(i,e,"access private method"),t),xn,ks,Yl,Er,Mn,bu,Fm,Fl,fu,Kl,Eu,Km,Gl,zl,ql;function ab(i){return`
2057
+ ${ve.getTemplateHTML(i)}
2058
2058
  <style>
2059
2059
  :host {
2060
2060
  --_menu-bg: rgb(20 20 30 / .8);
@@ -2067,8 +2067,8 @@ bp-player[has-error] {
2067
2067
  overflow: hidden;
2068
2068
  }
2069
2069
  </style>
2070
- `}var Ss=class extends me{constructor(){super(),Pt(this,As),Pt(this,mr),Pt(this,fu),Pt(this,Vl),Pt(this,mu),Pt(this,Cn,!1),Pt(this,Bl,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",n=Je(this,Vl,pu).call(this,t);(r||n)&&(Dt(this,Cn)?Je(this,mr,In).call(this):Je(this,mu,Bm).call(this,e))}),Pt(this,Fl,e=>{let t=e.target,r=this.contains(t),n=e.button===2,o=(t==null?void 0:t.nodeName)==="VIDEO",s=Je(this,Vl,pu).call(this,t);r||n&&(o||s)||Je(this,mr,In).call(this)}),Pt(this,ql,e=>{e.key==="Escape"&&Je(this,mr,In).call(this)}),Pt(this,Wl,e=>{var t,r;let n=e.target;if((t=n.matches)!=null&&t.call(n,'button[invoke="copy"]')){let o=(r=n.closest("media-context-menu-item"))==null?void 0:r.querySelector('input[slot="copy"]');o&&navigator.clipboard.writeText(o.value)}Je(this,mr,In).call(this)}),this.setAttribute("noautohide",""),Je(this,As,Kl).call(this)}connectedCallback(){super.connectedCallback(),re(this).addEventListener("contextmenu",Dt(this,Bl)),this.addEventListener("click",Dt(this,Wl))}disconnectedCallback(){super.disconnectedCallback(),re(this).removeEventListener("contextmenu",Dt(this,Bl)),this.removeEventListener("click",Dt(this,Wl)),document.removeEventListener("mousedown",Dt(this,Fl)),document.removeEventListener("keydown",Dt(this,ql))}};Cn=new WeakMap;As=new WeakSet;Kl=function(){this.hidden=!Dt(this,Cn)};mr=new WeakSet;In=function(){$m(this,Cn,!1),Je(this,As,Kl).call(this)};fu=new WeakSet;Vm=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&Je(t=e,mr,In).call(t)})};Vl=new WeakSet;pu=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};Bl=new WeakMap;mu=new WeakSet;Bm=function(i){i.preventDefault(),Je(this,fu,Vm).call(this),$m(this,Cn,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,Je(this,As,Kl).call(this),document.addEventListener("mousedown",Dt(this,Fl),{once:!0}),document.addEventListener("keydown",Dt(this,ql),{once:!0})};Fl=new WeakMap;ql=new WeakMap;Wl=new WeakMap;Ss.getTemplateHTML=nb;u.customElements.get("media-context-menu")||u.customElements.define("media-context-menu",Ss);function ob(i){return`
2071
- ${Ke.getTemplateHTML.call(this,i)}
2070
+ `}var Ls=class extends ve{constructor(){super(),Nt(this,ks),Nt(this,Er),Nt(this,bu),Nt(this,Fl),Nt(this,Eu),Nt(this,xn,!1),Nt(this,Kl,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",n=it(this,Fl,fu).call(this,t);(r||n)&&(Ut(this,xn)?it(this,Er,Mn).call(this):it(this,Eu,Km).call(this,e))}),Nt(this,Gl,e=>{let t=e.target,r=this.contains(t),n=e.button===2,o=(t==null?void 0:t.nodeName)==="VIDEO",s=it(this,Fl,fu).call(this,t);r||n&&(o||s)||it(this,Er,Mn).call(this)}),Nt(this,zl,e=>{e.key==="Escape"&&it(this,Er,Mn).call(this)}),Nt(this,ql,e=>{var t,r;let n=e.target;if((t=n.matches)!=null&&t.call(n,'button[invoke="copy"]')){let o=(r=n.closest("media-context-menu-item"))==null?void 0:r.querySelector('input[slot="copy"]');o&&navigator.clipboard.writeText(o.value)}it(this,Er,Mn).call(this)}),this.setAttribute("noautohide",""),it(this,ks,Yl).call(this)}connectedCallback(){super.connectedCallback(),ne(this).addEventListener("contextmenu",Ut(this,Kl)),this.addEventListener("click",Ut(this,ql))}disconnectedCallback(){super.disconnectedCallback(),ne(this).removeEventListener("contextmenu",Ut(this,Kl)),this.removeEventListener("click",Ut(this,ql)),document.removeEventListener("mousedown",Ut(this,Gl)),document.removeEventListener("keydown",Ut(this,zl))}};xn=new WeakMap;ks=new WeakSet;Yl=function(){this.hidden=!Ut(this,xn)};Er=new WeakSet;Mn=function(){Wm(this,xn,!1),it(this,ks,Yl).call(this)};bu=new WeakSet;Fm=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&it(t=e,Er,Mn).call(t)})};Fl=new WeakSet;fu=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};Kl=new WeakMap;Eu=new WeakSet;Km=function(i){i.preventDefault(),it(this,bu,Fm).call(this),Wm(this,xn,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,it(this,ks,Yl).call(this),document.addEventListener("mousedown",Ut(this,Gl),{once:!0}),document.addEventListener("keydown",Ut(this,zl),{once:!0})};Gl=new WeakMap;zl=new WeakMap;ql=new WeakMap;Ls.getTemplateHTML=ab;u.customElements.get("media-context-menu")||u.customElements.define("media-context-menu",Ls);function lb(i){return`
2071
+ ${ze.getTemplateHTML.call(this,i)}
2072
2072
  <style>
2073
2073
  ::slotted(*) {
2074
2074
  color: var(--media-text-color, white);
@@ -2080,16 +2080,16 @@ bp-player[has-error] {
2080
2080
  min-height: var(--media-control-height, 24px);
2081
2081
  }
2082
2082
  </style>
2083
- `}var Rn=class extends Ke{};Rn.shadowRootOptions={mode:"open"};Rn.getTemplateHTML=ob;u.customElements.get("media-context-menu-item")||u.customElements.define("media-context-menu-item",Rn);var sb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2083
+ `}var Pn=class extends ze{};Pn.shadowRootOptions={mode:"open"};Pn.getTemplateHTML=lb;u.customElements.get("media-context-menu-item")||u.customElements.define("media-context-menu-item",Pn);var db=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2084
2084
  <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"/>
2085
- </svg>`,ab=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2085
+ </svg>`,cb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2086
2086
  <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"/>
2087
- </svg>`,lb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2087
+ </svg>`,ub=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2088
2088
  <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"/>
2089
2089
  <line x1="2" y1="2" x2="22" y2="22" stroke="currentColor" stroke-width="2"/>
2090
- </svg>`,db=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2090
+ </svg>`,hb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2091
2091
  <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"/>
2092
- </svg>`;function cb(i){switch(i){case"offline":return ab;case"network":return lb;case"security":return db;default:return sb}}function ub(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 Kt=class extends De{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=cb(t),n=ub(t);return Ye`
2092
+ </svg>`;function pb(i){switch(i){case"offline":return cb;case"network":return ub;case"security":return hb;default:return db}}function mb(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 zt=class extends Oe{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=pb(t),n=mb(t);return Ze`
2093
2093
  <div part="icon">
2094
2094
  <slot name="icon">${this.renderIcon(r)}</slot>
2095
2095
  </div>
@@ -2099,7 +2099,7 @@ bp-player[has-error] {
2099
2099
  <p part="message">
2100
2100
  <slot name="message">${this.error.message}</slot>
2101
2101
  </p>
2102
- ${this.showCode?Ye`
2102
+ ${this.showCode?Ze`
2103
2103
  <span part="code">
2104
2104
  <slot name="code">Error ${this.error.code}</slot>
2105
2105
  </span>
@@ -2107,7 +2107,7 @@ bp-player[has-error] {
2107
2107
  <div part="actions">
2108
2108
  <slot name="actions"></slot>
2109
2109
  </div>
2110
- `}renderIcon(t){let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Kt.styles=jn`
2110
+ `}renderIcon(t){let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};zt.styles=eo`
2111
2111
  :host {
2112
2112
  display: flex;
2113
2113
  flex-direction: column;
@@ -2168,7 +2168,7 @@ bp-player[has-error] {
2168
2168
  [part="actions"] button {
2169
2169
  cursor: pointer;
2170
2170
  }
2171
- `,V([Q({type:Object})],Kt.prototype,"error",2),V([Q({type:Boolean})],Kt.prototype,"showCode",2),Kt=V([ti("bp-error-display")],Kt);var Wm=`/**
2171
+ `,V([Z({type:Object})],zt.prototype,"error",2),V([Z({type:Boolean})],zt.prototype,"showCode",2),zt=V([ri("bp-error-display")],zt);var qm=`/**
2172
2172
  * BP Default UI Styles
2173
2173
  *
2174
2174
  * Layer-based architecture.
@@ -2689,7 +2689,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2689
2689
  outline: 2px solid rgba(0, 255, 0, 1) !important;
2690
2690
  background: rgba(0, 255, 0, 0.3) !important;
2691
2691
  }
2692
- `;var Fm=!1;function pb(){if(Fm||(Fm=!0,document.getElementById("bp-default-ui-styles")))return;Pr();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=Wm,document.head.appendChild(i)}var ae=class extends De{constructor(){super(...arguments);this.autoplay=!1;this.muted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this.autohide=2;this.hotkeys=!0;this.mobile=!1;this.live=!1;this.fluid=!1;this._player=null;this._providerType=null;this._error=null;this._connectionState="idle";this._showEndedOverlay=!1;this._cleanupListeners=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),pb(),this.detectMobile()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupListeners.forEach(t=>t()),this._cleanupListeners=[]}get player(){return this._player}get mediaController(){return this.querySelector("media-controller")}get bpLive(){var t;return((t=this._player)==null?void 0:t.bpLive)??null}detectMobile(){let t=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.mobile=t}_getPoster(){var t;return((t=this.source)==null?void 0:t.poster)??this.poster??null}firstUpdated(t){super.firstUpdated(t),this.setupPlayer(),this._moveSlottedContent()}willUpdate(t){super.willUpdate(t),t.has("source")&&(this._applySourceHints(),this._error=null,this._showEndedOverlay=!1,ge(this,"has-error",!1))}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug)}_applySourceHints(){var r;let t=(r=this.source)==null?void 0:r.sources;if(t){for(let n of t)if(Vs(n)){if("clipId"in n){if(this.setAttribute("content-type","clip"),this.fluid&&n.preferredOrientation){let o=n.preferredOrientation==="portrait";this.style.setProperty("--bp-video-width",o?"9":"16"),this.style.setProperty("--bp-video-height",o?"16":"9")}}else this.setAttribute("content-type","stream");return}this.setAttribute("content-type","video")}}_updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r))):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"))}_clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}_moveSlottedContent(){let t=this.querySelector("media-controller");if(!t)return;let r=[{from:"top-chrome",to:"top-chrome",marker:"has-custom-top-chrome"},{from:"centered-chrome",to:"centered-chrome",marker:"has-custom-centered-chrome"},{from:"middle-chrome",to:"middle-chrome",marker:"has-custom-middle-chrome"},{from:"bottom-chrome",to:null,marker:"has-custom-bottom-chrome"}];for(let{from:n,to:o,marker:s}of r){let l=this.querySelectorAll(`:scope > [slot="${n}"]`);l.length>0&&this.setAttribute(s,""),l.forEach(d=>{d.parentElement!==t&&(o?d.setAttribute("slot",o):d.removeAttribute("slot"),t.appendChild(d))})}}setupPlayer(){let t=this.querySelector("bp-player");if(!t)return;let r=n=>{n.stopPropagation(),this._player=n.detail,this.setupPlayerListeners(),this.dispatchEvent(Fi(_o,{detail:this._player})),this.requestUpdate()};t.addEventListener("ready",r),this._cleanupListeners.push(()=>t.removeEventListener("ready",r))}setupPlayerListeners(){if(!this._player)return;let t=()=>{var E;let p=((E=this._player)==null?void 0:E.state.error)??null;this._error=p;let f=p!==null&&p.fatal&&p.category!=="offline";ge(this,"has-error",f)},r=()=>{var f;let p=(f=this._player)==null?void 0:f.state;if(p&&(this._connectionState=p.connectionState,this._providerType=p.providerType,this.live=p.streamType==="live",this.setAttribute("content-type",p.contentType),this.setAttribute("stream-type",p.streamType),ge(this,"paused",p.paused),ge(this,"ended",p.ended),ge(this,"waiting",p.waiting),p.error!==this._error)){this._error=p.error;let E=p.error!==null&&p.error.fatal&&p.error.category!=="offline";ge(this,"has-error",E)}},n=()=>{this._error=null,this._showEndedOverlay=!1,ge(this,"has-error",!1)},o=()=>{this.live&&(this._showEndedOverlay=!0)},s=()=>{this._error=null,this._showEndedOverlay=!1,ge(this,"has-error",!1)},l=p=>{this.debug&&console.log("[BPDefaultUI] updateVideoDimensions called",{fluid:this.fluid,...p}),this.fluid&&(this._updateVideoDimensions(p.videoWidth,p.videoHeight),this.debug&&console.log("[BPDefaultUI] Set video dimensions:",{width:p.videoWidth,height:p.videoHeight}))};this._player.addEventListener("error",t),this._player.addEventListener("statechange",r),this._player.addEventListener("playing",n),this._player.addEventListener("ended",o),this._player.addEventListener("sourcechange",s),this._player.addEventListener("resize",l),this._player.addEventListener("loadedmetadata",l);let{videoWidth:d,videoHeight:h}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:d,videoHeight:h,fluid:this.fluid}),d>0&&h>0&&l({videoWidth:d,videoHeight:h}),this._cleanupListeners.push(()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("error",t)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("statechange",r)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("playing",n)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("ended",o)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("sourcechange",s)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("resize",l)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?Ye`
2692
+ `;var Gm=!1;function fb(){if(Gm||(Gm=!0,document.getElementById("bp-default-ui-styles")))return;Nr();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=qm,document.head.appendChild(i)}var de=class extends Oe{constructor(){super(...arguments);this.autoplay=!1;this.muted=!1;this.loop=!1;this.scaling="letterbox";this.debug=!1;this.autohide=2;this.hotkeys=!0;this.mobile=!1;this.live=!1;this.fluid=!1;this._player=null;this._providerType=null;this._error=null;this._connectionState="idle";this._showEndedOverlay=!1;this._cleanupListeners=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),fb(),this.detectMobile()}disconnectedCallback(){super.disconnectedCallback(),this._cleanupListeners.forEach(t=>t()),this._cleanupListeners=[]}get player(){return this._player}get mediaController(){return this.querySelector("media-controller")}get bpLive(){var t;return((t=this._player)==null?void 0:t.bpLive)??null}detectMobile(){let t=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);this.mobile=t}_getPoster(){var t;return((t=this.source)==null?void 0:t.poster)??this.poster??null}firstUpdated(t){super.firstUpdated(t),this.setupPlayer(),this._moveSlottedContent()}willUpdate(t){super.willUpdate(t),t.has("source")&&(this._applySourceHints(),this._error=null,this._showEndedOverlay=!1,_e(this,"has-error",!1))}updated(t){super.updated(t),this._moveSlottedContent(),t.has("debug")&&this.toggleAttribute("debug-hitboxes",this.debug)}_applySourceHints(){var r;let t=(r=this.source)==null?void 0:r.sources;if(t){for(let n of t)if(Fs(n)){if("clipId"in n){if(this.setAttribute("content-type","clip"),this.fluid&&n.preferredOrientation){let o=n.preferredOrientation==="portrait";this.style.setProperty("--bp-video-width",o?"9":"16"),this.style.setProperty("--bp-video-height",o?"16":"9")}}else this.setAttribute("content-type","stream");return}this.setAttribute("content-type","video")}}_updateVideoDimensions(t,r){t>0&&r>0?(this.style.setProperty("--bp-video-width",String(t)),this.style.setProperty("--bp-video-height",String(r))):(this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height"))}_clearVideoDimensions(){this.style.removeProperty("--bp-video-width"),this.style.removeProperty("--bp-video-height")}_moveSlottedContent(){let t=this.querySelector("media-controller");if(!t)return;let r=[{from:"top-chrome",to:"top-chrome",marker:"has-custom-top-chrome"},{from:"centered-chrome",to:"centered-chrome",marker:"has-custom-centered-chrome"},{from:"middle-chrome",to:"middle-chrome",marker:"has-custom-middle-chrome"},{from:"bottom-chrome",to:null,marker:"has-custom-bottom-chrome"}];for(let{from:n,to:o,marker:s}of r){let l=this.querySelectorAll(`:scope > [slot="${n}"]`);l.length>0&&this.setAttribute(s,""),l.forEach(d=>{d.parentElement!==t&&(o?d.setAttribute("slot",o):d.removeAttribute("slot"),t.appendChild(d))})}}setupPlayer(){let t=this.querySelector("bp-player");if(!t)return;let r=n=>{n.stopPropagation(),this._player=n.detail,this.setupPlayerListeners(),this.dispatchEvent(Gi(To,{detail:this._player})),this.requestUpdate()};t.addEventListener("ready",r),this._cleanupListeners.push(()=>t.removeEventListener("ready",r))}setupPlayerListeners(){if(!this._player)return;let t=()=>{var f;let p=((f=this._player)==null?void 0:f.state.error)??null;this._error=p;let g=p!==null&&p.fatal&&p.category!=="offline";_e(this,"has-error",g)},r=()=>{var g;let p=(g=this._player)==null?void 0:g.state;if(p&&(this._connectionState=p.connectionState,this._providerType=p.providerType,this.live=p.streamType==="live",this.setAttribute("content-type",p.contentType),this.setAttribute("stream-type",p.streamType),_e(this,"paused",p.paused),_e(this,"ended",p.ended),_e(this,"waiting",p.waiting),p.error!==this._error)){this._error=p.error;let f=p.error!==null&&p.error.fatal&&p.error.category!=="offline";_e(this,"has-error",f)}},n=()=>{this._error=null,this._showEndedOverlay=!1,_e(this,"has-error",!1)},o=()=>{this.live&&(this._showEndedOverlay=!0)},s=()=>{this._error=null,this._showEndedOverlay=!1,_e(this,"has-error",!1)},l=p=>{this.debug&&console.log("[BPDefaultUI] updateVideoDimensions called",{fluid:this.fluid,...p}),this.fluid&&(this._updateVideoDimensions(p.videoWidth,p.videoHeight),this.debug&&console.log("[BPDefaultUI] Set video dimensions:",{width:p.videoWidth,height:p.videoHeight}))};this._player.addEventListener("error",t),this._player.addEventListener("statechange",r),this._player.addEventListener("playing",n),this._player.addEventListener("ended",o),this._player.addEventListener("sourcechange",s),this._player.addEventListener("resize",l),this._player.addEventListener("loadedmetadata",l);let{videoWidth:d,videoHeight:h}=this._player.state;this.debug&&console.log("[BPDefaultUI] Initial dimensions check",{videoWidth:d,videoHeight:h,fluid:this.fluid}),d>0&&h>0&&l({videoWidth:d,videoHeight:h}),this._cleanupListeners.push(()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("error",t)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("statechange",r)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("playing",n)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("ended",o)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("sourcechange",s)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("resize",l)},()=>{var p;return(p=this._player)==null?void 0:p.removeEventListener("loadedmetadata",l)})}renderDefaultControls(){return this._providerType==="nano"||this._providerType==="livekit"?Ze`
2693
2693
  <media-control-bar>
2694
2694
  <media-play-button notooltip clip-hidden></media-play-button>
2695
2695
  <media-live-button notooltip vod-hidden clip-hidden></media-live-button>
@@ -2699,7 +2699,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2699
2699
  <media-rendition-menu-button notooltip clip-hidden></media-rendition-menu-button>
2700
2700
  <media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
2701
2701
  </media-control-bar>
2702
- `:Ye`
2702
+ `:Ze`
2703
2703
  <media-control-bar>
2704
2704
  <media-play-button notooltip clip-hidden></media-play-button>
2705
2705
  <media-live-button notooltip vod-hidden clip-hidden></media-live-button>
@@ -2715,7 +2715,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2715
2715
  <media-pip-button notooltip clip-hidden></media-pip-button>
2716
2716
  <media-fullscreen-button notooltip clip-hidden></media-fullscreen-button>
2717
2717
  </media-control-bar>
2718
- `}render(){return Ye`
2718
+ `}render(){return Ze`
2719
2719
  <!-- Chrome Layer: media-controller with all controls -->
2720
2720
  <div class="bp-layer bp-chrome-layer">
2721
2721
  <media-controller autohide="${this.autohide}" ?hotkeys="${this.hotkeys}">
@@ -2731,7 +2731,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2731
2731
  ?debug="${this.debug}"
2732
2732
  ></bp-player>
2733
2733
 
2734
- ${this._getPoster()?Ye`
2734
+ ${this._getPoster()?Ze`
2735
2735
  <media-poster-image slot="poster" src="${this._getPoster()}"></media-poster-image>
2736
2736
  `:null}
2737
2737
 
@@ -2764,19 +2764,19 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2764
2764
  <div class="bp-layer bp-error-layer">
2765
2765
  <bp-error-display .error="${this._error}" ?showCode="${this.debug}"></bp-error-display>
2766
2766
  </div>
2767
- `}};V([Q({converter:Dr()})],ae.prototype,"source",2),V([Q({type:Boolean})],ae.prototype,"autoplay",2),V([Q({type:Boolean})],ae.prototype,"muted",2),V([Q({type:Boolean})],ae.prototype,"loop",2),V([Q({type:String})],ae.prototype,"poster",2),V([Q({type:String})],ae.prototype,"scaling",2),V([Q({type:String,attribute:"aspect-ratio"})],ae.prototype,"aspectRatio",2),V([Q({converter:Dr()})],ae.prototype,"config",2),V([Q({type:Boolean})],ae.prototype,"debug",2),V([Q({type:Number})],ae.prototype,"autohide",2),V([Q({type:Boolean})],ae.prototype,"hotkeys",2),V([Q({type:Boolean,reflect:!0})],ae.prototype,"mobile",2),V([Q({type:Boolean,reflect:!0})],ae.prototype,"live",2),V([Q({type:Boolean,reflect:!0})],ae.prototype,"fluid",2),V([ii()],ae.prototype,"_player",2),V([ii()],ae.prototype,"_providerType",2),V([ii()],ae.prototype,"_error",2),V([ii()],ae.prototype,"_connectionState",2),V([ii()],ae.prototype,"_showEndedOverlay",2),ae=V([ti("bp-default-ui")],ae);var mb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2767
+ `}};V([Z({converter:Ur()})],de.prototype,"source",2),V([Z({type:Boolean})],de.prototype,"autoplay",2),V([Z({type:Boolean})],de.prototype,"muted",2),V([Z({type:Boolean})],de.prototype,"loop",2),V([Z({type:String})],de.prototype,"poster",2),V([Z({type:String})],de.prototype,"scaling",2),V([Z({type:String,attribute:"aspect-ratio"})],de.prototype,"aspectRatio",2),V([Z({converter:Ur()})],de.prototype,"config",2),V([Z({type:Boolean})],de.prototype,"debug",2),V([Z({type:Number})],de.prototype,"autohide",2),V([Z({type:Boolean})],de.prototype,"hotkeys",2),V([Z({type:Boolean,reflect:!0})],de.prototype,"mobile",2),V([Z({type:Boolean,reflect:!0})],de.prototype,"live",2),V([Z({type:Boolean,reflect:!0})],de.prototype,"fluid",2),V([ni()],de.prototype,"_player",2),V([ni()],de.prototype,"_providerType",2),V([ni()],de.prototype,"_error",2),V([ni()],de.prototype,"_connectionState",2),V([ni()],de.prototype,"_showEndedOverlay",2),de=V([ri("bp-default-ui")],de);var Eb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
2768
2768
  <circle cx="12" cy="12" r="10" stroke-opacity="0.25"/>
2769
2769
  <path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round">
2770
2770
  <animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/>
2771
2771
  </path>
2772
- </svg>`,vb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2772
+ </svg>`,gb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2773
2773
  <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"/>
2774
2774
  <circle cx="12" cy="12" r="3" fill="currentColor"/>
2775
- </svg>`,fb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2775
+ </svg>`,bb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2776
2776
  <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"/>
2777
- </svg>`,Eb=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2777
+ </svg>`,_b=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2778
2778
  <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"/>
2779
- </svg>`,Ot=class extends De{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return mb;case"offline":return vb;case"ended":return this.live?fb:Eb;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 Ye`
2779
+ </svg>`,Ht=class extends Oe{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return Eb;case"offline":return gb;case"ended":return this.live?bb:_b;default:return""}}getDefaultMessage(){switch(this.type){case"loading":return"Loading...";case"offline":return"The live stream hasn't started yet";case"ended":return this.live?"Stream has ended":"Replay";default:return""}}render(){if(this.type==="none")return null;let t=this.getIcon(),r=this.getDefaultMessage();return Ze`
2780
2780
  <div part="icon">
2781
2781
  <slot name="icon">${this.renderIcon(t)}</slot>
2782
2782
  </div>
@@ -2786,7 +2786,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2786
2786
  <p part="submessage">
2787
2787
  <slot name="submessage"></slot>
2788
2788
  </p>
2789
- `}renderIcon(t){if(!t)return null;let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Ot.styles=jn`
2789
+ `}renderIcon(t){if(!t)return null;let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Ht.styles=eo`
2790
2790
  :host {
2791
2791
  display: flex;
2792
2792
  flex-direction: column;
@@ -2857,7 +2857,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2857
2857
  :host([button-mode]) [part="submessage"] {
2858
2858
  display: none;
2859
2859
  }
2860
- `,V([Q({type:String,reflect:!0})],Ot.prototype,"type",2),V([Q({type:Boolean,reflect:!0})],Ot.prototype,"live",2),V([Q({type:Boolean,reflect:!0,attribute:"button-mode"})],Ot.prototype,"buttonMode",2),Ot=V([ti("bp-overlay")],Ot);var gb=["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"],qm=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function bb(i){return`
2860
+ `,V([Z({type:String,reflect:!0})],Ht.prototype,"type",2),V([Z({type:Boolean,reflect:!0})],Ht.prototype,"live",2),V([Z({type:Boolean,reflect:!0,attribute:"button-mode"})],Ht.prototype,"buttonMode",2),Ht=V([ri("bp-overlay")],Ht);var yb=["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"],zm=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function Tb(i){return`
2861
2861
  <style>
2862
2862
  :host {
2863
2863
  display: inline-flex;
@@ -2871,10 +2871,10 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2871
2871
  }
2872
2872
  </style>
2873
2873
  <slot name="media">
2874
- <audio${Zm(i)}></audio>
2874
+ <audio${Jm(i)}></audio>
2875
2875
  </slot>
2876
2876
  <slot></slot>
2877
- `}function _b(i){return`
2877
+ `}function Ab(i){return`
2878
2878
  <style>
2879
2879
  :host {
2880
2880
  display: inline-block;
@@ -2896,25 +2896,25 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
2896
2896
  }
2897
2897
  </style>
2898
2898
  <slot name="media">
2899
- <video${Zm(i)}></video>
2899
+ <video${Jm(i)}></video>
2900
2900
  </slot>
2901
2901
  <slot></slot>
2902
- `}function Qm(i,{tag:e,is:t}){var o,s,l,d,h,Km,f,E,m,_,g,vr,Eu,Gm,gu,zm,Ym;let r=(s=(o=globalThis.document)==null?void 0:o.createElement)==null?void 0:s.call(o,e,{is:t}),n=r?yb(r):[];return l=class extends i{constructor(){super(...arguments);k(this,g);k(this,f,!1);k(this,E,null);k(this,m,new Map);k(this,_);q(this,"get");q(this,"set");q(this,"call")}static get observedAttributes(){var W,de;return C(W=l,h,Km).call(W),[...((de=r==null?void 0:r.constructor)==null?void 0:de.observedAttributes)??[],...qm]}get nativeEl(){var w;return C(this,g,vr).call(this),c(this,E)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((w=this.shadowRoot)==null?void 0:w.querySelector(e))??null}set nativeEl(w){v(this,E,w)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(w){this.toggleAttribute("muted",w)}get src(){return this.getAttribute("src")}set src(w){this.setAttribute("src",`${w}`)}get preload(){var w;return this.getAttribute("preload")??((w=this.nativeEl)==null?void 0:w.preload)}set preload(w){this.setAttribute("preload",`${w}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let w=Tb(this.attributes);t&&(w.is=t),e&&(w.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(w)}this.nativeEl.muted=this.hasAttribute("muted");for(let w of n)C(this,g,zm).call(this,w);v(this,_,new MutationObserver(C(this,g,Gm).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>C(this,g,Eu).call(this)),C(this,g,Eu).call(this);for(let w of this.constructor.Events)this.shadowRoot.addEventListener(w,this,!0)}handleEvent(w){w.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(w.type,{detail:w.detail}))}attributeChangedCallback(w,W,de){C(this,g,vr).call(this),C(this,g,Ym).call(this,w,W,de)}connectedCallback(){C(this,g,vr).call(this)}},d=new WeakMap,h=new WeakSet,Km=function(){if(c(this,d))return;v(this,d,!0);let w=new Set(this.observedAttributes);w.delete("muted");for(let W of n)if(!(W in this.prototype))if(typeof r[W]=="function")this.prototype[W]=function(...de){return C(this,g,vr).call(this),(()=>{var $;if(this.call)return this.call(W,...de);let Y=($=this.nativeEl)==null?void 0:$[W];return Y==null?void 0:Y.apply(this.nativeEl,de)})()};else{let de={get(){var Y,$;C(this,g,vr).call(this);let ie=W.toLowerCase();if(w.has(ie)){let ze=this.getAttribute(ie);return ze===null?!1:ze===""?!0:ze}return((Y=this.get)==null?void 0:Y.call(this,W))??(($=this.nativeEl)==null?void 0:$[W])}};W!==W.toUpperCase()&&(de.set=function(ie){C(this,g,vr).call(this);let Y=W.toLowerCase();if(w.has(Y)){ie===!0||ie===!1||ie==null?this.toggleAttribute(Y,!!ie):this.setAttribute(Y,ie);return}if(this.set){this.set(W,ie);return}this.nativeEl&&(this.nativeEl[W]=ie)}),Object.defineProperty(this.prototype,W,de)}},f=new WeakMap,E=new WeakMap,m=new WeakMap,_=new WeakMap,g=new WeakSet,vr=function(){c(this,f)||(v(this,f,!0),this.init())},Eu=function(){var ie;let w=new Map(c(this,m)),W=(ie=this.shadowRoot)==null?void 0:ie.querySelector("slot:not([name])");(W==null?void 0:W.assignedElements({flatten:!0}).filter(Y=>["track","source"].includes(Y.localName))).forEach(Y=>{var ze,Qn;w.delete(Y);let $=c(this,m).get(Y);$||($=Y.cloneNode(),c(this,m).set(Y,$),(ze=c(this,_))==null||ze.observe(Y,{attributes:!0})),(Qn=this.nativeEl)==null||Qn.append($),C(this,g,gu).call(this,$)}),w.forEach((Y,$)=>{Y.remove(),c(this,m).delete($)})},Gm=function(w){for(let W of w)if(W.type==="attributes"){let{target:de,attributeName:ie}=W,Y=c(this,m).get(de);Y&&ie&&(Y.setAttribute(ie,de.getAttribute(ie)??""),C(this,g,gu).call(this,Y))}},gu=function(w){w&&w.localName==="track"&&w.default&&(w.kind==="chapters"||w.kind==="metadata")&&w.track.mode==="disabled"&&(w.track.mode="hidden")},zm=function(w){if(Object.prototype.hasOwnProperty.call(this,w)){let W=this[w];delete this[w],this[w]=W}},Ym=function(w,W,de){var ie,Y,$;["id","class"].includes(w)||!l.observedAttributes.includes(w)&&this.constructor.observedAttributes.includes(w)||(de===null?(ie=this.nativeEl)==null||ie.removeAttribute(w):((Y=this.nativeEl)==null?void 0:Y.getAttribute(w))!==de&&(($=this.nativeEl)==null||$.setAttribute(w,de)))},k(l,h),q(l,"getTemplateHTML",e.endsWith("audio")?bb:_b),q(l,"shadowRootOptions",{mode:"open"}),q(l,"Events",gb),k(l,d,!1),l}function yb(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 Zm(i){let e="";for(let t in i){if(!qm.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function Tb(i){let e={};for(let t of i)e[t.name]=t.value;return e}var Ve=Qm(globalThis.HTMLElement??class{},{tag:"video"}),nC=Qm(globalThis.HTMLElement??class{},{tag:"audio"});var Gt=class extends Event{constructor(t,r){super(t);q(this,"track");this.track=r.track}};var bu=new WeakMap;function S(i){return bu.get(i)??Ab(i,{})}function Ab(i,e){let t=bu.get(i);return t||bu.set(i,t={}),Object.assign(t,e)}function Gl(i,e){let t=i.videoTracks;S(e).media=i,S(e).renditionSet||(S(e).renditionSet=new Set);let r=S(t).trackSet;r.add(e);let n=r.size-1;n in Er.prototype||Object.defineProperty(Er.prototype,n,{get(){return[...S(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Gt("addtrack",{track:e}))})}function zl(i){var r;let e=(r=S(i).media)==null?void 0:r.videoTracks;if(!e)return;S(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Gt("removetrack",{track:i}))})}function Xm(i){let e=S(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(S(e).changeRequested)return;S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var gi,bi,_i,fr,ks,Er=class extends EventTarget{constructor(){super();k(this,fr);k(this,gi);k(this,bi);k(this,_i);S(this).trackSet=new Set}[Symbol.iterator](){return c(this,fr,ks).values()}get length(){return c(this,fr,ks).size}getTrackById(t){return[...c(this,fr,ks)].find(r=>r.id===t)??null}get selectedIndex(){return[...c(this,fr,ks)].findIndex(t=>t.selected)}get onaddtrack(){return c(this,gi)}set onaddtrack(t){c(this,gi)&&(this.removeEventListener("addtrack",c(this,gi)),v(this,gi,void 0)),typeof t=="function"&&(v(this,gi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return c(this,bi)}set onremovetrack(t){c(this,bi)&&(this.removeEventListener("removetrack",c(this,bi)),v(this,bi,void 0)),typeof t=="function"&&(v(this,bi,t),this.addEventListener("removetrack",t))}get onchange(){return c(this,_i)}set onchange(t){c(this,_i)&&(this.removeEventListener("change",c(this,_i)),v(this,_i,void 0)),typeof t=="function"&&(v(this,_i,t),this.addEventListener("change",t))}};gi=new WeakMap,bi=new WeakMap,_i=new WeakMap,fr=new WeakSet,ks=function(){return S(this).trackSet};var zt=class extends Event{constructor(t,r){super(t);q(this,"rendition");this.rendition=r.rendition}};function jm(i,e){let t=S(i).media.videoRenditions;S(e).media=S(i).media,S(e).track=i;let r=S(i).renditionSet;r.add(e);let n=r.size-1;n in gr.prototype||Object.defineProperty(gr.prototype,n,{get(){return Mn(this)[n]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new zt("addrendition",{rendition:e}))})}function Jm(i){let e=S(i).media.videoRenditions,t=S(i).track;S(t).renditionSet.delete(i),queueMicrotask(()=>{S(i).track.selected&&e.dispatchEvent(new zt("removerendition",{rendition:i}))})}function ev(i){let e=S(i).media.videoRenditions;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,S(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Mn(i){return[...S(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...S(t).renditionSet])}var yi,Ti,Ai,gr=class extends EventTarget{constructor(){super(...arguments);k(this,yi);k(this,Ti);k(this,Ai)}[Symbol.iterator](){return Mn(this).values()}get length(){return Mn(this).length}getRenditionById(t){return Mn(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Mn(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of Mn(this).entries())n.selected=r===t}get onaddrendition(){return c(this,yi)}set onaddrendition(t){c(this,yi)&&(this.removeEventListener("addrendition",c(this,yi)),v(this,yi,void 0)),typeof t=="function"&&(v(this,yi,t),this.addEventListener("addrendition",t))}get onremoverendition(){return c(this,Ti)}set onremoverendition(t){c(this,Ti)&&(this.removeEventListener("removerendition",c(this,Ti)),v(this,Ti,void 0)),typeof t=="function"&&(v(this,Ti,t),this.addEventListener("removerendition",t))}get onchange(){return c(this,Ai)}set onchange(t){c(this,Ai)&&(this.removeEventListener("change",c(this,Ai)),v(this,Ai,void 0)),typeof t=="function"&&(v(this,Ai,t),this.addEventListener("change",t))}};yi=new WeakMap,Ti=new WeakMap,Ai=new WeakMap;var xn,Ls=class{constructor(){q(this,"src");q(this,"id");q(this,"width");q(this,"height");q(this,"bitrate");q(this,"frameRate");q(this,"codec");k(this,xn,!1)}get selected(){return c(this,xn)}set selected(e){c(this,xn)!==e&&(v(this,xn,e),ev(this))}};xn=new WeakMap;var Pn,Dn=class{constructor(){q(this,"id");q(this,"kind");q(this,"label","");q(this,"language","");q(this,"sourceBuffer");k(this,Pn,!1)}addRendition(e,t,r,n,o,s){let l=new Ls;return l.src=e,l.width=t,l.height=r,l.frameRate=s,l.bitrate=o,l.codec=n,jm(this,l),l}removeRendition(e){Jm(e)}get selected(){return c(this,Pn)}set selected(e){c(this,Pn)!==e&&(v(this,Pn,e),e===!0&&Xm(this))}};Pn=new WeakMap;function tv(i,e){let t=S(i).media.audioRenditions;S(e).media=S(i).media,S(e).track=i;let r=S(i).renditionSet;r.add(e);let n=r.size-1;n in br.prototype||Object.defineProperty(br.prototype,n,{get(){return On(this)[n]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new zt("addrendition",{rendition:e}))})}function iv(i){let e=S(i).media.audioRenditions,t=S(i).track;S(t).renditionSet.delete(i),queueMicrotask(()=>{S(i).track.enabled&&e.dispatchEvent(new zt("removerendition",{rendition:i}))})}function rv(i){let e=S(i).media.audioRenditions;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,S(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function On(i){return[...S(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...S(t).renditionSet])}var Si,ki,Li,br=class extends EventTarget{constructor(){super(...arguments);k(this,Si);k(this,ki);k(this,Li)}[Symbol.iterator](){return On(this).values()}get length(){return On(this).length}getRenditionById(t){return On(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return On(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of On(this).entries())n.selected=r===t}get onaddrendition(){return c(this,Si)}set onaddrendition(t){c(this,Si)&&(this.removeEventListener("addrendition",c(this,Si)),v(this,Si,void 0)),typeof t=="function"&&(v(this,Si,t),this.addEventListener("addrendition",t))}get onremoverendition(){return c(this,ki)}set onremoverendition(t){c(this,ki)&&(this.removeEventListener("removerendition",c(this,ki)),v(this,ki,void 0)),typeof t=="function"&&(v(this,ki,t),this.addEventListener("removerendition",t))}get onchange(){return c(this,Li)}set onchange(t){c(this,Li)&&(this.removeEventListener("change",c(this,Li)),v(this,Li,void 0)),typeof t=="function"&&(v(this,Li,t),this.addEventListener("change",t))}};Si=new WeakMap,ki=new WeakMap,Li=new WeakMap;var Nn,ws=class{constructor(){q(this,"src");q(this,"id");q(this,"bitrate");q(this,"codec");k(this,Nn,!1)}get selected(){return c(this,Nn)}set selected(e){c(this,Nn)!==e&&(v(this,Nn,e),rv(this))}};Nn=new WeakMap;function Ql(i,e){let t=i.audioTracks;S(e).media=i,S(e).renditionSet||(S(e).renditionSet=new Set);let r=S(t).trackSet;r.add(e);let n=r.size-1;n in _r.prototype||Object.defineProperty(_r.prototype,n,{get(){return[...S(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Gt("addtrack",{track:e}))})}function Zl(i){var r;let e=(r=S(i).media)==null?void 0:r.audioTracks;if(!e)return;S(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Gt("removetrack",{track:i}))})}function nv(i){let e=S(i).media.audioTracks;!e||S(e).changeRequested||(S(e).changeRequested=!0,queueMicrotask(()=>{delete S(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var wi,Ii,Ci,Un,Yl,_r=class extends EventTarget{constructor(){super();k(this,Un);k(this,wi);k(this,Ii);k(this,Ci);S(this).trackSet=new Set}[Symbol.iterator](){return c(this,Un,Yl).values()}get length(){return c(this,Un,Yl).size}getTrackById(t){return[...c(this,Un,Yl)].find(r=>r.id===t)??null}get onaddtrack(){return c(this,wi)}set onaddtrack(t){c(this,wi)&&(this.removeEventListener("addtrack",c(this,wi)),v(this,wi,void 0)),typeof t=="function"&&(v(this,wi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return c(this,Ii)}set onremovetrack(t){c(this,Ii)&&(this.removeEventListener("removetrack",c(this,Ii)),v(this,Ii,void 0)),typeof t=="function"&&(v(this,Ii,t),this.addEventListener("removetrack",t))}get onchange(){return c(this,Ci)}set onchange(t){c(this,Ci)&&(this.removeEventListener("change",c(this,Ci)),v(this,Ci,void 0)),typeof t=="function"&&(v(this,Ci,t),this.addEventListener("change",t))}};wi=new WeakMap,Ii=new WeakMap,Ci=new WeakMap,Un=new WeakSet,Yl=function(){return S(this).trackSet};var Hn,$n=class{constructor(){q(this,"id");q(this,"kind");q(this,"label","");q(this,"language","");q(this,"sourceBuffer");k(this,Hn,!1)}addRendition(e,t,r){let n=new ws;return n.src=e,n.codec=t,n.bitrate=r,tv(this,n),n}removeRendition(e){iv(e)}get enabled(){return c(this,Hn)}set enabled(e){c(this,Hn)!==e&&(v(this,Hn,e),nv(this))}};Hn=new WeakMap;var ov=Xl(globalThis.HTMLMediaElement,"video"),sv=Xl(globalThis.HTMLMediaElement,"audio");function Vn(i){if(!(i!=null&&i.prototype))return i;let e=Xl(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return Sb(this)}});let t=Xl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return kb(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(o,s="",l=""){let d=new Dn;return d.kind=o,d.label=s,d.language=l,Gl(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=zl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(o,s="",l=""){let d=new $n;return d.kind=o,d.label=s,d.language=l,Ql(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Zl),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=o=>{let s=S(o).videoRenditions;return s||(s=new gr,S(s).media=o,S(o).videoRenditions=s),s};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return n(this)}});let n=o=>{let s=S(o).audioRenditions;return s||(s=new br,S(s).media=o,S(o).audioRenditions=s),s};return i}function Xl(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function Sb(i){let e=S(i).videoTracks;if(!e&&(e=new Er,S(i).videoTracks=e,ov)){let t=ov.call(i.nativeEl??i);for(let r of t)Gl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof Dn)){for(let n of t)zl(n);return}Gl(i,r.track)}),t.addEventListener("removetrack",r=>{zl(r.track)})}return e}function kb(i){let e=S(i).audioTracks;if(!e&&(e=new _r,S(i).audioTracks=e,sv)){let t=sv.call(i.nativeEl??i);for(let r of t)Ql(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof $n)){for(let n of t)Zl(n);return}Ql(i,r.track)}),t.addEventListener("removetrack",r=>{Zl(r.track)})}return e}var xe=Mv(Qu("hls.js"),1);var Lb=Vn(Ve),Yt,Qt,Zt,Bn,et,_u,av,yu,Is,lv,Ri=class extends Lb{constructor(){super();k(this,et);k(this,Yt,null);k(this,Qt,null);k(this,Zt,null);k(this,Bn,!1);this.api=null;k(this,Is,()=>{var r,n;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(n=this.api)==null||n.startLoad()});C(this,et,lv).call(this,"config")}static getTemplateHTML(t,r={}){let{src:n,...o}=t;return`
2902
+ `}function jm(i,{tag:e,is:t}){var o,s,l,d,h,Ym,g,f,E,y,v,gr,_u,Qm,yu,Zm,Xm;let r=(s=(o=globalThis.document)==null?void 0:o.createElement)==null?void 0:s.call(o,e,{is:t}),n=r?Sb(r):[];return l=class extends i{constructor(){super(...arguments);k(this,v);k(this,g,!1);k(this,f,null);k(this,E,new Map);k(this,y);q(this,"get");q(this,"set");q(this,"call")}static get observedAttributes(){var F,ce;return C(F=l,h,Ym).call(F),[...((ce=r==null?void 0:r.constructor)==null?void 0:ce.observedAttributes)??[],...zm]}get nativeEl(){var w;return C(this,v,gr).call(this),c(this,f)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((w=this.shadowRoot)==null?void 0:w.querySelector(e))??null}set nativeEl(w){m(this,f,w)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(w){this.toggleAttribute("muted",w)}get src(){return this.getAttribute("src")}set src(w){this.setAttribute("src",`${w}`)}get preload(){var w;return this.getAttribute("preload")??((w=this.nativeEl)==null?void 0:w.preload)}set preload(w){this.setAttribute("preload",`${w}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let w=kb(this.attributes);t&&(w.is=t),e&&(w.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(w)}this.nativeEl.muted=this.hasAttribute("muted");for(let w of n)C(this,v,Zm).call(this,w);m(this,y,new MutationObserver(C(this,v,Qm).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>C(this,v,_u).call(this)),C(this,v,_u).call(this);for(let w of this.constructor.Events)this.shadowRoot.addEventListener(w,this,!0)}handleEvent(w){w.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(w.type,{detail:w.detail}))}attributeChangedCallback(w,F,ce){C(this,v,gr).call(this),C(this,v,Xm).call(this,w,F,ce)}connectedCallback(){C(this,v,gr).call(this)}},d=new WeakMap,h=new WeakSet,Ym=function(){if(c(this,d))return;m(this,d,!0);let w=new Set(this.observedAttributes);w.delete("muted");for(let F of n)if(!(F in this.prototype))if(typeof r[F]=="function")this.prototype[F]=function(...ce){return C(this,v,gr).call(this),(()=>{var $;if(this.call)return this.call(F,...ce);let Q=($=this.nativeEl)==null?void 0:$[F];return Q==null?void 0:Q.apply(this.nativeEl,ce)})()};else{let ce={get(){var Q,$;C(this,v,gr).call(this);let re=F.toLowerCase();if(w.has(re)){let Qe=this.getAttribute(re);return Qe===null?!1:Qe===""?!0:Qe}return((Q=this.get)==null?void 0:Q.call(this,F))??(($=this.nativeEl)==null?void 0:$[F])}};F!==F.toUpperCase()&&(ce.set=function(re){C(this,v,gr).call(this);let Q=F.toLowerCase();if(w.has(Q)){re===!0||re===!1||re==null?this.toggleAttribute(Q,!!re):this.setAttribute(Q,re);return}if(this.set){this.set(F,re);return}this.nativeEl&&(this.nativeEl[F]=re)}),Object.defineProperty(this.prototype,F,ce)}},g=new WeakMap,f=new WeakMap,E=new WeakMap,y=new WeakMap,v=new WeakSet,gr=function(){c(this,g)||(m(this,g,!0),this.init())},_u=function(){var re;let w=new Map(c(this,E)),F=(re=this.shadowRoot)==null?void 0:re.querySelector("slot:not([name])");(F==null?void 0:F.assignedElements({flatten:!0}).filter(Q=>["track","source"].includes(Q.localName))).forEach(Q=>{var Qe,Xn;w.delete(Q);let $=c(this,E).get(Q);$||($=Q.cloneNode(),c(this,E).set(Q,$),(Qe=c(this,y))==null||Qe.observe(Q,{attributes:!0})),(Xn=this.nativeEl)==null||Xn.append($),C(this,v,yu).call(this,$)}),w.forEach((Q,$)=>{Q.remove(),c(this,E).delete($)})},Qm=function(w){for(let F of w)if(F.type==="attributes"){let{target:ce,attributeName:re}=F,Q=c(this,E).get(ce);Q&&re&&(Q.setAttribute(re,ce.getAttribute(re)??""),C(this,v,yu).call(this,Q))}},yu=function(w){w&&w.localName==="track"&&w.default&&(w.kind==="chapters"||w.kind==="metadata")&&w.track.mode==="disabled"&&(w.track.mode="hidden")},Zm=function(w){if(Object.prototype.hasOwnProperty.call(this,w)){let F=this[w];delete this[w],this[w]=F}},Xm=function(w,F,ce){var re,Q,$;["id","class"].includes(w)||!l.observedAttributes.includes(w)&&this.constructor.observedAttributes.includes(w)||(ce===null?(re=this.nativeEl)==null||re.removeAttribute(w):((Q=this.nativeEl)==null?void 0:Q.getAttribute(w))!==ce&&(($=this.nativeEl)==null||$.setAttribute(w,ce)))},k(l,h),q(l,"getTemplateHTML",e.endsWith("audio")?Tb:Ab),q(l,"shadowRootOptions",{mode:"open"}),q(l,"Events",yb),k(l,d,!1),l}function Sb(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 Jm(i){let e="";for(let t in i){if(!zm.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function kb(i){let e={};for(let t of i)e[t.name]=t.value;return e}var We=jm(globalThis.HTMLElement??class{},{tag:"video"}),dC=jm(globalThis.HTMLElement??class{},{tag:"audio"});var Yt=class extends Event{constructor(t,r){super(t);q(this,"track");this.track=r.track}};var Tu=new WeakMap;function L(i){return Tu.get(i)??Lb(i,{})}function Lb(i,e){let t=Tu.get(i);return t||Tu.set(i,t={}),Object.assign(t,e)}function Ql(i,e){let t=i.videoTracks;L(e).media=i,L(e).renditionSet||(L(e).renditionSet=new Set);let r=L(t).trackSet;r.add(e);let n=r.size-1;n in _r.prototype||Object.defineProperty(_r.prototype,n,{get(){return[...L(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Yt("addtrack",{track:e}))})}function Zl(i){var r;let e=(r=L(i).media)==null?void 0:r.videoTracks;if(!e)return;L(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Yt("removetrack",{track:i}))})}function ev(i){let e=L(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(L(e).changeRequested)return;L(e).changeRequested=!0,queueMicrotask(()=>{delete L(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var _i,yi,Ti,br,ws,_r=class extends EventTarget{constructor(){super();k(this,br);k(this,_i);k(this,yi);k(this,Ti);L(this).trackSet=new Set}[Symbol.iterator](){return c(this,br,ws).values()}get length(){return c(this,br,ws).size}getTrackById(t){return[...c(this,br,ws)].find(r=>r.id===t)??null}get selectedIndex(){return[...c(this,br,ws)].findIndex(t=>t.selected)}get onaddtrack(){return c(this,_i)}set onaddtrack(t){c(this,_i)&&(this.removeEventListener("addtrack",c(this,_i)),m(this,_i,void 0)),typeof t=="function"&&(m(this,_i,t),this.addEventListener("addtrack",t))}get onremovetrack(){return c(this,yi)}set onremovetrack(t){c(this,yi)&&(this.removeEventListener("removetrack",c(this,yi)),m(this,yi,void 0)),typeof t=="function"&&(m(this,yi,t),this.addEventListener("removetrack",t))}get onchange(){return c(this,Ti)}set onchange(t){c(this,Ti)&&(this.removeEventListener("change",c(this,Ti)),m(this,Ti,void 0)),typeof t=="function"&&(m(this,Ti,t),this.addEventListener("change",t))}};_i=new WeakMap,yi=new WeakMap,Ti=new WeakMap,br=new WeakSet,ws=function(){return L(this).trackSet};var Qt=class extends Event{constructor(t,r){super(t);q(this,"rendition");this.rendition=r.rendition}};function tv(i,e){let t=L(i).media.videoRenditions;L(e).media=L(i).media,L(e).track=i;let r=L(i).renditionSet;r.add(e);let n=r.size-1;n in yr.prototype||Object.defineProperty(yr.prototype,n,{get(){return Dn(this)[n]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Qt("addrendition",{rendition:e}))})}function iv(i){let e=L(i).media.videoRenditions,t=L(i).track;L(t).renditionSet.delete(i),queueMicrotask(()=>{L(i).track.selected&&e.dispatchEvent(new Qt("removerendition",{rendition:i}))})}function rv(i){let e=L(i).media.videoRenditions;!e||L(e).changeRequested||(L(e).changeRequested=!0,queueMicrotask(()=>{delete L(e).changeRequested,L(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Dn(i){return[...L(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...L(t).renditionSet])}var Ai,Si,ki,yr=class extends EventTarget{constructor(){super(...arguments);k(this,Ai);k(this,Si);k(this,ki)}[Symbol.iterator](){return Dn(this).values()}get length(){return Dn(this).length}getRenditionById(t){return Dn(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Dn(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of Dn(this).entries())n.selected=r===t}get onaddrendition(){return c(this,Ai)}set onaddrendition(t){c(this,Ai)&&(this.removeEventListener("addrendition",c(this,Ai)),m(this,Ai,void 0)),typeof t=="function"&&(m(this,Ai,t),this.addEventListener("addrendition",t))}get onremoverendition(){return c(this,Si)}set onremoverendition(t){c(this,Si)&&(this.removeEventListener("removerendition",c(this,Si)),m(this,Si,void 0)),typeof t=="function"&&(m(this,Si,t),this.addEventListener("removerendition",t))}get onchange(){return c(this,ki)}set onchange(t){c(this,ki)&&(this.removeEventListener("change",c(this,ki)),m(this,ki,void 0)),typeof t=="function"&&(m(this,ki,t),this.addEventListener("change",t))}};Ai=new WeakMap,Si=new WeakMap,ki=new WeakMap;var On,Is=class{constructor(){q(this,"src");q(this,"id");q(this,"width");q(this,"height");q(this,"bitrate");q(this,"frameRate");q(this,"codec");k(this,On,!1)}get selected(){return c(this,On)}set selected(e){c(this,On)!==e&&(m(this,On,e),rv(this))}};On=new WeakMap;var Nn,Un=class{constructor(){q(this,"id");q(this,"kind");q(this,"label","");q(this,"language","");q(this,"sourceBuffer");k(this,Nn,!1)}addRendition(e,t,r,n,o,s){let l=new Is;return l.src=e,l.width=t,l.height=r,l.frameRate=s,l.bitrate=o,l.codec=n,tv(this,l),l}removeRendition(e){iv(e)}get selected(){return c(this,Nn)}set selected(e){c(this,Nn)!==e&&(m(this,Nn,e),e===!0&&ev(this))}};Nn=new WeakMap;function nv(i,e){let t=L(i).media.audioRenditions;L(e).media=L(i).media,L(e).track=i;let r=L(i).renditionSet;r.add(e);let n=r.size-1;n in Tr.prototype||Object.defineProperty(Tr.prototype,n,{get(){return Hn(this)[n]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Qt("addrendition",{rendition:e}))})}function ov(i){let e=L(i).media.audioRenditions,t=L(i).track;L(t).renditionSet.delete(i),queueMicrotask(()=>{L(i).track.enabled&&e.dispatchEvent(new Qt("removerendition",{rendition:i}))})}function sv(i){let e=L(i).media.audioRenditions;!e||L(e).changeRequested||(L(e).changeRequested=!0,queueMicrotask(()=>{delete L(e).changeRequested,L(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Hn(i){return[...L(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...L(t).renditionSet])}var Li,wi,Ii,Tr=class extends EventTarget{constructor(){super(...arguments);k(this,Li);k(this,wi);k(this,Ii)}[Symbol.iterator](){return Hn(this).values()}get length(){return Hn(this).length}getRenditionById(t){return Hn(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Hn(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of Hn(this).entries())n.selected=r===t}get onaddrendition(){return c(this,Li)}set onaddrendition(t){c(this,Li)&&(this.removeEventListener("addrendition",c(this,Li)),m(this,Li,void 0)),typeof t=="function"&&(m(this,Li,t),this.addEventListener("addrendition",t))}get onremoverendition(){return c(this,wi)}set onremoverendition(t){c(this,wi)&&(this.removeEventListener("removerendition",c(this,wi)),m(this,wi,void 0)),typeof t=="function"&&(m(this,wi,t),this.addEventListener("removerendition",t))}get onchange(){return c(this,Ii)}set onchange(t){c(this,Ii)&&(this.removeEventListener("change",c(this,Ii)),m(this,Ii,void 0)),typeof t=="function"&&(m(this,Ii,t),this.addEventListener("change",t))}};Li=new WeakMap,wi=new WeakMap,Ii=new WeakMap;var $n,Cs=class{constructor(){q(this,"src");q(this,"id");q(this,"bitrate");q(this,"codec");k(this,$n,!1)}get selected(){return c(this,$n)}set selected(e){c(this,$n)!==e&&(m(this,$n,e),sv(this))}};$n=new WeakMap;function jl(i,e){let t=i.audioTracks;L(e).media=i,L(e).renditionSet||(L(e).renditionSet=new Set);let r=L(t).trackSet;r.add(e);let n=r.size-1;n in Ar.prototype||Object.defineProperty(Ar.prototype,n,{get(){return[...L(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Yt("addtrack",{track:e}))})}function Jl(i){var r;let e=(r=L(i).media)==null?void 0:r.audioTracks;if(!e)return;L(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Yt("removetrack",{track:i}))})}function av(i){let e=L(i).media.audioTracks;!e||L(e).changeRequested||(L(e).changeRequested=!0,queueMicrotask(()=>{delete L(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Ci,Ri,Mi,Vn,Xl,Ar=class extends EventTarget{constructor(){super();k(this,Vn);k(this,Ci);k(this,Ri);k(this,Mi);L(this).trackSet=new Set}[Symbol.iterator](){return c(this,Vn,Xl).values()}get length(){return c(this,Vn,Xl).size}getTrackById(t){return[...c(this,Vn,Xl)].find(r=>r.id===t)??null}get onaddtrack(){return c(this,Ci)}set onaddtrack(t){c(this,Ci)&&(this.removeEventListener("addtrack",c(this,Ci)),m(this,Ci,void 0)),typeof t=="function"&&(m(this,Ci,t),this.addEventListener("addtrack",t))}get onremovetrack(){return c(this,Ri)}set onremovetrack(t){c(this,Ri)&&(this.removeEventListener("removetrack",c(this,Ri)),m(this,Ri,void 0)),typeof t=="function"&&(m(this,Ri,t),this.addEventListener("removetrack",t))}get onchange(){return c(this,Mi)}set onchange(t){c(this,Mi)&&(this.removeEventListener("change",c(this,Mi)),m(this,Mi,void 0)),typeof t=="function"&&(m(this,Mi,t),this.addEventListener("change",t))}};Ci=new WeakMap,Ri=new WeakMap,Mi=new WeakMap,Vn=new WeakSet,Xl=function(){return L(this).trackSet};var Bn,Wn=class{constructor(){q(this,"id");q(this,"kind");q(this,"label","");q(this,"language","");q(this,"sourceBuffer");k(this,Bn,!1)}addRendition(e,t,r){let n=new Cs;return n.src=e,n.codec=t,n.bitrate=r,nv(this,n),n}removeRendition(e){ov(e)}get enabled(){return c(this,Bn)}set enabled(e){c(this,Bn)!==e&&(m(this,Bn,e),av(this))}};Bn=new WeakMap;var lv=ed(globalThis.HTMLMediaElement,"video"),dv=ed(globalThis.HTMLMediaElement,"audio");function Fn(i){if(!(i!=null&&i.prototype))return i;let e=ed(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return wb(this)}});let t=ed(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return Ib(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(o,s="",l=""){let d=new Un;return d.kind=o,d.label=s,d.language=l,Ql(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=Zl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(o,s="",l=""){let d=new Wn;return d.kind=o,d.label=s,d.language=l,jl(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Jl),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=o=>{let s=L(o).videoRenditions;return s||(s=new yr,L(s).media=o,L(o).videoRenditions=s),s};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return n(this)}});let n=o=>{let s=L(o).audioRenditions;return s||(s=new Tr,L(s).media=o,L(o).audioRenditions=s),s};return i}function ed(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function wb(i){let e=L(i).videoTracks;if(!e&&(e=new _r,L(i).videoTracks=e,lv)){let t=lv.call(i.nativeEl??i);for(let r of t)Ql(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof Un)){for(let n of t)Zl(n);return}Ql(i,r.track)}),t.addEventListener("removetrack",r=>{Zl(r.track)})}return e}function Ib(i){let e=L(i).audioTracks;if(!e&&(e=new Ar,L(i).audioTracks=e,dv)){let t=dv.call(i.nativeEl??i);for(let r of t)jl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof Wn)){for(let n of t)Jl(n);return}jl(i,r.track)}),t.addEventListener("removetrack",r=>{Jl(r.track)})}return e}var be=Dv(ju("hls.js"),1);var Cb={[be.default.ErrorTypes.NETWORK_ERROR]:Xe.network,[be.default.ErrorTypes.MEDIA_ERROR]:Xe.media,[be.default.ErrorTypes.KEY_SYSTEM_ERROR]:Xe.keySystem},Rb=3e3,Mb=Fn(We),Zt,Xt,jt,xi,Kn,rt,Au,cv,Su,Rs,uv,Pi=class extends Mb{constructor(){super();k(this,rt);k(this,Zt,null);k(this,Xt,null);k(this,jt,null);k(this,xi,null);k(this,Kn,!1);this.api=null;k(this,Rs,()=>{var r,n;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(n=this.api)==null||n.startLoad()});C(this,rt,uv).call(this,"config"),this.addEventListener("waiting",()=>{c(this,xi)&&this.dispatchEvent(Ne(new Error(c(this,xi).message),c(this,xi).code))})}static getTemplateHTML(t,r={}){let{src:n,...o}=t;return`
2903
2903
  <script type="application/json" id="config">
2904
2904
  ${JSON.stringify(r.config||{})}
2905
2905
  <\/script>
2906
- ${Ve.getTemplateHTML(o)}
2907
- `}get config(){return c(this,Zt)}set config(t){v(this,Zt,t)}get activeVideoElement(){return this.nativeEl??null}attributeChangedCallback(t,r,n){t!=="src"&&super.attributeChangedCallback(t,r,n),t==="src"&&r!==n&&this.load()}disconnectedCallback(){var t;C(this,et,_u).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var n,o,s,l;let t=!this.api&&!c(this,Bn);if(C(this,et,_u).call(this),!this.src)return;if(t&&!c(this,Zt))try{v(this,Zt,JSON.parse(((o=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:o.textContent)||"{}"))}catch(d){console.error("[hls-video] Failed to parse config:",d),v(this,Zt,{})}if(!C(this,et,av).call(this,this.src)){await Promise.resolve(),v(this,Bn,!0),this.nativeEl.src=this.src;return}if(xe.default.isSupported()){switch(await Promise.resolve(),this.api=new xe.default({liveDurationInfinity:!0,autoStartLoad:!1,...c(this,Zt)}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let m=()=>{var _;return(_=this.api)==null?void 0:_.startLoad()};this.nativeEl.addEventListener("play",m,{once:!0}),this.api.on(xe.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",m)});break}case"metadata":{let m=this.api.config.maxBufferLength,_=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let g=()=>{this.api&&(this.api.config.maxBufferLength=m,this.api.config.maxBufferSize=_)};this.nativeEl.addEventListener("play",g,{once:!0}),this.api.on(xe.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",g)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",c(this,Is)),v(this,Yt,document.createElement("source")),c(this,Yt).setAttribute("type","application/x-mpegURL"),c(this,Yt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(c(this,Yt));let h=new WeakMap;this.api.on(xe.default.Events.MANIFEST_PARSED,(m,_)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(I=>{console.warn("Autoplay failed:",I)}),C(this,et,yu).call(this);let g=this.videoTracks.getTrackById("main");g||(g=this.addVideoTrack("main"),g.id="main",g.selected=!0);for(let[I,L]of _.levels.entries()){let le=g.addRendition(L.url[0],L.width,L.height,L.videoCodec??void 0,L.bitrate);h.set(L,`${I}`),le.id=`${I}`}for(let[I,L]of _.audioTracks.entries()){let le=L.default?"main":"alternative",Ie=this.addAudioTrack(le,L.name,L.lang);Ie.id=`${I}`,L.default&&(Ie.enabled=!0)}}),(s=c(this,Qt))==null||s.call(this);let p=()=>{var I,L;let m=[...this.audioTracks].find(le=>le.enabled),_=m?+m.id:void 0,g=((I=this.api)==null?void 0:I.audioTracks.map(le=>le.id))??[];_!==void 0&&_!==((L=this.api)==null?void 0:L.audioTrack)&&g.includes(_)&&this.api&&(this.api.audioTrack=_)};this.audioTracks.addEventListener("change",p),v(this,Qt,()=>{this.audioTracks.removeEventListener("change",p)}),this.api.on(xe.default.Events.LEVELS_UPDATED,(m,_)=>{let g=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!g)return;let I=_.levels.map(L=>h.get(L));for(let L of this.videoRenditions)L.id&&!I.includes(L.id)&&g.removeRendition(L)});let f=null;this.api.on(xe.default.Events.ERROR,(m,_)=>{var g;_.type===xe.default.ErrorTypes.NETWORK_ERROR&&_.details===xe.default.ErrorDetails.FRAG_LOAD_ERROR&&(f=((g=_.frag)==null?void 0:g.level)??null)}),this.api.on(xe.default.Events.LEVEL_SWITCHED,(m,_)=>{let g=_.level;f!==null&&g<f&&(console.warn(`hls.js downgraded quality from level ${f} to ${g} due to fragment load failure.`),this.videoRenditions.selectedIndex=g,f=null)});let E=()=>{let m=this.videoRenditions.selectedIndex;this.api&&m!==this.api.nextLevel&&(this.api.nextLevel=m)};(l=this.videoRenditions)==null||l.addEventListener("change",E),this.api.once(xe.default.Events.DESTROYING,()=>{var m,_;C(this,et,yu).call(this),(m=this.videoRenditions)==null||m.removeEventListener("change",E),(_=c(this,Qt))==null||_.call(this),v(this,Qt,null)});return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Yt=new WeakMap,Qt=new WeakMap,Zt=new WeakMap,Bn=new WeakMap,et=new WeakSet,_u=function(){var t,r,n;(t=c(this,Yt))==null||t.remove(),v(this,Yt,null),(r=c(this,Qt))==null||r.call(this),v(this,Qt,null),(n=this.nativeEl)==null||n.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",c(this,Is)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),v(this,Bn,!1)},av=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},yu=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},Is=new WeakMap,lv=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ri.shadowRootOptions={...Ve.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",Ri);var Tu=Ri;var wb="nanoplayer.4.min.js",Ib="nanoplayer",Pe={loading:!1,loaded:!1,error:null,callbacks:[]};function Cb(i,e){return new Promise((t,r)=>{if(window.NanoPlayer){Pe.loaded=!0,t();return}if(Pe.loaded){t();return}if(Pe.error){r(Pe.error);return}if(Pe.callbacks.push(s=>{s?r(s):t()}),Pe.loading)return;Pe.loading=!0;let n;e?n=e:n=`${i.endsWith("/")?i:`${i}/`}${Ib}/${wb}`;let o=document.createElement("script");o.src=n,o.async=!0,o.onload=()=>{Pe.loaded=!0,Pe.loading=!1,Pe.callbacks.forEach(s=>s()),Pe.callbacks=[]},o.onerror=()=>{let s=new Error(`Failed to load NanoPlayer script from ${n}`);Pe.error=s,Pe.loading=!1,Pe.callbacks.forEach(l=>l(s)),Pe.callbacks=[]},document.head.appendChild(o)})}var Rb=Vn(Ve),ut,Mi,ve,ht,Wn,Se,Cs,xi,Pi,yr,Tr,pt,Ar,Fn,qn,we,dv,Au,cv,uv,hv,jl,Di=class extends Rb{constructor(){super();k(this,we);k(this,ut,null);k(this,Mi,null);k(this,ve,null);k(this,ht,null);k(this,Wn,"");k(this,Se,null);k(this,Cs,!0);k(this,xi,[]);k(this,Pi,[]);k(this,yr,[]);k(this,Tr,null);k(this,pt,null);k(this,Ar,!1);k(this,Fn,!1);k(this,qn,null);this.api=null;C(this,we,jl).call(this,"config"),C(this,we,jl).call(this,"streamid"),C(this,we,jl).call(this,"sourceConfig"),C(this,we,dv).call(this)}static get observedAttributes(){return[...Ve.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:n,"library-location":o,...s}=t;return`
2906
+ ${We.getTemplateHTML(o)}
2907
+ `}get config(){return c(this,jt)}set config(t){m(this,jt,t)}get activeVideoElement(){return this.nativeEl??null}attributeChangedCallback(t,r,n){t!=="src"&&super.attributeChangedCallback(t,r,n),t==="src"&&r!==n&&this.load()}disconnectedCallback(){var t;C(this,rt,Au).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var n,o,s,l;let t=!this.api&&!c(this,Kn);if(C(this,rt,Au).call(this),m(this,xi,null),!this.src)return;if(t&&!c(this,jt))try{m(this,jt,JSON.parse(((o=(n=this.shadowRoot)==null?void 0:n.getElementById("config"))==null?void 0:o.textContent)||"{}"))}catch(d){console.error("[hls-video] Failed to parse config:",d),m(this,jt,{})}if(!C(this,rt,cv).call(this,this.src)){await Promise.resolve(),m(this,Kn,!0),this.nativeEl.src=this.src;return}if(be.default.isSupported()){await Promise.resolve(),this.api=new be.default({liveDurationInfinity:!0,autoStartLoad:!1,...c(this,jt)});let d=null,h=0;switch(this.api.on(be.default.Events.ERROR,(y,v)=>{var S,I,B;if(v.type===be.default.ErrorTypes.NETWORK_ERROR&&v.details===be.default.ErrorDetails.FRAG_LOAD_ERROR&&(d=((S=v.frag)==null?void 0:S.level)??null),v.fatal){if(v.type===be.default.ErrorTypes.MEDIA_ERROR){let A=Date.now();if(A-h>Rb){h=A,(I=this.api)==null||I.recoverMediaError();return}}let se=(B=v.response)==null?void 0:B.code,De=se?`${v.details} (HTTP ${se})`:v.details,ei=v.type===be.default.ErrorTypes.NETWORK_ERROR&&(se===401||se===403)?Xe.auth:Cb[v.type]??Xe.other;m(this,xi,{message:De,code:ei}),this.dispatchEvent(Ne(new Error(De),ei))}}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{let y=()=>{var v;return(v=this.api)==null?void 0:v.startLoad()};this.nativeEl.addEventListener("play",y,{once:!0}),this.api.on(be.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",y)});break}case"metadata":{let y=this.api.config.maxBufferLength,v=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;let S=()=>{this.api&&(this.api.config.maxBufferLength=y,this.api.config.maxBufferSize=v)};this.nativeEl.addEventListener("play",S,{once:!0}),this.api.on(be.default.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",S)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",c(this,Rs)),m(this,Zt,document.createElement("source")),c(this,Zt).setAttribute("type","application/x-mpegURL"),c(this,Zt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(c(this,Zt));let g=new WeakMap;this.api.on(be.default.Events.MANIFEST_PARSED,(y,v)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(I=>{console.warn("Autoplay failed:",I)}),C(this,rt,Su).call(this);let S=this.videoTracks.getTrackById("main");S||(S=this.addVideoTrack("main"),S.id="main",S.selected=!0);for(let[I,B]of v.levels.entries()){let se=S.addRendition(B.url[0],B.width,B.height,B.videoCodec??void 0,B.bitrate);g.set(B,`${I}`),se.id=`${I}`}for(let[I,B]of v.audioTracks.entries()){let se=B.default?"main":"alternative",De=this.addAudioTrack(se,B.name,B.lang);De.id=`${I}`,B.default&&(De.enabled=!0)}}),(s=c(this,Xt))==null||s.call(this);let f=()=>{var I,B;let y=[...this.audioTracks].find(se=>se.enabled),v=y?+y.id:void 0,S=((I=this.api)==null?void 0:I.audioTracks.map(se=>se.id))??[];v!==void 0&&v!==((B=this.api)==null?void 0:B.audioTrack)&&S.includes(v)&&this.api&&(this.api.audioTrack=v)};this.audioTracks.addEventListener("change",f),m(this,Xt,()=>{this.audioTracks.removeEventListener("change",f)}),this.api.on(be.default.Events.LEVELS_UPDATED,(y,v)=>{let S=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!S)return;let I=v.levels.map(B=>g.get(B));for(let B of this.videoRenditions)B.id&&!I.includes(B.id)&&S.removeRendition(B)}),this.api.on(be.default.Events.LEVEL_SWITCHED,(y,v)=>{let S=v.level;d!==null&&S<d&&(console.warn(`hls.js downgraded quality from level ${d} to ${S} due to fragment load failure.`),this.videoRenditions.selectedIndex=S,d=null)});let E=()=>{let y=this.videoRenditions.selectedIndex;this.api&&y!==this.api.nextLevel&&(this.api.nextLevel=y)};(l=this.videoRenditions)==null||l.addEventListener("change",E),this.api.once(be.default.Events.DESTROYING,()=>{var y,v;C(this,rt,Su).call(this),(y=this.videoRenditions)==null||y.removeEventListener("change",E),(v=c(this,Xt))==null||v.call(this),m(this,Xt,null)});return}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}};Zt=new WeakMap,Xt=new WeakMap,jt=new WeakMap,xi=new WeakMap,Kn=new WeakMap,rt=new WeakSet,Au=function(){var t,r,n;(t=c(this,Zt))==null||t.remove(),m(this,Zt,null),(r=c(this,Xt))==null||r.call(this),m(this,Xt,null),(n=this.nativeEl)==null||n.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",c(this,Rs)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),m(this,Kn,!1)},cv=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},Su=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},Rs=new WeakMap,uv=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Pi.shadowRootOptions={...We.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",Pi);var ku=Pi;var xb="nanoplayer.4.min.js",Pb="nanoplayer",Pe={loading:!1,loaded:!1,error:null,callbacks:[]};function Db(i,e){return new Promise((t,r)=>{if(window.NanoPlayer){Pe.loaded=!0,t();return}if(Pe.loaded){t();return}if(Pe.error){r(Pe.error);return}if(Pe.callbacks.push(s=>{s?r(s):t()}),Pe.loading)return;Pe.loading=!0;let n;e?n=e:n=`${i.endsWith("/")?i:`${i}/`}${Pb}/${xb}`;let o=document.createElement("script");o.src=n,o.async=!0,o.onload=()=>{Pe.loaded=!0,Pe.loading=!1,Pe.callbacks.forEach(s=>s()),Pe.callbacks=[]},o.onerror=()=>{let s=new Error(`Failed to load NanoPlayer script from ${n}`);Pe.error=s,Pe.loading=!1,Pe.callbacks.forEach(l=>l(s)),Pe.callbacks=[]},document.head.appendChild(o)})}var Ob=Fn(We),pt,Di,fe,mt,qn,Le,Ms,Oi,Ni,Sr,kr,vt,Lr,Gn,zn,Ce,hv,Lu,pv,mv,vv,td,Ui=class extends Ob{constructor(){super();k(this,Ce);k(this,pt,null);k(this,Di,null);k(this,fe,null);k(this,mt,null);k(this,qn,"");k(this,Le,null);k(this,Ms,!0);k(this,Oi,[]);k(this,Ni,[]);k(this,Sr,[]);k(this,kr,null);k(this,vt,null);k(this,Lr,!1);k(this,Gn,!1);k(this,zn,null);this.api=null;C(this,Ce,td).call(this,"config"),C(this,Ce,td).call(this,"streamid"),C(this,Ce,td).call(this,"sourceConfig"),C(this,Ce,hv).call(this)}static get observedAttributes(){return[...We.observedAttributes,"streamid","library-location"]}static getTemplateHTML(t,r={}){let{streamid:n,"library-location":o,...s}=t;return`
2908
2908
  <script type="application/json" id="config">
2909
2909
  ${JSON.stringify(r.config||{})}
2910
2910
  <\/script>
2911
- ${Ve.getTemplateHTML(s)}
2912
- `}get activeVideoElement(){return c(this,Se)}get config(){return c(this,ut)}set config(t){v(this,ut,t)}get sourceConfig(){return c(this,Mi)}set sourceConfig(t){let r=c(this,Mi)!==t;v(this,Mi,t),r&&t&&this.load()}get streamid(){return this.getAttribute("streamid")}set streamid(t){t?this.setAttribute("streamid",t):this.removeAttribute("streamid")}get libraryLocation(){return this.getAttribute("library-location")||"/vendor/bp-player"}set libraryLocation(t){this.setAttribute("library-location",t)}attributeChangedCallback(t,r,n){t==="streamid"&&r!==n?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,n)}async load(){var s,l,d,h,p,f;let t=!c(this,ve);C(this,we,Au).call(this);let r=this.streamid,n=!!c(this,Mi);if(!r&&!n)return;if(v(this,Tr,new Promise(E=>{v(this,pt,E)})),t&&!c(this,ut))try{v(this,ut,JSON.parse(((l=(s=this.shadowRoot)==null?void 0:s.getElementById("config"))==null?void 0:l.textContent)||"{}"))}catch(E){console.error("[nano-video] Failed to parse config:",E),v(this,ut,{})}try{await Cb(this.libraryLocation,(d=c(this,ut))==null?void 0:d.scriptUrl)}catch(E){console.error("[nano-video] Failed to load NanoPlayer script:",E),this.dispatchEvent(nt(E)),(h=c(this,pt))==null||h.call(this);return}v(this,Wn,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),v(this,ht,document.createElement("div")),c(this,ht).id=c(this,Wn),c(this,ht).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.nativeEl.style.display="none",this.appendChild(c(this,ht)),v(this,ve,new window.NanoPlayer(c(this,Wn))),this.api=c(this,ve);try{let E=C(this,we,cv).call(this,r,n?c(this,Mi):void 0),m=await c(this,ve).setup(E);v(this,yr,((p=m.source.entries)==null?void 0:p.map((_,g)=>({index:g,height:_.info.height??0,width:_.info.width??0,bitrate:_.info.bitrate??0,label:_.info.height?`${_.info.height}p`:g===0?"Source":`Stream ${g+1}`})))??[]),C(this,we,hv).call(this)}catch(E){console.error("[nano-video] Failed to setup NanoPlayer:",E),this.dispatchEvent(nt(E)),(f=c(this,pt))==null||f.call(this)}}async play(){if(c(this,Tr)&&await c(this,Tr),c(this,ve)){v(this,Ar,!0),c(this,ve).play();return}return super.play()}pause(){if(c(this,ve)){c(this,ve).pause();return}super.pause()}get currentTime(){var t;return((t=c(this,Se))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){c(this,ve)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=c(this,Se))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=c(this,Se))==null?void 0:t.volume)??super.volume}set volume(t){c(this,Se)?c(this,Se).volume=t:super.volume=t}get muted(){var t;return((t=c(this,Se))==null?void 0:t.muted)??super.muted}set muted(t){c(this,Se)&&(c(this,Se).muted=t),c(this,ve)?t?c(this,ve).mute():c(this,ve).unmute():super.muted=t}get videoWidth(){var t;return((t=c(this,Se))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=c(this,Se))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t,r;C(this,we,Au).call(this),(t=c(this,qn))==null||t.call(this),v(this,qn,null),(r=super.disconnectedCallback)==null||r.call(this)}};ut=new WeakMap,Mi=new WeakMap,ve=new WeakMap,ht=new WeakMap,Wn=new WeakMap,Se=new WeakMap,Cs=new WeakMap,xi=new WeakMap,Pi=new WeakMap,yr=new WeakMap,Tr=new WeakMap,pt=new WeakMap,Ar=new WeakMap,Fn=new WeakMap,qn=new WeakMap,we=new WeakSet,dv=function(){let t=r=>{var n;r.target!==this&&((n=c(this,ht))!=null&&n.contains(r.target))&&c(this,Ar)&&r.stopImmediatePropagation()};this.addEventListener("pause",t,!0),v(this,qn,()=>this.removeEventListener("pause",t,!0))},Au=function(){var t;(t=c(this,pt))==null||t.call(this),v(this,Tr,null),v(this,pt,null),c(this,xi).forEach(r=>r()),v(this,xi,[]),c(this,Pi).forEach(r=>r()),v(this,Pi,[]);for(let r of this.videoTracks)this.removeVideoTrack(r);for(let r of this.audioTracks)this.removeAudioTrack(r);c(this,ve)&&(c(this,ve).destroy(),v(this,ve,null),this.api=null),c(this,ht)&&(c(this,ht).remove(),v(this,ht,null)),c(this,Se)&&(v(this,Se,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),v(this,Fn,!1),v(this,yr,[])},cv=function(t,r){var o,s;return{source:r??{group:{id:t},options:{adaption:{rule:"deviationOfMean2"},switch:{method:"server",pauseOnError:!1,forcePlay:!0,timeout:10}}},playback:{autoplay:this.nativeEl.autoplay,muted:this.nativeEl.muted,reconnect:((o=c(this,ut))==null?void 0:o.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((s=c(this,ut))==null?void 0:s.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(j(Sd)),this.dispatchEvent(j(bo)),this.dispatchEvent(j(Fs)),(l=c(this,pt))==null||l.call(this)},onPlay:()=>{v(this,Ar,!1),v(this,Fn,!0),this.dispatchEvent(j(fo)),this.dispatchEvent(j(ri))},onPause:()=>{this.dispatchEvent(j(qi))},onLoading:()=>{this.dispatchEvent(j(Or))},onStartBuffering:()=>{this.dispatchEvent(j(Or))},onStopBuffering:()=>{this.dispatchEvent(j(Fs)),this.dispatchEvent(j(ri))},onError:l=>{var p,f;v(this,Ar,!1);let d=l.data.code??-1,h=l.data.message??"NanoPlayer error";if(d===2004&&c(this,Fn)){this.dispatchEvent(j(Eo)),(p=c(this,pt))==null||p.call(this);return}this.dispatchEvent(nt(new Error(h),d)),(f=c(this,pt))==null||f.call(this)},onActiveVideoElementChange:l=>{var h;let d=(h=l.data)==null?void 0:h.activeVideoElement;d&&d!==c(this,Se)&&(v(this,Se,d),C(this,we,uv).call(this,d),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:d}})))}}}},uv=function(t){c(this,xi).forEach(n=>n()),v(this,xi,[]);let r=[go,Nr,yd,ni];for(let n of r){let o=()=>{this.dispatchEvent(j(n))};t.addEventListener(n,o),c(this,xi).push(()=>t.removeEventListener(n,o))}},hv=function(){c(this,Pi).forEach(n=>n()),v(this,Pi,[]);for(let n of this.videoTracks)this.removeVideoTrack(n);for(let n of this.audioTracks)this.removeAudioTrack(n);if(c(this,yr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let n of c(this,yr)){let o=t.addRendition("",n.width,n.height,void 0,n.bitrate);o.id=`${n.index}`}let r=()=>{var o,s,l;let n=this.videoRenditions.selectedIndex;n<0?(v(this,Cs,!0),(o=c(this,ve))==null||o.setAdaption({rule:"deviationOfMean2"})):(v(this,Cs,!1),(s=c(this,ve))==null||s.switchStream(n).catch(d=>{console.warn("[nano-video] Quality switch failed:",d)}),(l=c(this,ve))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r),c(this,Pi).push(()=>{this.videoRenditions.removeEventListener("change",r)})},jl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Di.shadowRootOptions={...Ve.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",Di);var Su=Di;var F=Qu("livekit-client");var Mb=Vn(Ve),Ge,U,he,ke,tt,Gn,zn,Nt,Sr,Oi,kr,Xt,G,Jl,ku,Rs,Kn,pv,mv,ed,vv,fv,td,Ms=class Ms extends Mb{constructor(){super();k(this,G);k(this,Ge,null);k(this,U,null);k(this,he,null);k(this,ke,null);k(this,tt,[]);k(this,Gn,[]);k(this,zn,[]);k(this,Nt,"disconnected");k(this,Sr,null);k(this,Oi,null);k(this,kr,null);k(this,Xt,null);this.room=null;C(this,G,td).call(this,"config"),C(this,G,td).call(this,"url"),C(this,G,td).call(this,"token")}static get observedAttributes(){return[...Ve.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:n,token:o,...s}=t;return`
2911
+ ${We.getTemplateHTML(s)}
2912
+ `}get activeVideoElement(){return c(this,Le)}get config(){return c(this,pt)}set config(t){m(this,pt,t)}get sourceConfig(){return c(this,Di)}set sourceConfig(t){let r=c(this,Di)!==t;m(this,Di,t),r&&t&&this.load()}get streamid(){return this.getAttribute("streamid")}set streamid(t){t?this.setAttribute("streamid",t):this.removeAttribute("streamid")}get libraryLocation(){return this.getAttribute("library-location")||"/vendor/bp-player"}set libraryLocation(t){this.setAttribute("library-location",t)}attributeChangedCallback(t,r,n){t==="streamid"&&r!==n?this.load():t!=="streamid"&&t!=="library-location"&&super.attributeChangedCallback(t,r,n)}async load(){var s,l,d,h,p,g;let t=!c(this,fe);C(this,Ce,Lu).call(this);let r=this.streamid,n=!!c(this,Di);if(!r&&!n)return;if(m(this,kr,new Promise(f=>{m(this,vt,f)})),t&&!c(this,pt))try{m(this,pt,JSON.parse(((l=(s=this.shadowRoot)==null?void 0:s.getElementById("config"))==null?void 0:l.textContent)||"{}"))}catch(f){console.error("[nano-video] Failed to parse config:",f),m(this,pt,{})}try{await Db(this.libraryLocation,(d=c(this,pt))==null?void 0:d.scriptUrl)}catch(f){console.error("[nano-video] Failed to load NanoPlayer script:",f),this.dispatchEvent(Ne(f)),(h=c(this,vt))==null||h.call(this);return}m(this,qn,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),m(this,mt,document.createElement("div")),c(this,mt).id=c(this,qn),c(this,mt).style.cssText="width: 100%; height: 100%; position: absolute; top: 0; left: 0;",getComputedStyle(this).position==="static"&&(this.style.position="relative"),this.nativeEl.style.display="none",this.appendChild(c(this,mt)),m(this,fe,new window.NanoPlayer(c(this,qn))),this.api=c(this,fe);try{let f=C(this,Ce,pv).call(this,r,n?c(this,Di):void 0),E=await c(this,fe).setup(f);m(this,Sr,((p=E.source.entries)==null?void 0:p.map((y,v)=>({index:v,height:y.info.height??0,width:y.info.width??0,bitrate:y.info.bitrate??0,label:y.info.height?`${y.info.height}p`:v===0?"Source":`Stream ${v+1}`})))??[]),C(this,Ce,vv).call(this)}catch(f){console.error("[nano-video] Failed to setup NanoPlayer:",f),this.dispatchEvent(Ne(f)),(g=c(this,vt))==null||g.call(this)}}async play(){if(c(this,kr)&&await c(this,kr),c(this,fe)){m(this,Lr,!0),c(this,fe).play();return}return super.play()}pause(){if(c(this,fe)){c(this,fe).pause();return}super.pause()}get currentTime(){var t;return((t=c(this,Le))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){c(this,fe)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=c(this,Le))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=c(this,Le))==null?void 0:t.volume)??super.volume}set volume(t){c(this,Le)?c(this,Le).volume=t:super.volume=t}get muted(){var t;return((t=c(this,Le))==null?void 0:t.muted)??super.muted}set muted(t){c(this,Le)&&(c(this,Le).muted=t),c(this,fe)?t?c(this,fe).mute():c(this,fe).unmute():super.muted=t}get videoWidth(){var t;return((t=c(this,Le))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=c(this,Le))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t,r;C(this,Ce,Lu).call(this),(t=c(this,zn))==null||t.call(this),m(this,zn,null),(r=super.disconnectedCallback)==null||r.call(this)}};pt=new WeakMap,Di=new WeakMap,fe=new WeakMap,mt=new WeakMap,qn=new WeakMap,Le=new WeakMap,Ms=new WeakMap,Oi=new WeakMap,Ni=new WeakMap,Sr=new WeakMap,kr=new WeakMap,vt=new WeakMap,Lr=new WeakMap,Gn=new WeakMap,zn=new WeakMap,Ce=new WeakSet,hv=function(){let t=r=>{var n;r.target!==this&&((n=c(this,mt))!=null&&n.contains(r.target))&&c(this,Lr)&&r.stopImmediatePropagation()};this.addEventListener("pause",t,!0),m(this,zn,()=>this.removeEventListener("pause",t,!0))},Lu=function(){var t;(t=c(this,vt))==null||t.call(this),m(this,kr,null),m(this,vt,null),c(this,Oi).forEach(r=>r()),m(this,Oi,[]),c(this,Ni).forEach(r=>r()),m(this,Ni,[]);for(let r of this.videoTracks)this.removeVideoTrack(r);for(let r of this.audioTracks)this.removeAudioTrack(r);c(this,fe)&&(c(this,fe).destroy(),m(this,fe,null),this.api=null),c(this,mt)&&(c(this,mt).remove(),m(this,mt,null)),c(this,Le)&&(m(this,Le,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),m(this,Gn,!1),m(this,Sr,[])},pv=function(t,r){var o,s;return{source:r??{group:{id:t},options:{adaption:{rule:"deviationOfMean2"},switch:{method:"server",pauseOnError:!1,forcePlay:!0,timeout:10}}},playback:{autoplay:this.nativeEl.autoplay,muted:this.nativeEl.muted,reconnect:((o=c(this,pt))==null?void 0:o.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((s=c(this,pt))==null?void 0:s.buffer)??{min:.1,max:2,target:.5}},style:{width:"100%",height:"100%",controls:!1,view:!1,interactive:!1},events:{onReady:()=>{var l;this.dispatchEvent(J(wd)),this.dispatchEvent(J(yo)),this.dispatchEvent(J(Gs)),(l=c(this,vt))==null||l.call(this)},onPlay:()=>{m(this,Lr,!1),m(this,Gn,!0),this.dispatchEvent(J(go)),this.dispatchEvent(J(oi))},onPause:()=>{this.dispatchEvent(J(zi))},onLoading:()=>{this.dispatchEvent(J(Hr))},onStartBuffering:()=>{this.dispatchEvent(J(Hr))},onStopBuffering:()=>{this.dispatchEvent(J(Gs)),this.dispatchEvent(J(oi))},onError:l=>{var p,g;m(this,Lr,!1);let d=l.data.code??-1,h=l.data.message??"NanoPlayer error";if(d===2004&&c(this,Gn)){this.dispatchEvent(J(bo)),(p=c(this,vt))==null||p.call(this);return}this.dispatchEvent(Ne(new Error(h),d)),(g=c(this,vt))==null||g.call(this)},onActiveVideoElementChange:l=>{var h;let d=(h=l.data)==null?void 0:h.activeVideoElement;d&&d!==c(this,Le)&&(m(this,Le,d),C(this,Ce,mv).call(this,d),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:d}})))}}}},mv=function(t){c(this,Oi).forEach(n=>n()),m(this,Oi,[]);let r=[_o,$r,Sd,si];for(let n of r){let o=()=>{this.dispatchEvent(J(n))};t.addEventListener(n,o),c(this,Oi).push(()=>t.removeEventListener(n,o))}},vv=function(){c(this,Ni).forEach(n=>n()),m(this,Ni,[]);for(let n of this.videoTracks)this.removeVideoTrack(n);for(let n of this.audioTracks)this.removeAudioTrack(n);if(c(this,Sr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let n of c(this,Sr)){let o=t.addRendition("",n.width,n.height,void 0,n.bitrate);o.id=`${n.index}`}let r=()=>{var o,s,l;let n=this.videoRenditions.selectedIndex;n<0?(m(this,Ms,!0),(o=c(this,fe))==null||o.setAdaption({rule:"deviationOfMean2"})):(m(this,Ms,!1),(s=c(this,fe))==null||s.switchStream(n).catch(d=>{console.warn("[nano-video] Quality switch failed:",d)}),(l=c(this,fe))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r),c(this,Ni).push(()=>{this.videoRenditions.removeEventListener("change",r)})},td=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ui.shadowRootOptions={...We.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",Ui);var wu=Ui;var K=ju("livekit-client");var Nb=Fn(We),Ye,U,pe,we,nt,Qn,Zn,$t,wr,Hi,Ir,Jt,z,id,Iu,xs,Yn,fv,Ev,rd,gv,bv,nd,Ps=class Ps extends Nb{constructor(){super();k(this,z);k(this,Ye,null);k(this,U,null);k(this,pe,null);k(this,we,null);k(this,nt,[]);k(this,Qn,[]);k(this,Zn,[]);k(this,$t,"disconnected");k(this,wr,null);k(this,Hi,null);k(this,Ir,null);k(this,Jt,null);this.room=null;C(this,z,nd).call(this,"config"),C(this,z,nd).call(this,"url"),C(this,z,nd).call(this,"token")}static get observedAttributes(){return[...We.observedAttributes,"url","token"]}static getTemplateHTML(t,r={}){let{url:n,token:o,...s}=t;return`
2913
2913
  <script type="application/json" id="config">
2914
2914
  ${JSON.stringify(r.config||{})}
2915
2915
  <\/script>
2916
- ${Ve.getTemplateHTML(s)}
2917
- `}get activeVideoElement(){return c(this,he)}get config(){return c(this,Ge)}set config(t){v(this,Ge,t)}get url(){return this.getAttribute("url")}set url(t){t?this.setAttribute("url",t):this.removeAttribute("url")}get token(){return this.getAttribute("token")}set token(t){t?this.setAttribute("token",t):this.removeAttribute("token")}attributeChangedCallback(t,r,n){(t==="url"||t==="token")&&r!==n?this.url&&this.token?this.load():c(this,U)&&C(this,G,Jl).call(this):t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,n)}async load(){var jt,Ut,Yn;let t=!c(this,U);C(this,G,Jl).call(this);let r=this.url,n=this.token;if(!r||!n)return;if(v(this,Sr,new Promise(A=>{v(this,Oi,A)})),t&&!c(this,Ge))try{v(this,Ge,JSON.parse(((Ut=(jt=this.shadowRoot)==null?void 0:jt.getElementById("config"))==null?void 0:Ut.textContent)||"{}"))}catch(A){console.error("[livekit-video] Failed to parse config:",A),v(this,Ge,{})}let o=C(this,G,vv).call(this),s=C(this,G,fv).call(this);v(this,U,new F.Room(o)),this.room=c(this,U);let l=()=>{v(this,Nt,"connected")},d=A=>{let w=A!=null?F.DisconnectReason[A]??String(A):"undefined";console.log("[livekit-video] Disconnected",{reason:A,reasonName:w,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState}),v(this,Nt,"disconnected"),C(this,G,Rs).call(this),A?this.dispatchEvent(nt(new Error(`LiveKit disconnected: ${w} (${A})`),4001)):this.dispatchEvent(j(Eo))},h=()=>{console.log("[livekit-video] Reconnecting",{documentHidden:document.hidden,documentHasFocus:document.hasFocus()}),v(this,Nt,"reconnecting"),this.dispatchEvent(j(Or))},p=()=>{console.log("[livekit-video] Reconnected"),v(this,Nt,"connected"),this.dispatchEvent(j(ri))},f=()=>{console.log("[livekit-video] SignalReconnecting")},E=A=>{console.log("[livekit-video] ConnectionStateChanged",A)},m=A=>{console.error("[livekit-video] MediaDevicesError",A)},_=A=>{console.log("[livekit-video] AudioPlaybackStatusChanged",A),A?(C(this,G,Rs).call(this),C(this,G,Kn).call(this)):C(this,G,ku).call(this)},g=(A,w,W)=>{console.error("[livekit-video] TrackSubscriptionFailed",{trackSid:A,reason:W})},I=A=>{console.log("[livekit-video] TrackMuted",{sid:A.trackSid,kind:A.kind})},L=A=>{console.log("[livekit-video] TrackUnmuted",{sid:A.trackSid,kind:A.kind})},le=(A,w)=>{var W,de,ie,Y;if(A.kind===F.Track.Kind.Video){let $=A.attach();$.style.width="100%",$.style.height="100%",$.style.objectFit="contain",$.style.position="absolute",$.style.top="0",$.style.left="0",$.playsInline=!0,$.setAttribute("playsinline",""),$.setAttribute("webkit-playsinline",""),this.nativeEl.muted&&($.muted=!0),this.nativeEl.style.display="none",(W=this.shadowRoot)==null||W.appendChild($),v(this,he,$),C(this,G,pv).call(this,$),C(this,G,mv).call(this,w),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:$}})),this.dispatchEvent(j(Ad)),this.dispatchEvent(j(ni)),this.dispatchEvent(j(bo)),this.dispatchEvent(j(ri)),(de=c(this,Oi))==null||de.call(this)}else if(A.kind===F.Track.Kind.Audio){let $=A.attach();$.style.display="none",(ie=this.shadowRoot)==null||ie.appendChild($),v(this,ke,$),C(this,G,Kn).call(this);let ze=()=>{c(this,ke)===$&&C(this,G,Kn).call(this)};$.addEventListener(Nr,ze),(Y=c(this,Xt))==null||Y.call(this),v(this,Xt,()=>$.removeEventListener(Nr,ze)),c(this,U)&&!c(this,U).canPlaybackAudio&&C(this,G,ku).call(this)}},Ie=A=>{var w;A.kind===F.Track.Kind.Video?(A.detach(),C(this,G,ed).call(this),c(this,he)&&(c(this,tt).forEach(W=>W()),v(this,tt,[]),c(this,he).remove(),v(this,he,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}})))):A.kind===F.Track.Kind.Audio&&(A.detach(),c(this,ke)&&(c(this,ke).remove(),v(this,ke,null)),(w=c(this,Xt))==null||w.call(this),v(this,Xt,null),C(this,G,Rs).call(this))};c(this,U).on(F.RoomEvent.Connected,l),c(this,U).on(F.RoomEvent.Disconnected,d),c(this,U).on(F.RoomEvent.Reconnecting,h),c(this,U).on(F.RoomEvent.Reconnected,p),c(this,U).on(F.RoomEvent.SignalReconnecting,f),c(this,U).on(F.RoomEvent.ConnectionStateChanged,E),c(this,U).on(F.RoomEvent.MediaDevicesError,m),c(this,U).on(F.RoomEvent.AudioPlaybackStatusChanged,_),c(this,U).on(F.RoomEvent.TrackSubscribed,le),c(this,U).on(F.RoomEvent.TrackUnsubscribed,Ie),c(this,U).on(F.RoomEvent.TrackSubscriptionFailed,g),c(this,U).on(F.RoomEvent.TrackMuted,I),c(this,U).on(F.RoomEvent.TrackUnmuted,L),v(this,zn,[()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.Connected,l)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.Disconnected,d)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.Reconnecting,h)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.Reconnected,p)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.SignalReconnecting,f)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.ConnectionStateChanged,E)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.MediaDevicesError,m)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.AudioPlaybackStatusChanged,_)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.TrackSubscribed,le)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.TrackUnsubscribed,Ie)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.TrackSubscriptionFailed,g)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.TrackMuted,I)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(F.RoomEvent.TrackUnmuted,L)}]),v(this,Nt,"connecting"),this.dispatchEvent(j(Td));try{await c(this,U).connect(r,n,s)}catch(A){v(this,Nt,"failed"),console.error("[livekit-video] Failed to connect:",A);let w=A instanceof Error?A.message:"Failed to connect to LiveKit room";this.dispatchEvent(nt(new Error(w),4e3)),(Yn=c(this,Oi))==null||Yn.call(this)}}async play(){return c(this,Sr)&&await c(this,Sr),c(this,he)?c(this,he).play():super.play()}pause(){if(c(this,he)){c(this,he).pause();return}super.pause()}get currentTime(){var t;return((t=c(this,he))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){c(this,U)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=c(this,he))==null?void 0:t.paused)??super.paused}get volume(){return super.volume}set volume(t){super.volume=t,c(this,he)&&(c(this,he).volume=t),c(this,ke)&&(c(this,ke).volume=t)}get muted(){return super.muted}set muted(t){super.muted=t,c(this,he)&&(c(this,he).muted=t),c(this,ke)&&(c(this,ke).muted=t)}get videoWidth(){var t;return((t=c(this,he))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=c(this,he))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;C(this,G,Jl).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Ge=new WeakMap,U=new WeakMap,he=new WeakMap,ke=new WeakMap,tt=new WeakMap,Gn=new WeakMap,zn=new WeakMap,Nt=new WeakMap,Sr=new WeakMap,Oi=new WeakMap,kr=new WeakMap,Xt=new WeakMap,G=new WeakSet,Jl=function(){var t,r;(t=c(this,Oi))==null||t.call(this),v(this,Sr,null),v(this,Oi,null),c(this,tt).forEach(n=>n()),v(this,tt,[]),C(this,G,ed).call(this),c(this,zn).forEach(n=>n()),v(this,zn,[]),c(this,U)&&(c(this,U).disconnect(),v(this,U,null),this.room=null),c(this,he)&&(c(this,he).remove(),v(this,he,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),c(this,ke)&&(c(this,ke).remove(),v(this,ke,null)),(r=c(this,Xt))==null||r.call(this),v(this,Xt,null),C(this,G,Rs).call(this),v(this,Nt,"disconnected")},ku=function(){if(c(this,kr))return;let t=!1,r=()=>{let n=c(this,U);if(!n)return;let o=n.startAudio();C(this,G,Kn).call(this),o.then(()=>{c(this,U)===n&&C(this,G,Kn).call(this)}).catch(s=>{t||(t=!0,console.warn("[livekit-video] startAudio failed",s))})};document.addEventListener("click",r,{capture:!0}),document.addEventListener("touchend",r,{capture:!0,passive:!0}),document.addEventListener("keydown",r,{capture:!0}),v(this,kr,()=>{document.removeEventListener("click",r,{capture:!0}),document.removeEventListener("touchend",r,{capture:!0}),document.removeEventListener("keydown",r,{capture:!0})})},Rs=function(){var t;(t=c(this,kr))==null||t.call(this),v(this,kr,null)},Kn=function(){c(this,ke)&&(c(this,ke).muted=nd(Ms.prototype,this,"muted"),c(this,ke).volume=nd(Ms.prototype,this,"volume"))},pv=function(t){c(this,tt).forEach(s=>s()),v(this,tt,[]);let r=[go,fo,ri,qi,ni];for(let s of r){let l=()=>{this.dispatchEvent(j(s))};t.addEventListener(s,l),c(this,tt).push(()=>t.removeEventListener(s,l))}let n=()=>{var l,d,h;let s=t.srcObject;console.error("[livekit-video] attached <video> error",{code:(l=t.error)==null?void 0:l.code,message:(d=t.error)==null?void 0:d.message,readyState:t.readyState,networkState:t.networkState,paused:t.paused,srcObjectActive:s==null?void 0:s.active,tracks:s==null?void 0:s.getTracks().map(p=>({kind:p.kind,readyState:p.readyState,muted:p.muted,enabled:p.enabled})),documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState,roomState:(h=c(this,U))==null?void 0:h.state})};t.addEventListener("error",n),c(this,tt).push(()=>t.removeEventListener("error",n));let o=()=>{console.warn("[livekit-video] attached <video> stalled",{readyState:t.readyState,networkState:t.networkState,documentHidden:document.hidden})};t.addEventListener("stalled",o),c(this,tt).push(()=>t.removeEventListener("stalled",o))},mv=function(t){var l;C(this,G,ed).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let n=this.addVideoTrack("main");n.id="main",n.selected=!0;let o=[...r].sort((d,h)=>d.quality-h.quality);for(let d of o){let h=n.addRendition("",d.width,d.height,void 0,d.bitrate);h.id=`${d.quality}`}let s=()=>{let d=this.videoRenditions.selectedIndex;if(d<0)t.setVideoQuality(F.VideoQuality.HIGH);else{let h=o[d];h&&t.setVideoQuality(h.quality)}};this.videoRenditions.addEventListener("change",s),c(this,Gn).push(()=>this.videoRenditions.removeEventListener("change",s))},ed=function(){c(this,Gn).forEach(t=>t()),v(this,Gn,[]);for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},vv=function(){var t,r,n;return{adaptiveStream:((t=c(this,Ge))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=c(this,Ge))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((n=c(this,Ge))==null?void 0:n.disconnectOnPageLeave)??!1}},fv=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=c(this,Ge))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=c(this,Ge))==null?void 0:r.iceTransportPolicy)??"all"}}},td=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ms.shadowRootOptions={...Ve.shadowRootOptions};var Lr=Ms;globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",Lr);var Lu=Lr;return xv(xb);})();
2916
+ ${We.getTemplateHTML(s)}
2917
+ `}get activeVideoElement(){return c(this,pe)}get config(){return c(this,Ye)}set config(t){m(this,Ye,t)}get url(){return this.getAttribute("url")}set url(t){t?this.setAttribute("url",t):this.removeAttribute("url")}get token(){return this.getAttribute("token")}set token(t){t?this.setAttribute("token",t):this.removeAttribute("token")}attributeChangedCallback(t,r,n){(t==="url"||t==="token")&&r!==n?this.url&&this.token?this.load():c(this,U)&&C(this,z,id).call(this):t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,n)}async load(){var De,ft,ei;let t=!c(this,U);C(this,z,id).call(this);let r=this.url,n=this.token;if(!r||!n)return;if(m(this,wr,new Promise(A=>{m(this,Hi,A)})),t&&!c(this,Ye))try{m(this,Ye,JSON.parse(((ft=(De=this.shadowRoot)==null?void 0:De.getElementById("config"))==null?void 0:ft.textContent)||"{}"))}catch(A){console.error("[livekit-video] Failed to parse config:",A),m(this,Ye,{})}let o=C(this,z,gv).call(this),s=C(this,z,bv).call(this);m(this,U,new K.Room(o)),this.room=c(this,U);let l=()=>{m(this,$t,"connected")},d=A=>{let w=A!=null?K.DisconnectReason[A]??String(A):"undefined";console.log("[livekit-video] Disconnected",{reason:A,reasonName:w,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState}),m(this,$t,"disconnected"),C(this,z,xs).call(this),A?this.dispatchEvent(Ne(new Error(`LiveKit disconnected: ${w} (${A})`),4001)):this.dispatchEvent(J(bo))},h=()=>{console.log("[livekit-video] Reconnecting",{documentHidden:document.hidden,documentHasFocus:document.hasFocus()}),m(this,$t,"reconnecting"),this.dispatchEvent(J(Hr))},p=()=>{console.log("[livekit-video] Reconnected"),m(this,$t,"connected"),this.dispatchEvent(J(oi))},g=()=>{console.log("[livekit-video] SignalReconnecting")},f=A=>{console.log("[livekit-video] ConnectionStateChanged",A)},E=A=>{console.error("[livekit-video] MediaDevicesError",A)},y=A=>{console.log("[livekit-video] AudioPlaybackStatusChanged",A),A?(C(this,z,xs).call(this),C(this,z,Yn).call(this)):C(this,z,Iu).call(this)},v=(A,w,F)=>{console.error("[livekit-video] TrackSubscriptionFailed",{trackSid:A,reason:F})},S=A=>{console.log("[livekit-video] TrackMuted",{sid:A.trackSid,kind:A.kind})},I=A=>{console.log("[livekit-video] TrackUnmuted",{sid:A.trackSid,kind:A.kind})},B=(A,w)=>{var F,ce,re,Q;if(A.kind===K.Track.Kind.Video){let $=A.attach();$.style.width="100%",$.style.height="100%",$.style.objectFit="contain",$.style.position="absolute",$.style.top="0",$.style.left="0",$.playsInline=!0,$.setAttribute("playsinline",""),$.setAttribute("webkit-playsinline",""),this.nativeEl.muted&&($.muted=!0),this.nativeEl.style.display="none",(F=this.shadowRoot)==null||F.appendChild($),m(this,pe,$),C(this,z,fv).call(this,$),C(this,z,Ev).call(this,w),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:$}})),this.dispatchEvent(J(Ld)),this.dispatchEvent(J(si)),this.dispatchEvent(J(yo)),this.dispatchEvent(J(oi)),(ce=c(this,Hi))==null||ce.call(this)}else if(A.kind===K.Track.Kind.Audio){let $=A.attach();$.style.display="none",(re=this.shadowRoot)==null||re.appendChild($),m(this,we,$),C(this,z,Yn).call(this);let Qe=()=>{c(this,we)===$&&C(this,z,Yn).call(this)};$.addEventListener($r,Qe),(Q=c(this,Jt))==null||Q.call(this),m(this,Jt,()=>$.removeEventListener($r,Qe)),c(this,U)&&!c(this,U).canPlaybackAudio&&C(this,z,Iu).call(this)}},se=A=>{var w;A.kind===K.Track.Kind.Video?(A.detach(),C(this,z,rd).call(this),c(this,pe)&&(c(this,nt).forEach(F=>F()),m(this,nt,[]),c(this,pe).remove(),m(this,pe,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}})))):A.kind===K.Track.Kind.Audio&&(A.detach(),c(this,we)&&(c(this,we).remove(),m(this,we,null)),(w=c(this,Jt))==null||w.call(this),m(this,Jt,null),C(this,z,xs).call(this))};c(this,U).on(K.RoomEvent.Connected,l),c(this,U).on(K.RoomEvent.Disconnected,d),c(this,U).on(K.RoomEvent.Reconnecting,h),c(this,U).on(K.RoomEvent.Reconnected,p),c(this,U).on(K.RoomEvent.SignalReconnecting,g),c(this,U).on(K.RoomEvent.ConnectionStateChanged,f),c(this,U).on(K.RoomEvent.MediaDevicesError,E),c(this,U).on(K.RoomEvent.AudioPlaybackStatusChanged,y),c(this,U).on(K.RoomEvent.TrackSubscribed,B),c(this,U).on(K.RoomEvent.TrackUnsubscribed,se),c(this,U).on(K.RoomEvent.TrackSubscriptionFailed,v),c(this,U).on(K.RoomEvent.TrackMuted,S),c(this,U).on(K.RoomEvent.TrackUnmuted,I),m(this,Zn,[()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.Connected,l)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.Disconnected,d)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.Reconnecting,h)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.Reconnected,p)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.SignalReconnecting,g)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.ConnectionStateChanged,f)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.MediaDevicesError,E)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.AudioPlaybackStatusChanged,y)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.TrackSubscribed,B)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.TrackUnsubscribed,se)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.TrackSubscriptionFailed,v)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.TrackMuted,S)},()=>{var A;return(A=c(this,U))==null?void 0:A.off(K.RoomEvent.TrackUnmuted,I)}]),m(this,$t,"connecting"),this.dispatchEvent(J(kd));try{await c(this,U).connect(r,n,s)}catch(A){m(this,$t,"failed"),console.error("[livekit-video] Failed to connect:",A);let w=A instanceof Error?A.message:"Failed to connect to LiveKit room";this.dispatchEvent(Ne(new Error(w),4e3)),(ei=c(this,Hi))==null||ei.call(this)}}async play(){return c(this,wr)&&await c(this,wr),c(this,pe)?c(this,pe).play():super.play()}pause(){if(c(this,pe)){c(this,pe).pause();return}super.pause()}get currentTime(){var t;return((t=c(this,pe))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){c(this,U)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=c(this,pe))==null?void 0:t.paused)??super.paused}get volume(){return super.volume}set volume(t){super.volume=t,c(this,pe)&&(c(this,pe).volume=t),c(this,we)&&(c(this,we).volume=t)}get muted(){return super.muted}set muted(t){super.muted=t,c(this,pe)&&(c(this,pe).muted=t),c(this,we)&&(c(this,we).muted=t)}get videoWidth(){var t;return((t=c(this,pe))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=c(this,pe))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;C(this,z,id).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Ye=new WeakMap,U=new WeakMap,pe=new WeakMap,we=new WeakMap,nt=new WeakMap,Qn=new WeakMap,Zn=new WeakMap,$t=new WeakMap,wr=new WeakMap,Hi=new WeakMap,Ir=new WeakMap,Jt=new WeakMap,z=new WeakSet,id=function(){var t,r;(t=c(this,Hi))==null||t.call(this),m(this,wr,null),m(this,Hi,null),c(this,nt).forEach(n=>n()),m(this,nt,[]),C(this,z,rd).call(this),c(this,Zn).forEach(n=>n()),m(this,Zn,[]),c(this,U)&&(c(this,U).disconnect(),m(this,U,null),this.room=null),c(this,pe)&&(c(this,pe).remove(),m(this,pe,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),c(this,we)&&(c(this,we).remove(),m(this,we,null)),(r=c(this,Jt))==null||r.call(this),m(this,Jt,null),C(this,z,xs).call(this),m(this,$t,"disconnected")},Iu=function(){if(c(this,Ir))return;let t=!1,r=()=>{let n=c(this,U);if(!n)return;let o=n.startAudio();C(this,z,Yn).call(this),o.then(()=>{c(this,U)===n&&C(this,z,Yn).call(this)}).catch(s=>{t||(t=!0,console.warn("[livekit-video] startAudio failed",s))})};document.addEventListener("click",r,{capture:!0}),document.addEventListener("touchend",r,{capture:!0,passive:!0}),document.addEventListener("keydown",r,{capture:!0}),m(this,Ir,()=>{document.removeEventListener("click",r,{capture:!0}),document.removeEventListener("touchend",r,{capture:!0}),document.removeEventListener("keydown",r,{capture:!0})})},xs=function(){var t;(t=c(this,Ir))==null||t.call(this),m(this,Ir,null)},Yn=function(){c(this,we)&&(c(this,we).muted=ad(Ps.prototype,this,"muted"),c(this,we).volume=ad(Ps.prototype,this,"volume"))},fv=function(t){c(this,nt).forEach(s=>s()),m(this,nt,[]);let r=[_o,go,oi,zi,si];for(let s of r){let l=()=>{this.dispatchEvent(J(s))};t.addEventListener(s,l),c(this,nt).push(()=>t.removeEventListener(s,l))}let n=()=>{var l,d,h;let s=t.srcObject;console.error("[livekit-video] attached <video> error",{code:(l=t.error)==null?void 0:l.code,message:(d=t.error)==null?void 0:d.message,readyState:t.readyState,networkState:t.networkState,paused:t.paused,srcObjectActive:s==null?void 0:s.active,tracks:s==null?void 0:s.getTracks().map(p=>({kind:p.kind,readyState:p.readyState,muted:p.muted,enabled:p.enabled})),documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState,roomState:(h=c(this,U))==null?void 0:h.state})};t.addEventListener("error",n),c(this,nt).push(()=>t.removeEventListener("error",n));let o=()=>{console.warn("[livekit-video] attached <video> stalled",{readyState:t.readyState,networkState:t.networkState,documentHidden:document.hidden})};t.addEventListener("stalled",o),c(this,nt).push(()=>t.removeEventListener("stalled",o))},Ev=function(t){var l;C(this,z,rd).call(this);let r=(l=t.trackInfo)==null?void 0:l.layers;if(!r||r.length===0)return;let n=this.addVideoTrack("main");n.id="main",n.selected=!0;let o=[...r].sort((d,h)=>d.quality-h.quality);for(let d of o){let h=n.addRendition("",d.width,d.height,void 0,d.bitrate);h.id=`${d.quality}`}let s=()=>{let d=this.videoRenditions.selectedIndex;if(d<0)t.setVideoQuality(K.VideoQuality.HIGH);else{let h=o[d];h&&t.setVideoQuality(h.quality)}};this.videoRenditions.addEventListener("change",s),c(this,Qn).push(()=>this.videoRenditions.removeEventListener("change",s))},rd=function(){c(this,Qn).forEach(t=>t()),m(this,Qn,[]);for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},gv=function(){var t,r,n;return{adaptiveStream:((t=c(this,Ye))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=c(this,Ye))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((n=c(this,Ye))==null?void 0:n.disconnectOnPageLeave)??!1}},bv=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=c(this,Ye))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=c(this,Ye))==null?void 0:r.iceTransportPolicy)??"all"}}},nd=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ps.shadowRootOptions={...We.shadowRootOptions};var Cr=Ps;globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",Cr);var Cu=Cr;return Ov(Ub);})();
2918
2918
  /*! Bundled license information:
2919
2919
 
2920
2920
  @lit/reactive-element/css-tag.js: