@broadcastingplatforms/player 1.4.4 → 1.4.6
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 +118 -118
- package/dist/bp-player.mjs +121 -121
- package/dist/bp-player.standalone.mjs +80 -80
- package/dist/components/bp-default-ui.d.ts +1 -1
- package/dist/components/bp-error-display.d.ts +1 -1
- package/dist/components/bp-overlay.d.ts +1 -1
- package/dist/components/bp-player.d.ts +1 -1
- package/dist/core/player-core.d.ts +19 -0
- package/dist/elements/hls-video.d.ts +7 -0
- package/dist/elements/livekit-video.d.ts +7 -0
- package/dist/elements/nano-video.d.ts +7 -0
- package/package.json +1 -2
package/dist/bp-player.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* BP Player (v1.4.
|
|
2
|
+
* BP Player (v1.4.6)
|
|
3
3
|
* Universal video player web component
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var BPPlayer=(()=>{var fv=Object.create;var kr=Object.defineProperty;var Hu=Object.getOwnPropertyDescriptor;var Ev=Object.getOwnPropertyNames;var gv=Object.getPrototypeOf,bv=Object.prototype.hasOwnProperty;var $u=i=>{throw TypeError(i)};var _v=(i,e,t)=>e in i?kr(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Bu=(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 yv=(i,e)=>{for(var t in e)kr(i,t,{get:e[t],enumerable:!0})},Vu=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ev(e))!bv.call(i,o)&&o!==t&&kr(i,o,{get:()=>e[o],enumerable:!(r=Hu(e,o))||r.enumerable});return i};var Tv=(i,e,t)=>(t=i!=null?fv(gv(i)):{},Vu(e||!i||!i.__esModule?kr(t,"default",{value:i,enumerable:!0}):t,i)),Av=i=>Vu(kr({},"__esModule",{value:!0}),i),U=(i,e,t,r)=>{for(var o=r>1?void 0:r?Hu(e,t):e,n=i.length-1,s;n>=0;n--)(s=i[n])&&(o=(r?s(e,t,o):s(o))||o);return r&&o&&kr(e,t,o),o};var $=(i,e,t)=>_v(i,typeof e!="symbol"?e+"":e,t),Zl=(i,e,t)=>e.has(i)||$u("Cannot "+t);var u=(i,e,t)=>(Zl(i,e,"read from private field"),t?t.call(i):e.get(i)),L=(i,e,t)=>e.has(i)?$u("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),v=(i,e,t,r)=>(Zl(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),P=(i,e,t)=>(Zl(i,e,"access private method"),t);var Ab={};yv(Ab,{Attribute:()=>ln,BPDefaultUI:()=>te,BPErrorDisplay:()=>Ft,BPLiveError:()=>et,BPLiveService:()=>wr,BPOverlay:()=>xt,BPPlayer:()=>we,Hls:()=>Re.default,HlsVideo:()=>Li,HlsVideoElement:()=>mu,LiveKitVideo:()=>xi,LiveKitVideoElement:()=>Eu,NANOPLAYER_NO_REPLAY_CODES:()=>sh,NanoVideo:()=>Ri,NanoVideoElement:()=>fu,StateReceiverMixin:()=>dh,StateReceiverProps:()=>Hi,addGlobalStyles:()=>Cr,classifyLiveKitError:()=>Ms,classifyNanoPlayerError:()=>Rs,createInitialState:()=>en,createPlayerCore:()=>Ps,createTemplate:()=>ph,forEachStateReceiverElement:()=>$i,isBPLiveClipSource:()=>rn,isBPLiveSource:()=>xs,isBPLiveStreamSource:()=>tn,isStateReceiverElement:()=>Ds,propagateStateToReceiver:()=>sn,removeStateFromReceiver:()=>an,templateWithStyles:()=>mh,toggleAttribute:()=>Ee});var ks=globalThis,Ls=ks.ShadowRoot&&(ks.ShadyCSS===void 0||ks.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Xl=Symbol(),Wu=new WeakMap,qo=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Xl)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(Ls&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Wu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Wu.set(t,e))}return e}toString(){return this.cssText}},Fu=i=>new qo(typeof i=="string"?i:i+"",void 0,Xl),Ko=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,o,n)=>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.")})(o)+i[n+1],i[0]);return new qo(t,i,Xl)},qu=(i,e)=>{if(Ls)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),o=ks.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,i.appendChild(r)}},Jl=Ls?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return Fu(t)})(i):i;var{is:Sv,defineProperty:kv,getOwnPropertyDescriptor:Lv,getOwnPropertyNames:Iv,getOwnPropertySymbols:wv,getPrototypeOf:Cv}=Object,Qt=globalThis,Ku=Qt.trustedTypes,Rv=Ku?Ku.emptyScript:"",jl=Qt.reactiveElementPolyfillSupport,Go=(i,e)=>i,zo={toAttribute(i,e){switch(e){case Boolean:i=i?Rv: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}},Is=(i,e)=>!Sv(i,e),Gu={attribute:!0,type:String,converter:zo,reflect:!1,useDefault:!1,hasChanged:Is};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Qt.litPropertyMetadata??(Qt.litPropertyMetadata=new WeakMap);var Nt=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=Gu){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),o=this.getPropertyDescriptor(e,r,t);o!==void 0&&kv(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:n}=Lv(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:o,set(s){let l=o==null?void 0:o.call(this);n==null||n.call(this,s),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Gu}static _$Ei(){if(this.hasOwnProperty(Go("elementProperties")))return;let e=Cv(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Go("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Go("properties"))){let t=this.properties,r=[...Iv(t),...wv(t)];for(let o of r)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,o]of t)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let o=this._$Eu(t,r);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let o of r)t.unshift(Jl(o))}else e!==void 0&&t.push(Jl(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 qu(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var n;let r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){let s=(((n=r.converter)==null?void 0:n.toAttribute)!==void 0?r.converter:zo).toAttribute(t,r.type);this._$Em=e,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(e,t){var n,s;let r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let l=r.getPropertyOptions(o),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:zo;this._$Em=o;let h=d.fromAttribute(t,l.type);this[o]=h??((s=this._$Ej)==null?void 0:s.get(o))??h,this._$Em=null}}requestUpdate(e,t,r,o=!1,n){var s;if(e!==void 0){let l=this.constructor;if(o===!1&&(n=this[e]),r??(r=l.getPropertyOptions(e)),!((r.hasChanged??Is)(n,t)||r.useDefault&&r.reflect&&n===((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:o,wrapped:n},s){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,s??t??this[e]),n!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,s]of o){let{wrapped:l}=s,d=this[n];l!==!0||this._$AL.has(n)||d===void 0||this.C(n,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(o=>{var n;return(n=o.hostUpdate)==null?void 0:n.call(o)}),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var o;return(o=r.hostUpdated)==null?void 0:o.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Nt.elementStyles=[],Nt.shadowRootOptions={mode:"open"},Nt[Go("elementProperties")]=new Map,Nt[Go("finalized")]=new Map,jl==null||jl({ReactiveElement:Nt}),(Qt.reactiveElementVersions??(Qt.reactiveElementVersions=[])).push("2.1.2");var Qo=globalThis,zu=i=>i,ws=Qo.trustedTypes,Yu=ws?ws.createPolicy("lit-html",{createHTML:i=>i}):void 0,eh="$lit$",Zt=`lit$${Math.random().toFixed(9).slice(2)}$`,th="?"+Zt,Mv=`<${th}>`,Oi=document,Zo=()=>Oi.createComment(""),Xo=i=>i===null||typeof i!="object"&&typeof i!="function",ad=Array.isArray,xv=i=>ad(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",ed=`[
|
|
6
|
-
\f\r]`,
|
|
7
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Xu=/'/g,Ju=/"/g,ih=/^(?:script|style|textarea|title)$/i,ld=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Ge=ld(1),Rb=ld(2),Mb=ld(3),Ni=Symbol.for("lit-noChange"),_e=Symbol.for("lit-nothing"),ju=new WeakMap,Di=Oi.createTreeWalker(Oi,129);function rh(i,e){if(!ad(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yu!==void 0?Yu.createHTML(e):e}var Pv=(i,e)=>{let t=i.length-1,r=[],o,n=e===2?"<svg>":e===3?"<math>":"",s=Yo;for(let l=0;l<t;l++){let d=i[l],h,p,g=-1,E=0;for(;E<d.length&&(s.lastIndex=E,p=s.exec(d),p!==null);)E=s.lastIndex,s===Yo?p[1]==="!--"?s=Qu:p[1]!==void 0?s=Zu:p[2]!==void 0?(ih.test(p[2])&&(o=RegExp("</"+p[2],"g")),s=Pi):p[3]!==void 0&&(s=Pi):s===Pi?p[0]===">"?(s=o??Yo,g=-1):p[1]===void 0?g=-2:(g=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?Pi:p[3]==='"'?Ju:Xu):s===Ju||s===Xu?s=Pi:s===Qu||s===Zu?s=Yo:(s=Pi,o=void 0);let m=s===Pi&&i[l+1].startsWith("/>")?" ":"";n+=s===Yo?d+Mv:g>=0?(r.push(h),d.slice(0,g)+eh+d.slice(g)+Zt+m):d+Zt+(g===-2?l:m)}return[rh(i,n+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},Jo=class i{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let n=0,s=0,l=e.length-1,d=this.parts,[h,p]=Pv(e,t);if(this.el=i.createElement(h,r),Di.currentNode=this.el.content,t===2||t===3){let g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(o=Di.nextNode())!==null&&d.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let g of o.getAttributeNames())if(g.endsWith(eh)){let E=p[s++],m=o.getAttribute(g).split(Zt),T=/([.?@])?(.*)/.exec(E);d.push({type:1,index:n,name:T[2],strings:m,ctor:T[1]==="."?rd:T[1]==="?"?od:T[1]==="@"?nd:Ir}),o.removeAttribute(g)}else g.startsWith(Zt)&&(d.push({type:6,index:n}),o.removeAttribute(g));if(ih.test(o.tagName)){let g=o.textContent.split(Zt),E=g.length-1;if(E>0){o.textContent=ws?ws.emptyScript:"";for(let m=0;m<E;m++)o.append(g[m],Zo()),Di.nextNode(),d.push({type:2,index:++n});o.append(g[E],Zo())}}}else if(o.nodeType===8)if(o.data===th)d.push({type:2,index:n});else{let g=-1;for(;(g=o.data.indexOf(Zt,g+1))!==-1;)d.push({type:7,index:n}),g+=Zt.length-1}n++}}static createElement(e,t){let r=Oi.createElement("template");return r.innerHTML=e,r}};function Lr(i,e,t=i,r){var s,l;if(e===Ni)return e;let o=r!==void 0?(s=t._$Co)==null?void 0:s[r]:t._$Cl,n=Xo(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==n&&((l=o==null?void 0:o._$AO)==null||l.call(o,!1),n===void 0?o=void 0:(o=new n(i),o._$AT(i,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=o:t._$Cl=o),o!==void 0&&(e=Lr(i,o._$AS(i,e.values),o,r)),e}var id=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,o=((e==null?void 0:e.creationScope)??Oi).importNode(t,!0);Di.currentNode=o;let n=Di.nextNode(),s=0,l=0,d=r[0];for(;d!==void 0;){if(s===d.index){let h;d.type===2?h=new jo(n,n.nextSibling,this,e):d.type===1?h=new d.ctor(n,d.name,d.strings,this,e):d.type===6&&(h=new sd(n,this,e)),this._$AV.push(h),d=r[++l]}s!==(d==null?void 0:d.index)&&(n=Di.nextNode(),s++)}return Di.currentNode=Oi,o}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},jo=class i{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,o){this.type=2,this._$AH=_e,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Lr(this,e,t),Xo(e)?e===_e||e==null||e===""?(this._$AH!==_e&&this._$AR(),this._$AH=_e):e!==this._$AH&&e!==Ni&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):xv(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==_e&&Xo(this._$AH)?this._$AA.nextSibling.data=e:this.T(Oi.createTextNode(e)),this._$AH=e}$(e){var n;let{values:t,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=Jo.createElement(rh(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===o)this._$AH.p(t);else{let s=new id(o,this),l=s.u(this.options);s.p(t),this.T(l),this._$AH=s}}_$AC(e){let t=ju.get(e.strings);return t===void 0&&ju.set(e.strings,t=new Jo(e)),t}k(e){ad(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,o=0;for(let n of e)o===t.length?t.push(r=new i(this.O(Zo()),this.O(Zo()),this,this.options)):r=t[o],r._$AI(n),o++;o<t.length&&(this._$AR(r&&r._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let o=zu(e).nextSibling;zu(e).remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Ir=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,n){this.type=1,this._$AH=_e,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=_e}_$AI(e,t=this,r,o){let n=this.strings,s=!1;if(n===void 0)e=Lr(this,e,t,0),s=!Xo(e)||e!==this._$AH&&e!==Ni,s&&(this._$AH=e);else{let l=e,d,h;for(e=n[0],d=0;d<n.length-1;d++)h=Lr(this,l[r+d],t,d),h===Ni&&(h=this._$AH[d]),s||(s=!Xo(h)||h!==this._$AH[d]),h===_e?e=_e:e!==_e&&(e+=(h??"")+n[d+1]),this._$AH[d]=h}s&&!o&&this.j(e)}j(e){e===_e?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},rd=class extends Ir{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===_e?void 0:e}},od=class extends Ir{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==_e)}},nd=class extends Ir{constructor(e,t,r,o,n){super(e,t,r,o,n),this.type=5}_$AI(e,t=this){if((e=Lr(this,e,t,0)??_e)===Ni)return;let r=this._$AH,o=e===_e&&r!==_e||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==_e&&(r===_e||o);o&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},sd=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){Lr(this,e)}};var td=Qo.litHtmlPolyfillSupport;td==null||td(Jo,jo),(Qo.litHtmlVersions??(Qo.litHtmlVersions=[])).push("3.3.2");var oh=(i,e,t)=>{let r=(t==null?void 0:t.renderBefore)??e,o=r._$litPart$;if(o===void 0){let n=(t==null?void 0:t.renderBefore)??null;r._$litPart$=o=new jo(e.insertBefore(Zo(),n),n,void 0,t??{})}return o._$AI(i),o};var Ui=globalThis,Pe=class extends Nt{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=oh(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 Ni}},nh;Pe._$litElement$=!0,Pe.finalized=!0,(nh=Ui.litElementHydrateSupport)==null||nh.call(Ui,{LitElement:Pe});var dd=Ui.litElementPolyfillSupport;dd==null||dd({LitElement:Pe});(Ui.litElementVersions??(Ui.litElementVersions=[])).push("4.2.2");var Xt=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Dv={attribute:!0,type:String,converter:zo,reflect:!1,hasChanged:Is},Ov=(i=Dv,e,t)=>{let{kind:r,metadata:o}=t,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(t.name,i),r==="accessor"){let{name: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 W(i){return(e,t)=>typeof t=="object"?Ov(i,e,t):((r,o,n)=>{let s=o.hasOwnProperty(n);return o.constructor.createProperty(n,r),s?Object.getOwnPropertyDescriptor(o,n):void 0})(i,e,t)}function Jt(i){return W({...i,state:!0,attribute:!1})}var sh=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function Rs(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 Ms(i){return i===4e3||i===4001?"network":"unknown"}function en(){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 tn(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function rn(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function xs(i){return tn(i)||rn(i)}var et=class extends Error{constructor(t,r,o){super(t);this.code=r;this.status=o;this.name="BPLiveError"}},wr=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 et("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 o=new AbortController,n=setTimeout(()=>o.abort(),3e4);try{let s=await fetch(t,{method:"GET",headers:r,signal:o.signal});if(!s.ok)throw new et(`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 et("Request timeout after 30s","TIMEOUT"):s}finally{clearTimeout(n)}}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 et(`Unknown player source provider: ${e.provider}`,"UNKNOWN_PROVIDER")}selectClipMedia(e,t="landscape"){let r=e.filter(l=>l.type==="clip");if(r.length===0)return null;let o=r.find(l=>l.orientation===t);if(o)return o;let n=t==="landscape"?"portrait":"landscape",s=r.find(l=>l.orientation===n);return s||r[0]}mapClipMediaToPlayerSource(e){return{type:"video",url:e.url}}async resolveSource(e){if(this._stream=null,this._clip=null,tn(e))return this.resolveStreamSource(e);if(rn(e))return this.resolveClipSource(e);throw new et("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,E,m,T,f;let r=(await this.getStream(e.streamId)).data;this._stream=r;let o=this.extractStreamPoster(r);if(!!r.ended_at&&((d=(l=r.media)==null?void 0:l.vod)==null?void 0:d.length)>0){let b=r.media.vod[0];return{source:{type:"video",url:b.original},contentType:"video",poster:o??b.thumb??void 0,videoWidth:(h=b.dimension)==null?void 0:h.width,videoHeight:(p=b.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:o};if(((m=(E=r.media)==null?void 0:E.vod)==null?void 0:m.length)>0){let b=r.media.vod[0];return{source:{type:"video",url:b.original},contentType:"video",poster:o??b.thumb??void 0,videoWidth:(T=b.dimension)==null?void 0:T.width,videoHeight:(f=b.dimension)==null?void 0:f.height}}throw new et("Stream is not live and has no VOD content","STREAM_OFFLINE")}async resolveClipSource(e){let r=(await this.getClip(e.clipId)).data;this._clip=r;let o=this.selectClipMedia(r.media,e.preferredOrientation);if(!o)throw new et("No playable media found in clip","NO_MEDIA");return{source:this.mapClipMediaToPlayerSource(o),contentType:"clip",poster:o.thumbnail??void 0,videoWidth:o.width,videoHeight:o.height}}destroy(){this._authToken=null,this._stream=null,this._clip=null}};function on(i){return i!=null&&typeof i.then=="function"}function ah(i){return new Promise((e,t)=>{let r=!1,o=n=>{r||(r=!0,n?t(n):e())};try{let n=i(o);on(n)&&(r=!0,n.then(()=>e(),t))}catch(n){o(n)}})}var cd=class{constructor(e,t,r){this._closed=!1;this._pendingCount=0;this._firstError=null;this._redirectResult=null;this._responseResult=null;this.promise=new Promise((o,n)=>{this._resolve=o,this._reject=n}),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());on(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");on(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(ah(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())}},ud=class{constructor(e,t){this._closed=!1;this._pendingCount=0;this._firstError=null;this._responseResult=null;this.promise=new Promise((r,o)=>{this._resolve=r,this._reject=o}),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());on(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");on(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(ah(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())}},nn=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,o=null;for(let n of this._requestInterceptors.slice()){let s=new cd(t,n,!r);try{await s.promise}catch{continue}s.responseResult&&!r&&(r=!0,o=s.responseResult),s.redirectResult&&!r&&(t=s.redirectResult)}return{url:t.url,headers:t.headers,response:o}}async interceptResponse(e){let t={...e,headers:{...e.headers}};for(let r of this._responseInterceptors.slice()){let o=new ud(t,r);try{await o.promise}catch{continue}o.responseResult&&(t={...t,status:o.responseResult.status!==void 0?o.responseResult.status:t.status,headers:o.responseResult.headers!==void 0?o.responseResult.headers:t.headers,body:"body"in o.responseResult?o.responseResult.body:t.body})}return{status:t.status,headers:t.headers,body:t.body}}};function Nv(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 lh(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var Uv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],hd=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._network=new nn;this._currentProviderType=null;this._ready=!1;this._loadGeneration=0;this._state=en()}get state(){return this._state}get videoElement(){return this._mediaElement}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 o of r)this._listeners.has(o)||this._listeners.set(o,new Set),this._listeners.get(o).add(t)}removeEventListener(e,t){let r=Array.isArray(e)?e:[e];for(let o of r){let n=this._listeners.get(o);n&&(n.delete(t),n.size===0&&this._listeners.delete(o))}}dispatch(e,t){let r=this._listeners.get(e);if(r)for(let o of r)try{o(t)}catch(n){console.error(`[PlayerCore] Error in event listener for "${e}":`,n)}}updateState(e){this._state={...this._state,...e},this.dispatch("statechange",{state:this._state})}attach(e,t){this._destroyed||(this._container=e,this._config=t,this._ready=!0)}async loadSource(e,t,r){if(this._destroyed)return;let o=++this._loadGeneration,n=t??this._container,s=r??this._config;if(!n){console.error("[PlayerCore] No container provided. Call attach() first or provide container to loadSource().");return}this._container=n,s&&(this._config=s);let l=lh(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,E;if(lh(e)){if(s!=null&&s.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new wr(s.bpLive,this._network)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let S=await this._bpLive.resolveSource(e);if(o!==this._loadGeneration)return;d=S.source,h=S.contentType,p=S.poster,g=S.videoWidth,E=S.videoHeight}let m=Nv(d),b=m==="nano"||m==="livekit"||h==="stream"?"live":"vod";return this._mediaElement&&this.destroyMediaElement(),this._currentProviderType=m,this.updateState({providerType:m,contentType:h,streamType:b,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),n.appendChild(this._mediaElement),this._ready=!0,this.dispatch("videoelementchange",{video:this._mediaElement}),{poster:p,videoWidth:g,videoHeight:E}}catch(d){if(o!==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._container)for(;this._container.firstChild;)this._container.removeChild(this._container.firstChild)}createMediaElement(e,t,r){switch(e){case"nano":{let o=document.createElement("nano-video"),n=t;return o.libraryLocation=(r==null?void 0:r.libraryLocation)??"/vendor/bp-player",n.source?o.sourceConfig=n.source:n.streamid&&(o.streamid=n.streamid),r!=null&&r.nano&&(o.config=r.nano),o}case"livekit":{let o=document.createElement("livekit-video"),n=t;return o.url=n.url,o.token=n.token,r!=null&&r.livekit&&(o.config=r.livekit),o}case"video":default:{let o=document.createElement("hls-video"),n=typeof t=="string"?t:t.url;o.src=n;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",E=await l.intercept({url:p,method:"GET",type:g,headers:{}});E.url!==p&&h.open("GET",E.url,!0);for(let[m,T]of Object.entries(E.headers))h.setRequestHeader(m,T);d&&await d(h,E.url)},o.config=s,o}}}attachMediaElementListeners(e){for(let t of Uv){let r=o=>this.handleMediaEvent(t,e,o);e.addEventListener(t,r),this._eventCleanup.push(()=>e.removeEventListener(t,r))}}handleMediaEvent(e,t,r){switch(e){case"loadstart":this.updateState({readyState:1}),this.dispatch("loadstart",void 0);break;case"loadedmetadata":{let o=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,videoWidth:t.videoWidth,videoHeight:t.videoHeight,streamType:o}),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 o=t.duration===1/0?"live":this._state.streamType;this.updateState({duration:t.duration,streamType:o}),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 o=-1,n="Unknown error";r instanceof ErrorEvent&&r.error?(o=r.error.code??-1,n=r.error.message??r.message??"Unknown error"):t.error&&(o=t.error.code??-1,n=t.error.message??"Unknown error");let s="media",l=!0;this._state.providerType==="nano"&&o>0?(s=Rs(o),l=s!=="offline"&&s!=="autoplay"):this._state.providerType==="livekit"&&o>0&&(s=Ms(o),l=!0);let d={code:o,message:n,fatal:l,category:s};this.updateState({error:d}),this.dispatch("error",d);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({...en(),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){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"});let t=this._getFullscreenTarget();t&&(e&&!document.fullscreenElement?await t.requestFullscreen():!e&&document.fullscreenElement&&await document.exitFullscreen())}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){this._destroyed||(this._destroyed=!0,this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function Ps(){return new hd}var Hi="bpPlayerObservedProperties";function Ds(i){return Hi in i&&Array.isArray(i[Hi])}function dh(i,e){class t extends i{get[Hi](){return e}}return t}function Hv(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 $i(i,e,t){if(e!=null&&e.contains(i))return;i.nodeName.includes("-")&&!Ds(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),Ds(i)&&t(i);let r=Hv(i);r.length>0&&await Promise.all(r.map(o=>$i(o,e,t)))}function sn(i,e,t){let r=i[Hi];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 an(i){i[Hi].includes("player")&&(i.player=void 0)}var ch=`/**
|
|
5
|
+
"use strict";var BPPlayer=(()=>{var fv=Object.create;var Ir=Object.defineProperty;var Hu=Object.getOwnPropertyDescriptor;var Ev=Object.getOwnPropertyNames;var gv=Object.getPrototypeOf,bv=Object.prototype.hasOwnProperty;var $u=i=>{throw TypeError(i)};var _v=(i,e,t)=>e in i?Ir(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Bu=(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 yv=(i,e)=>{for(var t in e)Ir(i,t,{get:e[t],enumerable:!0})},Vu=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ev(e))!bv.call(i,n)&&n!==t&&Ir(i,n,{get:()=>e[n],enumerable:!(r=Hu(e,n))||r.enumerable});return i};var Tv=(i,e,t)=>(t=i!=null?fv(gv(i)):{},Vu(e||!i||!i.__esModule?Ir(t,"default",{value:i,enumerable:!0}):t,i)),Av=i=>Vu(Ir({},"__esModule",{value:!0}),i),H=(i,e,t,r)=>{for(var n=r>1?void 0:r?Hu(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&&Ir(e,t,n),n};var V=(i,e,t)=>_v(i,typeof e!="symbol"?e+"":e,t),Xl=(i,e,t)=>e.has(i)||$u("Cannot "+t);var u=(i,e,t)=>(Xl(i,e,"read from private field"),t?t.call(i):e.get(i)),L=(i,e,t)=>e.has(i)?$u("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),E=(i,e,t,r)=>(Xl(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),D=(i,e,t)=>(Xl(i,e,"access private method"),t);var Ab={};yv(Ab,{Attribute:()=>co,BPDefaultUI:()=>oe,BPErrorDisplay:()=>Kt,BPLiveError:()=>it,BPLiveService:()=>Rr,BPOverlay:()=>Dt,BPPlayer:()=>Ce,Hls:()=>Me.default,HlsVideo:()=>Ci,HlsVideoElement:()=>vu,LiveKitVideo:()=>Oi,LiveKitVideoElement:()=>gu,NANOPLAYER_NO_REPLAY_CODES:()=>sh,NanoVideo:()=>Pi,NanoVideoElement:()=>Eu,StateReceiverMixin:()=>dh,StateReceiverProps:()=>Vi,addGlobalStyles:()=>Mr,classifyLiveKitError:()=>Ps,classifyNanoPlayerError:()=>xs,createInitialState:()=>io,createPlayerCore:()=>Os,createTemplate:()=>ph,forEachStateReceiverElement:()=>Wi,isBPLiveClipSource:()=>no,isBPLiveSource:()=>Ds,isBPLiveStreamSource:()=>ro,isStateReceiverElement:()=>Ns,propagateStateToReceiver:()=>ao,removeStateFromReceiver:()=>lo,templateWithStyles:()=>mh,toggleAttribute:()=>ge});var Is=globalThis,ws=Is.ShadowRoot&&(Is.ShadyCSS===void 0||Is.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,jl=Symbol(),Wu=new WeakMap,Gn=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==jl)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(ws&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Wu.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Wu.set(t,e))}return e}toString(){return this.cssText}},Fu=i=>new Gn(typeof i=="string"?i:i+"",void 0,jl),zn=(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 Gn(t,i,jl)},qu=(i,e)=>{if(ws)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=Is.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}},Jl=ws?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return Fu(t)})(i):i;var{is:Sv,defineProperty:kv,getOwnPropertyDescriptor:Lv,getOwnPropertyNames:Iv,getOwnPropertySymbols:wv,getPrototypeOf:Cv}=Object,jt=globalThis,Ku=jt.trustedTypes,Rv=Ku?Ku.emptyScript:"",ed=jt.reactiveElementPolyfillSupport,Yn=(i,e)=>i,Qn={toAttribute(i,e){switch(e){case Boolean:i=i?Rv: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}},Cs=(i,e)=>!Sv(i,e),Gu={attribute:!0,type:String,converter:Qn,reflect:!1,useDefault:!1,hasChanged:Cs};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=Gu){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&kv(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:o}=Lv(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)??Gu}static _$Ei(){if(this.hasOwnProperty(Yn("elementProperties")))return;let e=Cv(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Yn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Yn("properties"))){let t=this.properties,r=[...Iv(t),...wv(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(Jl(n))}else e!==void 0&&t.push(Jl(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 qu(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:Qn).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:Qn;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??Cs)(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[Yn("elementProperties")]=new Map,Ht[Yn("finalized")]=new Map,ed==null||ed({ReactiveElement:Ht}),(jt.reactiveElementVersions??(jt.reactiveElementVersions=[])).push("2.1.2");var Xn=globalThis,zu=i=>i,Rs=Xn.trustedTypes,Yu=Rs?Rs.createPolicy("lit-html",{createHTML:i=>i}):void 0,eh="$lit$",Jt=`lit$${Math.random().toFixed(9).slice(2)}$`,th="?"+Jt,Mv=`<${th}>`,Hi=document,jn=()=>Hi.createComment(""),Jn=i=>i===null||typeof i!="object"&&typeof i!="function",ld=Array.isArray,xv=i=>ld(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",td=`[
|
|
6
|
+
\f\r]`,Zn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Qu=/-->/g,Zu=/>/g,Ni=RegExp(`>|${td}(?:([^\\s"'>=/]+)(${td}*=${td}*(?:[^
|
|
7
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Xu=/'/g,ju=/"/g,ih=/^(?:script|style|textarea|title)$/i,dd=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),ze=dd(1),Rb=dd(2),Mb=dd(3),$i=Symbol.for("lit-noChange"),ye=Symbol.for("lit-nothing"),Ju=new WeakMap,Ui=Hi.createTreeWalker(Hi,129);function rh(i,e){if(!ld(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yu!==void 0?Yu.createHTML(e):e}var Pv=(i,e)=>{let t=i.length-1,r=[],n,o=e===2?"<svg>":e===3?"<math>":"",s=Zn;for(let l=0;l<t;l++){let d=i[l],h,p,v=-1,f=0;for(;f<d.length&&(s.lastIndex=f,p=s.exec(d),p!==null);)f=s.lastIndex,s===Zn?p[1]==="!--"?s=Qu:p[1]!==void 0?s=Zu:p[2]!==void 0?(ih.test(p[2])&&(n=RegExp("</"+p[2],"g")),s=Ni):p[3]!==void 0&&(s=Ni):s===Ni?p[0]===">"?(s=n??Zn,v=-1):p[1]===void 0?v=-2:(v=s.lastIndex-p[2].length,h=p[1],s=p[3]===void 0?Ni:p[3]==='"'?ju:Xu):s===ju||s===Xu?s=Ni:s===Qu||s===Zu?s=Zn:(s=Ni,n=void 0);let m=s===Ni&&i[l+1].startsWith("/>")?" ":"";o+=s===Zn?d+Mv:v>=0?(r.push(h),d.slice(0,v)+eh+d.slice(v)+Jt+m):d+Jt+(v===-2?l:m)}return[rh(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},eo=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]=Pv(e,t);if(this.el=i.createElement(h,r),Ui.currentNode=this.el.content,t===2||t===3){let v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(n=Ui.nextNode())!==null&&d.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let v of n.getAttributeNames())if(v.endsWith(eh)){let f=p[s++],m=n.getAttribute(v).split(Jt),_=/([.?@])?(.*)/.exec(f);d.push({type:1,index:o,name:_[2],strings:m,ctor:_[1]==="."?nd:_[1]==="?"?od:_[1]==="@"?sd:Cr}),n.removeAttribute(v)}else v.startsWith(Jt)&&(d.push({type:6,index:o}),n.removeAttribute(v));if(ih.test(n.tagName)){let v=n.textContent.split(Jt),f=v.length-1;if(f>0){n.textContent=Rs?Rs.emptyScript:"";for(let m=0;m<f;m++)n.append(v[m],jn()),Ui.nextNode(),d.push({type:2,index:++o});n.append(v[f],jn())}}}else if(n.nodeType===8)if(n.data===th)d.push({type:2,index:o});else{let v=-1;for(;(v=n.data.indexOf(Jt,v+1))!==-1;)d.push({type:7,index:o}),v+=Jt.length-1}o++}}static createElement(e,t){let r=Hi.createElement("template");return r.innerHTML=e,r}};function wr(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=Jn(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=wr(i,n._$AS(i,e.values),n,r)),e}var rd=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 to(o,o.nextSibling,this,e):d.type===1?h=new d.ctor(o,d.name,d.strings,this,e):d.type===6&&(h=new ad(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++}},to=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=wr(this,e,t),Jn(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):xv(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ye&&Jn(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=eo.createElement(rh(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 rd(n,this),l=s.u(this.options);s.p(t),this.T(l),this._$AH=s}}_$AC(e){let t=Ju.get(e.strings);return t===void 0&&Ju.set(e.strings,t=new eo(e)),t}k(e){ld(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(jn()),this.O(jn()),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=zu(e).nextSibling;zu(e).remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Cr=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=wr(this,e,t,0),s=!Jn(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=wr(this,l[r+d],t,d),h===$i&&(h=this._$AH[d]),s||(s=!Jn(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??"")}},nd=class extends Cr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ye?void 0:e}},od=class extends Cr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ye)}},sd=class extends Cr{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=wr(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)}},ad=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){wr(this,e)}};var id=Xn.litHtmlPolyfillSupport;id==null||id(eo,to),(Xn.litHtmlVersions??(Xn.litHtmlVersions=[])).push("3.3.2");var nh=(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 to(e.insertBefore(jn(),o),o,void 0,t??{})}return n._$AI(i),n};var Bi=globalThis,Pe=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=nh(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}},oh;Pe._$litElement$=!0,Pe.finalized=!0,(oh=Bi.litElementHydrateSupport)==null||oh.call(Bi,{LitElement:Pe});var cd=Bi.litElementPolyfillSupport;cd==null||cd({LitElement:Pe});(Bi.litElementVersions??(Bi.litElementVersions=[])).push("4.2.2");var ei=i=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};var Dv={attribute:!0,type:String,converter:Qn,reflect:!1,hasChanged:Cs},Ov=(i=Dv,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"?Ov(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 ti(i){return z({...i,state:!0,attribute:!1})}var sh=[1005,1007,1008,1009,3001,3002,3003,3004,3005,3100,3101,3200,4003];function xs(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 Ps(i){return i===4e3||i===4001?"network":"unknown"}function io(){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 ro(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"streamId"in i}function no(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="bplive"&&"clipId"in i}function Ds(i){return ro(i)||no(i)}var it=class extends Error{constructor(t,r,n){super(t);this.code=r;this.status=n;this.name="BPLiveError"}},Rr=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 it("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 it(`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 it("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 it(`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,ro(e))return this.resolveStreamSource(e);if(no(e))return this.resolveClipSource(e);throw new it("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,v,f,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??((v=r.active_stream)==null?void 0:v.player_source);if(s)return{source:this.mapPlayerSourceToResolvedSource(s),contentType:"stream",poster:n};if(((m=(f=r.media)==null?void 0:f.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 it("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 it("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 oo(i){return i!=null&&typeof i.then=="function"}function ah(i){return new Promise((e,t)=>{let r=!1,n=o=>{r||(r=!0,o?t(o):e())};try{let o=i(n);oo(o)&&(r=!0,o.then(()=>e(),t))}catch(o){n(o)}})}var ud=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());oo(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");oo(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(ah(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())}},hd=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());oo(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");oo(e)?this._handleWaitUntil(e):typeof e=="function"&&this._handleWaitUntil(ah(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())}},so=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 ud(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 hd(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 Nv(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 lh(i){return typeof i=="object"&&i!==null&&i.type==="bplive"}var Uv=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","ratechange","volumechange","ended","progress","error","resize"],pd=class{constructor(){this._mediaElement=null;this._container=null;this._listeners=new Map;this._eventCleanup=[];this._destroyed=!1;this._bpLive=null;this._network=new so;this._currentProviderType=null;this._ready=!1;this._loadGeneration=0;this._state=io()}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=lh(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,v,f;if(lh(e)){if(s!=null&&s.bpLive&&(this._bpLive&&this._bpLive.destroy(),this._bpLive=new Rr(s.bpLive,this._network)),!this._bpLive)throw new Error("BPLive source requires config.bpLive configuration.");let S=await this._bpLive.resolveSource(e);if(n!==this._loadGeneration)return;d=S.source,h=S.contentType,p=S.poster,v=S.videoWidth,f=S.videoHeight}let m=Nv(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:v,videoHeight:f}}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"),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"),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"),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 v=p.includes(".m3u8")?"manifest":p.includes(".ts")||p.includes(".m4s")||p.includes(".fmp4")?"segment":"other",f=await l.intercept({url:p,method:"GET",type:v,headers:{}});f.url!==p&&h.open("GET",f.url,!0);for(let[m,_]of Object.entries(f.headers))h.setRequestHeader(m,_);d&&await d(h,f.url)},n.config=s,n}}}attachMediaElementListeners(e){for(let t of Uv){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 v=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:v==null?void 0:v.tagName,nativeElErrorCode:(l=v==null?void 0:v.error)==null?void 0:l.code,nativeElSrc:v==null?void 0:v.currentSrc,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState});let f="media",m=!0;this._state.providerType==="nano"&&d>0?(f=xs(d),m=f!=="offline"&&f!=="autoplay"):this._state.providerType==="livekit"&&d>0&&(f=Ps(d),m=!0);let _={code:d,message:h,fatal:m,category:f};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({...io(),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){this.updateState({fullscreen:e,presentationMode:e?"fullscreen":"inline"}),this.dispatch("fullscreenchange",{fullscreen:e}),this.dispatch("presentationmodechange",{mode:e?"fullscreen":"inline"});let t=this._getFullscreenTarget();t&&(e&&!document.fullscreenElement?await t.requestFullscreen():!e&&document.fullscreenElement&&await document.exitFullscreen())}setPresentationMode(e){this.updateState({presentationMode:e,fullscreen:e==="fullscreen"}),this.dispatch("presentationmodechange",{mode:e})}destroy(){this._destroyed||(this._destroyed=!0,this.unloadSource(),this._bpLive&&(this._bpLive.destroy(),this._bpLive=null),this._container=null,this._config=void 0,this._ready=!1,this.dispatch("destroy",void 0),this._listeners.clear())}};function Os(){return new pd}var Vi="bpPlayerObservedProperties";function Ns(i){return Vi in i&&Array.isArray(i[Vi])}function dh(i,e){class t extends i{get[Vi](){return e}}return t}function Hv(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("-")&&!Ns(i)&&(await Promise.resolve(),await customElements.whenDefined(i.nodeName.toLowerCase()),customElements.upgrade(i)),Ns(i)&&t(i);let r=Hv(i);r.length>0&&await Promise.all(r.map(n=>Wi(n,e,t)))}function ao(i,e,t){let r=i[Vi];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 lo(i){i[Vi].includes("player")&&(i.player=void 0)}var ch=`/**
|
|
8
8
|
* BP Player CSS Custom Properties
|
|
9
9
|
*
|
|
10
10
|
* All styling can be customized by overriding these CSS variables.
|
|
@@ -136,8 +136,8 @@ html.bp-player-full-window > body {
|
|
|
136
136
|
margin: 0 !important;
|
|
137
137
|
padding: 0 !important;
|
|
138
138
|
}
|
|
139
|
-
`;var hh=!1;function
|
|
140
|
-
`+uh,document.head.appendChild(i),hh=!0}function ph(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function mh(i,e){return`<style>${i}</style>${e}`}var
|
|
139
|
+
`;var hh=!1;function Mr(){if(hh)return;let i=document.createElement("style");i.id="bp-player-global-styles",i.textContent=ch+`
|
|
140
|
+
`+uh,document.head.appendChild(i),hh=!0}function ph(i,e){let t;return()=>(t||(t=document.createElement("template"),t.innerHTML=e),t)}function mh(i,e){return`<style>${i}</style>${e}`}var co=(C=>(C.CONFIGURATION="configuration",C.SOURCE="source",C.SOURCES="sources",C.AUTOPLAY="autoplay",C.MUTED="muted",C.LOOP="loop",C.SCALING="scaling",C.ASPECT_RATIO="aspect-ratio",C.DEBUG="debug",C.AUTOHIDE="autohide",C.HOTKEYS="hotkeys",C.PAUSED="paused",C.PLAYING="playing",C.ENDED="ended",C.SEEKING="seeking",C.WAITING="waiting",C.LOADING="loading",C.READY="ready",C.HAS_ERROR="has-error",C.HAS_FIRST_PLAY="has-first-play",C.FULLSCREEN="fullscreen",C.FULLWINDOW="fullwindow",C.DEVICE_TYPE="device-type",C.MOBILE="mobile",C.TV="tv",C.STREAM_TYPE="stream-type",C.LIVE="live",C.CONTENT_TYPE="content-type",C.USER_IDLE="user-idle",C.USER_IDLE_TIMEOUT="user-idle-timeout",C.MOBILE_ONLY="mobile-only",C.MOBILE_HIDDEN="mobile-hidden",C.TV_ONLY="tv-only",C.TV_HIDDEN="tv-hidden",C.LIVE_ONLY="live-only",C.LIVE_HIDDEN="live-hidden",C.VOD_HIDDEN="vod-hidden",C.CLIP_HIDDEN="clip-hidden",C.NO_AUTO_HIDE="no-auto-hide",C.DISABLED="disabled",C.HIDDEN="hidden",C.NOTOOLTIP="notooltip",C.MENU="menu",C.MENU_OPENED="menu-opened",C.ARIA_LABEL="aria-label",C.ARIA_LIVE="aria-live",C.ARIA_CHECKED="aria-checked",C.VOLUME_LEVEL="volume-level",C.PROVIDER_TYPE="provider-type",C))(co||{});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 xr(){return{fromAttribute:i=>{if(i)try{return JSON.parse(i)}catch{return}},toAttribute:i=>i==null?null:JSON.stringify(i)}}var Z=(i,e)=>new Event(i,{bubbles:!0,composed:!0,...e}),Fi=(i,e)=>new CustomEvent(i,{bubbles:!0,composed:!0,...e});function rt(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 uo="play";var qi="pause";var ii="playing";var Pr="waiting";var ho="ended";var po="timeupdate";var md="durationchange";var vd="loadstart";var fd="loadedmetadata";var Ed="loadeddata";var mo="canplay";var Us="canplaythrough";var vo="volumechange";var ri="resize";var fo="ready";var Hs="change";var gd="addrendition";var $s=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(Z(Hs))}_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(gd,{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(Z(Hs))};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 vh=`/**
|
|
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 fh=!1;function Wv(){if(fh||(fh=!0,document.getElementById("bp-player-styles")))return;
|
|
230
|
+
`;var fh=!1;function Wv(){if(fh||(fh=!0,document.getElementById("bp-player-styles")))return;Mr();let i=document.createElement("style");i.id="bp-player-styles",i.textContent=vh,document.head.appendChild(i)}var Fv=["emptied","loadstart","play","playing","pause","waiting","seeking","seeked","timeupdate","durationchange","volumechange","ratechange","ended","loadedmetadata","loadeddata","canplay","canplaythrough","progress","error","resize"],Ce=class extends Pe{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&&ao(t,this._playerCore,this._playerCore.state))};this.unregisterStateReceiver=t=>{let r=this.stateReceivers.indexOf(t);r>=0&&(this.stateReceivers.splice(r,1),lo(t))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),Wv(),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}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=Os(),this.defaultMuted&&this._playerCore.setMuted(!0),this.loop&&this._playerCore.setLoop(!0),this._playerCore.attach(this.providerContainer,this.config),this.setupEventForwarding(),this._videoRenditions=new $s(this),this._hasDispatchedReady||(this._hasDispatchedReady=!0,Wi(this,this.providerContainer,this.registerStateReceiver),this.dispatchEvent(Fi(fo,{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(rt(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(Z(qi)),this.autoplay&&this._playerCore)try{await this._playerCore.play()}catch{}}catch(h){console.error("[BPPlayer] Failed to load source:",h),this.dispatchEvent(rt(h instanceof Error?h:new Error(String(h))))}}propagateStateToAllReceivers(){if(!this._playerCore)return;let t=this._playerCore.state;for(let r of this.stateReceivers)ao(r,this._playerCore,t)}setupEventForwarding(){if(!this._playerCore)return;let t=this._playerCore;for(let s of Fv){let l=()=>{this.debug&&!["durationchange","timeupdate"].includes(s)&&console.log(`[BPPlayer] Forwarding event: ${s}`,t.state),this.dispatchEvent(Z(s))};t.addEventListener(s,l),this.eventCleanup.push(()=>t.removeEventListener(s,l))}let r=()=>{let s=t.videoElement;s&&this.updateVideoDimensions(s.videoWidth,s.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(Z(ri))};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))}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)lo(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
|
-
`}};U([W({converter:Rr()})],we.prototype,"source",2),U([W({type:Boolean})],we.prototype,"autoplay",2),U([W({type:Boolean,reflect:!0,attribute:"muted"})],we.prototype,"defaultMuted",2),U([W({type:Boolean})],we.prototype,"loop",2),U([W({type:String})],we.prototype,"scaling",2),U([W({type:String,attribute:"aspect-ratio"})],we.prototype,"aspectRatio",2),U([W({converter:Rr()})],we.prototype,"config",2),U([W({type:Boolean})],we.prototype,"debug",2),U([Jt()],we.prototype,"_playerCore",2),we=U([Xt("bp-player")],we);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"},N={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},gd={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"},Eh=Object.entries(gd),a=Eh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),qv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Wi=Eh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...qv}),e0=Object.entries(Wi).reduce((i,[e,t])=>{let r=a[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),gh=Object.entries(a).reduce((i,[e,t])=>{let r=Wi[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),De={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ti={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Hs={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Oe={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},it={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var bh={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function _h(i){return i==null?void 0:i.map(Gv).join(" ")}function yh(i){return i==null?void 0:i.split(/\s+/).map(zv)}function Gv(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(o=>o!=null).join(":")}}function zv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function Th(i){return i==null?void 0:i.map(Yv).join(" ")}function Ah(i){return i==null?void 0:i.split(/\s+/).map(Qv)}function Yv(i){if(i){let{id:e,kind:t,language:r,label:o}=i;return[e,t,r,o].filter(n=>n!=null).join(":")}}function Qv(i){if(i){let[e,t,r,o]=i.split(":");return{id:e,kind:t,language:r,label:o}}}function xr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var $s=i=>new Promise(e=>setTimeout(e,i));var Sh=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Zv=(i,e)=>{let t=i===1?Sh[e].singular:Sh[e].plural;return`${i} ${t}`},Fi=i=>{if(!xr(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&&Zv(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function rt(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let r=Math.floor(i%60),o=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=o=r="0"),n=n>0||l>0?n+":":"",o=((n||s>=10)&&o<10?"0"+o:o)+":",r=r<10?"0"+r:r,(t?"-":"")+n+o+r}var r0=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 kh={"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 Lh,bd={en:kh},_d=((Lh=globalThis.navigator)==null?void 0:Lh.language)||"en",Ih=i=>{_d=i};var Jv=i=>{var e,t,r;let[o]=_d.split("-");return((e=bd[_d])==null?void 0:e[i])||((t=bd[o])==null?void 0:t[i])||((r=bd.en)==null?void 0:r[i])||i},_=(i,e={})=>Jv(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var Bs=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Vs=class extends Bs{},Ws=class extends Vs{constructor(){super(...arguments),this.role=null}},yd=class{observe(){}unobserve(){}disconnect(){}},wh={createElement:function(){return new vn.HTMLElement},createElementNS:function(){return new vn.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},vn={ResizeObserver:yd,document:wh,Node:Vs,Element:Ws,HTMLElement:class extends Ws{constructor(){super(...arguments),this.innerHTML=""}get content(){return new vn.DocumentFragment}},DocumentFragment:class extends Bs{},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}}}}},Ch="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Rh=Object.keys(vn).every(i=>i in globalThis),c=Ch&&!Rh?vn:globalThis,ee=Ch&&!Rh?wh:globalThis.document;var Mh=new WeakMap,Td=i=>{let e=Mh.get(i);return e||Mh.set(i,e=new Set),e},xh=new c.ResizeObserver(i=>{for(let e of i)for(let t of Td(e.target))t(e)});function Ut(i,e){Td(i).add(e),xh.observe(i)}function Ht(i,e){let t=Td(i);t.delete(e),t.size||xh.unobserve(i)}function j(i){let e={};for(let t of i)e[t.name]=t.value;return e}function X(i){var e;return(e=Fs(i))!=null?e:ut(i,"media-controller")}function Fs(i){var e;let{MEDIA_CONTROLLER:t}=N,r=i.getAttribute(t);if(r)return(e=qi(i))==null?void 0:e.getElementById(r)}var qs=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},jv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},Ks=(i,e)=>jv(i,e)[0],Ce=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Ce(i,e.getRootNode().host),ut=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||ut(i.getRootNode().host,e)};function fn(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=fn(t.shadowRoot))!=null?e:t:null}function qi(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 Gs(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:r=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:r});let o=i;for(;o&&e>0;){let n=getComputedStyle(o);if(t&&n.opacity==="0"||r&&n.visibility==="hidden"||n.display==="none")return!1;o=o.parentElement,e--}return!0}function Ph(i,e,t,r){let o=r.x-t.x,n=r.y-t.y,s=o*o+n*n;if(s===0)return 0;let l=((i-t.x)*o+(e-t.y)*n)/s;return Math.max(0,Math.min(1,l))}function J(i,e){let t=ef(i,r=>r===e);return t||En(i,e)}function ef(i,e){var t,r;let o;for(o of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(r=o.sheet)==null?void 0:r.cssRules}catch{continue}for(let s of n??[])if(e(s.selectorText))return s}}function En(i,e){var t,r;let o=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=o==null?void 0:o[o.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(r=n.sheet.cssRules)==null?void 0:r[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function H(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function B(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}H(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function C(i,e){return i.hasAttribute(e)}function R(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}C(i,e)!=t&&i.toggleAttribute(e,t)}function D(i,e,t=null){var r;return(r=i.getAttribute(e))!=null?r:t}function O(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let r=`${t}`;D(i,e,void 0)!==r&&i.setAttribute(e,r)}var Dh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ii=(i,e,t)=>(Dh(i,e,"read from private field"),t?t.call(i):e.get(i)),tf=(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)},zs=(i,e,t,r)=>(Dh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ne;function rf(i){return`
|
|
236
|
+
`}};H([z({converter:xr()})],Ce.prototype,"source",2),H([z({type:Boolean})],Ce.prototype,"autoplay",2),H([z({type:Boolean,reflect:!0,attribute:"muted"})],Ce.prototype,"defaultMuted",2),H([z({type:Boolean})],Ce.prototype,"loop",2),H([z({type:String})],Ce.prototype,"scaling",2),H([z({type:String,attribute:"aspect-ratio"})],Ce.prototype,"aspectRatio",2),H([z({converter:xr()})],Ce.prototype,"config",2),H([z({type:Boolean})],Ce.prototype,"debug",2),H([ti()],Ce.prototype,"_playerCore",2),Ce=H([ei("bp-player")],Ce);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"},U={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},bd={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"},Eh=Object.entries(bd),a=Eh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),qv={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Ki=Eh.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...qv}),e0=Object.entries(Ki).reduce((i,[e,t])=>{let r=a[e];return r&&(i[t]=r),i},{userinactivechange:"userinactive"}),gh=Object.entries(a).reduce((i,[e,t])=>{let r=Ki[e];return r&&(i[t]=r),i},{userinactive:"userinactivechange"}),De={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ni={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Bs={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Oe={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},nt={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var bh={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function _h(i){return i==null?void 0:i.map(Gv).join(" ")}function yh(i){return i==null?void 0:i.split(/\s+/).map(zv)}function Gv(i){if(i){let{id:e,width:t,height:r}=i;return[e,t,r].filter(n=>n!=null).join(":")}}function zv(i){if(i){let[e,t,r]=i.split(":");return{id:e,width:+t,height:+r}}}function Th(i){return i==null?void 0:i.map(Yv).join(" ")}function Ah(i){return i==null?void 0:i.split(/\s+/).map(Qv)}function Yv(i){if(i){let{id:e,kind:t,language:r,label:n}=i;return[e,t,r,n].filter(o=>o!=null).join(":")}}function Qv(i){if(i){let[e,t,r,n]=i.split(":");return{id:e,kind:t,language:r,label:n}}}function Dr(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}var Vs=i=>new Promise(e=>setTimeout(e,i));var Sh=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Zv=(i,e)=>{let t=i===1?Sh[e].singular:Sh[e].plural;return`${i} ${t}`},Gi=i=>{if(!Dr(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&&Zv(l,d)).filter(l=>l).join(", ")}${t?" remaining":""}`};function ot(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 r0=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 kh={"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 Lh,_d={en:kh},yd=((Lh=globalThis.navigator)==null?void 0:Lh.language)||"en",Ih=i=>{yd=i};var jv=i=>{var e,t,r;let[n]=yd.split("-");return((e=_d[yd])==null?void 0:e[i])||((t=_d[n])==null?void 0:t[i])||((r=_d.en)==null?void 0:r[i])||i},b=(i,e={})=>jv(i).replace(/\{(\w+)\}/g,(t,r)=>r in e?String(e[r]):`{${r}}`);var Ws=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Fs=class extends Ws{},qs=class extends Fs{constructor(){super(...arguments),this.role=null}},Td=class{observe(){}unobserve(){}disconnect(){}},wh={createElement:function(){return new Eo.HTMLElement},createElementNS:function(){return new Eo.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Eo={ResizeObserver:Td,document:wh,Node:Fs,Element:qs,HTMLElement:class extends qs{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Eo.DocumentFragment}},DocumentFragment:class extends Ws{},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}}}}},Ch="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>"u"||typeof window.customElements>"u",Rh=Object.keys(Eo).every(i=>i in globalThis),c=Ch&&!Rh?Eo:globalThis,ne=Ch&&!Rh?wh:globalThis.document;var Mh=new WeakMap,Ad=i=>{let e=Mh.get(i);return e||Mh.set(i,e=new Set),e},xh=new c.ResizeObserver(i=>{for(let e of i)for(let t of Ad(e.target))t(e)});function $t(i,e){Ad(i).add(e),xh.observe(i)}function Bt(i,e){let t=Ad(i);t.delete(e),t.size||xh.unobserve(i)}function re(i){let e={};for(let t of i)e[t.name]=t.value;return e}function te(i){var e;return(e=Ks(i))!=null?e:pt(i,"media-controller")}function Ks(i){var e;let{MEDIA_CONTROLLER:t}=U,r=i.getAttribute(t);if(r)return(e=zi(i))==null?void 0:e.getElementById(r)}var Gs=(i,e,t=".value")=>{let r=i.querySelector(t);r&&(r.textContent=e)},Jv=(i,e)=>{let t=`slot[name="${e}"]`,r=i.shadowRoot.querySelector(t);return r?r.children:[]},zs=(i,e)=>Jv(i,e)[0],Re=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Re(i,e.getRootNode().host),pt=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||pt(i.getRootNode().host,e)};function go(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=go(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 Ys(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 Ph(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 ie(i,e){let t=ef(i,r=>r===e);return t||bo(i,e)}function ef(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 bo(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 $(i,e,t=Number.NaN){let r=i.getAttribute(e);return r!=null?+r:t}function W(i,e,t){let r=+t;if(t==null||Number.isNaN(r)){i.hasAttribute(e)&&i.removeAttribute(e);return}$(i,e,void 0)!==r&&i.setAttribute(e,`${r}`)}function R(i,e){return i.hasAttribute(e)}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}R(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 Dh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oi=(i,e,t)=>(Dh(i,e,"read from private field"),t?t.call(i):e.get(i)),tf=(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)},Qs=(i,e,t,r)=>(Dh(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ne;function rf(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
|
|
243
|
+
`}var Or=class extends c.HTMLElement{constructor(){if(super(),tf(this,Ne,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=re(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[U.MEDIA_CONTROLLER,a.MEDIA_PAUSED]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===U.MEDIA_CONTROLLER&&(t&&((o=(n=oi(this,Ne))==null?void 0:n.unassociateElement)==null||o.call(n,this),Qs(this,Ne,null)),r&&this.isConnected&&(Qs(this,Ne,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=oi(this,Ne))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r,n;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Qs(this,Ne,nf(this)),this.getAttribute(U.MEDIA_CONTROLLER)&&((t=(e=oi(this,Ne))==null?void 0:e.associateElement)==null||t.call(e,this)),(r=oi(this,Ne))==null||r.addEventListener("pointerdown",this),(n=oi(this,Ne))==null||n.addEventListener("click",this)}disconnectedCallback(){var e,t,r,n;this.getAttribute(U.MEDIA_CONTROLLER)&&((t=(e=oi(this,Ne))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(r=oi(this,Ne))==null||r.removeEventListener("pointerdown",this),(n=oi(this,Ne))==null||n.removeEventListener("click",this),Qs(this,Ne,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(),v=o-l,f=s-d;if(v<0||f<0||v>h||f>p||h===0&&p===0)return;let m=this._pointerType||"mouse";if(this._pointerType=void 0,m===Bs.TOUCH){this.handleTap(e);return}else if(m===Bs.MOUSE||m===Bs.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return R(this,a.MEDIA_PAUSED)}set mediaPaused(e){M(this,a.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(t,{composed:!0,bubbles:!0}))}};Ne=new WeakMap;Or.shadowRootOptions={mode:"open"};Or.getTemplateHTML=rf;function nf(i){var e;let t=i.getAttribute(U.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):pt(i,"media-controller")}c.customElements.get("media-gesture-receiver")||c.customElements.define("media-gesture-receiver",Or);var Zs=Or;var Id=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fe=(i,e,t)=>(Id(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)=>(Id(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ye=(i,e,t)=>(Id(i,e,"access private method"),t),Js,Nr,yo,Ur,Xs,Sd,Oh,_o,js,kd,Nh,Ld,Uh,To,ea,ta,wd,Hr,Ao,P={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function of(i){return`
|
|
244
244
|
<style>
|
|
245
245
|
|
|
246
246
|
:host([${a.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
@@ -256,7 +256,7 @@ bp-player[has-error] {
|
|
|
256
256
|
overflow: hidden;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
:host(:not([${
|
|
259
|
+
:host(:not([${P.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
|
|
260
260
|
position: absolute;
|
|
261
261
|
top: 0;
|
|
262
262
|
left: 0;
|
|
@@ -274,19 +274,19 @@ bp-player[has-error] {
|
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
|
|
277
|
-
:host([${
|
|
277
|
+
:host([${P.AUDIO}]) slot[name=media] {
|
|
278
278
|
display: var(--media-slot-display, none);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
|
|
282
|
-
:host([${
|
|
282
|
+
:host([${P.AUDIO}]) [part~=layer][part~=gesture-layer] {
|
|
283
283
|
height: 0;
|
|
284
284
|
display: block;
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
|
|
288
|
-
:host(:not([${
|
|
289
|
-
:host(:not([${
|
|
288
|
+
:host(:not([${P.AUDIO}])[${P.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
|
|
289
|
+
:host(:not([${P.AUDIO}])[${P.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
|
|
290
290
|
display: none;
|
|
291
291
|
}
|
|
292
292
|
|
|
@@ -295,13 +295,13 @@ bp-player[has-error] {
|
|
|
295
295
|
pointer-events: auto;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
:host(:not([${
|
|
298
|
+
:host(:not([${P.AUDIO}])) *[part~=layer][part~=centered-layer] {
|
|
299
299
|
align-items: center;
|
|
300
300
|
justify-content: center;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
:host(:not([${
|
|
304
|
-
:host(:not([${
|
|
303
|
+
:host(:not([${P.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
|
|
304
|
+
:host(:not([${P.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
|
|
305
305
|
align-self: stretch;
|
|
306
306
|
flex-grow: 1;
|
|
307
307
|
}
|
|
@@ -321,7 +321,7 @@ bp-player[has-error] {
|
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
|
|
324
|
-
:host(:not([${
|
|
324
|
+
:host(:not([${P.AUDIO}])) .spacer {
|
|
325
325
|
flex-grow: 1;
|
|
326
326
|
}
|
|
327
327
|
|
|
@@ -333,22 +333,22 @@ bp-player[has-error] {
|
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
|
|
336
|
-
::slotted(:not([slot=media]):not([slot=poster]):not([${
|
|
336
|
+
::slotted(:not([slot=media]):not([slot=poster]):not([${P.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {
|
|
337
337
|
opacity: 1;
|
|
338
338
|
transition: var(--media-control-transition-in, opacity 0.25s);
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
|
|
342
|
-
:host([${
|
|
342
|
+
:host([${P.USER_INACTIVE}]:not([${a.MEDIA_PAUSED}]):not([${a.MEDIA_IS_AIRPLAYING}]):not([${a.MEDIA_IS_CASTING}]):not([${P.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${P.NO_AUTOHIDE}]):not([role=dialog])) {
|
|
343
343
|
opacity: 0;
|
|
344
344
|
transition: var(--media-control-transition-out, opacity 1s);
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
-
:host([${
|
|
347
|
+
:host([${P.USER_INACTIVE}]:not([${P.NO_AUTOHIDE}]):not([${a.MEDIA_PAUSED}]):not([${a.MEDIA_IS_CASTING}]):not([${P.AUDIO}])) ::slotted([slot=media]) {
|
|
348
348
|
cursor: none;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
:host([${
|
|
351
|
+
:host([${P.USER_INACTIVE}][${P.AUTOHIDE_OVER_CONTROLS}]:not([${P.NO_AUTOHIDE}]):not([${a.MEDIA_PAUSED}]):not([${a.MEDIA_IS_CASTING}]):not([${P.AUDIO}])) * {
|
|
352
352
|
--media-cursor: none;
|
|
353
353
|
cursor: none;
|
|
354
354
|
}
|
|
@@ -359,7 +359,7 @@ bp-player[has-error] {
|
|
|
359
359
|
}
|
|
360
360
|
|
|
361
361
|
|
|
362
|
-
:host(:not([${
|
|
362
|
+
:host(:not([${P.AUDIO}])[${a.MEDIA_HAS_PLAYED}]) slot[name=poster] {
|
|
363
363
|
display: none;
|
|
364
364
|
}
|
|
365
365
|
|
|
@@ -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="${
|
|
382
|
-
${
|
|
381
|
+
<template shadowrootmode="${Zs.shadowRootOptions.mode}">
|
|
382
|
+
${Zs.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 sf=Object.values(a),af="sm:384 md:576 lg:768 xl:960";function lf(i){Hh(i.target,i.contentRect.width)}function Hh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(x.BREAKPOINTS))!=null?t:af,o=df(r),n=cf(o,e),s=!1;if(Object.keys(o).forEach(l=>{if(n.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(Wi.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(l)}i.breakpointsComputed||(i.breakpointsComputed=!0,i.dispatchEvent(new CustomEvent(Wi.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function df(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function cf(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Gi=class extends c.HTMLElement{constructor(){if(super(),Ve(this,Ad),Ve(this,Sd),Ve(this,kd),Ve(this,_n),Ve(this,js),Ve(this,Nr),Ve(this,Xs,0),Ve(this,Dr,null),Ve(this,bn,null),Ve(this,Or,void 0),this.breakpointsComputed=!1,Ve(this,Qs,new MutationObserver(ze(this,Ad,Oh).bind(this))),Ve(this,gn,!1),Ve(this,Zs,t=>{We(this,gn)||(setTimeout(()=>{lf(t),Ki(this,gn,!1)},0),Ki(this,gn,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=j(this.attributes),r=this.constructor.getTemplateHTML(t);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(r):this.shadowRoot.innerHTML=r}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){We(this,Dr)&&this.mediaUnsetCallback(We(this,Dr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[x.AUTOHIDE,x.GESTURES_DISABLED].concat(sf).filter(e=>![a.MEDIA_RENDITION_LIST,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_CHAPTERS_CUES,a.MEDIA_WIDTH,a.MEDIA_HEIGHT,a.MEDIA_ERROR,a.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==x.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&&(Ki(this,Dr,e),e.localName.includes("-")&&await c.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;We(this,Qs).observe(this,{childList:!0,subtree:!0}),Ut(this,We(this,Zs));let r=this.getAttribute(x.AUDIO)!=null?_("audio player"):_("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(x.USER_INACTIVE,""),Hh(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=c.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;We(this,Qs).disconnect(),Ht(this,We(this,Zs)),this.media&&this.mediaUnsetCallback(this.media),(e=c.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Ki(this,Dr,null)}handleEvent(e){switch(e.type){case"pointerdown":Ki(this,Xs,e.timeStamp);break;case"pointermove":ze(this,Sd,Nh).call(this,e);break;case"pointerup":ze(this,kd,Uh).call(this,e);break;case"mouseleave":ze(this,_n,Js).call(this);break;case"mouseup":this.removeAttribute(x.KEYBOARD_CONTROL);break;case"keyup":ze(this,Nr,yn).call(this),this.setAttribute(x.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Ki(this,Or,isNaN(t)?0:t)}get autohide(){return(We(this,Or)===void 0?2:We(this,Or)).toString()}get breakpoints(){return D(this,x.BREAKPOINTS)}set breakpoints(e){O(this,x.BREAKPOINTS,e)}get audio(){return C(this,x.AUDIO)}set audio(e){R(this,x.AUDIO,e)}get gesturesDisabled(){return C(this,x.GESTURES_DISABLED)}set gesturesDisabled(e){R(this,x.GESTURES_DISABLED,e)}get keyboardControl(){return C(this,x.KEYBOARD_CONTROL)}set keyboardControl(e){R(this,x.KEYBOARD_CONTROL,e)}get noAutohide(){return C(this,x.NO_AUTOHIDE)}set noAutohide(e){R(this,x.NO_AUTOHIDE,e)}get autohideOverControls(){return C(this,x.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){R(this,x.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return C(this,x.USER_INACTIVE)}set userInteractive(e){R(this,x.USER_INACTIVE,e)}};Xs=new WeakMap;Dr=new WeakMap;bn=new WeakMap;Or=new WeakMap;Qs=new WeakMap;Ad=new WeakSet;Oh=function(i){let e=this.media;for(let t of i){if(t.type!=="childList")continue;let r=t.removedNodes;for(let o of r){if(o.slot!="media"||t.target!=this)continue;let n=t.previousSibling&&t.previousSibling.previousElementSibling;if(!n||!e)this.mediaUnsetCallback(o);else{let s=n.slot!=="media";for(;(n=n.previousSibling)!==null;)n.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(o)}}if(e)for(let o of t.addedNodes)o===e&&this.handleMediaUpdated(e)}};gn=new WeakMap;Zs=new WeakMap;Sd=new WeakSet;Nh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-We(this,Xs)<250)return;ze(this,js,Id).call(this),clearTimeout(We(this,bn));let e=this.hasAttribute(x.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&ze(this,Nr,yn).call(this)};kd=new WeakSet;Uh=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(x.USER_INACTIVE);[this,this.media].includes(i.target)&&e?ze(this,_n,Js).call(this):ze(this,Nr,yn).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&ze(this,Nr,yn).call(this)};_n=new WeakSet;Js=function(){if(We(this,Or)<0||this.hasAttribute(x.USER_INACTIVE))return;this.setAttribute(x.USER_INACTIVE,"");let i=new c.CustomEvent(Wi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};js=new WeakSet;Id=function(){if(!this.hasAttribute(x.USER_INACTIVE))return;this.removeAttribute(x.USER_INACTIVE);let i=new c.CustomEvent(Wi.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Nr=new WeakSet;yn=function(){ze(this,js,Id).call(this),clearTimeout(We(this,bn));let i=parseInt(this.autohide);i<0||Ki(this,bn,setTimeout(()=>{ze(this,_n,Js).call(this)},i*1e3))};Gi.shadowRootOptions={mode:"open"};Gi.getTemplateHTML=nf;c.customElements.get("media-container")||c.customElements.define("media-container",Gi);var $h=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ye=(i,e,t)=>($h(i,e,"read from private field"),t?t.call(i):e.get(i)),Tn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ea=(i,e,t,r)=>($h(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ur,Hr,ta,zi,$t,ri,oi=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){Tn(this,$t),Tn(this,Ur,void 0),Tn(this,Hr,void 0),Tn(this,ta,void 0),Tn(this,zi,new Set),ea(this,Ur,e),ea(this,Hr,t),ea(this,ta,new Set(r))}[Symbol.iterator](){return ye(this,$t,ri).values()}get length(){return ye(this,$t,ri).size}get value(){var e;return(e=[...ye(this,$t,ri)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(ea(this,zi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...ye(this,$t,ri)][e]}values(){return ye(this,$t,ri).values()}forEach(e,t){ye(this,$t,ri).forEach(e,t)}add(...e){var t,r;e.forEach(o=>ye(this,zi).add(o)),!(this.value===""&&!((t=ye(this,Ur))!=null&&t.hasAttribute(`${ye(this,Hr)}`)))&&((r=ye(this,Ur))==null||r.setAttribute(`${ye(this,Hr)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>ye(this,zi).delete(r)),(t=ye(this,Ur))==null||t.setAttribute(`${ye(this,Hr)}`,`${this.value}`)}contains(e){return ye(this,$t,ri).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}};Ur=new WeakMap;Hr=new WeakMap;ta=new WeakMap;zi=new WeakMap;$t=new WeakSet;ri=function(){return ye(this,zi).size?ye(this,zi):ye(this,ta)};var uf=(i="")=>i.split(/\s+/),Bh=(i="")=>{let[e,t,r]=i.split(":"),o=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?De.CAPTIONS:De.SUBTITLES,language:t,label:o}},Yi=(i="",e={})=>uf(i).map(t=>{let r=Bh(t);return{...e,...r}}),wd=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Bh(e):e):typeof i=="string"?Yi(i):[i]:[],ia=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Bt=(i=[])=>Array.prototype.map.call(i,ia).join(" "),hf=(i,e)=>t=>t[i]===e,Vh=i=>{let e=Object.entries(i).map(([t,r])=>hf(t,r));return t=>e.every(r=>r(t))},Qi=(i,e=[],t=[])=>{let r=wd(t).map(Vh),o=n=>r.some(s=>s(n));Array.from(e).filter(o).forEach(n=>{n.mode=i})},Zi=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Vh(e);return Array.from(i.textTracks).filter(t)},ra=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(a.MEDIA_SUBTITLES_SHOWING)};var Fh=i=>{var e;let{media:t,fullscreenElement:r}=i;try{let o=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(o){let n=(e=r[o])==null?void 0:e.call(r);if(n instanceof Promise)return n.catch(()=>{})}else t!=null&&t.webkitEnterFullscreen?t.webkitEnterFullscreen():t!=null&&t.requestFullscreen&&t.requestFullscreen()}catch(o){console.error(o)}},Wh="exitFullscreen"in ee?"exitFullscreen":"webkitExitFullscreen"in ee?"webkitExitFullscreen":"webkitCancelFullScreen"in ee?"webkitCancelFullScreen":void 0,qh=i=>{var e;let{documentElement:t}=i;if(Wh){let r=(e=t==null?void 0:t[Wh])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},An="fullscreenElement"in ee?"fullscreenElement":"webkitFullscreenElement"in ee?"webkitFullscreenElement":void 0,pf=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[An];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===bh.FULLSCREEN?t:r},Kh=i=>{var e;let{media:t,documentElement:r,fullscreenElement:o=t}=i;if(!t||!r)return!1;let n=pf(i);if(!n)return!1;if(n===o||n===t)return!0;if(n.localName.includes("-")){let s=n.shadowRoot;if(!(An in s))return Ce(n,o);for(;s!=null&&s[An];){if(s[An]===o)return!0;s=(e=s[An])==null?void 0:e.shadowRoot}}return!1},mf="fullscreenEnabled"in ee?"fullscreenEnabled":"webkitFullscreenEnabled"in ee?"webkitFullscreenEnabled":void 0,Gh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[mf])||t&&"webkitSupportsFullscreen"in t};var oa,Cd=()=>{var i,e;return oa||(oa=(e=(i=ee)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),oa)},zh=async(i=Cd())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([vf(i,t.signal),ff(i,e)]);return t.abort(),r},vf=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),ff=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await $s(10)}return i.volume!==e},Ef=/.*Version\/.*Safari\/.*/.test(c.navigator.userAgent),Rd=(i=Cd())=>c.matchMedia("(display-mode: standalone)").matches&&Ef?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Md=(i=Cd())=>Gh({documentElement:ee,media:i}),Yh=Md(),Qh=Rd(),Zh=!!c.WebKitPlaybackTargetAvailabilityEvent,Xh=!!c.chrome;var $r=i=>Zi(i.media,e=>[De.SUBTITLES,De.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),xd=i=>Zi(i.media,e=>e.mode===ti.SHOWING&&[De.SUBTITLES,De.CAPTIONS].includes(e.kind)),na=(i,e)=>{let t=$r(i),r=xd(i),o=!!r.length;if(t.length){if(e===!1||o&&e!==!0)Qi(ti.DISABLED,t,r);else if(e===!0||!o&&e!==!1){let n=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,E=t.filter(m=>g.some(T=>m.language.toLowerCase().startsWith(T.split("-")[0]))).sort((m,T)=>{let f=g.findIndex(S=>m.language.toLowerCase().startsWith(S.split("-")[0])),b=g.findIndex(S=>T.language.toLowerCase().startsWith(S.split("-")[0]));return f-b});E[0]&&(n=E[0])}let{language:l,label:d,kind:h}=n;Qi(ti.DISABLED,t,r),Qi(ti.SHOWING,t,[{language:l,label:d,kind:h}])}}},sa=(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)?gf(i,e):Object.entries(i).every(([t,r])=>t in e&&sa(r,e[t])),gf=(i,e)=>{let t=Array.isArray(i),r=Array.isArray(e);return t!==r?!1:t||r?i.length!==e.length?!1:i.every((o,n)=>sa(o,e[n])):!0};var bf=Object.values(it),aa,_f=zh().then(i=>(aa=i,aa)),Jh=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof c.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=c.customElements.get(t);r&&e instanceof r||(await c.customElements.whenDefined(t),c.customElements.upgrade(e))}))},yf=new c.DOMParser,Tf=i=>i&&(yf.parseFromString(i,"text/html").body.textContent||i),Br={mediaError:{get(i,e){let{media:t}=i;if((e==null?void 0:e.type)!=="playing")return t==null?void 0:t.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(i,e){var t;let{media:r}=i;if((e==null?void 0:e.type)!=="playing")return(t=r==null?void 0:r.error)==null?void 0:t.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(i,e){var t,r;let{media:o}=i;if((e==null?void 0:e.type)!=="playing")return(r=(t=o==null?void 0:o.error)==null?void 0:t.message)!=null?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){var t;let{media:r}=e;r&&(i?r.pause():(t=r.play())==null||t.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t,options:{noMutedPref:r}={}}=e;if(t){t.muted=i;try{let o=c.localStorage.getItem("media-chrome-pref-muted")!==null,n=t.hasAttribute("muted");if(r){o&&c.localStorage.removeItem("media-chrome-pref-muted");return}if(n&&!o)return;c.localStorage.setItem("media-chrome-pref-muted",i?"true":"false")}catch(o){console.debug("Error setting muted pref",o)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noMutedPref:t}}=e,{media:r}=e;if(!(!r||r.muted||t))try{let o=c.localStorage.getItem("media-chrome-pref-muted")==="true";Br.mediaMuted.set(o,e),i(o)}catch(o){console.debug("Error getting muted pref",o)}}]},mediaLoop:{get(i){let{media:e}=i;return e==null?void 0:e.loop},set(i,e){let{media:t}=e;t&&(t.loop=i)},mediaEvents:["medialooprequest"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t,options:{noVolumePref:r}={}}=e;if(t){try{i==null?c.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&c.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch(o){console.debug("Error setting volume pref",o)}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let{media:r}=e;if(!r)return;let o=c.localStorage.getItem("media-chrome-pref-volume");if(o==null)return;Br.mediaVolume.set(+o,e),i(+o)}catch(r){console.debug("Error getting volume pref",r)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;!t||!xr(i)||(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let r=t.seekable.start(0),o=t.seekable.end(t.seekable.length-1);if(!(!r&&!o))return[Number(r.toFixed(3)),Number(o.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(i){var e;let{media:t}=i,r=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(r).map((o,n)=>[Number(r.start(n).toFixed(3)),Number(r.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,r=[it.LIVE,it.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:o}=e;if(bf.includes(o))return o===it.UNKNOWN?r:o;let n=e.duration;return n===1/0?it.LIVE:Number.isFinite(n)?it.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=Br.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===it.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(!(Br.mediaStreamType.get(i)===it.LIVE))return!1;let o=e.seekable;if(!o)return!0;if(!o.length)return!1;let n=o.end(o.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return $r(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return xd(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,r;let{media:o,options:n}=e;if(!o)return;let s=l=>{var d;!n.defaultSubtitles||l&&![De.CAPTIONS,De.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||na(e,!0)};return o.addEventListener("loadstart",s),(t=o.textTracks)==null||t.addEventListener("addtrack",s),(r=o.textTracks)==null||r.addEventListener("removetrack",s),()=>{var l,d;o.removeEventListener("loadstart",s),(l=o.textTracks)==null||l.removeEventListener("addtrack",s),(d=o.textTracks)==null||d.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[r]=Zi(t,{kind:De.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:o,startTime:n,endTime:s})=>({text:Tf(o),startTime:n,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;if(!r)return;let o=r.querySelector('track[kind="chapters"][default][src]'),n=(t=r.shadowRoot)==null?void 0:t.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return o==null||o.addEventListener("load",i),n==null||n.addEventListener("load",i),()=>{o==null||o.removeEventListener("load",i),n==null||n.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:r,documentElement:o}=i;if(!r||!o||!o.pictureInPictureElement)return!1;if(o.pictureInPictureElement===r)return!0;if(o.pictureInPictureElement instanceof HTMLMediaElement)return(e=r.localName)!=null&&e.includes("-")?Ce(r,o.pictureInPictureElement):!1;if(o.pictureInPictureElement.localName.includes("-")){let n=o.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===r)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!ee.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let r=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(o=>{if(o.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",s),t.preload="none"},s=()=>{t.requestPictureInPicture().catch(r),n()};t.addEventListener("loadedmetadata",s),t.preload="metadata",setTimeout(()=>{t.readyState===0&&r(),n()},1e3)}else throw o}else throw o})}else ee.pictureInPictureElement&&ee.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(r=>({...r}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,r;let{media:o}=i;return(r=(t=o==null?void 0:o.videoRenditions)==null?void 0:t[(e=o.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:r.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let r=i,o=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==r);t.videoRenditions.selectedIndex!=o&&(t.videoRenditions.selectedIndex=o)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:r}=i;return(t=[...(e=r==null?void 0:r.audioTracks)!=null?e:[]].find(o=>o.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let r=i;for(let o of t.audioTracks)o.enabled=r==o.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){return Kh(i)},set(i,e,t){var r;i?(Fh(e),t.detail&&((r=e.media)==null||r.focus())):qh(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,r;let{media:o}=e;if(o&&!(i&&((t=o.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((r=o.remote)==null?void 0:r.state)!=="connected")){if(typeof o.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}o.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&c.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(!Yh||!Md(e))return Oe.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!Qh||!Rd(e))return Oe.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Oe.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(aa===!1||(e==null?void 0:e.volume)==null)return Oe.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{aa==null&&_f.then(e=>i(e?void 0:Oe.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!Xh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Oe.UNSUPPORTED;if(!(e==null||e==="available"))return Oe.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!Zh)return Oe.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Oe.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:r}=e;return r?(r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||(t=r==null?void 0:r.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=r==null?void 0:r.remote)==null||n.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Oe.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Oe.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var jh={[y.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var r,o,n;let{media:s}=e,l=t??void 0,d,h;if(s&&l!=null){let[m]=Zi(s,{kind:De.METADATA,label:"thumbnails"}),T=Array.prototype.find.call((r=m==null?void 0:m.cues)!=null?r:[],(f,b,S)=>b===0?f.endTime>l:b===S.length-1?f.startTime<=l:f.startTime<=l&&f.endTime>l);if(T){let f=/'^(?:[a-z]+:)?\/\//i.test(T.text)||(o=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:o.src,b=new URL(T.text,f);h=new URLSearchParams(b.hash).get("#xywh").split(",").map(ie=>+ie),d=b.href}}let p=i.mediaDuration.get(e),E=(n=i.mediaChaptersCues.get(e).find((m,T,f)=>T===f.length-1&&p===m.endTime?m.startTime<=l&&m.endTime>=l:m.startTime<=l&&m.endTime>l))==null?void 0:n.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,o,n;let s="mediaPaused",d=i.mediaStreamType.get(e)===it.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 E=(n=(o=e.options)==null?void 0:o.seekToLiveOffset)!=null?n:0,m=g-E;i.mediaCurrentTime.set(m,e)}}i[s].set(!1,e)},[y.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let r="mediaPlaybackRate",o=t;i[r].set(o,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",o=!!t;return i[r].set(o,e),{mediaLoop:o}},[y.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let r="mediaVolume",o=t;o&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[r].set(o,e)},[y.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let r="mediaCurrentTime",o=t;i[r].set(o,e)},[y.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t,r,o;let n="mediaCurrentTime",s=(t=i.mediaSeekable.get(e))==null?void 0:t[1];if(Number.isNaN(Number(s)))return;let l=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,d=s-l;i[n].set(d,e)},[y.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var r;let{options:o}=e,n=$r(e),s=wd(t),l=(r=s[0])==null?void 0:r.language;l&&!o.noSubtitlesLangPref&&c.localStorage.setItem("media-chrome-pref-subtitles-lang",l),Qi(ti.SHOWING,n,s)},[y.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=$r(e),o=t??[];Qi(ti.DISABLED,r,o)},[y.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){na(e,t)},[y.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let r="mediaRenditionSelected",o=t;i[r].set(o,e)},[y.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let r="mediaAudioTrackEnabled",o=t;i[r].set(o,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 ep=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Br,requestMap:o=jh,options:n={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let l=[],d={options:{...n}},h=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),p=f=>{f!=null&&(sa(f,h)||(h=Object.freeze({...h,...f}),l.forEach(b=>b(h))))},g=()=>{let f=Object.entries(r).reduce((b,[S,{get:ie}])=>(b[S]=ie(d),b),{});p(f)},E={},m,T=async(f,b)=>{var S,ie,ke,Le,Tr,gu,Yl,I,q,de,re,z,fe,Ot,Wo,bu;let lv=!!m;if(m={...d,...m??{},...f},lv)return;await Jh(...Object.values(f));let Ar=l.length>0&&b===0&&s,_u=d.media!==m.media,yu=((S=d.media)==null?void 0:S.textTracks)!==((ie=m.media)==null?void 0:ie.textTracks),Tu=((ke=d.media)==null?void 0:ke.videoRenditions)!==((Le=m.media)==null?void 0:Le.videoRenditions),Au=((Tr=d.media)==null?void 0:Tr.audioTracks)!==((gu=m.media)==null?void 0:gu.audioTracks),Su=((Yl=d.media)==null?void 0:Yl.remote)!==((I=m.media)==null?void 0:I.remote),ku=d.documentElement!==m.documentElement,Lu=!!d.media&&(_u||Ar),Iu=!!((q=d.media)!=null&&q.textTracks)&&(yu||Ar),wu=!!((de=d.media)!=null&&de.videoRenditions)&&(Tu||Ar),Cu=!!((re=d.media)!=null&&re.audioTracks)&&(Au||Ar),Ru=!!((z=d.media)!=null&&z.remote)&&(Su||Ar),Mu=!!d.documentElement&&(ku||Ar),Ql=Lu||Iu||wu||Cu||Ru||Mu,Sr=l.length===0&&b===1&&s,w=!!m.media&&(_u||Sr),xu=!!((fe=m.media)!=null&&fe.textTracks)&&(yu||Sr),Pu=!!((Ot=m.media)!=null&&Ot.videoRenditions)&&(Tu||Sr),Du=!!((Wo=m.media)!=null&&Wo.audioTracks)&&(Au||Sr),Ou=!!((bu=m.media)!=null&&bu.remote)&&(Su||Sr),Nu=!!m.documentElement&&(ku||Sr),Uu=w||xu||Pu||Du||Ou||Nu;if(!(Ql||Uu)){Object.entries(m).forEach(([Y,Fo])=>{d[Y]=Fo}),g(),m=void 0;return}Object.entries(r).forEach(([Y,{get:Fo,mediaEvents:dv=[],textTracksEvents:cv=[],videoRenditionsEvents:uv=[],audioTracksEvents:hv=[],remoteEvents:pv=[],rootEvents:mv=[],stateOwnersUpdateHandlers:vv=[]}])=>{E[Y]||(E[Y]={});let Be=oe=>{let pe=Fo(d,oe);p({[Y]:pe})},be;be=E[Y].mediaEvents,dv.forEach(oe=>{be&&Lu&&(d.media.removeEventListener(oe,be),E[Y].mediaEvents=void 0),w&&(m.media.addEventListener(oe,Be),E[Y].mediaEvents=Be)}),be=E[Y].textTracksEvents,cv.forEach(oe=>{var pe,je;be&&Iu&&((pe=d.media.textTracks)==null||pe.removeEventListener(oe,be),E[Y].textTracksEvents=void 0),xu&&((je=m.media.textTracks)==null||je.addEventListener(oe,Be),E[Y].textTracksEvents=Be)}),be=E[Y].videoRenditionsEvents,uv.forEach(oe=>{var pe,je;be&&wu&&((pe=d.media.videoRenditions)==null||pe.removeEventListener(oe,be),E[Y].videoRenditionsEvents=void 0),Pu&&((je=m.media.videoRenditions)==null||je.addEventListener(oe,Be),E[Y].videoRenditionsEvents=Be)}),be=E[Y].audioTracksEvents,hv.forEach(oe=>{var pe,je;be&&Cu&&((pe=d.media.audioTracks)==null||pe.removeEventListener(oe,be),E[Y].audioTracksEvents=void 0),Du&&((je=m.media.audioTracks)==null||je.addEventListener(oe,Be),E[Y].audioTracksEvents=Be)}),be=E[Y].remoteEvents,pv.forEach(oe=>{var pe,je;be&&Ru&&((pe=d.media.remote)==null||pe.removeEventListener(oe,be),E[Y].remoteEvents=void 0),Ou&&((je=m.media.remote)==null||je.addEventListener(oe,Be),E[Y].remoteEvents=Be)}),be=E[Y].rootEvents,mv.forEach(oe=>{be&&Mu&&(d.documentElement.removeEventListener(oe,be),E[Y].rootEvents=void 0),Nu&&(m.documentElement.addEventListener(oe,Be),E[Y].rootEvents=Be)});let Ss=E[Y].stateOwnersUpdateHandlers;if(Ss&&Ql&&(Array.isArray(Ss)?Ss:[Ss]).forEach(pe=>{typeof pe=="function"&&pe()}),Uu){let oe=vv.map(pe=>pe(Be,m)).filter(pe=>typeof pe=="function");E[Y].stateOwnersUpdateHandlers=oe.length===1?oe[0]:oe}else Ql&&(E[Y].stateOwnersUpdateHandlers=void 0)}),Object.entries(m).forEach(([Y,Fo])=>{d[Y]=Fo}),g(),m=void 0};return T({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(f){let{type:b,detail:S}=f;if(o[b]&&h.mediaErrorCode==null){p(o[b](r,d,f));return}b==="mediaelementchangerequest"?T({media:S}):b==="fullscreenelementchangerequest"?T({fullscreenElement:S}):b==="documentelementchangerequest"?T({documentElement:S}):b==="optionschangerequest"&&(Object.entries(S??{}).forEach(([ie,ke])=>{d.options[ie]=ke}),g())},getState(){return h},subscribe(f){return T({},l.length+1),l.push(f),f(h),()=>{let b=l.indexOf(f);b>=0&&(T({},l.length-1),l.splice(b,1))}}}};var Hd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},M=(i,e,t)=>(Hd(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)},ht=(i,e,t,r)=>(Hd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),mt=(i,e,t)=>(Hd(i,e,"access private method"),t),ni,Sn,V,Ji,kn,pt,la,Ln,da,Pd,ji,Vr,ca,Dd,Od,ap,lp=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],tp=10,ip=.025,rp=.25,Af=.25,Sf=2,A={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},Nd=class extends Gi{constructor(){super(),Ye(this,da),Ye(this,ji),Ye(this,ca),Ye(this,Od),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ye(this,ni,new oi(this,A.HOTKEYS)),Ye(this,Sn,void 0),Ye(this,V,void 0),Ye(this,Ji,null),Ye(this,kn,void 0),Ye(this,pt,void 0),Ye(this,la,t=>{var r;(r=M(this,V))==null||r.dispatch(t)}),Ye(this,Ln,void 0),this.associateElement(this);let e={};ht(this,kn,t=>{Object.entries(t).forEach(([r,o])=>{if(r in e&&e[r]===o)return;this.propagateMediaState(r,o);let n=r.toLowerCase(),s=new c.CustomEvent(gh[n],{composed:!0,detail:o});this.dispatchEvent(s)}),e=t}),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(A.NO_HOTKEYS,A.HOTKEYS,A.DEFAULT_STREAM_TYPE,A.DEFAULT_SUBTITLES,A.DEFAULT_DURATION,A.NO_MUTED_PREF,A.NO_VOLUME_PREF,A.LANG,A.LOOP)}get mediaStore(){return M(this,V)}set mediaStore(e){var t,r;if(M(this,V)&&((t=M(this,pt))==null||t.call(this),ht(this,pt,void 0)),ht(this,V,e),!M(this,V)&&!this.hasAttribute(A.NO_DEFAULT_STORE)){mt(this,da,Pd).call(this);return}ht(this,pt,(r=M(this,V))==null?void 0:r.subscribe(M(this,kn)))}get fullscreenElement(){var e;return(e=M(this,Sn))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(A.FULLSCREEN_ELEMENT)&&this.removeAttribute(A.FULLSCREEN_ELEMENT),ht(this,Sn,e),(t=M(this,V))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return C(this,A.DEFAULT_SUBTITLES)}set defaultSubtitles(e){R(this,A.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return D(this,A.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){O(this,A.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return H(this,A.DEFAULT_DURATION)}set defaultDuration(e){B(this,A.DEFAULT_DURATION,e)}get noHotkeys(){return C(this,A.NO_HOTKEYS)}set noHotkeys(e){R(this,A.NO_HOTKEYS,e)}get keysUsed(){return D(this,A.KEYS_USED)}set keysUsed(e){O(this,A.KEYS_USED,e)}get liveEdgeOffset(){return H(this,A.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){B(this,A.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return C(this,A.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){R(this,A.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return C(this,A.NO_VOLUME_PREF)}set noVolumePref(e){R(this,A.NO_VOLUME_PREF,e)}get noMutedPref(){return C(this,A.NO_MUTED_PREF)}set noMutedPref(e){R(this,A.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return C(this,A.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){R(this,A.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return C(this,A.NO_DEFAULT_STORE)}set noDefaultStore(e){R(this,A.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var o,n,s,l,d,h,p,g,E,m,T,f;if(super.attributeChangedCallback(e,t,r),e===A.NO_HOTKEYS)r!==t&&r===""?(this.hasAttribute(A.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==t&&r===null&&this.enableHotkeys();else if(e===A.HOTKEYS)M(this,ni).value=r;else if(e===A.DEFAULT_SUBTITLES&&r!==t)(o=M(this,V))==null||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES)}});else if(e===A.DEFAULT_STREAM_TYPE)(s=M(this,V))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===A.LIVE_EDGE_OFFSET)(l=M(this,V))==null||l.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(A.LIVE_EDGE_OFFSET)}});else if(e===A.SEEK_TO_LIVE_OFFSET)(d=M(this,V))==null||d.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===A.NO_AUTO_SEEK_TO_LIVE)(h=M(this,V))==null||h.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE)}});else if(e===A.FULLSCREEN_ELEMENT){let b=r?(p=this.getRootNode())==null?void 0:p.getElementById(r):void 0;ht(this,Sn,b),(g=M(this,V))==null||g.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===A.LANG&&r!==t?(Ih(r),(E=M(this,V))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===A.LOOP&&r!==t?(m=M(this,V))==null||m.dispatch({type:y.MEDIA_LOOP_REQUEST,detail:r!=null}):e===A.NO_VOLUME_PREF&&r!==t?(T=M(this,V))==null||T.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF)}}):e===A.NO_MUTED_PREF&&r!==t&&((f=M(this,V))==null||f.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(A.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!M(this,V)&&!this.hasAttribute(A.NO_DEFAULT_STORE)&&mt(this,da,Pd).call(this),(e=M(this,V))==null||e.dispatch({type:"documentelementchangerequest",detail:ee}),super.connectedCallback(),M(this,V)&&!M(this,pt)&&ht(this,pt,(t=M(this,V))==null?void 0:t.subscribe(M(this,kn))),M(this,Ln)!==void 0&&M(this,V)&&this.media&&setTimeout(()=>{var r,o,n;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((n=M(this,V))==null||n.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:M(this,Ln)}))},0),this.hasAttribute(A.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,r,o,n;if((e=super.disconnectedCallback)==null||e.call(this),M(this,V)){let s=M(this,V).getState();ht(this,Ln,!!((t=s.mediaSubtitlesShowing)!=null&&t.length)),(r=M(this,V))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=M(this,V))==null||o.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}M(this,pt)&&((n=M(this,pt))==null||n.call(this),ht(this,pt,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=M(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=M(this,V))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){sp(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),o=this.unregisterMediaStateReceiver.bind(this),n=Rf(e,r,o);Object.values(y).forEach(s=>{e.addEventListener(s,M(this,la))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.values(y).forEach(o=>{e.removeEventListener(o,M(this,la))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),M(this,V)&&Object.entries(M(this,V).getState()).forEach(([o,n])=>{sp([e],o,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",mt(this,ca,Dd))}disableHotkeys(){this.removeEventListener("keydown",mt(this,ca,Dd)),this.removeEventListener("keyup",mt(this,ji,Vr))}get hotkeys(){return D(this,A.HOTKEYS)}set hotkeys(e){O(this,A.HOTKEYS,e)}keyboardShortcutHandler(e){var t,r,o,n,s,l,d,h,p;let g=e.target;if(((o=(r=(t=g.getAttribute(A.KEYS_USED))==null?void 0:t.split(" "))!=null?r:g==null?void 0:g.keysUsed)!=null?o:[]).map(S=>S==="Space"?" ":S).filter(Boolean).includes(e.key))return;let m,T,f;if(!(M(this,ni).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&M(this,ni).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&M(this,ni).contains("noshift+/")))switch(e.key){case" ":case"k":m=M(this,V).getState().mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new c.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 c.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 c.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new c.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let S=this.hasAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_BACKWARD_SEEK_OFFSET):tp;T=Math.max(((n=this.mediaStore.getState().mediaCurrentTime)!=null?n:0)-S,0),f=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"ArrowRight":case"l":{let S=this.hasAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(A.KEYBOARD_FORWARD_SEEK_OFFSET):tp;T=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+S,0),f=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"ArrowUp":{let S=this.hasAttribute(A.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_UP_VOLUME_STEP):ip;T=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+S,1),f=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"ArrowDown":{let S=this.hasAttribute(A.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(A.KEYBOARD_DOWN_VOLUME_STEP):ip;T=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-S,0),f=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"<":{let S=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;T=Math.max(S-rp,Af).toFixed(2),f=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case">":{let S=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;T=Math.min(S+rp,Sf).toFixed(2),f=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:T}),this.dispatchEvent(f);break}case"/":case"?":{e.shiftKey&&mt(this,Od,ap).call(this);break}case"p":{m=this.mediaStore.getState().mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST,f=new c.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(f);break}default:break}}};ni=new WeakMap;Sn=new WeakMap;V=new WeakMap;Ji=new WeakMap;kn=new WeakMap;pt=new WeakMap;la=new WeakMap;Ln=new WeakMap;da=new WeakSet;Pd=function(){var i;this.mediaStore=ep({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(A.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(A.DEFAULT_DURATION)?+this.getAttribute(A.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(A.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(A.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(A.SEEK_TO_LIVE_OFFSET):this.hasAttribute(A.LIVE_EDGE_OFFSET)?+this.getAttribute(A.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(A.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(A.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(A.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(A.NO_SUBTITLES_LANG_PREF)}})};ji=new WeakSet;Vr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||lp.includes(e))){this.removeEventListener("keyup",mt(this,ji,Vr));return}this.keyboardShortcutHandler(i)};ca=new WeakSet;Dd=function(i){var e;let{metaKey:t,altKey:r,key:o,shiftKey:n}=i,s=n&&(o==="/"||o==="?");if(s&&((e=M(this,Ji))!=null&&e.open)){this.removeEventListener("keyup",mt(this,ji,Vr));return}if(t||r||!s&&!lp.includes(o)){this.removeEventListener("keyup",mt(this,ji,Vr));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(o)&&!(M(this,ni).contains(`no${o.toLowerCase()}`)||o===" "&&M(this,ni).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",mt(this,ji,Vr),{once:!0})};Od=new WeakSet;ap=function(){M(this,Ji)||(ht(this,Ji,ee.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(M(this,Ji))),M(this,Ji).open=!0};var kf=Object.values(a),Lf=Object.values(gd),dp=i=>{var e,t,r,o;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(c.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(o=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,N.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:o.call(r,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>kf.includes(l)):[]},If=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&c.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof c.customElements.get(i.nodeName.toLowerCase()))&&c.customElements.upgrade(i),Lf.some(r=>r in i)},Ud=i=>If(i)||!!dp(i).length,op=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},np={[a.MEDIA_SUBTITLES_LIST]:Bt,[a.MEDIA_SUBTITLES_SHOWING]:Bt,[a.MEDIA_SEEKABLE]:op,[a.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(op).join(" "),[a.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[a.MEDIA_RENDITION_LIST]:_h,[a.MEDIA_AUDIO_TRACK_LIST]:Th},wf=async(i,e,t)=>{var r,o;if(i.isConnected||await $s(0),typeof t=="boolean"||t==null)return R(i,e,t);if(typeof t=="number")return B(i,e,t);if(typeof t=="string")return O(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(o=(r=np[e])==null?void 0:r.call(np,t))!=null?o:t;return i.setAttribute(e,n)},Cf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Xi=(i,e)=>{if(Cf(i))return;let t=(o,n)=>{var s,l;Ud(o)&&n(o);let{children:d=[]}=o??{},h=(l=(s=o==null?void 0:o.shadowRoot)==null?void 0:s.children)!=null?l:[];[...d,...h].forEach(g=>Xi(g,n))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!Ud(i)){c.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},sp=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let o=dp(r),n=e.toLowerCase();o.includes(n)&&wf(r,n,t)})},Rf=(i,e,t)=>{Xi(i,e);let r=p=>{var g;let E=(g=p==null?void 0:p.composedPath()[0])!=null?g:p.target;e(E)},o=p=>{var g;let E=(g=p==null?void 0:p.composedPath()[0])!=null?g:p.target;t(E)};i.addEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,o);let n=p=>{p.forEach(g=>{let{addedNodes:E=[],removedNodes:m=[],type:T,target:f,attributeName:b}=g;T==="childList"?(Array.prototype.forEach.call(E,S=>Xi(S,e)),Array.prototype.forEach.call(m,S=>Xi(S,t))):T==="attributes"&&b===N.MEDIA_CHROME_ATTRIBUTES&&(Ud(f)?e(f):t(f))})},s=[],l=p=>{let g=p.target;g.name!=="media"&&(s.forEach(E=>Xi(E,t)),s=[...g.assignedElements({flatten:!0})],s.forEach(E=>Xi(E,e)))};i.addEventListener("slotchange",l);let d=new MutationObserver(n);return d.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Xi(i,t),i.removeEventListener("slotchange",l),d.disconnect(),i.removeEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.removeEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};c.customElements.get("media-controller")||c.customElements.define("media-controller",Nd);var Wr={PLACEMENT:"placement",BOUNDS:"bounds"};function Mf(i){return`
|
|
394
|
+
`}var sf=Object.values(a),af="sm:384 md:576 lg:768 xl:960";function lf(i){Hh(i.target,i.contentRect.width)}function Hh(i,e){var t;if(!i.isConnected)return;let r=(t=i.getAttribute(P.BREAKPOINTS))!=null?t:af,n=df(r),o=cf(n,e),s=!1;if(Object.keys(n).forEach(l=>{if(o.includes(l)){i.hasAttribute(`breakpoint${l}`)||(i.setAttribute(`breakpoint${l}`,""),s=!0);return}i.hasAttribute(`breakpoint${l}`)&&(i.removeAttribute(`breakpoint${l}`),s=!0)}),s){let l=new CustomEvent(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 df(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function cf(i,e){return Object.keys(i).filter(t=>e>=parseInt(i[t]))}var Qi=class extends c.HTMLElement{constructor(){if(super(),We(this,Sd),We(this,kd),We(this,Ld),We(this,To),We(this,ta),We(this,Hr),We(this,Js,0),We(this,Nr,null),We(this,yo,null),We(this,Ur,void 0),this.breakpointsComputed=!1,We(this,Xs,new MutationObserver(Ye(this,Sd,Oh).bind(this))),We(this,_o,!1),We(this,js,t=>{Fe(this,_o)||(setTimeout(()=>{lf(t),Yi(this,_o,!1)},0),Yi(this,_o,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t=re(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,Nr)&&this.mediaUnsetCallback(Fe(this,Nr));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[P.AUTOHIDE,P.GESTURES_DISABLED].concat(sf).filter(e=>![a.MEDIA_RENDITION_LIST,a.MEDIA_AUDIO_TRACK_LIST,a.MEDIA_CHAPTERS_CUES,a.MEDIA_WIDTH,a.MEDIA_HEIGHT,a.MEDIA_ERROR,a.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,r){e.toLowerCase()==P.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,Nr,e),e.localName.includes("-")&&await c.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Fe(this,Xs).observe(this,{childList:!0,subtree:!0}),$t(this,Fe(this,js));let r=this.getAttribute(P.AUDIO)!=null?b("audio player"):b("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",r),this.handleMediaUpdated(this.media),this.setAttribute(P.USER_INACTIVE,""),Hh(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=c.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;Fe(this,Xs).disconnect(),Bt(this,Fe(this,js)),this.media&&this.mediaUnsetCallback(this.media),(e=c.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Yi(this,Nr,null)}handleEvent(e){switch(e.type){case"pointerdown":Yi(this,Js,e.timeStamp);break;case"pointermove":Ye(this,kd,Nh).call(this,e);break;case"pointerup":Ye(this,Ld,Uh).call(this,e);break;case"mouseleave":Ye(this,To,ea).call(this);break;case"mouseup":this.removeAttribute(P.KEYBOARD_CONTROL);break;case"keyup":Ye(this,Hr,Ao).call(this),this.setAttribute(P.KEYBOARD_CONTROL,"");break}}set autohide(e){let t=Number(e);Yi(this,Ur,isNaN(t)?0:t)}get autohide(){return(Fe(this,Ur)===void 0?2:Fe(this,Ur)).toString()}get breakpoints(){return O(this,P.BREAKPOINTS)}set breakpoints(e){N(this,P.BREAKPOINTS,e)}get audio(){return R(this,P.AUDIO)}set audio(e){M(this,P.AUDIO,e)}get gesturesDisabled(){return R(this,P.GESTURES_DISABLED)}set gesturesDisabled(e){M(this,P.GESTURES_DISABLED,e)}get keyboardControl(){return R(this,P.KEYBOARD_CONTROL)}set keyboardControl(e){M(this,P.KEYBOARD_CONTROL,e)}get noAutohide(){return R(this,P.NO_AUTOHIDE)}set noAutohide(e){M(this,P.NO_AUTOHIDE,e)}get autohideOverControls(){return R(this,P.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){M(this,P.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return R(this,P.USER_INACTIVE)}set userInteractive(e){M(this,P.USER_INACTIVE,e)}};Js=new WeakMap;Nr=new WeakMap;yo=new WeakMap;Ur=new WeakMap;Xs=new WeakMap;Sd=new WeakSet;Oh=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)}};_o=new WeakMap;js=new WeakMap;kd=new WeakSet;Nh=function(i){if(i.pointerType!=="mouse"&&i.timeStamp-Fe(this,Js)<250)return;Ye(this,ta,wd).call(this),clearTimeout(Fe(this,yo));let e=this.hasAttribute(P.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(i.target)||e)&&Ye(this,Hr,Ao).call(this)};Ld=new WeakSet;Uh=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(P.USER_INACTIVE);[this,this.media].includes(i.target)&&e?Ye(this,To,ea).call(this):Ye(this,Hr,Ao).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Ye(this,Hr,Ao).call(this)};To=new WeakSet;ea=function(){if(Fe(this,Ur)<0||this.hasAttribute(P.USER_INACTIVE))return;this.setAttribute(P.USER_INACTIVE,"");let i=new c.CustomEvent(Ki.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};ta=new WeakSet;wd=function(){if(!this.hasAttribute(P.USER_INACTIVE))return;this.removeAttribute(P.USER_INACTIVE);let i=new c.CustomEvent(Ki.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Hr=new WeakSet;Ao=function(){Ye(this,ta,wd).call(this),clearTimeout(Fe(this,yo));let i=parseInt(this.autohide);i<0||Yi(this,yo,setTimeout(()=>{Ye(this,To,ea).call(this)},i*1e3))};Qi.shadowRootOptions={mode:"open"};Qi.getTemplateHTML=of;c.customElements.get("media-container")||c.customElements.define("media-container",Qi);var $h=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Te=(i,e,t)=>($h(i,e,"read from private field"),t?t.call(i):e.get(i)),So=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ia=(i,e,t,r)=>($h(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),$r,Br,ra,Zi,Vt,si,ai=class{constructor(e,t,{defaultValue:r}={defaultValue:void 0}){So(this,Vt),So(this,$r,void 0),So(this,Br,void 0),So(this,ra,void 0),So(this,Zi,new Set),ia(this,$r,e),ia(this,Br,t),ia(this,ra,new Set(r))}[Symbol.iterator](){return Te(this,Vt,si).values()}get length(){return Te(this,Vt,si).size}get value(){var e;return(e=[...Te(this,Vt,si)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(ia(this,Zi,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...Te(this,Vt,si)][e]}values(){return Te(this,Vt,si).values()}forEach(e,t){Te(this,Vt,si).forEach(e,t)}add(...e){var t,r;e.forEach(n=>Te(this,Zi).add(n)),!(this.value===""&&!((t=Te(this,$r))!=null&&t.hasAttribute(`${Te(this,Br)}`)))&&((r=Te(this,$r))==null||r.setAttribute(`${Te(this,Br)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>Te(this,Zi).delete(r)),(t=Te(this,$r))==null||t.setAttribute(`${Te(this,Br)}`,`${this.value}`)}contains(e){return Te(this,Vt,si).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}};$r=new WeakMap;Br=new WeakMap;ra=new WeakMap;Zi=new WeakMap;Vt=new WeakSet;si=function(){return Te(this,Zi).size?Te(this,Zi):Te(this,ra)};var uf=(i="")=>i.split(/\s+/),Bh=(i="")=>{let[e,t,r]=i.split(":"),n=r?decodeURIComponent(r):void 0;return{kind:e==="cc"?De.CAPTIONS:De.SUBTITLES,language:t,label:n}},Xi=(i="",e={})=>uf(i).map(t=>{let r=Bh(t);return{...e,...r}}),Cd=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Bh(e):e):typeof i=="string"?Xi(i):[i]:[],na=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,Wt=(i=[])=>Array.prototype.map.call(i,na).join(" "),hf=(i,e)=>t=>t[i]===e,Vh=i=>{let e=Object.entries(i).map(([t,r])=>hf(t,r));return t=>e.every(r=>r(t))},ji=(i,e=[],t=[])=>{let r=Cd(t).map(Vh),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:Vh(e);return Array.from(i.textTracks).filter(t)},oa=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(a.MEDIA_SUBTITLES_SHOWING)};var Fh=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)}},Wh="exitFullscreen"in ne?"exitFullscreen":"webkitExitFullscreen"in ne?"webkitExitFullscreen":"webkitCancelFullScreen"in ne?"webkitCancelFullScreen":void 0,qh=i=>{var e;let{documentElement:t}=i;if(Wh){let r=(e=t==null?void 0:t[Wh])==null?void 0:e.call(t);if(r instanceof Promise)return r.catch(()=>{})}},ko="fullscreenElement"in ne?"fullscreenElement":"webkitFullscreenElement"in ne?"webkitFullscreenElement":void 0,pf=i=>{let{documentElement:e,media:t}=i,r=e==null?void 0:e[ko];return!r&&"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t&&t.webkitDisplayingFullscreen&&t.webkitPresentationMode===bh.FULLSCREEN?t:r},Kh=i=>{var e;let{media:t,documentElement:r,fullscreenElement:n=t}=i;if(!t||!r)return!1;let o=pf(i);if(!o)return!1;if(o===n||o===t)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(ko in s))return Re(o,n);for(;s!=null&&s[ko];){if(s[ko]===n)return!0;s=(e=s[ko])==null?void 0:e.shadowRoot}}return!1},mf="fullscreenEnabled"in ne?"fullscreenEnabled":"webkitFullscreenEnabled"in ne?"webkitFullscreenEnabled":void 0,Gh=i=>{let{documentElement:e,media:t}=i;return!!(e!=null&&e[mf])||t&&"webkitSupportsFullscreen"in t};var sa,Rd=()=>{var i,e;return sa||(sa=(e=(i=ne)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),sa)},zh=async(i=Rd())=>{if(!i)return!1;let e=i.volume;i.volume=e/2+.1;let t=new AbortController,r=await Promise.race([vf(i,t.signal),ff(i,e)]);return t.abort(),r},vf=(i,e)=>new Promise(t=>{i.addEventListener("volumechange",()=>t(!0),{signal:e})}),ff=async(i,e)=>{for(let t=0;t<10;t++){if(i.volume===e)return!1;await Vs(10)}return i.volume!==e},Ef=/.*Version\/.*Safari\/.*/.test(c.navigator.userAgent),Md=(i=Rd())=>c.matchMedia("(display-mode: standalone)").matches&&Ef?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",xd=(i=Rd())=>Gh({documentElement:ne,media:i}),Yh=xd(),Qh=Md(),Zh=!!c.WebKitPlaybackTargetAvailabilityEvent,Xh=!!c.chrome;var Vr=i=>Ji(i.media,e=>[De.SUBTITLES,De.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Pd=i=>Ji(i.media,e=>e.mode===ni.SHOWING&&[De.SUBTITLES,De.CAPTIONS].includes(e.kind)),aa=(i,e)=>{let t=Vr(i),r=Pd(i),n=!!r.length;if(t.length){if(e===!1||n&&e!==!0)ji(ni.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"),v=p?[p,...globalThis.navigator.languages]:globalThis.navigator.languages,f=t.filter(m=>v.some(_=>m.language.toLowerCase().startsWith(_.split("-")[0]))).sort((m,_)=>{let g=v.findIndex(S=>m.language.toLowerCase().startsWith(S.split("-")[0])),I=v.findIndex(S=>_.language.toLowerCase().startsWith(S.split("-")[0]));return g-I});f[0]&&(o=f[0])}let{language:l,label:d,kind:h}=o;ji(ni.DISABLED,t,r),ji(ni.SHOWING,t,[{language:l,label:d,kind:h}])}}},la=(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)?gf(i,e):Object.entries(i).every(([t,r])=>t in e&&la(r,e[t])),gf=(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)=>la(n,e[o])):!0};var bf=Object.values(nt),da,_f=zh().then(i=>(da=i,da)),jh=async(...i)=>{await Promise.all(i.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof c.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let r=c.customElements.get(t);r&&e instanceof r||(await c.customElements.whenDefined(t),c.customElements.upgrade(e))}))},yf=new c.DOMParser,Tf=i=>i&&(yf.parseFromString(i,"text/html").body.textContent||i),Wr={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=c.localStorage.getItem("media-chrome-pref-muted")!==null,o=t.hasAttribute("muted");if(r){n&&c.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!n)return;c.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=c.localStorage.getItem("media-chrome-pref-muted")==="true";Wr.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?c.localStorage.removeItem("media-chrome-pref-volume"):!t.hasAttribute("muted")&&!r&&c.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=c.localStorage.getItem("media-chrome-pref-volume");if(n==null)return;Wr.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||!Dr(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=[nt.LIVE,nt.ON_DEMAND].includes(t)?t:void 0;if(!e)return r;let{streamType:n}=e;if(bf.includes(n))return n===nt.UNKNOWN?r:n;let o=e.duration;return o===1/0?nt.LIVE:Number.isFinite(o)?nt.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=Wr.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&r===nt.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(!(Wr.mediaStreamType.get(i)===nt.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 Vr(i).map(({kind:e,label:t,language:r})=>({kind:e,label:t,language:r}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return Pd(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&&![De.CAPTIONS,De.SUBTITLES].includes((d=l==null?void 0:l.track)==null?void 0:d.kind)||aa(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:De.CHAPTERS});return Array.from((e=r==null?void 0:r.cues)!=null?e:[]).map(({text:n,startTime:o,endTime:s})=>({text:Tf(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("-")?Re(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(!ne.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 ne.pictureInPictureElement&&ne.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 Kh(i)},set(i,e,t){var r;i?(Fh(e),t.detail&&((r=e.media)==null||r.focus())):qh(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&&c.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(!Yh||!xd(e))return Oe.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!Qh||!Md(e))return Oe.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Oe.UNAVAILABLE}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(da===!1||(e==null?void 0:e.volume)==null)return Oe.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{da==null&&_f.then(e=>i(e?void 0:Oe.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:r}=i;if(!Xh||!((t=r==null?void 0:r.remote)!=null&&t.state))return Oe.UNSUPPORTED;if(!(e==null||e==="available"))return Oe.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(!Zh)return Oe.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Oe.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 Oe.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:r}=i;if(!(r!=null&&r.audioTracks))return Oe.UNSUPPORTED;if(((t=(e=r.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(i){let{options:{mediaLang:e}={}}=i;return e??"en"}}};var Jh={[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:De.METADATA,label:"thumbnails"}),_=Array.prototype.find.call((r=m==null?void 0:m.cues)!=null?r:[],(g,I,S)=>I===0?g.endTime>l:I===S.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(ae=>+ae),d=I.href}}let p=i.mediaDuration.get(e),f=(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&&f==null&&(f=""),{mediaPreviewTime:l,mediaPreviewImage:d,mediaPreviewCoords:h,mediaPreviewChapter:f}},[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)===nt.LIVE,h=!((t=e.options)!=null&&t.noAutoSeekToLive),p=i.mediaTargetLiveWindow.get(e)>0;if(d&&h&&!p){let v=(r=i.mediaSeekable.get(e))==null?void 0:r[1];if(v){let f=(o=(n=e.options)==null?void 0:n.seekToLiveOffset)!=null?o:0,m=v-f;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=Vr(e),s=Cd(t),l=(r=s[0])==null?void 0:r.language;l&&!n.noSubtitlesLangPref&&c.localStorage.setItem("media-chrome-pref-subtitles-lang",l),ji(ni.SHOWING,o,s)},[y.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let r=Vr(e),n=t??[];ji(ni.DISABLED,r,n)},[y.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){aa(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 ep=({media:i,fullscreenElement:e,documentElement:t,stateMediator:r=Wr,requestMap:n=Jh,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&&(la(g,h)||(h=Object.freeze({...h,...g}),l.forEach(I=>I(h))))},v=()=>{let g=Object.entries(r).reduce((I,[S,{get:ae}])=>(I[S]=ae(d),I),{});p(g)},f={},m,_=async(g,I)=>{var S,ae,Ie,Xt,Nt,k,Be,w,F,G,le,X,Ee,Ut,qn,bu;let lv=!!m;if(m={...d,...m??{},...g},lv)return;await jh(...Object.values(g));let kr=l.length>0&&I===0&&s,_u=d.media!==m.media,yu=((S=d.media)==null?void 0:S.textTracks)!==((ae=m.media)==null?void 0:ae.textTracks),Tu=((Ie=d.media)==null?void 0:Ie.videoRenditions)!==((Xt=m.media)==null?void 0:Xt.videoRenditions),Au=((Nt=d.media)==null?void 0:Nt.audioTracks)!==((k=m.media)==null?void 0:k.audioTracks),Su=((Be=d.media)==null?void 0:Be.remote)!==((w=m.media)==null?void 0:w.remote),ku=d.documentElement!==m.documentElement,Lu=!!d.media&&(_u||kr),Iu=!!((F=d.media)!=null&&F.textTracks)&&(yu||kr),wu=!!((G=d.media)!=null&&G.videoRenditions)&&(Tu||kr),Cu=!!((le=d.media)!=null&&le.audioTracks)&&(Au||kr),Ru=!!((X=d.media)!=null&&X.remote)&&(Su||kr),Mu=!!d.documentElement&&(ku||kr),Zl=Lu||Iu||wu||Cu||Ru||Mu,Lr=l.length===0&&I===1&&s,C=!!m.media&&(_u||Lr),xu=!!((Ee=m.media)!=null&&Ee.textTracks)&&(yu||Lr),Pu=!!((Ut=m.media)!=null&&Ut.videoRenditions)&&(Tu||Lr),Du=!!((qn=m.media)!=null&&qn.audioTracks)&&(Au||Lr),Ou=!!((bu=m.media)!=null&&bu.remote)&&(Su||Lr),Nu=!!m.documentElement&&(ku||Lr),Uu=C||xu||Pu||Du||Ou||Nu;if(!(Zl||Uu)){Object.entries(m).forEach(([j,Kn])=>{d[j]=Kn}),v(),m=void 0;return}Object.entries(r).forEach(([j,{get:Kn,mediaEvents:dv=[],textTracksEvents:cv=[],videoRenditionsEvents:uv=[],audioTracksEvents:hv=[],remoteEvents:pv=[],rootEvents:mv=[],stateOwnersUpdateHandlers:vv=[]}])=>{f[j]||(f[j]={});let Ve=de=>{let ve=Kn(d,de);p({[j]:ve})},_e;_e=f[j].mediaEvents,dv.forEach(de=>{_e&&Lu&&(d.media.removeEventListener(de,_e),f[j].mediaEvents=void 0),C&&(m.media.addEventListener(de,Ve),f[j].mediaEvents=Ve)}),_e=f[j].textTracksEvents,cv.forEach(de=>{var ve,tt;_e&&Iu&&((ve=d.media.textTracks)==null||ve.removeEventListener(de,_e),f[j].textTracksEvents=void 0),xu&&((tt=m.media.textTracks)==null||tt.addEventListener(de,Ve),f[j].textTracksEvents=Ve)}),_e=f[j].videoRenditionsEvents,uv.forEach(de=>{var ve,tt;_e&&wu&&((ve=d.media.videoRenditions)==null||ve.removeEventListener(de,_e),f[j].videoRenditionsEvents=void 0),Pu&&((tt=m.media.videoRenditions)==null||tt.addEventListener(de,Ve),f[j].videoRenditionsEvents=Ve)}),_e=f[j].audioTracksEvents,hv.forEach(de=>{var ve,tt;_e&&Cu&&((ve=d.media.audioTracks)==null||ve.removeEventListener(de,_e),f[j].audioTracksEvents=void 0),Du&&((tt=m.media.audioTracks)==null||tt.addEventListener(de,Ve),f[j].audioTracksEvents=Ve)}),_e=f[j].remoteEvents,pv.forEach(de=>{var ve,tt;_e&&Ru&&((ve=d.media.remote)==null||ve.removeEventListener(de,_e),f[j].remoteEvents=void 0),Ou&&((tt=m.media.remote)==null||tt.addEventListener(de,Ve),f[j].remoteEvents=Ve)}),_e=f[j].rootEvents,mv.forEach(de=>{_e&&Mu&&(d.documentElement.removeEventListener(de,_e),f[j].rootEvents=void 0),Nu&&(m.documentElement.addEventListener(de,Ve),f[j].rootEvents=Ve)});let Ls=f[j].stateOwnersUpdateHandlers;if(Ls&&Zl&&(Array.isArray(Ls)?Ls:[Ls]).forEach(ve=>{typeof ve=="function"&&ve()}),Uu){let de=vv.map(ve=>ve(Ve,m)).filter(ve=>typeof ve=="function");f[j].stateOwnersUpdateHandlers=de.length===1?de[0]:de}else Zl&&(f[j].stateOwnersUpdateHandlers=void 0)}),Object.entries(m).forEach(([j,Kn])=>{d[j]=Kn}),v(),m=void 0};return _({media:i,fullscreenElement:e,documentElement:t,options:o}),{dispatch(g){let{type:I,detail:S}=g;if(n[I]&&h.mediaErrorCode==null){p(n[I](r,d,g));return}I==="mediaelementchangerequest"?_({media:S}):I==="fullscreenelementchangerequest"?_({fullscreenElement:S}):I==="documentelementchangerequest"?_({documentElement:S}):I==="optionschangerequest"&&(Object.entries(S??{}).forEach(([ae,Ie])=>{d.options[ae]=Ie}),v())},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 $d=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},x=(i,e,t)=>($d(i,e,"read from private field"),t?t.call(i):e.get(i)),Qe=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mt=(i,e,t,r)=>($d(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ft=(i,e,t)=>($d(i,e,"access private method"),t),li,Lo,q,tr,Io,vt,ca,wo,ua,Dd,ir,Fr,ha,Od,Nd,ap,lp=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],tp=10,ip=.025,rp=.25,Af=.25,Sf=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"},Ud=class extends Qi{constructor(){super(),Qe(this,ua),Qe(this,ir),Qe(this,ha),Qe(this,Nd),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Qe(this,li,new ai(this,T.HOTKEYS)),Qe(this,Lo,void 0),Qe(this,q,void 0),Qe(this,tr,null),Qe(this,Io,void 0),Qe(this,vt,void 0),Qe(this,ca,t=>{var r;(r=x(this,q))==null||r.dispatch(t)}),Qe(this,wo,void 0),this.associateElement(this);let e={};mt(this,Io,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 c.CustomEvent(gh[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 x(this,q)}set mediaStore(e){var t,r;if(x(this,q)&&((t=x(this,vt))==null||t.call(this),mt(this,vt,void 0)),mt(this,q,e),!x(this,q)&&!this.hasAttribute(T.NO_DEFAULT_STORE)){ft(this,ua,Dd).call(this);return}mt(this,vt,(r=x(this,q))==null?void 0:r.subscribe(x(this,Io)))}get fullscreenElement(){var e;return(e=x(this,Lo))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(T.FULLSCREEN_ELEMENT)&&this.removeAttribute(T.FULLSCREEN_ELEMENT),mt(this,Lo,e),(t=x(this,q))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return R(this,T.DEFAULT_SUBTITLES)}set defaultSubtitles(e){M(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 $(this,T.DEFAULT_DURATION)}set defaultDuration(e){W(this,T.DEFAULT_DURATION,e)}get noHotkeys(){return R(this,T.NO_HOTKEYS)}set noHotkeys(e){M(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 $(this,T.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){W(this,T.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return R(this,T.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){M(this,T.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return R(this,T.NO_VOLUME_PREF)}set noVolumePref(e){M(this,T.NO_VOLUME_PREF,e)}get noMutedPref(){return R(this,T.NO_MUTED_PREF)}set noMutedPref(e){M(this,T.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return R(this,T.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){M(this,T.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return R(this,T.NO_DEFAULT_STORE)}set noDefaultStore(e){M(this,T.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,t,r){var n,o,s,l,d,h,p,v,f,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)x(this,li).value=r;else if(e===T.DEFAULT_SUBTITLES&&r!==t)(n=x(this,q))==null||n.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(T.DEFAULT_SUBTITLES)}});else if(e===T.DEFAULT_STREAM_TYPE)(s=x(this,q))==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=x(this,q))==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=x(this,q))==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=x(this,q))==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;mt(this,Lo,I),(v=x(this,q))==null||v.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===T.LANG&&r!==t?(Ih(r),(f=x(this,q))==null||f.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):e===T.LOOP&&r!==t?(m=x(this,q))==null||m.dispatch({type:y.MEDIA_LOOP_REQUEST,detail:r!=null}):e===T.NO_VOLUME_PREF&&r!==t?(_=x(this,q))==null||_.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(T.NO_VOLUME_PREF)}}):e===T.NO_MUTED_PREF&&r!==t&&((g=x(this,q))==null||g.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(T.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;!x(this,q)&&!this.hasAttribute(T.NO_DEFAULT_STORE)&&ft(this,ua,Dd).call(this),(e=x(this,q))==null||e.dispatch({type:"documentelementchangerequest",detail:ne}),super.connectedCallback(),x(this,q)&&!x(this,vt)&&mt(this,vt,(t=x(this,q))==null?void 0:t.subscribe(x(this,Io))),x(this,wo)!==void 0&&x(this,q)&&this.media&&setTimeout(()=>{var r,n,o;(n=(r=this.media)==null?void 0:r.textTracks)!=null&&n.length&&((o=x(this,q))==null||o.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:x(this,wo)}))},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),x(this,q)){let s=x(this,q).getState();mt(this,wo,!!((t=s.mediaSubtitlesShowing)!=null&&t.length)),(r=x(this,q))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(n=x(this,q))==null||n.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}x(this,vt)&&((o=x(this,vt))==null||o.call(this),mt(this,vt,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=x(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=x(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){sp(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let r=this.registerMediaStateReceiver.bind(this),n=this.unregisterMediaStateReceiver.bind(this),o=Rf(e,r,n);Object.values(y).forEach(s=>{e.addEventListener(s,x(this,ca))}),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,x(this,ca))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),x(this,q)&&Object.entries(x(this,q).getState()).forEach(([n,o])=>{sp([e],n,o)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,r=t.indexOf(e);r<0||t.splice(r,1)}enableHotkeys(){this.addEventListener("keydown",ft(this,ha,Od))}disableHotkeys(){this.removeEventListener("keydown",ft(this,ha,Od)),this.removeEventListener("keyup",ft(this,ir,Fr))}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 v=e.target;if(((n=(r=(t=v.getAttribute(T.KEYS_USED))==null?void 0:t.split(" "))!=null?r:v==null?void 0:v.keysUsed)!=null?n:[]).map(S=>S==="Space"?" ":S).filter(Boolean).includes(e.key))return;let m,_,g;if(!(x(this,li).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&x(this,li).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&x(this,li).contains("noshift+/")))switch(e.key){case" ":case"k":m=x(this,q).getState().mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new c.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 c.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 c.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new c.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let S=this.hasAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_BACKWARD_SEEK_OFFSET):tp;_=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-S,0),g=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowRight":case"l":{let S=this.hasAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(T.KEYBOARD_FORWARD_SEEK_OFFSET):tp;_=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+S,0),g=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowUp":{let S=this.hasAttribute(T.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(T.KEYBOARD_UP_VOLUME_STEP):ip;_=Math.min(((l=this.mediaStore.getState().mediaVolume)!=null?l:1)+S,1),g=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"ArrowDown":{let S=this.hasAttribute(T.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(T.KEYBOARD_DOWN_VOLUME_STEP):ip;_=Math.max(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)-S,0),g=new c.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"<":{let S=(h=this.mediaStore.getState().mediaPlaybackRate)!=null?h:1;_=Math.max(S-rp,Af).toFixed(2),g=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case">":{let S=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;_=Math.min(S+rp,Sf).toFixed(2),g=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:_}),this.dispatchEvent(g);break}case"/":case"?":{e.shiftKey&&ft(this,Nd,ap).call(this);break}case"p":{m=this.mediaStore.getState().mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST,g=new c.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(g);break}default:break}}};li=new WeakMap;Lo=new WeakMap;q=new WeakMap;tr=new WeakMap;Io=new WeakMap;vt=new WeakMap;ca=new WeakMap;wo=new WeakMap;ua=new WeakSet;Dd=function(){var i;this.mediaStore=ep({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;Fr=function(i){let{key:e,shiftKey:t}=i;if(!(t&&(e==="/"||e==="?")||lp.includes(e))){this.removeEventListener("keyup",ft(this,ir,Fr));return}this.keyboardShortcutHandler(i)};ha=new WeakSet;Od=function(i){var e;let{metaKey:t,altKey:r,key:n,shiftKey:o}=i,s=o&&(n==="/"||n==="?");if(s&&((e=x(this,tr))!=null&&e.open)){this.removeEventListener("keyup",ft(this,ir,Fr));return}if(t||r||!s&&!lp.includes(n)){this.removeEventListener("keyup",ft(this,ir,Fr));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)&&!(x(this,li).contains(`no${n.toLowerCase()}`)||n===" "&&x(this,li).contains("nospace"))&&!d&&i.preventDefault(),this.addEventListener("keyup",ft(this,ir,Fr),{once:!0})};Nd=new WeakSet;ap=function(){x(this,tr)||(mt(this,tr,ne.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(x(this,tr))),x(this,tr).open=!0};var kf=Object.values(a),Lf=Object.values(bd),dp=i=>{var e,t,r,n;let{observedAttributes:o}=i.constructor;!o&&((e=i.nodeName)!=null&&e.includes("-"))&&(c.customElements.upgrade(i),{observedAttributes:o}=i.constructor);let s=(n=(r=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,U.MEDIA_CHROME_ATTRIBUTES))==null?void 0:r.split)==null?void 0:n.call(r,/\s+/);return Array.isArray(o||s)?(o||s).filter(l=>kf.includes(l)):[]},If=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&c.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof c.customElements.get(i.nodeName.toLowerCase()))&&c.customElements.upgrade(i),Lf.some(r=>r in i)},Hd=i=>If(i)||!!dp(i).length,np=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},op={[a.MEDIA_SUBTITLES_LIST]:Wt,[a.MEDIA_SUBTITLES_SHOWING]:Wt,[a.MEDIA_SEEKABLE]:np,[a.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(np).join(" "),[a.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[a.MEDIA_RENDITION_LIST]:_h,[a.MEDIA_AUDIO_TRACK_LIST]:Th},wf=async(i,e,t)=>{var r,n;if(i.isConnected||await Vs(0),typeof t=="boolean"||t==null)return M(i,e,t);if(typeof t=="number")return W(i,e,t);if(typeof t=="string")return N(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let o=(n=(r=op[e])==null?void 0:r.call(op,t))!=null?n:t;return i.setAttribute(e,o)},Cf=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},er=(i,e)=>{if(Cf(i))return;let t=(n,o)=>{var s,l;Hd(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(v=>er(v,o))},r=i==null?void 0:i.nodeName.toLowerCase();if(r.includes("-")&&!Hd(i)){c.customElements.whenDefined(r).then(()=>{t(i,e)});return}t(i,e)},sp=(i,e,t)=>{i.forEach(r=>{if(e in r){r[e]=t;return}let n=dp(r),o=e.toLowerCase();n.includes(o)&&wf(r,o,t)})},Rf=(i,e,t)=>{er(i,e);let r=p=>{var v;let f=(v=p==null?void 0:p.composedPath()[0])!=null?v:p.target;e(f)},n=p=>{var v;let f=(v=p==null?void 0:p.composedPath()[0])!=null?v:p.target;t(f)};i.addEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),i.addEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,n);let o=p=>{p.forEach(v=>{let{addedNodes:f=[],removedNodes:m=[],type:_,target:g,attributeName:I}=v;_==="childList"?(Array.prototype.forEach.call(f,S=>er(S,e)),Array.prototype.forEach.call(m,S=>er(S,t))):_==="attributes"&&I===U.MEDIA_CHROME_ATTRIBUTES&&(Hd(g)?e(g):t(g))})},s=[],l=p=>{let v=p.target;v.name!=="media"&&(s.forEach(f=>er(f,t)),s=[...v.assignedElements({flatten:!0})],s.forEach(f=>er(f,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)}};c.customElements.get("media-controller")||c.customElements.define("media-controller",Ud);var qr={PLACEMENT:"placement",BOUNDS:"bounds"};function Mf(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
|
|
503
|
+
`}var Kr=class extends c.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Ys(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=pt(this,"#"+this.bounds))!=null?e:te(this);if(!n)return;let{x:o,width:s}=n.getBoundingClientRect(),{x:l,width:d}=this.getBoundingClientRect(),h=l+d,p=o+s,v=r.getPropertyValue("--media-tooltip-offset-x"),f=v?parseFloat(v.replace("px","")):0,m=r.getPropertyValue("--media-tooltip-container-margin"),_=m?parseFloat(m.replace("px","")):0,g=l-o+f-_,I=h-p+f+_;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=re(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[qr.PLACEMENT,qr.BOUNDS]}get placement(){return O(this,qr.PLACEMENT)}set placement(e){N(this,qr.PLACEMENT,e)}get bounds(){return O(this,qr.BOUNDS)}set bounds(e){N(this,qr.BOUNDS,e)}};Kr.shadowRootOptions={mode:"open"};Kr.getTemplateHTML=Mf;c.customElements.get("media-tooltip")||c.customElements.define("media-tooltip",Kr);var pa=Kr;var Vd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fe=(i,e,t)=>(Vd(i,e,"read from private field"),t?t.call(i):e.get(i)),Gr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ma=(i,e,t,r)=>(Vd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),xf=(i,e,t)=>(Vd(i,e,"access private method"),t),Et,Yr,ci,zr,va,Bd,cp,di={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Pf(i,e={}){return`
|
|
504
504
|
<style>
|
|
505
505
|
:host {
|
|
506
506
|
position: relative;
|
|
@@ -574,8 +574,8 @@ bp-player[has-error] {
|
|
|
574
574
|
|
|
575
575
|
<slot name="tooltip">
|
|
576
576
|
<media-tooltip part="tooltip" aria-hidden="true">
|
|
577
|
-
<template shadowrootmode="${
|
|
578
|
-
${
|
|
577
|
+
<template shadowrootmode="${pa.shadowRootOptions.mode}">
|
|
578
|
+
${pa.getTemplateHTML({})}
|
|
579
579
|
</template>
|
|
580
580
|
<slot name="tooltip-content">
|
|
581
581
|
${this.getTooltipContentHTML(i)}
|
|
@@ -584,7 +584,7 @@ bp-player[has-error] {
|
|
|
584
584
|
</slot>
|
|
585
585
|
`}function Df(i,e){return`
|
|
586
586
|
<slot></slot>
|
|
587
|
-
`}function Of(){return""}var
|
|
587
|
+
`}function Of(){return""}var Y=class extends c.HTMLElement{constructor(){if(super(),Gr(this,Bd),Gr(this,Et,void 0),this.preventClick=!1,this.tooltipEl=null,Gr(this,Yr,e=>{this.preventClick||this.handleClick(e),setTimeout(fe(this,ci),0)}),Gr(this,ci,()=>{var e,t;(t=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||t.call(e)}),Gr(this,zr,e=>{let{key:t}=e;if(!this.keysUsed.includes(t)){this.removeEventListener("keyup",fe(this,zr));return}this.preventClick||this.handleClick(e)}),Gr(this,va,e=>{let{metaKey:t,altKey:r,key:n}=e;if(t||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",fe(this,zr));return}this.addEventListener("keyup",fe(this,zr),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=re(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",di.TOOLTIP_PLACEMENT,U.MEDIA_CONTROLLER,a.MEDIA_LANG]}enable(){this.addEventListener("click",fe(this,Yr)),this.addEventListener("keydown",fe(this,va)),this.tabIndex=0}disable(){this.removeEventListener("click",fe(this,Yr)),this.removeEventListener("keydown",fe(this,va)),this.removeEventListener("keyup",fe(this,zr)),this.tabIndex=-1}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===U.MEDIA_CONTROLLER?(t&&((o=(n=fe(this,Et))==null?void 0:n.unassociateElement)==null||o.call(n,this),ma(this,Et,null)),r&&this.isConnected&&(ma(this,Et,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=fe(this,Et))==null?void 0:l.associateElement)==null||d.call(l,this))):e==="disabled"&&r!==t?r==null?this.enable():this.disable():e===di.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()),fe(this,ci).call(this)}connectedCallback(){var e,t,r;let{style:n}=ie(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(U.MEDIA_CONTROLLER);o&&(ma(this,Et,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=fe(this,Et))==null?void 0:t.associateElement)==null||r.call(t,this)),c.customElements.whenDefined("media-tooltip").then(()=>xf(this,Bd,cp).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=fe(this,Et))==null?void 0:e.unassociateElement)==null||t.call(e,this),ma(this,Et,null),this.removeEventListener("mouseenter",fe(this,ci)),this.removeEventListener("focus",fe(this,ci)),this.removeEventListener("click",fe(this,Yr))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return O(this,di.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){N(this,di.TOOLTIP_PLACEMENT,e)}get mediaController(){return O(this,U.MEDIA_CONTROLLER)}set mediaController(e){N(this,U.MEDIA_CONTROLLER,e)}get disabled(){return R(this,di.DISABLED)}set disabled(e){M(this,di.DISABLED,e)}get noTooltip(){return R(this,di.NO_TOOLTIP)}set noTooltip(e){M(this,di.NO_TOOLTIP,e)}handleClick(e){}};Et=new WeakMap;Yr=new WeakMap;ci=new WeakMap;zr=new WeakMap;va=new WeakMap;Bd=new WeakSet;cp=function(){this.addEventListener("mouseenter",fe(this,ci)),this.addEventListener("focus",fe(this,ci)),this.addEventListener("click",fe(this,Yr));let i=this.tooltipPlacement;i&&this.tooltipEl&&(this.tooltipEl.placement=i)};Y.shadowRootOptions={mode:"open"};Y.getTemplateHTML=Pf;Y.getSlotTemplateHTML=Df;Y.getTooltipContentHTML=Of;c.customElements.get("media-chrome-button")||c.customElements.define("media-chrome-button",Y);var up=`<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
590
|
`;function Nf(i){return`
|
|
@@ -609,9 +609,9 @@ bp-player[has-error] {
|
|
|
609
609
|
<slot name="exit">${up}</slot>
|
|
610
610
|
</slot>
|
|
611
611
|
`}function Uf(){return`
|
|
612
|
-
<slot name="tooltip-enter">${
|
|
613
|
-
<slot name="tooltip-exit">${
|
|
614
|
-
`}var hp=i=>{let e=i.mediaIsAirplaying?
|
|
612
|
+
<slot name="tooltip-enter">${b("start airplay")}</slot>
|
|
613
|
+
<slot name="tooltip-exit">${b("stop airplay")}</slot>
|
|
614
|
+
`}var hp=i=>{let e=i.mediaIsAirplaying?b("stop airplay"):b("start airplay");i.setAttribute("aria-label",e)},Co=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_AIRPLAYING,a.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),hp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_AIRPLAYING&&hp(this)}get mediaIsAirplaying(){return R(this,a.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){M(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 c.CustomEvent(y.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};Co.getSlotTemplateHTML=Nf;Co.getTooltipContentHTML=Uf;c.customElements.get("media-airplay-button")||c.customElements.define("media-airplay-button",Co);var Hf=`<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
616
|
</svg>`,$f=`<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"/>
|
|
@@ -637,9 +637,9 @@ bp-player[has-error] {
|
|
|
637
637
|
<slot name="off">${$f}</slot>
|
|
638
638
|
</slot>
|
|
639
639
|
`}function Vf(){return`
|
|
640
|
-
<slot name="tooltip-enable">${
|
|
641
|
-
<slot name="tooltip-disable">${
|
|
642
|
-
`}var pp=i=>{i.setAttribute("aria-checked",
|
|
640
|
+
<slot name="tooltip-enable">${b("Enable captions")}</slot>
|
|
641
|
+
<slot name="tooltip-disable">${b("Disable captions")}</slot>
|
|
642
|
+
`}var pp=i=>{i.setAttribute("aria-checked",oa(i).toString())},Ro=class extends Y{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")),pp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING&&pp(this)}get mediaSubtitlesList(){return mp(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){vp(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return mp(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){vp(this,a.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new c.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};Ro.getSlotTemplateHTML=Bf;Ro.getTooltipContentHTML=Vf;var mp=(i,e)=>{let t=i.getAttribute(e);return t?Xi(t):[]},vp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Wt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-button")||c.customElements.define("media-captions-button",Ro);var Wf='<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>',Ff='<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 qf(i){return`
|
|
643
643
|
<style>
|
|
644
644
|
:host([${a.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
|
|
645
645
|
display: none !important;
|
|
@@ -661,9 +661,9 @@ bp-player[has-error] {
|
|
|
661
661
|
<slot name="exit">${Ff}</slot>
|
|
662
662
|
</slot>
|
|
663
663
|
`}function Kf(){return`
|
|
664
|
-
<slot name="tooltip-enter">${
|
|
665
|
-
<slot name="tooltip-exit">${
|
|
666
|
-
`}var fp=i=>{let e=i.mediaIsCasting?
|
|
664
|
+
<slot name="tooltip-enter">${b("Start casting")}</slot>
|
|
665
|
+
<slot name="tooltip-exit">${b("Stop casting")}</slot>
|
|
666
|
+
`}var fp=i=>{let e=i.mediaIsCasting?b("stop casting"):b("start casting");i.setAttribute("aria-label",e)},Mo=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_CASTING,a.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),fp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_CASTING&&fp(this)}get mediaIsCasting(){return R(this,a.MEDIA_IS_CASTING)}set mediaIsCasting(e){M(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 c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Mo.getSlotTemplateHTML=qf;Mo.getTooltipContentHTML=Kf;c.customElements.get("media-cast-button")||c.customElements.define("media-cast-button",Mo);var Yd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},nr=(i,e,t)=>(Yd(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)},Qd=(i,e,t,r)=>(Yd(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),rr=(i,e,t)=>(Yd(i,e,"access private method"),t),Ea,Po,or,fa,Wd,Fd,Ep,qd,gp,Kd,bp,Gd,_p,zd,yp;function Gf(i){return`
|
|
667
667
|
<style>
|
|
668
668
|
:host {
|
|
669
669
|
font: var(--media-font,
|
|
@@ -706,7 +706,7 @@ bp-player[has-error] {
|
|
|
706
706
|
${this.getSlotTemplateHTML(i)}
|
|
707
707
|
`}function zf(i){return`
|
|
708
708
|
<slot id="content"></slot>
|
|
709
|
-
`}var
|
|
709
|
+
`}var xo={OPEN:"open",ANCHOR:"anchor"},gt=class extends c.HTMLElement{constructor(){super(),Ft(this,fa),Ft(this,Fd),Ft(this,qd),Ft(this,Kd),Ft(this,Gd),Ft(this,zd),Ft(this,Ea,!1),Ft(this,Po,null),Ft(this,or,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[xo.OPEN,xo.ANCHOR]}get open(){return R(this,xo.OPEN)}set open(e){M(this,xo.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":rr(this,Kd,bp).call(this,e);break;case"focusout":rr(this,Gd,_p).call(this,e);break;case"keydown":rr(this,zd,yp).call(this,e);break}}connectedCallback(){rr(this,fa,Wd).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,t,r){rr(this,fa,Wd).call(this),e===xo.OPEN&&r!==t&&(this.open?rr(this,Fd,Ep).call(this):rr(this,qd,gp).call(this))}focus(){Qd(this,Po,go());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"]}};Ea=new WeakMap;Po=new WeakMap;or=new WeakMap;fa=new WeakSet;Wd=function(){if(!nr(this,Ea)&&(Qd(this,Ea,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let i=re(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(i),queueMicrotask(()=>{let{style:e}=ie(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};Fd=new WeakSet;Ep=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})};qd=new WeakSet;gp=function(){var i;(i=nr(this,or))==null||i.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};Kd=new WeakSet;bp=function(i){Qd(this,or,i.relatedTarget),Re(this,i.relatedTarget)||(this.open=!this.open)};Gd=new WeakSet;_p=function(i){var e;Re(this,i.relatedTarget)||((e=nr(this,Po))==null||e.focus(),nr(this,or)&&nr(this,or)!==i.relatedTarget&&this.open&&(this.open=!1))};zd=new WeakSet;yp=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,Po))==null||o.focus(),this.open=!1))};gt.shadowRootOptions={mode:"open"};gt.getTemplateHTML=Gf;gt.getSlotTemplateHTML=zf;c.customElements.get("media-chrome-dialog")||c.customElements.define("media-chrome-dialog",gt);var ic=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ce=(i,e,t)=>(ic(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)},ui=(i,e,t,r)=>(ic(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),st=(i,e,t)=>(ic(i,e,"access private method"),t),bt,Ia,ga,ba,at,ka,_a,ya,Ta,rc,Tp,Aa,Zd,Sa,Xd,La,nc,jd,Ap,Jd,Sp,ec,kp,tc,Lp;function Yf(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 Qf(i){return""}var
|
|
939
|
+
`}function Qf(i){return""}var _t=class extends c.HTMLElement{constructor(){if(super(),ke(this,rc),ke(this,Aa),ke(this,Sa),ke(this,La),ke(this,jd),ke(this,Jd),ke(this,ec),ke(this,tc),ke(this,bt,void 0),ke(this,Ia,void 0),ke(this,ga,void 0),ke(this,ba,void 0),ke(this,at,{}),ke(this,ka,[]),ke(this,_a,()=>{if(this.range.matches(":focus-visible")){let{style:e}=ie(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),ke(this,ya,()=>{let{style:e}=ie(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),ke(this,Ta,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=re(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector("#container"),ui(this,ga,this.shadowRoot.querySelector("#startpoint")),ui(this,ba,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",U.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===U.MEDIA_CONTROLLER?(t&&((o=(n=ce(this,bt))==null?void 0:n.unassociateElement)==null||o.call(n,this),ui(this,bt,null)),r&&this.isConnected&&(ui(this,bt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=ce(this,bt))==null?void 0:l.associateElement)==null||d.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==r)&&(r==null?(this.range.removeAttribute(e),st(this,Aa,Zd).call(this)):(this.range.setAttribute(e,r),st(this,Sa,Xd).call(this)))}connectedCallback(){var e,t,r;let{style:n}=ie(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),ce(this,at).pointer=ie(this.shadowRoot,"#pointer"),ce(this,at).progress=ie(this.shadowRoot,"#progress"),ce(this,at).thumb=ie(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),ce(this,at).activeSegment=ie(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(U.MEDIA_CONTROLLER);o&&(ui(this,bt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=ce(this,bt))==null?void 0:t.associateElement)==null||r.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ce(this,_a)),this.shadowRoot.addEventListener("focusout",ce(this,ya)),st(this,Aa,Zd).call(this),$t(this.container,ce(this,Ta))}disconnectedCallback(){var e,t;st(this,Sa,Xd).call(this),(t=(e=ce(this,bt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ui(this,bt,null),this.shadowRoot.removeEventListener("focusin",ce(this,_a)),this.shadowRoot.removeEventListener("focusout",ce(this,ya)),Bt(this.container,ce(this,Ta))}updatePointerBar(e){var t;(t=ce(this,at).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let r=this.range.valueAsNumber*100;(e=ce(this,at).progress)==null||e.style.setProperty("width",`${r}%`),(t=ce(this,at).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])];ui(this,ka,[...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}%`,v=`calc(${((d?n:r[o+1])-s)*100}%${l||d?"":" - var(--segments-gap)"})`,f=ne.createElementNS("http://www.w3.org/2000/svg","rect"),m=bo(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);m.style.setProperty("x",h),m.style.setProperty("width",v),t.append(f)}}getPointerRatio(e){return Ph(e.clientX,e.clientY,ce(this,ga).getBoundingClientRect(),ce(this,ba).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":st(this,tc,Lp).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":st(this,jd,Ap).call(this,e);break;case"pointerdown":st(this,La,nc).call(this,e);break;case"pointerup":st(this,Jd,Sp).call(this);break;case"pointerleave":st(this,ec,kp).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};bt=new WeakMap;Ia=new WeakMap;ga=new WeakMap;ba=new WeakMap;at=new WeakMap;ka=new WeakMap;_a=new WeakMap;ya=new WeakMap;Ta=new WeakMap;rc=new WeakSet;Tp=function(i){let e=ce(this,at).activeSegment;if(!e)return;let t=this.getPointerRatio(i),n=`#segments-clipping rect:nth-child(${ce(this,ka).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))"))};Aa=new WeakSet;Zd=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Sa=new WeakSet;Xd=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=c.window)==null||i.removeEventListener("pointerup",this),(e=c.window)==null||e.removeEventListener("pointermove",this)};La=new WeakSet;nc=function(i){var e;ui(this,Ia,i.composedPath().includes(this.range)),(e=c.window)==null||e.addEventListener("pointerup",this)};jd=new WeakSet;Ap=function(i){var e;i.pointerType!=="mouse"&&st(this,La,nc).call(this,i),this.addEventListener("pointerleave",this),(e=c.window)==null||e.addEventListener("pointermove",this)};Jd=new WeakSet;Sp=function(){var i;(i=c.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};ec=new WeakSet;kp=function(){var i,e;this.removeEventListener("pointerleave",this),(i=c.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=ce(this,at).activeSegment)==null||e.style.removeProperty("transform")};tc=new WeakSet;Lp=function(i){i.pointerType==="pen"&&i.buttons===0||(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),st(this,rc,Tp).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!ce(this,Ia))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};_t.shadowRootOptions={mode:"open"};_t.getTemplateHTML=Yf;_t.getContainerTemplateHTML=Qf;c.customElements.get("media-chrome-range")||c.customElements.define("media-chrome-range",_t);var Ip=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wa=(i,e,t)=>(Ip(i,e,"read from private field"),t?t.call(i):e.get(i)),Zf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ca=(i,e,t,r)=>(Ip(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),yt;function Xf(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
|
|
965
|
+
`}var Do=class extends c.HTMLElement{constructor(){if(super(),Zf(this,yt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=re(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[U.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===U.MEDIA_CONTROLLER&&(t&&((o=(n=wa(this,yt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ca(this,yt,null)),r&&this.isConnected&&(Ca(this,yt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=wa(this,yt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let n=this.getAttribute(U.MEDIA_CONTROLLER);n&&(Ca(this,yt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=wa(this,yt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=wa(this,yt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ca(this,yt,null)}};yt=new WeakMap;Do.shadowRootOptions={mode:"open"};Do.getTemplateHTML=Xf;c.customElements.get("media-control-bar")||c.customElements.define("media-control-bar",Do);var wp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ra=(i,e,t)=>(wp(i,e,"read from private field"),t?t.call(i):e.get(i)),jf=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ma=(i,e,t,r)=>(wp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Tt;function Jf(i,e={}){return`
|
|
966
966
|
<style>
|
|
967
967
|
:host {
|
|
968
968
|
font: var(--media-font,
|
|
@@ -998,9 +998,9 @@ bp-player[has-error] {
|
|
|
998
998
|
${this.getSlotTemplateHTML(i,e)}
|
|
999
999
|
`}function eE(i,e){return`
|
|
1000
1000
|
<slot></slot>
|
|
1001
|
-
`}var Ue=class extends c.HTMLElement{constructor(){if(super(),
|
|
1002
|
-
<slot>${
|
|
1003
|
-
`}var
|
|
1001
|
+
`}var Ue=class extends c.HTMLElement{constructor(){if(super(),jf(this,Tt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=re(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[U.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===U.MEDIA_CONTROLLER&&(t&&((o=(n=Ra(this,Tt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Ma(this,Tt,null)),r&&this.isConnected&&(Ma(this,Tt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Ra(this,Tt))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let{style:n}=ie(this.shadowRoot,":host");n.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let o=this.getAttribute(U.MEDIA_CONTROLLER);o&&(Ma(this,Tt,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(r=(t=Ra(this,Tt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ra(this,Tt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ma(this,Tt,null)}};Tt=new WeakMap;Ue.shadowRootOptions={mode:"open"};Ue.getTemplateHTML=Jf;Ue.getSlotTemplateHTML=eE;c.customElements.get("media-text-display")||c.customElements.define("media-text-display",Ue);var Rp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Cp=(i,e,t)=>(Rp(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)},iE=(i,e,t,r)=>(Rp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Oo;function rE(i,e){return`
|
|
1002
|
+
<slot>${ot(e.mediaDuration)}</slot>
|
|
1003
|
+
`}var xa=class extends Ue{constructor(){var e;super(),tE(this,Oo,void 0),iE(this,Oo,this.shadowRoot.querySelector("slot")),Cp(this,Oo).textContent=ot((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_DURATION]}attributeChangedCallback(e,t,r){e===a.MEDIA_DURATION&&(Cp(this,Oo).textContent=ot(+r)),super.attributeChangedCallback(e,t,r)}get mediaDuration(){return $(this,a.MEDIA_DURATION)}set mediaDuration(e){W(this,a.MEDIA_DURATION,e)}};Oo=new WeakMap;xa.getSlotTemplateHTML=rE;c.customElements.get("media-duration-display")||c.customElements.define("media-duration-display",xa);var nE={2:b("Network Error"),3:b("Decode Error"),4:b("Source Not Supported"),5:b("Encryption Error")},oE={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.")},oc=i=>{var e,t;return i.code===1?null:{title:(e=nE[i.code])!=null?e:`Error ${i.code}`,message:(t=oE[i.code])!=null?t:i.message}};var xp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},sE=(i,e,t)=>(xp(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)},lE=(i,e,t,r)=>(xp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Pa;function dE(i){return`
|
|
1004
1004
|
<style>
|
|
1005
1005
|
:host {
|
|
1006
1006
|
background: rgb(20 20 30 / .8);
|
|
@@ -1019,7 +1019,7 @@ bp-player[has-error] {
|
|
|
1019
1019
|
<slot name="error-${i.mediaerrorcode}" id="content">
|
|
1020
1020
|
${Pp({code:+i.mediaerrorcode,message:i.mediaerrormessage})}
|
|
1021
1021
|
</slot>
|
|
1022
|
-
`}function cE(i){return i.code&&oc(i)!==null}function Pp(i){var e;let{title:t,message:r}=(e=oc(i))!=null?e:{},
|
|
1022
|
+
`}function cE(i){return i.code&&oc(i)!==null}function Pp(i){var e;let{title:t,message:r}=(e=oc(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 Mp=[a.MEDIA_ERROR_CODE,a.MEDIA_ERROR_MESSAGE],No=class extends gt{constructor(){super(...arguments),aE(this,Pa,null)}static get observedAttributes(){return[...super.observedAttributes,...Mp]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,r){var n;if(super.attributeChangedCallback(e,t,r),!Mp.includes(e))return;let o=(n=this.mediaError)!=null?n:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=cE(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o))}get mediaError(){return sE(this,Pa)}set mediaError(e){lE(this,Pa,e)}get mediaErrorCode(){return $(this,"mediaerrorcode")}set mediaErrorCode(e){W(this,"mediaerrorcode",e)}get mediaErrorMessage(){return O(this,"mediaerrormessage")}set mediaErrorMessage(e){N(this,"mediaerrormessage",e)}};Pa=new WeakMap;No.getSlotTemplateHTML=dE;No.formatErrorMessage=Pp;c.customElements.get("media-error-dialog")||c.customElements.define("media-error-dialog",No);var uE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},hi=(i,e,t)=>(uE(i,e,"read from private field"),t?t.call(i):e.get(i)),Dp=(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)},Qr,Zr;function hE(i){return`
|
|
1023
1023
|
<style>
|
|
1024
1024
|
:host {
|
|
1025
1025
|
position: fixed;
|
|
@@ -1111,12 +1111,12 @@ bp-player[has-error] {
|
|
|
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>
|
|
1113
1113
|
<td>
|
|
1114
|
-
<div class="key-combo">${t.map((
|
|
1114
|
+
<div class="key-combo">${t.map((o,s)=>s>0?`<span class="key-separator">or</span><span class="key">${o}</span>`:`<span class="key">${o}</span>`).join("")}</div>
|
|
1115
1115
|
</td>
|
|
1116
1116
|
<td class="description">${r}</td>
|
|
1117
1117
|
</tr>
|
|
1118
1118
|
`).join("")}</table>
|
|
1119
|
-
`}var
|
|
1119
|
+
`}var Da=class extends gt{constructor(){super(...arguments),Dp(this,Qr,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)}),Dp(this,Zr,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",hi(this,Qr)),document.addEventListener("keydown",hi(this,Zr)))}disconnectedCallback(){this.removeEventListener("click",hi(this,Qr)),document.removeEventListener("keydown",hi(this,Zr))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e==="open"&&(this.open?(this.addEventListener("click",hi(this,Qr)),document.addEventListener("keydown",hi(this,Zr))):(this.removeEventListener("click",hi(this,Qr)),document.removeEventListener("keydown",hi(this,Zr))))}};Qr=new WeakMap;Zr=new WeakMap;Da.getSlotTemplateHTML=hE;c.customElements.get("media-keyboard-shortcuts-dialog")||c.customElements.define("media-keyboard-shortcuts-dialog",Da);var Np=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},mE=(i,e,t)=>(Np(i,e,"read from private field"),t?t.call(i):e.get(i)),vE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},fE=(i,e,t,r)=>(Np(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Oa,EE=`<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
1121
|
</svg>`,gE=`<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"/>
|
|
@@ -1142,9 +1142,9 @@ bp-player[has-error] {
|
|
|
1142
1142
|
<slot name="exit">${gE}</slot>
|
|
1143
1143
|
</slot>
|
|
1144
1144
|
`}function _E(){return`
|
|
1145
|
-
<slot name="tooltip-enter">${
|
|
1146
|
-
<slot name="tooltip-exit">${
|
|
1147
|
-
`}var Op=i=>{let e=i.mediaIsFullscreen?
|
|
1145
|
+
<slot name="tooltip-enter">${b("Enter fullscreen mode")}</slot>
|
|
1146
|
+
<slot name="tooltip-exit">${b("Exit fullscreen mode")}</slot>
|
|
1147
|
+
`}var Op=i=>{let e=i.mediaIsFullscreen?b("exit fullscreen mode"):b("enter fullscreen mode");i.setAttribute("aria-label",e)},Uo=class extends Y{constructor(){super(...arguments),vE(this,Oa,null)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_FULLSCREEN,a.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Op(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_FULLSCREEN&&Op(this)}get mediaFullscreenUnavailable(){return O(this,a.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){N(this,a.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return R(this,a.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){M(this,a.MEDIA_IS_FULLSCREEN,e)}handleClick(e){fE(this,Oa,e);let t=mE(this,Oa)instanceof PointerEvent,r=this.mediaIsFullscreen?new c.CustomEvent(y.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new c.CustomEvent(y.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}};Oa=new WeakMap;Uo.getSlotTemplateHTML=bE;Uo.getTooltipContentHTML=_E;c.customElements.get("media-fullscreen-button")||c.customElements.define("media-fullscreen-button",Uo);var{MEDIA_TIME_IS_LIVE:Na,MEDIA_PAUSED:Ho}=a,{MEDIA_SEEK_TO_LIVE_REQUEST:yE,MEDIA_PLAY_REQUEST:TE}=y,AE='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function SE(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([${
|
|
1160
|
-
:host([${
|
|
1159
|
+
:host([${Na}]:not([${Ho}])) slot[name=indicator] > *,
|
|
1160
|
+
:host([${Na}]:not([${Ho}])) ::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([${
|
|
1165
|
+
:host([${Na}]:not([${Ho}])) {
|
|
1166
1166
|
cursor: var(--media-cursor, not-allowed);
|
|
1167
1167
|
}
|
|
1168
1168
|
|
|
@@ -1174,8 +1174,8 @@ bp-player[has-error] {
|
|
|
1174
1174
|
|
|
1175
1175
|
<slot name="indicator">${AE}</slot>
|
|
1176
1176
|
|
|
1177
|
-
<slot name="spacer"> </slot><slot name="text">${
|
|
1178
|
-
`}var Up=i=>{var e;let t=i.mediaPaused||!i.mediaTimeIsLive,r=t?
|
|
1177
|
+
<slot name="spacer"> </slot><slot name="text">${b("live")}</slot>
|
|
1178
|
+
`}var Up=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")},Ua=class extends Y{static get observedAttributes(){return[...super.observedAttributes,Na,Ho]}connectedCallback(){super.connectedCallback(),Up(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),Up(this)}get mediaPaused(){return R(this,a.MEDIA_PAUSED)}set mediaPaused(e){M(this,a.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return R(this,a.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){M(this,a.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new c.CustomEvent(yE,{composed:!0,bubbles:!0})),this.hasAttribute(Ho)&&this.dispatchEvent(new c.CustomEvent(TE,{composed:!0,bubbles:!0})))}};Ua.getSlotTemplateHTML=SE;c.customElements.get("media-live-button")||c.customElements.define("media-live-button",Ua);var $p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$o=(i,e,t)=>($p(i,e,"read from private field"),t?t.call(i):e.get(i)),Hp=(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)},Bo=(i,e,t,r)=>($p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),At,$a,Ha={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},Bp=500,kE=`
|
|
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
|
|
@@ -1234,8 +1234,8 @@ bp-player[has-error] {
|
|
|
1234
1234
|
</style>
|
|
1235
1235
|
|
|
1236
1236
|
<slot name="icon">${kE}</slot>
|
|
1237
|
-
<div id="status" role="status" aria-live="polite">${
|
|
1238
|
-
`}var
|
|
1237
|
+
<div id="status" role="status" aria-live="polite">${b("media loading")}</div>
|
|
1238
|
+
`}var Vo=class extends c.HTMLElement{constructor(){if(super(),Hp(this,At,void 0),Hp(this,$a,Bp),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=re(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[U.MEDIA_CONTROLLER,a.MEDIA_PAUSED,a.MEDIA_LOADING,Ha.LOADING_DELAY]}attributeChangedCallback(e,t,r){var n,o,s,l,d;e===Ha.LOADING_DELAY&&t!==r?this.loadingDelay=Number(r):e===U.MEDIA_CONTROLLER&&(t&&((o=(n=$o(this,At))==null?void 0:n.unassociateElement)==null||o.call(n,this),Bo(this,At,null)),r&&this.isConnected&&(Bo(this,At,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=$o(this,At))==null?void 0:l.associateElement)==null||d.call(l,this)))}connectedCallback(){var e,t,r;let n=this.getAttribute(U.MEDIA_CONTROLLER);n&&(Bo(this,At,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=$o(this,At))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=$o(this,At))==null?void 0:e.unassociateElement)==null||t.call(e,this),Bo(this,At,null)}get loadingDelay(){return $o(this,$a)}set loadingDelay(e){Bo(this,$a,e);let{style:t}=ie(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return R(this,a.MEDIA_PAUSED)}set mediaPaused(e){M(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return R(this,a.MEDIA_LOADING)}set mediaLoading(e){M(this,a.MEDIA_LOADING,e)}get mediaController(){return O(this,U.MEDIA_CONTROLLER)}set mediaController(e){N(this,U.MEDIA_CONTROLLER,e)}get noAutohide(){return R(this,Ha.NO_AUTOHIDE)}set noAutohide(e){M(this,Ha.NO_AUTOHIDE,e)}};At=new WeakMap;$a=new WeakMap;Vo.shadowRootOptions={mode:"open"};Vo.getTemplateHTML=LE;c.customElements.get("media-loading-indicator")||c.customElements.define("media-loading-indicator",Vo);var IE=`<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
1240
|
</svg>`,Vp=`<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"/>
|
|
@@ -1273,9 +1273,9 @@ bp-player[has-error] {
|
|
|
1273
1273
|
<slot name="high">${wE}</slot>
|
|
1274
1274
|
</slot>
|
|
1275
1275
|
`}function RE(){return`
|
|
1276
|
-
<slot name="tooltip-mute">${
|
|
1277
|
-
<slot name="tooltip-unmute">${
|
|
1278
|
-
`}var Wp=i=>{let t=i.mediaVolumeLevel==="off"?
|
|
1276
|
+
<slot name="tooltip-mute">${b("Mute")}</slot>
|
|
1277
|
+
<slot name="tooltip-unmute">${b("Unmute")}</slot>
|
|
1278
|
+
`}var Wp=i=>{let t=i.mediaVolumeLevel==="off"?b("unmute"):b("mute");i.setAttribute("aria-label",t)},Wo=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Wp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_VOLUME_LEVEL&&Wp(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 c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Wo.getSlotTemplateHTML=CE;Wo.getTooltipContentHTML=RE;c.customElements.get("media-mute-button")||c.customElements.define("media-mute-button",Wo);var Fp=`<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
1280
|
</svg>`;function ME(i){return`
|
|
1281
1281
|
<style>
|
|
@@ -1298,17 +1298,17 @@ bp-player[has-error] {
|
|
|
1298
1298
|
<slot name="exit">${Fp}</slot>
|
|
1299
1299
|
</slot>
|
|
1300
1300
|
`}function xE(){return`
|
|
1301
|
-
<slot name="tooltip-enter">${
|
|
1302
|
-
<slot name="tooltip-exit">${
|
|
1303
|
-
`}var qp=i=>{let e=i.mediaIsPip?
|
|
1301
|
+
<slot name="tooltip-enter">${b("Enter picture in picture mode")}</slot>
|
|
1302
|
+
<slot name="tooltip-exit">${b("Exit picture in picture mode")}</slot>
|
|
1303
|
+
`}var qp=i=>{let e=i.mediaIsPip?b("exit picture in picture mode"):b("enter picture in picture mode");i.setAttribute("aria-label",e)},Fo=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_IS_PIP,a.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),qp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_IS_PIP&&qp(this)}get mediaPipUnavailable(){return O(this,a.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){N(this,a.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return R(this,a.MEDIA_IS_PIP)}set mediaIsPip(e){M(this,a.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Fo.getSlotTemplateHTML=ME;Fo.getTooltipContentHTML=xE;c.customElements.get("media-pip-button")||c.customElements.define("media-pip-button",Fo);var PE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Xr=(i,e,t)=>(PE(i,e,"read from private field"),t?t.call(i):e.get(i)),DE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},pi,sc={RATES:"rates"},ac=[1,1.2,1.5,1.7,2],sr=1;function OE(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||
|
|
1311
|
-
`}function NE(){return
|
|
1310
|
+
<slot name="icon">${i.mediaplaybackrate||sr}x</slot>
|
|
1311
|
+
`}function NE(){return b("Playback rate")}var qo=class extends Y{constructor(){var e;super(),DE(this,pi,new ai(this,sc.RATES,{defaultValue:ac})),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,sc.RATES]}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===sc.RATES&&(Xr(this,pi).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 Xr(this,pi)}set rates(e){e?Array.isArray(e)?Xr(this,pi).value=e.join(" "):typeof e=="string"&&(Xr(this,pi).value=e):Xr(this,pi).value=""}get mediaPlaybackRate(){return $(this,a.MEDIA_PLAYBACK_RATE,sr)}set mediaPlaybackRate(e){W(this,a.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let r=Array.from(Xr(this,pi).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 c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(o)}};pi=new WeakMap;qo.getSlotTemplateHTML=OE;qo.getTooltipContentHTML=NE;c.customElements.get("media-playback-rate-button")||c.customElements.define("media-playback-rate-button",qo);var UE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1312
1312
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
1313
1313
|
</svg>`,HE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1314
1314
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
@@ -1330,9 +1330,9 @@ bp-player[has-error] {
|
|
|
1330
1330
|
<slot name="pause">${HE}</slot>
|
|
1331
1331
|
</slot>
|
|
1332
1332
|
`}function BE(){return`
|
|
1333
|
-
<slot name="tooltip-play">${
|
|
1334
|
-
<slot name="tooltip-pause">${
|
|
1335
|
-
`}var Kp=i=>{let e=i.mediaPaused?
|
|
1333
|
+
<slot name="tooltip-play">${b("Play")}</slot>
|
|
1334
|
+
<slot name="tooltip-pause">${b("Pause")}</slot>
|
|
1335
|
+
`}var Kp=i=>{let e=i.mediaPaused?b("play"):b("pause");i.setAttribute("aria-label",e)},Ko=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PAUSED,a.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),Kp(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),(e===a.MEDIA_PAUSED||e===a.MEDIA_LANG)&&Kp(this)}get mediaPaused(){return R(this,a.MEDIA_PAUSED)}set mediaPaused(e){M(this,a.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}};Ko.getSlotTemplateHTML=$E;Ko.getTooltipContentHTML=BE;c.customElements.get("media-play-button")||c.customElements.define("media-play-button",Ko);var St={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function VE(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 WE=i=>{i.style.removeProperty("background-image")},FE=(i,e)=>{i.style["background-image"]=`url('${e}')`},
|
|
1357
|
+
`}var WE=i=>{i.style.removeProperty("background-image")},FE=(i,e)=>{i.style["background-image"]=`url('${e}')`},Go=class extends c.HTMLElement{static get observedAttributes(){return[St.PLACEHOLDER_SRC,St.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=re(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,r){e===St.SRC&&(r==null?this.image.removeAttribute(St.SRC):this.image.setAttribute(St.SRC,r)),e===St.PLACEHOLDER_SRC&&(r==null?WE(this.image):FE(this.image,r))}get placeholderSrc(){return O(this,St.PLACEHOLDER_SRC)}set placeholderSrc(e){N(this,St.SRC,e)}get src(){return O(this,St.SRC)}set src(e){N(this,St.SRC,e)}};Go.shadowRootOptions={mode:"open"};Go.getTemplateHTML=VE;c.customElements.get("media-poster-image")||c.customElements.define("media-poster-image",Go);var Gp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qE=(i,e,t)=>(Gp(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)},GE=(i,e,t,r)=>(Gp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ba,lc=class extends Ue{constructor(){super(),KE(this,Ba,void 0),GE(this,Ba,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(qE(this,Ba).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)}};Ba=new WeakMap;c.customElements.get("media-preview-chapter-display")||c.customElements.define("media-preview-chapter-display",lc);var zp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Va=(i,e,t)=>(zp(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)},Wa=(i,e,t,r)=>(zp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),kt;function YE(i){return`
|
|
1358
1358
|
<style>
|
|
1359
1359
|
:host {
|
|
1360
1360
|
box-sizing: border-box;
|
|
@@ -1368,16 +1368,16 @@ bp-player[has-error] {
|
|
|
1368
1368
|
}
|
|
1369
1369
|
</style>
|
|
1370
1370
|
<img crossorigin loading="eager" decoding="async">
|
|
1371
|
-
`}var
|
|
1371
|
+
`}var jr=class extends c.HTMLElement{constructor(){if(super(),zE(this,kt,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=re(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[U.MEDIA_CONTROLLER,a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,r;let n=this.getAttribute(U.MEDIA_CONTROLLER);n&&(Wa(this,kt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(r=(t=Va(this,kt))==null?void 0:t.associateElement)==null||r.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Va(this,kt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Wa(this,kt,null)}attributeChangedCallback(e,t,r){var n,o,s,l,d;[a.MEDIA_PREVIEW_IMAGE,a.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===U.MEDIA_CONTROLLER&&(t&&((o=(n=Va(this,kt))==null?void 0:n.unassociateElement)==null||o.call(n,this),Wa(this,kt,null)),r&&this.isConnected&&(Wa(this,kt,(s=this.getRootNode())==null?void 0:s.getElementById(r)),(d=(l=Va(this,kt))==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:v,minHeight:f}=d,m=Math.min(parseInt(h)/o,parseInt(p)/s),_=Math.max(parseInt(v)/o,parseInt(f)/s),g=m<1,I=g?m:_>1?_:1,{style:S}=ie(this.shadowRoot,":host"),ae=ie(this.shadowRoot,"img").style,Ie=this.shadowRoot.querySelector("img"),Xt=g?"min":"max";S.setProperty(`${Xt}-width`,"initial","important"),S.setProperty(`${Xt}-height`,"initial","important"),S.width=`${o*I}px`,S.height=`${s*I}px`;let Nt=()=>{ae.width=`${this.imgWidth*I}px`,ae.height=`${this.imgHeight*I}px`,ae.display="block"};Ie.src!==l&&(Ie.onload=()=>{this.imgWidth=Ie.naturalWidth,this.imgHeight=Ie.naturalHeight,Nt()},Ie.src=l,Nt()),Nt(),ae.transform=`translate(-${r*I}px, -${n*I}px)`}};kt=new WeakMap;jr.shadowRootOptions={mode:"open"};jr.getTemplateHTML=YE;c.customElements.get("media-preview-thumbnail")||c.customElements.define("media-preview-thumbnail",jr);var Fa=jr;var Qp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yp=(i,e,t)=>(Qp(i,e,"read from private field"),t?t.call(i):e.get(i)),QE=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ZE=(i,e,t,r)=>(Qp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),zo,dc=class extends Ue{constructor(){super(),QE(this,zo,void 0),ZE(this,zo,this.shadowRoot.querySelector("slot")),Yp(this,zo).textContent=ot(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&&(Yp(this,zo).textContent=ot(parseFloat(r)))}get mediaPreviewTime(){return $(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){W(this,a.MEDIA_PREVIEW_TIME,e)}};zo=new WeakMap;c.customElements.get("media-preview-time-display")||c.customElements.define("media-preview-time-display",dc);var Jr={SEEK_OFFSET:"seekoffset"},cc=30,XE=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
|
|
1378
|
+
</svg>`;function jE(i,e){return`
|
|
1379
1379
|
<slot name="icon">${XE(e.seekOffset)}</slot>
|
|
1380
|
-
`}function
|
|
1380
|
+
`}function JE(){return b("Seek backward")}var eg=0,Yo=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,Jr.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=$(this,Jr.SEEK_OFFSET,cc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===Jr.SEEK_OFFSET&&(this.seekOffset=$(this,Jr.SEEK_OFFSET,cc))}get seekOffset(){return $(this,Jr.SEEK_OFFSET,cc)}set seekOffset(e){W(this,Jr.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Gs(zs(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return $(this,a.MEDIA_CURRENT_TIME,eg)}set mediaCurrentTime(e){W(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Yo.getSlotTemplateHTML=jE;Yo.getTooltipContentHTML=JE;c.customElements.get("media-seek-backward-button")||c.customElements.define("media-seek-backward-button",Yo);var en={SEEK_OFFSET:"seekoffset"},uc=30,tg=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>
|
|
@@ -1386,9 +1386,9 @@ bp-player[has-error] {
|
|
|
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
1387
|
</svg>`;function ig(i,e){return`
|
|
1388
1388
|
<slot name="icon">${tg(e.seekOffset)}</slot>
|
|
1389
|
-
`}function rg(){return
|
|
1390
|
-
<slot>${
|
|
1391
|
-
`}var
|
|
1389
|
+
`}function rg(){return b("Seek forward")}var ng=0,Qo=class extends Y{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_CURRENT_TIME,en.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=$(this,en.SEEK_OFFSET,uc)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===en.SEEK_OFFSET&&(this.seekOffset=$(this,en.SEEK_OFFSET,uc))}get seekOffset(){return $(this,en.SEEK_OFFSET,uc)}set seekOffset(e){W(this,en.SEEK_OFFSET,e),this.setAttribute("aria-label",b("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Gs(zs(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return $(this,a.MEDIA_CURRENT_TIME,ng)}set mediaCurrentTime(e){W(this,a.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Qo.getSlotTemplateHTML=ig;Qo.getTooltipContentHTML=rg;c.customElements.get("media-seek-forward-button")||c.customElements.define("media-seek-forward-button",Qo);var jp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},hc=(i,e,t)=>(jp(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)},sg=(i,e,t,r)=>(jp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),tn,ar={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Zp=[...Object.values(ar),a.MEDIA_CURRENT_TIME,a.MEDIA_DURATION,a.MEDIA_SEEKABLE],Xp=["Enter"," "],ag=" / ",pc=(i,{timesSep:e=ag}={})=>{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?ot(0-(s-n)):ot(n);return i.showDuration?`${l}${e}${ot(s)}`:l},lg="video not loaded, unknown time.",dg=i=>{var e;let t=i.mediaCurrentTime,[,r]=(e=i.mediaSeekable)!=null?e:[],n=null;if(Number.isFinite(i.mediaDuration)?n=i.mediaDuration:Number.isFinite(r)&&(n=r),t==null||n===null){i.setAttribute("aria-valuetext",lg);return}let o=i.remaining?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 cg(i,e){return`
|
|
1390
|
+
<slot>${pc(e)}</slot>
|
|
1391
|
+
`}var qa=class extends Ue{constructor(){super(),og(this,tn,void 0),sg(this,tn,this.shadowRoot.querySelector("slot")),hc(this,tn).innerHTML=`${pc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Zp,"disabled"]}connectedCallback(){let{style:e}=ie(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(!Xp.includes(n)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:n,altKey:o,key:s}=r;if(n||o||!Xp.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){Zp.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 R(this,ar.REMAINING)}set remaining(e){M(this,ar.REMAINING,e)}get showDuration(){return R(this,ar.SHOW_DURATION)}set showDuration(e){M(this,ar.SHOW_DURATION,e)}get noToggle(){return R(this,ar.NO_TOGGLE)}set noToggle(e){M(this,ar.NO_TOGGLE,e)}get mediaDuration(){return $(this,a.MEDIA_DURATION)}set mediaDuration(e){W(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return $(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){W(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=pc(this);dg(this),e!==hc(this,tn).innerHTML&&(hc(this,tn).innerHTML=e)}};tn=new WeakMap;qa.getSlotTemplateHTML=cg;c.customElements.get("media-time-display")||c.customElements.define("media-time-display",qa);var Jp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ae=(i,e,t)=>(Jp(i,e,"read from private field"),t?t.call(i):e.get(i)),Lt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},qe=(i,e,t,r)=>(Jp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ug=(i,e,t,r)=>({set _(n){qe(i,e,n,t)},get _(){return Ae(i,e,r)}}),rn,Ka,nn,Zo,Ga,za,Ya,on,lr,Qa,Za=class{constructor(e,t,r){Lt(this,rn,void 0),Lt(this,Ka,void 0),Lt(this,nn,void 0),Lt(this,Zo,void 0),Lt(this,Ga,void 0),Lt(this,za,void 0),Lt(this,Ya,void 0),Lt(this,on,void 0),Lt(this,lr,0),Lt(this,Qa,(n=performance.now())=>{qe(this,lr,requestAnimationFrame(Ae(this,Qa))),qe(this,Zo,performance.now()-Ae(this,nn));let o=1e3/this.fps;if(Ae(this,Zo)>o){qe(this,nn,n-Ae(this,Zo)%o);let s=1e3/((n-Ae(this,Ka))/++ug(this,Ga)._),l=(n-Ae(this,za))/1e3/this.duration,d=Ae(this,Ya)+l*this.playbackRate;d-Ae(this,rn).valueAsNumber>0?qe(this,on,this.playbackRate/this.duration/s):(qe(this,on,.995*Ae(this,on)),d=Ae(this,rn).valueAsNumber+Ae(this,on)),this.callback(d)}}),qe(this,rn,e),this.callback=t,this.fps=r}start(){Ae(this,lr)===0&&(qe(this,nn,performance.now()),qe(this,Ka,Ae(this,nn)),qe(this,Ga,0),Ae(this,Qa).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,rn).valueAsNumber,o=Math.abs(t-this.duration);(n>0||n<-.03||o>=.5)&&this.callback(e),qe(this,Ya,e),qe(this,za,performance.now()),this.duration=t,this.playbackRate=r}};rn=new WeakMap;Ka=new WeakMap;nn=new WeakMap;Zo=new WeakMap;Ga=new WeakMap;za=new WeakMap;Ya=new WeakMap;on=new WeakMap;lr=new WeakMap;Qa=new WeakMap;var Ec=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},he=(i,e,t)=>(Ec(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)},Ze=(i,e,t,r)=>(Ec(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),we=(i,e,t)=>(Ec(i,e,"access private method"),t),sn,dr,Ja,jo,el,ja,Jo,es,an,ln,dn,Xo,gc,em,mc,tl,bc,il,_c,rl,yc,vc,tm,ts,nl,fc,im,hg="video not loaded, unknown time.",pg=i=>{let e=i.range,t=Gi(+rm(i)),r=Gi(+i.mediaSeekableEnd),n=t&&r?`${t} of ${r}`:hg;e.setAttribute("aria-valuetext",n)};function mg(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="${
|
|
1595
|
-
${
|
|
1594
|
+
<template shadowrootmode="${Fa.shadowRootOptions.mode}">
|
|
1595
|
+
${Fa.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
|
|
1608
|
+
`}var Xa=(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))},rm=(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},is=class extends _t{constructor(){super(),be(this,dn),be(this,gc),be(this,tl),be(this,il),be(this,rl),be(this,vc),be(this,ts),be(this,fc),be(this,sn,void 0),be(this,dr,void 0),be(this,Ja,void 0),be(this,jo,void 0),be(this,el,void 0),be(this,ja,void 0),be(this,Jo,void 0),be(this,es,void 0),be(this,an,void 0),be(this,ln,void 0),be(this,mc,r=>{this.dragging||(Dr(r)&&(this.range.valueAsNumber=r),he(this,ln)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Ze(this,Ja,this.shadowRoot.querySelectorAll('[part~="box"]')),Ze(this,el,this.shadowRoot.querySelector('[part~="preview-box"]')),Ze(this,ja,this.shadowRoot.querySelector('[part~="current-box"]'));let t=getComputedStyle(this);Ze(this,Jo,parseInt(t.getPropertyValue("--media-box-padding-left"))),Ze(this,es,parseInt(t.getPropertyValue("--media-box-padding-right"))),Ze(this,dr,new Za(this.range,he(this,mc),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")),we(this,dn,Xo).call(this),Ze(this,sn,this.getRootNode()),(e=he(this,sn))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),we(this,dn,Xo).call(this),(e=he(this,sn))==null||e.removeEventListener("transitionstart",this),Ze(this,sn,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?(he(this,dr).update({start:Xa(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),we(this,dn,Xo).call(this),pg(this)):e===a.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===a.MEDIA_DURATION||e===a.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=he(this,an),this.updateBar()))}get mediaChaptersCues(){return he(this,an)}set mediaChaptersCues(e){var t;Ze(this,an,e),this.updateSegments((t=he(this,an))==null?void 0:t.map(r=>({start:Xa(this,r.startTime),end:Xa(this,r.endTime)})))}get mediaPaused(){return R(this,a.MEDIA_PAUSED)}set mediaPaused(e){M(this,a.MEDIA_PAUSED,e)}get mediaLoading(){return R(this,a.MEDIA_LOADING)}set mediaLoading(e){M(this,a.MEDIA_LOADING,e)}get mediaDuration(){return $(this,a.MEDIA_DURATION)}set mediaDuration(e){W(this,a.MEDIA_DURATION,e)}get mediaCurrentTime(){return $(this,a.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){W(this,a.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return $(this,a.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){W(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 $(this,a.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){W(this,a.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return R(this,a.MEDIA_ENDED)}set mediaEnded(e){M(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=Xa(this,s)}let{style:n}=ie(this.shadowRoot,"#buffered");n.setProperty("width",`${r*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=ie(this.shadowRoot,"#current-rail"),r=ie(this.shadowRoot,'[part~="current-box"]'),n=we(this,tl,bc).call(this,he(this,ja)),o=we(this,il,_c).call(this,n,this.range.valueAsNumber),s=we(this,rl,yc).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":we(this,fc,im).call(this);break;case"pointermove":we(this,vc,tm).call(this,e);break;case"pointerup":he(this,ln)&&Ze(this,ln,!1);break;case"pointerdown":Ze(this,ln,!0);break;case"pointerleave":we(this,ts,nl).call(this,null);break;case"transitionstart":Re(e.target,this)&&setTimeout(()=>we(this,dn,Xo).call(this),0);break}}};sn=new WeakMap;dr=new WeakMap;Ja=new WeakMap;jo=new WeakMap;el=new WeakMap;ja=new WeakMap;Jo=new WeakMap;es=new WeakMap;an=new WeakMap;ln=new WeakMap;dn=new WeakSet;Xo=function(){we(this,gc,em).call(this)?he(this,dr).start():he(this,dr).stop()};gc=new WeakSet;em=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Ys(this)};mc=new WeakMap;tl=new WeakSet;bc=function(i){var e;let r=((e=this.getAttribute("bounds")?pt(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}};il=new WeakSet;_c=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};rl=new WeakSet;yc=function(i,e){let{width:t,min:r,max:n}=i.box,o=e*i.range.width;if(o<r+he(this,Jo)){let s=i.range.left-i.bounds.left-he(this,Jo);return`${o-t/2+s}px`}if(o>n-he(this,es)){let s=i.bounds.right-i.range.right-he(this,es);return`${o+t/2-s-i.range.width}px`}return 0};vc=new WeakSet;tm=function(i){let e=[...he(this,Ja)].some(p=>i.composedPath().includes(p));if(!this.dragging&&(e||!i.composedPath().includes(this))){we(this,ts,nl).call(this,null);return}let t=this.mediaSeekableEnd;if(!t)return;let r=ie(this.shadowRoot,"#preview-rail"),n=ie(this.shadowRoot,'[part~="preview-box"]'),o=we(this,tl,bc).call(this,he(this,el)),s=(i.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let l=we(this,il,_c).call(this,o,s),d=we(this,rl,yc).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(he(this,jo))-Math.round(s*t);Math.abs(h)<1&&s>.01&&s<.99||(Ze(this,jo,s*t),we(this,ts,nl).call(this,he(this,jo)))};ts=new WeakSet;nl=function(i){this.dispatchEvent(new c.CustomEvent(y.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};fc=new WeakSet;im=function(){he(this,dr).stop();let i=rm(this);this.dispatchEvent(new c.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};is.shadowRootOptions={mode:"open"};is.getContainerTemplateHTML=mg;c.customElements.get("media-time-range")||c.customElements.define("media-time-range",is);var vg=1,fg=i=>i.mediaMuted?0:i.mediaVolume,Eg=i=>`${Math.round(i*100)}%`,Tc=class extends _t{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 c.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=fg(this),this.range.setAttribute("aria-valuetext",Eg(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return $(this,a.MEDIA_VOLUME,vg)}set mediaVolume(e){W(this,a.MEDIA_VOLUME,e)}get mediaMuted(){return R(this,a.MEDIA_MUTED)}set mediaMuted(e){M(this,a.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return O(this,a.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){N(this,a.MEDIA_VOLUME_UNAVAILABLE,e)}};c.customElements.get("media-volume-range")||c.customElements.define("media-volume-range",Tc);function gg(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 bg(){return
|
|
1637
|
+
`}function bg(){return b("Loop")}var rs=class extends Y{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 R(this,a.MEDIA_LOOP)}set mediaLoop(e){M(this,a.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new c.CustomEvent(y.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};rs.getSlotTemplateHTML=gg;rs.getTooltipContentHTML=bg;c.customElements.get("media-loop-button")||c.customElements.define("media-loop-button",rs);function nm({anchor:i,floating:e,placement:t}){let r=_g({anchor:i,floating:e}),{x:n,y:o}=Tg(r,t);return{x:n,y:o}}function _g({anchor:i,floating:e}){return{anchor:yg(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function yg(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 Tg({anchor:i,floating:e},t){let r=Ag(t)==="x"?"y":"x",n=r==="y"?"height":"width",o=om(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 om(i){return i.split("-")[0]}function Ag(i){return["top","bottom"].includes(om(i))?"y":"x"}var mi=class extends Event{constructor({action:e="auto",relatedTarget:t,...r}){super("invoke",r),this.action=e,this.relatedTarget=t}},ol=class extends Event{constructor({newState:e,oldState:t,...r}){super("toggle",r),this.newState=e,this.oldState=t}};var Dc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Q=(i,e,t)=>(Dc(i,e,"read from private field"),t?t.call(i):e.get(i)),J=(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)=>(Dc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),ee=(i,e,t)=>(Dc(i,e,"access private method"),t),wt,ur,vi,sl,al,hr,ss,Ac,sm,cl,Oc,ul,ll,Sc,kc,am,Lc,lm,Ic,dm,cn,un,hn,as,hl,Nc,wc,cm,Uc,um,Cc,hm,Hc,pm,Rc,mm,Mc,vm,ns,pl,xc,fm,os,ml,dl,Pc;function Ct({type:i,text:e,value:t,checked:r}){let n=ne.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=ne.createElement("span");return o.textContent=e,n.append(o),n}function lt(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 Sg(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 ar={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ue=class extends c.HTMLElement{constructor(){if(super(),Q(this,Tc),Q(this,ll),Q(this,sl),Q(this,Sc),Q(this,kc),Q(this,Lc),Q(this,co),Q(this,cl),Q(this,Ic),Q(this,Nc),Q(this,wc),Q(this,Uc),Q(this,Cc),Q(this,Rc),Q(this,is),Q(this,Mc),Q(this,rs),Q(this,al),Q(this,Lt,null),Q(this,lr,null),Q(this,hi,null),Q(this,ol,new Set),Q(this,nl,void 0),Q(this,dr,!1),Q(this,os,null),Q(this,dl,()=>{let e=K(this,ol),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}));kt(this,ol,t)}),Q(this,ao,()=>{Z(this,co,ns).call(this),Z(this,cl,Oc).call(this,!1)}),Q(this,lo,()=>{Z(this,co,ns).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=j(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),kt(this,nl,new MutationObserver(K(this,dl))),K(this,nl).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[ar.DISABLED,ar.HIDDEN,ar.STYLE,ar.ANCHOR,N.MEDIA_CONTROLLER]}static formatMenuItemText(e,t){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":Z(this,Tc,sm).call(this,e);break;case"invoke":Z(this,Sc,am).call(this,e);break;case"click":Z(this,Ic,cm).call(this,e);break;case"toggle":Z(this,wc,hm).call(this,e);break;case"focusout":Z(this,Cc,mm).call(this,e);break;case"keydown":Z(this,Rc,vm).call(this,e);break}}connectedCallback(){var e,t;kt(this,os,En(this.shadowRoot,":host")),Z(this,sl,Ac).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),kt(this,Lt,Fs(this)),(t=(e=K(this,Lt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Ut(ss(this),K(this,ao)),Ut(this,K(this,lo))),Z(this,ll,Dc).call(this)}disconnectedCallback(){var e,t;Ht(ss(this),K(this,ao)),Ht(this,K(this,lo)),this.disable(),(t=(e=K(this,Lt))==null?void 0:e.unassociateElement)==null||t.call(e,this),kt(this,Lt,null)}attributeChangedCallback(e,t,r){var o,n,s,l;e===ar.HIDDEN&&r!==t?(K(this,dr)||kt(this,dr,!0),this.hidden?Z(this,Lc,dm).call(this):Z(this,kc,lm).call(this),this.dispatchEvent(new rl({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===N.MEDIA_CONTROLLER?(t&&((n=(o=K(this,Lt))==null?void 0:o.unassociateElement)==null||n.call(o,this),kt(this,Lt,null)),r&&this.isConnected&&(kt(this,Lt,Fs(this)),(l=(s=K(this,Lt))==null?void 0:s.associateElement)==null||l.call(s,this))):e===ar.DISABLED&&r!==t?r==null?this.enable():this.disable():e===ar.STYLE&&r!==t&&Z(this,sl,Ac).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=qi(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(kg)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(r=>r.value===e);t&&Z(this,al,xc).call(this,t)}focus(){if(kt(this,lr,fn()),this.items.length){Z(this,rs,hl).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let r=Z(this,is,ul).call(this,e);r&&(Z(this,al,xc).call(this,r,r.type==="checkbox"),K(this,hi)&&!this.hidden&&((t=K(this,lr))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,r;let{key:o}=e,n=this.items,s=(r=(t=Z(this,is,ul).call(this,e))!=null?t:Z(this,Mc,fm).call(this))!=null?r:n[0],l=n.indexOf(s),d=Math.max(0,l);o==="ArrowDown"?d++:o==="ArrowUp"?d--:e.key==="Home"?d=0:e.key==="End"&&(d=n.length-1),d<0&&(d=n.length-1),d>n.length-1&&(d=0),Z(this,rs,hl).call(this,n[d]),n[d].focus()}};Lt=new WeakMap;lr=new WeakMap;hi=new WeakMap;ol=new WeakMap;nl=new WeakMap;dr=new WeakMap;os=new WeakMap;Tc=new WeakSet;sm=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();["header","title"].includes(e.name)&&Z(this,ll,Dc).call(this),e.name||K(this,dl).call(this)};ll=new WeakSet;Dc=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};dl=new WeakMap;sl=new WeakSet;Ac=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")};Sc=new WeakSet;am=function(i){kt(this,hi,i.relatedTarget),Ce(this,i.relatedTarget)||(this.hidden=!this.hidden)};kc=new WeakSet;lm=function(){var i;(i=K(this,hi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Ut(ss(this),K(this,ao)),Ut(this,K(this,lo))};Lc=new WeakSet;dm=function(){var i;(i=K(this,hi))==null||i.setAttribute("aria-expanded","false"),Ht(ss(this),K(this,ao)),Ht(this,K(this,lo))};ao=new WeakMap;lo=new WeakMap;co=new WeakSet;ns=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=om({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let o=ss(this).getBoundingClientRect(),n=o.width-e-i,s=o.height-t-this.offsetHeight,{style:l}=K(this,os);l.setProperty("position","absolute"),l.setProperty("right",`${Math.max(0,n)}px`),l.setProperty("--_menu-bottom",`${s}px`);let d=getComputedStyle(this),p=l.getPropertyValue("--_menu-bottom")===d.bottom?s:parseFloat(d.bottom),g=o.height-p-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};cl=new WeakSet;Oc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=K(this,os);if(i||r.setProperty("--media-menu-transition-in","none"),t){let o=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${o}px`),Z(this,co,ns).call(this,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),Z(this,co,ns).call(this);r.removeProperty("--media-menu-transition-in")};Ic=new WeakSet;cm=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(K(this,Nc,um))){(e=K(this,lr))==null||e.focus(),this.hidden=!0;return}let t=Z(this,is,ul).call(this,i);!t||t.hasAttribute("disabled")||(Z(this,rs,hl).call(this,t),this.handleSelect(i))};Nc=new WeakSet;um=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"]'))};wc=new WeakSet;hm=function(i){if(i.target===this)return;Z(this,Uc,pm).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 ui({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);Z(this,cl,Oc).call(this,!0)};Uc=new WeakSet;pm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Cc=new WeakSet;mm=function(i){var e;Ce(this,i.relatedTarget)||(K(this,dr)&&((e=K(this,lr))==null||e.focus()),K(this,hi)&&K(this,hi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Rc=new WeakSet;vm=function(i){var e,t,r,o,n;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(K(this,dr)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(o=(r=this.nextElementSibling)==null?void 0:r.focus)==null||o.call(r),this.blur()}else s==="Escape"?((n=K(this,lr))==null||n.focus(),K(this,dr)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};is=new WeakSet;ul=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Mc=new WeakSet;fm=function(){return this.items.find(i=>i.tabIndex===0)};rs=new WeakSet;hl=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};al=new WeakSet;xc=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(r=>r.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((r,o)=>r!=t[o])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};ue.shadowRootOptions={mode:"open"};ue.getTemplateHTML=Sg;function kg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function ss(i){var e;return(e=i.getAttribute("bounds")?ut(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}c.customElements.get("media-chrome-menu")||c.customElements.define("media-chrome-menu",ue);var Fc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wt=(i,e,t)=>(Fc(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)},Hc=(i,e,t,r)=>(Fc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),at=(i,e,t)=>(Fc(i,e,"access private method"),t),pl,ls,$c,Em,vl,qc,Kc,gm,Ct,uo,ds,Bc,bm,ml,Vc;function Lg(i){return`
|
|
1812
|
+
`}var cr={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},pe=class extends c.HTMLElement{constructor(){if(super(),J(this,Ac),J(this,cl),J(this,ll),J(this,kc),J(this,Lc),J(this,Ic),J(this,hn),J(this,hl),J(this,wc),J(this,Uc),J(this,Cc),J(this,Hc),J(this,Rc),J(this,Mc),J(this,ns),J(this,xc),J(this,os),J(this,dl),J(this,wt,null),J(this,ur,null),J(this,vi,null),J(this,sl,new Set),J(this,al,void 0),J(this,hr,!1),J(this,ss,null),J(this,ul,()=>{let e=Q(this,sl),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,sl,t)}),J(this,cn,()=>{ee(this,hn,as).call(this),ee(this,hl,Nc).call(this,!1)}),J(this,un,()=>{ee(this,hn,as).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=re(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,al,new MutationObserver(Q(this,ul))),Q(this,al).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[cr.DISABLED,cr.HIDDEN,cr.STYLE,cr.ANCHOR,U.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":ee(this,Ac,sm).call(this,e);break;case"invoke":ee(this,kc,am).call(this,e);break;case"click":ee(this,wc,cm).call(this,e);break;case"toggle":ee(this,Cc,hm).call(this,e);break;case"focusout":ee(this,Rc,mm).call(this,e);break;case"keydown":ee(this,Mc,vm).call(this,e);break}}connectedCallback(){var e,t;It(this,ss,bo(this.shadowRoot,":host")),ee(this,ll,Sc).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),It(this,wt,Ks(this)),(t=(e=Q(this,wt))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||($t(ls(this),Q(this,cn)),$t(this,Q(this,un))),ee(this,cl,Oc).call(this)}disconnectedCallback(){var e,t;Bt(ls(this),Q(this,cn)),Bt(this,Q(this,un)),this.disable(),(t=(e=Q(this,wt))==null?void 0:e.unassociateElement)==null||t.call(e,this),It(this,wt,null)}attributeChangedCallback(e,t,r){var n,o,s,l;e===cr.HIDDEN&&r!==t?(Q(this,hr)||It(this,hr,!0),this.hidden?ee(this,Ic,dm).call(this):ee(this,Lc,lm).call(this),this.dispatchEvent(new ol({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===U.MEDIA_CONTROLLER?(t&&((o=(n=Q(this,wt))==null?void 0:n.unassociateElement)==null||o.call(n,this),It(this,wt,null)),r&&this.isConnected&&(It(this,wt,Ks(this)),(l=(s=Q(this,wt))==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&&ee(this,ll,Sc).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(kg)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(r=>r.value===e);t&&ee(this,dl,Pc).call(this,t)}focus(){if(It(this,ur,go()),this.items.length){ee(this,os,ml).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=ee(this,ns,pl).call(this,e);r&&(ee(this,dl,Pc).call(this,r,r.type==="checkbox"),Q(this,vi)&&!this.hidden&&((t=Q(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=ee(this,ns,pl).call(this,e))!=null?t:ee(this,xc,fm).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),ee(this,os,ml).call(this,o[d]),o[d].focus()}};wt=new WeakMap;ur=new WeakMap;vi=new WeakMap;sl=new WeakMap;al=new WeakMap;hr=new WeakMap;ss=new WeakMap;Ac=new WeakSet;sm=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();["header","title"].includes(e.name)&&ee(this,cl,Oc).call(this),e.name||Q(this,ul).call(this)};cl=new WeakSet;Oc=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};ul=new WeakMap;ll=new WeakSet;Sc=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")};kc=new WeakSet;am=function(i){It(this,vi,i.relatedTarget),Re(this,i.relatedTarget)||(this.hidden=!this.hidden)};Lc=new WeakSet;lm=function(){var i;(i=Q(this,vi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),$t(ls(this),Q(this,cn)),$t(this,Q(this,un))};Ic=new WeakSet;dm=function(){var i;(i=Q(this,vi))==null||i.setAttribute("aria-expanded","false"),Bt(ls(this),Q(this,cn)),Bt(this,Q(this,un))};cn=new WeakMap;un=new WeakMap;hn=new WeakSet;as=function(i){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:t}=nm({anchor:this.anchorElement,floating:this,placement:"top-start"});i??(i=this.offsetWidth);let n=ls(this).getBoundingClientRect(),o=n.width-e-i,s=n.height-t-this.offsetHeight,{style:l}=Q(this,ss);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),v=n.height-p-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height",`${v}px`)};hl=new WeakSet;Nc=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:r}=Q(this,ss);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`),ee(this,hn,as).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),ee(this,hn,as).call(this);r.removeProperty("--media-menu-transition-in")};wc=new WeakSet;cm=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(Q(this,Uc,um))){(e=Q(this,ur))==null||e.focus(),this.hidden=!0;return}let t=ee(this,ns,pl).call(this,i);!t||t.hasAttribute("disabled")||(ee(this,os,ml).call(this,t),this.handleSelect(i))};Uc=new WeakSet;um=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"]'))};Cc=new WeakSet;hm=function(i){if(i.target===this)return;ee(this,Hc,pm).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 mi({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);ee(this,hl,Nc).call(this,!0)};Hc=new WeakSet;pm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Rc=new WeakSet;mm=function(i){var e;Re(this,i.relatedTarget)||(Q(this,hr)&&((e=Q(this,ur))==null||e.focus()),Q(this,vi)&&Q(this,vi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Mc=new WeakSet;vm=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(Q(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=Q(this,ur))==null||o.focus(),Q(this,hr)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(i):this.handleMove(i)};ns=new WeakSet;pl=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};xc=new WeakSet;fm=function(){return this.items.find(i=>i.tabIndex===0)};os=new WeakSet;ml=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};dl=new WeakSet;Pc=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}))};pe.shadowRootOptions={mode:"open"};pe.getTemplateHTML=Sg;function kg(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function ls(i){var e;return(e=i.getAttribute("bounds")?pt(i,`#${i.getAttribute("bounds")}`):te(i)||i.parentElement)!=null?e:i}c.customElements.get("media-chrome-menu")||c.customElements.define("media-chrome-menu",pe);var qc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Rt=(i,e,t)=>(qc(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)},$c=(i,e,t,r)=>(qc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),dt=(i,e,t)=>(qc(i,e,"access private method"),t),vl,cs,Bc,Em,El,Kc,Gc,gm,Mt,pn,us,Vc,bm,fl,Wc;function Lg(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 Ig(i){return""}var
|
|
1931
|
-
${
|
|
1930
|
+
`}function Ig(i){return""}var Xe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ke=class extends c.HTMLElement{constructor(){if(super(),qt(this,Bc),qt(this,El),qt(this,Gc),qt(this,pn),qt(this,Vc),qt(this,fl),qt(this,vl,!1),qt(this,cs,void 0),qt(this,Mt,()=>{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=ne.createElement("span");s.textContent=o??"",r.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=re(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[Xe.TYPE,Xe.DISABLED,Xe.CHECKED,Xe.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),ds(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":dt(this,Bc,Em).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":dt(this,Vc,bm).call(this,e);break;case"keyup":dt(this,pn,us).call(this,e);break}}attributeChangedCallback(e,t,r){e===Xe.CHECKED&&ds(this)&&!Rt(this,vl)?this.setAttribute("aria-checked",r!=null?"true":"false"):e===Xe.TYPE&&r!==t?this.role="menuitem"+r:e===Xe.DISABLED&&r!==t&&(r==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Xe.DISABLED)||this.enable(),this.role="menuitem"+this.type,$c(this,cs,Fc(this,this.parentNode)),dt(this,fl,Wc).call(this),this.submenuElement&&dt(this,El,Kc).call(this)}disconnectedCallback(){this.disable(),dt(this,fl,Wc).call(this),$c(this,cs,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(Xe.TYPE))!=null?e:""}set type(e){this.setAttribute(Xe.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Xe.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Xe.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(ds(this))return this.getAttribute("aria-checked")==="true"}set checked(e){ds(this)&&($c(this,vl,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){ds(this)||this.invokeTargetElement&&Re(this,e.target)&&this.invokeTargetElement.dispatchEvent(new mi({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};vl=new WeakMap;cs=new WeakMap;Bc=new WeakSet;Em=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?dt(this,El,Kc).call(this):dt(this,Gc,gm).call(this))};El=new WeakSet;Kc=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",Rt(this,Mt)),this.submenuElement.addEventListener("addmenuitem",Rt(this,Mt)),this.submenuElement.addEventListener("removemenuitem",Rt(this,Mt)),Rt(this,Mt).call(this)};Gc=new WeakSet;gm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Rt(this,Mt)),this.submenuElement.removeEventListener("addmenuitem",Rt(this,Mt)),this.submenuElement.removeEventListener("removemenuitem",Rt(this,Mt)),Rt(this,Mt).call(this)};Mt=new WeakMap;pn=new WeakSet;us=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",dt(this,pn,us));return}this.handleClick(i)};Vc=new WeakSet;bm=function(i){let{metaKey:e,altKey:t,key:r}=i;if(e||t||!this.keysUsed.includes(r)){this.removeEventListener("keyup",dt(this,pn,us));return}this.addEventListener("keyup",dt(this,pn,us),{once:!0})};fl=new WeakSet;Wc=function(){var i;let e=(i=Rt(this,cs))==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=Lg;Ke.getSuffixSlotInnerHTML=Ig;function ds(i){return i.type==="radio"||i.type==="checkbox"}function Fc(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Fc(i,t):e!=null&&e.items?e:Fc(e,e==null?void 0:e.parentNode)}c.customElements.get("media-chrome-menu-item")||c.customElements.define("media-chrome-menu-item",Ke);function wg(i){return`
|
|
1931
|
+
${pe.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
|
|
1966
|
-
${
|
|
1965
|
+
`}var hs=class extends pe{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:te(this).querySelector("media-settings-menu-button")}};hs.getTemplateHTML=wg;c.customElements.get("media-settings-menu")||c.customElements.define("media-settings-menu",hs);function Cg(i){return`
|
|
1966
|
+
${Ke.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));
|
|
@@ -1977,7 +1977,7 @@ bp-player[has-error] {
|
|
|
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
|
|
1980
|
+
`}var pr=class extends Ke{};pr.shadowRootOptions={mode:"open"};pr.getTemplateHTML=Cg;pr.getSuffixSlotInnerHTML=Rg;c.customElements.get("media-settings-menu-item")||c.customElements.define("media-settings-menu-item",pr);var He=class extends Y{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 mi({relatedTarget:this}))}};c.customElements.get("media-chrome-menu-button")||c.customElements.define("media-chrome-menu-button",He);function Mg(){return`
|
|
1981
1981
|
<style>
|
|
1982
1982
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
1983
1983
|
display: none;
|
|
@@ -1988,7 +1988,7 @@ 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 xg(){return
|
|
1991
|
+
`}function xg(){return b("Settings")}var mn=class extends He{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",b("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:te(this).querySelector("media-settings-menu")}};mn.getSlotTemplateHTML=Mg;mn.getTooltipContentHTML=xg;c.customElements.get("media-settings-menu-button")||c.customElements.define("media-settings-menu-button",mn);var Zc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_m=(i,e,t)=>(Zc(i,e,"read from private field"),t?t.call(i):e.get(i)),gl=(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)},zc=(i,e,t,r)=>(Zc(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),bl=(i,e,t)=>(Zc(i,e,"access private method"),t),ps,Tl,_l,Yc,yl,Qc,Al=class extends pe{constructor(){super(...arguments),gl(this,_l),gl(this,yl),gl(this,ps,[]),gl(this,Tl,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&&(zc(this,ps,Ah(r??"")),bl(this,_l,Yc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",bl(this,yl,Qc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",bl(this,yl,Qc))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=te(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return _m(this,ps)}set mediaAudioTrackList(e){zc(this,ps,e),bl(this,_l,Yc).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)}};ps=new WeakMap;Tl=new WeakMap;_l=new WeakSet;Yc=function(){if(_m(this,Tl)===JSON.stringify(this.mediaAudioTrackList))return;zc(this,Tl,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=Ct({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});r.prepend(lt(this,"checked-indicator")),this.defaultSlot.append(r)}};yl=new WeakSet;Qc=function(){if(this.value==null)return;let i=new c.CustomEvent(y.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-audio-track-menu")||c.customElements.define("media-audio-track-menu",Al);var Pg=`<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
1994
|
</svg>`;function Dg(){return`
|
|
@@ -1998,13 +1998,13 @@ bp-player[has-error] {
|
|
|
1998
1998
|
}
|
|
1999
1999
|
</style>
|
|
2000
2000
|
<slot name="icon">${Pg}</slot>
|
|
2001
|
-
`}function Og(){return
|
|
2001
|
+
`}function Og(){return b("Audio")}var ym=i=>{let e=b("Audio");i.setAttribute("aria-label",e)},vn=class extends He{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_AUDIO_TRACK_ENABLED,a.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),ym(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_LANG&&ym(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=te(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)}};vn.getSlotTemplateHTML=Dg;vn.getTooltipContentHTML=Og;c.customElements.get("media-audio-track-menu-button")||c.customElements.define("media-audio-track-menu-button",vn);var eu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ng=(i,e,t)=>(eu(i,e,"read from private field"),t?t.call(i):e.get(i)),Xc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ug=(i,e,t,r)=>(eu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Sl=(i,e,t)=>(eu(i,e,"access private method"),t),Il,kl,jc,Ll,Jc,Hg=`
|
|
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
2004
|
</svg>`;function $g(i){return`
|
|
2005
|
-
${
|
|
2005
|
+
${pe.getTemplateHTML(i)}
|
|
2006
2006
|
<slot name="captions-indicator" hidden>${Hg}</slot>
|
|
2007
|
-
`}var
|
|
2007
|
+
`}var ms=class extends pe{constructor(){super(...arguments),Xc(this,kl),Xc(this,Ll),Xc(this,Il,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?Sl(this,kl,jc).call(this):e===a.MEDIA_SUBTITLES_SHOWING&&t!==r&&(this.value=r||"",Sl(this,kl,jc).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Sl(this,Ll,Jc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Sl(this,Ll,Jc))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:te(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Tm(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Am(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Tm(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Am(this,a.MEDIA_SUBTITLES_SHOWING,e)}};Il=new WeakMap;kl=new WeakSet;jc=function(){var i;let e=Ng(this,Il)!==JSON.stringify(this.mediaSubtitlesList),t=this.value!==this.getAttribute(a.MEDIA_SUBTITLES_SHOWING);if(!e&&!t)return;Ug(this,Il,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let r=!this.value,n=Ct({type:"radio",text:this.formatMenuItemText(b("Off")),value:"off",checked:r});n.prepend(lt(this,"checked-indicator")),this.defaultSlot.append(n);let o=this.mediaSubtitlesList;for(let s of o){let l=Ct({type:"radio",text:this.formatMenuItemText(s.label,s),value:na(s),checked:this.value==na(s)});l.prepend(lt(this,"checked-indicator")),((i=s.kind)!=null?i:"subs")==="captions"&&l.append(lt(this,"captions-indicator")),this.defaultSlot.append(l)}};Ll=new WeakSet;Jc=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 c.CustomEvent(y.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let r=new c.CustomEvent(y.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)};ms.getTemplateHTML=$g;var Tm=(i,e)=>{let t=i.getAttribute(e);return t?Xi(t):[]},Am=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Wt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu")||c.customElements.define("media-captions-menu",ms);var Bg=`<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
2009
|
</svg>`,Vg=`<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"/>
|
|
@@ -2028,7 +2028,7 @@ bp-player[has-error] {
|
|
|
2028
2028
|
<slot name="on">${Bg}</slot>
|
|
2029
2029
|
<slot name="off">${Vg}</slot>
|
|
2030
2030
|
</slot>
|
|
2031
|
-
`}function Fg(){return
|
|
2031
|
+
`}function Fg(){return b("Captions")}var Sm=i=>{i.setAttribute("data-captions-enabled",oa(i).toString())},km=i=>{i.setAttribute("aria-label",b("closed captions"))},fn=class extends He{static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_SUBTITLES_LIST,a.MEDIA_SUBTITLES_SHOWING,a.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),km(this),Sm(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_SUBTITLES_SHOWING?Sm(this):e===a.MEDIA_LANG&&km(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=te(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Lm(this,a.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Im(this,a.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Lm(this,a.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Im(this,a.MEDIA_SUBTITLES_SHOWING,e)}};fn.getSlotTemplateHTML=Wg;fn.getTooltipContentHTML=Fg;var Lm=(i,e)=>{let t=i.getAttribute(e);return t?Xi(t):[]},Im=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let r=Wt(t);i.getAttribute(e)!==r&&i.setAttribute(e,r)};c.customElements.get("media-captions-menu-button")||c.customElements.define("media-captions-menu-button",fn);var wm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gn=(i,e,t)=>(wm(i,e,"read from private field"),t?t.call(i):e.get(i)),tu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},En=(i,e,t)=>(wm(i,e,"access private method"),t),fi,bn,vs,wl,ru,iu={RATES:"rates"},Cl=class extends pe{constructor(){super(),tu(this,bn),tu(this,wl),tu(this,fi,new ai(this,iu.RATES,{defaultValue:ac})),En(this,bn,vs).call(this)}static get observedAttributes(){return[...super.observedAttributes,a.MEDIA_PLAYBACK_RATE,iu.RATES]}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),e===a.MEDIA_PLAYBACK_RATE&&t!=r?(this.value=r,En(this,bn,vs).call(this)):e===iu.RATES&&t!=r&&(gn(this,fi).value=r,En(this,bn,vs).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",En(this,wl,ru))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",En(this,wl,ru))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:te(this).querySelector("media-playback-rate-menu-button")}get rates(){return gn(this,fi)}set rates(e){e?Array.isArray(e)?gn(this,fi).value=e.join(" "):typeof e=="string"&&(gn(this,fi).value=e):gn(this,fi).value="",En(this,bn,vs).call(this)}get mediaPlaybackRate(){return $(this,a.MEDIA_PLAYBACK_RATE,sr)}set mediaPlaybackRate(e){W(this,a.MEDIA_PLAYBACK_RATE,e)}};fi=new WeakMap;bn=new WeakSet;vs=function(){this.defaultSlot.textContent="";let i=this.mediaPlaybackRate,e=new Set(Array.from(gn(this,fi)).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=Ct({type:"radio",text:this.formatMenuItemText(`${r}x`,r),value:r.toString(),checked:i===r});n.prepend(lt(this,"checked-indicator")),this.defaultSlot.append(n)}};wl=new WeakSet;ru=function(){if(!this.value)return;let i=new c.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-playback-rate-menu")||c.customElements.define("media-playback-rate-menu",Cl);var Rl=1;function qg(i){return`
|
|
2032
2032
|
<style>
|
|
2033
2033
|
:host {
|
|
2034
2034
|
min-width: 5ch;
|
|
@@ -2043,8 +2043,8 @@ bp-player[has-error] {
|
|
|
2043
2043
|
display: none;
|
|
2044
2044
|
}
|
|
2045
2045
|
</style>
|
|
2046
|
-
<slot name="icon">${i.mediaplaybackrate||
|
|
2047
|
-
`}function Kg(){return
|
|
2046
|
+
<slot name="icon">${i.mediaplaybackrate||Rl}x</slot>
|
|
2047
|
+
`}function Kg(){return b("Playback rate")}var _n=class extends He{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:Rl}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)?Rl:n;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",b("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:te(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return $(this,a.MEDIA_PLAYBACK_RATE,Rl)}set mediaPlaybackRate(e){W(this,a.MEDIA_PLAYBACK_RATE,e)}};_n.getSlotTemplateHTML=qg;_n.getTooltipContentHTML=Kg;c.customElements.get("media-playback-rate-menu-button")||c.customElements.define("media-playback-rate-menu-button",_n);var ou=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fs=(i,e,t)=>(ou(i,e,"read from private field"),t?t.call(i):e.get(i)),Ml=(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)},Cm=(i,e,t,r)=>(ou(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),yn=(i,e,t)=>(ou(i,e,"access private method"),t),Es,An,Tn,gs,xl,nu,Pl=class extends pe{constructor(){super(...arguments),Ml(this,Tn),Ml(this,xl),Ml(this,Es,[]),Ml(this,An,{})}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",yn(this,Tn,gs).call(this)):e===a.MEDIA_RENDITION_LIST&&t!==r?(Cm(this,Es,yh(r)),yn(this,Tn,gs).call(this)):e===a.MEDIA_HEIGHT&&t!==r&&yn(this,Tn,gs).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",yn(this,xl,nu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",yn(this,xl,nu))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:te(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return fs(this,Es)}set mediaRenditionList(e){Cm(this,Es,e),yn(this,Tn,gs).call(this)}get mediaRenditionSelected(){return O(this,a.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){N(this,a.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return $(this,a.MEDIA_HEIGHT)}set mediaHeight(e){W(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)}};Es=new WeakMap;An=new WeakMap;Tn=new WeakSet;gs=function(){if(fs(this,An).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&fs(this,An).mediaHeight===this.mediaHeight)return;fs(this,An).mediaRenditionList=JSON.stringify(this.mediaRenditionList),fs(this,An).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=Ct({type:"radio",text:l,value:`${s.id}`,checked:s.selected&&!t});d.prepend(lt(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=Ct({type:"radio",text:n,value:"auto",checked:t});o.dataset.description=n,o.prepend(lt(this,"checked-indicator")),this.defaultSlot.append(o)};xl=new WeakSet;nu=function(){if(this.value==null)return;let i=new c.CustomEvent(y.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};c.customElements.get("media-rendition-menu")||c.customElements.define("media-rendition-menu",Pl);var Gg=`<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
2049
|
</svg>`;function zg(){return`
|
|
2050
2050
|
<style>
|
|
@@ -2053,8 +2053,8 @@ bp-player[has-error] {
|
|
|
2053
2053
|
}
|
|
2054
2054
|
</style>
|
|
2055
2055
|
<slot name="icon">${Gg}</slot>
|
|
2056
|
-
`}function Yg(){return
|
|
2057
|
-
${
|
|
2056
|
+
`}function Yg(){return b("Quality")}var Sn=class extends He{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:te(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 $(this,a.MEDIA_HEIGHT)}set mediaHeight(e){W(this,a.MEDIA_HEIGHT,e)}};Sn.getSlotTemplateHTML=zg;Sn.getTooltipContentHTML=Yg;c.customElements.get("media-rendition-menu-button")||c.customElements.define("media-rendition-menu-button",Sn);var lu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Pt=(i,e,t)=>(lu(i,e,"read from private field"),t?t.call(i):e.get(i)),xt=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Rm=(i,e,t,r)=>(lu(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),je=(i,e,t)=>(lu(i,e,"access private method"),t),Ln,bs,$l,mr,kn,du,Mm,Dl,su,Ol,au,xm,Ul,Hl,Nl;function Qg(i){return`
|
|
2057
|
+
${pe.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
|
|
2071
|
-
${
|
|
2070
|
+
`}var _s=class extends pe{constructor(){super(),xt(this,bs),xt(this,mr),xt(this,du),xt(this,Dl),xt(this,au),xt(this,Ln,!1),xt(this,Ol,e=>{let t=e.target,r=(t==null?void 0:t.nodeName)==="VIDEO",n=je(this,Dl,su).call(this,t);(r||n)&&(Pt(this,Ln)?je(this,mr,kn).call(this):je(this,au,xm).call(this,e))}),xt(this,Ul,e=>{let t=e.target,r=this.contains(t),n=e.button===2,o=(t==null?void 0:t.nodeName)==="VIDEO",s=je(this,Dl,su).call(this,t);r||n&&(o||s)||je(this,mr,kn).call(this)}),xt(this,Hl,e=>{e.key==="Escape"&&je(this,mr,kn).call(this)}),xt(this,Nl,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,kn).call(this)}),this.setAttribute("noautohide",""),je(this,bs,$l).call(this)}connectedCallback(){super.connectedCallback(),te(this).addEventListener("contextmenu",Pt(this,Ol)),this.addEventListener("click",Pt(this,Nl))}disconnectedCallback(){super.disconnectedCallback(),te(this).removeEventListener("contextmenu",Pt(this,Ol)),this.removeEventListener("click",Pt(this,Nl)),document.removeEventListener("mousedown",Pt(this,Ul)),document.removeEventListener("keydown",Pt(this,Hl))}};Ln=new WeakMap;bs=new WeakSet;$l=function(){this.hidden=!Pt(this,Ln)};mr=new WeakSet;kn=function(){Rm(this,Ln,!1),je(this,bs,$l).call(this)};du=new WeakSet;Mm=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var t;e!==this&&je(t=e,mr,kn).call(t)})};Dl=new WeakSet;su=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};Ol=new WeakMap;au=new WeakSet;xm=function(i){i.preventDefault(),je(this,du,Mm).call(this),Rm(this,Ln,!0),this.style.position="fixed",this.style.left=`${i.clientX}px`,this.style.top=`${i.clientY}px`,je(this,bs,$l).call(this),document.addEventListener("mousedown",Pt(this,Ul),{once:!0}),document.addEventListener("keydown",Pt(this,Hl),{once:!0})};Ul=new WeakMap;Hl=new WeakMap;Nl=new WeakMap;_s.getTemplateHTML=Qg;c.customElements.get("media-context-menu")||c.customElements.define("media-context-menu",_s);function Zg(i){return`
|
|
2071
|
+
${Ke.getTemplateHTML.call(this,i)}
|
|
2072
2072
|
<style>
|
|
2073
2073
|
::slotted(*) {
|
|
2074
2074
|
color: var(--media-text-color, white);
|
|
@@ -2080,26 +2080,26 @@ bp-player[has-error] {
|
|
|
2080
2080
|
min-height: var(--media-control-height, 24px);
|
|
2081
2081
|
}
|
|
2082
2082
|
</style>
|
|
2083
|
-
`}var
|
|
2083
|
+
`}var In=class extends Ke{};In.shadowRootOptions={mode:"open"};In.getTemplateHTML=Zg;c.customElements.get("media-context-menu-item")||c.customElements.define("media-context-menu-item",In);var Xg=`<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>`,Jg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
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
2085
|
</svg>`,jg=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
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>`,Jg=`<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
2090
|
</svg>`,eb=`<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 tb(i){switch(i){case"offline":return
|
|
2092
|
+
</svg>`;function tb(i){switch(i){case"offline":return jg;case"network":return Jg;case"security":return eb;default:return Xg}}function ib(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 Pe{constructor(){super(...arguments);this.error=null;this.showCode=!1}render(){if(!this.error)return null;let t=this.error.category,r=tb(t),n=ib(t);return ze`
|
|
2093
2093
|
<div part="icon">
|
|
2094
2094
|
<slot name="icon">${this.renderIcon(r)}</slot>
|
|
2095
2095
|
</div>
|
|
2096
2096
|
<h2 part="heading">
|
|
2097
|
-
<slot name="heading">${
|
|
2097
|
+
<slot name="heading">${n}</slot>
|
|
2098
2098
|
</h2>
|
|
2099
2099
|
<p part="message">
|
|
2100
2100
|
<slot name="message">${this.error.message}</slot>
|
|
2101
2101
|
</p>
|
|
2102
|
-
${this.showCode?
|
|
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)}};
|
|
2110
|
+
`}renderIcon(t){let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Kt.styles=zn`
|
|
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
|
-
`,
|
|
2171
|
+
`,H([z({type:Object})],Kt.prototype,"error",2),H([z({type:Boolean})],Kt.prototype,"showCode",2),Kt=H([ei("bp-error-display")],Kt);var Pm=`/**
|
|
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 Dm=!1;function
|
|
2692
|
+
`;var Dm=!1;function nb(){if(Dm||(Dm=!0,document.getElementById("bp-default-ui-styles")))return;Mr();let i=document.createElement("style");i.id="bp-default-ui-styles",i.textContent=Pm,document.head.appendChild(i)}var oe=class extends Pe{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(),nb(),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(Ds(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(fo,{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 v=p!==null&&p.fatal&&p.category!=="offline";ge(this,"has-error",v)},r=()=>{var v;let p=(v=this._player)==null?void 0:v.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 f=p.error!==null&&p.error.fatal&&p.error.category!=="offline";ge(this,"has-error",f)}},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"?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
|
-
`:
|
|
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
|
|
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()?
|
|
2734
|
+
${this._getPoster()?ze`
|
|
2735
2735
|
<media-poster-image slot="poster" src="${this._getPoster()}"></media-poster-image>
|
|
2736
2736
|
`:null}
|
|
2737
2737
|
|
|
@@ -2764,7 +2764,7 @@ 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
|
-
`}};
|
|
2767
|
+
`}};H([z({converter:xr()})],oe.prototype,"source",2),H([z({type:Boolean})],oe.prototype,"autoplay",2),H([z({type:Boolean})],oe.prototype,"muted",2),H([z({type:Boolean})],oe.prototype,"loop",2),H([z({type:String})],oe.prototype,"poster",2),H([z({type:String})],oe.prototype,"scaling",2),H([z({type:String,attribute:"aspect-ratio"})],oe.prototype,"aspectRatio",2),H([z({converter:xr()})],oe.prototype,"config",2),H([z({type:Boolean})],oe.prototype,"debug",2),H([z({type:Number})],oe.prototype,"autohide",2),H([z({type:Boolean})],oe.prototype,"hotkeys",2),H([z({type:Boolean,reflect:!0})],oe.prototype,"mobile",2),H([z({type:Boolean,reflect:!0})],oe.prototype,"live",2),H([z({type:Boolean,reflect:!0})],oe.prototype,"fluid",2),H([ti()],oe.prototype,"_player",2),H([ti()],oe.prototype,"_providerType",2),H([ti()],oe.prototype,"_error",2),H([ti()],oe.prototype,"_connectionState",2),H([ti()],oe.prototype,"_showEndedOverlay",2),oe=H([ei("bp-default-ui")],oe);var ob=`<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"/>
|
|
@@ -2776,7 +2776,7 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
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
2777
|
</svg>`,lb=`<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>`,
|
|
2779
|
+
</svg>`,Dt=class extends Pe{constructor(){super(...arguments);this.type="none";this.live=!1;this.buttonMode=!1}getIcon(){switch(this.type){case"loading":return ob;case"offline":return sb;case"ended":return this.live?ab:lb;default:return""}}getDefaultMessage(){switch(this.type){case"loading":return"Loading...";case"offline":return"The live stream hasn't started yet";case"ended":return this.live?"Stream has ended":"Replay";default:return""}}render(){if(this.type==="none")return null;let t=this.getIcon(),r=this.getDefaultMessage();return ze`
|
|
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)}};
|
|
2789
|
+
`}renderIcon(t){if(!t)return null;let r=document.createElement("template");return r.innerHTML=t.trim(),r.content.cloneNode(!0)}};Dt.styles=zn`
|
|
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
|
-
`,
|
|
2860
|
+
`,H([z({type:String,reflect:!0})],Dt.prototype,"type",2),H([z({type:Boolean,reflect:!0})],Dt.prototype,"live",2),H([z({type:Boolean,reflect:!0,attribute:"button-mode"})],Dt.prototype,"buttonMode",2),Dt=H([ei("bp-overlay")],Dt);var db=["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"],Om=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function cb(i){return`
|
|
2861
2861
|
<style>
|
|
2862
2862
|
:host {
|
|
2863
2863
|
display: inline-flex;
|
|
@@ -2899,22 +2899,22 @@ bp-default-ui[debug-hitboxes] media-controller *:hover {
|
|
|
2899
2899
|
<video${Vm(i)}></video>
|
|
2900
2900
|
</slot>
|
|
2901
2901
|
<slot></slot>
|
|
2902
|
-
`}function Bm(i,{tag:e,is:t}){var n,s,l,d,h,Nm,g,E,m,T,f,hr,du,Um,cu,Hm,$m;let r=(s=(n=globalThis.document)==null?void 0:n.createElement)==null?void 0:s.call(n,e,{is:t}),o=r?hb(r):[];return l=class extends i{constructor(){super(...arguments);L(this,f);L(this,g,!1);L(this,E,null);L(this,m,new Map);L(this,T);$(this,"get");$(this,"set");$(this,"call")}static get observedAttributes(){var q,de;return P(q=l,h,Nm).call(q),[...((de=r==null?void 0:r.constructor)==null?void 0:de.observedAttributes)??[],...Om]}get nativeEl(){var I;return P(this,f,hr).call(this),u(this,E)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((I=this.shadowRoot)==null?void 0:I.querySelector(e))??null}set nativeEl(I){v(this,E,I)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(I){this.toggleAttribute("muted",I)}get src(){return this.getAttribute("src")}set src(I){this.setAttribute("src",`${I}`)}get preload(){var I;return this.getAttribute("preload")??((I=this.nativeEl)==null?void 0:I.preload)}set preload(I){this.setAttribute("preload",`${I}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});let I=pb(this.attributes);t&&(I.is=t),e&&(I.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(I)}this.nativeEl.muted=this.hasAttribute("muted");for(let I of o)P(this,f,Hm).call(this,I);v(this,T,new MutationObserver(P(this,f,Um).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>P(this,f,du).call(this)),P(this,f,du).call(this);for(let I of this.constructor.Events)this.shadowRoot.addEventListener(I,this,!0)}handleEvent(I){I.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(I.type,{detail:I.detail}))}attributeChangedCallback(I,q,de){P(this,f,hr).call(this),P(this,f,$m).call(this,I,q,de)}connectedCallback(){P(this,f,hr).call(this)}},d=new WeakMap,h=new WeakSet,Nm=function(){if(u(this,d))return;v(this,d,!0);let I=new Set(this.observedAttributes);I.delete("muted");for(let q of o)if(!(q in this.prototype))if(typeof r[q]=="function")this.prototype[q]=function(...de){return P(this,f,hr).call(this),(()=>{var fe;if(this.call)return this.call(q,...de);let z=(fe=this.nativeEl)==null?void 0:fe[q];return z==null?void 0:z.apply(this.nativeEl,de)})()};else{let de={get(){var z,fe;P(this,f,hr).call(this);let re=q.toLowerCase();if(I.has(re)){let Ot=this.getAttribute(re);return Ot===null?!1:Ot===""?!0:Ot}return((z=this.get)==null?void 0:z.call(this,q))??((fe=this.nativeEl)==null?void 0:fe[q])}};q!==q.toUpperCase()&&(de.set=function(re){P(this,f,hr).call(this);let z=q.toLowerCase();if(I.has(z)){re===!0||re===!1||re==null?this.toggleAttribute(z,!!re):this.setAttribute(z,re);return}if(this.set){this.set(q,re);return}this.nativeEl&&(this.nativeEl[q]=re)}),Object.defineProperty(this.prototype,q,de)}},g=new WeakMap,E=new WeakMap,m=new WeakMap,T=new WeakMap,f=new WeakSet,hr=function(){u(this,g)||(v(this,g,!0),this.init())},du=function(){var re;let I=new Map(u(this,m)),q=(re=this.shadowRoot)==null?void 0:re.querySelector("slot:not([name])");(q==null?void 0:q.assignedElements({flatten:!0}).filter(z=>["track","source"].includes(z.localName))).forEach(z=>{var Ot,Wo;I.delete(z);let fe=u(this,m).get(z);fe||(fe=z.cloneNode(),u(this,m).set(z,fe),(Ot=u(this,T))==null||Ot.observe(z,{attributes:!0})),(Wo=this.nativeEl)==null||Wo.append(fe),P(this,f,cu).call(this,fe)}),I.forEach((z,fe)=>{z.remove(),u(this,m).delete(fe)})},Um=function(I){for(let q of I)if(q.type==="attributes"){let{target:de,attributeName:re}=q,z=u(this,m).get(de);z&&re&&(z.setAttribute(re,de.getAttribute(re)??""),P(this,f,cu).call(this,z))}},cu=function(I){I&&I.localName==="track"&&I.default&&(I.kind==="chapters"||I.kind==="metadata")&&I.track.mode==="disabled"&&(I.track.mode="hidden")},Hm=function(I){if(Object.prototype.hasOwnProperty.call(this,I)){let q=this[I];delete this[I],this[I]=q}},$m=function(I,q,de){var re,z,fe;["id","class"].includes(I)||!l.observedAttributes.includes(I)&&this.constructor.observedAttributes.includes(I)||(de===null?(re=this.nativeEl)==null||re.removeAttribute(I):((z=this.nativeEl)==null?void 0:z.getAttribute(I))!==de&&((fe=this.nativeEl)==null||fe.setAttribute(I,de)))},L(l,h),$(l,"getTemplateHTML",e.endsWith("audio")?cb:ub),$(l,"shadowRootOptions",{mode:"open"}),$(l,"Events",db),L(l,d,!1),l}function hb(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 Vm(i){let e="";for(let t in i){if(!Om.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function pb(i){let e={};for(let t of i)e[t.name]=t.value;return e}var $e=Bm(globalThis.HTMLElement??class{},{tag:"video"}),Qw=Bm(globalThis.HTMLElement??class{},{tag:"audio"});var qt=class extends Event{constructor(t,r){super(t);$(this,"track");this.track=r.track}};var uu=new WeakMap;function k(i){return uu.get(i)??mb(i,{})}function mb(i,e){let t=uu.get(i);return t||uu.set(i,t={}),Object.assign(t,e)}function Hl(i,e){let t=i.videoTracks;k(e).media=i,k(e).renditionSet||(k(e).renditionSet=new Set);let r=k(t).trackSet;r.add(e);let o=r.size-1;o in mr.prototype||Object.defineProperty(mr.prototype,o,{get(){return[...k(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new qt("addtrack",{track:e}))})}function $l(i){var r;let e=(r=k(i).media)==null?void 0:r.videoTracks;if(!e)return;k(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new qt("removetrack",{track:i}))})}function Wm(i){let e=k(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(k(e).changeRequested)return;k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var mi,vi,fi,pr,bs,mr=class extends EventTarget{constructor(){super();L(this,pr);L(this,mi);L(this,vi);L(this,fi);k(this).trackSet=new Set}[Symbol.iterator](){return u(this,pr,bs).values()}get length(){return u(this,pr,bs).size}getTrackById(t){return[...u(this,pr,bs)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,pr,bs)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,mi)}set onaddtrack(t){u(this,mi)&&(this.removeEventListener("addtrack",u(this,mi)),v(this,mi,void 0)),typeof t=="function"&&(v(this,mi,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,vi)}set onremovetrack(t){u(this,vi)&&(this.removeEventListener("removetrack",u(this,vi)),v(this,vi,void 0)),typeof t=="function"&&(v(this,vi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,fi)}set onchange(t){u(this,fi)&&(this.removeEventListener("change",u(this,fi)),v(this,fi,void 0)),typeof t=="function"&&(v(this,fi,t),this.addEventListener("change",t))}};mi=new WeakMap,vi=new WeakMap,fi=new WeakMap,pr=new WeakSet,bs=function(){return k(this).trackSet};var Kt=class extends Event{constructor(t,r){super(t);$(this,"rendition");this.rendition=r.rendition}};function Fm(i,e){let t=k(i).media.videoRenditions;k(e).media=k(i).media,k(e).track=i;let r=k(i).renditionSet;r.add(e);let o=r.size-1;o in vr.prototype||Object.defineProperty(vr.prototype,o,{get(){return Lo(this)[o]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new Kt("addrendition",{rendition:e}))})}function qm(i){let e=k(i).media.videoRenditions,t=k(i).track;k(t).renditionSet.delete(i),queueMicrotask(()=>{k(i).track.selected&&e.dispatchEvent(new Kt("removerendition",{rendition:i}))})}function Km(i){let e=k(i).media.videoRenditions;!e||k(e).changeRequested||(k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,k(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Lo(i){return[...k(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...k(t).renditionSet])}var Ei,gi,bi,vr=class extends EventTarget{constructor(){super(...arguments);L(this,Ei);L(this,gi);L(this,bi)}[Symbol.iterator](){return Lo(this).values()}get length(){return Lo(this).length}getRenditionById(t){return Lo(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Lo(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of Lo(this).entries())o.selected=r===t}get onaddrendition(){return u(this,Ei)}set onaddrendition(t){u(this,Ei)&&(this.removeEventListener("addrendition",u(this,Ei)),v(this,Ei,void 0)),typeof t=="function"&&(v(this,Ei,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,gi)}set onremoverendition(t){u(this,gi)&&(this.removeEventListener("removerendition",u(this,gi)),v(this,gi,void 0)),typeof t=="function"&&(v(this,gi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,bi)}set onchange(t){u(this,bi)&&(this.removeEventListener("change",u(this,bi)),v(this,bi,void 0)),typeof t=="function"&&(v(this,bi,t),this.addEventListener("change",t))}};Ei=new WeakMap,gi=new WeakMap,bi=new WeakMap;var Io,_s=class{constructor(){$(this,"src");$(this,"id");$(this,"width");$(this,"height");$(this,"bitrate");$(this,"frameRate");$(this,"codec");L(this,Io,!1)}get selected(){return u(this,Io)}set selected(e){u(this,Io)!==e&&(v(this,Io,e),Km(this))}};Io=new WeakMap;var wo,Co=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");L(this,wo,!1)}addRendition(e,t,r,o,n,s){let l=new _s;return l.src=e,l.width=t,l.height=r,l.frameRate=s,l.bitrate=n,l.codec=o,Fm(this,l),l}removeRendition(e){qm(e)}get selected(){return u(this,wo)}set selected(e){u(this,wo)!==e&&(v(this,wo,e),e===!0&&Wm(this))}};wo=new WeakMap;function Gm(i,e){let t=k(i).media.audioRenditions;k(e).media=k(i).media,k(e).track=i;let r=k(i).renditionSet;r.add(e);let o=r.size-1;o in fr.prototype||Object.defineProperty(fr.prototype,o,{get(){return Ro(this)[o]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new Kt("addrendition",{rendition:e}))})}function zm(i){let e=k(i).media.audioRenditions,t=k(i).track;k(t).renditionSet.delete(i),queueMicrotask(()=>{k(i).track.enabled&&e.dispatchEvent(new Kt("removerendition",{rendition:i}))})}function Ym(i){let e=k(i).media.audioRenditions;!e||k(e).changeRequested||(k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,k(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Ro(i){return[...k(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...k(t).renditionSet])}var _i,yi,Ti,fr=class extends EventTarget{constructor(){super(...arguments);L(this,_i);L(this,yi);L(this,Ti)}[Symbol.iterator](){return Ro(this).values()}get length(){return Ro(this).length}getRenditionById(t){return Ro(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return Ro(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,o]of Ro(this).entries())o.selected=r===t}get onaddrendition(){return u(this,_i)}set onaddrendition(t){u(this,_i)&&(this.removeEventListener("addrendition",u(this,_i)),v(this,_i,void 0)),typeof t=="function"&&(v(this,_i,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,yi)}set onremoverendition(t){u(this,yi)&&(this.removeEventListener("removerendition",u(this,yi)),v(this,yi,void 0)),typeof t=="function"&&(v(this,yi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,Ti)}set onchange(t){u(this,Ti)&&(this.removeEventListener("change",u(this,Ti)),v(this,Ti,void 0)),typeof t=="function"&&(v(this,Ti,t),this.addEventListener("change",t))}};_i=new WeakMap,yi=new WeakMap,Ti=new WeakMap;var Mo,ys=class{constructor(){$(this,"src");$(this,"id");$(this,"bitrate");$(this,"codec");L(this,Mo,!1)}get selected(){return u(this,Mo)}set selected(e){u(this,Mo)!==e&&(v(this,Mo,e),Ym(this))}};Mo=new WeakMap;function Vl(i,e){let t=i.audioTracks;k(e).media=i,k(e).renditionSet||(k(e).renditionSet=new Set);let r=k(t).trackSet;r.add(e);let o=r.size-1;o in Er.prototype||Object.defineProperty(Er.prototype,o,{get(){return[...k(this).trackSet][o]}}),queueMicrotask(()=>{t.dispatchEvent(new qt("addtrack",{track:e}))})}function Wl(i){var r;let e=(r=k(i).media)==null?void 0:r.audioTracks;if(!e)return;k(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new qt("removetrack",{track:i}))})}function Qm(i){let e=k(i).media.audioTracks;!e||k(e).changeRequested||(k(e).changeRequested=!0,queueMicrotask(()=>{delete k(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Ai,Si,ki,xo,Bl,Er=class extends EventTarget{constructor(){super();L(this,xo);L(this,Ai);L(this,Si);L(this,ki);k(this).trackSet=new Set}[Symbol.iterator](){return u(this,xo,Bl).values()}get length(){return u(this,xo,Bl).size}getTrackById(t){return[...u(this,xo,Bl)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,Ai)}set onaddtrack(t){u(this,Ai)&&(this.removeEventListener("addtrack",u(this,Ai)),v(this,Ai,void 0)),typeof t=="function"&&(v(this,Ai,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,Si)}set onremovetrack(t){u(this,Si)&&(this.removeEventListener("removetrack",u(this,Si)),v(this,Si,void 0)),typeof t=="function"&&(v(this,Si,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,ki)}set onchange(t){u(this,ki)&&(this.removeEventListener("change",u(this,ki)),v(this,ki,void 0)),typeof t=="function"&&(v(this,ki,t),this.addEventListener("change",t))}};Ai=new WeakMap,Si=new WeakMap,ki=new WeakMap,xo=new WeakSet,Bl=function(){return k(this).trackSet};var Po,Do=class{constructor(){$(this,"id");$(this,"kind");$(this,"label","");$(this,"language","");$(this,"sourceBuffer");L(this,Po,!1)}addRendition(e,t,r){let o=new ys;return o.src=e,o.codec=t,o.bitrate=r,Gm(this,o),o}removeRendition(e){zm(e)}get enabled(){return u(this,Po)}set enabled(e){u(this,Po)!==e&&(v(this,Po,e),Qm(this))}};Po=new WeakMap;var Zm=Fl(globalThis.HTMLMediaElement,"video"),Xm=Fl(globalThis.HTMLMediaElement,"audio");function Oo(i){if(!(i!=null&&i.prototype))return i;let e=Fl(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return vb(this)}});let t=Fl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return fb(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,s="",l=""){let d=new Co;return d.kind=n,d.label=s,d.language=l,Hl(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=$l),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,s="",l=""){let d=new Do;return d.kind=n,d.label=s,d.language=l,Vl(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Wl),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let s=k(n).videoRenditions;return s||(s=new vr,k(s).media=n,k(n).videoRenditions=s),s};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return o(this)}});let o=n=>{let s=k(n).audioRenditions;return s||(s=new fr,k(s).media=n,k(n).audioRenditions=s),s};return i}function Fl(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function vb(i){let e=k(i).videoTracks;if(!e&&(e=new mr,k(i).videoTracks=e,Zm)){let t=Zm.call(i.nativeEl??i);for(let r of t)Hl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof Co)){for(let o of t)$l(o);return}Hl(i,r.track)}),t.addEventListener("removetrack",r=>{$l(r.track)})}return e}function fb(i){let e=k(i).audioTracks;if(!e&&(e=new Er,k(i).audioTracks=e,Xm)){let t=Xm.call(i.nativeEl??i);for(let r of t)Vl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(o=>o instanceof Do)){for(let o of t)Wl(o);return}Vl(i,r.track)}),t.addEventListener("removetrack",r=>{Wl(r.track)})}return e}var Re=Tv(Bu("hls.js"),1);var Eb=Oo($e),Gt,zt,Yt,No,Je,hu,Jm,pu,Ts,jm,Li=class extends Eb{constructor(){super();L(this,Je);L(this,Gt,null);L(this,zt,null);L(this,Yt,null);L(this,No,!1);this.api=null;L(this,Ts,()=>{var r,o;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(o=this.api)==null||o.startLoad()});P(this,Je,jm).call(this,"config")}static getTemplateHTML(t,r={}){let{src:o,...n}=t;return`
|
|
2902
|
+
`}function Bm(i,{tag:e,is:t}){var o,s,l,d,h,Nm,v,f,m,_,g,vr,cu,Um,uu,Hm,$m;let r=(s=(o=globalThis.document)==null?void 0:o.createElement)==null?void 0:s.call(o,e,{is:t}),n=r?hb(r):[];return l=class extends i{constructor(){super(...arguments);L(this,g);L(this,v,!1);L(this,f,null);L(this,m,new Map);L(this,_);V(this,"get");V(this,"set");V(this,"call")}static get observedAttributes(){var F,G;return D(F=l,h,Nm).call(F),[...((G=r==null?void 0:r.constructor)==null?void 0:G.observedAttributes)??[],...Om]}get nativeEl(){var w;return D(this,g,vr).call(this),u(this,f)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??((w=this.shadowRoot)==null?void 0:w.querySelector(e))??null}set nativeEl(w){E(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=pb(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)D(this,g,Hm).call(this,w);E(this,_,new MutationObserver(D(this,g,Um).bind(this))),this.shadowRoot.addEventListener("slotchange",()=>D(this,g,cu).call(this)),D(this,g,cu).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,G){D(this,g,vr).call(this),D(this,g,$m).call(this,w,F,G)}connectedCallback(){D(this,g,vr).call(this)}},d=new WeakMap,h=new WeakSet,Nm=function(){if(u(this,d))return;E(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(...G){return D(this,g,vr).call(this),(()=>{var Ee;if(this.call)return this.call(F,...G);let X=(Ee=this.nativeEl)==null?void 0:Ee[F];return X==null?void 0:X.apply(this.nativeEl,G)})()};else{let G={get(){var X,Ee;D(this,g,vr).call(this);let le=F.toLowerCase();if(w.has(le)){let Ut=this.getAttribute(le);return Ut===null?!1:Ut===""?!0:Ut}return((X=this.get)==null?void 0:X.call(this,F))??((Ee=this.nativeEl)==null?void 0:Ee[F])}};F!==F.toUpperCase()&&(G.set=function(le){D(this,g,vr).call(this);let X=F.toLowerCase();if(w.has(X)){le===!0||le===!1||le==null?this.toggleAttribute(X,!!le):this.setAttribute(X,le);return}if(this.set){this.set(F,le);return}this.nativeEl&&(this.nativeEl[F]=le)}),Object.defineProperty(this.prototype,F,G)}},v=new WeakMap,f=new WeakMap,m=new WeakMap,_=new WeakMap,g=new WeakSet,vr=function(){u(this,v)||(E(this,v,!0),this.init())},cu=function(){var le;let w=new Map(u(this,m)),F=(le=this.shadowRoot)==null?void 0:le.querySelector("slot:not([name])");(F==null?void 0:F.assignedElements({flatten:!0}).filter(X=>["track","source"].includes(X.localName))).forEach(X=>{var Ut,qn;w.delete(X);let Ee=u(this,m).get(X);Ee||(Ee=X.cloneNode(),u(this,m).set(X,Ee),(Ut=u(this,_))==null||Ut.observe(X,{attributes:!0})),(qn=this.nativeEl)==null||qn.append(Ee),D(this,g,uu).call(this,Ee)}),w.forEach((X,Ee)=>{X.remove(),u(this,m).delete(Ee)})},Um=function(w){for(let F of w)if(F.type==="attributes"){let{target:G,attributeName:le}=F,X=u(this,m).get(G);X&&le&&(X.setAttribute(le,G.getAttribute(le)??""),D(this,g,uu).call(this,X))}},uu=function(w){w&&w.localName==="track"&&w.default&&(w.kind==="chapters"||w.kind==="metadata")&&w.track.mode==="disabled"&&(w.track.mode="hidden")},Hm=function(w){if(Object.prototype.hasOwnProperty.call(this,w)){let F=this[w];delete this[w],this[w]=F}},$m=function(w,F,G){var le,X,Ee;["id","class"].includes(w)||!l.observedAttributes.includes(w)&&this.constructor.observedAttributes.includes(w)||(G===null?(le=this.nativeEl)==null||le.removeAttribute(w):((X=this.nativeEl)==null?void 0:X.getAttribute(w))!==G&&((Ee=this.nativeEl)==null||Ee.setAttribute(w,G)))},L(l,h),V(l,"getTemplateHTML",e.endsWith("audio")?cb:ub),V(l,"shadowRootOptions",{mode:"open"}),V(l,"Events",db),L(l,d,!1),l}function hb(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 Vm(i){let e="";for(let t in i){if(!Om.includes(t))continue;let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function pb(i){let e={};for(let t of i)e[t.name]=t.value;return e}var $e=Bm(globalThis.HTMLElement??class{},{tag:"video"}),Qw=Bm(globalThis.HTMLElement??class{},{tag:"audio"});var Gt=class extends Event{constructor(t,r){super(t);V(this,"track");this.track=r.track}};var hu=new WeakMap;function A(i){return hu.get(i)??mb(i,{})}function mb(i,e){let t=hu.get(i);return t||hu.set(i,t={}),Object.assign(t,e)}function Bl(i,e){let t=i.videoTracks;A(e).media=i,A(e).renditionSet||(A(e).renditionSet=new Set);let r=A(t).trackSet;r.add(e);let n=r.size-1;n in Er.prototype||Object.defineProperty(Er.prototype,n,{get(){return[...A(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Gt("addtrack",{track:e}))})}function Vl(i){var r;let e=(r=A(i).media)==null?void 0:r.videoTracks;if(!e)return;A(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Gt("removetrack",{track:i}))})}function Wm(i){let e=A(i).media.videoTracks??[],t=!1;for(let r of e)r!==i&&(r.selected=!1,t=!0);if(t){if(A(e).changeRequested)return;A(e).changeRequested=!0,queueMicrotask(()=>{delete A(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var Ei,gi,bi,fr,ys,Er=class extends EventTarget{constructor(){super();L(this,fr);L(this,Ei);L(this,gi);L(this,bi);A(this).trackSet=new Set}[Symbol.iterator](){return u(this,fr,ys).values()}get length(){return u(this,fr,ys).size}getTrackById(t){return[...u(this,fr,ys)].find(r=>r.id===t)??null}get selectedIndex(){return[...u(this,fr,ys)].findIndex(t=>t.selected)}get onaddtrack(){return u(this,Ei)}set onaddtrack(t){u(this,Ei)&&(this.removeEventListener("addtrack",u(this,Ei)),E(this,Ei,void 0)),typeof t=="function"&&(E(this,Ei,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,gi)}set onremovetrack(t){u(this,gi)&&(this.removeEventListener("removetrack",u(this,gi)),E(this,gi,void 0)),typeof t=="function"&&(E(this,gi,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,bi)}set onchange(t){u(this,bi)&&(this.removeEventListener("change",u(this,bi)),E(this,bi,void 0)),typeof t=="function"&&(E(this,bi,t),this.addEventListener("change",t))}};Ei=new WeakMap,gi=new WeakMap,bi=new WeakMap,fr=new WeakSet,ys=function(){return A(this).trackSet};var zt=class extends Event{constructor(t,r){super(t);V(this,"rendition");this.rendition=r.rendition}};function Fm(i,e){let t=A(i).media.videoRenditions;A(e).media=A(i).media,A(e).track=i;let r=A(i).renditionSet;r.add(e);let n=r.size-1;n in gr.prototype||Object.defineProperty(gr.prototype,n,{get(){return wn(this)[n]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new zt("addrendition",{rendition:e}))})}function qm(i){let e=A(i).media.videoRenditions,t=A(i).track;A(t).renditionSet.delete(i),queueMicrotask(()=>{A(i).track.selected&&e.dispatchEvent(new zt("removerendition",{rendition:i}))})}function Km(i){let e=A(i).media.videoRenditions;!e||A(e).changeRequested||(A(e).changeRequested=!0,queueMicrotask(()=>{delete A(e).changeRequested,A(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function wn(i){return[...A(i).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...A(t).renditionSet])}var _i,yi,Ti,gr=class extends EventTarget{constructor(){super(...arguments);L(this,_i);L(this,yi);L(this,Ti)}[Symbol.iterator](){return wn(this).values()}get length(){return wn(this).length}getRenditionById(t){return wn(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return wn(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of wn(this).entries())n.selected=r===t}get onaddrendition(){return u(this,_i)}set onaddrendition(t){u(this,_i)&&(this.removeEventListener("addrendition",u(this,_i)),E(this,_i,void 0)),typeof t=="function"&&(E(this,_i,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,yi)}set onremoverendition(t){u(this,yi)&&(this.removeEventListener("removerendition",u(this,yi)),E(this,yi,void 0)),typeof t=="function"&&(E(this,yi,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,Ti)}set onchange(t){u(this,Ti)&&(this.removeEventListener("change",u(this,Ti)),E(this,Ti,void 0)),typeof t=="function"&&(E(this,Ti,t),this.addEventListener("change",t))}};_i=new WeakMap,yi=new WeakMap,Ti=new WeakMap;var Cn,Ts=class{constructor(){V(this,"src");V(this,"id");V(this,"width");V(this,"height");V(this,"bitrate");V(this,"frameRate");V(this,"codec");L(this,Cn,!1)}get selected(){return u(this,Cn)}set selected(e){u(this,Cn)!==e&&(E(this,Cn,e),Km(this))}};Cn=new WeakMap;var Rn,Mn=class{constructor(){V(this,"id");V(this,"kind");V(this,"label","");V(this,"language","");V(this,"sourceBuffer");L(this,Rn,!1)}addRendition(e,t,r,n,o,s){let l=new Ts;return l.src=e,l.width=t,l.height=r,l.frameRate=s,l.bitrate=o,l.codec=n,Fm(this,l),l}removeRendition(e){qm(e)}get selected(){return u(this,Rn)}set selected(e){u(this,Rn)!==e&&(E(this,Rn,e),e===!0&&Wm(this))}};Rn=new WeakMap;function Gm(i,e){let t=A(i).media.audioRenditions;A(e).media=A(i).media,A(e).track=i;let r=A(i).renditionSet;r.add(e);let n=r.size-1;n in br.prototype||Object.defineProperty(br.prototype,n,{get(){return xn(this)[n]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new zt("addrendition",{rendition:e}))})}function zm(i){let e=A(i).media.audioRenditions,t=A(i).track;A(t).renditionSet.delete(i),queueMicrotask(()=>{A(i).track.enabled&&e.dispatchEvent(new zt("removerendition",{rendition:i}))})}function Ym(i){let e=A(i).media.audioRenditions;!e||A(e).changeRequested||(A(e).changeRequested=!0,queueMicrotask(()=>{delete A(e).changeRequested,A(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function xn(i){return[...A(i).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...A(t).renditionSet])}var Ai,Si,ki,br=class extends EventTarget{constructor(){super(...arguments);L(this,Ai);L(this,Si);L(this,ki)}[Symbol.iterator](){return xn(this).values()}get length(){return xn(this).length}getRenditionById(t){return xn(this).find(r=>`${r.id}`==`${t}`)??null}get selectedIndex(){return xn(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[r,n]of xn(this).entries())n.selected=r===t}get onaddrendition(){return u(this,Ai)}set onaddrendition(t){u(this,Ai)&&(this.removeEventListener("addrendition",u(this,Ai)),E(this,Ai,void 0)),typeof t=="function"&&(E(this,Ai,t),this.addEventListener("addrendition",t))}get onremoverendition(){return u(this,Si)}set onremoverendition(t){u(this,Si)&&(this.removeEventListener("removerendition",u(this,Si)),E(this,Si,void 0)),typeof t=="function"&&(E(this,Si,t),this.addEventListener("removerendition",t))}get onchange(){return u(this,ki)}set onchange(t){u(this,ki)&&(this.removeEventListener("change",u(this,ki)),E(this,ki,void 0)),typeof t=="function"&&(E(this,ki,t),this.addEventListener("change",t))}};Ai=new WeakMap,Si=new WeakMap,ki=new WeakMap;var Pn,As=class{constructor(){V(this,"src");V(this,"id");V(this,"bitrate");V(this,"codec");L(this,Pn,!1)}get selected(){return u(this,Pn)}set selected(e){u(this,Pn)!==e&&(E(this,Pn,e),Ym(this))}};Pn=new WeakMap;function Fl(i,e){let t=i.audioTracks;A(e).media=i,A(e).renditionSet||(A(e).renditionSet=new Set);let r=A(t).trackSet;r.add(e);let n=r.size-1;n in _r.prototype||Object.defineProperty(_r.prototype,n,{get(){return[...A(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new Gt("addtrack",{track:e}))})}function ql(i){var r;let e=(r=A(i).media)==null?void 0:r.audioTracks;if(!e)return;A(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Gt("removetrack",{track:i}))})}function Qm(i){let e=A(i).media.audioTracks;!e||A(e).changeRequested||(A(e).changeRequested=!0,queueMicrotask(()=>{delete A(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Li,Ii,wi,Dn,Wl,_r=class extends EventTarget{constructor(){super();L(this,Dn);L(this,Li);L(this,Ii);L(this,wi);A(this).trackSet=new Set}[Symbol.iterator](){return u(this,Dn,Wl).values()}get length(){return u(this,Dn,Wl).size}getTrackById(t){return[...u(this,Dn,Wl)].find(r=>r.id===t)??null}get onaddtrack(){return u(this,Li)}set onaddtrack(t){u(this,Li)&&(this.removeEventListener("addtrack",u(this,Li)),E(this,Li,void 0)),typeof t=="function"&&(E(this,Li,t),this.addEventListener("addtrack",t))}get onremovetrack(){return u(this,Ii)}set onremovetrack(t){u(this,Ii)&&(this.removeEventListener("removetrack",u(this,Ii)),E(this,Ii,void 0)),typeof t=="function"&&(E(this,Ii,t),this.addEventListener("removetrack",t))}get onchange(){return u(this,wi)}set onchange(t){u(this,wi)&&(this.removeEventListener("change",u(this,wi)),E(this,wi,void 0)),typeof t=="function"&&(E(this,wi,t),this.addEventListener("change",t))}};Li=new WeakMap,Ii=new WeakMap,wi=new WeakMap,Dn=new WeakSet,Wl=function(){return A(this).trackSet};var On,Nn=class{constructor(){V(this,"id");V(this,"kind");V(this,"label","");V(this,"language","");V(this,"sourceBuffer");L(this,On,!1)}addRendition(e,t,r){let n=new As;return n.src=e,n.codec=t,n.bitrate=r,Gm(this,n),n}removeRendition(e){zm(e)}get enabled(){return u(this,On)}set enabled(e){u(this,On)!==e&&(E(this,On,e),Qm(this))}};On=new WeakMap;var Zm=Kl(globalThis.HTMLMediaElement,"video"),Xm=Kl(globalThis.HTMLMediaElement,"audio");function Un(i){if(!(i!=null&&i.prototype))return i;let e=Kl(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return vb(this)}});let t=Kl(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return fb(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(o,s="",l=""){let d=new Mn;return d.kind=o,d.label=s,d.language=l,Bl(this,d),d}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=Vl),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(o,s="",l=""){let d=new Nn;return d.kind=o,d.label=s,d.language=l,Fl(this,d),d}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=ql),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=o=>{let s=A(o).videoRenditions;return s||(s=new gr,A(s).media=o,A(o).videoRenditions=s),s};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return n(this)}});let n=o=>{let s=A(o).audioRenditions;return s||(s=new br,A(s).media=o,A(o).audioRenditions=s),s};return i}function Kl(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function vb(i){let e=A(i).videoTracks;if(!e&&(e=new Er,A(i).videoTracks=e,Zm)){let t=Zm.call(i.nativeEl??i);for(let r of t)Bl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof Mn)){for(let n of t)Vl(n);return}Bl(i,r.track)}),t.addEventListener("removetrack",r=>{Vl(r.track)})}return e}function fb(i){let e=A(i).audioTracks;if(!e&&(e=new _r,A(i).audioTracks=e,Xm)){let t=Xm.call(i.nativeEl??i);for(let r of t)Fl(i,r);t.addEventListener("change",()=>{e.dispatchEvent(new Event("change"))}),t.addEventListener("addtrack",r=>{if([...e].some(n=>n instanceof Nn)){for(let n of t)ql(n);return}Fl(i,r.track)}),t.addEventListener("removetrack",r=>{ql(r.track)})}return e}var Me=Tv(Bu("hls.js"),1);var Eb=Un($e),Yt,Qt,Zt,Hn,Je,pu,jm,mu,Ss,Jm,Ci=class extends Eb{constructor(){super();L(this,Je);L(this,Yt,null);L(this,Qt,null);L(this,Zt,null);L(this,Hn,!1);this.api=null;L(this,Ss,()=>{var r,n;let t=this.nativeEl;t!=null&&t.webkitCurrentPlaybackTargetIsWireless?(r=this.api)==null||r.stopLoad():(n=this.api)==null||n.startLoad()});D(this,Je,Jm).call(this,"config")}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
|
-
${$e.getTemplateHTML(
|
|
2907
|
-
`}get config(){return u(this,
|
|
2906
|
+
${$e.getTemplateHTML(o)}
|
|
2907
|
+
`}get config(){return u(this,Zt)}set config(t){E(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;D(this,Je,pu).call(this),(t=super.disconnectedCallback)==null||t.call(this)}async load(){var n,o,s,l;let t=!this.api&&!u(this,Hn);if(D(this,Je,pu).call(this),!this.src)return;if(t&&!u(this,Zt))try{E(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),E(this,Zt,{})}if(!D(this,Je,jm).call(this,this.src)){await Promise.resolve(),E(this,Hn,!0),this.nativeEl.src=this.src;return}if(Me.default.isSupported()){switch(await Promise.resolve(),this.api=new Me.default({liveDurationInfinity:!0,autoStartLoad:!1,...u(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(Me.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(Me.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",u(this,Ss)),E(this,Yt,document.createElement("source")),u(this,Yt).setAttribute("type","application/x-mpegURL"),u(this,Yt).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(u(this,Yt));let h=new WeakMap;this.api.on(Me.default.Events.MANIFEST_PARSED,(m,_)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(I=>{console.warn("Autoplay failed:",I)}),D(this,Je,mu).call(this);let g=this.videoTracks.getTrackById("main");g||(g=this.addVideoTrack("main"),g.id="main",g.selected=!0);for(let[I,S]of _.levels.entries()){let ae=g.addRendition(S.url[0],S.width,S.height,S.videoCodec??void 0,S.bitrate);h.set(S,`${I}`),ae.id=`${I}`}for(let[I,S]of _.audioTracks.entries()){let ae=S.default?"main":"alternative",Ie=this.addAudioTrack(ae,S.name,S.lang);Ie.id=`${I}`,S.default&&(Ie.enabled=!0)}}),(s=u(this,Qt))==null||s.call(this);let p=()=>{var I,S;let m=[...this.audioTracks].find(ae=>ae.enabled),_=m?+m.id:void 0,g=((I=this.api)==null?void 0:I.audioTracks.map(ae=>ae.id))??[];_!==void 0&&_!==((S=this.api)==null?void 0:S.audioTrack)&&g.includes(_)&&this.api&&(this.api.audioTrack=_)};this.audioTracks.addEventListener("change",p),E(this,Qt,()=>{this.audioTracks.removeEventListener("change",p)}),this.api.on(Me.default.Events.LEVELS_UPDATED,(m,_)=>{let g=[...this.videoTracks][this.videoTracks.selectedIndex??0];if(!g)return;let I=_.levels.map(S=>h.get(S));for(let S of this.videoRenditions)S.id&&!I.includes(S.id)&&g.removeRendition(S)});let v=null;this.api.on(Me.default.Events.ERROR,(m,_)=>{var g;_.type===Me.default.ErrorTypes.NETWORK_ERROR&&_.details===Me.default.ErrorDetails.FRAG_LOAD_ERROR&&(v=((g=_.frag)==null?void 0:g.level)??null)}),this.api.on(Me.default.Events.LEVEL_SWITCHED,(m,_)=>{let g=_.level;v!==null&&g<v&&(console.warn(`hls.js downgraded quality from level ${v} to ${g} due to fragment load failure.`),this.videoRenditions.selectedIndex=g,v=null)});let f=()=>{let m=this.videoRenditions.selectedIndex;this.api&&m!==this.api.nextLevel&&(this.api.nextLevel=m)};(l=this.videoRenditions)==null||l.addEventListener("change",f),this.api.once(Me.default.Events.DESTROYING,()=>{var m,_;D(this,Je,mu).call(this),(m=this.videoRenditions)==null||m.removeEventListener("change",f),(_=u(this,Qt))==null||_.call(this),E(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,Hn=new WeakMap,Je=new WeakSet,pu=function(){var t,r,n;(t=u(this,Yt))==null||t.remove(),E(this,Yt,null),(r=u(this,Qt))==null||r.call(this),E(this,Qt,null),(n=this.nativeEl)==null||n.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",u(this,Ss)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null),E(this,Hn,!1)},jm=function(t){return t.includes(".m3u8")||t.includes("application/x-mpegURL")},mu=function(){for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},Ss=new WeakMap,Jm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Ci.shadowRootOptions={...$e.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",Ci);var vu=Ci;var gb="nanoplayer.4.min.js",bb="nanoplayer",xe={loading:!1,loaded:!1,error:null,callbacks:[]};function _b(i,e){return new Promise((t,r)=>{if(window.NanoPlayer){xe.loaded=!0,t();return}if(xe.loaded){t();return}if(xe.error){r(xe.error);return}if(xe.callbacks.push(s=>{s?r(s):t()}),xe.loading)return;xe.loading=!0;let n;e?n=e:n=`${i.endsWith("/")?i:`${i}/`}${bb}/${gb}`;let o=document.createElement("script");o.src=n,o.async=!0,o.onload=()=>{xe.loaded=!0,xe.loading=!1,xe.callbacks.forEach(s=>s()),xe.callbacks=[]},o.onerror=()=>{let s=new Error(`Failed to load NanoPlayer script from ${n}`);xe.error=s,xe.loading=!1,xe.callbacks.forEach(l=>l(s)),xe.callbacks=[]},document.head.appendChild(o)})}var yb=Un($e),ct,Ri,me,ut,$n,Se,ks,Mi,xi,yr,Tr,ht,Ar,Bn,Vn,Le,ev,fu,tv,iv,rv,Gl,Pi=class extends yb{constructor(){super();L(this,Le);L(this,ct,null);L(this,Ri,null);L(this,me,null);L(this,ut,null);L(this,$n,"");L(this,Se,null);L(this,ks,!0);L(this,Mi,[]);L(this,xi,[]);L(this,yr,[]);L(this,Tr,null);L(this,ht,null);L(this,Ar,!1);L(this,Bn,!1);L(this,Vn,null);this.api=null;D(this,Le,Gl).call(this,"config"),D(this,Le,Gl).call(this,"streamid"),D(this,Le,Gl).call(this,"sourceConfig"),D(this,Le,ev).call(this)}static get observedAttributes(){return[...$e.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
2911
|
${$e.getTemplateHTML(s)}
|
|
2912
|
-
`}get config(){return u(this,
|
|
2912
|
+
`}get activeVideoElement(){return u(this,Se)}get config(){return u(this,ct)}set config(t){E(this,ct,t)}get sourceConfig(){return u(this,Ri)}set sourceConfig(t){let r=u(this,Ri)!==t;E(this,Ri,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,v;let t=!u(this,me);D(this,Le,fu).call(this);let r=this.streamid,n=!!u(this,Ri);if(!r&&!n)return;if(E(this,Tr,new Promise(f=>{E(this,ht,f)})),t&&!u(this,ct))try{E(this,ct,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),E(this,ct,{})}try{await _b(this.libraryLocation,(d=u(this,ct))==null?void 0:d.scriptUrl)}catch(f){console.error("[nano-video] Failed to load NanoPlayer script:",f),this.dispatchEvent(rt(f)),(h=u(this,ht))==null||h.call(this);return}E(this,$n,`nano-video-${Date.now()}-${Math.random().toString(36).slice(2,9)}`),E(this,ut,document.createElement("div")),u(this,ut).id=u(this,$n),u(this,ut).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(u(this,ut)),E(this,me,new window.NanoPlayer(u(this,$n))),this.api=u(this,me);try{let f=D(this,Le,tv).call(this,r,n?u(this,Ri):void 0),m=await u(this,me).setup(f);E(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}`})))??[]),D(this,Le,rv).call(this)}catch(f){console.error("[nano-video] Failed to setup NanoPlayer:",f),this.dispatchEvent(rt(f)),(v=u(this,ht))==null||v.call(this)}}async play(){if(u(this,Tr)&&await u(this,Tr),u(this,me)){E(this,Ar,!0),u(this,me).play();return}return super.play()}pause(){if(u(this,me)){u(this,me).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,Se))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,me)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,Se))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,Se))==null?void 0:t.volume)??super.volume}set volume(t){u(this,Se)?u(this,Se).volume=t:super.volume=t}get muted(){var t;return((t=u(this,Se))==null?void 0:t.muted)??super.muted}set muted(t){u(this,Se)&&(u(this,Se).muted=t),u(this,me)?t?u(this,me).mute():u(this,me).unmute():super.muted=t}get videoWidth(){var t;return((t=u(this,Se))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,Se))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t,r;D(this,Le,fu).call(this),(t=u(this,Vn))==null||t.call(this),E(this,Vn,null),(r=super.disconnectedCallback)==null||r.call(this)}};ct=new WeakMap,Ri=new WeakMap,me=new WeakMap,ut=new WeakMap,$n=new WeakMap,Se=new WeakMap,ks=new WeakMap,Mi=new WeakMap,xi=new WeakMap,yr=new WeakMap,Tr=new WeakMap,ht=new WeakMap,Ar=new WeakMap,Bn=new WeakMap,Vn=new WeakMap,Le=new WeakSet,ev=function(){let t=r=>{var n;r.target!==this&&((n=u(this,ut))!=null&&n.contains(r.target))&&u(this,Ar)&&r.stopImmediatePropagation()};this.addEventListener("pause",t,!0),E(this,Vn,()=>this.removeEventListener("pause",t,!0))},fu=function(){var t;(t=u(this,ht))==null||t.call(this),E(this,Tr,null),E(this,ht,null),u(this,Mi).forEach(r=>r()),E(this,Mi,[]),u(this,xi).forEach(r=>r()),E(this,xi,[]);for(let r of this.videoTracks)this.removeVideoTrack(r);for(let r of this.audioTracks)this.removeAudioTrack(r);u(this,me)&&(u(this,me).destroy(),E(this,me,null),this.api=null),u(this,ut)&&(u(this,ut).remove(),E(this,ut,null)),u(this,Se)&&(E(this,Se,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),E(this,Bn,!1),E(this,yr,[])},tv=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=u(this,ct))==null?void 0:o.reconnect)??{minDelay:2,maxDelay:10,delaySteps:10,maxRetries:10},buffer:((s=u(this,ct))==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(Z(Ed)),this.dispatchEvent(Z(mo)),this.dispatchEvent(Z(Us)),(l=u(this,ht))==null||l.call(this)},onPlay:()=>{E(this,Ar,!1),E(this,Bn,!0),this.dispatchEvent(Z(uo)),this.dispatchEvent(Z(ii))},onPause:()=>{this.dispatchEvent(Z(qi))},onLoading:()=>{this.dispatchEvent(Z(Pr))},onStartBuffering:()=>{this.dispatchEvent(Z(Pr))},onStopBuffering:()=>{this.dispatchEvent(Z(Us)),this.dispatchEvent(Z(ii))},onError:l=>{var p,v;E(this,Ar,!1);let d=l.data.code??-1,h=l.data.message??"NanoPlayer error";if(d===2004&&u(this,Bn)){this.dispatchEvent(Z(ho)),(p=u(this,ht))==null||p.call(this);return}this.dispatchEvent(rt(new Error(h),d)),(v=u(this,ht))==null||v.call(this)},onActiveVideoElementChange:l=>{var h;let d=(h=l.data)==null?void 0:h.activeVideoElement;d&&d!==u(this,Se)&&(E(this,Se,d),D(this,Le,iv).call(this,d),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:d}})))}}}},iv=function(t){u(this,Mi).forEach(n=>n()),E(this,Mi,[]);let r=[po,vo,md,ri];for(let n of r){let o=()=>{this.dispatchEvent(Z(n))};t.addEventListener(n,o),u(this,Mi).push(()=>t.removeEventListener(n,o))}},rv=function(){u(this,xi).forEach(n=>n()),E(this,xi,[]);for(let n of this.videoTracks)this.removeVideoTrack(n);for(let n of this.audioTracks)this.removeAudioTrack(n);if(u(this,yr).length===0)return;let t=this.addVideoTrack("main");t.id="main",t.selected=!0;for(let n of u(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?(E(this,ks,!0),(o=u(this,me))==null||o.setAdaption({rule:"deviationOfMean2"})):(E(this,ks,!1),(s=u(this,me))==null||s.switchStream(n).catch(d=>{console.warn("[nano-video] Quality switch failed:",d)}),(l=u(this,me))==null||l.setAdaption({rule:"none"}))};this.videoRenditions.addEventListener("change",r),u(this,xi).push(()=>{this.videoRenditions.removeEventListener("change",r)})},Gl=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Pi.shadowRootOptions={...$e.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("nano-video")&&globalThis.customElements.define("nano-video",Pi);var Eu=Pi;var K=Bu("livekit-client");var Tb=Un($e),Ge,B,se,et,Wn,Fn,Ot,Sr,Di,ue,zl,nv,ov,Yl,sv,av,Ql,Oi=class extends Tb{constructor(){super();L(this,ue);L(this,Ge,null);L(this,B,null);L(this,se,null);L(this,et,[]);L(this,Wn,[]);L(this,Fn,[]);L(this,Ot,"disconnected");L(this,Sr,null);L(this,Di,null);this.room=null;D(this,ue,Ql).call(this,"config"),D(this,ue,Ql).call(this,"url"),D(this,ue,Ql).call(this,"token")}static get observedAttributes(){return[...$e.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
2916
|
${$e.getTemplateHTML(s)}
|
|
2917
|
-
`}get config(){return u(this,
|
|
2917
|
+
`}get activeVideoElement(){return u(this,se)}get config(){return u(this,Ge)}set config(t){E(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():u(this,B)&&D(this,ue,zl).call(this):t!=="url"&&t!=="token"&&super.attributeChangedCallback(t,r,n)}async load(){var Ie,Xt,Nt;let t=!u(this,B);D(this,ue,zl).call(this);let r=this.url,n=this.token;if(!r||!n)return;if(E(this,Sr,new Promise(k=>{E(this,Di,k)})),t&&!u(this,Ge))try{E(this,Ge,JSON.parse(((Xt=(Ie=this.shadowRoot)==null?void 0:Ie.getElementById("config"))==null?void 0:Xt.textContent)||"{}"))}catch(k){console.error("[livekit-video] Failed to parse config:",k),E(this,Ge,{})}let o=D(this,ue,sv).call(this),s=D(this,ue,av).call(this);E(this,B,new K.Room(o)),this.room=u(this,B);let l=()=>{E(this,Ot,"connected")},d=k=>{let Be=k!=null?K.DisconnectReason[k]??String(k):"undefined";console.log("[livekit-video] Disconnected",{reason:k,reasonName:Be,documentHidden:document.hidden,documentHasFocus:document.hasFocus(),visibilityState:document.visibilityState}),E(this,Ot,"disconnected"),k?this.dispatchEvent(rt(new Error(`LiveKit disconnected: ${Be} (${k})`),4001)):this.dispatchEvent(Z(ho))},h=()=>{console.log("[livekit-video] Reconnecting",{documentHidden:document.hidden,documentHasFocus:document.hasFocus()}),E(this,Ot,"reconnecting"),this.dispatchEvent(Z(Pr))},p=()=>{console.log("[livekit-video] Reconnected"),E(this,Ot,"connected"),this.dispatchEvent(Z(ii))},v=()=>{console.log("[livekit-video] SignalReconnecting")},f=k=>{console.log("[livekit-video] ConnectionStateChanged",k)},m=k=>{console.error("[livekit-video] MediaDevicesError",k)},_=(k,Be,w)=>{console.error("[livekit-video] TrackSubscriptionFailed",{trackSid:k,reason:w})},g=k=>{console.log("[livekit-video] TrackMuted",{sid:k.trackSid,kind:k.kind})},I=k=>{console.log("[livekit-video] TrackUnmuted",{sid:k.trackSid,kind:k.kind})},S=(k,Be)=>{var w,F;if(k.kind===K.Track.Kind.Video){let G=k.attach();G.style.width="100%",G.style.height="100%",G.style.objectFit="contain",G.style.position="absolute",G.style.top="0",G.style.left="0",this.nativeEl.muted&&(G.muted=!0),this.nativeEl.style.display="none",(w=this.shadowRoot)==null||w.appendChild(G),E(this,se,G),D(this,ue,nv).call(this,G),D(this,ue,ov).call(this,Be),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:G}})),this.dispatchEvent(Z(fd)),this.dispatchEvent(Z(ri)),this.dispatchEvent(Z(mo)),this.dispatchEvent(Z(ii)),(F=u(this,Di))==null||F.call(this)}},ae=k=>{k.kind===K.Track.Kind.Video&&(k.detach(),D(this,ue,Yl).call(this),u(this,se)&&(u(this,et).forEach(Be=>Be()),E(this,et,[]),u(this,se).remove(),E(this,se,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))))};u(this,B).on(K.RoomEvent.Connected,l),u(this,B).on(K.RoomEvent.Disconnected,d),u(this,B).on(K.RoomEvent.Reconnecting,h),u(this,B).on(K.RoomEvent.Reconnected,p),u(this,B).on(K.RoomEvent.SignalReconnecting,v),u(this,B).on(K.RoomEvent.ConnectionStateChanged,f),u(this,B).on(K.RoomEvent.MediaDevicesError,m),u(this,B).on(K.RoomEvent.TrackSubscribed,S),u(this,B).on(K.RoomEvent.TrackUnsubscribed,ae),u(this,B).on(K.RoomEvent.TrackSubscriptionFailed,_),u(this,B).on(K.RoomEvent.TrackMuted,g),u(this,B).on(K.RoomEvent.TrackUnmuted,I),E(this,Fn,[()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.Connected,l)},()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.Disconnected,d)},()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.Reconnecting,h)},()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.Reconnected,p)},()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.SignalReconnecting,v)},()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.ConnectionStateChanged,f)},()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.MediaDevicesError,m)},()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.TrackSubscribed,S)},()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.TrackUnsubscribed,ae)},()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.TrackSubscriptionFailed,_)},()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.TrackMuted,g)},()=>{var k;return(k=u(this,B))==null?void 0:k.off(K.RoomEvent.TrackUnmuted,I)}]),E(this,Ot,"connecting"),this.dispatchEvent(Z(vd));try{await u(this,B).connect(r,n,s)}catch(k){E(this,Ot,"failed"),console.error("[livekit-video] Failed to connect:",k);let Be=k instanceof Error?k.message:"Failed to connect to LiveKit room";this.dispatchEvent(rt(new Error(Be),4e3)),(Nt=u(this,Di))==null||Nt.call(this)}}async play(){return u(this,Sr)&&await u(this,Sr),u(this,se)?u(this,se).play():super.play()}pause(){if(u(this,se)){u(this,se).pause();return}super.pause()}get currentTime(){var t;return((t=u(this,se))==null?void 0:t.currentTime)??super.currentTime}set currentTime(t){u(this,B)||(super.currentTime=t)}get duration(){return 1/0}get paused(){var t;return((t=u(this,se))==null?void 0:t.paused)??super.paused}get volume(){var t;return((t=u(this,se))==null?void 0:t.volume)??super.volume}set volume(t){u(this,se)?u(this,se).volume=t:super.volume=t}get muted(){var t;return((t=u(this,se))==null?void 0:t.muted)??super.muted}set muted(t){u(this,se)?u(this,se).muted=t:super.muted=t}get videoWidth(){var t;return((t=u(this,se))==null?void 0:t.videoWidth)??super.videoWidth}get videoHeight(){var t;return((t=u(this,se))==null?void 0:t.videoHeight)??super.videoHeight}disconnectedCallback(){var t;D(this,ue,zl).call(this),(t=super.disconnectedCallback)==null||t.call(this)}};Ge=new WeakMap,B=new WeakMap,se=new WeakMap,et=new WeakMap,Wn=new WeakMap,Fn=new WeakMap,Ot=new WeakMap,Sr=new WeakMap,Di=new WeakMap,ue=new WeakSet,zl=function(){var t;(t=u(this,Di))==null||t.call(this),E(this,Sr,null),E(this,Di,null),u(this,et).forEach(r=>r()),E(this,et,[]),D(this,ue,Yl).call(this),u(this,Fn).forEach(r=>r()),E(this,Fn,[]),u(this,B)&&(u(this,B).disconnect(),E(this,B,null),this.room=null),u(this,se)&&(u(this,se).remove(),E(this,se,null),this.dispatchEvent(new CustomEvent("activevideoelementchange",{detail:{video:null}}))),E(this,Ot,"disconnected")},nv=function(t){u(this,et).forEach(s=>s()),E(this,et,[]);let r=[po,vo,uo,ii,qi,ri];for(let s of r){let l=()=>{this.dispatchEvent(Z(s))};t.addEventListener(s,l),u(this,et).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=u(this,B))==null?void 0:h.state})};t.addEventListener("error",n),u(this,et).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),u(this,et).push(()=>t.removeEventListener("stalled",o))},ov=function(t){var l;D(this,ue,Yl).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),u(this,Wn).push(()=>this.videoRenditions.removeEventListener("change",s))},Yl=function(){u(this,Wn).forEach(t=>t()),E(this,Wn,[]);for(let t of this.videoTracks)this.removeVideoTrack(t);for(let t of this.audioTracks)this.removeAudioTrack(t)},sv=function(){var t,r,n;return{adaptiveStream:((t=u(this,Ge))==null?void 0:t.adaptiveStream)??!1,dynacast:((r=u(this,Ge))==null?void 0:r.dynacast)??!0,disconnectOnPageLeave:((n=u(this,Ge))==null?void 0:n.disconnectOnPageLeave)??!1}},av=function(){var t,r;return{autoSubscribe:!0,peerConnectionTimeout:((t=u(this,Ge))==null?void 0:t.peerConnectionTimeout)??8e3,rtcConfig:{iceTransportPolicy:((r=u(this,Ge))==null?void 0:r.iceTransportPolicy)??"all"}}},Ql=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let r=this[t];delete this[t],this[t]=r}},Oi.shadowRootOptions={...$e.shadowRootOptions};globalThis.customElements&&!globalThis.customElements.get("livekit-video")&&globalThis.customElements.define("livekit-video",Oi);var gu=Oi;return Av(Ab);})();
|
|
2918
2918
|
/*! Bundled license information:
|
|
2919
2919
|
|
|
2920
2920
|
@lit/reactive-element/css-tag.js:
|