@mux/mux-video
Advanced tools
Comparing version 0.22.0-canary.0-27b6858 to 0.22.0-canary.0-2fbb2c1
{ | ||
"inputs": { | ||
"src/polyfills/index.ts": { | ||
"bytes": 2165, | ||
"bytes": 2124, | ||
"imports": [ | ||
@@ -19,4 +19,4 @@ { | ||
}, | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytes": 12486, | ||
"../../node_modules/custom-media-element/dist/custom-media-element.js": { | ||
"bytes": 10071, | ||
"imports": [ | ||
@@ -389,3 +389,3 @@ { | ||
{ | ||
"path": "../../node_modules/custom-media-element/custom-media-element.js", | ||
"path": "../../node_modules/custom-media-element/dist/custom-media-element.js", | ||
"kind": "import-statement", | ||
@@ -418,3 +418,3 @@ "original": "custom-media-element" | ||
"inputs": {}, | ||
"bytes": 145970 | ||
"bytes": 144622 | ||
}, | ||
@@ -441,4 +441,4 @@ "dist/index.cjs.js": { | ||
}, | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytesInOutput": 5904 | ||
"../../node_modules/custom-media-element/dist/custom-media-element.js": { | ||
"bytesInOutput": 6535 | ||
}, | ||
@@ -449,6 +449,6 @@ "../../node_modules/castable-video/castable-utils.js": { | ||
"../../node_modules/castable-video/castable-remote-playback.js": { | ||
"bytesInOutput": 6210 | ||
"bytesInOutput": 6211 | ||
}, | ||
"../../node_modules/castable-video/castable-mixin.js": { | ||
"bytesInOutput": 4685 | ||
"bytesInOutput": 4682 | ||
}, | ||
@@ -495,5 +495,5 @@ "../../node_modules/media-tracks/dist/track-event.js": { | ||
}, | ||
"bytes": 43649 | ||
"bytes": 44278 | ||
} | ||
} | ||
} |
{ | ||
"inputs": { | ||
"src/polyfills/index.ts": { | ||
"bytes": 2165, | ||
"bytes": 2124, | ||
"imports": [ | ||
@@ -19,4 +19,4 @@ { | ||
}, | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytes": 12486, | ||
"../../node_modules/custom-media-element/dist/custom-media-element.js": { | ||
"bytes": 10071, | ||
"imports": [ | ||
@@ -389,3 +389,3 @@ { | ||
{ | ||
"path": "../../node_modules/custom-media-element/custom-media-element.js", | ||
"path": "../../node_modules/custom-media-element/dist/custom-media-element.js", | ||
"kind": "import-statement", | ||
@@ -418,3 +418,3 @@ "original": "custom-media-element" | ||
"inputs": {}, | ||
"bytes": 146792 | ||
"bytes": 145444 | ||
}, | ||
@@ -448,4 +448,4 @@ "dist/index.mjs": { | ||
}, | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytesInOutput": 5904 | ||
"../../node_modules/custom-media-element/dist/custom-media-element.js": { | ||
"bytesInOutput": 6535 | ||
}, | ||
@@ -456,6 +456,6 @@ "../../node_modules/castable-video/castable-utils.js": { | ||
"../../node_modules/castable-video/castable-remote-playback.js": { | ||
"bytesInOutput": 6210 | ||
"bytesInOutput": 6211 | ||
}, | ||
"../../node_modules/castable-video/castable-mixin.js": { | ||
"bytesInOutput": 4685 | ||
"bytesInOutput": 4682 | ||
}, | ||
@@ -502,5 +502,5 @@ "../../node_modules/media-tracks/dist/track-event.js": { | ||
}, | ||
"bytes": 43228 | ||
"bytes": 43857 | ||
} | ||
} | ||
} |
{ | ||
"inputs": { | ||
"src/polyfills/index.ts": { | ||
"bytes": 2165, | ||
"bytes": 2124, | ||
"imports": [ | ||
@@ -25,3 +25,3 @@ { | ||
"../playback-core/dist/index.mjs": { | ||
"bytes": 37429, | ||
"bytes": 37588, | ||
"imports": [ | ||
@@ -42,2 +42,7 @@ { | ||
"original": "hls.js" | ||
}, | ||
{ | ||
"path": "../../node_modules/hls.js/dist/hls.mjs", | ||
"kind": "import-statement", | ||
"original": "hls.js" | ||
} | ||
@@ -52,4 +57,4 @@ ], | ||
}, | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytes": 12486, | ||
"../../node_modules/custom-media-element/dist/custom-media-element.js": { | ||
"bytes": 10071, | ||
"imports": [ | ||
@@ -422,3 +427,3 @@ { | ||
{ | ||
"path": "../../node_modules/custom-media-element/custom-media-element.js", | ||
"path": "../../node_modules/custom-media-element/dist/custom-media-element.js", | ||
"kind": "import-statement", | ||
@@ -451,3 +456,3 @@ "original": "custom-media-element" | ||
"inputs": {}, | ||
"bytes": 2338194 | ||
"bytes": 2340107 | ||
}, | ||
@@ -463,9 +468,9 @@ "dist/mux-video.js": { | ||
"../../node_modules/mux-embed/dist/mux.mjs": { | ||
"bytesInOutput": 83778 | ||
"bytesInOutput": 83774 | ||
}, | ||
"../../node_modules/hls.js/dist/hls.mjs": { | ||
"bytesInOutput": 394132 | ||
"bytesInOutput": 394147 | ||
}, | ||
"../playback-core/dist/index.mjs": { | ||
"bytesInOutput": 35667 | ||
"bytesInOutput": 35787 | ||
}, | ||
@@ -475,4 +480,4 @@ "src/env.ts": { | ||
}, | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytesInOutput": 5894 | ||
"../../node_modules/custom-media-element/dist/custom-media-element.js": { | ||
"bytesInOutput": 6529 | ||
}, | ||
@@ -531,5 +536,5 @@ "../../node_modules/castable-video/castable-utils.js": { | ||
}, | ||
"bytes": 556691 | ||
"bytes": 557457 | ||
} | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
"use strict";var Qt=Object.defineProperty;var ci=Object.getOwnPropertyDescriptor;var hi=Object.getOwnPropertyNames;var li=Object.getPrototypeOf,fi=Object.prototype.hasOwnProperty;var mi=Reflect.get;var pi=(e,i,t)=>i in e?Qt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var gi=(e,i)=>{for(var t in i)Qt(e,t,{get:i[t],enumerable:!0})},Ei=(e,i,t,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of hi(i))!fi.call(e,n)&&n!==t&&Qt(e,n,{get:()=>i[n],enumerable:!(s=ci(i,n))||s.enumerable});return e};var Ti=e=>Ei(Qt({},"__esModule",{value:!0}),e);var T=(e,i,t)=>(pi(e,typeof i!="symbol"?i+"":i,t),t),Te=(e,i,t)=>{if(!i.has(e))throw TypeError("Cannot "+t)};var r=(e,i,t)=>(Te(e,i,"read from private field"),t?t.call(e):i.get(e)),u=(e,i,t)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,t)},h=(e,i,t,s)=>(Te(e,i,"write to private field"),s?s.call(e,t):i.set(e,t),t);var k=(e,i,t)=>(Te(e,i,"access private method"),t),Zt=(e,i,t)=>mi(li(e),t,i);var Mi={};gi(Mi,{Attributes:()=>o,MediaError:()=>f.MediaError,VideoEvents:()=>ee,default:()=>Li,playerSoftwareName:()=>Pe,playerSoftwareVersion:()=>Oe});module.exports=Ti(Mi);var Tt=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class e extends Tt{}globalThis.DocumentFragment=e}var xt=class extends Tt{},be=class extends Tt{},bi={get(e){},define(e,i,t){},getName(e){return null},upgrade(e){},whenDefined(e){return Promise.resolve(xt)}},Nt,ve=class{constructor(i,t={}){u(this,Nt,void 0);h(this,Nt,t==null?void 0:t.detail)}get detail(){return r(this,Nt)}initCustomEvent(){}};Nt=new WeakMap;function vi(e,i){return new xt}var Le={document:{createElement:vi},DocumentFragment,customElements:bi,CustomEvent:ve,EventTarget:Tt,HTMLElement:xt,HTMLVideoElement:be},Me=typeof window=="undefined"||typeof globalThis.customElements=="undefined",te=Me?Le:globalThis,Ni=Me?Le.document:globalThis.document;var f=require("@mux/playback-core");var yi=()=>{try{return"0.22.0"}catch{}return"UNKNOWN"},Ai=yi(),we=()=>Ai;var ee=["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"];function ki(e){return` | ||
"use strict";var Zt=Object.defineProperty;var fi=Object.getOwnPropertyDescriptor;var mi=Object.getOwnPropertyNames;var pi=Object.getPrototypeOf,gi=Object.prototype.hasOwnProperty;var Ei=Reflect.get;var bi=(e,i,t)=>i in e?Zt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var Ti=(e,i)=>{for(var t in i)Zt(e,t,{get:i[t],enumerable:!0})},vi=(e,i,t,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of mi(i))!gi.call(e,n)&&n!==t&&Zt(e,n,{get:()=>i[n],enumerable:!(s=fi(i,n))||s.enumerable});return e};var yi=e=>vi(Zt({},"__esModule",{value:!0}),e);var b=(e,i,t)=>(bi(e,typeof i!="symbol"?i+"":i,t),t),Te=(e,i,t)=>{if(!i.has(e))throw TypeError("Cannot "+t)};var r=(e,i,t)=>(Te(e,i,"read from private field"),t?t.call(e):i.get(e)),u=(e,i,t)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,t)},h=(e,i,t,s)=>(Te(e,i,"write to private field"),s?s.call(e,t):i.set(e,t),t);var A=(e,i,t)=>(Te(e,i,"access private method"),t),te=(e,i,t)=>Ei(pi(e),t,i);var xi={};Ti(xi,{Attributes:()=>o,MediaError:()=>m.MediaError,VideoEvents:()=>ie,default:()=>Ni,playerSoftwareName:()=>Le,playerSoftwareVersion:()=>Ie});module.exports=yi(xi);var Et=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class e extends Et{}globalThis.DocumentFragment=e}var Mt=class extends Et{},ve=class extends Et{},Ai={get(e){},define(e,i,t){},getName(e){return null},upgrade(e){},whenDefined(e){return Promise.resolve(Mt)}},wt,ye=class{constructor(i,t={}){u(this,wt,void 0);h(this,wt,t==null?void 0:t.detail)}get detail(){return r(this,wt)}initCustomEvent(){}};wt=new WeakMap;function ki(e,i){return new Mt}var we={document:{createElement:ki},DocumentFragment,customElements:Ai,CustomEvent:ye,EventTarget:Et,HTMLElement:Mt,HTMLVideoElement:ve},Ne=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ee=Ne?we:globalThis,Gi=Ne?we.document:globalThis.document;var m=require("@mux/playback-core");var Si=()=>{try{return"0.22.0"}catch{}return"UNKNOWN"},Ri=Si(),xe=()=>Ri;var ie=["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"];function Ci(e){return` | ||
<style> | ||
@@ -15,6 +15,6 @@ :host { | ||
<slot name="media"> | ||
<audio${Ke(e)}></audio> | ||
<audio${Ue(e)}></audio> | ||
</slot> | ||
<slot></slot> | ||
`}function Si(e){return` | ||
`}function _i(e){return` | ||
<style> | ||
@@ -41,6 +41,6 @@ :host { | ||
<slot name="media"> | ||
<video${Ke(e)}></video> | ||
<video${Ue(e)}></video> | ||
</slot> | ||
<slot></slot> | ||
`}var De=(e,{tag:i,is:t})=>{var l,m,d,b,_,Ve,pt,N,a,p,ot,x,ye,M,Ge,P,Be;let s=(m=(l=globalThis.document)==null?void 0:l.createElement)==null?void 0:m.call(l,i,{is:t}),n=s?Ri(s):[];return d=class extends e{constructor(){super();u(this,p);u(this,x);u(this,M);u(this,P);u(this,pt,void 0);u(this,N,void 0);u(this,a,new Map)}static get observedAttributes(){var E,y,I;return k(E=d,_,Ve).call(E),[...(I=(y=s==null?void 0:s.constructor)==null?void 0:y.observedAttributes)!=null?I:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var g,E,y;return k(this,p,ot).call(this),(y=(E=(g=r(this,N))!=null?g:this.shadowRoot.querySelector(i))!=null?E:this.querySelector(":scope > [slot=media]"))!=null?y:this.querySelector(i)}set nativeEl(g){h(this,N,g)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(g){this.toggleAttribute("muted",!!g)}get src(){return this.getAttribute("src")}set src(g){this.setAttribute("src",`${g}`)}get preload(){var g,E;return(E=this.getAttribute("preload"))!=null?E:(g=this.nativeEl)==null?void 0:g.preload}set preload(g){this.setAttribute("preload",`${g}`)}init(){var g,E;if(!this.shadowRoot){this.attachShadow({mode:"open"});let y=Ci(this.attributes);t&&(y.is=t),i&&(y.part=i),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(y)}this.nativeEl.muted=this.hasAttribute("muted");for(let y of n)k(this,M,Ge).call(this,y);this.shadowRoot.addEventListener("slotchange",this),k(this,x,ye).call(this);for(let y of this.constructor.Events)(E=(g=this.shadowRoot).addEventListener)==null||E.call(g,y,this,!0)}handleEvent(g){if(g.type==="slotchange"){k(this,x,ye).call(this);return}g.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(g.type,{detail:g.detail}))}attributeChangedCallback(g,E,y){k(this,p,ot).call(this),k(this,P,Be).call(this,g,E,y)}connectedCallback(){k(this,p,ot).call(this)}},b=new WeakMap,_=new WeakSet,Ve=function(){if(r(this,b))return;h(this,b,!0);let g=new Set(this.observedAttributes);g.delete("muted");for(let E of n){if(E in this.prototype)continue;if(typeof s[E]=="function")this.prototype[E]=function(...I){return k(this,p,ot).call(this),this.call?this.call(E,...I):this.nativeEl[E].apply(this.nativeEl,I)};else{let I={get(){var V,Mt,wt;k(this,p,ot).call(this);let O=E.toLowerCase();if(g.has(O)){let Et=this.getAttribute(O);return Et===null?!1:Et===""?!0:Et}return(wt=(V=this.get)==null?void 0:V.call(this,E))!=null?wt:(Mt=this.nativeEl)==null?void 0:Mt[E]}};E!==E.toUpperCase()&&(I.set=function(O){k(this,p,ot).call(this);let V=E.toLowerCase();if(g.has(V)){O===!0||O===!1||O==null?this.toggleAttribute(V,!!O):this.setAttribute(V,O);return}if(this.set){this.set(E,O);return}this.nativeEl[E]=O}),Object.defineProperty(this.prototype,E,I)}}},pt=new WeakMap,N=new WeakMap,a=new WeakMap,p=new WeakSet,ot=function(){r(this,pt)||(h(this,pt,!0),this.init())},x=new WeakSet,ye=function(){let g=new Map(r(this,a));this.shadowRoot.querySelector("slot:not([name])").assignedElements({flatten:!0}).filter(E=>["track","source"].includes(E.localName)).forEach(E=>{var I,O;g.delete(E);let y=r(this,a).get(E);y||(y=E.cloneNode(),r(this,a).set(E,y)),(O=(I=this.nativeEl).append)==null||O.call(I,y),y.localName==="track"&&y.default&&(y.kind==="chapters"||y.kind==="metadata")&&y.track.mode==="disabled"&&(y.track.mode="hidden")}),g.forEach(E=>E.remove())},M=new WeakSet,Ge=function(g){if(Object.prototype.hasOwnProperty.call(this,g)){let E=this[g];delete this[g],this[g]=E}},P=new WeakSet,Be=function(g,E,y){var I,O,V,Mt,wt,Et;["id","class"].includes(g)||!d.observedAttributes.includes(g)&&this.constructor.observedAttributes.includes(g)||(y===null?(O=(I=this.nativeEl).removeAttribute)==null||O.call(I,g):((Mt=(V=this.nativeEl).getAttribute)==null?void 0:Mt.call(V,g))!=y&&((Et=(wt=this.nativeEl).setAttribute)==null||Et.call(wt,g,y)))},u(d,_),T(d,"getTemplateHTML",i.endsWith("audio")?ki:Si),T(d,"shadowRootOptions",{mode:"open"}),T(d,"Events",ee),u(d,b,void 0),d};function Ri(e){let i=[];for(let t=Object.getPrototypeOf(e);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))i.push(...Object.getOwnPropertyNames(t));return i}function Ke(e){let i="";for(let t in e){let s=e[t];s===""?i+=` ${t}`:i+=` ${t}="${s}"`}return i}function Ci(e){let i={};for(let t of e)i[t.name]=t.value;return i}var xe,ie=De((xe=globalThis.HTMLElement)!=null?xe:class{},{tag:"video"}),Ne,Bi=De((Ne=globalThis.HTMLElement)!=null?Ne:class{},{tag:"audio"});var G=new WeakMap,bt=class extends Error{},re=class extends Error{};var qe=globalThis.WeakRef?class extends Set{add(e){super.add(new WeakRef(e))}forEach(e){super.forEach(i=>{let t=i.deref();t&&e(t)})}}:Set;function Fe(e){var i,t,s;(t=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?e():customElements.whenDefined("google-cast-button").then(e):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(e)}}function Ue(){return globalThis.chrome}function Ye(){var t;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${e}"]`))return;let i=document.createElement("script");i.src=e,document.head.append(i)}function Y(){var e,i;return(i=(e=globalThis.cast)==null?void 0:e.framework)==null?void 0:i.CastContext.getInstance()}function Dt(){var e;return(e=Y())==null?void 0:e.getCurrentSession()}function se(){var e;return(e=Dt())==null?void 0:e.getSessionObj().media[0]}function je(e){return new Promise((i,t)=>{se().editTracksInfo(e,i,t)})}function We(e){return new Promise((i,t)=>{se().getStatus(e,i,t)})}function Ae(e){return Y().setOptions({...ke(),...e})}function ke(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var ne=new qe,j=new WeakSet,C;Fe(()=>{var e,i,t,s;if(!((i=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&i.isAvailable)){console.debug("chrome.cast.isAvailable",(s=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:s.isAvailable);return}C||(C=cast.framework,Y().addEventListener(C.CastContextEventType.CAST_STATE_CHANGED,n=>{ne.forEach(l=>{var m,d;return(d=(m=G.get(l)).onCastStateChanged)==null?void 0:d.call(m,n)})}),Y().addEventListener(C.CastContextEventType.SESSION_STATE_CHANGED,n=>{ne.forEach(l=>{var m,d;return(d=(m=G.get(l)).onSessionStateChanged)==null?void 0:d.call(m,n)})}),ne.forEach(n=>{var l,m;return(m=(l=G.get(n)).init)==null?void 0:m.call(l)}))});var He=0,A,Vt,L,B,dt,ut,W,ae,K,at,de,$e,Gt,Se,ue,ze,Bt,Re,ce,Xe,Kt,Ce,oe=class extends EventTarget{constructor(t){super();u(this,K);u(this,de);u(this,Gt);u(this,ue);u(this,Bt);u(this,ce);u(this,Kt);u(this,A,void 0);u(this,Vt,void 0);u(this,L,void 0);u(this,B,void 0);u(this,dt,"disconnected");u(this,ut,!1);u(this,W,new Set);u(this,ae,new WeakMap);h(this,A,t),ne.add(this),G.set(this,{init:()=>k(this,Bt,Re).call(this),onCastStateChanged:()=>k(this,Gt,Se).call(this),onSessionStateChanged:()=>k(this,ue,ze).call(this),getCastPlayer:()=>r(this,K,at)}),k(this,Bt,Re).call(this)}get state(){return r(this,dt)}async watchAvailability(t){if(r(this,A).disableRemotePlayback)throw new bt("disableRemotePlayback attribute is present.");return r(this,ae).set(t,++He),r(this,W).add(t),He}async cancelWatchAvailability(t){if(r(this,A).disableRemotePlayback)throw new bt("disableRemotePlayback attribute is present.");t?r(this,W).delete(t):r(this,W).clear()}async prompt(){var s,n,l,m;if(r(this,A).disableRemotePlayback)throw new bt("disableRemotePlayback attribute is present.");if(!((n=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&n.isAvailable))throw new re("The RemotePlayback API is disabled on this platform.");let t=j.has(r(this,A));j.add(r(this,A)),Ae(r(this,A).castOptions),Object.entries(r(this,B)).forEach(([d,b])=>{r(this,L).controller.addEventListener(d,b)});try{await Y().requestSession()}catch(d){if(d==="cancel"){t||j.delete(r(this,A));return}throw new Error(d)}(m=(l=G.get(r(this,A)))==null?void 0:l.loadOnPrompt)==null||m.call(l)}};A=new WeakMap,Vt=new WeakMap,L=new WeakMap,B=new WeakMap,dt=new WeakMap,ut=new WeakMap,W=new WeakMap,ae=new WeakMap,K=new WeakSet,at=function(){if(j.has(r(this,A)))return r(this,L)},de=new WeakSet,$e=function(){j.has(r(this,A))&&(Object.entries(r(this,B)).forEach(([t,s])=>{r(this,L).controller.removeEventListener(t,s)}),j.delete(r(this,A)),r(this,A).muted=r(this,L).isMuted,r(this,A).currentTime=r(this,L).savedPlayerState.currentTime,r(this,L).savedPlayerState.isPaused===!1&&r(this,A).play())},Gt=new WeakSet,Se=function(){let t=Y().getCastState();if(j.has(r(this,A))&&t==="CONNECTING"&&(h(this,dt,"connecting"),this.dispatchEvent(new Event("connecting"))),!r(this,ut)&&(t!=null&&t.includes("CONNECT"))){h(this,ut,!0);for(let s of r(this,W))s(!0)}else if(r(this,ut)&&(!t||t==="NO_DEVICES_AVAILABLE")){h(this,ut,!1);for(let s of r(this,W))s(!1)}},ue=new WeakSet,ze=async function(){var s;let{SESSION_RESUMED:t}=C.SessionState;if(Y().getSessionState()===t&&r(this,A).castSrc===((s=se())==null?void 0:s.media.contentId)){j.add(r(this,A)),Object.entries(r(this,B)).forEach(([n,l])=>{r(this,L).controller.addEventListener(n,l)});try{await We(new chrome.cast.media.GetStatusRequest)}catch(n){console.error(n)}r(this,B)[C.RemotePlayerEventType.IS_PAUSED_CHANGED](),r(this,B)[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Bt=new WeakSet,Re=function(){!C||r(this,Vt)||(h(this,Vt,!0),Ae(r(this,A).castOptions),r(this,A).textTracks.addEventListener("change",()=>k(this,Kt,Ce).call(this)),k(this,Gt,Se).call(this),h(this,L,new C.RemotePlayer),new C.RemotePlayerController(r(this,L)),h(this,B,{[C.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:t})=>{t===!0?(h(this,dt,"connected"),this.dispatchEvent(new Event("connect"))):(k(this,de,$e).call(this),h(this,dt,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[C.RemotePlayerEventType.DURATION_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("durationchange"))},[C.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var t;(t=r(this,K,at))!=null&&t.isMediaLoaded&&r(this,A).dispatchEvent(new Event("timeupdate"))},[C.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("resize"))},[C.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{r(this,A).dispatchEvent(new Event(this.paused?"pause":"play"))},[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var t,s;((t=r(this,K,at))==null?void 0:t.playerState)!==chrome.cast.media.PlayerState.PAUSED&&r(this,A).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(s=r(this,K,at))==null?void 0:s.playerState]))},[C.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var t;(t=r(this,K,at))!=null&&t.isMediaLoaded&&(await Promise.resolve(),k(this,ce,Xe).call(this))}}))},ce=new WeakSet,Xe=function(){k(this,Kt,Ce).call(this)},Kt=new WeakSet,Ce=async function(){var N,a,p,R,x;if(!r(this,K,at))return;let s=((a=(N=r(this,L).mediaInfo)==null?void 0:N.tracks)!=null?a:[]).filter(({type:S})=>S===chrome.cast.media.TrackType.TEXT),n=[...r(this,A).textTracks].filter(({kind:S})=>S==="subtitles"||S==="captions"),l=s.map(({language:S,name:M,trackId:gt})=>{var nt;let{mode:P}=(nt=n.find(D=>D.language===S&&D.label===M))!=null?nt:{};return P?{mode:P,trackId:gt}:!1}).filter(Boolean),d=l.filter(({mode:S})=>S!=="showing").map(({trackId:S})=>S),b=l.find(({mode:S})=>S==="showing"),_=(x=(R=(p=Dt())==null?void 0:p.getSessionObj().media[0])==null?void 0:R.activeTrackIds)!=null?x:[],U=_;if(_.length&&(U=U.filter(S=>!d.includes(S))),b!=null&&b.trackId&&(U=[...U,b.trackId]),U=[...new Set(U)],!((S,M)=>S.length===M.length&&S.every(gt=>M.includes(gt)))(_,U))try{let S=new chrome.cast.media.EditTracksInfoRequest(U);await je(S)}catch(S){console.error(S)}};var Je=e=>{var i,t,s,n,l,m,d,v,_,Qe;return t=class extends e{constructor(){super(...arguments);u(this,d);u(this,_);u(this,s,{paused:!1});u(this,n,ke());u(this,l,void 0);u(this,m,void 0)}get remote(){return r(this,m)?r(this,m):Ue()?(Ye(),G.set(this,{loadOnPrompt:()=>k(this,_,Qe).call(this)}),h(this,m,new oe(this))):super.remote}attributeChangedCallback(a,p,R){if(super.attributeChangedCallback(a,p,R),a==="cast-receiver"&&R){r(this,n).receiverApplicationId=R;return}if(r(this,d,v))switch(a){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var M,gt;if(!r(this,d,v))return super.load();let a=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);a.customData=this.castCustomData;let p=[...this.querySelectorAll("track")].filter(({kind:P,src:nt})=>nt&&(P==="subtitles"||P==="captions")),R=[],x=0;p.length&&(a.tracks=p.map(P=>{let nt=++x;R.length===0&&P.track.mode==="showing"&&R.push(nt);let D=new chrome.cast.media.Track(nt,chrome.cast.media.TrackType.TEXT);return D.trackContentId=P.src,D.trackContentType="text/vtt",D.subtype=P.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,D.name=P.label,D.language=P.srclang,D})),this.castStreamType==="live"?a.streamType=chrome.cast.media.StreamType.LIVE:a.streamType=chrome.cast.media.StreamType.BUFFERED,a.metadata=new chrome.cast.media.GenericMediaMetadata,a.metadata.title=this.title,a.metadata.images=[{url:this.poster}];let S=new chrome.cast.media.LoadRequest(a);S.currentTime=(M=super.currentTime)!=null?M:0,S.autoplay=!r(this,s).paused,S.activeTrackIds=R,await((gt=Dt())==null?void 0:gt.loadMedia(S)),this.dispatchEvent(new Event("volumechange"))}play(){var a;if(r(this,d,v)){r(this,d,v).isPaused&&((a=r(this,d,v).controller)==null||a.playOrPause());return}return super.play()}pause(){var a;if(r(this,d,v)){r(this,d,v).isPaused||(a=r(this,d,v).controller)==null||a.playOrPause();return}super.pause()}get castOptions(){return r(this,n)}get castReceiver(){var a;return(a=this.getAttribute("cast-receiver"))!=null?a:void 0}set castReceiver(a){this.castReceiver!=a&&this.setAttribute("cast-receiver",`${a}`)}get castSrc(){var a,p,R;return(R=(p=this.getAttribute("cast-src"))!=null?p:(a=this.querySelector("source"))==null?void 0:a.src)!=null?R:this.currentSrc}set castSrc(a){this.castSrc!=a&&this.setAttribute("cast-src",`${a}`)}get castContentType(){var a;return(a=this.getAttribute("cast-content-type"))!=null?a:void 0}set castContentType(a){this.setAttribute("cast-content-type",`${a}`)}get castStreamType(){var a,p;return(p=(a=this.getAttribute("cast-stream-type"))!=null?a:this.streamType)!=null?p:void 0}set castStreamType(a){this.setAttribute("cast-stream-type",`${a}`)}get castCustomData(){return r(this,l)}set castCustomData(a){let p=typeof a;if(!["object","undefined"].includes(p)){console.error(`castCustomData must be nullish or an object but value was of type ${p}`);return}h(this,l,a)}get readyState(){if(r(this,d,v))switch(r(this,d,v).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return r(this,d,v)?r(this,d,v).isPaused:super.paused}get muted(){var a;return r(this,d,v)?(a=r(this,d,v))==null?void 0:a.isMuted:super.muted}set muted(a){var p;if(r(this,d,v)){(a&&!r(this,d,v).isMuted||!a&&r(this,d,v).isMuted)&&((p=r(this,d,v).controller)==null||p.muteOrUnmute());return}super.muted=a}get volume(){var a,p;return r(this,d,v)?(p=(a=r(this,d,v))==null?void 0:a.volumeLevel)!=null?p:1:super.volume}set volume(a){var p;if(r(this,d,v)){r(this,d,v).volumeLevel=+a,(p=r(this,d,v).controller)==null||p.setVolumeLevel();return}super.volume=a}get duration(){var a,p,R;return r(this,d,v)&&((a=r(this,d,v))!=null&&a.isMediaLoaded)?(R=(p=r(this,d,v))==null?void 0:p.duration)!=null?R:NaN:super.duration}get currentTime(){var a,p,R;return r(this,d,v)&&((a=r(this,d,v))!=null&&a.isMediaLoaded)?(R=(p=r(this,d,v))==null?void 0:p.currentTime)!=null?R:0:super.currentTime}set currentTime(a){var p;if(r(this,d,v)){r(this,d,v).currentTime=a,(p=r(this,d,v).controller)==null||p.seek();return}super.currentTime=a}},s=new WeakMap,n=new WeakMap,l=new WeakMap,m=new WeakMap,d=new WeakSet,v=function(){var a,p;return(p=(a=G.get(this.remote))==null?void 0:a.getCastPlayer)==null?void 0:p.call(a)},_=new WeakSet,Qe=async function(){r(this,s).paused=Zt(t.prototype,this,"paused"),Zt(t.prototype,this,"pause").call(this),this.muted=Zt(t.prototype,this,"muted");try{await this.load()}catch(a){console.error(a)}},T(t,"observedAttributes",[...(i=e.observedAttributes)!=null?i:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t};var q=class extends Event{constructor(t,s){super(t);T(this,"track");this.track=s.track}};var _e=new WeakMap;function c(e){var i;return(i=_e.get(e))!=null?i:_i(e,{})}function _i(e,i){let t=_e.get(e);return t||_e.set(e,t={}),Object.assign(t,i)}function he(e,i){let t=e.videoTracks;c(i).media=e,c(i).renditionSet||(c(i).renditionSet=new Set);let s=c(t).trackSet;s.add(i);let n=s.size-1;n in ht.prototype||Object.defineProperty(ht.prototype,n,{get(){return[...c(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new q("addtrack",{track:i}))})}function le(e){var s;let i=(s=c(e).media)==null?void 0:s.videoTracks;if(!i)return;c(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new q("removetrack",{track:e}))})}function Ze(e){var s;let i=(s=c(e).media.videoTracks)!=null?s:[],t=!1;for(let n of i)n!==e&&(n.selected=!1,t=!0);if(t){if(c(i).changeRequested)return;c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,i.dispatchEvent(new Event("change"))})}}var H,$,z,ct,qt,ht=class extends EventTarget{constructor(){super();u(this,ct);u(this,H,void 0);u(this,$,void 0);u(this,z,void 0);c(this).trackSet=new Set}[Symbol.iterator](){return r(this,ct,qt).values()}get length(){return r(this,ct,qt).size}getTrackById(t){var s;return(s=[...r(this,ct,qt)].find(n=>n.id===t))!=null?s:null}get selectedIndex(){return[...r(this,ct,qt)].findIndex(t=>t.selected)}get onaddtrack(){return r(this,H)}set onaddtrack(t){r(this,H)&&(this.removeEventListener("addtrack",r(this,H)),h(this,H,void 0)),typeof t=="function"&&(h(this,H,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,$)}set onremovetrack(t){r(this,$)&&(this.removeEventListener("removetrack",r(this,$)),h(this,$,void 0)),typeof t=="function"&&(h(this,$,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,z)}set onchange(t){r(this,z)&&(this.removeEventListener("change",r(this,z)),h(this,z,void 0)),typeof t=="function"&&(h(this,z,t),this.addEventListener("change",t))}};H=new WeakMap,$=new WeakMap,z=new WeakMap,ct=new WeakSet,qt=function(){return c(this).trackSet};var F=class extends Event{constructor(t,s){super(t);T(this,"rendition");this.rendition=s.rendition}};function ti(e,i){let t=c(e).media.videoRenditions;c(i).media=c(e).media,c(i).track=e;let s=c(e).renditionSet;s.add(i);let n=s.size-1;n in lt.prototype||Object.defineProperty(lt.prototype,n,{get(){return vt(this)[n]}}),queueMicrotask(()=>{e.selected&&t.dispatchEvent(new F("addrendition",{rendition:i}))})}function ei(e){let i=c(e).media.videoRenditions,t=c(e).track;c(t).renditionSet.delete(e),queueMicrotask(()=>{c(e).track.selected&&i.dispatchEvent(new F("removerendition",{rendition:e}))})}function ii(e){let i=c(e).media.videoRenditions;!i||c(i).changeRequested||(c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,c(e).track.selected&&i.dispatchEvent(new Event("change"))}))}function vt(e){return[...c(e).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...c(t).renditionSet])}var X,J,Q,lt=class extends EventTarget{constructor(){super(...arguments);u(this,X,void 0);u(this,J,void 0);u(this,Q,void 0)}[Symbol.iterator](){return vt(this).values()}get length(){return vt(this).length}getRenditionById(t){var s;return(s=vt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return vt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of vt(this).entries())n.selected=s===t}get onaddrendition(){return r(this,X)}set onaddrendition(t){r(this,X)&&(this.removeEventListener("addrendition",r(this,X)),h(this,X,void 0)),typeof t=="function"&&(h(this,X,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,J)}set onremoverendition(t){r(this,J)&&(this.removeEventListener("removerendition",r(this,J)),h(this,J,void 0)),typeof t=="function"&&(h(this,J,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,Q)}set onchange(t){r(this,Q)&&(this.removeEventListener("change",r(this,Q)),h(this,Q,void 0)),typeof t=="function"&&(h(this,Q,t),this.addEventListener("change",t))}};X=new WeakMap,J=new WeakMap,Q=new WeakMap;var yt,Ft=class{constructor(){T(this,"src");T(this,"id");T(this,"width");T(this,"height");T(this,"bitrate");T(this,"frameRate");T(this,"codec");u(this,yt,!1)}get selected(){return r(this,yt)}set selected(i){r(this,yt)!==i&&(h(this,yt,i),ii(this))}};yt=new WeakMap;var At,kt=class{constructor(){T(this,"id");T(this,"kind");T(this,"label","");T(this,"language","");T(this,"sourceBuffer");u(this,At,!1)}addRendition(i,t,s,n,l,m){let d=new Ft;return d.src=i,d.width=t,d.height=s,d.frameRate=m,d.bitrate=l,d.codec=n,ti(this,d),d}removeRendition(i){ei(i)}get selected(){return r(this,At)}set selected(i){r(this,At)!==i&&(h(this,At,i),i===!0&&Ze(this))}};At=new WeakMap;function ri(e,i){let t=c(e).media.audioRenditions;c(i).media=c(e).media,c(i).track=e;let s=c(e).renditionSet;s.add(i);let n=s.size-1;n in ft.prototype||Object.defineProperty(ft.prototype,n,{get(){return St(this)[n]}}),queueMicrotask(()=>{e.enabled&&t.dispatchEvent(new F("addrendition",{rendition:i}))})}function si(e){let i=c(e).media.audioRenditions,t=c(e).track;c(t).renditionSet.delete(e),queueMicrotask(()=>{c(e).track.enabled&&i.dispatchEvent(new F("removerendition",{rendition:e}))})}function ni(e){let i=c(e).media.audioRenditions;!i||c(i).changeRequested||(c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,c(e).track.enabled&&i.dispatchEvent(new Event("change"))}))}function St(e){return[...c(e).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...c(t).renditionSet])}var Z,tt,et,ft=class extends EventTarget{constructor(){super(...arguments);u(this,Z,void 0);u(this,tt,void 0);u(this,et,void 0)}[Symbol.iterator](){return St(this).values()}get length(){return St(this).length}getRenditionById(t){var s;return(s=St(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return St(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of St(this).entries())n.selected=s===t}get onaddrendition(){return r(this,Z)}set onaddrendition(t){r(this,Z)&&(this.removeEventListener("addrendition",r(this,Z)),h(this,Z,void 0)),typeof t=="function"&&(h(this,Z,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,tt)}set onremoverendition(t){r(this,tt)&&(this.removeEventListener("removerendition",r(this,tt)),h(this,tt,void 0)),typeof t=="function"&&(h(this,tt,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,et)}set onchange(t){r(this,et)&&(this.removeEventListener("change",r(this,et)),h(this,et,void 0)),typeof t=="function"&&(h(this,et,t),this.addEventListener("change",t))}};Z=new WeakMap,tt=new WeakMap,et=new WeakMap;var Rt,Ut=class{constructor(){T(this,"src");T(this,"id");T(this,"bitrate");T(this,"codec");u(this,Rt,!1)}get selected(){return r(this,Rt)}set selected(i){r(this,Rt)!==i&&(h(this,Rt,i),ni(this))}};Rt=new WeakMap;function me(e,i){let t=e.audioTracks;c(i).media=e,c(i).renditionSet||(c(i).renditionSet=new Set);let s=c(t).trackSet;s.add(i);let n=s.size-1;n in mt.prototype||Object.defineProperty(mt.prototype,n,{get(){return[...c(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new q("addtrack",{track:i}))})}function pe(e){var s;let i=(s=c(e).media)==null?void 0:s.audioTracks;if(!i)return;c(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new q("removetrack",{track:e}))})}function oi(e){let i=c(e).media.audioTracks;!i||c(i).changeRequested||(c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,i.dispatchEvent(new Event("change"))}))}var it,rt,st,Ct,fe,mt=class extends EventTarget{constructor(){super();u(this,Ct);u(this,it,void 0);u(this,rt,void 0);u(this,st,void 0);c(this).trackSet=new Set}[Symbol.iterator](){return r(this,Ct,fe).values()}get length(){return r(this,Ct,fe).size}getTrackById(t){var s;return(s=[...r(this,Ct,fe)].find(n=>n.id===t))!=null?s:null}get onaddtrack(){return r(this,it)}set onaddtrack(t){r(this,it)&&(this.removeEventListener("addtrack",r(this,it)),h(this,it,void 0)),typeof t=="function"&&(h(this,it,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,rt)}set onremovetrack(t){r(this,rt)&&(this.removeEventListener("removetrack",r(this,rt)),h(this,rt,void 0)),typeof t=="function"&&(h(this,rt,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,st)}set onchange(t){r(this,st)&&(this.removeEventListener("change",r(this,st)),h(this,st,void 0)),typeof t=="function"&&(h(this,st,t),this.addEventListener("change",t))}};it=new WeakMap,rt=new WeakMap,st=new WeakMap,Ct=new WeakSet,fe=function(){return c(this).trackSet};var _t,Ot=class{constructor(){T(this,"id");T(this,"kind");T(this,"label","");T(this,"language","");T(this,"sourceBuffer");u(this,_t,!1)}addRendition(i,t,s){let n=new Ut;return n.src=i,n.codec=t,n.bitrate=s,ri(this,n),n}removeRendition(i){si(i)}get enabled(){return r(this,_t)}set enabled(i){r(this,_t)!==i&&(h(this,_t,i),oi(this))}};_t=new WeakMap;var ai=ge(globalThis.HTMLMediaElement,"video"),di=ge(globalThis.HTMLMediaElement,"audio");function ui(e){if(!(e!=null&&e.prototype))return e;let i=ge(e,"video");(!i||`${i}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"videoTracks",{get(){return Oi(this)}});let t=ge(e,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"audioTracks",{get(){return Pi(this)}}),"addVideoTrack"in e.prototype||(e.prototype.addVideoTrack=function(l,m="",d=""){let b=new kt;return b.kind=l,b.label=m,b.language=d,he(this,b),b}),"removeVideoTrack"in e.prototype||(e.prototype.removeVideoTrack=le),"addAudioTrack"in e.prototype||(e.prototype.addAudioTrack=function(l,m="",d=""){let b=new Ot;return b.kind=l,b.label=m,b.language=d,me(this,b),b}),"removeAudioTrack"in e.prototype||(e.prototype.removeAudioTrack=pe),"videoRenditions"in e.prototype||Object.defineProperty(e.prototype,"videoRenditions",{get(){return s(this)}});let s=l=>{let m=c(l).videoRenditions;return m||(m=new lt,c(m).media=l,c(l).videoRenditions=m),m};"audioRenditions"in e.prototype||Object.defineProperty(e.prototype,"audioRenditions",{get(){return n(this)}});let n=l=>{let m=c(l).audioRenditions;return m||(m=new ft,c(m).media=l,c(l).audioRenditions=m),m};return e}function ge(e,i){var t;if(e!=null&&e.prototype)return(t=Object.getOwnPropertyDescriptor(e.prototype,`${i}Tracks`))==null?void 0:t.get}function Oi(e){var t;let i=c(e).videoTracks;if(!i&&(i=new ht,c(e).videoTracks=i,ai)){let s=ai.call((t=e.nativeEl)!=null?t:e);for(let n of s)he(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof kt)){for(let l of s)le(l);return}he(e,n.track)}),s.addEventListener("removetrack",n=>{le(n.track)})}return i}function Pi(e){var t;let i=c(e).audioTracks;if(!i&&(i=new mt,c(e).audioTracks=i,di)){let s=di.call((t=e.nativeEl)!=null?t:e);for(let n of s)me(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof Ot)){for(let l of s)pe(l);return}me(e,n.track)}),s.addEventListener("removetrack",n=>{pe(n.track)})}return i}ee.push("castchange","entercast","leavecast");var o={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",ASSET_START_TIME:"asset-start-time",ASSET_END_TIME:"asset-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type"},Ii=Object.values(o),Oe=we(),Pe="mux-video",w,Pt,jt,It,Wt,Ht,$t,zt,Xt,Lt,Ee,Ie=class extends ie{constructor(){super();u(this,Lt);u(this,w,void 0);u(this,Pt,void 0);u(this,jt,void 0);u(this,It,{});u(this,Wt,{});u(this,Ht,void 0);u(this,$t,void 0);u(this,zt,void 0);u(this,Xt,void 0);h(this,jt,(0,f.generatePlayerInitTime)())}static get NAME(){return Pe}static get VERSION(){return Oe}static get observedAttributes(){var t;return[...Ii,...(t=ie.observedAttributes)!=null?t:[]]}get preferCmcd(){var t;return(t=this.getAttribute(o.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?f.CmcdTypeValues.includes(t)?this.setAttribute(o.PREFER_CMCD,t):console.warn(`Invalid value for preferCmcd. Must be one of ${f.CmcdTypeValues.join()}`):this.removeAttribute(o.PREFER_CMCD))}get playerInitTime(){return r(this,jt)}get playerSoftwareName(){var t;return(t=r(this,zt))!=null?t:Pe}set playerSoftwareName(t){h(this,zt,t)}get playerSoftwareVersion(){var t;return(t=r(this,$t))!=null?t:Oe}set playerSoftwareVersion(t){h(this,$t,t)}get _hls(){var t;return(t=r(this,w))==null?void 0:t.engine}get mux(){var t;return(t=this.nativeEl)==null?void 0:t.mux}get error(){var t;return(t=(0,f.getError)(this.nativeEl))!=null?t:null}get errorTranslator(){return r(this,Xt)}set errorTranslator(t){h(this,Xt,t)}get src(){return this.getAttribute("src")}set src(t){t!==this.src&&(t==null?this.removeAttribute("src"):this.setAttribute("src",t))}get type(){var t;return(t=this.getAttribute(o.TYPE))!=null?t:void 0}set type(t){t!==this.type&&(t?this.setAttribute(o.TYPE,t):this.removeAttribute(o.TYPE))}get autoplay(){let t=this.getAttribute("autoplay");return t===null?!1:t===""?!0:t}set autoplay(t){let s=this.autoplay;t!==s&&(t?this.setAttribute("autoplay",typeof t=="string"?t:""):this.removeAttribute("autoplay"))}get preload(){let t=this.getAttribute("preload");return t===""?"auto":["none","metadata","auto"].includes(t)?t:super.preload}set preload(t){t!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(t)?this.setAttribute("preload",t):this.removeAttribute("preload"))}get debug(){return this.getAttribute(o.DEBUG)!=null}set debug(t){t!==this.debug&&(t?this.setAttribute(o.DEBUG,""):this.removeAttribute(o.DEBUG))}get disableTracking(){return this.hasAttribute(o.DISABLE_TRACKING)}set disableTracking(t){t!==this.disableTracking&&this.toggleAttribute(o.DISABLE_TRACKING,!!t)}get disableCookies(){return this.hasAttribute(o.DISABLE_COOKIES)}set disableCookies(t){t!==this.disableCookies&&(t?this.setAttribute(o.DISABLE_COOKIES,""):this.removeAttribute(o.DISABLE_COOKIES))}get startTime(){let t=this.getAttribute(o.START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set startTime(t){t!==this.startTime&&(t==null?this.removeAttribute(o.START_TIME):this.setAttribute(o.START_TIME,`${t}`))}get playbackId(){var t;return this.hasAttribute(o.PLAYBACK_ID)?this.getAttribute(o.PLAYBACK_ID):(t=(0,f.toPlaybackIdFromSrc)(this.src))!=null?t:void 0}set playbackId(t){t!==this.playbackId&&(t?this.setAttribute(o.PLAYBACK_ID,t):this.removeAttribute(o.PLAYBACK_ID))}get maxResolution(){var t;return(t=this.getAttribute(o.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(o.MAX_RESOLUTION,t):this.removeAttribute(o.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(o.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(o.MIN_RESOLUTION,t):this.removeAttribute(o.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(o.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(o.RENDITION_ORDER,t):this.removeAttribute(o.RENDITION_ORDER))}get programStartTime(){let t=this.getAttribute(o.PROGRAM_START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programStartTime(t){t==null?this.removeAttribute(o.PROGRAM_START_TIME):this.setAttribute(o.PROGRAM_START_TIME,`${t}`)}get programEndTime(){let t=this.getAttribute(o.PROGRAM_END_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programEndTime(t){t==null?this.removeAttribute(o.PROGRAM_END_TIME):this.setAttribute(o.PROGRAM_END_TIME,`${t}`)}get assetStartTime(){let t=this.getAttribute(o.ASSET_START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set assetStartTime(t){t==null?this.removeAttribute(o.ASSET_START_TIME):this.setAttribute(o.ASSET_START_TIME,`${t}`)}get assetEndTime(){let t=this.getAttribute(o.ASSET_END_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set assetEndTime(t){t==null?this.removeAttribute(o.ASSET_END_TIME):this.setAttribute(o.ASSET_END_TIME,`${t}`)}get customDomain(){var t;return(t=this.getAttribute(o.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(o.CUSTOM_DOMAIN,t):this.removeAttribute(o.CUSTOM_DOMAIN))}get drmToken(){var t;return(t=this.getAttribute(o.DRM_TOKEN))!=null?t:void 0}set drmToken(t){t!==this.drmToken&&(t?this.setAttribute(o.DRM_TOKEN,t):this.removeAttribute(o.DRM_TOKEN))}get playbackToken(){var t,s,n,l;if(this.hasAttribute(o.PLAYBACK_TOKEN))return(t=this.getAttribute(o.PLAYBACK_TOKEN))!=null?t:void 0;if(this.hasAttribute(o.PLAYBACK_ID)){let[,m]=(0,f.toPlaybackIdParts)((s=this.playbackId)!=null?s:"");return(n=new URLSearchParams(m).get("token"))!=null?n:void 0}if(this.src)return(l=new URLSearchParams(this.src).get("token"))!=null?l:void 0}set playbackToken(t){t!==this.playbackToken&&(t?this.setAttribute(o.PLAYBACK_TOKEN,t):this.removeAttribute(o.PLAYBACK_TOKEN))}get tokens(){let t=this.getAttribute(o.PLAYBACK_TOKEN),s=this.getAttribute(o.DRM_TOKEN);return{...r(this,Wt),...t!=null?{playback:t}:{},...s!=null?{drm:s}:{}}}set tokens(t){h(this,Wt,t!=null?t:{})}get ended(){return(0,f.getEnded)(this.nativeEl,this._hls)}get envKey(){var t;return(t=this.getAttribute(o.ENV_KEY))!=null?t:void 0}set envKey(t){t!==this.envKey&&(t?this.setAttribute(o.ENV_KEY,t):this.removeAttribute(o.ENV_KEY))}get beaconCollectionDomain(){var t;return(t=this.getAttribute(o.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(o.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(o.BEACON_COLLECTION_DOMAIN))}get streamType(){var t;return(t=this.getAttribute(o.STREAM_TYPE))!=null?t:(0,f.getStreamType)(this.nativeEl)}set streamType(t){t!==this.streamType&&(t?this.setAttribute(o.STREAM_TYPE,t):this.removeAttribute(o.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(o.TARGET_LIVE_WINDOW)?+this.getAttribute(o.TARGET_LIVE_WINDOW):(0,f.getTargetLiveWindow)(this.nativeEl)}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(o.TARGET_LIVE_WINDOW):this.setAttribute(o.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t,s;if(this.hasAttribute(o.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:n}=this,l=(t=this.nativeEl.seekable.end(0))!=null?t:0,m=(s=this.nativeEl.seekable.start(0))!=null?s:0;return Math.max(m,l-n)}return(0,f.getLiveEdgeStart)(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(o.LIVE_EDGE_OFFSET))return+this.getAttribute(o.LIVE_EDGE_OFFSET)}set liveEdgeOffset(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(o.LIVE_EDGE_OFFSET):this.setAttribute(o.LIVE_EDGE_OFFSET,`${+t}`))}get seekable(){return(0,f.getSeekable)(this.nativeEl)}async addCuePoints(t){return(0,f.addCuePoints)(this.nativeEl,t)}get activeCuePoint(){return(0,f.getActiveCuePoint)(this.nativeEl)}get cuePoints(){return(0,f.getCuePoints)(this.nativeEl)}async addChapters(t){return(0,f.addChapters)(this.nativeEl,t)}get activeChapter(){return(0,f.getActiveChapter)(this.nativeEl)}get chapters(){return(0,f.getChapters)(this.nativeEl)}getStartDate(){return(0,f.getStartDate)(this.nativeEl,this._hls)}get currentPdt(){return(0,f.getCurrentPdt)(this.nativeEl,this._hls)}get preferPlayback(){let t=this.getAttribute(o.PREFER_PLAYBACK);if(t===f.PlaybackTypes.MSE||t===f.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===f.PlaybackTypes.MSE||t===f.PlaybackTypes.NATIVE?this.setAttribute(o.PREFER_PLAYBACK,t):this.removeAttribute(o.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(s=>s.startsWith("metadata-")&&![o.METADATA_URL].includes(s)).reduce((s,n)=>{let l=this.getAttribute(n);return l!=null&&(s[n.replace(/^metadata-/,"").replace(/-/g,"_")]=l),s},{}),...r(this,It)}}set metadata(t){h(this,It,t!=null?t:{}),this.mux&&this.mux.emit("hb",r(this,It))}get _hlsConfig(){return r(this,Ht)}set _hlsConfig(t){h(this,Ht,t)}load(){h(this,w,(0,f.initialize)(this,this.nativeEl,r(this,w)))}unload(){(0,f.teardown)(this.nativeEl,r(this,w)),h(this,w,void 0)}attributeChangedCallback(t,s,n){var m,d;switch(ie.observedAttributes.includes(t)&&!["src","autoplay","preload"].includes(t)&&super.attributeChangedCallback(t,s,n),t){case o.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=n!=null?n:void 0;break;case o.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=n!=null?n:void 0;break;case"src":{let b=!!s,_=!!n;!b&&_?k(this,Lt,Ee).call(this):b&&!_?this.unload():b&&_&&(this.unload(),k(this,Lt,Ee).call(this));break}case"autoplay":if(n===s)break;(m=r(this,w))==null||m.setAutoplay(this.autoplay);break;case"preload":if(n===s)break;(d=r(this,w))==null||d.setPreload(n);break;case o.PLAYBACK_ID:this.src=(0,f.toMuxVideoURL)(this);break;case o.DEBUG:{let b=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=b);break}case o.METADATA_URL:n&&fetch(n).then(b=>b.json()).then(b=>this.metadata=b).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${n}!`));break;case o.STREAM_TYPE:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case o.TARGET_LIVE_WINDOW:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var t;(t=super.connectedCallback)==null||t.call(this),this.nativeEl&&this.src&&!r(this,w)&&k(this,Lt,Ee).call(this)}disconnectedCallback(){this.unload()}};w=new WeakMap,Pt=new WeakMap,jt=new WeakMap,It=new WeakMap,Wt=new WeakMap,Ht=new WeakMap,$t=new WeakMap,zt=new WeakMap,Xt=new WeakMap,Lt=new WeakSet,Ee=async function(){r(this,Pt)||(await h(this,Pt,Promise.resolve()),h(this,Pt,null),this.load())};var Jt,Yt=class extends Je(ui(Ie)){constructor(){super(...arguments);u(this,Jt,void 0)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var t;return(t=r(this,Jt))!=null?t:this.muxCastCustomData}set castCustomData(t){h(this,Jt,t)}};Jt=new WeakMap;te.customElements.get("mux-video")||(te.customElements.define("mux-video",Yt),te.MuxVideoElement=Yt);var Li=Yt; | ||
`}function Fe(e,{tag:i,is:t}){var l,p,d,T,I,Ge,pt,D,a,g,R,ot,y,Ae,w,Be,L,ke,Jt,Ke,Qt,qe;let s=(p=(l=globalThis.document)==null?void 0:l.createElement)==null?void 0:p.call(l,i,{is:t}),n=s?Oi(s):[];return d=class extends e{constructor(){super(...arguments);u(this,R);u(this,y);u(this,w);u(this,L);u(this,Jt);u(this,Qt);u(this,pt,!1);u(this,D,null);u(this,a,new Map);u(this,g,void 0);b(this,"get");b(this,"set");b(this,"call")}static get observedAttributes(){var E,_,C;return A(E=d,I,Ge).call(E),[...(C=(_=s==null?void 0:s.constructor)==null?void 0:_.observedAttributes)!=null?C:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var f,E,_,C,S;return A(this,R,ot).call(this),(S=(C=(E=(f=r(this,D))!=null?f:this.querySelector(":scope > [slot=media]"))!=null?E:this.querySelector(i))!=null?C:(_=this.shadowRoot)==null?void 0:_.querySelector(i))!=null?S:null}set nativeEl(f){h(this,D,f)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(f){this.toggleAttribute("muted",f)}get src(){return this.getAttribute("src")}set src(f){this.setAttribute("src",`${f}`)}get preload(){var f,E;return(E=this.getAttribute("preload"))!=null?E:(f=this.nativeEl)==null?void 0:f.preload}set preload(f){this.setAttribute("preload",`${f}`)}init(){var f;if(!this.shadowRoot){this.attachShadow({mode:"open"});let E=Pi(this.attributes);t&&(E.is=t),i&&(E.part=i),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(E)}this.nativeEl.muted=this.hasAttribute("muted");for(let E of n)A(this,Jt,Ke).call(this,E);h(this,g,new MutationObserver(A(this,w,Be).bind(this))),this.shadowRoot.addEventListener("slotchange",this),A(this,y,Ae).call(this);for(let E of this.constructor.Events)(f=this.shadowRoot)==null||f.addEventListener(E,this,!0)}handleEvent(f){if(f.type==="slotchange"){A(this,y,Ae).call(this);return}f.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(f.type,{detail:f.detail}))}attributeChangedCallback(f,E,_){A(this,R,ot).call(this),A(this,Qt,qe).call(this,f,E,_)}connectedCallback(){A(this,R,ot).call(this)}},T=new WeakMap,I=new WeakSet,Ge=function(){if(r(this,T))return;h(this,T,!0);let f=new Set(this.observedAttributes);f.delete("muted");for(let E of n)if(!(E in this.prototype))if(typeof s[E]=="function")this.prototype[E]=function(..._){return A(this,R,ot).call(this),(()=>{var O;if(this.call)return this.call(E,..._);let S=(O=this.nativeEl)==null?void 0:O[E];return S==null?void 0:S.apply(this.nativeEl,_)})()};else{let _={get(){var S,O,Lt;A(this,R,ot).call(this);let C=E.toLowerCase();if(f.has(C)){let gt=this.getAttribute(C);return gt===null?!1:gt===""?!0:gt}return(Lt=(S=this.get)==null?void 0:S.call(this,E))!=null?Lt:(O=this.nativeEl)==null?void 0:O[E]}};E!==E.toUpperCase()&&(_.set=function(C){A(this,R,ot).call(this);let S=E.toLowerCase();if(f.has(S)){C===!0||C===!1||C==null?this.toggleAttribute(S,!!C):this.setAttribute(S,C);return}if(this.set){this.set(E,C);return}this.nativeEl&&(this.nativeEl[E]=C)}),Object.defineProperty(this.prototype,E,_)}},pt=new WeakMap,D=new WeakMap,a=new WeakMap,g=new WeakMap,R=new WeakSet,ot=function(){r(this,pt)||(h(this,pt,!0),this.init())},y=new WeakSet,Ae=function(){var C;let f=new Map(r(this,a)),E=(C=this.shadowRoot)==null?void 0:C.querySelector("slot:not([name])");(E==null?void 0:E.assignedElements({flatten:!0}).filter(S=>["track","source"].includes(S.localName))).forEach(S=>{var Lt,gt;f.delete(S);let O=r(this,a).get(S);O||(O=S.cloneNode(),r(this,a).set(S,O),(Lt=r(this,g))==null||Lt.observe(S,{attributes:!0})),(gt=this.nativeEl)==null||gt.append(O),A(this,L,ke).call(this,O)}),f.forEach((S,O)=>{S.remove(),r(this,a).delete(O)})},w=new WeakSet,Be=function(f){var E;for(let _ of f)if(_.type==="attributes"){let{target:C,attributeName:S}=_,O=r(this,a).get(C);O&&S&&(O.setAttribute(S,(E=C.getAttribute(S))!=null?E:""),A(this,L,ke).call(this,O))}},L=new WeakSet,ke=function(f){f&&f.localName==="track"&&f.default&&(f.kind==="chapters"||f.kind==="metadata")&&f.track.mode==="disabled"&&(f.track.mode="hidden")},Jt=new WeakSet,Ke=function(f){if(Object.prototype.hasOwnProperty.call(this,f)){let E=this[f];delete this[f],this[f]=E}},Qt=new WeakSet,qe=function(f,E,_){var C,S,O;["id","class"].includes(f)||!d.observedAttributes.includes(f)&&this.constructor.observedAttributes.includes(f)||(_===null?(C=this.nativeEl)==null||C.removeAttribute(f):((S=this.nativeEl)==null?void 0:S.getAttribute(f))!==_&&((O=this.nativeEl)==null||O.setAttribute(f,_)))},u(d,I),b(d,"getTemplateHTML",i.endsWith("audio")?Ci:_i),b(d,"shadowRootOptions",{mode:"open"}),b(d,"Events",ie),u(d,T,!1),d}function Oi(e){let i=[];for(let t=Object.getPrototypeOf(e);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let s=Object.getOwnPropertyNames(t);i.push(...s)}return i}function Ue(e){let i="";for(let t in e){let s=e[t];s===""?i+=` ${t}`:i+=` ${t}="${s}"`}return i}function Pi(e){let i={};for(let t of e)i[t.name]=t.value;return i}var De,re=Fe((De=globalThis.HTMLElement)!=null?De:class{},{tag:"video"}),Ve,Fi=Fe((Ve=globalThis.HTMLElement)!=null?Ve:class{},{tag:"audio"});var G=new WeakMap,bt=class extends Error{},se=class extends Error{};var Ye=globalThis.WeakRef?class extends Set{add(e){super.add(new WeakRef(e))}forEach(e){super.forEach(i=>{let t=i.deref();t&&e(t)})}}:Set;function je(e){var i,t,s;(t=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?e():customElements.whenDefined("google-cast-button").then(e):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(e)}}function We(){return globalThis.chrome}function He(){var t;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${e}"]`))return;let i=document.createElement("script");i.src=e,document.head.append(i)}function Y(){var e,i;return(i=(e=globalThis.cast)==null?void 0:e.framework)==null?void 0:i.CastContext.getInstance()}function Nt(){var e;return(e=Y())==null?void 0:e.getCurrentSession()}function ne(){var e;return(e=Nt())==null?void 0:e.getSessionObj().media[0]}function $e(e){return new Promise((i,t)=>{ne().editTracksInfo(e,i,t)})}function ze(e){return new Promise((i,t)=>{ne().getStatus(e,i,t)})}function Se(e){return Y().setOptions({...Re(),...e})}function Re(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var oe=new Ye,j=new WeakSet,P;je(()=>{var e,i,t,s;if(!((i=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&i.isAvailable)){console.debug("chrome.cast.isAvailable",(s=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:s.isAvailable);return}P||(P=cast.framework,Y().addEventListener(P.CastContextEventType.CAST_STATE_CHANGED,n=>{oe.forEach(l=>{var p,d;return(d=(p=G.get(l)).onCastStateChanged)==null?void 0:d.call(p,n)})}),Y().addEventListener(P.CastContextEventType.SESSION_STATE_CHANGED,n=>{oe.forEach(l=>{var p,d;return(d=(p=G.get(l)).onSessionStateChanged)==null?void 0:d.call(p,n)})}),oe.forEach(n=>{var l,p;return(p=(l=G.get(n)).init)==null?void 0:p.call(l)}))});var Xe=0,k,xt,M,B,dt,ut,W,de,K,at,ue,Je,Dt,Ce,ce,Qe,Vt,_e,he,Ze,Gt,Oe,ae=class extends EventTarget{constructor(t){super();u(this,K);u(this,ue);u(this,Dt);u(this,ce);u(this,Vt);u(this,he);u(this,Gt);u(this,k,void 0);u(this,xt,void 0);u(this,M,void 0);u(this,B,void 0);u(this,dt,"disconnected");u(this,ut,!1);u(this,W,new Set);u(this,de,new WeakMap);h(this,k,t),oe.add(this),G.set(this,{init:()=>A(this,Vt,_e).call(this),onCastStateChanged:()=>A(this,Dt,Ce).call(this),onSessionStateChanged:()=>A(this,ce,Qe).call(this),getCastPlayer:()=>r(this,K,at)}),A(this,Vt,_e).call(this)}get state(){return r(this,dt)}async watchAvailability(t){if(r(this,k).disableRemotePlayback)throw new bt("disableRemotePlayback attribute is present.");return r(this,de).set(t,++Xe),r(this,W).add(t),Xe}async cancelWatchAvailability(t){if(r(this,k).disableRemotePlayback)throw new bt("disableRemotePlayback attribute is present.");t?r(this,W).delete(t):r(this,W).clear()}async prompt(){var s,n,l,p;if(r(this,k).disableRemotePlayback)throw new bt("disableRemotePlayback attribute is present.");if(!((n=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&n.isAvailable))throw new se("The RemotePlayback API is disabled on this platform.");let t=j.has(r(this,k));j.add(r(this,k)),Se(r(this,k).castOptions),Object.entries(r(this,B)).forEach(([d,T])=>{r(this,M).controller.addEventListener(d,T)});try{await Y().requestSession()}catch(d){if(d==="cancel"){t||j.delete(r(this,k));return}throw new Error(d)}(p=(l=G.get(r(this,k)))==null?void 0:l.loadOnPrompt)==null||p.call(l)}};k=new WeakMap,xt=new WeakMap,M=new WeakMap,B=new WeakMap,dt=new WeakMap,ut=new WeakMap,W=new WeakMap,de=new WeakMap,K=new WeakSet,at=function(){if(j.has(r(this,k)))return r(this,M)},ue=new WeakSet,Je=function(){j.has(r(this,k))&&(Object.entries(r(this,B)).forEach(([t,s])=>{r(this,M).controller.removeEventListener(t,s)}),j.delete(r(this,k)),r(this,k).muted=r(this,M).isMuted,r(this,k).currentTime=r(this,M).savedPlayerState.currentTime,r(this,M).savedPlayerState.isPaused===!1&&r(this,k).play())},Dt=new WeakSet,Ce=function(){let t=Y().getCastState();if(j.has(r(this,k))&&t==="CONNECTING"&&(h(this,dt,"connecting"),this.dispatchEvent(new Event("connecting"))),!r(this,ut)&&(t!=null&&t.includes("CONNECT"))){h(this,ut,!0);for(let s of r(this,W))s(!0)}else if(r(this,ut)&&(!t||t==="NO_DEVICES_AVAILABLE")){h(this,ut,!1);for(let s of r(this,W))s(!1)}},ce=new WeakSet,Qe=async function(){var s;let{SESSION_RESUMED:t}=P.SessionState;if(Y().getSessionState()===t&&r(this,k).castSrc===((s=ne())==null?void 0:s.media.contentId)){j.add(r(this,k)),Object.entries(r(this,B)).forEach(([n,l])=>{r(this,M).controller.addEventListener(n,l)});try{await ze(new chrome.cast.media.GetStatusRequest)}catch(n){console.error(n)}r(this,B)[P.RemotePlayerEventType.IS_PAUSED_CHANGED](),r(this,B)[P.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Vt=new WeakSet,_e=function(){!P||r(this,xt)||(h(this,xt,!0),Se(r(this,k).castOptions),r(this,k).textTracks.addEventListener("change",()=>A(this,Gt,Oe).call(this)),A(this,Dt,Ce).call(this),h(this,M,new P.RemotePlayer),new P.RemotePlayerController(r(this,M)),h(this,B,{[P.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:t})=>{t===!0?(h(this,dt,"connected"),this.dispatchEvent(new Event("connect"))):(A(this,ue,Je).call(this),h(this,dt,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[P.RemotePlayerEventType.DURATION_CHANGED]:()=>{r(this,k).dispatchEvent(new Event("durationchange"))},[P.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{r(this,k).dispatchEvent(new Event("volumechange"))},[P.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{r(this,k).dispatchEvent(new Event("volumechange"))},[P.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var t;(t=r(this,K,at))!=null&&t.isMediaLoaded&&r(this,k).dispatchEvent(new Event("timeupdate"))},[P.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{r(this,k).dispatchEvent(new Event("resize"))},[P.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{r(this,k).dispatchEvent(new Event(this.paused?"pause":"play"))},[P.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var t,s;((t=r(this,K,at))==null?void 0:t.playerState)!==chrome.cast.media.PlayerState.PAUSED&&r(this,k).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(s=r(this,K,at))==null?void 0:s.playerState]))},[P.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var t;(t=r(this,K,at))!=null&&t.isMediaLoaded&&(await Promise.resolve(),A(this,he,Ze).call(this))}}))},he=new WeakSet,Ze=function(){A(this,Gt,Oe).call(this)},Gt=new WeakSet,Oe=async function(){var D,a,g,R,Xt;if(!r(this,K,at))return;let s=((a=(D=r(this,M).mediaInfo)==null?void 0:D.tracks)!=null?a:[]).filter(({type:y})=>y===chrome.cast.media.TrackType.TEXT),n=[...r(this,k).textTracks].filter(({kind:y})=>y==="subtitles"||y==="captions"),l=s.map(({language:y,name:nt,trackId:w})=>{var L;let{mode:N}=(L=n.find(V=>V.language===y&&V.label===nt))!=null?L:{};return N?{mode:N,trackId:w}:!1}).filter(Boolean),d=l.filter(({mode:y})=>y!=="showing").map(({trackId:y})=>y),T=l.find(({mode:y})=>y==="showing"),I=(Xt=(R=(g=Nt())==null?void 0:g.getSessionObj().media[0])==null?void 0:R.activeTrackIds)!=null?Xt:[],U=I;if(I.length&&(U=U.filter(y=>!d.includes(y))),T!=null&&T.trackId&&(U=[...U,T.trackId]),U=[...new Set(U)],!((y,nt)=>y.length===nt.length&&y.every(w=>nt.includes(w)))(I,U))try{let y=new chrome.cast.media.EditTracksInfoRequest(U);await $e(y)}catch(y){console.error(y)}};var ti=e=>{var i,t,s,n,l,p,d,v,I,ei;return t=class extends e{constructor(){super(...arguments);u(this,d);u(this,I);u(this,s,{paused:!1});u(this,n,Re());u(this,l,void 0);u(this,p,void 0)}get remote(){return r(this,p)?r(this,p):We()?(He(),G.set(this,{loadOnPrompt:()=>A(this,I,ei).call(this)}),h(this,p,new ae(this))):super.remote}attributeChangedCallback(a,g,R){if(super.attributeChangedCallback(a,g,R),a==="cast-receiver"&&R){r(this,n).receiverApplicationId=R;return}if(r(this,d,v))switch(a){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var nt,w;if(!r(this,d,v))return super.load();let a=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);a.customData=this.castCustomData;let g=[...this.querySelectorAll("track")].filter(({kind:N,src:L})=>L&&(N==="subtitles"||N==="captions")),R=[],Xt=0;g.length&&(a.tracks=g.map(N=>{let L=++Xt;R.length===0&&N.track.mode==="showing"&&R.push(L);let V=new chrome.cast.media.Track(L,chrome.cast.media.TrackType.TEXT);return V.trackContentId=N.src,V.trackContentType="text/vtt",V.subtype=N.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,V.name=N.label,V.language=N.srclang,V})),this.castStreamType==="live"?a.streamType=chrome.cast.media.StreamType.LIVE:a.streamType=chrome.cast.media.StreamType.BUFFERED,a.metadata=new chrome.cast.media.GenericMediaMetadata,a.metadata.title=this.title,a.metadata.images=[{url:this.poster}];let y=new chrome.cast.media.LoadRequest(a);y.currentTime=(nt=super.currentTime)!=null?nt:0,y.autoplay=!r(this,s).paused,y.activeTrackIds=R,await((w=Nt())==null?void 0:w.loadMedia(y)),this.dispatchEvent(new Event("volumechange"))}play(){var a;if(r(this,d,v)){r(this,d,v).isPaused&&((a=r(this,d,v).controller)==null||a.playOrPause());return}return super.play()}pause(){var a;if(r(this,d,v)){r(this,d,v).isPaused||(a=r(this,d,v).controller)==null||a.playOrPause();return}super.pause()}get castOptions(){return r(this,n)}get castReceiver(){var a;return(a=this.getAttribute("cast-receiver"))!=null?a:void 0}set castReceiver(a){this.castReceiver!=a&&this.setAttribute("cast-receiver",`${a}`)}get castSrc(){var a,g,R;return(R=(g=this.getAttribute("cast-src"))!=null?g:(a=this.querySelector("source"))==null?void 0:a.src)!=null?R:this.currentSrc}set castSrc(a){this.castSrc!=a&&this.setAttribute("cast-src",`${a}`)}get castContentType(){var a;return(a=this.getAttribute("cast-content-type"))!=null?a:void 0}set castContentType(a){this.setAttribute("cast-content-type",`${a}`)}get castStreamType(){var a,g;return(g=(a=this.getAttribute("cast-stream-type"))!=null?a:this.streamType)!=null?g:void 0}set castStreamType(a){this.setAttribute("cast-stream-type",`${a}`)}get castCustomData(){return r(this,l)}set castCustomData(a){let g=typeof a;if(!["object","undefined"].includes(g)){console.error(`castCustomData must be nullish or an object but value was of type ${g}`);return}h(this,l,a)}get readyState(){if(r(this,d,v))switch(r(this,d,v).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return r(this,d,v)?r(this,d,v).isPaused:super.paused}get muted(){var a;return r(this,d,v)?(a=r(this,d,v))==null?void 0:a.isMuted:super.muted}set muted(a){var g;if(r(this,d,v)){(a&&!r(this,d,v).isMuted||!a&&r(this,d,v).isMuted)&&((g=r(this,d,v).controller)==null||g.muteOrUnmute());return}super.muted=a}get volume(){var a,g;return r(this,d,v)?(g=(a=r(this,d,v))==null?void 0:a.volumeLevel)!=null?g:1:super.volume}set volume(a){var g;if(r(this,d,v)){r(this,d,v).volumeLevel=+a,(g=r(this,d,v).controller)==null||g.setVolumeLevel();return}super.volume=a}get duration(){var a,g,R;return r(this,d,v)&&((a=r(this,d,v))!=null&&a.isMediaLoaded)?(R=(g=r(this,d,v))==null?void 0:g.duration)!=null?R:NaN:super.duration}get currentTime(){var a,g,R;return r(this,d,v)&&((a=r(this,d,v))!=null&&a.isMediaLoaded)?(R=(g=r(this,d,v))==null?void 0:g.currentTime)!=null?R:0:super.currentTime}set currentTime(a){var g;if(r(this,d,v)){r(this,d,v).currentTime=a,(g=r(this,d,v).controller)==null||g.seek();return}super.currentTime=a}},s=new WeakMap,n=new WeakMap,l=new WeakMap,p=new WeakMap,d=new WeakSet,v=function(){var a,g;return(g=(a=G.get(this.remote))==null?void 0:a.getCastPlayer)==null?void 0:g.call(a)},I=new WeakSet,ei=async function(){r(this,s).paused=te(t.prototype,this,"paused"),te(t.prototype,this,"pause").call(this),this.muted=te(t.prototype,this,"muted");try{await this.load()}catch(a){console.error(a)}},b(t,"observedAttributes",[...(i=e.observedAttributes)!=null?i:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t};var q=class extends Event{constructor(t,s){super(t);b(this,"track");this.track=s.track}};var Pe=new WeakMap;function c(e){var i;return(i=Pe.get(e))!=null?i:Ii(e,{})}function Ii(e,i){let t=Pe.get(e);return t||Pe.set(e,t={}),Object.assign(t,i)}function le(e,i){let t=e.videoTracks;c(i).media=e,c(i).renditionSet||(c(i).renditionSet=new Set);let s=c(t).trackSet;s.add(i);let n=s.size-1;n in ht.prototype||Object.defineProperty(ht.prototype,n,{get(){return[...c(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new q("addtrack",{track:i}))})}function fe(e){var s;let i=(s=c(e).media)==null?void 0:s.videoTracks;if(!i)return;c(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new q("removetrack",{track:e}))})}function ii(e){var s;let i=(s=c(e).media.videoTracks)!=null?s:[],t=!1;for(let n of i)n!==e&&(n.selected=!1,t=!0);if(t){if(c(i).changeRequested)return;c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,i.dispatchEvent(new Event("change"))})}}var H,$,z,ct,Bt,ht=class extends EventTarget{constructor(){super();u(this,ct);u(this,H,void 0);u(this,$,void 0);u(this,z,void 0);c(this).trackSet=new Set}[Symbol.iterator](){return r(this,ct,Bt).values()}get length(){return r(this,ct,Bt).size}getTrackById(t){var s;return(s=[...r(this,ct,Bt)].find(n=>n.id===t))!=null?s:null}get selectedIndex(){return[...r(this,ct,Bt)].findIndex(t=>t.selected)}get onaddtrack(){return r(this,H)}set onaddtrack(t){r(this,H)&&(this.removeEventListener("addtrack",r(this,H)),h(this,H,void 0)),typeof t=="function"&&(h(this,H,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,$)}set onremovetrack(t){r(this,$)&&(this.removeEventListener("removetrack",r(this,$)),h(this,$,void 0)),typeof t=="function"&&(h(this,$,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,z)}set onchange(t){r(this,z)&&(this.removeEventListener("change",r(this,z)),h(this,z,void 0)),typeof t=="function"&&(h(this,z,t),this.addEventListener("change",t))}};H=new WeakMap,$=new WeakMap,z=new WeakMap,ct=new WeakSet,Bt=function(){return c(this).trackSet};var F=class extends Event{constructor(t,s){super(t);b(this,"rendition");this.rendition=s.rendition}};function ri(e,i){let t=c(e).media.videoRenditions;c(i).media=c(e).media,c(i).track=e;let s=c(e).renditionSet;s.add(i);let n=s.size-1;n in lt.prototype||Object.defineProperty(lt.prototype,n,{get(){return Tt(this)[n]}}),queueMicrotask(()=>{e.selected&&t.dispatchEvent(new F("addrendition",{rendition:i}))})}function si(e){let i=c(e).media.videoRenditions,t=c(e).track;c(t).renditionSet.delete(e),queueMicrotask(()=>{c(e).track.selected&&i.dispatchEvent(new F("removerendition",{rendition:e}))})}function ni(e){let i=c(e).media.videoRenditions;!i||c(i).changeRequested||(c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,c(e).track.selected&&i.dispatchEvent(new Event("change"))}))}function Tt(e){return[...c(e).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...c(t).renditionSet])}var X,J,Q,lt=class extends EventTarget{constructor(){super(...arguments);u(this,X,void 0);u(this,J,void 0);u(this,Q,void 0)}[Symbol.iterator](){return Tt(this).values()}get length(){return Tt(this).length}getRenditionById(t){var s;return(s=Tt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return Tt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of Tt(this).entries())n.selected=s===t}get onaddrendition(){return r(this,X)}set onaddrendition(t){r(this,X)&&(this.removeEventListener("addrendition",r(this,X)),h(this,X,void 0)),typeof t=="function"&&(h(this,X,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,J)}set onremoverendition(t){r(this,J)&&(this.removeEventListener("removerendition",r(this,J)),h(this,J,void 0)),typeof t=="function"&&(h(this,J,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,Q)}set onchange(t){r(this,Q)&&(this.removeEventListener("change",r(this,Q)),h(this,Q,void 0)),typeof t=="function"&&(h(this,Q,t),this.addEventListener("change",t))}};X=new WeakMap,J=new WeakMap,Q=new WeakMap;var vt,Kt=class{constructor(){b(this,"src");b(this,"id");b(this,"width");b(this,"height");b(this,"bitrate");b(this,"frameRate");b(this,"codec");u(this,vt,!1)}get selected(){return r(this,vt)}set selected(i){r(this,vt)!==i&&(h(this,vt,i),ni(this))}};vt=new WeakMap;var yt,At=class{constructor(){b(this,"id");b(this,"kind");b(this,"label","");b(this,"language","");b(this,"sourceBuffer");u(this,yt,!1)}addRendition(i,t,s,n,l,p){let d=new Kt;return d.src=i,d.width=t,d.height=s,d.frameRate=p,d.bitrate=l,d.codec=n,ri(this,d),d}removeRendition(i){si(i)}get selected(){return r(this,yt)}set selected(i){r(this,yt)!==i&&(h(this,yt,i),i===!0&&ii(this))}};yt=new WeakMap;function oi(e,i){let t=c(e).media.audioRenditions;c(i).media=c(e).media,c(i).track=e;let s=c(e).renditionSet;s.add(i);let n=s.size-1;n in ft.prototype||Object.defineProperty(ft.prototype,n,{get(){return kt(this)[n]}}),queueMicrotask(()=>{e.enabled&&t.dispatchEvent(new F("addrendition",{rendition:i}))})}function ai(e){let i=c(e).media.audioRenditions,t=c(e).track;c(t).renditionSet.delete(e),queueMicrotask(()=>{c(e).track.enabled&&i.dispatchEvent(new F("removerendition",{rendition:e}))})}function di(e){let i=c(e).media.audioRenditions;!i||c(i).changeRequested||(c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,c(e).track.enabled&&i.dispatchEvent(new Event("change"))}))}function kt(e){return[...c(e).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...c(t).renditionSet])}var Z,tt,et,ft=class extends EventTarget{constructor(){super(...arguments);u(this,Z,void 0);u(this,tt,void 0);u(this,et,void 0)}[Symbol.iterator](){return kt(this).values()}get length(){return kt(this).length}getRenditionById(t){var s;return(s=kt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return kt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of kt(this).entries())n.selected=s===t}get onaddrendition(){return r(this,Z)}set onaddrendition(t){r(this,Z)&&(this.removeEventListener("addrendition",r(this,Z)),h(this,Z,void 0)),typeof t=="function"&&(h(this,Z,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,tt)}set onremoverendition(t){r(this,tt)&&(this.removeEventListener("removerendition",r(this,tt)),h(this,tt,void 0)),typeof t=="function"&&(h(this,tt,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,et)}set onchange(t){r(this,et)&&(this.removeEventListener("change",r(this,et)),h(this,et,void 0)),typeof t=="function"&&(h(this,et,t),this.addEventListener("change",t))}};Z=new WeakMap,tt=new WeakMap,et=new WeakMap;var St,qt=class{constructor(){b(this,"src");b(this,"id");b(this,"bitrate");b(this,"codec");u(this,St,!1)}get selected(){return r(this,St)}set selected(i){r(this,St)!==i&&(h(this,St,i),di(this))}};St=new WeakMap;function pe(e,i){let t=e.audioTracks;c(i).media=e,c(i).renditionSet||(c(i).renditionSet=new Set);let s=c(t).trackSet;s.add(i);let n=s.size-1;n in mt.prototype||Object.defineProperty(mt.prototype,n,{get(){return[...c(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new q("addtrack",{track:i}))})}function ge(e){var s;let i=(s=c(e).media)==null?void 0:s.audioTracks;if(!i)return;c(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new q("removetrack",{track:e}))})}function ui(e){let i=c(e).media.audioTracks;!i||c(i).changeRequested||(c(i).changeRequested=!0,queueMicrotask(()=>{delete c(i).changeRequested,i.dispatchEvent(new Event("change"))}))}var it,rt,st,Rt,me,mt=class extends EventTarget{constructor(){super();u(this,Rt);u(this,it,void 0);u(this,rt,void 0);u(this,st,void 0);c(this).trackSet=new Set}[Symbol.iterator](){return r(this,Rt,me).values()}get length(){return r(this,Rt,me).size}getTrackById(t){var s;return(s=[...r(this,Rt,me)].find(n=>n.id===t))!=null?s:null}get onaddtrack(){return r(this,it)}set onaddtrack(t){r(this,it)&&(this.removeEventListener("addtrack",r(this,it)),h(this,it,void 0)),typeof t=="function"&&(h(this,it,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,rt)}set onremovetrack(t){r(this,rt)&&(this.removeEventListener("removetrack",r(this,rt)),h(this,rt,void 0)),typeof t=="function"&&(h(this,rt,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,st)}set onchange(t){r(this,st)&&(this.removeEventListener("change",r(this,st)),h(this,st,void 0)),typeof t=="function"&&(h(this,st,t),this.addEventListener("change",t))}};it=new WeakMap,rt=new WeakMap,st=new WeakMap,Rt=new WeakSet,me=function(){return c(this).trackSet};var Ct,_t=class{constructor(){b(this,"id");b(this,"kind");b(this,"label","");b(this,"language","");b(this,"sourceBuffer");u(this,Ct,!1)}addRendition(i,t,s){let n=new qt;return n.src=i,n.codec=t,n.bitrate=s,oi(this,n),n}removeRendition(i){ai(i)}get enabled(){return r(this,Ct)}set enabled(i){r(this,Ct)!==i&&(h(this,Ct,i),ui(this))}};Ct=new WeakMap;var ci=Ee(globalThis.HTMLMediaElement,"video"),hi=Ee(globalThis.HTMLMediaElement,"audio");function li(e){if(!(e!=null&&e.prototype))return e;let i=Ee(e,"video");(!i||`${i}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"videoTracks",{get(){return Li(this)}});let t=Ee(e,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"audioTracks",{get(){return Mi(this)}}),"addVideoTrack"in e.prototype||(e.prototype.addVideoTrack=function(l,p="",d=""){let T=new At;return T.kind=l,T.label=p,T.language=d,le(this,T),T}),"removeVideoTrack"in e.prototype||(e.prototype.removeVideoTrack=fe),"addAudioTrack"in e.prototype||(e.prototype.addAudioTrack=function(l,p="",d=""){let T=new _t;return T.kind=l,T.label=p,T.language=d,pe(this,T),T}),"removeAudioTrack"in e.prototype||(e.prototype.removeAudioTrack=ge),"videoRenditions"in e.prototype||Object.defineProperty(e.prototype,"videoRenditions",{get(){return s(this)}});let s=l=>{let p=c(l).videoRenditions;return p||(p=new lt,c(p).media=l,c(l).videoRenditions=p),p};"audioRenditions"in e.prototype||Object.defineProperty(e.prototype,"audioRenditions",{get(){return n(this)}});let n=l=>{let p=c(l).audioRenditions;return p||(p=new ft,c(p).media=l,c(l).audioRenditions=p),p};return e}function Ee(e,i){var t;if(e!=null&&e.prototype)return(t=Object.getOwnPropertyDescriptor(e.prototype,`${i}Tracks`))==null?void 0:t.get}function Li(e){var t;let i=c(e).videoTracks;if(!i&&(i=new ht,c(e).videoTracks=i,ci)){let s=ci.call((t=e.nativeEl)!=null?t:e);for(let n of s)le(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof At)){for(let l of s)fe(l);return}le(e,n.track)}),s.addEventListener("removetrack",n=>{fe(n.track)})}return i}function Mi(e){var t;let i=c(e).audioTracks;if(!i&&(i=new mt,c(e).audioTracks=i,hi)){let s=hi.call((t=e.nativeEl)!=null?t:e);for(let n of s)pe(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof _t)){for(let l of s)ge(l);return}pe(e,n.track)}),s.addEventListener("removetrack",n=>{ge(n.track)})}return i}ie.push("castchange","entercast","leavecast");var o={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",ASSET_START_TIME:"asset-start-time",ASSET_END_TIME:"asset-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type"},wi=Object.values(o),Ie=xe(),Le="mux-video",x,Ot,Ut,Pt,Yt,jt,Wt,Ht,$t,It,be,Me=class extends re{constructor(){super();u(this,It);u(this,x,void 0);u(this,Ot,void 0);u(this,Ut,void 0);u(this,Pt,{});u(this,Yt,{});u(this,jt,void 0);u(this,Wt,void 0);u(this,Ht,void 0);u(this,$t,void 0);h(this,Ut,(0,m.generatePlayerInitTime)())}static get NAME(){return Le}static get VERSION(){return Ie}static get observedAttributes(){var t;return[...wi,...(t=re.observedAttributes)!=null?t:[]]}get preferCmcd(){var t;return(t=this.getAttribute(o.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?m.CmcdTypeValues.includes(t)?this.setAttribute(o.PREFER_CMCD,t):console.warn(`Invalid value for preferCmcd. Must be one of ${m.CmcdTypeValues.join()}`):this.removeAttribute(o.PREFER_CMCD))}get playerInitTime(){return r(this,Ut)}get playerSoftwareName(){var t;return(t=r(this,Ht))!=null?t:Le}set playerSoftwareName(t){h(this,Ht,t)}get playerSoftwareVersion(){var t;return(t=r(this,Wt))!=null?t:Ie}set playerSoftwareVersion(t){h(this,Wt,t)}get _hls(){var t;return(t=r(this,x))==null?void 0:t.engine}get mux(){var t;return(t=this.nativeEl)==null?void 0:t.mux}get error(){var t;return(t=(0,m.getError)(this.nativeEl))!=null?t:null}get errorTranslator(){return r(this,$t)}set errorTranslator(t){h(this,$t,t)}get src(){return this.getAttribute("src")}set src(t){t!==this.src&&(t==null?this.removeAttribute("src"):this.setAttribute("src",t))}get type(){var t;return(t=this.getAttribute(o.TYPE))!=null?t:void 0}set type(t){t!==this.type&&(t?this.setAttribute(o.TYPE,t):this.removeAttribute(o.TYPE))}get autoplay(){let t=this.getAttribute("autoplay");return t===null?!1:t===""?!0:t}set autoplay(t){let s=this.autoplay;t!==s&&(t?this.setAttribute("autoplay",typeof t=="string"?t:""):this.removeAttribute("autoplay"))}get preload(){let t=this.getAttribute("preload");return t===""?"auto":["none","metadata","auto"].includes(t)?t:super.preload}set preload(t){t!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(t)?this.setAttribute("preload",t):this.removeAttribute("preload"))}get debug(){return this.getAttribute(o.DEBUG)!=null}set debug(t){t!==this.debug&&(t?this.setAttribute(o.DEBUG,""):this.removeAttribute(o.DEBUG))}get disableTracking(){return this.hasAttribute(o.DISABLE_TRACKING)}set disableTracking(t){t!==this.disableTracking&&this.toggleAttribute(o.DISABLE_TRACKING,!!t)}get disableCookies(){return this.hasAttribute(o.DISABLE_COOKIES)}set disableCookies(t){t!==this.disableCookies&&(t?this.setAttribute(o.DISABLE_COOKIES,""):this.removeAttribute(o.DISABLE_COOKIES))}get startTime(){let t=this.getAttribute(o.START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set startTime(t){t!==this.startTime&&(t==null?this.removeAttribute(o.START_TIME):this.setAttribute(o.START_TIME,`${t}`))}get playbackId(){var t;return this.hasAttribute(o.PLAYBACK_ID)?this.getAttribute(o.PLAYBACK_ID):(t=(0,m.toPlaybackIdFromSrc)(this.src))!=null?t:void 0}set playbackId(t){t!==this.playbackId&&(t?this.setAttribute(o.PLAYBACK_ID,t):this.removeAttribute(o.PLAYBACK_ID))}get maxResolution(){var t;return(t=this.getAttribute(o.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(o.MAX_RESOLUTION,t):this.removeAttribute(o.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(o.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(o.MIN_RESOLUTION,t):this.removeAttribute(o.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(o.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(o.RENDITION_ORDER,t):this.removeAttribute(o.RENDITION_ORDER))}get programStartTime(){let t=this.getAttribute(o.PROGRAM_START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programStartTime(t){t==null?this.removeAttribute(o.PROGRAM_START_TIME):this.setAttribute(o.PROGRAM_START_TIME,`${t}`)}get programEndTime(){let t=this.getAttribute(o.PROGRAM_END_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programEndTime(t){t==null?this.removeAttribute(o.PROGRAM_END_TIME):this.setAttribute(o.PROGRAM_END_TIME,`${t}`)}get assetStartTime(){let t=this.getAttribute(o.ASSET_START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set assetStartTime(t){t==null?this.removeAttribute(o.ASSET_START_TIME):this.setAttribute(o.ASSET_START_TIME,`${t}`)}get assetEndTime(){let t=this.getAttribute(o.ASSET_END_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set assetEndTime(t){t==null?this.removeAttribute(o.ASSET_END_TIME):this.setAttribute(o.ASSET_END_TIME,`${t}`)}get customDomain(){var t;return(t=this.getAttribute(o.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(o.CUSTOM_DOMAIN,t):this.removeAttribute(o.CUSTOM_DOMAIN))}get drmToken(){var t;return(t=this.getAttribute(o.DRM_TOKEN))!=null?t:void 0}set drmToken(t){t!==this.drmToken&&(t?this.setAttribute(o.DRM_TOKEN,t):this.removeAttribute(o.DRM_TOKEN))}get playbackToken(){var t,s,n,l;if(this.hasAttribute(o.PLAYBACK_TOKEN))return(t=this.getAttribute(o.PLAYBACK_TOKEN))!=null?t:void 0;if(this.hasAttribute(o.PLAYBACK_ID)){let[,p]=(0,m.toPlaybackIdParts)((s=this.playbackId)!=null?s:"");return(n=new URLSearchParams(p).get("token"))!=null?n:void 0}if(this.src)return(l=new URLSearchParams(this.src).get("token"))!=null?l:void 0}set playbackToken(t){t!==this.playbackToken&&(t?this.setAttribute(o.PLAYBACK_TOKEN,t):this.removeAttribute(o.PLAYBACK_TOKEN))}get tokens(){let t=this.getAttribute(o.PLAYBACK_TOKEN),s=this.getAttribute(o.DRM_TOKEN);return{...r(this,Yt),...t!=null?{playback:t}:{},...s!=null?{drm:s}:{}}}set tokens(t){h(this,Yt,t!=null?t:{})}get ended(){return(0,m.getEnded)(this.nativeEl,this._hls)}get envKey(){var t;return(t=this.getAttribute(o.ENV_KEY))!=null?t:void 0}set envKey(t){t!==this.envKey&&(t?this.setAttribute(o.ENV_KEY,t):this.removeAttribute(o.ENV_KEY))}get beaconCollectionDomain(){var t;return(t=this.getAttribute(o.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(o.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(o.BEACON_COLLECTION_DOMAIN))}get streamType(){var t;return(t=this.getAttribute(o.STREAM_TYPE))!=null?t:(0,m.getStreamType)(this.nativeEl)}set streamType(t){t!==this.streamType&&(t?this.setAttribute(o.STREAM_TYPE,t):this.removeAttribute(o.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(o.TARGET_LIVE_WINDOW)?+this.getAttribute(o.TARGET_LIVE_WINDOW):(0,m.getTargetLiveWindow)(this.nativeEl)}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(o.TARGET_LIVE_WINDOW):this.setAttribute(o.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t,s;if(this.hasAttribute(o.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:n}=this,l=(t=this.nativeEl.seekable.end(0))!=null?t:0,p=(s=this.nativeEl.seekable.start(0))!=null?s:0;return Math.max(p,l-n)}return(0,m.getLiveEdgeStart)(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(o.LIVE_EDGE_OFFSET))return+this.getAttribute(o.LIVE_EDGE_OFFSET)}set liveEdgeOffset(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(o.LIVE_EDGE_OFFSET):this.setAttribute(o.LIVE_EDGE_OFFSET,`${+t}`))}get seekable(){return(0,m.getSeekable)(this.nativeEl)}async addCuePoints(t){return(0,m.addCuePoints)(this.nativeEl,t)}get activeCuePoint(){return(0,m.getActiveCuePoint)(this.nativeEl)}get cuePoints(){return(0,m.getCuePoints)(this.nativeEl)}async addChapters(t){return(0,m.addChapters)(this.nativeEl,t)}get activeChapter(){return(0,m.getActiveChapter)(this.nativeEl)}get chapters(){return(0,m.getChapters)(this.nativeEl)}getStartDate(){return(0,m.getStartDate)(this.nativeEl,this._hls)}get currentPdt(){return(0,m.getCurrentPdt)(this.nativeEl,this._hls)}get preferPlayback(){let t=this.getAttribute(o.PREFER_PLAYBACK);if(t===m.PlaybackTypes.MSE||t===m.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===m.PlaybackTypes.MSE||t===m.PlaybackTypes.NATIVE?this.setAttribute(o.PREFER_PLAYBACK,t):this.removeAttribute(o.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(s=>s.startsWith("metadata-")&&![o.METADATA_URL].includes(s)).reduce((s,n)=>{let l=this.getAttribute(n);return l!=null&&(s[n.replace(/^metadata-/,"").replace(/-/g,"_")]=l),s},{}),...r(this,Pt)}}set metadata(t){h(this,Pt,t!=null?t:{}),this.mux&&this.mux.emit("hb",r(this,Pt))}get _hlsConfig(){return r(this,jt)}set _hlsConfig(t){h(this,jt,t)}load(){h(this,x,(0,m.initialize)(this,this.nativeEl,r(this,x)))}unload(){(0,m.teardown)(this.nativeEl,r(this,x)),h(this,x,void 0)}attributeChangedCallback(t,s,n){var p,d;switch(re.observedAttributes.includes(t)&&!["src","autoplay","preload"].includes(t)&&super.attributeChangedCallback(t,s,n),t){case o.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=n!=null?n:void 0;break;case o.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=n!=null?n:void 0;break;case"src":{let T=!!s,I=!!n;!T&&I?A(this,It,be).call(this):T&&!I?this.unload():T&&I&&(this.unload(),A(this,It,be).call(this));break}case"autoplay":if(n===s)break;(p=r(this,x))==null||p.setAutoplay(this.autoplay);break;case"preload":if(n===s)break;(d=r(this,x))==null||d.setPreload(n);break;case o.PLAYBACK_ID:this.src=(0,m.toMuxVideoURL)(this);break;case o.DEBUG:{let T=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=T);break}case o.METADATA_URL:n&&fetch(n).then(T=>T.json()).then(T=>this.metadata=T).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${n}!`));break;case o.STREAM_TYPE:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case o.TARGET_LIVE_WINDOW:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var t;(t=super.connectedCallback)==null||t.call(this),this.nativeEl&&this.src&&!r(this,x)&&A(this,It,be).call(this)}disconnectedCallback(){this.unload()}};x=new WeakMap,Ot=new WeakMap,Ut=new WeakMap,Pt=new WeakMap,Yt=new WeakMap,jt=new WeakMap,Wt=new WeakMap,Ht=new WeakMap,$t=new WeakMap,It=new WeakSet,be=async function(){r(this,Ot)||(await h(this,Ot,Promise.resolve()),h(this,Ot,null),this.load())};var zt,Ft=class extends ti(li(Me)){constructor(){super(...arguments);u(this,zt,void 0)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var t;return(t=r(this,zt))!=null?t:this.muxCastCustomData}set castCustomData(t){h(this,zt,t)}};zt=new WeakMap;ee.customElements.get("mux-video")||(ee.customElements.define("mux-video",Ft),ee.MuxVideoElement=Ft);var Ni=Ft; | ||
//# sourceMappingURL=index.cjs.js.map |
{ | ||
"inputs": { | ||
"src/polyfills/index.ts": { | ||
"bytes": 2165, | ||
"bytes": 2124, | ||
"imports": [ | ||
@@ -25,3 +25,3 @@ { | ||
"../playback-core/dist/index.mjs": { | ||
"bytes": 37429, | ||
"bytes": 37588, | ||
"imports": [ | ||
@@ -42,2 +42,7 @@ { | ||
"original": "hls.js" | ||
}, | ||
{ | ||
"path": "../../node_modules/hls.js/dist/hls.mjs", | ||
"kind": "import-statement", | ||
"original": "hls.js" | ||
} | ||
@@ -52,4 +57,4 @@ ], | ||
}, | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytes": 12486, | ||
"../../node_modules/custom-media-element/dist/custom-media-element.js": { | ||
"bytes": 10071, | ||
"imports": [ | ||
@@ -422,3 +427,3 @@ { | ||
{ | ||
"path": "../../node_modules/custom-media-element/custom-media-element.js", | ||
"path": "../../node_modules/custom-media-element/dist/custom-media-element.js", | ||
"kind": "import-statement", | ||
@@ -451,3 +456,3 @@ "original": "custom-media-element" | ||
"inputs": {}, | ||
"bytes": 2338194 | ||
"bytes": 2340107 | ||
}, | ||
@@ -470,9 +475,9 @@ "dist/mux-video.mjs": { | ||
"../../node_modules/mux-embed/dist/mux.mjs": { | ||
"bytesInOutput": 83778 | ||
"bytesInOutput": 83774 | ||
}, | ||
"../../node_modules/hls.js/dist/hls.mjs": { | ||
"bytesInOutput": 394132 | ||
"bytesInOutput": 394147 | ||
}, | ||
"../playback-core/dist/index.mjs": { | ||
"bytesInOutput": 35667 | ||
"bytesInOutput": 35787 | ||
}, | ||
@@ -482,4 +487,4 @@ "src/env.ts": { | ||
}, | ||
"../../node_modules/custom-media-element/custom-media-element.js": { | ||
"bytesInOutput": 5894 | ||
"../../node_modules/custom-media-element/dist/custom-media-element.js": { | ||
"bytesInOutput": 6529 | ||
}, | ||
@@ -538,5 +543,5 @@ "../../node_modules/castable-video/castable-utils.js": { | ||
}, | ||
"bytes": 556793 | ||
"bytes": 557559 | ||
} | ||
} | ||
} |
{ | ||
"name": "@mux/mux-video", | ||
"version": "0.22.0-canary.0-27b6858", | ||
"version": "0.22.0-canary.0-2fbb2c1", | ||
"description": "A custom mux video element for the browser that Just Works™", | ||
@@ -33,5 +33,5 @@ "keywords": [ | ||
"require": "./dist/index.cjs.js", | ||
"default": "./dist/index.cjs.js", | ||
"types@<4.3.5": "./dist/types-ts3.4/index.d.ts", | ||
"types": "./dist/types/index.d.ts" | ||
"types": "./dist/types/index.d.ts", | ||
"default": "./dist/index.cjs.js" | ||
} | ||
@@ -70,5 +70,5 @@ }, | ||
"dependencies": { | ||
"@mux/playback-core": "0.27.0-canary.0-27b6858", | ||
"castable-video": "~1.1.0", | ||
"custom-media-element": "~1.3.1", | ||
"@mux/playback-core": "0.27.0-canary.0-2fbb2c1", | ||
"castable-video": "~1.1.3", | ||
"custom-media-element": "~1.4.1", | ||
"media-tracks": "~0.3.2" | ||
@@ -75,0 +75,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6311728
7248
+ Added@mux/playback-core@0.27.0-canary.0-2fbb2c1(transitive)
- Removed@mux/playback-core@0.27.0-canary.0-27b6858(transitive)
- Removedcustom-media-element@1.3.3(transitive)
Updatedcastable-video@~1.1.3
Updatedcustom-media-element@~1.4.1