/* VimeoPlayer - v4.39.41 - 2024-12-19 - https://player.vimeo.com/NOTICE.txt */ var e=Object.prototype;function t(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}function n(e,t){return function(n){return e(t(n))}}var r=n(Object.keys,Object),i=Object.prototype.hasOwnProperty;function o(e){if(!t(e))return r(e);var n=[];for(var o in Object(e))i.call(e,o)&&"constructor"!=o&&n.push(o);return n}var s="object"==typeof global&&global&&global.Object===Object&&global,a="object"==typeof self&&self&&self.Object===Object&&self,u=s||a||Function("return this")(),c=u.Symbol,l=Object.prototype,d=l.hasOwnProperty,h=l.toString,f=c?c.toStringTag:void 0,p=Object.prototype.toString,_=c?c.toStringTag:void 0;function m(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_&&_ in Object(e)?function(e){var t=d.call(e,f),n=e[f];try{e[f]=void 0;var r=!0}catch(kh){}var i=h.call(e);return r&&(t?e[f]=n:delete e[f]),i}(e):function(e){return p.call(e)}(e)}function v(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function g(e){if(!v(e))return!1;var t=m(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var y=u["__core-js_shared__"],E=function(){var e=/[^.]+$/.exec(y&&y.keys&&y.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),T=Function.prototype.toString;function S(e){if(null!=e){try{return T.call(e)}catch(kh){}try{return e+""}catch(kh){}}return""}var b=/^\[object .+?Constructor\]$/,A=Function.prototype,w=Object.prototype,R=A.toString,I=w.hasOwnProperty,k=RegExp("^"+R.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function P(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!v(e)||function(e){return!!E&&E in e}(e))&&(g(e)?k:b).test(S(e))}(n)?n:void 0}var D=P(u,"DataView"),O=P(u,"Map"),L=P(u,"Promise"),C=P(u,"Set"),N=P(u,"WeakMap"),M=S(D),x=S(O),U=S(L),F=S(C),j=S(N),V=m;(D&&"[object DataView]"!=V(new D(new ArrayBuffer(1)))||O&&"[object Map]"!=V(new O)||L&&"[object Promise]"!=V(L.resolve())||C&&"[object Set]"!=V(new C)||N&&"[object WeakMap]"!=V(new N))&&(V=function(e){var t=m(e),n="[object Object]"==t?e.constructor:void 0,r=n?S(n):"";if(r)switch(r){case M:return"[object DataView]";case x:return"[object Map]";case U:return"[object Promise]";case F:return"[object Set]";case j:return"[object WeakMap]"}return t});var B=V;function H(e){return null!=e&&"object"==typeof e}function X(e){return H(e)&&"[object Arguments]"==m(e)}var q=Object.prototype,W=q.hasOwnProperty,G=q.propertyIsEnumerable,K=X(function(){return arguments}())?X:function(e){return H(e)&&W.call(e,"callee")&&!G.call(e,"callee")},Y=Array.isArray;function $(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function z(e){return null!=e&&$(e.length)&&!g(e)}var Q="object"==typeof exports&&exports&&!exports.nodeType&&exports,J=Q&&"object"==typeof module&&module&&!module.nodeType&&module,Z=J&&J.exports===Q?u.Buffer:void 0,ee=(Z?Z.isBuffer:void 0)||function(){return!1},te={};function ne(e){return function(t){return e(t)}}te["[object Float32Array]"]=te["[object Float64Array]"]=te["[object Int8Array]"]=te["[object Int16Array]"]=te["[object Int32Array]"]=te["[object Uint8Array]"]=te["[object Uint8ClampedArray]"]=te["[object Uint16Array]"]=te["[object Uint32Array]"]=!0,te["[object Arguments]"]=te["[object Array]"]=te["[object ArrayBuffer]"]=te["[object Boolean]"]=te["[object DataView]"]=te["[object Date]"]=te["[object Error]"]=te["[object Function]"]=te["[object Map]"]=te["[object Number]"]=te["[object Object]"]=te["[object RegExp]"]=te["[object Set]"]=te["[object String]"]=te["[object WeakMap]"]=!1;var re="object"==typeof exports&&exports&&!exports.nodeType&&exports,ie=re&&"object"==typeof module&&module&&!module.nodeType&&module,oe=ie&&ie.exports===re&&s.process,se=function(){try{return ie&&ie.require&&ie.require("util").types||oe&&oe.binding&&oe.binding("util")}catch(kh){}}(),ae=se&&se.isTypedArray,ue=ae?ne(ae):function(e){return H(e)&&$(e.length)&&!!te[m(e)]},ce=Object.prototype.hasOwnProperty;function le(e){if(null==e)return!0;if(z(e)&&(Y(e)||"string"==typeof e||"function"==typeof e.splice||ee(e)||ue(e)||K(e)))return!e.length;var n=B(e);if("[object Map]"==n||"[object Set]"==n)return!e.size;if(t(e))return!o(e).length;for(var r in e)if(ce.call(e,r))return!1;return!0}const de={MANIFEST:"manifest",SEGMENT:"segment"},he={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 fe(e,t){for(var n=0;n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function we(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Re(e){return function(e){if(Array.isArray(e))return ke(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Ie(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ie(e,t){if(e){if("string"==typeof e)return ke(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)?ke(e,t):void 0}}function ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new 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.")}return(n=e[Symbol.iterator]()).next.bind(n)}function De(e,t){var n=t.get(e);if(!n)throw new TypeError("attempted to get private field on non-instance");return n.get?n.get.call(e):n.value}function Oe(e,t,n){var r=t.get(e);if(!r)throw new TypeError("attempted to set private field on non-instance");if(r.set)r.set.call(e,n);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=n}return n}function Le(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function Ce(e){return e.filter((e,t,n)=>n.indexOf(e)===t)}function Ne(e,t){return e.reduce((e,n,r,i)=>e.concat(t(n,r,i)),[])}function Me(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 xe=Me({enumerable:!1,configurable:!0,writeable:!1}),Ue=Me({enumerable:!1,configurable:!1,writeable:!1}),Fe=Me({enumerable:!0,configurable:!0,writeable:!1}),je=e=>new Promise((t,n)=>setTimeout(t,e));function Ve(e){e.substring(0,e.lastIndexOf("/")+1)}const Be=(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)}),He=e=>Math.pow(e,2),Xe=e=>Math.sqrt(e),qe=(e,t)=>(...n)=>{[`%c${e}`,t].concat(n)};function We(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]=We({},r,i):e[n]=i)}),e),e)}const Ge=void 0!==window.ManagedMediaSource?window.ManagedMediaSource:window.MediaSource;function Ke(){let e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function Ye(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 $e(e,t){let n=e;for(let r=0;r=e){n=t.end(r);break}return n-e}function ze(){return void 0!==window.performance&&"function"==typeof window.performance.now?window.performance.now():Date.now()}function Qe(){return Math.trunc(ze()/1e3)}function Je(e){return Qe()-e}function Ze(e){return ze()-e}const et=e=>Math.trunc(Date.now()/1e3)-e;function tt(e){if("object"!=typeof e)return"";let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.length?t.join("&"):""}function nt(e){return"string"!=typeof e?{}:e.replace("?","").split("&").reduce((e,t)=>{if(t.length>0){const n=t.substring(0,t.indexOf("=")),r=t.substring(t.indexOf("=")+1);e[n]=decodeURIComponent(r)}return e},{})}function rt(e){const t=document.createElement("a");return t.href=e,t}function it(e,t){const n=tt(t);let r=-1===e.indexOf("?")?"?":"&";return`${e}${n?`${r}${n}`:""}`}function ot(e){const t=e.split("://");if(2!==t.length)return null;const n=t[1].split("/");if(n.length>1)return n[0];const r=t[1].split("?");if(r.length>1)return r[0];const i=t[1].split("#");return i.length>1?i[0]:t[1]}function st(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^16*Math.random()>>e/4).toString(16))}function at(e,t){this.headers={},this.perfTimings={},We(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 at(e,this),this.isVimeoResponse=!0}let ut=function(e){function t(){var t;return(t=e.call(this,"The operation was aborted.")||this).name="AbortError",t}return ge(t,e),t}(be(Error)),ct=function(e){function t(t){var n;return(n=e.call(this,t.statusText)||this).name="HTTPError",n.response=t,n}return ge(t,e),t}(be(Error)),lt=function(e){function t(){var t;return(t=e.call(this,"A network error occurred.")||this).name="NetworkError",t}return ge(t,e),t}(be(Error)),dt=function(e){function t(t){var n;return(n=e.call(this,"Request timed out.")||this).name="TimeoutError",n.timeoutMs=t,n}return ge(t,e),t}(be(Error));function ht(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 at(c.response,{headers:e,statusText:c.statusText,status:c.status,url:c.responseURL,perfTimings:t}))},c.onabort=function(){u(new ut)},c.onerror=function(){u(new lt)},c.ontimeout=function(){u(new dt(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 ft(){}function pt(e,t,n){if(!e.s){if(n instanceof _t){if(!n.s)return void(n.o=pt.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(pt.bind(null,e,t),pt.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const _t=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{pt(r,1,e(this.v))}catch(kh){pt(r,2,kh)}return r}return this}return this.o=function(e){try{const i=e.v;1&e.s?pt(r,1,t?t(i):i):n?pt(r,1,n(i)):pt(r,2,i)}catch(kh){pt(r,2,kh)}},r},e}();function mt(e){return e instanceof _t&&1&e.s}function vt(e){const t=function(e){return function(){for(var t=[],n=0;n=e.retry)return 0;if(t instanceof ct){if(!e.retryStatus(t.response.status))return 0;const n=t.response.headers["retry-after"];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 function(a,u){var c=function(){if(0!==s&&n>0)return function(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}(je(s),(function(){const s=e.hooks.beforeRetry||[];return function(e,t){return e&&e.then?e.then(t):t()}(function(e,t,n){var r,i,o=-1;return function n(s){try{for(;++oe(r.apply(void 0,t),n)})}(a,()=>t.abort())}function Pt(e,t){We(this,he,e="string"==typeof e?{url:e}:e,t)}function Dt(e){const{validateStatus:t,throwHttpErrors:n,hooks:r}=e;return yt((function(i){const o=r.afterResponse||[];return At(bt(o,(function(t){return gt((0,o[t])(e,i.clone()),(function(e){e instanceof at&&(i=e)}))})),(function(){if(!t||t(i.status))return i;if(n)throw new ct(i);return i}))}))}wt.forEach((function(e){return kt[e]=(t,n)=>kt(t,ve({method:e},n)),kt[e]}));const{get:Ot,post:Lt,put:Ct,patch:Nt,head:Mt}=kt,xt={ARRAY_BUFFER:"arraybuffer"};var Ut=Object.freeze({__proto__:null,ContentTypes:de,defaults:he,requestMethods:wt,responseTypes:Rt,retryMethods:It,request:kt,Request:Pt,get:Ot,post:Lt,put:Ct,patch:Nt,head:Mt,Response:at,ResponseTypes:xt,AbortError:ut,HTTPError:ct,NetworkError:lt,TimeoutError:dt,xhr:ht});const Ft=navigator.userAgent.toLowerCase(),jt=["googlebot","google-inspectiontool"];function Vt(e){e=e.toLowerCase();const t=new RegExp(e).test(Ft);return"safari"===e?t&&new RegExp("version").test(Ft):t}function Bt(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 Ht=!!Vt("android")&&(parseFloat(Ft.replace(/^.* android (\d+)\.(\d+).*$/,"$1.$2"))||!0),Xt=window.devicePixelRatio||1,qt=!(!Vt("windows phone")&&!Vt("iemobile"))&&(parseFloat(Ft.replace(/^.* windows phone (os )?(\d+)\.(\d+).*$/,"$2.$3"))||!0),Wt=!!Vt("msie")&&parseFloat(Ft.replace(/^.*msie (\d+).*$/,"$1")),Gt=!!Vt("trident")&&parseFloat(Ft.replace(/^.*trident\/(\d+)\.(\d+).*$/,"$1.$2"))+4,Kt=Vt("ipad;")||Vt("iphone;")||Vt("ipod touch;")?parseFloat(Ft.replace(/^.* os (\d+)_(\d+).*$/,"$1.$2")):navigator.userAgent.includes("Mac")&&"ontouchend"in document,Yt="MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,$t=Vt("opera")||Vt("opr"),zt=/^Mozilla\/5\.0 \(.* Mac OS X.*\(KHTML, like Gecko\)(?: Mobile\/[\S]*|)$/i.test(Ft),Qt=Vt("safari")&&Vt("apple")&&!Vt("chrome")&&!Vt("android");function Jt(e){if(!Qt)return!1;const t=e.split("."),n=function(){if(!Vt("safari"))return[];const e=Ft.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 Zt={autoplayPolicy:Jt("11"),hevc:Jt("11"),dolbyVision:Jt("14.1"),spatial:Jt("11.0.2"),fullscreenRequiresDataLoaded:Jt("17.2")},en={airPlay:"WebKitPlaybackTargetAvailabilityEvent"in window,android:Ht,appleMail:zt,hasAutoplayPolicy:Ht||Kt||Zt.autoplayPolicy||function(){if(!Vt("chrome"))return[];const e=Ft.split(" ").find((function(e){return Kt?/CriOS\//.test(e):/chrome\//.test(e)}));return e?e.replace("chrome/","").split(".").map((function(e){return parseInt(e,10)})):[]}()[0]>=66,iOS:Kt,iPadOS:Yt,mobileAndroid:Ht&&Vt("mobile"),browser:{bb10:Vt("bb10"),chrome:Vt("chrome"),firefox:Vt("firefox"),ie:Wt||Gt,edge:Vt("edge"),opera:$t,safari:Qt,chromium:"chrome"in window},devicePixelRatio:Xt,iPhone:Vt("iphone;")||Vt("ipod touch;")||Vt("ipod;"),iPad:Vt("ipad;"),iPadNonRetina:Vt("ipad;")&&Xt<2,mac:Vt("mac os"),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(kh){}return e}(),svg:!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,touch:"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch||Vt("windows phone")||window.navigator.maxTouchPoints>1||window.navigator.msMaxTouchPoints||!1,transformProperty:Bt("transform"),transitionProperty:Bt("transition"),webp:function(){const e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))&&0===e.toDataURL("image/webp").indexOf("data:image/webp")}(),windowsPhone:qt,mediaCapabilities:"mediaCapabilities"in navigator,isGoogleBot:(()=>{const e=Ft.toLowerCase();return jt.some(t=>e.includes(t))})(),storageAccessAPI:"requestStorageAccess"in document&&"hasStorageAccess"in document,clipboardAPI:"clipboard"in navigator&&"write"in navigator.clipboard,videoContentPreload:!Vt("iphone"),intersectionObserver:"IntersectionObserver"in window},tn=/mac os x 10_13/.test(Ft),nn=en.iOS&&en.iOS>=11,rn="undefined"!=typeof matchMedia&&(matchMedia("(color-gamut: p3)").matches&&screen.pixelDepth>24||matchMedia("(dynamic-range: high), (video-dynamic-range: high)").matches);function on(e="hvc1"){return void 0!==Ge?Ge.isTypeSupported(`video/mp4; codecs="${e}"`):Zt.hevc&&(tn||nn)}function sn(){return!(en.iOS||en.iPad||en.browser.ie||Vt("safari")&&!Zt.spatial)}function an(e){return"symbol"==typeof e||H(e)&&"[object Symbol]"==m(e)}en.hevc=on(),en.hevcMain10=on("hvc1.2.4.H150.90"),en.hdr=rn,en.dolbyVision=function(){let e=void 0!==Ge&&Ge.isTypeSupported('video/mp4; codecs="dvh1"');if(!e){const t=document.createElement("video");"canPlayType"in t&&(e="probably"===t.canPlayType('video/mp4; codecs="dvh1"'))}return!((Yt||en.iOS)&&!Zt.dolbyVision)&&e}(),en.vp9hdr=(window.matchMedia("(color-gamut: p3)").matches||window.matchMedia("(color-gamut: rec2020)").matches)&&screen.colorDepth>=48&&(Ge.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.16.09.00"')||Ge.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.16.09.01"')||Ge.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.18.09.00"')||Ge.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.18.09.01"')),en.av1=void 0!==Ge&&Ge.isTypeSupported('video/mp4; codecs="av01.0.31M.08.0.110.01.01.01.0"'),en.webvr=!!(window.navigator&&"getVRDisplays"in window.navigator),en.webxr=!!(window.navigator&&"xr"in window.navigator&&"supportsSession"in window.navigator.xr),en.spatialPlayback=sn(),en.spatialHEVC=!en.browser.safari&&sn()&&on(),en.stereoscopic=en.spatialPlayback&&en.mobileAndroid,en.fullscreenRequiresDataLoaded=en.iOS>=17||en.iPadOS&&Zt.fullscreenRequiresDataLoaded;var un=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cn=/^\w*$/,ln=P(Object,"create"),dn=Object.prototype.hasOwnProperty,hn=Object.prototype.hasOwnProperty;function fn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},vn.prototype.set=function(e,t){var n=this.__data__,r=_n(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},yn.prototype.clear=function(){this.size=0,this.__data__={hash:new fn,map:new(O||vn),string:new fn}},yn.prototype.delete=function(e){var t=gn(this,e).delete(e);return this.size-=t?1:0,t},yn.prototype.get=function(e){return gn(this,e).get(e)},yn.prototype.has=function(e){return gn(this,e).has(e)},yn.prototype.set=function(e,t){var n=gn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},En.Cache=yn;var Tn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sn=/\\(\\)?/g,bn=function(e){var t=En((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Tn,(function(e,n,r,i){t.push(r?i.replace(Sn,"$1"):n||e)})),t}),(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}(),An=c?c.prototype:void 0,wn=An?An.toString:void 0;function Rn(e){if("string"==typeof e)return e;if(Y(e))return function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++nObject.keys(De(this,Jn))),_e(this,"fire",(e,...t)=>{if(!e)throw new Error("Tried to fire an undefined event.");if(e in De(this,Jn)){const n=De(this,Jn)[e].slice(0);for(let e=0,r=n.length;e(Oe(this,Zn,!0),this)),_e(this,"on",(e,t,n)=>{const r=[].concat(e);for(let i=0,o=r.length;i{const r=(...n)=>{this.off(e,r),t.apply(this,n)};return r.handler=t,this.on(e,r,n)}),_e(this,"off",(e,t)=>{if(!e)return Oe(this,Jn,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 tr(e){var t=this.__data__=new vn(e);this.size=t.size}tr.prototype.clear=function(){this.__data__=new vn,this.size=0},tr.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},tr.prototype.get=function(e){return this.__data__.get(e)},tr.prototype.has=function(e){return this.__data__.has(e)},tr.prototype.set=function(e,t){var n=this.__data__;if(n instanceof vn){var r=n.__data__;if(!O||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new yn(r)}return n.set(e,t),this.size=n.size,this};var nr=function(){try{var e=P(Object,"defineProperty");return e({},"",{}),e}catch(kh){}}();function rr(e,t,n){"__proto__"==t&&nr?nr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var ir=Object.prototype.hasOwnProperty;function or(e,t,n){var r=e[t];ir.call(e,t)&&pn(r,n)&&(void 0!==n||t in e)||rr(e,t,n)}function sr(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Jr);function ti(e,t){return ei(zr(e,t,Yr),e+"")}function ni(e,t,n){(void 0===n||pn(e[t],n))&&(void 0!==n||t in e)||rr(e,t,n)}var ri=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},ii=Function.prototype,oi=Object.prototype,si=ii.toString,ai=oi.hasOwnProperty,ui=si.call(Object);function ci(e){if(!H(e)||"[object Object]"!=m(e))return!1;var t=wr(e);if(null===t)return!0;var n=ai.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&si.call(n)==ui}function li(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function di(e,t,n,r,i){e!==t&&ri(t,(function(o,s){if(i||(i=new tr),v(o))!function(e,t,n,r,i,o,s){var a=li(e,n),u=li(t,n),c=s.get(u);if(c)ni(e,n,c);else{var l=o?o(a,u,n+"",e,t,s):void 0,d=void 0===l;if(d){var h=Y(u),f=!h&&ee(u),p=!h&&!f&&ue(u);l=u,h||f||p?Y(a)?l=a:function(e){return H(e)&&z(e)}(a)?l=yr(a):f?(d=!1,l=gr(u,!0)):p?(d=!1,l=xr(u,!0)):l=[]:ci(u)||K(u)?(l=a,K(a)?l=function(e){return sr(e,fr(e))}(a):v(a)&&!g(a)||(l=jr(u))):d=!1}d&&(s.set(u,l),i(l,u,r,o,s),s.delete(u)),ni(e,n,l)}}(e,t,s,n,di,r,i);else{var a=r?r(li(e,s),o,s+"",e,t,i):void 0;void 0===a&&(a=o),ni(e,s,a)}}),fr)}function hi(e,t,n,r,i,o){return v(e)&&v(t)&&(o.set(t,e),di(e,t,void 0,hi,o),o.delete(t)),e}function fi(e){return ti((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(!v(n))return!1;var r=typeof t;return!!("number"==r?z(n)&&ur(t,n.length):"string"==r&&t in n)&&pn(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]},pe(t,[{key:"active",get:function(){return this._active}},{key:"available",get:function(){return this._available}},{key:"element",get:function(){return document.createElement("div")}}]),t}(er);const vi={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"},gi={ADD_TRACK:"addtrack",REMOVE_TRACK:"removetrack",CHANGE:"change"},yi={AVAILABLE:"externaldisplayavailable",UNAVAILABLE:"externaldisplayunavailable",ACTIVATED:"externaldisplayactivated",DEACTIVATED:"externaldisplaydeactivated"},Ei={AIRPLAY_AVAILABLE:"available",AIRPLAY_UNAVAILABLE:"unavailable",AIRPLAY_ACTIVATED:"activated",AIRPLAY_DEACTIVATED:"deactivated"},Ti={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"},Si={STREAM_ONLINE:"livestreamonline",STREAM_OFFLINE:"livestreamoffline",BUFFER_GAP_JUMP:"livebuffergapjump",BUFFER_GAP_JUMP_PREVENT:"livebuffergapjumpprevent",STALL_JUMP:"livestalljump",LATENCY_UPDATED:"latencyupdated"},bi={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"},Ai={MEDIASESSION_PLAY:"mediasessionplay",MEDIASESSION_PAUSE:"mediasessionpause",MEDIASESSION_SEEK_FORWARD:"mediasessionseekforward",MEDIASESSION_SEEK_TO:"mediasessionseekto",MEDIASESSION_SEEK_BACKWARD:"mediasessionseekbackward"},wi=Object.assign({},vi,gi,yi,Ei,Ti,bi,Si,Ai);var Ri="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ii(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 ki=Ii((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&&R());if("MasterPlaylist"===e){if(void 0===t.isMasterPlaylist)return void(t.isMasterPlaylist=!0);!1===t.isMasterPlaylist&&R()}}(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];case"EXT-X-PLAYLIST-TYPE":default:return[t,null]}}(r,o),2);return{name:r,category:s,value:u[0],attributes:u[1]}}e.exports=function(e){var t={version:void 0,isMasterPlaylist:void 0,hasMap:!1,targetDuration:0,compatibleVersion:1,isClosedCaptionsNone:!1,hash:{}},n=function(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 R=w.parts;R.length>0&&!o.endlist&&!R[R.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=R.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(A(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(A(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(A(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(A(v))}}catch(e){m.e(e)}finally{m.f()}}e.push("".concat(n,":").concat(r.join(","))),t.isIFrameOnly||e.push("".concat(t.uri))}function A(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 w(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(I(t.byterange))),t.discontinuity&&e.push("#EXT-X-DISCONTINUITY"),t.key){var s=S(t.key);s!==n&&(e.push(s),n=s)}if(t.map){var a=R(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(k(t.dateRange)),t.markers.length>0&&P(e,t.markers),t.parts.length>0&&(o=D(e,t.parts)),o)return[n,r];var u=i<3?Math.round(t.duration):y(t.duration,E(t.duration));return e.push("#EXTINF:".concat(u,",").concat(unescape(encodeURIComponent(t.title||"")))),Array.prototype.push.call(e,"".concat(t.uri)),[n,r]}function R(e){var t=['URI="'.concat(e.uri,'"')];return e.byterange&&t.push('BYTERANGE="'.concat(I(e.byterange),'"')),"#EXT-X-MAP:".concat(t.join(","))}function I(e){var t=e.offset,n=e.length;return"".concat(n,"@").concat(t)}function k(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(","))}function P(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 D(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(I(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(T(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(S(u,!0))}}catch(e){a.e(e)}finally{a.f()}var c,l=o(t.variants);try{for(l.s();!(c=l.n()).done;)b(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(w(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&&function(e,t){(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(e,t)}function o(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=a(e);if(t){var i=a(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return s(this,n)}}function s(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 a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var c=n(771),l=function e(t){u(this,e),c.PARAMCHECK(t),this.type=t},d=function(e){i(n,e);var t=o(n);function n(e){var r,i=e.isMasterPlaylist,o=e.uri,s=e.version,a=e.independentSegments,l=void 0!==a&&a,d=e.start,h=e.source;return u(this,n),r=t.call(this,"playlist"),c.PARAMCHECK(i),r.isMasterPlaylist=i,r.uri=o,r.version=s,r.independentSegments=l,r.start=d,r.source=h,r}return n}(l),h=function(e){i(n,e);var t=o(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(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,c=void 0===a?[]:a,l=r.sessionKeyList,d=void 0===l?[]:l;return e.variants=o,e.currentVariant=s,e.sessionDataList=c,e.sessionKeyList=d,e}return n}(d),f=function(e){i(n,e);var t=o(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(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,c=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=c,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}(d),p=function(e){i(n,e);var t=o(n);function n(e){var r,i=e.uri,o=e.mimeType,s=e.data,a=e.duration,c=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 u(this,n),(r=t.call(this,"segment")).uri=i,r.mimeType=o,r.data=s,r.duration=a,r.title=c,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}(l),_=function(e){i(n,e);var t=o(n);function n(e){var r,i=e.hint,o=void 0!==i&&i,s=e.uri,a=e.duration,l=e.independent,d=e.byterange,h=e.gap;return u(this,n),r=t.call(this,"part"),c.PARAMCHECK(s),r.hint=o,r.uri=s,r.duration=a,r.independent=l,r.duration=a,r.byterange=d,r.gap=h,r}return n}(l);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,l=t.isDefault,d=t.autoselect,h=t.forced,f=t.instreamId,p=t.characteristics,_=t.channels;u(this,e),c.PARAMCHECK(n,i,a),c.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=l,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,l=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;u(this,e),c.PARAMCHECK(n,o),this.uri=n,this.isIFrameOnly=i,this.bandwidth=o,this.averageBandwidth=s,this.codecs=a,this.resolution=l,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;u(this,e),c.PARAMCHECK(n,r||i),c.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;u(this,e),c.PARAMCHECK(n),c.CONDITIONALPARAMCHECK(["NONE"!==n,r]),c.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;u(this,e),c.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,l=t.endOnNext,d=t.attributes,h=void 0===d?{}:d;u(this,e),c.PARAMCHECK(n),c.CONDITIONALPARAMCHECK([!0===l,r]),c.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=l,this.attributes=h},SpliceInfo:function e(t){var n=t.type,r=t.duration,i=t.tagName,o=t.value;u(this,e),c.PARAMCHECK(n),c.CONDITIONALPARAMCHECK(["OUT"===n,r]),c.CONDITIONALPARAMCHECK(["RAW"===n,i]),this.type=n,this.duration=r,this.tagName=i,this.value=o},Playlist:d,MasterPlaylist:h,MediaPlaylist:f,Segment:p,PartialSegment:_,RenditionReport:function e(t){var n=t.uri,r=t.lastMSN,i=t.lastPart;u(this,e),c.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 Pi={},Di={variant:0,audio:0,subtitles:0};let Oi=function(e){function t(t,n){var r;return(r=e.call(this,t)||this).type=r.type.toLowerCase(),r.index=Di[r.type]++,r.id=r.uri,r.label=r.name,r.codecs=Mi(n,r.type),r.url=null,r.playlist=null,r}return ge(t,e),t.prototype.getSegmentBySN=function(e){return this.playlist.getSegmentBySN(e)},pe(t,[{key:"mimeType",get:function(){return this.playlist&&xi(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}}]),t}(ki.types.Rendition),Li=function(e){function t(t){var n,r,i;return(i=e.call(this,t)||this).audio=i.audio.map(e=>Pi[e.uri]||(Pi[e.uri]=new Oi(e,i.codecs))),i.subtitles=i.subtitles.map(e=>Pi[e.uri]||(Pi[e.uri]=new Oi(e,i.codecs))),i.type="video",i.index=Di.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="avc1.42E01E,mp4a.40.2"){return e?t:Mi(t,"video")}(!i.audio.length,t.codecs),i.url=null,i.playlist=null,i}return ge(t,e),t.prototype.getSegmentBySN=function(e){return this.playlist.getSegmentBySN(e)},pe(t,[{key:"mimeType",get:function(){return this.playlist&&xi(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}}]),t}(ki.types.Variant),Ci=function(e){function t(t){var n;return(n=e.call(this,t)||this).variants=n.variants.map(e=>new Li(e)),n}return ge(t,e),pe(t,[{key:"video",get:function(){return this.variants}},{key:"audio",get:function(){return Ce(Ne(this.variants,e=>e.audio))}},{key:"subtitles",get:function(){return Ce(Ne(this.variants,e=>e.subtitles))}},{key:"captions",get:function(){return this.subtitles}}]),t}(ki.types.MasterPlaylist);const Ni={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/]};function Mi(e="avc1.42E01E,mp4a.40.2",t){const n=e.split(","),r=Ni[t.toLowerCase()]||[];return n.find(e=>r.some(t=>t.test(e.trim())))}function xi(e,t){const n=e.split(".").pop().split("?")[0],r={fmp4:"mp4",m4s:"mp4",ts:"mp2t"}[n]||n||"mp4";return`${t.toLowerCase()}/${r}`}const Ui=function(e){return function(){for(var t=[],n=0;n{var s,a;if(void 0===i.mediaSequenceNumber)throw new Error("No valid segment sequence number found");let u=ji(Fi(e.url),i.uri);const c=(null==(s=Bi[u])?void 0:s.update(i))||new Xi(ve(ve({},i),{},{type:e.type,stream:e.stream,targetDuration:t.targetDuration,url:u,start:n}));u&&(Bi[u]=c);const l=i.parts.map((n,r)=>{var i;return u=ji(Fi(e.url),n.uri),(null==(i=Bi[u])?void 0:i.update(n))||(Bi[u]=new qi(ve(ve({},n),{},{type:e.type,stream:e.stream,partTargetDuration:t.partTargetDuration,mediaSequenceNumber:c.mediaSequenceNumber,url:u,part:r})))});c.parts=l,(a=e.parts).push.apply(a,Re(l)),function(e,t){e.programDateTime?e.programDateTime=new Date(e.programDateTime).getTime():(null==t?void 0:t.programDateTime)&&(e.programDateTime=t.endProgramDateTime),Number.isFinite(e.programDateTime)||(e.programDateTime=null)}(c,e.segments[e.segments.length-1]),c.programDateTime&&-1===r&&(r=e.segments.length),n+=c.duration||0,e.segments.push(c)}),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)}(we(o),t),o}ge(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)},pe(t,[{key:"availableParts",get:function(){var e;return(null==(e=this.parts)?void 0: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)?void 0:e.length)?this.segments[this.segments.length-1].end:0}},{key:"segmentEndPDT",get:function(){var e;return(null==(e=this.segments)?void 0:e.length)?this.segments[this.segments.length-1].programDateTime:0}},{key:"endSN",get:function(){var e;return(null==(e=this.segments)?void 0: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)?void 0:e.length)?this.parts[this.parts.length-1].end:0}},{key:"lastPartIndex",get:function(){var e;return(null==(e=this.parts)?void 0:e.length)?this.parts[this.parts.length-1].part:-1}},{key:"lastAvailablePartIndex",get:function(){var e;return(null==(e=this.availableParts)?void 0:e.length)?this.availableParts[this.availableParts.length-1].part:-1}},{key:"lastPartSn",get:function(){var e;return(null==(e=this.parts)?void 0:e.length)?this.parts[this.parts.length-1].mediaSequenceNumber:this.endSN}},{key:"lastAvailablePartSn",get:function(){var e;return(null==(e=this.availableParts)?void 0:e.length)?this.availableParts[this.availableParts.length-1].mediaSequenceNumber:this.endSN}},{key:"edge",get:function(){return this.partEnd||this.segmentEnd}}]),t}(ki.types.MediaPlaylist),Xi=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}ge(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},pe(t,[{key:"timeOffset",get:function(){return this._timeOffset||0},set:function(e){this._timeOffset=e,this.parts.forEach(t=>{t.timeOffset=e})}},{key:"start",set:function(e){this._start=e,this._syncPartsWithStart()},get:function(){return this._start+this.timeOffset}},{key:"programDateTime",set:function(e){this._programDateTime=e,this._syncPartsWithPDT()},get:function(){return this._programDateTime}},{key:"parts",set:function(e){this._parts=e,this._linkParts(),this._syncPartsWithStart(),this._syncPartsWithPDT()},get:function(){return this._parts}},{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}}]),t}(ki.types.Segment),qi=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 ge(t,e),t.prototype.update=function({hint:e,duration:t,independent:n}){return this.hint=e,this.duration=t,this.independent=n,this},pe(t,[{key:"segment",get:function(){return this.mediaSequenceNumber}},{key:"start",set:function(e){this._start=e},get:function(){return this._start+this.timeOffset}},{key:"end",get:function(){return this.start+(this.duration||this.partTargetDuration||0)}}]),t}(ki.types.PartialSegment);function Wi(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Gi(e,t){try{var n=e()}catch(kh){return t(kh)}return n&&n.then?n.then(void 0,t):n}function Ki(e){return function(){for(var t=[],n=0;n0?r._mergeDeltaPlaylistUpdates(e.playlist,a):a;if(e.playlist=u,e.playlist.advancedDateTime=Date.now()-n.perfTimings.duration,e.playlist.reloaded(r._oldPlaylist),r._oldPlaylist=e.playlist,r._masterLoader.fire("1",e,t),r.lowLatencyMode&&(null==(o=e.playlist.lowLatencyCompatibility)?void 0:o.canBlockReload)){const t=a.lastAvailablePartIndex,n=-1!==t?a.lastAvailablePartSn:a.endSN+1,i=-1!==t?t+1:void 0;r.update(e,!1,{_HLS_msn:n,_HLS_part:i})}else if(r.alive){clearTimeout(r._timer);const t=function(e,t){return 1e3*(t&&e.partTargetDuration||e.targetDuration)}(e,r.lowLatencyMode);r._timer=setTimeout(()=>r.update(e),t)}}))}))}))}),(function(e){e instanceof ut||r._masterLoader.fire("2",e)}))}catch(kh){return Promise.reject(kh)}},t.stop=function(){var e;clearTimeout(this._timer),null==(e=this._requestPromise)||e.abort(),this._requestPromise=null,this.alive=!1},t._isExpired=function(){return this._expirationTime&&this._expirationTime-1e4<=Date.now()},t._beforeRetry=function(e){const t=this;return Ki((function(n,r){return Wi(t._masterLoader.refreshBaseUrl(),(function(r){n.url=ji(r,e.uri),t._expirationTime=function(e){const t=rt(e),n=t&&t.pathname.match(/^\/(exp=)?(\d{10,})/);return n&&1e3*n[2]}(n.url)}))}))},t._mergeDeltaPlaylistUpdates=function(e,t){e.mediaSequenceBasee.mediaSequenceNumber>=t.mediaSequenceBase));const n=t.segments.filter(t=>t.mediaSequenceNumber>e.endSN);return t.segments=[].concat(Re(e.segments),Re(n)),t},pe(e,[{key:"baseUrl",get:function(){var e;return null==(e=this._masterLoader)?void 0:e.baseUrl}}]),e}();const Ji={disableDeltaUpdates:!1};let Zi=function(e){function t(t=Ji){var n;return(n=e.call(this)||this).video=new Qi(we(n),"video"),n.audio=new Qi(we(n),"audio"),n.subtitles=new Qi(we(n),"subtitles"),n._disableDeltaUpdates=t.disableDeltaUpdates,n._activeStreamIndex={},n}ge(t,e);var n=t.prototype;return n.start=function(e,t){try{const n=this;return n._refreshUrl=t,Wi(Ui(e),(function(e){return n._masterPlaylistUrl=e,Wi(n._fetchMasterPlaylist(n._masterPlaylistUrl),(function(e){return n.manifest=new Ci(ki.parse(e)),n.manifest}))}))}catch(kh){return Promise.reject(kh)}},n.stop=function(){this.video.stop(),this.audio.stop(),this.subtitles.stop(),this.video=new Qi(this,"video",this.video),this.audio=new Qi(this,"audio",this.audio),this.subtitles=new Qi(this,"subtitles",this.subtitles)},n.update=function(e){try{const t=this;return Wi(t.video.update(t.activeStream("video"),e),(function(){return $i(Promise.all([t.audio.update(t.activeStream("audio"),e),t.subtitles.update(t.activeStream("subtitles"),e)]))}))}catch(kh){return Promise.reject(kh)}},n.switchTo=function(e,t){try{const n=this;if(t===n._activeStreamIndex[e])return;return n[e].stop(),n[e]=new Qi(n,e,n[e]),n._activeStreamIndex[e]=t,$i(n[e].update(n.activeStream(e),!0))}catch(kh){return Promise.reject(kh)}},n.activeStream=function(e){return this.manifest[e].find(({index:t})=>t===this._activeStreamIndex[e])},n.activeStreamIndex=function(e){return this._activeStreamIndex[e]},n.refreshBaseUrl=function(){try{const e=this;return Wi(zi(e._refreshUrl),(function(t){return e._masterPlaylistUrl=t,e.baseUrl}))}catch(kh){return Promise.reject(kh)}},n._fetchMasterPlaylist=function(e){try{let t=!1;const n=this;let r;return function(e,t){return e&&e.then?e.then(t):t(e)}(Gi((function(){const t={type:de.MANIFEST,retry:8,retryStatus:eo,hooks:{beforeRetry:[n._beforeRetryMasterPlaylist.bind(n)]}};return n.dvrEnabled||(t.searchParams={min_seconds:30}),Wi(kt(e,t).text(),(function(e){r=e}))}),(function(){throw new Error("Master playlist failed to load. Giving up updating after 8 attempts.")})),(function(e){return t?e:r}))}catch(kh){return Promise.reject(kh)}},n._beforeRetryMasterPlaylist=function(e,t,n){try{const t=this;return Wi(zi(t._refreshUrl),(function(n){t._masterPlaylistUrl=n,e.url=t._masterPlaylistUrl}))}catch(kh){return Promise.reject(kh)}},pe(t,[{key:"baseUrl",get:function(){return Fi(this._masterPlaylistUrl)}},{key:"lowLatencyMode",get:function(){var e;return!!(null==(e=this.video)?void 0: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)?void 0:e.dvrEnabled)},set:function(e){this.video.dvrEnabled=e,this.audio.dvrEnabled=e,this.subtitles.dvrEnabled=e}},{key:"disableDeltaUpdates",get:function(){return this._disableDeltaUpdates}}]),t}(er);function eo(e){return[403,404,410].includes(e)||he.retryStatus(e)}const to=["width","height","bandwidth","duration","timescale","presentationTimeOffset"];function no(e){const t={};for(let n=0;ne.nodeType===Node.TEXT_NODE||e.nodeType===Node.CDATA_SECTION_NODE)?e.textContent.trim():null}function uo(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 co={"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 lo=Object.freeze({__proto__:null,fetchMasterPlaylistUrl:Ui,PLAYLIST_UPDATE:"1",PLAYLIST_ERROR:"2",M3U8Loader:Zi,Rendition:Oi,Variant:Li,M3U8Manifest:Ci,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){let n,r,i,o,s,a;function u(e,t){const n=e[0].adaptationSets.find(e=>e.mimeType?0===e.mimeType.indexOf(t):e.representations.find(e=>0===e.mimeType.indexOf(t)))||{};return(n.representations||[]).map(e=>{var t;return ve(ve({},e),{},{base_url:"",bitrate:e.bandwidth,duration:i,framerate:so(e.frameRate),init_segment:e.initSegment,max_segment_duration:o,mime_type:null!==(t=n.mimeType)&&void 0!==t?t:e.mimeType})})}function c(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 l(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=io(i[u],"media");o.segments.push({url:t+r,start:s,end:e}),s+=a}return o}return function(){const l=(new DOMParser).parseFromString(e,"application/xml");n=l.getElementsByTagName("MPD")[0],r=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]}(n,"BaseURL");return e&&ao(e)||t.substr(0,t.lastIndexOf("/")+1)}(),i=uo(io(n,"mediaPresentationDuration")),o=uo(io(n,"maxSegmentDuration"));const d=function(){const e=[],t=n.getElementsByTagName("Period");for(let n=0;n({initDataType:"cenc",initData:Vi(e)}))}catch(kh){throw new Error("Bad pshh encoding")}c.length>0&&(o[co[a]]=o[co[a]]||{},o[co[a]].cenc=c[0]);const l=ro(s,"usn:microsoft:playready","pro").map(ao);c=[];try{c=l.map(e=>({initDataType:"mspr",initData:Vi(e)}))}catch(kh){throw new Error("Bad pro encoding")}c.length>0&&(o[co[a]]=o[co[a]]||{},o[co[a]].mspr=c[0])}return r?{is_drm:!0,key_info:{cdms:Re(new Set(i)),key_id:r,inits:o}}:{}}()),{},{audio:a,video:s,mediaPresentationDuration:i,maxSegmentDuration:o,baseUrl:r,base_url:r,get profiles(){return io(n,"profiles")},get type(){return io(n,"type")},get minimumUpdatePeriod(){return uo(io(n,"minimumUpdatePeriod"))},get publishTime(){return io(n,"publishTime")},get availabilityStartTime(){return io(n,"availabilityStartTime")},get timeShiftBufferDepth(){return uo(io(n,"timeShiftBufferDepth"))},get suggestedPresentationDelay(){return uo(io(n,"suggestedPresentationDelay"))},get minBufferTime(){return uo(io(n,"minBufferTime"))}})}()}});let ho=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}ge(t,e),pe(t,null,[{key:"displayName",get:function(){return"AirPlayExternalDisplay"}},{key:"supported",get:function(){return"WebKitPlaybackTargetAvailabilityEvent"in window}},{key:"supportedVideoTypes",get:function(){return["application/vnd.apple.mpegurl","video/mp4"]}}]);var n=t.prototype;return n.addVideoEventListeners=function(e=this._videoElement){e.addEventListener(vi.LOADED_METADATA,e=>{this.fire(vi.LOADED_METADATA,e)}),e.addEventListener("webkitplaybacktargetavailabilitychanged",e=>{switch(e.availability){case"available":this._available||(this._available=!0,this.fire(Ei.AIRPLAY_AVAILABLE));break;case"not-available":this._available&&(this._available=!1,this.fire(Ei.AIRPLAY_UNAVAILABLE))}}),e.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",e=>{if(e.target.webkitCurrentPlaybackTargetIsWireless)return this._active=!0,void this.fire(Ei.AIRPLAY_ACTIVATED);this._active=!1,this.fire(Ei.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():new Promise(function(e){return function(){for(var t=[],n=0;n{t()}),function(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}(Ui(e.getFile().src),(function(t){e._videoElement.src=t}))})))}catch(kh){return Promise.reject(kh)}},pe(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