/* VimeoPlayer - v4.41.8 - 2025-06-27 - https://player.vimeo.com/NOTICE.txt */ const e={MANIFEST:"manifest",SEGMENT:"segment"},t={method:"GET",async:!0,retry:0,throwHttpErrors:!0,headers:{},hooks:{beforeRequest:[],beforeRetry:[],afterResponse:[]},validateStatus:function(e){return e>=200&&e<300},retryStatus:function(e){return[408,413,429].includes(e)||e>=500&&e<600}};function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t,n){return(t=S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,E(e,t)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_=function(){return!!e})()}function m(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function v(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 g(e){for(var t=1;tn.indexOf(e)===t))}function I(e,t){return e.reduce(((e,n,r,i)=>e.concat(t(n,r,i))),[])}function R(e){return(t,...n)=>(n.forEach((n=>{for(const r in n){const i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,Object.assign(i,e))}})),t)}const k=R({enumerable:!1,configurable:!0,writeable:!1}),P=R({enumerable:!1,configurable:!1,writeable:!1}),D=R({enumerable:!0,configurable:!0,writeable:!1}),O=e=>new Promise((t=>setTimeout(t,e)));function L(e){e.substring(0,e.lastIndexOf("/")+1)}const C=(e,t=!1)=>new Promise(((n,r)=>{if(t){const t=document.querySelector(`script[src="${e}"]`);if(t&&!t.dataset.error)return void setTimeout(n,0)}const i=document.createElement("script");i.src=e,i.addEventListener("load",n),i.addEventListener("error",(e=>{i.dataset.error="true",r(e.error)})),document.head.appendChild(i)})),N=e=>Math.pow(e,2),M=e=>Math.sqrt(e),x=(e,t)=>{const n=(n,...r)=>{[`%c${e}`,t].concat(r)},r=e=>(...t)=>{n.apply(void 0,[e].concat(t))},i=r("log"),o=(...e)=>{i.apply(void 0,e)};return Object.assign(o,{log:i,warn:r("warn"),error:r("error")}),o};function U(e,...t){return t.reduce(((e,t)=>(Object.keys(t||{}).forEach((n=>{const r=e[n],i=t[n];r&&void 0===i||(Array.isArray(i)?e[n]=(r||[]).concat(i):(e=>e&&"object"==typeof e)(i)?e[n]=U({},r,i):e[n]=i)})),e)),e)}const F=(e=!1)=>e?window.MediaSource:j,j=void 0!==window.ManagedMediaSource?window.ManagedMediaSource:window.MediaSource,V=navigator.userAgent.toLowerCase(),B=["googlebot","google-inspectiontool"],H=["bingbot","bingpreview","yandex","slurp","facebookexternalhit","msnbot","feedly","parse.ly"];function X(e){e=e.toLowerCase();const t=new RegExp(e).test(V);return"safari"===e?t&&new RegExp("version").test(V):t}function W(e){const t=document.createElement("div"),n=e.charAt(0).toUpperCase()+e.slice(1),r=(e+" "+["Webkit","Moz","O","ms"].join(n+" ")+n).split(" ");for(let i in r){const e=r[i];if(void 0!==t.style[e])return e}return e}const q=!!X("android")&&(parseFloat(V.replace(/^.* android (\d+)\.(\d+).*$/,"$1.$2"))||!0),G=window.devicePixelRatio||1,K=!(!X("windows phone")&&!X("iemobile"))&&(parseFloat(V.replace(/^.* windows phone (os )?(\d+)\.(\d+).*$/,"$2.$3"))||!0),Y=!!X("msie")&&parseFloat(V.replace(/^.*msie (\d+).*$/,"$1")),$=!!X("trident")&&parseFloat(V.replace(/^.*trident\/(\d+)\.(\d+).*$/,"$1.$2"))+4,z=X("ipad;")||X("iphone;")||X("ipod touch;")?parseFloat(V.replace(/^.* os (\d+)_(\d+).*$/,"$1.$2")):navigator.userAgent.includes("Mac")&&"ontouchend"in document,Q=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Version)/i.test(navigator.userAgent),J="MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,Z=X("opera")||X("opr"),ee=/^Mozilla\/5\.0 \(.* Mac OS X.*\(KHTML, like Gecko\)(?: Mobile\/[\S]*|)$/i.test(V),te=(X("safari")||Q)&&X("apple")&&!X("chrome")&&!X("android");function ne(e){if(!te)return!1;const t=e.split("."),n=function(){if(!X("safari"))return[];const e=V.split(" ").find((function(e){return/version\//.test(e)}));return e?e.replace("version/","").split(".").map((function(e){return parseInt(e,10)})):[]}();for(let r=0;r<3;r++){const e=parseInt(t[r],10)||0,i=n[r]||0;if(ei)return!1}return!0}const re={autoplayPolicy:ne("11"),hevc:ne("11"),dolbyVision:ne("14.1"),spatial:ne("11.0.2"),fullscreenRequiresDataLoaded:ne("17.2")},ie={airPlay:"WebKitPlaybackTargetAvailabilityEvent"in window,android:q,appleMail:ee,hasAutoplayPolicy:q||z||re.autoplayPolicy||function(){if(!X("chrome"))return[];const e=V.split(" ").find((function(e){return z?/CriOS\//.test(e):/chrome\//.test(e)}));return e?e.replace("chrome/","").split(".").map((function(e){return parseInt(e,10)})):[]}()[0]>=66,iOS:z,iPadOS:J,mobileAndroid:q&&X("mobile"),browser:{bb10:X("bb10"),chrome:X("chrome"),firefox:X("firefox"),ie:Y||$,edge:X("edge"),opera:Z,safari:te,chromium:"chrome"in window&&!X("crios"),webKit:te||X("crios")},mse:j,devicePixelRatio:G,iPhone:X("iphone;")||X("ipod touch;")||X("ipod;"),iPad:X("ipad;"),iPadNonRetina:X("ipad;")&&G<2,mac:X("mac os"),navigatorConnection:window.navigator.connection,pictureInPictureSupportType:function(){if("pictureInPictureEnabled"in document)return"pip-api";const e=document.createElement("video");return!("function"!=typeof e.webkitSetPresentationMode||!e.webkitSupportsPresentationMode("picture-in-picture"))&&"webkit-presentation-mode"}(),pointerEvents:window.navigator.pointerEnabled||window.navigator.msPointerEnabled||!1,passiveEvents:function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(Np){}return e}(),svg:!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,touch:"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch||X("windows phone")||window.navigator.maxTouchPoints>1||window.navigator.msMaxTouchPoints||!1,transformProperty:W("transform"),transitionProperty:W("transition"),webp:function(){const e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))&&0===e.toDataURL("image/webp").indexOf("data:image/webp")}(),windowsPhone:K,mediaCapabilities:"mediaCapabilities"in navigator,webShare:"canShare"in navigator&&"share"in navigator,isGoogleBot:(()=>{const e=V.toLowerCase();return B.some((t=>e.includes(t)))})(),isCrawler:(()=>{const e=V.toLowerCase();return H.some((t=>e.includes(t)))})(),storageAccessAPI:"requestStorageAccess"in document&&"hasStorageAccess"in document,clipboardAPI:"clipboard"in navigator&&"write"in navigator.clipboard,videoContentPreload:!X("iphone"),intersectionObserver:"IntersectionObserver"in window},oe=e=>{ie.mse=e},se=/mac os x 10_13/.test(V),ae=ie.iOS&&ie.iOS>=11,ue="undefined"!=typeof matchMedia&&(matchMedia("(color-gamut: p3)").matches&&screen.pixelDepth>24||matchMedia("(dynamic-range: high), (video-dynamic-range: high)").matches);ie.hevc=function(e="hvc1"){return void 0!==j?j.isTypeSupported(`video/mp4; codecs="${e}"`):re.hevc&&(se||ae)}("hvc1.2.4.H150.90"),ie.hdr=ue,ie.dolbyVision=function(){const e='video/mp4; codecs="dvh1"';let t=void 0!==j&&j.isTypeSupported(e);if(!t){const n=document.createElement("video");"canPlayType"in n&&(t="probably"===n.canPlayType(e))}return!((J||ie.iOS)&&!re.dolbyVision)&&t}(),ie.vp9hdr=(window.matchMedia("(color-gamut: p3)").matches||window.matchMedia("(color-gamut: rec2020)").matches)&&screen.colorDepth>=48&&(j.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.16.09.00"')||j.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.16.09.01"')||j.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.18.09.00"')||j.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.18.09.01"')),ie.av1=void 0!==j&&j.isTypeSupported('video/mp4; codecs="av01.0.31M.08.0.110.01.01.01.0"'),ie.webvr=!(!window.navigator||!("getVRDisplays"in window.navigator)),ie.webxr=!!(window.navigator&&"xr"in window.navigator&&"supportsSession"in window.navigator.xr),ie.spatialPlayback=!!ie.mse,ie.stereoscopic=ie.spatialPlayback&&ie.mobileAndroid,ie.fullscreenRequiresDataLoaded=ie.iOS>=17||ie.iPadOS&&re.fullscreenRequiresDataLoaded;const ce=function(e){return function(){for(var t=[],n=0;n{const{cleanup:n}=le(e,(e=>{e&&(t(),n())}))}))}));function le(e,t){let n=!0,r=!0;function i(){return r=n&&"visible"===document.visibilityState,r}if(!ie.intersectionObserver)return null==t||t(!0),{cleanup:()=>{},isInView:!0};const o=new IntersectionObserver((e=>{const[o]=e;n=!(null==o||!o.isIntersecting),i(),null==t||t(r)}),{threshold:.5});o.observe(e);const s=()=>{i(),null==t||t(r)};return document.addEventListener("visibilitychange",s),{cleanup:()=>{o.disconnect(),document.removeEventListener("visibilitychange",s)},get isInView(){return r}}}function de(){let e,t,n=new Promise(((n,r)=>{e=n,t=r}));return Object.assign(n,{resolve:e,reject:t}),n}function he(e,t){if(!t||!t.length)return 0;if(1===t.length&&t.end(0)-t.start(0)<1e-6)return 0;let n=0;for(let r=t.length-1;r>=0&&t.end(r)>e;--r)n+=t.end(r)-Math.max(t.start(r),e);return n}function fe(e,t){let n=e;for(let r=0;r=e){n=t.end(r);break}return n-e}function pe(){return void 0!==window.performance&&"function"==typeof window.performance.now?window.performance.now():Date.now()}function _e(){return Math.trunc(pe()/1e3)}function me(e){return _e()-e}function ve(e){return pe()-e}const ge=e=>Math.trunc(Date.now()/1e3)-e;function ye(e){try{const t=new URLSearchParams;return Object.entries(e).forEach((([e,n])=>{void 0!==n&&t.append(e,String(n))})),t.toString()}catch(Np){return""}}function Ee(e){if("string"!=typeof e)return{};try{const t=new URLSearchParams(e),n={};return t.forEach(((e,t)=>{n[t]=e})),n}catch(Np){return{}}}function Te(e){try{return new URL(e)}catch(t){return{}}}const Se=(e,t,n=!1)=>{try{const r=new URL(e);return Object.entries(t).forEach((([e,t])=>{var i;n&&void 0===t||r.searchParams.set(e,null!==(i=null==t?void 0:t.toString())&&void 0!==i?i:"")})),r.toString()}catch(Np){return e}},be=e=>{try{const{username:t,password:n,host:r}=new URL(e);return r?t||n?`${t}:${n}@${r}`:r:null}catch(Np){return null}};function Ae(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^16*Math.random()>>e/4).toString(16)))}function we(e,t){this.headers={},this.perfTimings={},U(this,t),this.ok=2==(this.status/100|0),this.body=e,this.text=()=>Promise.resolve(e),this.json=()=>Promise.resolve(JSON.parse(e)),this.blob=()=>Promise.resolve(new Blob([e])),this.arrayBuffer=()=>Promise.resolve(e),this.clone=()=>new we(e,this),this.isVimeoResponse=!0}let Ie=function(e){function t(){var t;return(t=e.call(this,"The operation was aborted.")||this).name="AbortError",t}return p(t,e),t}(A(Error)),Re=function(e){function t(t){var n;return(n=e.call(this,t.statusText)||this).name="HTTPError",n.response=t,n}return p(t,e),t}(A(Error)),ke=function(e){function t(){var t;return(t=e.call(this,"A network error occurred.")||this).name="NetworkError",t}return p(t,e),t}(A(Error)),Pe=function(e){function t(t){var n;return(n=e.call(this,"Request timed out.")||this).name="TimeoutError",n.timeoutMs=t,n}return p(t,e),t}(A(Error));function De(e,t){let{url:n,method:r,body:i,onDownloadProgress:o}=e,s=100;return new Promise((function(a,u){const c=t?new t:new XMLHttpRequest,l=window.performance;c.open(r.toUpperCase(),n,e.async),e.timeout&&(c.timeout=e.timeout),c.onload=function(){if(0===c.status&&(!c.responseURL||0!==c.responseURL.indexOf("file:")))return;const e={};c.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,((t,n,r)=>{e[n]=e[n]?`${e[n]},${r}`:r}));let t={};if(window.performance&&void 0!==window.performance.getEntriesByType){const e=window.performance.getEntriesByType("resource");if(e.length&&e.length>=s&&("function"==typeof l.clearResourceTimings&&l.clearResourceTimings(),"function"==typeof l.setResourceTimingBufferSize&&(l.setResourceTimingBufferSize(500),s=500)),e.length){const n=e.filter((e=>e.name===c.responseURL)).sort(((e,t)=>e.connectStart-t.connectStart));n.length&&(t=n[n.length-1].toJSON())}}a(new we(c.response,{headers:e,statusText:c.statusText,status:c.status,url:c.responseURL,perfTimings:t}))},c.onabort=function(){u(new Ie)},c.onerror=function(){u(new ke)},c.ontimeout=function(){u(new Pe(e.timeout))},"function"==typeof o&&c.addEventListener("progress",o);for(let t in e.headers)c.setRequestHeader(t,e.headers[t]);e.withCredentials&&(c.withCredentials=!0),e.responseType&&(c.responseType=e.responseType),e.abort=c.abort.bind(c),c.send(i||null)}))}function Oe(){}function Le(e,t,n){if(!e.s){if(n instanceof Ce){if(!n.s)return void(n.o=Le.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Le.bind(null,e,t),Le.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const Ce=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,i=this.s;if(i){const e=1&i?t:n;if(e){try{Le(r,1,e(this.v))}catch(Np){Le(r,2,Np)}return r}return this}return this.o=function(e){try{const i=e.v;1&e.s?Le(r,1,t?t(i):i):n?Le(r,1,n(i)):Le(r,2,i)}catch(Np){Le(r,2,Np)}},r},e}();function Ne(e){return e instanceof Ce&&1&e.s}function Me(e){const t=function(e){return function(){for(var t=[],n=0;n=e.retry)return 0;if(t instanceof Re){if(!e.retryStatus(t.response.status))return 0;const n=function(e){const t="retry-after".toLowerCase();for(const n in e)if(n.toLowerCase()===t)return e[n];return null}(t.response.headers);if(n&&e.retryStatus(t.response.status)){let e=Number(n);return isNaN(e)?e=Date.parse(n)-Date.now():e*=1e3,e}if(413===t.response.status)return 0}return.3*2**(n-1)*1e3}(i);return n++,function(a,u){var c=function(){if(0!==s&&n>0)return function(e,t){return void 0?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}(O(s),(function(){var s;const a=(null==e||null==(s=e.hooks)?void 0:s.beforeRetry)||[];return function(e,t){return e&&e.then?e.then(t):t(e)}(function(e,t,n){var r,i,o=-1;return function s(a){try{for(;++oxe(n.apply(void 0,e),t)})}function Ue(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Fe(e){return function(){for(var t=[],n=0;nt.abort()))}function Ye(e,n){U(this,t,e="string"==typeof e?{url:e}:e,n)}function $e(e){const{validateStatus:t,throwHttpErrors:n,hooks:r}=e;return Fe((function(i){const o=r.afterResponse||[];return Xe(He(o,(function(t){return Ue((0,o[t])(e,i.clone()),(function(e){e instanceof we&&(i=e)}))})),(function(){if(!t||t(i.status))return i;if(n)throw new Re(i);return i}))}))}We.forEach((function(e){return Ke[e]=(t,n)=>Ke(t,g({method:e},n)),Ke[e]}));const{get:ze,post:Qe,put:Je,patch:Ze,head:et}=Ke,tt={ARRAY_BUFFER:"arraybuffer"};var nt=Object.freeze({__proto__:null,ContentTypes:e,defaults:t,requestMethods:We,responseTypes:qe,retryMethods:Ge,request:Ke,Request:Ye,get:ze,post:Qe,put:Je,patch:Ze,head:et,Response:we,ResponseTypes:tt,AbortError:Ie,HTTPError:Re,NetworkError:ke,TimeoutError:Pe,xhr:De}),rt=Array.isArray,it="object"==typeof global&&global&&global.Object===Object&&global,ot="object"==typeof self&&self&&self.Object===Object&&self,st=it||ot||Function("return this")(),at=st.Symbol,ut=Object.prototype,ct=ut.hasOwnProperty,lt=ut.toString,dt=at?at.toStringTag:void 0,ht=Object.prototype.toString,ft=at?at.toStringTag:void 0;function pt(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ft&&ft in Object(e)?function(e){var t=ct.call(e,dt),n=e[dt];try{e[dt]=void 0;var r=!0}catch(Np){}var i=lt.call(e);return r&&(t?e[dt]=n:delete e[dt]),i}(e):function(e){return ht.call(e)}(e)}function _t(e){return null!=e&&"object"==typeof e}function mt(e){return"symbol"==typeof e||_t(e)&&"[object Symbol]"==pt(e)}var vt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gt=/^\w*$/;function yt(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Et(e){if(!yt(e))return!1;var t=pt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Tt=st["__core-js_shared__"],St=function(){var e=/[^.]+$/.exec(Tt&&Tt.keys&&Tt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),bt=Function.prototype.toString;function At(e){if(null!=e){try{return bt.call(e)}catch(Np){}try{return e+""}catch(Np){}}return""}var wt=/^\[object .+?Constructor\]$/,It=Function.prototype,Rt=Object.prototype,kt=It.toString,Pt=Rt.hasOwnProperty,Dt=RegExp("^"+kt.call(Pt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ot(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!yt(e)||function(e){return!!St&&St in e}(e))&&(Et(e)?Dt:wt).test(At(e))}(n)?n:void 0}var Lt=Ot(Object,"create"),Ct=Object.prototype.hasOwnProperty,Nt=Object.prototype.hasOwnProperty;function Mt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},jt.prototype.set=function(e,t){var n=this.__data__,r=Ut(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Vt=Ot(st,"Map");function Bt(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Ht(e){var t=-1,n=null==e?0:e.length;for(this.clear();++tObject.keys(o(bn,this)))),h(this,"fire",((e,...t)=>{if(!e)throw new Error("Tried to fire an undefined event.");if(e in o(bn,this)){const n=o(bn,this)[e].slice(0);for(let e=0,r=n.length;e(a(An,this,!0),this))),h(this,"on",((e,t,n)=>{const r=[].concat(e);for(let i=0,s=r.length;i{const r=(...n)=>{this.off(e,r),t.apply(this,n)};return r.handler=t,this.on(e,r,n)})),h(this,"off",((e,t)=>{if(!e)return a(bn,this,Object.create(null)),this;const n=[].concat(e);for(let r=0,i=n.length;rthis.on(e,t,!0)))}return e.extend=function(t){return Object.assign(t,new e),t},e}();function In(e){var t=this.__data__=new jt(e);this.size=t.size}In.prototype.clear=function(){this.__data__=new jt,this.size=0},In.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},In.prototype.get=function(e){return this.__data__.get(e)},In.prototype.has=function(e){return this.__data__.has(e)},In.prototype.set=function(e,t){var n=this.__data__;if(n instanceof jt){var r=n.__data__;if(!Vt||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ht(r)}return n.set(e,t),this.size=n.size,this};var Rn=function(){try{var e=Ot(Object,"defineProperty");return e({},"",{}),e}catch(Np){}}();function kn(e,t,n){"__proto__"==t&&Rn?Rn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Pn=Object.prototype.hasOwnProperty;function Dn(e,t,n){var r=e[t];Pn.call(e,t)&&xt(r,n)&&(void 0!==n||t in e)||kn(e,t,n)}function On(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}var Wn={};function qn(e){return function(t){return e(t)}}Wn["[object Float32Array]"]=Wn["[object Float64Array]"]=Wn["[object Int8Array]"]=Wn["[object Int16Array]"]=Wn["[object Int32Array]"]=Wn["[object Uint8Array]"]=Wn["[object Uint8ClampedArray]"]=Wn["[object Uint16Array]"]=Wn["[object Uint32Array]"]=!0,Wn["[object Arguments]"]=Wn["[object Array]"]=Wn["[object ArrayBuffer]"]=Wn["[object Boolean]"]=Wn["[object DataView]"]=Wn["[object Date]"]=Wn["[object Error]"]=Wn["[object Function]"]=Wn["[object Map]"]=Wn["[object Number]"]=Wn["[object Object]"]=Wn["[object RegExp]"]=Wn["[object Set]"]=Wn["[object String]"]=Wn["[object WeakMap]"]=!1;var Gn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kn=Gn&&"object"==typeof module&&module&&!module.nodeType&&module,Yn=Kn&&Kn.exports===Gn&&it.process,$n=function(){try{return Kn&&Kn.require&&Kn.require("util").types||Yn&&Yn.binding&&Yn.binding("util")}catch(Np){}}(),zn=$n&&$n.isTypedArray,Qn=zn?qn(zn):function(e){return _t(e)&&Xn(e.length)&&!!Wn[pt(e)]},Jn=Object.prototype.hasOwnProperty;function Zn(e,t){var n=rt(e),r=!n&&xn(e),i=!n&&!r&&Vn(e),o=!n&&!r&&!i&&Qn(e),s=n||r||i||o,a=s?function(e,t){for(var n=-1,r=Array(e);++n0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(fi);function mi(e,t){return _i(di(e,t,ci),e+"")}function vi(e,t,n){(void 0!==n&&!xt(e[t],n)||void 0===n&&!(t in e))&&kn(e,t,n)}var gi=function(e,t,n){for(var r=-1,i=Object(e),o=n(e),s=o.length;s--;){var a=o[++r];if(!1===t(i[a],a,i))break}return e},yi=Function.prototype,Ei=Object.prototype,Ti=yi.toString,Si=Ei.hasOwnProperty,bi=Ti.call(Object);function Ai(e){if(!_t(e)||"[object Object]"!=pt(e))return!1;var t=Tr(e);if(null===t)return!0;var n=Si.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ti.call(n)==bi}function wi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Ii(e,t,n,r,i){e!==t&&gi(t,(function(o,s){if(i||(i=new In),yt(o))!function(e,t,n,r,i,o,s){var a=wi(e,n),u=wi(t,n),c=s.get(u);if(c)vi(e,n,c);else{var l=o?o(a,u,n+"",e,t,s):void 0,d=void 0===l;if(d){var h=rt(u),f=!h&&Vn(u),p=!h&&!f&&Qn(u);l=u,h||f||p?rt(a)?l=a:function(e){return _t(e)&&sr(e)}(a)?l=_r(a):f?(d=!1,l=pr(u,!0)):p?(d=!1,l=Yr(u,!0)):l=[]:Ai(u)||xn(u)?(l=a,xn(a)?l=function(e){return On(e,cr(e))}(a):yt(a)&&!Et(a)||(l=Qr(u))):d=!1}d&&(s.set(u,l),i(l,u,r,o,s),s.delete(u)),vi(e,n,l)}}(e,t,s,n,Ii,r,i);else{var a=r?r(wi(e,s),o,s+"",e,t,i):void 0;void 0===a&&(a=o),vi(e,s,a)}}),cr)}function Ri(e,t,n,r,i,o){return yt(e)&&yt(t)&&(o.set(t,e),Ii(e,t,void 0,Ri,o),o.delete(t)),e}function ki(e){return mi((function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,s&&function(e,t,n){if(!yt(n))return!1;var r=typeof t;return!!("number"==r?sr(n)&&Hn(t,n.length):"string"==r&&t in n)&&xt(n[t],e)}(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++r-1!==t.indexOf(e.mime))).sort(((e,n)=>e.mime===n.mime?e.priority-n.priority:t.indexOf(e.mime)-t.indexOf(n.mime)));if(!n.length)throw new Error(`No files available for ${this.constructor.displayName} external display.`);return n[0]},l(t,[{key:"active",get:function(){return this._active}},{key:"available",get:function(){return this._available}},{key:"element",get:function(){return document.createElement("div")}}],[{key:"displayName",get:function(){return"ExternalDisplay"}},{key:"supported",get:function(){return!1}},{key:"supportedVideoTypes",get:function(){return[]}}])}(wn);const Li={ABORT:"abort",CAN_PLAY:"canplay",CAN_PLAY_THROUGH:"canplaythrough",DURATION_CHANGE:"durationchange",EMPTIED:"emptied",ENDED:"ended",ENTER_PICTURE_IN_PICTURE:"enterpictureinpicture",LEAVE_PICTURE_IN_PICTURE:"leavepictureinpicture",ERROR:"error",LOADED_DATA:"loadeddata",LOADED_METADATA:"loadedmetadata",LOAD_START:"loadstart",PAUSE:"pause",PLAY:"play",PLAYING:"playing",PROGRESS:"progress",RATE_CHANGE:"ratechange",RESIZE:"resize",SEEKED:"seeked",SEEKING:"seeking",STALLED:"stalled",SUSPEND:"suspend",TIME_UPDATE:"timeupdate",VOLUME_CHANGE:"volumechange",WAITING:"waiting",WEBKIT_BEGIN_FULLSCREEN:"webkitbeginfullscreen",WEBKIT_END_FULLSCREEN:"webkitendfullscreen",WEBKIT_PRESENTATION_MODE_CHANGED:"webkitpresentationmodechanged"},Ci={ADD_TRACK:"addtrack",REMOVE_TRACK:"removetrack",CHANGE:"change"},Ni={AVAILABLE:"externaldisplayavailable",UNAVAILABLE:"externaldisplayunavailable",ACTIVATED:"externaldisplayactivated",DEACTIVATED:"externaldisplaydeactivated"},Mi={AIRPLAY_AVAILABLE:"available",AIRPLAY_UNAVAILABLE:"unavailable",AIRPLAY_ACTIVATED:"activated",AIRPLAY_DEACTIVATED:"deactivated"},xi={SCANNER_CHANGE:"scannerchange",SCANNER_ERROR:"scannererror",FILE_ERROR:"fileerror",FILE_SRC_UPDATE:"filesrcupdate",DOWNLOAD_START:"downloadstart",DOWNLOAD_END:"downloadend",DOWNLOAD_ERROR:"downloaderror",DOWNLOAD_TIMEOUT:"downloadtimeout",DRM_AUTH_FAILURE:"drmauthfailure",DRM_AUTH_SUCCESS:"drmauthsuccess",DRM_FAILURE:"drmfailure",DRM_KEY_SWITCH:"drmkeyswitch",DRM_OUTPUT_RESTRICTED:"drmoutputrestricted",EME_UNSUPPORTED:"emeunsupported",CURRENT_FILE_CHANGE:"currentfilechange",MEDIA_URL_EXPIRED:"mediaurlexpired",MEDIA_URL_BAD_REQUEST:"mediaurlbadrequest",STREAM_CHANGE:"streamchange",STREAM_CHANGE_START:"streamchangestart",STREAM_UPDATED:"streamupdated",STREAM_BUFFER_START:"streambufferstart",STREAM_BUFFER_END:"streambufferend",AVAILABLE_STREAMS_CHANGED:"availablestreamschanged",MEDIA_CAPABILITY_STREAMS_UNSUPPORTED:"mediacapabilitystreamsunsupported",DROPPED_FRAMES:"droppedframes",BANDWIDTH:"bandwidth",STREAM_TARGET_CHANGE:"streamtargetchange",CUE_POINT:"cuepoint",BUFFER_OCCUPANCY:"bufferoccupancy",MANIFEST_TIMEOUT:"manifesttimeout",MANIFEST_LOADED:"manifestloaded",STREAMS_LOADED:"streamsloaded",TEXT_SRC_UPDATE:"texttracksrcupdate",TEXT_TRACKS_AVAILABLE:"texttracksavailable",AV_DURATION_MISMATCH:"avdurationmismatch",BUFFER_STARTED:"bufferstarted",BUFFER_ENDED:"bufferended",QUOTA_EXCEEDED_ERROR:"quotaexceedederror",CHAPTER_CUES_UPDATED:"chaptercuesupdated",APPEND_BUFFER_END:"appendbufferend",DROPPED_FRAME_PERCENT_EXCEEDED:"droppedframepercentexceeded",LOAD_SEGMENT_FAILED:"loadsegmentfailed",AUDIO_TRACK_CHANGED:"audiotrackchanged",SEGMENT_CUES_LOADED:"segmentcuesloaded"},Ui={STREAM_ONLINE:"livestreamonline",STREAM_OFFLINE:"livestreamoffline",BUFFER_GAP_JUMP:"livebuffergapjump",BUFFER_GAP_JUMP_PREVENT:"livebuffergapjumpprevent",STALL_JUMP:"livestalljump",LATENCY_UPDATED:"latencyupdated"},Fi={CAMERA_UPDATE:"cameraupdate",CAMERA_CHANGE:"camerachange",MOTION_START:"motionstart",MOTION_END:"motionend",SPATIAL_UNSUPPORTED:"spatialunsupported",WEBVR_ENTER:"entervr",WEBVR_EXIT:"exitvr",WEBVR_HARDWARE_AVAILABLE:"webvrhardwareavailable",AMBISONIC_UNSUPPORTED:"ambisonicunsupported"},ji={MEDIASESSION_PLAY:"mediasessionplay",MEDIASESSION_PAUSE:"mediasessionpause",MEDIASESSION_SEEK_FORWARD:"mediasessionseekforward",MEDIASESSION_SEEK_TO:"mediasessionseekto",MEDIASESSION_SEEK_BACKWARD:"mediasessionseekbackward"},Vi=Object.assign({},Li,Ci,Ni,Mi,xi,Fi,Ui,ji);var Bi="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Hi(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var Xi=Hi((function(e,t){ /*! For license information please see hls-parser.min.js.LICENSE.txt */ self,e.exports=function(){return e={851:(e,t,n)=>{var r=n(771),i=r.getOptions,o=r.setOptions,s=n(463),a=n(367),u=n(890);e.exports={parse:s,stringify:a,types:u,getOptions:i,setOptions:o}},463:(e,t,n)=>{function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return n}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ns.targetDuration&&a.INVALIDPLAYLIST("EXTINF duration, when rounded to the nearest integer, MUST be less than or equal to the target duration"),u.duration=i.duration,u.title=i.title;else if("EXT-X-BYTERANGE"===r)s.compatibleVersion<4&&(s.compatibleVersion=4),u.byterange=i;else if("EXT-X-DISCONTINUITY"===r)u.parts.length>0&&a.INVALIDPLAYLIST("EXT-X-DISCONTINUITY must appear before the first EXT-X-PART tag of the Parent Segment."),u.discontinuity=!0;else if("EXT-X-KEY"===r)u.parts.length>0&&a.INVALIDPLAYLIST("EXT-X-KEY must appear before the first EXT-X-PART tag of the Parent Segment."),A(s,o),u.key=new h({method:o.METHOD,uri:o.URI,iv:o.IV,format:o.KEYFORMAT,formatVersion:o.KEYFORMATVERSIONS});else if("EXT-X-MAP"===r)u.parts.length>0&&a.INVALIDPLAYLIST("EXT-X-MAP must appear before the first EXT-X-PART tag of the Parent Segment."),s.compatibleVersion<5&&(s.compatibleVersion=5),s.hasMap=!0,u.map=new f({uri:o.URI,byterange:o.BYTERANGE});else if("EXT-X-PROGRAM-DATE-TIME"===r)u.programDateTime=i;else if("EXT-X-DATERANGE"===r){var d={};Object.keys(o).forEach((function(e){(e.startsWith("SCTE35-")||e.startsWith("X-"))&&(d[e]=o[e])})),u.dateRange=new p({id:o.ID,classId:o.CLASS,start:o["START-DATE"],end:o["END-DATE"],duration:o.DURATION,plannedDuration:o["PLANNED-DURATION"],endOnNext:o["END-ON-NEXT"],attributes:d})}else if("EXT-X-CUE-OUT"===r)u.markers.push(new _({type:"OUT",duration:i}));else if("EXT-X-CUE-IN"===r)u.markers.push(new _({type:"IN"}));else if("EXT-X-CUE-OUT-CONT"===r||"EXT-X-CUE"===r||"EXT-OATCLS-SCTE35"===r||"EXT-X-ASSET"===r||"EXT-X-SCTE35"===r)u.markers.push(new _({type:"RAW",tagName:r,value:i}));else if("EXT-X-PRELOAD-HINT"!==r||o.TYPE)if("EXT-X-PRELOAD-HINT"===r&&"PART"===o.TYPE&&l)a.INVALIDPLAYLIST("Servers should not add more than one EXT-X-PRELOAD-HINT tag with the same TYPE attribute to a Playlist.");else if("EXT-X-PART"!==r&&"EXT-X-PRELOAD-HINT"!==r||o.URI){if("EXT-X-PRELOAD-HINT"===r&&"MAP"===o.TYPE)c&&a.INVALIDPLAYLIST("Servers should not add more than one EXT-X-PRELOAD-HINT tag with the same TYPE attribute to a Playlist."),c=!0,s.hasMap=!0,u.map=new f({hint:!0,uri:o.URI,byterange:{length:o["BYTERANGE-LENGTH"],offset:o["BYTERANGE-START"]||0}});else if("EXT-X-PART"===r||"EXT-X-PRELOAD-HINT"===r&&"PART"===o.TYPE){"EXT-X-PART"!==r||o.DURATION||a.INVALIDPLAYLIST("EXT-X-PART: DURATION attribute is mandatory"),"EXT-X-PRELOAD-HINT"===r&&(l=!0);var m=new y({hint:"EXT-X-PRELOAD-HINT"===r,uri:o.URI,byterange:"EXT-X-PART"===r?o.BYTERANGE:{length:o["BYTERANGE-LENGTH"],offset:o["BYTERANGE-START"]||0},duration:o.DURATION,independent:o.INDEPENDENT,gap:o.GAP});u.parts.push(m)}}else a.INVALIDPLAYLIST("EXT-X-PART / EXT-X-PRELOAD-HINT: URI attribute is mandatory");else a.INVALIDPLAYLIST("EXT-X-PRELOAD-HINT: TYPE attribute is mandatory")},m=n;m<=r;m++)d(m);return u}function O(e,t,n,r,i){var o=t.discontinuity,s=t.key,u=t.map,c=t.byterange,l=t.uri;if(o&&(t.discontinuitySequence=n+1),s||(t.key=r),u||(t.map=i),c&&-1===c.offset){var d=e.segments;if(d.length>0){var h=d[d.length-1];h.byterange&&h.uri===l?c.offset=h.byterange.offset+h.byterange.length:a.INVALIDPLAYLIST("If offset of EXT-X-BYTERANGE is not present, a previous Media Segment MUST be a sub-range of the same media resource")}else a.INVALIDPLAYLIST("If offset of EXT-X-BYTERANGE is not present, a previous Media Segment MUST appear in the Playlist file")}return e.segments.push(t),[t.discontinuitySequence,t.key,t.map]}function L(e,t){var n=i(function(e){var t=e.indexOf(":");return-1===t?[e.slice(1).trim(),null]:[e.slice(1,t).trim(),e.slice(t+1).trim()]}(e),2),r=n[0],o=n[1],s=function(e){switch(e){case"EXTM3U":case"EXT-X-VERSION":return"Basic";case"EXTINF":case"EXT-X-BYTERANGE":case"EXT-X-DISCONTINUITY":case"EXT-X-KEY":case"EXT-X-MAP":case"EXT-X-PROGRAM-DATE-TIME":case"EXT-X-DATERANGE":case"EXT-X-CUE-OUT":case"EXT-X-CUE-IN":case"EXT-X-CUE-OUT-CONT":case"EXT-X-CUE":case"EXT-OATCLS-SCTE35":case"EXT-X-ASSET":case"EXT-X-SCTE35":case"EXT-X-PART":case"EXT-X-PRELOAD-HINT":return"Segment";case"EXT-X-TARGETDURATION":case"EXT-X-MEDIA-SEQUENCE":case"EXT-X-DISCONTINUITY-SEQUENCE":case"EXT-X-ENDLIST":case"EXT-X-PLAYLIST-TYPE":case"EXT-X-I-FRAMES-ONLY":case"EXT-X-SERVER-CONTROL":case"EXT-X-PART-INF":case"EXT-X-RENDITION-REPORT":case"EXT-X-SKIP":return"MediaPlaylist";case"EXT-X-MEDIA":case"EXT-X-STREAM-INF":case"EXT-X-I-FRAME-STREAM-INF":case"EXT-X-SESSION-DATA":case"EXT-X-SESSION-KEY":return"MasterPlaylist";case"EXT-X-INDEPENDENT-SEGMENTS":case"EXT-X-START":return"MediaorMasterPlaylist";default:return"Unknown"}}(r);if(function(e,t){if("Segment"===e||"MediaPlaylist"===e)return void 0===t.isMasterPlaylist?void(t.isMasterPlaylist=!1):void(t.isMasterPlaylist&&I());if("MasterPlaylist"===e){if(void 0===t.isMasterPlaylist)return void(t.isMasterPlaylist=!0);!1===t.isMasterPlaylist&&I()}}(s,t),"Unknown"===s)return null;"MediaPlaylist"===s&&"EXT-X-RENDITION-REPORT"!==r&&(t.hash[r]&&a.INVALIDPLAYLIST("There MUST NOT be more than one Media Playlist tag of each type in any Media Playlist"),t.hash[r]=!0);var u=i(function(e,t){switch(e){case"EXTM3U":case"EXT-X-DISCONTINUITY":case"EXT-X-ENDLIST":case"EXT-X-I-FRAMES-ONLY":case"EXT-X-INDEPENDENT-SEGMENTS":case"EXT-X-CUE-IN":return[null,null];case"EXT-X-VERSION":case"EXT-X-TARGETDURATION":case"EXT-X-MEDIA-SEQUENCE":case"EXT-X-DISCONTINUITY-SEQUENCE":case"EXT-X-CUE-OUT":return[a.toNumber(t),null];case"EXT-X-KEY":case"EXT-X-MAP":case"EXT-X-DATERANGE":case"EXT-X-MEDIA":case"EXT-X-STREAM-INF":case"EXT-X-I-FRAME-STREAM-INF":case"EXT-X-SESSION-DATA":case"EXT-X-SESSION-KEY":case"EXT-X-START":case"EXT-X-SERVER-CONTROL":case"EXT-X-PART-INF":case"EXT-X-PART":case"EXT-X-PRELOAD-HINT":case"EXT-X-RENDITION-REPORT":case"EXT-X-SKIP":return[null,w(t)];case"EXTINF":return[S(t),null];case"EXT-X-BYTERANGE":return[b(t),null];case"EXT-X-PROGRAM-DATE-TIME":return[new Date(t),null];default:return[t,null]}}(r,o),2);return{name:r,category:s,value:u[0],attributes:u[1]}}function C(e,t){var n;return t.isMasterPlaylist?n=function(e,t){var n,o=new m,s=r(e.entries());try{for(s.s();!(n=s.n()).done;){var u=i(n.value,2),c=u[0],l=u[1],f=l.name,p=l.value,_=l.attributes;if("EXT-X-VERSION"===f)o.version=p;else if("EXT-X-STREAM-INF"===f){var v=e[c+1];("string"!=typeof v||v.startsWith("#EXT"))&&a.INVALIDPLAYLIST("EXT-X-STREAM-INF must be followed by a URI line");var g=k(e,_,v,!1,t);g&&o.variants.push(g)}else if("EXT-X-I-FRAME-STREAM-INF"===f){var y=k(e,_,_.URI,!0,t);y&&o.variants.push(y)}else"EXT-X-SESSION-DATA"===f?function(){var e=new d({id:_["DATA-ID"],value:_.VALUE,uri:_.URI,language:_.LANGUAGE});o.sessionDataList.find((function(t){return t.id===e.id&&t.language===e.language}))&&a.INVALIDPLAYLIST("A Playlist MUST NOT contain more than one EXT-X-SESSION-DATA tag with the same DATA-ID attribute and the same LANGUAGE attribute."),o.sessionDataList.push(e)}():"EXT-X-SESSION-KEY"===f?function(){"NONE"===_.METHOD&&a.INVALIDPLAYLIST("EXT-X-SESSION-KEY: The value of the METHOD attribute MUST NOT be NONE");var e=new h({method:_.METHOD,uri:_.URI,iv:_.IV,format:_.KEYFORMAT,formatVersion:_.KEYFORMATVERSIONS});o.sessionKeyList.find((function(t){return P(t,e)}))&&a.INVALIDPLAYLIST("A Master Playlist MUST NOT contain more than one EXT-X-SESSION-KEY tag with the same METHOD, URI, IV, KEYFORMAT, and KEYFORMATVERSIONS attribute values."),A(t,_),o.sessionKeyList.push(e)}():"EXT-X-INDEPENDENT-SEGMENTS"===f?(o.independentSegments&&a.INVALIDPLAYLIST("EXT-X-INDEPENDENT-SEGMENTS tag MUST NOT appear more than once in a Playlist"),o.independentSegments=!0):"EXT-X-START"===f&&(o.start&&a.INVALIDPLAYLIST("EXT-X-START tag MUST NOT appear more than once in a Playlist"),"number"!=typeof _["TIME-OFFSET"]&&a.INVALIDPLAYLIST("EXT-X-START: TIME-OFFSET attribute is REQUIRED"),o.start={offset:_["TIME-OFFSET"],precise:_.PRECISE||!1})}}catch(e){s.e(e)}finally{s.f()}if(t.isClosedCaptionsNone){var E,T=r(o.variants);try{for(T.s();!(E=T.n()).done;)E.value.closedCaptions.length>0&&a.INVALIDPLAYLIST("If there is a variant with CLOSED-CAPTIONS attribute of NONE, all EXT-X-STREAM-INF tags MUST have this attribute with a value of NONE")}catch(e){T.e(e)}finally{T.f()}}return o}(e,t):!(n=function(e,t){var n,o=new v,s=-1,u=0,c=!1,l=0,d=null,h=null,f=!1,p=r(e.entries());try{for(p.s();!(n=p.n()).done;){var _=i(n.value,2),m=_[0],g=_[1],y=g.name,T=g.value,S=g.attributes;if("Segment"!==g.category){if("EXT-X-VERSION"===y)void 0===o.version?o.version=T:a.INVALIDPLAYLIST("A Playlist file MUST NOT contain more than one EXT-X-VERSION tag.");else if("EXT-X-TARGETDURATION"===y)o.targetDuration=t.targetDuration=T;else if("EXT-X-MEDIA-SEQUENCE"===y)o.segments.length>0&&a.INVALIDPLAYLIST("The EXT-X-MEDIA-SEQUENCE tag MUST appear before the first Media Segment in the Playlist."),o.mediaSequenceBase=u=T;else if("EXT-X-DISCONTINUITY-SEQUENCE"===y)o.segments.length>0&&a.INVALIDPLAYLIST("The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before the first Media Segment in the Playlist."),c&&a.INVALIDPLAYLIST("The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before any EXT-X-DISCONTINUITY tag."),o.discontinuitySequenceBase=l=T;else if("EXT-X-ENDLIST"===y)o.endlist=!0;else if("EXT-X-PLAYLIST-TYPE"===y)o.playlistType=T;else if("EXT-X-I-FRAMES-ONLY"===y)t.compatibleVersion<4&&(t.compatibleVersion=4),o.isIFrame=!0;else if("EXT-X-INDEPENDENT-SEGMENTS"===y)o.independentSegments&&a.INVALIDPLAYLIST("EXT-X-INDEPENDENT-SEGMENTS tag MUST NOT appear more than once in a Playlist"),o.independentSegments=!0;else if("EXT-X-START"===y)o.start&&a.INVALIDPLAYLIST("EXT-X-START tag MUST NOT appear more than once in a Playlist"),"number"!=typeof S["TIME-OFFSET"]&&a.INVALIDPLAYLIST("EXT-X-START: TIME-OFFSET attribute is REQUIRED"),o.start={offset:S["TIME-OFFSET"],precise:S.PRECISE||!1};else if("EXT-X-SERVER-CONTROL"===y)S["CAN-BLOCK-RELOAD"]||a.INVALIDPLAYLIST("EXT-X-SERVER-CONTROL: CAN-BLOCK-RELOAD=YES is mandatory for Low-Latency HLS"),o.lowLatencyCompatibility={canBlockReload:S["CAN-BLOCK-RELOAD"],canSkipUntil:S["CAN-SKIP-UNTIL"],holdBack:S["HOLD-BACK"],partHoldBack:S["PART-HOLD-BACK"]};else if("EXT-X-PART-INF"===y)S["PART-TARGET"]||a.INVALIDPLAYLIST("EXT-X-PART-INF: PART-TARGET attribute is mandatory"),o.partTargetDuration=S["PART-TARGET"];else if("EXT-X-RENDITION-REPORT"===y)S.URI||a.INVALIDPLAYLIST("EXT-X-RENDITION-REPORT: URI attribute is mandatory"),0===S.URI.search(/^[a-z]+:/)&&a.INVALIDPLAYLIST("EXT-X-RENDITION-REPORT: URI must be relative to the playlist uri"),o.renditionReports.push(new E({uri:S.URI,lastMSN:S["LAST-MSN"],lastPart:S["LAST-PART"]}));else if("EXT-X-SKIP"===y)S["SKIPPED-SEGMENTS"]||a.INVALIDPLAYLIST("EXT-X-SKIP: SKIPPED-SEGMENTS attribute is mandatory"),t.compatibleVersion<9&&(t.compatibleVersion=9),o.skip=S["SKIPPED-SEGMENTS"],u+=o.skip;else if("string"==typeof g){-1===s&&a.INVALIDPLAYLIST("A URI line is not preceded by any segment tags"),o.targetDuration||a.INVALIDPLAYLIST("The EXT-X-TARGETDURATION tag is REQUIRED");var b=D(e,g,s,m-1,u++,l,t);if(b){var A=i(O(o,b,l,d,h),3);l=A[0],d=A[1],h=A[2],!f&&b.parts.length>0&&(f=!0)}s=-1}}else-1===s&&(s=m),"EXT-X-DISCONTINUITY"===y&&(c=!0)}}catch(e){p.e(e)}finally{p.f()}if(-1!==s){var w=D(e,"",s,e.length-1,u++,l,t);if(w){var I=w.parts;I.length>0&&!o.endlist&&!I[I.length-1].hint&&a.INVALIDPLAYLIST("If the Playlist contains EXT-X-PART tags and does not contain an EXT-X-ENDLIST tag, the Playlist must contain an EXT-X-PRELOAD-HINT tag with a TYPE=PART attribute"),O(o,w,d,h),!f&&w.parts.length>0&&(f=!0)}}return function(e){for(var t=new Map,n=new Map,i=!1,o=!1,s=e.length-1;s>=0;s--){var u=e[s],c=u.programDateTime,l=u.dateRange;if(c&&(o=!0),l&&l.start){i=!0,l.endOnNext&&(l.end||l.duration)&&a.INVALIDPLAYLIST("An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST NOT contain DURATION or END-DATE attributes.");var d=l.start.getTime(),h=l.duration||0;l.end&&l.duration&&d+1e3*h!==l.end.getTime()&&a.INVALIDPLAYLIST("END-DATE MUST be equal to the value of the START-DATE attribute plus the value of the DURATION"),l.endOnNext&&(l.end=t.get(l.classId)),t.set(l.classId,l.start);var f=l.end?l.end.getTime():l.start.getTime()+1e3*(l.duration||0),p=n.get(l.classId);if(p){var _,m=r(p);try{for(m.s();!(_=m.n()).done;){var v=_.value;(v.start<=d&&v.end>d||v.start>=d&&v.start0&&ms&&a.INVALIDPLAYLIST("PART-TARGET is the maximum duration of any Partial Segment"),T0&&(w.lastPart=I.parts.length-1)}}catch(e){A.e(e)}finally{A.f()}}(o,f),o}(e,t)).isIFrame&&t.hasMap&&t.compatibleVersion<6&&(t.compatibleVersion=6),t.compatibleVersion>1&&(!n.version||n.version{function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return n}}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=s(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function s(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){r.push('AUDIO="'.concat(t.audio[0].groupId,'"'));var i,s=o(t.audio);try{for(s.s();!(i=s.n()).done;){var a=i.value;e.push(b(a))}}catch(e){s.e(e)}finally{s.f()}}if(t.video.length>0){r.push('VIDEO="'.concat(t.video[0].groupId,'"'));var u,c=o(t.video);try{for(c.s();!(u=c.n()).done;){var l=u.value;e.push(b(l))}}catch(e){c.e(e)}finally{c.f()}}if(t.subtitles.length>0){r.push('SUBTITLES="'.concat(t.subtitles[0].groupId,'"'));var d,h=o(t.subtitles);try{for(h.s();!(d=h.n()).done;){var f=d.value;e.push(b(f))}}catch(e){h.e(e)}finally{h.f()}}if(_.getOptions().allowClosedCaptionsNone&&0===t.closedCaptions.length)r.push("CLOSED-CAPTIONS=NONE");else if(t.closedCaptions.length>0){r.push('CLOSED-CAPTIONS="'.concat(t.closedCaptions[0].groupId,'"'));var p,m=o(t.closedCaptions);try{for(m.s();!(p=m.n()).done;){var v=p.value;e.push(b(v))}}catch(e){m.e(e)}finally{m.f()}}e.push("".concat(n,":").concat(r.join(","))),t.isIFrameOnly||e.push("".concat(t.uri))}function b(e){var t=["TYPE=".concat(e.type),'GROUP-ID="'.concat(e.groupId,'"'),'NAME="'.concat(e.name,'"')];return void 0!==e.isDefault&&t.push("DEFAULT=".concat(e.isDefault?"YES":"NO")),void 0!==e.autoselect&&t.push("AUTOSELECT=".concat(e.autoselect?"YES":"NO")),void 0!==e.forced&&t.push("FORCED=".concat(e.forced?"YES":"NO")),e.language&&t.push('LANGUAGE="'.concat(e.language,'"')),e.assocLanguage&&t.push('ASSOC-LANGUAGE="'.concat(e.assocLanguage,'"')),e.instreamId&&t.push('INSTREAM-ID="'.concat(e.instreamId,'"')),e.characteristics&&t.push('CHARACTERISTICS="'.concat(e.characteristics,'"')),e.channels&&t.push('CHANNELS="'.concat(e.channels,'"')),e.uri&&t.push('URI="'.concat(e.uri,'"')),"#EXT-X-MEDIA:".concat(t.join(","))}function A(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=!1;if(t.byterange&&e.push("#EXT-X-BYTERANGE:".concat(w(t.byterange))),t.discontinuity&&e.push("#EXT-X-DISCONTINUITY"),t.key){var s=T(t.key);s!==n&&(e.push(s),n=s)}if(t.map){var a=function(e){var t=['URI="'.concat(e.uri,'"')];return e.byterange&&t.push('BYTERANGE="'.concat(w(e.byterange),'"')),"#EXT-X-MAP:".concat(t.join(","))}(t.map);a!==r&&(e.push(a),r=a)}if(t.programDateTime&&e.push("#EXT-X-PROGRAM-DATE-TIME:".concat(_.formatDate(t.programDateTime))),t.dateRange&&e.push(function(e){var t=['ID="'.concat(e.id,'"')];return e.start&&t.push('START-DATE="'.concat(_.formatDate(e.start),'"')),e.end&&t.push('END-DATE="'.concat(e.end,'"')),e.duration&&t.push("DURATION=".concat(e.duration)),e.plannedDuration&&t.push("PLANNED-DURATION=".concat(e.plannedDuration)),e.classId&&t.push('CLASS="'.concat(e.classId,'"')),e.endOnNext&&t.push("END-ON-NEXT=YES"),Object.keys(e.attributes).forEach((function(n){n.startsWith("X-")?"number"==typeof e.attributes[n]?t.push("".concat(n,"=").concat(e.attributes[n])):t.push("".concat(n,'="').concat(e.attributes[n],'"')):n.startsWith("SCTE35-")&&t.push("".concat(n,"=").concat(_.byteSequenceToHex(e.attributes[n])))})),"#EXT-X-DATERANGE:".concat(t.join(","))}(t.dateRange)),t.markers.length>0&&I(e,t.markers),t.parts.length>0&&(o=R(e,t.parts)),o)return[n,r];var u=i<3?Math.round(t.duration):y(t.duration,function(e){var t=e.toString(10),n=t.indexOf(".");return-1===n?0:t.length-n-1}(t.duration));return e.push("#EXTINF:".concat(u,",").concat(unescape(encodeURIComponent(t.title||"")))),Array.prototype.push.call(e,"".concat(t.uri)),[n,r]}function w(e){var t=e.offset,n=e.length;return"".concat(n,"@").concat(t)}function I(e,t){var n,r=o(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("OUT"===i.type)e.push("#EXT-X-CUE-OUT:".concat(i.duration));else if("IN"===i.type)e.push("#EXT-X-CUE-IN");else if("RAW"===i.type){var s=i.value?":".concat(i.value):"";e.push("#".concat(i.tagName).concat(s))}}}catch(e){r.e(e)}finally{r.f()}}function R(e,t){var n,r=!1,i=o(t);try{for(i.s();!(n=i.n()).done;){var s=n.value;if(s.hint){var a=[];if(a.push("TYPE=PART"),a.push('URI="'.concat(s.uri,'"')),s.byterange){var u=s.byterange,c=u.offset,l=u.length;a.push("BYTERANGE-START=".concat(c)),l&&a.push("BYTERANGE-LENGTH=".concat(l))}e.push("#EXT-X-PRELOAD-HINT:".concat(a.join(","))),r=!0}else{var d=[];d.push("DURATION=".concat(s.duration)),d.push('URI="'.concat(s.uri,'"')),s.byterange&&d.push("BYTERANGE=".concat(w(s.byterange))),s.independent&&d.push("INDEPENDENT=YES"),s.gap&&d.push("GAP=YES"),e.push("#EXT-X-PART:".concat(d.join(",")))}}}catch(e){i.e(e)}finally{i.f()}return r}e.exports=function(e){_.PARAMCHECK(e),_.ASSERT("Not a playlist","playlist"===e.type);var t=new g(e.uri);return t.push("#EXTM3U"),e.version&&t.push("#EXT-X-VERSION:".concat(e.version)),e.independentSegments&&t.push("#EXT-X-INDEPENDENT-SEGMENTS"),e.start&&t.push("#EXT-X-START:TIME-OFFSET=".concat(y(e.start.offset)).concat(e.start.precise?",PRECISE=YES":"")),e.isMasterPlaylist?function(e,t){var n,r=o(t.sessionDataList);try{for(r.s();!(n=r.n()).done;){var i=n.value;e.push(E(i))}}catch(e){r.e(e)}finally{r.f()}var s,a=o(t.sessionKeyList);try{for(a.s();!(s=a.n()).done;){var u=s.value;e.push(T(u,!0))}}catch(e){a.e(e)}finally{a.f()}var c,l=o(t.variants);try{for(l.s();!(c=l.n()).done;)S(e,c.value)}catch(e){l.e(e)}finally{l.f()}}(t,e):function(e,t){var n="",r="";if(t.targetDuration&&e.push("#EXT-X-TARGETDURATION:".concat(t.targetDuration)),t.lowLatencyCompatibility){var s=t.lowLatencyCompatibility,a=s.canBlockReload,u=s.canSkipUntil,c=s.holdBack,l=s.partHoldBack,d=[];d.push("CAN-BLOCK-RELOAD=".concat(a?"YES":"NO")),void 0!==u&&d.push("CAN-SKIP-UNTIL=".concat(u)),void 0!==c&&d.push("HOLD-BACK=".concat(c)),void 0!==l&&d.push("PART-HOLD-BACK=".concat(l)),e.push("#EXT-X-SERVER-CONTROL:".concat(d.join(",")))}t.partTargetDuration&&e.push("#EXT-X-PART-INF:PART-TARGET=".concat(t.partTargetDuration)),t.mediaSequenceBase&&e.push("#EXT-X-MEDIA-SEQUENCE:".concat(t.mediaSequenceBase)),t.discontinuitySequenceBase&&e.push("#EXT-X-DISCONTINUITY-SEQUENCE:".concat(t.discontinuitySequenceBase)),t.playlistType&&e.push("#EXT-X-PLAYLIST-TYPE:".concat(t.playlistType)),t.isIFrame&&e.push("#EXT-X-I-FRAMES-ONLY"),t.skip>0&&e.push("#EXT-X-SKIP:SKIPPED-SEGMENTS=".concat(t.skip));var h,f=o(t.segments);try{for(f.s();!(h=f.n()).done;){var p=i(A(e,h.value,n,r,t.version),2);n=p[0],r=p[1]}}catch(e){f.e(e)}finally{f.f()}t.endlist&&e.push("#EXT-X-ENDLIST");var _,m=o(t.renditionReports);try{for(m.s();!(_=m.n()).done;){var v=_.value,g=[];g.push('URI="'.concat(v.uri,'"')),g.push("LAST-MSN=".concat(v.lastMSN)),void 0!==v.lastPart&&g.push("LAST-PART=".concat(v.lastPart)),e.push("#EXT-X-RENDITION-REPORT:".concat(g.join(",")))}}catch(e){m.e(e)}finally{m.f()}}(t,e),t.join("\n")}},890:(e,t,n)=>{function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return a(this,n)}}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var l=n(771),d=function e(t){c(this,e),l.PARAMCHECK(t),this.type=t},h=function(e){i(n,e);var t=s(n);function n(e){var r,i=e.isMasterPlaylist,o=e.uri,s=e.version,a=e.independentSegments,u=void 0!==a&&a,d=e.start,h=e.source;return c(this,n),r=t.call(this,"playlist"),l.PARAMCHECK(i),r.isMasterPlaylist=i,r.uri=o,r.version=s,r.independentSegments=u,r.start=d,r.source=h,r}return n}(d),f=function(e){i(n,e);var t=s(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c(this,n),r.isMasterPlaylist=!0,e=t.call(this,r);var i=r.variants,o=void 0===i?[]:i,s=r.currentVariant,a=r.sessionDataList,u=void 0===a?[]:a,l=r.sessionKeyList,d=void 0===l?[]:l;return e.variants=o,e.currentVariant=s,e.sessionDataList=u,e.sessionKeyList=d,e}return n}(h),p=function(e){i(n,e);var t=s(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c(this,n),r.isMasterPlaylist=!1,e=t.call(this,r);var i=r.targetDuration,o=r.mediaSequenceBase,s=void 0===o?0:o,a=r.discontinuitySequenceBase,u=void 0===a?0:a,l=r.endlist,d=void 0!==l&&l,h=r.playlistType,f=r.isIFrame,p=r.segments,_=void 0===p?[]:p,m=r.lowLatencyCompatibility,v=r.partTargetDuration,g=r.renditionReports,y=void 0===g?[]:g,E=r.skip,T=void 0===E?0:E,S=r.hash;return e.targetDuration=i,e.mediaSequenceBase=s,e.discontinuitySequenceBase=u,e.endlist=d,e.playlistType=h,e.isIFrame=f,e.segments=_,e.lowLatencyCompatibility=m,e.partTargetDuration=v,e.renditionReports=y,e.skip=T,e.hash=S,e}return n}(h),_=function(e){i(n,e);var t=s(n);function n(e){var r,i=e.uri,o=e.mimeType,s=e.data,a=e.duration,u=e.title,l=e.byterange,d=e.discontinuity,h=e.mediaSequenceNumber,f=void 0===h?0:h,p=e.discontinuitySequence,_=void 0===p?0:p,m=e.key,v=e.map,g=e.programDateTime,y=e.dateRange,E=e.markers,T=void 0===E?[]:E,S=e.parts,b=void 0===S?[]:S;return c(this,n),(r=t.call(this,"segment")).uri=i,r.mimeType=o,r.data=s,r.duration=a,r.title=u,r.byterange=l,r.discontinuity=d,r.mediaSequenceNumber=f,r.discontinuitySequence=_,r.key=m,r.map=v,r.programDateTime=g,r.dateRange=y,r.markers=T,r.parts=b,r}return n}(d),m=function(e){i(n,e);var t=s(n);function n(e){var r,i=e.hint,o=void 0!==i&&i,s=e.uri,a=e.duration,u=e.independent,d=e.byterange,h=e.gap;return c(this,n),r=t.call(this,"part"),l.PARAMCHECK(s),r.hint=o,r.uri=s,r.duration=a,r.independent=u,r.duration=a,r.byterange=d,r.gap=h,r}return n}(d);e.exports={Rendition:function e(t){var n=t.type,r=t.uri,i=t.groupId,o=t.language,s=t.assocLanguage,a=t.name,u=t.isDefault,d=t.autoselect,h=t.forced,f=t.instreamId,p=t.characteristics,_=t.channels;c(this,e),l.PARAMCHECK(n,i,a),l.CONDITIONALASSERT(["SUBTITLES"===n,r],["CLOSED-CAPTIONS"===n,f],["CLOSED-CAPTIONS"===n,!r],[h,"SUBTITLES"===n]),this.type=n,this.uri=r,this.groupId=i,this.language=o,this.assocLanguage=s,this.name=a,this.isDefault=u,this.autoselect=d,this.forced=h,this.instreamId=f,this.characteristics=p,this.channels=_},Variant:function e(t){var n=t.uri,r=t.isIFrameOnly,i=void 0!==r&&r,o=t.bandwidth,s=t.averageBandwidth,a=t.codecs,u=t.resolution,d=t.frameRate,h=t.hdcpLevel,f=t.audio,p=void 0===f?[]:f,_=t.video,m=void 0===_?[]:_,v=t.subtitles,g=void 0===v?[]:v,y=t.closedCaptions,E=void 0===y?[]:y,T=t.currentRenditions,S=void 0===T?{audio:0,video:0,subtitles:0,closedCaptions:0}:T;c(this,e),l.PARAMCHECK(n,o),this.uri=n,this.isIFrameOnly=i,this.bandwidth=o,this.averageBandwidth=s,this.codecs=a,this.resolution=u,this.frameRate=d,this.hdcpLevel=h,this.audio=p,this.video=m,this.subtitles=g,this.closedCaptions=E,this.currentRenditions=S},SessionData:function e(t){var n=t.id,r=t.value,i=t.uri,o=t.language;c(this,e),l.PARAMCHECK(n,r||i),l.ASSERT("SessionData cannot have both value and uri, shoud be either.",!(r&&i)),this.id=n,this.value=r,this.uri=i,this.language=o},Key:function e(t){var n=t.method,r=t.uri,i=t.iv,o=t.format,s=t.formatVersion;c(this,e),l.PARAMCHECK(n),l.CONDITIONALPARAMCHECK(["NONE"!==n,r]),l.CONDITIONALASSERT(["NONE"===n,!(r||i||o||s)]),this.method=n,this.uri=r,this.iv=i,this.format=o,this.formatVersion=s},MediaInitializationSection:function e(t){var n=t.hint,r=void 0!==n&&n,i=t.uri,o=t.mimeType,s=t.byterange;c(this,e),l.PARAMCHECK(i),this.hint=r,this.uri=i,this.mimeType=o,this.byterange=s},DateRange:function e(t){var n=t.id,r=t.classId,i=t.start,o=t.end,s=t.duration,a=t.plannedDuration,u=t.endOnNext,d=t.attributes,h=void 0===d?{}:d;c(this,e),l.PARAMCHECK(n),l.CONDITIONALPARAMCHECK([!0===u,r]),l.CONDITIONALASSERT([o,i],[o,i<=o],[s,s>=0],[a,a>=0]),this.id=n,this.classId=r,this.start=i,this.end=o,this.duration=s,this.plannedDuration=a,this.endOnNext=u,this.attributes=h},SpliceInfo:function e(t){var n=t.type,r=t.duration,i=t.tagName,o=t.value;c(this,e),l.PARAMCHECK(n),l.CONDITIONALPARAMCHECK(["OUT"===n,r]),l.CONDITIONALPARAMCHECK(["RAW"===n,i]),this.type=n,this.duration=r,this.tagName=i,this.value=o},Playlist:h,MasterPlaylist:f,MediaPlaylist:p,Segment:_,PartialSegment:m,RenditionReport:function e(t){var n=t.uri,r=t.lastMSN,i=t.lastPart;c(this,e),l.PARAMCHECK(n),this.uri=n,this.lastMSN=r,this.lastPart=i}}},771:e=>{function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return n}}(e,t)||r(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw s}}}}function r(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:10;if("number"==typeof e)return e;var n=10===t?Number.parseFloat(e,t):Number.parseInt(e,t);return Number.isNaN(n)?0:n}e.exports={THROW:s,ASSERT:function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;n<=t&&s(new Error("end must be larger than start : start=".concat(t,", end=").concat(n)));for(var r=[],i=t;i2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=0,o=0;i1&&void 0!==arguments[1]?arguments[1]:" ";return e?(e=e.trim()," "===t||(e.startsWith(t)&&(e=e.slice(1)),e.endsWith(t)&&(e=e.slice(0,-1))),e):e},splitByCommaWithPreservingQuotes:function(e){for(var t=[],n=!0,r=0,i=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:{};o=Object.assign(o,e)},getOptions:function(){return Object.assign({},o)}}}},t={},function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}(851);var e,t}()}));const Wi={},qi={variant:0,audio:0,subtitles:0};let Gi=function(e){function t(t,n){var r;return(r=e.call(this,t)||this).type=r.type.toLowerCase(),r.index=qi[r.type]++,r.id=r.uri,r.label=r.name,r.codecs=Qi(n,r.type),r.url=null,r.playlist=null,r}return p(t,e),t.prototype.getSegmentBySN=function(e){return this.playlist.getSegmentBySN(e)},l(t,[{key:"mimeType",get:function(){return this.playlist&&Ji(this.playlist.segments[0].uri,this.type)}},{key:"initSegment",get:function(){const e=this;return{get url(){var t;return null==(t=e.playlist)?void 0:t.initSegment.url}}}},{key:"segments",get:function(){var e;return(null==(e=this.playlist)?void 0:e.segments)||[]}},{key:"targetDuration",get:function(){var e;return null==(e=this.playlist)?void 0:e.targetDuration}},{key:"hasProgramDateTime",get:function(){return this.playlist.hasProgramDateTime}},{key:"age",get:function(){var e;return null==(e=this.playlist)?void 0:e.age}},{key:"edge",get:function(){var e;return null==(e=this.playlist)?void 0:e.edge}},{key:"parts",get:function(){var e;return(null==(e=this.playlist)?void 0:e.parts)||[]}},{key:"partTargetDuration",get:function(){var e;return null==(e=this.playlist)?void 0:e.partTargetDuration}},{key:"lowLatencyCompatibility",get:function(){return this.playlist.lowLatencyCompatibility}}])}(Xi.types.Rendition),Ki=function(e){function t(t){var n,r,i;return(i=e.call(this,t)||this).audio=i.audio.map((e=>Wi[e.uri]||(Wi[e.uri]=new Gi(e,i.codecs)))),i.subtitles=i.subtitles.map((e=>Wi[e.uri]||(Wi[e.uri]=new Gi(e,i.codecs)))),i.type="video",i.index=qi.variant++,i.id=i.uri,i.bitrate=i.bandwidth,i.avg_bitrate=i.averageBandwidth,i.framerate=i.frameRate||30,i.height=null==(n=i.resolution)?void 0:n.height,i.width=null==(r=i.resolution)?void 0:r.width,i.codecs=function(e,t=zi){return e?t:Qi(t,"video")}(!i.audio.length,t.codecs),i.url=null,i.playlist=null,i}return p(t,e),t.prototype.getSegmentBySN=function(e){return this.playlist.getSegmentBySN(e)},l(t,[{key:"mimeType",get:function(){return this.playlist&&Ji(this.playlist.segments[0].uri,"video")}},{key:"initSegment",get:function(){const e=this;return{get url(){var t;return null==(t=e.playlist)?void 0:t.initSegment.url}}}},{key:"segments",get:function(){var e;return(null==(e=this.playlist)?void 0:e.segments)||[]}},{key:"targetDuration",get:function(){var e;return null==(e=this.playlist)?void 0:e.targetDuration}},{key:"hasProgramDateTime",get:function(){return this.playlist.hasProgramDateTime}},{key:"age",get:function(){var e;return null==(e=this.playlist)?void 0:e.age}},{key:"edge",get:function(){var e;return null==(e=this.playlist)?void 0:e.edge}},{key:"parts",get:function(){var e;return(null==(e=this.playlist)?void 0:e.parts)||[]}},{key:"partTargetDuration",get:function(){var e;return null==(e=this.playlist)?void 0:e.partTargetDuration}},{key:"lowLatencyCompatibility",get:function(){return this.playlist.lowLatencyCompatibility}}])}(Xi.types.Variant),Yi=function(e){function t(t){var n;return(n=e.call(this,t)||this).variants=n.variants.map((e=>new Ki(e))),n}return p(t,e),l(t,[{key:"video",get:function(){return this.variants}},{key:"audio",get:function(){return w(I(this.variants,(e=>e.audio)))}},{key:"subtitles",get:function(){return w(I(this.variants,(e=>e.subtitles)))}},{key:"captions",get:function(){return this.subtitles}}])}(Xi.types.MasterPlaylist);const $i={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/]},zi="avc1.42E01E,mp4a.40.2";function Qi(e=zi,t){const n=e.split(","),r=$i[t.toLowerCase()]||[];return n.find((e=>r.some((t=>t.test(e.trim())))))}function Ji(e,t){const n=e.split(".").pop().split("?")[0],r={fmp4:"mp4",m4s:"mp4",ts:"mp2t"}[n]||n||"mp4";return`${t.toLowerCase()}/${r}`}const Zi=function(e){return function(){for(var t=[],n=0;n{var o,s;if(void 0===i.mediaSequenceNumber)throw new Error("No valid segment sequence number found");let a=to(eo(e.url),i.uri);const u=(null==(o=no[a])?void 0:o.update(i))||new io(g(g({},i),{},{type:e.type,stream:e.stream,targetDuration:t.targetDuration,url:a,start:n}));a&&(no[a]=u);const c=i.parts.map(((n,r)=>{var i;return a=to(eo(e.url),n.uri),(null==(i=no[a])?void 0:i.update(n))||(no[a]=new oo(g(g({},n),{},{type:e.type,stream:e.stream,partTargetDuration:t.partTargetDuration,mediaSequenceNumber:u.mediaSequenceNumber,url:a,part:r})))}));u.parts=c,(s=e.parts).push.apply(s,T(c)),function(e,t){e.programDateTime?e.programDateTime=new Date(e.programDateTime).getTime():null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),Number.isFinite(e.programDateTime)||(e.programDateTime=null)}(u,e.segments[e.segments.length-1]),u.programDateTime&&-1===r&&(r=e.segments.length),n+=u.duration||0,e.segments.push(u)})),r>0&&function(e,t){let n=e[t];for(let r=t;r--;){const t=e[r];if(!t)return;t.programDateTime=n.programDateTime-1e3*t.duration,n=t}}(e.segments,r)}(o,t),o}p(t,e);var n=t.prototype;return n.reloaded=function(e){if(!e)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t,this.advanced=this.endSN>e.endSN||t>0||0===t&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.timeOffset=e.timeOffset},n.getSegmentBySN=function(e){return this.segments.find((t=>t.mediaSequenceNumber===e))},l(t,[{key:"availableParts",get:function(){var e;return null!=(e=this.parts)&&e.length?this.parts.filter((e=>!e.hint)):[]}},{key:"timeOffset",get:function(){return this._timeOffset||0},set:function(e){this._timeOffset=e,this.segments.forEach((t=>{t.timeOffset=e}))}},{key:"segmentEnd",get:function(){var e;return null!=(e=this.segments)&&e.length?this.segments[this.segments.length-1].end:0}},{key:"segmentEndPDT",get:function(){var e;return null!=(e=this.segments)&&e.length?this.segments[this.segments.length-1].programDateTime:0}},{key:"endSN",get:function(){var e;return null!=(e=this.segments)&&e.length?this.segments[this.segments.length-1].mediaSequenceNumber:0}},{key:"hasProgramDateTime",get:function(){return!!this.segments.length&&Number.isFinite(this.segmentEndPDT)}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"partEnd",get:function(){var e;return null!=(e=this.parts)&&e.length?this.parts[this.parts.length-1].end:0}},{key:"lastPartIndex",get:function(){var e;return null!=(e=this.parts)&&e.length?this.parts[this.parts.length-1].part:-1}},{key:"lastAvailablePartIndex",get:function(){var e;return null!=(e=this.availableParts)&&e.length?this.availableParts[this.availableParts.length-1].part:-1}},{key:"lastPartSn",get:function(){var e;return null!=(e=this.parts)&&e.length?this.parts[this.parts.length-1].mediaSequenceNumber:this.endSN}},{key:"lastAvailablePartSn",get:function(){var e;return null!=(e=this.availableParts)&&e.length?this.availableParts[this.availableParts.length-1].mediaSequenceNumber:this.endSN}},{key:"edge",get:function(){return this.partEnd||this.segmentEnd}}])}(Xi.types.MediaPlaylist),io=function(e){function t(t){var n;return(n=e.call(this,t)||this).type=t.type,n.stream=t.stream,n.targetDuration=t.targetDuration,n.start=t.start,n.parts=t.parts,n.url=t.url,n}p(t,e);var n=t.prototype;return n.getPart=function(e){return e>=0&&e1&&!0===this._parts[0].independent&&!this._parts[1].independent){var t;let e;null==(t=this._parts)||t.forEach((t=>{t.dependentOn=!0===t.independent?null:e,e=t}))}},n._syncPartsWithStart=function(){var e;let t=this._start;null==(e=this._parts)||e.forEach((e=>{e.start=t,t+=e.duration||e.partTargetDuration||0}))},n._syncPartsWithPDT=function(){var e;let t=this.programDateTime;null==(e=this._parts)||e.forEach((e=>{e.programDateTime=t,t+=1e3*(e.duration||e.partTargetDuration||0)}))},n.update=function({uri:e}){return this.uri=e,this},l(t,[{key:"timeOffset",get:function(){return this._timeOffset||0},set:function(e){this._timeOffset=e,this.parts.forEach((t=>{t.timeOffset=e}))}},{key:"start",get:function(){return this._start+this.timeOffset},set:function(e){this._start=e,this._syncPartsWithStart()}},{key:"programDateTime",get:function(){return this._programDateTime},set:function(e){this._programDateTime=e,this._syncPartsWithPDT()}},{key:"parts",get:function(){return this._parts},set:function(e){this._parts=e,this._linkParts(),this._syncPartsWithStart(),this._syncPartsWithPDT()}},{key:"segment",get:function(){return this.mediaSequenceNumber}},{key:"end",get:function(){return this.start+(this.duration||this.targetDuration||0)}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Number.isFinite(this.programDateTime))return null;const e=Number.isFinite(this.duration)?this.duration:0;return this.programDateTime+1e3*e}}])}(Xi.types.Segment),oo=function(e){function t(t){var n;return(n=e.call(this,t)||this).type=t.type,n.stream=t.stream,n.partTargetDuration=t.partTargetDuration,n.start=t.start,n.url=t.url,n.mediaSequenceNumber=t.mediaSequenceNumber,n.part=t.part,n.programDateTime=null,n.timeOffset=0,n.dependentOn=null,n}return p(t,e),t.prototype.update=function({hint:e,duration:t,independent:n}){return this.hint=e,this.duration=t,this.independent=n,this},l(t,[{key:"segment",get:function(){return this.mediaSequenceNumber}},{key:"start",get:function(){return this._start+this.timeOffset},set:function(e){this._start=e}},{key:"end",get:function(){return this.start+(this.duration||this.partTargetDuration||0)}}])}(Xi.types.PartialSegment);function so(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const ao=co((function(e){return so(Ke(e).json(),(function(e){return Zi(e.url.hls)}))}));function uo(e,t){try{var n=e()}catch(Np){return t(Np)}return n&&n.then?n.then(void 0,t):n}function co(e){return function(){for(var t=[],n=0;n0?i._mergeDeltaPlaylistUpdates(t.playlist,a):a;if(t.playlist=u,t.playlist.advancedDateTime=Date.now()-e.perfTimings.duration,t.playlist.reloaded(i._oldPlaylist),i._oldPlaylist=t.playlist,i._masterLoader.fire("1",t,n),i.lowLatencyMode&&null!=(o=t.playlist.lowLatencyCompatibility)&&o.canBlockReload){const e=a.lastAvailablePartIndex,n=-1!==e?a.lastAvailablePartSn:a.endSN+1,r=-1!==e?e+1:void 0;i.update(t,!1,{_HLS_msn:n,_HLS_part:r})}else if(i.alive){clearTimeout(i._timer);const e=function(e,t){return 1e3*(t&&e.partTargetDuration||e.targetDuration)}(t,i.lowLatencyMode);i._timer=setTimeout((()=>i.update(t)),e)}}))}))}))}),(function(e){e instanceof Ie||i._masterLoader.fire("2",e)}))):so()}catch(Np){return Promise.reject(Np)}},n.stop=function(){var e;clearTimeout(this._timer),null==(e=this._requestPromise)||e.abort(),this._requestPromise=null,this.alive=!1},n._isExpired=function(){return this._expirationTime&&this._expirationTime-1e4<=Date.now()},n._beforeRetry=function(e){const t=this;return co((function(n,r){return so(t._masterLoader.refreshBaseUrl(),(function(r){n.url=to(r,e.uri),t._expirationTime=function(e){const t=Te(e),n=t&&t.pathname.match(/^\/(exp=)?(\d{10,})/);return n&&1e3*n[2]}(n.url)}))}))},n._mergeDeltaPlaylistUpdates=function(e,t){e.mediaSequenceBasee.mediaSequenceNumber>=t.mediaSequenceBase)));const n=t.segments.filter((t=>t.mediaSequenceNumber>e.endSN));return t.segments=[].concat(T(e.segments),T(n)),t},l(t,[{key:"baseUrl",get:function(){var e;return null==(e=this._masterLoader)?void 0:e.baseUrl}}])}();const po={disableDeltaUpdates:!1};let _o=function(t){function n(e=po){var n;return(n=t.call(this)||this).video=new fo(n,"video"),n.audio=new fo(n,"audio"),n.subtitles=new fo(n,"subtitles"),n._disableDeltaUpdates=e.disableDeltaUpdates,n._activeStreamIndex={},n}p(n,t);var r=n.prototype;return r.start=function(e,t){try{const n=this;return n._refreshUrl=t,so(Zi(e),(function(e){return n._masterPlaylistUrl=e,so(n._fetchMasterPlaylist(n._masterPlaylistUrl),(function(e){return n.manifest=new Yi(Xi.parse(e)),n.manifest}))}))}catch(Np){return Promise.reject(Np)}},r.stop=function(){this.video.stop(),this.audio.stop(),this.subtitles.stop(),this.video=new fo(this,"video",this.video),this.audio=new fo(this,"audio",this.audio),this.subtitles=new fo(this,"subtitles",this.subtitles)},r.update=function(e){try{const t=this;return so(t.video.update(t.activeStream("video"),e),(function(){return ho(Promise.all([t.audio.update(t.activeStream("audio"),e),t.subtitles.update(t.activeStream("subtitles"),e)]))}))}catch(Np){return Promise.reject(Np)}},r.switchTo=function(e,t){try{const n=this;return t===n._activeStreamIndex[e]?so():(n[e].stop(),n[e]=new fo(n,e,n[e]),n._activeStreamIndex[e]=t,so(ho(n[e].update(n.activeStream(e),!0))))}catch(Np){return Promise.reject(Np)}},r.activeStream=function(e){return this.manifest[e].find((({index:t})=>t===this._activeStreamIndex[e]))},r.activeStreamIndex=function(e){return this._activeStreamIndex[e]},r.refreshBaseUrl=function(){try{const e=this;return so(ao(e._refreshUrl),(function(t){return e._masterPlaylistUrl=t,e.baseUrl}))}catch(Np){return Promise.reject(Np)}},r._fetchMasterPlaylist=function(t){try{let n=!1;const r=this;let i;return so(function(e,t){return e&&e.then?e.then(t):t(e)}(uo((function(){const n={type:e.MANIFEST,retry:8,retryStatus:mo,hooks:{beforeRetry:[r._beforeRetryMasterPlaylist.bind(r)]}};return r.dvrEnabled||(n.searchParams={min_seconds:30}),so(Ke(t,n).text(),(function(e){i=e}))}),(function(){throw new Error("Master playlist failed to load. Giving up updating after 8 attempts.")})),(function(e){return n?e:i})))}catch(Np){return Promise.reject(Np)}},r._beforeRetryMasterPlaylist=function(e,t,n){try{const t=this;return so(ao(t._refreshUrl),(function(n){t._masterPlaylistUrl=n,e.url=t._masterPlaylistUrl}))}catch(Np){return Promise.reject(Np)}},l(n,[{key:"baseUrl",get:function(){return eo(this._masterPlaylistUrl)}},{key:"lowLatencyMode",get:function(){var e;return!(null==(e=this.video)||!e.lowLatencyMode)},set:function(e){this.video.lowLatencyMode=e,this.audio.lowLatencyMode=e,this.subtitles.lowLatencyMode=e}},{key:"dvrEnabled",get:function(){var e;return!(null==(e=this.video)||!e.dvrEnabled)},set:function(e){this.video.dvrEnabled=e,this.audio.dvrEnabled=e,this.subtitles.dvrEnabled=e}},{key:"disableDeltaUpdates",get:function(){return this._disableDeltaUpdates}}])}(wn);function mo(e){return[403,404,410].includes(e)||t.retryStatus(e)}const vo=["width","height","bandwidth","duration","timescale","presentationTimeOffset"];function go(e){const t={};for(let n=0;ne.nodeType===Node.TEXT_NODE||e.nodeType===Node.CDATA_SECTION_NODE))?e.textContent.trim():null}function Ao(e){if(!e)return null;const t=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/.exec(e);let n=31536e3*parseFloat(t[2]||0)+2592e3*parseFloat(t[4]||0)+86400*parseFloat(t[6]||0)+3600*parseFloat(t[8]||0)+60*parseFloat(t[10]||0)+parseFloat(t[12]||0);return void 0!==t[1]&&(n=-n),n}const wo={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"};var Io=Object.freeze({__proto__:null,fetchMasterPlaylistUrl:Zi,PLAYLIST_UPDATE:"1",PLAYLIST_ERROR:"2",M3U8Loader:_o,Rendition:Gi,Variant:Ki,M3U8Manifest:Yi,convertTsCodecs:function(e){let t=e.replace(/mp2t/i,"mp4");const n=/avc1\.(66|77|100)\.(\d+)/.exec(t);if(n){let e="avc1.";const r=n[1];e+="66"===r?"4200":"77"===r?"4d00":"6400";const i=Number(n[2]);e+=(i>>4).toString(16),e+=(15&i).toString(16),t=t.replace(n[0],e)}return t},parseMPD:function(e,t,n={}){let r,i,o,s,a,u;function c(e,t){return e.mimeType?0===e.mimeType.indexOf(t):e.representations.find((e=>0===e.mimeType.indexOf(t)))}function l(e,t){let r;return"audio"===t&&n.audioLang&&(r=e[0].adaptationSets.find((e=>e.lang===n.audioLang&&c(e,t)))),r||(r=e[0].adaptationSets.find((e=>c(e,t)))||{}),(r.representations||[]).map((e=>{var t;return g(g({},e),{},{avg_bitrate:e.bandwidth,base_url:"",bitrate:e.bandwidth,duration:o,framerate:So(e.frameRate),init_segment_url:e.initSegment,max_segment_duration:s,mime_type:null!==(t=r.mimeType)&&void 0!==t?t:e.mimeType})}))}function d(e,t){const n=[];for(let r=0;r{e.framerate=parseInt(i.frameRate,10)})),1===i.representations.length&&(i.width&&(i.representations[0].width=i.width),i.height&&(i.representations[0].height=i.height)),n.push(i)}return n}function h(e,t){const n=[];for(let r=0;rn){if(u!==i.length-1)throw new Error("segment list duration is greater than the period's duraton");e=s+(n-s)}const r=Eo(i[u],"media");o.segments.push({url:t+r,start:s,end:e}),s+=a}return o}return function(){const n=(new DOMParser).parseFromString(e,"application/xml");r=n.getElementsByTagName("MPD")[0],i=function(){const e=function(e,t){let n=function(e,t){return Array.prototype.filter.call(e.childNodes,(function(e){return e instanceof Element&&e.tagName===t}))}(e,t);return 1!==n.length?null:n[0]}(r,"BaseURL");return e&&bo(e)||t.substr(0,t.lastIndexOf("/")+1)}(),o=Ao(Eo(r,"mediaPresentationDuration")),s=Ao(Eo(r,"maxSegmentDuration"));const c=function(){const e=[],t=r.getElementsByTagName("Period");for(let n=0;n({initDataType:"cenc",initData:e})))}catch(Np){throw new Error("Bad pshh encoding")}c.length>0&&(o[wo[a]]=o[wo[a]]||{},o[wo[a]].cenc=c[0]);const l=yo(s,"usn:microsoft:playready","pro").map(bo);c=[];try{c=l.map((e=>({initDataType:"mspr",initData:e})))}catch(Np){throw new Error("Bad pro encoding")}c.length>0&&(o[wo[a]]=o[wo[a]]||{},o[wo[a]].mspr=c[0])}return n?{is_drm:!0,key_info:{cdms:T(new Set(i)),key_id:n,inits:o}}:{}}()),{},{audio:u,video:a,mediaPresentationDuration:o,maxSegmentDuration:s,baseUrl:i,base_url:i,get profiles(){return Eo(r,"profiles")},get type(){return Eo(r,"type")},get minimumUpdatePeriod(){return Ao(Eo(r,"minimumUpdatePeriod"))},get publishTime(){return Eo(r,"publishTime")},get availabilityStartTime(){return Eo(r,"availabilityStartTime")},get timeShiftBufferDepth(){return Ao(Eo(r,"timeShiftBufferDepth"))},get suggestedPresentationDelay(){return Ao(Eo(r,"suggestedPresentationDelay"))},get minBufferTime(){return Ao(Eo(r,"minBufferTime"))}})}()}});function Ro(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}let ko=function(e){function t(t){var n;return(n=e.call(this,t)||this)._videoElement=document.createElement("video"),n._videoElement.setAttribute("data-airplay",""),n._videoElement.setAttribute("x-webkit-airplay","allow"),n.addVideoEventListeners(),n}p(t,e);var n=t.prototype;return n.addVideoEventListeners=function(e=this._videoElement){e.addEventListener(Li.LOADED_METADATA,(e=>{this.fire(Li.LOADED_METADATA,e)})),e.addEventListener("webkitplaybacktargetavailabilitychanged",(e=>{switch(e.availability){case"available":this._available||(this._available=!0,this.fire(Mi.AIRPLAY_AVAILABLE));break;case"not-available":this._available&&(this._available=!1,this.fire(Mi.AIRPLAY_UNAVAILABLE))}})),e.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",(e=>{if(e.target.webkitCurrentPlaybackTargetIsWireless)return this._active=!0,void this.fire(Mi.AIRPLAY_ACTIVATED);this._active=!1,this.fire(Mi.AIRPLAY_DEACTIVATED)}))},n.showPicker=function(){this._videoElement.webkitShowPlaybackTargetPicker(),this.loadMetadata().then((()=>this._videoElement.webkitShowPlaybackTargetPicker())).catch((()=>{}))},n.loadMetadata=function(){try{const e=this;return e._videoElement.readyState>=1?Promise.resolve():Ro(new Promise(function(e){return function(){for(var t=[],n=0;n{t()})),Ro(Zi(e.getFile().src),(function(t){e._videoElement.src=t}))}))))}catch(Np){return Promise.reject(Np)}},l(t,[{key:"element",get:function(){return this._videoElement},set:function(e){if(!(e instanceof HTMLVideoElement))throw new TypeError("The element for AirPlay must be a