@vindral/web-sdk 4.3.2 → 4.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{D5iA4gy8.js → BdFcdkj1.js} +1 -1
- package/{C8g5RSrs.js → DAKX3dD2.js} +2 -2
- package/{DZobqUqG.js → _2aj2ylj.js} +1 -1
- package/cast-sender.js +1 -1
- package/core.js +1 -1
- package/legacy.es.js +1 -1
- package/legacy.umd.js +1 -1
- package/package.json +1 -1
- package/player.js +2 -2
- package/vindral-player-component.js +2 -2
|
@@ -45,7 +45,7 @@ var r = class extends n {
|
|
|
45
45
|
var e;
|
|
46
46
|
let t = this.getInstance();
|
|
47
47
|
if (!t) throw "cast context should exist";
|
|
48
|
-
let n = t.getSessionState(), r = ((e = this.config) == null ? void 0 : e.receiverApplicationId) ||
|
|
48
|
+
let n = t.getSessionState(), r = ((e = this.config) == null ? void 0 : e.receiverApplicationId) || "A5452297";
|
|
49
49
|
t.setOptions({
|
|
50
50
|
receiverApplicationId: r,
|
|
51
51
|
autoJoinPolicy: chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { n as e, t } from "./BsfwXDui.js";
|
|
2
|
-
import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as ee, l, m as te, n as u, o as ne, p as re, r as ie, s as ae, t as oe, u as se, v as ce } from "./
|
|
2
|
+
import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as ee, l, m as te, n as u, o as ne, p as re, r as ie, s as ae, t as oe, u as se, v as ce } from "./_2aj2ylj.js";
|
|
3
3
|
import { M as le } from "./C01DcfYu.js";
|
|
4
4
|
import { a as d, i as f, n as p, r as m, t as h } from "./B7hT-BKr.js";
|
|
5
5
|
import { n as ue, t as de } from "./DeYmk5AL.js";
|
|
6
6
|
import { t as fe } from "./FYiEDBC4.js";
|
|
7
7
|
import { _ as pe, a as me, c as he, d as ge, f as _e, g, h as _, i as v, l as ve, m as ye, n as y, o as b, p as be, r as x, s as xe, t as Se, u as Ce, v as we, y as Te } from "./CjPLLJi5.js";
|
|
8
|
-
import { t as Ee } from "./
|
|
8
|
+
import { t as Ee } from "./BdFcdkj1.js";
|
|
9
9
|
//#region ../../libs/utils/src/mediaMetadata.ts
|
|
10
10
|
var De = ({ title: e, subTitle: t = "Live stream", poster: n }) => {
|
|
11
11
|
document.title = e, "mediaSession" in navigator && (navigator.mediaSession.metadata = new MediaMetadata({
|
|
@@ -11096,7 +11096,7 @@ var Uv = class {
|
|
|
11096
11096
|
let e = this.modules.canvasModule instanceof J_ ? !0 : void 0;
|
|
11097
11097
|
return w({
|
|
11098
11098
|
uptime: this.uptime,
|
|
11099
|
-
version: "4.3.
|
|
11099
|
+
version: "4.3.3",
|
|
11100
11100
|
clientId: this.clientId,
|
|
11101
11101
|
sessionId: this.sessionId,
|
|
11102
11102
|
channelId: this.channelId,
|
package/cast-sender.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./
|
|
1
|
+
import { t as e } from "./BdFcdkj1.js";
|
|
2
2
|
export { e as CastSender };
|
package/core.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as e } from "./
|
|
1
|
+
import { t as e } from "./_2aj2ylj.js";
|
|
2
2
|
import { a as t, c as n, i as r, l as i, n as a, o, r as s, s as c, u as l } from "./C01DcfYu.js";
|
|
3
3
|
export { a as AUTHENTICATION_EXPIRED_CODE, s as AUTHENTICATION_FAILED_CODE, r as CHANNEL_NOT_FOUND_CODE, t as CONNECTION_FAILED_AFTER_RETRIES_CODE, o as CONNECTION_FAILED_CODE, c as DISCONNECTED_BY_EDGE, n as INACTIVITY_CODE, i as NO_INCOMING_DATA, e as Vindral, l as VindralError };
|
package/legacy.es.js
CHANGED
|
@@ -1216,7 +1216,7 @@ var cr = class extends Ut {
|
|
|
1216
1216
|
var e;
|
|
1217
1217
|
let t = this.getInstance();
|
|
1218
1218
|
if (!t) throw "cast context should exist";
|
|
1219
|
-
let n = t.getSessionState(), r = ((e = this.config) == null ? void 0 : e.receiverApplicationId) ||
|
|
1219
|
+
let n = t.getSessionState(), r = ((e = this.config) == null ? void 0 : e.receiverApplicationId) || "A5452297";
|
|
1220
1220
|
t.setOptions({
|
|
1221
1221
|
receiverApplicationId: r,
|
|
1222
1222
|
autoJoinPolicy: chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,
|
package/legacy.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Vindral={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,t)=>()=>(e&&(t=e(e=0)),t),r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},i=`_buffering_1ccif_1`,a=`_hidden_1ccif_25`,o=`_scaleout_1ccif_1`,s={buffering:i,"buffering-fullscreen":`_buffering-fullscreen_1ccif_16`,hidden:a,"buffering-indicator":`_buffering-indicator_1ccif_31`,scaleout:o};function c(e){"@babel/helpers - typeof";return c=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},c(e)}var l=n((()=>{}));function u(e,t){if(c(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(c(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var d=n((()=>{l()}));function f(e){var t=u(e,`string`);return c(t)==`symbol`?t:t+``}var p=n((()=>{l(),d()}));function m(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=n((()=>{p()}));h();var g=class{constructor(e){m(this,`attach`,e=>{this.detach(),e.appendChild(this.element)}),m(this,`attachBefore`,(e,t)=>{this.detach(),e.insertBefore(this.element,t)}),m(this,`detach`,()=>this.element.remove()),this.element=e}};h();var _,v,y,b,x=(_=s.hidden)==null?``:_,ee=(v=s.buffering)==null?``:v,te=(y=s[`buffering-fullscreen`])==null?``:y,ne=(b=s[`buffering-indicator`])==null?``:b,re=class extends g{constructor(){super(document.createElement(`div`)),m(this,`indicator`,document.createElement(`div`)),m(this,`isHidden`,()=>this.element.classList.contains(x)),m(this,`setHidden`,e=>e?this.hide():this.show()),m(this,`hide`,()=>this.element.classList.add(x)),m(this,`show`,()=>this.element.classList.remove(x)),m(this,`fullscreen`,e=>{e?this.element.classList.add(te):this.element.classList.remove(te)}),this.element.className=ee,this.indicator.className=ne,this.element.appendChild(this.indicator)}},ie,ae=n((()=>{h(),ie=class{constructor(e){m(this,`maxSize`,0),m(this,`size`,0),m(this,`buffers`,[]),m(this,`_borrowedBuffers`,0),m(this,`get`,e=>{let t=this.buffers.pop();return this._borrowedBuffers++,this.size<e||!t?(this.buffers=[],this.size=e,new ArrayBuffer(e)):t}),m(this,`reclaim`,e=>{this._borrowedBuffers=Math.max(0,this._borrowedBuffers-1),!(e.byteLength<this.size)&&(this.buffers.length>=this.maxSize||this.buffers.push(e))}),this.maxSize=e}get bufferSize(){return this.size}get poolSize(){return this.buffers.length}get borrowedBuffers(){return this._borrowedBuffers}}})),S,oe=n((()=>{S=()=>{}})),C,se=n((()=>{oe(),h(),C=class e{constructor(){m(this,`promise`,void 0),m(this,`resolved`,void 0),m(this,`resolve`,void 0),m(this,`reject`,void 0),m(this,`pending`,!0),this.promise=new Promise((e,t)=>{this.resolve=t=>{this.pending=!1,this.resolved=t,e(t)},this.reject=e=>{this.pending=!1,t(e)}}),this.promise.catch(S)}static resolved(t){let n=new e;return n.resolve(t),n}static fromPromise(t){let n=new e;return n.promise=t,t.then(e=>{n.pending=!1,n.resolved=e},e=>{n.pending=!1,n.reject(e)}),n}}})),w,ce=n((()=>{h(),w=class{constructor(e=50){m(this,`maxSize`,void 0),m(this,`values`,[]),m(this,`start`,0),m(this,`size`,()=>this.values.length-this.start),m(this,`compact`,()=>{if(this.start!==0){if(this.start>=this.values.length){this.values=[],this.start=0;return}this.start<32&&this.start*2<this.values.length||(this.values=this.values.slice(this.start),this.start=0)}}),m(this,`push`,e=>{this.isFull()&&(this.start++,this.compact()),this.values.push(e)}),m(this,`clear`,()=>{this.values=[],this.start=0}),m(this,`pop`,()=>{if(this.isEmpty())return;let e=this.values[this.start];return this.start++,this.compact(),e}),m(this,`popLast`,()=>{if(this.isEmpty())return;let e=this.values.pop();return this.start>=this.values.length&&this.clear(),e}),m(this,`peekFirst`,()=>this.isEmpty()?void 0:this.values[this.start]),m(this,`peekLast`,()=>this.isEmpty()?void 0:this.values[this.values.length-1]),m(this,`isFull`,()=>this.size()>=this.maxSize),m(this,`isEmpty`,()=>this.size()===0),m(this,`items`,()=>this.start===0?this.values:this.values.slice(this.start)),m(this,`filterPop`,e=>{for(;!this.isEmpty();){let t=this.peekFirst();if(t===void 0||e(t))return;this.pop()}}),this.maxSize=e}}}));function le(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}var ue=n((()=>{}));function T(e,t,n){le(e,t),t.set(e,n)}var E=n((()=>{ue()}));function D(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}var O=n((()=>{}));function k(e,t,n){return e.set(D(e,t),n),n}var A=n((()=>{O()}));function j(e,t){return e.get(D(e,t))}var M=n((()=>{O()}));function de(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function N(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){de(a,r,i,o,s,`next`,e)}function s(e){de(a,r,i,o,s,`throw`,e)}o(void 0)})}}var P=n((()=>{}));function fe(e){let t=new ve(e);return[t,t]}var pe,me,he,ge,_e,ve,ye=n((()=>{se(),ce(),oe(),E(),A(),M(),P(),me=new WeakMap,he=new WeakMap,ge=new WeakMap,_e=new WeakMap,pe=Symbol.asyncIterator,ve=class{constructor(e){T(this,me,void 0),T(this,he,new C),T(this,ge,void 0),T(this,_e,!1),k(me,this,new w(e))}isFull(){return j(me,this).isFull()}close(){var e;(e=j(ge,this))==null||e.resolve(),k(_e,this,!0)}abort(e){var t,n;(t=j(ge,this))==null||t.promise.catch(S),(n=j(ge,this))==null||n.reject(e)}push(e){var t=this;return N(function*(){var n;j(me,t).isFull()&&(yield j(he,t).promise),j(me,t).push(e),(n=j(ge,t))==null||n.resolve(),k(ge,t,new C)})()}pop(){var e=this;return N(function*(){for(;!(j(_e,e)&&j(me,e).isEmpty());){var t;let n=j(me,e).pop();if(n)return j(he,e).resolve(),k(he,e,new C),n;j(ge,e)||k(ge,e,new C),yield(t=j(ge,e))==null?void 0:t.promise}})()}start(e){}pull(e){var t=this;return N(function*(){let n=yield t.pop();n?e.enqueue(n):e.close()})()}cancel(e){this.abort(Error(e))}next(){var e=this;return N(function*(){let t=yield e.pop().catch(()=>void 0);return t?{done:!1,value:t}:{done:!0,value:void 0}})()}return(){return this.close(),Promise.resolve({done:!0,value:void 0})}[pe](){return this}}}));function be(e,t){if(!e)throw Error(t)}var xe=n((()=>{}));function F(e){return Se?BigInt(e):typeof BigInt==`function`&&typeof e==`bigint`?Number(e):e}var Se,Ce=n((()=>{Se=typeof DataView.prototype.getBigUint64==`function`})),we,Te,Ee,De,Oe=n((()=>{E(),h(),M(),A(),we=new WeakMap,Te=new WeakMap,Ee=new WeakMap,De=class{constructor(e,t=0){T(this,we,void 0),T(this,Te,void 0),T(this,Ee,void 0),m(this,`position`,()=>j(Ee,this)),m(this,`peekBit`,()=>this.getBit(j(Te,this),j(Ee,this))),m(this,`readBit`,()=>{var e;let t=this.peekBit();return k(Ee,this,(e=j(Ee,this),e++,e)),t}),m(this,`readBits`,e=>{let t=0;for(let i=0;i<e;i++){var n,r;t=t<<1|(this.getBit(j(Te,this),(k(Ee,this,(n=j(Ee,this),r=n++,n)),r))?1:0)}return t}),m(this,`remainingBits`,()=>j(Te,this).byteLength*8-j(Ee,this)),m(this,`readSignedExpGolomb`,()=>{let e=this.readUnsignedExpGolomb();return e&1?(e+1)/2:-(e/2)}),m(this,`readUnsignedExpGolomb`,()=>{var e,t;let n=0;for(;this.getBit(j(Te,this),(k(Ee,this,(e=j(Ee,this),t=e++,e)),t))===0;)n++;let r=1<<n;for(let e=n-1;e>=0;e--){var i,a;r|=this.getBit(j(Te,this),(k(Ee,this,(i=j(Ee,this),a=i++,i)),a))<<e}return r-1}),m(this,`getBit`,(e,t)=>{if(e.byteLength*8<=t)throw Error(`BitReader: Out of bounds`);return e[t>>3]>>7-(t&7)&1}),k(we,this,e),k(Te,this,new Uint8Array(j(we,this))),k(Ee,this,t)}bytes(){return j(Te,this)}}})),ke,Ae=n((()=>{ke=(e,t,n)=>{let r=0;for(let i=t;i<=n;i++)if(i===t){let t=e[i];r+=t&127,t&128&&(r-=128)}else r=r*256+e[i];return r}})),I,je,Me,Ne,Pe=n((()=>{Ae(),E(),A(),M(),I=new WeakMap,je=new WeakMap,Me=new WeakMap,Ne=class{constructor(e){T(this,I,void 0),T(this,je,void 0),T(this,Me,void 0),k(je,this,e),k(Me,this,new DataView(e.buffer,e.byteOffset,e.byteLength)),k(I,this,0)}position(){return j(I,this)}byteOffset(){return j(je,this).byteOffset+j(I,this)}buffer(){return j(je,this)}remaining(){return j(je,this).length-j(I,this)}readUint8(){let e=j(Me,this).getUint8(j(I,this));return k(I,this,j(I,this)+1),e}readUint24(){let e=j(Me,this).getUint32(j(I,this))>>8&16777215;return k(I,this,j(I,this)+3),e}readUint16(){let e=j(Me,this).getUint16(j(I,this));return k(I,this,j(I,this)+2),e}readUint32(){let e=j(Me,this).getUint32(j(I,this));return k(I,this,j(I,this)+4),e}readUint64(){let e=ke(j(je,this),j(I,this),j(I,this)+7);return k(I,this,j(I,this)+8),e}readBytes(e){let t=j(je,this).subarray(j(I,this),j(I,this)+e);return k(I,this,j(I,this)+e),t}readRemaining(){return this.readBytes(this.remaining())}readUtf8String(){let e=[],t;for(;(t=this.readUint8())!==0&&(e.push(t),this.remaining()!==0););return new TextDecoder().decode(new Uint8Array(e))}}})),Fe,Ie=n((()=>{h(),Fe=class{constructor(e=100){m(this,`internalBuffer`,void 0),m(this,`view`,void 0),m(this,`uint8`,void 0),m(this,`_position`,0),m(this,`_end`,0),this.internalBuffer=new ArrayBuffer(e),this.view=new DataView(this.internalBuffer),this.uint8=new Uint8Array(this.internalBuffer)}position(){return this._position}seek(e){this._position=Math.max(0,Math.min(this._end,e))}seekToEnd(){this._position=this._end}writeUint8(e){this.writeAndMove(e,1)}writeUint16(e){this.writeAndMove(e,2)}writeUint24(e){this.writeAndMove(e,3)}writeUint32(e){this.writeAndMove(e,4)}writeUint64(e){let t=Math.floor(e/4294967296),n=(e&4294967295)>>>0;this.writeUint32(t),this.writeUint32(n)}writeUint32At(e,t){this.view.setUint32(e,t)}writeBytes(e){this.resizeIfNeeded(this.position()+e.byteLength),this.uint8.set(e,this.position()),this._position+=e.byteLength,this._end=Math.max(this._end,this._position)}buffer(){return this.internalBuffer.slice(0,this._end)}bufferExact(){return this._end===this.internalBuffer.byteLength?this.internalBuffer:this.internalBuffer.slice(0,this._end)}write(e,t){switch(this.resizeIfNeeded(this.position()+t),t){case 1:this.view.setUint8(this.position(),e);break;case 2:this.view.setUint16(this.position(),e);break;case 3:this.view.setUint8(this.position(),e>>16&255),this.view.setUint8(this.position()+1,e>>8&255),this.view.setUint8(this.position()+2,e&255);break;case 4:this.view.setUint32(this.position(),e);break}}writeAndMove(e,t){this.write(e,t),this._position+=t,this._end=Math.max(this._end,this._position)}resizeIfNeeded(e){if(e>this.internalBuffer.byteLength){let t=Math.max(e,this.internalBuffer.byteLength*2),n=new ArrayBuffer(t),r=new Uint8Array(n);r.set(this.uint8),this.internalBuffer=n,this.view=new DataView(this.internalBuffer),this.uint8=r}}}}));function Le(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}var Re=n((()=>{}));function ze(){let e=self.MediaSource,t=self.ManagedMediaSource;return e==null?t:e}var Be=n((()=>{}));function Ve(){if(/(iPhone|iPod|iPad)/i.test(We)){var e;return We==null||(e=We.match(/OS [\d_]+/i))==null||(e=e[0])==null?void 0:e.substring(3).split(`_`).map(e=>parseInt(e,10))[0]}}function He(){if(/^((?!chrome|android).)*safari/i.test(We)){var e;return(e=We.match(/version\/([\d.]+)/))==null||(e=e[1])==null?void 0:e.split(`.`).map(e=>parseInt(e,10))[0]}}var Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt=n((()=>{Be(),Ue=/(android|bbd+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows ce|xda|xiino\/i.test(a)||\/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-\//i,We=navigator.userAgent.toLowerCase(),Ge=Ue.test(We),Ke=()=>{let e=document.createElement(`video`);return e.canPlayType(`application/vnd.apple.mpegURL`)!==``||e.canPlayType(`audio/mpegurl`)!==``},qe=()=>{try{if(typeof WebAssembly==`object`&&typeof WebAssembly.instantiate==`function`){let e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){return!1}return!1},Je=()=>We.indexOf(`CrKey`)!==-1,Ye=()=>navigator.platform===`MacIntel`&&navigator.maxTouchPoints===0,Xe=()=>navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1,Ze=()=>Qe()||Xe()?!0:/AppleWebKit/i.test(navigator.userAgent)&&!/Chrome|Chromium|Edg|OPR|Opera/i.test(navigator.userAgent),Qe=()=>We.indexOf(`iphone`)>=0&&We.indexOf(`like iphone`)<0||We.indexOf(`ipad`)>=0&&We.indexOf(`like ipad`)<0||We.indexOf(`ipod`)>=0&&We.indexOf(`like ipod`)<0||Xe(),$e=()=>{var e,t;return Xe()||(e=(t=ze())==null?void 0:t.isTypeSupported(`audio/mp4; codecs="opus"`))==null?!1:e},et=()=>/^(?!.*chrome).*safari/i.test(We),tt=()=>typeof HTMLCanvasElement<`u`&&typeof HTMLCanvasElement.prototype.captureStream==`function`,nt=()=>{var e,t;let n=!!ze(),r=!1;return n&&(r=$e()),{isMobile:Ge,supportsMp4Opus:r,supportsMediaSource:n,supportsHls:Ke(),supportsWebAssembly:qe(),supportsCanvasCaptureStream:tt(),platform:{iosVersion:(e=Ve())==null?2**53-1:e,safariVersion:(t=He())==null?2**53-1:t,isIpadOS:Xe(),isMacOS:Ye(),isIOS:Qe(),isWebKit:Ze()}}}})),it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt=n((()=>{it=e=>e,at=e=>e,ot=e=>e,st=e=>e,ct=e=>`orientation`in e?e.orientation:void 0,lt=(e=document)=>{let t=it(e);return!!(e.fullscreenElement||e.fullscreen||t.mozFullScreen||t.webkitIsFullScreen)},ut=e=>{var t,n,r,i;let a=at(e);return((t=e.requestFullscreen)==null?void 0:t.bind(e))||((n=a.webkitRequestFullscreen)==null?void 0:n.bind(a))||((r=a.webkitEnterFullscreen)==null?void 0:r.bind(a))||((i=a.mozRequestFullScreen)==null?void 0:i.bind(a))},dt=(e,t=document)=>{var n,r;let i=it(t);return((n=t.exitFullscreen)==null?void 0:n.bind(t))||(i.webkitFullscreenElement&&i.webkitExitFullscreen?i.webkitExitFullscreen.bind(t):void 0)||(i.mozFullscreenElement&&i.mozCancelFullScreen?i.mozCancelFullScreen.bind(t):void 0)||(e?(r=at(e).webkitExitFullscreen)==null?void 0:r.bind(e):void 0)},ft=e=>!!ut(e),pt=e=>{var t;let n=st(e);return(t=n.requestPictureInPicture)==null?void 0:t.bind(n)},mt=(e=document)=>{var t;return(t=ot(e).exitPictureInPicture)==null?void 0:t.bind(e)},ht=(e=document)=>!!ot(e).pictureInPictureEnabled,gt=(e=document)=>!!ot(e).pictureInPictureElement,_t=(e,t=document)=>!!pt(e)&&ht(t),vt=e=>e.pictureInPictureWindow,yt=e=>st(e).webkitPresentationMode,bt=(e,t)=>{var n,r;(n=(r=st(e)).webkitSetPresentationMode)==null||n.call(r,t)},xt=e=>!!st(e).webkitSetPresentationMode,St=(e,t)=>{if(t){e.setAttribute(`autopictureinpicture`,``);return}e.removeAttribute(`autopictureinpicture`)},Ct=(e=screen)=>{var t;let n=ct(e);return n==null||(t=n.lock)==null?void 0:t.bind(n)},wt=(e,t=screen)=>{var n;return(n=Ct(t))==null?void 0:n(e)},Tt=(e=screen)=>{var t,n;(t=ct(e))==null||(n=t.unlock)==null||n.call(t)},Et=e=>{if(!e.supportsCanvasCaptureStream)return!1;if(!e.platform.isIOS)return!0;let{iosVersion:t,safariVersion:n,isIpadOS:r}=e.platform;return Number.isFinite(t)&&t!==2**53-1?t>=15:r&&Number.isFinite(n)&&n!==2**53-1?n>=15:typeof VideoDecoder<`u`}})),Ot,kt=n((()=>{h(),Ot=class{constructor(e,t,n){m(this,`onSuccess`,void 0),m(this,`onError`,void 0),m(this,`doExecute`,void 0),this.doExecute=e,this.onSuccess=t,this.onError=n}execute(e){try{this.doExecute(e),this.onSuccess()}catch(e){this.onError(e)}}}})),At,jt,Mt,Nt,Pt,Ft=n((()=>{At=e=>e.reduce((e,t)=>e+t,0)/e.length,jt=e=>{if(e.length<2)return;let t=0;for(let n=1;n<e.length;n++)t+=e[n]-e[n-1];return t/(e.length-1)},Mt=e=>{if(e.length===0)return NaN;let t=Math.floor(e.length/2),n=[...e].sort((e,t)=>e-t);return e.length%2==0?(n[t-1]+n[t])/2:n[t]},Nt=e=>({last:e[e.length-1]||0,average:e.length===0?0:At(e),max:e.length===0?0:Math.max(...e),min:e.length===0?0:Math.min(...e)}),Pt=e=>{let t=0,n=0,r=0,i=0,a=0;for(let o=0;o<e.length;o++){let{x:s,y:c}=e[o];t+=s,n+=c,r+=s*c,i+=s*s,a+=c*c}let o=(e.length*r-t*n)/(e.length*i-t*t),s=(n-o*t)/e.length;return{slope:o,intercept:s,r2:((e.length*r-t*n)/Math.sqrt((e.length*i-t*t)*(e.length*a-n*n)))**2,predict:t=>o*(e.length+t)+s}}})),It,Lt=n((()=>{ce(),Ft(),h(),It=class{constructor(e=10){m(this,`rates`,void 0),m(this,`_total`,0),m(this,`accumulatedValues`,0),m(this,`lastTickTime`,performance.now()),m(this,`add`,e=>{this.accumulatedValues+=e,this._total+=e}),m(this,`tick`,()=>{let e=performance.now(),t=this.accumulatedValues/((e-this.lastTickTime)/1e3);this.rates.push(t),this.accumulatedValues=0,this.lastTickTime=e}),this.rates=new w(e)}get total(){return this._total}get average(){return this.rates.isEmpty()?0:At(this.rates.items())}get minMaxAverage(){return Nt(this.rates.items())}}})),Rt,zt=n((()=>{Rt=5e3})),Bt=n((()=>{})),Vt,Ht=n((()=>{Vt=(e,t)=>{if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=0,r=0;for(let t in e)n+=1;for(let n in t)if(r+=1,!(n in e)||!Vt(e[n],t[n]))return!1;return n===r}})),Ut,Wt=n((()=>{h(),Ut=class{constructor(){m(this,`listeners`,{})}emit(e,t){let n=this.listeners[e];if(n){let r=!1;for(let e=0;e<n.length;e++)if(n[e].once){r=!0;break}r&&(this.listeners[e]=n.filter(e=>!e.once));let i,a=n.length;for(let e=0;e<a;e++){let r=n[e].fn(t);typeof r==`function`&&(i||(i=[]),i.push(r))}if(i)for(let e=0;e<i.length;e++)i[e]()}}off(e,t){let n=this.listeners[e];n&&(this.listeners[e]=n.filter(e=>e.fn!==t))}on(e,t){this.add(e,t,!1)}once(e,t){this.add(e,t,!0)}hasListeners(e){let t=this.listeners[e];return t!==void 0&&t.length>0}reset(){this.listeners={}}add(e,t,n){let r=this.listeners[e],i={fn:t,once:n};r?r.push(i):this.listeners[e]=[i]}}})),Gt=n((()=>{})),Kt,qt,Jt,Yt,Xt,Zt,Qt,$t=n((()=>{Kt=1e3,qt=Kt*1e3,Jt=qt*1e3,Yt=(e,t,n)=>e%t===0?e/t:(e/t).toFixed(n),Xt=(e,t=1)=>e>=Jt?`${Yt(e,Jt,t)} Gbit/s`:e>=qt?`${Yt(e,qt,t)} Mbit/s`:e>=Kt?`${Yt(e,Kt,t)} Kbit/s`:`${e} bit/s`,Zt=({width:e,height:t})=>`${e}x${t}`,Qt=e=>e%1e3==0?`${e/1e3} kHz`:e>1e3?`${(e/1e3).toFixed(1)} kHz`:`${e} Hz`})),en=n((()=>{})),tn,nn,rn,an,on,sn,cn,ln,un=n((()=>{E(),h(),A(),M(),tn=[`off`,`error`,`warn`,`info`,`debug`,`trace`],nn={ERROR:`error`,WARN:`warn`,INFO:`info`,DEBUG:`debug`,TRACE:`trace`,OFF:`off`},rn=new WeakMap,an=new WeakMap,on=new WeakMap,sn=new WeakMap,cn=class e{constructor({context:e,logLevel:t,debug:n}){T(this,rn,new Map),T(this,an,``),T(this,on,!1),T(this,sn,`off`),m(this,`trace`,(...e)=>{}),m(this,`debug`,(...e)=>{}),m(this,`info`,(...e)=>{}),m(this,`warn`,(...e)=>{}),m(this,`error`,(...e)=>{}),m(this,`table`,(...e)=>{}),m(this,`count`,(...e)=>{}),k(an,this,e),k(sn,this,t),k(on,this,n||!1),this.setLevel(t),this.setDebug(j(on,this))}setDebug(e){k(on,this,e);for(let[t,n]of j(rn,this))n.setDebug(e);e?(this.table=console.table.bind(console),this.count=console.count.bind(console)):(this.table=()=>{},this.count=()=>{})}setLevel(e){k(sn,this,e);for(let[t,n]of j(rn,this))n.setLevel(e);let t=tn.indexOf(e);for(let[e,n]of tn.entries())n!==`off`&&(e<=t?this[n]=console[n].bind(console,`%c%s %c%s`,`font-weight:bold;`,n.toUpperCase(),`font-weight:normal;`,j(an,this)):this[n]=()=>{})}createContext(t){let n=j(rn,this).get(t);if(!n){let n=new e({context:`${t}`,logLevel:j(sn,this),debug:j(on,this)});return j(rn,this).set(t,n),n}return n}static get(){return ln._||(ln._=new e({context:`Vindral`,logLevel:`off`})),ln._}},ln={_:void 0}}));function dn(){return typeof Symbol.asyncDispose!=`symbol`&&Object.defineProperty(Symbol,`asyncDispose`,{value:Symbol.for(`asyncDispose`)}),Symbol.asyncDispose}function fn(){return typeof Symbol.dispose!=`symbol`&&Object.defineProperty(Symbol,`dispose`,{value:Symbol.for(`dispose`)}),Symbol.dispose}var pn=n((()=>{}));function L(e,t){le(e,t),t.add(e)}var R=n((()=>{ue()}));function mn(){this.unlocker.resolve(this.value)}var hn,gn,_n,vn,yn,bn,xn,Sn=n((()=>{se(),oe(),pn(),R(),h(),O(),E(),M(),A(),P(),_n=new WeakSet,hn=fn(),gn=Symbol.dispose,vn=class{constructor(e,t){L(this,_n),m(this,`value`,void 0),m(this,`unlocker`,void 0),this.value=e,this.unlocker=t}unlocked(){var e;return(e=this.unlocker)==null?void 0:e.promise}[hn](){D(_n,this,mn).call(this)}[gn](){D(_n,this,mn).call(this)}},yn=new WeakMap,bn=new WeakMap,xn=class{unsafeValue(){return j(yn,this)}constructor(e){T(this,yn,void 0),T(this,bn,new C),k(yn,this,e),j(bn,this).resolve(e)}isLocked(){return j(bn,this).pending}lock(){var e=this;return N(function*(){let t=new C;t.promise.then(t=>{k(yn,e,t)}).catch(S);let n=j(bn,e).promise.then(()=>t);return k(bn,e,t),yield n,new vn(j(yn,e),t)})()}}}));function Cn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Cn(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var B=n((()=>{h()})),wn=n((()=>{})),Tn=n((()=>{})),En=n((()=>{}));function Dn(e,t){this.v=e,this.k=t}var On=n((()=>{}));function V(e){return new Dn(e,0)}var kn=n((()=>{On()}));function An(e){return function(){return new jn(e.apply(this,arguments))}}function jn(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Dn;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`?`return`:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(a.done?`return`:`normal`,n)},function(e){r(`throw`,e)})}catch(e){i(`throw`,e)}}function i(e,i){switch(e){case`return`:t.resolve({value:i,done:!0});break;case`throw`:t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}var Mn=n((()=>{On(),jn.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},jn.prototype.next=function(e){return this._invoke(`next`,e)},jn.prototype.throw=function(e){return this._invoke(`throw`,e)},jn.prototype.return=function(e){return this._invoke(`return`,e)}})),Nn,Pn,Fn,In,Ln=n((()=>{se(),E(),A(),M(),P(),kn(),Mn(),Pn=new WeakMap,Fn=new WeakMap,Nn=Symbol.asyncIterator,In=class{constructor(e){T(this,Pn,void 0),T(this,Fn,void 0),k(Pn,this,e),k(Fn,this,new C)}isClosed(){var e;return!((e=j(Fn,this))!=null&&e.pending)}current(){return j(Pn,this)}value(){var e;return[j(Pn,this),(e=j(Fn,this))==null?void 0:e.promise]}update(e){var t;if(!((t=j(Fn,this))!=null&&t.pending))throw Error(`ObservableValue is closed`);k(Pn,this,e instanceof Function?e(j(Pn,this)):e),j(Fn,this).resolve(j(Pn,this)),k(Fn,this,new C)}close(){var e;(e=j(Fn,this))==null||e.resolve(j(Pn,this)),k(Fn,this,void 0)}waitFor(e){var t=this;return N(function*(){if(e(j(Pn,t)))return j(Pn,t);for(;;){let[n,r]=t.value();if(!r)throw Error(`ObservableValue was closed while waiting for condition`);let i=yield r;if(e(i))return i}})()}[Nn](){var e=this;return An(function*(){for(;;){let[t,n]=e.value();if(yield t,!n)return;yield V(n)}})()}}})),Rn,zn=n((()=>{B(),Rn=(e,t)=>{let n=z({},e);return typeof n==`object`&&t.forEach(e=>{delete n[e]}),n}})),Bn=n((()=>{})),Vn,Hn,Un=n((()=>{h(),Hn=class{constructor(){m(this,`pendingTimeouts`,new Set),m(this,`pendingIntervals`,new Set),m(this,`clearTimeout`,e=>{this.pendingTimeouts.delete(e)&&window.clearTimeout(e)}),m(this,`clearInterval`,e=>{this.pendingIntervals.delete(e)&&window.clearInterval(e)}),m(this,`setTimeout`,(e,t,...n)=>{let r=window.setTimeout(()=>{e(...n),this.clearTimeout(r)},t);return this.pendingTimeouts.add(r),r}),m(this,`setInterval`,(e,t,...n)=>{let r=window.setInterval(()=>{e(...n)},t);return this.pendingIntervals.add(r),r}),m(this,`unload`,()=>{this.pendingIntervals.forEach(this.clearInterval),this.pendingTimeouts.forEach(this.clearTimeout)})}},Vn=Hn,m(Hn,`create`,()=>new Vn)})),Wn,Gn,Kn,qn,Jn=n((()=>{Wn=(e,t=performance.now())=>{let n=e.length;if(n>0){let r=e[n-1];r.end||(r.end=t)}},Gn=(e,t=performance.now())=>{Wn(e,t),e.push({start:t})},Kn=e=>e.reduce((e,t)=>{var n;return e+(((n=t.end)==null?performance.now():n)-t.start)},0),qn=(e,t,n=performance.now())=>e.reduce((e,r)=>{var i;let a=Math.max(n-t,r.start),o=(i=r.end)==null?n:i;return Math.max(0,o-a)+e},0)}));function Yn(e){try{return e()}catch(e){return e}}var Xn=n((()=>{})),Zn,Qn=n((()=>{Zn=e=>{try{return JSON.parse(e)}catch(e){return}}})),$n=n((()=>{})),er,tr=n((()=>{oe(),h(),B(),er=class{constructor(){var e;m(this,`highEntropyValues`,void 0),(e=self.navigator.userAgentData)==null||e.getHighEntropyValues([`architecture`,`model`,`platformVersion`,`fullVersionList`]).then(e=>{this.highEntropyValues=e}).catch(S)}getUserAgentInformation(){var e;let t=window.location.origin,n=!t||t===`null`?``:`${window.location.pathname}${window.location.search}`.substring(0,1e3),r={locationOrigin:window.location.origin,locationPath:n,ancestorOrigins:((e=window.location.ancestorOrigins)==null?void 0:e.length)>0?Array.from(window.location.ancestorOrigins):void 0,hardwareConcurrency:navigator.hardwareConcurrency,deviceMemory:navigator.deviceMemory};if(self.navigator.userAgentData&&this.highEntropyValues){var i,a,o,s,c;let e=[...(i=this.highEntropyValues.brands)==null?[]:i];e.sort((e,t)=>e.brand.localeCompare(t.brand));let t=[...(a=this.highEntropyValues.fullVersionList)==null?[]:a];t.sort((e,t)=>e.brand.localeCompare(t.brand));let n=t.map(e=>e.version),l=e.map(e=>e.brand),u=e.map(e=>e.version),d=parseInt((o=(s=this.highEntropyValues.platformVersion)==null?void 0:s.split(`.`)[0])==null?`1`:o,10);return z({userAgentLegacy:window.navigator.userAgent,ua:{browser:{brands:l,fullVersionBrands:n,majorVersions:u},device:this.highEntropyValues.model||`Other`,os:{family:this.highEntropyValues.platform||`Other`,version:(c=this.highEntropyValues.platformVersion)==null?`1`:c,major_version:Number.isFinite(d)?d:0}}},r)}else return z({userAgent:window.navigator.userAgent},r)}}})),nr,rr=n((()=>{nr=()=>{let e=[...Array(256).keys()].map(e=>e.toString(16).padStart(2,`0`)),t=crypto.getRandomValues(new Uint8Array(16));return t[6]=t[6]&15|64,t[8]=t[8]&63|128,[...t.entries()].map(([t,n])=>[4,6,8,10].includes(t)?`-${e[n]}`:e[n]).join(``)}})),ir,ar,or=n((()=>{P(),ir=function(){var e=N(function*(e){return new Promise(t=>setTimeout(t,e))});return function(t){return e.apply(this,arguments)}}(),ar=function(){var e=N(function*(e,t=Error(`Timeout`)){return new Promise((n,r)=>setTimeout(()=>r(t),e))});return function(t){return e.apply(this,arguments)}}(),function(){var e=N(function*(e,t){throw yield e,Error(t)});return function(t,n){return e.apply(this,arguments)}}()})),H=n((()=>{ae(),ye(),xe(),Ce(),Oe(),Pe(),Ie(),Re(),rt(),rt(),Dt(),Ae(),kt(),Lt(),zt(),se(),Bt(),Ht(),Wt(),ce(),Gt(),$t(),en(),Be(),un(),Sn(),wn(),Tn(),En(),oe(),Ln(),zn(),Bn(),Ft(),pn(),Un(),Jn(),Xn(),Qn(),$n(),tr(),rr(),or()}));H(),h(),P();var sr=class extends Ut{constructor(e){super(),m(this,`config`,void 0),m(this,`hlsUrl`,void 0),m(this,`element`,void 0),m(this,`connectingTimeout`,void 0),m(this,`castingAvailable`,!1),m(this,`updateAuthenticationToken`,e=>{this.config.authenticationToken=e,this.hlsUrl=this.getHlsUrl(),this.castingAvailable&&(this.element.src=this.hlsUrl)}),m(this,`unload`,()=>{this.element&&(this.element.removeEventListener(`webkitplaybacktargetavailabilitychanged`,this.onAirPlayAvailable),this.element.removeEventListener(`webkitcurrentplaybacktargetiswirelesschanged`,this.onAirPlayPlaybackChanged),this.element.remove())}),m(this,`onAirPlayAvailable`,e=>{switch(e.availability){case`available`:this.castingAvailable=!0,this.element.src!==this.hlsUrl&&this.checkHlsUrl(this.hlsUrl).then(e=>{e&&(this.element.src=this.hlsUrl,this.emit(`available`))});break;case`not-available`:this.castingAvailable=!1;break;default:break}}),m(this,`onAirPlayPlaybackChanged`,()=>{window.clearTimeout(this.connectingTimeout),this.element.webkitCurrentPlaybackTargetIsWireless?(this.emit(`connected`),this.element.style.display=`block`,this.element.paused&&this.element.play().catch(S)):(this.emit(`disconnected`),this.element.pause(),this.element.src=``,this.element.src=this.hlsUrl,this.element.style.display=`none`)}),this.config=e,this.hlsUrl=this.getHlsUrl(),this.element=document.createElement(`video`),this.element.style.position=`absolute`,this.element.style.top=`0`,this.element.style.bottom=`0`,this.element.style.left=`0`,this.element.style.right=`0`,this.element.style.width=`100%`,this.element.style.height=`100%`,this.element.style.zIndex=`1001`,this.element.style.display=`none`,this.element.id=`vindral-airplay-element`,this.element.slot=`overlay`,this.element.playsInline=!0,this.element.controls=!0,this.element.preload=`metadata`,this.element.addEventListener(`webkitplaybacktargetavailabilitychanged`,this.onAirPlayAvailable),this.element.addEventListener(`webkitcurrentplaybacktargetiswirelesschanged`,this.onAirPlayPlaybackChanged),this.config.container.appendChild(this.element)}get casting(){return this.element.webkitCurrentPlaybackTargetIsWireless}set channelId(e){}showPlaybackTargetPicker(){`webkitShowPlaybackTargetPicker`in this.element&&this.castingAvailable&&(this.element.paused&&(this.element.play().catch(S),this.connectingTimeout=window.setTimeout(()=>{this.casting||(this.element.pause(),this.element.src=``,this.element.src=this.hlsUrl)},3e4)),this.element.webkitShowPlaybackTargetPicker())}static isAirPlaySupported(){return!!window.WebKitPlaybackTargetAvailabilityEvent}getHlsUrl(){let e=new URL(`/api/hls?channelId=${this.config.channelId}`,this.config.url);return this.config.authenticationToken&&e.searchParams.set(`authenticationToken`,this.config.authenticationToken),e.toString()}checkHlsUrl(e){return N(function*(){try{return(yield fetch(e,{method:`HEAD`})).ok}catch(e){return!1}})()}};H(),h(),P();var cr=class extends Ut{constructor(e){var t;super(),t=this,m(this,`state`,`not casting`),m(this,`config`,void 0),m(this,`unloaded`,!1),m(this,`updateAuthenticationToken`,e=>{this.config&&(this.config.options.authenticationToken=e,this.send({type:`updateAuthToken`,token:e}))}),m(this,`unload`,()=>{var e;this.unloaded=!0,(e=this.getSession())==null||e.removeMessageListener(`urn:x-cast:com.vindral.castdata`,this.onMessage)}),m(this,`init`,N(function*(){return new Promise((e,n)=>{let r=!1,i=setTimeout(()=>{r=!0,n()},1e4);window.__onGCastApiAvailable=a=>{if(r){r=!1;return}if(clearTimeout(i),!a)return n();setTimeout(()=>{try{t.onGCastApiAvailable(),e()}catch(e){n()}},1e3)},t.castLibrariesAdded()&&window.cast?window.__onGCastApiAvailable(!0):t.verifyCastLibraries()})})),m(this,`start`,N(function*(){var e;yield(e=t.getInstance())==null?void 0:e.requestSession()})),m(this,`stop`,()=>{var e;(e=this.getSession())==null||e.endSession(!0)}),m(this,`getReceiverName`,()=>{var e;return((e=this.getSession())==null||(e=e.getCastDevice())==null?void 0:e.friendlyName)||void 0}),m(this,`onGCastApiAvailable`,()=>{var e;let t=this.getInstance();if(!t)throw`cast context should exist`;let n=t.getSessionState(),r=((e=this.config)==null?void 0:e.receiverApplicationId)||void 0;t.setOptions({receiverApplicationId:r,autoJoinPolicy:chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,resumeSavedSession:!0}),t.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.onSessionStateChanged),n===cast.framework.SessionState.SESSION_STARTED&&setTimeout(()=>{this.state=`casting`,this.emit(`resumed`)})}),m(this,`send`,e=>{var t;(t=this.getSession())==null||t.sendMessage(`urn:x-cast:com.vindral.castdata`,e)}),m(this,`onMessage`,(e,t)=>{if(e===`urn:x-cast:com.vindral.castdata`)try{let e=JSON.parse(t);switch(e.type){case`metadata`:this.emit(`metadata`,e.metadata);break;case`serverWallclockTime`:this.emit(`server wallclock time`,e.serverWallclockTime);break;default:break}}catch(e){}}),m(this,`onSessionStarted`,()=>{var e;(e=this.getSession())==null||e.addMessageListener(`urn:x-cast:com.vindral.castdata`,this.onMessage),this.send({type:`start`,config:this.config})}),m(this,`onSessionStateChanged`,e=>{if(!this.unloaded)switch(e.sessionState){case cast.framework.SessionState.SESSION_START_FAILED:this.state=`not casting`,this.emit(`failed`);break;case cast.framework.SessionState.SESSION_ENDED:this.state=`not casting`,this.emit(`disconnected`);break;case cast.framework.SessionState.SESSION_ENDING:break;case cast.framework.SessionState.SESSION_RESUMED:this.onSessionStarted(),this.state=`casting`,this.emit(`resumed`);break;case cast.framework.SessionState.SESSION_STARTED:this.onSessionStarted(),this.state=`casting`,this.emit(`connected`);break;case cast.framework.SessionState.SESSION_STARTING:break;default:break}}),m(this,`getInstance`,()=>{var e;return(e=window.cast)==null?void 0:e.framework.CastContext.getInstance()}),m(this,`getSession`,()=>{var e;return(e=this.getInstance())==null?void 0:e.getCurrentSession()}),m(this,`castLibrariesAdded`,()=>!!(document.querySelector(`#vindralCastFrameworkLib`)&&document.querySelector(`#vindralCastSenderLib`))),m(this,`verifyCastLibraries`,()=>{if(this.castLibrariesAdded())return;let e=document.createElement(`script`);e.type=`text/javascript`,e.id=`vindralCastFrameworkLib`,e.src=`//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js`,document.head.appendChild(e);let t=document.createElement(`script`);t.type=`text/javascript`,t.id=`vindralCastSenderLib`,t.src=`//www.gstatic.com/cv/js/sender/v1/cast_sender.js`,document.head.appendChild(t)}),this.config=e}get casting(){return this.state===`casting`}get volume(){var e,t;return(e=(t=this.getSession())==null?void 0:t.getVolume())==null?0:e}set volume(e){var t;(t=this.getSession())==null||t.setVolume(e)}get language(){var e;return(e=this.config)==null||(e=e.options)==null?void 0:e.language}set language(e){this.config&&(this.config.options.language=e,this.send({type:`setLanguage`,language:e}))}get channelId(){var e;return((e=this.config)==null?void 0:e.options.channelId)||``}set channelId(e){this.config&&(this.config.options.channelId=e,this.send({type:`setChannelId`,channelId:e}))}},lr=e=>{switch(e){case`h264`:case`h265`:case`av1`:return`video`;case`aac`:case`opus`:case`mp3`:return`audio`;case`webvtt`:return`text`;default:throw Error(`Unknown codec`)}};function ur(e){if(e.startsWith(`opus`))return`opus`;if(e.startsWith(`mp4a`))return`aac`;if(e.startsWith(`avc1`))return`h264`;if(e.startsWith(`hvc1`)||e.startsWith(`hev1`))return`h265`;if(e.startsWith(`av01`))return`av1`;if(e.startsWith(`webvtt`))return`webvtt`}H();function dr(e){return!(typeof e.edges[0]==`string`||e.channels[0]&&!(`catalog`in e.channels[0]))}function fr(e){return e.tracks.filter(e=>!!e.codec).filter(e=>ur(e.codec||``)).map((e,t)=>{let n=e.codec,r=e.bitrate;be(n,`codec is required`),be(r!==void 0,`bitrate is required`);let i=ur(n);if(be(i,`codec is required`),lr(i)===`audio`){let a=e.samplerate||0;return{track:e,id:t,codec:i,codecString:n,bitRate:r,channels:e.channelConfig===`stereo`?2:1,sampleRate:a,language:e.language}}return lr(i)===`text`?{track:e,id:t,bitRate:0,codec:i,kind:`subtitles`,codecString:n,label:e.label,language:e.language}:(be(e.width,`width is required`),be(e.height,`width is required`),be(e.framerate,`framerate is required`),{track:e,id:t,codec:i,bitRate:r,codecString:n,width:e.width,height:e.height,frameRate:e.framerate})}).sort((e,t)=>e.bitRate-t.bitRate)}var pr=e=>`width`in e&&typeof e.width==`number`,mr=e=>`sampleRate`in e&&typeof e.sampleRate==`number`,hr=e=>{switch(e.codec){case`opus`:return`audio/mp4; codecs="opus"`;case`mp3`:return`audio/mpeg`;case`webvtt`:return`text/vtt`;case`aac`:return e.codecString?`audio/mp4; codecs="${e.codecString}"`:`audio/mp4`;case`h264`:case`h265`:return e.codecString?`video/mp4; codecs="${e.codecString}"`:`video/mp4`;case`av1`:return e.codecString?`video/mp4; codecs="${e.codecString}"`:`video/mp4`}},gr=()=>2**53-1,_r=()=>({width:2**53-1,height:2**53-1}),vr=e=>!(typeof e!=`object`||!e||!(`type`in e));H();var yr={sizeBasedResolutionCapEnabled:!0,pictureInPictureEnabled:!0,abrEnabled:!0,burstEnabled:!1,mseEnabled:!0,mseOpusEnabled:!0,muted:!1,volume:1,minBufferTime:1500,maxBufferTime:1500,logLevel:nn.OFF,maxSize:_r(),maxVideoBitRate:gr(),maxAudioBitRate:gr(),maxInitialBitRate:2.5*1e3*1e3,tags:[],media:`audio+video`,poster:!0,reconnectHandler:e=>e.reconnectRetries<30,iosWakeLockEnabled:!1,telemetryEnabled:!0,streamToMediaElementEnabled:!1,iosMediaElementEnabled:!1,pauseSupportEnabled:!0,webcodecsHardwareAcceleration:`no-preference`,offscreenCanvasEnabled:void 0,advanced:{},videoCodecs:[`av1`,`h264`,`h265`],webtransportEnabled:!0};function br(e){return typeof e==`function`?this.then(t=>Promise.resolve(e()).then(()=>t),t=>Promise.resolve(e()).then(()=>{throw t})):this.then()}function xr(e=Promise){return typeof e.prototype.finally!=`function`&&Object.defineProperty(e.prototype,`finally`,{configurable:!0,enumerable:!1,value:br,writable:!0}),e.prototype.finally}xr();var Sr=e=>{e.width=320,e.height=180,e.style.width=`100%`,e.style.position=`relative`,e.style.backgroundColor=`#000`};R(),E(),h(),B(),M(),A(),O();var Cr={backgroundColor:`rgba(0,0,0,0.6)`,textPadding:8,fontSize:`28px`,lineGap:16},wr=new WeakMap,Tr=new WeakMap,Er=new WeakMap,Dr=new WeakMap,Or=new WeakSet,kr=class{constructor(){L(this,Or),T(this,wr,[]),T(this,Tr,document.createElement(`canvas`)),T(this,Er,void 0),T(this,Dr,window.devicePixelRatio||1),m(this,`config`,z({},Cr));let e=j(Tr,this).getContext(`2d`,{alpha:!0});if(!e)throw Error(`Failed to create 2d context`);k(Er,this,e),D(Or,this,jr).call(this)}get canvas(){return j(Tr,this)}setActiveCues(e){k(wr,this,e)}render(e,t=!1){let n=j(wr,this).flatMap(t=>t.text.split(`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Vindral={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,t)=>()=>(e&&(t=e(e=0)),t),r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},i=`_buffering_1ccif_1`,a=`_hidden_1ccif_25`,o=`_scaleout_1ccif_1`,s={buffering:i,"buffering-fullscreen":`_buffering-fullscreen_1ccif_16`,hidden:a,"buffering-indicator":`_buffering-indicator_1ccif_31`,scaleout:o};function c(e){"@babel/helpers - typeof";return c=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},c(e)}var l=n((()=>{}));function u(e,t){if(c(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(c(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var d=n((()=>{l()}));function f(e){var t=u(e,`string`);return c(t)==`symbol`?t:t+``}var p=n((()=>{l(),d()}));function m(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=n((()=>{p()}));h();var g=class{constructor(e){m(this,`attach`,e=>{this.detach(),e.appendChild(this.element)}),m(this,`attachBefore`,(e,t)=>{this.detach(),e.insertBefore(this.element,t)}),m(this,`detach`,()=>this.element.remove()),this.element=e}};h();var _,v,y,b,x=(_=s.hidden)==null?``:_,ee=(v=s.buffering)==null?``:v,te=(y=s[`buffering-fullscreen`])==null?``:y,ne=(b=s[`buffering-indicator`])==null?``:b,re=class extends g{constructor(){super(document.createElement(`div`)),m(this,`indicator`,document.createElement(`div`)),m(this,`isHidden`,()=>this.element.classList.contains(x)),m(this,`setHidden`,e=>e?this.hide():this.show()),m(this,`hide`,()=>this.element.classList.add(x)),m(this,`show`,()=>this.element.classList.remove(x)),m(this,`fullscreen`,e=>{e?this.element.classList.add(te):this.element.classList.remove(te)}),this.element.className=ee,this.indicator.className=ne,this.element.appendChild(this.indicator)}},ie,ae=n((()=>{h(),ie=class{constructor(e){m(this,`maxSize`,0),m(this,`size`,0),m(this,`buffers`,[]),m(this,`_borrowedBuffers`,0),m(this,`get`,e=>{let t=this.buffers.pop();return this._borrowedBuffers++,this.size<e||!t?(this.buffers=[],this.size=e,new ArrayBuffer(e)):t}),m(this,`reclaim`,e=>{this._borrowedBuffers=Math.max(0,this._borrowedBuffers-1),!(e.byteLength<this.size)&&(this.buffers.length>=this.maxSize||this.buffers.push(e))}),this.maxSize=e}get bufferSize(){return this.size}get poolSize(){return this.buffers.length}get borrowedBuffers(){return this._borrowedBuffers}}})),S,oe=n((()=>{S=()=>{}})),C,se=n((()=>{oe(),h(),C=class e{constructor(){m(this,`promise`,void 0),m(this,`resolved`,void 0),m(this,`resolve`,void 0),m(this,`reject`,void 0),m(this,`pending`,!0),this.promise=new Promise((e,t)=>{this.resolve=t=>{this.pending=!1,this.resolved=t,e(t)},this.reject=e=>{this.pending=!1,t(e)}}),this.promise.catch(S)}static resolved(t){let n=new e;return n.resolve(t),n}static fromPromise(t){let n=new e;return n.promise=t,t.then(e=>{n.pending=!1,n.resolved=e},e=>{n.pending=!1,n.reject(e)}),n}}})),w,ce=n((()=>{h(),w=class{constructor(e=50){m(this,`maxSize`,void 0),m(this,`values`,[]),m(this,`start`,0),m(this,`size`,()=>this.values.length-this.start),m(this,`compact`,()=>{if(this.start!==0){if(this.start>=this.values.length){this.values=[],this.start=0;return}this.start<32&&this.start*2<this.values.length||(this.values=this.values.slice(this.start),this.start=0)}}),m(this,`push`,e=>{this.isFull()&&(this.start++,this.compact()),this.values.push(e)}),m(this,`clear`,()=>{this.values=[],this.start=0}),m(this,`pop`,()=>{if(this.isEmpty())return;let e=this.values[this.start];return this.start++,this.compact(),e}),m(this,`popLast`,()=>{if(this.isEmpty())return;let e=this.values.pop();return this.start>=this.values.length&&this.clear(),e}),m(this,`peekFirst`,()=>this.isEmpty()?void 0:this.values[this.start]),m(this,`peekLast`,()=>this.isEmpty()?void 0:this.values[this.values.length-1]),m(this,`isFull`,()=>this.size()>=this.maxSize),m(this,`isEmpty`,()=>this.size()===0),m(this,`items`,()=>this.start===0?this.values:this.values.slice(this.start)),m(this,`filterPop`,e=>{for(;!this.isEmpty();){let t=this.peekFirst();if(t===void 0||e(t))return;this.pop()}}),this.maxSize=e}}}));function le(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}var ue=n((()=>{}));function T(e,t,n){le(e,t),t.set(e,n)}var E=n((()=>{ue()}));function D(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}var O=n((()=>{}));function k(e,t,n){return e.set(D(e,t),n),n}var A=n((()=>{O()}));function j(e,t){return e.get(D(e,t))}var M=n((()=>{O()}));function de(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function N(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){de(a,r,i,o,s,`next`,e)}function s(e){de(a,r,i,o,s,`throw`,e)}o(void 0)})}}var P=n((()=>{}));function fe(e){let t=new ve(e);return[t,t]}var pe,me,he,ge,_e,ve,ye=n((()=>{se(),ce(),oe(),E(),A(),M(),P(),me=new WeakMap,he=new WeakMap,ge=new WeakMap,_e=new WeakMap,pe=Symbol.asyncIterator,ve=class{constructor(e){T(this,me,void 0),T(this,he,new C),T(this,ge,void 0),T(this,_e,!1),k(me,this,new w(e))}isFull(){return j(me,this).isFull()}close(){var e;(e=j(ge,this))==null||e.resolve(),k(_e,this,!0)}abort(e){var t,n;(t=j(ge,this))==null||t.promise.catch(S),(n=j(ge,this))==null||n.reject(e)}push(e){var t=this;return N(function*(){var n;j(me,t).isFull()&&(yield j(he,t).promise),j(me,t).push(e),(n=j(ge,t))==null||n.resolve(),k(ge,t,new C)})()}pop(){var e=this;return N(function*(){for(;!(j(_e,e)&&j(me,e).isEmpty());){var t;let n=j(me,e).pop();if(n)return j(he,e).resolve(),k(he,e,new C),n;j(ge,e)||k(ge,e,new C),yield(t=j(ge,e))==null?void 0:t.promise}})()}start(e){}pull(e){var t=this;return N(function*(){let n=yield t.pop();n?e.enqueue(n):e.close()})()}cancel(e){this.abort(Error(e))}next(){var e=this;return N(function*(){let t=yield e.pop().catch(()=>void 0);return t?{done:!1,value:t}:{done:!0,value:void 0}})()}return(){return this.close(),Promise.resolve({done:!0,value:void 0})}[pe](){return this}}}));function be(e,t){if(!e)throw Error(t)}var xe=n((()=>{}));function F(e){return Se?BigInt(e):typeof BigInt==`function`&&typeof e==`bigint`?Number(e):e}var Se,Ce=n((()=>{Se=typeof DataView.prototype.getBigUint64==`function`})),we,Te,Ee,De,Oe=n((()=>{E(),h(),M(),A(),we=new WeakMap,Te=new WeakMap,Ee=new WeakMap,De=class{constructor(e,t=0){T(this,we,void 0),T(this,Te,void 0),T(this,Ee,void 0),m(this,`position`,()=>j(Ee,this)),m(this,`peekBit`,()=>this.getBit(j(Te,this),j(Ee,this))),m(this,`readBit`,()=>{var e;let t=this.peekBit();return k(Ee,this,(e=j(Ee,this),e++,e)),t}),m(this,`readBits`,e=>{let t=0;for(let i=0;i<e;i++){var n,r;t=t<<1|(this.getBit(j(Te,this),(k(Ee,this,(n=j(Ee,this),r=n++,n)),r))?1:0)}return t}),m(this,`remainingBits`,()=>j(Te,this).byteLength*8-j(Ee,this)),m(this,`readSignedExpGolomb`,()=>{let e=this.readUnsignedExpGolomb();return e&1?(e+1)/2:-(e/2)}),m(this,`readUnsignedExpGolomb`,()=>{var e,t;let n=0;for(;this.getBit(j(Te,this),(k(Ee,this,(e=j(Ee,this),t=e++,e)),t))===0;)n++;let r=1<<n;for(let e=n-1;e>=0;e--){var i,a;r|=this.getBit(j(Te,this),(k(Ee,this,(i=j(Ee,this),a=i++,i)),a))<<e}return r-1}),m(this,`getBit`,(e,t)=>{if(e.byteLength*8<=t)throw Error(`BitReader: Out of bounds`);return e[t>>3]>>7-(t&7)&1}),k(we,this,e),k(Te,this,new Uint8Array(j(we,this))),k(Ee,this,t)}bytes(){return j(Te,this)}}})),ke,Ae=n((()=>{ke=(e,t,n)=>{let r=0;for(let i=t;i<=n;i++)if(i===t){let t=e[i];r+=t&127,t&128&&(r-=128)}else r=r*256+e[i];return r}})),I,je,Me,Ne,Pe=n((()=>{Ae(),E(),A(),M(),I=new WeakMap,je=new WeakMap,Me=new WeakMap,Ne=class{constructor(e){T(this,I,void 0),T(this,je,void 0),T(this,Me,void 0),k(je,this,e),k(Me,this,new DataView(e.buffer,e.byteOffset,e.byteLength)),k(I,this,0)}position(){return j(I,this)}byteOffset(){return j(je,this).byteOffset+j(I,this)}buffer(){return j(je,this)}remaining(){return j(je,this).length-j(I,this)}readUint8(){let e=j(Me,this).getUint8(j(I,this));return k(I,this,j(I,this)+1),e}readUint24(){let e=j(Me,this).getUint32(j(I,this))>>8&16777215;return k(I,this,j(I,this)+3),e}readUint16(){let e=j(Me,this).getUint16(j(I,this));return k(I,this,j(I,this)+2),e}readUint32(){let e=j(Me,this).getUint32(j(I,this));return k(I,this,j(I,this)+4),e}readUint64(){let e=ke(j(je,this),j(I,this),j(I,this)+7);return k(I,this,j(I,this)+8),e}readBytes(e){let t=j(je,this).subarray(j(I,this),j(I,this)+e);return k(I,this,j(I,this)+e),t}readRemaining(){return this.readBytes(this.remaining())}readUtf8String(){let e=[],t;for(;(t=this.readUint8())!==0&&(e.push(t),this.remaining()!==0););return new TextDecoder().decode(new Uint8Array(e))}}})),Fe,Ie=n((()=>{h(),Fe=class{constructor(e=100){m(this,`internalBuffer`,void 0),m(this,`view`,void 0),m(this,`uint8`,void 0),m(this,`_position`,0),m(this,`_end`,0),this.internalBuffer=new ArrayBuffer(e),this.view=new DataView(this.internalBuffer),this.uint8=new Uint8Array(this.internalBuffer)}position(){return this._position}seek(e){this._position=Math.max(0,Math.min(this._end,e))}seekToEnd(){this._position=this._end}writeUint8(e){this.writeAndMove(e,1)}writeUint16(e){this.writeAndMove(e,2)}writeUint24(e){this.writeAndMove(e,3)}writeUint32(e){this.writeAndMove(e,4)}writeUint64(e){let t=Math.floor(e/4294967296),n=(e&4294967295)>>>0;this.writeUint32(t),this.writeUint32(n)}writeUint32At(e,t){this.view.setUint32(e,t)}writeBytes(e){this.resizeIfNeeded(this.position()+e.byteLength),this.uint8.set(e,this.position()),this._position+=e.byteLength,this._end=Math.max(this._end,this._position)}buffer(){return this.internalBuffer.slice(0,this._end)}bufferExact(){return this._end===this.internalBuffer.byteLength?this.internalBuffer:this.internalBuffer.slice(0,this._end)}write(e,t){switch(this.resizeIfNeeded(this.position()+t),t){case 1:this.view.setUint8(this.position(),e);break;case 2:this.view.setUint16(this.position(),e);break;case 3:this.view.setUint8(this.position(),e>>16&255),this.view.setUint8(this.position()+1,e>>8&255),this.view.setUint8(this.position()+2,e&255);break;case 4:this.view.setUint32(this.position(),e);break}}writeAndMove(e,t){this.write(e,t),this._position+=t,this._end=Math.max(this._end,this._position)}resizeIfNeeded(e){if(e>this.internalBuffer.byteLength){let t=Math.max(e,this.internalBuffer.byteLength*2),n=new ArrayBuffer(t),r=new Uint8Array(n);r.set(this.uint8),this.internalBuffer=n,this.view=new DataView(this.internalBuffer),this.uint8=r}}}}));function Le(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}var Re=n((()=>{}));function ze(){let e=self.MediaSource,t=self.ManagedMediaSource;return e==null?t:e}var Be=n((()=>{}));function Ve(){if(/(iPhone|iPod|iPad)/i.test(We)){var e;return We==null||(e=We.match(/OS [\d_]+/i))==null||(e=e[0])==null?void 0:e.substring(3).split(`_`).map(e=>parseInt(e,10))[0]}}function He(){if(/^((?!chrome|android).)*safari/i.test(We)){var e;return(e=We.match(/version\/([\d.]+)/))==null||(e=e[1])==null?void 0:e.split(`.`).map(e=>parseInt(e,10))[0]}}var Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt=n((()=>{Be(),Ue=/(android|bbd+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows ce|xda|xiino\/i.test(a)||\/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-\//i,We=navigator.userAgent.toLowerCase(),Ge=Ue.test(We),Ke=()=>{let e=document.createElement(`video`);return e.canPlayType(`application/vnd.apple.mpegURL`)!==``||e.canPlayType(`audio/mpegurl`)!==``},qe=()=>{try{if(typeof WebAssembly==`object`&&typeof WebAssembly.instantiate==`function`){let e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){return!1}return!1},Je=()=>We.indexOf(`CrKey`)!==-1,Ye=()=>navigator.platform===`MacIntel`&&navigator.maxTouchPoints===0,Xe=()=>navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1,Ze=()=>Qe()||Xe()?!0:/AppleWebKit/i.test(navigator.userAgent)&&!/Chrome|Chromium|Edg|OPR|Opera/i.test(navigator.userAgent),Qe=()=>We.indexOf(`iphone`)>=0&&We.indexOf(`like iphone`)<0||We.indexOf(`ipad`)>=0&&We.indexOf(`like ipad`)<0||We.indexOf(`ipod`)>=0&&We.indexOf(`like ipod`)<0||Xe(),$e=()=>{var e,t;return Xe()||(e=(t=ze())==null?void 0:t.isTypeSupported(`audio/mp4; codecs="opus"`))==null?!1:e},et=()=>/^(?!.*chrome).*safari/i.test(We),tt=()=>typeof HTMLCanvasElement<`u`&&typeof HTMLCanvasElement.prototype.captureStream==`function`,nt=()=>{var e,t;let n=!!ze(),r=!1;return n&&(r=$e()),{isMobile:Ge,supportsMp4Opus:r,supportsMediaSource:n,supportsHls:Ke(),supportsWebAssembly:qe(),supportsCanvasCaptureStream:tt(),platform:{iosVersion:(e=Ve())==null?2**53-1:e,safariVersion:(t=He())==null?2**53-1:t,isIpadOS:Xe(),isMacOS:Ye(),isIOS:Qe(),isWebKit:Ze()}}}})),it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt=n((()=>{it=e=>e,at=e=>e,ot=e=>e,st=e=>e,ct=e=>`orientation`in e?e.orientation:void 0,lt=(e=document)=>{let t=it(e);return!!(e.fullscreenElement||e.fullscreen||t.mozFullScreen||t.webkitIsFullScreen)},ut=e=>{var t,n,r,i;let a=at(e);return((t=e.requestFullscreen)==null?void 0:t.bind(e))||((n=a.webkitRequestFullscreen)==null?void 0:n.bind(a))||((r=a.webkitEnterFullscreen)==null?void 0:r.bind(a))||((i=a.mozRequestFullScreen)==null?void 0:i.bind(a))},dt=(e,t=document)=>{var n,r;let i=it(t);return((n=t.exitFullscreen)==null?void 0:n.bind(t))||(i.webkitFullscreenElement&&i.webkitExitFullscreen?i.webkitExitFullscreen.bind(t):void 0)||(i.mozFullscreenElement&&i.mozCancelFullScreen?i.mozCancelFullScreen.bind(t):void 0)||(e?(r=at(e).webkitExitFullscreen)==null?void 0:r.bind(e):void 0)},ft=e=>!!ut(e),pt=e=>{var t;let n=st(e);return(t=n.requestPictureInPicture)==null?void 0:t.bind(n)},mt=(e=document)=>{var t;return(t=ot(e).exitPictureInPicture)==null?void 0:t.bind(e)},ht=(e=document)=>!!ot(e).pictureInPictureEnabled,gt=(e=document)=>!!ot(e).pictureInPictureElement,_t=(e,t=document)=>!!pt(e)&&ht(t),vt=e=>e.pictureInPictureWindow,yt=e=>st(e).webkitPresentationMode,bt=(e,t)=>{var n,r;(n=(r=st(e)).webkitSetPresentationMode)==null||n.call(r,t)},xt=e=>!!st(e).webkitSetPresentationMode,St=(e,t)=>{if(t){e.setAttribute(`autopictureinpicture`,``);return}e.removeAttribute(`autopictureinpicture`)},Ct=(e=screen)=>{var t;let n=ct(e);return n==null||(t=n.lock)==null?void 0:t.bind(n)},wt=(e,t=screen)=>{var n;return(n=Ct(t))==null?void 0:n(e)},Tt=(e=screen)=>{var t,n;(t=ct(e))==null||(n=t.unlock)==null||n.call(t)},Et=e=>{if(!e.supportsCanvasCaptureStream)return!1;if(!e.platform.isIOS)return!0;let{iosVersion:t,safariVersion:n,isIpadOS:r}=e.platform;return Number.isFinite(t)&&t!==2**53-1?t>=15:r&&Number.isFinite(n)&&n!==2**53-1?n>=15:typeof VideoDecoder<`u`}})),Ot,kt=n((()=>{h(),Ot=class{constructor(e,t,n){m(this,`onSuccess`,void 0),m(this,`onError`,void 0),m(this,`doExecute`,void 0),this.doExecute=e,this.onSuccess=t,this.onError=n}execute(e){try{this.doExecute(e),this.onSuccess()}catch(e){this.onError(e)}}}})),At,jt,Mt,Nt,Pt,Ft=n((()=>{At=e=>e.reduce((e,t)=>e+t,0)/e.length,jt=e=>{if(e.length<2)return;let t=0;for(let n=1;n<e.length;n++)t+=e[n]-e[n-1];return t/(e.length-1)},Mt=e=>{if(e.length===0)return NaN;let t=Math.floor(e.length/2),n=[...e].sort((e,t)=>e-t);return e.length%2==0?(n[t-1]+n[t])/2:n[t]},Nt=e=>({last:e[e.length-1]||0,average:e.length===0?0:At(e),max:e.length===0?0:Math.max(...e),min:e.length===0?0:Math.min(...e)}),Pt=e=>{let t=0,n=0,r=0,i=0,a=0;for(let o=0;o<e.length;o++){let{x:s,y:c}=e[o];t+=s,n+=c,r+=s*c,i+=s*s,a+=c*c}let o=(e.length*r-t*n)/(e.length*i-t*t),s=(n-o*t)/e.length;return{slope:o,intercept:s,r2:((e.length*r-t*n)/Math.sqrt((e.length*i-t*t)*(e.length*a-n*n)))**2,predict:t=>o*(e.length+t)+s}}})),It,Lt=n((()=>{ce(),Ft(),h(),It=class{constructor(e=10){m(this,`rates`,void 0),m(this,`_total`,0),m(this,`accumulatedValues`,0),m(this,`lastTickTime`,performance.now()),m(this,`add`,e=>{this.accumulatedValues+=e,this._total+=e}),m(this,`tick`,()=>{let e=performance.now(),t=this.accumulatedValues/((e-this.lastTickTime)/1e3);this.rates.push(t),this.accumulatedValues=0,this.lastTickTime=e}),this.rates=new w(e)}get total(){return this._total}get average(){return this.rates.isEmpty()?0:At(this.rates.items())}get minMaxAverage(){return Nt(this.rates.items())}}})),Rt,zt=n((()=>{Rt=5e3})),Bt=n((()=>{})),Vt,Ht=n((()=>{Vt=(e,t)=>{if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=0,r=0;for(let t in e)n+=1;for(let n in t)if(r+=1,!(n in e)||!Vt(e[n],t[n]))return!1;return n===r}})),Ut,Wt=n((()=>{h(),Ut=class{constructor(){m(this,`listeners`,{})}emit(e,t){let n=this.listeners[e];if(n){let r=!1;for(let e=0;e<n.length;e++)if(n[e].once){r=!0;break}r&&(this.listeners[e]=n.filter(e=>!e.once));let i,a=n.length;for(let e=0;e<a;e++){let r=n[e].fn(t);typeof r==`function`&&(i||(i=[]),i.push(r))}if(i)for(let e=0;e<i.length;e++)i[e]()}}off(e,t){let n=this.listeners[e];n&&(this.listeners[e]=n.filter(e=>e.fn!==t))}on(e,t){this.add(e,t,!1)}once(e,t){this.add(e,t,!0)}hasListeners(e){let t=this.listeners[e];return t!==void 0&&t.length>0}reset(){this.listeners={}}add(e,t,n){let r=this.listeners[e],i={fn:t,once:n};r?r.push(i):this.listeners[e]=[i]}}})),Gt=n((()=>{})),Kt,qt,Jt,Yt,Xt,Zt,Qt,$t=n((()=>{Kt=1e3,qt=Kt*1e3,Jt=qt*1e3,Yt=(e,t,n)=>e%t===0?e/t:(e/t).toFixed(n),Xt=(e,t=1)=>e>=Jt?`${Yt(e,Jt,t)} Gbit/s`:e>=qt?`${Yt(e,qt,t)} Mbit/s`:e>=Kt?`${Yt(e,Kt,t)} Kbit/s`:`${e} bit/s`,Zt=({width:e,height:t})=>`${e}x${t}`,Qt=e=>e%1e3==0?`${e/1e3} kHz`:e>1e3?`${(e/1e3).toFixed(1)} kHz`:`${e} Hz`})),en=n((()=>{})),tn,nn,rn,an,on,sn,cn,ln,un=n((()=>{E(),h(),A(),M(),tn=[`off`,`error`,`warn`,`info`,`debug`,`trace`],nn={ERROR:`error`,WARN:`warn`,INFO:`info`,DEBUG:`debug`,TRACE:`trace`,OFF:`off`},rn=new WeakMap,an=new WeakMap,on=new WeakMap,sn=new WeakMap,cn=class e{constructor({context:e,logLevel:t,debug:n}){T(this,rn,new Map),T(this,an,``),T(this,on,!1),T(this,sn,`off`),m(this,`trace`,(...e)=>{}),m(this,`debug`,(...e)=>{}),m(this,`info`,(...e)=>{}),m(this,`warn`,(...e)=>{}),m(this,`error`,(...e)=>{}),m(this,`table`,(...e)=>{}),m(this,`count`,(...e)=>{}),k(an,this,e),k(sn,this,t),k(on,this,n||!1),this.setLevel(t),this.setDebug(j(on,this))}setDebug(e){k(on,this,e);for(let[t,n]of j(rn,this))n.setDebug(e);e?(this.table=console.table.bind(console),this.count=console.count.bind(console)):(this.table=()=>{},this.count=()=>{})}setLevel(e){k(sn,this,e);for(let[t,n]of j(rn,this))n.setLevel(e);let t=tn.indexOf(e);for(let[e,n]of tn.entries())n!==`off`&&(e<=t?this[n]=console[n].bind(console,`%c%s %c%s`,`font-weight:bold;`,n.toUpperCase(),`font-weight:normal;`,j(an,this)):this[n]=()=>{})}createContext(t){let n=j(rn,this).get(t);if(!n){let n=new e({context:`${t}`,logLevel:j(sn,this),debug:j(on,this)});return j(rn,this).set(t,n),n}return n}static get(){return ln._||(ln._=new e({context:`Vindral`,logLevel:`off`})),ln._}},ln={_:void 0}}));function dn(){return typeof Symbol.asyncDispose!=`symbol`&&Object.defineProperty(Symbol,`asyncDispose`,{value:Symbol.for(`asyncDispose`)}),Symbol.asyncDispose}function fn(){return typeof Symbol.dispose!=`symbol`&&Object.defineProperty(Symbol,`dispose`,{value:Symbol.for(`dispose`)}),Symbol.dispose}var pn=n((()=>{}));function L(e,t){le(e,t),t.add(e)}var R=n((()=>{ue()}));function mn(){this.unlocker.resolve(this.value)}var hn,gn,_n,vn,yn,bn,xn,Sn=n((()=>{se(),oe(),pn(),R(),h(),O(),E(),M(),A(),P(),_n=new WeakSet,hn=fn(),gn=Symbol.dispose,vn=class{constructor(e,t){L(this,_n),m(this,`value`,void 0),m(this,`unlocker`,void 0),this.value=e,this.unlocker=t}unlocked(){var e;return(e=this.unlocker)==null?void 0:e.promise}[hn](){D(_n,this,mn).call(this)}[gn](){D(_n,this,mn).call(this)}},yn=new WeakMap,bn=new WeakMap,xn=class{unsafeValue(){return j(yn,this)}constructor(e){T(this,yn,void 0),T(this,bn,new C),k(yn,this,e),j(bn,this).resolve(e)}isLocked(){return j(bn,this).pending}lock(){var e=this;return N(function*(){let t=new C;t.promise.then(t=>{k(yn,e,t)}).catch(S);let n=j(bn,e).promise.then(()=>t);return k(bn,e,t),yield n,new vn(j(yn,e),t)})()}}}));function Cn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Cn(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var B=n((()=>{h()})),wn=n((()=>{})),Tn=n((()=>{})),En=n((()=>{}));function Dn(e,t){this.v=e,this.k=t}var On=n((()=>{}));function V(e){return new Dn(e,0)}var kn=n((()=>{On()}));function An(e){return function(){return new jn(e.apply(this,arguments))}}function jn(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Dn;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`?`return`:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(a.done?`return`:`normal`,n)},function(e){r(`throw`,e)})}catch(e){i(`throw`,e)}}function i(e,i){switch(e){case`return`:t.resolve({value:i,done:!0});break;case`throw`:t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}var Mn=n((()=>{On(),jn.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},jn.prototype.next=function(e){return this._invoke(`next`,e)},jn.prototype.throw=function(e){return this._invoke(`throw`,e)},jn.prototype.return=function(e){return this._invoke(`return`,e)}})),Nn,Pn,Fn,In,Ln=n((()=>{se(),E(),A(),M(),P(),kn(),Mn(),Pn=new WeakMap,Fn=new WeakMap,Nn=Symbol.asyncIterator,In=class{constructor(e){T(this,Pn,void 0),T(this,Fn,void 0),k(Pn,this,e),k(Fn,this,new C)}isClosed(){var e;return!((e=j(Fn,this))!=null&&e.pending)}current(){return j(Pn,this)}value(){var e;return[j(Pn,this),(e=j(Fn,this))==null?void 0:e.promise]}update(e){var t;if(!((t=j(Fn,this))!=null&&t.pending))throw Error(`ObservableValue is closed`);k(Pn,this,e instanceof Function?e(j(Pn,this)):e),j(Fn,this).resolve(j(Pn,this)),k(Fn,this,new C)}close(){var e;(e=j(Fn,this))==null||e.resolve(j(Pn,this)),k(Fn,this,void 0)}waitFor(e){var t=this;return N(function*(){if(e(j(Pn,t)))return j(Pn,t);for(;;){let[n,r]=t.value();if(!r)throw Error(`ObservableValue was closed while waiting for condition`);let i=yield r;if(e(i))return i}})()}[Nn](){var e=this;return An(function*(){for(;;){let[t,n]=e.value();if(yield t,!n)return;yield V(n)}})()}}})),Rn,zn=n((()=>{B(),Rn=(e,t)=>{let n=z({},e);return typeof n==`object`&&t.forEach(e=>{delete n[e]}),n}})),Bn=n((()=>{})),Vn,Hn,Un=n((()=>{h(),Hn=class{constructor(){m(this,`pendingTimeouts`,new Set),m(this,`pendingIntervals`,new Set),m(this,`clearTimeout`,e=>{this.pendingTimeouts.delete(e)&&window.clearTimeout(e)}),m(this,`clearInterval`,e=>{this.pendingIntervals.delete(e)&&window.clearInterval(e)}),m(this,`setTimeout`,(e,t,...n)=>{let r=window.setTimeout(()=>{e(...n),this.clearTimeout(r)},t);return this.pendingTimeouts.add(r),r}),m(this,`setInterval`,(e,t,...n)=>{let r=window.setInterval(()=>{e(...n)},t);return this.pendingIntervals.add(r),r}),m(this,`unload`,()=>{this.pendingIntervals.forEach(this.clearInterval),this.pendingTimeouts.forEach(this.clearTimeout)})}},Vn=Hn,m(Hn,`create`,()=>new Vn)})),Wn,Gn,Kn,qn,Jn=n((()=>{Wn=(e,t=performance.now())=>{let n=e.length;if(n>0){let r=e[n-1];r.end||(r.end=t)}},Gn=(e,t=performance.now())=>{Wn(e,t),e.push({start:t})},Kn=e=>e.reduce((e,t)=>{var n;return e+(((n=t.end)==null?performance.now():n)-t.start)},0),qn=(e,t,n=performance.now())=>e.reduce((e,r)=>{var i;let a=Math.max(n-t,r.start),o=(i=r.end)==null?n:i;return Math.max(0,o-a)+e},0)}));function Yn(e){try{return e()}catch(e){return e}}var Xn=n((()=>{})),Zn,Qn=n((()=>{Zn=e=>{try{return JSON.parse(e)}catch(e){return}}})),$n=n((()=>{})),er,tr=n((()=>{oe(),h(),B(),er=class{constructor(){var e;m(this,`highEntropyValues`,void 0),(e=self.navigator.userAgentData)==null||e.getHighEntropyValues([`architecture`,`model`,`platformVersion`,`fullVersionList`]).then(e=>{this.highEntropyValues=e}).catch(S)}getUserAgentInformation(){var e;let t=window.location.origin,n=!t||t===`null`?``:`${window.location.pathname}${window.location.search}`.substring(0,1e3),r={locationOrigin:window.location.origin,locationPath:n,ancestorOrigins:((e=window.location.ancestorOrigins)==null?void 0:e.length)>0?Array.from(window.location.ancestorOrigins):void 0,hardwareConcurrency:navigator.hardwareConcurrency,deviceMemory:navigator.deviceMemory};if(self.navigator.userAgentData&&this.highEntropyValues){var i,a,o,s,c;let e=[...(i=this.highEntropyValues.brands)==null?[]:i];e.sort((e,t)=>e.brand.localeCompare(t.brand));let t=[...(a=this.highEntropyValues.fullVersionList)==null?[]:a];t.sort((e,t)=>e.brand.localeCompare(t.brand));let n=t.map(e=>e.version),l=e.map(e=>e.brand),u=e.map(e=>e.version),d=parseInt((o=(s=this.highEntropyValues.platformVersion)==null?void 0:s.split(`.`)[0])==null?`1`:o,10);return z({userAgentLegacy:window.navigator.userAgent,ua:{browser:{brands:l,fullVersionBrands:n,majorVersions:u},device:this.highEntropyValues.model||`Other`,os:{family:this.highEntropyValues.platform||`Other`,version:(c=this.highEntropyValues.platformVersion)==null?`1`:c,major_version:Number.isFinite(d)?d:0}}},r)}else return z({userAgent:window.navigator.userAgent},r)}}})),nr,rr=n((()=>{nr=()=>{let e=[...Array(256).keys()].map(e=>e.toString(16).padStart(2,`0`)),t=crypto.getRandomValues(new Uint8Array(16));return t[6]=t[6]&15|64,t[8]=t[8]&63|128,[...t.entries()].map(([t,n])=>[4,6,8,10].includes(t)?`-${e[n]}`:e[n]).join(``)}})),ir,ar,or=n((()=>{P(),ir=function(){var e=N(function*(e){return new Promise(t=>setTimeout(t,e))});return function(t){return e.apply(this,arguments)}}(),ar=function(){var e=N(function*(e,t=Error(`Timeout`)){return new Promise((n,r)=>setTimeout(()=>r(t),e))});return function(t){return e.apply(this,arguments)}}(),function(){var e=N(function*(e,t){throw yield e,Error(t)});return function(t,n){return e.apply(this,arguments)}}()})),H=n((()=>{ae(),ye(),xe(),Ce(),Oe(),Pe(),Ie(),Re(),rt(),rt(),Dt(),Ae(),kt(),Lt(),zt(),se(),Bt(),Ht(),Wt(),ce(),Gt(),$t(),en(),Be(),un(),Sn(),wn(),Tn(),En(),oe(),Ln(),zn(),Bn(),Ft(),pn(),Un(),Jn(),Xn(),Qn(),$n(),tr(),rr(),or()}));H(),h(),P();var sr=class extends Ut{constructor(e){super(),m(this,`config`,void 0),m(this,`hlsUrl`,void 0),m(this,`element`,void 0),m(this,`connectingTimeout`,void 0),m(this,`castingAvailable`,!1),m(this,`updateAuthenticationToken`,e=>{this.config.authenticationToken=e,this.hlsUrl=this.getHlsUrl(),this.castingAvailable&&(this.element.src=this.hlsUrl)}),m(this,`unload`,()=>{this.element&&(this.element.removeEventListener(`webkitplaybacktargetavailabilitychanged`,this.onAirPlayAvailable),this.element.removeEventListener(`webkitcurrentplaybacktargetiswirelesschanged`,this.onAirPlayPlaybackChanged),this.element.remove())}),m(this,`onAirPlayAvailable`,e=>{switch(e.availability){case`available`:this.castingAvailable=!0,this.element.src!==this.hlsUrl&&this.checkHlsUrl(this.hlsUrl).then(e=>{e&&(this.element.src=this.hlsUrl,this.emit(`available`))});break;case`not-available`:this.castingAvailable=!1;break;default:break}}),m(this,`onAirPlayPlaybackChanged`,()=>{window.clearTimeout(this.connectingTimeout),this.element.webkitCurrentPlaybackTargetIsWireless?(this.emit(`connected`),this.element.style.display=`block`,this.element.paused&&this.element.play().catch(S)):(this.emit(`disconnected`),this.element.pause(),this.element.src=``,this.element.src=this.hlsUrl,this.element.style.display=`none`)}),this.config=e,this.hlsUrl=this.getHlsUrl(),this.element=document.createElement(`video`),this.element.style.position=`absolute`,this.element.style.top=`0`,this.element.style.bottom=`0`,this.element.style.left=`0`,this.element.style.right=`0`,this.element.style.width=`100%`,this.element.style.height=`100%`,this.element.style.zIndex=`1001`,this.element.style.display=`none`,this.element.id=`vindral-airplay-element`,this.element.slot=`overlay`,this.element.playsInline=!0,this.element.controls=!0,this.element.preload=`metadata`,this.element.addEventListener(`webkitplaybacktargetavailabilitychanged`,this.onAirPlayAvailable),this.element.addEventListener(`webkitcurrentplaybacktargetiswirelesschanged`,this.onAirPlayPlaybackChanged),this.config.container.appendChild(this.element)}get casting(){return this.element.webkitCurrentPlaybackTargetIsWireless}set channelId(e){}showPlaybackTargetPicker(){`webkitShowPlaybackTargetPicker`in this.element&&this.castingAvailable&&(this.element.paused&&(this.element.play().catch(S),this.connectingTimeout=window.setTimeout(()=>{this.casting||(this.element.pause(),this.element.src=``,this.element.src=this.hlsUrl)},3e4)),this.element.webkitShowPlaybackTargetPicker())}static isAirPlaySupported(){return!!window.WebKitPlaybackTargetAvailabilityEvent}getHlsUrl(){let e=new URL(`/api/hls?channelId=${this.config.channelId}`,this.config.url);return this.config.authenticationToken&&e.searchParams.set(`authenticationToken`,this.config.authenticationToken),e.toString()}checkHlsUrl(e){return N(function*(){try{return(yield fetch(e,{method:`HEAD`})).ok}catch(e){return!1}})()}};H(),h(),P();var cr=class extends Ut{constructor(e){var t;super(),t=this,m(this,`state`,`not casting`),m(this,`config`,void 0),m(this,`unloaded`,!1),m(this,`updateAuthenticationToken`,e=>{this.config&&(this.config.options.authenticationToken=e,this.send({type:`updateAuthToken`,token:e}))}),m(this,`unload`,()=>{var e;this.unloaded=!0,(e=this.getSession())==null||e.removeMessageListener(`urn:x-cast:com.vindral.castdata`,this.onMessage)}),m(this,`init`,N(function*(){return new Promise((e,n)=>{let r=!1,i=setTimeout(()=>{r=!0,n()},1e4);window.__onGCastApiAvailable=a=>{if(r){r=!1;return}if(clearTimeout(i),!a)return n();setTimeout(()=>{try{t.onGCastApiAvailable(),e()}catch(e){n()}},1e3)},t.castLibrariesAdded()&&window.cast?window.__onGCastApiAvailable(!0):t.verifyCastLibraries()})})),m(this,`start`,N(function*(){var e;yield(e=t.getInstance())==null?void 0:e.requestSession()})),m(this,`stop`,()=>{var e;(e=this.getSession())==null||e.endSession(!0)}),m(this,`getReceiverName`,()=>{var e;return((e=this.getSession())==null||(e=e.getCastDevice())==null?void 0:e.friendlyName)||void 0}),m(this,`onGCastApiAvailable`,()=>{var e;let t=this.getInstance();if(!t)throw`cast context should exist`;let n=t.getSessionState(),r=((e=this.config)==null?void 0:e.receiverApplicationId)||`A5452297`;t.setOptions({receiverApplicationId:r,autoJoinPolicy:chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,resumeSavedSession:!0}),t.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.onSessionStateChanged),n===cast.framework.SessionState.SESSION_STARTED&&setTimeout(()=>{this.state=`casting`,this.emit(`resumed`)})}),m(this,`send`,e=>{var t;(t=this.getSession())==null||t.sendMessage(`urn:x-cast:com.vindral.castdata`,e)}),m(this,`onMessage`,(e,t)=>{if(e===`urn:x-cast:com.vindral.castdata`)try{let e=JSON.parse(t);switch(e.type){case`metadata`:this.emit(`metadata`,e.metadata);break;case`serverWallclockTime`:this.emit(`server wallclock time`,e.serverWallclockTime);break;default:break}}catch(e){}}),m(this,`onSessionStarted`,()=>{var e;(e=this.getSession())==null||e.addMessageListener(`urn:x-cast:com.vindral.castdata`,this.onMessage),this.send({type:`start`,config:this.config})}),m(this,`onSessionStateChanged`,e=>{if(!this.unloaded)switch(e.sessionState){case cast.framework.SessionState.SESSION_START_FAILED:this.state=`not casting`,this.emit(`failed`);break;case cast.framework.SessionState.SESSION_ENDED:this.state=`not casting`,this.emit(`disconnected`);break;case cast.framework.SessionState.SESSION_ENDING:break;case cast.framework.SessionState.SESSION_RESUMED:this.onSessionStarted(),this.state=`casting`,this.emit(`resumed`);break;case cast.framework.SessionState.SESSION_STARTED:this.onSessionStarted(),this.state=`casting`,this.emit(`connected`);break;case cast.framework.SessionState.SESSION_STARTING:break;default:break}}),m(this,`getInstance`,()=>{var e;return(e=window.cast)==null?void 0:e.framework.CastContext.getInstance()}),m(this,`getSession`,()=>{var e;return(e=this.getInstance())==null?void 0:e.getCurrentSession()}),m(this,`castLibrariesAdded`,()=>!!(document.querySelector(`#vindralCastFrameworkLib`)&&document.querySelector(`#vindralCastSenderLib`))),m(this,`verifyCastLibraries`,()=>{if(this.castLibrariesAdded())return;let e=document.createElement(`script`);e.type=`text/javascript`,e.id=`vindralCastFrameworkLib`,e.src=`//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js`,document.head.appendChild(e);let t=document.createElement(`script`);t.type=`text/javascript`,t.id=`vindralCastSenderLib`,t.src=`//www.gstatic.com/cv/js/sender/v1/cast_sender.js`,document.head.appendChild(t)}),this.config=e}get casting(){return this.state===`casting`}get volume(){var e,t;return(e=(t=this.getSession())==null?void 0:t.getVolume())==null?0:e}set volume(e){var t;(t=this.getSession())==null||t.setVolume(e)}get language(){var e;return(e=this.config)==null||(e=e.options)==null?void 0:e.language}set language(e){this.config&&(this.config.options.language=e,this.send({type:`setLanguage`,language:e}))}get channelId(){var e;return((e=this.config)==null?void 0:e.options.channelId)||``}set channelId(e){this.config&&(this.config.options.channelId=e,this.send({type:`setChannelId`,channelId:e}))}},lr=e=>{switch(e){case`h264`:case`h265`:case`av1`:return`video`;case`aac`:case`opus`:case`mp3`:return`audio`;case`webvtt`:return`text`;default:throw Error(`Unknown codec`)}};function ur(e){if(e.startsWith(`opus`))return`opus`;if(e.startsWith(`mp4a`))return`aac`;if(e.startsWith(`avc1`))return`h264`;if(e.startsWith(`hvc1`)||e.startsWith(`hev1`))return`h265`;if(e.startsWith(`av01`))return`av1`;if(e.startsWith(`webvtt`))return`webvtt`}H();function dr(e){return!(typeof e.edges[0]==`string`||e.channels[0]&&!(`catalog`in e.channels[0]))}function fr(e){return e.tracks.filter(e=>!!e.codec).filter(e=>ur(e.codec||``)).map((e,t)=>{let n=e.codec,r=e.bitrate;be(n,`codec is required`),be(r!==void 0,`bitrate is required`);let i=ur(n);if(be(i,`codec is required`),lr(i)===`audio`){let a=e.samplerate||0;return{track:e,id:t,codec:i,codecString:n,bitRate:r,channels:e.channelConfig===`stereo`?2:1,sampleRate:a,language:e.language}}return lr(i)===`text`?{track:e,id:t,bitRate:0,codec:i,kind:`subtitles`,codecString:n,label:e.label,language:e.language}:(be(e.width,`width is required`),be(e.height,`width is required`),be(e.framerate,`framerate is required`),{track:e,id:t,codec:i,bitRate:r,codecString:n,width:e.width,height:e.height,frameRate:e.framerate})}).sort((e,t)=>e.bitRate-t.bitRate)}var pr=e=>`width`in e&&typeof e.width==`number`,mr=e=>`sampleRate`in e&&typeof e.sampleRate==`number`,hr=e=>{switch(e.codec){case`opus`:return`audio/mp4; codecs="opus"`;case`mp3`:return`audio/mpeg`;case`webvtt`:return`text/vtt`;case`aac`:return e.codecString?`audio/mp4; codecs="${e.codecString}"`:`audio/mp4`;case`h264`:case`h265`:return e.codecString?`video/mp4; codecs="${e.codecString}"`:`video/mp4`;case`av1`:return e.codecString?`video/mp4; codecs="${e.codecString}"`:`video/mp4`}},gr=()=>2**53-1,_r=()=>({width:2**53-1,height:2**53-1}),vr=e=>!(typeof e!=`object`||!e||!(`type`in e));H();var yr={sizeBasedResolutionCapEnabled:!0,pictureInPictureEnabled:!0,abrEnabled:!0,burstEnabled:!1,mseEnabled:!0,mseOpusEnabled:!0,muted:!1,volume:1,minBufferTime:1500,maxBufferTime:1500,logLevel:nn.OFF,maxSize:_r(),maxVideoBitRate:gr(),maxAudioBitRate:gr(),maxInitialBitRate:2.5*1e3*1e3,tags:[],media:`audio+video`,poster:!0,reconnectHandler:e=>e.reconnectRetries<30,iosWakeLockEnabled:!1,telemetryEnabled:!0,streamToMediaElementEnabled:!1,iosMediaElementEnabled:!1,pauseSupportEnabled:!0,webcodecsHardwareAcceleration:`no-preference`,offscreenCanvasEnabled:void 0,advanced:{},videoCodecs:[`av1`,`h264`,`h265`],webtransportEnabled:!0};function br(e){return typeof e==`function`?this.then(t=>Promise.resolve(e()).then(()=>t),t=>Promise.resolve(e()).then(()=>{throw t})):this.then()}function xr(e=Promise){return typeof e.prototype.finally!=`function`&&Object.defineProperty(e.prototype,`finally`,{configurable:!0,enumerable:!1,value:br,writable:!0}),e.prototype.finally}xr();var Sr=e=>{e.width=320,e.height=180,e.style.width=`100%`,e.style.position=`relative`,e.style.backgroundColor=`#000`};R(),E(),h(),B(),M(),A(),O();var Cr={backgroundColor:`rgba(0,0,0,0.6)`,textPadding:8,fontSize:`28px`,lineGap:16},wr=new WeakMap,Tr=new WeakMap,Er=new WeakMap,Dr=new WeakMap,Or=new WeakSet,kr=class{constructor(){L(this,Or),T(this,wr,[]),T(this,Tr,document.createElement(`canvas`)),T(this,Er,void 0),T(this,Dr,window.devicePixelRatio||1),m(this,`config`,z({},Cr));let e=j(Tr,this).getContext(`2d`,{alpha:!0});if(!e)throw Error(`Failed to create 2d context`);k(Er,this,e),D(Or,this,jr).call(this)}get canvas(){return j(Tr,this)}setActiveCues(e){k(wr,this,e)}render(e,t=!1){let n=j(wr,this).flatMap(t=>t.text.split(`
|
|
2
2
|
`).flatMap(t=>D(Or,this,Mr).call(this,t,e.width)).map(e=>{D(Or,this,jr).call(this);let t=j(Er,this).measureText(e);return{text:e,measurement:t,size:{height:t.fontBoundingBoxAscent+t.fontBoundingBoxDescent+this.config.textPadding*2,width:t.width+this.config.textPadding*2}}})),r=Math.max(...n.map(e=>e.size.width)),i=n.reduce((e,{size:t})=>e+t.height,0)+(n.length-1)*this.config.lineGap,a=0;D(Or,this,Ar).call(this,r,i),j(Er,this).clearRect(0,0,j(Tr,this).width,j(Tr,this).height);for(let{size:e,text:t}of n)D(Or,this,jr).call(this),j(Er,this).fillStyle=this.config.backgroundColor,j(Er,this).fillRect(0,a,e.width,e.height),D(Or,this,jr).call(this),j(Er,this).fillText(t,this.config.textPadding,a+this.config.textPadding),a+=e.height+this.config.lineGap;t&&(j(Er,this).strokeStyle=`red`,j(Er,this).strokeRect(0,0,e.width,j(Tr,this).height))}};function Ar(e,t){j(Tr,this).width=e*j(Dr,this),j(Tr,this).height=t*j(Dr,this),j(Er,this).setTransform(j(Dr,this),0,0,j(Dr,this),0,0),this.canvas.style.width=`${e}px`,this.canvas.style.height=`${t}px`}function jr(){j(Er,this).fillStyle=`white`,j(Er,this).textAlign=`left`,j(Er,this).textBaseline=`top`,j(Er,this).font=`${this.config.fontSize} sans-serif`}function Mr(e,t){let n=[],r=e.split(` `),i=``;for(;r.length>0;){D(Or,this,jr).call(this);let e=0;for(;j(Er,this).measureText(i+(i.length>0?` `:``)+r[0]).width+this.config.textPadding*2<=t&&r.length>0;)e++,i+=(i.length>0?` `:``)+r.shift();if(e===0){n.push(r.shift()||``),i=``;continue}n.push(i),i=``}return n}function Nr(e,t){let n=t*.05,r=e*.035;return`${Math.max(Math.round(Math.min(n,r)),16)}px`}function Pr(e){var t;let{subtitleWidth:n,subtitleHeight:r,canvasWidth:i,canvasHeight:a,containerWidth:o,bottomPadding:s}=e,c=(t=e.baseMargin)==null?20:t,l=i/o,u=n*l,d=r*l;return{drawWidth:u,drawHeight:d,x:(i-u)/2,y:a-d-(s+c)*l}}function Fr(e,t,n){return{scaleX:2*e.drawWidth/t,scaleY:2*e.drawHeight/n,translateX:2*e.x/t-1,translateY:1-2*e.y/n}}H(),h();var Ir={width:256,height:144},Lr=class extends Ut{constructor(){super(),m(this,`canvas`,document.createElement(`canvas`)),m(this,`context`,null),m(this,`size`,Ir),m(this,`hasWarnedNoVideoFrame`,!1),m(this,`subtitleRenderer`,null),m(this,`hasActiveSubtitles`,!1),m(this,`load`,()=>{if(this.hasWarnedNoVideoFrame=!1,this.context=this.canvas.getContext(`2d`,{alpha:!1,desynchronized:!0}),!this.context)throw Error(`Failed to get 2D rendering context`);this.setSize(Ir)}),m(this,`unload`,()=>{this.context=null,this.subtitleRenderer=null,this.hasActiveSubtitles=!1,this.setSize(Ir)}),m(this,`setActiveCues`,(e,t)=>{this.subtitleRenderer||(this.subtitleRenderer=new kr),this.subtitleRenderer.config.fontSize=Nr(t.width,t.height),this.subtitleRenderer.setActiveCues(e),this.subtitleRenderer.render(t),this.hasActiveSubtitles=e.length>0}),m(this,`render`,(e,t=0)=>{if(!this.context)return;if(!e.videoFrame){this.hasWarnedNoVideoFrame||(console.warn(`[VideoFrameCanvas2DRenderer] No VideoFrame in sample, cannot render`),this.hasWarnedNoVideoFrame=!0);return}let n=e.videoFrame;this.setSize({width:e.width,height:e.height});try{this.context.drawImage(n,0,0,this.canvas.width,this.canvas.height),this.renderSubtitles(t)}catch(e){this.emit(`context lost`,e instanceof Error?e:Error(`Failed to render VideoFrame`))}}),m(this,`renderSubtitles`,e=>{if(!this.hasActiveSubtitles||!this.subtitleRenderer||!this.context)return;let t=this.subtitleRenderer.canvas;if(t.width===0||t.height===0)return;let n=window.devicePixelRatio||1,r=this.canvas.clientWidth||this.canvas.width,i=Pr({subtitleWidth:t.width/n,subtitleHeight:t.height/n,canvasWidth:this.canvas.width,canvasHeight:this.canvas.height,containerWidth:r,bottomPadding:e});this.context.drawImage(t,i.x,i.y,i.drawWidth,i.drawHeight)}),m(this,`setSize`,e=>{e.width===this.size.width&&e.height===this.size.height||(this.size=e,this.canvas.width=e.width,this.canvas.height=e.height,this.context&&(this.context.fillStyle=`#000`,this.context.fillRect(0,0,e.width,e.height)))}),Sr(this.canvas)}},Rr=`
|
|
3
3
|
precision mediump float;
|
|
4
4
|
uniform sampler2D texture;
|
package/package.json
CHANGED
package/player.js
CHANGED