1/*! For license information please see LICENSES */ 2(window.webpackJsonp=window.webpackJsonp||[]).push([[65],{116:function(t,e,n){"use strict";n.r(e);var r=n(10),o=n(88),l=(n(19),n(137),n(30),n(18),n(25),n(8),n(38),n(27),n(40),n(13)),c=["tag"];function d(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function h(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?d(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):d(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var f={name:"T3NavLink",functional:!0,extends:l.default.component("RouterLink"),render:function(t,e){var n=function(t){return"string"==typeof t&&t.match(/^((http(s)?|ftp):\/\/)|(mailto|tel):/)?{tag:"a",data:{attrs:{href:t,target:"_blank",rel:"noopener noreferrer"}},props:{}}:{tag:"nuxt-link",data:{},props:{to:e.props.to||"/"}}}(e.props.to),r=e.props,l=(r.tag,Object(o.a)(r,c));return t(n.tag,h(h(h({},e.data),n.data),{},{props:h({props:l},n.props)}),e.children)}},m=n(28),component=Object(m.a)(f,undefined,undefined,!1,null,null,null);e.default=component.exports},125:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return l}));n(33),n(42),n(19),n(137);function r(t){return void 0!==t&&void 0!==t.matched&&void 0!==t.matched[0]&&t.matched[0].path.includes("*")}function o(t){var e=t.match(/^(http:\/\/|https:\/\/)?([^/:]*).*$/);return null!=e&&e.length>2&&"string"==typeof e[2]&&e[2].length>0?e[2]:null}function l(t,e){t.redirect;var n=t.next;if("undefined"!=typeof window)return window.location.href=e,n(!1)}},142:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return c}));n(19),n(58),n(61),n(8);var r=n(71);function o(t){var e=t.isHMR,n=t.app,r=(t.store,t.params,t.route);if(!e){var o=r.path&&r.path.split("/")[1];return n.$typo3.i18n.locales&&n.$typo3.i18n.locales.find((function(t){return t===o}))?o:n.$typo3.i18n.defaultLocale}}function l(t,e){var n=t.app,o=t.store,l=t.params,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return n.$typo3.callHook("beforeLocaleChange",e,o.state.typo3.locale),new Promise((function(t,d){e?c?o.dispatch("typo3/getInitialData",{path:l.pathMatch}).then((function(l){n.$typo3.callHook("localeChange",e,o.state.typo3.locale),o.commit(r.c,e),t(l)})).catch((function(t){d(t)})):(n.$typo3.callHook("localeChange",e,o.state.typo3.locale),o.commit(r.c,e),t({localeCode:e})):d(new Error("localeCode not provided"))}))}function c(t){var e=t.app,n=e.$typo3.i18n.locale;return n===e.$typo3.i18n.defaultLocale?"":n}},143:function(t,e,n){"use strict";var r={name:"NoSsr",functional:!0,props:{placeholder:String,placeholderTag:{type:String,default:"div"}},render:function(t,e){var n=e.parent,r=e.slots,o=e.props,l=r(),c=l.default;void 0===c&&(c=[]);var d=l.placeholder;return n._isMounted?c:(n.$once("hook:mounted",(function(){n.$forceUpdate()})),o.placeholderTag&&(o.placeholder||d)?t(o.placeholderTag,{class:["no-ssr-placeholder"]},o.placeholder||d):c.length>0?c.map((function(){return t(!1)})):t(!1))}};t.exports=r},144:function(t,e,n){"use strict";function r(t,e,n){"object"==typeof n.value&&(n.value=o(n.value)),n.enumerable&&!n.get&&!n.set&&n.configurable&&n.writable&&"__proto__"!==e?t[e]=n.value:Object.defineProperty(t,e,n)}function o(t){if("object"!=typeof t)return t;var e,n,l,i=0,c=Object.prototype.toString.call(t);if("[object Object]"===c?l=Object.create(t.__proto__||null):"[object Array]"===c?l=Array(t.length):"[object Set]"===c?(l=new Set,t.forEach((function(t){l.add(o(t))}))):"[object Map]"===c?(l=new Map,t.forEach((function(t,e){l.set(o(e),o(t))}))):"[object Date]"===c?l=new Date(+t):"[object RegExp]"===c?l=new RegExp(t.source,t.flags):"[object DataView]"===c?l=new t.constructor(o(t.buffer)):"[object ArrayBuffer]"===c?l=t.slice(0):"Array]"===c.slice(-6)&&(l=new t.constructor(t)),l){for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)r(l,n[i],Object.getOwnPropertyDescriptor(t,n[i]));for(i=0,n=Object.getOwnPropertyNames(t);i<n.length;i++)Object.hasOwnProperty.call(l,e=n[i])&&l[e]===t[e]||r(l,e,Object.getOwnPropertyDescriptor(t,e))}return l||t}n.d(e,"a",(function(){return o}
vendor: 48,273 bytes, line 2
2))},145:function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",(function(){return rr}));var l,c,d,h,f,m,v,y,E,T,k,S,_,A,O,w={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},I={duration:.5,overwrite:!1,delay:0},R=1e8,L=1e-8,x=2*Math.PI,D=x/4,C=0,P=Math.sqrt,M=Math.cos,j=Math.sin,F=function(t){return"string"==typeof t},N=function(t){return"function"==typeof t},U=function(t){return"number"==typeof t},B=function(t){return void 0===t},$=function(t){return"object"==typeof t},V=function(t){return!1!==t},G=function(){return"undefined"!=typeof window},H=function(t){return N(t)||F(t)},W="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},K=Array.isArray,Y=/(?:-?\.?\d|\.)+/gi,z=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Q=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,X=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Z=/[+-]=-?[.\d]+/,J=/[^,'"\[\]\s]+/gi,tt=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,et={},nt={},it=function(t){return(nt=Ct(t,et))&&Pn},st=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},at=function(t,e){return!e&&console.warn(t)},ot=function(t,e){return t&&(et[t]=e)&&nt&&(nt[t]=e)||et},lt=function(){return 0},ct={suppressEvents:!0,isStart:!0},ut={suppressEvents:!0},ht={},ft=[],pt={},mt={},gt={},vt=30,yt=[],bt="",Et=function(t){var e,i,n=t[0];if($(n)||N(n)||(t=[t]),!(e=(n._gsap||{}).harness)){for(i=yt.length;i--&&!yt[i].targetTest(n););e=yt[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new Ye(t[i],e)))||t.splice(i,1);return t},Tt=function(t){return t._gsap||Et(he(t))[0]._gsap},kt=function(t,e,n){return(n=t[e])&&N(n)?t[e]():B(n)&&t.getAttribute&&t.getAttribute(e)||n},St=function(t,e){return(t=t.split(",")).forEach(e)||t},_t=function(t){return Math.round(1e5*t)/1e5||0},At=function(t){return Math.round(1e7*t)/1e7||0},Ot=function(t,e){var n=e.charAt(0),r=parseFloat(e.substr(2));return t=parseFloat(t),"+"===n?t+r:"-"===n?t-r:"*"===n?t*r:t/r},wt=function(t,e){for(var n=e.length,i=0;t.indexOf(e[i])<0&&++i<n;);return i<n},It=function(){var i,t,e=ft.length,a=ft.slice(0);for(pt={},ft.length=0,i=0;i<e;i++)(t=a[i])&&t._lazy&&(t.render(t._lazy[0],t._lazy[1],!0)._lazy=0)},Rt=function(t,time,e,n){ft.length&&It(),t.render(time,e,n||c),ft.length&&It()},Lt=function(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(J).length<2?e:F(t)?t.trim():t},xt=function(p){return p},Dt=function(t,e){for(var p in e)p in t||(t[p]=e[p]);return t},Ct=function(base,t){for(var p in t)base[p]=t[p];return base},Pt=function t(base,e){for(var p in e)"__proto__"!==p&&"constructor"!==p&&"prototype"!==p&&(base[p]=$(e[p])?t(base[p]||(base[p]={}),e[p]):e[p]);return base},Mt=function(t,e){var p,n={};for(p in t)p in e||(n[p]=t[p]);return n},jt=function(t){var e,n=t.parent||h,r=t.keyframes?(e=K(t.keyframes),function(t,n){for(var p in n)p in t||"duration"===p&&e||"ease"===p||(t[p]=n[p])}):Dt;if(V(t.inherit))for(;n;)r(t,n.vars.defaults),n=n.parent||n._dp;return t},Ft=function(t,e,n,r,o){void 0===n&&(n="_first"),void 0===r&&(r="_last");var l,c=t[r];if(o)for(l=e[o];c&&c[o]>l;)c=c._prev;return c?(e._next=c._next,c._next=e):(e._next=t[n],t[n]=e),e._next?e._next._prev=e:t[r]=e,e._prev=c,e.parent=e._dp=t,e},Nt=function(t,e,n,r){void 0===n&&(n="_first"),void 0===r&&(r="_last");var o=e._prev,l=e._next;o?o._next=l:t[n]===e&&(t[n]=l),l?l._prev=o:t[r]===e&&(t[r]=o),e._next=e._prev=e.parent=null},Ut=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove(t),t._act=0},Bt=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var a=t;a;)a._dirty=1,a=a.parent;return t},$t=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},Vt=function(t,e,n,r){return t._startAt&&(c?t._startAt.revert(ut):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,r))},Gt=function t(e){return!e||e._ts&&t(e.parent)},Ht=function(t){return t._repeat?Wt(t._tTime,t=t.duration()+t._rDelay)*t:0},Wt=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},Kt=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},qt=function(t){return t._end=At(t._start+(t._tDur/Math.abs(t._ts||t._rts||L)||0))},Yt=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=At(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),qt(t),n._dirty||Bt(n,t)),t},zt=function(t,e){var n;if((e._time||e._initted&&!e._dur)&&(n=Kt(t.rawTime(),e),(!e._dur||oe(0,e.totalDuration(),n)-e._tTime>L)&&e.render(n,!0)),Bt(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(n=t;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-1e-8}},Qt=function(t,e,n,r){return e.parent&&Ut(e),e._start=At((U(n)?n:n||t!==h?re(t,n,e):t._time)+e._delay),e._end=At(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Ft(t,e,"_first","_last",t._sort?"_start":0),te(e)||(t._recent=e),r||zt(t,e),t._ts<0&&Yt(t,t._tTime),t},Xt=function(t,e){return(et.ScrollTrigger||st("scrollTrigger",e))&&et.ScrollTrigger.create(e,t)},Zt=function(t,e,n,r){return nn(t,e),t._initted?!n&&t._pt&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&E!==Me.frame?(ft.push(t),t._lazy=[e,r],1):void 0:1},Jt=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},te=function(t){var data=t.data;return"isFromStart"===data||"isStart"===data},ee=function(t,e,n,r){var o=t._repeat,l=At(e)||0,c=t._tTime/t._tDur;return c&&!r&&(t._time*=l/t._dur),t._dur=l,t._tDur=o?o<0?1e10:At(l*(o+1)+t._rDelay*o):l,c>0&&!r?Yt(t,t._tTime=t._tDur*c):t.parent&&qt(t),n||Bt(t.parent,t),t},ne=function(t){return t instanceof Qe?Bt(t):ee(t,t._dur)},ie={_start:0,endTime:lt,totalDuration:lt},re=function t(e,n,r){var i,o,l,c=e.labels,d=e._recent||ie,h=e.duration()>=R?d.endTime(!1):e._dur;return F(n)&&(isNaN(n)||n in c)?(o=n.charAt(0),l="%"===n.substr(-1),i=n.indexOf("="),"<"===o||">"===o?(i>=0&&(n=n.replace(/=/,"")),("<"===o?d._start:d.endTime(d._repeat>=0))+(parseFloat(n.substr(1))||0)*(l?(i<0?d:r).totalDuration()/100:1)):i<0?(n in c||(c[n]=h),c[n]):(o=parseFloat(n.charAt(i-1)+n.substr(i+1)),l&&r&&(o=o/100*(K(r)?r[0]:r).totalDuration()),i>1?t(e,n.substr(0,i-1),r)+o:h+o)):null==n?h:+n},se=function(t,e,n){var r,o,l=U(e[1]),c=(l?2:1)+(t<2?0:1),d=e[c];if(l&&(d.duration=e[1]),d.parent=n,t){for(r=d,o=n;o&&!("immediateRender"in r);)r=o.vars.defaults||{},o=V(o.vars.inherit)&&o.parent;d.immediateRender=V(r.immediateRender),t<2?d.runBackwards=1:d.startAt=e[c-1]}return new ln(e[0],d,e[c+1])},ae=function(t,e){return t||0===t?e(t):e},oe=function(t,e,n){return n<t?t:n>e?e:n},le=function(t,e){return F(t)&&(e=tt.exec(t))?e[1]:""},ce=[].slice,ue=function(t,e){return t&&$(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&$(t[0]))&&!t.nodeType&&t!==f},de=function(t,e,n){return void 0===n&&(n=[]),t.forEach((function(t){var r;return F(t)&&!e||ue(t,1)?(r=n).push.apply(r,he(t)):n.push(t)}))||n},he=function(t,e,n){return d&&!e&&d.selector?d.selector(t):!F(t)||n||!m&&je()?K(t)?de(t,n):ue(t)?ce.call(t,0):t?[t]:[]:ce.call((e||v).querySelectorAll(t),0)},fe=function(t){return t=he(t)[0]||at("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return he(e,n.querySelectorAll?n:n===t?at("Invalid scope")||v.createElement("div"):t)}},pe=function(a){return a.sort((function(){return.5-Math.random()}))},me=function(t){if(N(t))return t;var e=$(t)?t:{each:t},n=Ge(e.ease),r=e.from||0,base=parseFloat(e.base)||0,o={},l=r>0&&r<1,c=isNaN(r)||l,d=e.axis,h=r,f=r;return F(r)?h=f={center:.5,edges:.5,end:1}[r]||0:!l&&c&&(h=r[0],f=r[1]),function(i,t,a){var l,m,v,y,E,T,k,S,_,A=(a||e).length,O=o[A];if(!O){if(!(_="auto"===e.grid?0:(e.grid||[1,R])[1])){for(k=-R;k<(k=a[_++].getBoundingClientRect().left)&&_<A;);_--}for(O=o[A]=[],l=c?Math.min(_,A)*h-.5:r%_,m=_===R?0:c?A*f/_-.5:r/_|0,k=0,S=R,T=0;T<A;T++)v=T%_-l,y=m-(T/_|0),O[T]=E=d?Math.abs("y"===d?y:v):P(v*v+y*y),E>k&&(k=E),E<S&&(S=E);"random"===r&&pe(O),O.max=k-S,O.min=S,O.v=A=(parseFloat(e.amount)||parseFloat(e.each)*(_>A?A-1:d?"y"===d?A/_:_:Math.max(_,A/_))||0)*("edges"===r?-1:1),O.b=A<0?base-A:base,O.u=le(e.amount||e.each)||0,n=n&&A<0?$e(n):n}return A=(O[i]-O.min)/O.max||0,At(O.b+(n?n(A):A)*O.v)+O.u}},ge=function(t){var p=Math.pow(10,((t+"").split(".")[1]||"").length);return function(e){var n=At(Math.round(parseFloat(e)/t)*t*p);return(n-n%1)/p+(U(e)?0:le(e))}},ve=function(t,e){var n,r,o=K(t);return!o&&$(t)&&(n=o=t.radius||R,t.values?(t=he(t.values),(r=!U(t[0]))&&(n*=n)):t=ge(t.increment)),ae(e,o?N(t)?function(e){return r=t(e),Math.abs(r-e)<=n?r:e}:function(e){for(var o,l,c=parseFloat(r?e.x:e),d=parseFloat(r?e.y:0),h=R,f=0,i=t.length;i--;)(o=r?(o=t[i].x-c)*o+(l=t[i].y-d)*l:Math.abs(t[i]-c))<h&&(h=o,f=i);return f=!n||h<=n?t[f]:e,r||f===e||U(e)?f:f+le(e)}:ge(t))},ye=function(t,e,n,r){return ae(K(t)?!e:!0===n?!!(n=0):!r,(function(){return K(t)?t[~~(Math.random()*t.length)]:(n=n||1e-5)&&(r=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((t-n/2+Math.random()*(e-t+.99*n))/n)*n*r)/r}))},be=function(a,t,e){return ae(e,(function(e){return a[~~t(e)]}))},Ee=function(t){for(var i,e,n,r,o=0,s="";~(i=t.indexOf("random(",o));)n=t.indexOf(")",i),r="["===t.charAt(i+7),e=t.substr(i+7,n-i-7).match(r?J:Y),s+=t.substr(o,i-o)+ye(r?e:+e[0],r?0:+e[1],+e[2]||1e-5),o=n+1;return s+t.substr(o,t.length-o)},Te=function(t,e,n,r,o){var l=e-t,c=r-n;return ae(o,(function(e){return n+((e-t)/l*c||0)}))},ke=function(t,e,n){var p,r,label,o=t.labels,l=R;for(p in o)(r=o[p]-e)<0==!!n&&r&&l>(r=Math.abs(r))&&(label=p,l=r);return label},Se=function(t,e,n){var r,o,l,c=t.vars,h=c[e],f=d,m=t._ctx;if(h)return r=c[e+"Params"],o=c.callbackScope||t,n&&ft.length&&It(),m&&(d=m),l=r?h.apply(o,r):h.call(o),d=f,l},_e=function(t){return Ut(t),t.scrollTrigger&&t.scrollTrigger.kill(!1),t.progress()<1&&Se(t,"onInterrupt"),t},Ae=function(t){var e=(t=!t.name&&t.default||t).name,n=N(t),r=e&&!n&&t.init?function(){this._props=[]}:t,o={init:lt,render:vn,add:tn,kill:bn,modifier:yn,rawVars:0},l={targetTest:0,get:0,getSetter:fn,aliases:{},register:0};if(je(),t!==r){if(mt[e])return;Dt(r,Dt(Mt(t,o),l)),Ct(r.prototype,Ct(o,Mt(t,l))),mt[r.prop=e]=r,t.targetTest&&(yt.push(r),ht[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}ot(e,r),t.register&&t.register(Pn,r,kn)},Oe=255,we={aqua:[0,Oe,Oe],lime:[0,Oe,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Oe],navy:[0,0,128],white:[Oe,Oe,Oe],olive:[128,128,0],yellow:[Oe,Oe,0],orange:[Oe,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Oe,0,0],pink:[Oe,192,203],cyan:[0,Oe,Oe],transparent:[Oe,Oe,Oe,0]},Ie=function(t,e,n){return(6*(t+=t<0?1:t>1?-1:0)<1?e+(n-e)*t*6:t<.5?n:3*t<2?e+(n-e)*(2/3-t)*6:e)*Oe+.5|0},Re=function(t,e,n){var r,g,b,o,s,l,c,d,h,f,a=t?U(t)?[t>>16,t>>8&Oe,t&Oe]:0:we.black;if(!a){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),we[t])a=we[t];else if("#"===t.charAt(0)){if(t.length<6&&(r=t.charAt(1),g=t.charAt(2),b=t.charAt(3),t="#"+r+r+g+g+b+b+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(a=parseInt(t.substr(1,6),16))>>16,a>>8&Oe,a&Oe,parseInt(t.substr(7),16)/255];a=[(t=parseInt(t.substr(1),16))>>16,t>>8&Oe,t&Oe]}else if("hsl"===t.substr(0,3))if(a=f=t.match(Y),e){if(~t.indexOf("="))return a=t.match(z),n&&a.length<4&&(a[3]=1),a}else o=+a[0]%360/360,s=+a[1]/100,r=2*(l=+a[2]/100)-(g=l<=.5?l*(s+1):l+s-l*s),a.length>3&&(a[3]*=1),a[0]=Ie(o+1/3,r,g),a[1]=Ie(o,r,g),a[2]=Ie(o-1/3,r,g);else a=t.match(Y)||we.transparent;a=a.map(Number)}return e&&!f&&(r=a[0]/Oe,g=a[1]/Oe,b=a[2]/Oe,l=((c=Math.max(r,g,b))+(d=Math.min(r,g,b)))/2,c===d?o=s=0:(h=c-d,s=l>.5?h/(2-c-d):h/(c+d),o=c===r?(g-b)/h+(g<b?6:0):c===g?(b-r)/h+2:(r-g)/h+4,o*=60),a[0]=~~(o+.5),a[1]=~~(100*s+.5),a[2]=~~(100*l+.5)),n&&a.length<4&&(a[3]=1),a},Le=function(t){var e=[],n=[],i=-1;return t.split(De).forEach((function(t){var a=t.match(Q)||[];e.push.apply(e,a),n.push(i+=a.length+1)})),e.c=n,e},xe=function(s,t,e){var n,r,o,l,c="",d=(s+c).match(De),h=t?"hsla(":"rgba(",i=0;if(!d)return s;if(d=d.map((function(e){return(e=Re(e,t,1))&&h+(t?e[0]+","+e[1]+"%,"+e[2]+"%,"+e[3]:e.join(","))+")"})),e&&(o=Le(s),(n=e.c).join(c)!==o.c.join(c)))for(l=(r=s.replace(De,"1").split(Q)).length-1;i<l;i++)c+=r[i]+(~n.indexOf(i)?d.shift()||h+"0,0,0,0)":(o.length?o:d.length?d:e).shift());if(!r)for(l=(r=s.split(De)).length-1;i<l;i++)c+=r[i]+d[i];return c+r[l]},De=function(){var p,s="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(p in we)s+="|"+p+"\\b";return new RegExp(s+")","gi")}(),Ce=/hsl[a]?\(/,Pe=function(a){var t,e=a.join(" ");if(De.lastIndex=0,De.test(e))return t=Ce.test(e),a[1]=xe(a[1],t),a[0]=xe(a[0],t,Le(a[1])),!0},Me=function(){var t,e,n,r,o,l,c=Date.now,d=500,h=33,E=c(),T=E,S=1e3/240,_=S,A=[],O=function n(f){var m,v,time,y,k=c()-T,O=!0===f;if(k>d&&(E+=k-h),((m=(time=(T+=k)-E)-_)>0||O)&&(y=++r.frame,o=time-1e3*r.time,r.time=time/=1e3,_+=m+(m>=S?4:S-m),v=1),O||(t=e(n)),v)for(l=0;l<A.length;l++)A[l](time,o,y,f)};return r={time:0,frame:0,tick:function(){O(!0)},deltaRatio:function(t){return o/(1e3/(t||60))},wake:function(){y&&(!m&&G()&&(f=m=window,v=f.document||{},et.gsap=Pn,(f.gsapVersions||(f.gsapVersions=[])).push(Pn.version),it(nt||f.GreenSockGlobals||!f.gsap&&f||{}),n=f.requestAnimationFrame),t&&r.sleep(),e=n||function(t){return setTimeout(t,_-1e3*r.time+1|0)},k=1,O(2))},sleep:function(){(n?f.cancelAnimationFrame:clearTimeout)(t),k=0,e=lt},lagSmoothing:function(t,e){d=t||1e8,h=Math.min(e,d,0)},fps:function(t){S=1e3/(t||240),_=1e3*r.time+S},add:function(t,e,n){var o=e?function(e,n,l,c){t(e,n,l,c),r.remove(o)}:t;return r.remove(t),A[n?"unshift":"push"](o),je(),o},remove:function(t,i){~(i=A.indexOf(t))&&A.splice(i,1)&&l>=i&&l--},_listeners:A}}(),je=function(){return!k&&Me.wake()},Fe={},Ne=/^[\d.\-M][\d.\-,\s]/,Ue=/["']/g,Be=function(t){for(var e,n,r,o={},l=t.substr(1,t.length-3).split(":"),c=l[0],i=1,d=l.length;i<d;i++)n=l[i],e=i!==d-1?n.lastIndexOf(","):n.length,r=n.substr(0,e),o[c]=isNaN(r)?r.replace(Ue,"").trim():+r,c=n.substr(e+1).trim();return o},$e=function(t){return function(p){return 1-t(1-p)}},Ve=function t(e,n){for(var r,o=e._first;o;)o instanceof Qe?t(o,n):!o.vars.yoyoEase||o._yoyo&&o._repeat||o._yoyo===n||(o.timeline?t(o.timeline,n):(r=o._ease,o._ease=o._yEase,o._yEase=r,o._yoyo=n)),o=o._next},Ge=function(t,e){return t&&(N(t)?t:Fe[t]||function(t){var e,n,r,o,l=(t+"").split("("),c=Fe[l[0]];return c&&l.length>1&&c.config?c.config.apply(null,~t.indexOf("{")?[Be(l[1])]:(e=t,n=e.indexOf("(")+1,r=e.indexOf(")"),o=e.indexOf("(",n),e.substring(n,~o&&o<r?e.indexOf(")",r+1):r)).split(",").map(Lt)):Fe._CE&&Ne.test(t)?Fe._CE("",t):c}(t))||e},He=function(t,e,n,r){void 0===n&&(n=function(p){return 1-e(1-p)}),void 0===r&&(r=function(p){return p<.5?e(2*p)/2:1-e(2*(1-p))/2});var o,l={easeIn:e,easeOut:n,easeInOut:r};return St(t,(function(t){for(var p in Fe[t]=et[t]=l,Fe[o=t.toLowerCase()]=n,l)Fe[o+("easeIn"===p?".in":"easeOut"===p?".out":".inOut")]=Fe[t+"."+p]=l[p]})),l},We=function(t){return function(p){return p<.5?(1-t(1-2*p))/2:.5+t(2*(p-.5))/2}},Ke=function t(e,n,r){var o=n>=1?n:1,l=(r||(e?.3:.45))/(n<1?n:1),c=l/x*(Math.asin(1/o)||0),d=function(p){return 1===p?1:o*Math.pow(2,-10*p)*j((p-c)*l)+1},h="out"===e?d:"in"===e?function(p){return 1-d(1-p)}:We(d);return l=x/l,h.config=function(n,r){return t(e,n,r)},h},qe=function t(e,n){void 0===n&&(n=1.70158);var r=function(p){return p?--p*p*((n+1)*p+n)+1:0},o="out"===e?r:"in"===e?function(p){return 1-r(1-p)}:We(r);return o.config=function(n){return t(e,n)},o};St("Linear,Quad,Cubic,Quart,Quint,Strong",(function(t,i){var e=i<5?i+1:i;He(t+",Power"+(e-1),i?function(p){return Math.pow(p,e)}:function(p){return p},(function(p){return 1-Math.pow(1-p,e)}),(function(p){return p<.5?Math.pow(2*p,e)/2:1-Math.pow(2*(1-p),e)/2}))})),Fe.Linear.easeNone=Fe.none=Fe.Linear.easeIn,He("Elastic",Ke("in"),Ke("out"),Ke()),S=7.5625,A=1/(_=2.75),He("Bounce",(function(p){return 1-O(1-p)}),O=function(p){return p<A?S*p*p:p<.7272727272727273?S*Math.pow(p-1.5/_,2)+.75:p<.9090909090909092?S*(p-=2.25/_)*p+.9375:S*Math.pow(p-2.625/_,2)+.984375}),He("Expo",(function(p){return p?Math.pow(2,10*(p-1)):0})),He("Circ",(function(p){return-(P(1-p*p)-1)})),He("Sine",(function(p){return 1===p?1:1-M(p*D)})),He("Back",qe("in"),qe("out"),qe()),Fe.SteppedEase=Fe.steps=et.SteppedEase={config:function(t,e){void 0===t&&(t=1);var n=1/t,r=t+(e?0:1),o=e?1:0;return function(p){return((r*oe(0,.99999999,p)|0)+o)*n}}},I.ease=Fe["quad.out"],St("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",(function(t){return bt+=t+","+t+"Params,"}));var Ye=function(t,e){this.id=C++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:kt,this.set=e?e.getSetter:fn},ze=function(){function t(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,ee(this,+t.duration,1,1),this.data=t.data,d&&(this._ctx=d,d.data.push(this)),k||Me.wake()}var e=t.prototype;return e.delay=function(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,ee(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,e){if(je(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(Yt(this,t),!n._dp||n.parent||zt(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&Qt(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===L||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),Rt(this,t,e)),this},e.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Ht(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},e.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},e.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Ht(this),e):this.duration()?Math.min(1,this._time/this._dur):this.ratio},e.iteration=function(t,e){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*n,e):this._repeat?Wt(this._tTime,n)+1:1},e.timeScale=function(t){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===t)return this;var e=this.parent&&this._ts?Kt(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,this.totalTime(oe(-this._delay,this._tDur,e),!0),qt(this),$t(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(je(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==L&&(this._tTime-=L)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return e&&(e._sort||!this.parent)&&Qt(e,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(V(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Kt(e.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){void 0===t&&(t=ut);var e=c;return c=t,this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents),"nested"!==this.data&&Ut(this),c=e,this},e.globalTime=function(t){for(var e=this,time=arguments.length?t:e.rawTime();e;)time=e._start+time/(e._ts||1),e=e._dp;return!this.parent&&this.vars.immediateRender?-1:time},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,ne(this)):-2===this._repeat?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var time=this._time;return this._rDelay=t,ne(this),time?this.time(time):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,e){return this.totalTime(re(this,t),V(e))},e.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,V(e))},e.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},e.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},e.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var t,e=this.parent||this._dp,n=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=n&&t<this.endTime(!0)-L))},e.eventCallback=function(t,e,n){var r=this.vars;return arguments.length>1?(e?(r[t]=e,n&&(r[t+"Params"]=n),"onUpdate"===t&&(this._onUpdate=e)):delete r[t],this):r[t]},e.then=function(t){var e=this;return new Promise((function(n){var r=N(t)?t:xt,o=function(){var t=e.then;e.then=null,N(r)&&(r=r(e))&&(r.then||r===e)&&(e.then=t),n(r),e.then=t};e._initted&&1===e.totalProgress()&&e._ts>=0||!e._tTime&&e._ts<0?o():e._prom=o}))},e.kill=function(){_e(this)},t}();Dt(ze.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var Qe=function(t){function e(e,n){var o;return void 0===e&&(e={}),(o=t.call(this,e)||this).labels={},o.smoothChildTiming=!!e.smoothChildTiming,o.autoRemoveChildren=!!e.autoRemoveChildren,o._sort=V(e.sortChildren),h&&Qt(e.parent||h,r(o),n),e.reversed&&o.reverse(),e.paused&&o.paused(!0),e.scrollTrigger&&Xt(r(o),e.scrollTrigger),o}o(e,t);var n=e.prototype;return n.to=function(t,e,n){return se(0,arguments,this),this},n.from=function(t,e,n){return se(1,arguments,this),this},n.fromTo=function(t,e,n,r){return se(2,arguments,this),this},n.set=function(t,e,n){return e.duration=0,e.parent=this,jt(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new ln(t,e,re(this,n),1),this},n.call=function(t,e,n){return Qt(this,ln.delayedCall(0,t,e),n)},n.staggerTo=function(t,e,n,r,o,l,c){return n.duration=e,n.stagger=n.stagger||r,n.onComplete=l,n.onCompleteParams=c,n.parent=this,new ln(t,n,re(this,o)),this},n.staggerFrom=function(t,e,n,r,o,l,c){return n.runBackwards=1,jt(n).immediateRender=V(n.immediateRender),this.staggerTo(t,e,n,r,o,l,c)},n.staggerFromTo=function(t,e,n,r,o,l,c,d){return r.startAt=n,jt(r).immediateRender=V(r.immediateRender),this.staggerTo(t,e,r,o,l,c,d)},n.render=function(t,e,n){var time,r,o,l,d,f,m,v,y,E,T,k,S=this._time,_=this._dirty?this.totalDuration():this._tDur,A=this._dur,O=t<=0?0:At(t),w=this._zTime<0!=t<0&&(this._initted||!A);if(this!==h&&O>_&&t>=0&&(O=_),O!==this._tTime||n||w){if(S!==this._time&&A&&(O+=this._time-S,t+=this._time-S),time=O,y=this._start,f=!(v=this._ts),w&&(A||(S=this._zTime),(t||!e)&&(this._zTime=t)),this._repeat){if(T=this._yoyo,d=A+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*d+t,e,n);if(time=At(O%d),O===_?(l=this._repeat,time=A):((l=~~(O/d))&&l===O/d&&(time=A,l--),time>A&&(time=A)),E=Wt(this._tTime,d),!S&&this._tTime&&E!==l&&(E=l),T&&1&l&&(time=A-time,k=1),l!==E&&!this._lock){var I=T&&1&E,R=I===(T&&1&l);if(l<E&&(I=!I),S=I?0:A,this._lock=1,this.render(S||(k?0:At(l*d)),e,!A)._lock=0,this._tTime=O,!e&&this.parent&&Se(this,"onRepeat"),this.vars.repeatRefresh&&!k&&(this.invalidate()._lock=1),S&&S!==this._time||f!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(A=this._dur,_=this._tDur,R&&(this._lock=2,S=I?A:-1e-4,this.render(S,!0),this.vars.repeatRefresh&&!k&&this.invalidate()),this._lock=0,!this._ts&&!f)return this;Ve(this,k)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(m=function(t,e,time){var n;if(time>e)for(n=t._first;n&&n._start<=time;){if("isPause"===n.data&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=time;){if("isPause"===n.data&&n._start<e)return n;n=n._prev}}(this,At(S),At(time)),m&&(O-=time-(time=m._start))),this._tTime=O,this._time=time,this._act=!v,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,S=0),!S&&time&&!e&&(Se(this,"onStart"),this._tTime!==O))return this;if(time>=S&&t>=0)for(r=this._first;r;){if(o=r._next,(r._act||time>=r._start)&&r._ts&&m!==r){if(r.parent!==this)return this.render(t,e,n);if(r.render(r._ts>0?(time-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(time-r._start)*r._ts,e,n),time!==this._time||!this._ts&&!f){m=0,o&&(O+=this._zTime=-1e-8);break}}r=o}else{n=n||c,r=this._last;for(var x=t<0?t:time;r;){if(o=r._prev,(r._act||x<=r._end)&&r._ts&&m!==r){if(r.parent!==this)return this.render(t,e,n);if(r.render(r._ts>0?(x-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(x-r._start)*r._ts,e,n),time!==this._time||!this._ts&&!f){m=0,o&&(O+=this._zTime=x?-1e-8:L);break}}r=o}}if(m&&!e&&(this.pause(),m.render(time>=S?0:-1e-8)._zTime=time>=S?1:-1,this._ts))return this._start=y,qt(this),this.render(t,e,n);this._onUpdate&&!e&&Se(this,"onUpdate",!0),(O===_&&this._tTime>=this.totalDuration()||!O&&S)&&(y!==this._start&&Math.abs(v)===Math.abs(this._ts)||this._lock||((t||!A)&&(O===_&&this._ts>0||!O&&this._ts<0)&&Ut(this,1),e||t<0&&!S||!O&&!S&&_||(Se(this,O===_&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(O<_&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(t,e){var n=this;if(U(e)||(e=re(this,e,t)),!(t instanceof ze)){if(K(t))return t.forEach((function(t){return n.add(t,e)})),this;if(F(t))return this.addLabel(t,e);if(!N(t))return this;t=ln.delayedCall(0,t)}return this!==t?Qt(this,t,e):this},n.getChildren=function(t,e,n,r){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===n&&(n=!0),void 0===r&&(r=-R);for(var a=[],o=this._first;o;)o._start>=r&&(o instanceof ln?e&&a.push(o):(n&&a.push(o),t&&a.push.apply(a,o.getChildren(!0,e,n)))),o=o._next;return a},n.getById=function(t){for(var e=this.getChildren(1,1,1),i=e.length;i--;)if(e[i].vars.id===t)return e[i]},n.remove=function(t){return F(t)?this.removeLabel(t):N(t)?this.killTweensOf(t):(Nt(this,t),t===this._recent&&(this._recent=this._last),Bt(this))},n.totalTime=function(e,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=At(Me.time-(this._ts>0?e/this._ts:(this.totalDuration()-e)/-this._ts))),t.prototype.totalTime.call(this,e,n),this._forcing=0,this):this._tTime},n.addLabel=function(label,t){return this.labels[label]=re(this,t),this},n.removeLabel=function(label){return delete this.labels[label],this},n.addPause=function(t,e,n){var r=ln.delayedCall(0,e||lt,n);return r.data="isPause",this._hasPause=1,Qt(this,r,re(this,t))},n.removePause=function(t){var e=this._first;for(t=re(this,t);e;)e._start===t&&"isPause"===e.data&&Ut(e),e=e._next},n.killTweensOf=function(t,e,n){for(var r=this.getTweensOf(t,n),i=r.length;i--;)Xe!==r[i]&&r[i].kill(t,e);return this},n.getTweensOf=function(t,e){for(var n,a=[],r=he(t),o=this._first,l=U(e);o;)o instanceof ln?wt(o._targets,r)&&(l?(!Xe||o._initted&&o._ts)&&o.globalTime(0)<=e&&o.globalTime(o.totalDuration())>e:!e||o.isActive())&&a.push(o):(n=o.getTweensOf(r,e)).length&&a.push.apply(a,n),o=o._next;return a},n.tweenTo=function(t,e){e=e||{};var n,r=this,o=re(r,t),l=e,c=l.startAt,d=l.onStart,h=l.onStartParams,f=l.immediateRender,m=ln.to(r,Dt({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:e.duration||Math.abs((o-(c&&"time"in c?c.time:r._time))/r.timeScale())||L,onStart:function(){if(r.pause(),!n){var t=e.duration||Math.abs((o-(c&&"time"in c?c.time:r._time))/r.timeScale());m._dur!==t&&ee(m,t,0,1).render(m._time,!0,!0),n=1}d&&d.apply(m,h||[])}},e));return f?m.render(0):m},n.tweenFromTo=function(t,e,n){return this.tweenTo(e,Dt({startAt:{time:re(this,t)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(t){return void 0===t&&(t=this._time),ke(this,re(this,t))},n.previousLabel=function(t){return void 0===t&&(t=this._time),ke(this,re(this,t),1)},n.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+L)},n.shiftChildren=function(t,e,n){void 0===n&&(n=0);for(var p,r=this._first,o=this.labels;r;)r._start>=n&&(r._start+=t,r._end+=t),r=r._next;if(e)for(p in o)o[p]>=n&&(o[p]+=t);return Bt(this)},n.invalidate=function(){var e=this._first;for(this._lock=0;e;)e.invalidate(),e=e._next;return t.prototype.invalidate.call(this)},n.clear=function(t){void 0===t&&(t=!0);for(var e,n=this._first;n;)e=n._next,this.remove(n),n=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Bt(this)},n.totalDuration=function(t){var e,n,r,o=0,l=this,c=l._last,d=R;if(arguments.length)return l.timeScale((l._repeat<0?l.duration():l.totalDuration())/(l.reversed()?-t:t));if(l._dirty){for(r=l.parent;c;)e=c._prev,c._dirty&&c.totalDuration(),(n=c._start)>d&&l._sort&&c._ts&&!l._lock?(l._lock=1,Qt(l,c,n-c._delay,1)._lock=0):d=n,n<0&&c._ts&&(o-=n,(!r&&!l._dp||r&&r.smoothChildTiming)&&(l._start+=n/l._ts,l._time-=n,l._tTime-=n),l.shiftChildren(-n,!1,-Infinity),d=0),c._end>o&&c._ts&&(o=c._end),c=e;ee(l,l===h&&l._time>o?l._time:o,1,1),l._dirty=0}return l._tDur},e.updateRoot=function(time){if(h._ts&&(Rt(h,Kt(time,h)),E=Me.frame),Me.frame>=vt){vt+=w.autoSleep||120;var t=h._first;if((!t||!t._ts)&&w.autoSleep&&Me._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||Me.sleep()}}},e}(ze);Dt(Qe.prototype,{_lock:0,_hasPause:0,_forcing:0});var Xe,Ze,Je=function(t,e,n,r,o,l,c){var d,h,f,m,v,y,E,a,T=new kn(this._pt,t,e,0,1,gn,null,o),k=0,S=0;for(T.b=n,T.e=r,n+="",(E=~(r+="").indexOf("random("))&&(r=Ee(r)),l&&(l(a=[n,r],t,e),n=a[0],r=a[1]),h=n.match(X)||[];d=X.exec(r);)m=d[0],v=r.substring(k,d.index),f?f=(f+1)%5:"rgba("===v.substr(-5)&&(f=1),m!==h[S++]&&(y=parseFloat(h[S-1])||0,T._pt={_next:T._pt,p:v||1===S?v:",",s:y,c:"="===m.charAt(1)?Ot(y,m)-y:parseFloat(m)-y,m:f&&f<4?Math.round:0},k=X.lastIndex);return T.c=k<r.length?r.substring(k,r.length):"",T.fp=c,(Z.test(r)||E)&&(T.e=0),this._pt=T,T},tn=function(t,e,n,r,o,l,c,d,h,f){N(r)&&(r=r(o||0,t,l));var m,v=t[e],y="get"!==n?n:N(v)?h?t[e.indexOf("set")||!N(t["get"+e.substr(3)])?e:"get"+e.substr(3)](h):t[e]():v,E=N(v)?h?dn:un:cn;if(F(r)&&(~r.indexOf("random(")&&(r=Ee(r)),"="===r.charAt(1)&&((m=Ot(y,r)+(le(y)||0))||0===m)&&(r=m)),!f||y!==r||Ze)return isNaN(y*r)||""===r?(!v&&!(e in t)&&st(e,r),Je.call(this,t,e,y,r,E,d||w.stringFilter,h)):(m=new kn(this._pt,t,e,+y||0,r-(y||0),"boolean"==typeof v?mn:pn,0,E),h&&(m.fp=h),c&&m.modifier(c,this,t),this._pt=m)},en=function(t,e,n,r,o,l){var c,d,h,i;if(mt[t]&&!1!==(c=new mt[t]).init(o,c.rawVars?e[t]:function(t,e,n,r,o){if(N(t)&&(t=sn(t,o,e,n,r)),!$(t)||t.style&&t.nodeType||K(t)||W(t))return F(t)?sn(t,o,e,n,r):t;var p,l={};for(p in t)l[p]=sn(t[p],o,e,n,r);return l}(e[t],r,o,l,n),n,r,l)&&(n._pt=d=new kn(n._pt,o,t,0,1,c.render,c,0,c.priority),n!==T))for(h=n._ptLookup[n._targets.indexOf(o)],i=c._props.length;i--;)h[c._props[i]]=d;return c},nn=function t(e,time){var n,i,p,r,o,d,f,m,v,y,E,T,k,S=e.vars,_=S.ease,A=S.startAt,O=S.immediateRender,w=S.lazy,x=S.onUpdate,D=S.onUpdateParams,C=S.callbackScope,P=S.runBackwards,M=S.yoyoEase,j=S.keyframes,F=S.autoRevert,N=e._dur,U=e._startAt,B=e._targets,$=e.parent,G=$&&"nested"===$.data?$.parent._targets:B,H="auto"===e._overwrite&&!l,W=e.timeline;if(W&&(!j||!_)&&(_="none"),e._ease=Ge(_,I.ease),e._yEase=M?$e(Ge(!0===M?_:M,I.ease)):0,M&&e._yoyo&&!e._repeat&&(M=e._yEase,e._yEase=e._ease,e._ease=M),e._from=!W&&!!S.runBackwards,!W||j&&!S.stagger){if(T=(m=B[0]?Tt(B[0]).harness:0)&&S[m.prop],n=Mt(S,ht),U&&(U.revert(P&&N?ut:ct),U._lazy=0),A){if(Ut(e._startAt=ln.set(B,Dt({data:"isStart",overwrite:!1,parent:$,immediateRender:!0,lazy:V(w),startAt:null,delay:0,onUpdate:x,onUpdateParams:D,callbackScope:C,stagger:0},A))),time<0&&(c||!O&&!F)&&e._startAt.revert(ut),O&&N&&time<=0)return void(time&&(e._zTime=time))}else if(P&&N&&!U)if(time&&(O=!1),p=Dt({overwrite:!1,data:"isFromStart",lazy:O&&V(w),immediateRender:O,stagger:0,parent:$},n),T&&(p[m.prop]=T),Ut(e._startAt=ln.set(B,p)),time<0&&(c?e._startAt.revert(ut):e._startAt.render(-1,!0)),e._zTime=time,O){if(!time)return}else t(e._startAt,L);for(e._pt=e._ptCache=0,w=N&&V(w)||w&&!N,i=0;i<B.length;i++){if(f=(o=B[i])._gsap||Et(B)[i]._gsap,e._ptLookup[i]=y={},pt[f.id]&&ft.length&&It(),E=G===B?i:G.indexOf(o),m&&!1!==(v=new m).init(o,T||n,e,E,G)&&(e._pt=r=new kn(e._pt,o,v.name,0,1,v.render,v,0,v.priority),v._props.forEach((function(t){y[t]=r})),v.priority&&(d=1)),!m||T)for(p in n)mt[p]&&(v=en(p,n,e,E,o,G))?v.priority&&(d=1):y[p]=r=tn.call(e,o,p,"get",n[p],E,G,0,S.stringFilter);e._op&&e._op[i]&&e.kill(o,e._op[i]),H&&e._pt&&(Xe=e,h.killTweensOf(o,y,e.globalTime(time)),k=!e.parent,Xe=0),e._pt&&w&&(pt[f.id]=1)}d&&Tn(e),e._onInit&&e._onInit(e)}e._onUpdate=x,e._initted=(!e._op||e._pt)&&!k,j&&time<=0&&W.render(R,!0,!0)},rn=function(t,e,n,r){var p,a,o=e.ease||r||"power1.inOut";if(K(e))a=n[t]||(n[t]=[]),e.forEach((function(t,i){return a.push({t:i/(e.length-1)*100,v:t,e:o})}));else for(p in e)a=n[p]||(n[p]=[]),"ease"===p||a.push({t:parseFloat(t),v:e[p],e:o})},sn=function(t,e,i,n,r){return N(t)?t.call(e,i,n,r):F(t)&&~t.indexOf("random(")?Ee(t):t},an=bt+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",on={};St(an+",id,stagger,delay,duration,paused,scrollTrigger",(function(t){return on[t]=1}));var ln=function(t){function e(e,n,o,c){var d;"number"==typeof n&&(o.duration=n,n=o,o=null);var f,i,m,v,p,y,E,T,k=(d=t.call(this,c?n:jt(n))||this).vars,S=k.duration,_=k.delay,A=k.immediateRender,O=k.stagger,I=k.overwrite,R=k.keyframes,L=k.defaults,x=k.scrollTrigger,D=k.yoyoEase,C=n.parent||h,P=(K(e)||W(e)?U(e[0]):"length"in n)?[e]:he(e);if(d._targets=P.length?Et(P):at("GSAP target "+e+" not found. https://greensock.com",!w.nullTargetWarn)||[],d._ptLookup=[],d._overwrite=I,R||O||H(S)||H(_)){if(n=d.vars,(f=d.timeline=new Qe({data:"nested",defaults:L||{}})).kill(),f.parent=f._dp=r(d),f._start=0,O||H(S)||H(_)){if(v=P.length,E=O&&me(O),$(O))for(p in O)~an.indexOf(p)&&(T||(T={}),T[p]=O[p]);for(i=0;i<v;i++)(m=Mt(n,on)).stagger=0,D&&(m.yoyoEase=D),T&&Ct(m,T),y=P[i],m.duration=+sn(S,r(d),i,y,P),m.delay=(+sn(_,r(d),i,y,P)||0)-d._delay,!O&&1===v&&m.delay&&(d._delay=_=m.delay,d._start+=_,m.delay=0),f.to(y,m,E?E(i,y,P):0),f._ease=Fe.none;f.duration()?S=_=0:d.timeline=0}else if(R){jt(Dt(f.vars.defaults,{ease:"none"})),f._ease=Ge(R.ease||n.ease||"none");var a,M,j,time=0;if(K(R))R.forEach((function(t){return f.to(P,t,">")})),f.duration();else{for(p in m={},R)"ease"===p||"easeEach"===p||rn(p,R[p],m,R.easeEach);for(p in m)for(a=m[p].sort((function(a,b){return a.t-b.t})),time=0,i=0;i<a.length;i++)(j={ease:(M=a[i]).e,duration:(M.t-(i?a[i-1].t:0))/100*S})[p]=M.v,f.to(P,j,time),time+=j.duration;f.duration()<S&&f.to({},{duration:S-f.duration()})}}S||d.duration(S=f.duration())}else d.timeline=0;return!0!==I||l||(Xe=r(d),h.killTweensOf(P),Xe=0),Qt(C,r(d),o),n.reversed&&d.reverse(),n.paused&&d.paused(!0),(A||!S&&!R&&d._start===At(C._time)&&V(A)&&Gt(r(d))&&"nested"!==C.data)&&(d._tTime=-1e-8,d.render(Math.max(0,-_))),x&&Xt(r(d),x),d}o(e,t);var n=e.prototype;return n.render=function(t,e,n){var time,r,o,l,d,h,f,m,v,y=this._time,E=this._tDur,T=this._dur,k=t<0,S=t>E-L&&!k?E:t<L?0:t;if(T){if(S!==this._tTime||!t||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==k){if(time=S,m=this.timeline,this._repeat){if(l=T+this._rDelay,this._repeat<-1&&k)return this.totalTime(100*l+t,e,n);if(time=At(S%l),S===E?(o=this._repeat,time=T):((o=~~(S/l))&&o===S/l&&(time=T,o--),time>T&&(time=T)),(h=this._yoyo&&1&o)&&(v=this._yEase,time=T-time),d=Wt(this._tTime,l),time===y&&!n&&this._initted)return this._tTime=S,this;o!==d&&(m&&this._yEase&&Ve(m,h),!this.vars.repeatRefresh||h||this._lock||(this._lock=n=1,this.render(At(l*o),!0).invalidate()._lock=0))}if(!this._initted){if(Zt(this,k?t:time,n,e))return this._tTime=0,this;if(y!==this._time)return this;if(T!==this._dur)return this.render(t,e,n)}if(this._tTime=S,this._time=time,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=f=(v||this._ease)(time/T),this._from&&(this.ratio=f=1-f),time&&!y&&!e&&(Se(this,"onStart"),this._tTime!==S))return this;for(r=this._pt;r;)r.r(f,r.d),r=r._next;m&&m.render(t<0?t:!time&&h?-1e-8:m._dur*m._ease(time/this._dur),e,n)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(k&&Vt(this,t,0,n),Se(this,"onUpdate")),this._repeat&&o!==d&&this.vars.onRepeat&&!e&&this.parent&&Se(this,"onRepeat"),S!==this._tDur&&S||this._tTime!==S||(k&&!this._onUpdate&&Vt(this,t,0,!0),(t||!T)&&(S===this._tDur&&this._ts>0||!S&&this._ts<0)&&Ut(this,1),e||k&&!y||!S&&!y||(Se(this,S===E?"onComplete":"onReverseComplete",!0),this._prom&&!(S<E&&this.timeScale()>0)&&this._prom()))}}else!function(t,e,n,r){var o,l,d,h=t.ratio,f=e<0||!e&&(!t._start&&Jt(t)&&(t._initted||!te(t))||(t._ts<0||t._dp._ts<0)&&!te(t))?0:1,m=t._rDelay,v=0;if(m&&t._repeat&&(v=oe(0,t._tDur,e),l=Wt(v,m),t._yoyo&&1&l&&(f=1-f),l!==Wt(t._tTime,m)&&(h=1-f,t.vars.repeatRefresh&&t._initted&&t.invalidate())),f!==h||c||r||t._zTime===L||!e&&t._zTime){if(!t._initted&&Zt(t,e,r,n))return;for(d=t._zTime,t._zTime=e||(n?L:0),n||(n=e&&!d),t.ratio=f,t._from&&(f=1-f),t._time=0,t._tTime=v,o=t._pt;o;)o.r(f,o.d),o=o._next;e<0&&Vt(t,e,0,!0),t._onUpdate&&!n&&Se(t,"onUpdate"),v&&t._repeat&&!n&&t.parent&&Se(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===f&&(f&&Ut(t,1),n||(Se(t,f?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,n);return this},n.targets=function(){return this._targets},n.invalidate=function(){return this._pt=this._op=this._startAt=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),t.prototype.invalidate.call(this)},n.resetTo=function(t,e,n,r){k||Me.wake(),this._ts||this.play();var time=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||nn(this,time),function(t,e,n,r,o,l,time){var c,d,h,i,f=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!f)for(f=t._ptCache[e]=[],h=t._ptLookup,i=t._targets.length;i--;){if((c=h[i][e])&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==e&&c.fp!==e;)c=c._next;if(!c)return Ze=1,t.vars[e]="+=0",nn(t,time),Ze=0,1;f.push(c)}for(i=f.length;i--;)(c=(d=f[i])._pt||d).s=!r&&0!==r||o?c.s+(r||0)+l*c.c:r,c.c=n-c.s,d.e&&(d.e=_t(n)+le(d.e)),d.b&&(d.b=c.s+le(d.b))}(this,t,e,n,r,this._ease(time/this._dur),time)?this.resetTo(t,e,n,r):(Yt(this,0),this.parent||Ft(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?_e(this):this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Xe&&!0!==Xe.vars.overwrite)._first||_e(this),this.parent&&n!==this.timeline.totalDuration()&&ee(this,this._dur*this.timeline._tDur/n,0,1),this}var r,o,l,c,p,d,i,h=this._targets,f=t?he(t):h,m=this._ptLookup,v=this._pt;if((!e||"all"===e)&&function(t,e){for(var i=t.length,n=i===e.length;n&&i--&&t[i]===e[i];);return i<0}(h,f))return"all"===e&&(this._pt=0),_e(this);for(r=this._op=this._op||[],"all"!==e&&(F(e)&&(p={},St(e,(function(t){return p[t]=1})),e=p),e=function(t,e){var n,p,i,r,o=t[0]?Tt(t[0]).harness:0,l=o&&o.aliases;if(!l)return e;for(p in n=Ct({},e),l)if(p in n)for(i=(r=l[p].split(",")).length;i--;)n[r[i]]=n[p];return n}(h,e)),i=h.length;i--;)if(~f.indexOf(h[i]))for(p in o=m[i],"all"===e?(r[i]=e,c=o,l={}):(l=r[i]=r[i]||{},c=e),c)(d=o&&o[p])&&("kill"in d.d&&!0!==d.d.kill(p)||Nt(this,d,"_pt"),delete o[p]),"all"!==l&&(l[p]=1);return this._initted&&!this._pt&&v&&_e(this),this},e.to=function(t,n){return new e(t,n,arguments[2])},e.from=function(t,e){return se(1,arguments)},e.delayedCall=function(t,n,r,o){return new e(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:n,onReverseComplete:n,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:o})},e.fromTo=function(t,e,n){return se(2,arguments)},e.set=function(t,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new e(t,n)},e.killTweensOf=function(t,e,n){return h.killTweensOf(t,e,n)},e}(ze);Dt(ln.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),St("staggerTo,staggerFrom,staggerFromTo",(function(t){ln[t]=function(){var e=new Qe,n=ce.call(arguments,0);return n.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,n)}}));var cn=function(t,e,n){return t[e]=n},un=function(t,e,n){return t[e](n)},dn=function(t,e,n,data){return t[e](data.fp,n)},hn=function(t,e,n){return t.setAttribute(e,n)},fn=function(t,e){return N(t[e])?un:B(t[e])&&t.setAttribute?hn:cn},pn=function(t,data){return data.set(data.t,data.p,Math.round(1e6*(data.s+data.c*t))/1e6,data)},mn=function(t,data){return data.set(data.t,data.p,!!(data.s+data.c*t),data)},gn=function(t,data){var e=data._pt,s="";if(!t&&data.b)s=data.b;else if(1===t&&data.e)s=data.e;else{for(;e;)s=e.p+(e.m?e.m(e.s+e.c*t):Math.round(1e4*(e.s+e.c*t))/1e4)+s,e=e._next;s+=data.c}data.set(data.t,data.p,s,data)},vn=function(t,data){for(var e=data._pt;e;)e.r(t,e.d),e=e._next},yn=function(t,e,n,r){for(var o,l=this._pt;l;)o=l._next,l.p===r&&l.modifier(t,e,n),l=o},bn=function(t){for(var e,n,r=this._pt;r;)n=r._next,r.p===t&&!r.op||r.op===t?Nt(this,r,"_pt"):r.dep||(e=1),r=n;return!e},En=function(t,e,n,data){data.mSet(t,e,data.m.call(data.tween,n,data.mt),data)},Tn=function(t){for(var e,n,r,o,l=t._pt;l;){for(e=l._next,n=r;n&&n.pr>l.pr;)n=n._next;(l._prev=n?n._prev:o)?l._prev._next=l:r=l,(l._next=n)?n._prev=l:o=l,l=e}t._pt=r},kn=function(){function t(t,e,n,r,o,l,data,c,d){this.t=e,this.s=r,this.c=o,this.p=n,this.r=l||pn,this.d=data||this,this.set=c||cn,this.pr=d||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,n){this.mSet=this.mSet||this.set,this.set=En,this.m=t,this.mt=n,this.tween=e},t}();St(bt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return ht[t]=1})),et.TweenMax=et.TweenLite=ln,et.TimelineLite=et.TimelineMax=Qe,h=new Qe({sortChildren:!1,defaults:I,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),w.stringFilter=Pe;var Sn=[],_n={},An=[],On=0,wn=function(t){return(_n[t]||An).map((function(t){return t()}))},In=function(){var time=Date.now(),t=[];time-On>2&&(wn("matchMediaInit"),Sn.forEach((function(e){var n,p,r,o,l=e.queries,c=e.conditions;for(p in l)(n=f.matchMedia(l[p]).matches)&&(r=1),n!==c[p]&&(c[p]=n,o=1);o&&(e.revert(),r&&t.push(e))})),wn("matchMediaRevert"),t.forEach((function(t){return t.onMatch(t)})),On=time,wn("matchMedia"))},Rn=function(){function t(t,e){this.selector=e&&fe(e),this.data=[],this._r=[],this.isReverted=!1,t&&this.add(t)}var e=t.prototype;return e.add=function(t,e,n){N(t)&&(n=e,e=t,t=N);var r=this,o=function(){var t,o=d,l=r.selector;return o&&o.data.push(r),n&&(r.selector=fe(n)),d=r,t=e.apply(r,arguments),N(t)&&r._r.push(t),d=o,r.selector=l,r.isReverted=!1,t};return r.last=o,t===N?o(r):t?r[t]=o:o},e.ignore=function(t){var e=d;d=null,t(this),d=e},e.getTweens=function(){var a=[];return this.data.forEach((function(e){return e instanceof t?a.push.apply(a,e.getTweens()):e instanceof ln&&e._targets[0]!==e.vars.onComplete&&a.push(e)})),a},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var n=this;if(t?(this.getTweens().map((function(t){return{g:t.globalTime(0),t:t}})).sort((function(a,b){return b.g-a.g||-1})).forEach((function(e){return e.t.revert(t)})),this.data.forEach((function(e){return!(e instanceof ze)&&e.revert&&e.revert(t)})),this._r.forEach((function(e){return e(t,n)})),this.isReverted=!0):this.data.forEach((function(t){return t.kill&&t.kill()})),this.clear(),e){var i=Sn.indexOf(this);~i&&Sn.splice(i,1)}},e.revert=function(t){this.kill(t||{})},t}(),Ln=function(){function t(t){this.contexts=[],this.scope=t}var e=t.prototype;return e.add=function(t,e,n){$(t)||(t={matches:t});var r,p,o,l=new Rn(0,n||this.scope),c=l.conditions={};for(p in this.contexts.push(l),e=l.add("onMatch",e),l.queries=t,t)"all"===p?o=1:(r=f.matchMedia(t[p]))&&(Sn.indexOf(l)<0&&Sn.push(l),(c[p]=r.matches)&&(o=1),r.addListener?r.addListener(In):r.addEventListener("change",In));return o&&e(l),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach((function(e){return e.kill(t,!0)}))},t}(),xn={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach((function(t){return Ae(t)}))},timeline:function(t){return new Qe(t)},getTweensOf:function(t,e){return h.getTweensOf(t,e)},getProperty:function(t,e,n,r){F(t)&&(t=he(t)[0]);var o=Tt(t||{}).get,l=n?xt:Lt;return"native"===n&&(n=""),t?e?l((mt[e]&&mt[e].get||o)(t,e,n,r)):function(e,n,r){return l((mt[e]&&mt[e].get||o)(t,e,n,r))}:t},quickSetter:function(t,e,n){if((t=he(t)).length>1){var r=t.map((function(t){return Pn.quickSetter(t,e,n)})),o=r.length;return function(t){for(var i=o;i--;)r[i](t)}}t=t[0]||{};var l=mt[e],c=Tt(t),p=c.harness&&(c.harness.aliases||{})[e]||e,d=l?function(e){var p=new l;T._pt=0,p.init(t,n?e+n:e,T,0,[t]),p.render(1,p),T._pt&&vn(1,T)}:c.set(t,p);return l?d:function(e){return d(t,p,n?e+n:e,c,1)}},quickTo:function(t,e,n){var r,o=Pn.to(t,Ct(((r={})[e]="+=0.1",r.paused=!0,r),n||{})),l=function(t,n,r){return o.resetTo(e,t,n,r)};return l.tween=o,l},isTweening:function(t){return h.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Ge(t.ease,I.ease)),Pt(I,t||{})},config:function(t){return Pt(w,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,r=t.plugins,o=t.defaults,l=t.extendTimeline;(r||"").split(",").forEach((function(t){return t&&!mt[t]&&!et[t]&&at(e+" effect requires "+t+" plugin.")})),gt[e]=function(t,e,r){return n(he(t),Dt(e||{},o),r)},l&&(Qe.prototype[e]=function(t,n,r){return this.add(gt[e](t,$(n)?n:(r=n)&&{},this),r)})},registerEase:function(t,e){Fe[t]=Ge(e)},parseEase:function(t,e){return arguments.length?Ge(t,e):Fe},getById:function(t){return h.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var n,r,o=new Qe(t);for(o.smoothChildTiming=V(t.smoothChildTiming),h.remove(o),o._dp=0,o._time=o._tTime=h._time,n=h._first;n;)r=n._next,!e&&!n._dur&&n instanceof ln&&n.vars.onComplete===n._targets[0]||Qt(o,n,n._start-n._delay),n=r;return Qt(h,o,0),o},context:function(t,e){return t?new Rn(t,e):d},matchMedia:function(t){return new Ln(t)},matchMediaRefresh:function(){return Sn.forEach((function(t){var e,p,n=t.conditions;for(p in n)n[p]&&(n[p]=!1,e=1);e&&t.revert()}))||In()},addEventListener:function(t,e){var a=_n[t]||(_n[t]=[]);~a.indexOf(e)||a.push(e)},removeEventListener:function(t,e){var a=_n[t],i=a&&a.indexOf(e);i>=0&&a.splice(i,1)},utils:{wrap:function t(e,n,r){var o=n-e;return K(e)?be(e,t(0,e.length),n):ae(r,(function(t){return(o+(t-e)%o)%o+e}))},wrapYoyo:function t(e,n,r){var o=n-e,l=2*o;return K(e)?be(e,t(0,e.length-1),n):ae(r,(function(t){return e+((t=(l+(t-e)%l)%l||0)>o?l-t:t)}))},distribute:me,random:ye,snap:ve,normalize:function(t,e,n){return Te(t,e,0,1,n)},getUnit:le,clamp:function(t,e,n){return ae(n,(function(n){return oe(t,e,n)}))},splitColor:Re,toArray:he,selector:fe,mapRange:Te,pipe:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return e.reduce((function(t,e){return e(t)}),t)}},unitize:function(t,e){return function(n){return t(parseFloat(n))+(e||le(n))}},interpolate:function t(e,n,progress,r){var o=isNaN(e+n)?0:function(p){return(1-p)*e+p*n};if(!o){var p,i,l,c,d,h=F(e),f={};if(!0===progress&&(r=1)&&(progress=null),h)e={p:e},n={p:n};else if(K(e)&&!K(n)){for(l=[],c=e.length,d=c-2,i=1;i<c;
2i++)l.push(t(e[i-1],e[i]));c--,o=function(p){p*=c;var i=Math.min(d,~~p);return l[i](p-i)},progress=n}else r||(e=Ct(K(e)?[]:{},e));if(!l){for(p in n)tn.call(f,e,p,"get",n[p]);o=function(p){return vn(p,f)||(h?e.p:e)}}}return ae(progress,o)},shuffle:pe},install:it,effects:gt,ticker:Me,updateRoot:Qe.updateRoot,plugins:mt,globalTimeline:h,core:{PropTween:kn,globals:ot,Tween:ln,Timeline:Qe,Animation:ze,getCache:Tt,_removeLinkedListItem:Nt,reverting:function(){return c},context:function(t){return t&&d&&(d.data.push(t),t._ctx=d),d},suppressOverwrites:function(t){return l=t}}};St("to,from,fromTo,delayedCall,set,killTweensOf",(function(t){return xn[t]=ln[t]})),Me.add(Qe.updateRoot),T=xn.to({},{duration:0});var Dn=function(t,e){for(var n=t._pt;n&&n.p!==e&&n.op!==e&&n.fp!==e;)n=n._next;return n},Cn=function(t,e){return{name:t,rawVars:1,init:function(t,n,r){r._onInit=function(t){var r,p;if(F(n)&&(r={},St(n,(function(t){return r[t]=1})),n=r),e){for(p in r={},n)r[p]=e(n[p]);n=r}!function(t,e){var p,i,n,r=t._targets;for(p in e)for(i=r.length;i--;)(n=t._ptLookup[i][p])&&(n=n.d)&&(n._pt&&(n=Dn(n,p)),n&&n.modifier&&n.modifier(e[p],t,r[i],p))}(t,n)}}}},Pn=xn.registerPlugin({name:"attr",init:function(t,e,n,r,o){var p,l,c;for(p in this.tween=n,e)c=t.getAttribute(p)||"",(l=this.add(t,"setAttribute",(c||0)+"",e[p],r,o,0,0,p)).op=p,l.b=c,this._props.push(p)},render:function(t,data){for(var e=data._pt;e;)c?e.set(e.t,e.p,e.b,e):e.r(t,e.d),e=e._next}},{name:"endArray",init:function(t,e){for(var i=e.length;i--;)this.add(t,i,t[i]||0,e[i],0,0,0,0,0,1)}},Cn("roundProps",ge),Cn("modifiers"),Cn("snap",ve))||xn;ln.version=Qe.version=Pn.version="3.11.0",y=1,G()&&je();Fe.Power0,Fe.Power1,Fe.Power2,Fe.Power3,Fe.Power4,Fe.Linear,Fe.Quad,Fe.Cubic,Fe.Quart,Fe.Quint,Fe.Strong,Fe.Elastic,Fe.Back,Fe.SteppedEase,Fe.Bounce,Fe.Sine,Fe.Expo,Fe.Circ;var Mn,jn,Fn,Nn,Un,Bn,$n,Vn,Gn={},Hn=180/Math.PI,Wn=Math.PI/180,Kn=Math.atan2,qn=/([A-Z])/g,Yn=/(left|right|width|margin|padding|x)/i,zn=/[\s,\(]\S/,Qn={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Xn=function(t,data){return data.set(data.t,data.p,Math.round(1e4*(data.s+data.c*t))/1e4+data.u,data)},Zn=function(t,data){return data.set(data.t,data.p,1===t?data.e:Math.round(1e4*(data.s+data.c*t))/1e4+data.u,data)},Jn=function(t,data){return data.set(data.t,data.p,t?Math.round(1e4*(data.s+data.c*t))/1e4+data.u:data.b,data)},ti=function(t,data){var e=data.s+data.c*t;data.set(data.t,data.p,~~(e+(e<0?-.5:.5))+data.u,data)},ei=function(t,data){return data.set(data.t,data.p,t?data.e:data.b,data)},ni=function(t,data){return data.set(data.t,data.p,1!==t?data.b:data.e,data)},ii=function(t,e,n){return t.style[e]=n},ri=function(t,e,n){return t.style.setProperty(e,n)},si=function(t,e,n){return t._gsap[e]=n},ai=function(t,e,n){return t._gsap.scaleX=t._gsap.scaleY=n},oi=function(t,e,n,data,r){var o=t._gsap;o.scaleX=o.scaleY=n,o.renderTransform(r,o)},ci=function(t,e,n,data,r){var o=t._gsap;o[e]=n,o.renderTransform(r,o)},ui="transform",di=ui+"Origin",hi=function(t){var e=this,n=this.target,style=n.style;if(t in Gn){if(this.tfm=this.tfm||{},"transform"!==t&&(~(t=Qn[t]||t).indexOf(",")?t.split(",").forEach((function(a){return e.tfm[a]=Li(n,a)})):this.tfm[t]=n._gsap.x?n._gsap[t]:Li(n,t)),n._gsap.svg&&(this.svg=n.getAttribute(t)||""),this.props.indexOf(ui)>=0)return;t=ui}style&&this.props.push(t,style[t])},fi=function(style){style.translate&&(style.removeProperty("translate"),style.removeProperty("scale"),style.removeProperty("rotate"))},pi=function(){var i,p,t=this.props,e=this.target,style=e.style,n=e._gsap;for(i=0;i<t.length;i+=2)t[i+1]?style[t[i]]=t[i+1]:style.removeProperty(t[i].replace(qn,"-$1").toLowerCase());if(this.tfm){for(p in n.svg&&e.setAttribute("transform",this.svg||""),this.tfm)n[p]=this.tfm[p];!(i=$n())||i.isStart||style[ui]||(fi(style),n.uncache=1)}},mi=function(t,e){var n={target:t,props:[],revert:pi,save:hi};return e&&e.split(",").forEach((function(p){return n.save(p)})),n},gi=function(t,e){var n=jn.createElementNS?jn.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):jn.createElement(t);return n.style?n:jn.createElement(t)},vi=function t(e,n,r){var o=getComputedStyle(e);return o[n]||o.getPropertyValue(n.replace(qn,"-$1").toLowerCase())||o.getPropertyValue(n)||!r&&t(e,bi(n)||n,1)||""},yi="O,Moz,ms,Ms,Webkit".split(","),bi=function(t,element,e){var s=(element||Un).style,i=5;if(t in s&&!e)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);i--&&!(yi[i]+t in s););return i<0?null:(3===i?"ms":i>=0?yi[i]:"")+t},Ei=function(){"undefined"!=typeof window&&window.document&&(Mn=window,jn=Mn.document,Fn=jn.documentElement,Un=gi("div")||{style:{}},gi("div"),ui=bi(ui),di=ui+"Origin",Un.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Vn=!!bi("perspective"),$n=Pn.core.reverting,Nn=1)},Ti=function t(e){var n,svg=gi("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=this.parentNode,o=this.nextSibling,l=this.style.cssText;if(Fn.appendChild(svg),svg.appendChild(this),this.style.display="block",e)try{n=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=t}catch(t){}else this._gsapBBox&&(n=this._gsapBBox());return r&&(o?r.insertBefore(this,o):r.appendChild(this)),Fn.removeChild(svg),this.style.cssText=l,n},ki=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},Si=function(t){var e;try{e=t.getBBox()}catch(n){e=Ti.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===Ti||(e=Ti.call(t,!0)),!e||e.width||e.x||e.y?e:{x:+ki(t,["x","cx","x1"])||0,y:+ki(t,["y","cy","y1"])||0,width:0,height:0}},_i=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Si(t))},Ai=function(t,e){if(e){var style=t.style;e in Gn&&e!==di&&(e=ui),style.removeProperty?("ms"!==e.substr(0,2)&&"webkit"!==e.substr(0,6)||(e="-"+e),style.removeProperty(e.replace(qn,"-$1").toLowerCase())):style.removeAttribute(e)}},Oi=function(t,e,n,r,o,l){var c=new kn(t._pt,e,n,0,1,l?ni:ei);return t._pt=c,c.b=r,c.e=o,t._props.push(n),c},wi={deg:1,rad:1,turn:1},Ii={grid:1,flex:1},Ri=function t(e,n,r,o){var l,c,d,h,f=parseFloat(r)||0,m=(r+"").trim().substr((f+"").length)||"px",style=Un.style,v=Yn.test(n),y="svg"===e.tagName.toLowerCase(),E=(y?"client":"offset")+(v?"Width":"Height"),T=100,k="px"===o,S="%"===o;return o===m||!f||wi[o]||wi[m]?f:("px"!==m&&!k&&(f=t(e,n,r,"px")),h=e.getCTM&&_i(e),!S&&"%"!==m||!Gn[n]&&!~n.indexOf("adius")?(style[v?"width":"height"]=T+(k?m:o),c=~n.indexOf("adius")||"em"===o&&e.appendChild&&!y?e:e.parentNode,h&&(c=(e.ownerSVGElement||{}).parentNode),c&&c!==jn&&c.appendChild||(c=jn.body),(d=c._gsap)&&S&&d.width&&v&&d.time===Me.time&&!d.uncache?_t(f/d.width*T):((S||"%"===m)&&!Ii[vi(c,"display")]&&(style.position=vi(e,"position")),c===e&&(style.position="static"),c.appendChild(Un),l=Un[E],c.removeChild(Un),style.position="absolute",v&&S&&((d=Tt(c)).time=Me.time,d.width=c[E]),_t(k?l*f/T:l&&f?T/l*f:0))):(l=h?e.getBBox()[v?"width":"height"]:e[E],_t(S?f/l*T:f/100*l)))},Li=function(t,e,n,r){var o;return Nn||Ei(),e in Qn&&"transform"!==e&&~(e=Qn[e]).indexOf(",")&&(e=e.split(",")[0]),Gn[e]&&"transform"!==e?(o=$i(t,r),o="transformOrigin"!==e?o[e]:o.svg?o.origin:Vi(vi(t,di))+" "+o.zOrigin+"px"):(!(o=t.style[e])||"auto"===o||r||~(o+"").indexOf("calc("))&&(o=Pi[e]&&Pi[e](t,e,n)||vi(t,e)||kt(t,e)||("op
2acity"===e?1:0)),n&&!~(o+"").trim().indexOf(" ")?Ri(t,e,o,n)+n:o},xi=function(t,e,n,r){if(!n||"none"===n){var p=bi(e,t,1),s=p&&vi(t,p,1);s&&s!==n?(e=p,n=s):"borderColor"===e&&(n=vi(t,"borderTopColor"))}var a,o,l,c,d,h,f,m,v,y,E,T=new kn(this._pt,t.style,e,0,1,gn),k=0,S=0;if(T.b=n,T.e=r,n+="","auto"===(r+="")&&(t.style[e]=r,r=vi(t,e)||r,t.style[e]=n),Pe(a=[n,r]),r=a[1],l=(n=a[0]).match(Q)||[],(r.match(Q)||[]).length){for(;o=Q.exec(r);)f=o[0],v=r.substring(k,o.index),d?d=(d+1)%5:"rgba("!==v.substr(-5)&&"hsla("!==v.substr(-5)||(d=1),f!==(h=l[S++]||"")&&(c=parseFloat(h)||0,E=h.substr((c+"").length),"="===f.charAt(1)&&(f=Ot(c,f)+E),m=parseFloat(f),y=f.substr((m+"").length),k=Q.lastIndex-y.length,y||(y=y||w.units[e]||E,k===r.length&&(r+=y,T.e+=y)),E!==y&&(c=Ri(t,e,h,y)||0),T._pt={_next:T._pt,p:v||1===S?v:",",s:c,c:m-c,m:d&&d<4||"zIndex"===e?Math.round:0});T.c=k<r.length?r.substring(k,r.length):""}else T.r="display"===e&&"none"===r?ni:ei;return Z.test(r)&&(T.e=0),this._pt=T,T},Di={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Ci=function(t,data){if(data.tween&&data.tween._time===data.tween._dur){var e,n,i,r=data.t,style=r.style,o=data.u,l=r._gsap;if("all"===o||!0===o)style.cssText="",n=1;else for(i=(o=o.split(",")).length;--i>-1;)e=o[i],Gn[e]&&(n=1,e="transformOrigin"===e?di:ui),Ai(r,e);n&&(Ai(r,ui),l&&(l.svg&&r.removeAttribute("transform"),$i(r,1),l.uncache=1,fi(style)))}},Pi={clearProps:function(t,e,n,r,o){if("isFromStart"!==o.data){var l=t._pt=new kn(t._pt,e,n,0,0,Ci);return l.u=r,l.pr=-10,l.tween=o,t._props.push(n),1}}},Mi=[1,0,0,1,0,0],ji={},Fi=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},Ni=function(t){var e=vi(t,ui);return Fi(e)?Mi:e.substr(7).match(z).map(_t)},Ui=function(t,e){var n,r,o,l,c=t._gsap||Tt(t),style=t.style,d=Ni(t);return c.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(d=[(o=t.transform.baseVal.consolidate().matrix).a,o.b,o.c,o.d,o.e,o.f]).join(",")?Mi:d:(d!==Mi||t.offsetParent||t===Fn||c.svg||(o=style.display,style.display="block",(n=t.parentNode)&&t.offsetParent||(l=1,r=t.nextElementSibling,Fn.appendChild(t)),d=Ni(t),o?style.display=o:Ai(t,"display"),l&&(r?n.insertBefore(t,r):n?n.appendChild(t):Fn.removeChild(t))),e&&d.length>6?[d[0],d[1],d[4],d[5],d[12],d[13]]:d)},Bi=function(t,e,n,r,o,l){var c,d,h,f=t._gsap,m=o||Ui(t,!0),v=f.xOrigin||0,y=f.yOrigin||0,E=f.xOffset||0,T=f.yOffset||0,a=m[0],b=m[1],k=m[2],S=m[3],_=m[4],A=m[5],O=e.split(" "),w=parseFloat(O[0])||0,I=parseFloat(O[1])||0;n?m!==Mi&&(d=a*S-b*k)&&(h=w*(-b/d)+I*(a/d)-(a*A-b*_)/d,w=w*(S/d)+I*(-k/d)+(k*A-S*_)/d,I=h):(w=(c=Si(t)).x+(~O[0].indexOf("%")?w/100*c.width:w),I=c.y+(~(O[1]||O[0]).indexOf("%")?I/100*c.height:I)),r||!1!==r&&f.smooth?(_=w-v,A=I-y,f.xOffset=E+(_*a+A*k)-_,f.yOffset=T+(_*b+A*S)-A):f.xOffset=f.yOffset=0,f.xOrigin=w,f.yOrigin=I,f.smooth=!!r,f.origin=e,f.originIsAbsolute=!!n,t.style[di]="0px 0px",l&&(Oi(l,f,"xOrigin",v,w),Oi(l,f,"yOrigin",y,I),Oi(l,f,"xOffset",E,f.xOffset),Oi(l,f,"yOffset",T,f.yOffset)),t.setAttribute("data-svg-origin",w+" "+I)},$i=function(t,e){var n=t._gsap||new Ye(t);if("x"in n&&!e&&!n.uncache)return n;var r,o,l,c,d,h,f,m,v,y,E,T,k,S,_,A,O,a,b,I,R,L,x,D,C,P,M,j,F,N,U,B,style=t.style,$=n.scaleX<0,V="px",G="deg",H=getComputedStyle(t),W=vi(t,di)||"0";return r=o=l=h=f=m=v=y=E=0,c=d=1,n.svg=!(!t.getCTM||!_i(t)),H.translate&&("none"===H.translate&&"none"===H.scale&&"none"===H.rotate||(style[ui]=("none"!==H.translate?"translate3d("+(H.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==H.rotate?"rotate("+H.rotate+") ":"")+("none"!==H.scale?"scale("+H.scale.split(" ").join(",")+") ":"")+H[ui]),style.scale=style.rotate=style.translate="none"),S=Ui(t,n.svg),n.svg&&(D=(!n.uncache||"0px 0px"===W)&&!e&&t.getAttribute("data-svg-origin"),Bi(t,D||W,!!D||n.originIsAbsolute,!1!==n.smooth,S)),T=n.xOrigin||0,k=n.yOrigin||0,S!==Mi&&(a=S[0],b=S[1],I=S[2],R=S[3],r=L=S[4],o=x=S[5],6===S.length?(c=Math.sqrt(a*a+b*b),d=Math.sqrt(R*R+I*I),h=a||b?Kn(b,a)*Hn:0,(v=I||R?Kn(I,R)*Hn+h:0)&&(d*=Math.abs(Math.cos(v*Wn))),n.svg&&(r-=T-(T*a+k*I),o-=k-(T*b+k*R))):(B=S[6],N=S[7],M=S[8],j=S[9],F=S[10],U=S[11],r=S[12],o=S[13],l=S[14],f=(_=Kn(B,F))*Hn,_&&(D=L*(A=Math.cos(-_))+M*(O=Math.sin(-_)),C=x*A+j*O,P=B*A+F*O,M=L*-O+M*A,j=x*-O+j*A,F=B
vendor: 4,299 bytes, line 2
2*-O+F*A,U=N*-O+U*A,L=D,x=C,B=P),m=(_=Kn(-I,F))*Hn,_&&(A=Math.cos(-_),U=R*(O=Math.sin(-_))+U*A,a=D=a*A-M*O,b=C=b*A-j*O,I=P=I*A-F*O),h=(_=Kn(b,a))*Hn,_&&(D=a*(A=Math.cos(_))+b*(O=Math.sin(_)),C=L*A+x*O,b=b*A-a*O,x=x*A-L*O,a=D,L=C),f&&Math.abs(f)+Math.abs(h)>359.9&&(f=h=0,m=180-m),c=_t(Math.sqrt(a*a+b*b+I*I)),d=_t(Math.sqrt(x*x+B*B)),_=Kn(L,x),v=Math.abs(_)>2e-4?_*Hn:0,E=U?1/(U<0?-U:U):0),n.svg&&(D=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Fi(vi(t,ui)),D&&t.setAttribute("transform",D))),Math.abs(v)>90&&Math.abs(v)<270&&($?(c*=-1,v+=h<=0?180:-180,h+=h<=0?180:-180):(d*=-1,v+=v<=0?180:-180)),e=e||n.uncache,n.x=r-((n.xPercent=r&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-r)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+V,n.y=o-((n.yPercent=o&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-o)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+V,n.z=l+V,n.scaleX=_t(c),n.scaleY=_t(d),n.rotation=_t(h)+G,n.rotationX=_t(f)+G,n.rotationY=_t(m)+G,n.skewX=v+G,n.skewY=y+G,n.transformPerspective=E+V,(n.zOrigin=parseFloat(W.split(" ")[2])||0)&&(style[di]=Vi(W)),n.xOffset=n.yOffset=0,n.force3D=w.force3D,n.renderTransform=n.svg?zi:Vn?Yi:Hi,n.uncache=0,n},Vi=function(t){return(t=t.split(" "))[0]+" "+t[1]},Gi=function(t,e,n){var r=le(e);return _t(parseFloat(e)+parseFloat(Ri(t,"x",n+"px",r)))+r},Hi=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Yi(t,e)},Wi="0deg",Ki="0px",qi=") ",Yi=function(t,e){var n=e||this,r=n.xPercent,o=n.yPercent,l=n.x,c=n.y,d=n.z,h=n.rotation,f=n.rotationY,m=n.rotationX,v=n.skewX,y=n.skewY,E=n.scaleX,T=n.scaleY,k=n.transformPerspective,S=n.force3D,_=n.target,A=n.zOrigin,O="",w="auto"===S&&t&&1!==t||!0===S;if(A&&(m!==Wi||f!==Wi)){var I,R=parseFloat(f)*Wn,L=Math.sin(R),x=Math.cos(R);R=parseFloat(m)*Wn,I=Math.cos(R),l=Gi(_,l,L*I*-A),c=Gi(_,c,-Math.sin(R)*-A),d=Gi(_,d,x*I*-A+A)}k!==Ki&&(O+="perspective("+k+qi),(r||o)&&(O+="translate("+r+"%, "+o+"%) "),(w||l!==Ki||c!==Ki||d!==Ki)&&(O+=d!==Ki||w?"translate3d("+l+", "+c+", "+d+") ":"translate("+l+", "+c+qi),h!==Wi&&(O+="rotate("+h+qi),f!==Wi&&(O+="rotateY("+f+qi),m!==Wi&&(O+="rotateX("+m+qi),v===Wi&&y===Wi||(O+="skew("+v+", "+y+qi),1===E&&1===T||(O+="scale("+E+", "+T+qi),_.style[ui]=O||"translate(0, 0)"},zi=function(t,e){var n,r,o,l,c,d=e||this,h=d.xPercent,f=d.yPercent,m=d.x,v=d.y,y=d.rotation,E=d.skewX,T=d.skewY,k=d.scaleX,S=d.scaleY,_=d.target,A=d.xOrigin,O=d.yOrigin,w=d.xOffset,I=d.yOffset,R=d.forceCSS,L=parseFloat(m),x=parseFloat(v);y=parseFloat(y),E=parseFloat(E),(T=parseFloat(T))&&(E+=T=parseFloat(T),y+=T),y||E?(y*=Wn,E*=Wn,n=Math.cos(y)*k,r=Math.sin(y)*k,o=Math.sin(y-E)*-S,l=Math.cos(y-E)*S,E&&(T*=Wn,c=Math.tan(E-T),o*=c=Math.sqrt(1+c*c),l*=c,T&&(c=Math.tan(T),n*=c=Math.sqrt(1+c*c),r*=c)),n=_t(n),r=_t(r),o=_t(o),l=_t(l)):(n=k,l=S,r=o=0),(L&&!~(m+"").indexOf("px")||x&&!~(v+"").indexOf("px"))&&(L=Ri(_,"x",m,"px"),x=Ri(_,"y",v,"px")),(A||O||w||I)&&(L=_t(L+A-(A*n+O*o)+w),x=_t(x+O-(A*r+O*l)+I)),(h||f)&&(c=_.getBBox(),L=_t(L+h/100*c.width),x=_t(x+f/100*c.height)),c="matrix("+n+","+r+","+o+","+l+","+L+","+x+")",_.setAttribute("transform",c),R&&(_.style[ui]=c)},Qi=function(t,e,n,r,o){var l,c,d=360,h=F(o),f=parseFloat(o)*(h&&~o.indexOf("rad")?Hn:1)-r,m=r+f+"deg";return h&&("short"===(l=o.split("_")[1])&&(f%=d)!==f%180&&(f+=f<0?d:-360),"cw"===l&&f<0?f=(f+36e9)%d-~~(f/d)*d:"ccw"===l&&f>0&&(f=(f-36e9)%d-~~(f/d)*d)),t._pt=c=new kn(t._pt,e,n,r,f,Zn),c.e=m,c.u="deg",t._props.push(n),c},Xi=function(t,source){for(var p in source)t[p]=source[p];return t},Zi=function(t,e,n){var r,p,o,l,c,d,h,f=Xi({},n._gsap),style=n.style;for(p in f.svg?(o=n.getAttribute("transform"),n.setAttribute("transform",""),style[ui]=e,r=$i(n,1),Ai(n,ui),n.setAttribute("transform",o)):(o=getComputedStyle(n)[ui],style[ui]=e,r=$i(n,1),style[ui]=o),Gn)(o=f[p])!==(l=r[p])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(p)<0&&(c=le(o)!==(h=le(l))?Ri(n,p,o,h):parseFloat(o),d=parseFloat(l),t._pt=new kn(t._pt,r,p,c,d-c,Xn),t._pt.u=h||0,t._props.push(p));Xi(r,f)};St("padding,margin,Width,Radius",(function(t,e){var n="Top",r="Right",b="Bottom",o="Left",l=(e<3?[n,r,b,o]:[n+o,n+r,b+r,b+o]).map((function(n){return e<2?t+n:"border"+n+t}));Pi[e>1?"border"+t:t]=function(t,e,n,r,o){var a,c;if(arguments.length<4)return a=l.map((function(e){return Li(t,e,n)}
2)),5===(c=a.join(" ")).split(a[0]).length?a[0]:c;a=(r+"").split(" "),c={},l.forEach((function(t,i){return c[t]=a[i]=a[i]||a[(i-1)/2|0]})),t.init(e,c,o)}}));var Ji,er,nr,ir={name:"css",register:Ei,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,r,o){var l,c,d,h,f,m,p,v,y,E,T,k,S,_,A,O,I,R,L,x,D=this._props,style=t.style,C=n.vars.startAt;for(p in Nn||Ei(),this.styles=this.styles||mi(t),O=this.styles.props,this.tween=n,e)if("autoRound"!==p&&(c=e[p],!mt[p]||!en(p,e,n,r,t,o)))if(f=typeof c,m=Pi[p],"function"===f&&(f=typeof(c=c.call(n,r,t,o))),"string"===f&&~c.indexOf("random(")&&(c=Ee(c)),m)m(this,t,p,c,n)&&(A=1);else if("--"===p.substr(0,2))l=(getComputedStyle(t).getPropertyValue(p)+"").trim(),c+="",De.lastIndex=0,De.test(l)||(v=le(l),y=le(c)),y?v!==y&&(l=Ri(t,p,l,y)+y):v&&(c+=v),this.add(style,"setProperty",l,c,r,o,0,0,p),D.push(p),O.push(p,style[p]);else if("undefined"!==f){if(C&&p in C?(l="function"==typeof C[p]?C[p].call(n,r,t,o):C[p],F(l)&&~l.indexOf("random(")&&(l=Ee(l)),le(l+"")||(l+=w.units[p]||le(Li(t,p))||""),"="===(l+"").charAt(1)&&(l=Li(t,p))):l=Li(t,p),h=parseFloat(l),(E="string"===f&&"="===c.charAt(1)&&c.substr(0,2))&&(c=c.substr(2)),d=parseFloat(c),p in Qn&&("autoAlpha"===p&&(1===h&&"hidden"===Li(t,"visibility")&&d&&(h=0),O.push("visibility",style.visibility),Oi(this,style,"visibility",h?"inherit":"hidden",d?"inherit":"hidden",!d)),"scale"!==p&&"transform"!==p&&~(p=Qn[p]).indexOf(",")&&(p=p.split(",")[0])),T=p in Gn)if(this.styles.save(p),k||((S=t._gsap).renderTransform&&!e.parseTransform||$i(t,e.parseTransform),_=!1!==e.smoothOrigin&&S.smooth,(k=this._pt=new kn(this._pt,style,ui,0,1,S.renderTransform,S,0,-1)).dep=1),"scale"===p)this._pt=new kn(this._pt,S,"scaleY",S.scaleY,(E?Ot(S.scaleY,E+d):d)-S.scaleY||0,Xn),this._pt.u=0,D.push("scaleY",p),p+="X";else{if("transformOrigin"===p){O.push(di,style[di]),R=void 0,L=void 0,x=void 0,R=(I=c).split(" "),L=R[0],x=R[1]||"50%","top"!==L&&"bottom"!==L&&"left"!==x&&"right"!==x||(I=L,L=x,x=I),R[0]=Di[L]||L,R[1]=Di[x]||x,c=R.join(" "),S.svg?Bi(t,c,0,_,0,this):((y=parseFloat(c.split(" ")[2])||0)!==S.zOrigin&&Oi(this,S,"zOrigin",S.zOrigin,y),Oi(this,style,p,Vi(l),Vi(c)));continue}if("svgOrigin"===p){Bi(t,c,1,_,0,this);continue}if(p in ji){Qi(this,S,p,h,E?Ot(h,E+c):c);continue}if("smoothOrigin"===p){Oi(this,S,"smooth",S.smooth,c);continue}if("force3D"===p){S[p]=c;continue}if("transform"===p){Zi(this,c,t);continue}}else p in style||(p=bi(p)||p);if(T||(d||0===d)&&(h||0===h)&&!zn.test(c)&&p in style)d||(d=0),(v=(l+"").substr((h+"").length))!==(y=le(c)||(p in w.units?w.units[p]:v))&&(h=Ri(t,p,l,y)),this._pt=new kn(this._pt,T?S:style,p,h,(E?Ot(h,E+d):d)-h,T||"px"!==y&&"zIndex"!==p||!1===e.autoRound?Xn:ti),this._pt.u=y||0,v!==y&&"%"!==y&&(this._pt.b=l,this._pt.r=Jn);else if(p in style)xi.call(this,t,p,l,E?E+c:c);else{if(!(p in t)){st(p,c);continue}this.add(t,p,l||t[p],E?E+c:c,r,o)}T||O.push(p,style[p]),D.push(p)}A&&Tn(this)},render:function(t,data){if(data.tween._time||!$n())for(var e=data._pt;e;)e.r(t,e.d),e=e._next;else data.styles.revert()},get:Li,aliases:Qn,getSetter:function(t,e,n){var p=Qn[e];return p&&p.indexOf(",")<0&&(e=p),e in Gn&&e!==di&&(t._gsap.x||Li(t,"x"))?n&&Bn===n?"scale"===e?ai:si:(Bn=n||{})&&("scale"===e?oi:ci):t.style&&!B(t.style[e])?ii:~e.indexOf("-")?ri:fn(t,e)},core:{_removeProperty:Ai,_getMatrix:Ui}};Pn.utils.checkPrefix=bi,Pn.core.getStyleSaver=mi,nr=St((Ji="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(er="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){Gn[t]=1})),St(er,(function(t){w.units[t]="deg",ji[t]=1})),Qn[nr[13]]=Ji+","+er,St("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");Qn[e[1]]=nr[e[0]]})),St("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){w.units[t]="px"})),Pn.registerPlugin(ir);var rr=Pn.registerPlugin(ir)||Pn;rr.core.Tween},203:function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return c}));var r=n(56),o=n(311);function l(t,e){if(t&&t.length){var n=Object(o.a)(t);if(e["T3Bl".concat(n)])return"T3Bl".concat(n)}return"T3BlDefault"}function c(t,e){return e&&"object"===Object(r.a)(e)&&e[t]?e[t]:t||"default"}},204:function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(56);n(14),n(8),n(72);function o(t){return null!==t&&"object"===Object(r.a)(t)}function l(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",r=arguments.length>3?arguments[3]:void 0;if(!o(e))return l(t,{},n,r);var c=Object.assign({},e);for(var d in t)if("__proto__"!==d&&"constructor"!==d){var h=t[d];null!=h&&(r&&r(c,d,h,n)||(Array.isArray(h)&&Array.isArray(c[d])?c[d]=c[d].concat(h):o(h)&&o(c[d])?c[d]=l(h,c[d],(n?"".concat(n,"."):"")+d.toString(),r):c[d]=h))}return c}function c(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.reduce((function(p,e){return l(p,e,"",t)}),{})}}var d=c();d.fn=c((function(t,e,n,r){if(void 0!==t[e]&&"function"==typeof n)return t[e]=n(t[e]),!0})),d.arrayFn=c((function(t,e,n,r){if(Array.isArray(t[e])&&"function"==typeof n)return t[e]=n(t[e]),!0})),d.extend=c},205:function(t,e,n){"use strict";function r(t){return"string"==typeof t?t[0].toUpperCase()+t.substr(1):t}n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return d}));var o={accepted:function(t){return t.name+" erfordert Zustimmung."},after:function(t){var e=t.name,a=t.args;return Array.isArray(a)&&a.length?r(e)+" muss auf "+a[0]+" folgen.":r(e)+" muss ein späteres Datum sein."},alpha:function(t){return r(t.name)+" darf nur Buchstaben enthalten."},alphanumeric:function(t){return r(t.name)+" darf nur Buchstaben und Zahlen enthalten."},before:function(t){var e=t.name,a=t.args;return Array.isArray(a)&&a.length?r(e)+" muss vor "+a[0]+" sein.":r(e)+" muss ein früheres Datum sein."},between:function(t){var e=t.name,a=t.value,n=t.args,i=!(!Array.isArray(n)||
2!n[2])&&n[2];return!isNaN(a)&&"length"!==i||"value"===i?r(e)+" muss zwischen "+n[0]+" und "+n[1]+".":r(e)+" muss zwischen "+n[0]+" und "+n[1]+" Zeichen lang sein."},confirm:function(t){var e=t.name;return t.args,r(e)+" stimmt nicht überein."},date:function(t){var e=t.name,a=t.args;return Array.isArray(a)&&a.length?r(e)+" ist nicht korrekt, bitte das Format "+a[0]+" benutzen.":r(e)+" ist kein gültiges Datum."},default:function(t){return t.name,"Das Feld hat einen Fehler."},email:function(t){t.name;var e=t.value;return e?"â"+e+"â ist keine gültige E-Mail-Adresse.":"Bitte eine gültige E-Mail-Adresse eingeben."},endsWith:function(t){t.name;var e=t.value;return e?"â"+e+"â endet nicht mit einem gültigen Wert.":"Dieses Feld endet nicht mit einem gültigen Wert"},in:function(t){var e=t.name,a=t.value;return"string"==typeof a&&a?"â"+r(a)+"â ist kein gültiger Wert für "+e+".":"Dies ist kein gültiger Wert für "+e+"."},matches:function(t){return r(t.name)+" ist kein gültiger Wert."},max:function(t){var e=t.name,a=t.value,n=t.args;if(Array.isArray(a))return"Es dürfen nur "+n[0]+" "+e+" ausgewählt werden.";var i=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(a)&&"length"!==i||"value"===i?r(e)+" muss kleiner oder gleich "+n[0]+" sein.":r(e)+" muss "+n[0]+" oder weniger Zeichen lang sein."},mime:function(t){var e=t.name,a=t.args;return r(e)+" muss den Typ "+(a[0]||"Keine Dateien erlaubt")+" haben."},min:function(t){var e=t.name,a=t.value,n=t.args;if(Array.isArray(a))return"Es müssen mindestens "+n[0]+" "+e+" ausgewählt werden.";var i=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(a)&&"length"!==i||"value"===i?r(e)+" muss gröÃer als "+n[0]+" sein.":r(e)+" muss "+n[0]+" oder mehr Zeichen lang sein."},not:function(t){var e=t.name;return"â"+t.value+"â ist kein erlaubter Wert für "+e+"."},number:function(t){return r(t.name)+" muss eine Zahl sein."},required:function(t){return r(t.name)+" ist ein Pflichtfeld."},startsWith:function(t){t.name;var e=t.value;return e?"â"+e+"â beginnt nicht mit einem gültigen Wert":"Dieses Feld beginnt nicht mit einem gültigen Wert"},url:function(t){return r(t.name)+" muss eine gültige URL sein."}};function l(t){var e;t.extend({locales:(e={},e.de=o,e)})}var c={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,a=t.args;return Array.isArray(a)&&a.length?r(e)+" must be after "+a[0]+".":r(e)+" must be a later date."},alpha:function(t){return r(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return r(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,a=t.args;return Array.isArray(a)&&a.length?r(e)+" must be before "+a[0]+".":r(e)+" must be an earlier date."},between:function(t){var e=t.name,a=t.value,n=t.args,i=!(!Array.isArray(n)||!n[2])&&n[2];return!isNaN(a)&&"length"!==i||"value"===i?r(e)+" must be between "+n[0]+" and "+n[1]+".":r(e)+" must be between "+n[0]+" and "+n[1]+" characters long."},confirm:function(t){var e=t.name;return t.args,r(e)+" does not match."},date:function(t){var e=t.name,a=t.args;return Array.isArray(a)&&a.length?r(e)+" is not a valid date, please use the format "+a[0]:r(e)+" is not a valid date."},default:function(t){return t.name,"This field isnât valid."},email:function(t){t.name;var e=t.value;return e?"â"+e+"â is not a valid email address.":"Please enter a valid email address."},endsWith:function(t){t.name;var e=t.value;return e?"â"+e+"â doesnât end with a valid value.":"This field doesnât end with a valid value."},in:function(t){var e=t.name,a=t.value;return"string"==typeof a&&a?"â"+r(a)+"â is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return r(t.name)+" is not an allowed value."},max:function(t){var e=t.name,a=t.value,n=t.args;if(Array.isArray(a))return"You may only select "+n[0]+" "+e+".";var i=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(a)&&"length"!==i||"value"===i?r(e)+" must be less than or equal to "+n[0]+".":r(e)+" must be less than or equal to "+n[0]+" characters long."},mime:function(t){var e=t.name,a=t.args;return r(e)+" must be of the type: "+(a[0]||"No file formats allowed.")},min:function(t){var e=t.name,a=t.value,n=t.args;if(Array.isArray(a))return"You need at least "+n[0]+" "+e+".";
2var i=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(a)&&"length"!==i||"value"===i?r(e)+" must be at least "+n[0]+".":r(e)+" must be at least "+n[0]+" characters long."},not:function(t){var e=t.name;return"â"+t.value+"â is not an allowed "+e+"."},number:function(t){return r(t.name)+" must be a number."},required:function(t){return r(t.name)+" is required."},startsWith:function(t){t.name;var e=t.value;return e?"â"+e+"â doesnât start with a valid value.":"This field doesnât start with a valid value."},url:function(t){return t.name,"Please include a valid url."}};function d(t){var e;t.extend({locales:(e={},e.en=c,e)})}},206:function(t,e,n){"use strict";n.d(e,"c",(function(){return h})),n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return m}));var r,o=n(10),l=n(20),c=(n(8),n(59),n(71)),d=n(125),h={layout:"default",locale:"",initial:{},page:{},domain:null,locales:null},f={nuxtServerInit:function(t,e){return Object(l.a)(regeneratorRuntime.mark((function n(){var r,o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=t.dispatch,(o=e.app).$typo3.domains&&o.$typo3.domains.setDomain(o.$typo3.domains.getDomain()),o.$typo3.i18n.setLocale(o.$typo3.i18n.getLocaleByPath(),!1),n.next=6,r("getInitialData");case 6:case"end":return n.stop()}}),n)})))()},getInitialData:function(t){var e=this,n=t.commit,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{path:this.$router.currentRoute.params.pathMatch};if(!Object(d.b)(this.$router.currentRoute)){var o=this.app.$typo3.i18n.getLocaleCodePath();r.path=o}return this.$typo3.api.getInitialData(r).then(function(){var t=Object(l.a)(regeneratorRuntime.mark((function t(r){var data;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return data=r.data,t.next=3,e.$typo3.callHook("initialData",data);case 3:n(c.e.SET_INITIAL_DATA,data),Promise.resolve(data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){return Promise.reject(t)}))}},m=(r={},Object(o.a)(r,c.e.SET_INITIAL_DATA,(function(t,data){t.initial=data})),Object(o.a)(r,c.e.SET_LOCALE_ACTIVE,(function(t,e){t.locale=e})),Object(o.a)(r,c.e.SET_PAGE_DATA,(function(t,data){t.page=data})),Object(o.a)(r,c.e.SET_DOMAIN,(function(t,e){t.domain=e})),Object(o.a)(r,c.e.SET_AVAILABLE_LOCALES,(function(t,e){t.locales=e})),r)},231:function(t,e,n){"use strict";t.exports=function(t,e){return e||(e={}),"string"!=typeof(t=t&&t.__esModule?t.default:t)?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t)}},250:function(t,e,n){"use strict";var r=n(345),o=n.n(r).a.withScope("nuxt:typo3");e.a=o},251:function(t,e,n){"use strict";var r={name:"ClientOnly",functional:!0,props:{placeholder:String,placeholderTag:{type:String,default:"div"}},render:function(t,e){var n=e.parent,r=e.slots,o=e.props,l=r(),c=l.default;void 0===c&&(c=[]);var d=l.placeholder;return n._isMounted?c:(n.$once("hook:mounted",(function(){n.$forceUpdate()})),o.placeholderTag&&(o.placeholder||d)?t(o.placeholderTag,{class:["client-only-placeholder"]},o.placeholder||d):c.length>0?c.map((function(){return t(!1)})):t(!1))}};t.exports=r},259:function(t,e,n){"use strict";var r=["compactDisplay","currency","currencyDisplay","currencySign","localeMatcher","notation","numberingSystem","signDisplay","style","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function o(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}var l=Array.isArray;function c(t){return null!==t&&"object"==typeof t}function d(t){return"string"==typeof t}var h=Object.prototype.toString;function f(t){return"[object Object]"===h.call(t)}function m(t){return null==t}function v(t){return"function"==typeof t}function y(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=null,r=null;return 1===t.length?c(t[0])||l(t[0])?r=t[0]:"string"==typeof t[0]&&(n=t[0]):2===t.length&&("string"==typeof t[0]&&(n=t[0]),(c(t[1])||l(t[1]))&&(r=t[1])),{locale:n,params:r}}function E(t){return JSON.parse(JSON.stringify(t))}function T(t,e){return!!~t.indexOf(e)}var k=Object.prototype.hasOwnProperty;function S(t,e){return k.call(t,e)}function _(t){for(var e=arguments,output=Object(t),i=1;i<arguments.length;i++){var source=e[i];if(null!=source){var n=void 0;for(n in source)S(source,n)&&(c(source[n])?output[n]=_(output[n],source[n]):output[n]=source[n])}}return output}function A(a,b){if(a===b)return!0;var t=c(a),e=c(b);if(!t||!e)return!t&&!e&&String(a)===String(b);try{var n=l(a),r=l(b);if(n&&r)return a.length===b.length&&a.every((function(t,i){return A(t,b[i])}));if(n||r)return!1;var o=Object.keys(a),d=Object.keys(b);return o.length===d.length&&o.every((function(t){return A(a[t],b[t])}))}catch(t){return!1}}function O(t){return null!=t&&Object.keys(t).forEach((function(e){"string"==typeof t[e]&&(t[e]=t[e].replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"))})),t}var w={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(t,e){var data=e.data,n=e.parent,r=e.props,o=e.slots,l=n.$i18n;if(l){var path=r.path,c=r.locale,d=r.places,h=o(),f=l.i(path,c,function(t){var e;
vendor: 19,346 bytes, line 2
2for(e in t)if("default"!==e)return!1;return Boolean(e)}(h)||d?function(t,e){var n=e?function(t){0;return Array.isArray(t)?t.reduce(R,{}):Object.assign({},t)}(e):{};if(!t)return n;var r=(t=t.filter((function(t){return t.tag||""!==t.text.trim()}))).every(L);0;return t.reduce(r?I:R,n)}(h.default,d):h),m=r.tag&&!0!==r.tag||!1===r.tag?r.tag:"span";return m?t(m,data,f):f}}};function I(t,e){return e.data&&e.data.attrs&&e.data.attrs.place&&(t[e.data.attrs.place]=e),t}function R(t,e,n){return t[n]=e,t}function L(t){return Boolean(t.data&&t.data.attrs&&t.data.attrs.place)}var x,D={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render:function(t,e){var n=e.props,o=e.parent,data=e.data,l=o.$i18n;if(!l)return null;var h=null,f=null;d(n.format)?h=n.format:c(n.format)&&(n.format.key&&(h=n.format.key),f=Object.keys(n.format).reduce((function(t,e){var o;return T(r,e)?Object.assign({},t,((o={})[e]=n.format[e],o)):t}),null));var m=n.locale||l.locale,v=l._ntp(n.value,m,h,f),y=v.map((function(t,e){var n,slot=data.scopedSlots&&data.scopedSlots[t.type];return slot?slot(((n={})[t.type]=t.value,n.index=e,n.parts=v,n)):t.value})),E=n.tag&&!0!==n.tag||!1===n.tag?n.tag:"span";return E?t(E,{attrs:data.attrs,class:data.class,staticClass:data.staticClass},y):y}};function C(t,e,n){j(t,n)&&F(t,e,n)}function P(t,e,n,r){if(j(t,n)){var o=n.context.$i18n;(function(t,e){var n=e.context;return t._locale===n.$i18n.locale})(t,n)&&A(e.value,e.oldValue)&&A(t._localeMessage,o.getLocaleMessage(o.locale))||F(t,e,n)}}function M(t,e,n,r){if(n.context){var l=n.context.$i18n||{};e.modifiers.preserve||l.preserveDirectiveContent||(t.textContent=""),t._vt=void 0,delete t._vt,t._locale=void 0,delete t._locale,t._localeMessage=void 0,delete t._localeMessage}else o("Vue instance does not exists in VNode context")}function j(t,e){var n=e.context;return n?!!n.$i18n||(o("VueI18n instance does not exists in Vue instance"),!1):(o("Vue instance does not exists in VNode context"),!1)}function F(t,e,n){var r,l,c=function(t){var path,e,n,r;d(t)?path=t:f(t)&&(path=t.path,e=t.locale,n=t.args,r=t.choice);return{path:path,locale:e,args:n,choice:r}}(e.value),path=c.path,h=c.locale,m=c.args,v=c.choice;if(path||h||m)if(path){var y=n.context;t._vt=t.textContent=null!=v?(r=y.$i18n).tc.apply(r,[path,v].concat(N(h,m))):(l=y.$i18n).t.apply(l,[path].concat(N(h,m))),t._locale=y.$i18n.locale,t._localeMessage=y.$i18n.getLocaleMessage(y.$i18n.locale)}else o("`path` is required in v-t directive");else o("value type not supported")}function N(t,e){var n=[];return t&&n.push(t),e&&(Array.isArray(e)||f(e))&&n.push(e),n}function U(t,e){void 0===e&&(e={bridge:!1}),U.installed=!0;(x=t).version&&Number(x.version.split(".")[0]);(function(t){t.prototype.hasOwnProperty("$i18n")||Object.defineProperty(t.prototype,"$i18n",{get:function(){return this._i18n}}),t.prototype.$t=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=this.$i18n;return r._t.apply(r,[t,r.locale,r._getMessages(),this].concat(e))},t.prototype.$tc=function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];var o=this.$i18n;return o._tc.apply(o,[t,o.locale,o._getMessages(),this,e].concat(n))},t.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},t.prototype.$n=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).n.apply(e,[t].concat(n))}})(x),x.mixin(function(t){function e(){this!==this.$root&&this.$options.__INTLIFY_META__&&this.$el&&this.$el.setAttribute("data-intlify",this.$options.__INTLIFY_META__)}return void 0===t&&(t=!1),t?{mounted:e}:{beforeCreate:function(){var t=this.$options;if(t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n){if(t.i18n instanceof nt){if(t.__i18nBridge||t.__i18n)try{var e=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach((function(t){e=_(e,JSON.parse(t))})),Object.keys(e).forEach((function(n){t.i18n.mergeLocaleMessage(n,e[n])}))}catch(t){}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(f(t.i18n)){var n=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof nt?this.$root.$i18n:null;if(n&&(t.i18n.root=this.$root,t.i18n.formatter=n.formatter,t.i18n.fallbackLocale=n.fallbackLocale,t.i18n.formatFallbackMessages=n.formatFallbackMessages,t.i18n.silentTranslationWarn=n.silentTranslationWarn,t.i18n.silentFallbackWarn=n.silentFallbackWarn,t.i18n.pluralizationRules=n.pluralizationRules,t.i18n.preserveDirectiveContent=n.preserveDirectiveContent),t.__i18nBridge||t.__i18n)try{var r=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach((function(t){r=_(r,JSON.parse(t))})),t.i18n.messages=r}catch(t){}var o=t.i18n.sharedMessages;o&&f(o)&&(t.i18n.messages=_(t.i18n.messages,o)),this._i18n=new nt(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),n&&n.onComponentInstanceCreated(this._i18n)}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof nt?this._i18n=this.$root.$i18n:t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof nt&&(this._i18n=t.parent.$i18n)},beforeMount:function(){var t=this.$options;t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n?(t.i18n instanceof nt||f(t.i18n))&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):(this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof nt||t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof nt)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},mounted:e,beforeDestroy:function(){if(this._i18n){var t=this;this.$nextTick((function(){t._subscribing&&(t._i18n.unsubscribeDataChanging(t),delete t._subscribing),t._i18nWatcher&&(t._i18nWatcher(),t._i18n.destroyVM(),delete t._i18nWatcher),t._localeWatcher&&(t._localeWatcher(),delete t._localeWatcher)}))}}}}(e.bridge)),x.directive("t",{bind:C,update:P,unbind:M}),x.component(w.name,w),x.component(D.name,D),x.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}var B=function(){this._caches=Object.create(null)};B.prototype.interpolate=function(t,e){if(!e)return[t];var n=this._caches[t];return n||(n=function(t){var e=[],n=0,text="";for(;n<t.length;){var r=t[n++];if("{"===r){text&&e.push({type:"text",value:text}),text="";var sub="";for(r=t[n++];void 0!==r&&"}"!==r;)sub+=r,r=t[n++];var o="}"===r,l=$.test(sub)?"list":o&&V.test(sub)?"named":"unknown";e.push({value:sub,type:l})}else"%"===r?"{"!==t[n]&&(text+=r):text+=r}return text&&e.push({type:"text",value:text}),e}(t),this._caches[t]=n),function(t,e){var n=[],r=0,o=Array.isArray(e)?"list":c(e)?"named":"unknown";if("unknown"===o)return n;for(;r<t.length;){var l=t[r];switch(l.type){case"text":n.push(l.value);break;case"list":n.push(e[parseInt(l.value,10)]);break;case"named":"named"===o&&n.push(e[l.value])}r++}return n}(n,e)};var $=/^(?:\d)+/,V=/^(?:\w)+/;var G=[];G[0]={ws:[0],ident:[3,0],"[":[4],eof:[7]},G[1]={ws:[1],".":[2],"[":[4],eof:[7]},G[2]={ws:[2],ident:[3,0],0:[3,0],number:[3,0]},G[3]={ident:[3,0],0:[3,0],number:[3,0],ws:[1,1],".":[2,1],"[":[4,1],eof:[7,1]},G[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],eof:8,else:[4,0]},G[5]={"'":[4,0],eof:8,else:[5,0]},G[6]={'"':[4,0],eof:8,else:[6,0]};var H=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function W(t){if(null==t)return"eof";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"ident";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return"ident"}function K(path){var t,a,e,n=path.trim();return("0"!==path.charAt(0)||!isNaN(path))&&(e=n,H.test(e)?(a=(t=n).charCodeAt(0))!==t.charCodeAt(t.length-1)||34!==a&&39!==a?t:t.slice(1,-1):"*"+n)}var Y=function(){this._cache=Object.create(null)};Y.prototype.parsePath=function(path){var t=this._cache[path];return t||(t=function(path){var t,e,n,r,o,l,c,d=[],h=-1,f=0,m=0,v=[];function y(){var t=path[h+1];if(5===f&&"'"===t||6===f&&'"'===t)return h++,n="\\"+t,v[0](),!0}for(v[1]=function(){void 0!==e&&(d.push(e),e=void 0)},v[0]=function(){void 0===e?e=n:e+=n},v[2]=function(){v[0](),m++},v[3]=function(){if(m>0)m--,f=4,v[0]();else{if(m=0,void 0===e)return!1;if(!1===(e=K(e)))return!1;v[1]()}};null!==f;)if(h++,"\\"!==(t=path[h])||!y()){if(r=W(t),8===(o=(c=G[f])[r]||c.else||8))return;if(f=o[0],(l=v[o[1]])&&(n=void 0===(n=o[2])?t:n,!1===l()))return;if(7===f)return d}}(path),t&&(this._cache[path]=t)),t||[]},Y.prototype.getPathValue=function(t,path){if(!c(t))return null;var e=this.parsePath(path);if(0===e.length)return null;for(var n=e.length,r=t,i=0;i<n;){var o=r[e[i]];if(null==o)return null;r=o,i++}return r};var z,Q=/<\/?[\w\s="/.':;#-\/]+>/,X=/(?:@(?:\.[a-zA-Z]+)?:(?:[\w\-_|./]+|\([\w\-_:|./]+\)))/g,Z=/^@(?:\.([a-zA-Z]+))?:/,J=/[()]/g,tt={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()},capitalize:function(t){return""+t.charAt(0).toLocaleUpperCase()+t.substr(1)}},et=new B,nt=function(t){var e=this;void 0===t&&(t={}),!x&&"undefined"!=typeof window&&window.Vue&&U(window.Vue);var n=t.locale||"en-US",r=!1!==t.fallbackLocale&&(t.fallbackLocale||"en-US"),o=t.messages||{},l=t.dateTimeFormats||t.datetimeFormats||{},c=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||et,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._fallbackRootWithEmptyString=void 0===t.fallbackRootWithEmptyString||!!t.fallbackRootWithEmptyString,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new Y,this._dataListeners=new Set,this._componentInstanceCreatedListener=t.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._postTranslation=t.postTranslation||null,this._escapeParameterHtml=t.escapeParameterHtml||!1,"__VUE_I18N_BRIDGE__"in t&&(this.__VUE_I18N_BRIDGE__=t.__VUE_I18N_BRIDGE__),this.getChoiceIndex=function(t,n){var r=Object.getPrototypeOf(e);if(r&&r.getChoiceIndex)return r.getChoiceIndex.call(e,t,n);var o,l;return e.locale in e.pluralizationRules?e.pluralizationRules[e.locale].apply(e,[t,n]):(o=t,l=n,o=Math.abs(o),2===l?o?o>1?1:0:1:o?Math.min(o,2):0)},this._exist=function(t,n){return!(!t||!n)&&(!m(e._path.getPathValue(t,n))||!!t[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(o).forEach((function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,o[t])})),this._initVM({locale:n,fallbackLocale:r,messages:o,dateTimeFormats:l,numberFormats:c})},it={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0},sync:{configurable:!0}};nt.prototype._checkLocaleMessage=function(t,e,n){var r=function(t,e,n,c){if(f(n))Object.keys(n).forEach((function(o){var l=n[o];f(l)?(c.push(o),c.push("."),r(t,e,l,c),c.pop(),c.pop()):(c.push(o),r(t,e,l,c),c.pop())}));else if(l(n))n.forEach((function(n,o){f(n)?(c.push("["+o+"]"),c.push("."),r(t,e,n,c),c.pop(),c.pop()):(c.push("["+o+"]"),r(t,e,n,c),c.pop())}));else if(d(n)){if(Q.test(n)){var h="Detected HTML in message '"+n+"' of keypath '"+c.join("")+"' at '"+e+"'. Consider component interpolation with '<i18n>' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===t?o(h):"error"===t&&function(t,e){"undefined"!=typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}(h)}}};r(e,t,n,[])},nt.prototype._initVM=function(data){var t=x.config.silent;x.config.silent=!0,this._vm=new x({data:data,__VUE18N__INSTANCE__:!0}),x.config.silent=t},nt.prototype.destroyVM=function(){this._vm.$destroy()},nt.prototype.subscribeDataChanging=function(t){this._dataListeners.add(t)},nt.prototype.unsubscribeDataChanging=function(t){!function(t,e){if(t.delete(e));}(this._dataListeners,t)},nt.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",(function(){for(var e,n,r=(e=t._dataListeners,n=[],e.forEach((function(a){return n.push(a)})),n),i=r.length;i--;)x.nextTick((function(){r[i]&&r[i].$forceUpdate()}))}),{deep:!0})},nt.prototype.watchLocale=function(t){if(t){if(!this.__VUE_I18N_BRIDGE__)return null;var e=this,n=this._vm;return this.vm.$watch("locale",(function(r){n.$set(n,"locale",r),e.__VUE_I18N_BRIDGE__&&t&&(t.locale.value=r),n.$forceUpdate()}),{immediate:!0})}if(!this._sync||!this._root)return null;var r=this._vm;return this._root.$i18n.vm.$watch("locale",(function(t){r.$set(r,"locale",t),r.$forceUpdate()}),{immediate:!0})},nt.prototype.onComponentInstanceCreated=function(t){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(t,this)},it.vm.get=function(){return this._vm},it.messages.get=function(){return E(this._getMessages())},it.dateTimeFormats.get=function(){return E(this._getDateTimeFormats())},it.numberFormats.get=function(){return E(this._getNumberFormats())},it.availableLocales.get=function(){return Object.keys(this.messages).sort()},it.locale.get=function(){return this._vm.locale},it.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},it.fallbackLocale.get=function(){return this._vm.fallbackLocale},it.fallbackLocale.set=function(t){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",t)},it.formatFallbackMessages.get=function(){return this._formatFallbackMessages},it.formatFallbackMessages.set=function(t){this._formatFallbackMessages=t},it.missing.get=function(){return this._missing},it.missing.set=function(t){this._missing=t},it.formatter.get=function(){return this._formatter},it.formatter.set=function(t){this._formatter=t},it.silentTranslationWarn.get=function(){return this._silentTranslationWarn},it.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},it.silentFallbackWarn.get=function(){return this._silentFallbackWarn},it.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},it.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},it.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},it.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},it.warnHtmlInMessage.set=function(t){var e=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,n!==t&&("warn"===t||"error"===t)){var r=this._getMessages();Object.keys(r).forEach((function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,r[t])}))}},it.postTranslation.get=function(){return this._postTranslation},it.postTranslation.set=function(t){this._postTranslation=t},it.sync.get=function(){return this._sync},it.sync.set=function(t){this._sync=t},nt.prototype._getMessages=function(){return this._vm.messages},nt.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},nt.prototype._getNumberFormats=function(){return this._vm.numberFormats},nt.prototype._warnDefault=function(t,e,n,r,o,l){if(!m(n))return n;if(this._missing){var c=this._missing.apply(null,[t,e,r,o]);if(d(c))return c}else 0;if(this._formatFallbackMessages){var h=y.apply(void 0,o);return this._render(e,l,h.params,e)}return e},nt.prototype._isFallbackRoot=function(t){return(this._fallbackRootWithEmptyString?!t:m(t))&&!m(this._root)&&this._fallbackRoot},nt.prototype._isSilentFallbackWarn=function(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn},nt.prototype._isSilentFallback=function(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)},nt.prototype._isSilentTranslationWarn=function(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn},nt.prototype._interpolate=function(t,e,n,r,o,c,h){if(!e)return null;var y,E=this._path.getPathValue(e,n);if(l(E)||f(E))return E;if(m(E)){if(!f(e))return null;if(!d(y=e[n])&&!v(y))return null}else{if(!d(E)&&!v(E))return null;y=E}return d(y)&&(y.indexOf("@:")>=0||y.indexOf("@.")>=0)&&(y=this._link(t,e,y,r,"raw",c,h)),this._render(y,o,c,n)},nt.prototype._link=function(t,e,n,r,o,c,d){var h=n,f=h.match(X);for(var m in f)if(f.hasOwnProperty(m)){var link=f[m],v=link.match(Z),y=v[0],E=v[1],k=link.replace(y,"").replace(J,"");if(T(d,k))return h;d.push(k);var S=this._interpolate(t,e,k,r,"raw"===o?"string":o,"raw"===o?void 0:c,d);if(this._isFallbackRoot(S)){if(!this._root)throw Error("unexpected error");var _=this._root.$i18n;S=_._translate(_._getMessages(),_.locale,_.fallbackLocale,k,r,o,c)}S=this._warnDefault(t,k,S,r,l(c)?c:[c],o),this._modifiers.hasOwnProperty(E)?S=this._modifiers[E](S):tt.hasOwnProperty(E)&&(S=tt[E](S)),d.pop(),h=S?h.replace(link,S):h}return h},nt.prototype._createMessageContext=function(t,e,path,n){var r=this,o=l(t)?t:[],d=c(t)?t:{},h=this._getMessages(),f=this.locale;return{list:function(t){return o[t]},named:function(t){return d[t]},values:t,formatter:e,path:path,messages:h,locale:f,linked:function(t){return r._interpolate(f,h[f]||{},t,null,n,void 0,[t])}}},nt.prototype._render=function(t,e,n,path){if(v(t))return t(this._createMessageContext(n,this._formatter||et,path,e));var r=this._formatter.interpolate(t,n,path);return r||(r=et.interpolate(t,n,path)),"string"!==e||d(r)?r:r.join("")},nt.prototype._appendItemToChain=function(t,e,n){var r=!1;return T(t,e)||(r=!0,e&&(r="!"!==e[e.length-1],e=e.replace(/!/g,""),t.push(e),n&&n[e]&&(r=n[e]))),r},nt.prototype._appendLocaleToChain=function(t,e,n){var r,o=e.split("-");do{var l=o.join("-");r=this._appendItemToChain(t,l,n),o.splice(-1,1)}while(o.length&&!0===r);return r},nt.prototype._appendBlockToChain=function(t,e,n){for(var r=!0,i=0;i<e.length&&"boolean"==typeof r;i++){var o=e[i];d(o)&&(r=this._appendLocaleToChain(t,o,n))}return r},nt.prototype._getLocaleChain=function(t,e){if(""===t)return[];this._localeChainCache||(this._localeChainCache={});var n=this._localeChainCache[t];if(!n){e||(e=this.fallbackLocale),n=[];for(var r,o=[t];l(o);)o=this._appendBlockToChain(n,o,e);(o=d(r=l(e)?e:c(e)?e.default?e.default:null:e)?[r]:r)&&this._appendBlockToChain(n,o,null),this._localeChainCache[t]=n}return n},nt.prototype._translate=function(t,e,n,r,o,l,c){for(var d,h=this._getLocaleChain(e,n),i=0;i<h.length;i++){var f=h[i];if(!m(d=this._interpolate(f,t[f],r,o,l,c,[r])))return d}return null},nt.prototype._t=function(t,e,n,r){for(var o,l=[],c=arguments.length-4;c-- >0;)l[c]=arguments[c+4];if(!t)return"";var d=y.apply(void 0,l);this._escapeParameterHtml&&(d.params=O(d.params));
2var h=d.locale||e,f=this._translate(n,h,this.fallbackLocale,t,r,"string",d.params);if(this._isFallbackRoot(f)){if(!this._root)throw Error("unexpected error");return(o=this._root).$t.apply(o,[t].concat(l))}return f=this._warnDefault(h,t,f,r,l,"string"),this._postTranslation&&null!=f&&(f=this._postTranslation(f,t)),f},nt.prototype.t=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},nt.prototype._i=function(t,e,n,r,o){var l=this._translate(n,e,this.fallbackLocale,t,r,"raw",o);if(this._isFallbackRoot(l)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,o)}return this._warnDefault(e,t,l,r,[o],"raw")},nt.prototype.i=function(t,e,n){return t?(d(e)||(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},nt.prototype._tc=function(t,e,n,r,o){for(var l,c=[],d=arguments.length-5;d-- >0;)c[d]=arguments[d+5];if(!t)return"";void 0===o&&(o=1);var h={count:o,n:o},f=y.apply(void 0,c);return f.params=Object.assign(h,f.params),c=null===f.locale?[f.params]:[f.locale,f.params],this.fetchChoice((l=this)._t.apply(l,[t,e,n,r].concat(c)),o)},nt.prototype.fetchChoice=function(t,e){if(!t||!d(t))return null;var n=t.split("|");return n[e=this.getChoiceIndex(e,n.length)]?n[e].trim():t},nt.prototype.tc=function(t,e){for(var n,r=[],o=arguments.length-2;o-- >0;)r[o]=arguments[o+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(r))},nt.prototype._te=function(t,e,n){for(var r=[],o=arguments.length-3;o-- >0;)r[o]=arguments[o+3];var l=y.apply(void 0,r).locale||e;return this._exist(n[l],t)},nt.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},nt.prototype.getLocaleMessage=function(t){return E(this._vm.messages[t]||{})},nt.prototype.setLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,e)},nt.prototype.mergeLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,_(void 0!==this._vm.messages[t]&&Object.keys(this._vm.messages[t]).length?Object.assign({},this._vm.messages[t]):{},e))},nt.prototype.getDateTimeFormat=function(t){return E(this._vm.dateTimeFormats[t]||{})},nt.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e),this._clearDateTimeFormat(t,e)},nt.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,_(this._vm.dateTimeFormats[t]||{},e)),this._clearDateTimeFormat(t,e)},nt.prototype._clearDateTimeFormat=function(t,e){for(var n in e){var r=t+"__"+n;this._dateTimeFormatters.hasOwnProperty(r)&&delete this._dateTimeFormatters[r]}},nt.prototype._localizeDateTime=function(t,e,n,r,o){for(var l=e,c=r[l],d=this._getLocaleChain(e,n),i=0;i<d.length;i++){var h=d[i];if(l=h,!m(c=r[h])&&!m(c[o]))break}if(m(c)||m(c[o]))return null;var f=c[o],v=l+"__"+o,y=this._dateTimeFormatters[v];return y||(y=this._dateTimeFormatters[v]=new Intl.DateTimeFormat(l,f)),y.format(t)},nt.prototype._d=function(t,e,n){if(!n)return new Intl.DateTimeFormat(e).format(t);var r=this._localizeDateTime(t,e,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.d(t,n,e)}return r||""},nt.prototype.d=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=this.locale,o=null;return 1===e.length?d(e[0])?o=e[0]:c(e[0])&&(e[0].locale&&(r=e[0].locale),e[0].key&&(o=e[0].key)):2===e.length&&(d(e[0])&&(o=e[0]),d(e[1])&&(r=e[1])),this._d(t,r,o)},nt.prototype.getNumberFormat=function(t){return E(this._vm.numberFormats[t]||{})},nt.prototype.setNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,e),this._clearNumberFormat(t,e)},nt.prototype.mergeNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,_(this._vm.numberFormats[t]||{},e)),this._clearNumberFormat(t,e)},nt.prototype._clearNumberFormat=function(t,e){for(var n in e){var r=t+"__"+n;this._numberFormatters.hasOwnProperty(r)&&delete this._numberFormatters[r]}},nt.prototype._getNumberFormatter=function(t,e,n,r,o,l){for(var c=e,d=r[c],h=this._getLocaleChain(e,n),i=0;i<h.length;i++){var f=h[i];if(c=f,!m(d=r[f])&&!m(d[o]))break}if(m(d)||m(d[o]))return null;var v,y=d[o];if(l)v=new Intl.NumberFormat(c,Object.assign({},y,l));else{var E=c+"__"+o;(v=this._numberFormatters[E])||(v=this._numberFormatters[E]=new Intl.NumberFormat(c,y))}return v},nt.prototype._n=function(t,e,n,r){if(!nt.availabilities.numberFormat)return"";if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).format(t);var o=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),l=o&&o.format(t);if(this._isFallbackRoot(l)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.n(t,Object.assign({},{key:n,locale:e},r))}return l||""},nt.prototype.n=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var o=this.locale,l=null,h=null;return 1===e.length?d(e[0])?l=e[0]:c(e[0])&&(e[0].locale&&(o=e[0].locale),e[0].key&&(l=e[0].key),h=Object.keys(e[0]).reduce((function(t,n){var o;return T(r,n)?Object.assign({},t,((o={})[n]=e[0][n],o)):t}),null)):2===e.length&&(d(e[0])&&(l=e[0]),d(e[1])&&(o=e[1])),this._n(t,o,l,h)},nt.prototype._ntp=function(t,e,n,r){if(!nt.availabilities.numberFormat)return[];if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).formatToParts(t);var o=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),l=o&&o.formatToParts(t);if(this._isFallbackRoot(l)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,r)}return l||[]},Object.defineProperties(nt.prototype,it),Object.defineProperty(nt,"availabilities",{get:function(){if(!z){var t="undefined"!=typeof Intl;z={dateTimeFormat:t&&void 0!==Intl.DateTimeFormat,numberFormat:t&&void 0!==Intl.NumberFormat}}return z}}),nt.install=U,nt.version="8.27.2",e.a=nt},311:function(t,e,n){"use strict";function r(t=""){return t.toUpperCase()===t}n.d(e,"a",(function(){return c}));const o=["-","_","/","."];function l(t,e=o){const n=[];let l="",c=r(t[0]),d=e.includes(t[0]);for(const o of t.split("")){const t=e.includes(o);t?(n.push(l),l="",c=!1,d=!0):d||c||!r(o)?(l+=o,c=r(o),d=t):(n.push(l),l=o,c=!0,d=!1)}return l&&n.push(l),n}function c(t=""){return(Array.isArray(t)?t:l(t)).map((p=>function(t){return t?t[0].toUpperCase()+t.substr(1):""}(p))).join("")}},337:function(t,e,n){"use strict";e.a=function(t,e){return e=e||{},new Promise((function(n,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(t){return i[t.toLowerCase()]},has:function(t){return t.toLowerCase()in i}}}};for(var l in s.open(e.method||"get",t,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,n){o.push(e=e.toLowerCase()),u.push([e,n]),i[e]=i[e]?i[e]+","+n:n})),n(a())},s.onerror=r,s.withCredentials="include"==e.credentials,e.headers)s.setRequestHeader(l,e.headers[l]);s.send(e.body||null)}))}},343:function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(20),o=(n(59),n(71)),l=n(125),c=n(203);function d(t,e){return h.apply(this,arguments)}
2function h(){return(h=Object(r.a)(regeneratorRuntime.mark((function t(e,n){var data,r,l,d;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(data=n.data,r=e.store,l=e.app,!data){t.next=9;break}return(d=data.appearance)&&(e.layout=Object(c.b)(d.layout,e.app.$typo3.options.layouts)),e.t3page=data,r.commit(o.d,data),t.next=9,l.$typo3.callHook("context",e,data);case 9:return t.abrupt("return",e);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function f(t,e){return m.apply(this,arguments)}function m(){return(m=Object(r.a)(regeneratorRuntime.mark((function t(e,n){var r,o,l,c,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.error,o={ssr:null,message:n.message,statusCode:n.status},!n.data){t.next=9;break}return t.next=5,d(e,n);case 5:l=t.sent,c=l.layout,h=l.t3page,o.ssr={layout:c,t3page:h};case 9:return t.abrupt("return",r(o));case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(t){return y.apply(this,arguments)}function y(){return(y=Object(r.a)(regeneratorRuntime.mark((function t(e){var n,r,path,o,data,c,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.route,r=e.app,path=n.fullPath||n.path,!Object(l.b)(e.route)){t.next=19;break}return t.prev=3,t.next=6,r.$typo3.api.getPage(path);case 6:if(o=t.sent,!(data=o.data)||!data.redirectUrl){t.next=13;break}return c=data.redirectUrl,h=data.statusCode,t.next=12,r.$typo3.callHook("redirect",e,data);case 12:return t.abrupt("return",Object(l.c)(e,c,h));case 13:d(e,o),t.next=19;break;case 16:t.prev=16,t.t0=t.catch(3),f(e,t.t0.response);case 19:return t.abrupt("return",e);case 20:case"end":return t.stop()}}),t,null,[[3,16]])})))).apply(this,arguments)}},344:function(t,e,n){t.exports=function(){"use strict";return class{constructor(t=console){this._logger=t,this._hooks={},this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this)}hook(t,e){if(!t||"function"!=typeof e)return;const n=t;let s;for(;this._deprecatedHooks[t];)"string"==typeof(s=this._deprecatedHooks[t])&&(s={to:s}),t=s.to;s&&(s.message?this._logger.warn(s.message):this._logger.warn(`${n} hook has been deprecated`+(s.to?`, please use ${s.to}`:""))),this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e)}deprecateHook(t,e){this._deprecatedHooks[t]=e}deprecateHooks(t){Object.assign(this._deprecatedHooks,t)}addHooks(t){const e=function t(e,n={},s){for(const i in e){const r=e[i],o=s?`${s}:${i}`:i;"object"==typeof r&&null!==r?t(r,n,o):n[o]=r}return n}(t);for(const t in e)this.hook(t,e[t])}async callHook(t,...e){var n,s;if(this._hooks[t])try{await(n=this._hooks[t],s=t=>t(...e),n.reduce(((t,e)=>t.then((t=>s(e,t)))),Promise.resolve(null)))}catch(e){"error"!==t&&await this.callHook("error",e),this._logger.fatal?this._logger.fatal(e):this._logger.error(e)}}clearHook(t){t&&delete this._hooks[t]}clearHooks(){this._hooks={}}}}()},345:function(t,e,n){t.exports=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function i(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||a(t)||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 a(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function u(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=a(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}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 r,o,s=!0,i=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){i=!0,o=t}
vendor: 4,554 bytes, line 2
2,f:function(){try{s||null==r.return||r.return()}finally{if(i)throw o}}}}var c={};c[c.Fatal=0]="Fatal",c[c.Error=0]="Error",c[c.Warn=1]="Warn",c[c.Log=2]="Log",c[c.Info=3]="Info",c[c.Success=3]="Success",c[c.Debug=4]="Debug",c[c.Trace=5]="Trace",c[c.Silent=-1/0]="Silent",c[c.Verbose=1/0]="Verbose";var d={silent:{level:-1},fatal:{level:c.Fatal},error:{level:c.Error},warn:{level:c.Warn},log:{level:c.Log},info:{level:c.Info},success:{level:c.Success},debug:{level:c.Debug},trace:{level:c.Trace},verbose:{level:c.Trace},ready:{level:c.Info},start:{level:c.Info}};function h(t){return e=t,!("[object Object]"!==Object.prototype.toString.call(e)||!t.message&&!t.args||t.stack);var e}var p=!1,f=[],m=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var r in t(this,e),this._reporters=n.reporters||[],this._types=n.types||d,this.level=void 0!==n.level?n.level:3,this._defaults=n.defaults||{},this._async=void 0!==n.async?n.async:void 0,this._stdout=n.stdout,this._stderr=n.stderr,this._mockFn=n.mockFn,this._throttle=n.throttle||1e3,this._throttleMin=n.throttleMin||5,this._types){var o=s(s({type:r},this._types[r]),this._defaults);this[r]=this._wrapLogFn(o),this[r].raw=this._wrapLogFn(o,!0)}this._mockFn&&this.mockTypes(),this._lastLogSerialized=void 0,this._lastLog=void 0,this._lastLogTime=void 0,this._lastLogCount=0,this._throttleTimeout=void 0}return n(e,[{key:"create",value:function(t){return new e(Object.assign({reporters:this._reporters,level:this.level,types:this._types,defaults:this._defaults,stdout:this._stdout,stderr:this._stderr,mockFn:this._mockFn},t))}},{key:"withDefaults",value:function(t){return this.create({defaults:Object.assign({},this._defaults,t)})}},{key:"withTag",value:function(t){return this.withDefaults({tag:this._defaults.tag?this._defaults.tag+":"+t:t})}},{key:"addReporter",value:function(t){return this._reporters.push(t),this}},{key:"removeReporter",value:function(t){if(t){var e=this._reporters.indexOf(t);if(e>=0)return this._reporters.splice(e,1)}else this._reporters.splice(0);return this}},{key:"setReporters",value:function(t){return this._reporters=Array.isArray(t)?t:[t],this}},{key:"wrapAll",value:function(){this.wrapConsole(),this.wrapStd()}},{key:"restoreAll",value:function(){this.restoreConsole(),this.restoreStd()}},{key:"wrapConsole",value:function(){for(var t in this._types)console["__"+t]||(console["__"+t]=console[t]),console[t]=this[t].raw}},{key:"restoreConsole",value:function(){for(var t in this._types)console["__"+t]&&(console[t]=console["__"+t],delete console["__"+t])}},{key:"wrapStd",value:function(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}},{key:"_wrapStream",value:function(t,e){var n=this;t&&(t.__write||(t.__write=t.write),t.write=function(t){n[e].raw(String(t).trim())})}},{key:"restoreStd",value:function(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}},{key:"_restoreStream",value:function(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}},{key:"pauseLogs",value:function(){p=!0}},{key:"resumeLogs",value:function(){p=!1;var t,e=u(f.splice(0));try{for(e.s();!(t=e.n()).done;){var n=t.value;n[0]._logFn(n[1],n[2])}}catch(t){e.e(t)}finally{e.f()}}},{key:"mockTypes",value:function(t){if(this._mockFn=t||this._mockFn,"function"==typeof this._mockFn)for(var e in this._types)this[e]=this._mockFn(e,this._types[e])||this[e],this[e].raw=this[e]}},{key:"_wrapLogFn",value:function(t,e){var n=this;return function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];if(!p)return n._logFn(t,o,e);f.push([n,t,o,e])}}},{key:"_logFn",value:function(t,e,n){var r=this;if(t.level>this.level)return!!this._async&&Promise.resolve(!1);var o=Object.assign({date:new Date,args:[]},t);!n&&1===e.length&&h(e[0])?Object.assign(o,e[0]):o.args=Array.from(e),o.message&&(o.args.unshift(o.message),delete o.message),o.additional&&(Array.isArray(o.additional)||(o.additional=o.additional.split("\n")),o.args.push("\n"+o.additional.join("\n")),delete o.additional),o.type="string"==typeof o.type?o.type.toLowerCase():"",o.tag="string"==typeof o.tag?o.tag.toLowerCase():"";var a=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=r._lastLogCount-r._throttleMin;if(r._lastLog&&e>0){var n=i(r._lastLog.args);e>1&&n.push("(repeated ".concat(e," times)")),r._log(s(s({},r._lastLog),{},{args:n})),r._lastLogCount=1}if(t){if(r._lastLog=o,r._async)return r._logAsync(o);r._log(o)}};clearTimeout(this._throttleTimeout);var l=this._lastLogTime?o.date-this._lastLogTime:0;
2if(this._lastLogTime=o.date,l<this._throttle)try{var u=JSON.stringify([o.type,o.tag,o.args]),c=this._lastLogSerialized===u;if(this._lastLogSerialized=u,c&&(this._lastLogCount++,this._lastLogCount>this._throttleMin))return void(this._throttleTimeout=setTimeout(a,this._throttle))}catch(t){}a(!0)}},{key:"_log",value:function(t){var e,n=u(this._reporters);try{for(n.s();!(e=n.n()).done;)e.value.log(t,{async:!1,stdout:this.stdout,stderr:this.stderr})}catch(t){n.e(t)}finally{n.f()}}},{key:"_logAsync",value:function(t){var e=this;return Promise.all(this._reporters.map((function(n){return n.log(t,{async:!0,stdout:e.stdout,stderr:e.stderr})})))}},{key:"stdout",get:function(){return this._stdout||console._stdout}},{key:"stderr",get:function(){return this._stderr||console._stderr}}]),e}();m.prototype.add=m.prototype.addReporter,m.prototype.remove=m.prototype.removeReporter,m.prototype.clear=m.prototype.removeReporter,m.prototype.withScope=m.prototype.withTag,m.prototype.mock=m.prototype.mockTypes,m.prototype.pause=m.prototype.pauseLogs,m.prototype.resume=m.prototype.resumeLogs;var v,g=function(){function e(n){t(this,e),this.options=Object.assign({},n),this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}return n(e,[{key:"log",value:function(t){var e=t.level<1?console.__error||console.error:1===t.level&&console.warn?console.__warn||console.warn:console.__log||console.log,n="log"!==t.type?t.type:"",r=t.tag?t.tag:"",o=this.typeColorMap[t.type]||this.levelColorMap[t.level]||this.defaultColor,s="\n background: ".concat(o,";\n border-radius: 0.5em;\n color: white;\n font-weight: bold;\n padding: 2px 0.5em;\n "),a="%c".concat([r,n].filter(Boolean).join(":"));"string"==typeof t.args[0]?e.apply(void 0,["".concat(a,"%c ").concat(t.args[0]),s,""].concat(i(t.args.slice(1)))):e.apply(void 0,[a,s].concat(i(t.args)))}}]),e}();return"undefined"!=typeof window&&window.consola||((v=new m({reporters:[new g]})).Consola=m,v.LogLevel=c,v.BrowserReporter=g,v)}()},346:function(t,e,n){"use strict";n(30),n(18),n(25),n(8),n(38),n(27),n(40);var r=n(10),o=n(142);function l(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function c(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?l(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}e.a=function(t,e){var n=t.store.state.typo3||!1;return c(c({},e.i18n),{},{get locale(){return n?n.locale:e.i18n.defaultLocale},get locales(){return n&&n.locales?n.locales:e.i18n.locales},get defaultLocale(){return n&&n.domain?n.domain.i18n.defaultLocale:e.i18n.defaultLocale},getLocaleCodePath:function(){return Object(o.b)(t)},getLocaleByPath:function(){return Object(o.a)(t)},setLocale:function(e,n){return Object(o.c)(t,e,n)}})}},347:function(t,e,n){t.exports=function(){"use strict";function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function l(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];
2if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},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 l,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,l=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw l}}}}var s=function(t){var e=window.getComputedStyle(t),n=parseFloat(e.height),r="normal"===e.lineHeight?1.2*parseFloat(e.fontSize):parseFloat(e.lineHeight);return 0===n&&0===r?0:Math.ceil(n/r)},u=new WeakMap,c=function(t){return u.get(t)},a=function(t,e){u.set(t,e)},d=function(t){return{hasEllipsis:c(t).hasEllipsis}},p=function(t){var e=n({},c(t));(null==e?void 0:e.observer)&&(null==e||e.observer.disconnect()),(null==e?void 0:e.observer)&&(null==e||delete e.prevWidth),(null==e?void 0:e.observer)&&(null==e||delete e.prevHeight),(null==e?void 0:e.observer)&&(null==e||delete e.observer),a(t,e)},h={mode:"css",lines:3,ellipsis:".â.â.",midWord:!0},f=function(t){if("number"==typeof t)return parseInt(t.toString());if("string"==typeof t){var e=parseInt(t);if(!isNaN(e))return e}return h.lines},b=function(t){return"undefined"!=typeof CSS&&CSS.supports("display","-webkit-box")&&CSS.supports("-webkit-line-clamp","3")&&CSS.supports("-webkit-box-orient","vertical")?"css"===t||"js"===t?t:h.mode:"js"},m=function(t){return"string"==typeof t?t:"number"==typeof t?t.toString():h.ellipsis},v=function(t){return"boolean"==typeof t?t:h.midWord},y=function(t){var e,n=c(t);t.textContent=null!==(e=null==n?void 0:n.fullText)&&void 0!==e?e:t.textContent,t.style.display="",t.style.webkitLineClamp="",t.style.webkitBoxOrient="",t.style.overflow=""},g=function(t,e,o){var i=!function(t){return u.has(t)}(t),g=c(t);a(t,n(n(n({},g),function(t){if("object"!==r(t)||null===t)return h;var e=t,n=e.mode,o=e.lines,i=e.ellipsis,l=e.midWord;return{mode:b(n),lines:f(o),ellipsis:m(i),midWord:v(l)}}(e)),{},{hasEllipsis:!i&&(null==g?void 0:g.hasEllipsis),fullText:i?t.textContent:null==g?void 0:g.fullText}));var E=function(){var e=d(t),r=c(t);y(t);var i=s(t);if("css"===r.mode&&function(t,e){var n=e.lines,r=e.fullText;t.textContent=r,t.style.display="-webkit-box",t.style.webkitLineClamp=n.toString(),t.style.webkitBoxOrient="vertical",t.style.overflow="hidden"}(t,r),"js"===r.mode&&function(t,e){var n=e.lines,r=e.midWord,o=e.fullText,i=e.ellipsis,u=r?[". ",", "," ",""]:[". ",", "," "];if(t.textContent=o,t.style.display="",t.style.webkitLineClamp="",t.style.webkitBoxOrient="",t.style.overflow="",!(n<=0||s(t)<=n)){var c={unprocessed:o,processed:""};u.forEach((function(e){var r,o=l(c.unprocessed.split(e));try{for(o.s();!(r=o.n()).done;){var u=r.value;if(t.textContent="".concat(c.processed).concat(u).concat(e).concat(i),s(t)>n){c.unprocessed=u;break}c.processed="".concat(c.processed).concat(u).concat(e)}}catch(t){o.e(t)}finally{o.f()}})),t.textContent="".concat(c.processed.trim()).concat(i)}}(t,r),a(t,n(n({},r),{},{hasEllipsis:s(t)<i})),o){var u=d(t);o(u,e)}};if("undefined"!=typeof ResizeObserver)return p(t),void function(t,e){var r=c(t),o=r.observer||new ResizeObserver((function(){var r=c(t);if(t.clientWidth!==r.prevWidth||t.clientHeight!==r.prevHeight){e();var o=n({},r);o.prevWidth=t.clientWidth,o.prevHeight=t.clientHeight,a(t,o)}}));o.observe(t),a(t,n(n({},r),{},{observer:o}))}(t,E);E()},E=function(t,e){var n=e.value,r=n.lines,o=n.mode,i=n.midWord,l=n.ellipsis,s=n.onSnipped;g(t,{lines:r,mode:o,midWord:i,ellipsis:l},s)},T=function(t,e){var n=e.value,r=n.lines,o=n.mode,i=n.midWord,l=n.ellipsis,s=n.onSnipped;g(t,{lines:r,mode:o,midWord:i,ellipsis:l},s)},k=function(t){!function(t){y(t),p(t),function(t){u.delete(t)}(t)}(t)};return{install:function(e){var n,r=parseFloat(e.version[0])>2;e.directive("snip",(t(n={},r?"mounted":"inserted",E),t(n,r?"updated":"update",T),t(n,r?"unmounted":"unbind",k),n))}}}()},350:function(t,e,n){"use strict";n(30),n(18),n(25),n(8),n(38),n(27),n(40);var r=n(10),o=(n(33),n(42),n(14),n(2)),l=n(3),c=n(250),d=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;Object(o.a)(this,t),this.$http=n.create(e),this.options=e,this.getInitialData=this.getInitialData.bind(this),this.getPage=this.getPage.bind(this)}return Object(l.a)(t,[{key:"getInitialData",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:""},n=encodeURI("".concat(e.path).concat(this.options.endpoints.initialData));return this.$http.get(n).catch((function(e){throw c.a.warn("Can't get the initial config of ".concat(t.options.baseURL)),c.a.error(new Error(e)),e}))}},{key:"getPage",value:function(path){return this.$http.get(path)}}]),t}(),h=n(142);function f(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function m(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
2i%2?f(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):f(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}e.a=function(t,e){var n=t.store,r=t.$axios,o=!1,l=m(m({},new d(n.state.typo3&&n.state.typo3.domain?Object.assign(e.api,n.state.typo3.domain.api):e.api,r)),{},{setOptions:function(t){Object.assign(this.$http.defaults,t),Object.assign(this.options,t)}});return l.$http.onError((function(n){if(404===n.response.status&&n.config.url&&n.config.url.includes(e.api.endpoints.initialData)){if(o)throw new Error("initialData fallback not available for ".concat(n.config.baseURL).concat(n.config.url));return o=!0,l.getInitialData({path:Object(h.b)(t)})}})),l}},351:function(t,e,n){"use strict";n(61),n(8),n(31);var r=n(71),o=n(125);e.a=function(t,e){return{list:e.domains?e.domains:[],getDomain:function(){return function(t){var e=t.app,n=t.req;if(e.$typo3.options.domains&&e.$typo3.options.domains.length){var r=Object(o.a)(n?n.headers.host:window.location.origin);return e.$typo3.options.domains.find((function(t){return t.name===r}))}return!1}(t)},setDomain:function(e){return function(t,e){var n=t.store,o=t.app;e&&(o.$typo3.api.setOptions(e.api),n.commit(r.a,e.i18n.locales),n.commit(r.b,e))}(t,e)}}}},352:function(t,e,n){"use strict";function r(t){return!0==(null!=(e=t)&&"object"==typeof e&&!1===Array.isArray(e))&&"[object Object]"===Object.prototype.toString.call(t);var e}var o=function(t){var e,n;return!1!==r(t)&&("function"==typeof(e=t.constructor)&&(!1!==r(n=e.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")))},l=n(205),c=function(t,e){return{classification:t,component:"FormulateInput"+(e||t[0].toUpperCase()+t.substr(1))}},d=Object.assign({},["text","email","number","color","date","hidden","month","password","search","tel","time","url","week","datetime-local"].reduce((function(t,e){var n;return Object.assign({},t,((n={})[e]=c("text"),n))}),{}),{range:c("slider"),textarea:c("textarea","TextArea"),checkbox:c("box"),radio:c("box"),submit:c("button"),button:c("button"),select:c("select"),file:c("file"),image:c("file"),group:c("group")});function h(t,e){var n={};for(var r in t)n[r]=e(r,t[r]);return n}function f(t,e,n){if(void 0===n&&(n=!1),t===e)return!0;if(!t||!e)return!1;if("object"!=typeof t&&"object"!=typeof e)return t===e;var r=Object.keys(t),i=Object.keys(e),s=r.length;if(i.length!==s)return!1;for(var a=0;a<s;a++){var o=r[a];if(!n&&t[o]!==e[o]||n&&!f(t[o],e[o],n))return!1}return!0}function m(t){return"string"==typeof t?t.replace(/([_-][a-z0-9])/gi,(function(e){return 0===t.indexOf(e)||/[_-]/.test(t[t.indexOf(e)-1])?e:e.toUpperCase().replace(/[_-]/,"")})):t}function a(t){return"string"==typeof t?t[0].toUpperCase()+t.substr(1):t}function v(t){return t?"string"==typeof t?[t]:Array.isArray(t)?t:"object"==typeof t?Object.values(t):[]:[]}function u(t,e){return"string"==typeof t?u(t.split("|"),e):Array.isArray(t)?t.map((function(t){return function(t,e){if("function"==typeof t)return[t,[]];if(Array.isArray(t)&&t.length){var n=y((t=t.map((function(t){return t}))).shift()),r=n[0],i=n[1];if("string"==typeof r&&e.hasOwnProperty(r))return[e[r],t,r,i];if("function"==typeof r)return[r,t,r,i]}if("string"==typeof t&&t){var o=t.split(":"),s=y(o.shift()),a=s[0],l=s[1];if(e.hasOwnProperty(a))return[e[a],o.length?o.join(":").split(","):[],a,l];throw new Error("Unknown validation rule "+t)}return!1}(t,e)})).filter((function(t){return!!t})):[]}function y(t){return/^[\^]/.test(t.charAt(0))?[m(t.substr(1)),t.charAt(0)]:[m(t),null]}function E(t){switch(typeof t){case"symbol":case"number":case"string":case"boolean":case"undefined":return!0;default:return null===t}}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function T(t,e){return!p(t,"__id")||e?Object.defineProperty(t,"__id",Object.assign(Object.create(null),{value:e||_(9)})):t}function k(t){return"number"!=typeof t&&(void 0===t||""===t||null===t||!1===t||Array.isArray(t)&&!t.some((function(t){return!k(t)}))||t&&!Array.isArray(t)&&"object"==typeof t&&k(Object.values(t)))}function S(t,e){return Object.keys(t).reduce((function(n,r){var i=m(r);return e.includes(i)&&(n[i]=t[r]),n}),{})}function _(t){return void 0===t&&(t=13),Math.random().toString(36).substring(2,t+2)}var A=/^(?:\w+:)?\/\/(\S+)$/,O=/^localhost[:?\d]*(?:[^:?\d]\S*)?$/,g=/^[^\s.]+\.\S{2,}$/,b=function(t,e,n){void 0===n&&(n={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},n),this.results=!1,this.context=e,this.dataTransferCheck(),e&&e.uploadUrl&&(this.options.uploadUrl=e.uploadUrl),this.uploadPromise=null,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};b.prototype.rehydrateFileList=function(t){var e=this,n=t.reduce((function(t,n){var r=n[e.o
2ptions?e.options.fileUrlKey:"url"],i=!(!r||-1===r.lastIndexOf("."))&&r.substr(r.lastIndexOf(".")+1),o=e.options.mimes[i]||!1;return t.push(Object.assign({},n,r?{name:n.name||r.substr(r.lastIndexOf("/")+1||0),type:n.type?n.type:o,previewData:r}:{})),t}),[]);this.addFileList(n),this.results=this.mapUUID(t)},b.prototype.addFileList=function(t){for(var e=this,n=function(n){var r=t[n],i=_();e.files.push({progress:!1,error:!1,complete:!1,justFinished:!1,name:r.name||"file-upload",file:r,uuid:i,path:!1,removeFile:function(){this.removeFile(i)}.bind(e),previewData:r.previewData||!1})},r=0;r<t.length;r++)n(r)},b.prototype.hasUploader=function(){return!!this.context.uploader},b.prototype.uploaderIsAxios=function(){return!(!this.hasUploader()||"function"!=typeof this.context.uploader.request||"function"!=typeof this.context.uploader.get||"function"!=typeof this.context.uploader.delete||"function"!=typeof this.context.uploader.post)},b.prototype.getUploader=function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];if(this.uploaderIsAxios()){var r=new FormData;if(r.append(this.context.name||"file",e[0]),!1===this.context.uploadUrl)throw new Error("No uploadURL specified: https://vueformulate.com/guide/inputs/file/#props");return this.context.uploader.post(this.context.uploadUrl,r,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(t){e[1](Math.round(100*t.loaded/t.total))}}).then((function(t){return t.data})).catch((function(t){return e[2](t)}))}return(t=this.context).uploader.apply(t,e)},b.prototype.upload=function(){var t=this;return this.uploadPromise=this.uploadPromise?this.uploadPromise.then((function(){return t.__performUpload()})):this.__performUpload(),this.uploadPromise},b.prototype.__performUpload=function(){var t=this;return new Promise((function(e,n){if(!t.hasUploader())return n(new Error("No uploader has been defined"));Promise.all(t.files.map((function(e){return e.error=!1,e.complete=!!e.path,e.path?Promise.resolve(e.path):t.getUploader(e.file,(function(n){e.progress=n,t.context.rootEmit("file-upload-progress",n),n>=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0,t.context.rootEmit("file-upload-complete",e))}),(function(r){e.progress=0,e.error=r,e.complete=!0,t.context.rootEmit("file-upload-error",r),n(r)}),t.options)}))).then((function(n){t.results=t.mapUUID(n),e(n)})).catch((function(t){throw new Error(t)}))}))},b.prototype.removeFile=function(t){var e=this.files.length;if(this.files=this.files.filter((function(e){return e&&e.uuid!==t})),Array.isArray(this.results)&&(this.results=this.results.filter((function(e){return e&&e.__id!==t}))),this.context.performValidation(),window&&this.fileList instanceof FileList&&this.supportsDataTransfers){var n=new DataTransfer;this.files.forEach((function(t){return n.items.add(t.file)})),this.fileList=n.files,this.input.files=this.fileList}else this.fileList=this.fileList.filter((function(e){return e&&e.__id!==t}));e>this.files.length&&this.context.rootEmit("file-removed",this.files)},b.prototype.mergeFileList=function(t){if(this.addFileList(t.files),this.supportsDataTransfers){var e=new DataTransfer;this.files.forEach((function(t){t.file instanceof File&&e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList,t.files=(new DataTransfer).files}this.context.performValidation(),this.loadPreviews(),"delayed"!==this.context.uploadBehavior&&this.upload()},b.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},b.prototype.dataTransferCheck=function(){try{new DataTransfer,this.supportsDataTransfers=!0}catch(t){this.supportsDataTransfers=!1}},b.prototype.getFiles=function(){return this.files},b.prototype.mapUUID=function(t){var e=this;return t.map((function(t,n){return e.files[n].path=void 0!==t&&t,t&&T(t,e.files[n].uuid)}))},b.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var w,I={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var n=t.value;void 0===e&&(e=!1);var r=Date.parse(e||new Date),i=Date.parse(n);return Promise.resolve(!isNaN(i)&&i>r)},alpha:function(t,e){var n=t.value;void 0===e&&(e="default");var r={default:/^[a-zA-ZÃ-ÃÃ-öø-ÿÄÄ
ÄÄÄÄÅÅÅÅÅÅŹźŻż]+$/,latin:/^[a-zA-Z]+$/},i=r.hasOwnProperty(e)?e:"default";return Promise.resolve(r[i].test(n))}
2,alphanumeric:function(t,e){var n=t.value;void 0===e&&(e="default");var r={default:/^[a-zA-Z0-9Ã-ÃÃ-öø-ÿÄÄ
ÄÄÄÄÅÅÅÅÅÅŹźŻż]+$/,latin:/^[a-zA-Z0-9]+$/},i=r.hasOwnProperty(e)?e:"default";return Promise.resolve(r[i].test(n))},before:function(t,e){var n=t.value;void 0===e&&(e=!1);var r=Date.parse(e||new Date),i=Date.parse(n);return Promise.resolve(!isNaN(i)&&i<r)},between:function(t,e,n,r){var i=t.value;return void 0===e&&(e=0),void 0===n&&(n=10),Promise.resolve(null!==e&&null!==n&&!isNaN(e)&&!isNaN(n)&&(!isNaN(i)&&"length"!==r||"value"===r?(i=Number(i),e=Number(e),n=Number(n),i>e&&i<n):("string"==typeof i||"length"===r)&&(i=isNaN(i)?i:i.toString()).length>e&&i.length<n))},confirm:function(t,e){var n,r,i=t.value,o=t.getGroupValues,s=t.name;return Promise.resolve((n=o(),(r=e)||(r=/_confirm$/.test(s)?s.substr(0,s.length-8):s+"_confirm"),n[r]===i))},date:function(t,e){var n=t.value;return void 0===e&&(e=!1),Promise.resolve(e&&"string"==typeof e?function(t){var e="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"$",n={MM:"(0[1-9]|1[012])",M:"([1-9]|1[012])",DD:"([012][0-9]|3[01])",D:"([012]?[0-9]|3[01])",YYYY:"\\d{4}",YY:"\\d{2}"};return new RegExp(Object.keys(n).reduce((function(t,e){return t.replace(e,n[e])}),e))}(e).test(n):!isNaN(Date.parse(n)))},email:function(t){var e=t.value;return Promise.resolve(/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve("string"==typeof e&&n.length?void 0!==n.find((function(t){return e.endsWith(t)})):"string"==typeof e&&0===n.length)},in:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(void 0!==n.find((function(t){return"object"==typeof t?f(t,e):t===e})))},matches:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(!!n.find((function(t){return"string"==typeof t&&"/"===t.substr(0,1)&&"/"===t.substr(-1)&&(t=new RegExp(t.substr(1,t.length-2))),t instanceof RegExp?t.test(e):t===e})))},mime:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(function(){if(e instanceof b)for(var t=e.getFiles(),r=0;r<t.length;r++){var i=t[r].file;if(!n.includes(i.type))return!1}return!0}())},min:function(t,e,n){var r=t.value;return void 0===e&&(e=1),Promise.resolve(Array.isArray(r)?(e=isNaN(e)?e:Number(e),r.length>=e):!isNaN(r)&&"length"!==n||"value"===n?(r=isNaN(r)?r:Number(r))>=e:("string"==typeof r||"length"===n)&&(r=isNaN(r)?r:r.toString()).length>=e)},max:function(t,e,n){var r=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(r)?(e=isNaN(e)?e:Number(e),r.length<=e):!isNaN(r)&&"length"!==n||"value"===n?(r=isNaN(r)?r:Number(r))<=e:("string"==typeof r||"length"===n)&&(r=isNaN(r)?r:r.toString()).length<=e)},not:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(void 0===n.find((function(t){return"object"==typeof t?f(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var n=t.value;return void 0===e&&(e="pre"),Promise.resolve(Array.isArray(n)?!!n.length:n instanceof b?n.getFiles().length>0:"string"==typeof n?"trim"===e?!!n.trim():!!n:"object"!=typeof n||!!n&&!!Object.keys(n).length)},startsWith:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve("string"==typeof e&&n.length?void 0!==n.find((function(t){return e.startsWith(t)})):"string"==typeof e&&0===n.length)},url:function(t){var e=t.value;return Promise.resolve(function(t){if("string"!=typeof t)return!1;var e=t.match(A);if(!e)return!1;var n=e[1];return!(!n||!O.test(n)&&!g.test(n))}(e))},bail:function(){return Promise.resolve(!0)},optional:function(t){var e=t.value;return Promise.resolve(!k(e))}},R="image/",L={csv:"text/csv",gif:R+"gif",jpg:R+"jpeg",jpeg:R+"jpeg",png:R+"png",pdf:"application/pdf",svg:R+"svg+xml"},x=["outer","wrapper","label","element","input","help","errors","error","decorator","rangeValue","uploadArea","uploadAreaMask","files","file","fileName","fileAdd","fileAddInput","fileRemove","fileProgress","fileUploadError","fileImagePreview","fileImagePreviewImage","fileProgressInner","grouping","groupRepeatable","groupRepeatableRemove","groupAddMore","form","formErrors","formError"],D={hasErrors:function(t){return t.hasErrors},hasValue:function(t){return t.hasValue},isValid:function(t){return t.isValid}},C=(w=[""].concat(Object.keys(D).map((function(t){return a(t)}))),x.reduce((function(t,e){return t.concat(w.reduce((function(t,n){return t.push(""+e+n+"Class"),t}),[]))}),[]));function P(t,e,n){switch(typeof e){case"string":return e;case"function":return e(n,v(t));case"object":if(Array.isArray(e))return v(t).concat(e);default:return t}}function M(t){return x.reduce((function(e,n){var r;return Object.assign(e,((r={})[n]=function(t,e){var n=t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()})),r="formulate"+(["form","file"].includes(n.substr(0,4))?"":"-input")+(["decorator","range-value"].includes(n)?"-element":"")+("outer"!==n?"-"+n:"");return"input"===n?[]:[r].concat(function(t,e,n){var r=[];switch(e){case"label":r.push(t+"--"+n.labelPosition);break;case"element":var i="group"===n.classification?"group":n.type;r.push(t+"--"+i),"group"===i&&r.push("formulate-input-group");break;case"help":r.push(t+"--"+n.helpPosition);break;case"form":n.name&&r.push(t+"--"+n.name)}return r}(r,t,e))}(n,t),r))}),{})}function j(t,e,n,r){return new Promise((function(n,i){var o=(r.fauxUploaderDuration||1500)*(.5+Math.random()),s=performance.now(),a=function(){return setTimeout((function(){var r=performance.now()-s,i=Math.min(100,Math.round(r/o*100));if(e(i),i>=100)return n({url:"http://via.placeholder.com/350x150.png",name:t.name});a()}),20)};a()}))}function F(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}var N={inheritAttrs:!1,functional:!0,render:function(t,e){for(var n=e.props,r=e.data,i=e.parent,o=e.children,s=i,a=(n.name,n.forceWrap),l=n.context,u=F(n,["name","forceWrap","context"]);s&&"FormulateInput"!==s.$options.name;)s=s.$parent;if(!s)return null;if(s.$scopedSlots&&s.$scopedSlots[n.name])return s.$scopedSlots[n.name](Object.assign({},l,u));if(Array.isArray(o)&&(o.length>1||a&&o.length>0)){var c=r.attrs,d=(c.name,c.context,F(c,["name","context"]));return t("div",Object.assign({},r,{attrs:d}),o)}return Array.isArray(o)&&1===o.length?o[0]:null}};var U={functional:!0,render:function(t,e){var n=e.props,r=e.listeners;return function t(e,n,r){return Array.isArray(n)?n.map((function(n,i){var o=function(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n={}),t&&"object"==typeof t&&!Array.isArray(t)){var r=t.children;void 0===r&&(r=null);var i=t.component;void 0===i&&(i="FormulateInput");var o=t.depth;void 0===o&&(o=1);var s=t.key;void 0===s&&(s=null);var a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}(t,["children","component","depth","key"]),l=a.class||{};delete a.class;var u={},c=Object.keys(a).reduce((function(t,e){var n;return/^@/.test(e)?Object.assign(t,((n={})[e.substr(1)]=a[e],n)):t}),{});
2Object.keys(c).forEach((function(t){delete a["@"+t],u[t]=function(t,e,n){return function(){for(var r,i,o=[],s=arguments.length;s--;)o[s]=arguments[s];return"function"==typeof e?e.call.apply(e,[this].concat(o)):"string"==typeof e&&p(n,e)?(r=n[e]).call.apply(r,[this].concat(o)):p(n,t)?(i=n[t]).call.apply(i,[this].concat(o)):void 0}}(t,c[t],n)}));var d="FormulateInput"===i?a.type||"text":i,h=a.name||d||"el";s||(s=a.id?a.id:"FormulateInput"!==i&&"string"==typeof r?d+"-"+function(t,e){void 0===e&&(e=0);for(var n=3735928559^e,r=1103547991^e,i=0,o=void 0;i<t.length;i++)o=t.charCodeAt(i),n=Math.imul(n^o,2654435761),r=Math.imul(r^o,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&(r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0)}(r):d+"-"+h+"-"+o+(a.name?"":"-"+e));var f=Array.isArray(r)?r.map((function(t){return Object.assign(t,{depth:o+1})})):r;return Object.assign({key:s,depth:o,attrs:a,component:i,class:l,on:u},f?{children:f}:{})}return null}(n,i,r);return e(o.component,{attrs:o.attrs,class:o.class,key:o.key,on:o.on},o.children?t(e,o.children,r):null)})):n}(t,n.schema,r)}};function B(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}var $=function(t){this.registry=new Map,this.errors={},this.ctx=t};function V(t){return new $(t).dataProps()}function G(t){return{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values||this.isGrouping&&"object"==typeof this.context.model[this.index]},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return p(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):p(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):this.isGrouping&&"object"==typeof this.context.model[this.index]?this.context.model[this.index]:{}},mergedGroupErrors:function(){var t=this,e=/^([^.\d+].*?)\.(\d+\..+)$/;return Object.keys(this.mergedFieldErrors).filter((function(t){return e.test(t)})).reduce((function(n,r){var i,o=r.match(e),s=o[1],a=o[2];return n[s]||(n[s]={}),Object.assign(n[s],((i={})[a]=t.mergedFieldErrors[r],i)),n}),{})}}}function H(t){void 0===t&&(t=[]);var e={applyInitialValues:function(){this.hasInitialValue&&(this.proxy=Object.assign({},this.initialValues))},setFieldValue:function(t,e){var n;if(void 0===e){var r=this.proxy,i=(r[t],B(r,[String(t)]));this.proxy=i}else Object.assign(this.proxy,((n={})[t]=e,n));this.$emit("input",Object.assign({},this.proxy))},valueDeps:function(t){var e=this;return Object.keys(this.proxy).reduce((function(n,r){return Object.defineProperty(n,r,{enumerable:!0,get:function(){var n=e.registry.get(r);return e.deps.set(t,e.deps.get(t)||new Set),n&&(e.deps.set(n,e.deps.get(n)||new Set),e.deps.get(n).add(t.name)),e.deps.get(t).add(r),e.proxy[r]}})}),Object.create(null))},validateDeps:function(t){var e=this;this.deps.has(t)&&this.deps.get(t).forEach((function(t){return e.registry.has(t)&&e.registry.get(t).performValidation()}))},hasValidationErrors:function(){return Promise.all(this.registry.reduce((function(t,e,n){return t.push(e.performValidation()&&e.getValidationErrors()),t}),[])).then((function(t){return t.some((function(t){return t.hasErrors}))}))},showErrors:function(){this.childrenShouldShowErrors=!0,this.registry.map((function(t){t.formShouldShowErrors=!0}))},hideErrors:function(){this.childrenShouldShowErrors=!1,this.registry.map((function(t){t.formShouldShowErrors=!1,t.behavioralErrorVisibility=!1}))},setValues:function(t){var e=this;Array.from(new Set(Object.keys(t||{}).concat(Object.keys(this.proxy)))).forEach((function(n){var r=e.registry.has(n)&&e.registry.get(n),i=t?t[n]:void 0;r&&!f(r.proxy,i,!0)&&(r.context.model=i),f(i,e.proxy[n],!0)||e.setFieldValue(n,i)}))},updateValidation:function(t){p(this.registry.errors,t.name)&&(this.registry.errors[t.name]=t.hasErrors),this.$emit("validation",t)},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):"group"===t.type&&p(this.mergedGroupErrors,t.field)?t.callback(this.mergedGroupErrors[t.field]):p(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))}};return Object.keys(e).reduce((function(n,r){var i;return t.includes(r)?n:Object.assign({},n,((i={})[r]=e[r],i))}),{})}function W(t,e){void 0===e&&(e=[]);var n={formulateSetter:t.setFieldValue,formulateRegister:t.register,formulateDeregister:t.deregister,formulateFieldValidation:t.updateValidation,getFormValues:t.valueDeps,getGroupValues:t.valueDeps,validateDependents:t.validateDeps,observeErrors:t.addErrorObserver,removeErrorObserver:t.removeErrorObserver};return Object.keys(n).filter((function(t){return!e.includes(t)})).reduce((function(t,e){var r;return Object.assign(t,((r={})[e]=n[e],r))}),{})}$.prototype.add=function(t,e){var n;return this.registry.set(t,e),this.errors=Object.assign({},this.errors,((n={})[t]=e.getErrorObject().hasErrors,n)),this},$.prototype.remove=function(t){this.ctx.deps.delete(this.registry.get(t)),this.ctx.deps.forEach((function(e){return e.delete(t)}));var e=this.ctx.keepModelData;!e&&this.registry.has(t)&&"inherit"!==this.registry.get(t).keepModelData&&(e=this.registry.get(t).keepModelData),this.ctx.preventCleanup&&(e=!0),this.registry.delete(t);var n=this.errors,r=(n[t],B(n,[String(t)]));if(this.errors=r,!e){var i=this.ctx.proxy,o=(i[t],B(i,[String(t)]));this.ctx.uuid&&T(o,this.ctx.uuid),this.ctx.proxy=o,this.ctx.$emit("input",this.ctx.proxy)}return this},$.prototype.has=function(t){return this.registry.has(t)},$.prototype.get=function(t){return this.registry.get(t)},$.prototype.map=function(t){var e={};
2return this.registry.forEach((function(n,r){var i;return Object.assign(e,((i={})[r]=t(n,r),i))})),e},$.prototype.keys=function(){return Array.from(this.registry.keys())},$.prototype.register=function(t,e){var n=this;if(p(e.$options.propsData,"ignored"))return!1;if(this.registry.has(t))return this.ctx.$nextTick((function(){return!n.registry.has(t)&&n.register(t,e)})),!1;this.add(t,e);var r=p(e.$options.propsData,"formulateValue"),i=p(e.$options.propsData,"value"),s=this.ctx.debounce||this.ctx.debounceDelay||this.ctx.context&&this.ctx.context.debounceDelay;s&&!p(e.$options.propsData,"debounce")&&(e.debounceDelay=s),r||!this.ctx.hasInitialValue||k(this.ctx.initialValues[t])?!r&&!i||f(e.proxy,this.ctx.initialValues[t],!0)||this.ctx.setFieldValue(t,e.proxy):e.context.model=this.ctx.initialValues[t],this.childrenShouldShowErrors&&(e.formShouldShowErrors=!0)},$.prototype.reduce=function(t,e){return this.registry.forEach((function(n,r){e=t(e,n,r)})),e},$.prototype.dataProps=function(){var t=this;return{proxy:{},registry:this,register:this.register.bind(this),deregister:function(e){return t.remove(e)},childrenShouldShowErrors:!1,errorObservers:[],deps:new Map,preventCleanup:!1}};var K=function(t){this.form=t};function Y(t,e,n,r,i,o,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var c,d="function"==typeof n?n.options:n;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),r&&(d._scopeId=r),o?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=c):e&&(c=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var h=d.beforeCreate;d.beforeCreate=h?[].concat(h,c):[c]}return n}K.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},K.prototype.values=function(){var t=this;return new Promise((function(e,n){var r=[],i=function t(e){if("object"!=typeof e)return e;var n=Array.isArray(e)?[]:{};for(var r in e)e[r]instanceof b||E(e[r])?n[r]=e[r]:n[r]=t(e[r]);return n}(t.form.proxy),o=function(e){"object"==typeof t.form.proxy[e]&&t.form.proxy[e]instanceof b&&r.push(t.form.proxy[e].upload().then((function(t){var n;return Object.assign(i,((n={})[e]=t,n))})))};for(var s in i)o(s);Promise.all(r).then((function(){return e(i)})).catch((function(t){return n(t)}))}))};var q={name:"FormulateForm",inheritAttrs:!1,provide:function(){return Object.assign({},W(this,["getGroupValues"]),{observeContext:this.addContextObserver,removeContextObserver:this.removeContextObserver})},model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}},schema:{type:[Array,Boolean],default:!1},keepModelData:{type:[Boolean,String],default:!1},invalidMessage:{type:[Boolean,Function,String],default:!1},debounce:{type:[Boolean,Number],default:!1}},data:function(){return Object.assign({},V(this),{formShouldShowErrors:!1,contextObservers:[],namedErrors:[],namedFieldErrors:{},isLoading:!1,hasFailedSubmit:!1})},computed:Object.assign({},G(),{schemaListeners:function(){var t=this.$listeners;return t.submit,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}(t,["submit"])},pseudoProps:function(){return S(this.$attrs,C.filter((function(t){return/^form/.test(t)})))},attributes:function(){var t=this,e=Object.keys(this.$attrs).filter((function(e){return!p(t.pseudoProps,m(e))})).reduce((function(e,n){var r;return Object.assign({},e,((r={})[n]=t.$attrs[n],r))}),{});return"string"==typeof this.name&&Object.assign(e,{name:this.name}),e},hasErrors:function(){return Object.values(this.registry.errors).some((function(t){return t}))},isValid:function(){return!this.hasErrors},formContext:function(){return{errors:this.mergedFormErrors,pseudoProps:this.pseudoProps,hasErrors:this.hasErrors,value:this.proxy,hasValue:!k(this.proxy),isValid:this.isValid,isLoading:this.isLoading,classes:this.classes}},classes:function(){return this.$formulate.classes(Object.assign({},this.$props,this.pseudoProps,{value:this.proxy,errors:this.mergedFormErrors,hasErrors:this.hasErrors,hasValue:!k(this.proxy),isValid:this.isValid,isLoading:this.isLoading,type:"form",classification:"form",attrs:this.$attrs}))},invalidErrors:function(){if(this.hasFailedSubmit&&this.hasErrors)switch(typeof this.invalidMessage){case"string":return[this.invalidMessage];case"object":return Array.isArray(this.invalidMessage)?this.invalidMessage:[];case"function":var t=this.invalidMessage(this.failingFields);return Array.isArray(t)?t:[t]}return[]},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors).concat(this.invalidErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=v(this.errors[e]);for(var n in this.namedFieldErrors)t[n]=v(this.namedFieldErrors[n]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length},failingFields:function(){var t=this;return Object.keys(this.registry.errors).reduce((function(e,n){var r;return Object.assign({},e,t.registry.errors[n]?((r={})[n]=t.registry.get(n),r):{})}),{})}}),watch:Object.assign({},{mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type}
2)).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0},mergedGroupErrors:{handler:function(t){this.errorObservers.filter((function(t){return"group"===t.type})).forEach((function(e){return e.callback(t[e.field]||{})}))},immediate:!0}},{formulateValue:{handler:function(t){this.isVmodeled&&t&&"object"==typeof t&&this.setValues(t)},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))}}),created:function(){this.$formulate.register(this),this.applyInitialValues(),this.$emit("created",this)},destroyed:function(){this.$formulate.deregister(this)},methods:Object.assign({},H(),{applyErrors:function(t){var e=t.formErrors,n=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=n},addContextObserver:function(t){this.contextObservers.find((function(e){return e===t}))||(this.contextObservers.push(t),t(this.formContext))},removeContextObserver:function(t){this.contextObservers.filter((function(e){return e!==t}))},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;if(!this.isLoading){this.isLoading=!0,this.showErrors();var e=new K(this),n=this.$listeners["submit-raw"]||this.$listeners.submitRaw,r="function"==typeof n?n(e):Promise.resolve(e);return(r instanceof Promise?r:Promise.resolve(r)).then((function(t){var n=t instanceof K?t:e;return n.hasValidationErrors().then((function(t){return[n,t]}))})).then((function(e){var n=e[0];return e[1]||"function"!=typeof t.$listeners.submit?t.onFailedValidation():n.values().then((function(e){t.hasFailedSubmit=!1;var n=t.$listeners.submit(e);return(n instanceof Promise?n:Promise.resolve()).then((function(){return e}))}))})).finally((function(){t.isLoading=!1}))}},onFailedValidation:function(){return this.hasFailedSubmit=!0,this.$emit("failed-validation",Object.assign({},this.failingFields)),this.$formulate.failedValidation(this)}})},z=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",t._b({class:t.classes.form,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},"form",t.attributes,!1),[t.schema?n("FormulateSchema",t._g({attrs:{schema:t.schema}},t.schemaListeners)):t._e(),t._v(" "),t.hasFormErrorObservers?t._e():n("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default",null,null,t.formContext)],2)};z._withStripped=!0;var Q=Y({render:z,staticRenderFns:[]},void 0,q,void 0,!1,void 0,!1,void 0,void 0,void 0),X={context:function(){return et.call(this,Object.assign({},{addLabel:this.logicalAddLabel,removeLabel:this.logicalRemoveLabel,attributes:this.elementAttributes,blurHandler:tt.bind(this),classification:this.classification,component:this.component,debounceDelay:this.debounceDelay,disableErrors:this.disableErrors,errors:this.explicitErrors,formShouldShowErrors:this.formShouldShowErrors,getValidationErrors:this.getValidationErrors.bind(this),groupErrors:this.mergedGroupErrors,hasGivenName:this.hasGivenName,hasValue:this.hasValue,hasLabel:this.label&&"button"!==this.classification,hasValidationErrors:this.hasValidationErrors.bind(this),help:this.help,helpPosition:this.logicalHelpPosition,id:this.id||this.defaultId,ignored:p(this.$options.propsData,"ignored"),isValid:this.isValid,imageBehavior:this.imageBehavior,label:this.label,labelPosition:this.logicalLabelPosition,limit:this.limit===1/0?this.limit:parseInt(this.limit,10),name:this.nameOrFallback,minimum:parseInt(this.minimum,10),performValidation:this.performValidation.bind(this),pseudoProps:this.pseudoProps,preventWindowDrops:this.preventWindowDrops,removePosition:this.mergedRemovePosition,repeatable:this.repeatable,rootEmit:this.$emit.bind(this),rules:this.ruleDetails,setErrors:this.setErrors.bind(this),showValidationErrors:this.showValidationErrors,slot
2Components:this.slotComponents,slotProps:this.slotProps,type:this.type,uploadBehavior:this.uploadBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),validationErrors:this.validationErrors,value:this.value,visibleValidationErrors:this.visibleValidationErrors,isSubField:this.isSubField,classes:this.classes},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification){var t=this.id||this.elementAttributes.id.replace(/[^0-9]/g,"");return this.type+"_"+t}return!1!==this.name&&("button"!==this.classification||!0!==this.name)&&this.name},hasGivenName:function(){return"boolean"!=typeof this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:Z.call(this,this.options),optionGroups:!!this.optionGroups&&h(this.optionGroups,(function(e,n){return Z.call(t,n)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:Z.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.filteredAttributes);return this.id?t.id=this.id:t.id=this.defaultId,this.hasGivenName&&(t.name=this.name),this.help&&!p(t,"aria-describedby")&&(t["aria-describedby"]=t.id+"-help"),!this.classes.input||Array.isArray(this.classes.input)&&!this.classes.input.length||(t.class=this.classes.input),t},logicalLabelPosition:function(){return this.labelPosition?this.labelPosition:"box"===this.classification?"after":"before"},logicalHelpPosition:function(){return this.helpPosition?this.helpPosition:"group"===this.classification?"before":"after"},mergedRemovePosition:function(){return"group"===this.type&&(this.removePosition||"before")},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},mergedGroupErrors:function(){var t=this,e=Object.keys(this.groupErrors).concat(Object.keys(this.localGroupErrors)),n=/^(\d+)\.(.*)$/;return Array.from(new Set(e)).filter((function(t){return n.test(t)})).reduce((function(e,r){var i,o=r.match(n),s=o[1],a=o[2];p(e,s)||(e[s]={});var u=Array.from(new Set(v(t.groupErrors[r]).concat(v(t.localGroupErrors[r]))));return e[s]=Object.assign(e[s],((i={})[a]=u,i)),e}),{})},hasValue:function(){var t=this,e=this.proxy;return"box"===this.classification&&this.isGrouped||"select"===this.classification&&p(this.filteredAttributes,"multiple")?Array.isArray(e)?e.some((function(e){return e===t.value})):this.value===e:!k(e)},visibleValidationErrors:function(){return this.showValidationErrors&&this.validationErrors.length?this.validationErrors:[]},slotComponents:function(){var t=this.$formulate.slotComponent.bind(this.$formulate);return{addMore:t(this.type,"addMore"),buttonContent:t(this.type,"buttonContent"),errors:t(this.type,"errors"),file:t(this.type,"file"),help:t(this.type,"help"),label:t(this.type,"label"),prefix:t(this.type,"prefix"),remove:t(this.type,"remove"),repeatable:t(this.type,"repeatable"),suffix:t(this.type,"suffix"),uploadAreaMask:t(this.type,"uploadAreaMask")}},logicalAddLabel:function(){if("file"===this.classification)return!0===this.addLabel?"+ Add "+a(this.type):this.addLabel;if("boolean"==typeof this.addLabel){var t=this.label||this.name;return"+ "+("string"==typeof t?t+" ":"")+" Add"}return this.addLabel},logicalRemoveLabel:function(){return"boolean"==typeof this.removeLabel?"Remove":this.removeLabel},classes:function(){return this.$formulate.classes(Object.assign({},this.$props,this.pseudoProps,{attrs:this.filteredAttributes,classification:this.classification,hasErrors:this.hasVisibleErrors,hasValue:this.hasValue,helpPosition:this.logicalHelpPosition,isValid:this.isValid,labelPosition:this.logicalLabelPosition,type:this.t
2ype,value:this.proxy}))},showValidationErrors:function(){return!(!this.showErrors&&!this.formShouldShowErrors)||(!("file"!==this.classification||"live"!==this.uploadBehavior||!nt.call(this))||this.behavioralErrorVisibility)},slotProps:function(){var t=this.$formulate.slotProps.bind(this.$formulate);return{label:t(this.type,"label",this.typeProps),help:t(this.type,"help",this.typeProps),errors:t(this.type,"errors",this.typeProps),repeatable:t(this.type,"repeatable",this.typeProps),addMore:t(this.type,"addMore",this.typeProps),remove:t(this.type,"remove",this.typeProps),component:t(this.type,"component",this.typeProps)}},pseudoProps:function(){return S(this.localAttributes,C)},isValid:function(){return!this.hasErrors},ruleDetails:function(){return this.parsedValidation.map((function(t){var e=t[1];return{ruleName:t[2],args:e}}))},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){var t=this,e=this.$formulate.options.validationNameStrategy||["validationName","name","label","type"];return Array.isArray(e)?this[e.find((function(e){return"string"==typeof t[e]}))]:"function"==typeof e?e.call(this,this):this.type},explicitErrors:function(){return v(this.errors).concat(this.localErrors).concat(v(this.error))},allErrors:function(){return this.explicitErrors.concat(v(this.validationErrors))},hasVisibleErrors:function(){return Array.isArray(this.validationErrors)&&this.validationErrors.length&&this.showValidationErrors||!!this.explicitErrors.length},hasErrors:function(){return!!this.allErrors.length},filteredAttributes:function(){var t=this,e=Object.keys(this.pseudoProps).concat(Object.keys(this.typeProps));return Object.keys(this.localAttributes).reduce((function(n,r){return e.includes(m(r))||(n[r]=t.localAttributes[r]),n}),{})},typeProps:function(){return S(this.localAttributes,this.$formulate.typeProps(this.type))},listeners:function(){var t=this.$listeners;return t.input,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}(t,["input"])}};function Z(t){return t?(Array.isArray(t)?t:Object.keys(t).map((function(e){return{label:t[e],value:e}}))).map(J.bind(this)):[]}function J(t){return"number"==typeof t&&(t=String(t)),"string"==typeof t?{label:t,value:t,id:this.elementAttributes.id+"_"+t}:("number"==typeof t.value&&(t.value=String(t.value)),Object.assign({value:"",label:"",id:this.elementAttributes.id+"_"+(t.value||t.label)},t))}function tt(){var t=this;"blur"!==this.errorBehavior&&"value"!==this.errorBehavior||(this.behavioralErrorVisibility=!0),this.$nextTick((function(){return t.$emit("blur-context",t.context)}))}function et(t){var e=this;return Object.defineProperty(t,"model",{get:nt.bind(this),set:function(t){if(!e.mntd||!e.debounceDelay)return it.call(e,t);e.dSet(it,[t],e.debounceDelay)},enumerable:!0})}function nt(){var t=this.isVmodeled?"formulateValue":"proxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]||0===this[t]?this[t]:""}function it(t){var e=!1;f(t,this.proxy,"group"===this.type)||(this.proxy=t,e=!0),!this.context.ignored&&this.context.name&&"function"==typeof this.formulateSetter&&this.formulateSetter(this.context.name,t),e&&this.$emit("input",t)}var st={name:"FormulateInput",inheritAttrs:!1,provide:function(){return{formulateRegisterRule:this.registerRule,formulateRemoveRule:this.removeRule}},inject:{formulateSetter:{default:void 0},formulateFieldValidation:{default:function(){return function(){return{}}}},formulateRegister:{default:void 0},formulateDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}},getGroupValues:{default:void 0},validateDependents:{default:function(){return function(){}}},observeErrors:{default:void 0},removeErrorObserver:{default:void 0},isSubField:{default:function(){return function(){return!1}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},limit:{type:[String,Number],default:1/0,validator:function(t){return 1/0}},minimum:{type:[String,Number],default:0,validator:function(t){return parseInt(t,10)==t}},help:{type:[String,Boolean],default:!1},helpPosition:{type:[String,Boolean],default:!1},isGrouped:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},removePosition:{type:[String,Boolean],default:!1},repeatable:{type:Boolean,default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live","submit","value"].includes(t)}},showErrors:{type:Boolean,default:!1},groupErrors:{type:Object,default:function(){return{}},validator:function(t){var e=/^\d+\./;return!Object.keys(t).some((function(t){return!e.test(t)}))}},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1},addLabel:{type:[Boolean,String],default:!0},removeLabel:{type:[Boolean,String],default:!1},keepModelData:{type:[Boolean,String],default:"inherit"},ignored:{type:[Boolean,String],default:!1},debounce:{type:[Boolean,Number],default:!1},preventDeregister:{type:Boolean,default:!1}},data:function(){return{defaultId:this.$formulate.nextId(this),localAttributes:{},localErrors:[],localGroupErrors:{},proxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Prom
2ise.resolve(),ruleRegistry:[],messageRegistry:{},touched:!1,debounceDelay:this.debounce,dSet:function(e,n,r){var i=this;t&&clearTimeout(t),t=setTimeout((function(){return e.call.apply(e,[i].concat(n))}),r)},mntd:!1};var t},computed:Object.assign({},X,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(n){e[m(n)]=t.validationRules[n]})),e},parsedValidation:function(){return u(this.validation,this.$formulate.rules(this.parsedValidationRules))},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(n){e[m(n)]=t.validationMessages[n]})),Object.keys(this.messageRegistry).forEach((function(n){e[m(n)]=t.messageRegistry[n]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},proxy:{handler:function(t,e){this.performValidation(),this.isVmodeled||f(t,e,"group"===this.type)||(this.context.model=t),this.validateDependents(this),!this.touched&&t&&(this.touched=!0)},deep:!0},formulateValue:{handler:function(t,e){this.isVmodeled&&!f(t,e,"group"===this.type)&&(this.context.model=t)},deep:!0},showValidationErrors:{handler:function(t){this.$emit("error-visibility",t)},immediate:!0},validation:{handler:function(){this.performValidation()},deep:!0},touched:function(t){"value"===this.errorBehavior&&t&&(this.behavioralErrorVisibility=t)},debounce:function(t){this.debounceDelay=t}},created:function(){this.applyInitialValue(),this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.applyDefaultValue(),this.disableErrors||"function"!=typeof this.observeErrors||(this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),"group"===this.type&&this.observeErrors({callback:this.setGroupErrors,type:"group",field:this.nameOrFallback})),this.updateLocalAttributes(this.$attrs),this.performValidation(),this.hasValue&&(this.touched=!0)},mounted:function(){this.mntd=!0},beforeDestroy:function(){this.disableErrors||"function"!=typeof this.removeErrorObserver||(this.removeErrorObserver(this.setErrors),"group"===this.type&&this.removeErrorObserver(this.setGroupErrors)),"function"!=typeof this.formulateDeregister||this.preventDeregister||this.formulateDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:p(this.$options.propsData,"value")&&"box"!==t?this.value:p(this.$options.propsData,"formulateValue")?this.formulateValue:"group"===t?Object.defineProperty("group"===this.type?[{}]:[],"__init",{value:!0}):""},applyInitialValue:function(){f(this.context.model,this.proxy)||"box"===this.classification&&!p(this.$options.propsData,"options")||(this.context.model=this.proxy,this.$emit("input",this.proxy))},applyDefaultValue:function(){"select"===this.type&&!this.context.placeholder&&k(this.proxy)&&!this.isVmodeled&&!1===this.value&&this.context.options.length&&(p(this.$attrs,"multiple")?this.context.model=[]:this.context.model=this.context.options[0].value)},updateLocalAttributes:function(t){f(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=u(this.validation,this.$formulate.rules(this.parsedValidationRules));return e=this.ruleRegistry.length?this.ruleRegistry.concat(e):e,this.pendingValidation=this.runRules(e).then((function(e){return t.didValidate(e)})),this.pendingValidation},runRules:function(t){var e=this,n=function(t){var n=t[0],r=t[1],i=t[2],o=(t[3],n.apply(void 0,[{value:e.context.model,getFormValues:function(){for(var t,n=[],r=arguments.length;r--;)n[r]=arguments[r];return(t=e).getFormValues.apply(t,[e].concat(n))},getGroupValues:function(){for(var t,n=[],r=arguments.length;r--;)n[r]=arguments[r];return(t=e)["get"+(e.getGroupValues?"Group":"Form")+"Values"].apply(t,[e].concat(n))},name:e.context.name}].concat(r)));
2return(o=o instanceof Promise?o:Promise.resolve(o)).then((function(t){return!t&&e.getMessage(i,r)}))};return new Promise((function(e){var r=function(t,i){void 0===i&&(i=[]);var o=t.shift();Array.isArray(o)&&o.length?Promise.all(o.map(n)).then((function(t){return t.filter((function(t){return!!t}))})).then((function(n){return(n=Array.isArray(n)?n:[]).length&&o.bail||!t.length?e(i.concat(n).filter((function(t){return!k(t)}))):r(t,i.concat(n))})):e([])};r(function(t){var e=[],n=t.findIndex((function(t){return"bail"===t[2].toLowerCase()})),r=t.findIndex((function(t){return"optional"===t[2].toLowerCase()}));if(r>=0){var i=t.splice(r,1);e.push(Object.defineProperty(i,"bail",{value:!0}))}if(n>=0){var o=t.splice(0,n+1).slice(0,-1);o.length&&e.push(o),t.map((function(t){return e.push(Object.defineProperty([t],"bail",{value:!0}))}))}else e.push(t);return e.reduce((function(t,e){var n=function(t,e){if(void 0===e&&(e=!1),t.length<2)return Object.defineProperty([t],"bail",{value:e});var r=[],i=t.findIndex((function(t){return"^"===t[3]}));if(i>=0){var o=t.splice(0,i);o.length&&r.push.apply(r,n(o,e)),r.push(Object.defineProperty([t.shift()],"bail",{value:!0})),t.length&&r.push.apply(r,n(t,e))}else r.push(t);return r};return t.concat(n(e))}),[])}(t))}))},didValidate:function(t){var e=!f(t,this.validationErrors);if(this.validationErrors=t,e){var n=this.getErrorObject();this.$emit("validation",n),this.formulateFieldValidation&&"function"==typeof this.formulateFieldValidation&&this.formulateFieldValidation(n)}},getMessage:function(t,e){var n=this;return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues(this),getFormValues:function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(t=n).getFormValues.apply(t,[n].concat(e))},getGroupValues:function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(t=n)["get"+(n.getGroupValues?"Group":"Form")+"Values"].apply(t,[n].concat(e))}})},getMessageFunc:function(t){var e=this;if("optional"===(t=m(t)))return function(){return[]};if(this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":case"boolean":return function(){return e.messages[t]}}return function(n){return e.$formulate.validationMessage(t,n,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))},getValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){return t.pendingValidation.then((function(){return e(t.getErrorObject())}))}))}))},getErrorObject:function(){return{name:this.context.nameOrFallback||this.context.name,errors:this.validationErrors.filter((function(t){return"string"==typeof t})),hasErrors:!!this.validationErrors.length}},setErrors:function(t){this.localErrors=v(t)},setGroupErrors:function(t){this.localGroupErrors=t},registerRule:function(t,e,n,r){void 0===r&&(r=null),this.ruleRegistry.some((function(t){return t[2]===n}))||(this.ruleRegistry.push([t,e,n]),null!==r&&(this.messageRegistry[n]=r))},removeRule:function(t){var e=this.ruleRegistry.findIndex((function(e){return e[2]===t}));e>=0&&(this.ruleRegistry.splice(e,1),delete this.messageRegistry[t])}}},at=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.context.classes.outer,attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-has-value":t.hasValue,"data-type":t.type}},[n("div",{class:t.context.classes.wrapper},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?n(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?n(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[n(t.context.component,t._g(t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.component,!1),t.listeners),[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?n(t.context.slotComponents.label,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.label,!1)):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?n(t.context.slotComponents.help,t._b({tag:"component",attrs:{context:t.context}},"component",t.context.slotProps.help,!1)):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():n(t.context.slotComponents.errors,t._b({tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}},"component",t.context.slotProps.errors,!1))],null,t.context)],2)};at._withStripped=!0;var rt=Y({render:at,staticRenderFns:[]},void 0,st,void 0,!1,void 0,!1,void 0,void 0,void 0),ot={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1},observeContext:{default:!1},removeContextObserver:{default:!1}},props:{context:{type:Object,default:function(){return{}}},type:{type:String,default:"form"}},data:function(){return{boundSetErrors:this.setErrors.bind(this),boundSetForm
2Context:this.setFormContext.bind(this),localErrors:[],formContext:{classes:{formErrors:"formulate-form-errors",formError:"formulate-form-error"}}}},computed:{visibleValidationErrors:function(){return Array.isArray(this.context.visibleValidationErrors)?this.context.visibleValidationErrors:[]},errors:function(){return Array.isArray(this.context.errors)?this.context.errors:[]},mergedErrors:function(){return this.errors.concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.visibleValidationErrors))).filter((function(t){return"string"==typeof t}))},outerClass:function(){return"input"===this.type&&this.context.classes?this.context.classes.errors:this.formContext.classes.formErrors},itemClass:function(){return"input"===this.type&&this.context.classes?this.context.classes.error:this.formContext.classes.formError},role:function(){return"form"===this.type?"alert":"status"},ariaLive:function(){return"form"===this.type?"assertive":"polite"},slotComponent:function(){return this.$formulate.slotComponent(null,"errorList")}},created:function(){"form"===this.type&&"function"==typeof this.observeErrors&&(Array.isArray(this.context.errors)||this.observeErrors({callback:this.boundSetErrors,type:"form"}),this.observeContext(this.boundSetFormContext))},destroyed:function(){"form"===this.type&&"function"==typeof this.removeErrorObserver&&(Array.isArray(this.context.errors)||this.removeErrorObserver(this.boundSetErrors),this.removeContextObserver(this.boundSetFormContext))},methods:{setErrors:function(t){this.localErrors=v(t)},setFormContext:function(t){this.formContext=t}}},lt=function(){var t=this.$createElement;return(this._self._c||t)(this.slotComponent,{tag:"component",attrs:{"visible-errors":this.visibleErrors,"item-class":this.itemClass,"outer-class":this.outerClass,role:this.role,"aria-live":this.ariaLive,type:this.type}})};lt._withStripped=!0;var ct=Y({render:lt,staticRenderFns:[]},void 0,ot,void 0,!1,void 0,!1,void 0,void 0,void 0),ut={props:{context:{type:Object,required:!0}}},ht=function(){var t=this.$createElement,e=this._self._c||t;return this.context.help?e("div",{class:this.context.classes.help,attrs:{id:this.context.id+"-help"},domProps:{textContent:this._s(this.context.help)}}):this._e()};ht._withStripped=!0;var ft=Y({render:ht,staticRenderFns:[]},void 0,ut,void 0,!1,void 0,!1,void 0,void 0,void 0),pt={props:{file:{type:Object,required:!0},imagePreview:{type:Boolean,default:!1},context:{type:Object,required:!0}}},mt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.context.classes.file},[t.imagePreview&&t.file.previewData?n("div",{class:t.context.classes.fileImagePreview},[n("img",{class:t.context.classes.fileImagePreviewImage,attrs:{src:t.file.previewData}})]):t._e(),t._v(" "),n("div",{class:t.context.classes.fileName,attrs:{title:t.file.name},domProps:{textContent:t._s(t.file.name)}}),t._v(" "),!1!==t.file.progress?n("div",{class:t.context.classes.fileProgress,attrs:{"data-just-finished":t.file.justFinished,"data-is-finished":!t.file.justFinished&&t.file.complete}},[n("div",{class:t.context.classes.fileProgressInner,style:{width:t.file.progress+"%"}})]):t._e(),t._v(" "),t.file.complete&&!t.file.justFinished||!1===t.file.progress?n("div",{class:t.context.classes.fileRemove,on:{click:t.file.removeFile}}):t._e()])};mt._withStripped=!0;var dt=Y({render:mt,staticRenderFns:[]},void 0,pt,void 0,!1,void 0,!1,void 0,void 0,void 0),gt={name:"FormulateGrouping",props:{context:{type:Object,required:!0}},provide:function(){return{isSubField:function(){return!0},registerProvider:this.registerProvider,deregisterProvider:this.deregisterProvider}},data:function(){return{providers:[],keys:[]}},inject:["formulateRegisterRule","formulateRemoveRule"],computed:{items:function(){var t=this;return Array.isArray(this.context.model)?this.context.repeatable||0!==this.context.model.length?this.context.model.length<this.context.minimum?new Array(this.context.minimum||1).fill("").map((function(e,n){return t.setId(t.context.model[n]||{},n)}
2)):this.context.model.map((function(e,n){return t.setId(e,n)})):[this.setId({},0)]:new Array(this.context.minimum||1).fill("").map((function(e,n){return t.setId({},n)}))},formShouldShowErrors:function(){return this.context.formShouldShowErrors},groupErrors:function(){var t=this;return this.items.map((function(e,n){return p(t.context.groupErrors,n)?t.context.groupErrors[n]:{}}))}},watch:{providers:function(){this.formShouldShowErrors&&this.showErrors()},formShouldShowErrors:function(t){t&&this.showErrors()},items:{handler:function(t,e){f(t,e,!0)||(this.keys=t.map((function(t){return t.__id})))},immediate:!0}},created:function(){this.formulateRegisterRule(this.validateGroup.bind(this),[],"formulateGrouping",!0)},destroyed:function(){this.formulateRemoveRule("formulateGrouping")},methods:{validateGroup:function(){return Promise.all(this.providers.reduce((function(t,e){return e&&"function"==typeof e.hasValidationErrors&&t.push(e.hasValidationErrors()),t}),[])).then((function(t){return!t.some((function(t){return!!t}))}))},showErrors:function(){this.providers.forEach((function(t){return t&&"function"==typeof t.showErrors&&t.showErrors()}))},setItem:function(t,e){var n=this;Array.isArray(this.context.model)&&this.context.model.length>=this.context.minimum&&!this.context.model.__init?this.context.model.splice(t,1,this.setId(e,t)):this.context.model=this.items.map((function(r,i){return i===t?n.setId(e,t):r}))},removeItem:function(t){var e=this;Array.isArray(this.context.model)&&this.context.model.length>this.context.minimum?(this.context.model=this.context.model.filter((function(e,n){return n!==t&&e})),this.context.rootEmit("repeatableRemoved",this.context.model)):!Array.isArray(this.context.model)&&this.items.length>this.context.minimum&&(this.context.model=new Array(this.items.length-1).fill("").map((function(t,n){return e.setId({},n)})),this.context.rootEmit("repeatableRemoved",this.context.model))},registerProvider:function(t){this.providers.some((function(e){return e===t}))||this.providers.push(t)},deregisterProvider:function(t){this.providers=this.providers.filter((function(e){return e!==t}))},setId:function(t,e){return t.__id?t:T(t,this.keys[e])}}},vt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("FormulateSlot",{class:t.context.classes.grouping,attrs:{name:"grouping",context:t.context,"force-wrap":t.context.repeatable}},t._l(t.items,(function(e,r){return n("FormulateRepeatableProvider",{key:e.__id,attrs:{index:r,context:t.context,uuid:e.__id,errors:t.groupErrors[r]},on:{remove:t.removeItem,input:function(e){return t.setItem(r,e)}}},[t._t("default")],2)})),1)};vt._withStripped=!0;var yt=Y({render:vt,staticRenderFns:[]},void 0,gt,void 0,!1,void 0,!1,void 0,void 0,void 0),bt={props:{context:{type:Object,required:!0}}},Et=function(){var t=this.$createElement;return(this._self._c||t)("label",{class:this.context.classes.label,attrs:{id:this.context.id+"_label",for:this.context.id},domProps:{textContent:this._s(this.context.label)}})};Et._withStripped=!0;var Tt=Y({render:Et,staticRenderFns:[]},void 0,bt,void 0,!1,void 0,!1,void 0,void 0,void 0),kt={props:{context:{type:Object,required:!0},addMore:{type:Function,required:!0}}},St=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{class:this.context.classes.groupAddMore},[e("FormulateInput",{attrs:{type:"button",label:this.context.addLabel,"data-minor":"","data-ghost":""},on:{click:this.addMore}})],1)};St._withStripped=!0;var _t=Y({render:St,staticRenderFns:[]},void 0,kt,void 0,!1,void 0,!1,void 0,void 0,void 0),At={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},attributes:function(){return this.context.attributes||{}},hasValue:function(){return this.context.hasValue}}},Ot={name:"FormulateInputBox",mixins:[At],computed:{usesDecorator:function(){return this.$formulate.options.useInputDecorators}}},wt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},[n("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?n(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),"radio"===t.type?n("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)}
2,on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1),t.$listeners)):n("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t.context.value,s=t._i(n,o);r.checked?s<0&&t.$set(t.context,"model",n.concat([o])):s>-1&&t.$set(t.context,"model",n.slice(0,s).concat(n.slice(s+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),t.usesDecorator?n("label",{tag:"component",class:t.context.classes.decorator,attrs:{for:t.attributes.id}}):t._e(),t._v(" "),n("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?n(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};wt._withStripped=!0;var It=Y({render:wt,staticRenderFns:[]},void 0,Ot,void 0,!1,void 0,!1,void 0,void 0,void 0),Rt={props:{visibleErrors:{type:Array,required:!0},itemClass:{type:[String,Array,Object,Boolean],default:!1},outerClass:{type:[String,Array,Object,Boolean],default:!1},role:{type:[String],default:"status"},ariaLive:{type:[String,Boolean],default:"polite"}
2,type:{type:String,required:!0}}},Lt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.visibleErrors.length?n("ul",{class:t.outerClass},t._l(t.visibleErrors,(function(e){return n("li",{key:e,class:t.itemClass,attrs:{role:t.role,"aria-live":t.ariaLive},domProps:{textContent:t._s(e)}})})),0):t._e()};Lt._withStripped=!0;var xt=Y({render:Lt,staticRenderFns:[]},void 0,Rt,void 0,!1,void 0,!1,void 0,void 0,void 0),Dt={name:"FormulateInputText",mixins:[At]},Ct=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},[n("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?n(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),"checkbox"===t.type?n("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&t.$set(t.context,"model",n.concat([null])):o>-1&&t.$set(t.context,"model",n.slice(0,o).concat(n.slice(o+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1),t.$listeners)):"radio"===t.type?n("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1),t.$listeners)):n("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),n("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?n(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};Ct._withStripped=!0;var Pt=Y({render:Ct,staticRenderFns:[]},void 0,Dt,void 0,!1,void 0,!1,void 0,void 0,void 0),Mt={name:"FormulateFiles",props:{files:{type:b,required:!0},imagePreview:{type:Boolean,default:!1},context:{type:Object,required:!0}},computed:{fileUploads:function(){return this.files.files||[]},isMultiple:function(){return p(this.context.attributes,"multiple")}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()},methods:{appendFiles:function(){var t=this.$refs.addFiles;t.files.length&&this.files.mergeFileList(t)}}},jt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.fileUploads.length?n("ul",{class:t.context.classes.files},[t._l(t.fileUploads,(function(e){return n("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[n("FormulateSlot",{attrs:{name:"file",context:t.context,file:e,"image-preview":t.imagePreview}},[n(t.context.slotComponents.file,{tag:"component",attrs:{context:t.context,file:e,"image-preview":t.imagePreview}})],1),t._v(" "),e.error?n("div",{class:t.context.classes.fileUploadError,domProps:{textContent:t._s(e.error)}}):t._e()],1)})),t._v(" "),t.isMultiple&&t.context.addLabel?n("div",{class:t.context.classes.fileAdd,attrs:{role:"button"}},[t._v("\n "+t._s(t.context.addLabel)+"\n "),n("input",{ref:"addFiles",class:t.context.classes.fileAddInput,attrs:{type:"file",multiple:""},on:{change:t.appendFiles}})]):t._e()],2):t._e()};jt._withStripped=!0;var Ft={name:"FormulateInputFile",components:{FormulateFiles:Y({render:jt,staticRenderFns:[]},void 0,Mt,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[At],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof b&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof b&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},Nt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[n("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?n(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),n("div",{class:t.context.classes.uploadArea,attrs:{"data-has-files":t.hasFiles}},[n("input",t._g(t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1),t.$listeners)),t._v(" "),n("FormulateSlot",{attrs:{name:"uploadAreaMask",context:t.context,"has-files":t.hasFiles}},[n(t.context.slotComponents.uploadAreaMask,{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],tag:"component",class:t.context.classes.uploadAreaMask,attrs:{"has-files":"div"!==t.context.slotComponents.uploadAreaMask&&t.hasFiles,"data-has-files":"div"===t.context.slotComponents.uploadAreaMask&&t.hasFiles}}
2)],1),t._v(" "),t.hasFiles?n("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior,context:t.context}}):t._e()],1),t._v(" "),n("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?n(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};Nt._withStripped=!0;var Ut=Y({render:Nt,staticRenderFns:[]},void 0,Ft,void 0,!1,void 0,!1,void 0,void 0,void 0),Bt={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0},index:{type:Number,required:!0}}},$t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.context.classes.groupRepeatable},["after"===t.context.removePosition?t._t("default"):t._e(),t._v(" "),n("FormulateSlot",{attrs:{name:"remove",context:t.context,index:t.index,"remove-item":t.removeItem}},[n(t.context.slotComponents.remove,t._b({tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},"component",t.context.slotProps.remove,!1))],1),t._v(" "),"before"===t.context.removePosition?t._t("default"):t._e()],2)};$t._withStripped=!0;var Vt=Y({render:$t,staticRenderFns:[]},void 0,Bt,void 0,!1,void 0,!1,void 0,void 0,void 0);function Gt(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}var Ht={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subType:function(){return"group"===this.context.type?"grouping":"inputs"},optionsWithContext:function(){var t=this,e=this.context,n=e.attributes,r=(n.id,Gt(n,["id"])),i=(e.blurHandler,e.classification,e.component,e.getValidationErrors,e.hasLabel,e.hasValidationErrors,e.isSubField,e.isValid,e.labelPosition,e.options,e.performValidation,e.setErrors,e.slotComponents,e.slotProps,e.validationErrors,e.visibleValidationErrors,e.classes,e.showValidationErrors,e.rootEmit,e.help,e.pseudoProps,e.rules,e.model,Gt(e,["attributes","blurHandler","classification","component","getValidationErrors","hasLabel","hasValidationErrors","isSubField","isValid","labelPosition","options","performValidation","setErrors","slotComponents","slotProps","validationErrors","visibleValidationErrors","classes","showValidationErrors","rootEmit","help","pseudoProps","rules","model"]));return this.options.map((function(e){return t.groupItemContext(i,e,r)}))},totalItems:function(){return Array.isArray(this.context.model)&&this.context.model.length>this.context.minimum?this.context.model.length:this.context.minimum||1},canAddMore:function(){return this.context.repeatable&&this.totalItems<this.context.limit},labelledBy:function(){return this.context.label&&this.context.id+"_label"}},methods:{addItem:function(){if(Array.isArray(this.context.model))for(var t=this.context.minimum-this.context.model.length+1,e=Math.max(t,1),n=0;n<e;n++)this.context.model.push(T({}));else this.context.model=new Array(this.totalItems+1).fill("").map((function(){return T({})}));this.context.rootEmit("repeatableAdded",this.context.model)},groupItemContext:function(t,e,n){return Object.assign({},t,e,n,{isGrouped:!0},t.hasGivenName?{}:{name:!0})}}},Wt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.context.classes.element,attrs:{"data-is-repeatable":t.context.repeatable,role:"group","aria-labelledby":t.labelledBy}},[n("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?n(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),"grouping"!==t.subType?t._l(t.optionsWithContext,(function(e){return n("FormulateInput",t._b({key:e.id,staticClass:"formulate-input-group-item",attrs:{"disable-errors":!0,"prevent-deregister":!0},on:{blur:t.context.blurHandler},model:{value:t.context.model,callback:function(e){t.$set(t.context,"model",e)},expression:"context.model"}},"FormulateInput",e,!1))})):[n("FormulateGrouping",{attrs:{context:t.context}},[t._t("default")],2),t._v(" "),t.canAddMore?n("FormulateSlot",{attrs:{name:"addmore",context:t.context,"add-more":t.addItem}},[n(t.context.slotComponents.addMore,t._b({tag:"component",attrs:{context:t.context,"add-more":t.addItem},on:{add:t.addItem}}
2,"component",t.context.slotProps.addMore,!1))],1):t._e()],t._v(" "),n("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?n(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],2)};Wt._withStripped=!0;var Kt=Y({render:Wt,staticRenderFns:[]},void 0,Ht,void 0,!1,void 0,!1,void 0,void 0,void 0),qt={name:"FormulateInputButton",mixins:[At]},Yt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},[n("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?n(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),n("button",t._g(t._b({attrs:{type:t.type}},"button",t.attributes,!1),t.$listeners),[t._t("default",[n(t.context.slotComponents.buttonContent,{tag:"component",attrs:{context:t.context}})],{context:t.context})],2),t._v(" "),n("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?n(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};Yt._withStripped=!0;var zt=Y({render:Yt,staticRenderFns:[]},void 0,qt,void 0,!1,void 0,!1,void 0,void 0,void 0),Qt={name:"FormulateInputSelect",mixins:[At],computed:{options:function(){return this.context.options||{}},optionGroups:function(){return this.context.optionGroups||!1},placeholderSelected:function(){return!(this.hasValue||!this.context.attributes||!this.context.attributes.placeholder)}}},Xt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type,"data-multiple":t.attributes&&void 0!==t.attributes.multiple}},[n("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?n(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),n("select",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{"data-placeholder-selected":t.placeholderSelected},on:{blur:t.context.blurHandler,change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.context,"model",e.target.multiple?n:n[0])}}},"select",t.attributes,!1),t.$listeners),[t.context.placeholder?n("option",{attrs:{value:"",hidden:"hidden",disabled:""},domProps:{selected:!t.hasValue}},[t._v("\n "+t._s(t.context.placeholder)+"\n ")]):t._e(),t._v(" "),t.optionGroups?t._l(t.optionGroups,(function(e,r){return n("optgroup",{key:r,attrs:{label:r}},t._l(e,(function(e){return n("option",t._b({key:e.id,attrs:{disabled:!!e.disabled},domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||e.attrs||{},!1))})),0)})):t._l(t.options,(function(e){return n("option",t._b({key:e.id,attrs:{disabled:!!e.disabled},domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||e.attrs||{},!1))}))],2),t._v(" "),n("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?n(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};Xt._withStripped=!0;var Zt=Y({render:Xt,staticRenderFns:[]},void 0,Qt,void 0,!1,void 0,!1,void 0,void 0,void 0),Jt={name:"FormulateInputSlider",mixins:[At]},te=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.context.classes.element,attrs:{"data-type":t.context.type}},[n("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?n(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),"checkbox"===t.type?n("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&t.$set(t.context,"model",n.concat([null])):o>
2-1&&t.$set(t.context,"model",n.slice(0,o).concat(n.slice(o+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1),t.$listeners)):"radio"===t.type?n("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1),t.$listeners)):n("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1),t.$listeners)),t._v(" "),t.context.showValue?n("div",{class:t.context.classes.rangeValue,domProps:{textContent:t._s(t.context.model)}}):t._e(),t._v(" "),n("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?n(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};te._withStripped=!0;var ee=Y({render:te,staticRenderFns:[]},void 0,Jt,void 0,!1,void 0,!1,void 0,void 0,void 0),ne={props:{context:{type:Object,required:!0}}},ie=function(){var t=this.$createElement;return(this._self._c||t)("span",{class:"formulate-input-element--"+this.context.type+"--label",domProps:{textContent:this._s(this.context.value||this.context.label||this.context.name||"Submit")}})};ie._withStripped=!0;var re=Y({render:ie,staticRenderFns:[]},void 0,ne,void 0,!1,void 0,!1,void 0,void 0,void 0),se={name:"FormulateInputTextArea",mixins:[At]},ae=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.context.classes.element,attrs:{"data-type":"textarea"}},[n("FormulateSlot",{attrs:{name:"prefix",context:t.context}},[t.context.slotComponents.prefix?n(t.context.slotComponents.prefix,{tag:"component",attrs:{context:t.context}}):t._e()],1),t._v(" "),n("textarea",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1),t.$listeners)),t._v(" "),n("FormulateSlot",{attrs:{name:"suffix",context:t.context}},[t.context.slotComponents.suffix?n(t.context.slotComponents.suffix,{tag:"component",attrs:{context:t.context}}):t._e()],1)],1)};ae._withStripped=!0;var oe=Y({render:ae,staticRenderFns:[]},void 0,se,void 0,!1,void 0,!1,void 0,void 0,void 0),le={provide:function(){var t=this;return Object.assign({},W(this,["getFormValues"]),{formulateSetter:function(e,n){return t.setGroupValue(e,n)}})},inject:{registerProvider:"registerProvider",deregisterProvider:"deregisterProvider"},props:{index:{type:Number,required:!0},context:{type:Object,required:!0},uuid:{type:String,required:!0},errors:{type:Object,required:!0}},data:function(){return Object.assign({},V(this),{isGrouping:!0})},computed:Object.assign({},G(),{mergedFieldErrors:function(){return this.errors}}),watch:Object.assign({},{mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0},mergedGroupErrors:{handler:function(t){this.errorObservers.filter((function(t){return"group"===t.type})).forEach((function(e){return e.callback(t[e.field]||{})}))},immediate:!0}},{"context.model":{handler:function(t){f(t[this.index],this.proxy,!0)||this.setValues(t[this.index])},deep:!0}}),created:function(){this.applyInitialValues(),this.registerProvider(this)},beforeDestroy:function(){this.preventCleanup=!0,this.deregisterProvider(this)},methods:Object.assign({},H(),{setGroupValue:function(t,e){f(this.proxy[t],e,!0)||this.setFieldValue(t,e)},removeItem:function(){this.$emit("remove",this.index)}})},ce=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("FormulateSlot",{attrs:{name:"repeatable",context:t.context,index:t.index,"remove-item":t.removeItem}},[n(t.context.slotComponents.repeatable,t._b({tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},"component",t.context.slotProps.repeatable,!1),[n("FormulateSlot",{attrs:{context:t.context,index:t.index,name:"default"}})],1)],1)};ce._withStripped=!0;var ue=Y({render:ce,staticRenderFns:[]},void 0,le,void 0,!1,void 0,!1,void 0,void 0,void 0),de={props:{index:{type:Number,default:null},context:{type:Object,required:!0},removeItem:{type:Function,required:!0}}},he=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.context.repeatable?n("a",{class:t.context.classes.groupRepeatableRemove,attrs:{"data-disabled":t.context.model.length<=t.context.minimum,role:"button"},domProps:{textContent:t._s(t.context.removeLabel)},on:{click:function(e){return e.preventDefault(),t.removeItem(e)},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.removeItem(e)}}}):t._e()};he._withStripped=!0;var fe=Y({render:he,staticRenderFns:[]},void 0,de,void 0,!1,void 0,!1,void 0,void 0,void 0),pe=function(){this.options={},this.defaults={components:{FormulateSlot:N,FormulateForm:Q,FormulateFile:dt,FormulateHelp:ft,FormulateLabel:Tt,FormulateInput:rt,FormulateErrors:ct,FormulateSchema:U,FormulateAddMore:_t,FormulateGrouping:yt,FormulateInputBox:It,FormulateInputText:Pt,FormulateInputFile:Ut,FormulateErrorList:xt,FormulateRepeatable:Vt,FormulateInputGroup:Kt,FormulateInputButton:zt,FormulateInputSelect:Zt,FormulateInputSlider:ee,FormulateButtonContent:re,FormulateInputTextArea:oe,FormulateRepeatableRemove:fe,FormulateRepeatableProvider:ue},slotComponents:{addMore:"FormulateAddMore",buttonContent:"FormulateButtonContent",errorList:"FormulateErrorList",errors:"FormulateErrors",file:"FormulateFile",help:"FormulateHelp",label:"FormulateLabel",prefix:!1,remove:"FormulateRepeatableRemove",repeatable:"FormulateRepeatable",suffix:!1,uploadAreaMask:"div"},slotProps:{},library:d,rules:I,mimes:L,locale:!1,uploader:j,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[l.b],locales:{},failedValidation:function(){return!1},idPrefix:"formulate-",baseClasses:function(t){return t},coreClasses:M,classes:{},useInputDecorators:!0,validationNameStrategy:!1},this.registry=new Map,this.idRegistry={}};pe.prototype.install=function(t,e){var n=this;t.prototype.$formulate=this,this.options=this.defaults;var r=this.defaults.plugins;for(var i in e&&Array.isArray(e.plugins)&&e.plugins.length&&(r=r.concat(e.plugins)),r.forEach((function(t){return"function"==typeof t?t(n):null})),this.extend(e||{}),this.options.components)t.component(i,this.options.components[i])},pe.prototype.nextId=function(t){var e=t.$route&&t.$route.path&&t.$route.path?t.$route.path.replace(/[/\\.\s]/g,"-"):"global";return Object.prototype.hasOwnProperty.call(this.idRegistry,e)||(this.idRegistry[e]=0),""+this.options.idPrefix+e+"-"+ ++this.idRegistry[e]},pe.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge
2(this.options,t),this;throw new Error("Formulate.extend expects an object, was "+typeof t)},pe.prototype.merge=function(t,e,n){void 0===n&&(n=!0);var i={};for(var r in t)e.hasOwnProperty(r)?o(e[r])&&o(t[r])?i[r]=this.merge(t[r],e[r],n):n&&Array.isArray(t[r])&&Array.isArray(e[r])?i[r]=t[r].concat(e[r]):i[r]=e[r]:i[r]=t[r];for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i},pe.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},pe.prototype.classes=function(t){var e=this,n=this.options.coreClasses(t),r=this.options.baseClasses(n,t);return Object.keys(r).reduce((function(n,i){var o,s=P(r[i],e.options.classes[i],t);return s=function(t,e,n,r){return Object.keys(D).reduce((function(e,i){if(D[i](r)){var o=""+t+a(i),s=o+"Class";n[o]&&(e=P(e,"string"==typeof n[o]?v(n[o]):n[o],r)),r[s]&&(e=P(e,"string"==typeof r[s]?v(r[s]):r[o+"Class"],r))}return e}),e)}(i,s=P(s,t[i+"Class"],t),e.options.classes,t),Object.assign(n,((o={})[i]=s,o))}),{})},pe.prototype.typeProps=function(t){var e=function(t){return Object.keys(t).reduce((function(e,n){return Array.isArray(t[n])?e.concat(t[n]):e}),[])},n=e(this.options.slotProps);return this.options.library[t]?n.concat(e(this.options.library[t].slotProps||{})):n},pe.prototype.slotProps=function(t,e,n){var r=Array.isArray(this.options.slotProps[e])?this.options.slotProps[e]:[],i=this.options.library[t];return i&&i.slotProps&&Array.isArray(i.slotProps[e])&&(r=r.concat(i.slotProps[e])),r.reduce((function(t,e){var r;return Object.assign(t,((r={})[e]=n[e],r))}),{})},pe.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},pe.prototype.slotComponent=function(t,e){var n=this.options.library[t];return n&&n.slotComponents&&n.slotComponents[e]?n.slotComponents[e]:this.options.slotComponents[e]},pe.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},pe.prototype.i18n=function(t){if(t.$i18n)switch(typeof t.$i18n.locale){case"string":return t.$i18n.locale;case"function":return t.$i18n.locale()}return!1},pe.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,n){if(t)return t;if(n){var r=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(n).find((function(t){return p(e.options.locales,t)}));r&&(t=r)}return t}),!1)),this.selectedLocale},pe.prototype.setLocale=function(t){p(this.options.locales,t)&&(this.options.locale=t,this.selectedLocale=t,this.registry.forEach((function(t,e){t.hasValidationErrors()})))},pe.prototype.validationMessage=function(t,e,n){var r=this.options.locales[this.getLocale(n)];return r.hasOwnProperty(t)?r[t](e):r.hasOwnProperty("default")?r.default(e):"Invalid field value"},pe.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},pe.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},pe.prototype.handle=function(t,e,n){void 0===n&&(n=!1);var r=n?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:v(r.formErrors),inputErrors:r.inputErrors||{}}),r},pe.prototype.reset=function(t,e){void 0===e&&(e={}),this.resetValidation(t),this.setValues(t,e)},pe.prototype.submit=function(t){this.registry.get(t).formSubmitted()},pe.prototype.resetValidation=function(t){var e=this.registry.get(t);e.hideErrors(t),e.namedErrors=[],e.namedFieldErrors={}},pe.prototype.setValues=function(t,e){e&&!Array.isArray(e)&&"object"==typeof e&&this.registry.get(t).setValues(Object.assign({},e))},pe.prototype.getUploader=function(){return this.options.uploader||!1},pe.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},pe.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},pe.prototype.createUpload=function(t,e){return new b(t,e,this.options)},pe.prototype.failedValidation=function(t){return this.options.failedValidation(this)};var me=new pe;e.a=me},355:function(t,e,n){"use strict";n.r(e);var r=n(12),o=n(10),l=(n(64),n(19),n(73),n(37),n(30),n(18),n(25),n(8),n(38),n(27),n(40),n(203));function c(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function d(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
2i%2?c(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}e.default={name:"T3Dynamic",props:{layout:{type:Boolean,default:!1},data:{type:[Object,Array],required:!0},type:{type:String,default:"text"},index:{type:Number,default:-1}},methods:{createContentElement:function(){var t=this.type.replace(/_([a-z])/g,(function(g){return g[1].toUpperCase()})),e="t3-ce-".concat(this.type.replace(/_/g,"-")),n="T3Ce".concat(t[0].toUpperCase()+t.slice(1));return this.$root.$options.components[n]||this.$root.$options.components[e]||(e="t3-ce-default"),[e,{props:d(d({},{id:this.data.id,type:this.data.type,appearance:this.data.appearance,index:this.index}),this.data.content)}]},createBackendLayout:function(){return[Object(l.a)(this.type,this.$root.$options.components),{props:{content:this.data}}]}},render:function(t){var e=this.layout?this.createBackendLayout():this.createContentElement(),n=Object(r.a)(e,2),element=t(n[0],n[1]);return this.$nuxt.$typo3.options.debug?t("t3-debug",{props:this.data},[element]):element}}},358:function(t,e,n){(function(t){t.installComponents=function(component,t){var n="function"==typeof component.exports?component.exports.extendOptions:component.options;for(var i in"function"==typeof component.exports&&(n.components=component.exports.options.components),n.components=n.components||{},t)n.components[i]=n.components[i]||t[i];n.functional&&function(component,t){if(component.exports[e])return;component.exports[e]=!0;var n=component.exports.render;component.exports.render=function(e,r){return n(e,Object.assign({},r,{_c:function(e,a,b){return r._c(t[e]||e,a,b)}}))}}(component,n.components)};var e="_functionalComponents"}).call(this,n(108))},490:function(t,e,n){"use strict";var r=n(3),o=n(2),l=n(6),c=n(7),d=n(1),h=n(348),f=(n(482),n(8),n(15),n(10)),m=n(12);n(85),n(30),n(18),n(25),n(38),n(27),n(40);function v(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}var y={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},E="mediachromeattributes",T="mediacontroller",k={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_P
2LAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},S=Object.entries(k),_=S.reduce((function(t,e){var n=Object(m.a)(e,2),r=n[0],o=n[1];return t[r]=o.toLowerCase(),t}),{}),A=S.reduce((function(t,e){var n=Object(m.a)(e,2),r=n[0],o=n[1];return t[r]=o.toLowerCase(),t}),function(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?v(Object(source),!0).forEach((function(e){Object(f.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):v(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}({},{USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"})),O=(Object.entries(A).reduce((function(t,e){var n=Object(m.a)(e,2),r=n[0],o=n[1],l=_[r];return l&&(t[o]=l),t}),{userinactivechange:"userinactive"}),Object.entries(_).reduce((function(t,e){var n=Object(m.a)(e,2),r=n[0],o=n[1],l=A[r];return l&&(t[o]=l),t}),{userinactive:"userinactivechange"})),w={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},I="disabled",R="showing",L="mouse",x="pen",D="touch",C="unavailable",P="unsupported",M={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"},j="fullscreen";n(14),n(67),n(50),n(262),n(39),n(16),n(64),n(198),n(19),n(58),n(37),n(73),n(114),n(199),n(82);function F(t){if(t)return[t.id,t.width,t.height].filter((function(a){return null!=a})).join(":")}function N(t){if(t){var e=t.split(":"),n=Object(m.a)(e,3);return{id:n[0],width:+n[1],height:+n[2]}}}function U(t){if(t)return[t.id,t.kind,t.language,t.label].filter((function(a){return null!=a})).join(":")}function B(t){if(t){var e=t.split(":"),n=Object(m.a)(e,4);return{id:n[0],kind:n[1],language:n[2],label:n[3]}}}function $(t){return t.replace(/[-_]([a-z])/g,(function(t,e){return e.toUpperCase()}))}function V(t){return"number"==typeof t&&!Number.isNaN(t)&&Number.isFinite(t)}function G(t){return"string"==typeof t&&(!isNaN(t)&&!isNaN(parseFloat(t)))}var H,W=function(t){return new Promise((function(e){return setTimeout(e,t)}))},K=(n(163),{en:{"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","S
2ource Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it.",hour:"hour",hours:"hours",minute:"minute",minutes:"minutes",second:"second",seconds:"seconds","{time} remaining":"{time} remaining","{currentTime} of {totalTime}":"{currentTime} of {totalTime}","video not loaded, unknown time.":"video not loaded, unknown time."}}),Y=(null==(H=globalThis.navigator)?void 0:H.language)||"en",z=function(t){var e,n,r,o=Y.split("-"),base=Object(m.a)(o,1)[0];return(null==(e=K[Y])?void 0:e[t])||(null==(n=K[base])?void 0:n[t])||(null==(r=K.en)?void 0:r[t])||t},Q=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return z(t).replace(/\{(\w+)\}/g,(function(t,n){return n in e?String(e[n]):"{".concat(n,"}")}))},X=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Z=function(t){if(!V(t))return"";var e=Math.abs(t),n=e!==t,r=new Date(0,0,0,0,0,e,0),o=[r.getHours(),r.getMinutes(),r.getSeconds()].map((function(t,e){return t&&function(t,e){var n=Q(1===t?X[e].singular:X[e].plural);return"".concat(t," ").concat(n)}(t,e)})).filter((function(t){return t})).join(", ");return n?Q("{time} remaining",{time:o}):o};function J(t,e){var n=!1;t<0&&(n=!0,t=0-t),t=t<0?0:t;
2var s=Math.floor(t%60),r=Math.floor(t/60%60),o=Math.floor(t/3600),l=Math.floor(e/60%60),c=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(o=r=s="0"),(n?"-":"")+(o=o>0||c>0?o+":":"")+(r=((o||l>=10)&&r<10?"0"+r:r)+":")+(s=s<10?"0"+s:s)}Object.freeze({length:0,start:function(t){var e=t>>>0;if(e>=this.length)throw new DOMException("Failed to execute 'start' on 'TimeRanges': The index provided (".concat(e,") is greater than or equal to the maximum bound (").concat(this.length,")."));return 0},end:function(t){var e=t>>>0;if(e>=this.length)throw new DOMException("Failed to execute 'end' on 'TimeRanges': The index provided (".concat(e,") is greater than or equal to the maximum bound (").concat(this.length,")."));return 0}});var tt=n(9),et=n(20),nt=n(0),it=n(4);n(59),n(44),n(45),n(46),n(17),n(233),n(234),n(235),n(236),n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(246),n(33),n(165),n(208),n(42),n(34),n(35),n(31),n(36),n(41),n(330),n(72);function st(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var at=function(){function t(){Object(o.a)(this,t)}return Object(r.a)(t,[{key:"addEventListener",value:function(){}},{key:"removeEventListener",value:function(){}},{key:"dispatchEvent",value:function(){return!0}}]),t}(),ot=function(t){Object(l.a)(n,t);var e=st(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n)}(at),lt=function(t){Object(l.a)(n,t);var e=st(n);function n(){var t;return Object(o.a)(this,n),(t=e.apply(this,arguments)).role=null,t}return Object(r.a)(n)}(ot),ct={createElement:function(){return new ut.HTMLElement},createElementNS:function(){return new ut.HTMLElement},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(t){return!1}},ut={ResizeObserver:function(){function t(){Object(o.a)(this,t)}return Object(r.a)(t,[{key:"observe",value:function(){}},{key:"unobserve",value:function(){}},{key:"disconnect",value:function(){}}]),t}(),document:ct,Node:ot,Element:lt,HTMLElement:function(t){Object(l.a)(n,t);var e=st(n);function n(){var t;return Object(o.a)(this,n),(t=e.apply(this,arguments)).innerHTML="",t}return Object(r.a)(n,[{key:"content",get:function(){return new ut.DocumentFragment}}]),n}(lt),DocumentFragment:function(t){Object(l.a)(n,t);var e=st(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n)}(at),customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem:function(t){return null},setItem:function(t,e){},removeItem:function(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia:function(t){return{matches:!1,media:t}},DOMParser:function(){function t(){Object(o.a)(this,t)}return Object(r.a)(t,[{key:"parseFromString",value:function(t,e){return{body:{textContent:t}}}}]),t}()},ht="global"in globalThis&&(null==globalThis?void 0:globalThis.global)===globalThis||"undefined"==typeof window||void 0===window.customElements,ft=Object.keys(ut).every((function(t){return t in globalThis})),pt=ht&&!ft?ut:globalThis,mt=ht&&!ft?ct:globalThis.document;n(91),n(92),n(93),n(94),n(95),n(96),n(97),n(98),n(99),n(100),n(101),n(102),n(103),n(104),n(105),n(106),n(107);function gt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return vt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}
2var yt=new WeakMap,bt=function(element){var t=yt.get(element);return t||yt.set(element,t=new Set),t},Et=new pt.ResizeObserver((function(t){var e,n=gt(t);try{for(n.s();!(e=n.n()).done;){var r,o=e.value,l=gt(bt(o.target));try{for(l.s();!(r=l.n()).done;){(0,r.value)(o)}}catch(t){l.e(t)}finally{l.f()}}}catch(t){n.e(t)}finally{n.f()}}));function Tt(element,t){bt(element).add(t),Et.observe(element)}function kt(element,t){var e=bt(element);e.delete(t),e.size||Et.unobserve(element)}function St(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return _t(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _t(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function _t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function At(t){var e,n={},r=St(t);try{for(r.s();!(e=r.n()).done;){var o=e.value;n[o.name]=o.value}}catch(t){r.e(t)}finally{r.f()}return n}function Ot(t){var e;return null!=(e=wt(t))?e:xt(t,"media-controller")}function wt(t){var e,n=T,r=t.getAttribute(n);if(r)return null==(e=Ct(t))?void 0:e.getElementById(r)}var It=function(svg,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".value",n=svg.querySelector(e);n&&(n.textContent=t)},Rt=function(t,e){return function(t,e){var n='slot[name="'.concat(e,'"]'),slot=t.shadowRoot.querySelector(n);return slot?slot.children:[]}(t,e)[0]},Lt=function t(e,n){return!(!e||!n)&&(!!(null==e?void 0:e.contains(n))||t(e,n.getRootNode().host))},xt=function t(e,n){if(!e)return null;var r=e.closest(n);return r||t(e.getRootNode().host,n)};function Dt(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=null==e?void 0:e.activeElement;return n?null!=(t=Dt(n.shadowRoot))?t:n:null}function Ct(t){var e,n=null==(e=null==t?void 0:t.getRootNode)?void 0:e.call(t);return n instanceof ShadowRoot||n instanceof Document?n:null}function Pt(element){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.depth,n=void 0===e?3:e,r=t.checkOpacity,o=void 0===r||r,l=t.checkVisibilityCSS,c=void 0===l||l;if(element.checkVisibility)return element.checkVisibility({checkOpacity:o,checkVisibilityCSS:c});for(var d=element;d&&n>0;){var style=getComputedStyle(d);if(o&&"0"===style.opacity||c&&"hidden"===style.visibility||"none"===style.display)return!1;d=d.parentElement,n--}return!0}function Mt(t,e){var n=function(t,e){var n,r,style,o,l=St(null!=(n=t.querySelectorAll("style:not([media])"))?n:[]);try{for(l.s();!(o=l.n()).done;){style=o.value;var c=void 0;try{c=null==(r=style.sheet)?void 0:r.cssRules}catch(t){continue}var d,h=St(null!=c?c:[]);try{for(h.s();!(d=h.n()).done;){var f=d.value;if(e(f.selectorText))return f}}catch(t){h.e(t)}finally{h.f()}}}catch(t){l.e(t)}finally{l.f()}}(t,(function(t){return t===e}));return n||jt(t,e)}function jt(t,e){var n,r,o=null!=(n=t.querySelectorAll("style:not([media])"))?n:[],style=null==o?void 0:o[o.length-1];if(!(null==style?void 0:style.sheet))return console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:function(){},removeProperty:function(){return""},getPropertyValue:function(){return""}}};var l=null==style?void 0:style.sheet.insertRule("".concat(e,"{}"),style.sheet.cssRules.length);return null==(r=style.sheet.cssRules)?void 0:r[l]}function Ft(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,r=t.getAttribute(e);return null!=r?+r:n}function Nt(t,e,n){var r=+n;null==n||Number.isNaN(r)?t.hasAttribute(e)&&t.removeAttribute(e):Ft(t,e,void 0)!==r&&t.setAttribute(e,"".concat(r))}function Ut(t,e){return t.hasAttribute(e)}function Bt(t,e,n){null!=n?Ut(t,e)!=n&&t.toggleAttribute(e,n):t.hasAttribute(e)&&t.removeAttribute(e)}function $t(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return null!=(n=t.getAttribute(e))?n:r}function Vt(t,e,n){if(null!=n){var r="".concat(n);$t(t,e,void 0)!==r&&t.setAttribute(e,r)}else t.hasAttribute(e)&&t.removeAttribute(e)}function Gt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ht,Wt=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Kt=function(t,e,n){return Wt(t,e,"read from private field"),n?n.call(t):e.get(t)},qt=function(t,e,n,r){return Wt(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n};var Yt=function(t){Object(l.a)(n,t);var e=Gt(n);function n(){var t;if(Object(o.a)(this,n),t=e.call(this),function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)}(Object(nt.a)(t),Ht,void 0),!t.shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var r=At(t.attributes);t.shadowRoot.innerHTML=t.constructor.getTemplateHTML(r)}return t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,n){var r,o,l,c,d;t===T&&(e&&(null==(o=null==(r=Kt(this,Ht))?void 0:r.unassociateElement)||o.call(r,this),qt(this,Ht,null)),n&&this.isConnected&&(qt(this,Ht,null==(l=this.getRootNode())?void 0:l.getElementById(n)),null==(d=null==(c=Kt(this,Ht))?void 0:c.associateElement)||d.call(c,this)))}},{key:"connectedCallback",value:function(){var t,e;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),qt(this,Ht,function(t){var e,n=t.getAttribute(T);if(n)return null==(e=t.getRootNode())?void 0:e.getElementById(n);return xt(t,"media-controller")}(this)),this.getAttribute(T)&&(null==(e=null==(t=Kt(this,Ht))?void 0:t.associateElement)||e.call(t,this)),Kt(this,Ht)&&(Kt(this,Ht).addEventListener("pointerdown",this),Kt(this,Ht).addEventListener("click",this),Kt(this,Ht).hasAttribute("tabindex")||(Kt(this,Ht).tabIndex=0))}},{key:"disconnectedCallback",value:function(){var t,e,n,r;this.getAttribute(T)&&(null==(e=null==(t=Kt(this,Ht))?void 0:t.unassociateElement)||e.call(t,this)),null==(n=Kt(this,Ht))||n.removeEventListener("pointerdown",this),null==(r=Kt(this,Ht))||r.removeEventListener("click",this),qt(this,Ht,null)}},{key:"handleEvent",value:function(t){var e,n=null==(e=t.composedPath())?void 0:e[0];if(["video","media-controller"].includes(null==n?void 0:n.localName))if("pointerdown"===t.type)this._pointerType=t.pointerType;else if("click"===t.type){var r=t.clientX,o=t.clientY,l=this.getBoundingClientRect(),c=l.left,d=l.top,h=l.width,f=l.height,m=r-c,v=o-d;if(m<0||v<0||m>h||v>f||0===h&&0===f)return;var y=this._pointerType||"mouse";if(this._pointerType=void 0,y===D)return void this.handleTap(t);if(y===L||y===x)return void this.handleMouseClick(t)}}},{key:"mediaPaused",get:function(){return Ut(this,_.MEDIA_PAUSED)},set:function(t){Bt(this,_.MEDIA_PAUSED,t)}},{key:"handleTap",value:function(t){}}
2,{key:"handleMouseClick",value:function(t){var e=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new pt.CustomEvent(e,{composed:!0,bubbles:!0}))}}],[{key:"observedAttributes",get:function(){return[T,_.MEDIA_PAUSED]}}]),n}(pt.HTMLElement);Ht=new WeakMap,Yt.shadowRootOptions={mode:"open"},Yt.getTemplateHTML=function(t){return"\n <style>\n :host {\n display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));\n box-sizing: border-box;\n }\n </style>\n "},pt.customElements.get("media-gesture-receiver")||pt.customElements.define("media-gesture-receiver",Yt);var zt=Yt;function Qt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function Xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Zt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Jt,te,ee,ne,ie,re,se,ae,oe,le,ce,ue,de,he,fe,pe,me,ge,ve,ye,be=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Ee=function(t,e,n){return be(t,e,"read from private field"),n?n.call(t):e.get(t)},Te=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},ke=function(t,e,n,r){return be(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},Se=function(t,e,n){return be(t,e,"access private method"),n},_e={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};var Ae=Object.values(_);function Oe(t,e){var n;if(t.isConnected){var r=function(t){var e=t.split(/\s+/);return Object.fromEntries(e.map((function(t){return t.split(":")})))}(null!=(n=t.getAttribute(_e.BREAKPOINTS))?n:"sm:384 md:576 lg:768 xl:960"),o=function(t,e){return Object.keys(t).filter((function(n){return e>=parseInt(t[n])}))}(r,e),l=!1;if(Object.keys(r).forEach((function(e){o.includes(e)?t.hasAttribute("breakpoint".concat(e))||(t.setAttribute("breakpoint".concat(e),""),l=!0):t.hasAttribute("breakpoint".concat(e))&&(t.removeAttribute("breakpoint".concat(e)),l=!0)})),l){var c=new CustomEvent(A.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(c)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(A.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}}var we=function(t){Object(l.a)(c,t);var e,n=Zt(c);function c(){var t;if(Object(o.a)(this,c),t=n.call(this),Te(Object(nt.a)(t),oe),Te(Object(nt.a)(t),ce),Te(Object(nt.a)(t),de),Te(Object(nt.a)(t),fe),Te(Object(nt.a)(t),me),Te(Object(nt.a)(t),Jt,void 0),Te(Object(nt.a)(t),te,0),Te(Object(nt.a)(t),ee,null),Te(Object(nt.a)(t),ne,null),Te(Object(nt.a)(t),ie,void 0),t.breakpointsComputed=!1,Te(Object(nt.a)(t),re,(function(e){var n,r=t.media,o=Qt(e);try{for(o.s();!(n=o.n()).done;){var l=n.value;
2if("childList"===l.type){var c,d=Qt(l.removedNodes);try{for(d.s();!(c=d.n()).done;){var h=c.value;if("media"==h.slot&&l.target==Object(nt.a)(t)){var f=l.previousSibling&&l.previousSibling.previousElementSibling;if(f&&r){for(var m="media"!==f.slot;null!==(f=f.previousSibling);)"media"==f.slot&&(m=!1);m&&t.mediaUnsetCallback(h)}else t.mediaUnsetCallback(h)}}}catch(t){d.e(t)}finally{d.f()}if(r){var v,y=Qt(l.addedNodes);try{for(y.s();!(v=y.n()).done;){v.value===r&&t.handleMediaUpdated(r)}}catch(t){y.e(t)}finally{y.f()}}}}}catch(t){o.e(t)}finally{o.f()}})),Te(Object(nt.a)(t),se,!1),Te(Object(nt.a)(t),ae,(function(e){Ee(Object(nt.a)(t),se)||(setTimeout((function(){!function(t){Oe(t.target,t.contentRect.width)}(e),ke(Object(nt.a)(t),se,!1)}),0),ke(Object(nt.a)(t),se,!0))})),Te(Object(nt.a)(t),ve,void 0),Te(Object(nt.a)(t),ye,(function(){Ee(Object(nt.a)(t),ve).assignedElements({flatten:!0}).length?t.handleMediaUpdated(t.media):Ee(Object(nt.a)(t),ee)&&t.mediaUnsetCallback(Ee(Object(nt.a)(t),ee))})),!t.shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var e=At(t.attributes),html=t.constructor.getTemplateHTML(e);t.shadowRoot.setHTMLUnsafe?t.shadowRoot.setHTMLUnsafe(html):t.shadowRoot.innerHTML=html}return ke(Object(nt.a)(t),Jt,new MutationObserver(Ee(Object(nt.a)(t),re))),t}return Object(r.a)(c,[{key:"attributeChangedCallback",value:function(t,e,n){t.toLowerCase()==_e.AUTOHIDE&&(this.autohide=n)}},{key:"media",get:function(){var t=this.querySelector(":scope > [slot=media]");return"SLOT"==(null==t?void 0:t.nodeName)&&(t=t.assignedElements({flatten:!0})[0]),t}},{key:"handleMediaUpdated",value:(e=Object(et.a)(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return");case 2:if(ke(this,ee,e),!e.localName.includes("-")){t.next=6;break}return t.next=6,pt.customElements.whenDefined(e.localName);case 6:this.mediaSetCallback(e);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"connectedCallback",value:function(){var t;Ee(this,Jt).observe(this,{childList:!0,subtree:!0}),Tt(this,Ee(this,ae));var e=null!=this.getAttribute(_e.AUDIO),label=Q(e?"audio player":"video player");this.setAttribute("role","region"),this.setAttribute("aria-label",label),this.handleMediaUpdated(this.media),this.setAttribute(_e.USER_INACTIVE,""),Oe(this,this.getBoundingClientRect().width);var n=this.querySelector(":scope > slot[slot=media]");n&&(ke(this,ve,n),Ee(this,ve).addEventListener("slotchange",Ee(this,ye))),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),null==(t=pt.window)||t.addEventListener("mouseup",this)}},{key:"disconnectedCallback",value:function(){var t;kt(this,Ee(this,ae)),clearTimeout(Ee(this,ne)),Ee(this,Jt).disconnect(),this.media&&this.mediaUnsetCallback(this.media),null==(t=pt.window)||t.removeEventListener("mouseup",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointermove",this),this.removeEventListener("pointerup",this),this.removeEventListener("mouseleave",this),this.removeEventListener("keyup",this),Ee(this,ve)&&(Ee(this,ve).removeEventListener("slotchange",Ee(this,ye)),ke(this,ve,null)),ke(this,se,!1)}},{key:"mediaSetCallback",value:function(t){}},{key:"mediaUnsetCallback",value:function(t){ke(this,ee,null)}},{key:"handleEvent",value:function(t){switch(t.type){case"pointerdown":ke(this,te,t.timeStamp);break;case"pointermove":Se(this,oe,le).call(this,t);break;case"pointerup":Se(this,ce,ue).call(this,t);break;case"mouseleave":Se(this,de,he).call(this);break;case"mouseup":this.removeAttribute(_e.KEYBOARD_CONTROL);break;case"keyup":Se(this,me,ge).call(this),this.setAttribute(_e.KEYBOARD_CONTROL,"")}}},{key:"autohide",get:function(){return(void 0===Ee(this,ie)?2:Ee(this,ie)).toString()},set:function(t){var e=Number(t);ke(this,ie,isNaN(e)?0:e)}},{key:"breakpoints",get:function(){return $t(this,_e.BREAKPOINTS)},set:function(t){Vt(this,_e.BREAKPOINTS,t)}},{key:"audio",get:function(){return Ut(this,_e.AUDIO)},set:function(t){Bt(this,_e.AUDIO,t)}},{key:"gesturesDisabled",get:function(){return Ut(this,_e.GESTURES_DISABLED)},set:function(t){Bt(this,_e.GESTURES_DISABLED,t)}},{key:"keyboardControl",get:function(){return Ut(this,_e.KEYBOARD_CONTROL)},set:function(t){Bt(this,_e.KEYBOARD_CONTROL,t)}},{key:"noAutohide",get:function(){return Ut(this,_e.NO_AUTOHIDE)},set:function(t){Bt(this,_e.NO_AUTOHIDE,t)}},{key:"autohideOverControls",get:function(){return Ut(this,_e.AUTOHIDE_OVER_CONTROLS)},set:function(t){Bt(this,_e.AUTOHIDE_OVER_CONTROLS,t)}},{key:"userInteractive",get:function(){return Ut(this,_e.USER_INACTIVE)},set:function(t){Bt(this,_e.USER_INACTIVE,t)}}],[{key:"observedAttributes",get:function(){return[_e.AUTOHIDE,_e.GESTURES_DISABLED].concat(Ae).filter((function(t){return![_.MEDIA_RENDITION_LIST,_.MEDIA_AUDIO_TRACK_LIST,_.MEDIA_CHAPTERS_CUES,_.MEDIA_WIDTH,_.MEDIA_HEIGHT,_.MEDIA_ERROR,_.MEDIA_ERROR_MESSAGE].includes(t)}))}}]),c}(pt.HTMLElement);Jt=new WeakMap,te=new WeakMap,ee=new WeakMap,ne=new WeakMap,ie=new WeakMap,re=new WeakMap,se=new WeakMap,ae=new WeakMap,oe=new WeakSet,le=function(t){if("mouse"!==t.pointerType){if(t.timeStamp-Ee(this,te)<250)return}Se(this,fe,pe).call(this),clearTimeout(Ee(this,ne));var e=this.hasAttribute(_e.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&Se(this,me,ge).call(this)},ce=new WeakSet,ue=function(t){if("touch"===t.pointerType){var e=!this.hasAttribute(_e.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Se(this,de,he).call(this):Se(this,me,ge).call(this)}else t.composedPath().some((function(t){return["media-play-button","media-fullscreen-button"].includes(null==t?void 0:t.localName)}))&&Se(this,me,ge).call(this)},de=new WeakSet,he=function(){if(!(Ee(this,ie)<0||this.hasAttribute(_e.USER_INACTIVE))){this.setAttribute(_e.USER_INACTIVE,"");var t=new pt.CustomEvent(A.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)}},fe=new WeakSet,pe=function(){if(this.hasAttribute(_e.USER_INACTIVE)){this.removeAttribute(_e.USER_INACTIVE);var t=new pt.CustomEvent(A.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)}},me=new WeakSet,ge=function(){var t=this;Se(this,fe,pe).call(this),clearTimeout(Ee(this,ne));var e=parseInt(this.autohide);e<0||ke(this,ne,setTimeout((function(){Se(t,de,he).call(t)}),1e3*e))},ve=new WeakMap,ye=new WeakMap,we.shadowRootOptions={mode:"open"},we.getTemplateHTML=function(t){return"\n <style>\n ".concat("\n :host([",_.MEDIA_IS_FULLSCREEN,"]) ::slotted([slot=media]) {\n outline: none;\n }\n\n :host {\n box-sizing: border-box;\n position: relative;\n display: inline-block;\n line-height: 0;\n background-color: var(--media-background-color, #000);\n overflow: hidden;\n }\n\n :host(:not([").concat(_e.AUDIO,"])) [part~=layer]:not([part~=media-layer]) {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n display: flex;\n flex-flow: column nowrap;\n align-items: start;\n pointer-events: none;\n background: none;\n }\n\n slot[name=media] {\n display: var(--media-slot-display, contents);\n }\n\n ","\n :host([").concat(_e.AUDIO,"]) slot[name=media] {\n display: var(--media-slot-display, none);\n }\n\n ","\n :host([").concat(_e.AUDIO,"]) [part~=layer][part~=gesture-layer] {\n height: 0;\n display: block;\n }\n\n ","\n :host(:not([").concat(_e.AUDIO,"])[").concat(_e.GESTURES_DISABLED,"]) ::slotted([slot=gestures-chrome]),\n :host(:not([").concat(_e.AUDIO,"])[").concat(_e.GESTURES_DISABLED,"]) media-gesture-receiver[slot=gestures-chrome] {\n display: none;\n }\n\n ","\n ::slotted(:not([slot=media]):not([slot=poster]):not(media-loading-indicator):not([role=dialog]):not([hidden])) {\n pointer-events: auto;\n }\n\n :host(:not([").concat(_e.AUDIO,"])) *[part~=layer][part~=centered-layer] {\n align-items: center;\n justify-content: center;\n }\n\n :host(:not([").concat(_e.AUDIO,"])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),\n :host(:not([").concat(_e.AUDIO,"])) media-gesture-receiver[slot=gestures-chrome] {\n align-self: stretch;\n flex-grow: 1;\n }\n\n slot[name=middle-chrome] {\n display: inline;\n flex-grow: 1;\n pointer-events: none;\n background: none;\n }\n\n ","\n ::slotted([slot=media]),\n ::slotted([slot=poster]) {\n width: 100%;\n height: 100%;\n }\n\n ","\n :host(:not([").concat(_e.AUDIO,"])) .spacer {\n flex-grow: 1;\n }\n\n ","\n :host(:-webkit-full-screen) {\n ","\n width: 100% !important;\n height: 100% !important;\n }\n\n ","\n ::slotted(:not([slot=media]):not([slot=poster]):not([").concat(_e.NO_AUTOHIDE,"]):not([hidden]):not([role=dialog])) {\n opacity: 1;\n transition: var(--media-control-transition-in, opacity 0.25s);\n }\n\n ","\n :host([").concat(_e.USER_INACTIVE,"]:not([").concat(_.MEDIA_PAUSED,"]):not([").concat(_.MEDIA_IS_AIRPLAYING,"]):not([").concat(_.MEDIA_IS_CASTING,"]):not([").concat(_e.AUDIO,"])) ::slotted(:not([slot=media]):not([slot=poster]):not([").concat(_e.NO_AUTOHIDE,"]):not([role=dialog])) {\n opacity: 0;\n transition: var(--media-control-transition-out, opacity 1s);\n }\n\n :host([").concat(_e.USER_INACTIVE,"]:not([").concat(_e.NO_AUTOHIDE,"]):not([").concat(_.MEDIA_PAUSED,"]):not([").concat(_.MEDIA_IS_CASTING,"]):not([").concat(_e.AUDIO,"])) ::slotted([slot=media]) {\n cursor: n
2one;\n }\n\n :host([").concat(_e.USER_INACTIVE,"][").concat(_e.AUTOHIDE_OVER_CONTROLS,"]:not([").concat(_e.NO_AUTOHIDE,"]):not([").concat(_.MEDIA_PAUSED,"]):not([").concat(_.MEDIA_IS_CASTING,"]):not([").concat(_e.AUDIO,"])) * {\n --media-cursor: none;\n cursor: none;\n }\n\n\n ::slotted(media-control-bar) {\n align-self: stretch;\n }\n\n ","\n :host(:not([").concat(_e.AUDIO,"])[").concat(_.MEDIA_HAS_PLAYED,']) slot[name=poster] {\n display: none;\n }\n\n ::slotted([role=dialog]) {\n width: 100%;\n height: 100%;\n align-self: center;\n }\n\n ::slotted([role=menu]) {\n align-self: end;\n }\n </style>\n\n <slot name="media" part="layer media-layer"></slot>\n <slot name="poster" part="layer poster-layer"></slot>\n <slot name="gestures-chrome" part="layer gesture-layer">\n <media-gesture-receiver slot="gestures-chrome">\n <template shadowrootmode="').concat(zt.shadowRootOptions.mode,'">\n ').concat(zt.getTemplateHTML({}),'\n </template>\n </media-gesture-receiver>\n </slot>\n <span part="layer vertical-layer">\n <slot name="top-chrome" part="top chrome"></slot>\n <slot name="middle-chrome" part="middle chrome"></slot>\n <slot name="centered-chrome" part="layer centered-layer center centered chrome"></slot>\n ','\n <slot part="bottom chrome"></slot>\n </span>\n <slot name="dialog" part="layer dialog-layer"></slot>\n ')},pt.customElements.get("media-container")||pt.customElements.define("media-container",we);var Ie,Re,Le,xe,De,Ce,Pe=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Me=function(t,e,n){return Pe(t,e,"read from private field"),n?n.call(t):e.get(t)},je=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Fe=function(t,e,n,r){return Pe(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},Ne=function(t){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{defaultValue:void 0},l=r.defaultValue;Object(o.a)(this,e),je(this,De),je(this,Ie,void 0),je(this,Re,void 0),je(this,Le,void 0),je(this,xe,new Set),Fe(this,Ie,t),Fe(this,Re,n),Fe(this,Le,new Set(l))}return Object(r.a)(e,[{key:t,value:function(){return Me(this,De,Ce).values()}},{key:"length",get:function(){return Me(this,De,Ce).size}},{key:"value",get:function(){var t;return null!=(t=Object(tt.a)(Me(this,De,Ce)).join(" "))?t:""}},{key:"value",set:function(t){var e;t!==this.value&&(Fe(this,xe,new Set),this.add.apply(this,Object(tt.a)(null!=(e=null==t?void 0:t.split(" "))?e:[])))}},{key:"toString",value:function(){return this.value}},{key:"item",value:function(t){return Object(tt.a)(Me(this,De,Ce))[t]}},{key:"values",value:function(){return Me(this,De,Ce).values()}},{key:"forEach",value:function(t,e){Me(this,De,Ce).forEach(t,e)}},{key:"add",value:function(){for(var t,e,n=this,r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];o.forEach((function(t){return Me(n,xe).add(t)})),(""!==this.value||(null==(t=Me(this,Ie))?void 0:t.hasAttribute("".concat(Me(this,Re)))))&&(null==(e=Me(this,Ie))||e.setAttribute("".concat(Me(this,Re)),"".concat(this.value)))}},{key:"remove",value:function(){for(var t,e=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];r.forEach((function(t){return Me(e,xe).delete(t)})),null==(t=Me(this,Ie))||t.setAttribute("".concat(Me(this,Re)),"".concat(this.value))}},{key:"contains",value:function(t){return Me(this,De,Ce).has(t)}},{key:"toggle",value:function(t,e){return void 0!==e?e?(this.add(t),!0):(this.remove(t),!1):this.contains(t)?(this.remove(t),!1):(this.add(t),!0)}},{key:"replace",value:function(t,e){return this.remove(t),this.add(e),t===e}}]),e}(Symbol.iterator);function Ue(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function Be(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
2i%2?Ue(Object(source),!0).forEach((function(e){Object(f.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):Ue(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}Ie=new WeakMap,Re=new WeakMap,Le=new WeakMap,xe=new WeakMap,De=new WeakSet,Ce=function(){return Me(this,xe).size?Me(this,xe):Me(this,Le)};var $e,Ve=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(/\s+/)},Ge=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t.split(":"),n=Object(m.a)(e,3),r=n[0],o=n[1],l=n[2],label=l?decodeURIComponent(l):void 0;return{kind:"cc"===r?w.CAPTIONS:w.SUBTITLES,language:o,label:label}},He=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ve(t).map((function(t){var n=Ge(t);return Be(Be({},e),n)}))},We=function(t){return t?Array.isArray(t)?t.map((function(t){return"string"==typeof t?Ge(t):t})):"string"==typeof t?He(t):[t]:[]},Ke=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{kind:"subtitles"},e=t.kind,label=t.label,n=t.language;return label?"".concat("captions"===e?"cc":"sb",":").concat(n,":").concat(encodeURIComponent(label)):n},qe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.prototype.map.call(t,Ke).join(" ")},Ye=function(t){var e=Object.entries(t).map((function(t){var e=Object(m.a)(t,2);return function(t,e){return function(n){return n[t]===e}}(e[0],e[1])}));return function(t){return e.every((function(e){return e(t)}))}},ze=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=We(n).map(Ye),o=function(t){return r.some((function(e){return e(t)}))};Array.from(e).filter(o).forEach((function(e){e.mode=t}))},Qe=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};if(!(null==t?void 0:t.textTracks))return[];var n="function"==typeof e?e:Ye(e);return Array.from(t.textTracks).filter(n)},Xe=function(t){var e;return!!(null==(e=t.mediaSubtitlesShowing)?void 0:e.length)||t.hasAttribute(_.MEDIA_SUBTITLES_SHOWING)},Ze=(n(139),n(61),"exitFullscreen"in mt?"exitFullscreen":"webkitExitFullscreen"in mt?"webkitExitFullscreen":"webkitCancelFullScreen"in mt?"webkitCancelFullScreen":void 0),Je="fullscreenElement"in mt?"fullscreenElement":"webkitFullscreenElement"in mt?"webkitFullscreenElement":void 0,tn=function(t){var e,n=t.media,r=t.documentElement,o=t.fullscreenElement,l=void 0===o?n:o;if(!n||!r)return!1;var c=function(t){var e=t.documentElement,n=t.media,r=null==e?void 0:e[Je];return!r&&"webkitDisplayingFullscreen"in n&&"webkitPresentationMode"in n&&n.webkitDisplayingFullscreen&&n.webkitPresentationMode===j?n:r}(t);if(!c)return!1;if(c===l||c===n)return!0;if(c.localName.includes("-")){var d=c.shadowRoot;if(!(Je in d))return Lt(c,l);for(;null==d?void 0:d[Je];){if(d[Je]===l)return!0;d=null==(e=d[Je])?void 0:e.shadowRoot}}return!1},en="fullscreenEnabled"in mt?"fullscreenEnabled":"webkitFullscreenEnabled"in mt?"webkitFullscreenEnabled":void 0,nn=function(t){var e=t.documentElement,n=t.media;return!!(null==e?void 0:e[en])||n&&"webkitSupportsFullscreen"in n},rn=function(){var t,e;return $e||($e=null==(e=null==(t=mt)?void 0:t.createElement)?void 0:e.call(t,"video"))},sn=function(){var t=Object(et.a)(regeneratorRuntime.mark((function t(){var e,n,r,o,l=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]?l[0]:rn()){t.next=3;break}return t.abrupt("return",!1);case 3:return n=e.volume,e.volume=n/2+.1,r=new AbortController,t.next=8,Promise.race([an(e,r.signal),on(e,n)]);case 8:return o=t.sent,r.abort(),t.abrupt("return",o);case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),an=function(t,e){return new Promise((function(n){t.addEventListener("volumechange",(function(){return n(!0)}),{signal:e})}))},on=function(){var t=Object(et.a)(regeneratorRuntime.mark((function t(e,n){var i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=0;case 1:if(!(i<10)){t.next=9;break}if(e.volume!==n){t.next=4;break}return t.abrupt("return",!1);case 4:return t.next=6,W(10);case 6:i++,t.next=1;break;case 9:return t.abrupt("return",e.volume!==n);case 10:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),ln=/.*Version\/.*Safari\/.*/.test(pt.navigator.userAgent),cn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rn();return(!pt.matchMedia("(display-mode: standalone)").matches||!ln)&&"function"==typeof(null==t?void 0:t.requestPictureInPicture)},un=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rn();return nn({documentElement:mt,media:t})},dn=un(),hn=cn(),fn=!!pt.WebKitPlaybackTargetAvailabilityEvent,pn=!!pt.chrome,mn=n(56),gn=(n(138),n(122),function(t){return Qe(t.media,(function(t){return[w.SUBTITLES,w.CAPTIONS].includes(t.kind)})).sort((function(a,b){return a.kind>=b.kind?1:-1}))}),vn=function(t){return Qe(t.media,(function(t){return t.mode===R&&[w.SUBTITLES,w.CAPTIONS].includes(t.kind)}))},yn=function(t,e){var n=gn(t),r=vn(t),o=!!r.length;if(n.length)if(!1===e||o&&!0!==e)ze(I,n,r);else if(!0===e||!o&&!1!==e){var l=n[0],c=t.options;if(!(null==c?void 0:c.noSubtitlesLangPref)){var d=pt.localStorage.getItem("media-chrome-pref-subtitles-lang"),h=d?[d].concat(Object(tt.a)(pt.navigator.languages)
2):pt.navigator.languages,f=n.filter((function(t){return h.some((function(e){return t.language.toLowerCase().startsWith(e.split("-")[0])}))})).sort((function(t,e){return h.findIndex((function(e){return t.language.toLowerCase().startsWith(e.split("-")[0])}))-h.findIndex((function(t){return e.language.toLowerCase().startsWith(t.split("-")[0])}))}));f[0]&&(l=f[0])}var m=l,v=m.language,label=m.label,y=m.kind;ze(I,n,r),ze(R,n,[{language:v,label:label,kind:y}])}},bn=function t(e,n){return e===n||null!=e&&null!=n&&(Object(mn.a)(e)===Object(mn.a)(n)&&(!("number"!=typeof e||!Number.isNaN(e)||!Number.isNaN(n))||"object"===Object(mn.a)(e)&&(Array.isArray(e)?En(e,n):Object.entries(e).every((function(e){var r=Object(m.a)(e,2),o=r[0],l=r[1];return o in n&&t(l,n[o])})))))},En=function(t,e){var n=Array.isArray(t),r=Array.isArray(e);return n===r&&(!n&&!r||t.length===e.length&&t.every((function(t,i){return bn(t,e[i])})))};function Tn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return kn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function kn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Sn(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}var _n,An,On=Object.values(M),wn=sn().then((function(t){return _n=t})),In=function(){var t=Object(et.a)(regeneratorRuntime.mark((function t(){var e,n,r,o=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=o.length,n=new Array(e),r=0;r<e;r++)n[r]=o[r];return t.next=3,Promise.all(n.filter((function(t){return t})).map(function(){var t=Object(et.a)(regeneratorRuntime.mark((function t(e){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("localName"in e&&e instanceof pt.HTMLElement){t.next=2;break}return t.abrupt("return");case 2:if((n=e.localName).includes("-")){t.next=5;break}return t.abrupt("return");case 5:if(!((r=pt.customElements.get(n))&&e instanceof r)){t.next=8;break}return t.abrupt("return");case 8:return t.next=10,pt.customElements.whenDefined(n);case 10:pt.customElements.upgrade(e);case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Rn=new pt.DOMParser,Ln=function(text){return text&&Rn.parseFromString(text,"text/html").body.textContent||text},xn={mediaError:{get:function(t,e){var n=t.media;if("playing"!==(null==e?void 0:e.type))return null==n?void 0:n.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get:function(t,e){var n,r=t.media;if("playing"!==(null==e?void 0:e.type))return null==(n=null==r?void 0:r.error)?void 0:n.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get:function(t,e){var n,r,o=t.media;if("playing"!==(null==e?void 0:e.type))return null!=(r=null==(n=null==o?void 0:o.error)?void 0:n.message)?r:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get:function(t){var e,n=t.media;return null!=(e=null==n?void 0:n.videoWidth)?e:0},mediaEvents:["resize"]},mediaHeight:{get:function(t){var e,n=t.media;return null!=(e=null==n?void 0:n.videoHeight)?e:0},mediaEvents:["resize"]},mediaPaused:{get:function(t){var e,n=t.media;return null==(e=null==n?void 0:n.paused)||e},set:function(t,e){var n,r=e.media;r&&(t?r.pause():null==(n=r.play())||n.catch((function(){})))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get:function(t,e){var n=t.media;return!!n&&(e?"playing"===e.type:!n.paused)},mediaEvents:["playing","emptied"]},mediaEnded:{get:function(t){var e,n=t.media;return null!=(e=null==n?void 0:n.ended)&&e},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get:function(t){var e,n=t.media;return null!=(e=null==n?void 0:n.playbackRate)?e:1}
2,set:function(t,e){var n=e.media;n&&Number.isFinite(+t)&&(n.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get:function(t){var e,n=t.media;return null!=(e=null==n?void 0:n.muted)&&e},set:function(t,e){var n=e.media,r=e.options,o=(r=void 0===r?{}:r).noMutedPref;if(n){n.muted=t;try{var l=null!==pt.localStorage.getItem("media-chrome-pref-muted"),c=n.hasAttribute("muted");if(o)return void(l&&pt.localStorage.removeItem("media-chrome-pref-muted"));if(c&&!l)return;pt.localStorage.setItem("media-chrome-pref-muted",t?"true":"false")}catch(t){console.debug("Error setting muted pref",t)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[function(t,e){var n=e.options.noMutedPref,r=e.media;if(r&&!r.muted&&!n)try{var o="true"===pt.localStorage.getItem("media-chrome-pref-muted");xn.mediaMuted.set(o,e),t(o)}catch(t){console.debug("Error getting muted pref",t)}}]},mediaLoop:{get:function(t){var e=t.media;return null==e?void 0:e.loop},set:function(t,e){var n=e.media;n&&(n.loop=t)},mediaEvents:["medialooprequest"]},mediaVolume:{get:function(t){var e,n=t.media;return null!=(e=null==n?void 0:n.volume)?e:1}
2,set:function(t,e){var n=e.media,r=e.options,o=(r=void 0===r?{}:r).noVolumePref;if(n){try{null==t?pt.localStorage.removeItem("media-chrome-pref-volume"):n.hasAttribute("muted")||o||pt.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch(t){console.debug("Error setting volume pref",t)}Number.isFinite(+t)&&(n.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[function(t,e){if(!e.options.noVolumePref)try{if(!e.media)return;var n=pt.localStorage.getItem("media-chrome-pref-volume");if(null==n)return;xn.mediaVolume.set(+n,e),t(+n)}catch(t){console.debug("Error getting volume pref",t)}}]},mediaVolumeLevel:{get:function(t){var e=t.media;return void 0===(null==e?void 0:e.volume)?"high":e.muted||0===e.volume?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get:function(t){var e,n=t.media;return null!=(e=null==n?void 0:n.currentTime)?e:0},set:function(t,e){var n=e.media;n&&V(t)&&(n.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get:function(t){var e=t.media,n=t.options,r=(n=void 0===n?{}:n).defaultDuration;return!r||e&&e.duration&&!Number.isNaN(e.duration)&&Number.isFinite(e.duration)?Number.isFinite(null==e?void 0:e.duration)?e.duration:Number.NaN:r},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get:function(t){var e=t.media;return(null==e?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get:function(t){var e,n=t.media;if(null==(e=null==n?void 0:n.seekable)?void 0:e.length){var r=n.seekable.start(0),o=n.seekable.end(n.seekable.length-1);if(r||o)return[Number(r.toFixed(3)),Number(o.toFixed(3))]}},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get:function(t){var e,n=t.media,r=null!=(e=null==n?void 0:n.buffered)?e:[];return Array.from(r).map((function(t,i){return[Number(r.start(i).toFixed(3)),Number(r.end(i).toFixed(3))]}))},mediaEvents:["progress","emptied"]},mediaStreamType:{get:function(t){var e=t.media,n=t.options,r=(n=void 0===n?{}:n).defaultStreamType,o=[M.LIVE,M.ON_DEMAND].includes(r)?r:void 0;if(!e)return o;var l=e.streamType;if(On.includes(l))return l===M.UNKNOWN?o:l;var c=e.duration;return c===1/0?M.LIVE:Number.isFinite(c)?M.ON_DEMAND:o},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get:function(t){var e=t.media;if(!e)return Number.NaN;var n=e.targetLiveWindow,r=xn.mediaStreamType.get(t);return null!=n&&!Number.isNaN(n)||r!==M.LIVE?n:0},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get:function(t){var e=t.media,n=t.options,r=(n=void 0===n?{}:n).liveEdgeOffset,o=void 0===r?10:r;if(!e)return!1;if("number"==typeof e.liveEdgeStart)return!Number.isNaN(e.liveEdgeStart)&&e.currentTime>=e.liveEdgeStart;if(!(xn.mediaStreamType.get(t)===M.LIVE))return!1;var l=e.seekable;if(!l)return!0;if(!l.length)return!1;var c=l.end(l.length-1)-o;return e.currentTime>=c},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get:function(t){return gn(t).map((function(t){return{kind:t.kind,label:t.label,language:t.language}}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get:function(t){return vn(t).map((function(t){return{kind:t.kind,label:t.label,language:t.language}}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[function(t,e){var n,r,o=e.media,l=e.options;if(o){var c=function(t){var n;l.defaultSubtitles&&(t&&![w.CAPTIONS,w.SUBTITLES].includes(null==(n=null==t?void 0:t.track)?void 0:n.kind)||yn(e,!0))};return o.addEventListener("loadstart",c),null==(n=o.textTracks)||n.addEventListener("addtrack",c),null==(r=o.textTracks)||r.addEventListener("removetrack",c),function(){var t,e;o.removeEventListener("loadstart",c),null==(t=o.textTracks)||t.removeEventListener("addtrack",c),null==(e=o.textTracks)||e.removeEventListener("removetrack",c)}}}]},mediaChaptersCues:{get:function(t){var e,n=t.media;if(!n)return[];var r=Qe(n,{kind:w.CHAPTERS}),o=Object(m.a)(r,1)[0];return Array.from(null!=(e=null==o?void 0:o.cues)?e:[]).map((function(t){var text=t.text,e=t.startTime,n=t.endTime;return{text:Ln(text),startTime:e,endTime:n}}
2))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[function(t,e){var n,r=e.media;if(r){var o=r.querySelector('track[kind="chapters"][default][src]'),l=null==(n=r.shadowRoot)?void 0:n.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return null==o||o.addEventListener("load",t),null==l||l.addEventListener("load",t),function(){null==o||o.removeEventListener("load",t),null==l||l.removeEventListener("load",t)}}}]},mediaIsPip:{get:function(t){var e,n,r=t.media,o=t.documentElement;if(!r||!o)return!1;if(!o.pictureInPictureElement)return!1;if(o.pictureInPictureElement===r)return!0;if(o.pictureInPictureElement instanceof HTMLMediaElement)return!!(null==(e=r.localName)?void 0:e.includes("-"))&&Lt(r,o.pictureInPictureElement);if(o.pictureInPictureElement.localName.includes("-"))for(var l=o.pictureInPictureElement.shadowRoot;null==l?void 0:l.pictureInPictureElement;){if(l.pictureInPictureElement===r)return!0;l=null==(n=l.pictureInPictureElement)?void 0:n.shadowRoot}return!1},set:function(t,e){var n=e.media;if(n)if(t){if(!mt.pictureInPictureEnabled)return void console.warn("MediaChrome: Picture-in-picture is not enabled");if(!n.requestPictureInPicture)return void console.warn("MediaChrome: The current media does not support picture-in-picture");var r=function(){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};n.requestPictureInPicture().catch((function(t){if(11!==t.code)throw t;if(n.src){if(0!==n.readyState||"none"!==n.preload)throw t;var e=function(){n.removeEventListener("loadedmetadata",o),n.preload="none"},o=function(){n.requestPictureInPicture().catch(r),e()};n.addEventListener("loadedmetadata",o),n.preload="metadata",setTimeout((function(){0===n.readyState&&r(),e()}),1e3)}else console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.")}))}else mt.pictureInPictureElement&&mt.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get:function(t){var e,n=t.media;return Object(tt.a)(null!=(e=null==n?void 0:n.videoRenditions)?e:[]).map((function(t){return function(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Sn(Object(source),!0).forEach((function(e){Object(f.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):Sn(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}({},t)}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get:function(t){var e,n,r,o=t.media;return null==(r=null==(n=null==o?void 0:o.videoRenditions)?void 0:n[null==(e=o.videoRenditions)?void 0:e.selectedIndex])?void 0:r.id},set:function(t,e){var n=e.media;if(null==n?void 0:n.videoRenditions){var r=t,o=Array.prototype.findIndex.call(n.videoRenditions,(function(t){return t.id==r}));n.videoRenditions.selectedIndex!=o&&(n.videoRenditions.selectedIndex=o)}else console.warn("MediaController: Rendition selection not supported by this media.")},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get:function(t){var e,n=t.media;return Object(tt.a)(null!=(e=null==n?void 0:n.audioTracks)?e:[])},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get:function(t){var e,n,r=t.media;return null==(n=Object(tt.a)(null!=(e=null==r?void 0:r.audioTracks)?e:[]).find((function(t){return t.enabled})))?void 0:n.id},set:function(t,e){var n=e.media;if(null==n?void 0:n.audioTracks){var r,o=t,l=Tn(n.audioTracks);try{for(l.s();!(r=l.n()).done;){var track=r.value;track.enabled=o==track.id}}catch(t){l.e(t)}finally{l.f()}}else console.warn("MediaChrome: Audio track selection not supported by this media.")},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get:function(t){return tn(t)},set:function(t,e,n){var r,o;t?(!function(t){var e,n=t.media,r=t.fullscreenElement;try{var o=r&&"requestFullscreen"in r?"requestFullscreen":r&&"webkitRequestFullScreen"in r?"webkitRequestFullScreen":void 0;if(o){var l=null==(e=r[o])?void 0:e.call(r);if(l instanceof Promise)l.catch((function(){}))}else(null==n?void 0:n.webkitEnterFullscreen)?n.webkitEnterFullscreen():(null==n?void 0:n.requestFullscreen)&&n.requestFullscreen()}catch(t){console.error(t)}}(e),n.detail&&!(null==(r=e.media)?void 0:r.inert)&&(null==(o=e.media)||o.focus())):function(t){var e,n=t.documentElement;if(Ze){var r=null==(e=null==n?void 0:n[Ze])?void 0:e.call(n);if(r instanceof Promise)r.catch((function(){}))}}(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get:function(t){var e,n=t.media;return!(!(null==n?void 0:n.remote)||"disconnected"===(null==(e=n.remote)?void 0:e.state))&&"connected"===n.remote.state},set:function(t,e){var n,r,o=e.media;o&&(t&&"disconnected"!==(null==(n=o.remote)?void 0:n.state)||(t||"connected"===(null==(r=o.remote)?void 0:r.state))&&("function"==typeof o.remote.prompt?o.remote.prompt().catch((function(){})):console.warn("MediaChrome: Casting is not supported in this environment")))},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get:function(){return!1},set:function(t,e){var n=e.media;n&&(n.webkitShowPlaybackTargetPicker&&pt.WebKitPlaybackTargetAvailabilityEvent?n.webkitShowPlaybackTargetPicker():console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment"))},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get:function(t){var e=t.media;if(!dn||!un(e))return P}},mediaPipUnavailable:{get:function(t){var e=t.media;return hn&&cn(e)?(null==e?void 0:e.disablePictureInPicture)?C:void 0:P}},mediaVolumeUnavailable:{get:function(t){var e=t.media;if(!1===_n||null==(null==e?void 0:e.volume))return P},stateOwnersUpdateHandlers:[function(t){null==_n&&wn.then((function(e){return t(e?void 0:P)}))}]},mediaCastUnavailable:{get:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.availability,o=void 0===r?"not-available":r,l=t.media;return pn&&(null==(e=null==l?void 0:l.remote)?void 0:e.state)?null!=o&&"available"!==o?C:void 0:P},stateOwnersUpdateHandlers:[function(t,e){var n,r=e.media;if(r)return r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||null==(n=null==r?void 0:r.remote)||n.watchAvailability((function(e){t({availability:e?"available":"not-available"})})).catch((function(e){"NotSupportedError"===e.name?t({availability:null}):t({availability:"not-available"})})),function(){var t;null==(t=null==r?void 0:r.remote)||t.cancelWatchAvailability().catch((function(){}))}}]},mediaAirplayUnavailable:{get:function(t,e){return fn?"not-available"===(null==e?void 0:e.availability)?C:void 0:P},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[function(t,e){var n,r=e.media;if(r)return r.disableRemotePlayback||r.hasAttribute("disableremoteplayback")||null==(n=null==r?void 0:r.remote)||n.watchAvailability((function(e){t({availability:e?"available":"not-available"})})).catch((function(e){"NotSupportedError"===e.name?t({availability:null}):t({availability:"not-available"})})),function(){var t;null==(t=null==r?void 0:r.remote)||t.cancelWatchAvailability().catch((function(){}))}}]},mediaRenditionUnavailable:{get:function(t){var e,n=t.media;return(null==n?void 0:n.videoRenditions)?(null==(e=n.videoRenditions)?void 0:e.length)?void 0:C:P},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get:function(t){var e,n,r=t.media;return(null==r?void 0:r.audioTracks)?(null!=(n=null==(e=r.audioTracks)?void 0:e.length)?n:0)<=1?C:void 0:P},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get:function(t){var e=t.options,n=(e=void 0===e?{}:e).mediaLang;return null!=n?n:"en"}}},Dn=(n(263),n(169),An={},Object(f.a)(An,y.MEDIA_PREVIEW_REQUEST,(function(t,e,n){var r,o,l,c=n.detail,d=e.media,h=null!=c?c:void 0,f=void 0,v=void 0;if(d&&null!=h){var y=Qe(d,{kind:w.METADATA,label:"thumbnails"}
2),track=Object(m.a)(y,1)[0],E=Array.prototype.find.call(null!=(r=null==track?void 0:track.cues)?r:[],(function(t,i,e){return 0===i?t.endTime>h:i===e.length-1?t.startTime<=h:t.startTime<=h&&t.endTime>h}));if(E){var base=/'^(?:[a-z]+:)?\/\//i.test(E.text)||null==(o=null==d?void 0:d.querySelector('track[label="thumbnails"]'))?void 0:o.src,T=new URL(E.text,base);v=new URLSearchParams(T.hash).get("#xywh").split(",").map((function(t){return+t})),f=T.href}}var k=t.mediaDuration.get(e),S=null==(l=t.mediaChaptersCues.get(e).find((function(t,i,e){return i===e.length-1&&k===t.endTime?t.startTime<=h&&t.endTime>=h:t.startTime<=h&&t.endTime>h})))?void 0:l.text;return null!=c&&null==S&&(S=""),{mediaPreviewTime:h,mediaPreviewImage:f,mediaPreviewCoords:v,mediaPreviewChapter:S}})),Object(f.a)(An,y.MEDIA_PAUSE_REQUEST,(function(t,e){t.mediaPaused.set(!0,e)})),Object(f.a)(An,y.MEDIA_PLAY_REQUEST,(function(t,e){var n,r,o,l,c=t.mediaStreamType.get(e)===M.LIVE,d=!(null==(n=e.options)?void 0:n.noAutoSeekToLive),h=t.mediaTargetLiveWindow.get(e)>0;if(c&&d&&!h){var f=null==(r=t.mediaSeekable.get(e))?void 0:r[1];if(f){var m=f-(null!=(l=null==(o=e.options)?void 0:o.seekToLiveOffset)?l:0);t.mediaCurrentTime.set(m,e)}}t.mediaPaused.set(!1,e)})),Object(f.a)(An,y.MEDIA_PLAYBACK_RATE_REQUEST,(function(t,e,n){var r=n.detail;t.mediaPlaybackRate.set(r,e)})),Object(f.a)(An,y.MEDIA_MUTE_REQUEST,(function(t,e){t.mediaMuted.set(!0,e)})),Object(f.a)(An,y.MEDIA_UNMUTE_REQUEST,(function(t,e){t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t.mediaMuted.set(!1,e)})),Object(f.a)(An,y.MEDIA_LOOP_REQUEST,(function(t,e,n){var r=!!n.detail;return t.mediaLoop.set(r,e),{mediaLoop:r}})),Object(f.a)(An,y.MEDIA_VOLUME_REQUEST,(function(t,e,n){var r=n.detail;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t.mediaVolume.set(r,e)})),Object(f.a)(An,y.MEDIA_SEEK_REQUEST,(function(t,e,n){var r=n.detail;t.mediaCurrentTime.set(r,e)})),Object(f.a)(An,y.MEDIA_SEEK_TO_LIVE_REQUEST,(function(t,e){var n,r,o,l=null==(n=t.mediaSeekable.get(e))?void 0:n[1];if(!Number.isNaN(Number(l))){var c=l-(null!=(o=null==(r=e.options)?void 0:r.seekToLiveOffset)?o:0);t.mediaCurrentTime.set(c,e)}})),Object(f.a)(An,y.MEDIA_SHOW_SUBTITLES_REQUEST,(function(t,e,n){var r,o=n.detail,l=e.options,c=gn(e),d=We(o),h=null==(r=d[0])?void 0:r.language;h&&!l.noSubtitlesLangPref&&pt.localStorage.setItem("media-chrome-pref-subtitles-lang",h),ze(R,c,d)})),Object(f.a)(An,y.MEDIA_DISABLE_SUBTITLES_REQUEST,(function(t,e,n){var r=n.detail,o=gn(e);ze(I,o,null!=r?r:[])})),Object(f.a)(An,y.MEDIA_TOGGLE_SUBTITLES_REQUEST,(function(t,e,n){var r=n.detail;yn(e,r)})),Object(f.a)(An,y.MEDIA_RENDITION_REQUEST,(function(t,e,n){var r=n.detail;t.mediaRenditionSelected.set(r,e)})),Object(f.a)(An,y.MEDIA_AUDIO_TRACK_REQUEST,(function(t,e,n){var r=n.detail;t.mediaAudioTrackEnabled.set(r,e)})),Object(f.a)(An,y.MEDIA_ENTER_PIP_REQUEST,(function(t,e){t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t.mediaIsPip.set(!0,e)})),Object(f.a)(An,y.MEDIA_EXIT_PIP_REQUEST,(function(t,e){t.mediaIsPip.set(!1,e)})),Object(f.a)(An,y.MEDIA_ENTER_FULLSCREEN_REQUEST,(function(t,e,n){t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t.mediaIsFullscreen.set(!0,e,n)})),Object(f.a)(An,y.MEDIA_EXIT_FULLSCREEN_REQUEST,(function(t,e){t.mediaIsFullscreen.set(!1,e)})),Object(f.a)(An,y.MEDIA_ENTER_CAST_REQUEST,(function(t,e){t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t.mediaIsCasting.set(!0,e)})),Object(f.a)(An,y.MEDIA_EXIT_CAST_REQUEST,(function(t,e){t.mediaIsCasting.set(!1,e)})),Object(f.a)(An,y.MEDIA_AIRPLAY_REQUEST,(function(t,e){t.mediaIsAirplaying.set(!0,e)})),An);function Cn(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function Pn(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Cn(Object(source),!0).forEach((function(e){Object(f.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):Cn(Object(source)).forEac
2h((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var Mn,jn=function(t){var e=t.media,n=t.fullscreenElement,r=t.documentElement,o=t.stateMediator,l=void 0===o?xn:o,c=t.requestMap,d=void 0===c?Dn:c,h=t.options,v=void 0===h?{}:h,y=t.monitorStateOwnersOnlyWithSubscriptions,E=void 0===y||y,T=[],k={options:Pn({},v)},S=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),_=function(t){null!=t&&(bn(t,S)||(S=Object.freeze(Pn(Pn({},S),t)),T.forEach((function(t){return t(S)}))))},A=function(){var t=Object.entries(l).reduce((function(t,e){var n=Object(m.a)(e,2),r=n[0],o=n[1].get;return t[r]=o(k),t}),{});_(t)},O={},w=void 0,I=function(){var t=Object(et.a)(regeneratorRuntime.mark((function t(e,n){var r,o,c,d,h,v,y,S,I,R,L,x,D,C,P,M,j,F,N,U,B,$,V,G,H,W,K,Y,z,Q,X,Z,J,et,nt,it,st,at,ot;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(j=!!w,w=Pn(Pn(Pn({},k),null!=w?w:{}),e),!j){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,In.apply(void 0,Object(tt.a)(Object.values(e)));case 6:if(F=T.length>0&&0===n&&E,N=k.media!==w.media,U=(null==(r=k.media)?void 0:r.textTracks)!==(null==(o=w.media)?void 0:o.textTracks),B=(null==(c=k.media)?void 0:c.videoRenditions)!==(null==(d=w.media)?void 0:d.videoRenditions),$=(null==(h=k.media)?void 0:h.audioTracks)!==(null==(v=w.media)?void 0:v.audioTracks),V=(null==(y=k.media)?void 0:y.remote)!==(null==(S=w.media)?void 0:S.remote),G=k.documentElement!==w.documentElement,H=!!k.media&&(N||F),W=!!(null==(I=k.media)?void 0:I.textTracks)&&(U||F),K=!!(null==(R=k.media)?void 0:R.videoRenditions)&&(B||F),Y=!!(null==(L=k.media)?void 0:L.audioTracks)&&($||F),z=!!(null==(x=k.media)?void 0:x.remote)&&(V||F),Q=!!k.documentElement&&(G||F),X=H||W||K||Y||z||Q,Z=0===T.length&&1===n&&E,J=!!w.media&&(N||Z),et=!!(null==(D=w.media)?void 0:D.textTracks)&&(U||Z),nt=!!(null==(C=w.media)?void 0:C.videoRenditions)&&(B||Z),it=!!(null==(P=w.media)?void 0:P.audioTracks)&&($||Z),st=!!(null==(M=w.media)?void 0:M.remote)&&(V||Z),at=!!w.documentElement&&(G||Z),ot=J||et||nt||it||st||at,X||ot){t.next=34;break}return Object.entries(w).forEach((function(t){var e=Object(m.a)(t,2),n=e[0],r=e[1];k[n]=r})),A(),w=void 0,t.abrupt("return");case 34:Object.entries(l).forEach((function(t){var e=Object(m.a)(t,2),n=e[0],r=e[1],o=r.get,l=r.mediaEvents,c=void 0===l?[]:l,d=r.textTracksEvents,h=void 0===d?[]:d,v=r.videoRenditionsEvents,y=void 0===v?[]:v,E=r.audioTracksEvents,T=void 0===E?[]:E,S=r.remoteEvents,A=void 0===S?[]:S,I=r.rootEvents,R=void 0===I?[]:I,L=r.stateOwnersUpdateHandlers,x=void 0===L?[]:L;O[n]||(O[n]={});var D,C=function(t){var e=o(k,t);_(Object(f.a)({},n,e))};D=O[n].mediaEvents,c.forEach((function(t){D&&H&&(k.media.removeEventListener(t,D),O[n].mediaEvents=void 0),J&&(w.media.addEventListener(t,C),O[n].mediaEvents=C)})),D=O[n].textTracksEvents,h.forEach((function(t){var e,r;D&&W&&(null==(e=k.media.textTracks)||e.removeEventListener(t,D),O[n].textTracksEvents=void 0),et&&(null==(r=w.media.textTracks)||r.addEventListener(t,C),O[n].textTracksEvents=C)})),D=O[n].videoRenditionsEvents,y.forEach((function(t){var e,r;D&&K&&(null==(e=k.media.videoRenditions)||e.removeEventListener(t,D),O[n].videoRenditionsEvents=void 0),nt&&(null==(r=w.media.videoRenditions)||r.addEventListener(t,C),O[n].videoRenditionsEvents=C)})),D=O[n].audioTracksEvents,T.forEach((function(t){var e,r;D&&Y&&(null==(e=k.media.audioTracks)||e.removeEventListener(t,D),O[n].audioTracksEvents=void 0),it&&(null==(r=w.media.audioTracks)||r.addEventListener(t,C),O[n].audioTracksEvents=C)})),D=O[n].remoteEvents,A.forEach((function(t){var e,r;D&&z&&(null==(e=k.media.remote)||e.removeEventListener(t,D),O[n].remoteEvents=void 0),st&&(null==(r=w.media.remote)||r.addEventListener(t,C),O[n].remoteEvents=C)})),D=O[n].rootEvents,R.forEach((function(t){D&&Q&&(k.documentElement.removeEventListener(t,D),O[n].rootEvents=void 0),at&&(w.documentElement.addEventListener(t,C),O[n].rootEvents=C)}));var P=O[n].stateOwnersUpdateHandlers;
2P&&X&&(Array.isArray(P)?P:[P]).forEach((function(t){"function"==typeof t&&t()}));if(ot){var M=x.map((function(t){return t(C,w)})).filter((function(t){return"function"==typeof t}));O[n].stateOwnersUpdateHandlers=1===M.length?M[0]:M}else X&&(O[n].stateOwnersUpdateHandlers=void 0)})),Object.entries(w).forEach((function(t){var e=Object(m.a)(t,2),n=e[0],r=e[1];k[n]=r})),A(),w=void 0;case 38:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}();return I({media:e,fullscreenElement:n,documentElement:r,options:v}),{dispatch:function(t){var e=t.type,n=t.detail;d[e]&&null==S.mediaErrorCode?_(d[e](l,k,t)):"mediaelementchangerequest"===e?I({media:n}):"fullscreenelementchangerequest"===e?I({fullscreenElement:n}):"documentelementchangerequest"===e?I({documentElement:n}):"optionschangerequest"===e&&(Object.entries(null!=n?n:{}).forEach((function(t){var e=Object(m.a)(t,2),n=e[0],r=e[1];k.options[n]=r})),A())},getState:function(){return S},subscribe:function(t){return I({},T.length+1),T.push(t),t(S),function(){var e=T.indexOf(t);e>=0&&(I({},T.length-1),T.splice(e,1))}}}};function Fn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Nn,Un,Bn,$n,Vn,Gn,Hn,Wn,Kn,qn,Yn,zn,Qn,Xn,Zn,Jn=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},ti=function(t,e,n){return Jn(t,e,"read from private field"),n?n.call(t):e.get(t)},ei=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},ni=function(t,e,n,r){return Jn(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},ii=function(t,e,n){return Jn(t,e,"access private method"),n},ri=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],si="defaultsubtitles",ai="defaultstreamtype",oi="defaultduration",ci="fullscreenelement",ui="hotkeys",di="keyboardbackwardseekoffset",hi="keyboardforwardseekoffset",fi="keyboarddownvolumestep",pi="keyboardupvolumestep",mi="keysused",gi="lang",vi="loop",yi="liveedgeoffset",bi="noautoseektolive",Ei="nodefaultstore",Ti="nohotkeys",ki="nomutedpref",Si="nosubtitleslangpref",_i="novolumepref",Ai="seektoliveoffset",Oi=function(t){Object(l.a)(n,t);var e=Fn(n);function n(){var t;Object(o.a)(this,n),t=e.call(this),ei(Object(nt.a)(t),Kn),ei(Object(nt.a)(t),zn),ei(Object(nt.a)(t),Xn),t.mediaStateReceivers=[],t.associatedElementSubscriptions=new Map,ei(Object(nt.a)(t),Nn,new Ne(Object(nt.a)(t),ui)),ei(Object(nt.a)(t),Un,void 0),ei(Object(nt.a)(t),Bn,void 0),ei(Object(nt.a)(t),$n,null),ei(Object(nt.a)(t),Vn,void 0),ei(Object(nt.a)(t),Gn,void 0),ei(Object(nt.a)(t),Hn,(function(e){var n;null==(n=ti(Object(nt.a)(t),Bn))||n.dispatch(e)})),ei(Object(nt.a)(t),Wn,void 0),ei(Object(nt.a)(t),Yn,(function(e){var n=e.key;e.shiftKey&&("/"===n||"?"===n)||ri.includes(n)?t.keyboardShortcutHandler(e):t.removeEventListener("keyup",ti(Object(nt.a)(t),Yn))})),t.associateElement(Object(nt.a)(t));var r={};return ni(Object(nt.a)(t),Vn,(function(e){Object.entries(e).forEach((function(e){var n=Object(m.a)(e,2),o=n[0],l=n[1];if(!(o in r)||r[o]!==l){t.propagateMediaState(o,l);var c=o.toLowerCase(),d=new pt.CustomEvent(O[c],{composed:!0,detail:l});t.dispatchEvent(d)}})),r=e})),t}return Object(r.a)(n,[{key:"mediaStore",get:function(){return ti(this,Bn)},set:function(t){var e,n;ti(this,Bn)&&(null==(e=ti(this,Gn))||e.call(this),ni(this,Gn,void 0)),ni(this,Bn,t),ti(this,Bn)||this.hasAttribute(Ei)?ni(this,Gn,null==(n=ti(this,Bn))?void 0:n.subscribe(ti(this,Vn))):ii(this,Kn,qn).call(this)}},{key:"fullscreenElement",get:function(){var t;return null!=(t=ti(this,Un))?t:this},set:function(element){var t;this.hasAttribute(ci)&&this.removeAttribute(ci),ni(this,Un,element),null==(t=ti(this,Bn))||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}},{key:"defaultSubtitles",get:function(){return Ut(this,si)},set:function(t){Bt(this,si,t)}},{key:"defaultStreamType",get:function(){return $t(this,ai)},set:function(t){Vt(this,ai,t)}},{key:"defaultDuration",get:function(){return Ft(this,oi)},set:function(t){Nt(this,oi,t)}},{key:"noHotkeys",get:function(){return Ut(this,Ti)},set:function(t){Bt(this,Ti,t)}},{key:"keysUsed",get:function(){return $t(this,mi)},set:function(t){Vt(this,mi,t)}},{key:"liveEdgeOffset",get:function(){return Ft(this,yi)},set:function(t){Nt(this,yi,t)}},{key:"noAutoSeekToLive",get:function(){return Ut(this,bi)},set:function(t){Bt(this,bi,t)}},{key:"noVolumePref",get:function(){return Ut(this,_i)},set:function(t){Bt(this,_i,t)}},{key:"noMutedPref",get:function(){return Ut(this,ki)},set:function(t){Bt(this,ki,t)}},{key:"noSubtitlesLangPref",get:function(){return Ut(this,Si)},set:function(t){Bt(this,Si,t)}},{key:"noDefaultStore",get:function(){return Ut(this,Ei)},set:function(t){Bt(this,Ei,t)}},{key:"resolvedLang",get:function(){return t=Y.split("-"),base=Object(m.a)(t,1)[0],K[Y]?Y:K[base]?base
2:"en";var t,base}},{key:"attributeChangedCallback",value:function(t,e,r){var o,l,c,h,f,m,v,E,T,k,S,_;if(Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===Ti)r!==e&&""===r?(this.hasAttribute(ui)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):r!==e&&null===r&&this.enableHotkeys();else if(t===ui)ti(this,Nn).value=r;else if(t===si&&r!==e)null==(o=ti(this,Bn))||o.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(si)}});else if(t===ai)null==(c=ti(this,Bn))||c.dispatch({type:"optionschangerequest",detail:{defaultStreamType:null!=(l=this.getAttribute(ai))?l:void 0}});else if(t===yi&&r!==e)null==(h=ti(this,Bn))||h.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(yi)?+this.getAttribute(yi):void 0,seekToLiveOffset:this.hasAttribute(Ai)?+this.getAttribute(Ai):this.hasAttribute(yi)?+this.getAttribute(yi):void 0}});else if(t===Ai&&r!==e)null==(f=ti(this,Bn))||f.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(Ai)?+this.getAttribute(Ai):this.hasAttribute(yi)?+this.getAttribute(yi):void 0}});else if(t===bi)null==(m=ti(this,Bn))||m.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(bi)}});else if(t===ci){var A=r?null==(v=this.getRootNode())?void 0:v.getElementById(r):void 0;ni(this,Un,A),null==(E=ti(this,Bn))||E.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else t===gi&&r!==e?(Y=r,null==(T=ti(this,Bn))||T.dispatch({type:"optionschangerequest",detail:{mediaLang:r}})):t===vi&&r!==e?null==(k=ti(this,Bn))||k.dispatch({type:y.MEDIA_LOOP_REQUEST,detail:null!=r}):t===_i&&r!==e?null==(S=ti(this,Bn))||S.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(_i)}}):t===ki&&r!==e&&(null==(_=ti(this,Bn))||_.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(ki)}}))}},{key:"connectedCallback",value:function(){var t,e,r,o=this;this.associateElement(this),ti(this,Bn)||this.hasAttribute(Ei)||ii(this,Kn,qn).call(this),null==(t=ti(this,Bn))||t.dispatch({type:"documentelementchangerequest",detail:mt}),null==(e=ti(this,Bn))||e.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement}),Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),ti(this,Bn)&&!ti(this,Gn)&&ni(this,Gn,null==(r=ti(this,Bn))?void 0:r.subscribe(ti(this,Vn))),void 0!==ti(this,Wn)&&ti(this,Bn)&&this.media&&setTimeout((function(){var t,e,n;(null==(e=null==(t=o.media)?void 0:t.textTracks)?void 0:e.length)&&(null==(n=ti(o,Bn))||n.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:ti(o,Wn)}))}),0),this.hasAttribute(Ti)?this.disableHotkeys():this.enableHotkeys()}},{key:"disconnectedCallback",value:function(){var t,e,r,o,l,c;if(null==(t=Object(it.a)(Object(d.a)(n.prototype),"disconnectedCallback",this))||t.call(this),this.disableHotkeys(),ti(this,Bn)){var h=ti(this,Bn).getState();ni(this,Wn,!!(null==(e=h.mediaSubtitlesShowing)?void 0:e.length)),null==(r=ti(this,Bn))||r.dispatch({type:"fullscreenelementchangerequest",detail:void 0}),null==(o=ti(this,Bn))||o.dispatch({type:"documentelementchangerequest",detail:void 0}),null==(l=ti(this,Bn))||l.dispatch({type:y.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}ti(this,Gn)&&(null==(c=ti(this,Gn))||c.call(this),ni(this,Gn,void 0)),this.unassociateElement(this),ti(this,$n)&&(ti(this,$n).remove(),ni(this,$n,null))}},{key:"mediaSetCallback",value:function(t){var e;Object(it.a)(Object(d.a)(n.prototype),"mediaSetCallback",this).call(this,t),null==(e=ti(this,Bn))||e.dispatch({type:"mediaelementchangerequest",detail:t}),t.hasAttribute("tabindex")||(t.tabIndex=-1)}},{key:"mediaUnsetCallback",value:function(t){var e;Object(it.a)(Object(d.a)(n.prototype),"mediaUnsetCallback",this).call(this,t),null==(e=ti(this,Bn))||e.dispatch({type:"mediaelementchangerequest",detail:void 0})}},{key:"propagateMediaState",value:function(t,e){Mi(this.mediaStateReceivers,t,e)}},{key:"associateElement",value:function(element){var t=this;if(element){var e=this.associatedElementSubscriptions;if(!e.has(element)){var n=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),o=ji(element,n,r);
2Object.values(y).forEach((function(e){element.addEventListener(e,ti(t,Hn))})),e.set(element,o)}}}},{key:"unassociateElement",value:function(element){var t=this;if(element){var e=this.associatedElementSubscriptions;if(e.has(element))e.get(element)(),e.delete(element),Object.values(y).forEach((function(e){element.removeEventListener(e,ti(t,Hn))}))}}},{key:"registerMediaStateReceiver",value:function(t){if(t){var e=this.mediaStateReceivers;e.indexOf(t)>-1||(e.push(t),ti(this,Bn)&&Object.entries(ti(this,Bn).getState()).forEach((function(e){var n=Object(m.a)(e,2),r=n[0],o=n[1];Mi([t],r,o)})))}}},{key:"unregisterMediaStateReceiver",value:function(t){var e=this.mediaStateReceivers,n=e.indexOf(t);n<0||e.splice(n,1)}},{key:"enableHotkeys",value:function(){this.addEventListener("keydown",ii(this,zn,Qn))}},{key:"disableHotkeys",value:function(){this.removeEventListener("keydown",ii(this,zn,Qn)),this.removeEventListener("keyup",ti(this,Yn))}},{key:"hotkeys",get:function(){return ti(this,Nn)},set:function(t){Vt(this,ui,t)}},{key:"keyboardShortcutHandler",value:function(t){var e,n,r,o,l,c,d,h,f,m,v,E,T=t.target;if(!(null!=(r=null!=(n=null==(e=T.getAttribute(mi))?void 0:e.split(" "))?n:null==T?void 0:T.keysUsed)?r:[]).map((function(t){return"Space"===t?" ":t})).filter(Boolean).includes(t.key)&&(!ti(this,Nn).contains("no".concat(t.key.toLowerCase()))&&!(" "===t.key&&ti(this,Nn).contains("nospace")||t.shiftKey&&("/"===t.key||"?"===t.key)&&ti(this,Nn).contains("noshift+/"))))switch(t.key){case" ":case"k":m=ti(this,Bn).getState().mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new pt.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"m":m="off"===this.mediaStore.getState().mediaVolumeLevel?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST,this.dispatchEvent(new pt.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"f":m=this.mediaStore.getState().mediaIsFullscreen?y.MEDIA_EXIT_FULLSCREEN_REQUEST:y.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new pt.CustomEvent(m,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new pt.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":var k=this.hasAttribute(di)?+this.getAttribute(di):10;v=Math.max((null!=(o=this.mediaStore.getState().mediaCurrentTime)?o:0)-k,0),E=new pt.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:v}),this.dispatchEvent(E);break;case"ArrowRight":case"l":var S=this.hasAttribute(hi)?+this.getAttribute(hi):10;v=Math.max((null!=(l=this.mediaStore.getState().mediaCurrentTime)?l:0)+S,0),E=new pt.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:v}),this.dispatchEvent(E);break;case"ArrowUp":var _=this.hasAttribute(pi)?+this.getAttribute(pi):.025;v=Math.min((null!=(c=this.mediaStore.getState().mediaVolume)?c:1)+_,1),E=new pt.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:v}),this.dispatchEvent(E);break;case"ArrowDown":var A=this.hasAttribute(fi)?+this.getAttribute(fi):.025;v=Math.max((null!=(d=this.mediaStore.getState().mediaVolume)?d:1)-A,0),E=new pt.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:v}),this.dispatchEvent(E);break;case"<":var O=null!=(h=this.mediaStore.getState().mediaPlaybackRate)?h:1;v=Math.max(O-.25,.25).toFixed(2),E=new pt.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:v}),this.dispatchEvent(E);break;case">":var w=null!=(f=this.mediaStore.getState().mediaPlaybackRate)?f:1;v=Math.min(w+.25,2).toFixed(2),E=new pt.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:v}),this.dispatchEvent(E);break;case"/":case"?":t.shiftKey&&ii(this,Xn,Zn).call(this);break;case"p":m=this.mediaStore.getState().mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST,E=new pt.CustomEvent(m,{composed:!0,bubbles:!0}),this.dispatchEvent(E)}}}],[{key:"observedAttributes",get:function(){return Object(it.a)(Object(d.a)(n),"observedAttributes",this).concat(Ti,ui,ai,si,oi,ki,_i,gi,vi,yi,Ai,bi)}}]),n}(we);Nn=new WeakMap,Un=new WeakMap,Bn=new WeakMap,$n=new WeakMap,Vn=new WeakMap,Gn=new WeakMap,Hn=new WeakMap,Wn=new WeakMap,Kn=new WeakSet,qn=function(){var t;this.mediaStore=jn({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(si),defaultDuration:this.hasAttribute(oi)?+this.getAttribute(oi):void 0,defaultStreamType:null!=(t=this.getAttribute(ai))?t:void 0,liveEdgeOffset:this.hasAttribute(yi)?+this.getAttribute(yi):void 0,seekToLiveOffset:this.hasAttribute(Ai)?+this.getAttribute(Ai):this.hasAttribute(yi)?+this.getAttribute(yi):void 0,noAutoSeekToLive:this.hasAttribute(bi),noVolumePref:this.hasAttribute(_i),noMutedPref:this.hasAttribute(ki),noSubtitlesLangPref:this.hasAttribute(Si)}})},Yn=new WeakMap,zn=new WeakSet,Qn=function(t){var e,n=t.metaKey,r=t.altKey,o=t.key,l=t.shiftKey&&("/"===o||"?"===o);if(l&&(null==(e=ti(this,$n))?void 0:e.open))this.removeEventListener("keyup",ti(this,Yn));else if(n||r||!l&&!ri.includes(o))this.removeEventListener("keyup",ti(this,Yn));
2else{var c=t.target,d=c instanceof HTMLElement&&("media-volume-range"===c.tagName.toLowerCase()||"media-time-range"===c.tagName.toLowerCase());![" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(o)||ti(this,Nn).contains("no".concat(o.toLowerCase()))||" "===o&&ti(this,Nn).contains("nospace")||d||t.preventDefault(),this.addEventListener("keyup",ti(this,Yn),{once:!0})}},Xn=new WeakSet,Zn=function(){ti(this,$n)||(ni(this,$n,mt.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(ti(this,$n))),ti(this,$n).open=!0};var wi=Object.values(_),Ii=Object.values(k),Ri=function(t){var e,n,r,o,l=t.constructor.observedAttributes;!l&&(null==(e=t.nodeName)?void 0:e.includes("-"))&&(pt.customElements.upgrade(t),l=t.constructor.observedAttributes);var c=null==(o=null==(r=null==(n=null==t?void 0:t.getAttribute)?void 0:n.call(t,E))?void 0:r.split)?void 0:o.call(r,/\s+/);return Array.isArray(l||c)?(l||c).filter((function(t){return wi.includes(t)})):[]},Li=function(t){return!(null==(n=(e=t).nodeName)?void 0:n.includes("-"))||!pt.customElements.get(null==(r=e.nodeName)?void 0:r.toLowerCase())||e instanceof pt.customElements.get(e.nodeName.toLowerCase())||pt.customElements.upgrade(e),Ii.some((function(t){return t in e}))||!!Ri(t).length;var e,n,r},xi=function(t){var e;return null==(e=null==t?void 0:t.join)?void 0:e.call(t,":")},Di=(Mn={},Object(f.a)(Mn,_.MEDIA_SUBTITLES_LIST,qe),Object(f.a)(Mn,_.MEDIA_SUBTITLES_SHOWING,qe),Object(f.a)(Mn,_.MEDIA_SEEKABLE,xi),Object(f.a)(Mn,_.MEDIA_BUFFERED,(function(t){return null==t?void 0:t.map(xi).join(" ")})),Object(f.a)(Mn,_.MEDIA_PREVIEW_COORDS,(function(t){return null==t?void 0:t.join(" ")})),Object(f.a)(Mn,_.MEDIA_RENDITION_LIST,(function(t){return null==t?void 0:t.map(F).join(" ")})),Object(f.a)(Mn,_.MEDIA_AUDIO_TRACK_LIST,(function(t){return null==t?void 0:t.map(U).join(" ")})),Mn),Ci=function(){var t=Object(et.a)(regeneratorRuntime.mark((function t(e,n,r){var o,l,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isConnected){t.next=3;break}return t.next=3,W(0);case 3:if("boolean"!=typeof r&&null!=r){t.next=5;break}return t.abrupt("return",Bt(e,n,r));case 5:if("number"!=typeof r){t.next=7;break}return t.abrupt("return",Nt(e,n,r));case 7:if("string"!=typeof r){t.next=9;break}return t.abrupt("return",Vt(e,n,r));case 9:if(!Array.isArray(r)||r.length){t.next=11;break}return t.abrupt("return",e.removeAttribute(n));case 11:return c=null!=(l=null==(o=Di[n])?void 0:o.call(Di,r))?l:r,t.abrupt("return",e.setAttribute(n,c));case 13:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),Pi=function t(e,n){if(!(null==(o=(r=e).closest)?void 0:o.call(r,'*[slot="media"]'))){var r,o,l=function(e,n){var r,o;Li(e)&&n(e);var l=(null!=e?e:{}).children,c=void 0===l?[]:l,d=null!=(o=null==(r=null==e?void 0:e.shadowRoot)?void 0:r.children)?o:[];[].concat(Object(tt.a)(c),Object(tt.a)(d)).forEach((function(e){return t(e,n)}))},c=null==e?void 0:e.nodeName.toLowerCase();!c.includes("-")||Li(e)?l(e,n):pt.customElements.whenDefined(c).then((function(){l(e,n)}))}},Mi=function(t,e,n){t.forEach((function(t){if(e in t)t[e]=n;else{var r=Ri(t),o=e.toLowerCase();r.includes(o)&&Ci(t,o,n)}}))},ji=function(t,e,n){Pi(t,e);var r=function(t){var n,r=null!=(n=null==t?void 0:t.composedPath()[0])?n:t.target;e(r)},o=function(t){var e,r=null!=(e=null==t?void 0:t.composedPath()[0])?e:t.target;n(r)};t.addEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),t.addEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,o);var l=[],c=function(t){var r=t.target;"media"!==r.name&&(l.forEach((function(t){return Pi(t,n)})),(l=Object(tt.a)(r.assignedElements({flatten:!0}))).forEach((function(t){return Pi(t,e)})))};t.addEventListener("slotchange",c);var d=new MutationObserver((function(t){t.forEach((function(t){var r=t.addedNodes,o=void 0===r?[]:r,l=t.removedNodes,c=void 0===l?[]:l,d=t.type,h=t.target,f=t.attributeName;"childList"===d?(Array.prototype.forEach.call(o,(function(t){return Pi(t,e)})),Array.prototype.forEach.call(c,(function(t){return Pi(t,n)}))):"attributes"===d&&f===E&&(Li(h)?e(h):n(h))}))}));d.observe(t,{childList:!0,attributes:!0,subtree:!0});return function(){Pi(t,n),t.removeEventListener("slotchange",c),d.disconnect(),t.removeEventListener(y.REGISTER_MEDIA_STATE_RECEIVER,r),t.removeEventListener(y.UNREGISTER_MEDIA_STATE_RECEIVER,o)}};pt.customElements.get("media-controller")||pt.customElements.define("media-controller",Oi
2);function Fi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ni="placement",Ui="bounds";var Bi=function(t){Object(l.a)(n,t);var e=Fi(n);function n(){var t;if(Object(o.a)(this,n),(t=e.call(this)).updateXOffset=function(){var e;if(Pt(Object(nt.a)(t),{checkOpacity:!1,checkVisibilityCSS:!1})){var n=t.placement;if("left"!==n&&"right"!==n){var r=getComputedStyle(Object(nt.a)(t)),o=null!=(e=xt(Object(nt.a)(t),"#"+t.bounds))?e:Ot(Object(nt.a)(t));if(o){var l=o.getBoundingClientRect(),c=l.x,d=l.width,h=t.getBoundingClientRect(),f=h.x,m=f+h.width,v=c+d,y=r.getPropertyValue("--media-tooltip-offset-x"),E=y?parseFloat(y.replace("px","")):0,T=r.getPropertyValue("--media-tooltip-container-margin"),k=T?parseFloat(T.replace("px","")):0,S=f-c+E-k,_=m-v+E+k;S<0?t.style.setProperty("--media-tooltip-offset-x","".concat(S,"px")):_>0?t.style.setProperty("--media-tooltip-offset-x","".concat(_,"px")):t.style.removeProperty("--media-tooltip-offset-x")}}else t.style.removeProperty("--media-tooltip-offset-x")}},!t.shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var r=At(t.attributes);t.shadowRoot.innerHTML=t.constructor.getTemplateHTML(r)}if(t.arrowEl=t.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(Object(nt.a)(t),"placement")){var l=t.placement;delete t.placement,t.placement=l}return t}return Object(r.a)(n,[{key:"placement",get:function(){return $t(this,Ni)},set:function(t){Vt(this,Ni,t)}},{key:"bounds",get:function(){return $t(this,Ui)},set:function(t){Vt(this,Ui,t)}}],[{key:"observedAttributes",get:function(){return[Ni,Ui]}}]),n}(pt.HTMLElement);Bi.shadowRootOptions={mode:"open"},Bi.getTemplateHTML=function(t){return'\n <style>\n :host {\n --_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));\n --_tooltip-background: var(--media-tooltip-background, var(--_tooltip-background-color));\n --_tooltip-arrow-half-width: calc(var(--media-tooltip-arrow-width, 12px) / 2);\n --_tooltip-arrow-height: var(--media-tooltip-arrow-height, 5px);\n --_tooltip-arrow-background: var(--media-tooltip-arrow-color, var(--_tooltip-background-color));\n position: relative;\n pointer-events: none;\n display: var(--media-tooltip-display, inline-flex);\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n z-index: var(--media-tooltip-z-index, 1);\n background: var(--_tooltip-background);\n color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n font: var(--media-font,\n var(--media-font-weight, 400)\n var(--media-font-size, 13px) /\n var(--media-text-content-height, var(--media-control-height, 18px))\n var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));\n padding: var(--media-tooltip-padding, .35em .7em);\n border: var(--media-tooltip-border, none);\n border-radius: var(--media-tooltip-border-radius, 5px);\n filter: var(--media-tooltip-filter, drop-shadow(0 0 4px rgba(0, 0, 0, .2)));\n white-space: var(--media-tooltip-white-space, nowrap);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n img, svg {\n display: inline-block;\n }\n\n #arrow {\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n display: var(--media-tooltip-arrow-display, block);\n }\n\n :host(:not([placement])),\n :host([placement="top"]) {\n position: absolute;\n bottom: calc(100% + var(--media-tooltip-distance, 12px));\n left: 50%;\n transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0
2);\n }\n :host(:not([placement])) #arrow,\n :host([placement="top"]) #arrow {\n top: 100%;\n left: 50%;\n border-width: var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width);\n border-color: var(--_tooltip-arrow-background) transparent transparent transparent;\n transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);\n }\n\n :host([placement="right"]) {\n position: absolute;\n left: calc(100% + var(--media-tooltip-distance, 12px));\n top: 50%;\n transform: translate(0, -50%);\n }\n :host([placement="right"]) #arrow {\n top: 50%;\n right: 100%;\n border-width: var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0;\n border-color: transparent var(--_tooltip-arrow-background) transparent transparent;\n transform: translate(0, -50%);\n }\n\n :host([placement="bottom"]) {\n position: absolute;\n top: calc(100% + var(--media-tooltip-distance, 12px));\n left: 50%;\n transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);\n }\n :host([placement="bottom"]) #arrow {\n bottom: 100%;\n left: 50%;\n border-width: 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width);\n border-color: transparent transparent var(--_tooltip-arrow-background) transparent;\n transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);\n }\n\n :host([placement="left"]) {\n position: absolute;\n right: calc(100% + var(--media-tooltip-distance, 12px));\n top: 50%;\n transform: translate(0, -50%);\n }\n :host([placement="left"]) #arrow {\n top: 50%;\n left: 100%;\n border-width: var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height);\n border-color: transparent transparent transparent var(--_tooltip-arrow-background);\n transform: translate(0, -50%);\n }\n \n :host([placement="none"]) #arrow {\n display: none;\n }\n </style>\n <slot></slot>\n <div id="arrow"></div>\n '},pt.customElements.get("media-tooltip")||pt.customElements.define("media-tooltip",Bi);var $i=Bi;function Vi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Gi,Hi,Wi,Ki,qi,Yi,zi,Qi=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Xi=function(t,e,n){return Qi(t,e,"read from private field"),n?n.call(t):e.get(t)},Zi=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Ji=function(t,e,n,r){return Qi(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},er="tooltipplacement",nr="disabled",ir="notooltip";var rr=function(t){Object(l.a)(n,t);var e=Vi(n);function n(){var t;if(Object(o.a)(this,n),t=e.call(this),Zi(Object(nt.a)(t),Yi),Zi(Object(nt.a)(t),Gi,void 0),t.preventClick=!1,t.tooltipEl=null,Zi(Object(nt.a)(t),Hi,(function(e){t.preventClick||t.handleClick(e),setTimeout(Xi(Object(nt.a)(t),Wi),0)})),Zi(Object(nt.a)(t),Wi,(function(){var e,n;null==(n=null==(e=t.tooltipEl)?void 0:e.updateXOffset)||n.call(e)})),Zi(Object(nt.a)(t),Ki,(function(e){var n=e.key;t.keysUsed.includes(n)?t.preventClick||t.handleClick(e):t.removeEventListener("keyup",Xi(Object(nt.a)(t),Ki))})),Zi(Object(nt.a)(t),qi,(function(e){var n=e.metaKey,r=e.altKey,o=e.key;n||r||!t.keysUsed.includes(o)?t.removeEventListener("keyup",Xi(Object(nt.a)(t),Ki)):t.addEventListener("keyup",Xi(Object(nt.a)(t),Ki),{once:!0})})),!t.shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var r=At(t.attributes),html=t.constructor.getTemplateHTML(r);t.shadowRoot.setHTMLUnsafe?t.shadowRoot.setHTMLUnsafe(html):t.shadowRoot.innerHTML=html}return t.tooltipEl=t.shadowRoot.querySelector("media-tooltip"),t}return Object(r.a)(n,[{key:"enable",value:function(){this.addEventListener("click",Xi(this,Hi)),this.addEventListener("keydown",Xi(this,qi)),this.tabIndex=0}},{key:"disable",value:function(){this.removeEventListener("click",Xi(this,Hi)),this.removeEventListener("keydown",Xi(this,qi)),this.removeEventListener("keyup",Xi(this,Ki)),this.tabIndex=-1}},{key:"attributeChangedCallback",value:function(t,e,n){var r,o,l,c,d;t===T?(e&&(null==(o=null==(r=Xi(this,Gi))?void 0:r.unassociateElement)||o.call(r,this),Ji(this,Gi,null)),n&&this.isConnected&&(Ji(this,Gi,null==(l=this.getRootNode())?void 0:l.getElementById(n)),null==(d=null==(c=Xi(this,Gi))?void 0:c.associateElement)||d.call(c,this))):"disabled"===t&&n!==e?null==n?this.enable():this.disable():t===er&&this.tooltipEl&&n!==e?this.tooltipEl.placement=n:t===_.MEDIA_LA
2NG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),Xi(this,Wi).call(this)}},{key:"connectedCallback",value:function(){var t,e,n,r=this;Mt(this.shadowRoot,":host").style.setProperty("display","var(--media-control-display, var(--".concat(this.localName,"-display, inline-flex))")),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");var o=this.getAttribute(T);o&&(Ji(this,Gi,null==(t=this.getRootNode())?void 0:t.getElementById(o)),null==(n=null==(e=Xi(this,Gi))?void 0:e.associateElement)||n.call(e,this)),pt.customElements.whenDefined("media-tooltip").then((function(){return(t=r,e=Yi,n=zi,Qi(t,e,"access private method"),n).call(r);var t,e,n}))}},{key:"disconnectedCallback",value:function(){var t,e;this.disable(),null==(e=null==(t=Xi(this,Gi))?void 0:t.unassociateElement)||e.call(t,this),Ji(this,Gi,null),this.removeEventListener("mouseenter",Xi(this,Wi)),this.removeEventListener("focus",Xi(this,Wi)),this.removeEventListener("click",Xi(this,Hi))}},{key:"keysUsed",get:function(){return["Enter"," "]}},{key:"tooltipPlacement",get:function(){return $t(this,er)},set:function(t){Vt(this,er,t)}},{key:"mediaController",get:function(){return $t(this,T)},set:function(t){Vt(this,T,t)}},{key:"disabled",get:function(){return Ut(this,nr)},set:function(t){Bt(this,nr,t)}},{key:"noTooltip",get:function(){return Ut(this,ir)},set:function(t){Bt(this,ir,t)}},{key:"handleClick",value:function(t){}}],[{key:"observedAttributes",get:function(){return["disabled",er,T,_.MEDIA_LANG]}}]),n}(pt.HTMLElement);Gi=new WeakMap,Hi=new WeakMap,Wi=new WeakMap,Ki=new WeakMap,qi=new WeakMap,Yi=new WeakSet,zi=function(){this.addEventListener("mouseenter",Xi(this,Wi)),this.addEventListener("focus",Xi(this,Wi)),this.addEventListener("click",Xi(this,Hi));var t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)},rr.shadowRootOptions={mode:"open"},rr.getTemplateHTML=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"\n <style>\n :host {\n position: relative;\n font: var(--media-font,\n var(--media-font-weight, bold)\n var(--media-font-size, 14px) /\n var(--media-text-content-height, var(--media-control-height, 24px))\n var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));\n color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));\n padding: var(--media-button-padding, var(--media-control-padding, 10px));\n justify-content: var(--media-button-justify-content, center);\n display: inline-flex;\n align-items: center;\n vertical-align: middle;\n box-sizing: border-box;\n transition: background .15s linear;\n pointer-events: auto;\n cursor: var(--media-cursor, pointer);\n -webkit-tap-highlight-color: transparent;\n }\n\n ".concat("\n :host(:focus-visible) {\n box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));\n outline: 0;\n }\n ",'\n :host(:where(:focus)) {\n box-shadow: none;\n outline: 0;\n }\n\n :host(:hover) {\n background: var(--media-control-hover-background, rgba(50 50 70 / .7));\n }\n\n slot[name="icon"] {\n display: inline-flex;\n align-items: center;\n }\n\n svg, img, ::slotted(svg), ::slotted(img) {\n width: var(--media-button-icon-width);\n height: var(--media-button-icon-height, var(--media-control-height, 24px));\n transform: var(--media-button-icon-transform);\n transition: var(--media-button-icon-transition);\n fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));\n vertical-align: middle;\n max-width: 100%;\n max-height: 100%;\n min-width: 100%;\n }\n\n media-tooltip {\n ','\n max-width: 0;\n overflow-x: clip;\n opacity: 0;\n transition: opacity .3s, max-width 0s 9s;\n }\n\n :host(:hover) media-tooltip,\n :host(:focus-visible) media-tooltip {\n max-width: 100vw;\n opacity: 1;\n transition: opacity .3s;\n }\n\n :host([notooltip]) slot[name="tooltip"] {\n display: none;\n }\n </style>
2\n\n ',this.getSlotTemplateHTML(t,e),'\n\n <slot name="tooltip">\n <media-tooltip part="tooltip" aria-hidden="true">\n <template shadowrootmode="').concat($i.shadowRootOptions.mode,'">\n ').concat($i.getTemplateHTML({}),'\n </template>\n <slot name="tooltip-content">\n ').concat(this.getTooltipContentHTML(t),"\n </slot>\n </media-tooltip>\n </slot>\n ")},rr.getSlotTemplateHTML=function(t,e){return"\n <slot></slot>\n "},rr.getTooltipContentHTML=function(){return""},pt.customElements.get("media-chrome-button")||pt.customElements.define("media-chrome-button",rr);function sr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var ar='<svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>\n</svg>\n';var or=function(t){var label=t.mediaIsAirplaying?Q("stop airplay"):Q("start airplay");t.setAttribute("aria-label",label)},lr=function(t){Object(l.a)(n,t);var e=sr(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),or(this)}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_IS_AIRPLAYING&&or(this)}},{key:"mediaIsAirplaying",get:function(){return Ut(this,_.MEDIA_IS_AIRPLAYING)},set:function(t){Bt(this,_.MEDIA_IS_AIRPLAYING,t)}},{key:"mediaAirplayUnavailable",get:function(){return $t(this,_.MEDIA_AIRPLAY_UNAVAILABLE)},set:function(t){Vt(this,_.MEDIA_AIRPLAY_UNAVAILABLE,t)}},{key:"handleClick",value:function(){var t=new pt.CustomEvent(y.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_IS_AIRPLAYING,_.MEDIA_AIRPLAY_UNAVAILABLE])}}]),n}(rr);lr.getSlotTemplateHTML=function(t){return"\n <style>\n :host([".concat(_.MEDIA_IS_AIRPLAYING,"]) slot[name=icon] slot:not([name=exit]) {\n display: none !important;\n }\n\n ","\n :host(:not([").concat(_.MEDIA_IS_AIRPLAYING,"])) slot[name=icon] slot:not([name=enter]) {\n display: none !important;\n }\n\n :host([").concat(_.MEDIA_IS_AIRPLAYING,"]) slot[name=tooltip-enter],\n :host(:not([").concat(_.MEDIA_IS_AIRPLAYING,'])) slot[name=tooltip-exit] {\n display: none;\n }\n </style>\n\n <slot name="icon">\n <slot name="enter">').concat(ar,'</slot>\n <slot name="exit">').concat(ar,"</slot>\n </slot>\n ")},lr.getTooltipContentHTML=function(){return'\n <slot name="tooltip-enter">'.concat(Q("start airplay"),'</slot>\n <slot name="tooltip-exit">').concat(Q("stop airplay"),"</slot>\n ")},pt.customElements.get("media-airplay-button")||pt.customElements.define("media-airplay-button",lr);function cr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var ur=function(t){t.setAttribute("aria-checked",Xe(t).toString())},dr=function(t){Object(l.a)(n,t);var e=cr(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}
2return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.setAttribute("role","button"),this.setAttribute("aria-label",Q("closed captions")),ur(this)}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_SUBTITLES_SHOWING&&ur(this)}},{key:"mediaSubtitlesList",get:function(){return fr(this,_.MEDIA_SUBTITLES_LIST)},set:function(t){pr(this,_.MEDIA_SUBTITLES_LIST,t)}},{key:"mediaSubtitlesShowing",get:function(){return fr(this,_.MEDIA_SUBTITLES_SHOWING)},set:function(t){pr(this,_.MEDIA_SUBTITLES_SHOWING,t)}},{key:"handleClick",value:function(){this.dispatchEvent(new pt.CustomEvent(y.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_SUBTITLES_LIST,_.MEDIA_SUBTITLES_SHOWING])}}]),n}(rr);dr.getSlotTemplateHTML=function(t){return'\n <style>\n :host([aria-checked="true"]) slot[name=off] {\n display: none !important;\n }\n\n '.concat('\n :host(:not([aria-checked="true"])) slot[name=on] {\n display: none !important;\n }\n\n :host([aria-checked="true"]) slot[name=tooltip-enable],\n :host(:not([aria-checked="true"])) slot[name=tooltip-disable] {\n display: none;\n }\n </style>\n\n <slot name="icon">\n <slot name="on">','<svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>\n</svg>','</slot>\n <slot name="off">').concat('<svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>\n</svg>',"</slot>\n </slot>\n ")},dr.getTooltipContentHTML=function(){return'\n <slot name="tooltip-enable">'.concat(Q("Enable captions"),'</slot>\n <slot name="tooltip-disable">').concat(Q("Disable captions"),"</slot>\n ")};var fr=function(t,e){var n=t.getAttribute(e);return n?He(n):[]},pr=function(t,e,n){if(null==n?void 0:n.length){var r=qe(n);t.getAttribute(e)!==r&&t.setAttribute(e,r)}else t.removeAttribute(e)};pt.customElements.get("media-captions-button")||pt.customElements.define("media-captions-button",dr);function mr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var gr=function(t){var label=t.mediaIsCasting?Q("stop casting"):Q("start casting");t.setAttribute("aria-label",label)},vr=function(t){Object(l.a)(n,t);var e=mr(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}
2return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),gr(this)}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_IS_CASTING&&gr(this)}},{key:"mediaIsCasting",get:function(){return Ut(this,_.MEDIA_IS_CASTING)},set:function(t){Bt(this,_.MEDIA_IS_CASTING,t)}},{key:"mediaCastUnavailable",get:function(){return $t(this,_.MEDIA_CAST_UNAVAILABLE)},set:function(t){Vt(this,_.MEDIA_CAST_UNAVAILABLE,t)}},{key:"handleClick",value:function(){var t=this.mediaIsCasting?y.MEDIA_EXIT_CAST_REQUEST:y.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new pt.CustomEvent(t,{composed:!0,bubbles:!0}))}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_IS_CASTING,_.MEDIA_CAST_UNAVAILABLE])}}]),n}(rr);vr.getSlotTemplateHTML=function(t){return"\n <style>\n :host([".concat(_.MEDIA_IS_CASTING,"]) slot[name=icon] slot:not([name=exit]) {\n display: none !important;\n }\n\n ","\n :host(:not([").concat(_.MEDIA_IS_CASTING,"])) slot[name=icon] slot:not([name=enter]) {\n display: none !important;\n }\n\n :host([").concat(_.MEDIA_IS_CASTING,"]) slot[name=tooltip-enter],\n :host(:not([").concat(_.MEDIA_IS_CASTING,'])) slot[name=tooltip-exit] {\n display: none;\n }\n </style>\n\n <slot name="icon">\n <slot name="enter">').concat('<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>','</slot>\n <slot name="exit">').concat('<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',"</slot>\n </slot>\n ")},vr.getTooltipContentHTML=function(){return'\n <slot name="tooltip-enter">'.concat(Q("Start casting"),'</slot>\n <slot name="tooltip-exit">').concat(Q("Stop casting"),"</slot>\n ")},pt.customElements.get("media-cast-button")||pt.customElements.define("media-cast-button",vr);n(164);function yr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Er,Tr,kr,Sr,_r,Ar,Or,wr,Ir,Rr,Lr,xr,Dr,Cr,Pr,Mr=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},jr=function(t,e,n){return Mr(t,e,"read from private field"),n?n.call(t):e.get(t)},Fr=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Nr=function(t,e,n,r){return Mr(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},Ur=function(t,e,n){return Mr(t,e,"access private method"),n};var Br="open",$r="anchor",Vr=function(t){Object(l.a)(n,t);var e=yr(n);function n(){var t;return Object(o.a)(this,n),t=e.call(this),Fr(Object(nt.a)(t),Sr),Fr(Object(nt.a)(t),Ar),Fr(Object(nt.a)(t),wr),Fr(Object(nt.a)(t),Rr),Fr(Object(nt.a)(t),xr),Fr(Object(nt.a)(t),Cr),Fr(Object(nt.a)(t),Er,!1),Fr(Object(nt.a)(t),Tr,null),Fr(Object(nt.a)(t),kr,null),t}return Object(r.a)(n,[{key:"open",get:function(){return Ut(this,Br)},set:function(t){Bt(this,Br,t)}},{key:"handleEvent",value:function(t){switch(t.type){case"invoke":Ur(this,Rr,Lr).call(this,t);break;case"focusout":Ur(this,xr,Dr).call(this,t);break;case"keydown":Ur(this,Cr,Pr).call(this,t)}}},{key:"connectedCallback",value:function(){Ur(this,Sr,_r).call(this),this.role||(this.role="dialog"),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("invoke",this),this.removeEventListener("focusout",this),this.removeEventListener("keydown",this)}},{key:"attributeChangedCallback",value:function(t,e,n){Ur(this,Sr,_r).call(this),t===Br&&n!==e&&(this.open?Ur(this,Ar,Or).call(this):Ur(this,wr,Ir).call(this))}},{key:"focus",value:function(){Nr(this,Tr,Dt());var t=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),e=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(!t&&!e){var n=this.querySelector('[autofocus], [tabindex]:not
2([tabindex="-1"]), [role="menu"]');null==n||n.focus()}}},{key:"keysUsed",get:function(){return["Escape","Tab"]}}],[{key:"observedAttributes",get:function(){return[Br,$r]}}]),n}(pt.HTMLElement);Er=new WeakMap,Tr=new WeakMap,kr=new WeakMap,Sr=new WeakSet,_r=function(){var t=this;if(!jr(this,Er)&&(Nr(this,Er,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);var e=At(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e),queueMicrotask((function(){Mt(t.shadowRoot,":host").style.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")}))}},Ar=new WeakSet,Or=function(){var t,e=this;null==(t=jr(this,kr))||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",(function(){return e.focus()}),{once:!0})},wr=new WeakSet,Ir=function(){var t;null==(t=jr(this,kr))||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))},Rr=new WeakSet,Lr=function(t){Nr(this,kr,t.relatedTarget),Lt(this,t.relatedTarget)||(this.open=!this.open)},xr=new WeakSet,Dr=function(t){var e;Lt(this,t.relatedTarget)||(null==(e=jr(this,Tr))||e.focus(),jr(this,kr)&&jr(this,kr)!==t.relatedTarget&&this.open&&(this.open=!1))},Cr=new WeakSet,Pr=function(t){var e,n,r,o,l,c=t.key,d=t.ctrlKey,h=t.altKey,f=t.metaKey;d||h||f||this.keysUsed.includes(c)&&(t.preventDefault(),t.stopPropagation(),"Tab"===c?(t.shiftKey?null==(n=null==(e=this.previousElementSibling)?void 0:e.focus)||n.call(e):null==(o=null==(r=this.nextElementSibling)?void 0:r.focus)||o.call(r),this.blur()):"Escape"===c&&(null==(l=jr(this,Tr))||l.focus(),this.open=!1))},Vr.shadowRootOptions={mode:"open"},Vr.getTemplateHTML=function(t){return"\n <style>\n :host {\n font: var(--media-font,\n var(--media-font-weight, normal)\n var(--media-font-size, 14px) /\n var(--media-text-content-height, var(--media-control-height, 24px))\n var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));\n color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n display: var(--media-dialog-display, inline-flex);\n justify-content: center;\n align-items: center;\n ".concat("\n transition-behavior: allow-discrete;\n visibility: hidden;\n opacity: 0;\n transform: translateY(2px) scale(.99);\n pointer-events: none;\n }\n\n :host([open]) {\n transition: display .2s, visibility 0s, opacity .2s ease-out, transform .15s ease-out;\n visibility: visible;\n opacity: 1;\n transform: translateY(0) scale(1);\n pointer-events: auto;\n }\n\n #content {\n display: flex;\n position: relative;\n box-sizing: border-box;\n width: min(320px, 100%);\n word-wrap: break-word;\n max-height: 100%;\n overflow: auto;\n text-align: center;\n line-height: 1.4;\n }\n </style>\n ",this.getSlotTemplateHTML(t),"\n ")},Vr.getSlotTemplateHTML=function(t){return'\n <slot id="content"></slot>\n '},pt.customElements.get("media-chrome-dialog")||pt.customElements.define("media-chrome-dialog",Vr);n(196),n(197);function Gr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Hr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function Hr(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Wr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Kr,qr,Yr,zr,Qr,Xr,Zr,Jr,ts,es,ns,is,rs,ss,as,os,ls,cs,us,ds,hs,fs,ps,ms,gs,vs=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},ys=function(t,e,n){return vs(t,e,"read from private field"),n?n.call(t):e.get(t)},bs=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Es=function(t,e,n,r){return vs(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},Ts=function(t,e,n){return vs(t,e,"access private method"),n};var ks=function(t){Object(l.a)(n,t);var e=Wr(n);function n(){var t;if(Object(o.a)(this,n),t=e.call(this),bs(Object(nt.a)(t),es),bs(Object(nt.a)(t),is),bs(Object(nt.a)(t),ss),bs(Object(nt.a)(t),os),bs(Object(nt.a)(t),
2cs),bs(Object(nt.a)(t),ds),bs(Object(nt.a)(t),fs),bs(Object(nt.a)(t),ms),bs(Object(nt.a)(t),Kr,void 0),bs(Object(nt.a)(t),qr,void 0),bs(Object(nt.a)(t),Yr,void 0),bs(Object(nt.a)(t),zr,void 0),bs(Object(nt.a)(t),Qr,{}),bs(Object(nt.a)(t),Xr,[]),bs(Object(nt.a)(t),Zr,(function(){t.range.matches(":focus-visible")&&Mt(t.shadowRoot,":host").style.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")})),bs(Object(nt.a)(t),Jr,(function(){Mt(t.shadowRoot,":host").style.removeProperty("--_focus-visible-box-shadow")})),bs(Object(nt.a)(t),ts,(function(){var e=t.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)})),!t.shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var r=At(t.attributes),html=t.constructor.getTemplateHTML(r);t.shadowRoot.setHTMLUnsafe?t.shadowRoot.setHTMLUnsafe(html):t.shadowRoot.innerHTML=html}return t.container=t.shadowRoot.querySelector("#container"),Es(Object(nt.a)(t),Yr,t.shadowRoot.querySelector("#startpoint")),Es(Object(nt.a)(t),zr,t.shadowRoot.querySelector("#endpoint")),t.range=t.shadowRoot.querySelector("#range"),t.appearance=t.shadowRoot.querySelector("#appearance"),t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,n){var r,o,l,c,d;t===T?(e&&(null==(o=null==(r=ys(this,Kr))?void 0:r.unassociateElement)||o.call(r,this),Es(this,Kr,null)),n&&this.isConnected&&(Es(this,Kr,null==(l=this.getRootNode())?void 0:l.getElementById(n)),null==(d=null==(c=ys(this,Kr))?void 0:c.associateElement)||d.call(c,this))):("disabled"===t||"aria-disabled"===t&&e!==n)&&(null==n?(this.range.removeAttribute(t),Ts(this,is,rs).call(this)):(this.range.setAttribute(t,n),Ts(this,ss,as).call(this)))}},{key:"connectedCallback",value:function(){var t,e,n;Mt(this.shadowRoot,":host").style.setProperty("display","var(--media-control-display, var(--".concat(this.localName,"-display, inline-flex))")),ys(this,Qr).pointer=Mt(this.shadowRoot,"#pointer"),ys(this,Qr).progress=Mt(this.shadowRoot,"#progress"),ys(this,Qr).thumb=Mt(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),ys(this,Qr).activeSegment=Mt(this.shadowRoot,"#segments-clipping rect:nth-child(0)");var r=this.getAttribute(T);r&&(Es(this,Kr,null==(t=this.getRootNode())?void 0:t.getElementById(r)),null==(n=null==(e=ys(this,Kr))?void 0:e.associateElement)||n.call(e,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ys(this,Zr)),this.shadowRoot.addEventListener("focusout",ys(this,Jr)),Ts(this,is,rs).call(this),Tt(this.container,ys(this,ts))}},{key:"disconnectedCallback",value:function(){var t,e;Ts(this,ss,as).call(this),null==(e=null==(t=ys(this,Kr))?void 0:t.unassociateElement)||e.call(t,this),Es(this,Kr,null),this.shadowRoot.removeEventListener("focusin",ys(this,Zr)),this.shadowRoot.removeEventListener("focusout",ys(this,Jr)),kt(this.container,ys(this,ts))}},{key:"updatePointerBar",value:function(t){var e;null==(e=ys(this,Qr).pointer)||e.style.setProperty("width","".concat(100*this.getPointerRatio(t),"%"))}},{key:"updateBar",value:function(){var t,e,n=100*this.range.valueAsNumber;null==(t=ys(this,Qr).progress)||t.style.setProperty("width","".concat(n,"%")),null==(e=ys(this,Qr).thumb)||e.style.setProperty("left","".concat(n,"%"))}},{key:"updateSegments",value:function(t){var e=this.shadowRoot.querySelector("#segments-clipping");if(e.textContent="",this.container.classList.toggle("segments",!!(null==t?void 0:t.length)),null==t?void 0:t.length){var n=Object(tt.a)(new Set([+this.range.min].concat(Object(tt.a)(t.flatMap((function(s){return[s.start,s.end]}))),[+this.range.max])));Es(this,Xr,Object(tt.a)(n));var r,o=n.pop(),l=Gr(n.entries());try{for(l.s();!(r=l.n()).done;){var c=Object(m.a)(r.value,2),i=c[0],marker=c[1],d=0===i,h=i===n.length-1,f=d?"calc(var(--segments-gap) / -1)":"".concat(100*marker,"%"),v=h?o:n[i+1],y="calc(".concat(100*(v-marker),"%").concat(d||h?"":" - var(--segments-gap)",")"),E=mt.createElementNS("http://www.w3.org/2000/svg","rect"),T=jt(this.shadowRoot,"#segments-clipping rect:nth-child(".concat(i+1,")"));T.style.setProperty("x",f),T.style.setProperty("width",y),e.append(E)}}catch(t){l.e(t)}finally{l.f()}}}},{key:"getPointerRatio",value:function(t){return function(t,e,n,r){var o=r.x-n.x,l=r.y-n.y,c=o*o+l*l;if(0===c)return 0;var d=((t-n.x)*o+(e-n.y)*l)/c;return Math.max(0,Math.min(1,d))}(t.clientX,t.clientY,ys(this,Yr).getBoundingClientRect(),ys(this,zr).getBoundingClientRect())}},{key:"dragging",get:function(){return this.hasAttribute("dragging")}},{key:"handleEvent",value:function(t){switch(t.type){case"pointermove":Ts(this,ms,gs).call(this,t);break;case"input":this.updateBar();break;case"pointerenter":Ts(this,cs,us).call(this,t);break;case"pointerdown":Ts(this,os,ls).call(this,t);break;case"pointerup":Ts(this,ds,hs).call(this);break;case"pointerleave":Ts(this,fs,ps).call(this)}}},{key:"keysUsed",get:function(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}}],[{key:"observedAttributes",get:function(){return["disabled","aria-disabled",T]}}]),n}(pt.HTMLElement);Kr=new WeakMap,qr=new WeakMap,Yr=new WeakMap,zr=new WeakMap,Qr=new WeakMap,Xr=new WeakMap,Zr=ne
2w WeakMap,Jr=new WeakMap,ts=new WeakMap,es=new WeakSet,ns=function(t){var e=ys(this,Qr).activeSegment;if(e){var n=this.getPointerRatio(t),r=ys(this,Xr).findIndex((function(t,i,e){var r=e[i+1];return null!=r&&n>=t&&n<=r})),o="#segments-clipping rect:nth-child(".concat(r+1,")");e.selectorText==o&&e.style.transform||(e.selectorText=o,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))}},is=new WeakSet,rs=function(){!this.hasAttribute("disabled")&&this.isConnected&&(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))},ss=new WeakSet,as=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),this.removeEventListener("pointerleave",this),null==(t=pt.window)||t.removeEventListener("pointerup",this),null==(e=pt.window)||e.removeEventListener("pointermove",this)},os=new WeakSet,ls=function(t){var e;Es(this,qr,t.composedPath().includes(this.range)),null==(e=pt.window)||e.addEventListener("pointerup",this,{once:!0})},cs=new WeakSet,us=function(t){var e;"mouse"!==t.pointerType&&Ts(this,os,ls).call(this,t),this.addEventListener("pointerleave",this,{once:!0}),null==(e=pt.window)||e.addEventListener("pointermove",this)},ds=new WeakSet,hs=function(){var t;null==(t=pt.window)||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")},fs=new WeakSet,ps=function(){var t,e;this.removeEventListener("pointerleave",this),null==(t=pt.window)||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),null==(e=ys(this,Qr).activeSegment)||e.style.removeProperty("transform")},ms=new WeakSet,gs=function(t){"pen"===t.pointerType&&0===t.buttons||(this.toggleAttribute("dragging",1===t.buttons||"mouse"!==t.pointerType),this.updatePointerBar(t),Ts(this,es,ns).call(this,t),!this.dragging||"mouse"===t.pointerType&&ys(this,qr)||(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))},ks.shadowRootOptions={mode:"open"},ks.getTemplateHTML=function(t){return"\n <style>\n :host {\n --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));\n --_media-range-padding: var(--media-range-padding, var(--media-control-padding, 10px));\n\n box-shadow: var(--_focus-visible-box-shadow, none);\n background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));\n height: calc(var(--media-control-height, 24px) + 2 * var(--_media-range-padding));\n display: inline-flex;\n align-items: center;\n ".concat("\n vertical-align: middle;\n box-sizing: border-box;\n position: relative;\n width: 100px;\n transition: background .15s linear;\n cursor: var(--media-cursor, pointer);\n pointer-events: auto;\n touch-action: none; ","\n }\n\n ","\n input[type=range]:focus {\n outline: 0;\n }\n input[type=range]:focus::-webkit-slider-runnable-track {\n outline: 0;\n }\n\n :host(:hover) {\n background: var(--media-control-hover-background, rgb(50 50 70 / .7));\n }\n\n #leftgap {\n padding-left: var(--media-range-padding-left, var(--_media-range-padding));\n }\n\n #rightgap {\n padding-right: var(--media-range-padding-right, var(--_media-range-padding));\n }\n\n #startpoint,\n #endpoint {\n position: absolute;\n }\n\n #endpoint {\n right: 0;\n }\n\n #container {\n ","\n width: var(--media-range-track-width, 100%);\n transform: translate(var(--media-range-track-translate-x, 0px), var(--media-range-track-translate-y, 0px));\n position: relative;\n height: 100%;\n display: flex;\n align-items: center;\n min-width: 40px;\n }\n\n #range {\n ","\n display: var(--media-time-range-hover-display, block);\n bottom: var(--media-time-range-hover-bottom, 0);\n height: var(--media-time-range-hover-height, max(100% , 25px));\n width: 100%;\n position: absolute;\n cursor: var(--media-cursor, pointer);\n\n -webkit-appearance: none; ","\n -webkit-tap-highlight-color: transparent;\n background: transparent; ","\n margin: 0;\n z-index: 1;\n }\n\n @media (hover: hover) {\n #range {\n bottom: var(--media-time-range-hover-bottom, 0);\n height: var(--media-time-range-hover-height, max(100%, 20px));\n }\n }\n\n ","\n ","\n #range::-webkit-slider-thumb {\n -webkit-appearance: none;\n background: transparent;\n width: .1px;\n height: .1px;\n }\n\n ","\n #range::-moz-range-thumb {\n background: transparent;\n border: transparent;\n width: .1px;\n height: .1px;\n }\n\n #appearance {\n height: var(--media-range-track-height, 4px);\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n position: absolute;\n ",'\n will-change: transform;\n }\n\n #track {\n background: var(--media-range-track-background, rgb(255 255 255 / .2));\n border-radius: var(--media-range-track-border-radius, 1px);\n border: var(--media-range-track-border, none);\n outline: var(--media-range-track-outline);\n outline-offset: var(--media-range-track-outline-offset);\n backdrop-filter: var(--media-range-track-backdrop-filter);\n -webkit-backdrop-filter: var(--media-range-track-backdrop-filter);
2\n box-shadow: var(--media-range-track-box-shadow, none);\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n\n #progress,\n #pointer {\n position: absolute;\n height: 100%;\n will-change: width;\n }\n\n #progress {\n background: var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)));\n transition: var(--media-range-track-transition);\n }\n\n #pointer {\n background: var(--media-range-track-pointer-background);\n border-right: var(--media-range-track-pointer-border-right);\n transition: visibility .25s, opacity .25s;\n visibility: hidden;\n opacity: 0;\n }\n\n @media (hover: hover) {\n :host(:hover) #pointer {\n transition: visibility .5s, opacity .5s;\n visibility: visible;\n opacity: 1;\n }\n }\n\n #thumb,\n ::slotted([slot=thumb]) {\n width: var(--media-range-thumb-width, 10
2px);\n height: var(--media-range-thumb-height, 10px);\n transition: var(--media-range-thumb-transition);\n transform: var(--media-range-thumb-transform, none);\n opacity: var(--media-range-thumb-opacity, 1);\n translate: -50%;\n position: absolute;\n left: 0;\n cursor: var(--media-cursor, pointer);\n }\n\n #thumb {\n border-radius: var(--media-range-thumb-border-radius, 10px);\n background: var(--media-range-thumb-background, var(--media-primary-color, rgb(238 238 238)));\n box-shadow: var(--media-range-thumb-box-shadow, 1px 1px 1px transparent);\n border: var(--media-range-thumb-border, none);\n }\n\n :host([disabled]) #thumb {\n background-color: #777;\n }\n\n .segments #appearance {\n height: var(--media-range-segment-hover-height, 7px);\n }\n\n #track {\n clip-path: url(#segments-clipping);\n }\n\n #segments {\n --segments-gap: var(--media-range-segments-gap, 2px);\n position: absolute;\n width: 100%;\n height: 100%;\n }\n\n #segments-clipping {\n transform: translateX(calc(var(--segments-gap) / 2));\n }\n\n #segments-clipping:empty {\n display: none;\n }\n\n #segments-clipping rect {\n height: var(--media-range-track-height, 4px);\n y: calc((var(--media-range-segment-hover-height, 7px) - var(--media-range-track-height, 4px)) / 2);\n transition: var(--media-range-segment-transition, transform .1s ease-in-out);\n transform: var(--media-range-segment-transform, scaleY(1));\n transform-origin: center;\n }\n\n /* Visible label for accessibility - positioned off-screen but technically visible (Firefox requires visible labels) */\n #range-label {\n position: absolute;\n left: -10000px;\n background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));\n pointer-events: none;\n }\n </style>\n <div id="leftgap"></div>\n <div id="container">\n <div id="startpoint"></div>\n <div id="endpoint"></div>\n <div id="appearance">\n <div id="track" part="track">\n <div id="pointer"></div>\n <div id="progress" part="progress"></div>\n </div>\n <slot name="thumb">\n <div id="thumb" part="thumb"></div>\n </slot>\n <svg id="segments" aria-hidden="true"><clipPath id="segments-clipping"></clipPath></svg>\n </div>
2\n <input id="range" type="range" min="0" max="1" step="any" value="0">\n <label for="range" id="range-label"></label>\n\n ',this.getContainerTemplateHTML(t),'\n </div>\n <div id="rightgap"></div>\n ')},ks.getContainerTemplateHTML=function(t){return""},pt.customElements.get("media-chrome-range")||pt.customElements.define("media-chrome-range",ks);function Ss(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var _s,As=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Os=function(t,e,n){return As(t,e,"read from private field"),n?n.call(t):e.get(t)},ws=function(t,e,n,r){return As(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n};var Is=function(t){Object(l.a)(n,t);var e=Ss(n);function n(){var t;if(Object(o.a)(this,n),t=e.call(this),function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)}(Object(nt.a)(t),_s,void 0),!t.shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var r=At(t.attributes);t.shadowRoot.innerHTML=t.constructor.getTemplateHTML(r)}return t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,n){var r,o,l,c,d;t===T&&(e&&(null==(o=null==(r=Os(this,_s))?void 0:r.unassociateElement)||o.call(r,this),ws(this,_s,null)),n&&this.isConnected&&(ws(this,_s,null==(l=this.getRootNode())?void 0:l.getElementById(n)),null==(d=null==(c=Os(this,_s))?void 0:c.associateElement)||d.call(c,this)))}},{key:"connectedCallback",value:function(){var t,e,n,r=this.getAttribute(T);r&&(ws(this,_s,null==(t=this.getRootNode())?void 0:t.getElementById(r)),null==(n=null==(e=Os(this,_s))?void 0:e.associateElement)||n.call(e,this))}},{key:"disconnectedCallback",value:function(){var t,e;null==(e=null==(t=Os(this,_s))?void 0:t.unassociateElement)||e.call(t,this),ws(this,_s,null)}}],[{key:"observedAttributes",get:function(){return[T]}}]),n}(pt.HTMLElement);_s=new WeakMap,Is.shadowRootOptions={mode:"open"},Is.getTemplateHTML=function(t){return"\n <style>\n :host {\n ".concat('\n box-sizing: border-box;\n display: var(--media-control-display, var(--media-control-bar-display, inline-flex));\n color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n --media-loading-indicator-icon-height: 44px;\n }\n\n ::slotted(media-time-range),\n ::slotted(media-volume-range) {\n min-height: 100%;\n }\n\n ::slotted(media-time-range),\n ::slotted(media-clip-selector) {\n flex-grow: 1;\n }\n\n ::slotted([role="menu"]) {\n position: absolute;\n }\n </style>\n\n <slot></slot>\n ')},pt.customElements.get("media-control-bar")||pt.customElements.define("media-control-bar",Is);function Rs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ls,xs=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Ds=function(t,e,n){return xs(t,e,"read from private field"),n?n.call(t):e.get(t)},Cs=function(t,e,n,r){return xs(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n};var Ps=function(t){Object(l.a)(n,t);var e=Rs(n);function n(){var t;if(Object(o.a)(this,n),t=e.call(this),function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)}(Object(nt.a)(t),Ls,void 0),!t.shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var r=At(t.attributes);t.shadowRoot.innerHTML=t.constructor.getTemplateHTML(r)}return t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,n){var r,o,l,c,d;t===T&&(e&&(null==(o=null==(r=Ds(this,Ls))?void 0:r.unassociateElement)||o.call(r,this),Cs(this,Ls,null)),n&&this.isConnected&&(Cs(this,Ls,null==(l=this.getRootNode())?void 0:l.getElementById(n)),null==(d=null==(c=Ds(this,Ls))?void 0:c.associateElement)||d.call(c,this)))}},{key:"connectedCallback",value:function(){var t,e,n;Mt(this.shadowRoot,":host").style.setProperty("display","var(--media-control-display, var(--".concat(this.localName,"-display, inline-flex))"));var r=this.getAttribute(T);r&&(Cs(this,Ls,null==(t=this.getRootNode())?void 0:t.getElementById(r)),null==(n=null==(e=Ds(this,Ls))?void 0:e.associateElement)||n.call(e,this))}},{key:"disconnectedCallback",value:function(){var t,e;null==(e=null==(t=Ds(this,Ls))?void 0:t.unassociateElement)||e.call(t,this),Cs(this,Ls,null)}}],[{key:"observedAttributes",get:function(){return[T]}}]),n}(pt.HTMLElement);Ls=new WeakMap,Ps.shadowRootOptions={mode:"open"},Ps.getTemplateHTML=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"\n <style>\n :host {\n font: var(--media-font,\n var(--media-font-weight, normal)\n var(--media-font-size, 14px) /\n var(--media-text-content-height, var(--media-control-height, 24px))\n var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));\n color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n background: var(--media-text-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7))));\n padding: var(--media-control-padding, 10px);\n display: inline-flex;\n justify-content: center;\n align-items: center;\n vertical-align: middle;\n box-sizing: border-box;\n text-align: center;\n pointer-events: auto;\n }\n\n ".concat("\n :host(:focus-visible) {\n box-shadow: var(--media-focus-box-sha
2dow, inset 0 0 0 2px rgb(27 127 204 / .9));\n outline: 0;\n }\n\n ","\n :host(:where(:focus)) {\n box-shadow: none;\n outline: 0;\n }\n </style>\n\n ",this.getSlotTemplateHTML(t,e),"\n ")},Ps.getSlotTemplateHTML=function(t,e){return"\n <slot></slot>\n "},pt.customElements.get("media-text-display")||pt.customElements.define("media-text-display",Ps);function Ms(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var js,Fs=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Ns=function(t,e,n){return Fs(t,e,"read from private field"),n?n.call(t):e.get(t)};var Us=function(t){Object(l.a)(n,t);var e=Ms(n);function n(){var t,r,l,c,d,h;return Object(o.a)(this,n),t=e.call(this),function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)}(Object(nt.a)(t),js,void 0),l=Object(nt.a)(t),c=js,d=t.shadowRoot.querySelector("slot"),Fs(l,c,"write to private field"),h?h.call(l,d):c.set(l,d),Ns(Object(nt.a)(t),js).textContent=J(null!=(r=t.mediaDuration)?r:0),t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,r){t===_.MEDIA_DURATION&&(Ns(this,js).textContent=J(+r)),Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r)}},{key:"mediaDuration",get:function(){return Ft(this,_.MEDIA_DURATION)},set:function(time){Nt(this,_.MEDIA_DURATION,time)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_DURATION])}}]),n}(Ps);js=new WeakMap,Us.getSlotTemplateHTML=function(t,e){return"\n <slot>".concat(J(e.mediaDuration),"</slot>\n ")},pt.customElements.get("media-duration-display")||pt.customElements.define("media-duration-display",Us);var Bs={2:Q("Network Error"),3:Q("Decode Error"),4:Q("Source Not Supported"),5:Q("Encryption
2Error")},$s={2:Q("A network error caused the media download to fail."),3:Q("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:Q("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:Q("The media is encrypted and there are no keys to decrypt it.")},Vs=function(t){var e,n;return 1===t.code?null:{title:null!=(e=Bs[t.code])?e:"Error ".concat(t.code),message:null!=(n=$s[t.code])?n:t.message}};function Gs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Hs,Ws=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Ks=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};function qs(t){var e,n=null!=(e=Vs(t))?e:{},title=n.title,r=n.message,html="";return title&&(html+='<slot name="error-'.concat(t.code,'-title"><h3>').concat(title,"</h3></slot>")),r&&(html+='<slot name="error-'.concat(t.code,'-message"><p>').concat(r,"</p></slot>")),html}var Ys=[_.MEDIA_ERROR_CODE,_.MEDIA_ERROR_MESSAGE],zs=function(t){Object(l.a)(n,t);var e=Gs(n);function n(){var t;return Object(o.a)(this,n),t=e.apply(this,arguments),Ks(Object(nt.a)(t),Hs,null),t}return Object(r.a)(n,[{key:"formatErrorMessage",value:function(t){return this.constructor.formatErrorMessage(t)}},{key:"attributeChangedCallback",value:function(t,e,r){var o;if(Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),Ys.includes(t)){var l,c=null!=(o=this.mediaError)?o:{code:this.mediaErrorCode,message:this.mediaErrorMessage};if(this.open=(l=c).code&&null!==Vs(l),this.open&&(this.shadowRoot.querySelector("slot").name="error-".concat(this.mediaErrorCode),this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(c),!this.hasAttribute("aria-label"))){var title=Vs(c).title;title&&this.setAttribute("aria-label",title)}}}},{key:"mediaError",get:function(){return Ws(t=this,e=Hs,"read from private field"),n?n.call(t):e.get(t);var t,e,n},set:function(t){!function(t,e,n,r){Ws(t,e,"write to private field"),r?r.call(t,n):e.set(t,n)}(this,Hs,t)}},{key:"mediaErrorCode",get:function(){return Ft(this,"mediaerrorcode")},set:function(t){Nt(this,"mediaerrorcode",t)}},{key:"mediaErrorMessage",get:function(){return $t(this,"mediaerrormessage")},set:function(t){Vt(this,"mediaerrormessage",t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),Ys)}}]),n}(Vr);Hs=new WeakMap,zs.getSlotTemplateHTML=function(t){return'\n <style>\n :host {\n background: rgb(20 20 30 / .8);\n }\n\n #content {\n display: block;\n padding: 1.2em 1.5em;\n }\n\n h3,\n p {\n margin-block: 0 .3em;\n }\n </style>\n <slot name="error-'.concat(t.mediaerrorcode,'" id="content">\n ').concat(qs({code:+t.mediaerrorcode,message:t.mediaerrormessage}),"\n </slot>\n ")},zs.formatErrorMessage=qs,pt.customElements.get("media-error-dialog")||pt.customElements.define("media-error-dialog",zs);function Qs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Xs,Zs,Js=function(t,e,n){return function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)}(t,e,"read from private field"),n?n.call(t):e.get(t)},ta=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};var ea=function(t){Object(l.a)(n,t);var e=Qs(n);function n(){var t;return Object(o.a)(this,n),t=e.apply(this,arguments),ta(Object(nt.a)(t),Xs,(function(e){var n;if(t.open){var content=null==(n=t.shadowRoot)?void 0:n.querySelector("#content");
2if(content){var path=e.composedPath(),r=path[0]===Object(nt.a)(t)||path.includes(Object(nt.a)(t)),o=path.includes(content);r&&!o&&(t.open=!1)}}})),ta(Object(nt.a)(t),Zs,(function(e){if(t.open){var n=e.shiftKey&&("/"===e.key||"?"===e.key);"Escape"!==e.key&&!n||e.ctrlKey||e.altKey||e.metaKey||(t.open=!1,e.preventDefault(),e.stopPropagation())}})),t}return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.open&&(this.addEventListener("click",Js(this,Xs)),document.addEventListener("keydown",Js(this,Zs)))}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",Js(this,Xs)),document.removeEventListener("keydown",Js(this,Zs))}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),"open"===t&&(this.open?(this.addEventListener("click",Js(this,Xs)),document.addEventListener("keydown",Js(this,Zs))):(this.removeEventListener("click",Js(this,Xs)),document.removeEventListener("keydown",Js(this,Zs))))}}]),n}(Vr);Xs=new WeakMap,Zs=new WeakMap,ea.getSlotTemplateHTML=function(t){return"\n <style>\n :host {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 9999;\n background: rgb(20 20 30 / .8);\n backdrop-filter: blur(10px);\n }\n\n #content {\n display: block;\n width: clamp(400px, 40vw, 700px);\n max-width: 90vw;\n text-align: left;\n }\n\n h2 {\n margin: 0 0 1.5rem 0;\n font-size: 1.5rem;\n font-weight: 500;\n text-align: center;\n }\n\n .shortcuts-table {\n width: 100%;\n border-collapse: collapse;\n }\n\n .shortcuts-table tr {\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n }\n\n .shortcuts-table tr:last-child {\n border-bottom: none;\n }\n\n .shortcuts-table td {\n padding: 0.75rem 0.5rem;\n }\n\n .shortcuts-table td:first-child {\n text-align: right;\n padding-right: 1rem;\n width: 40%;\n min-width: 120px;\n }\n\n .shortcuts-table td:last-child {\n padding-left: 1rem;\n }\n\n .key {\n display: inline-block;\n background: rgba(255, 255, 255, 0.15);\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 4px;\n padding: 0.25rem 0.5rem;\n font-family: 'Courier New', monospace;\n font-size: 0.9rem;\n font-weight: 500;\n min-width: 1.5rem;\n text-align: center;\n margin: 0 0.2rem;\n }\n\n .description {\n color: rgba(255, 255, 255, 0.9);\n font-size: 0.95rem;\n }\n\n .key-combo {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 0.3rem;\n }\n\n .key-separator {\n color: rgba(255, 255, 255, 0.5);\n font-size: 0.9rem;\n }\n </style>\n <slot id=\"content\">\n ".concat((e=[{keys:["Space","k"],description:"Toggle Playback"},{keys:["m"],description:"Toggle mute"},{keys:["f"],description:"Toggle fullscreen"},{keys:["c"],description:"Toggle captions or subtitles, if available"},{keys:["p"],description:"Toggle Picture in Picture"},{keys:["â","j"],description:"Seek back 10s"},{keys:["â","l"],description:"Seek forward 10s"},{keys:["â"],description:"Turn volume up"},{keys:["â"],description:"Turn volume down"},{keys:["< (SHIFT+,)"],description:"Decrease playback rate"},{keys:["> (SHIFT+.)"],description:"Increase playback rate"}].map((function(t){var e=t.keys,n=t.description,r=e.map((function(t,e){return e>0?'<span class="key-separator">or</span><span class="key">'.concat(t,"</span>"):'<span class="key">'.concat(t,"</span>")})).join("");return'\n <tr>\n <td>\n <div class="key-combo">'.concat(r,'</div>\n </td>\n <td class="description">').concat(n,"</td>\n </tr>\n ")})).join(""),'\n <h2>Keyboard Shortcuts</h2>\n <table class="shortcuts-table">'.concat(e,"</table>\n ")),"\n </slot>\n ");var e},pt.customElements.get("media-keyboard-shortcuts-dialog")||pt.customElements.define("media-keyboard-shortcuts-dialog",ea);function na(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var ia,ra=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},sa=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};var aa=function(t){var label=t.mediaIsFullscreen?Q("exit fullscreen mode"):Q("enter fullscreen mode");t.setAttribute("aria-label",label)},oa=function(t){Object(l.a)(n,t);var e=na(n);function n(){var t;return Object(o.a)(this,n),t=e.apply(this,arguments),sa(Object(nt.a)(t),ia,null),t}
2return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),aa(this)}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_IS_FULLSCREEN&&aa(this)}},{key:"mediaFullscreenUnavailable",get:function(){return $t(this,_.MEDIA_FULLSCREEN_UNAVAILABLE)},set:function(t){Vt(this,_.MEDIA_FULLSCREEN_UNAVAILABLE,t)}},{key:"mediaIsFullscreen",get:function(){return Ut(this,_.MEDIA_IS_FULLSCREEN)},set:function(t){Bt(this,_.MEDIA_IS_FULLSCREEN,t)}},{key:"handleClick",value:function(t){var e,n,r,o;r=t,ra(e=this,n=ia,"write to private field"),o?o.call(e,r):n.set(e,r);var l=function(t,e,n){return ra(t,e,"read from private field"),n?n.call(t):e.get(t)}(this,ia)instanceof PointerEvent,c=this.mediaIsFullscreen?new pt.CustomEvent(y.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new pt.CustomEvent(y.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:l});this.dispatchEvent(c)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_IS_FULLSCREEN,_.MEDIA_FULLSCREEN_UNAVAILABLE])}}]),n}(rr);ia=new WeakMap,oa.getSlotTemplateHTML=function(t){return"\n <style>\n :host([".concat(_.MEDIA_IS_FULLSCREEN,"]) slot[name=icon] slot:not([name=exit]) {\n display: none !important;\n }\n\n ","\n :host(:not([").concat(_.MEDIA_IS_FULLSCREEN,"])) slot[name=icon] slot:not([name=enter]) {\n display: none !important;\n }\n\n :host([").concat(_.MEDIA_IS_FULLSCREEN,"]) slot[name=tooltip-enter],\n :host(:not([").concat(_.MEDIA_IS_FULLSCREEN,'])) slot[name=tooltip-exit] {\n display: none;\n }\n </style>\n\n <slot name="icon">\n <slot name="enter">').concat('<svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>\n</svg>','</slot>\n <slot name="exit">').concat('<svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>\n</svg>',"</slot>\n </slot>\n ")},oa.getTooltipContentHTML=function(){return'\n <slot name="tooltip-enter">'.concat(Q("Enter fullscreen mode"),'</slot>\n <slot name="tooltip-exit">').concat(Q("Exit fullscreen mode"),"</slot>\n ")},pt.customElements.get("media-fullscreen-button")||pt.customElements.define("media-fullscreen-button",oa);function la(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var ca=_.MEDIA_TIME_IS_LIVE,ua=_.MEDIA_PAUSED,da=y.MEDIA_SEEK_TO_LIVE_REQUEST,ha=y.MEDIA_PLAY_REQUEST;var fa=function(t){var e,n=t.mediaPaused||!t.mediaTimeIsLive,label=Q(n?"seek to live":"playing live");t.setAttribute("aria-label",label);var r=null==(e=t.shadowRoot)?void 0:e.querySelector('slot[name="text"]');r&&(r.textContent=Q("live")),n?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},pa=function(t){Object(l.a)(n,t);var e=la(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),fa(this)}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),fa(this)}},{key:"mediaPaused",get:function(){return Ut(this,_.MEDIA_PAUSED)},set:function(t){Bt(this,_.MEDIA_PAUSED,t)}},{key:"mediaTimeIsLive",get:function(){return Ut(this,_.MEDIA_TIME_IS_LIVE)},set:function(t){Bt(this,_.MEDIA_TIME_IS_LIVE,t)}},{key:"handleClick",value:function(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new pt.CustomEvent(da,{composed:!0,bubbles:!0})),this.hasAttribute(ua)&&this.dispatchEvent(new pt.CustomEvent(ha,{composed:!0,bubbles:!0})))}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[ca,ua])}}]),n}(rr);pa.getSlotTemplateHTML=function(t){return"\n <style>\n :host { --media-tooltip-display: none; }\n \n slot[name=indicator] > *,\n :host ::slotted([slot=indicator]) {\n ".concat("\n min-width: auto;\n fill: var(--media-live-button-icon-color, rgb(140, 140, 140));\n color: var(--media-live-button-icon-color, rgb(140, 140, 140));\n }\n\n :host([",ca,"]:not([").concat(ua,"])) slot[name=indicator] > *,\n :host([").concat(ca,"]:not([").concat(ua,"])) ::slotted([slot=indicator]) {\n fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));\n color: var(--media-live-button-indicator-color, rgb(255, 0, 0));\n }\n\n :host([").concat(ca,"]:not([").concat(ua,'])) {\n cursor: var(--media-cursor, not-allowed);\n }\n\n slot[name=text]{\n text-transform: uppercase;\n }\n\n </style>\n\n <slot name="indicator">').concat('<svg viewBox="0 0 6 12" aria-hidden="true"><circle cx="3" cy="6" r="2"></circle></svg>',"</slot>\n ",'\n <slot name="spacer"> </slot><slot name="text">').concat(Q("live"),"</slot>\n ")},pt.customElements.get("media-live-button")||pt.customElements.define("media-live-button",pa);function ma(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var ga,va,ya=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},ba=function(t,e,n){return ya(t,e,"read from private field"),n?n.call(t):e.get(t)},Ea=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Ta=function(t,e,n,r){return ya(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n}
2,ka="loadingdelay",Sa="noautohide";var _a=function(t){Object(l.a)(n,t);var e=ma(n);function n(){var t;if(Object(o.a)(this,n),t=e.call(this),Ea(Object(nt.a)(t),ga,void 0),Ea(Object(nt.a)(t),va,500),!t.shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var r=At(t.attributes);t.shadowRoot.innerHTML=t.constructor.getTemplateHTML(r)}return t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,n){var r,o,l,c,d;t===ka&&e!==n?this.loadingDelay=Number(n):t===T&&(e&&(null==(o=null==(r=ba(this,ga))?void 0:r.unassociateElement)||o.call(r,this),Ta(this,ga,null)),n&&this.isConnected&&(Ta(this,ga,null==(l=this.getRootNode())?void 0:l.getElementById(n)),null==(d=null==(c=ba(this,ga))?void 0:c.associateElement)||d.call(c,this)))}},{key:"connectedCallback",value:function(){var t,e,n,r=this.getAttribute(T);r&&(Ta(this,ga,null==(t=this.getRootNode())?void 0:t.getElementById(r)),null==(n=null==(e=ba(this,ga))?void 0:e.associateElement)||n.call(e,this))}},{key:"disconnectedCallback",value:function(){var t,e;null==(e=null==(t=ba(this,ga))?void 0:t.unassociateElement)||e.call(t,this),Ta(this,ga,null)}},{key:"loadingDelay",get:function(){return ba(this,va)},set:function(t){Ta(this,va,t),Mt(this.shadowRoot,":host").style.setProperty("--_loading-indicator-delay","var(--media-loading-indicator-transition-delay, ".concat(t,"ms)"))}},{key:"mediaPaused",get:function(){return Ut(this,_.MEDIA_PAUSED)},set:function(t){Bt(this,_.MEDIA_PAUSED,t)}},{key:"mediaLoading",get:function(){return Ut(this,_.MEDIA_LOADING)},set:function(t){Bt(this,_.MEDIA_LOADING,t)}},{key:"mediaController",get:function(){return $t(this,T)},set:function(t){Vt(this,T,t)}},{key:"noAutohide",get:function(){return Ut(this,Sa)},set:function(t){Bt(this,Sa,t)}}],[{key:"observedAttributes",get:function(){return[T,_.MEDIA_PAUSED,_.MEDIA_LOADING,ka]}}]),n}(pt.HTMLElement);ga=new WeakMap,va=new WeakMap,_a.shadowRootOptions={mode:"open"},_a.getTemplateHTML=function(t){return"\n <style>\n :host {\n display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));\n vertical-align: middle;\n box-sizing: border-box;\n --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ".concat(500,"ms);\n }\n\n #status {\n color: rgba(0,0,0,0);\n width: 0px;\n height: 0px;\n }\n\n :host slot[name=icon] > *,\n :host ::slotted([slot=icon]) {\n opacity: var(--media-loading-indicator-opacity, 0);\n transition: opacity 0.15s;\n }\n\n :host([").concat(_.MEDIA_LOADING,"]:not([").concat(_.MEDIA_PAUSED,"])) slot[name=icon] > *,\n :host([").concat(_.MEDIA_LOADING,"]:not([").concat(_.MEDIA_PAUSED,"])) ::slotted([slot=icon]) {\n opacity: var(--media-loading-indicator-opacity, 1);\n transition: opacity 0.15s var(--_loading-indicator-delay);\n }\n\n :host #status {\n visibility: var(--media-loading-indicator-opacity, hidden);\n transition: visibility 0.15s;\n }\n\n :host([").concat(_.MEDIA_LOADING,"]:not([").concat(_.MEDIA_PAUSED,'])) #status {\n visibility: var(--media-loading-indicator-opacity, visible);\n transition: visibility 0.15s var(--_loading-indicator-delay);\n }\n\n svg, img, ::slotted(svg), ::slotted(img) {\n width: var(--media-loading-indicator-icon-width);\n height: var(--media-loading-indicator-icon-height, 100px);\n fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));\n vertical-align: middle;\n }\n </style>\n\n <slot name="icon">').concat('\n<svg aria-hidden="true" viewBox="0 0 100 100">\n <path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">\n <animateTransform\n attributeName="transform"\n attributeType="XML"\n type="rotate"\n dur="1s"\n from="0 50 50"\n to="360 50 50"\n repeatCount="indefinite" />\n </path>\n</svg>\n','</slot>\n <div id="status" role="status" aria-live="polite">').concat(Q("media loading"),"</div>\n ")},pt.customElements.get("media-loading-indicator")||pt.customElements.define("media-loading-indicator",_a);function Aa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Oa='<svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>\n</svg>';var wa=function(t){var e="off"===t.mediaVolumeLevel,label=Q(e?"unmute":"mute");t.setAttribute("aria-label",label)},Ia=function(t){Object(l.a)(n,t);var e=Aa(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}
2return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),wa(this)}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_VOLUME_LEVEL&&wa(this)}},{key:"mediaVolumeLevel",get:function(){return $t(this,_.MEDIA_VOLUME_LEVEL)},set:function(t){Vt(this,_.MEDIA_VOLUME_LEVEL,t)}},{key:"handleClick",value:function(){var t="off"===this.mediaVolumeLevel?y.MEDIA_UNMUTE_REQUEST:y.MEDIA_MUTE_REQUEST;this.dispatchEvent(new pt.CustomEvent(t,{composed:!0,bubbles:!0}))}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_VOLUME_LEVEL])}}]),n}(rr);Ia.getSlotTemplateHTML=function(t){return"\n <style>\n :host(:not([".concat(_.MEDIA_VOLUME_LEVEL,"])) slot[name=icon] slot:not([name=high]),\n :host([").concat(_.MEDIA_VOLUME_LEVEL,"=high]) slot[name=icon] slot:not([name=high]) {\n display: none !important;\n }\n\n :host([").concat(_.MEDIA_VOLUME_LEVEL,"=off]) slot[name=icon] slot:not([name=off]) {\n display: none !important;\n }\n\n :host([").concat(_.MEDIA_VOLUME_LEVEL,"=low]) slot[name=icon] slot:not([name=low]) {\n display: none !important;\n }\n\n :host([").concat(_.MEDIA_VOLUME_LEVEL,"=medium]) slot[name=icon] slot:not([name=medium]) {\n display: none !important;\n }\n\n :host(:not([").concat(_.MEDIA_VOLUME_LEVEL,"=off])) slot[name=tooltip-unmute],\n :host([").concat(_.MEDIA_VOLUME_LEVEL,'=off]) slot[name=tooltip-mute] {\n display: none;\n }\n </style>\n\n <slot name="icon">\n <slot name="off">').concat('<svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>\n</svg>','</slot>\n <slot name="low">').concat(Oa,'</slot>\n <slot name="medium">').concat(Oa,'</slot>\n <slot name="high">').concat('<svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>\n</svg>',"</slot>\n </slot>\n ")},Ia.getTooltipContentHTML=function(){return'\n <slot name="tooltip-mute">'.concat(Q("Mute"),'</slot>\n <slot name="tooltip-unmute">').concat(Q("Unmute"),"</slot>\n ")},pt.customElements.get("media-mute-button")||pt.customElements.define("media-mute-button",Ia);function Ra(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var La='<svg aria-hidden="true" viewBox="0 0 28 24">\n <path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>\n</svg>';var xa=function(t){var label=t.mediaIsPip?Q("exit picture in picture mode"):Q("enter picture in picture mode");t.setAttribute("aria-label",label)},Da=function(t){Object(l.a)(n,t);var e=Ra(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),xa(this)}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_IS_PIP&&xa(this)}},{key:"mediaPipUnavailable",get:function(){return $t(this,_.MEDIA_PIP_UNAVAILABLE)},set:function(t){Vt(this,_.MEDIA_PIP_UNAVAILABLE,t)}},{key:"mediaIsPip",get:function(){return Ut(this,_.MEDIA_IS_PIP)},set:function(t){Bt(this,_.MEDIA_IS_PIP,t)}},{key:"handleClick",value:function(){var t=this.mediaIsPip?y.MEDIA_EXIT_PIP_REQUEST:y.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new pt.CustomEvent(t,{composed:!0,bubbles:!0}))}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_IS_PIP,_.MEDIA_PIP_UNAVAILABLE])}}]),n}(rr);Da.getSlotTemplateHTML=function(t){return"\n <style>\n :host([".concat(_.MEDIA_IS_PIP,"]) slot[name=icon] slot:not([name=exit]) {\n display: none !important;\n }\n\n :host(:not([").concat(_.MEDIA_IS_PIP,"])) slot[name=icon] slot:not([name=enter]) {\n display: none !important;\n }\n\n :host([").concat(_.MEDIA_IS_PIP,"]) slot[name=tooltip-enter],\n :host(:not([").concat(_.MEDIA_IS_PIP,'])) slot[name=tooltip-exit] {\n display: none;\n }\n </style>\n\n <slot name="icon">\n <slot name="enter">').concat(La,'</slot>\n <slot name="exit">').concat(La,"</slot>\n </slot>\n ")},Da.getTooltipContentHTML=function(){return'\n <slot name="tooltip-enter">'.concat(Q("Enter picture in picture mode"),'</slot>\n <slot name="tooltip-exit">').concat(Q("Exit picture in picture mode"),"</slot>\n ")},pt.customElements.get("media-pip-button")||pt.customElements.define("media-pip-button",Da);function Ca(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Pa,Ma=function(t,e,n){return function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)}(t,e,"read from private field"),n?n.call(t):e.get(t)},ja="rates",Fa=[1,1.2,1.5,1.7,2];function Na(t){return Math.round(100*t)/100}var Ua=function(t){Object(l.a)(n,t);var e=Ca(n);function n(){var t,r;return Object(o.a)(this,n),t=e.call(this),function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)}(Object(nt.a)(t),Pa,new Ne(Object(nt.a)(t),ja,{defaultValue:Fa})),t.container=t.shadowRoot.querySelector('slot[name="icon"]'),t.container.innerHTML="".concat(Na(null!=(r=t.mediaPlaybackRate)?r:1),"x"),t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,r){if(Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===ja&&(Ma(this,Pa).value=r),t===_.MEDIA_PLAYBACK_RATE){var o=r?+r:Number.NaN,l=Na(Number.isNaN(o)?1:o);this.container.innerHTML="".concat(l,"x"),this.setAttribute("aria-label",Q("Playback rate {playbackRate}",{playbackRate:l}))}}},{key:"rates",get:function(){return Ma(this,Pa)},set:function(t){t?Array.isArray(t)?Ma(this,Pa).value=t.join(" "):"str
2ing"==typeof t&&(Ma(this,Pa).value=t):Ma(this,Pa).value=""}},{key:"mediaPlaybackRate",get:function(){return Ft(this,_.MEDIA_PLAYBACK_RATE,1)},set:function(t){Nt(this,_.MEDIA_PLAYBACK_RATE,t)}},{key:"handleClick",value:function(){var t,e,n=this,r=Array.from(Ma(this,Pa).values(),(function(t){return+t})).sort((function(a,b){return a-b})),o=null!=(e=null!=(t=r.find((function(t){return t>n.mediaPlaybackRate})))?t:r[0])?e:1,l=new pt.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:o});this.dispatchEvent(l)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_PLAYBACK_RATE,ja])}}]),n}(rr);Pa=new WeakMap,Ua.getSlotTemplateHTML=function(t){var e=t.mediaplaybackrate?Na(+t.mediaplaybackrate):1;return'\n <style>\n :host {\n min-width: 5ch;\n padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));\n }\n </style>\n <slot name="icon">'.concat(e,"x</slot>\n ")},Ua.getTooltipContentHTML=function(){return Q("Playback rate")},pt.customElements.get("media-playback-rate-button")||pt.customElements.define("media-playback-rate-button",Ua);function Ba(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var $a=function(t){var label=t.mediaPaused?Q("play"):Q("pause");t.setAttribute("aria-label",label)},Va=function(t){Object(l.a)(n,t);var e=Ba(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),$a(this)}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t!==_.MEDIA_PAUSED&&t!==_.MEDIA_LANG||$a(this)}},{key:"mediaPaused",get:function(){return Ut(this,_.MEDIA_PAUSED)},set:function(t){Bt(this,_.MEDIA_PAUSED,t)}},{key:"handleClick",value:function(){var t=this.mediaPaused?y.MEDIA_PLAY_REQUEST:y.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new pt.CustomEvent(t,{composed:!0,bubbles:!0}))}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_PAUSED,_.MEDIA_ENDED])}}]),n}(rr);Va.getSlotTemplateHTML=function(t){return"\n <style>\n :host([".concat(_.MEDIA_PAUSED,"]) slot[name=pause],\n :host(:not([").concat(_.MEDIA_PAUSED,"])) slot[name=play] {\n display: none !important;\n }\n\n :host([").concat(_.MEDIA_PAUSED,"]) slot[name=tooltip-pause],\n :host(:not([").concat(_.MEDIA_PAUSED,'])) slot[name=tooltip-play] {\n display: none;\n }\n </style>\n\n <slot name="icon">\n <slot name="play">').concat('<svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="m6 21 15-9L6 3v18Z"/>\n</svg>','</slot>\n <slot name="pause">').concat('<svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>\n</svg>',"</slot>\n </slot>\n ")},Va.getTooltipContentHTML=function(){return'\n <slot name="tooltip-play">'.concat(Q("Play"),'</slot>\n <slot name="tooltip-pause">').concat(Q("Pause"),"</slot>\n ")},pt.customElements.get("media-play-button")||pt.customElements.define("media-play-button",Va);function Ga(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ha="placeholdersrc",Wa="src";var Ka=function(t){Object(l.a)(n,t);var e=Ga(n);function n(){var t;if(Object(o.a)(this,n),!(t=e.call(this)).shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var r=At(t.attributes);t.shadowRoot.innerHTML=t.constructor.getTemplateHTML(r)}return t.image=t.shadowRoot.querySelector("#image"),t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,n){t===Wa&&(null==n?this.image.removeAttribute(Wa):this.image.setAttribute(Wa,n)),t===Ha&&
2(null==n?this.image.style.removeProperty("background-image"):function(t,image){t.style["background-image"]="url('".concat(image,"')")}(this.image,n))}},{key:"placeholderSrc",get:function(){return $t(this,Ha)},set:function(t){Vt(this,Wa,t)}},{key:"src",get:function(){return $t(this,Wa)},set:function(t){Vt(this,Wa,t)}}],[{key:"observedAttributes",get:function(){return[Ha,Wa]}}]),n}(pt.HTMLElement);Ka.shadowRootOptions={mode:"open"},Ka.getTemplateHTML=function(t){return'\n <style>\n :host {\n pointer-events: none;\n display: var(--media-poster-image-display, inline-block);\n box-sizing: border-box;\n }\n\n img {\n max-width: 100%;\n max-height: 100%;\n min-width: 100%;\n min-height: 100%;\n background-repeat: no-repeat;\n background-position: var(--media-poster-image-background-position, var(--media-object-position, center));\n background-size: var(--media-poster-image-background-size, var(--media-object-fit, contain));\n object-fit: var(--media-object-fit, contain);\n object-position: var(--media-object-position, center);\n }\n </style>\n\n <img part="poster img" aria-hidden="true" id="image"/>\n '},pt.customElements.get("media-poster-image")||pt.customElements.define("media-poster-image",Ka);function qa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ya,za=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Qa=function(t){Object(l.a)(n,t);var e=qa(n);function n(){var t,r,l,c,d;return Object(o.a)(this,n),t=e.call(this),function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)}(Object(nt.a)(t),Ya,void 0),r=Object(nt.a)(t),l=Ya,c=t.shadowRoot.querySelector("slot"),za(r,l,"write to private field"),d?d.call(r,c):l.set(r,c),t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,r){if(Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),(t===_.MEDIA_PREVIEW_CHAPTER||t===_.MEDIA_LANG)&&r!==e&&null!=r)if((l=this,c=Ya,za(l,c,"read from private field"),h?h.call(l):c.get(l)).textContent=r,""!==r){var o=Q("chapter: {chapterName}",{chapterName:r});this.setAttribute("aria-valuetext",o)}else this.removeAttribute("aria-valuetext");var l,c,h}},{key:"mediaPreviewChapter",get:function(){return $t(this,_.MEDIA_PREVIEW_CHAPTER)},set:function(t){Vt(this,_.MEDIA_PREVIEW_CHAPTER,t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_PREVIEW_CHAPTER,_.MEDIA_LANG])}}]),n}(Ps);Ya=new WeakMap,pt.customElements.get("media-preview-chapter-display")||pt.customElements.define("media-preview-chapter-display",Qa);n(170);function Xa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Za,Ja=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},to=function(t,e,n){return Ja(t,e,"read from private field"),n?n.call(t):e.get(t)},eo=function(t,e,n,r){return Ja(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n};var no=function(t){Object(l.a)(n,t);var e=Xa(n);function n(){var t;if(Object(o.a)(this,n),t=e.call(this),function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)}(Object(nt.a)(t),Za,void 0),!t.shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var r=At(t.attributes);t.shadowRoot.innerHTML=t.constructor.getTemplateHTML(r)}return t}
2return Object(r.a)(n,[{key:"connectedCallback",value:function(){var t,e,n,r=this.getAttribute(T);r&&(eo(this,Za,null==(t=this.getRootNode())?void 0:t.getElementById(r)),null==(n=null==(e=to(this,Za))?void 0:e.associateElement)||n.call(e,this))}},{key:"disconnectedCallback",value:function(){var t,e;null==(e=null==(t=to(this,Za))?void 0:t.unassociateElement)||e.call(t,this),eo(this,Za,null)}},{key:"attributeChangedCallback",value:function(t,e,n){var r,o,l,c,d;[_.MEDIA_PREVIEW_IMAGE,_.MEDIA_PREVIEW_COORDS].includes(t)&&this.update(),t===T&&(e&&(null==(o=null==(r=to(this,Za))?void 0:r.unassociateElement)||o.call(r,this),eo(this,Za,null)),n&&this.isConnected&&(eo(this,Za,null==(l=this.getRootNode())?void 0:l.getElementById(n)),null==(d=null==(c=to(this,Za))?void 0:c.associateElement)||d.call(c,this)))}},{key:"mediaPreviewImage",get:function(){return $t(this,_.MEDIA_PREVIEW_IMAGE)},set:function(t){Vt(this,_.MEDIA_PREVIEW_IMAGE,t)}},{key:"mediaPreviewCoords",get:function(){var t=this.getAttribute(_.MEDIA_PREVIEW_COORDS);if(t)return t.split(/\s+/).map((function(t){return+t}))},set:function(t){t?this.setAttribute(_.MEDIA_PREVIEW_COORDS,t.join(" ")):this.removeAttribute(_.MEDIA_PREVIEW_COORDS)}},{key:"update",value:function(){var t=this,e=this.mediaPreviewCoords,n=this.mediaPreviewImage;if(e&&n){var r,o,l=Object(m.a)(e,4),c=l[0],d=l[1],h=l[2],f=l[3],v=n.split("#")[0],y=getComputedStyle(this),E=y.maxWidth,T=y.maxHeight,k=y.minWidth,S=y.minHeight;if("fill"===(y.getPropertyValue("--media-preview-thumbnail-object-fit").trim()||"contain")){var _=parseInt(E)/h,A=parseInt(T)/f,O=parseInt(k)/h,w=parseInt(S)/f;r=_<1?_:Math.max(_,O),o=A<1?A:Math.max(A,w)}else{var I=Math.min(parseInt(E)/h,parseInt(T)/f),R=Math.max(parseInt(k)/h,parseInt(S)/f),L=I<1?I:R>1?R:1;r=L,o=L}var style=Mt(this.shadowRoot,":host").style,x=Mt(this.shadowRoot,"img").style,img=this.shadowRoot.querySelector("img"),D=Math.min(r,o)<1?"min":"max";style.setProperty("".concat(D,"-width"),"initial","important"),style.setProperty("".concat(D,"-height"),"initial","important"),style.width="".concat(h*r,"px"),style.height="".concat(f*o,"px");var C=function(){x.width="".concat(t.imgWidth*r,"px"),x.height="".concat(t.imgHeight*o,"px"),x.display="block"};img.src!==v&&(img.onload=function(){t.imgWidth=img.naturalWidth,t.imgHeight=img.naturalHeight,C(),img.onload=null},img.src=v,C()),C(),x.transform="translate(-".concat(c*r,"px, -").concat(d*o,"px)")}}}],[{key:"observedAttributes",get:function(){return[T,_.MEDIA_PREVIEW_IMAGE,_.MEDIA_PREVIEW_COORDS]}}]),n}(pt.HTMLElement);Za=new WeakMap,no.shadowRootOptions={mode:"open"},no.getTemplateHTML=function(t){return'\n <style>\n :host {\n box-sizing: border-box;\n display: var(--media-control-display, var(--media-preview-thumbnail-display, inline-block));\n overflow: hidden;\n }\n\n img {\n display: none;\n position: relative;\n }\n </style>\n <img crossorigin loading="eager" decoding="async">\n '},pt.customElements.get("media-preview-thumbnail")||pt.customElements.define("media-preview-thumbnail",no);var io=no;function ro(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var so,ao=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},oo=function(t,e,n){return ao(t,e,"read from private field"),n?n.call(t):e.get(t)},lo=function(t){Object(l.a)(n,t);var e=ro(n);function n(){var t,r,l,c,d;return Object(o.a)(this,n),t=e.call(this),function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)}(Object(nt.a)(t),so,void 0),r=Object(nt.a)(t),l=so,c=t.shadowRoot.querySelector("slot"),ao(r,l,"write to private field"),d?d.call(r,c):l.set(r,c),oo(Object(nt.a)(t),so).textContent=J(0),t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_PREVIEW_TIME&&null!=r&&(oo(this,so).textContent=J(parseFloat(r)))}},{key:"mediaPreviewTime",get:function(){return Ft(this,_.MEDIA_PREVIEW_TIME)},set:function(t){Nt(this,_.MEDIA_PREVIEW_TIME,t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_PREVIEW_TIME])}}]),n}(Ps);so=new WeakMap,pt.customElements.get("media-preview-time-display")||pt.customElements.define("media-preview-time-display",lo);function co(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var uo="seekoffset";var ho=function(t){Object(l.a)(n,t);var e=co(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}
2return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.seekOffset=Ft(this,uo,30)}},{key:"attributeChangedCallback",value:function(t,e,r){var o,l;Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),o=this,l=this.seekOffset,o.setAttribute("aria-label",Q("seek back {seekOffset} seconds",{seekOffset:l})),t===uo&&(this.seekOffset=Ft(this,uo,30))}},{key:"seekOffset",get:function(){return Ft(this,uo,30)},set:function(t){Nt(this,uo,t),this.setAttribute("aria-label",Q("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),It(Rt(this,"icon"),this.seekOffset)}},{key:"mediaCurrentTime",get:function(){return Ft(this,_.MEDIA_CURRENT_TIME,0)},set:function(time){Nt(this,_.MEDIA_CURRENT_TIME,time)}},{key:"handleClick",value:function(){var t=Math.max(this.mediaCurrentTime-this.seekOffset,0),e=new pt.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(e)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_CURRENT_TIME,uo])}}]),n}(rr);ho.getSlotTemplateHTML=function(t,e){return'\n <slot name="icon">'.concat((n=e.seekOffset,'\n <svg aria-hidden="true" viewBox="0 0 20 24">\n <defs>\n <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>\n </defs>\n <text class="text value" transform="translate(2.18 19.87)">'.concat(n,'</text>\n <path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/>\n </svg>')),"</slot>\n ");var n},ho.getTooltipContentHTML=function(){return Q("Seek backward")},pt.customElements.get("media-seek-backward-button")||pt.customElements.define("media-seek-backward-button",ho);function fo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var po="seekoffset";var mo=function(t){Object(l.a)(n,t);var e=fo(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.seekOffset=Ft(this,po,30)}},{key:"attributeChangedCallback",value:function(t,e,r){var o,l;Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),o=this,l=this.seekOffset,o.setAttribute("aria-label",Q("seek forward {seekOffset} seconds",{seekOffset:l})),t===po&&(this.seekOffset=Ft(this,po,30))}},{key:"seekOffset",get:function(){return Ft(this,po,30)},set:function(t){Nt(this,po,t),this.setAttribute("aria-label",Q("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),It(Rt(this,"icon"),this.seekOffset)}},{key:"mediaCurrentTime",get:function(){return Ft(this,_.MEDIA_CURRENT_TIME,0)},set:function(time){Nt(this,_.MEDIA_CURRENT_TIME,time)}},{key:"handleClick",value:function(){var t=this.mediaCurrentTime+this.seekOffset,e=new pt.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(e)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_CURRENT_TIME,po])}}]),n}(rr);mo.getSlotTemplateHTML=function(t,e){return'\n <slot name="icon">'.concat((n=e.seekOffset,'\n <svg aria-hidden="true" viewBox="0 0 20 24">\n <defs>\n <style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>\n </defs>\n <text class="text value" transform="translate(8.9 19.87)">'.concat(n,'</text>\n <path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/>\n </svg>')),"</slot>\n ");var n},mo.getTooltipContentHTML=function(){return Q("Seek forward")},pt.customElements.get("media-seek-forward-button")||pt.customElements.define("media-seek-forward-button",mo);function go(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}
2var vo,yo,bo,Eo,To,ko,So,_o,Ao,Oo,wo,Io=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Ro=function(t,e,n){return Io(t,e,"read from private field"),n?n.call(t):e.get(t)},Lo=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},xo=function(t,e,n,r){return Io(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},Do=function(t,e,n){return Io(t,e,"access private method"),n},Co={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Po=[].concat(Object(tt.a)(Object.values(Co)),[_.MEDIA_CURRENT_TIME,_.MEDIA_DURATION,_.MEDIA_SEEKABLE]),Mo=["Enter"," "],jo=" / ",Fo=function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.timesSep,l=void 0===o?jo:o,c=null!=(e=t.mediaCurrentTime)?e:0,d=null!=(n=t.mediaSeekable)?n:[],h=Object(m.a)(d,2),f=h[1],v=0;Number.isFinite(t.mediaDuration)?v=t.mediaDuration:Number.isFinite(f)&&(v=f);var y=t.remaining?J(0-(v-c)):J(c);return t.showDuration?"".concat(y).concat(l).concat(J(v)):y};var No=function(t){Object(l.a)(n,t);var e=go(n);function n(){var t;return Object(o.a)(this,n),t=e.call(this),Lo(Object(nt.a)(t),Eo),Lo(Object(nt.a)(t),ko),Lo(Object(nt.a)(t),_o),Lo(Object(nt.a)(t),Oo),Lo(Object(nt.a)(t),vo,void 0),Lo(Object(nt.a)(t),yo,null),Lo(Object(nt.a)(t),bo,(function(e){var n=e.metaKey,r=e.altKey,o=e.key;n||r||!Mo.includes(o)?t.removeEventListener("keyup",Ro(Object(nt.a)(t),yo)):t.addEventListener("keyup",Ro(Object(nt.a)(t),yo))})),xo(Object(nt.a)(t),vo,t.shadowRoot.querySelector("slot")),Ro(Object(nt.a)(t),vo).innerHTML="".concat(Fo(Object(nt.a)(t))),t}return Object(r.a)(n,[{key:"connectedCallback",value:function(){var style=Mt(this.shadowRoot,":host(:hover:not([notoggle]))").style;style.setProperty("cursor","var(--media-cursor, pointer)"),style.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.setAttribute("aria-label",Q("playback time")),Do(this,_o,Ao).call(this),Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this)}},{key:"toggleTimeDisplay",value:function(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}},{key:"disconnectedCallback",value:function(){this.disable(),Do(this,ko,So).call(this),Object(it.a)(Object(d.a)(n.prototype),"disconnectedCallback",this).call(this)}},{key:"attributeChangedCallback",value:function(t,e,r){this.setAttribute("aria-label",Q("playback time")),Po.includes(t)?this.update():"disabled"===t&&r!==e?null==r?Do(this,_o,Ao).call(this):Do(this,Oo,wo).call(this):t===Co.NO_TOGGLE&&r!==e&&(this.noToggle?Do(this,Oo,wo).call(this):Do(this,_o,Ao).call(this)),Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r)}},{key:"enable",value:function(){this.noToggle||(this.tabIndex=0)}},{key:"disable",value:function(){this.tabIndex=-1}},{key:"remaining",get:function(){return Ut(this,Co.REMAINING)},set:function(t){Bt(this,Co.REMAINING,t)}},{key:"showDuration",get:function(){return Ut(this,Co.SHOW_DURATION)},set:function(t){Bt(this,Co.SHOW_DURATION,t)}},{key:"noToggle",get:function(){return Ut(this,Co.NO_TOGGLE)},set:function(t){Bt(this,Co.NO_TOGGLE,t)}},{key:"mediaDuration",get:function(){return Ft(this,_.MEDIA_DURATION)},set:function(time){Nt(this,_.MEDIA_DURATION,time)}},{key:"mediaCurrentTime",get:function(){return Ft(this,_.MEDIA_CURRENT_TIME)},set:function(time){Nt(this,_.MEDIA_CURRENT_TIME,time)}},{key:"mediaSeekable",get:function(){var t=this.getAttribute(_.MEDIA_SEEKABLE);if(t)return t.split(":").map((function(time){return+time}))},set:function(t){null!=t?this.setAttribute(_.MEDIA_SEEKABLE,t.join(":")):this.removeAttribute(_.MEDIA_SEEKABLE)}},{key:"update",value:function(){var t=Fo(this);!function(t){var e,n=t.mediaCurrentTime,r=null!=(e=t.mediaSeekable)?e:[],o=Object(m.a)(r,2)[1],l=null;if(Number.isFinite(t.mediaDuration)?l=t.mediaDuration:Number.isFinite(o)&&(l=o),null!=n&&null!==l){var c=t.remaining?Z(0-(l-n)):Z(n);if(t.showDuration){var d=Z(l),h=Q("{currentTime} of {totalTime}",{currentTime:c,totalTime:d});t.setAttribute("aria-description",h)}else t.setAttribute("aria-description",c)}else t.setAttribute("aria-description",Q("video not loaded, unknown time."))}(this),t!==Ro(this,vo).innerHTML&&(Ro(this,vo).innerHTML=t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),Object(tt.a)(Po),["disabled"])}}]),n}(Ps);vo=new WeakMap,yo=new WeakMap,bo=new WeakMap,Eo=new WeakSet,To=function(){var t=this;Ro(this,yo)||(xo(this,yo,(function(e){var n=e.key;Mo.includes(n)?t.toggleTimeDisplay():t.removeEventListener("keyup",Ro(t,yo))}
2)),this.addEventListener("keydown",Ro(this,bo)),this.addEventListener("click",this.toggleTimeDisplay))},ko=new WeakSet,So=function(){Ro(this,yo)&&(this.removeEventListener("keyup",Ro(this,yo)),this.removeEventListener("keydown",Ro(this,bo)),this.removeEventListener("click",this.toggleTimeDisplay),xo(this,yo,null))},_o=new WeakSet,Ao=function(){this.noToggle||this.hasAttribute("disabled")||(this.setAttribute("role","button"),this.enable(),Do(this,Eo,To).call(this))},Oo=new WeakSet,wo=function(){this.removeAttribute("role"),this.disable(),Do(this,ko,So).call(this)},No.getSlotTemplateHTML=function(t,e){return"\n <slot>".concat(Fo(e),"</slot>\n ")},pt.customElements.get("media-time-display")||pt.customElements.define("media-time-display",No);var Uo,Bo,$o,Vo,Go,Ho,Wo,Ko,qo,Yo,zo=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Qo=function(t,e,n){return zo(t,e,"read from private field"),n?n.call(t):e.get(t)},Xo=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Zo=function(t,e,n,r){return zo(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},Jo=function(t,e,n,r){return{set _(r){Zo(t,e,r,n)},get _(){return Qo(t,e,r)}}},tl=function(){function t(e,n,r){var l=this;Object(o.a)(this,t),Xo(this,Uo,void 0),Xo(this,Bo,void 0),Xo(this,$o,void 0),Xo(this,Vo,void 0),Xo(this,Go,void 0),Xo(this,Ho,void 0),Xo(this,Wo,void 0),Xo(this,Ko,void 0),Xo(this,qo,0),Xo(this,Yo,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:performance.now();Zo(l,qo,requestAnimationFrame(Qo(l,Yo))),Zo(l,Vo,performance.now()-Qo(l,$o));var e=1e3/l.fps;if(Qo(l,Vo)>e){Zo(l,$o,t-Qo(l,Vo)%e);var n=1e3/((t-Qo(l,Bo))/++Jo(l,Go)._),r=(t-Qo(l,Ho))/1e3/l.duration,o=Qo(l,Wo)+r*l.playbackRate,c=o-Qo(l,Uo).valueAsNumber;c>0?Zo(l,Ko,l.playbackRate/l.duration/n):(Zo(l,Ko,.995*Qo(l,Ko)),o=Qo(l,Uo).valueAsNumber+Qo(l,Ko)),l.callback(o)}})),Zo(this,Uo,e),this.callback=n,this.fps=r}return Object(r.a)(t,[{key:"start",value:function(){0===Qo(this,qo)&&(Zo(this,$o,performance.now()),Zo(this,Bo,Qo(this,$o)),Zo(this,Go,0),Qo(this,Yo).call(this))}},{key:"stop",value:function(){0!==Qo(this,qo)&&(cancelAnimationFrame(Qo(this,qo)),Zo(this,qo,0))}},{key:"update",value:function(t){var e=t.start,n=t.duration,r=t.playbackRate,o=e-Qo(this,Uo).valueAsNumber,l=Math.abs(n-this.duration);(o>0||o<-.03||l>=.5)&&this.callback(e),Zo(this,Wo,e),Zo(this,Ho,performance.now()),this.duration=n,this.playbackRate=r}}]),t}();function el(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}Uo=new WeakMap,Bo=new WeakMap,$o=new WeakMap,Vo=new WeakMap,Go=new WeakMap,Ho=new WeakMap,Wo=new WeakMap,Ko=new WeakMap,qo=new WeakMap,Yo=new WeakMap;var nl,il,rl,sl,al,ll,cl,hl,fl,pl,ml,gl,vl,yl,bl,El,Tl,kl,Sl,_l,Al,Ol,wl,Il,Rl,Ll,xl=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Dl=function(t,e,n){return xl(t,e,"read from private field"),n?n.call(t):e.get(t)},Cl=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Pl=function(t,e,n,r){return xl(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},Ml=function(t,e,n){return xl(t,e,"access private method"),n};var jl=function(t){var time=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.mediaCurrentTime,e=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,n=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(n))return 0;var r=(time-e)/(n-e);return Math.max(0,Math.min(r,1))},Fl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.range.valueAsNumber,n=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,r=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(r)?0:e*(r-n)+n},Nl=function(t){Object(l.a)(n,t);var e=el(n);function n(){var t;Object(o.a)(this,n),t=e.call(this),Cl(Object(nt.a)(t),gl),Cl(Object(nt.a)(t),bl),Cl(Object(nt.a)(t),Tl),Cl(Object(nt.a)(t),Sl),Cl(Object(nt.a)(t),Al),Cl(Object(nt.a)(t),wl),Cl(Object(nt.a)(t),Rl),Cl(Object(nt.a)(t),nl,null),Cl(Object(nt.a)(t),il,void 0),Cl(Object(nt.a)(t),rl,void 0),Cl(Object(nt.a)(t),sl,void 0),Cl(Object(nt.a)(t),al,void 0),Cl(Object(nt.a)(t),ll,void 0),Cl(Object(nt.a)(t),
2cl,void 0),Cl(Object(nt.a)(t),hl,void 0),Cl(Object(nt.a)(t),fl,void 0),Cl(Object(nt.a)(t),pl,void 0),Cl(Object(nt.a)(t),ml,(function(){Ml(Object(nt.a)(t),gl,vl).call(Object(nt.a)(t))?Dl(Object(nt.a)(t),il).start():Dl(Object(nt.a)(t),il).stop()})),Cl(Object(nt.a)(t),yl,(function(e){t.dragging||(V(e)&&(t.range.valueAsNumber=e),Dl(Object(nt.a)(t),pl)||t.updateBar())})),t.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Pl(Object(nt.a)(t),rl,t.shadowRoot.querySelectorAll('[part~="box"]')),Pl(Object(nt.a)(t),al,t.shadowRoot.querySelector('[part~="preview-box"]')),Pl(Object(nt.a)(t),ll,t.shadowRoot.querySelector('[part~="current-box"]'));var r=getComputedStyle(Object(nt.a)(t));return Pl(Object(nt.a)(t),cl,parseInt(r.getPropertyValue("--media-box-padding-left"))),Pl(Object(nt.a)(t),hl,parseInt(r.getPropertyValue("--media-box-padding-right"))),Pl(Object(nt.a)(t),il,new tl(t.range,Dl(Object(nt.a)(t),yl),60)),t}return Object(r.a)(n,[{key:"connectedCallback",value:function(){var t;Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.range.setAttribute("aria-label",Q("seek")),Dl(this,ml).call(this),Pl(this,nl,this.getRootNode()),null==(t=Dl(this,nl))||t.addEventListener("transitionstart",this)}},{key:"disconnectedCallback",value:function(){var t;Object(it.a)(Object(d.a)(n.prototype),"disconnectedCallback",this).call(this),Dl(this,il).stop(),null==(t=Dl(this,nl))||t.removeEventListener("transitionstart",this),Pl(this,nl,null)}},{key:"attributeChangedCallback",value:function(t,e,r){var o,l,c,h,f;(Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),e!=r)&&(t===_.MEDIA_CURRENT_TIME||t===_.MEDIA_PAUSED||t===_.MEDIA_ENDED||t===_.MEDIA_LOADING||t===_.MEDIA_DURATION||t===_.MEDIA_SEEKABLE?(Dl(this,il).update({start:jl(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),Dl(this,ml).call(this),l=(o=this).range,c=Z(+Fl(o)),h=Z(+o.mediaSeekableEnd),f=c&&h?Q("{currentTime} of {totalTime}",{currentTime:c,totalTime:h}):Q("video not loaded, unknown time."),l.setAttribute("aria-valuetext",f)):t===_.MEDIA_BUFFERED&&this.updateBufferedBar(),t!==_.MEDIA_DURATION&&t!==_.MEDIA_SEEKABLE||(this.mediaChaptersCues=Dl(this,fl),this.updateBar()))}},{key:"mediaChaptersCues",get:function(){return Dl(this,fl)},set:function(t){var e,n=this;Pl(this,fl,t),this.updateSegments(null==(e=Dl(this,fl))?void 0:e.map((function(t){return{start:jl(n,t.startTime),end:jl(n,t.endTime)}})))}},{key:"mediaPaused",get:function(){return Ut(this,_.MEDIA_PAUSED)},set:function(t){Bt(this,_.MEDIA_PAUSED,t)}},{key:"mediaLoading",get:function(){return Ut(this,_.MEDIA_LOADING)},set:function(t){Bt(this,_.MEDIA_LOADING,t)}},{key:"mediaDuration",get:function(){return Ft(this,_.MEDIA_DURATION)},set:function(t){Nt(this,_.MEDIA_DURATION,t)}},{key:"mediaCurrentTime",get:function(){return Ft(this,_.MEDIA_CURRENT_TIME)},set:function(t){Nt(this,_.MEDIA_CURRENT_TIME,t)}},{key:"mediaPlaybackRate",get:function(){return Ft(this,_.MEDIA_PLAYBACK_RATE,1)},set:function(t){Nt(this,_.MEDIA_PLAYBACK_RATE,t)}},{key:"mediaBuffered",get:function(){var t=this.getAttribute(_.MEDIA_BUFFERED);return t?t.split(" ").map((function(t){return t.split(":").map((function(t){return+t}))})):[]},set:function(t){if(t){var e=t.map((function(t){return t.join(":")})).join(" ");this.setAttribute(_.MEDIA_BUFFERED,e)}else this.removeAttribute(_.MEDIA_BUFFERED)}},{key:"mediaSeekable",get:function(){var t=this.getAttribute(_.MEDIA_SEEKABLE);if(t)return t.split(":").map((function(time){return+time}))},set:function(t){null!=t?this.setAttribute(_.MEDIA_SEEKABLE,t.join(":")):this.removeAttribute(_.MEDIA_SEEKABLE)}},{key:"mediaSeekableEnd",get:function(){var t,e=null!=(t=this.mediaSeekable)?t:[],n=Object(m.a)(e,2)[1];return void 0===n?this.mediaDuration:n}},{key:"mediaSeekableStart",get:function(){var t,e=null!=(t=this.mediaSeekable)?t:[],n=Object(m.a)(e,1)[0];return void 0===n?0:n}},{key:"mediaPreviewImage",get:function(){return $t(this,_.MEDIA_PREVIEW_IMAGE)},set:function(t){Vt(this,_.MEDIA_PREVIEW_IMAGE,t)}},{key:"mediaPreviewTime",get:function(){return Ft(this,_.MEDIA_PREVIEW_TIME)},set:function(t){Nt(this,_.MEDIA_PREVIEW_TIME,t)}},{key:"mediaEnded",get:function(){return Ut(this,_.MEDIA_ENDED)},set:function(t){Bt(this,_.MEDIA_ENDED,t)}},{key:"updateBar",value:function(){Object(it.a)(Object(d.a)(n.prototype),"updateBar",this).call(this),this.updateBufferedBar(),this.updateCurrentBox()}},{key:"updateBufferedBar",value:function(){var t,e=this.mediaBuffered;if(e.length){var n;if(this.mediaEnded)n=1;else{var r=this.mediaCurrentTime,o=null!=(t=e.find((function(t){var e=Object(m.a)(t,2),n=e[0],o=e[1];return n<=r&&r<=o})))?t:[],l=Object(m.a)(o,2)[1],c=void 0===l?this.mediaSeekableStart:l;n=jl(this,c)}Mt(this.shadowRoot,"#buffered").style.setProperty("width","".concat(100*n,"%"))}}},{key:"updateCurrentBox",value:function(){if(this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length){var t=Mt(this.shadowRoot,"#current-rail"),e=
2Mt(this.shadowRoot,'[part~="current-box"]'),n=Ml(this,bl,El).call(this,Dl(this,ll)),r=Ml(this,Tl,kl).call(this,n,this.range.valueAsNumber),o=Ml(this,Sl,_l).call(this,n,this.range.valueAsNumber);t.style.transform="translateX(".concat(r,")"),t.style.setProperty("--_range-width","".concat(n.range.width)),e.style.setProperty("--_box-shift","".concat(o)),e.style.setProperty("--_box-width","".concat(n.box.width,"px")),e.style.setProperty("visibility","initial")}}},{key:"handleEvent",value:function(t){var e=this;switch(Object(it.a)(Object(d.a)(n.prototype),"handleEvent",this).call(this,t),t.type){case"input":Ml(this,Rl,Ll).call(this);break;case"pointermove":Ml(this,Al,Ol).call(this,t);break;case"pointerup":Dl(this,pl)&&Pl(this,pl,!1);break;case"pointerdown":Pl(this,pl,!0);break;case"pointerleave":Ml(this,wl,Il).call(this,null);break;case"transitionstart":Lt(t.target,this)&&setTimeout((function(){return Dl(e,ml).call(e)}),0)}}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_PAUSED,_.MEDIA_DURATION,_.MEDIA_SEEKABLE,_.MEDIA_CURRENT_TIME,_.MEDIA_PREVIEW_IMAGE,_.MEDIA_PREVIEW_TIME,_.MEDIA_PREVIEW_CHAPTER,_.MEDIA_BUFFERED,_.MEDIA_PLAYBACK_RATE,_.MEDIA_LOADING,_.MEDIA_ENDED])}}]),n}(ks);nl=new WeakMap,il=new WeakMap,rl=new WeakMap,sl=new WeakMap,al=new WeakMap,ll=new WeakMap,cl=new WeakMap,hl=new WeakMap,fl=new WeakMap,pl=new WeakMap,ml=new WeakMap,gl=new WeakSet,vl=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Pt(this)},yl=new WeakMap,bl=new WeakSet,El=function(t){var e,n=(null!=(e=this.getAttribute("bounds")?xt(this,"#".concat(this.getAttribute("bounds"))):this.parentElement)?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth;return{box:{width:o,min:-(r.left-n.left-o/2),max:n.right-r.left-o/2},bounds:n,range:r}},Tl=new WeakSet,kl=function(t,e){var n="".concat(100*e,"%"),r=t.box,o=r.width,l=r.min,c=r.max;if(!o)return n;if(!Number.isNaN(l)){var d="calc(1 / var(--_range-width) * 100 * ".concat(l,"% + ").concat("var(--media-box-padding-left)",")");n="max(".concat(d,", ").concat(n,")")}if(!Number.isNaN(c)){var h="calc(1 / var(--_range-width) * 100 * ".concat(c,"% - ").concat("var(--media-box-padding-right)",")");n="min(".concat(n,", ").concat(h,")")}return n},Sl=new WeakSet,_l=function(t,e){var n=t.box,r=n.width,o=n.min,l=n.max,c=e*t.range.width;if(c<o+Dl(this,cl)){var d=t.range.left-t.bounds.left-Dl(this,cl);return"".concat(c-r/2+d,"px")}if(c>l-Dl(this,hl)){var h=t.bounds.right-t.range.right-Dl(this,hl);return"".concat(c+r/2-h-t.range.width,"px")}return 0},Al=new WeakSet,Ol=function(t){var e=Object(tt.a)(Dl(this,rl)).some((function(b){return t.composedPath().includes(b)}));if(this.dragging||!e&&t.composedPath().includes(this)){var n=this.mediaSeekableEnd;if(n){var r=Mt(this.shadowRoot,"#preview-rail"),o=Mt(this.shadowRoot,'[part~="preview-box"]'),l=Ml(this,bl,El).call(this,Dl(this,al)),c=(t.clientX-l.range.left)/l.range.width;c=Math.max(0,Math.min(1,c));var d=Ml(this,Tl,kl).call(this,l,c),h=Ml(this,Sl,_l).call(this,l,c);r.style.transform="translateX(".concat(d,")"),r.style.setProperty("--_range-width","".concat(l.range.width)),o.style.setProperty("--_box-shift","".concat(h)),o.style.setProperty("--_box-width","".concat(l.box.width,"px"));var f=Math.round(Dl(this,sl))-Math.round(c*n);Math.abs(f)<1&&c>.01&&c<.99||(Pl(this,sl,c*n),Ml(this,wl,Il).call(this,Dl(this,sl)))}}else Ml(this,wl,Il).call(this,null)},wl=new WeakSet,Il=function(t){this.dispatchEvent(new pt.CustomEvent(y.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))},Rl=new WeakSet,Ll=function(){Dl(this,il).stop();var t=Fl(this);this.dispatchEvent(new pt.CustomEvent(y.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))},Nl.shadowRootOptions={mode:"open"},Nl.getContainerTemplateHTML=function(t){return"\n <style>\n :host {\n --media-box-border-radius: 4px;\n --media-box-padding-left: 10px;\n --media-box-padding-right: 10px;\n --media-preview-border-radius: var(--media-box-border-radius);\n --media-box-arrow-offset: var(--media-box-border-radius);\n --_control-background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));\n --_preview-background: var(--media-preview-background, var(--_control-background));\n\n ".concat('\n contain: layout;\n }\n\n #buffered {\n background: var(--media-time-range-buffered-color, rgb(255 255 255 / .4));\n position: absolute;\n height: 100%;\n will-change: width;\n }\n\n #preview-rail,\n #current-rail {\n width: 100%;\n position: absolute;\n left: 0;\n bottom: 100%;\n pointer-events: none;\n will-change: transform;\n }\n\n [part~="box"] {\n width: min-content;\n ','\n position: absolute;\n bottom: 100%;\n flex-direction: column;\n align-items: center;\n transform: translateX(-50%);\n }\n\n [part~="current-box"] {\n display: var(--media-current-box-display, var(--media-box-display, flex));\n margin: var(--media-current-box-margin, var(--media-box-margin, 0 0 5px));\n visibility: hidden;\n }\n\n [part~="preview-box"] {\n display: var(--media-preview-box-display, var(--media-box-display, flex));\n margin: var(--media-preview-box-margin, var(--media-box-margin, 0 0 5px));\n transition-property: var(--media-preview-transition-property, visibility, opacity);\n transition-duration: var(--media-preview-transition-duration-out, .25s);\n transition-delay: var(--media-preview-transition-delay-out, 0s);\n visibility: hidden;\n opacity: 0;\n }\n\n :host(:is([',_.MEDIA_PREVIEW_IMAGE,"], [").concat(_.MEDIA_PREVIEW_TIME,'])[dragging]) [part~="preview-box"] {\n transition-duration: var(--media-preview-transition-duration-in, .5s);\n transition-delay: var(--media-preview-transition-delay-in, .25s);\n visibility: visible;\n opacity: 1;\n }\n\n @media (hover: hover) {\n :host(:is([').concat(_.MEDIA_PREVIEW_IMAGE,"], [").concat(_.MEDIA_PREVIEW_TIME,']):hover) [part~="preview-box"] {\n transition-duration: var(--media-preview-transition-duration-in, .5s);\n transition-delay: var(--media-preview-transition-delay-in, .25s);\n visibility: visible;\n opacity: 1;\n }\n }
2\n\n media-preview-thumbnail,\n ::slotted(media-preview-thumbnail) {\n visibility: hidden;\n ',"\n transition: visibility 0s .25s;\n transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));\n background: var(--media-preview-thumbnail-background, var(--_preview-background));\n box-shadow: var(--media-preview-thumbnail-box-shadow, 0 0 4px rgb(0 0 0 / .2));\n max-width: var(--media-preview-thumbnail-max-width, 180px);\n max-height: var(--media-preview-thumbnail-max-height, 160px);\n min-width: var(--media-preview-thumbnail-min-width, 120px);\n min-height: var(--media-preview-thumbnail-min-height, 80px);\n border: var(--media-preview-thumbnail-border);\n border-radius: var(--media-preview-thumbnail-border-radius,\n var(--media-preview-border-radius) var(--media-preview-border-radius) 0 0);\n }\n\n :host([").concat(_.MEDIA_PREVIEW_IMAGE,"][dragging]) media-preview-thumbnail,\n :host([").concat(_.MEDIA_PREVIEW_IMAGE,"][dragging]) ::slotted(media-preview-thumbnail) {\n transition-delay: var(--media-preview-transition-delay-in, .25s);\n visibility: visible;\n }\n\n @media (hover: hover) {\n :host([").concat(_.MEDIA_PREVIEW_IMAGE,"]:hover) media-preview-thumbnail,\n :host([").concat(_.MEDIA_PREVIEW_IMAGE,"]:hover) ::slotted(media-preview-thumbnail) {\n transition-delay: var(--media-preview-transition-delay-in, .25s);\n visibility: visible;\n }\n\n :host([").concat(_.MEDIA_PREVIEW_TIME,"]:hover) {\n --media-time-range-hover-display: block;\n }\n }\n\n media-preview-chapter-display,\n ::slotted(media-preview-chapter-display) {\n font-size: var(--media-font-size, 13px);\n line-height: 17px;\n min-width: 0;\n visibility: hidden;\n ","\n transition: min-width 0s, border-radius 0s, margin 0s, padding 0s, visibility 0s;\n transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));\n background: var(--media-preview-chapter-background, var(--_preview-background));\n border-radius: var(--media-preview-chapter-border-radius,\n var(--media-preview-border-radius) var(--media-preview-border-radius)\n var(--media-preview-border-radius) var(--media-preview-border-radius));\n padding: var(--media-preview-chapter-padding, 3.5px 9px);\n margin: var(--media-preview-chapter-margin, 0 0 5px);\n text-shadow: var(--media-preview-chapter-text-shadow, 0 0 4px rgb(0 0 0 / .75));\n }\n\n :host([").concat(_.MEDIA_PREVIEW_IMAGE,"]) media-preview-chapter-display,\n :host([").concat(_.MEDIA_PREVIEW_IMAGE,"]) ::slotted(media-preview-chapter-display) {\n transition-delay: var(--media-preview-transition-delay-in, .25s);\n border-radius: var(--media-preview-chapter-border-radius, 0);\n padding: var(--media-preview-chapter-padding, 3.5px 9px 0);\n margin: var(--media-preview-chapter-margin, 0);\n min-width: 100%;\n }\n\n media-preview-chapter-display[").concat(_.MEDIA_PREVIEW_CHAPTER,"],\n ::slotted(media-preview-chapter-display[").concat(_.MEDIA_PREVIEW_CHAPTER,"]) {\n visibility: visible;\n }\n\n media-preview-chapter-display:not([aria-valuetext]),\n ::slotted(media-preview-chapter-display:not([aria-valuetext])) {\n display: none;\n }\n\n media-preview-time-display,\n ::slotted(media-preview-time-display),\n media-time-display,\n ::slotted(media-time-display) {\n font-size: var(--media-font-size, 13px);\n line-height: 17px;\n min-width: 0;\n ","\n transition: min-width 0s, border-radius 0s;\n transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));\n background: var(--media-preview-time-background, var(--_preview-background));\n border-radius: var(--media-preview-time-border-radius,\n var(--media-preview-border-radius) var(--media-preview-border-radius)\n var(--media-preview-border-radius) var(--media-preview-border-radius));\n padding: var(--media-preview-time-padding, 3.5px 9px);\n margin: var(--media-preview-time-margin, 0);\n text-shadow: var(--media-preview-time-text-shadow, 0 0 4px rgb(0 0 0 / .75));\n transform: translateX(min(\n max(calc(50% - var(--_box-width) / 2),\n calc(var(--_box-shift, 0))),\n calc(var(--_box-width) / 2 - 50%)\n ));\n }\n\n :host([").concat(_.MEDIA_PREVIEW_IMAGE,"]) media-preview-time-display,\n :host([").concat(_.MEDIA_PREVIEW_IMAGE,"]) ::slotted(media-preview-time-display) {\n transition-delay: var(--media-preview-transition-delay-in, .25s);\n border-radius: var(--media-preview-time-border-radius,\n 0 0 var(--media-preview-border-radius) var(--media-preview-border-radius));\n min-width: 100%;\n }\n\n :host([").concat(_.MEDIA_PREVIEW_TIME,']:hover) {\n --media-time-range-hover-display: block;\n }\n\n [part~="arrow"],\n ::slotted([part~="arrow"]) {\n display: var(--media-box-arrow-display, inline-block);\n transform: translateX(min(\n max(calc(50% - var(--_box-width) / 2 + var(--media-box-arrow-offset)),\n calc(var(--_box-shift, 0))),\n calc(var(--_box-width) / 2 - 50% - var(--media-box-arrow-offset))\n ));\n ','\n border-color: transparent;\n border-top-color: var(--media-box-arrow-background, var(--_control-background));\n border-width: var(--media-box-arrow-border-width,\n var(--media-box-arrow-height, 5px) var(--media-box-arrow-width, 6px) 0);\n border-style: solid;\n justify-content: center;\n height: 0;\n }\n </style>\n <div id="preview-rail">\n <slot name="preview" part="box preview-box">
2\n <media-preview-thumbnail>\n <template shadowrootmode="').concat(io.shadowRootOptions.mode,'">\n ').concat(io.getTemplateHTML({}),'\n </template>\n </media-preview-thumbnail>\n <media-preview-chapter-display></media-preview-chapter-display>\n <media-preview-time-display></media-preview-time-display>\n <slot name="preview-arrow"><div part="arrow"></div></slot>\n </slot>\n </div>\n <div id="current-rail">\n <slot name="current" part="box current-box">\n ',"\n </slot>\n </div>\n ")},pt.customElements.get("media-time-range")||pt.customElements.define("media-time-range",Nl);function Ul(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Bl,$l=function(t,e,n){return function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)}(t,e,"read from private field"),n?n.call(t):e.get(t)},Vl=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Gl=function(t){Object(l.a)(n,t);var e=Ul(n);function n(){var t;return Object(o.a)(this,n),t=e.apply(this,arguments),Vl(Object(nt.a)(t),Bl,(function(){var e=t.range.value,n=new pt.CustomEvent(y.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});t.dispatchEvent(n)})),t}return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.range.setAttribute("aria-label",Q("volume")),this.range.addEventListener("input",$l(this,Bl))}},{key:"disconnectedCallback",value:function(){this.range.removeEventListener("input",$l(this,Bl)),Object(it.a)(Object(d.a)(n.prototype),"disconnectedCallback",this).call(this)}},{key:"attributeChangedCallback",value:function(t,e,r){var o,l;Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t!==_.MEDIA_VOLUME&&t!==_.MEDIA_MUTED||(this.range.valueAsNumber=(l=this).mediaMuted?0:l.mediaVolume,this.range.setAttribute("aria-valuetext",(o=this.range.valueAsNumber,"".concat(Math.round(100*o),"%"))),this.updateBar())}},{key:"mediaVolume",get:function(){return Ft(this,_.MEDIA_VOLUME,
21)},set:function(t){Nt(this,_.MEDIA_VOLUME,t)}},{key:"mediaMuted",get:function(){return Ut(this,_.MEDIA_MUTED)},set:function(t){Bt(this,_.MEDIA_MUTED,t)}},{key:"mediaVolumeUnavailable",get:function(){return $t(this,_.MEDIA_VOLUME_UNAVAILABLE)},set:function(t){Vt(this,_.MEDIA_VOLUME_UNAVAILABLE,t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_VOLUME,_.MEDIA_MUTED,_.MEDIA_VOLUME_UNAVAILABLE])}}]),n}(ks);Bl=new WeakMap,pt.customElements.get("media-volume-range")||pt.customElements.define("media-volume-range",Gl);function Hl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Wl=function(t){Object(l.a)(n,t);var e=Hl(n);function n(){var t;return Object(o.a)(this,n),(t=e.apply(this,arguments)).container=null,t}return Object(r.a)(n,[{key:"connectedCallback",value:function(){var t;Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.container=(null==(t=this.shadowRoot)?void 0:t.querySelector("#icon"))||null,this.container&&(this.container.textContent=Q("Loop"))}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}},{key:"mediaLoop",get:function(){return Ut(this,_.MEDIA_LOOP)},set:function(t){Bt(this,_.MEDIA_LOOP,t)}},{key:"handleClick",value:function(){var t=!this.mediaLoop,e=new pt.CustomEvent(y.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(e)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_LOOP])}}]),n}(rr);Wl.getSlotTemplateHTML=function(t){return"\n <style>\n :host {\n min-width: 4ch;\n padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));\n width: 100%;\n display: grid;\n grid-template-columns: 1fr auto;\n gap: 1rem;\n font-weight: var(--media-button-font-weight, normal);\n }\n\n #checked-indicator {\n display: none;\n }\n\n :host([".concat(_.MEDIA_LOOP,']) #checked-indicator {\n display: block;\n }\n </style>\n \n <span id="icon">\n </span>\n\n <div id="checked-indicator">\n <svg aria-hidden="true" viewBox="0 1 24 24" part="checked-indicator indicator">\n <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>\n </svg>\n </div>\n ')},Wl.getTooltipContentHTML=function(){return Q("Loop")},pt.customElements.get("media-loop-button")||pt.customElements.define("media-loop-button",Wl);n(488),n(489);function Kl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}function ql(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Yl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yl(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function Yl(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var zl,Ql,Xl,Zl,Jl,tc,ec,nc,ic,rc,sc,ac=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},oc=function(t,e,n){return ac(t,e,"read from private field"),n?n.call(t):e.get(t)},lc=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},cc=function(t,e,n,r){return ac(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},uc={processCallback:function(t,e,n){if(n){var r,o=ql(e);try{for(o.s();!(r=o.n()).done;){var l=Object(m.a)(r.value,2),c=l[0],d=l[1];if(c in n){var h=n[c];"boolean"==typeof h&&d instanceof yc&&"boolean"==typeof d.element[d.attributeName]?d.booleanValue=h:"function"==typeof h&&d instanceof yc?d.element[d.attributeName]=h:d.value=h}}}catch(t){o.e(t)}finally{o.f()}}}},dc=function(t){Object(l.a)(n,t);var e=Kl(n);function n(template,t){var r,l,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:uc;return Object(o.a)(this,n),r=e.call(this),lc(Object(nt.a)(r),zl,void 0),lc(Object(nt.a)(r),Ql,void 0),r.append(template.content.cloneNode(!0)),cc(Object(nt.a)(r),zl,hc(Object(nt.a)(r))),cc(Object(nt.a)(r),Ql,c),null==(l=c.createCallback)||l.call(c,Object(nt.a)(r),oc(Object(nt.a)(r),zl),t),c.processCallback(Object(nt.a)(r),oc(Object(nt.a)(r),zl),t),r}return Object(r.a)(n,[{key:"update",value:function(t){oc(this,Ql).processCallback(this,oc(this,zl),t)}}]),n}(pt.DocumentFragment);zl=new WeakMap,Ql=new WeakMap;var hc=function t(element){var e,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=ql(element.attributes||[]);try{for(l.s();!(r=l.n()).done;){var c=r.value;if(c.value.includes("{{")){var d,h=new vc,f=ql(pc(c.value));try{for(f.s();!(d=f.n()).done;){var v=Object(m.a)(d.value,2);if(e=v[0],n=v[1],e){var y=new yc(element,c.name,c.namespaceURI);h.append(y),o.push([n,y])}else h.append(n)}}catch(t){f.e(t)}finally{f.f()}c.value=h.toString()}}}catch(t){l.e(t)}finally{l.f()}var E,T=ql(element.childNodes);try{for(T.s();!(E=T.n()).done;){var k=E.value;if(1!==k.nodeType||k instanceof HTMLTemplateElement){var data=k.data;if(1===k.nodeType||data.includes("{{")){var S=[];if(data){var _,A=ql(pc(data));try{for(A.s();!(_=A.n()).done;){var O=Object(m.a)(_.value,2);if(e=O[0],n=O[1],e){var w=new bc(element);S.push(w),o.push([n,w])}else S.push(new Text(n))}}catch(t){A.e(t)}finally{A.f()}}else if(k instanceof HTMLTemplateElement){var I=new Ec(element,k);S.push(I),o.push([I.expression,I])}k.replaceWith.apply(k,Object(tt.a)(S.flatMap((function(t){return t.replacementNodes||[t]}))))}}else t(k,o)}}catch(t){T.e(t)}finally{T.f()}return o},fc={},pc=function(text){var t,e="",n=0,r=fc[text],i=0;if(r)return r;for(r=[];t=text[i];i++)"{"===t&&"{"===text[i+1]&&"\\"!==text[i-1]&&text[i+2]&&1==++n?(e&&r.push([0,e]),e="",i++):"}"!==t||"}"!==text[i+1]||"\\"===text[i-1]||--n?e+=t||"":(r.push([1,e.trim()]),e="",i++);return e&&r.push([0,(n>0?"{{":"")+e]),fc[text]=r},mc=function(){function t(){Object(o.a)(this,t)}return Object(r.a)(t,[{key:"value",get:function(){return""},set:function(t){}}
2,{key:"toString",value:function(){return this.value}}]),t}(),gc=new WeakMap,vc=function(t){function e(){Object(o.a)(this,e),lc(this,Xl,[])}return Object(r.a)(e,[{key:t,value:function(){return oc(this,Xl).values()}},{key:"length",get:function(){return oc(this,Xl).length}},{key:"item",value:function(t){return oc(this,Xl)[t]}},{key:"append",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,o=e;r<o.length;r++){var l=o[r];l instanceof yc&&gc.set(l,this),oc(this,Xl).push(l)}}},{key:"toString",value:function(){return oc(this,Xl).join("")}}]),e}(Symbol.iterator);Xl=new WeakMap;var yc=function(t){Object(l.a)(n,t);var e=Kl(n);function n(element,t,r){var l;return Object(o.a)(this,n),l=e.call(this),lc(Object(nt.a)(l),nc),lc(Object(nt.a)(l),Zl,""),lc(Object(nt.a)(l),Jl,void 0),lc(Object(nt.a)(l),tc,void 0),lc(Object(nt.a)(l),ec,void 0),cc(Object(nt.a)(l),Jl,element),cc(Object(nt.a)(l),tc,t),cc(Object(nt.a)(l),ec,r),l}return Object(r.a)(n,[{key:"attributeName",get:function(){return oc(this,tc)}},{key:"attributeNamespace",get:function(){return oc(this,ec)}},{key:"element",get:function(){return oc(this,Jl)}},{key:"value",get:function(){return oc(this,Zl)},set:function(t){oc(this,Zl)!==t&&(cc(this,Zl,t),oc(this,nc,ic)&&1!==oc(this,nc,ic).length?oc(this,Jl).setAttributeNS(oc(this,ec),oc(this,tc),oc(this,nc,ic).toString()):null==t?oc(this,Jl).removeAttributeNS(oc(this,ec),oc(this,tc)):oc(this,Jl).setAttributeNS(oc(this,ec),oc(this,tc),t))}},{key:"booleanValue",get:function(){return oc(this,Jl).hasAttributeNS(oc(this,ec),oc(this,tc))},set:function(t){if(oc(this,nc,ic)&&1!==oc(this,nc,ic).length)throw new DOMException("Value is not fully templatized");this.value=t?"":null}}]),n}(mc);Zl=new WeakMap,Jl=new WeakMap,tc=new WeakMap,ec=new WeakMap,nc=new WeakSet,ic=function(){return gc.get(this)};var bc=function(t){Object(l.a)(n,t);var e=Kl(n);function n(t,r){var l;return Object(o.a)(this,n),l=e.call(this),lc(Object(nt.a)(l),rc,void 0),lc(Object(nt.a)(l),sc,void 0),cc(Object(nt.a)(l),rc,t),cc(Object(nt.a)(l),sc,r?Object(tt.a)(r):[new Text]),l}return Object(r.a)(n,[{key:"replacementNodes",get:function(){return oc(this,sc)}},{key:"parentNode",get:function(){return oc(this,rc)}},{key:"nextSibling",get:function(){return oc(this,sc)[oc(this,sc).length-1].nextSibling}},{key:"previousSibling",get:function(){return oc(this,sc)[0].previousSibling}},{key:"value",get:function(){return oc(this,sc).map((function(t){return t.textContent})).join("")},set:function(t){this.replace(t)}},{key:"replace",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e.flat().flatMap((function(t){return null==t?[new Text]:t.forEach?Object(tt.a)(t):11===t.nodeType?Object(tt.a)(t.childNodes):t.nodeType?[t]:[new Text(t)]}));r.length||r.push(new Text),cc(this,sc,Tc(oc(this,sc)[0].parentNode,oc(this,sc),r,this.nextSibling))}}]),n}(mc);rc=new WeakMap,sc=new WeakMap;var Ec=function(t){Object(l.a)(n,t);var e=Kl(n);function n(t,template){var r;Object(o.a)(this,n);var l=template.getAttribute("directive")||template.getAttribute("type"),c=template.getAttribute("expression")||template.getAttribute(l)||"";return c.startsWith("{{")&&(c=c.trim().slice(2,-2).trim()),(r=e.call(this,t)).expression=c,r.template=template,r.directive=l,r}return Object(r.a)(n)}(bc);function Tc(t,a,b){for(var e,n,r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=0,l=b.length,c=a.length;i<l&&i<c&&a[i]==b[i];)i++;for(;i<l&&i<c&&b[l-1]==a[c-1];)o=b[(--c,--l)];if(i==c)for(;i<l;)t.insertBefore(b[i++],o);if(i==l)for(;i<c;)t.removeChild(a[i++]);else{for(e=a[i];i<l;)r=b[i++],n=e?e.nextSibling:o,e==r?e=n:i<l&&b[i]==n?(t.replaceChild(r,e),e=n):t.insertBefore(r,e);for(;e!=o;)n=e.nextSibling,t.removeChild(e),e=n}return b}function kc(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function Sc(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
2i%2?kc(Object(source),!0).forEach((function(e){Object(f.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):kc(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}function _c(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ac(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ac(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function Ac(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var Oc={string:function(t){return String(t)}},wc=Object(r.a)((function t(template){Object(o.a)(this,t),this.template=template,this.state=void 0})),Ic=new WeakMap,Rc=new WeakMap,Lc={partial:function(t,e){e[t.expression]=new wc(t.template)},if:function(t,e){var n;if(Mc(t.expression,e))if(Ic.get(t)!==t.template){Ic.set(t,t.template);var r=new dc(t.template,e,Dc);t.replace(r),Rc.set(t,r)}else null==(n=Rc.get(t))||n.update(e);else t.replace(""),Ic.delete(t),Rc.delete(t)}},xc=Object.keys(Lc),Dc={processCallback:function(t,e,n){var r,o;if(n){var l,c=_c(e);try{var d=function(){var t=Object(m.a)(l.value,2),e=t[0],c=t[1];if(c instanceof Ec){if(!c.directive){var d=xc.find((function(t){return c.template.hasAttribute(t)}));d&&(c.directive=d,c.expression=c.template.getAttribute(d))}return null==(r=Lc[c.directive])||r.call(Lc,c,n),"continue"}var h=Mc(e,n);if(h instanceof wc)return Ic.get(c)!==h.template?(Ic.set(c,h.template),h=new dc(h.template,h.state,Dc),c.value=h,Rc.set(c,h)):null==(o=Rc.get(c))||o.update(h.state),"continue";h?(c instanceof yc&&c.attributeName.startsWith("aria-")&&(h=String(h)),c instanceof yc?"boolean"==typeof h?c.booleanValue=h:"function"==typeof h?c.element[c.attributeName]=h:c.value=h:(c.value=h,Ic.delete(c),Rc.delete(c))):c instanceof yc?c.value=void 0:(c.value=void 0,Ic.delete(c),Rc.delete(c))};for(c.s();!(l=c.n()).done;)d()}catch(t){c.e(t)}finally{c.f()}}}},Cc={"!":function(a){return!a},"!!":function(a){return!!a},"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},">":function(a,b){return a>b},">=":function(a,b){return a>=b},"<":function(a,b){return a<b},"<=":function(a,b){return a<=b},"??":function(a,b){return null!=a?a:b},"|":function(a,b){var t;return null==(t=Oc[b])?void 0:t.call(Oc,a)}};function Pc(t){return function(t,e){var n,r,o,l=[];for(;t;){for(var c in o=null,n=t.length,e)(r=e[c].exec(t))&&r.index<n&&(o={token:r[0],type:c,matches:r.slice(1)},n=r.index);n&&l.push({token:t.substr(0,n),type:void 0}),o&&l.push(o),t=t.substr(n+(o?o.token.length:0))}return l}(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter((function(t){return"ws"!==t.type}))}function Mc(t){var e,n,r,o,l,c,d,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=Pc(t);if(0===f.length||f.some((function(t){return!t.type})))return jc(t);if(">"===(null==(e=f[0])?void 0:e.token)){var m=h[null==(n=f[1])?void 0:n.token];if(!m)return jc(t);var v=Sc({},h);m.state=v;for(var y=f.slice(2),i=0;i<y.length;i+=3){var E=null==(r=y[i])?void 0:r.token,T=null==(o=y[i+1])?void 0:o.token,k=null==(l=y[i+2])?void 0:l.token;E&&"="===T&&(v[E]=Nc(k,h))}return m}if(1===f.length)return Fc(f[0])?Nc(f[0].token,h):jc(t);if(2===f.length){var S=null==(c=f[0])?void 0:c.token,_=Cc[S];if(!_||!Fc(f[1]))return jc(t);var a=Nc(f[1].token,h);return _(a)}if(3===f.length){var A=null==(d=f[1])?void 0:d.token,O=Cc[A];if(!O||!Fc(f[0])||!Fc(f[2]))return jc(t);var w=Nc(f[0].token,h);if("|"===A)return O(w,f[2].token);var b=Nc(f[2].token,h);return O(w,b)}}function jc(t){return console.warn("Warning: invalid expression `".concat(t,"`")),!1}function Fc(t){var e=t.type;return["number","boolean","string","param"].includes(e)}function Nc(t,e){var n=t[0],r=t.slice(-1);return"true"===t||"false"===t?"true"===t:n===r&&["'",'"'].includes(n)?t.slice(1,-1):G(t)?parseFloat(t):e[t]}function Uc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];
2if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Bc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bc(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function Bc(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function $c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Vc,Gc,Hc,Wc,Kc,qc,Yc,zc,Qc,Xc=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Zc=function(t,e,n){return Xc(t,e,"read from private field"),n?n.call(t):e.get(t)},Jc=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},tu=function(t,e,n,r){return Xc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},eu=function(t,e,n){return Xc(t,e,"access private method"),n},nu={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},iu=mt.createElement("template");
2iu.innerHTML="\n <style>\n :host {\n display: inline-block;\n line-height: 0;\n }\n\n media-controller {\n width: 100%;\n height: 100%;\n }\n\n media-captions-button:not([mediasubtitleslist]),\n media-captions-menu:not([mediasubtitleslist]),\n media-captions-menu-button:not([mediasubtitleslist]),\n media-audio-track-menu[mediaaudiotrackunavailable],\n media-audio-track-menu-button[mediaaudiotrackunavailable],\n media-rendition-menu[mediarenditionunavailable],\n media-rendition-menu-button[mediarenditionunavailable],\n media-volume-range[mediavolumeunavailable],\n media-airplay-button[mediaairplayunavailable],\n media-fullscreen-button[mediafullscreenunavailable],\n media-cast-button[mediacastunavailable],\n media-pip-button[mediapipunavailable] {\n display: none;\n }\n </style>\n";var ru=function(t){Object(l.a)(n,t);var e=$c(n);function n(){var t;return Object(o.a)(this,n),t=e.call(this),Jc(Object(nt.a)(t),Kc),Jc(Object(nt.a)(t),Yc),Jc(Object(nt.a)(t),Vc,void 0),Jc(Object(nt.a)(t),Gc,void 0),Jc(Object(nt.a)(t),Hc,void 0),Jc(Object(nt.a)(t),Wc,void 0),Jc(Object(nt.a)(t),Qc,void 0),t.shadowRoot?t.renderRoot=t.shadowRoot:(t.renderRoot=t.attachShadow({mode:"open"}),t.createRenderer()),tu(Object(nt.a)(t),Wc,new MutationObserver((function(e){var n;t.mediaController&&!(null==(n=t.mediaController)?void 0:n.breakpointsComputed)||e.some((function(e){var n=e.target;return n===Object(nt.a)(t)||"media-controller"===n.localName&&(!!nu[e.attributeName]||!!e.attributeName.startsWith("breakpoint"))}))&&t.render()}))),tu(Object(nt.a)(t),Qc,t.render.bind(Object(nt.a)(t))),eu(Object(nt.a)(t),Kc,qc).call(Object(nt.a)(t),"template"),t}return Object(r.a)(n,[{key:"mediaController",get:function(){return this.renderRoot.querySelector("media-controller")}},{key:"template",get:function(){var t;return null!=(t=Zc(this,Vc))?t:this.constructor.template},set:function(t){null!==t?"string"==typeof t?this.setAttribute("template",t):t instanceof HTMLTemplateElement&&(tu(this,Vc,t),tu(this,Hc,null),this.createRenderer()):this.removeAttribute("template")}},{key:"props",get:function(){var t,e,n,r,o=[].concat(Object(tt.a)(Array.from(null!=(e=null==(t=this.mediaController)?void 0:t.attributes)?e:[]).filter((function(t){var e=t.name;return nu[e]||e.startsWith("breakpoint")}))),Object(tt.a)(Array.from(this.attributes))),l={},c=Uc(o);try{for(c.s();!(r=c.n()).done;){var d=r.value,h=null!=(n=nu[d.name])?n:$(d.name),f=d.value;null!=f?(G(f)&&(f=parseFloat(f)),l[h]=""===f||f):l[h]=!1}}catch(t){c.e(t)}finally{c.f()}return l}},{key:"attributeChangedCallback",value:function(t,e,n){"template"===t&&e!=n&&eu(this,Yc,zc).call(this)}},{key:"connectedCallback",value:function(){this.addEventListener(A.BREAKPOINTS_COMPUTED,Zc(this,Qc)),Zc(this,Wc).observe(this,{attributes:!0}),Zc(this,Wc).observe(this.renderRoot,{attributes:!0,subtree:!0}),eu(this,Yc,zc).call(this)}},{key:"disconnectedCallback",value:function(){this.removeEventListener(A.BREAKPOINTS_COMPUTED,Zc(this,Qc)),Zc(this,Wc).disconnect()}},{key:"createRenderer",value:function(){this.template instanceof HTMLTemplateElement&&this.template!==Zc(this,Gc)&&(tu(this,Gc,this.template),this.renderer=new dc(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(iu.content.cloneNode(!0),this.renderer))}},{key:"render",value:function(){var t;null==(t=this.renderer)||t.update(this.props)}}]),n}(pt.HTMLElement);function su(){return(su=Object(et.a)(regeneratorRuntime.mark((function t(e){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e);case 2:if(200===(n=t.sent).status){t.next=5;break}throw new Error("Failed to load resource: the server responded with a status of ".concat(n.status));case 5:return t.abrupt("return",n.text());case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}Vc=new WeakMap,Gc=new WeakMap,Hc=new WeakMap,Wc=new WeakMap,Kc=new WeakSet,qc=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){var e=this[t];delete this[t],this[t]=e}},Yc=new WeakSet,zc=function(){var t,e=this,n=this.getAttribute("template");if(n&&n!==Zc(this,Hc)){var r=this.getRootNode(),template=null==(t=null==r?void 0:r.getElementById)?void 0:t.call(r,n);if(template)return tu(this,Hc,n),tu(this,Vc,template),void this.createRenderer();(function(t){if(!/^(\/|\.\/|https?:\/\/)/.test(t))return!1;var base=/^https?:\/\//.test(t)?void 0:location.origin;try{new URL(t,base)}catch(t){return!1}return!0})(n)&&(tu(this,Hc,n),function(t){return su.apply(this,arguments)}(n).then((function(data){var t=mt.createElement("template");t.innerHTML=data,tu(e,Vc,t),e.createRenderer()})).catch(console.error))}},Qc=new WeakMap,ru.observedAttributes=["template"],ru.processor=Dc,pt.customElements.get("media-theme")||pt.customElements.define("media-theme",ru);n(124);function au(t){var e=t.anchor,n=t.floating,r=t.placement,o=function(t){var e=t.anchor,n=t.floating;return{anchor:ou(e,n.offsetParent),floating:{x:0,y:0,width:n.offsetWidth,height:n.offsetHeight}}}({anchor:e,floating:n}),l=function(t,e){var n,r=t.anchor,o=t.floating,l="x"===function(t){return["top","bottom"].includes(lu(t))?"y":"x"}(e)?"y":"x",c="y"===l?"height":"width",d=lu(e),h=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,m=r[c]/2-o[c]/2;switch(d){case"top":n={x:h,y:r.y-o.height};break;case"bottom":n={x:h,y:r.y+r.height};break;case"right":n={x:r.x+r.width,y:f};break;case"left":n={x:r.x-o.width,y:f};break;default:n={x:r.x,y:r.y}}switch(e.split("-")[1]){case"start":n[l]-=m;break;case"end":n[l]+=m}return n}(o,r);return{x:l.x,y:l.y}}
2function ou(element,t){var e,rect=element.getBoundingClientRect(),n=null!=(e=null==t?void 0:t.getBoundingClientRect())?e:{x:0,y:0};return{x:rect.x-n.x,y:rect.y-n.y,width:rect.width,height:rect.height}}function lu(t){return t.split("-")[0]}var cu=n(88),uu=n(70),du=["action","relatedTarget"],hu=["newState","oldState"];function fu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var pu=function(t){Object(l.a)(n,t);var e=fu(n);function n(t){var r,l=t.action,c=void 0===l?"auto":l,d=t.relatedTarget,h=Object(cu.a)(t,du);return Object(o.a)(this,n),(r=e.call(this,"invoke",h)).action=c,r.relatedTarget=d,r}return Object(r.a)(n)}(Object(uu.a)(Event)),mu=function(t){Object(l.a)(n,t);var e=fu(n);function n(t){var r,l=t.newState,c=t.oldState,d=Object(cu.a)(t,hu);return Object(o.a)(this,n),(r=e.call(this,"toggle",d)).newState=l,r.oldState=c,r}return Object(r.a)(n)}(Object(uu.a)(Event));function gu(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return vu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vu(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function vu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function yu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var bu,Eu,Tu,ku,Su,_u,Au,Ou,wu,Iu,Ru,Lu,xu,Du,Cu,Pu,Mu,ju,Fu,Nu,Uu,Bu,$u,Vu,Gu,Hu,Wu,Ku,qu,Yu,zu,Qu,Xu,Zu,Ju,ed,nd,id,rd,sd,ad,od,ld,cd,ud,hd,fd=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},pd=function(t,e,n){return fd(t,e,"read from private field"),n?n.call(t):e.get(t)},md=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},gd=function(t,e,n,r){return fd(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},vd=function(t,e,n){return fd(t,e,"access private method"),n};function yd(t){var e=t.type,text=t.text,n=t.value,r=t.checked,o=mt.createElement("media-chrome-menu-item");o.type=null!=e?e:"",o.part.add("menu-item"),e&&o.part.add(e),o.value=n,o.checked=r;var label=mt.createElement("span");return label.textContent=text,o.append(label),o}function bd(t,e){var n=t.querySelector(':scope > [slot="'.concat(e,'"]'));if("SLOT"==(null==n?void 0:n.nodeName)&&(n=n.assignedElements({flatten:!0})[0]),n)return n=n.cloneNode(!0);var r=t.shadowRoot.querySelector('[name="'.concat(e,'"] > svg'));return r?r.cloneNode(!0):""}var Ed="style",Td="hidden",kd="disabled",Sd="anchor",_d=function(t){Object(l.a)(n,t);var e=yu(n);function n(){var t;if(Object(o.a)(this,n),t=e.call(this),md(Object(nt.a)(t),Ou),md(Object(nt.a)(t),Iu),md(Object(nt.a)(t),xu),md(Object(nt.a)(t),Cu),md(Object(nt.a)(t),Mu),md(Object(nt.a)(t),Fu),md(Object(nt.a)(t),$u),md(Object(nt.a)(t),Gu),md(Object(nt.a)(t),Wu),md(Object(nt.a)(t),qu),md(Object(nt.a)(t),zu),md(Object(nt.a)(t),Xu),md(Object(nt.a)(t),Ju),md(Object(nt.a)(t),nd),md(Object(nt.a)(t),rd),md(Object(nt.a)(t),ad),md(Object(nt.a)(t),ld),md(Object(nt.a)(t),ud),md(Object(nt.a)(t),bu,null),md(Object(nt.a)(t),Eu,null),md(Object(nt.a)(t),Tu,null),md(Object(nt.a)(t),ku,new Set),md(Object(nt.a)(t),Su,void 0),md(Object(nt.a)(t),_u,!1),md(Object(nt.a)(t),Au,null),md(Object(nt.a)(t),Lu,(function(){var e,n=pd(Object(nt.a)(t),ku),r=new Set(t.items),o=gu(n);try{for(o.s();!(e=o.n()).done;){var l=e.value;r.has(l)||t.dispatchEvent(new CustomEvent("removemenuitem",{detail:l}))}}catch(t){o.e(t)}finally{o.f()}var c,d=gu(r);try{for(d.s();!(c=d.n()).done;){var h=c.value;n.has(h)||t.dispatchEvent(new CustomEvent("addmenuitem",{detail:h}))}}catch(t){d.e(t)}finally{d.f()}gd(Object(nt.a)(t),ku,r)})),md(Object(nt.a)(t),Uu,(function(){vd(Object(nt.a)(t),$u,Vu).call(Object(nt.a)(t)),vd(Object(nt.a)(t),Gu,Hu).call(Object(nt.a)(t),!1)})),md(Object(nt.a)(t),Bu,(function(){vd(Object(nt.a)(t),$u,Vu).call(Object(nt.a)(t))})),!t.shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var r=At(t.attributes);t.shadowRoot.innerHTML=t.constructor.getTemplateHTML(r)}return t.container=t.shadowRoot.querySelector("#container"),t.defaultSlot=t.shadowRoot.querySelector("slot:not([name])"),gd(Object(nt.a)(t),Su,new MutationObserver(pd(Object(nt.a)(t),Lu))),t}return Object(r.a)(n,[{key:"enable",value:function(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}},{key:"disable",value:function(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}},{key:"handleEvent",value:function(t){switch(t.type){case"slotchange":vd(this,Ou,wu).
2call(this,t);break;case"invoke":vd(this,Cu,Pu).call(this,t);break;case"click":vd(this,Wu,Ku).call(this,t);break;case"toggle":vd(this,zu,Qu).call(this,t);break;case"focusout":vd(this,Ju,ed).call(this,t);break;case"keydown":vd(this,nd,id).call(this,t)}}},{key:"connectedCallback",value:function(){var t,e;pd(this,Su).observe(this.defaultSlot,{childList:!0}),gd(this,Au,jt(this.shadowRoot,":host")),vd(this,xu,Du).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),gd(this,bu,wt(this)),null==(e=null==(t=pd(this,bu))?void 0:t.associateElement)||e.call(t,this),this.hidden||(Tt(Od(this),pd(this,Uu)),Tt(this,pd(this,Bu))),vd(this,Iu,Ru).call(this),this.shadowRoot.addEventListener("slotchange",this)}},{key:"disconnectedCallback",value:function(){var t,e;pd(this,Su).disconnect(),kt(Od(this),pd(this,Uu)),kt(this,pd(this,Bu)),this.disable(),null==(e=null==(t=pd(this,bu))?void 0:t.unassociateElement)||e.call(t,this),gd(this,bu,null),gd(this,Eu,null),gd(this,Tu,null),this.shadowRoot.removeEventListener("slotchange",this)}},{key:"attributeChangedCallback",value:function(t,e,n){var r,o,l,c;t===Td&&n!==e?(pd(this,_u)||gd(this,_u,!0),this.hidden?vd(this,Fu,Nu).call(this):vd(this,Mu,ju).call(this),this.dispatchEvent(new mu({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):t===T?(e&&(null==(o=null==(r=pd(this,bu))?void 0:r.unassociateElement)||o.call(r,this),gd(this,bu,null)),n&&this.isConnected&&(gd(this,bu,wt(this)),null==(c=null==(l=pd(this,bu))?void 0:l.associateElement)||c.call(l,this))):t===kd&&n!==e?null==n?this.enable():this.disable():t===Ed&&n!==e&&vd(this,xu,Du).call(this)}},{key:"formatMenuItemText",value:function(text,data){return this.constructor.formatMenuItemText(text,data)}},{key:"anchor",get:function(){return this.getAttribute("anchor")},set:function(t){this.setAttribute("anchor","".concat(t))}},{key:"anchorElement",get:function(){var t;return this.anchor?null==(t=Ct(this))?void 0:t.querySelector("#".concat(this.anchor)):null}},{key:"items",get:function(){return this.defaultSlot.assignedElements({flatten:!0}).filter(Ad)}},{key:"radioGroupItems",get:function(){return this.items.filter((function(t){return"menuitemradio"===t.role}))}},{key:"checkedItems",get:function(){return this.items.filter((function(t){return t.checked}))}},{key:"value",get:function(){var t,e;return null!=(e=null==(t=this.checkedItems[0])?void 0:t.value)?e:""},set:function(t){var e=this.items.find((function(e){return e.value===t}));e&&vd(this,ud,hd).call(this,e)}},{key:"focus",value:function(){if(gd(this,Eu,Dt()),this.items.length)return vd(this,ld,cd).call(this,this.items[0]),void this.items[0].focus();var t=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');null==t||t.focus()}},{key:"handleSelect",value:function(t){var e,n=vd(this,rd,sd).call(this,t);n&&(vd(this,ud,hd).call(this,n,"checkbox"===n.type),pd(this,Tu)&&!this.hidden&&(null==(e=pd(this,Eu))||e.focus(),this.hidden=!0))}},{key:"keysUsed",get:function(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}},{key:"handleMove",value:function(t){var e,n,r=t.key,o=this.items,l=null!=(n=null!=(e=vd(this,rd,sd).call(this,t))?e:vd(this,ad,od).call(this))?n:o[0],c=o.indexOf(l),d=Math.max(0,c);"ArrowDown"===r?d++:"ArrowUp"===r?d--:"Home"===t.key?d=0:"End"===t.key&&(d=o.length-1),d<0&&(d=o.length-1),d>o.length-1&&(d=0),vd(this,ld,cd).call(this,o[d]),o[d].focus()}}],[{key:"observedAttributes",get:function(){return[kd,Td,Ed,Sd,T]}},{key:"formatMenuItemText",value:function(text,t){return text}}]),n}(pt.HTMLElement);function Ad(element){return["menuitem","menuitemradio","menuitemcheckbox"].includes(null==element?void 0:element.role)}function Od(t){var e;return null!=(e=t.getAttribute("bounds")?xt(t,"#".concat(t.getAttribute("bounds"))):Ot(t)||t.parentElement)?e:t}bu=new WeakMap,Eu=new WeakMap,Tu=new WeakMap,ku=new WeakMap,Su=new WeakMap,_u=new WeakMap,Au=new WeakMap,Ou=new WeakSet,wu=function(t){var e,slot=t.target,n=gu(slot.assignedNodes({flatten:!0}));try{for(n.s();!(e=n.n()).done;){var r=e.value;3===r.nodeType&&""===r.textContent.trim()&&r.remove()}}catch(t){n.e(t)}finally{n.f()}["header","title"].includes(slot.name)&&vd(this,Iu,Ru).call(this),slot.name||pd(this,Lu).call(this)},Iu=new WeakSet,Ru=function(){var header=this.shadowRoot.querySelector('slot[name="header"]'),title=this.shadowRoot.querySelector('slot[name="title"]');header.hidden=0===title.assignedNodes().length&&0===header.assignedNodes().length},Lu=new WeakMap,xu=new WeakSet,Du=function(){var t,e=this.shadowRoot.querySelector("#layout-row"),n=null==(t=getComputedStyle(this).getPropertyValue("--media-menu-layout"))?void 0:t.trim();e.setAttribute("media","row"===n?"":"width:0")},Cu=new WeakSet,Pu=function(t){gd(this,Tu,t.relatedTarget),Lt(this,t.relatedTarget)||(this.hidden=!this.hidden)},Mu=new WeakSet,ju=function(){var t,e=this;null==(t=pd(this,Tu))||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",(function(){return e.focus()}),{once:!0}),Tt(Od(this),pd(this,Uu)),Tt(this,pd(this,Bu))},Fu=new WeakSet,Nu=function(){var t;
2null==(t=pd(this,Tu))||t.setAttribute("aria-expanded","false"),kt(Od(this),pd(this,Uu)),kt(this,pd(this,Bu))},Uu=new WeakMap,Bu=new WeakMap,$u=new WeakSet,Vu=function(t){if((!this.hasAttribute("mediacontroller")||this.anchor)&&!this.hidden&&this.anchorElement){var e=au({anchor:this.anchorElement,floating:this,placement:"top-start"}),n=e.x,r=e.y;null!=t||(t=this.offsetWidth);var o=Od(this).getBoundingClientRect(),l=o.width-n-t,c=o.height-r-this.offsetHeight,style=pd(this,Au).style;style.setProperty("position","absolute"),style.setProperty("right","".concat(Math.max(0,l),"px")),style.setProperty("--_menu-bottom","".concat(c,"px"));var d=getComputedStyle(this),h=style.getPropertyValue("--_menu-bottom")===d.bottom?c:parseFloat(d.bottom),f=o.height-h-parseFloat(d.marginBottom);this.style.setProperty("--_menu-max-height","".concat(f,"px"))}},Gu=new WeakSet,Hu=function(animate){var t=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),e=null==t?void 0:t.querySelector('[role="menu"]'),style=pd(this,Au).style;if(animate||style.setProperty("--media-menu-transition-in","none"),e){var n=e.offsetHeight,r=Math.max(e.offsetWidth,t.offsetWidth);this.style.setProperty("min-width","".concat(r,"px")),this.style.setProperty("min-height","".concat(n,"px")),vd(this,$u,Vu).call(this,r)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),vd(this,$u,Vu).call(this);style.removeProperty("--media-menu-transition-in")},Wu=new WeakSet,Ku=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(pd(this,qu,Yu)))return null==(e=pd(this,Eu))||e.focus(),void(this.hidden=!0);var n=vd(this,rd,sd).call(this,t);n&&!n.hasAttribute("disabled")&&(vd(this,ld,cd).call(this,n),this.handleSelect(t))},qu=new WeakSet,Yu=function(){var t;return null==(t=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))?void 0:t.find((function(t){return t.matches('button[part~="back"]')}))},zu=new WeakSet,Qu=function(t){if(t.target!==this){vd(this,Xu,Zu).call(this);for(var e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]')),n=0,r=e;n<r.length;n++){var o=r[n];o.invokeTargetElement!=t.target&&("open"!=t.newState||"true"!=o.getAttribute("aria-expanded")||o.invokeTargetElement.hidden||o.invokeTargetElement.dispatchEvent(new pu({relatedTarget:o})))}for(var l=0,c=e;l<c.length;l++){var d=c[l];d.setAttribute("aria-expanded","".concat(!d.submenuElement.hidden))}vd(this,Gu,Hu).call(this,!0)}},Xu=new WeakSet,Zu=function(){var t=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!t)},Ju=new WeakSet,ed=function(t){var e;Lt(this,t.relatedTarget)||(pd(this,_u)&&(null==(e=pd(this,Eu))||e.focus()),pd(this,Tu)&&pd(this,Tu)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))},nd=new WeakSet,id=function(t){var e,n,r,o,l,c=t.key,d=t.ctrlKey,h=t.altKey,f=t.metaKey;if(!(d||h||f)&&this.keysUsed.includes(c))if(t.preventDefault(),t.stopPropagation(),"Tab"===c){if(pd(this,_u))return void(this.hidden=!0);t.shiftKey?null==(n=null==(e=this.previousElementSibling)?void 0:e.focus)||n.call(e):null==(o=null==(r=this.nextElementSibling)?void 0:r.focus)||o.call(r),this.blur()}else"Escape"===c?(null==(l=pd(this,Eu))||l.focus(),pd(this,_u)&&(this.hidden=!0)):"Enter"===c||" "===c?this.handleSelect(t):this.handleMove(t)},rd=new WeakSet,sd=function(t){return t.composedPath().find((function(t){return["menuitemradio","menuitemcheckbox"].includes(t.role)}))},ad=new WeakSet,od=function(){return this.items.find((function(t){return 0===t.tabIndex}))},ld=new WeakSet,cd=function(t){var e,n=gu(this.items);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.tabIndex=r===t?0:-1}}catch(t){n.e(t)}finally{n.f()}},ud=new WeakSet,hd=function(t,e){var n=Object(tt.a)(this.checkedItems);"radio"===t.type&&this.radioGroupItems.forEach((function(t){return t.checked=!1})),t.checked=!e||!t.checked,this.checkedItems.some((function(t,i){return t!=n[i]}))&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},_d.shadowRootOptions={mode:"open"},_d.getTemplateHTML=function(t){return"\n <style>\n :host {\n font: var(--media-font,\n var(--media-font-weight, normal)\n var(--media-font-size, 14px) /\n var(--media-text-content-height, var(--media-control-height, 24px))\n var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));\n color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));\n --_menu-bg: rgb(20 20 30 / .8);\n background: var(--media-menu-background, var(--media-control-background, var(--media-secondary-color, var(--_menu-bg))));\n border-radius: var(--media-menu-border-radius);\n border: var(--media-menu-border, none);\n display: var(--media-menu-display, inline-flex) !important;\n ".concat("\n transition: var(--media-menu-transition-in,\n visibility 0s,\n opacity .2s ease-out,\n transform .15s ease-out,\n left .2s ease-in-out,\n min-width .2s ease-in-out,\n min-height .2s ease-in-out\n ) !important;\n ","\n visibility: var(--media-menu-visibility, visible);\n opacity: var(--media-menu-opacity, 1);\n max-height: var(--media-menu-max-height, var(--_menu-max-height, 300px));\n transform: var(--media-menu-transform-in, translateY(0) scale(1));\n flex-direction: column;\n ",'\n min-height: 0;\n position: relative;\n bottom: var(--_menu-bottom);\n box-sizing: border-box;\n } \n\n @-moz-document url-prefix() {\n :host{\n --_menu-bg: rgb(20 20 30);\n }\n }\n\n :host([hidden]) {\n transition: var(--media-menu-transition-out,\n visibility .15s ease-in,\n opacity .15s ease-in,\n transform .15s ease-in\n ) !important;\n visibility: var(--media-menu-hidden-visibility, hidden);\n opacity: var(--media-menu-hidden-opacity, 0);\n max-height: var(--media-menu-hidden-max-height,\n var(--media-menu-max-height, var(--_menu-max-height, 300px)));\n transform: var(--media-menu-transform-out, translateY(2px) scale(.99));\n pointer-events: none;\n }
2\n\n :host([slot="submenu"]) {\n background: none;\n width: 100%;\n min-height: 100%;\n position: absolute;\n bottom: 0;\n right: -100%;\n }\n\n #container {\n display: flex;\n flex-direction: column;\n min-height: 0;\n transition: transform .2s ease-out;\n transform: translate(0, 0);\n }\n\n #container.has-expanded {\n transition: transform .2s ease-in;\n transform: translate(-100%, 0);\n }\n\n button {\n background: none;\n color: inherit;\n border: none;\n padding: 0;\n font: inherit;\n outline: inherit;\n display: inline-flex;\n align-items: center;\n }\n\n slot[name="header"][hidden] {\n display: none;\n }\n\n slot[name="header"] > *,\n slot[name="header"]::slotted(*) {\n padding: .4em .7em;\n border-bottom: 1px solid rgb(255 255 255 / .25);\n cursor: var(--media-cursor, default);\n }\n\n slot[name="header"] > button[part~="back"],\n slot[name="header"]::slotted(button[part~="back"]) {\n cursor: var(--media-cursor, pointer);\n }\n\n svg[part~="back"] {\n height: var(--media-menu-icon-height, var(--media-control-height, 24px));\n fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));\n display: block;\n margin-right: .5ch;\n }\n\n slot:not([name]) {\n gap: var(--media-menu-gap);\n flex-direction: var(--media-menu-flex-direction, column);\n overflow: var(--media-menu-overflow, hidden auto);\n display: flex;\n min-height: 0;\n }\n\n :host([role="menu"]) slot:not([name]) {\n padding-block: .4em;\n }\n\n slot:not([name])::slotted([role="menu"]) {\n background: none;\n }\n\n media-chrome-menu-item > span {\n margin-right: .5ch;\n max-width: var(--media-menu-item-max-width);\n text-overflow: ellipsis;\n overflow: hidden;\n }\n </style>\n <style id="layout-row" media="width:0">\n\n slot[name="header"] > *,\n slot[name="header"]::slotted(*) {\n padding: .4em .5em;\n }\n\n slot:not([name]) {\n gap: var(--media-menu-gap, .25em);\n flex-direction: var(--media-menu-flex-direction, row);\n padding-inline: .5em;\n }\n\n media-chrome-menu-item {\n padding: .3em .5em;\n }\n\n media-chrome-menu-item[aria-checked="true"] {\n background: var(--media-menu-item-checked-background, rgb(255 255 255 / .2));\n }\n\n ','\n media-chrome-menu-item::part(checked-indicator) {\n display: var(--media-menu-item-checked-indicator-display, none);\n }\n </style>\n <div id="container" part="container">\n <slot name="header" hidden>\n <button part="back button" aria-label="Back to previous menu">\n <slot name="back-icon">\n <svg aria-hidden="true" viewBox="0 0 20 24" part="back indicator">\n <path d="m11.88 17.585.742-.669-4.2-4.665 4.2-4.666-.743-.669-4.803 5.335 4.803 5.334Z"/>\n </svg>\n </slot>\n <slot name="title"></slot>\n </button>\n </slot>\n <slot></slot>\n </div>\n <slot name="checked-indicator" hidden></slot>\n ')},pt.customElements.get("media-chrome-menu")||pt.customElements.define("media-chrome-menu",_d);function wd(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Id(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Id(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function Id(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Rd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ld,xd,Dd,Cd,Pd,Md,jd,Fd,Nd,Ud,Bd,$d,Vd,Gd=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Hd=function(t,e,n){return Gd(t,e,"read from private field"),n?n.call(t):e.get(t)},Wd=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Kd=function(t,e,n,r){return Gd(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},qd=function(t,e,n){return Gd(t,e,"access private method"),n};var Yd="type",zd="value",Qd="checked",Xd="disabled",Zd=function(t){Object(l.a)(n,t);var e=Rd(n);function n(){var t;if(Object(o.a)(this,n),t=e.call(this),Wd(Object(nt.a)(t),Dd),Wd(Object(nt.a)(t),Pd),Wd(Object(nt.a)(t),jd),Wd(Object(nt.a)(t),$d),Wd(Object(nt.a)(t),Ld,!1),Wd(Object(nt.a)(t),xd,void 0),Wd(Object(nt.a)(t),Nd,(function(){var e,n;t.submenuElement.items&&t.setAttribute("submenusize","".concat(t.submenuElement.items.length));var r=t.shadowRoot.querySelector('slot[name="description"]'),o=null==(e=t.submenuElement.checkedItems)?void 0:e[0],l=null!=(n=null==o?void 0:o.dataset.description)?n:null==o?void 0:o.text,span=mt.createElement("span");span.textContent=null!=l?l:"",r.replaceChildren(span)})),Wd(Object(nt.a)(t),Ud,(function(e){var n=e.key;t.keysUsed.includes(n)?t.handleClick(e):t.removeEventListener("keyup",Hd(Object(nt.a)(t),Ud))})),Wd(Object(nt.a)(t),Bd,(function(e){var n=e.metaKey,r=e.altKey,o=e.key;n||r||!t.keysUsed.includes(o)?t.removeEventListener("keyup",Hd(Object(nt.a)(t),Ud)):t.addEventListener("keyup",Hd(Object(nt.a)(t),Ud),{once:!0})})),!t.shadowRoot){t.attachShadow(t.constructor.shadowRootOptions);var r=At(t.attributes);t.shadowRoot.innerHTML=t.constructor.getTemplateHTML(r)}return t}return Object(r.a)(n,[{key:"enable",value:function(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),Jd(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","fal
2se"),this.addEventListener("click",this),this.addEventListener("keydown",this)}},{key:"disable",value:function(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}},{key:"handleEvent",value:function(t){switch(t.type){case"slotchange":qd(this,Dd,Cd).call(this,t);break;case"click":this.handleClick(t);break;case"keydown":Hd(this,Bd).call(this,t);break;case"keyup":Hd(this,Ud).call(this,t)}}},{key:"attributeChangedCallback",value:function(t,e,n){t===Qd&&Jd(this)&&!Hd(this,Ld)?this.setAttribute("aria-checked",null!=n?"true":"false"):t===Yd&&n!==e?this.role="menuitem"+n:t===Xd&&n!==e&&(null==n?this.enable():this.disable())}},{key:"connectedCallback",value:function(){this.hasAttribute(Xd)||this.enable(),this.role="menuitem"+this.type,Kd(this,xd,eh(this,this.parentNode)),qd(this,$d,Vd).call(this),this.submenuElement&&qd(this,Pd,Md).call(this),this.shadowRoot.addEventListener("slotchange",this)}},{key:"disconnectedCallback",value:function(){this.disable(),qd(this,$d,Vd).call(this),Kd(this,xd,null),this.shadowRoot.removeEventListener("slotchange",this)}},{key:"invokeTarget",get:function(){return this.getAttribute("invoketarget")},set:function(t){this.setAttribute("invoketarget","".concat(t))}},{key:"invokeTargetElement",get:function(){var t;return this.invokeTarget?null==(t=Ct(this))?void 0:t.querySelector("#".concat(this.invokeTarget)):this.submenuElement}},{key:"submenuElement",get:function(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}},{key:"type",get:function(){var t;return null!=(t=this.getAttribute(Yd))?t:""},set:function(t){this.setAttribute(Yd,"".concat(t))}},{key:"value",get:function(){var t;return null!=(t=this.getAttribute(zd))?t:this.text},set:function(t){this.setAttribute(zd,t)}},{key:"text",get:function(){var t;return(null!=(t=this.textContent)?t:"").trim()}},{key:"checked",get:function(){if(Jd(this))return"true"===this.getAttribute("aria-checked")},set:function(t){Jd(this)&&(Kd(this,Ld,!0),this.setAttribute("aria-checked",t?"true":"false"),t?this.part.add("checked"):this.part.remove("checked"))}},{key:"handleClick",value:function(t){Jd(this)||this.invokeTargetElement&&Lt(this,t.target)&&this.invokeTargetElement.dispatchEvent(new pu({relatedTarget:this}))}},{key:"keysUsed",get:function(){return["Enter"," "]}}],[{key:"observedAttributes",get:function(){return[Yd,Xd,Qd,zd]}}]),n}(pt.HTMLElement);function Jd(t){return"radio"===t.type||"checkbox"===t.type}function eh(t,e){if(!t)return null;var n=t.getRootNode().host;return!e&&n?eh(t,n):(null==e?void 0:e.items)?e:eh(e,null==e?void 0:e.parentNode)}Ld=new WeakMap,xd=new WeakMap,Dd=new WeakSet,Cd=function(t){var slot=t.target;if(!(null==slot?void 0:slot.name)){var e,n=wd(slot.assignedNodes({flatten:!0}));try{for(n.s();!(e=n.n()).done;){var r=e.value;r instanceof Text&&""===r.textContent.trim()&&r.remove()}}catch(t){n.e(t)}finally{n.f()}}"submenu"===slot.name&&(this.submenuElement?qd(this,Pd,Md).call(this):qd(this,jd,Fd).call(this))},Pd=new WeakSet,Md=function(){var t=Object(et.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded","".concat(!this.submenuElement.hidden)),this.submenuElement.addEventListener("change",Hd(this,Nd)),this.submenuElement.addEventListener("addmenuitem",Hd(this,Nd)),this.submenuElement.addEventListener("removemenuitem",Hd(this,Nd)),Hd(this,Nd).call(this);case 6:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),jd=new WeakSet,Fd=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",Hd(this,Nd)),this.submenuElement.removeEventListener("addmenuitem",Hd(this,Nd)),this.submenuElement.removeEventListener("removemenuitem",Hd(this,Nd)),Hd(this,Nd).call(this)},Nd=new WeakMap,Ud=new WeakMap,Bd=new WeakMap,$d=new WeakSet,Vd=function(){var t,e=null==(t=Hd(this,xd))?void 0:t.radioGroupItems;if(e){var n=e.filter((function(t){return"true"===t.getAttribute("aria-checked")})).pop();n||(n=e[0]);var r,o=wd(e);try{for(o.s();!(r=o.n()).done;
2){r.value.setAttribute("aria-checked","false")}}catch(t){o.e(t)}finally{o.f()}null==n||n.setAttribute("aria-checked","true")}},Zd.shadowRootOptions={mode:"open"},Zd.getTemplateHTML=function(t){return'\n <style>\n :host {\n transition: var(--media-menu-item-transition,\n background .15s linear,\n opacity .2s ease-in-out\n );\n outline: var(--media-menu-item-outline, 0);\n outline-offset: var(--media-menu-item-outline-offset, -1px);\n cursor: var(--media-cursor, pointer);\n display: flex;\n align-items: center;\n align-self: stretch;\n justify-self: stretch;\n white-space: nowrap;\n white-space-collapse: collapse;\n text-wrap: nowrap;\n padding: .4em .8em .4em 1em;\n }\n\n :host(:focus-visible) {\n box-shadow: var(--media-menu-item-focus-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));\n outline: var(--media-menu-item-hover-outline, 0);\n outline-offset: var(--media-menu-item-hover-outline-offset, var(--media-menu-item-outline-offset, -1px));\n }\n\n :host(:hover) {\n cursor: var(--media-cursor, pointer);\n background: var(--media-menu-item-hover-background, rgb(92 92 102 / .5));\n outline: var(--media-menu-item-hover-outline);\n outline-offset: var(--media-menu-item-hover-outline-offset, var(--media-menu-item-outline-offset, -1px));\n }\n\n :host([aria-checked="true"]) {\n background: var(--media-menu-item-checked-background);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n :host([disabled]) {\n pointer-events: none;\n color: rgba(255, 255, 255, .3);\n }\n\n slot:not([name]) {\n width: 100%;\n }\n\n slot:not([name="submenu"]) {\n display: inline-flex;\n align-items: center;\n transition: inherit;\n opacity: var(--media-menu-item-opacity, 1);\n }\n\n slot[name="description"] {\n justify-content: end;\n }\n\n slot[name="description"] > span {\n display: inline-block;\n margin-inline: 1em .2em;\n max-width: var(--media-menu-item-description-max-width, 100px);\n text-overflow: ellipsis;\n overflow: hidden;\n font-size: .8em;\n font-weight: 400;\n text-align: right;\n position: relative;\n top: .04em;\n }\n\n slot[name="checked-indicator"] {\n display: none;\n }\n\n :host(:is([role="menuitemradio"],[role="menuitemcheckbox"])) slot[name="checked-indicator"] {\n display: var(--media-menu-item-checked-indicator-display, inline-block);\n }\n\n '.concat("\n svg, img, ::slotted(svg), ::slotted(img) {\n height: var(--media-menu-item-icon-height, var(--media-control-height, 24px));\n fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));\n display: block;\n }\n\n ",'\n [part~="indicator"],\n ::slotted([part~="indicator"]) {\n fill: var(--media-menu-item-indicator-fill,\n var(--media-icon-color, var(--media-primary-color, rgb(238 238 238))));\n height: var(--media-menu-item-indicator-height, 1.25em);\n margin-right: .5ch;\n }\n\n [part~="checked-indicator"] {\n visibility: hidden;\n }\n\n :host([aria-checked="true"]) [part~="checked-indicator"] {\n visibility: visible;\n }\n </style>\n <slot name="checked-indicator">\n <svg aria-hidden="true" viewBox="0 1 24 24" part="checked-indicator indicator">\n <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>\n </svg>\n </slot>\n <slot name="prefix"></slot>\n <slot></slot>\n <slot name="description"></slot>\n <slot name="suffix">\n ',this.getSuffixSlotInnerHTML(t),'\n </slot>\n <slot name="submenu"></slot>\n ')},Zd.getSuffixSlotInnerHTML=function(t){return""},pt.customElements.get("media-chrome-menu-item")||pt.customElements.define("media-chrome-menu-item",Zd);function nh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var ih=function(t){Object(l.a)(n,t);var e=nh(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n,[{key:"anchorElement",get:function(){return"auto"!==this.anchor?Object(it.a)(Object(d.a)(n.prototype),"anchorElement",this):Ot(this).querySelector("media-settings-menu-button")}}]),n}(_d);ih.getTemplateHTML=function(t){return"\n ".concat(_d.getTemplateHTML(t),'\n <style>\n :host {\n --_menu-bg: rgb(20 20 30 / .8);
2\n background: var(--media-settings-menu-background,\n var(--media-menu-background,\n var(--media-control-background,\n var(--media-secondary-color, var(--_menu-bg)))));\n min-width: var(--media-settings-menu-min-width, 170px);\n border-radius: 2px 2px 0 0;\n overflow: hidden;\n }\n\n @-moz-document url-prefix() {\n :host{\n --_menu-bg: rgb(20 20 30);\n }\n }\n\n :host([role="menu"]) {\n ',"\n justify-content: end;\n }\n\n slot:not([name]) {\n justify-content: var(--media-settings-menu-justify-content);\n flex-direction: var(--media-settings-menu-flex-direction, column);\n overflow: visible;\n }\n\n #container.has-expanded {\n --media-settings-menu-item-opacity: 0;\n }\n </style>\n ")},pt.customElements.get("media-settings-menu")||pt.customElements.define("media-settings-menu",ih);function rh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var sh=function(t){Object(l.a)(n,t);var e=rh(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n)}(Zd);sh.shadowRootOptions={mode:"open"},sh.getTemplateHTML=function(t){return"\n ".concat(Zd.getTemplateHTML.call(this,t),'\n <style>\n slot:not([name="submenu"]) {\n opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));\n }\n\n :host([aria-expanded="true"]:hover) {\n background: transparent;\n }\n </style>\n ')},sh.getSuffixSlotInnerHTML=function(t){return'\n <svg aria-hidden="true" viewBox="0 0 20 24">\n <path d="m8.12 17.585-.742-.669 4.2-4.665-4.2-4.666.743-.669 4.803 5.335-4.803 5.334Z"/>\n </svg>\n '},pt.customElements.get("media-settings-menu-item")||pt.customElements.define("media-settings-menu-item",sh);function ah(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var oh=function(t){Object(l.a)(n,t);var e=ah(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}},{key:"invokeTarget",get:function(){return this.getAttribute("invoketarget")},set:function(t){this.setAttribute("invoketarget","".concat(t))}},{key:"invokeTargetElement",get:function(){var t;return this.invokeTarget?null==(t=Ct(this))?void 0:t.querySelector("#".concat(this.invokeTarget)):null}},{key:"handleClick",value:function(){var t;null==(t=this.invokeTargetElement)||t.dispatchEvent(new pu({relatedTarget:this}))}}]),n}(rr);pt.customElements.get("media-chrome-menu-button")||pt.customElements.define("media-chrome-menu-button",oh);function lh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var ch=function(t){Object(l.a)(n,t);var e=lh(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}
2return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.setAttribute("aria-label",Q("settings"))}},{key:"invokeTargetElement",get:function(){return null!=this.invokeTarget?Object(it.a)(Object(d.a)(n.prototype),"invokeTargetElement",this):Ot(this).querySelector("media-settings-menu")}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),["target"])}}]),n}(oh);ch.getSlotTemplateHTML=function(){return'\n <style>\n :host([aria-expanded="true"]) slot[name=tooltip] {\n display: none;\n }\n </style>\n <slot name="icon">\n <svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="M4.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"/>\n </svg>\n </slot>\n '},ch.getTooltipContentHTML=function(){return Q("Settings")},pt.customElements.get("media-settings-menu-button")||pt.customElements.define("media-settings-menu-button",ch);function uh(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return dh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dh(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function dh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function hh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var fh,ph,mh,gh,vh,yh,bh=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Eh=function(t,e,n){return bh(t,e,"read from private field"),n?n.call(t):e.get(t)},Th=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},kh=function(t,e,n,r){return bh(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},Sh=function(t,e,n){return bh(t,e,"access private method"),n},_h=function(t){Object(l.a)(n,t);var e=hh(n);function n(){var t;return Object(o.a)(this,n),t=e.apply(this,arguments),Th(Object(nt.a)(t),mh),Th(Object(nt.a)(t),vh),Th(Object(nt.a)(t),fh,[]),Th(Object(nt.a)(t),ph,void 0),t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,r){var o;Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_AUDIO_TRACK_ENABLED&&e!==r?this.value=r:t===_.MEDIA_AUDIO_TRACK_LIST&&e!==r&&(kh(this,fh,null==(o=null!=r?r:"")?void 0:o.split(/\s+/).map(B)),Sh(this,mh,gh).call(this))}},{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.addEventListener("change",Sh(this,vh,yh))}},{key:"disconnectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("change",Sh(this,vh,yh))}},{key:"anchorElement",get:function(){var t;return"auto"!==this.anchor?Object(it.a)(Object(d.a)(n.prototype),"anchorElement",this):null==(t=Ot(this))?void 0:t.querySelector("media-audio-track-menu-button")}},{key:"mediaAudioTrackList",get:function(){return Eh(this,fh)},set:function(t){kh(this,fh,t),Sh(this,mh,gh).call(this)}},{key:"mediaAudioTrackEnabled",get:function(){var t;return null!=(t=$t(this,_.MEDIA_AUDIO_TRACK_ENABLED))?t:""},set:function(t){Vt(this,_.MEDIA_AUDIO_TRACK_ENABLED,t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_AUDIO_TRACK_LIST,_.MEDIA_AUDIO_TRACK_ENABLED,_.MEDIA_AUDIO_TRACK_UNAVAILABLE])}}]),n}(_d);fh=new WeakMap,ph=new WeakMap,mh=new WeakSet,gh=function(){if(Eh(this,ph)!==JSON.stringify(this.mediaAudioTrackList)){kh(this,ph,JSON.stringify(this.mediaAudioTrackList));var t=this.mediaAudioTrackList;this.defaultSlot.textContent="",t.sort((function(a,b){return a.id.localeCompare(b.id,void 0,{numeric:!0})}));var e,n=uh(t);try{for(n.s();!(e=n.n()).done;){var r=e.value,o=yd({type:"radio",text:this.formatMenuItemText(r.label,r),value:"".concat(r.id),checked:r.enabled});o.prepend(bd(this,"checked-indicator")),this.defaultSlot.append(o)}}catch(t){n.e(t)}finally{n.f()}}},vh=new WeakSet,yh=function(){if(null!=this.value){var t=new pt.CustomEvent(y.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)}},pt.customElements.get("media-audio-track-menu")||pt.customElements.define("media-audio-track-menu",_h);function Ah(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Oh=function(t){var label=Q("Audio");t.setAttribute("aria-label",label)},wh=function(t){Object(l.a)(n,t);var e=Ah(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}
2return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),Oh(this)}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_LANG&&Oh(this)}},{key:"invokeTargetElement",get:function(){var t;return null!=this.invokeTarget?Object(it.a)(Object(d.a)(n.prototype),"invokeTargetElement",this):null==(t=Ot(this))?void 0:t.querySelector("media-audio-track-menu")}},{key:"mediaAudioTrackEnabled",get:function(){var t;return null!=(t=$t(this,_.MEDIA_AUDIO_TRACK_ENABLED))?t:""},set:function(t){Vt(this,_.MEDIA_AUDIO_TRACK_ENABLED,t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_AUDIO_TRACK_ENABLED,_.MEDIA_AUDIO_TRACK_UNAVAILABLE])}}]),n}(oh);wh.getSlotTemplateHTML=function(){return'\n <style>\n :host([aria-expanded="true"]) slot[name=tooltip] {\n display: none;\n }\n </style>\n <slot name="icon">'.concat('<svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>\n <path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>\n</svg>',"</slot>\n ")},wh.getTooltipContentHTML=function(){return Q("Audio")},pt.customElements.get("media-audio-track-menu-button")||pt.customElements.define("media-audio-track-menu-button",wh);function Ih(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Rh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rh(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function Rh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Lh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var xh,Dh,Ch,Ph,Mh,jh=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Fh=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Nh=function(t,e,n){return jh(t,e,"access private method"),n};var Uh=function(t){Object(l.a)(n,t);var e=Lh(n);function n(){var t;return Object(o.a)(this,n),t=e.apply(this,arguments),Fh(Object(nt.a)(t),Dh),Fh(Object(nt.a)(t),Ph),Fh(Object(nt.a)(t),xh,void 0),t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_SUBTITLES_LIST&&e!==r?Nh(this,Dh,Ch).call(this):t===_.MEDIA_SUBTITLES_SHOWING&&e!==r&&(this.value=r||"",Nh(this,Dh,Ch).call(this))}},{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.addEventListener("change",Nh(this,Ph,Mh))}},{key:"disconnectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("change",Nh(this,Ph,Mh))}},{key:"anchorElement",get:function(){return"auto"!==this.anchor?Object(it.a)(Object(d.a)(n.prototype),"anchorElement",this):Ot(this).querySelector("media-captions-menu-button")}},{key:"mediaSubtitlesList",get:function(){return Bh(this,_.MEDIA_SUBTITLES_LIST)},set:function(t){$h(this,_.MEDIA_SUBTITLES_LIST,t)}},{key:"mediaSubtitlesShowing",get:function(){return Bh(this,_.MEDIA_SUBTITLES_SHOWING)},set:function(t){$h(this,_.MEDIA_SUBTITLES_SHOWING,t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_SUBTITLES_LIST,_.MEDIA_SUBTITLES_SHOWING])}}]),n}(_d);xh=new WeakMap,Dh=new WeakSet,Ch=function(){var t,e,n,r,o=(jh(e=this,n=xh,"read from private field"),(r?r.call(e):n.get(e))!==JSON.stringify(this.mediaSubtitlesList)),l=this.value!==this.getAttribute(_.MEDIA_SUBTITLES_SHOWING);if(o||l){!function(t,e,n,r){jh(t,e,"write to private field"),r?r.call(t,n):e.set(t,n)}(this,xh,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";var c=!this.value,d=yd({type:"radio",text:this.formatMenuItemText(Q("Off")),value:"off",checked:c});d.prepend(bd(this,"checked-indicator")),this.defaultSlot.append(d);var h,f=Ih(this.mediaSubtitlesList);try{for(f.s();!(h=f.n()).done;){var m=h.value,v=yd({type:"radio",text:this.formatMenuItemText(m.label,m),value:Ke(m),checked:this.value==Ke(m)});
2v.prepend(bd(this,"checked-indicator")),"captions"===(null!=(t=m.kind)?t:"subs")&&v.append(bd(this,"captions-indicator")),this.defaultSlot.append(v)}}catch(t){f.e(t)}finally{f.f()}}},Ph=new WeakSet,Mh=function(){var t=this.mediaSubtitlesShowing,e=this.getAttribute(_.MEDIA_SUBTITLES_SHOWING),n=this.value!==e;if((null==t?void 0:t.length)&&n&&this.dispatchEvent(new pt.CustomEvent(y.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),this.value&&n){var r=new pt.CustomEvent(y.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(r)}},Uh.getTemplateHTML=function(t){return"\n ".concat(_d.getTemplateHTML(t),'\n <slot name="captions-indicator" hidden>').concat('\n <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">\n <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>\n </svg>',"</slot>\n ")};var Bh=function(t,e){var n=t.getAttribute(e);return n?He(n):[]},$h=function(t,e,n){if(null==n?void 0:n.length){var r=qe(n);t.getAttribute(e)!==r&&t.setAttribute(e,r)}else t.removeAttribute(e)};pt.customElements.get("media-captions-menu")||pt.customElements.define("media-captions-menu",Uh);function Vh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Gh=function(t){t.setAttribute("data-captions-enabled",Xe(t).toString())},Hh=function(t){t.setAttribute("aria-label",Q("closed captions"))},Wh=function(t){Object(l.a)(n,t);var e=Vh(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),Hh(this),Gh(this)}},{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_SUBTITLES_SHOWING?Gh(this):t===_.MEDIA_LANG&&Hh(this)}},{key:"invokeTargetElement",get:function(){var t;return null!=this.invokeTarget?Object(it.a)(Object(d.a)(n.prototype),"invokeTargetElement",this):null==(t=Ot(this))?void 0:t.querySelector("media-captions-menu")}},{key:"mediaSubtitlesList",get:function(){return Kh(this,_.MEDIA_SUBTITLES_LIST)},set:function(t){qh(this,_.MEDIA_SUBTITLES_LIST,t)}},{key:"mediaSubtitlesShowing",get:function(){return Kh(this,_.MEDIA_SUBTITLES_SHOWING)},set:function(t){qh(this,_.MEDIA_SUBTITLES_SHOWING,t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_SUBTITLES_LIST,_.MEDIA_SUBTITLES_SHOWING,_.MEDIA_LANG])}}]),n}(oh);Wh.getSlotTemplateHTML=function(){return'\n <style>\n :host([data-captions-enabled="true"]) slot[name=off] {\n display: none !important;\n }\n\n '.concat('\n :host(:not([data-captions-enabled="true"])) slot[name=on] {\n display: none !important;\n }\n\n :host([aria-expanded="true"]) slot[name=tooltip] {\n display: none;\n }\n </style>\n\n <slot name="icon">\n <slot name="on">','<svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M22.83 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79
20 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>\n</svg>','</slot>\n <slot name="off">').concat('<svg aria-hidden="true" viewBox="0 0 26 24">\n <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>\n</svg>',"</slot>\n </slot>\n ")},Wh.getTooltipContentHTML=function(){return Q("Captions")};var Kh=function(t,e){var n=t.getAttribute(e);return n?He(n):[]},qh=function(t,e,n){if(null==n?void 0:n.length){var r=qe(n);t.getAttribute(e)!==r&&t.setAttribute(e,r)}else t.removeAttribute(e)};pt.customElements.get("media-captions-menu-button")||pt.customElements.define("media-captions-menu-button",Wh);function Yh(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return zh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zh(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function zh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Qh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Xh,Zh,Jh,tf,ef,nf=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},rf=function(t,e,n){return nf(t,e,"read from private field"),n?n.call(t):e.get(t)},sf=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},af=function(t,e,n){return nf(t,e,"access private method"),n},of="rates",lf=function(t){Object(l.a)(n,t);var e=Qh(n);function n(){var t;return Object(o.a)(this,n),t=e.call(this),sf(Object(nt.a)(t),Zh),sf(Object(nt.a)(t),tf),sf(Object(nt.a)(t),Xh,new Ne(Object(nt.a)(t),of,{defaultValue:Fa})),af(Object(nt.a)(t),Zh,Jh).call(Object(nt.a)(t)),t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,r){Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_PLAYBACK_RATE&&e!=r?(this.value=r,af(this,Zh,Jh).call(this)):t===of&&e!=r&&(rf(this,Xh).value=r,af(this,Zh,Jh).call(this))}},{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.addEventListener("change",af(this,tf,ef))}},{key:"disconnectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("change",af(this,tf,ef))}},{key:"anchorElement",get:function(){return"auto"!==this.anchor?Object(it.a)(Object(d.a)(n.prototype),"anchorElement",this):Ot(this).querySelector("media-playback-rate-menu-button")}},{key:"rates",get:function(){return rf(this,Xh)},set:function(t){t?Array.isArray(t)?rf(this,Xh).value=t.join(" "):"str
2ing"==typeof t&&(rf(this,Xh).value=t):rf(this,Xh).value="",af(this,Zh,Jh).call(this)}},{key:"mediaPlaybackRate",get:function(){return Ft(this,_.MEDIA_PLAYBACK_RATE,1)},set:function(t){Nt(this,_.MEDIA_PLAYBACK_RATE,t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_PLAYBACK_RATE,of])}}]),n}(_d);Xh=new WeakMap,Zh=new WeakSet,Jh=function(){this.defaultSlot.textContent="";var t=Na(this.mediaPlaybackRate),e=new Set(Array.from(rf(this,Xh)).map((function(t){return Na(Number(t))})));t>0&&!e.has(t)&&e.add(t);var n,r=Yh(Array.from(e).sort((function(a,b){return a-b})));try{for(r.s();!(n=r.n()).done;){var o=n.value,l=yd({type:"radio",text:this.formatMenuItemText("".concat(o,"x"),o),value:o.toString(),checked:t===o});l.prepend(bd(this,"checked-indicator")),this.defaultSlot.append(l)}}catch(t){r.e(t)}finally{r.f()}},tf=new WeakSet,ef=function(){if(this.value){var t=new pt.CustomEvent(y.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)}},pt.customElements.get("media-playback-rate-menu")||pt.customElements.define("media-playback-rate-menu",lf);function cf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var uf=function(t){Object(l.a)(n,t);var e=cf(n);function n(){var t,r;return Object(o.a)(this,n),(t=e.call(this)).container=t.shadowRoot.querySelector('slot[name="icon"]'),t.container.innerHTML="".concat(Na(null!=(r=t.mediaPlaybackRate)?r:1),"x"),t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,r){if(Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),t===_.MEDIA_PLAYBACK_RATE){var o=r?+r:Number.NaN,l=Na(Number.isNaN(o)?1:o);this.container.innerHTML="".concat(l,"x"),this.setAttribute("aria-label",Q("Playback rate {playbackRate}",{playbackRate:l}))}}},{key:"invokeTargetElement",get:function(){return null!=this.invokeTarget?Object(it.a)(Object(d.a)(n.prototype),"invokeTargetElement",this):Ot(this).querySelector("media-playback-rate-menu")}},{key:"mediaPlaybackRate",get:function(){return Ft(this,_.MEDIA_PLAYBACK_RATE,1)},set:function(t){Nt(this,_.MEDIA_PLAYBACK_RATE,t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_PLAYBACK_RATE])}}]),n}(oh);uf.getSlotTemplateHTML=function(t){var e=t.mediaplaybackrate?Na(+t.mediaplaybackrate):1;return'\n <style>\n :host {\n min-width: 5ch;\n padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));\n }\n\n :host([aria-expanded="true"]) slot {\n display: block;\n }\n\n :host([aria-expanded="true"]) slot[name=tooltip] {\n display: none;\n }\n </style>\n <slot name="icon">'.concat(e,"x</slot>\n ")},uf.getTooltipContentHTML=function(){return Q("Playback rate")},pt.customElements.get("media-playback-rate-menu-button")||pt.customElements.define("media-playback-rate-menu-button",uf);function df(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return hf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hf(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function hf(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function ff(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var pf,mf,gf,vf,yf,bf,Ef=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Tf=function(t,e,n){return Ef(t,e,"read from private field"),n?n.call(t):e.get(t)},kf=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Sf=function(t,e,n,r){return Ef(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},_f=function(t,e,n){return Ef(t,e,"access private method"),n},Af=function(t){Object(l.a)(n,t);var e=ff(n);function n(){var t;return Object(o.a)(this,n),t=e.apply(this,arguments),kf(Object(nt.a)(t),gf),kf(Object(nt.a)(t),yf),kf(Object(nt.a)(t),pf,[]),kf(Object(nt.a)(t),mf,{}),t}return Object(r.a)(n,[{key:"attributeChangedCallback",value:function(t,e,r){if(Object(it.a)(Object(d.a)(n.prototype),"attributeChangedCallback",this).call(this,t,e,r),e!==r)switch(t){case _.MEDIA_RENDITION_SELECTED:this.value=null!=r?r:"auto",_f(this,gf,vf).call(this);break;case _.MEDIA_RENDITION_LIST:Sf(this,pf,null==(o=r)?void 0:o.split(/\s+/).map(N)),_f(this,gf,vf).call(this);break;case _.MEDIA_HEIGHT:case _.MEDIA_WIDTH:_f(this,gf,vf).call(this)}var o}},{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.addEventListener("change",_f(this,yf,bf))}},{key:"disconnectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("change",_f(this,yf,bf))}},{key:"anchorElement",get:function(){return"auto"!==this.anchor?Object(it.a)(Object(d.a)(n.prototype),"anchorElement",this):Ot(this).querySelector("media-rendition-menu-button")}},{key:"mediaRenditionList",get:function(){return Tf(this,pf)},set:function(t){Sf(this,pf,t),_f(this,gf,vf).call(this)}},{key:"mediaRenditionSelected",get:function(){return $t(this,_.MEDIA_RENDITION_SELECTED)},set:function(t){Vt(this,_.MEDIA_RENDITION_SELECTED,t)}},{key:"mediaHeight",get:function(){return Ft(this,_.MEDIA_HEIGHT)},set:function(t){Nt(this,_.MEDIA_HEIGHT,t)}},{key:"mediaWidth",get:function(){return Ft(this,_.MEDIA_WIDTH)},set:function(t){Nt(this,_.MEDIA_WIDTH,t)}},{key:"compareRendition",value:function(a,b){return this.constructor.compareRendition(a,b)}},{key:"formatMenuItemText",value:function(text,t){return this.constructor.formatMenuItemText(text,t)}},{key:"formatRendition",value:function(t,e){return this.constructor.formatRendition(t,e)}},{key:"showRenditionBitrate",value:function(t){return this.mediaRenditionList.some((function(e){return e!==t&&e.height===t.height&&e.bitrate!==t.bitrate}))}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_RENDITION_LIST,_.MEDIA_RENDITION_SELECTED,_.MEDIA_RENDITION_UNAVAILABLE,_.MEDIA_HEIGHT,_.MEDIA_WIDTH])}},{key:"formatMenuItemText",value:function(text,t){return Object(it.a)(Object(d.a)(n),"formatMenuItemText",this).call(this,text,t)}},{key:"formatRendition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.showBitrate,r=void 0!==n&&n,o="".concat(Math.min(t.width,t.height),"p");if(r&&t.bitrate){var l=t.bitrate/1e6,c="".concat(l.toFixed(l<1?1:0)," Mbps");return"".concat(o," (").concat(c,")")}return this.formatMenuItemText(o,t)}},{key:"compareRendition",value:function(a,b){var t,e;return b.height===a.height?(null!=(t=b.bitrate)?t:0)-(null!=(e=a.bitrate)?e:0):b.height-a.height}}]),n}(_d);pf=new WeakMap,mf=new WeakMap,gf=new WeakSet,vf=function(){var t=this,e=!this.mediaRenditionSelected;if(Tf(this,mf).mediaRenditionList!==JSON.stringify(this.mediaRenditionList)||Tf(this,mf).mediaHeight!==this.mediaHeight||Tf(this,mf).mediaWidth!==this.mediaWidth||Tf(this,mf).isAuto!==e){Tf(this,mf).mediaRenditionList=JSON.stringify(this.mediaRenditionList),Tf(this,mf).mediaHeight=this.mediaHeight,Tf(this,mf).mediaWidth=this.mediaWidth,Tf(this,mf).isAuto=e;var n,r=this.mediaRenditionList.sort(this.compareRendition.bind(this)),o=r.find((function(e){return e.id===t.mediaRenditionSelected})),l=df(r);try{for(l.s();!(n=l.n()).done;){var c=n.value;c.selected=c===o}}catch(t){l.e(t)}finally{l.f()}this.defaultSlot.textContent="";var d,h=df(r);try{for(h.s();!(d=h.n()).done;){var f=d.value,m=yd({type:"radio",text:this.formatRendition(f,{showBitrate:this.showRenditionBitrate(f)}),value:"".concat(f.id),checked:f.selected&&!e});
2m.prepend(bd(this,"checked-indicator")),this.defaultSlot.append(m)}}catch(t){h.e(t)}finally{h.f()}var v=o&&this.showRenditionBitrate(o),y=void 0;e&&(o?y=this.formatMenuItemText("".concat(Q("Auto")," ⢠").concat(this.formatRendition(o,{showBitrate:v})),o):this.mediaHeight>0&&this.mediaWidth>0&&(y=this.formatMenuItemText("".concat(Q("Auto")," (").concat(Math.min(this.mediaWidth,this.mediaHeight),"p)")))),y||(y=this.formatMenuItemText(Q("Auto")));var E=yd({type:"radio",text:y,value:"auto",checked:e});E.dataset.description=y,E.prepend(bd(this,"checked-indicator")),this.defaultSlot.append(E)}},yf=new WeakSet,bf=function(){if(null!=this.value){var t=new pt.CustomEvent(y.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)}},pt.customElements.get("media-rendition-menu")||pt.customElements.define("media-rendition-menu",Af);function Of(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var wf=function(t){Object(l.a)(n,t);var e=Of(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),this.setAttribute("aria-label",Q("quality"))}},{key:"invokeTargetElement",get:function(){return null!=this.invokeTarget?Object(it.a)(Object(d.a)(n.prototype),"invokeTargetElement",this):Ot(this).querySelector("media-rendition-menu")}},{key:"mediaRenditionSelected",get:function(){return $t(this,_.MEDIA_RENDITION_SELECTED)},set:function(t){Vt(this,_.MEDIA_RENDITION_SELECTED,t)}},{key:"mediaHeight",get:function(){return Ft(this,_.MEDIA_HEIGHT)},set:function(t){Nt(this,_.MEDIA_HEIGHT,t)}}],[{key:"observedAttributes",get:function(){return[].concat(Object(tt.a)(Object(it.a)(Object(d.a)(n),"observedAttributes",this)),[_.MEDIA_RENDITION_SELECTED,_.MEDIA_RENDITION_UNAVAILABLE,_.MEDIA_HEIGHT])}}]),n}(oh);wf.getSlotTemplateHTML=function(){return'\n <style>\n :host([aria-expanded="true"]) slot[name=tooltip] {\n display: none;\n }\n </style>\n <slot name="icon">'.concat('<svg aria-hidden="true" viewBox="0 0 24 24">\n <path d="M13.5 2.5h2v6h-2v-2h-11v-2h11v-2Zm4 2h4v2h-4v-2Zm-12 4h2v6h-2v-2h-3v-2h3v-2Zm4 2h12v2h-12v-2Zm1 4h2v6h-2v-2h-8v-2h8v-2Zm4 2h7v2h-7v-2Z" />\n</svg>',"</slot>\n ")},wf.getTooltipContentHTML=function(){return Q("Quality")},pt.customElements.get("media-rendition-menu-button")||pt.customElements.define("media-rendition-menu-button",wf);function If(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Rf,Lf,xf,Df,Cf,Pf,Mf,jf,Ff,Nf,Uf,Bf,$f,Vf,Gf,Hf=function(t,e,n){if(!e.has(t))throw TypeError("Cannot "+n)},Wf=function(t,e,n){return Hf(t,e,"read from private field"),n?n.call(t):e.get(t)},Kf=function(t,e,n){if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},qf=function(t,e,n,r){return Hf(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n},Yf=function(t,e,n){return Hf(t,e,"access private method"),n};var zf=function(t){Object(l.a)(n,t);var e=If(n);function n(){var t;return Object(o.a)(this,n),t=e.call(this),Kf(Object(nt.a)(t),Lf),Kf(Object(nt.a)(t),Df),Kf(Object(nt.a)(t),Pf),Kf(Object(nt.a)(t),jf),Kf(Object(nt.a)(t),Uf),Kf(Object(nt.a)(t),Rf,!1),Kf(Object(nt.a)(t),Nf,(function(e){var n=e.target,r="VIDEO"===(null==n?void 0:n.nodeName),o=Yf(Object(nt.a)(t),jf,Ff).call(Object(nt.a)(t),n);(r||o)&&(Wf(Object(nt.a)(t),Rf)?Yf(Object(nt.a)(t),Df,Cf).call(Object(nt.a)(t)):Yf(Object(nt.a)(t),Uf,Bf).call(Object(nt.a)(t),e))})),Kf(Object(nt.a)(t),$f,(function(e){var n=e.target,r=t.contains(n),o=2===e.button,l="VIDEO"===(null==n?void 0:n.nodeName),c=Yf(Object(nt.a)(t),jf,Ff).call(Object(nt.a)(t),n);r||(o&&(l||c)||Yf(Object(nt.a)(t),Df,Cf).call(Object(nt.a)(t)))})),Kf(Object(nt.a)(t),Vf,(function(e){"Escape"===e.key&&Yf(Object(nt.a)(t),Df,Cf).call(Object(nt.a)(t))})),Kf(Object(nt.a)(t),Gf,(function(e){var n,r,o=e.target;if(null==(n=o.matches)?void 0:n.call(o,'button[invoke="copy"]')){var input=null==(r=o.closest("media-context-menu-item"))?void 0:r.querySelector('input[slot="copy"]');input&&navigator.clipboard.writeText(input.value)}Yf(Object(nt.a)(t),Df,Cf).call(Object(nt.a)(t))})),t.setAttribute("noautohide",""),Yf(Object(nt.a)(t),Lf,xf).call(Object(nt.a)(t)),t}
2return Object(r.a)(n,[{key:"connectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"connectedCallback",this).call(this),Ot(this).addEventListener("contextmenu",Wf(this,Nf)),this.addEventListener("click",Wf(this,Gf))}},{key:"disconnectedCallback",value:function(){Object(it.a)(Object(d.a)(n.prototype),"disconnectedCallback",this).call(this),Ot(this).removeEventListener("contextmenu",Wf(this,Nf)),this.removeEventListener("click",Wf(this,Gf)),document.removeEventListener("mousedown",Wf(this,$f)),document.removeEventListener("keydown",Wf(this,Vf))}}]),n}(_d);Rf=new WeakMap,Lf=new WeakSet,xf=function(){this.hidden=!Wf(this,Rf)},Df=new WeakSet,Cf=function(){qf(this,Rf,!1),Yf(this,Lf,xf).call(this)},Pf=new WeakSet,Mf=function(){var t=this;document.querySelectorAll("media-context-menu").forEach((function(menu){var e;menu!==t&&Yf(e=menu,Df,Cf).call(e)}))},jf=new WeakSet,Ff=function(element){return!!element&&(!(!element.hasAttribute("slot")||"media"!==element.getAttribute("slot"))||!(!element.nodeName.includes("-")||!element.tagName.includes("-"))&&(element.hasAttribute("src")||element.hasAttribute("poster")||element.hasAttribute("preload")||element.hasAttribute("playsinline")))},Nf=new WeakMap,Uf=new WeakSet,Bf=function(t){t.preventDefault(),Yf(this,Pf,Mf).call(this),qf(this,Rf,!0),this.style.position="fixed",this.style.left="".concat(t.clientX,"px"),this.style.top="".concat(t.clientY,"px"),Yf(this,Lf,xf).call(this),document.addEventListener("mousedown",Wf(this,$f),{once:!0}),document.addEventListener("keydown",Wf(this,Vf),{once:!0})},$f=new WeakMap,Vf=new WeakMap,Gf=new WeakMap,zf.getTemplateHTML=function(t){return"\n ".concat(_d.getTemplateHTML(t),"\n <style>\n :host {\n --_menu-bg: rgb(20 20 30 / .8);\n background: var(--media-settings-menu-background,\n var(--media-menu-background,\n var(--media-control-background,\n var(--media-secondary-color, var(--_menu-bg)))));\n min-width: var(--media-settings-menu-min-width, 170px);\n border-radius: 2px;\n overflow: hidden;\n }\n </style>\n ")},pt.customElements.get("media-context-menu")||pt.customElements.define("media-context-menu",zf);function Qf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Xf=function(t){Object(l.a)(n,t);var e=Qf(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n)}(Zd);Xf.shadowRootOptions={mode:"open"},Xf.getTemplateHTML=function(t){return"\n ".concat(Zd.getTemplateHTML.call(this,t),"\n <style>\n ::slotted(*) {\n color: var(--media-text-color, white);\n text-decoration: none;\n border: none;\n background: none;\n cursor: pointer;\n padding: 0;\n min-height: var(--media-control-height, 24px);\n }\n </style>\n ")},pt.customElements.get("media-context-menu-item")||pt.customElements.define("media-context-menu-item",Xf);var Zf,Jf,tp;function ep(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(d.a)(t);if(e){var o=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var np=null===(Zf=pt.document)||void 0===Zf||null===(Jf=Zf.createElement)||void 0===Jf?void 0:Jf.call(Zf,"template");np&&(np.innerHTML=String.raw(tp||(tp=Object(h.a)(['\n <style>\n :host {\n --_primary-color: var(--media-primary-color, rgb(255 255 255 / 0.9));\n --_secondary-color: var(--media-secondary-color, rgb(0 0 0 / .75));\n --_volume-range-expand-width: 70px;\n --_volume-range-expand-height: 42px;\n\n --media-icon-color: var(--_primary-color);\n --media-range-thumb-background: var(--_primary-color);\n --media-range-bar-color: var(--_primary-color);\n --media-range-thumb-opacity: 0;\n --media-control-background: transparent;\n --media-control-hover-background: transparent;\n --media-control-padding: 5px 5px;\n --media-preview-time-text-shadow: none;\n --media-tooltip-display: none;\n\n color: var(--_primary-color);\n }\n\n @supports (color: color-mix(in srgb, red, blue)) {\n :host {\n --_secondary-color: color-mix(in srgb, var(--media-secondary-color, #000) 75%, transparent);\n }\n }\n\n [disabled]:not(media-live-button) {\n opacity: 60%;
2\n cursor: not-allowed;\n }\n\n [breakpointsm] {\n --media-control-padding: 9px 5px;\n }\n\n [breakpointmd] {\n --media-control-padding: 9px 7px;\n }\n\n media-time-range,\n media-live-button,\n media-time-display,\n media-text-display,\n media-playback-rate-button[role=\'button\'] {\n color: inherit;\n }\n\n media-controller::part(centered-layer) {\n display: grid;\n justify-content: unset;\n padding-bottom: 6px;\n }\n\n :host([streamtype=live]:not([targetlivewindow])) media-controller::part(centered-layer),\n :host([mediastreamtype=live]:not([mediatargetlivewindow])) media-controller::part(centered-layer) {\n padding-bottom: 0;\n }\n\n media-loading-indicator {\n place-self: center;\n /* Stack the grid items on top of each other */\n grid-area: 1 / 1;\n }\n\n media-control-bar {\n place-self: var(--_control-bar-place-self, end center);\n grid-area: 1 / 1;\n position: relative;\n margin: 10px;\n gap: 4px;\n align-items: start;\n }\n\n :host([controlbarplace$="end"]) media-control-bar {\n align-items: end;\n }\n\n .control-group {\n background: var(--_secondary-color);\n position: relative;\n display: inline-flex;\n border-radius: 5px;\n }\n\n :host([controlbarvertical]) :is(media-control-bar, .control-group) {\n flex-direction: column;\n width: 40px;\n }\n\n .volume-group {\n position: relative;\n display: inline-flex;\n flex-direction: row;\n }\n\n :host([controlbarplace$="end"]) .volume-group {\n flex-direction: row;\n }\n\n :host([controlbarplace$="end"]) .volume-group:first-child .volume-range-span {\n --_volume-range-padding-left: 10px;\n }\n\n :host([controlbarvertical]) .volume-group {\n flex-direction: column;\n }\n\n :host([controlbarvertical][controlbarplace^="end"]) .volume-group {\n flex-direction: column-reverse;\n }\n\n :host([controlbarvertical][controlbarplace^="end"]) .volume-group:first-child .volume-range-span {\n --_volume-range-padding-top: 10px;\n }\n\n .volume-range-span {\n display: inline-flex;\n position: relative;\n overflow: hidden;\n width: 0;\n transition: width .2s ease-in-out , height .2s ease-in-out;\n }\n\n .volume-group:hover .volume-range-span,\n [keyboardcontrol] .volume-group:focus-within .volume-range-span {\n width: var(--_volume-range-expand-width);\n padding-left: var(--_volume-range-padding-left);\n padding-top: var(--_volume-range-padding-top);\n }\n\n :host([controlbarvertical]) .volume-range-span {\n --_volume-range-padding-left: 0 !important;\n display: inline-flex;\n height: 0;\n }\n\n :host([controlbarvertical]) .volume-group:hover .volume-range-span,\n :host([controlbarvertical]) [keyboardcontrol] .volume-group:focus-within .volume-range-span {\n height: var(--_volume-range-expand-height);\n width: auto;\n max-width: 40px;\n }\n\n media-volume-range {\n --media-range-track-border-radius: 2px;\n --media-range-track-background: rgba(255, 255, 255, .2);\n\n width: var(--_volume-range-expand-width);\n display: var(--controls, var(--volume-range, inline-block));\n border-radius: 5px;\n }\n\n :host([controlbarvertical]) media-volume-range {\n width: var(--_volume-range-expand-height);\n transform: rotate(-90deg);\n }\n\n media-control-bar:has(.volume-group:hover),\n [keyboardcontrol] media-control-bar:has(.volume-group:focus-within) {\n top: var(--_control-bar-offset-top, 0);\n left: var(--_control-bar-offset-left, - var(--_volume-range-expand-width));\n }\n\n :host([controlbarplace$="start"]),\n :host([controlbarplace$="end"]) {\n --_control-bar-offset-left: 0;\n }\n\n :host([controlbarvertical]) {\n --_control-bar-offset-left: 0;\n }\n\n :host([controlbarvertical][controlbarplace^="center"]) {\n --_control-bar-offset-top: - var(--_volume-range-expand-height);\n }\n\n media-time-range {\n --media-range-track-height: 6px;\n --media-range-track-transition: height .1s linear;\n --media-range-track-background: rgba(20, 20, 30, .25);\n --media-time-range-buffered-color: rgba(20, 20, 30, .3);
2\n --media-range-track-box-shadow: 0 -1px 0 rgba(20, 20, 30, .07);\n --media-range-padding-left: 0;\n --media-range-padding-right: 0;\n --media-preview-time-background: var(--_secondary-color);\n --media-preview-box-margin: 0 0 3px;\n\n display: var(--controls, var(--time-range, inline-block));\n width: 100%;\n height: 10px;\n bottom: -2px;\n }\n\n media-live-button {\n --media-control-background: var(--_secondary-color);\n --media-control-hover-background: var(--_secondary-color);\n border-radius: 5px;\n }\n\n media-live-button::before {\n content: \'\';\n width: 5px;\n }\n\n media-live-button::after {\n content: \'\';\n width: 7px;\n }\n\n /* Turn some buttons off by default */\n media-seek-backward-button {\n display: var(--media-control-display, var(--media-seek-backward-button-display, none));\n }\n\n media-seek-forward-button {\n display: var(--media-control-display, var(--media-seek-forward-button-display, none));\n }\n\n media-pip-button {\n display: var(--media-control-display, var(--media-pip-button-display, none));\n }\n </style>\n\n <template partial="PlayButton">\n <media-play-button\n part="play button"\n disabled="{{disabled}}"\n aria-disabled="{{disabled}}"\n >\n <svg aria-hidden="true" viewBox="0 0 24 24" slot="play">\n <path d="m6.73 20.93 14.05-8.54a.46.46 0 0 0 0-.78L6.73 3.07a.48.48 0 0 0-.73.39v17.07a.48.48 0 0 0 .73.4Z" />\n </svg>\n <svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">\n <path\n d="M6 19.5a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v15ZM14.5 4a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3Z"\n />\n </svg>\n </media-play-button>\n </template>\n\n <template partial="SeekBackwardButton">\n <media-seek-backward-button\n seekoffset="{{backwardseekoffset ?? 10}}"\n part="seek-backward button"\n disabled="{{disabled}}"\n aria-disabled="{{disabled}}"\n >\n <svg aria-hidden="true" viewBox="0 0 22 24" slot="icon">\n <path d="M11 6V3L5.37 7 11 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 11 6Z" />\n <text class="value" transform="translate(2.5 21)" style="font-size: 8px; font-family: \'ArialMT\', \'Arial\'">\n {{backwardseekoffset ?? 10}}\n </text>\n </svg>\n </media-seek-backward-button>\n </template>\n\n <template partial="SeekForwardButton">\n <media-seek-forward-button\n seekoffset="{{forwardseekoffset ?? 10}}"\n part="seek-forward button"\n disabled="{{disabled}}"\n aria-disabled="{{disabled}}"\n >\n <svg aria-hidden="true" viewBox="0 0 22 24" slot="icon">\n <path d="M11 6V3l5.61 4L11 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 11 6Z" />\n <text class="value" transform="translate(10 21)" style="font-size: 8px; font-family: \'ArialMT\', \'Arial\'">\n {{forwardseekoffset ?? 10}}\n </text>\n </svg>\n </media-seek-forward-button>\n </template>\n\n <template partial="MuteButton">\n <media-mute-button part="mute button" disabled="{{disabled}}" aria-disabled="{{disabled}}">\n <svg aria-hidden="true" viewBox="0 0 24 24" slot="high">\n <path\n d="m11.14 4.86-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.21a.5.5 0 0 0-.86-.35Zm2.74-1.56v1.52A7.52 7.52 0 0 1 19.47 12a7.52 7.52 0 0 1-5.59 7.18v1.52A9 9 0 0 0 21 12a9 9 0 0 0-7.12-8.7Zm3.56 8.7a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"\n />\n </svg>\n <svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">\n <path\n d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"\n />\n </svg>\n <svg aria-hidden="true" viewBox="0 0 24 24" slot="low">\n <path\n d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"\n />\n </svg>\n <svg aria-hidden="true" viewBox="0 0 24 24" slot="off">\n <path\n d="m3 4.05 4.48 4.47-.33.33a.49.49 0 0 1-.36.15H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.48.48 0 0 0 .36.15.5.5 0 0 0 .5-.5v-5.75l4.67 4.66a7.71 7.71 0 0 1-2.79 1.47v1.52a9.32 9.32
20 0 0 3.87-1.91L20 21l1-1L4.06 3 3 4.05Zm5.36 5.36 2.39 2.39V17L8 14.26a1.74 1.74 0 0 0-1.24-.51H4.25v-3.5h2.54A1.74 1.74 0 0 0 8 9.74l.36-.33ZM19.47 12a7.19 7.19 0 0 1-.89 3.47l1.11 1.1A8.64 8.64 0 0 0 21 12a9 9 0 0 0-7.12-8.7v1.52A7.52 7.52 0 0 1 19.47 12ZM12 8.88V5.21a.5.5 0 0 0-.5-.5.48.48 0 0 0-.36.15L9.56 6.44 12 8.88ZM15.91 12a4.284 4.284 0 0 1-.07.72l1.22 1.22a5.2 5.2 0 0 0 .38-1.94 5.49 5.49 0 0 0-3.56-5.1v1.66A4 4 0 0 1 15.91 12Z"\n />\n </svg>\n </media-mute-button>\n </template>\n\n <template partial="CaptionsButton">\n <media-captions-button\n part="captions button"\n disabled="{{disabled}}"\n aria-disabled="{{disabled}}"\n >\n <svg aria-hidden="true" viewBox="0 0 26 24" slot="on">\n <path\n d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.41 10.1a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 4 4 0 0 1-1.28-.83 3.67 3.67 0 0 1-.84-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.53 3.53 0 0 1 .84-1.21 3.89 3.89 0 0 1 1.29-.8 4.76 4.76 0 0 1 1.63-.27 4.06 4.06 0 0 1 1.35.24c.225.091.44.205.64.34a2.7 2.7 0 0 1 .55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.35 2.35 0 0 0-.46.77 2.78 2.78 0 0 0-.16 1c-.009.34.046.68.16 1 .104.283.26.545.46.77.188.21.415.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.88 2.88 0 0 1-1.22 1.01Zm7.52 0a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 3.89 3.89 0 0 1-1.28-.83 3.55 3.55 0 0 1-.85-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.43 3.43 0 0 1 .85-1.25 3.75 3.75 0 0 1 1.28-.8 4.76 4.76 0 0 1 1.63-.27 4 4 0 0 1 1.35.24c.225.091.44.205.64.34.21.144.395.32.55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.352 2.352 0 0 0-.46.77 3.01 3.01 0 0 0-.16 1c-.003.34.05.678.16 1 .108.282.263.542.46.77.188.21.416.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.82 2.82 0 0 1-1.21 1.05Z"\n />\n </svg>\n <svg aria-hidden="true" viewBox="0 0 26 24" slot="off">\n <path\n d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-1.81-.12-4.67-.18-7.53-.18-2.86 0-5.72.06-7.53.18a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c1.81.12 4.67.18 7.53.18 2.86 0 5.72-.06 7.53-.18a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.137-.21-8.283 0-12.42a1.11 1.11 0 0 1 .91-1.11c1.67-.11 4.43-.18 7.43-.18s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.137.21 8.283 0 12.42ZM10.843 14a1.55 1.55 0 0 1-.76.18 1.57 1.57 0 0 1-.71-.18 1.69 1.69 0 0 1-.57-.42 2.099 2.099 0 0 1-.38-.58 2.47 2.47 0 0 1 0-1.64 2 2 0 0 1 .39-.66 1.73 1.73 0 0 1 .58-.42c.23-.103.479-.158.73-.16.241-.004.48.044.7.14.199.088.373.222.51.39l1.08-.89a2.179 2.179 0 0 0-.47-.44 2.81 2.81 0 0 0-.54-.32 2.91 2.91 0 0 0-.58-.15 2.71 2.71 0 0 0-.56 0 4.08 4.08 0 0 0-1.38.15 3.27 3.27 0 0 0-1.09.67 3.14 3.14 0 0 0-.71 1.06 3.62 3.62 0 0 0-.26 1.39 3.57 3.57 0 0 0 .26 1.38 3 3 0 0 0 .71 1.06c.316.293.687.52 1.09.67.443.16.91.238 1.38.23a3.2 3.2 0 0 0 1.28-.27c.401-.183.747-.47 1-.83l-1.17-.88a1.42 1.42 0 0 1-.53.52Zm6.62 0a1.58 1.58 0 0 1-.76.18 1.54 1.54 0 0 1-.7-.18 1.69 1.69 0 0 1-.57-.42 2.12 2.12 0 0 1-.43-.58 2.29 2.29 0 0 1 .39-2.3 1.84 1.84 0 0 1 1.32-.58c.241-.003.48.045.7.14.199.088.373.222.51.39l1.08-.92a2.43 2.43 0 0 0-.47-.44 3.22 3.22 0 0 0-.53-.29 2.999 2.999 0 0 0-.57-.15 2.87 2.87 0 0 0-.57 0 4.06 4.06 0 0 0-1.36.15 3.17 3.17 0 0 0-1.09.67 3 3 0 0 0-.72 1.06 3.62 3.62 0 0 0-.25 1.39 3.57 3.57 0 0 0 .25 1.38c.16.402.405.764.72 1.06a3.17 3.17 0 0 0 1.09.67c.44.16.904.237 1.37.23.441 0 .877-.092 1.28-.27a2.45 2.45 0 0 0 1-.83l-1.15-.85a1.49 1.49 0 0 1-.54.49Z"\n />\n </svg>\n </media-captions-button>\n </template>\n\n <template partial="PipButton">\n <media-pip-button part="pip button" disabled="{{disabled}}" aria-disabled="{{disabled}}">\n <svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">\n <path\n d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"\n />\n </svg>\n <svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">\n <path\n d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"\n />\n </svg>\n </media-pip-button>
2\n </template>\n\n <template partial="AirplayButton">\n <media-airplay-button part="airplay button" disabled="{{disabled}}" aria-disabled="{{disabled}}">\n <svg aria-hidden="true" viewBox="0 0 26 24" slot="icon">\n <path\n d="M13.19 14.22a.25.25 0 0 0-.38 0l-5.46 6.37a.25.25 0 0 0 .19.41h10.92a.25.25 0 0 0 .19-.41l-5.46-6.37Z"\n />\n <path\n d="M22 3H4a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h2.94L8 16.75H4.25V4.25h17.5v12.5H18L19.06 18H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"\n />\n </svg>\n </media-airplay-button>\n </template>\n\n <template partial="CastButton">\n <media-cast-button part="cast button" disabled="{{disabled}}" aria-disabled="{{disabled}}">\n <svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">\n <path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z" />\n <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z" />\n <path\n d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"\n />\n </svg>\n <svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">\n <path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z" />\n <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z" />\n <path\n d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"\n />\n <path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z" />\n </svg>\n </media-cast-button>\n </template>\n\n <template partial="FullscreenButton">\n <media-fullscreen-button\n part="fullscreen button"\n disabled="{{disabled}}"\n aria-disabled="{{disabled}}"\n >\n <svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">\n <path\n d="M20.25 14.5a.76.76 0 0 0-.75.75v4.25h-4.25a.75.75 0 1 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5a.76.76 0 0 0-.75-.75Zm0-11.5h-5a.76.76 0 0 0-.75.75.76.76 0 0 0 .75.75h4.25v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75ZM8.75 19.5H4.5v-4.25a.76.76 0 0 0-.75-.75.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75h5a.75.75 0 1 0 0-1.5Zm0-16.5h-5a.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75.76.76 0 0 0 .75-.75V4.5h4.25a.76.76 0 0 0 .75-.75.76.76 0 0 0-.75-.75Z"\n />\n </svg>\n <svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">\n <path\n d="M20.25 14.5h-5a.76.76 0 0 0-.75.75v5a.75.75 0 1 0 1.5 0V16h4.25a.75.75 0 1 0 0-1.5Zm-5-5h5a.75.75 0 1 0 0-1.5H16V3.75a.75.75 0 1 0-1.5 0v5a.76.76 0 0 0 .75.75Zm-6.5 5h-5a.75.75 0 1 0 0 1.5H8v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75Zm0-11.5a.76.76 0 0 0-.75.75V8H3.75a.75.75 0 0 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5A.76.76 0 0 0 8.75 3Z"\n />\n </svg>\n </media-fullscreen-button>\n </template>\n\n <template partial="LiveButton">\n <media-live-button\n part="live seek-live button"\n disabled="{{disabled}}"\n aria-disabled="{{disabled}}"\n >\n <span slot="text">Live</span>\n </media-live-button>\n </template>\n\n <template partial="TimeRange">\n <media-time-range\n part="time range"\n disabled="{{disabled}}"\n aria-disabled="{{disabled}}"\n ></media-time-range>\n </template>\n\n <template partial="VolumeRange">
2\n <span class="volume-range-span">\n <media-volume-range\n part="volume range"\n disabled="{{disabled}}"\n aria-disabled="{{disabled}}"\n ></media-volume-range>\n </span>\n </template>\n\n \x3c!--\n controlbarplace targets the place-self CSS property of the controlbar.\n e.g. controlbarplace="center center" will center the controlbar.\n --\x3e\n\n <media-controller\n style="--_control-bar-place-self:{{controlbarplace ?? \'unset\'}}"\n defaultsubtitles="{{defaultsubtitles}}"\n defaultduration="{{defaultduration}}"\n gesturesdisabled="{{disabled}}"\n hotkeys="{{hotkeys}}"\n nohotkeys="{{nohotkeys}}"\n defaultstreamtype="on-demand"\n >\n <slot name="media" slot="media"></slot>\n <slot name="poster" slot="poster"></slot>\n <media-loading-indicator slot="centered-chrome" noautohide></media-loading-indicator>\n <media-error-dialog slot="dialog"></media-error-dialog>\n\n <template if="streamtype == \'on-demand\'">\n\n <media-control-bar slot="centered-chrome">\n <div class="control-group">\n {{>PlayButton}}\n {{>SeekBackwardButton}}\n {{>SeekForwardButton}}\n <span class="volume-group">\n {{>MuteButton}}\n {{>VolumeRange}}\n </span>\n {{>CaptionsButton}}\n {{>AirplayButton}}\n {{>CastButton}}\n {{>PipButton}}\n {{>FullscreenButton}}\n </div>\n </media-control-bar>\n {{>TimeRange}}\n\n </template>\n\n <template if="streamtype == \'live\'">\n\n <template if="!targetlivewindow">\n\n <media-control-bar slot="centered-chrome">\n {{>LiveButton}}\n <div class="control-group">\n <span class="volume-group">\n {{>MuteButton}}\n {{>VolumeRange}}\n </span>\n {{>CaptionsButton}}\n {{>AirplayButton}}\n {{>CastButton}}\n {{>PipButton}}\n {{>FullscreenButton}}\n </div>\n </media-control-bar>\n\n </template>\n\n <template if="targetlivewindow > 0">\n\n <media-control-bar slot="centered-chrome">\n {{>LiveButton}}\n <div class="control-group">\n {{>PlayButton}}\n {{>SeekBackwardButton}}\n {{>SeekForwardButton}}\n <span class="volume-group">\n {{>MuteButton}}\n {{>VolumeRange}}\n </span>\n {{>CaptionsButton}}\n {{>AirplayButton}}\n {{>CastButton}}\n {{>PipButton}}\n {{>FullscreenButton}}\n </div>\n </media-control-bar>\n {{>TimeRange}}\n\n </template>\n\n </template>\n\n <slot></slot>\n\n </media-controller>\n\n ']))));var ip=function(t){Object(l.a)(n,t);var e=ep(n);function n(){return Object(o.a)(this,n),e.apply(this,arguments)}return Object(r.a)(n)}(ru);ip.template=np,pt.customElements&&!pt.customElements.get("media-theme-microvideo")&&pt.customElements.define("media-theme-microvideo",ip)},491:function(t,e,n){"use strict";n(15),n(30),n(18),n(25),n(38),n(27),n(40),n(37),n(39),n(19),n(36),n(41);var r,o,l=n(88),c=n(9),d=n(12),h=n(10),f=n(20),m=n(2),v=n(3),y=n(0),E=n(4),T=n(6),k=n(7),S=n(1),_=n(5),A=n(24);n(59),n(8),n(16),n(34),n(35),n(17),n(31),n(61),n(50),n(33),n(42),n(14),n(163),n(233),n(234),n(235),n(236),n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(246),n(306),n(91),n(92),n(93),n(94),n(95),n(96),n(97),n(98),n(99),n(100),n(101),n(102),n(103),n(104),n(105),n(106),n(107),n(480),n(481);function O(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function I(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(S.a)(t);if(e){var o=Object(S.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(k.a)(this,n)}}var R=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],L=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function x(t){return'\n <style>\n :host {\n display: inline-flex;\n line-height: 0;\n flex-direction: column;\n justify-content: end;\n }\n\n audio {\n width: 100%;\n }\n </style>\n <slot name="media">\n <audio'.concat(P(t),"></audio>\n </slot>\n <slot></slot>\n ")}function D(t){return'\n <style>\n :host {\n display: inline-block;\n line-height: 0;\n }\n\n video {\n max-width: 100%;\n max-height: 100%;\n min-width: 100%;\n min-height: 100%;\n object-fit: var(--media-object-fit, contain);\n object-position: var(--media-object-position, 50% 50%);\n }\n\n video::-webkit-media-text-track-container {\n transform: var(--media-webkit-text-track-transform);\n transition: var(--media-webkit-text-track-transition);\n }\n </style>\n <slot name="media">\n <video'.concat(P(t),"></video>\n </slot>\n <slot></slot>\n ")}function C(t,e){var n,r,o,l,d,h,f,E,k,S,w,C,P,M,j,F,N,U=e.tag,B=e.is,$=null===(n=globalThis.document)||void 0===n||null===(r=n.createElement)||void 0===r?void 0:r.call(n,U,{is:B}),V=$?function(t){for(var e=[],n=Object.getPrototypeOf(t);n&&n!==HTMLElement.prototype;n=Object.getPrototypeOf(n)){var r=Object.getOwnPropertyNames(n);e.push.apply(e,Object(c.a)(r))}return e}($):[];return l=Object(A.a)("isDefined"),d=Object(A.a)("define"),h=Object(A.a)("isInit"),f=Object(A.a)("nativeEl"),E=Object(A.a)("childMap"),k=Object(A.a)("childObserver"),S=Object(A.a)("slotChangeHandler"),w=Object(A.a)("init"),C=Object(A.a)("setupListeners"),P=Object(A.a)("syncMediaChildren"),M=Object(A.a)("syncMediaChildAttribute"),j=Object(A.a)("enableDefaultTrack"),F=Object(A.a)("upgradeProperty"),N=Object(A.a)("forwardAttribute"),o=function(t){Object(T.a)(n,t);var e=I(n);function n(){var t;Object(m.a)(this,n);for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return t=e.call.apply(e,[this].concat(o)),Object.defineProperty(Object(y.a)(t),N,{value:Q}),Object.defineProperty(Object(y.a)(t),F,{value:z}),Object.defineProperty(Object(y.a)(t),j,{value:Y}),Object.defineProperty(Object(y.a)(t),M,{value:K}),Object.defineProperty(Object(y.a)(t),P,{value:W}),Object.defineProperty(Object(y.a)(t),C,{value:H}),Object.defineProperty(Object(y.a)(t),w,{value:G}
2),Object.defineProperty(Object(y.a)(t),h,{writable:!0,value:!1}),Object.defineProperty(Object(y.a)(t),f,{writable:!0,value:null}),Object.defineProperty(Object(y.a)(t),E,{writable:!0,value:new Map}),Object.defineProperty(Object(y.a)(t),k,{writable:!0,value:void 0}),Object.defineProperty(Object(y.a)(t),S,{writable:!0,value:void 0}),t.get=void 0,t.set=void 0,t.call=void 0,t}return Object(v.a)(n,[{key:"nativeEl",get:function(){var t,e,n,r,o;return Object(_.a)(this,w)[w](),null!==(t=null!==(e=null!==(n=null!==(r=Object(_.a)(this,f)[f])&&void 0!==r?r:this.querySelector(":scope > [slot=media]"))&&void 0!==n?n:this.querySelector(U))&&void 0!==e?e:null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector(U))&&void 0!==t?t:null},set:function(t){Object(_.a)(this,f)[f]=t}},{key:"defaultMuted",get:function(){return this.hasAttribute("muted")},set:function(t){this.toggleAttribute("muted",t)}},{key:"src",get:function(){return this.getAttribute("src")},set:function(t){this.setAttribute("src","".concat(t))}},{key:"preload",get:function(){var t,e;return null!==(t=this.getAttribute("preload"))&&void 0!==t?t:null===(e=this.nativeEl)||void 0===e?void 0:e.preload},set:function(t){this.setAttribute("preload","".concat(t))}},{key:"init",value:function(){if(!this.shadowRoot){this.attachShadow({mode:"open"});var t=function(t){var e,n={},r=O(t);try{for(r.s();!(e=r.n()).done;){var o=e.value;n[o.name]=o.value}}catch(t){r.e(t)}finally{r.f()}return n}(this.attributes);B&&(t.is=B),U&&(t.part=U),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(t)}this.nativeEl.muted=this.hasAttribute("muted");var e,n=O(V);try{for(n.s();!(e=n.n()).done;){var r=e.value;Object(_.a)(this,F)[F](r)}}catch(t){n.e(t)}finally{n.f()}Object(_.a)(this,C)[C]()}},{key:"handleEvent",value:function(t){t.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(t.type,{detail:t.detail}))}},{key:"attributeChangedCallback",value:function(t,e,n){Object(_.a)(this,w)[w](),Object(_.a)(this,N)[N](t,e,n)}},{key:"connectedCallback",value:function(){Object(_.a)(this,w)[w](),Object(_.a)(this,S)[S]||Object(_.a)(this,C)[C]()}},{key:"disconnectedCallback",value:function(){var t,e;(null===(t=Object(_.a)(this,k)[k])||void 0===t||t.disconnect(),Object(_.a)(this,k)[k]=void 0,Object(_.a)(this,S)[S])&&(null===(e=this.shadowRoot)||void 0===e||e.removeEventListener("slotchange",Object(_.a)(this,S)[S]),Object(_.a)(this,S)[S]=void 0);var n,r=O(this.constructor.Events);try{for(r.s();!(n=r.n()).done;){var o,l=n.value;null===(o=this.shadowRoot)||void 0===o||o.removeEventListener(l,this,!0)}}catch(t){r.e(t)}finally{r.f()}
2Object(_.a)(this,E)[E].forEach((function(t){return t.remove()})),Object(_.a)(this,E)[E].clear(),Object(_.a)(this,f)[f]=null}}],[{key:"observedAttributes",get:function(){var t,e;Object(_.a)(n,d)[d]();var r=null!==(t=null==$||null===(e=$.constructor)||void 0===e?void 0:e.observedAttributes)&&void 0!==t?t:[];return[].concat(Object(c.a)(r),L)}}]),n}(t),Object.defineProperty(o,d,{value:function(){var t=this;if(Object(_.a)(this,l)[l])return;Object(_.a)(this,l)[l]=!0;var e=new Set(this.observedAttributes);e.delete("muted");var n,r=O(V);try{var o=function(){var r=n.value;if(r in t.prototype)return"continue";if("function"==typeof $[r])t.prototype[r]=function(){for(var t=this,e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];Object(_.a)(this,w)[w]();var l=function(){var e;if(t.call)return t.call.apply(t,[r].concat(n));var o=null===(e=t.nativeEl)||void 0===e?void 0:e[r];return null==o?void 0:o.apply(t.nativeEl,n)};return l()};else{var o={get:function(){var t,n,o;Object(_.a)(this,w)[w]();var l=r.toLowerCase();if(e.has(l)){var c=this.getAttribute(l);return null!==c&&(""===c||c)}return null!==(t=null===(n=this.get)||void 0===n?void 0:n.call(this,r))&&void 0!==t?t:null===(o=this.nativeEl)||void 0===o?void 0:o[r]}};r!==r.toUpperCase()&&(o.set=function(t){Object(_.a)(this,w)[w]();var n=r.toLowerCase();e.has(n)?!0===t||!1===t||null==t?this.toggleAttribute(n,Boolean(t)):this.setAttribute(n,t):this.set?this.set(r,t):this.nativeEl&&(this.nativeEl[r]=t)}),Object.defineProperty(t.prototype,r,o)}};for(r.s();!(n=r.n()).done;)o()}catch(t){r.e(t)}finally{r.f()}}}),o.getTemplateHTML=U.endsWith("audio")?x:D,o.shadowRootOptions={mode:"open"},o.Events=R,Object.defineProperty(o,l,{writable:!0,value:!1}),o;function G(){Object(_.a)(this,h)[h]||(Object(_.a)(this,h)[h]=!0,this.init())}function H(){var t,e=this;Object(_.a)(this,k)[k]=new MutationObserver(Object(_.a)(this,M)[M].bind(this)),Object(_.a)(this,S)[S]=function(){return Object(_.a)(e,P)[P]()},null===(t=this.shadowRoot)||void 0===t||t.addEventListener("slotchange",Object(_.a)(this,S)[S]),Object(_.a)(this,P)[P]();var n,r=O(this.constructor.Events);try{for(r.s();!(n=r.n()).done;){var o,l=n.value;null===(o=this.shadowRoot)||void 0===o||o.addEventListener(l,this,!0)}}catch(t){r.e(t)}finally{r.f()}}function W(){var t,e=this,n=new Map(Object(_.a)(this,E)[E]),r=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("slot:not([name])");(null==r?void 0:r.assignedElements({flatten:!0}).filter((function(t){return["track","source"].includes(t.localName)}))).forEach((function(t){var r;n.delete(t);var o,l=Object(_.a)(e,E)[E].get(t);l||(l=t.cloneNode(),Object(_.a)(e,E)[E].set(t,l),null===(o=Object(_.a)(e,k)[k])||void 0===o||o.observe(t,{attributes:!0}));null===(r=e.nativeEl)||void 0===r||r.append(l),Object(_.a)(e,j)[j](l)})),n.forEach((function(t,n){t.remove(),Object(_.a)(e,E)[E].delete(n)}))}function K(t){var e,n=O(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if("attributes"===r.type){var o,l=r.target,c=r.attributeName,d=Object(_.a)(this,E)[E].get(l);if(d&&c)d.setAttribute(c,null!==(o=l.getAttribute(c))&&void 0!==o?o:""),Object(_.a)(this,j)[j](d)}}}catch(t){n.e(t)}finally{n.f()}}function Y(t){t&&"track"===t.localName&&t.default&&("chapters"===t.kind||"metadata"===t.kind)&&"disabled"===t.track.mode&&(t.track.mode="hidden")}function z(t){if(Object.prototype.hasOwnProperty.call(this,t)){var e=this[t];delete this[t],this[t]=e}}function Q(t,e,n){var r,l;if(!["id","class"].includes(t)&&(o.observedAttributes.includes(t)||!this.constructor.observedAttributes.includes(t)))if(null===n)null===(l=this.nativeEl)||void 0===l||l.removeAttribute(t);else if((null===(r=this.nativeEl)||void 0===r?void 0:r.getAttribute(t))!==n){var c;null===(c=this.nativeEl)||void 0===c||c.setAttribute(t,n)}}}function P(t){var html="";for(var e in t)if(L.includes(e)){var n=t[e];html+=""===n?" ".concat(e):" ".concat(e,'="').concat(n,'"')}return html}var M=C(null!==(r=globalThis.HTMLElement)&&void 0!==r?r:function(){return Object(v.a)((function t(){Object(m.a)(this,t)}))}(),{tag:"video"}),j=(C(null!==(o=globalThis.HTMLElement)&&void 0!==o?o:function(){return Object(v.a)((function t(){Object(m.a)(this,t)}))}(),{tag:"audio"}),n(70));n(164),n(139);function F(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(S.a)(t);if(e){var o=Object(S.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(k.a)(this,n)}}var N,U=function(t){Object(T.a)(n,t);var e=F(n);function n(t,r){var o;return Object(m.a)(this,n),(o=e.call(this,t)).track=void 0,o.track=r.track,o}return Object(v.a)(n)}(Object(j.a)(Event)),B=new WeakMap;function $(t){var e;return null!==(e=B.get(t))&&void 0!==e?e:function(t,e){var n=B.get(t);n||B.set(t,n={});return Object.assign(n,e)}(t,{})}function V(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(S.a)(t);if(e){var o=Object(S.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(k.a)(this,n)}}function G(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];
2if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return H(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function W(t,track){var e=t.videoTracks;$(track).media=new WeakRef(t),$(track).renditionSet||($(track).renditionSet=new Set);var n=$(e).trackSet;n.add(track);var r=n.size-1;r in Z.prototype||Object.defineProperty(Z.prototype,r,{get:function(){return Object(c.a)($(this).trackSet)[r]}}),queueMicrotask((function(){e.dispatchEvent(new U("addtrack",{track:track}))}))}function K(track){var t,e,n=null===(t=$(track).media)||void 0===t||null===(e=t.deref())||void 0===e?void 0:e.videoTracks;n&&($(n).trackSet.delete(track),queueMicrotask((function(){n.dispatchEvent(new U("removetrack",{track:track}))})))}var Y=Object(A.a)("addTrackCallback"),z=Object(A.a)("removeTrackCallback"),Q=Object(A.a)("changeCallback"),X=Object(A.a)("tracks");N=Symbol.iterator;var Z=function(t){Object(T.a)(n,t);var e=V(n);function n(){var t;return Object(m.a)(this,n),t=e.call(this),Object.defineProperty(Object(y.a)(t),X,{get:J,set:void 0}),Object.defineProperty(Object(y.a)(t),Y,{writable:!0,value:void 0}),Object.defineProperty(Object(y.a)(t),z,{writable:!0,value:void 0}),Object.defineProperty(Object(y.a)(t),Q,{writable:!0,value:void 0}),$(Object(y.a)(t)).trackSet=new Set,t}return Object(v.a)(n,[{key:N,value:function(){return Object(_.a)(this,X)[X].values()}},{key:"length",get:function(){return Object(_.a)(this,X)[X].size}},{key:"getTrackById",value:function(t){var e;return null!==(e=Object(c.a)(Object(_.a)(this,X)[X]).find((function(track){return track.id===t})))&&void 0!==e?e:null}},{key:"selectedIndex",get:function(){return Object(c.a)(Object(_.a)(this,X)[X]).findIndex((function(track){return track.selected}))}},{key:"onaddtrack",get:function(){return Object(_.a)(this,Y)[Y]}},{key:"onaddtrack",set:function(t){Object(_.a)(this,Y)[Y]&&(this.removeEventListener("addtrack",Object(_.a)(this,Y)[Y]),Object(_.a)(this,Y)[Y]=void 0),"function"==typeof t&&(Object(_.a)(this,Y)[Y]=t,this.addEventListener("addtrack",t))}},{key:"onremovetrack",get:function(){return Object(_.a)(this,z)[z]}},{key:"onremovetrack",set:function(t){Object(_.a)(this,z)[z]&&(this.removeEventListener("removetrack",Object(_.a)(this,z)[z]),Object(_.a)(this,z)[z]=void 0),"function"==typeof t&&(Object(_.a)(this,z)[z]=t,this.addEventListener("removetrack",t))}},{key:"onchange",get:function(){return Object(_.a)(this,Q)[Q]}},{key:"onchange",set:function(t){Object(_.a)(this,Q)[Q]&&(this.removeEventListener("change",Object(_.a)(this,Q)[Q]),Object(_.a)(this,Q)[Q]=void 0),"function"==typeof t&&(Object(_.a)(this,Q)[Q]=t,this.addEventListener("change",t))}}]),n}(Object(j.a)(EventTarget));function J(){return $(this).trackSet}n(196),n(197);function tt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(S.a)(t);if(e){var o=Object(S.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(k.a)(this,n)}}var et,nt=function(t){Object(T.a)(n,t);var e=tt(n);function n(t,r){var o;return Object(m.a)(this,n),(o=e.call(this,t)).rendition=void 0,o.rendition=r.rendition,o}return Object(v.a)(n)}(Object(j.a)(Event));function it(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];
2if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return st(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return st(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function at(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(S.a)(t);if(e){var o=Object(S.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(k.a)(this,n)}}function ot(t){var e,n=null===(e=$(t).media)||void 0===e?void 0:e.deref();return n?Object(c.a)(n.videoTracks).filter((function(track){return track.selected})).flatMap((function(track){return Object(c.a)($(track).renditionSet)})):[]}var lt=Object(A.a)("addRenditionCallback"),ct=Object(A.a)("removeRenditionCallback"),ut=Object(A.a)("changeCallback");et=Symbol.iterator;var ht,ft=function(t){Object(T.a)(n,t);var e=at(n);function n(){var t;Object(m.a)(this,n);for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return t=e.call.apply(e,[this].concat(o)),Object.defineProperty(Object(y.a)(t),lt,{writable:!0,value:void 0}),Object.defineProperty(Object(y.a)(t),ct,{writable:!0,value:void 0}),Object.defineProperty(Object(y.a)(t),ut,{writable:!0,value:void 0}),t}return Object(v.a)(n,[{key:et,value:function(){return ot(this).values()}},{key:"length",get:function(){return ot(this).length}},{key:"getRenditionById",value:function(t){var e;return null!==(e=ot(this).find((function(e){return"".concat(e.id)==="".concat(t)})))&&void 0!==e?e:null}},{key:"selectedIndex",get:function(){return ot(this).findIndex((function(t){return t.selected}))}},{key:"selectedIndex",set:function(t){var e,n=it(ot(this).entries());try{for(n.s();!(e=n.n()).done;){var r=Object(d.a)(e.value,2),i=r[0];r[1].selected=i===t}}catch(t){n.e(t)}finally{n.f()}}},{key:"onaddrendition",get:function(){return Object(_.a)(this,lt)[lt]}},{key:"onaddrendition",set:function(t){Object(_.a)(this,lt)[lt]&&(this.removeEventListener("addrendition",Object(_.a)(this,lt)[lt]),Object(_.a)(this,lt)[lt]=void 0),"function"==typeof t&&(Object(_.a)(this,lt)[lt]=t,this.addEventListener("addrendition",t))}},{key:"onremoverendition",get:function(){return Object(_.a)(this,ct)[ct]}},{key:"onremoverendition",set:function(t){Object(_.a)(this,ct)[ct]&&(this.removeEventListener("removerendition",Object(_.a)(this,ct)[ct]),Object(_.a)(this,ct)[ct]=void 0),"function"==typeof t&&(Object(_.a)(this,ct)[ct]=t,this.addEventListener("removerendition",t))}},{key:"onchange",get:function(){return Object(_.a)(this,ut)[ut]}},{key:"onchange",set:function(t){Object(_.a)(this,ut)[ut]&&(this.removeEventListener("change",Object(_.a)(this,ut)[ut]),Object(_.a)(this,ut)[ut]=void 0),"function"==typeof t&&(Object(_.a)(this,ut)[ut]=t,this.addEventListener("change",t))}}]),n}(Object(j.a)(EventTarget)),pt=Object(A.a)("selected"),mt=function(){function t(){Object(m.a)(this,t),this.src=void 0,this.id=void 0,this.width=void 0,this.height=void 0,this.bitrate=void 0,this.frameRate=void 0,this.codec=void 0,Object.defineProperty(this,pt,{writable:!0,value:!1})}return Object(v.a)(t,[{key:"selected",get:function(){return Object(_.a)(this,pt)[pt]},set:function(t){var e,n,r,o;Object(_.a)(this,pt)[pt]!==t&&(Object(_.a)(this,pt)[pt]=t,(o=null===(n=$(e=this).media)||void 0===n||null===(r=n.deref())||void 0===r?void 0:r.videoRenditions)&&!$(o).changeRequested&&($(o).changeRequested=!0,queueMicrotask((function(){delete $(o).changeRequested,$(e).track.selected&&o.dispatchEvent(new Event("change"))}))))}}]),t}
2(),gt=Object(A.a)("selected"),vt=function(){function t(){Object(m.a)(this,t),this.id=void 0,this.kind=void 0,this.label="",this.language="",this.sourceBuffer=void 0,Object.defineProperty(this,gt,{writable:!0,value:!1})}return Object(v.a)(t,[{key:"addRendition",value:function(t,e,n,r,o,l){var c=new mt;return c.src=t,c.width=e,c.height=n,c.frameRate=l,c.bitrate=o,c.codec=r,function(track,t){var e,n,r=null===(e=$(track).media)||void 0===e||null===(n=e.deref())||void 0===n?void 0:n.videoRenditions;$(t).media=$(track).media,$(t).track=track;var o=$(track).renditionSet;o.add(t);var l=o.size-1;l in ft.prototype||Object.defineProperty(ft.prototype,l,{get:function(){return ot(this)[l]}}),queueMicrotask((function(){r&&track.selected&&r.dispatchEvent(new nt("addrendition",{rendition:t}))}))}(this,c),c}},{key:"removeRendition",value:function(t){!function(t){var e,n,r=null===(e=$(t).media)||void 0===e||null===(n=e.deref())||void 0===n?void 0:n.videoRenditions,track=$(t).track;$(track).renditionSet.delete(t),queueMicrotask((function(){var e=$
2(t).track;r&&e.selected&&r.dispatchEvent(new nt("removerendition",{rendition:t}))}))}(t)}},{key:"selected",get:function(){return Object(_.a)(this,gt)[gt]},set:function(t){Object(_.a)(this,gt)[gt]!==t&&(Object(_.a)(this,gt)[gt]=t,!0===t&&function(t){var e,n,r,o,l=null!==(e=null===(n=$(t).media)||void 0===n||null===(r=n.deref())||void 0===r?void 0:r.videoTracks)&&void 0!==e?e:[],c=!1,d=G(l);try{for(d.s();!(o=d.n()).done;){var track=o.value;track!==t&&(track.selected=!1,c=!0)}}catch(t){d.e(t)}finally{d.f()}if(c){if($(l).changeRequested)return;$(l).changeRequested=!0,queueMicrotask((function(){delete $(l).changeRequested,l.dispatchEvent(new Event("change"))}))}}(this))}}]),t}();function yt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return bt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Et(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(S.a)(t);if(e){var o=Object(S.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(k.a)(this,n)}}function Tt(t){var e,n=null===(e=$(t).media)||void 0===e?void 0:e.deref();return n?Object(c.a)(n.audioTracks).filter((function(track){return track.enabled})).flatMap((function(track){return Object(c.a)($(track).renditionSet)})):[]}var kt=Object(A.a)("addRenditionCallback"),St=Object(A.a)("removeRenditionCallback"),_t=Object(A.a)("changeCallback");ht=Symbol.iterator;var At,Ot=function(t){Object(T.a)(n,t);var e=Et(n);function n(){var t;Object(m.a)(this,n);for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return t=e.call.apply(e,[this].concat(o)),Object.defineProperty(Object(y.a)(t),kt,{writable:!0,value:void 0}),Object.defineProperty(Object(y.a)(t),St,{writable:!0,value:void 0}),Object.defineProperty(Object(y.a)(t),_t,{writable:!0,value:void 0}),t}return Object(v.a)(n,[{key:ht,value:function(){return Tt(this).values()}},{key:"length",get:function(){return Tt(this).length}},{key:"getRenditionById",value:function(t){var e;return null!==(e=Tt(this).find((function(e){return"".concat(e.id)==="".concat(t)})))&&void 0!==e?e:null}},{key:"selectedIndex",get:function(){return Tt(this).findIndex((function(t){return t.selected}))}},{key:"selectedIndex",set:function(t){var e,n=yt(Tt(this).entries());try{for(n.s();!(e=n.n()).done;){var r=Object(d.a)(e.value,2),i=r[0];r[1].selected=i===t}}catch(t){n.e(t)}finally{n.f()}}},{key:"onaddrendition",get:function(){return Object(_.a)(this,kt)[kt]}},{key:"onaddrendition",set:function(t){Object(_.a)(this,kt)[kt]&&(this.removeEventListener("addrendition",Object(_.a)(this,kt)[kt]),Object(_.a)(this,kt)[kt]=void 0),"function"==typeof t&&(Object(_.a)(this,kt)[kt]=t,this.addEventListener("addrendition",t))}},{key:"onremoverendition",get:function(){return Object(_.a)(this,St)[St]}},{key:"onremoverendition",set:function(t){Object(_.a)(this,St)[St]&&(this.removeEventListener("removerendition",Object(_.a)(this,St)[St]),Object(_.a)(this,St)[St]=void 0),"function"==typeof t&&(Object(_.a)(this,St)[St]=t,this.addEventListener("removerendition",t))}},{key:"onchange",get:function(){return Object(_.a)(this,_t)[_t]}},{key:"onchange",set:function(t){Object(_.a)(this,_t)[_t]&&(this.removeEventListener("change",Object(_.a)(this,_t)[_t]),Object(_.a)(this,_t)[_t]=void 0),"function"==typeof t&&(Object(_.a)(this,_t)[_t]=t,this.addEventListener("change",t))}}]),n}(Object(j.a)(EventTarget)),wt=Object(A.a)("selected"),It=function(){function t(){Object(m.a)(this,t),this.src=void 0,this.id=void 0,this.bitrate=void 0,this.codec=void 0,Object.defineProperty(this,wt,{writable:!0,value:!1})}return Object(v.a)(t,[{key:"selected",get:function(){return Object(_.a)(this,wt)[wt]}
2,set:function(t){var e,n,r,o;Object(_.a)(this,wt)[wt]!==t&&(Object(_.a)(this,wt)[wt]=t,(o=null===(n=$(e=this).media)||void 0===n||null===(r=n.deref())||void 0===r?void 0:r.audioRenditions)&&!$(o).changeRequested&&($(o).changeRequested=!0,queueMicrotask((function(){delete $(o).changeRequested,$(e).track.enabled&&o.dispatchEvent(new Event("change"))}))))}}]),t}();function Rt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(S.a)(t);if(e){var o=Object(S.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(k.a)(this,n)}}function Lt(t,track){var e=t.audioTracks;$(track).media=new WeakRef(t),$(track).renditionSet||($(track).renditionSet=new Set);var n=$(e).trackSet;n.add(track);var r=n.size-1;r in jt.prototype||Object.defineProperty(jt.prototype,r,{get:function(){return Object(c.a)($(this).trackSet)[r]}}),queueMicrotask((function(){e.dispatchEvent(new U("addtrack",{track:track}))}))}function xt(track){var t,e,n=null===(t=$(track).media)||void 0===t||null===(e=t.deref())||void 0===e?void 0:e.audioTracks;n&&($(n).trackSet.delete(track),queueMicrotask((function(){n.dispatchEvent(new U("removetrack",{track:track}))})))}var Dt=Object(A.a)("addTrackCallback"),Ct=Object(A.a)("removeTrackCallback"),Pt=Object(A.a)("changeCallback"),Mt=Object(A.a)("tracks");At=Symbol.iterator;var jt=function(t){Object(T.a)(n,t);var e=Rt(n);function n(){var t;return Object(m.a)(this,n),t=e.call(this),Object.defineProperty(Object(y.a)(t),Mt,{get:Ft,set:void 0}),Object.defineProperty(Object(y.a)(t),Dt,{writable:!0,value:void 0}),Object.defineProperty(Object(y.a)(t),Ct,{writable:!0,value:void 0}),Object.defineProperty(Object(y.a)(t),Pt,{writable:!0,value:void 0}),$(Object(y.a)(t)).trackSet=new Set,t}return Object(v.a)(n,[{key:At,value:function(){return Object(_.a)(this,Mt)[Mt].values()}},{key:"length",get:function(){return Object(_.a)(this,Mt)[Mt].size}},{key:"getTrackById",value:function(t){var e;return null!==(e=Object(c.a)(Object(_.a)(this,Mt)[Mt]).find((function(track){return track.id===t})))&&void 0!==e?e:null}},{key:"onaddtrack",get:function(){return Object(_.a)(this,Dt)[Dt]}},{key:"onaddtrack",set:function(t){Object(_.a)(this,Dt)[Dt]&&(this.removeEventListener("addtrack",Object(_.a)(this,Dt)[Dt]),Object(_.a)(this,Dt)[Dt]=void 0),"function"==typeof t&&(Object(_.a)(this,Dt)[Dt]=t,this.addEventListener("addtrack",t))}},{key:"onremovetrack",get:function(){return Object(_.a)(this,Ct)[Ct]}},{key:"onremovetrack",set:function(t){Object(_.a)(this,Ct)[Ct]&&(this.removeEventListener("removetrack",Object(_.a)(this,Ct)[Ct]),Object(_.a)(this,Ct)[Ct]=void 0),"function"==typeof t&&(Object(_.a)(this,Ct)[Ct]=t,this.addEventListener("removetrack",t))}},{key:"onchange",get:function(){return Object(_.a)(this,Pt)[Pt]}},{key:"onchange",set:function(t){Object(_.a)(this,Pt)[Pt]&&(this.removeEventListener("change",Object(_.a)(this,Pt)[Pt]),Object(_.a)(this,Pt)[Pt]=void 0),"function"==typeof t&&(Object(_.a)(this,Pt)[Pt]=t,this.addEventListener("change",t))}}]),n}(Object(j.a)(EventTarget));function Ft(){return $(this).trackSet}var Nt=Object(A.a)("enabled"),Ut=function(){function t(){Object(m.a)(this,t),this.id=void 0,this.kind=void 0,this.label="",this.language="",this.sourceBuffer=void 0,Object.defineProperty(this,Nt,{writable:!0,value:!1})}return Object(v.a)(t,[{key:"addRendition",value:function(t,e,n){var r=new It;return r.src=t,r.codec=e,r.bitrate=n,function(track,t){var e,n,r=null===(e=$(track).media)||void 0===e||null===(n=e.deref())||void 0===n?void 0:n.audioRenditions;$(t).media=$(track).media,$(t).track=track;var o=$(track).renditionSet;o.add(t);var l=o.size-1;l in Ot.prototype||Object.defineProperty(Ot.prototype,l,{get:function(){return Tt(this)[l]}}),queueMicrotask((function(){r&&track.enabled&&r.dispatchEvent(new nt("addrendition",{rendition:t}))}))}(this,r),r}},{key:"removeRendition",value:function(t){!function(t){var e,n,r=null===(e=$(t).media)||void 0===e||null===(n=e.deref())||void 0===n?void 0:n.audioRenditions,track=$(t).track;$(track).renditionSet.delete(t),queueMicrotask((function(){var e=$
2(t).track;r&&e.enabled&&r.dispatchEvent(new nt("removerendition",{rendition:t}))}))}(t)}},{key:"enabled",get:function(){return Object(_.a)(this,Nt)[Nt]},set:function(t){var e,n,r;Object(_.a)(this,Nt)[Nt]!==t&&(Object(_.a)(this,Nt)[Nt]=t,(r=null===(e=$(this).media)||void 0===e||null===(n=e.deref())||void 0===n?void 0:n.audioTracks)&&!$(r).changeRequested&&($(r).changeRequested=!0,queueMicrotask((function(){delete $(r).changeRequested,r.dispatchEvent(new Event("change"))}))))}}]),t}();function Bt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return $t(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $t(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function $t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var Vt=Ht(globalThis.HTMLMediaElement,"video"),Gt=Ht(globalThis.HTMLMediaElement,"audio");function Ht(t,e){var n;if(null!=t&&t.prototype)return null===(n=Object.getOwnPropertyDescriptor(t.prototype,"".concat(e,"Tracks")))||void 0===n?void 0:n.get}var Wt=n(63),Kt=["src"];function qt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Yt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f: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.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function Yt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function zt(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function Qt(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?zt(Object(source),!0).forEach((function(e){Object(h.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):zt(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}function Xt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Object(S.a)(t);if(e){var o=Object(S.a)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Object(k.a)(this,n)}}var Zt=function(t){var e,n,r,o,h,k;return n=Object(A.a)("airplaySourceEl"),r=Object(A.a)("config"),o=Object(A.a)("destroy"),h=Object(A.a)("toggleHlsLoad"),k=Object(A.a)("upgradeProperty"),e=function(t){Object(T.a)(A,t);var e,l=Xt(A);function A(){var t;
2return Object(m.a)(this,A),t=l.call(this),Object.defineProperty(Object(y.a)(t),k,{value:w}),Object.defineProperty(Object(y.a)(t),o,{value:O}),Object.defineProperty(Object(y.a)(t),n,{writable:!0,value:null}),Object.defineProperty(Object(y.a)(t),r,{writable:!0,value:null}),Object.defineProperty(Object(y.a)(t),h,{writable:!0,value:function(){var e,n,r;(null==(e=t.nativeEl)?void 0:e.webkitCurrentPlaybackTargetIsWireless)?null==(n=t.api)||n.stopLoad():null==(r=t.api)||r.startLoad()}}),Object(_.a)(Object(y.a)(t),k)[k]("config"),t}return Object(v.a)(A,[{key:"config",get:function(){return Object(_.a)(this,r)[r]},set:function(t){Object(_.a)(this,r)[r]=t}},{key:"attributeChangedCallback",value:function(t,e,n){"src"!==t&&Object(E.a)(Object(S.a)(A.prototype),"attributeChangedCallback",this).call(this,t,e,n),"src"===t&&e!=n&&this.load()}},{key:"load",value:(e=Object(f.a)(regeneratorRuntime.mark((function t(){var e,l,f,m,v,y,E,T,k,S,A,O=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(f=!this.api,Object(_.a)(this,o)[o](),this.src){t.next=4;break}return t.abrupt("return");case 4:if(f&&!Object(_.a)(this,r)[r]&&(Object(_.a)(this,r)[r]=JSON.parse((null==(e=this.shadowRoot.getElementById("config"))?void 0:e.textContent)||"{}")),!Wt.a.isSupported()){t.next=47;break}return t.next=8,Promise.resolve();case 8:this.api=new Wt.a(Qt({liveDurationInfinity:!0,autoStartLoad:!1},this.config)),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),t.t0=this.nativeEl.preload,t.next="none"===t.t0?14:"metadata"===t.t0?18:27;break;case 14:return m=function(){return O.api.startLoad()},this.nativeEl.addEventListener("play",m,{once:!0}),this.api.on(Wt.a.Events.DESTROYING,(function(){O.nativeEl.removeEventListener("play",m)})),t.abrupt("break",28);case 18:return v=this.api.config.maxBufferLength,y=this.api.config.maxBufferSize,this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1,E=function(){O.api.config.maxBufferLength=v,O.api.config.maxBufferSize=y},this.nativeEl.addEventListener("play",E,{once:!0}),this.api.on(Wt.a.Events.DESTROYING,(function(){O.nativeEl.removeEventListener("play",E)})),this.api.startLoad(),t.abrupt("break",28);case 27:this.api.startLoad();case 28:return this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",Object(_.a)(this,h)[h]),Object(_.a)(this,n)[n]=document.createElement("source"),Object(_.a)(this,n)[n].setAttribute("type","application/x-mpegURL"),Object(_.a)(this,n)[n].setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(Object(_.a)(this,n)[n]),T=new WeakMap,this.api.on(Wt.a.Events.MANIFEST_PARSED,(function(t,data){O.nativeEl.autoplay&&O.nativeEl.paused&&O.nativeEl.play().catch((function(t){console.warn("Autoplay failed:",t)})),A();var e=O.videoTracks.getTrackById("main");e||((e=O.addVideoTrack("main")).id="main",e.selected=!0);var n,r=qt(data.levels.entries());try{for(r.s();!(n=r.n()).done;){var o=Object(d.a)(n.value,2),l=o[0],c=o[1],h=e.addRendition(c.url[0],c.width,c.height,c.videoCodec,c.bitrate);T.set(c,"".concat(l)),h.id="".concat(l)}}catch(t){r.e(t)}finally{r.f()}var f,m=qt(data.audioTracks.entries());try{for(m.s();!(f=m.n()).done;){var v=Object(d.a)(f.value,2),y=v[0],a=v[1],E=a.default?"main":"alternative",k=O.addAudioTrack(E,a.name,a.lang);k.id="".concat(y),a.default&&(k.enabled=!0)}}catch(t){m.e(t)}finally{m.f()}})),this.audioTracks.addEventListener("change",(function(){var t,e=+(null==(t=Object(c.a)(O.audioTracks).find((function(t){return t.enabled})))?void 0:t.id),n=O.api.audioTracks.map((function(t){return t.id}));e!=O.api.audioTrack&&n.includes(e)&&(O.api.audioTrack=e)})),this.api.on(Wt.a.Events.LEVELS_UPDATED,(function(t,data){var e,n=O.videoTracks[null!==(e=O.videoTracks.selectedIndex)&&void 0!==e?e:0];if(n){var r,o=data.levels.map((function(t){return T.get(t)})),l=qt(O.videoRenditions);try{for(l.s();!(r=l.n()).done;){var c=r.value;c.id&&!o.includes(c.id)&&n.removeRendition(c)}}catch(t){l.e(t)}finally{l.f()}}})),k=null,this.api.on(Wt.a.Events.ERROR,(function(t,data){data.type===Wt.a.ErrorTypes.NETWORK_E
2RROR&&data.details===Wt.a.ErrorDetails.FRAG_LOAD_ERROR&&(k=data.frag.level)})),this.api.on(Wt.a.Events.LEVEL_SWITCHED,(function(t,data){var e=data.level;null!==k&&e<k&&(console.warn("â ï¸ hls.js downgraded quality from level ".concat(k," to ").concat(e," due to fragment load failure.")),O.videoRenditions.selectedIndex=e,k=null)})),S=function(t){var e=t.target.selectedIndex;e!=O.api.nextLevel&&(O.api.nextLevel=e)},null==(l=this.videoRenditions)||l.addEventListener("change",S),A=function(){var t,e=qt(O.videoTracks);try{for(e.s();!(t=e.n()).done;){var n=t.value;O.removeVideoTrack(n)}}catch(t){e.e(t)}finally{e.f()}var r,o=qt(O.audioTracks);try{for(o.s();!(r=o.n()).done;){var l=r.value;O.removeAudioTrack(l)}}catch(t){o.e(t)}finally{o.f()}},this.api.once(Wt.a.Events.DESTROYING,A),t.abrupt("return");case 47:return t.next=49,Promise.resolve();case 49:this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src);case 50:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),A}(t),e.shadowRootOptions=Qt({},t.shadowRootOptions),e.getTemplateHTML=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(e.src,Object(l.a)(e,Kt));return'\n <script type="application/json" id="config">\n '.concat(JSON.stringify(n.config||{}),"\n <\/script>\n ").concat(t.getTemplateHTML(r),"\n ")},e;function O(){var t,e;null==(t=Object(_.a)(this,n)[n])||t.remove(),null==(e=this.nativeEl)||e.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",Object(_.a)(this,h)[h]),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null)}function w(t){if(Object.prototype.hasOwnProperty.call(this,t)){var e=this[t];delete this[t],this[t]=e}}}(function(t){if(null==t||!t.prototype)return t;var e=Ht(t,"video");e&&!"".concat(e).includes("[native code]")||Object.defineProperty(t.prototype,"videoTracks",{get:function(){return function(t){var e=$(t).videoTracks;if(!e&&(e=new Z,$(t).videoTracks=e,Vt)){var n,r,o=Vt.call(null!==(n=t.nativeEl)&&void 0!==n?n:t),l=Bt(o);try{for(l.s();!(r=l.n()).done;){var d=r.value;W(t,d)}}catch(t){l.e(t)}finally{l.f()}var h=function(){e.dispatchEvent(new Event("change"))},f=function(n){if(Object(c.a)(e).some((function(t){return t instanceof vt}))){var r,l=Bt(o);try{for(l.s();!(r=l.n()).done;){K(r.value)}}catch(t){l.e(t)}finally{l.f()}}else W(t,n.track)},m=function(t){K(t.track)};o.addEventListener("change",h),o.addEventListener("addtrack",f),o.addEventListener("removetrack",m)}return e}(this)}});var n=Ht(t,"audio");n&&!"".concat(n).includes("[native code]")||Object.defineProperty(t.prototype,"audioTracks",{get:function(){return function(t){var e=$(t).audioTracks;
2if(!e&&(e=new jt,$(t).audioTracks=e,Gt)){var n,r,o=Gt.call(null!==(n=t.nativeEl)&&void 0!==n?n:t),l=Bt(o);try{for(l.s();!(r=l.n()).done;){var d=r.value;Lt(t,d)}}catch(t){l.e(t)}finally{l.f()}var h=function(){e.dispatchEvent(new Event("change"))},f=function(n){if(Object(c.a)(e).some((function(t){return t instanceof Ut}))){var r,l=Bt(o);try{for(l.s();!(r=l.n()).done;){xt(r.value)}}catch(t){l.e(t)}finally{l.f()}}else Lt(t,n.track)},m=function(t){xt(t.track)};o.addEventListener("change",h),o.addEventListener("addtrack",f),o.addEventListener("removetrack",m)}return e}(this)}}),"addVideoTrack"in t.prototype||(t.prototype.addVideoTrack=function(t){var label=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",track=new vt;return track.kind=t,track.label=label,track.language=e,W(this,track),track}),"removeVideoTrack"in t.prototype||(t.prototype.removeVideoTrack=K),"addAudioTrack"in t.prototype||(t.prototype.addAudioTrack=function(t){var label=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",track=new Ut;return track.kind=t,track.label=label,track.language=e,Lt(this,track),track}),"removeAudioTrack"in t.prototype||(t.prototype.removeAudioTrack=xt),"videoRenditions"in t.prototype||Object.defineProperty(t.prototype,"videoRenditions",{get:function(){return r(this)}});var r=function(t){var e=$(t).videoRenditions;return e||($(e=new ft).media=new WeakRef(t),$(t).videoRenditions=e),e};"audioRenditions"in t.prototype||Object.defineProperty(t.prototype,"audioRenditions",{get:function(){return o(this)}});var o=function(t){var e=$(t).audioRenditions;return e||($(e=new Ot).media=new WeakRef(t),$(t).audioRenditions=e),e};return t}(M));globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",Zt)},63:function(t,e,n){"use strict";n.d(e,"a",(function(){return Ol}));const r=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},o=Number.isSafeInteger||function(t){return"number"==typeof t&&Math.abs(t)<=l},l=Number.MAX_SAFE_INTEGER||9007199254740991;let c=function(t){return t.NETWORK_ERROR="networkError",t.MEDIA_ERROR="mediaError",t.KEY_SYSTEM_ERROR="keySystemError",t.MUX_ERROR="muxError",t.OTHER_ERROR="otherError",t}({}),d=function(t){return t.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",t.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",t.KEY_SYSTEM_NO_SESSION="keySystemNoSession",t.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",t.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",t.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",t.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",t.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",t.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",t.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",t.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",t.MANIFEST_LOAD_ERROR="manifestLoadError",t.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",t.MANIFEST_PARSING_ERROR="manifestParsingError",t.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",t.LEVEL_EMPTY_ERROR="levelEmptyError",t.LEVEL_LOAD_ERROR="levelLoadError",t.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",t.LEVEL_PARSING_ERROR="levelParsingError",t.LEVEL_SWITCH_ERROR="levelSwitchError",t.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",t.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",t.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",t.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",t.FRAG_LOAD_ERROR="fragLoadError",t.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",t.FRAG_DECRYPT_ERROR="fragDecryptError",t.FRAG_PARSING_ERROR="fragParsingError",t.FRAG_GAP="fragGap",t.REMUX_ALLOC_ERROR="remuxAllocError",t.KEY_LOAD_ERROR="keyLoadError",t.KEY_LOAD_TIMEOUT="keyLoadTimeOut",t.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",t.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",t.BUFFER_APPEND_ERROR="bufferAppendError",t.BUFFER_APPENDING_ERROR="bufferAppendingError",t.BUFFER_STALLED_ERROR="bufferStalledError",t.BUFFER_FULL_ERROR="bufferFullError",t.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",t.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",t.ASSET_LIST_LOAD_ERROR="assetListLoadError",t.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",t.ASSET_LIST_PARSING_ERROR="assetListParsingError",t.INTERSTITIAL_ASSET_ITEM_ER
vendor: 4,189 bytes, line 2
2ROR="interstitialAssetItemError",t.INTERNAL_EXCEPTION="internalException",t.INTERNAL_ABORTED="aborted",t.ATTACH_MEDIA_ERROR="attachMediaError",t.UNKNOWN="unknown",t}({}),h=function(t){return t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.MEDIA_ENDED="hlsMediaEnded",t.STALL_RESOLVED="hlsStallResolved",t.BUFFER_RESET="hlsBufferReset",t.BUFFER_CODECS="hlsBufferCodecs",t.BUFFER_CREATED="hlsBufferCreated",t.BUFFER_APPENDING="hlsBufferAppending",t.BUFFER_APPENDED="hlsBufferAppended",t.BUFFER_EOS="hlsBufferEos",t.BUFFERED_TO_END="hlsBufferedToEnd",t.BUFFER_FLUSHING="hlsBufferFlushing",t.BUFFER_FLUSHED="hlsBufferFlushed",t.MANIFEST_LOADING="hlsManifestLoading",t.MANIFEST_LOADED="hlsManifestLoaded",t.MANIFEST_PARSED="hlsManifestParsed",t.LEVEL_SWITCHING="hlsLevelSwitching",t.LEVEL_SWITCHED="hlsLevelSwitched",t.LEVEL_LOADING="hlsLevelLoading",t.LEVEL_LOADED="hlsLevelLoaded",t.LEVEL_UPDATED="hlsLevelUpdated",t.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",t.LEVELS_UPDATED="hlsLevelsUpdated",t.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",t.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",t.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",t.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",t.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",t.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",t.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",t.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",t.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",t.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",t.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",t.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",t.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",t.CUES_PARSED="hlsCuesParsed",t.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",t.INIT_PTS_FOUND="hlsInitPtsFound",t.FRAG_LOADING="hlsFragLoading",t.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",t.FRAG_LOADED="hlsFragLoaded",t.FRAG_DECRYPTED="hlsFragDecrypted",t.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",t.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",t.FRAG_PARSING_METADATA="hlsFragParsingMetadata",t.FRAG_PARSED="hlsFragParsed",t.FRAG_BUFFERED="hlsFragBuffered",t.FRAG_CHANGED="hlsFragChanged",t.FPS_DROP="hlsFpsDrop",t.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",t.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",t.ERROR="hlsError",t.DESTROYING="hlsDestroying",t.KEY_LOADING="hlsKeyLoading",t.KEY_LOADED="hlsKeyLoaded",t.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",t.BACK_BUFFER_REACHED="hlsBackBufferReached",t.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",t.ASSET_LIST_LOADING="hlsAssetListLoading",t.ASSET_LIST_LOADED="hlsAssetListLoaded",t.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",t.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",t.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",t.INTERSTITIAL_STARTED="hlsInterstitialStarted",t.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",t.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",t.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",t.INTERSTITIAL_ENDED="hlsInterstitialEnded",t.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",t.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",t.EVENT_CUE_ENTER="hlsEventCueEnter",t}({});var f="manifest",m="level",v="audioTrack",y="subtitleTrack",E="main",T="audio",k="subtitle";class S{constructor(t,e=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=n}sample(t,e){const n=Math.pow(this.alpha_,t);this.estimate_=e*(1-n)+n*this.estimate_,this.totalWeight_+=t}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_}}class _{constructor(t,e,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_
vendor: 4,505 bytes, line 2
2=new S(t),this.fast_=new S(e),this.defaultTTFB_=r,this.ttfb_=new S(t)}update(t,e){const{slow_:n,fast_:r,ttfb_:o}=this;n.halfLife!==t&&(this.slow_=new S(t,n.getEstimate(),n.getTotalWeight())),r.halfLife!==e&&(this.fast_=new S(e,r.getEstimate(),r.getTotalWeight())),o.halfLife!==t&&(this.ttfb_=new S(t,o.getEstimate(),o.getTotalWeight()))}sample(t,e){const n=(t=Math.max(t,this.minDelayMs_))/1e3,r=8*e/n;this.fast_.sample(n,r),this.slow_.sample(n,r)}sampleTTFB(t){const e=t/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(e,2)/2);this.ttfb_.sample(n,Math.max(t,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function A(t,e,n){return(e=function(t){var i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof i?i:i+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O(){return O=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},O.apply(null,arguments)}function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function I(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){A(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}class R{constructor(label,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const e=`[${label}]:`;this.trace=L,this.debug=t.debug.bind(null,e),this.log=t.log.bind(null,e),this.warn=t.warn.bind(null,e),this.info=t.info.bind(null,e),this.error=t.error.bind(null,e)}}const L=function(){},x={trace:L,debug:L,log:L,warn:L,info:L,error:L};function D(){return O({},x)}function C(t,e,n){return e[t]?e[t].bind(e):function(t,e){const n=self.console[t];return n?n.bind(self.console,`${e?"["+e+"] ":""}[${t}] >`):L}(t,n)}const P=D();const M=P;function j(t=!0){if("undefined"==typeof self)return;return(t||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function F(t,e){const n=Object.keys(t),r=Object.keys(e),o=n.length,l=r.length;return!o||!l||o===l&&!n.some((t=>-1===r.indexOf(t)))}function N(t,e=!1){if("undefined"!=typeof TextDecoder){const n=new TextDecoder("utf-8").decode(t);if(e){const t=n.indexOf("\0");return-1!==t?n.substring(0,t):n}return n.replace(/\0/g,"")}const n=t.length;let r,o,l,c="",i=0;for(;i<n;){if(r=t[i++],0===r&&e)return c;if(0!==r&&3!==r)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(r);break;case 12:case 13:o=t[i++],c+=String.fromCharCode((31&r)<<6|63&o);break;case 14:o=t[i++],l=t[i++],c+=String.fromCharCode((15&r)<<12|(63&o)<<6|(63&l)<<0)}}return c}function U(t){let e="";for(let i=0;i<t.length;i++){let n=t[i].toString(16);n.length<2&&(n="0"+n),e+=n}return e}function B(t){return Uint8Array.from(t.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function $(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var V,G={exports:{}};var H=(V||(V=1,function(t,e){var n,r,o,l,c;n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,o=/(?:\/|^)\.(?=\/)/g,l=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,c={buildAbsoluteURL:function(t,e,n){if(n=n||{},t=t.trim(),!(e=e.trim())){if(!n.alwaysNormalize)return t;var o=c.parseURL(t);if(!o)throw new Error("Error trying to parse base URL.");return o.path=c.normalizePath(o.path),c.buildURLFromParts(o)}var l=c.parseURL(e);if(!l)throw new Error("Error trying to parse relative URL.");
vendor: 4,283 bytes, line 2
2if(l.scheme)return n.alwaysNormalize?(l.path=c.normalizePath(l.path),c.buildURLFromParts(l)):e;var d=c.parseURL(t);if(!d)throw new Error("Error trying to parse base URL.");if(!d.netLoc&&d.path&&"/"!==d.path[0]){var h=r.exec(d.path);d.netLoc=h[1],d.path=h[2]}d.netLoc&&!d.path&&(d.path="/");var f={scheme:d.scheme,netLoc:l.netLoc,path:null,params:l.params,query:l.query,fragment:l.fragment};if(!l.netLoc&&(f.netLoc=d.netLoc,"/"!==l.path[0]))if(l.path){var m=d.path,v=m.substring(0,m.lastIndexOf("/")+1)+l.path;f.path=c.normalizePath(v)}else f.path=d.path,l.params||(f.params=d.params,l.query||(f.query=d.query));return null===f.path&&(f.path=n.alwaysNormalize?c.normalizePath(l.path):l.path),c.buildURLFromParts(f)},parseURL:function(t){var e=n.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(path){for(path=path.split("").reverse().join("").replace(o,"");path.length!==(path=path.replace(l,"")).length;);return path.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=c}(G)),G.exports);class W{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var K="audio",Y="video",z="audiovideo";class Q{constructor(base){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,"string"==typeof base&&(base={url:base}),this.base=base,function(object,t){const e=tt(object,t);e&&(e.enumerable=!0,Object.defineProperty(object,t,e))}(this,"stats")}setByteRange(t,e){const n=t.split("@",2);let r;r=1===n.length?(null==e?void 0:e.byteRangeEndOffset)||0:parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}get baseurl(){return this.base.url}get byteRange(){return null===this._byteRange?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return null===this._streams&&(this._streams={[K]:null,[Y]:null,[z]:null}),this._streams}set elementaryStreams(t){this._streams=t}get hasStats(){return null!==this._stats}get hasStreams(){return null!==this._streams}get stats(){return null===this._stats&&(this._stats=new W),this._stats}set stats(t){this._stats=t}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=H.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(t){this._url=t}clearElementaryStreamInfo(){const{elementaryStreams:t}=this;t[K]=null,t[Y]=null,t[z]=null}}function X(t){return"initSegment"!==t.sn}class Z extends Q{constructor(t,base){super(base),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=t}get byteLength(){if(this.hasStats){const t=this.stats.total;if(t)return t}if(this.byteRange.length){const t=this.byteRange[0],e=this.byteRange[1];if(r(t)&&r(e))return e-t}return null}get bitrate(){return this.byteLength?8*this.byteLength/this.duration:this._bitrate?this._bitrate:null}set bitrate(t){this._bitrate=t}get decryptdata(){var t;const{levelkeys:e}=this;if(!e||e.NONE)return null;if(e.identity)this._decryptdata||(this._decryptdata=e.identity.getDecryptData(this.sn));else if(null==(t=this._decryptdata)||!t.keyId){const t=Object.keys(e);if(1===t.length){const n=this._decryptdata=e[t[0]]||null;n&&(this._decryptdata=n.getDecryptData(this.sn,e))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;const t=r(this.duration)?this.duration:0;return this.programDateTime+1e3*t}get encrypted(){var t;if(null!=(t=this._decryptdata)&&t.encrypted)return!0;
vendor: 6,107 bytes, line 2
2if(this.levelkeys){var e;const t=Object.keys(this.levelkeys),n=t.length;if(n>1||1===n&&null!=(e=this.levelkeys[t[0]])&&e.encrypted)return!0}return!1}get programDateTime(){return null===this._programDateTime&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(t){r(t)?this._programDateTime=t:this._programDateTime=this.rawProgramDateTime=null}get ref(){return X(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(t){this.setStart(this.start+t)}setStart(t){this.start=t,this._ref&&(this._ref.start=t)}setDuration(t){this.duration=t,this._ref&&(this._ref.duration=t)}setKeyFormat(t){const e=this.levelkeys;if(e){var n;const r=e[t];!r||null!=(n=this._decryptdata)&&n.keyId||(this._decryptdata=r.getDecryptData(this.sn,e))}}abortRequests(){var t,e;null==(t=this.loader)||t.abort(),null==(e=this.keyLoader)||e.abort()}setElementaryStreamInfo(t,e,n,r,o,l=!1){const{elementaryStreams:c}=this,d=c[t];d?(d.startPTS=Math.min(d.startPTS,e),d.endPTS=Math.max(d.endPTS,n),d.startDTS=Math.min(d.startDTS,r),d.endDTS=Math.max(d.endDTS,o)):c[t]={startPTS:e,endPTS:n,startDTS:r,endDTS:o,partial:l}}}class J extends Q{constructor(t,e,base,n,r){super(base),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=t.decimalFloatingPoint("DURATION"),this.gap=t.bool("GAP"),this.independent=t.bool("INDEPENDENT"),this.relurl=t.enumeratedString("URI"),this.fragment=e,this.index=n;const o=t.enumeratedString("BYTERANGE");o&&this.setByteRange(o,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:t}=this;return!!(t.audio||t.video||t.audiovideo)}}function tt(object,t){const e=Object.getPrototypeOf(object);if(e){const n=Object.getOwnPropertyDescriptor(e,t);return n||tt(e,t)}}const et=Math.pow(2,32)-1,nt=[].push,it={video:1,audio:2,id3:3,text:4};function st(data){return String.fromCharCode.apply(null,data)}function at(t,e){const n=t[e]<<8|t[e+1];return n<0?65536+n:n}function ot(t,e){const n=ct(t,e);return n<0?4294967296+n:n}function lt(t,e){let n=ot(t,e);return n*=Math.pow(2,32),n+=ot(t,e+4),n}function ct(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function ut(data,path){const t=[];if(!path.length)return t;const e=data.byteLength;for(let i=0;i<e;){const n=ot(data,i),r=n>1?i+n:e;if(st(data.subarray(i+4,i+8))===path[0])if(1===path.length)t.push(data.subarray(i+8,r));else{const e=ut(data.subarray(i+8,r),path.slice(1));e.length&&nt.apply(t,e)}i=r}return t}function ht(t){const e=[],n=t[0];let r=8;const o=ot(t,r);r+=4;let l=0,c=0;0===n?(l=ot(t,r),c=ot(t,r+4),r+=8):(l=lt(t,r),c=lt(t,r+8),r+=16),r+=2;let d=t.length+c;const h=at(t,r);r+=2;for(let i=0;i<h;i++){let n=r;const l=ot(t,n);n+=4;const c=2147483647&l;if(1===(2147483648&l)>>>31)return M.warn("SIDX has hierarchical references (not supported)"),null;const h=ot(t,n);n+=4,e.push({referenceSize:c,subsegmentDuration:h,info:{duration:h/o,start:d,end:d+c-1}}),d+=c,n+=4,r=n}return{earliestPresentationTime:l,timescale:o,version:n,referencesCount:h,references:e}}function ft(t){const e=[],n=ut(t,["moov","trak"]);for(let i=0;i<n.length;i++){const t=n[i],r=ut(t,["tkhd"])[0];if(r){let n=r[0];const o=ot(r,0===n?12:20),l=ut(t,["mdia","mdhd"])[0];if(l){n=l[0];const r=ot(l,0===n?12:20),c=ut(t,["mdia","hdlr"])[0];if(c){const n=st(c.subarray(8,12)),l={soun:K,vide:Y}[n],d=pt(ut(t,["mdia","minf","stbl","stsd"])[0]);l?(e[o]={timescale:r,type:l,stsd:d},e[l]=I({timescale:r,id:o},d)):e[o]={timescale:r,type:n,stsd:d}}}}}return ut(t,["moov","mvex","trex"]).forEach((t=>{const n=ot(t,4),track=e[n];track&&(track.default={duration:ot(t,12),flags:ot(t,20)})})),e}function pt(t){const e=t.subarray(8),n=e.subarray(86),r=st(e.subarray(4,8));let o,l=r;const c="enca"===r||"encv"===r;if(c){const t=ut(e,[r])[0];ut(t.subarray("enca"===r?28:78),["sinf"]).forEach((t=>{const e=ut(t,["schm"])[0];if(e){const n=st(e.subarray(4,8));if("cbcs"===n||"cenc"===n){const e=ut(t,["frma"])[0];e&&(l=st(e))}}}))}const d=l;switch(l){case"avc1":case"avc2":case"avc3":case"avc4":{const t=ut(n,["avcC"])[0];t&&t.length>3&&(l+="."+vt(t[1])+vt(t[2])+vt(t[3]),o=mt("avc1"===d?"dva1":"dvav",n));break}case"mp4a":{const t=ut(e,[r])[0],n=ut(t.subarray(28),["esds"])[0];if(n&&n.length>7){let i=4;if(3!==n[i++])break;i=gt(n,i),i+=2;const t=n[i++];if(128&t&&(i+=2),64&t&&(i+=n[i++]),4!==n[i++])break;i=gt(n,i);const e=n[i++];if(64!==e)break;if(l+="."+vt(e),i+=12,5!==n[i++])break;i=gt(n,i);const r=n[i++];let o=(248&r)>>3;31===o&&(o+=1+((7&r)<<3)+((224&n[i])>>5)),l+="."+o}break}case"hvc1":case"hev1":{const t=ut(n,["hvcC"])[0];if(t&&t.length>12){const e=t[1],n=["","A","B","C"][e>>6],r=31&e,o=ot(t,2),c=(32&e)>>5?"H":"L",d=t[12],h=t.subarray(6,12);l+="."+n+r,l+="."+function(t){let e=0;for(let i=0;i<32;i++)e|=(t>>i&1)<<31-i;return e>>>0}(o).toString(16).toUpperCase(),l+="."+c+d;let f="";for(let i=h.length;i--;){const t=h[i];if(t||f){f="."+t.toString(16).toUpperCase()+f}}l+=f}o=mt("hev1"==d?"dvhe":"dvh1",n);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":l=mt(l,n)||l;break;case"vp09":{const t=ut(n,["vpcC"])[0];if(t&&t.length>6){const e=t[4],n=t[5],r=t[6]>>4&15;l+="."+yt(e)+"."+yt(n)+"."+yt(r)}break}case"av01":{const t=ut(n,["av1C"])[0];if(t&&t.length>2){const e=t[1]>>>5,r=31&t[1],c=t[2]>>>7?"H":"M",d=(64&t[2])>>6,h=(32&t[2])>>5,f=2===e&&d?h?12:10:d?10:8,m=(16&t[2])>>4,v=(8&t[2])>>3,y=(4&t[2])>>2,E=3&t[2],T=1,k=1,S=1,_=0;l+="."+e+"."+yt(r)+c+"."+yt(f)+"."+m+"."+v+y+E+"."+yt(T)+"."+yt(k)+"."+yt(S)+"."+_,o=mt("dav1",n)}break}}return{codec:l,encrypted:c,supplemental:o}}function mt(t,e){const n=ut(e,["dvvC"]),r=n.length?n[0]:ut(e,["dvcC"])[0];if(r){const e=r[2]>>1&127,n=r[2]<<5&32|r[3]>>3&31;return t+"."+yt(e)+"."+yt(n)}}function gt(t,i){const e=i+5;for(;128&t[i++]&&i<e;);return i}function vt(t){return("0"+t.toString(16).toUpperCase()).slice(-2)}function yt(t){return(t<10?"0":"")+t}
vendor: 8,919 bytes, line 2
2function bt(t,e){ut(t,["moov","trak"]).forEach((t=>{const n=ut(t,["mdia","minf","stbl","stsd"])[0];if(!n)return;const r=n.subarray(8);let o=ut(r,["enca"]);const l=o.length>0;l||(o=ut(r,["encv"])),o.forEach((t=>{ut(l?t.subarray(28):t.subarray(78),["sinf"]).forEach((t=>{const n=Et(t);n&&e(n,l)}))}))}))}function Et(t){const e=ut(t,["schm"])[0];if(e){const n=st(e.subarray(4,8));if("cbcs"===n||"cenc"===n){const e=ut(t,["schi","tenc"])[0];if(e)return e}}}function Tt(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function kt(t,track){const e=[],n=track.samples,r=track.timescale,o=track.id;let l=!1;return ut(n,["moof"]).map((c=>{const d=c.byteOffset-8;ut(c,["traf"]).map((c=>{const h=ut(c,["tfdt"]).map((t=>{const e=t[0];let n=ot(t,4);return 1===e&&(n*=Math.pow(2,32),n+=ot(t,8)),n/r}))[0];return void 0!==h&&(t=h),ut(c,["tfhd"]).map((h=>{const f=ot(h,4),m=16777215&ot(h,0);let v=0;const y=0!=(16&m);let E=0;const T=0!=(32&m);let k=8;f===o&&(0!=(1&m)&&(k+=8),0!=(2&m)&&(k+=4),0!=(8&m)&&(v=ot(h,k),k+=4),y&&(E=ot(h,k),k+=4),T&&(k+=4),"video"===track.type&&(l=St(track.codec)),ut(c,["trun"]).map((o=>{const c=o[0],h=16777215&ot(o,0),f=0!=(1&h);let m=0;const y=0!=(4&h),T=0!=(256&h);let k=0;const S=0!=(512&h);let _=0;const A=0!=(1024&h),O=0!=(2048&h);let w=0;const I=ot(o,4);let R=8;f&&(m=ot(o,R),R+=4),y&&(R+=4);let L=m+d;for(let d=0;d<I;d++){if(T?(k=ot(o,R),R+=4):k=v,S?(_=ot(o,R),R+=4):_=E,A&&(R+=4),O&&(w=0===c?ot(o,R):ct(o,R),R+=4),track.type===Y){let o=0;for(;o<_;){const c=ot(n,L);if(L+=4,_t(l,n[L])){At(n.subarray(L,L+c),l?2:1,t+w/r,e)}L+=c,o+=c+4}}t+=k/r}})))}))}))})),e}function St(t){if(!t)return!1;const e=t.substring(0,4);return"hvc1"===e||"hev1"===e||"dvh1"===e||"dvhe"===e}function _t(t,e){if(t){const t=e>>1&63;return 39===t||40===t}return 6===(31&e)}function At(t,e,n,r){const data=Ot(t);let o=0;o+=e;let l=0,c=0,b=0;for(;o<data.length;){l=0;do{if(o>=data.length)break;b=data[o++],l+=b}while(255===b);c=0;do{if(o>=data.length)break;b=data[o++],c+=b}while(255===b);const t=data.length-o;let e=o;if(c<t)o+=c;else if(c>t){M.error(`Malformed SEI payload. ${c} is too small, only ${t} bytes left to parse.`);break}if(4===l){if(181===data[e++]){const t=at(data,e);if(e+=2,49===t){const t=ot(data,e);if(e+=4,1195456820===t){const t=data[e++];if(3===t){const o=data[e++],c=31&o,d=64&o,h=d?2+3*c:0,f=new Uint8Array(h);if(d){f[0]=o;for(let i=1;i<h;i++)f[i]=data[e++]}r.push({type:t,payloadType:l,pts:n,bytes:f})}}}}}else if(5===l&&c>16){const t=[];for(let i=0;i<16;i++){const n=data[e++].toString(16);t.push(1==n.length?"0"+n:n),3!==i&&5!==i&&7!==i&&9!==i||t.push("-")}const o=c-16,d=new Uint8Array(o);for(let i=0;i<o;i++)d[i]=data[e++];r.push({payloadType:l,pts:n,uuid:t.join(""),userData:N(d),userDataBytes:d})}}}function Ot(data){const t=data.byteLength,e=[];let i=1;for(;i<t-2;)0===data[i]&&0===data[i+1]&&3===data[i+2]?(e.push(i+2),i+=2):i++;if(0===e.length)return data;const n=t-e.length,r=new Uint8Array(n);let o=0;for(i=0;i<n;o++,i++)o===e[0]&&(o++,e.shift()),r[i]=data[o];return r}function wt(t,e,data){if(16!==t.byteLength)throw new RangeError("Invalid system id");let n,r,o;n=0,r=new Uint8Array,o=new Uint8Array;const l=new Uint8Array(4);return data.byteLength>0&&new DataView(l.buffer).setUint32(0,data.byteLength,!1),function(t,...e){const n=e.length;let r=8,i=n;for(;i--;)r+=e[i].byteLength;const o=new Uint8Array(r);for(o[0]=r>>24&255,o[1]=r>>16&255,o[2]=r>>8&255,o[3]=255&r,o.set(t,4),i=0,r=8;i<n;i++)o.set(e[i],r),r+=e[i].byteLength;return o}([112,115,115,104],new Uint8Array([0,0,0,0]),t,o,r,l,data)}function It(view){const t=view.getUint32(0),e=view.byteOffset,n=view.byteLength;if(n<t)return{offset:e,size:n};if(1886614376!==view.getUint32(4))return{offset:e,size:t};const r=view.getUint32(8)>>>24;if(0!==r&&1!==r)return{offset:e,size:t};const o=view.buffer,l=U(new Uint8Array(o,e+12,16));let c=null,data=null,d=0;if(0===r)d=28;else{const r=view.getUint32(28);if(!r||n<32+16*r)return{offset:e,size:t};c=[];for(let i=0;i<r;i++)c.push(new Uint8Array(o,e+32+16*i,16));d=32+16*r}if(!d)return{offset:e,size:t};const h=view.getUint32(d);return t-32<h?{offset:e,size:t}:(data=new Uint8Array(o,e+d+4,h),{version:r,systemId:l,kids:c,data:data,offset:e,size:t})}const Rt=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Lt={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function xt(t,e){const n=Lt[e];return!!n&&!!n[t.slice(0,4)]}function Dt(t,e,n=!0){return!t.split(",").some((t=>!Ct(t,e,n)))}function Ct(t,e,n=!0){var r;const o=j(n);return null!=(r=null==o?void 0:o.isTypeSupported(Pt(t,e)))&&r}function Pt(t,e){return`${e}/mp4;codecs=${t}`}function Mt(t){if(t){const e=t.substring(0,4);return Lt.video[e]}return 2}function jt(t){const e=Rt();return t.split(",").reduce(((t,n)=>{const r=e&&St(n)?9:Lt.video[n];return r?(2*r+t)/(t?3:2):(Lt.audio[n]+t)/(t?2:1)}),0)}const Ft={};const Nt=/flac|opus|mp4a\.40\.34/i;function Ut(t,e=!0){return t.replace(Nt,(t=>function(t,e=!0){if(Ft[t])return Ft[t];const n={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[t];for(let i=0;i<n.length;i++){var r;if(Ct(n[i],"audio",e))return Ft[t]=n[i],n[i];if("mp3"===n[i]&&null!=(r=j(e))&&r.isTypeSupported("audio/mpeg"))return""}return t}(t.toLowerCase(),e)))}function Bt(t,e){if(t&&(t.length>4||-1!==["ac-3","ec-3","alac","fLaC","Opus"].indexOf(t))&&($t(t,"audio")||$t(t,"video")))return t;if(e){const n=e.split(",");if(n.length>1){if(t)for(let i=n.length;i--;)if(n[i].substring(0,4)===t.substring(0,4))return n[i];return n[0]}}return e||t}function $t(t,e){return xt(t,e)&&Ct(t,e)}function Vt(t){if(t.startsWith("av01.")){const e=t.split("."),n=["0","111","01","01","01","0"];for(let i=e.length;i>4&&i<10;i++)e[i]=n[i-4];return e.join(".")}return t}function Gt(t){const e=j(t)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Ht(t){return t.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Wt={supported:!1,smooth:!1,powerEfficient:!1},Kt={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function qt(t,e){return{supported:!1,configurations:e,decodingInfoResults:[Wt],error:t}}function Yt(t,e,n,o,l,c){const d=t.videoCodec,h=t.audioCodec?t.audioGroups:null,f=null==c?void 0:c.audioCodec,m=null==c?void 0:c.channels,v=m?parseInt(m):f?1/0:2;let y=null;if(null!=h&&h.length)try{y=1===h.length&&h[0]?e.groups[h[0]].channels:h.reduce(((t,n)=>{if(n){const r=e.groups[n];if(!r)throw new Error(`Audio track group ${n} not found`);Object.keys(r.channels).forEach((e=>{t[e]=(t[e]||0)+r.channels[e]}))}return t}),{2:0})}catch(t){return!0}return void 0!==d&&(d.split(",").some((t=>St(t)))||t.width>1920&&t.height>1088||t.height>1920&&t.width>1088||t.frameRate>Math.max(o,30)||"SDR"!==t.videoRange&&t.videoRange!==n||t.bitrate>Math.max(l,8e6))||!!y&&r(v)&&Object.keys(y).some((t=>parseInt(t)>v))}function zt(t,e,n,r={}){const o=t.videoCodec;if(!o&&!t.audioCodec||!n)return Promise.resolve(Kt);const l=[],c=function(t){var e;const n=null==(e=t.videoCodec)?void 0:e.split(","),r=Xt(t),o=t.width||640,l=t.height||480,c=t.frameRate||30,d=t.videoRange.toLowerCase();return n?n.map((t=>{const e={contentType:Pt(Vt(t),"video"),width:o,height:l,bitrate:r,framerate:c};return"sdr"!==d&&(e.transferFunction=d),e})):[]}(t),d=c.length,h=function(t,e,n){var r;const o=null==(r=t.audioCodec)?void 0:r.split(","),l=Xt(t);if(o&&t.audioGroups)return t.audioGroups.reduce(((t,r)=>{var c;const d=r?null==(c=e.groups[r])?void 0:c.tracks:null;return d?d.reduce(((t,e)=>{if(e.groupId===r){const r=parseFloat(e.channels||"");o.forEach((e=>{const o={contentType:Pt(e,"audio"),bitrate:n?Qt(e,l):l};r&&(o.channels=""+r),t.push(o)}))}return t}),t):t}),[]);return[]}(t,e,d>0),f=h.length;for(let i=d||1*f||1;i--;){const t={type:"media-source"};if(d&&(t.video=c[i%d]),f){t.audio=h[i%f];const e=t.audio.bitrate;t.video&&e&&(t.video.bitrate-=e)}l.push(t)}if(o){const t=navigator.userAgent;if(o.split(",").some((t=>St(t)))&&Rt())return Promise.resolve(qt(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${t})`),l))}return Promise.all(l.map((t=>{const e=function(t){let e="";const{audio:audio,video:video}=t;if(video){e+=`${Ht(video.contentType)}_r${video.height}x${video.width}f${Math.ceil(video.framerate)}${video.transferFunction||"sd"}_${Math.ceil(video.bitrate/1e5)}`}if(audio){e+=`${video?"_":""}
2${Ht(audio.contentType)}_c${audio.channels}`}return e}(t);return r[e]||(r[e]=n.decodingInfo(t))}))).then((t=>({supported:!t.some((t=>!t.supported)),configurations:l,decodingInfoResults:t}))).catch((t=>({supported:!1,configurations:l,decodingInfoResults:[],error:t})))}function Qt(t,e){if(e<=1)return 1;let n=128e3;return"ec-3"===t?n=768e3:"ac-3"===t&&(n=64e4),Math.min(e/2,n)}function Xt(t){return 1e3*Math.ceil(Math.max(.9*t.bitrate,t.averageBitrate)/1e3)||1}const Zt=["NONE","TYPE-0","TYPE-1",null];const Jt=["SDR","PQ","HLG"];var te="",ee="YES",ne="v2";function ie(details){const{canSkipUntil:t,canSkipDateRanges:e,age:n}=details;return t&&n<t/2?e?ne:ee:te}class re{constructor(t,e,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=e,this.skip=n}addDirectives(t){const e=new self.URL(t);return void 0!==this.msn&&e.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.href}}class se{constructor(data){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[data.url],this._attrs=[data.attrs],this.bitrate=data.bitrate,data.details&&(this.details=data.details),this.id=data.id||0,this.name=data.name,this.width=data.width||0,this.height=data.height||0,this.frameRate=data.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=data.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=data.audioCodec,this.videoCodec=data.videoCodec,this.codecSet=[data.videoCodec,data.audioCodec].filter((t=>!!t)).map((s=>s.substring(0,4))).join(","),"supplemental"in data){var t;this.supplemental=data.supplemental;const e=null==(t=data.supplemental)?void 0:t.videoCodec;e&&e!==data.videoCodec&&(this.codecSet+=`,${e.substring(0,4)}`)}this.addGroupId("audio",data.attrs.AUDIO),this.addGroupId("text",data.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(t){return ae(this._audioGroups,t)}hasSubtitleGroup(t){return ae(this._subtitleGroups,t)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(t,e){if(e)if("audio"===t){let t=this._audioGroups;t||(t=this._audioGroups=[]),-1===t.indexOf(e)&&t.push(e)}else if("text"===t){let t=this._subtitleGroups;t||(t=this._subtitleGroups=[]),-1===t.indexOf(e)&&t.push(e)}}get urlId(){return 0}set urlId(t){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var t;return null==(t=this.audioGroups)?void 0:t[0]}get textGroupId(){var t;return null==(t=this.subtitleGroups)?void 0:t[0]}addFallback(){}}function ae(t,e){return!(!e||!t)&&-1!==t.indexOf(e)}function oe(t,e){let n=!1,r=[];if(t&&(n="SDR"!==t,r=[t]),e){r=e.allowedVideoRanges||Jt.slice(0);const t="SDR"!==r.join("")&&!e.videoCodec;n=void 0!==e.preferHDR?e.preferHDR:t&&function(){if("function"==typeof matchMedia){const t=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(t.media!==e.media)return!0===t.matches}return!1}(),n||(r=["SDR"])}return{preferHDR:n,allowedVideoRanges:r}}const le=(object,t)=>JSON.stringify(object,(t=>{const e=new WeakSet;return(n,r)=>{if(t&&(r=t(n,r)),"object"==typeof r&&null!==r){if(e.has(r))return;e.add(r)}return r}})(t));function ce(t,e){M.log(`[abr] start candidates with "${t}" ignored because ${e}`)}function ue(t){return t.reduce(((t,track)=>{let e=t.groups[track.groupId];e||(e=t.groups[track.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),e.tracks.push(track);const n=track.channels||"2";return e.channels[n]=(e.channels[n]||0)+1,e.hasDefault=e.hasDefault||track.default,e.hasAutoSelect=e.hasAutoSelect||track.autoselect,e.hasDefault&&(t.hasDefaultAudio=!0),e.hasAutoSelect&&(t.hasAutoSelectAudio=!0),t}),{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function de(option){if(!option)return option;const{lang:t,assocLang:e,characteristics:n,channels:r,audioCodec:o}=option;return{lang:t,assocLang:e,characteristics:n,channels:r,audioCodec:o}}function he(option,t,e){if("attrs"in option){const e=t.indexOf(option);if(-1!==e)return e}for(let i=0;i<t.length;i++){if(fe(option,t[i],e))return i}return-1}function fe(option,track,t){const{groupId:e,name:n,lang:r,assocLang:o,default:l}=option,c=option.forced;return(void 0===e||track.groupId===e)&&(void 0===n||track.name===n)&&(void 0===r||function(t,e="--"){if(t.length===e.length)return t===e;return t.startsWith(e)||e.startsWith(t)}(r,track.lang))&&(void 0===r||track.assocLang===o)&&(void 0===l||track.default===l)&&(void 0===c||track.forced===c)&&(!("characteristics"in option)||function(t,e=""){const n=t.split(","),r=e.split(",");return n.length===r.length&&!n.some((t=>-1===r.indexOf(t)))}(option.characteristics||"",track.characteristics))&&(void 0===t||t(option,track))}function pe(option,track){const{audioCodec:t,channels:e}=option;return!(void 0!==t&&(track.audioCodec||"").substring(0,4)!==t.substring(0,4)||void 0!==e&&e!==(track.channels||"2"))}function me(t,e,n){for(let i=e;i>-1;i--)if(n(t[i]))return i;for(let i=e+1;i<t.length;i++)if(n(t[i]))return i;return-1}function ge(t,e){var n;return!!t&&t!==(null==(n=e.loadLevelObj)?void 0:n.uri)}const ve=function(t,e){let n=0,r=t.length-1,o=null,l=null;for(;n<=r;){o=(n+r)/2|0,l=t[o];const c=e(l);if(c>0)n=o+1;else{if(!(c<0))return l;r=o-1}}return null};function ye(t,e,n=0,r=0,o=.005){let l=null;if(t){l=e[1+t.sn-e[0].sn]||null;const r=t.endDTS-n;r>0&&r<15e-7&&(n+=15e-7),l&&t.level!==l.level&&l.end<=t.end&&(l=e[2+t.sn-e[0].sn]||null)}else 0===n&&0===e[0].start&&(l=e[0]);if(l&&((!t||t.level===l.level)&&0===be(n,r,l)||function(t,e,n){if(e&&0===e.start&&e.level<t.level&&(e.endPTS||0)>0){const r=e.tagList.reduce(((t,e)=>("INF"===e[0]&&(t+=parseFloat(e[1])),t)),n);return t.start<=r}return!1}(l,t,Math.min(o,r))))return l;const c=ve(e,be.bind(null,n,r));return!c||c===t&&l?l:c}function be(t=0,e=0,n){if(n.start<=t&&n.start+n.duration>t)return 0;const r=Math.min(e,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-r<=t?1:n.start-r>t&&n.start?-1:0}function Ee(t,e,n){const r=1e3*Math.min(e,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-r>t}function Te(details,t,e){if(details&&details.startCC<=t&&details.endCC>=t){let n=details.fragments;const{fragmentHint:r}
vendor: 9,771 bytes, line 2
2=details;let o;return r&&(n=n.concat(r)),ve(n,(n=>n.cc<t?1:n.cc>t?-1:(o=n,n.end<=e?1:n.start>e?-1:0))),o||null}return null}function ke(t){switch(t.details){case d.FRAG_LOAD_TIMEOUT:case d.KEY_LOAD_TIMEOUT:case d.LEVEL_LOAD_TIMEOUT:case d.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Se(t){return t.details.startsWith("key")}function _e(t){return Se(t)&&!!t.frag&&!t.frag.decryptdata}function Ae(t,e){const n=ke(e);return t.default[(n?"timeout":"error")+"Retry"]}function Oe(t,e){const n="linear"===t.backoff?1:Math.pow(2,e);return Math.min(n*t.retryDelayMs,t.maxRetryDelayMs)}function we(t){return I(I({},t),{errorRetry:null,timeoutRetry:null})}function Ie(t,e,n,r){if(!t)return!1;const o=null==r?void 0:r.code,l=e<t.maxNumRetry&&(function(t){return Re(t)||!!t&&(t<400||t>499)}(o)||!!n);return t.shouldRetry?t.shouldRetry(t,e,n,r,l):l}function Re(t){return 0===t&&!1===navigator.onLine}var Le=0,xe=2,De=3,Ce=5,Pe=0,Me=1,je=2,Fe=4;function Ne(t){const e={action:Le,flags:Pe};return t&&(e.resolved=!0),e}var Ue="NOT_LOADED",Be="APPENDING",$e="PARTIAL",Ve="OK";class Ge{constructor(t){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=t,this._registerListeners()}_registerListeners(){const{hls:t}=this;t&&(t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.BUFFER_APPENDED,this.onBufferAppended,this),t.on(h.FRAG_BUFFERED,this.onFragBuffered,this),t.on(h.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:t}=this;t&&(t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.BUFFER_APPENDED,this.onBufferAppended,this),t.off(h.FRAG_BUFFERED,this.onFragBuffered,this),t.off(h.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(t,e){const n=this.activePartLists[e];if(n)for(let i=n.length;i--;){const e=n[i];if(!e)break;if(e.start<=t&&t<=e.end&&e.loaded)return e}return this.getBufferedFrag(t,e)}getBufferedFrag(t,e){return this.getFragAtPos(t,e,!0)}getFragAtPos(t,e,n){const{fragments:r}=this,o=Object.keys(r);for(let i=o.length;i--;){const l=r[o[i]];if((null==l?void 0:l.body.type)===e&&(!n||l.buffered)){const e=l.body;if(e.start<=t&&t<=e.end)return e}}return null}detectEvictedFragments(t,e,n,r,o){this.timeRanges&&(this.timeRanges[t]=e);const l=(null==r?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach((r=>{const c=this.fragments[r];if(!c)return;if(l>=c.body.sn)return;if(!c.buffered&&(!c.loaded||o))return void(c.body.type===n&&this.removeFragment(c.body));const d=c.range[t];d&&(0!==d.time.length?d.time.some((time=>{const t=!this.isTimeBuffered(time.startPTS,time.endPTS,e);return t&&this.removeFragment(c.body),t})):this.removeFragment(c.body))}))}detectPartialFragments(data){const t=this.timeRanges;if(!t||"initSegment"===data.frag.sn)return;const e=data.frag,n=We(e),r=this.fragments[n];if(!r||r.buffered&&e.gap)return;const o=!e.relurl;Object.keys(t).forEach((n=>{const l=e.elementaryStreams[n];if(!l)return;const c=t[n],d=o||!0===l.partial;r.range[n]=this.getBufferedTimes(e,data.part,d,c)})),r.loaded=null,Object.keys(r.range).length?(this.bufferedEnd(r,e),He(r)||this.removeParts(e.sn-1,e.type)):this.removeFragment(r.body)}bufferedEnd(t,e){t.buffered=!0;(t.body.endList=e.endList||t.body.endList)&&(this.endListFragments[t.body.type]=t)}removeParts(t,e){const n=this.activePartLists[e];n&&(this.activePartLists[e]=Ke(n,(e=>e.fragment.sn>=t)))}fragBuffered(t,e){const n=We(t);let r=this.fragments[n];!r&&e&&(r=this.fragments[n]={body:t,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},t.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,this.bufferedEnd(r,t))}getBufferedTimes(t,e,n,r){const o={time:[],partial:n},l=t.start,c=t.end,d=t.minEndPTS||c,h=t.maxStartPTS||l;for(let i=0;i<r.length;i++){const t=r.start(i)-this.bufferPadding,e=r.end(i)+this.bufferPadding;if(h>=t&&d<=e){o.time.push({startPTS:Math.max(l,r.start(i)),endPTS:Math.min(c,r.end(i))});break}if(l<e&&c>t){const t=Math.max(l,r.start(i)),e=Math.min(c,r.end(i));e>t&&(o.partial=!0,o.time.push({startPTS:t,endPTS:e}))}else if(c<=t)break}return o}getPartialFragment(time){let t,e,n,r=null,o=0;const{bufferPadding:l,fragments:c}=this;return Object.keys(c).forEach((d=>{const h=c[d];h&&He(h)&&(e=h.body.start-l,n=h.body.end+l,time>=e&&time<=n&&(t=Math.min(time-e,n-time),o<=t&&(r=h.body,o=t)))})),r}isEndListAppended(t){const e=this.endListFragments[t];return void 0!==e&&(e.buffered||He(e))}getState(t){const e=We(t),n=this.fragments[e];return n?n.buffered?He(n)?$e:Ve:Be:Ue}isTimeBuffered(t,e,n){let r,o;for(let i=0;i<n.length;i++){if(r=n.start(i)-this.bufferPadding,o=n.end(i)+this.bufferPadding,t>=r&&e<=o)return!0;if(e<=r)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(t,data){if("initSegment"===data.frag.sn||data.frag.bitrateTest)return;const e=data.frag,n=data.part?null:data,r=We(e);this.fragments[r]={body:e,appendedPTS:null,loaded:n,buffered:!1,range:Object.create(null)}}onBufferAppended(t,data){const{frag:e,part:n,timeRanges:r,type:o}=data;if("initSegment"===e.sn)return;const l=e.type;if(n){let t=this.activePartLists[l];t||(this.activePartLists[l]=t=[]),t.push(n)}this.timeRanges=r;const c=r[o];this.detectEvictedFragments(o,c,l,n)}onFragBuffered(t,data){this.detectPartialFragments(data)}hasFragment(t){const e=We(t);return!!this.fragments[e]}hasFragments(t){const{fragments:e}=this,n=Object.keys(e);if(!t)return n.length>0;for(let i=n.length;i--;){const r=e[n[i]];if((null==r?void 0:r.body.type)===t)return!0}return!1}hasParts(t){var e;return!(null==(e=this.activePartLists[t])||!e.length)}removeFragmentsInRange(t,e,n,r,o){r&&!this.hasGaps||Object.keys(this.fragments).forEach((l=>{const c=this.fragments[l];if(!c)return;const d=c.body;d.type!==n||r&&!d.gap||d.start<e&&d.end>t&&(c.buffered||o)&&this.removeFragment(d)}))}removeFragment(t){const e=We(t);t.clearElementaryStreamInfo();const n=this.activePartLists[t.type];if(n){const e=t.sn;this.activePartLists[t.type]=Ke(n,(t=>t.fragment.sn!==e))}delete this.fragments[e],t.endList&&delete this.endListFragments[t.type]}removeAllFragments(){var t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const e=null==(t=this.hls)||null==(t=t.latestLevelDetails)?void 0:t.partList;e&&e.forEach((t=>t.clearElementaryStreamInfo()))}}function He(t){var e,n,r;return t.buffered&&!!(t.body.gap||null!=(e=t.range.video)&&e.partial||null!=(n=t.range.audio)&&n.partial||null!=(r=t.range.audiovideo)&&r.partial)}function We(t){return`${t.type}_${t.level}_${t.sn}`}function Ke(t,e){return t.filter((t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n}))}var qe=0,Ye=1;class ze{constructor(t,e,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=t,this.aesIV=e,this.aesMode=n}decrypt(data,t){switch(this.aesMode){case qe:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,data);case Ye:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,data);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}class Qe{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(t){const view=new DataView(t),e=new Uint32Array(4);for(let i=0;i<4;i++)e[i]=view.getUint32(4*i);return e}initTable(){const t=this.sBox,e=this.invSBox,n=this.subMix,r=n[0],o=n[1],l=n[2],c=n[3],d=this.invSubMix,h=d[0],f=d[1],m=d[2],v=d[3],y=new Uint32Array(256);let E=0,T=0,i=0;for(i=0;i<256;i++)y[i]=i<128?i<<1:i<<1^283;for(i=0;i<256;i++){let n=T^T<<1^T<<2^T<<3^T<<4;n=n>>>8^255&n^99,t[E]=n,e[n]=E;const d=y[E],k=y[d],S=y[k];let _=257*y[n]^16843008*n;r[E]=_<<24|_>>>8,o[E]=_<<16|_>>>16,l[E]=_<<8|_>>>24,c[E]=_,_=16843009*S^65537*k^257*d^16843008*E,h[n]=_<<24|_>>>8,f[n]=_<<16|_>>>16,m[n]=_<<8|_>>>24,v[n]=_,E?(E=d^y[y[y[S^d]]],T^=y[y[T]]):E=T=1}}expandKey(t){const e=this.uint8ArrayToUint32Array_(t);let n=!0,r=0;for(;r<e.length&&n;)n=e[r]===this.key[r],r++;if(n)return;this.key=e;const o=this.keySize=e.length;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size="+o);const l=this.ksRows=4*(o+6+1);let c,d;const h=this.keySchedule=new Uint32Array(l),f=this.invKeySchedule=new Uint32Array(l),m=this.sBox,v=this.rcon,y=this.invSubMix,E=y[0],T=y[1],k=y[2],S=y[3];let _,A;for(c=0;c<l;c++)c<o?_=h[c]=e[c]:(A=_,c%o==0?(A=A<<8|A>>>24,A=m[A>>>24]<<24|m[A>>>16&255]<<16|m[A>>>8&255]<<8|m[255&A],A^=v[c/o|0]<<24):o>6&&c%o==4&&(A=m[A>>>24]<<24|m[A>>>16&255]<<16|m[A>>>8&255]<<8|m[255&A]),h[c]=_=(h[c-o]^A)>>>0);for(d=0;d<l;d++)c=l-d,A=3&d?h[c]:h[c-4],f[d]=d<4||c<=4?A:E[m[A>>>24]]^T[m[A>>>16&255]]^k[m[A>>>8&255]]^S[m[255&A]],f[d]=f[d]>>>0}networkToHostOrderSwap(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24}decrypt(t,e,n){const r=this.keySize+6,o=this.invKeySchedule,l=this.invSBox,c=this.invSubMix,d=c[0],h=c[1],f=c[2],m=c[3],v=this.uint8ArrayToUint32Array_(n);let y=v[0],E=v[1],T=v[2],k=v[3];const S=new Int32Array(t),_=new Int32Array(S.length);let A,O,w,I,R,L,x,D,C,P,M,j,F,i;const N=this.networkToHostOrderSwap;for(;e<S.length;){for(C=N(S[e]),P=N(S[e+1]),M=N(S[e+2]),j=N(S[e+3]),R=C^o[0],L=j^o[1],x=M^o[2],D=P^o[3],F=4,i=1;i<r;i++)A=d[R>>>24]^h[L>>16&255]^f[x>>8&255]^m[255&D]^o[F],O=d[L>>>24]^h[x>>16&255]^f[D>>
vendor: 4,049 bytes, line 2
28&255]^m[255&R]^o[F+1],w=d[x>>>24]^h[D>>16&255]^f[R>>8&255]^m[255&L]^o[F+2],I=d[D>>>24]^h[R>>16&255]^f[L>>8&255]^m[255&x]^o[F+3],R=A,L=O,x=w,D=I,F+=4;A=l[R>>>24]<<24^l[L>>16&255]<<16^l[x>>8&255]<<8^l[255&D]^o[F],O=l[L>>>24]<<24^l[x>>16&255]<<16^l[D>>8&255]<<8^l[255&R]^o[F+1],w=l[x>>>24]<<24^l[D>>16&255]<<16^l[R>>8&255]<<8^l[255&L]^o[F+2],I=l[D>>>24]<<24^l[R>>16&255]<<16^l[L>>8&255]<<8^l[255&x]^o[F+3],_[e]=N(A^y),_[e+1]=N(I^E),_[e+2]=N(w^T),_[e+3]=N(O^k),y=C,E=P,T=M,k=j,e+=4}return _.buffer}}class Xe{constructor(t,e,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=t,this.key=e,this.aesMode=n}expandKey(){const t=function(t){switch(t){case qe:return"AES-CBC";case Ye:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${t}`)}}(this.aesMode);return this.subtle.importKey("raw",this.key,{name:t},!1,["encrypt","decrypt"])}}class Ze{constructor(t,{removePKCS7Padding:e=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=t.enableSoftwareAES,this.removePKCS7Padding=e,e)try{const t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(t){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:t,remainderData:e}=this;if(!t||e)return this.reset(),null;const data=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?function(t){const e=t.byteLength,n=e&&new DataView(t.buffer).getUint8(e-1);return n?t.slice(0,e-n):t}(data):data}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(data,t,e,n){return this.useSoftware?new Promise(((r,o)=>{const l=ArrayBuffer.isView(data)?data:new Uint8Array(data);this.softwareDecrypt(l,t,e,n);const c=this.flush();c?r(c.buffer):o(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(data),t,e,n)}softwareDecrypt(data,t,e,n){const{currentIV:r,currentResult:o,remainderData:l}=this;if(n!==qe||16!==t.byteLength)return M.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),l&&(data=Tt(l,data),this.remainderData=null);const c=this.getValidChunk(data);if(!c.length)return null;r&&(e=r);let d=this.softwareDecrypter;d||(d=this.softwareDecrypter=new Qe),d.expandKey(t);const h=o;return this.currentResult=d.decrypt(c.buffer,0,e),this.currentIV=c.slice(-16).buffer,h||null}webCryptoDecrypt(data,t,e,n){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(data,t,e,n));this.key=t,this.fastAesKey=new Xe(this.subtle,t,n)}return this.fastAesKey.expandKey().then((t=>{if(!this.subtle)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");return new ze(this.subtle,new Uint8Array(e),n).decrypt(data.buffer,t)})).catch((r=>(M.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(data,t,e,n))))}onWebCryptoError(data,t,e,n){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(data,t,e,n);const r=this.flush();if(r)return r.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(data){let t=data;const e=data.length-data.length%16;return e!==data.length&&(t=data.slice(0,e),this.remainderData=data.slice(e)),t}logOnce(t){this.logEnabled&&(M.log(`[decrypter]: ${t}`),this.logEnabled=!1)}}const Je=Math.pow(2,17);class tn{constructor(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(t,e){const n=t.url;
vendor: 24,113 bytes, line 2
2if(!n)return Promise.reject(new rn({type:c.NETWORK_ERROR,details:d.FRAG_LOAD_ERROR,fatal:!1,frag:t,error:new Error("Fragment does not have a "+(n?"part list":"url")),networkDetails:null}));this.abort();const r=this.config,o=r.fLoader,l=r.loader;return new Promise(((h,f)=>{if(this.loader&&this.loader.destroy(),t.gap){if(t.tagList.some((t=>"GAP"===t[0])))return void f(nn(t));t.gap=!1}const m=this.loader=o?new o(r):new l(r),v=en(t);t.loader=m;const y=we(r.fragLoadPolicy.default),E={loadPolicy:y,timeout:y.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===t.sn?1/0:Je};t.stats=m.stats;const T={onSuccess:(e,n,r,o)=>{this.resetLoader(t,m);let l=e.data;r.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(l.slice(0,16)),l=l.slice(16)),h({frag:t,part:null,payload:l,networkDetails:o})},onError:(e,r,o,l)=>{this.resetLoader(t,m),f(new rn({type:c.NETWORK_ERROR,details:d.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:I({url:n,data:void 0},e),error:new Error(`HTTP Error ${e.code} ${e.text}`),networkDetails:o,stats:l}))},onAbort:(e,n,r)=>{this.resetLoader(t,m),f(new rn({type:c.NETWORK_ERROR,details:d.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:r,stats:e}))},onTimeout:(e,n,r)=>{this.resetLoader(t,m),f(new rn({type:c.NETWORK_ERROR,details:d.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error(`Timeout after ${E.timeout}ms`),networkDetails:r,stats:e}))}};e&&(T.onProgress=(n,r,data,o)=>e({frag:t,part:null,payload:data,networkDetails:o})),m.load(v,E,T)}))}loadPart(t,e,n){this.abort();const r=this.config,o=r.fLoader,l=r.loader;return new Promise(((h,f)=>{if(this.loader&&this.loader.destroy(),t.gap||e.gap)return void f(nn(t,e));const m=this.loader=o?new o(r):new l(r),v=en(t,e);t.loader=m;const y=we(r.fragLoadPolicy.default),E={loadPolicy:y,timeout:y.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Je};e.stats=m.stats,m.load(v,E,{onSuccess:(r,o,l,c)=>{this.resetLoader(t,m),this.updateStatsFromPart(t,e);const d={frag:t,part:e,payload:r.data,networkDetails:c};n(d),h(d)},onError:(n,r,o,l)=>{this.resetLoader(t,m),f(new rn({type:c.NETWORK_ERROR,details:d.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:I({url:v.url,data:void 0},n),error:new Error(`HTTP Error ${n.code} ${n.text}`),networkDetails:o,stats:l}))},onAbort:(n,r,o)=>{t.stats.aborted=e.stats.aborted,this.resetLoader(t,m),f(new rn({type:c.NETWORK_ERROR,details:d.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,error:new Error("Aborted"),networkDetails:o,stats:n}))},onTimeout:(n,r,o)=>{this.resetLoader(t,m),f(new rn({type:c.NETWORK_ERROR,details:d.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,error:new Error(`Timeout after ${E.timeout}ms`),networkDetails:o,stats:n}))}})}))}updateStatsFromPart(t,e){const n=t.stats,r=e.stats,o=r.total;if(n.loaded+=r.loaded,o){const r=Math.round(t.duration/e.duration),l=Math.min(Math.round(n.loaded/o),r),c=(r-l)*Math.round(n.loaded/l);n.total=n.loaded+c}else n.total=Math.max(n.loaded,n.total);const l=n.loading,c=r.loading;l.start?l.first+=c.first-c.start:(l.start=c.start,l.first=c.first),l.end=c.end}resetLoader(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()}}function en(t,e=null){const n=e||t,o={frag:t,part:e,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},l=n.byteRangeStartOffset,c=n.byteRangeEndOffset;if(r(l)&&r(c)){var d;let e=l,n=c;if("initSegment"===t.sn&&("AES-128"===(h=null==(d=t.decryptdata)?void 0:d.method)||"AES-256"===h)){const t=c-l;t%16&&(n=c+(16-t%16)),0!==l&&(o.resetIV=!0,e=l-16)}o.rangeStart=e,o.rangeEnd=n}var h;return o}function nn(t,e){const n=new Error(`GAP ${t.gap?"tag":"attribute"} found`),r={type:c.MEDIA_ERROR,details:d.FRAG_GAP,fatal:!1,frag:t,error:n,networkDetails:null};return e&&(r.part=e),(e||t).stats.aborted=!0,new rn(r)}class rn extends Error{constructor(data){super(data.error.message),this.data=void 0,this.data=data}}class sn extends R{constructor(label,t){super(label,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(t){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,t),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class an{constructor(t,e,n,r=0,o=-1,l=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=e,this.id=n,this.size=r,this.part=o,this.partial=l}}const on={length:0,start:()=>0,end:()=>0};class ln{static isBuffered(t,e){if(t){const n=ln.getBuffered(t);for(let i=n.length;i--;)if(e>=n.start(i)&&e<=n.end(i))return!0}return!1}static bufferedRanges(t){if(t){const e=ln.getBuffered(t);return ln.timeRangesToArray(e)}return[]}static timeRangesToArray(t){const e=[];for(let i=0;i<t.length;i++)e.push({start:t.start(i),end:t.end(i)});return e}static bufferInfo(t,e,n){if(t){const r=ln.bufferedRanges(t);if(r.length)return ln.bufferedInfo(r,e,n)}return{len:0,start:e,end:e,bufferedIndex:-1}}static bufferedInfo(t,e,n){e=Math.max(0,e),t.length>1&&t.sort(((a,b)=>a.start-b.start||b.end-a.end));let r=-1,o=[];if(n)for(let i=0;i<t.length;i++){e>=t[i].start&&e<=t[i].end&&(r=i);const l=o.length;if(l){const e=o[l-1].end;t[i].start-e<n?t[i].end>e&&(o[l-1].end=t[i].end):o.push(t[i])}else o.push(t[i])}else o=t;let l,c=0,d=e,h=e;for(let i=0;i<o.length;i++){const t=o[i].start,f=o[i].end;if(-1===r&&e>=t&&e<=f&&(r=i),e+n>=t&&e<f)d=t,h=f,c=h-e;else if(e+n<t){l=t;break}}return{len:c,start:d||0,end:h||0,nextStart:l,buffered:t,bufferedIndex:r}}static getBuffered(t){try{return t.buffered||on}catch(t){return M.log("failed to get media.buffered",t),on}}}const cn=/\{\$([a-zA-Z0-9-_]+)\}/g;function un(t){return cn.test(t)}function dn(t,e){if(null!==t.variableList||t.hasVariableRefs){const n=t.variableList;return e.replace(cn,(e=>{const r=e.substring(2,e.length-1),o=null==n?void 0:n[r];return void 0===o?(t.playlistParsingError||(t.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),e):o}))}return e}function hn(t,e,n){let r,o,l=t.variableList;if(l||(t.variableList=l={}),"QUERYPARAM"in e){r=e.QUERYPARAM;try{const t=new self.URL(n).searchParams;if(!t.has(r))throw new Error(`"${r}" does not match any query parameter in URI: "${n}"`);o=t.get(r)}catch(e){t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${e.message}`))}}else r=e.NAME,o=e.VALUE;r in l?t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):l[r]=o||""}function fn(t,e,n){const r=e.IMPORT;if(n&&r in n){let e=t.variableList;e||(t.variableList=e={}),e[r]=n[r]}else t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}const pn=/^(\d+)x(\d+)$/,mn=/(.+?)=(".*?"|.*?)(?:,|$)/g;class gn{constructor(t,e){"string"==typeof t&&(t=gn.parseAttrList(t,e)),O(this,t)}get clientAttrs(){return Object.keys(this).filter((t=>"X-"===t.substring(0,2)))}decimalInteger(t){const e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e}hexadecimalInteger(t){if(this[t]){let e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;const n=new Uint8Array(e.length/2);for(let i=0;i<e.length/2;i++)n[i]=parseInt(e.slice(2*i,2*i+2),16);return n}return null}hexadecimalIntegerAsNumber(t){const e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e}decimalFloatingPoint(t){return parseFloat(this[t])}optionalFloat(t,e){const n=this[t];return n?parseFloat(n):e}enumeratedString(t){return this[t]}enumeratedStringList(t,e){const n=this[t];return(n?n.split(/[ ,]+/):[]).reduce(((t,e)=>(t[e.toLowerCase()]=!0,t)),e)}bool(t){return"YES"===this[t]}decimalResolution(t){const e=pn.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}}static parseAttrList(input,t){let e;const n={};for(mn.lastIndex=0;null!==(e=mn.exec(input));){const r=e[1].trim();let o=e[2];const l=0===o.indexOf('"')&&o.lastIndexOf('"')===o.length-1;let c=!1;if(l)o=o.slice(1,-1);else switch(r){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":c=!0}if(t&&(l||c))o=dn(t,o);else if(!c&&!l)switch(r){case"CLOSED-CAPTIONS":if("NONE"===o)break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":M.warn(`${input}: attribute ${r} is missing quotes`)}n[r]=o}return n}}function vn(t){return"SCTE35-OUT"===t||"SCTE35-IN"===t||"SCTE35-CMD"===t}class yn{constructor(t,e,n=0){var o;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(null==e?void 0:e.tagAnchor)||null,this.tagOrder=null!=(o=null==e?void 0:e.tagOrder)?o:n,e){const n=e.attr;for(const e in n)if(Object.prototype.hasOwnProperty.call(t,e)&&t[e]!==n[e]){M.warn(`DATERANGE tag attribute: "${e}" does not match for tags with ID: "${t.ID}"`),this._badValueForSameId=e;break}t=O(new gn({}),n,t)}if(this.attr=t,e?(this._startDate=e._startDate,this._cue=e._cue,this._endDate=e._endDate,this._dateAtEnd=e._dateAtEnd):this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){const t=(null==e?void 0:e.endDate)||new Date(this.attr["END-DATE"]);r(t.getTime())&&(this._endDate=t)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const t=this._cue;return void 0===t?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):t}get startTime(){const{tagAnchor:t}=this;return null===t||null===t.programDateTime?(M.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${t}`),NaN):t.start+(this.startDate.getTime()-t.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const t=this._endDate||this._dateAtEnd;if(t)return t;const e=this.duration;return null!==e?this._dateAtEnd=new Date(this._startDate.getTime()+1e3*e):null}get duration(){if("DURATION"in this.attr){const t=this.attr.decimalFloatingPoint("DURATION");if(r(t))return t}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return"com.apple.hls.interstitial"===this.class}get isValid(){return!!this.id&&!this._badValueForSameId&&r(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}class bn{constructor(t){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=t}reloaded(t){if(!t)return this.advanced=!0,void(this.updated=!0);const e=this.lastPartSn-t.lastPartSn,n=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!n||!!e||!this.live,this.advanced=this.endSN>t.endSN||e>0||0===e&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1}hasKey(t){return this.encryptedFragments.some((e=>{let n=e.decryptdata;return n||(e.setKeyFormat(t.keyFormat),n=e.decryptdata),!!n&&t.matches(n)}))}get hasProgramDateTime(){return!!this.fragments.length&&r(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const t=this.driftEndTime-this.driftStartTime;if(t>0){return 1e3*(this.driftEnd-this.driftStart)/t}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const t=this.partList;if(t){const e=this.lastPartIndex;if(-1!==e){for(let i=t.length;i--;)if(t[i].index>e)return t[i].index;return e}}return 0}get lastPartSn(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const t=this.partEnd-this.fragmentStart;return this.age>Math.max(t,this.totalduration)+this.levelTargetDuration}return!1}}function En(a,b){return a.length===b.length&&!a.some(((t,i)=>t!==b[i]))}function Tn(a,b){return!a&&!b||!(!a||!b)&&En(a,b)}function kn(t){return"AES-128"===t||"AES-256"===t||"AES-256-CTR"===t}function Sn(t){switch(t){case"AES-128":case"AES-256":return qe;case"AES-256-CTR":return Ye;default:throw new Error(`invalid full segment method ${t}`)}}function _n(t){return Uint8Array.from(atob(t),(t=>t.charCodeAt(0)))}function An(t){return Uint8Array.from(unescape(encodeURIComponent(t)),(t=>t.charCodeAt(0)))}function On(t){const e=function(t,e,n){const r=t[e];t[e]=t[n],t[n]=r};e(t,0,3),e(t,1,2),e(t,4,5),e(t,6,7)}function wn(t){const e=t.split(":");let n=null;if("data"===e[0]&&2===e.length){const t=e[1].split(";"),r=t[t.length-1].split(",");if(2===r.length){const e="base64"===r[0],data=r[1];e?(t.splice(-1,1),n=_n(data)):n=function(t){const e=An(t).subarray(0,16),n=new Uint8Array(16);return n.set(e,16-e.length),n}(data)}}return n}const In="undefined"!=typeof self?self:void 0;var Rn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Ln="org.w3.clearkey",xn="com.apple.streamingkeydelivery",Dn="com.microsoft.playready",Cn="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Pn(t){switch(t){case xn:return Rn.FAIRPLAY;case Dn:return Rn.PLAYREADY;case Cn:return Rn.WIDEVINE;case Ln:return Rn.CLEARKEY}}function Mn(t){switch(t){case Rn.FAIRPLAY:return xn;case Rn.PLAYREADY:return Dn;case Rn.WIDEVINE:return Cn;case Rn.CLEARKEY:return Ln}}function jn(t){const{drmSystems:e,widevineLicenseUrl:n}=t,r=e?[Rn.FAIRPLAY,Rn.WIDEVINE,Rn.PLAYREADY,Rn.CLEARKEY].filter((t=>!!e[t])):[];return!r[Rn.WIDEVINE]&&n&&r.push(Rn.WIDEVINE),r}const Fn=null!=In&&null!=(Nn=In.navigator)&&Nn.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var Nn;function Un(t){const e=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),n=String.fromCharCode.apply(null,Array.from(e)),r=n.substring(n.indexOf("<"),n.length),o=(new DOMParser).parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(o){const t=o.childNodes[0]?o.childNodes[0].nodeValue:o.getAttribute("VALUE");if(t){const e=_n(t).subarray(0,16);return On(e),e}}return null}let Bn={};class $n{static clearKeyUriToKeyIdMap(){Bn={}}static setKeyIdForUri(t,e){Bn[t]=e}static addKeyIdForUri(t){const e=Object.keys(Bn).length%Number.MAX_SAFE_INTEGER,n=new Uint8Array(16);return new DataView(n.buffer,12,4).setUint32(0,e),Bn[t]=n,n}constructor(t,e,n,r=[1],o=null,l){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=t,this.uri=e,this.keyFormat=n,this.keyFormatVersions=r,this.iv=o,this.encrypted=!!t&&"NONE"!==t,this.isCommonEncryption=this.encrypted&&!kn(t),null!=l&&l.startsWith("0x")&&(this.keyId=new Uint8Array(B(l)))}matches(t){return t.uri===this.uri&&t.method===this.method&&t.encrypted===this.encrypted&&t.keyFormat===this.keyFormat&&En(t.keyFormatVersions,this.keyFormatVersions)&&Tn(t.iv,this.iv)&&Tn(t.keyId,this.keyId)}isSupported(){if(this.method){if(kn(this.method)||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case xn:case Cn:case Dn:case Ln:return-1!==["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(t,e){if(!this.encrypted||!this.uri)return null;if(kn(this.method)){let e=this.iv;e||("number"!=typeof t&&(M.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),t=0),e=function(t){const e=new Uint8Array(16);for(let i=12;i<16;i++)e[i]=t>>8*(15-i)&255;return e}(t));return new $n(this.method,this.uri,"identity",this.keyFormatVersions,e)}if(this.keyId){const t=Bn[this.uri];if(t&&!En(this.keyId,t)&&$n.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const n=wn(this.uri);if(n)switch(this.keyFormat){case Cn:if(this.pssh=n,!this.keyId){const t=function(t){const e=[];if(t instanceof ArrayBuffer){const n=t.byteLength;let r=0;for(;r+32<n;){const n=It(new DataView(t,r));e.push(n),r+=n.size}}return e}(n.buffer);if(t.length){var r;const e=t[0];this.keyId=null!=(r=e.kids)&&r.length?e.kids[0]:null}}this.keyId||(this.keyId=Vn(e));break;case Dn:{const t=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=wt(t,0,n),this.keyId=Un(n);break}default:{let t=n.subarray(0,16);if(16!==t.length){const e=new Uint8Array(16);e.set(t,16-t.length),t=e}this.keyId=t;break}}if(!this.keyId||16!==this.keyId.byteLength){let t;t=function(t){const e=null==t?void 0:t[Cn];if(e)return e.keyId;return null}(e),t||(t=Vn(e),t||(t=Bn[this.uri])),t&&(this.keyId=t,$n.setKeyIdForUri(this.uri,t))}return this}}function Vn(t){const e=null==t?void 0:t[Dn];if(e){const t=wn(e.uri);if(t)return Un(t)}return null}const Gn=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Hn=/#EXT-X-MEDIA:(.*)/g,Wn=/^#EXT(?:INF|-X-TARGETDURATION):/m,Kn=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),qn=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Yn{static findGroup(t,e){for(let i=0;i<t.length;i++){const n=t[i];if(n.id===e)return n}}static resolve(t,e){return H.buildAbsoluteURL(e,t,{alwaysNormalize:!0})}static isMediaPlaylist(t){return Wn.test(t)}static parseMasterPlaylist(t,e){const n={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:un(t)},r=[];if(Gn.lastIndex=0,!t.startsWith("#EXTM3U"))return n.playlistParsingError=new Error("no EXTM3U delimiter"),n;let o;for(;null!=(o=Gn.exec(t));)if(o[1]){var l;const t=new gn(o[1],n),c=dn(n,o[2]),d={attrs:t,bitrate:t.decimalInteger("BANDWIDTH")||t.decimalInteger("AVERAGE-BANDWIDTH"),name:t.NAME,url:Yn.resolve(c,e)},h=t.decimalResolution("RESOLUTION");h&&(d.width=h.width,d.height=h.height),Jn(t.CODECS,d);const f=t["SUPPLEMENTAL-CODECS"];f&&(d.supplemental={},Jn(f,d.supplemental)),null!=(l=d.unknownCodecs)&&l.length||r.push(d),n.levels.push(d)}else if(o[3]){const t=o[3],r=o[4];switch(t){case"SESSION-DATA":{const t=new gn(r,n),e=t["DATA-ID"];e&&(null===n.sessionData&&(n.sessionData={}),n.sessionData[e]=t);break}case"SESSION-KEY":{const t=Xn(r,e,n);t.encrypted&&t.isSupported()?(null===n.sessionKeys&&(n.sessionKeys=[]),n.sessionKeys.push(t)):M.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${r}"`);break}case"DEFINE":hn(n,new gn(r,n),e);break;case"CONTENT-STEERING":{const t=new gn(r,n);n.contentSteering={uri:Yn.resolve(t["SERVER-URI"],e),pathwayId:t["PATHWAY-ID"]||"."};break}case"START":n.startTimeOffset=Zn(r)}}const c=r.length>0&&r.length<n.levels.length;return n.levels=c?r:n.levels,0===n.levels.length&&(n.playlistParsingError=new Error("no levels found in manifest")),n}static parseMasterPlaylistMedia(t,e,n){let r;const o={},l=n.levels,c={AUDIO:l.map((t=>({id:t.attrs.AUDIO,audioCodec:t.audioCodec}))),SUBTITLES:l.map((t=>({id:t.attrs.SUBTITLES,textCodec:t.textCodec}))),"CLOSED-CAPTIONS":[]};let d=0;for(Hn.lastIndex=0;null!==(r=Hn.exec(t));){const t=new gn(r[1],n),l=t.TYPE;if(l){const n=c[l],r=o[l]||[];o[l]=r;const h=t.LANGUAGE,f=t["ASSOC-LANGUAGE"],m=t.CHANNELS,v=t.CHARACTERISTICS,y=t["INSTREAM-ID"],E={attrs:t,bitrate:0,id:d++,groupId:t["GROUP-ID"]||"",name:t.NAME||h||"",type:l,default:t.bool("DEFAULT"),autoselect:t.bool("AUTOSELECT"),forced:t.bool("FORCED"),lang:h,url:t.URI?Yn.resolve(t.URI,e):""};if(f&&(E.assocLang=f),m&&(E.channels=m),v&&(E.characteristics=v),y&&(E.instreamId=y),null!=n&&n.length){const t=Yn.findGroup(n,E.groupId)||n[0];ti(E,t,"audioCodec"),ti(E,t,"textCodec")}r.push(E)}}return o}static parseLevelPlaylist(t,e,n,o,l,c){var d;const base={url:e},h=new bn(e),f=h.fragments,m=[];let v,i,y,E,T=null,k=0,S=0,_=0,A=0,w=0,I=null,R=new Z(o,base),L=-1,x=!1,D=null;if(Kn.lastIndex=0,h.m3u8=t,h.hasVariableRefs=un(t),"#EXTM3U"!==(null==(d=Kn.exec(t))?void 0:d[0]))return h.playlistParsingError=new Error("Missing format identifier #EXTM3U"),h;for(;null!==(v=Kn.exec(t));){x&&(x=!1,R=new Z(o,base),R.playlistOffset=_,R.setStart(_),R.sn=k,R.cc=A,w&&(R.bitrate=w),R.level=n,T&&(R.initSegment=T,T.rawProgramDateTime&&(R.rawProgramDateTime=T.rawProgramDateTime,T.rawProgramDateTime=null),D&&(R.setByteRange(D),D=null)));const t=v[1];if(t){R.duration=parseFloat(t);const title=(" "+v[2]).slice(1);R.title=title||null,R.tagList.push(title?["INF",t,title]:["INF",t])}else if(v[3]){if(r(R.duration)){R.playlistOffset=_,R.setStart(_),y&&ii(R,y,h),R.sn=k,R.level=n,R.cc=A,f.push(R);const t=(" "+v[3]).slice(1);R.relurl=dn(h,t),ei(R,I,m),I=R,_+=R.duration,k++,S=0,x=!0}}
vendor: 1,027 bytes, line 2
2else{if(v=v[0].match(qn),!v){M.warn("No matches on slow regex match for level playlist!");continue}for(i=1;i<v.length&&void 0===v[i];i++);const t=(" "+v[i]).slice(1),l=(" "+v[i+1]).slice(1),d=v[i+2]?(" "+v[i+2]).slice(1):null;switch(t){case"BYTERANGE":I?R.setByteRange(l,I):R.setByteRange(l);break;case"PROGRAM-DATE-TIME":R.rawProgramDateTime=l,R.tagList.push(["PROGRAM-DATE-TIME",l]),-1===L&&(L=f.length);break;case"PLAYLIST-TYPE":h.type&&ri(h,t,v),h.type=l.toUpperCase();break;case"MEDIA-SEQUENCE":0!==h.startSN?ri(h,t,v):f.length>0&&si(h,t,v),k=h.startSN=parseInt(l);break;case"SKIP":{h.skippedSegments&&ri(h,t,v);const e=new gn(l,h),n=e.decimalInteger("SKIPPED-SEGMENTS");if(r(n)){h.skippedSegments+=n;for(let t=n;t--;)f.push(null);k+=n}const o=e.enumeratedString("RECENTLY-REMOVED-DATERANGES");o&&(h.recentlyRemovedDateranges=(h.recentlyRemovedDateranges||[]).concat(o.split("\t")));break}case"TARGETDURATION":0!==h.targetduration&&ri(h,t,v),h.targetduration=Math.max(parseInt(l),1);break;case"VERSION":null!==h.version&&r
vendor: 2,918 bytes, line 2
2i(h,t,v),h.version=parseInt(l);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":h.live||ri(h,t,v),h.live=!1;break;case"#":(l||d)&&R.tagList.push(d?[l,d]:[l]);break;case"DISCONTINUITY":A++,R.tagList.push(["DIS"]);break;case"GAP":R.gap=!0,R.tagList.push([t]);break;case"BITRATE":R.tagList.push([t,l]),w=1e3*parseInt(l),r(w)?R.bitrate=w:w=0;break;case"DATERANGE":{const t=new gn(l,h),e=new yn(t,h.dateRanges[t.ID],h.dateRangeTagCount);h.dateRangeTagCount++,e.isValid||h.skippedSegments?h.dateRanges[e.id]=e:M.warn(`Ignoring invalid DATERANGE tag: "${l}"`),R.tagList.push(["EXT-X-DATERANGE",l]);break}case"DEFINE":{const t=new gn(l,h);"IMPORT"in t?fn(h,t,c):hn(h,t,e)}break;case"DISCONTINUITY-SEQUENCE":0!==h.startCC?ri(h,t,v):f.length>0&&si(h,t,v),h.startCC=A=parseInt(l);break;case"KEY":{const t=Xn(l,e,h);if(t.isSupported()){if("NONE"===t.method){y=void 0;break}y||(y={});const e=y[t.keyFormat];null!=e&&e.matches(t)||(e&&(y=O({},y)),y[t.keyFormat]=t)}else M.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${l}"`);break}case"START":h.startTimeOffset=Zn(l);break;case"MAP":{const t=new gn(l,h);if(R.duration){const e=new Z(o,base);ni(e,t,n,y),T=e,R.initSegment=T,T.rawProgramDateTime&&!R.rawProgramDateTime&&(R.rawProgramDateTime=T.rawProgramDateTime)}else{const e=R.byteRangeEndOffset;if(e){const t=R.byteRangeStartOffset;D=`${e-t}@${t}`}else D=null;ni(R,t,n,y),T=R,x=!0}T.cc=A;break}case"SERVER-CONTROL":E&&ri(h,t,v),E=new gn(l),h.canBlockReload=E.bool("CAN-BLOCK-RELOAD"),h.canSkipUntil=E.optionalFloat("CAN-SKIP-UNTIL",0),h.canSkipDateRanges=h.canSkipUntil>0&&E.bool("CAN-SKIP-DATERANGES"),h.partHoldBack=E.optionalFloat("PART-HOLD-BACK",0),h.holdBack=E.optionalFloat("HOLD-BACK",0);break;case"PART-INF":{h.partTarget&&ri(h,t,v);const e=new gn(l);h.partTarget=e.decimalFloatingPoint("PART-TARGET");break}case"PART":{let t=h.partList;t||(t=h.partList=[]);const e=S>0?t[t.length-1]:void 0,n=S++,r=new gn(l,h),o=new J(r,R,base,n,e);t.push(o),R.duration+=o.duration;break}case"PRELOAD-HINT":{const t=new gn(l,h);h.preloadHint=t;break}case"RENDITION-REPORT":{const t=new gn(l,h);h.renditionReports=h.renditionReports||[],h.renditionReports.push(t);break}default:M.warn(`line parsed but not handled: ${v}`)}}}I&&!I.relurl?(f.pop(),_-=I.duration,h.partList&&(h.fragmentHint=I)):h.partList&&(ei(R,I,m),R.cc=A,h.fragmentHint=R,y&&ii(R,y,h)),h.targetduration||(h.playlistParsingError=new Error("Missing Target Duration"));const C=f.length,P=f[0],j=f[C-1];if(_+=h.skippedSegments*h.targetduration,_>0&&C&&j){h.averagetargetduration=_/C;const t=j.sn;h.endSN="initSegment"!==t?t:0,h.live||(j.endList=!0),L>0&&(!function(t,e){let n=t[e];for(let i=e;i--;){const e=t[i];if(!e)return;e.programDateTime=n.programDateTime-1e3*e.duration,n=e}}(f,L),P&&m.unshift(P))}return h.fragmentHint&&(_+=h.fragmentHint.duration),h.totalduration=_,m.length&&h.dateRangeTagCount&&P&&zn(m,h),h.endCC=A,h}}function zn(t,details){let e=t.length;
vendor: 4,389 bytes, line 2
2if(!e){if(!details.hasProgramDateTime)return;{const n=details.fragments[details.fragments.length-1];t.push(n),e++}}const n=t[e-1],r=details.live?1/0:details.totalduration,o=Object.keys(details.dateRanges);for(let i=o.length;i--;){const c=details.dateRanges[o[i]],d=c.startDate.getTime();c.tagAnchor=n.ref;for(let n=e;n--;){var l;if((null==(l=t[n])?void 0:l.sn)<details.startSN)break;const e=Qn(details,d,t,n,r);if(-1!==e){c.tagAnchor=details.fragments[e].ref;break}}}}function Qn(details,t,e,n,r){const o=e[n];if(o){const c=o.programDateTime;if(t>=c||0===n){var l;if(t<=c+1e3*(((null==(l=e[n+1])?void 0:l.start)||r)-o.start)){const r=e[n].sn-details.startSN;if(r<0)return-1;const o=details.fragments;if(o.length>e.length){for(let i=(e[n+1]||o[o.length-1]).sn-details.startSN;i>r;i--){const e=o[i].programDateTime;if(t>=e&&t<e+1e3*o[i].duration)return i}}return r}}}return-1}function Xn(t,e,n){var r,o;const l=new gn(t,n),c=null!=(r=l.METHOD)?r:"",d=l.URI,h=l.hexadecimalInteger("IV"),f=l.KEYFORMATVERSIONS,m=null!=(o=l.KEYFORMAT)?o:"identity";d&&l.IV&&!h&&M.error(`Invalid IV: ${l.IV}`);const v=d?Yn.resolve(d,e):"",y=(f||"1").split("/").map(Number).filter(Number.isFinite);return new $n(c,v,m,y,h,l.KEYID)}function Zn(t){const e=new gn(t).decimalFloatingPoint("TIME-OFFSET");return r(e)?e:null}function Jn(t,e){let n=(t||"").split(/[ ,]+/).filter((t=>t));["video","audio","text"].forEach((t=>{const r=n.filter((e=>xt(e,t)));r.length&&(e[`${t}Codec`]=r.map((t=>t.split("/")[0])).join(","),n=n.filter((t=>-1===r.indexOf(t))))})),e.unknownCodecs=n}function ti(t,e,n){const r=e[n];r&&(t[n]=r)}function ei(t,e,n){t.rawProgramDateTime?n.push(t):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime)}function ni(t,e,n,r){t.relurl=e.URI,e.BYTERANGE&&t.setByteRange(e.BYTERANGE),t.level=n,t.sn="initSegment",r&&(t.levelkeys=r),t.initSegment=null}function ii(t,e,n){t.levelkeys=e;const{encryptedFragments:r}=n;r.length&&r[r.length-1].levelkeys===e||!Object.keys(e).some((t=>e[t].isCommonEncryption))||r.push(t)}function ri(t,e,n){t.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${n[0]})`)}function si(t,e,n){t.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${n[0]})`)}function ai(t,e){const n=e.startPTS;if(r(n)){let r,o=0;e.sn>t.sn?(o=n-t.start,r=t):(o=t.start-n,r=e),r.duration!==o&&r.setDuration(o)}else if(e.sn>t.sn){t.cc===e.cc&&t.minEndPTS?e.setStart(t.start+(t.minEndPTS-t.start)):e.setStart(t.start+t.duration)}else e.setStart(Math.max(t.start-e.duration,0))}function oi(details,t,e,n,o,l,c){n-e<=0&&(c.warn("Fragment should have a positive duration",t),n=e+t.duration,l=o+t.duration);let d=e,h=n;const f=t.startPTS,m=t.endPTS;if(r(f)){const v=Math.abs(f-e);details&&v>details.totalduration?c.warn(`media timestamps and playlist times differ by ${v}s for level ${t.level} ${details.url}`):r(t.deltaPTS)?t.deltaPTS=Math.max(v,t.deltaPTS):t.deltaPTS=v,d=Math.max(e,f),e=Math.min(e,f),o=void 0!==t.startDTS?Math.min(o,t.startDTS):o,h=Math.min(n,m),n=Math.max(n,m),l=void 0!==t.endDTS?Math.max(l,t.endDTS):l}const v=e-t.start;0!==t.start&&t.setStart(e),t.setDuration(n-t.start),t.startPTS=e,t.maxStartPTS=d,t.startDTS=o,t.endPTS=n,t.minEndPTS=h,t.endDTS=l;const y=t.sn;if(!details||y<details.startSN||y>details.endSN)return 0;let i;const E=y-details.startSN,T=details.fragments;for(T[E]=t,i=E;i>0;i--)ai(T[i],T[i-1]);for(i=E;i<T.length-1;i++)ai(T[i],T[i+1]);return details.fragmentHint&&ai(T[T.length-1],details.fragmentHint),details.PTSKnown=details.alignedSliding=!0,v}function ci(t,e,n){if(t===e)return;let o=null;const l=t.fragments;for(let i=l.length-1;i>=0;i--){const t=l[i].initSegment;if(t){o=t;break}}let c;t.fragmentHint&&delete t.fragmentHint.endPTS,function(t,e,n){const r=e.skippedSegments,o=Math.max(t.startSN,e.startSN)-e.startSN,l=(t.fragmentHint?1:0)+(r?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,c=e.startSN-t.startSN,d=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,h=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;for(let i=o;i<=l;i++){const o=h[c+i];let l=d[i];if(r&&!l&&o&&(l=e.fragments[i]=o),o&&l){n(o,l,i,d);const r=o.relurl,c=l.relurl;if(r&&yi(r,c))return void(e.playlistParsingError=ui(`media sequence mismatch ${l.sn}:`,t,e,o,l));if(o.cc!==l.cc)return void(e.playlistParsingError=ui(`discontinuity sequence mismatch (${o.cc}!=${l.cc})`,t,e,o,l))}}}
vendor: 4,528 bytes, line 2
2(t,e,((t,n,l,d)=>{if((!e.startCC||e.skippedSegments)&&n.cc!==t.cc){const r=t.cc-n.cc;for(let i=l;i<d.length;i++)d[i].cc+=r;e.endCC=d[d.length-1].cc}r(t.startPTS)&&r(t.endPTS)&&(n.setStart(n.startPTS=t.startPTS),n.startDTS=t.startDTS,n.maxStartPTS=t.maxStartPTS,n.endPTS=t.endPTS,n.endDTS=t.endDTS,n.minEndPTS=t.minEndPTS,n.setDuration(t.endPTS-t.startPTS),n.duration&&(c=n),e.PTSKnown=e.alignedSliding=!0),t.hasStreams&&(n.elementaryStreams=t.elementaryStreams),n.loader=t.loader,t.hasStats&&(n.stats=t.stats),t.initSegment&&(n.initSegment=t.initSegment,o=t.initSegment)}));const d=e.fragments,h=e.fragmentHint?d.concat(e.fragmentHint):d;if(o&&h.forEach((t=>{var e;!t||t.initSegment&&t.initSegment.relurl!==(null==(e=o)?void 0:e.relurl)||(t.initSegment=o)})),e.skippedSegments){if(e.deltaUpdateFailed=d.some((t=>!t)),e.deltaUpdateFailed){n.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let i=e.skippedSegments;i--;)d.shift();e.startSN=d[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=function(t,e,n){const{dateRanges:r,recentlyRemovedDateranges:o}=e,l=O({},t);o&&o.forEach((t=>{delete l[t]}));const c=Object.keys(l).length;if(!c)return r;return Object.keys(r).forEach((t=>{const e=l[t],o=new yn(r[t].attr,e);o.isValid?(l[t]=o,e||(o.tagOrder+=c)):n.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${le(r[t].attr)}"`)})),l}(t.dateRanges,e,n));const r=t.fragments.filter((t=>t.rawProgramDateTime));if(t.hasProgramDateTime&&!e.hasProgramDateTime)for(let i=1;i<h.length;i++)null===h[i].programDateTime&&ei(h[i],h[i-1],r);zn(r,e)}e.endCC=d[d.length-1].cc}if(!e.startCC){var f;const n=pi(t,e.startSN-1);e.startCC=null!=(f=null==n?void 0:n.cc)?f:d[0].cc}!function(t,e,n){if(t&&e){let r=0;for(let i=0,o=t.length;i<=o;i++){const o=t[i],l=e[i+r];o&&l&&o.index===l.index&&o.fragment.sn===l.fragment.sn?n(o,l):r--}}}(t.partList,e.partList,((t,e)=>{e.elementaryStreams=t.elementaryStreams,e.stats=t.stats})),c?oi(e,c,c.startPTS,c.endPTS,c.startDTS,c.endDTS,n):di(t,e),d.length&&(e.totalduration=e.edge-d[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;const m=e.advancedDateTime;if(e.advanced&&m){const t=e.edge;e.driftStart||(e.driftStartTime=m,e.driftStart=t),e.driftEndTime=m,e.driftEnd=t}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime;-1===e.requestScheduled&&(e.requestScheduled=t.requestScheduled)}function ui(t,e,n,r,o){return new Error(`${t} ${o.url}\nPlaylist starting @${e.startSN}\n${e.m3u8}\n\nPlaylist starting @${n.startSN}\n${n.m3u8}`)}function di(t,e,n=!0){const r=e.startSN+e.skippedSegments-t.startSN,o=t.fragments,l=r>=0;let c=0;if(l&&r<o.length)c=o[r].start;else if(l&&e.startSN===t.endSN+1)c=t.fragmentEnd;else if(l&&n)c=t.fragmentStart+r*e.levelTargetDuration;else{if(e.skippedSegments||0!==e.fragmentStart)return;c=t.fragmentStart}hi(e,c)}function hi(details,t){if(t){const e=details.fragments;for(let i=details.skippedSegments;i<e.length;i++)e[i].addStart(t);details.fragmentHint&&details.fragmentHint.addStart(t)}}function fi(t,e=1/0){let n=1e3*t.targetduration;if(t.updated){const r=t.fragments,o=4;if(r.length&&n*o>e){const t=1e3*r[r.length-1].duration;t<n&&(n=t)}}else n/=2;return Math.round(n)}function pi(details,t,e){if(!details)return null;let n=details.fragments[t-details.startSN];return n||(n=details.fragmentHint,n&&n.sn===t?n:t<details.startSN&&e&&e.sn===t?e:null)}function mi(details,t,e){return details?gi(details.partList,t,e):null}function gi(t,e,n){if(t)for(let i=t.length;i--;){const r=t[i];if(r.index===n&&r.fragment.sn===e)return r}return null}function vi(t){t.forEach(((t,e)=>{var n;null==(n=t.details)||n.fragments.forEach((t=>{t.level=e,t.initSegment&&(t.initSegment.level=e)}))}))}function yi(t,e){return!(t===e||!e)&&bi(t)!==bi(e)}function bi(t){return t.replace(/\?[^?]*$/,"")}function Ei(t,e){for(let i=0,r=t.length;i<r;i++){var n;if((null==(n=t[i])?void 0:n.cc)===e)return t[i]}return null}function Ti(t,e){const n=t.start+e;t.startPTS=n,t.setStart(n),t.endPTS=n+t.duration}function ki(t,details){const e=details.fragments;for(let i=0,n=e.length;i<n;i++)Ti(e[i],t);details.fragmentHint&&Ti(details.fragmentHint,t),details.alignedSliding=!0}function Si(details,t){if(!function(t,details){return!!(t&&details.startCC<t.endCC&&details.endCC>t.startCC)}(t,details))return;const e=Math.min(t.endCC,details.endCC),n=Ei(t.fragments,e),r=Ei(details.fragments,e);if(!n||!r)return;M.log(`Aligning playlist at start of dicontinuity sequence ${e}`);ki(n.start-r.start,details)}
vendor: 4,625 bytes, line 2
2function _i(details,t){if(!details.hasProgramDateTime||!t.hasProgramDateTime)return;const e=details.fragments,n=t.fragments;if(!e.length||!n.length)return;let r,o;const l=Math.min(t.endCC,details.endCC);t.startCC<l&&details.startCC<l&&(r=Ei(n,l),o=Ei(e,l)),r&&o||(r=n[Math.floor(n.length/2)],o=Ei(e,r.cc)||e[Math.floor(e.length/2)]);const c=r.programDateTime,d=o.programDateTime;if(!c||!d)return;ki((d-c)/1e3-(o.start-r.start),details)}function Ai(t,e,n){Oi(t,e,n),t.addEventListener(e,n)}function Oi(t,e,n){t.removeEventListener(e,n)}const wi=function(t){let e="";const n=t.length;for(let i=0;i<n;i++)e+=`[${t.start(i).toFixed(3)}-${t.end(i).toFixed(3)}]`;return e},Ii="STOPPED",Ri="IDLE",Li="KEY_LOADING",xi="FRAG_LOADING",Di="FRAG_LOADING_WAITING_RETRY",Ci="WAITING_TRACK",Pi="PARSING",Mi="PARSED",ji="ENDED",Fi="ERROR",Ni="WAITING_INIT_PTS",Ui="WAITING_LEVEL";class Bi extends sn{constructor(t,e,n,o,l){super(o,t.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Ii,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:t,fragCurrent:e,media:n,mediaBuffer:o,state:l}=this,c=n?n.currentTime:0,d=ln.bufferInfo(o||n,c,t.maxBufferHole),h=!d.len;if(this.log(`Media seeking to ${r(c)?c.toFixed(3):c}, state: ${l}, ${h?"out of":"in"} buffer`),this.state===ji)this.resetLoadingState();else if(e){const n=t.maxFragLookUpTolerance,r=e.start-n,o=e.start+e.duration+n;if(h||o<d.start||r>d.end){const t=c>o;(c<r||t)&&(t&&e.loader&&(this.log(`Cancelling fragment load for seek (sn: ${e.sn})`),e.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(n){this.fragmentTracker.removeFragmentsInRange(c,1/0,this.playlistType,!0);if(c>this.lastCurrentTime&&(this.lastCurrentTime=c),!this.loadingParts){const t=Math.max(d.end,c),e=this.shouldLoadParts(this.getLevelDetails(),t);e&&(this.log(`LL-Part loading ON after seeking to ${c.toFixed(2)} with buffer @${t.toFixed(2)}`),this.loadingParts=e)}}this.hls.hasEnoughToStart||(this.log(`Setting ${h?"startPosition":"nextLoadPosition"} to ${c} for seek without enough to start`),this.nextLoadPosition=c,h&&(this.startPosition=c)),h&&this.state===Ri&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=l,this.hls=t,this.fragmentLoader=new tn(t.config),this.keyLoader=n,this.fragmentTracker=e,this.config=t.config,this.decrypter=new Ze(t.config)}registerListeners(){const{hls:t}=this;t.on(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(h.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(h.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(t){}stopLoad(){if(this.state===Ii)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const t=this.fragCurrent;null!=t&&t.loader&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Ii}get startPositionValue(){const{nextLoadPosition:t,startPosition:e}=this;return-1===e&&t?t:e}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(t,e){if(e.live||!this.media)return!1;const n=t.end||0,r=this.config.timelineOffset||0;if(n<=r)return!1;const o=t.buffered;this.config.maxBufferHole&&o&&o.length>1&&(t=ln.bufferedInfo(o,t.start,0));const l=t.nextStart;if(l&&l>r&&l<e.edge)return!1;if(this.media.currentTime<t.start)return!1;const c=e.partList;if(null!=c&&c.length){const t=c[c.length-1];return ln.isBuffered(this.media,t.start+t.duration/2)}const d=e.fragments[e.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(d)}
vendor: 10,782 bytes, line 2
2getLevelDetails(){if(this.levels&&null!==this.levelLastLoaded)return this.levelLastLoaded.details}get timelineOffset(){const t=this.config.timelineOffset;var e;return t?(null==(e=this.getLevelDetails())?void 0:e.appliedTimelineOffset)||t:0}onMediaAttached(t,data){const e=this.media=this.mediaBuffer=data.media;Ai(e,"seeking",this.onMediaSeeking),Ai(e,"ended",this.onMediaEnded);const n=this.config;this.levels&&n.autoStartLoad&&this.state===Ii&&this.startLoad(n.startPosition)}onMediaDetaching(t,data){const e=!!data.transferMedia,n=this.media;if(null!==n){if(n.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),Oi(n,"seeking",this.onMediaSeeking),Oi(n,"ended",this.onMediaEnded),this.keyLoader&&!e&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,e)return this.resetLoadingState(),void this.resetTransmuxer();this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(t,data){}onManifestLoaded(t,data){this.startTimeOffset=data.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=Ii,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(t,e,n){this.startFragRequested=!0,this._loadFragForPlayback(t,e,n)}_loadFragForPlayback(t,e,n){this._doFragLoad(t,e,n,(data=>{const t=data.frag;if(this.fragContextChanged(t))return this.warn(`${t.type} sn: ${t.sn}${data.part?" part: "+data.part.index:""} of ${this.fragInfo(t,!1,data.part)}) was dropped during download.`),void this.fragmentTracker.removeFragment(t);t.stats.chunkCount++,this._handleFragmentLoadProgress(data)})).then((data=>{if(!data)return;const t=this.state,e=data.frag;this.fragContextChanged(e)?(t===xi||!this.fragCurrent&&t===Pi)&&(this.fragmentTracker.removeFragment(e),this.state=Ri):("payload"in data&&(this.log(`Loaded ${e.type} sn: ${e.sn} of ${this.playlistLabel()} ${e.level}`),this.hls.trigger(h.FRAG_LOADED,data)),this._handleFragmentLoadComplete(data))})).catch((e=>{this.state!==Ii&&this.state!==Fi&&(this.warn(`Frag error: ${(null==e?void 0:e.message)||e}`),this.resetFragmentLoading(t))}))}clearTrackerIfNeeded(t){var e;const{fragmentTracker:n}=this;if(n.getState(t)===Be){const e=t.type,r=this.getFwdBufferInfo(this.mediaBuffer,e),o=Math.max(t.duration,r?r.len:this.config.maxBufferLength),l=this.backtrackFragment;(1===(l?t.sn-l.sn:0)||this.reduceMaxBufferLength(o,t.duration))&&n.removeFragment(t)}else 0===(null==(e=this.mediaBuffer)?void 0:e.buffered.length)?n.removeAllFragments():n.hasParts(t.type)&&(n.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type}),n.getState(t)===$e&&n.removeFragment(t))}checkLiveUpdate(details){if(details.updated&&!details.live){const t=details.fragments[details.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}details.fragments[0]||(details.deltaUpdateFailed=!0)}waitForLive(t){const details=t.details;return(null==details?void 0:details.live)&&"EVENT"!==details.type&&(this.levelLastLoaded!==t||details.expired)}flushMainBuffer(t,e,n=null){if(!(t-e))return;const r={startOffset:t,endOffset:e,type:n};this.hls.trigger(h.BUFFER_FLUSHING,r)}_loadInitSegment(t,e){this._doFragLoad(t,e).then((data=>{const t=null==data?void 0:data.frag;if(!t||this.fragContextChanged(t)||!this.levels)throw new Error("init load aborted");return data})).then((data=>{const{hls:t}=this,{frag:e,payload:n}=data,r=e.decryptdata;if(n&&n.byteLength>0&&null!=r&&r.key&&r.iv&&kn(r.method)){const o=self.performance.now();return this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer,Sn(r.method)).catch((n=>{throw t.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.FRAG_DECRYPT_ERROR,fatal:!1,error:n,reason:n.message,frag:e}),n})).then((n=>{const r=self.performance.now();return t.trigger(h.FRAG_DECRYPTED,{frag:e,payload:n,stats:{tstart:o,tdecrypt:r}}),data.payload=n,this.completeInitSegmentLoad(data)}))}return this.completeInitSegmentLoad(data)})).catch((e=>{this.state!==Ii&&this.state!==Fi&&(this.warn(e),this.resetFragmentLoading(t))}))}completeInitSegmentLoad(data){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const e=data.frag.stats;this.state!==Ii&&(this.state=Ri),data.frag.data=new Uint8Array(data.payload),e.parsing.start=e.buffering.start=self.performance.now(),e.parsing.end=e.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(t,e){var n,r;const o=t.tracks;if(o&&!e.encrypted&&(null!=(n=o.audio)&&n.encrypted||null!=(r=o.video)&&r.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const t=this.media,n=new Error(`Encrypted track with no key in ${this.fragInfo(e)} (media ${t?"attached mediaKeys: "+t.mediaKeys:"detached"})`);return this.warn(n.message),!t||t.mediaKeys?!1:(this.hls.trigger(h.ERROR,{type:c.KEY_SYSTEM_ERROR,details:d.KEY_SYSTEM_NO_KEYS,fatal:!1,error:n,frag:e}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(t){const{fragCurrent:e}=this;return!t||!e||t.sn!==e.sn||t.level!==e.level}fragBufferedComplete(t,e){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${t.type} sn: ${t.sn}${e?" part: "+e.index:""} of ${this.fragInfo(t,!1,e)} > buffer:${n?wi(ln.getBuffered(n)):"(detached)"})`),X(t)){var r;if(t.type!==k){const e=t.elementaryStreams;if(!Object.keys(e).some((t=>!!e[t])))return void(this.state=Ri)}const e=null==(r=this.levels)?void 0:r[t.level];null!=e&&e.fragmentError&&(this.log(`Resetting level fragment error count of ${e.fragmentError} on frag buffered`),e.fragmentError=0)}this.state=Ri}_handleFragmentLoadComplete(t){const{transmuxer:e}=this;if(!e)return;const{frag:n,part:r,partsLoaded:o}=t,l=!o||0===o.length||o.some((t=>!t)),c=new an(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!l);e.flush(c)}_handleFragmentLoadProgress(t){}_doFragLoad(t,e,n=null,o){var l;this.fragCurrent=t;const details=e.details;if(!this.levels||!details)throw new Error(`frag load aborted, missing level${details?"":" detail"}s`);let c=null;if(!t.encrypted||null!=(l=t.decryptdata)&&l.key)t.encrypted||(c=this.keyLoader.loadClear(t,details.encryptedFragments,this.startFragRequested),c&&this.log("[eme] blocking frag load until media-keys acquired"));else if(this.log(`Loading key for ${t.sn} of [${details.startSN}-${details.endSN}], ${this.playlistLabel()} ${t.level}`),this.state=Li,this.fragCurrent=t,c=this.keyLoader.load(t).then((t=>{if(!this.fragContextChanged(t.frag))return this.hls.trigger(h.KEY_LOADED,t),this.state===Li&&(this.state=Ri),t})),this.hls.trigger(h.KEY_LOADING,{frag:t}),null===this.fragCurrent)return this.log("context changed in KEY_LOADING"),Promise.resolve(null);const d=this.fragPrevious;if(X(t)&&(!d||t.sn!==d.sn)){const n=this.shouldLoadParts(e.details,t.end);n!==this.loadingParts&&(this.log(`LL-Part loading ${n?"ON":"OFF"} loading sn ${null==d?void 0:d.sn}->${t.sn}`),this.loadingParts=n)}if(n=Math.max(t.start,n||0),this.loadingParts&&X(t)){const r=details.partList;if(r&&o){n>details.fragmentEnd&&details.fragmentHint&&(t=details.fragmentHint);const l=this.getNextPart(r,t,n);if(l>-1){const d=r[l];let f;return t=this.fragCurrent=d.fragment,this.log(`Loading ${t.type} sn: ${t.sn} part: ${d.index} (${l}/${r.length-1}) of ${this.fragInfo(t,!1,d)}) cc: ${t.cc} [${details.startSN}-${details.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=d.start+d.duration,this.state=xi,f=c?c.then((n=>!n||this.fragContextChanged(n.frag)?null:this.doFragPartsLoad(t,d,e,o))).catch((t=>this.handleFragLoadError(t))):this.doFragPartsLoad(t,d,e,o).catch((t=>this.handleFragLoadError(t))),this.hls.trigger(h.FRAG_LOADING,{frag:t,part:d,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):f}if(!t.url||this.loadedEndOfParts(r,n))return Promise.resolve(null)}}var f;if(X(t)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)} Check buffer at sn: ${t.sn} loaded parts: ${null==(f=details.partList)?void 0:f.filter((p=>p.loaded)).map((p=>`[${p.start}-${p.end}]`))}`),this.loadingParts=!1;else if(!t.url)return Promise.resolve(null);this.log(`Loading ${t.type} sn: ${t.sn} of ${this.fragInfo(t,!1)}) cc: ${t.cc} ${"["+details.startSN+"-"+details.endSN+"]"}, target: ${parseFloat(n.toFixed(3))}`),r(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=xi;const m=this.config.progressive&&t.type!==k;let v;return v=m&&c?c.then((e=>!e||this.fragContextChanged(e.frag)?null:this.fragmentLoader.load(t,o))).catch((t=>this.handleFragLoadError(t))):Promise.all([this.fragmentLoader.load(t,m?o:void 0),c]).then((([t])=>(!m&&o&&o(t),t))).catch((t=>this.handleFragLoadError(t))),this.hls.trigger(h.FRAG_LOADING,{frag:t,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):v}doFragPartsLoad(t,e,n,r){return new Promise(((o,l)=>{var c;const d=[],f=null==(c=n.details)?void 0:c.partList,m=e=>{this.fragmentLoader.loadPart(t,e,r).then((r=>{d[e.index]=r;const l=r.part;this.hls.trigger(h.FRAG_LOADED,r);const c=mi(n.details,t.sn,e.index+1)||gi(f,t.sn,e.index+1);if(!c)return o({frag:t,part:l,partsLoaded:d});m(c)})).catch(l)};m(e)}))}handleFragLoadError(t){if("data"in t){const data=t.data;data.frag&&data.details===d.INTERNAL_ABORTED?this.handleFragLoadAborted(data.frag,data.part):data.frag&&data.type===c.KEY_SYSTEM_ERROR?(data.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(data.frag)):this.hls.trigger(h.ERROR,data)}else this.hls.trigger(h.ERROR,{type:c.OTHER_ERROR,details:d.INTERNAL_EXCEPTION,err:t,error:t,fatal:!0});return null}_handleTransmuxerFlush(t){const e=this.getCurrentContext(t);if(!e||this.state!==Pi)return void(this.fragCurrent||this.state===Ii||this.state===Fi||(this.state=Ri));const{frag:n,part:r,level:o}=e,l=self.performance.now();n.stats.parsing.end=l,r&&(r.stats.parsing.end=l);const c=this.getLevelDetails(),d=c&&n.sn>c.endSN||this.shouldLoadParts(c,n.end);d!==this.loadingParts&&(this.log(`LL-Part loading ${d?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=d),this.updateLevelTiming(n,r,o,t.partial)}shouldLoadParts(details,t){if(this.config.lowLatencyMode){if(!detail
vendor: 5,592 bytes, line 2
2s)return this.loadingParts;if(details.partList){var e;const r=details.partList[0];if(r.fragment.type===k)return!1;if(t>=r.end+((null==(e=details.fragmentHint)?void 0:e.duration)||0)){var n;if((this.hls.hasEnoughToStart?(null==(n=this.media)?void 0:n.currentTime)||this.lastCurrentTime:this.getLoadPosition())>r.start-r.fragment.duration)return!0}}}return!1}getCurrentContext(t){const{levels:e,fragCurrent:n}=this,{level:r,sn:o,part:l}=t;if(null==e||!e[r])return this.warn(`Levels object was unset while buffering fragment ${o} of ${this.playlistLabel()} ${r}. The current chunk will not be buffered.`),null;const c=e[r],d=c.details,h=l>-1?mi(d,o,l):null,f=h?h.fragment:pi(d,o,n);return f?(n&&n!==f&&(f.stats=n.stats),{frag:f,part:h,level:c}):null}bufferFragmentData(data,t,e,n,r){if(this.state!==Pi)return;const{data1:o,data2:l}=data;let c=o;if(l&&(c=Tt(o,l)),!c.length)return;const d=this.initPTS[t.cc],f=d?-d.baseTime/d.timescale:void 0,m={type:data.type,frag:t,part:e,chunkMeta:n,offset:f,parent:t.type,data:c};if(this.hls.trigger(h.BUFFER_APPENDING,m),data.dropped&&data.independent&&!e){if(r)return;this.flushBufferGap(t)}}flushBufferGap(t){const e=this.media;if(!e)return;if(!ln.isBuffered(e,e.currentTime))return void this.flushMainBuffer(0,t.start);const n=e.currentTime,r=ln.bufferInfo(e,n,0),o=t.duration,l=Math.min(2*this.config.maxFragLookUpTolerance,.25*o),c=Math.max(Math.min(t.start-l,r.end-l),n+l);t.start-c>l&&this.flushMainBuffer(c,t.start)}getFwdBufferInfo(t,e){var n;const o=this.getLoadPosition();if(!r(o))return null;const l=this.lastCurrentTime>o||null!=(n=this.media)&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(t,o,e,l)}getFwdBufferInfoAtPos(t,e,n,r){const o=ln.bufferInfo(t,e,r);if(0===o.len&&void 0!==o.nextStart){const l=this.fragmentTracker.getBufferedFrag(e,n);if(l&&(o.nextStart<=l.end||l.gap)){const n=Math.max(Math.min(o.nextStart,l.end)-e,r);return ln.bufferInfo(t,e,n)}}return o}getMaxBufferLength(t){const{config:e}=this;let n;return n=t?Math.max(8*e.maxBufferSize/t,e.maxBufferLength):e.maxBufferLength,Math.min(n,e.maxMaxBufferLength)}exceedsMaxBuffer(t,e,n){const r=t.nextStart;if(r&&n.start>r){const r=t.buffered;if(r){let o=t.len;const l=t.bufferedIndex;for(let i=r.length-1;i>l;i--)r[i].start<n.start&&(o+=r[i].end-r[i].start);return o>=e}}return!1}reduceMaxBufferLength(t,e){const n=this.config,r=Math.max(Math.min(t-e,n.maxBufferLength),e),o=Math.max(t-3*e,n.maxMaxBufferLength/2,r);return o>=r&&(n.maxMaxBufferLength=o,this.warn(`Reduce max buffer length to ${o}s`),!0)}getAppendedFrag(t,e=E){const n=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(t,e):null;return n&&"fragment"in n?n.fragment:n}getNextFragment(t,e){const n=e.fragments,r=n.length;if(!r)return null;const{config:o}=this,l=e.fragmentStart,c=o.lowLatencyMode&&!!e.partList;let d=null;if(e.live){const n=o.initialLiveManifestSize;if(r<n)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${n})`),null;if(!e.PTSKnown&&!this.startFragRequested&&-1===this.startPosition||t<l){var h;c&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),d=this.getInitialLiveFragment(e);const n=this.config.startPosition,r=this.hls.startPosition,o=this.hls.liveSyncPosition,f=(null==(h=d)?void 0:h.start)||0;let m,v;-1!==r&&r>=l?(m=r,v=r===n?"config":"next load start"):null!==o?(m=o,v="live edge"):(m=t,v="buffer pos"),m<f&&(m=f,v="live frag start"),m<l&&(m=l,v="playlist start"),this.startPosition==m&&this.nextLoadPosition==m||(this.log(`Setting startPosition to ${m.toFixed(3)} ${-1===r?"":`(from ${n}) `}based on ${v}. live edge: ${o} live frag start: ${f.toFixed(3)} playlist start: ${l.toFixed(3)} buffer pos: ${t}`),this.startPosition=this.nextLoadPosition=m)}}else t<=l&&(d=n[0]);if(!d){const n=this.loadingParts?e.partEnd:e.fragmentEnd;d=this.getFragmentAtPosition(t,n,e)}let f=this.filterReplacedPrimary(d,e);if(!f&&d){const t=d.sn-e.startSN;f=this.filterReplacedPrimary(n[t+1]||null,e)}return this.mapToInitFragWhenRequired(f)}isLoopLoading(t,e){if(this.nextLoadPosition<=e)return!1;const n=this.fragmentTracker.getState(t);return n===Ve||n===$e&&!!t.gap}getNextFragmentLoopLoading(t,e,n,r,o){let l=null;if(t.gap&&(l=this.getNextFragment(this.nextLoadPosition,e),l&&!l.gap&&n.nextStart)){const t=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,r,0);if(null!==t&&n.len+t.len>=o){const t=l.sn;return this.loopSn!==t&&(this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${t}`),this.loopSn=t),null}}return this.loopSn=void 0,l}get primaryPrefetch(){if($i(this.config)){var t;if(null==(t=this.hls.interstitialsManager)||null==(t=t.playingItem)?void 0:t.event)return!0}return!1}filterReplacedPrimary(t,details){if(!t)return t;if($i(this.config)&&t.type!==k){const e=this.hls.interstitialsManager,n=null==e?void 0:e.bufferingItem;if(n){const e=n.event;if(e){if(e.appendInPlace||Math.abs(t.start-n.start)>1||0===n.start)return null}else{if(t.end<=n.start&&!1===(null==details?void 0:details.live))return null;if(t.start>n.end&&n.nextEvent&&(n.nextEvent.appendInPlace||t.start-n.end>1))return null}}const r=null==e?void 0:e.playerQueue;if(r)for(let i=r.length;i--;){const e=r[i].interstitial;if(e.appendInPlace&&t.start>=e.startTime&&t.end<=e.resumeTime)return null}}return t}mapToInitFragWhenRequired(t){return null==t||!t.initSegment||t.initSegment.data||this.bitrateTest?t:t.initSegment}getNextPart(t,e,n){let r=-1,o=!1,l=!0;for(let i=0,c=t.length;i<c;i++){const c=t[i];if(l=l&&!c.independent,r>-1&&n<c.start)break;const d=c.loaded;
vendor: 2,922 bytes, line 2
2d?r=-1:(o||(c.independent||l)&&c.fragment===e)&&(c.fragment!==e&&this.warn(`Need buffer at ${n} but next unloaded part starts at ${c.start}`),r=i),o=d}return r}loadedEndOfParts(t,e){let n;for(let i=t.length;i--;){if(n=t[i],!n.loaded)return!1;if(e>n.start)return!0}return!1}getInitialLiveFragment(t){const e=t.fragments,n=this.fragPrevious;let o=null;if(n){if(t.hasProgramDateTime&&(o=function(t,e,n){if(null===e||!Array.isArray(t)||!t.length||!r(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;for(let r=0;r<t.length;++r){const o=t[r];if(Ee(e,n,o))return o}return null}(e,n.endProgramDateTime,this.config.maxFragLookUpTolerance),o&&this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`)),!o){const r=n.sn+1;if(r>=t.startSN&&r<=t.endSN){const l=e[r-t.startSN];n.cc===l.cc&&(o=l,this.log(`Live playlist, switching playlist, load frag with next SN: ${o.sn}`))}o||(o=Te(t,n.cc,n.end),o&&this.log(`Live playlist, switching playlist, load frag with same CC: ${o.sn}`))}}else{const e=this.hls.liveSyncPosition;null!==e&&(o=this.getFragmentAtPosition(e,this.bitrateTest?t.fragmentEnd:t.edge,t))}return o}getFragmentAtPosition(t,e,n){const{config:r}=this;let{fragPrevious:o}=this,{fragments:l,endSN:c}=n;const{fragmentHint:d}=n,{maxFragLookUpTolerance:h}=r,f=n.partList,m=!!(this.loadingParts&&null!=f&&f.length&&d);let v;if(m&&!this.bitrateTest&&f[f.length-1].fragment.sn===d.sn&&(l=l.concat(d),c=d.sn),t<e){var y;v=ye(o,l,t,t<this.lastCurrentTime||t>e-h||null!=(y=this.media)&&y.paused||!this.startFragRequested?0:h)}else v=l[l.length-1];if(v){const t=v.sn-n.startSN,e=this.fragmentTracker.getState(v);if((e===Ve||e===$e&&v.gap)&&(o=v),o&&v.sn===o.sn&&(!m||f[0].fragment.sn>v.sn||!n.live)){if(v.level===o.level){const e=l[t+1];v=v.sn<c&&this.fragmentTracker.getState(e)!==Ve?e:null}}}return v}alignPlaylists(details,t,e){const n=details.fragments.length;if(!n)return this.warn("No fragments in live playlist"),0;const o=details.fragmentStart,l=!t,c=details.alignedSliding&&r(o);if(l||!c&&!o){!function(t,details){t&&(Si(details,t),details.alignedSliding||_i(details,t),details.alignedSliding||details.skippedSegments||di(t,details,!1))}(e,details);const r=details.fragmentStart;return this.log(`Live playlist sliding: ${r.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${details.startSN} fragments: ${n}`),r}return o}waitForCdnTuneIn(details){return details.live&&details.canBlockReload&&details.partTarget&&details.tuneInGoal>Math.max(details.partHoldBack,3*details.partTarget)}setStartPosition(details,t){let e=this.startPosition;e<t&&(e=-1);const n=this.timelineOffset;if(-1===e){const o=null!==this.startTimeOffset,l=o?this.startTimeOffset:details.startTimeOffset;null!==l&&r(l)?(e=t+l,l<0&&(e+=details.edge),e=Math.min(Math.max(t,e),t+details.totalduration),this.log(`Setting startPosition to ${e} for start time offset ${l}
2 found in ${o?"multivariant":"media"} playlist`),this.startPosition=e):details.live?(e=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${e}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=e=0),this.lastCurrentTime=e+n}this.nextLoadPosition=e+n}getLoadPosition(){var t;const{media:e}=this;let n=0;return null!=(t=this.hls)&&t.hasEnoughToStart&&e?n=e.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(t,e){this.transmuxer&&t.type===this.playlistType&&X(t)&&t.stats.aborted&&(this.log(`Fragment ${t.sn}${e?" part "+e.index:""} of ${this.playlistLabel()} ${t.level} was aborted`),this.resetFragmentLoading(t))}resetFragmentLoading(t){this.fragCurrent&&(this.fragContextChanged(t)||this.state===Di)||(this.state=Ri)}onFragmentOrKeyLoadError(t,data){var e;if(data.chunkMeta&&!data.frag){const t=this.getCurrentContext(data.chunkMeta);t&&(data.frag=t.frag)}const n=data.frag;if(!n||n.type!==t||!this.levels)return;var r;if(this.fragContextChanged(n))return void this.warn(`Frag load error must match current frag to retry ${n.url} > ${null==(r=this.fragCurrent)?void 0:r.url}`);const o=data.details===d.FRAG_GAP;o&&this.fragmentTracker.fragBuffered(n,!0);const l=data.errorAction;if(!l)return void(this.state=Fi);const{action:c,flags:h,retryCount:f=0,retryConfig:m}=l,v=!!m,y=v&&c===Ce,E=v&&!l.resolved&&h===Me,T=null==(e=this.hls.latestLevelDetails)?void 0:e.live;if(!y&&E&&X(n)&&!n.endList&&T&&!_e(data))this.resetFragmentErrors(t),this.treatAsGap(n),l.resolved=!0;else if((y||E)&&f<m.maxNumRetry){var k;const e=Re(null==(k=data.response)?void 0:k.code),r=Oe(m,f);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+r,this.state=Di,l.resolved=!0,e)return this.log("Waiting for connection (offline)"),this.retryDate=1/0,void(data.reason="offline");this.warn(`Fragment ${n.sn} of ${t} ${n.level} errored with ${data.details}, retrying loading ${f+1}/${m.maxNumRetry} in ${r}ms`)}else if(m){if(this.resetFragmentErrors(t),!(f<m.maxNumRetry))return void this.warn(`${data.details} reached or exceeded max retry (${f})`);o||c===De||(l.resolved=!0)}else this.state=c===xe?Ui:Fi;this.tickImmediate()}checkRetryDate(){const t=self.performance.now(),e=this.retryDate,n=e===1/0;(!e||t>=e||n&&!Re(0))&&(n&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=Ri)}reduceLengthAndFlushBuffer(data){if(this.state===Pi||this.state===Mi){const t=data.frag,e=data.parent,n=this.getFwdBufferInfo(this.mediaBuffer,e),r=n&&n.len>.5;r&&this.reduceMaxBufferLength(n.len,(null==t?void 0:t.duration)||10);const o=!r;return o&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${e} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),o}return!1}resetFragmentErrors(t){t===T&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==Ii&&(this.state=Ri)}afterBufferFlushed(t,e,n){if(!t)return;const r=ln.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,r,n),this.state===ji&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==Ii&&(this.state=Ri)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=this.levelLastLoaded,details=t?t.details:null;null!=details&&details.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(details,details.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(t){this.log(`Loading context changed while buffering sn ${t.sn} of ${this.playlistLabel()} ${-1===t.level?"<removed>":t.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(t=0){this.fragmentTracker.removeFragmentsInRange(t,1/0,this.playlistType,!1,!0)}updateLevelTiming(t,e,n,r){const details=n.details;
vendor: 5,305 bytes, line 2
2if(!details)return void this.warn("level.details undefined");if(!Object.keys(t.elementaryStreams).reduce(((e,o)=>{const l=t.elementaryStreams[o];if(l){const c=l.endPTS-l.startPTS;if(c<=0)return this.warn(`Could not parse fragment ${t.sn} ${o} duration reliably (${c})`),e||!1;const d=r?0:oi(details,t,l.startPTS,l.endPTS,l.startDTS,l.endDTS,this);return this.hls.trigger(h.LEVEL_PTS_UPDATED,{details:details,level:n,drift:d,type:o,frag:t,start:l.startPTS,end:l.endPTS}),!0}return e}),!1)){var o;const e=null===(null==(o=this.transmuxer)?void 0:o.error);if((0===n.fragmentError||e&&(n.fragmentError<2||t.endList))&&this.treatAsGap(t,n),e){const e=new Error(`Found no media in fragment ${t.sn} of ${this.playlistLabel()} ${t.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(e.message),this.hls.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.FRAG_PARSING_ERROR,fatal:!1,error:e,frag:t,reason:`Found no media in msn ${t.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=Mi,this.log(`Parsed ${t.type} sn: ${t.sn}${e?" part: "+e.index:""} of ${this.fragInfo(t,!1,e)})`),this.hls.trigger(h.FRAG_PARSED,{frag:t,part:e})}playlistLabel(){return this.playlistType===E?"level":"track"}fragInfo(t,e=!0,n){var r,o;return`${this.playlistLabel()} ${t.level} (${n?"part":"frag"}:[${(null!=(r=e&&!n?t.startPTS:(n||t).start)?r:NaN).toFixed(3)}-${(null!=(o=e&&!n?t.endPTS:(n||t).end)?o:NaN).toFixed(3)}]${n&&"main"===t.type?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(t,e){e&&e.fragmentError++,t.gap=!0,this.fragmentTracker.removeFragment(t),this.fragmentTracker.fragBuffered(t,!0)}resetTransmuxer(){var t;null==(t=this.transmuxer)||t.reset()}recoverWorkerError(data){"demuxerWorker"===data.event&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(t){const e=this._state;e!==t&&(this._state=t,this.log(`${e}->${t}`))}get state(){return this._state}}function $i(t){return!!t.interstitialsController&&!1!==t.enableInterstitialPlayback}class Vi{constructor(){this.chunks=[],this.dataLength=0}push(t){this.chunks.push(t),this.dataLength+=t.length}flush(){const{chunks:t,dataLength:e}=this;let n;return t.length?(n=1===t.length?t[0]:function(t,e){const n=new Uint8Array(e);let r=0;for(let i=0;i<t.length;i++){const e=t[i];n.set(e,r),r+=e.length}return n}(t,e),this.reset(),n):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}var Gi,Hi={exports:{}};var Wi=(Gi||(Gi=1,function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function o(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function l(t,e,r,l,c){if("function"!=typeof r)throw new TypeError("The listener must be a function");var d=new o(r,l||t,c),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],d]:t._events[h].push(d):(t._events[h]=d,t._eventsCount++),t}function c(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function d(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),d.prototype.eventNames=function(){var t,r,o=[];if(0===this._eventsCount)return o;for(r in t=this._events)e.call(t,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},d.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,l=new Array(o);i<o;i++)l[i]=r[i].fn;return l},d.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},d.prototype.emit=function(t,e,r,o,l,c){var d=n?n+t:t;if(!this._events[d])return!1;var h,i,f=this._events[d],m=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),m){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,r),!0;case 4:return f.fn.call(f.context,e,r,o),!0;case 5:return f.fn.call(f.context,e,r,o,l),!0;case 6:return f.fn.call(f.context,e,r,o,l,c),!0}for(i=1,h=new Array(m-1);i<m;i++)h[i-1]=arguments[i];f.fn.apply(f.context,h)}else{var v,y=f.length;for(i=0;i<y;i++)switch(f[i].once&&this.removeListener(t,f[i].fn,void 0,!0),m){case 1:f[i].fn.call(f[i].context);break;case 2:f[i].fn.call(f[i].context,e);break;case 3:f[i].fn.call(f[i].context,e,r);break;case 4:f[i].fn.call(f[i].context,e,r,o);break;default:if(!h)for(v=1,h=new Array(m-1);v<m;v++)h[v-1]=arguments[v];f[i].fn.apply(f[i].context,h)}}return!0},d.prototype.on=function(t,e,n){return l(this,t,e,n,!1)},d.prototype.once=function(t,e,n){return l(this,t,e,n,!0)},d.prototype.removeListener=function(t,e,r,o){var l=n?n+t:t;if(!this._events[l])return this;if(!e)return c(this,l),this;var d=this._events[l];if(d.fn)d.fn!==e||o&&!d.once||r&&d.context!==r||c(this,l);else{for(var i=0,h=[],f=d.length;i<f;i++)(d[i].fn!==e||o&&!d[i].once||r&&d[i].context!==r)&&h.push(d[i]);h.length?this._events[l]=1===h.length?h[0]:h:c(this,l)}return this},d.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&c(this,e)):(this._events=new r,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prefixed=n,d.EventEmitter=d,t.exports=d}
vendor: 8,469 bytes, line 2
2(Hi)),Hi.exports),Ki=$(Wi);const qi="1.6.16",Yi={};function zi(data,t){return t+10<=data.length&&51===data[t]&&68===data[t+1]&&73===data[t+2]&&data[t+3]<255&&data[t+4]<255&&data[t+6]<128&&data[t+7]<128&&data[t+8]<128&&data[t+9]<128}function Qi(data,t){return t+10<=data.length&&73===data[t]&&68===data[t+1]&&51===data[t+2]&&data[t+3]<255&&data[t+4]<255&&data[t+6]<128&&data[t+7]<128&&data[t+8]<128&&data[t+9]<128}function Xi(data,t){let e=0;return e=(127&data[t])<<21,e|=(127&data[t+1])<<14,e|=(127&data[t+2])<<7,e|=127&data[t+3],e}function Zi(data,t){const e=t;let n=0;for(;Qi(data,t);){n+=10;n+=Xi(data,t+6),zi(data,t+10)&&(n+=10),t+=n}if(n>0)return data.subarray(e,e+n)}function Ji(data,t){return 255===data[t]&&240==(246&data[t+1])}function er(data,t){return 1&data[t+1]?7:9}function nr(data,t){return(3&data[t+3])<<11|data[t+4]<<3|(224&data[t+5])>>>5}function ir(data,t){return t+1<data.length&&Ji(data,t)}function rr(data,t){if(ir(data,t)){const e=er(data,t);if(t+e>=data.length)return!1;const n=nr(data,t);if(n<=e)return!1;const r=t+n;return r===data.length||ir(data,r)}return!1}function sr(track,t,data,e,n){if(!track.samplerate){const r=function(t,data,e,n){const r=data[e+2],o=r>>2&15;if(o>12){const e=new Error(`invalid ADTS sampling index:${o}`);return void t.emit(h.ERROR,h.ERROR,{type:c.MEDIA_ERROR,details:d.FRAG_PARSING_ERROR,fatal:!0,error:e,reason:e.message})}const l=1+(r>>6&3),f=data[e+3]>>6&3|(1&r)<<2,m="mp4a.40."+l,v=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][o];let y=o;5!==l&&29!==l||(y-=3);const E=[l<<3|(14&y)>>1,(1&y)<<7|f<<3];return M.log(`manifest codec:${n}, parsed codec:${m}, channels:${f}, rate:${v} (ADTS object type:${l} sampling index:${o})`),{config:E,samplerate:v,channelCount:f,codec:m,parsedCodec:m,manifestCodec:n}}(t,data,e,n);if(!r)return;O(track,r)}}function ar(t){return 9216e4/t}function or(track,data,t,e,n){const r=e+n*ar(track.samplerate),header=function(data,t){const e=er(data,t);if(t+e<=data.length){const n=nr(data,t)-e;if(n>0)return{headerLength:e,frameLength:n}}}(data,t);let o;if(header){const{frameLength:e,headerLength:n}=header,l=n+e,c=Math.max(0,t+l-data.length);c?(o=new Uint8Array(l-n),o.set(data.subarray(t+n,data.length),0)):o=data.subarray(t+n,t+l);const d={unit:o,pts:r};return c||track.samples.push(d),{sample:d,length:l,missing:c}}const l=data.length-t;o=new Uint8Array(l),o.set(data.subarray(t,data.length),0);return{sample:{unit:o,pts:r},length:l,missing:-1}}function lr(data,t){return Qi(data,t)&&Xi(data,t+6)+10<=data.length-t}function cr(data,t=0,e=1/0){return function(data,t,e,n){const r=function(view){return view instanceof ArrayBuffer?view:view.buffer}(data);let o=1;"BYTES_PER_ELEMENT"in n&&(o=n.BYTES_PER_ELEMENT);const l=(m=data,m&&m.buffer instanceof ArrayBuffer&&void 0!==m.byteLength&&void 0!==m.byteOffset?data.byteOffset:0),c=(l+data.byteLength)/o,d=(l+t)/o,h=Math.floor(Math.max(0,Math.min(d,c))),f=Math.floor(Math.min(h+Math.max(e,0),c));var m;return new n(r,h,f-h)}(data,t,e,Uint8Array)}function ur(t){const e={key:t.type,description:"",data:"",mimeType:null,pictureType:null};if(t.size<2)return;if(3!==t.data[0])return void console.log("Ignore frame with unrecognized character encoding");const n=t.data.subarray(1).indexOf(0);if(-1===n)return;const r=N(cr(t.data,1,n)),o=t.data[2+n],l=t.data.subarray(3+n).indexOf(0);if(-1===l)return;const c=N(cr(t.data,3+n,l));let data;return data="--\x3e"===r?N(cr(t.data,4+n+l)):function(view){return view instanceof ArrayBuffer?view:0==view.byteOffset&&view.byteLength==view.buffer.byteLength?view.buffer:new Uint8Array(view).buffer}(t.data.subarray(4+n+l)),e.mimeType=r,e.pictureType=o,e.description=c,e.data=data,e}function dr(t){return"PRIV"===t.type?function(t){if(t.size<2)return;const e=N(t.data,!0),n=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:n.buffer}}(t):"W"===t.type[0]?function(t){if("WXXX"===t.type){if(t.size<2)return;let e=1;const n=N(t.data.subarray(e),!0);e+=n.length+1;const r=N(t.data.subarray(e));return{key:t.type,info:n,data:r}}const e=N(t.data);return{key:t.type,info:"",data:e}}(t):"APIC"===t.type?ur(t):function(t){if(t.size<2)return;if("TXXX"===t.type){let e=1;const n=N(t.data.subarray(e),!0);e+=n.length+1;const r=N(t.data.subarray(e));return{key:t.type,info:n,data:r}}const text=N(t.data.subarray(1));return{key:t.type,info:"",data:text}}(t)}function fr(data){const t=String.fromCharCode(data[0],data[1],data[2],data[3]),e=Xi(data,4);return{type:t,size:e,data:data.subarray(10,10+e)}}function pr(t){let e=0;const n=[];for(;Qi(t,e);){const r=Xi(t,e+6);t[e+5]>>6&1&&(e+=10),e+=10;const o=e+r;for(;e+10<o;){const r=fr(t.subarray(e)),o=dr(r);o&&n.push(o),e+=r.size+10}zi(t,e)&&(e+=10)}return n}function mr(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info}function gr(t){if(8===t.data.byteLength){const data=new Uint8Array(t.data),e=1&data[3];let n=(data[4]<<23)+(data[5]<<15)+(data[6]<<7)+data[7];return n/=45,e&&(n+=47721858.84),Math.round(n)}}function vr(data){const t=pr(data);for(let i=0;i<t.length;i++){const e=t[i];if(mr(e))return gr(e)}}let yr=function(t){return t.audioId3="org.id3",t.dateRange="com.apple.quicktime.HLS",t.emsg="https://aomedia.org/emsg/ID3",t.misbklv="urn:misb:KLV:bin:1910.1",t}({});function Er(t="",e=9e4){return{type:t,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Tr{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(t,e,n,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(t){this.initPTS=t,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(data,t){return!1}appendFrame(track,data,t){}demux(data,t){this.cachedData&&(data=Tt(this.cachedData,data),this.cachedData=null);let e,n=Zi(data,0),o=n?n.length:0;const track=this._audioTrack,l=this._id3Track,c=n?vr(n):void 0,d=data.length;for((null===this.basePTS||0===this.frameIndex&&r(c))&&(this.basePTS=kr(c,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),n&&n.length>0&&l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:yr.audioId3,duration:Number.POSITIVE_INFINITY});o<d;){if(this.canParse(data,o)){const t=this.appendFrame(track,data,o);t?(this.frameIndex++,this.lastPTS=t.sample.pts,o+=t.length,e=o):o=d}else lr(data,o)?(n=Zi(data,o),l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:yr.audioId3,duration:Number.POSITIVE_INFINITY}),o+=n.length,e=o):o++;if(o===d&&e!==d){const t=data.slice(e);this.cachedData?this.cachedData=Tt(this.cachedData,t):this.cachedData=t}}return{audioTrack:track,videoTrack:Er(),id3Track:l,textTrack:Er()}}demuxSampleAes(data,t,e){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(t){const e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),{audioTrack:this._audioTrack,videoTrack:Er(),id3Track:this._id3Track,textTrack:Er()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const kr=(t,e,n)=>{if(r(t))return 90*t;return 9e4*e+(n?9e4*n.baseTime/n.timescale:0)};let Sr=null;const _r=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Ar=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Or=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],wr=[0,1,1,4];function Ir(track,data,t,e,n){if(t+24>data.length)return;const header=Rr(data,t);if(header&&t+header.frameLength<=data.length){const r=e+n*(9e4*header.samplesPerFrame/header.sampleRate),o={unit:data.subarray(t,t+header.frameLength),pts:r,dts:r};return track.config=[],track.channelCount=header.channelCount,track.samplerate=header.sampleRate,track.samples.push(o),{sample:o,length:header.frameLength,missing:0}}}function Rr(data,t){const e=data[t+1]>>3&3,n=data[t+1]>>1&3,r=data[t+2]>>4&15,o=data[t+2]>>2&3;if(1!==e&&0!==r&&15!==r&&3!==o){const l=data[t+2]>>1&1,c=data[t+3]>>6,d=1e3*_r[14*(3===e?3-n:3===n?3:4)+r-1],h=Ar[3*(3===e?0:2===e?1:2)+o],f=3===c?1:2,m=Or[e][n],v=wr[n],y=8*m*v,E=Math.floor(m*d/h+l)*v;if(null===Sr){const t=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Sr=t?parseInt(t[1]):0}return!!Sr&&Sr<=87&&2===n&&d>
vendor: 4,129 bytes, line 2
2=224e3&&0===c&&(data[t+3]=128|data[t+3]),{sampleRate:h,channelCount:f,frameLength:E,samplesPerFrame:y}}}function Lr(data,t){return 255===data[t]&&224==(224&data[t+1])&&0!=(6&data[t+1])}function xr(data,t){return t+1<data.length&&Lr(data,t)}function Dr(data,t){if(t+1<data.length&&Lr(data,t)){const e=4,header=Rr(data,t);let n=e;null!=header&&header.frameLength&&(n=header.frameLength);const r=t+n;return r===data.length||xr(data,r)}return!1}const Cr=(data,t)=>{let e=0,n=5;t+=n;const r=new Uint32Array(1),mask=new Uint32Array(1),o=new Uint8Array(1);for(;n>0;){o[0]=data[t];const l=Math.min(n,8),c=8-l;mask[0]=4278190080>>>24+c<<c,r[0]=(o[0]&mask[0])>>c,e=e?e<<l|r[0]:r[0],t+=1,n-=l}return e};class Pr extends Tr{constructor(t){super(),this.observer=void 0,this.observer=t}resetInitSegment(t,e,n,r){super.resetInitSegment(t,e,n,r),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}}canParse(data,t){return t+64<data.length}appendFrame(track,data,t){const e=Mr(track,data,t,this.basePTS,this.frameIndex);if(-1!==e){return{sample:track.samples[track.samples.length-1],length:e,missing:0}}}static probe(data){if(!data)return!1;const t=Zi(data,0);if(!t)return!1;const e=t.length;return 11===data[e]&&119===data[e+1]&&void 0!==vr(t)&&Cr(data,e)<16}}function Mr(track,data,t,e,n){if(t+8>data.length)return-1;if(11!==data[t]||119!==data[t+1])return-1;const r=data[t+4]>>6;if(r>=3)return-1;const o=[48e3,44100,32e3][r],l=63&data[t+4],c=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*l+r];if(t+c>data.length)return-1;const d=data[t+6]>>5;let h=0;2===d?h+=2:(1&d&&1!==d&&(h+=2),4&d&&(h+=2));const f=(data[t+6]<<8|data[t+7])>>12-h&1,m=[2,1,2,3,3,4,4,5][d]+f,v=data[t+5]>>3,y=7&data[t+5],E=new Uint8Array([r<<6|v<<1|y>>2,(3&y)<<6|d<<3|f<<2|l>>4,l<<4&224]),T=e+n*(1536/o*9e4),k=data.subarray(t,t+c);return track.config=E,track.channelCount=m,track.samplerate=o,track.samples.push({unit:k,pts:T}),c}const jr=/\/emsg[-/]ID3/i;function Fr(t,e){return r(t.presentationTime)?t.presentationTime/t.timeScale:e+t.presentationTimeDelta/t.timeScale}class Nr{constructor(t,e,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Ze(e,{removePKCS7Padding:!1})}decryptBuffer(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,qe)}decryptAacSample(t,e,n){const r=t[e].unit;if(r.length<=16)return;const o=r.subarray(16,r.length-r.length%16),l=o.buffer.slice(o.byteOffset,o.byteOffset+o.length);this.decryptBuffer(l).then((o=>{const l=new Uint8Array(o);r.set(l,16),this.decrypter.isSync()||this.decryptAacSamples(t,e+1,n)})).catch(n)}decryptAacSamples(t,e,n){for(;;e++){if(e>=t.length)return void n();if(!(t[e].unit.length<32)&&(this.decryptAacSample(t,e,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(t){const e=16*Math.floor((t.length-48)/160)+16,n=new Int8Array(e);let r=0;for(let e=32;e<t.length-16;e+=160,r+=16)n.set(t.subarray(e,e+16),r);return n}getAvcDecryptedUnit(t,e){const n=new Uint8Array(e);let r=0;for(let e=32;e<t.length-16;e+=160,r+=16)t.set(n.subarray(r,r+16),e);return t}decryptAvcSample(t,e,n,r,o){const l=Ot(o.data),c=this.getAvcEncryptedData(l);this.decryptBuffer(c.buffer).then((c=>{o.data=this.getAvcDecryptedUnit(l,c),this.decrypter.isSync()||this.decryptAvcSamples(t,e,n+1,r)})).catch(r)}decryptAvcSamples(t,e,n,r){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,n=0){if(e>=t.length)return void r();const o=t[e].units;for(;!(n>=o.length);n++){const l=o[n];if(!(l.data.length<=48||1!==l.type&&5!==l.type||(this.decryptAvcSample(t,e,n,r,l),this.decrypter.isSync())))return}}}}
vendor: 4,355 bytes, line 2
2class Ur{constructor(){this.VideoSample=null}createVideoSample(t,e,n){return{key:t,frame:!1,pts:e,dts:n,units:[],length:0}}getLastNalUnit(t){var e;let n,r=this.VideoSample;if(r&&0!==r.units.length||(r=t[t.length-1]),null!=(e=r)&&e.units){const t=r.units;n=t[t.length-1]}return n}pushAccessUnit(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){const n=e.samples,r=n.length;if(!r)return void e.dropped++;{const e=n[r-1];t.pts=e.pts,t.dts=e.dts}}e.samples.push(t)}}parseNALu(track,t,e){const n=t.byteLength;let r=track.naluState||0;const o=r,l=[];let c,d,h,i=0,f=-1,m=0;for(-1===r&&(f=0,m=this.getNALuType(t,0),r=0,i=1);i<n;)if(c=t[i++],r)if(1!==r)if(c)if(1===c){if(d=i-r-1,f>=0){const e={data:t.subarray(f,d),type:m};l.push(e)}else{const e=this.getLastNalUnit(track.samples);e&&(o&&i<=4-o&&e.state&&(e.data=e.data.subarray(0,e.data.byteLength-o)),d>0&&(e.data=Tt(e.data,t.subarray(0,d)),e.state=0))}i<n?(h=this.getNALuType(t,i),f=i,m=h,r=0):r=-1}else r=0;else r=3;else r=c?0:2;else r=c?0:1;if(f>=0&&r>=0){const e={data:t.subarray(f,n),type:m,state:r};l.push(e)}if(0===l.length){const e=this.getLastNalUnit(track.samples);e&&(e.data=Tt(e.data,t))}return track.naluState=r,l}}class Br{constructor(data){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=data,this.bytesAvailable=data.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const data=this.data,t=this.bytesAvailable,e=data.byteLength-t,n=new Uint8Array(4),r=Math.min(4,t);if(0===r)throw new Error("no bytes available");n.set(data.subarray(e,e+r)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*r,this.bytesAvailable-=r}skipBits(t){let e;t=Math.min(t,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(e=(t-=this.bitsAvailable)>>3,t-=e<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}readBits(t){let e=Math.min(this.bitsAvailable,t);const n=this.word>>>32-e;if(t>32&&M.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0)this.word<<=e;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return e=t-e,e>0&&this.bitsAvailable?n<<e|this.readBits(e):n}skipLZ(){let t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const t=this.skipLZ();return this.readBits(t+1)-1}readEG(){const t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class $r extends Ur{parsePES(track,t,e,n){const r=this.parseNALu(track,e.data,n);let o,l=this.VideoSample,c=!1;e.data=null,l&&r.length&&!track.audFound&&(this.pushAccessUnit(l,track),l=this.VideoSample=this.createVideoSample(!1,e.pts,e.dts)),r.forEach((n=>{var r,d;switch(n.type){case 1:{let t=!1;o=!0;const data=n.data;if(c&&data.length>4){const e=this.readSliceType(data);2!==e&&4!==e&&7!==e&&9!==e||(t=!0)}var h;if(t)null!=(h=l)&&h.frame&&!l.key&&(this.pushAccessUnit(l,track),l=this.VideoSample=null);l||(l=this.VideoSample=this.createVideoSample(!0,e.pts,e.dts)),l.frame=!0,l.key=t;break}case 5:o=!0,null!=(r=l)&&r.frame&&!l.key&&(this.pushAccessUnit(l,track),l=this.VideoSample=null),l||(l=this.VideoSample=this.createVideoSample(!0,e.pts,e.dts)),l.key=!0,l.frame=!0;break;case 6:o=!0,At(n.data,1,e.pts,t.samples);break;case 7:{var f,m;o=!0,c=!0;const t=n.data,e=this.readSPS(t);if(!track.sps||track.width!==e.width||track.height!==e.height||(null==(f=track.pixelRatio)?void 0:f[0])!==e.pixelRatio[0]||(null==(m=track.pixelRatio)?void 0:m[1])!==e.pixelRatio[1]){track.width=e.width,track.height=e.height,track.pixelRatio=e.pixelRatio,track.sps=[t];const n=t.subarray(1,4);let r="avc1.";for(let i=0;i<3;i++){let t=n[i].toString(16);t.length<2&&(t="0"+t),r+=t}track.codec=r}break}case 8:o=!0,track.pps=[n.data];break;case 9:o=!0,track.audFound=!0,null!=(d=l)&&d.frame&&(this.pushAccessUnit(l,track),l=null),l||(l=this.VideoSample=this.createVideoSample(!1,e.pts,e.dts));break;case 12:o=!0;break;default:o=!1}if(l&&o){l.units.push(n)}})),n&&l&&(this.pushAccessUnit(l,track),this.VideoSample=null)}
vendor: 24,600 bytes, line 2
2getNALuType(data,t){return 31&data[t]}readSliceType(data){const t=new Br(data);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(t,e){let n,r=8,o=8;for(let l=0;l<t;l++)0!==o&&(n=e.readEG(),o=(r+n+256)%256),r=0===o?r:o}readSPS(t){const e=new Br(t);let n,r,i,o=0,l=0,c=0,d=0;const h=e.readUByte.bind(e),f=e.readBits.bind(e),m=e.readUEG.bind(e),v=e.readBoolean.bind(e),y=e.skipBits.bind(e),E=e.skipEG.bind(e),T=e.skipUEG.bind(e),k=this.skipScalingList.bind(this);h();const S=h();if(f(5),y(3),h(),T(),100===S||110===S||122===S||244===S||44===S||83===S||86===S||118===S||128===S){const t=m();if(3===t&&y(1),T(),T(),y(1),v())for(r=3!==t?8:12,i=0;i<r;i++)v()&&k(i<6?16:64,e)}T();const _=m();if(0===_)m();else if(1===_)for(y(1),E(),E(),n=m(),i=0;i<n;i++)E();T(),y(1);const A=m(),O=m(),w=f(1);0===w&&y(1),y(1),v()&&(o=m(),l=m(),c=m(),d=m());let I=[1,1];if(v()&&v()){switch(h()){case 1:I=[1,1];break;case 2:I=[12,11];break;case 3:I=[10,11];break;case 4:I=[16,11];break;case 5:I=[40,33];break;case 6:I=[24,11];break;case 7:I=[20,11];break;case 8:I=[32,11];break;case 9:I=[80,33];break;case 10:I=[18,11];break;case 11:I=[15,11];break;case 12:I=[64,33];break;case 13:I=[160,99];break;case 14:I=[4,3];break;case 15:I=[3,2];break;case 16:I=[2,1];break;case 255:I=[h()<<8|h(),h()<<8|h()]}}return{width:Math.ceil(16*(A+1)-2*o-2*l),height:(2-w)*(O+1)*16-(w?2:4)*(c+d),pixelRatio:I}}}class Vr extends Ur{constructor(...t){super(...t),this.initVPS=null}parsePES(track,t,e,n){const r=this.parseNALu(track,e.data,n);let o,l=this.VideoSample,c=!1;e.data=null,l&&r.length&&!track.audFound&&(this.pushAccessUnit(l,track),l=this.VideoSample=this.createVideoSample(!1,e.pts,e.dts)),r.forEach((n=>{var r,d;switch(n.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:l||(l=this.VideoSample=this.createVideoSample(!1,e.pts,e.dts)),l.frame=!0,o=!0;break;case 16:case 17:case 18:case 21:var h;if(o=!0,c)null!=(h=l)&&h.frame&&!l.key&&(this.pushAccessUnit(l,track),l=this.VideoSample=null);l||(l=this.VideoSample=this.createVideoSample(!0,e.pts,e.dts)),l.key=!0,l.frame=!0;break;case 19:case 20:o=!0,null!=(r=l)&&r.frame&&!l.key&&(this.pushAccessUnit(l,track),l=this.VideoSample=null),l||(l=this.VideoSample=this.createVideoSample(!0,e.pts,e.dts)),l.key=!0,l.frame=!0;break;case 39:o=!0,At(n.data,2,e.pts,t.samples);break;case 32:o=!0,track.vps||("object"!=typeof track.params&&(track.params={}),track.params=O(track.params,this.readVPS(n.data)),this.initVPS=n.data),track.vps=[n.data];break;case 33:if(o=!0,c=!0,void 0===track.vps||track.vps[0]===this.initVPS||void 0===track.sps||this.matchSPS(track.sps[0],n.data)||(this.initVPS=track.vps[0],track.sps=track.pps=void 0),!track.sps){const t=this.readSPS(n.data);track.width=t.width,track.height=t.height,track.pixelRatio=t.pixelRatio,track.codec=t.codecString,track.sps=[],"object"!=typeof track.params&&(track.params={});for(const e in t.params)track.params[e]=t.params[e]}this.pushParameterSet(track.sps,n.data,track.vps),l||(l=this.VideoSample=this.createVideoSample(!0,e.pts,e.dts)),l.key=!0;break;case 34:if(o=!0,"object"==typeof track.params){if(!track.pps){track.pps=[];const t=this.readPPS(n.data);for(const e in t)track.params[e]=t[e]}this.pushParameterSet(track.pps,n.data,track.vps)}break;case 35:o=!0,track.audFound=!0,null!=(d=l)&&d.frame&&(this.pushAccessUnit(l,track),l=null),l||(l=this.VideoSample=this.createVideoSample(!1,e.pts,e.dts));break;default:o=!1}if(l&&o){l.units.push(n)}})),n&&l&&(this.pushAccessUnit(l,track),this.VideoSample=null)}pushParameterSet(t,data,e){(e&&e[0]===this.initVPS||!e&&!t.length)&&t.push(data)}getNALuType(data,t){return(126&data[t])>>>1}ebsp2rbsp(t){const e=new Uint8Array(t.byteLength);let n=0;for(let i=0;i<t.byteLength;i++)i>=2&&3===t[i]&&0===t[i-1]&&0===t[i-2]||(e[n]=t[i],n++);return new Uint8Array(e.buffer,0,n)}pushAccessUnit(t,e){super.pushAccessUnit(t,e),this.initVPS&&(this.initVPS=null)}readVPS(t){const e=new Br(t);e.readUByte(),e.readUByte(),e.readBits(4),e.skipBits(2),e.readBits(6);return{numTemporalLayers:e.readBits(3)+1,temporalIdNested:e.readBoolean()}}readSPS(t){const e=new Br(this.ebsp2rbsp(t));e.readUByte(),e.readUByte(),e.readBits(4);const n=e.readBits(3);e.readBoolean();const r=e.readBits(2),o=e.readBoolean(),l=e.readBits(5),c=e.readUByte(),d=e.readUByte(),h=e.readUByte(),f=e.readUByte(),m=e.readUByte(),v=e.readUByte(),y=e.readUByte(),E=e.readUByte(),T=e.readUByte(),k=e.readUByte(),S=e.readUByte(),_=[],A=[];for(let i=0;i<n;i++)_.push(e.readBoolean()),A.push(e.readBoolean());if(n>0)for(let i=n;i<8;i++)e.readBits(2);for(let i=0;i<n;i++)_[i]&&(e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte()),A[i]&&e.readUByte();e.readUEG();const O=e.readUEG();3==O&&e.skipBits(1);const w=e.readUEG(),I=e.readUEG(),R=e.readBoolean();let L=0,x=0,D=0,C=0;R&&(L+=e.readUEG(),x+=e.readUEG(),D+=e.readUEG(),C+=e.readUEG());const P=e.readUEG(),M=e.readUEG(),j=e.readUEG();for(let i=e.readBoolean()?0:n;i<=n;i++)e.skipUEG(),e.skipUEG(),e.skipUEG();e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG();if(e.readBoolean()){if(e.readBoolean())for(let t=0;t<4;t++)for(let n=0;n<(3===t?2:6);n++){if(e.readBoolean()){const n=Math.min(64,1<<4+(t<<1));t>1&&e.readEG();for(let i=0;i<n;i++)e.readEG()}else e.readUEG()}}e.readBoolean(),e.readBoolean();e.readBoolean()&&(e.readUByte(),e.skipUEG(),e.skipUEG(),e.readBoolean());const F=e.readUEG();let N=0;for(let i=0;i<F;i++){let t=!1;if(0!==i&&(t=e.readBoolean()),t){i===F&&e.readUEG(),e.readBoolean(),e.readUEG();let t=0;for(let n=0;n<=N;n++){const n=e.readBoolean();let r=!1;n||(r=e.readBoolean()),(n||r)&&t++}N=t}else{const t=e.readUEG(),n=e.readUEG();N=t+n;for(let n=0;n<t;n++)e.readUEG(),e.readBoolean();for(let t=0;t<n;t++)e.readUEG(),e.readBoolean()}}if(e.readBoolean()){const t=e.readUEG();for(let i=0;i<t;i++){for(let t=0;t<j+4;t++)e.readBits(1);e.readBits(1)}}let U=0,B=1,$=1,V=!0,G=1,H=0;e.readBoolean(),e.readBoolean();let W=!1;if(e.readBoolean()){if(e.readBoolean()){const t=e.readUByte(),n=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],r=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];t>0&&t<16?(B=n[t-1],$=r[t-1]):255===t&&(B=e.readBits(16),$=e.readBits(16))}e.readBoolean()&&e.readBoolean();if(e.readBoolean()){e.readBits(3),e.readBoolean();e.readBoolean()&&(e.readUByte(),e.readUByte(),e.readUByte())}e.readBoolean()&&(e.readUEG(),e.readUEG()),e.readBoolean(),e.readBoolean(),e.readBoolean(),W=e.readBoolean(),W&&(e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG());if(e.readBoolean()){G=e.readBits(32),H=e.readBits(32);e.readBoolean()&&e.readUEG();if(e.readBoolean()){const t=e.readBoolean(),r=e.readBoolean();let o=!1;(t||r)&&(o=e.readBoolean(),o&&(e.readUByte(),e.readBits(5),e.readBoolean(),e.readBits(5)),e.readBits(4),e.readBits(4),o&&e.readBits(4),e.readBits(5),e.readBits(5),e.readBits(5));for(let i=0;i<=n;i++){V=e.readBoolean();let n=!1;V||e.readBoolean()?e.readEG():n=e.readBoolean();const l=n?1:e.readUEG()+1;if(t)for(let t=0;t<l;t++)e.readUEG(),e.readUEG(),o&&(e.readUEG(),e.readUEG()),e.skipBits(1);if(r)for(let t=0;t<l;t++)e.readUEG(),e.readUEG(),o&&(e.readUEG(),e.readUEG()),e.skipBits(1)}}}e.readBoolean()&&(e.readBoolean(),e.readBoolean(),e.readBoolean(),U=e.readUEG())}let K=w,Y=I;if(R){let t=1,e=1;1===O?t=e=2:2==O&&(t=2),K=w-t*x-t*L,Y=I-e*C-e*D}const z=r?["A","B","C"][r]:"",Q=c<<24|d<<16|h<<8|f;let X=0;for(let i=0;i<32;i++)X=(X|(Q>>i&1)<<31-i)>>>0;let Z=X.toString(16);1===l&&"2"===Z&&(Z="6");return{codecString:`hvc1.${z}${l}.${Z}.${o?"H":"L"}${S}.B0`,params:{general_tier_flag:o,general_profile_idc:l,general_profile_space:r,general_profile_compatibility_flags:[c,d,h,f],general_constraint_indicator_flags:[m,v,y,E,T,k],general_level_idc:S,bit_depth:P+8,bit_depth_luma_minus8:P,bit_depth_chroma_minus8:M,min_spatial_segmentation_idc:U,chroma_format_idc:O,frame_rate:{fixed:V,fps:H/G}},width:K,height:Y,pixelRatio:[B,$]}}readPPS(t){const e=new Br(this.ebsp2rbsp(t));e.readUByte(),e.readUByte(),e.skipUEG(),e.skipUEG(),e.skipBits(2),e.skipBits(3),e.skipBits(2),e.skipUEG(),e.skipUEG(),e.skipEG(),e.skipBits(2);e.readBoolean()&&e.skipUEG(),e.skipEG(),e.skipEG(),e.skipBits(4);const n=e.readBoolean(),r=e.readBoolean();let o=1;return r&&n?o=0:r?o=3:n&&(o=2),{parallelismType:o}}matchSPS(t,e){return String.fromCharCode.apply(null,t).substr(3)===String.fromCharCode.apply(null,e).substr(3)}}const Gr=188;class Hr{constructor(t,e,n,r){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=t,this.config=e,this.typeSupported=n,this.logger=r,this.videoParser=null}static probe(data,t){const e=Hr.syncOffset(data);return e>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${e}`),-1!==e}static syncOffset(data){const t=data.length;let e=Math.min(940,t-Gr)+1,i=0;for(;i<e;){let n=!1,r=-1,o=0;for(let l=i;l<t;l+=Gr){if(71!==data[l]||t-l!==Gr&&71!==data[l+Gr]){if(o)return-1;break}if(o++,-1===r&&(r=l,0!==r&&(e=Math.min(r+18612,data.length-Gr)+1)),n||(n=0===Wr(data,l)),n&&o>1&&(0===r&&o>2||l+Gr>e))return r}i++}return-1}static createTrack(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:it[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===t?e:void 0}}resetInitSegment(t,e,n,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Hr.createTrack("video"),this._videoTrack.duration=r,this._audioTrack=Hr.createTrack("audio",r),this._id3Track=Hr.createTrack("id3"),this._txtTrack=Hr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=e,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:t,_videoTrack:e,_id3Track:n}=this;t&&(t.pesData=null),e&&(e.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(data,t,e=!1,n=!1){let r;e||(this.sampleAes=null);const o=this._videoTrack,l=this._audioTrack,c=this._id3Track,d=this._txtTrack;let h=o.pid,f=o.pesData,m=l.pid,v=c.pid,y=l.pesData,E=c.pesData,T=null,k=this.pmtParsed,S=this._pmtId,_=data.length;if(this.remainderData&&(_=(data=Tt(this.remainderData,data)).length,this.remainderData=null),_<Gr&&!n)return this.remainderData=data,{audioTrack:l,videoTrack:o,id3Track:c,textTrack:d};const A=Math.max(0,Hr.syncOffset(data));_-=(_-A)%Gr,_<data.byteLength&&!n&&(this.remainderData=new Uint8Array(data.buffer,_,data.buffer.byteLength-_));let O=0;for(let t=A;t<_;t+=Gr)if(71===data[t]){const n=!!(64&data[t+1]),_=Wr(data,t);let O;if((48&data[t+3])>>4>1){if(O=t+5+data[t+4],O===t+Gr)continue}else O=t+4;switch(_){case h:n&&(f&&(r=Qr(f,this.logger))&&(this.readyVideoParser(o.segmentCodec),null!==this.videoParser&&this.videoParser.parsePES(o,d,r,!1)),f={data:[],size:0}),f&&(f.data.push(data.subarray(O,t+Gr)),f.size+=t+Gr-O);break;case m:if(n){if(y&&(r=Qr(y,this.logger)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,r);break;case"mp3":this.parseMPEGPES(l,r);break;case"ac3":this.parseAC3PES(l,r)}y={data:[],size:0}}y&&(y.data.push(data.subarray(O,t+Gr)),y.size+=t+Gr-O);break;case v:n&&(E&&(r=Qr(E,this.logger))&&this.parseID3PES(c,r),E={data:[],size:0}),E&&(E.data.push(data.subarray(O,t+Gr)),E.size+=t+Gr-O);break;case 0:n&&(O+=data[O]+1),S=this._pmtId=Kr(data,O);break;case S:{n&&(O+=data[O]+1);const r=qr(data,O,this.typeSupported,e,this.observer,this.logger);h=r.videoPid,h>0&&(o.pid=h,o.segmentCodec=r.segmentVideoCodec),m=r.audioPid,m>0&&(l.pid=m,l.segmentCodec=r.segmentAudioCodec),v=r.id3Pid,v>0&&(c.pid=v),null===T||k||(this.logger.warn(`MPEG-TS PMT found at ${t} after unknown PID '${T}'. Backtracking to sync byte @${A} to parse all TS packets.`),T=null,t=A-188),k=this.pmtParsed=!0;break}case 17:case 8191:break;default:T=_}}else O++;O>0&&Yr(this.observer,new Error(`Found ${O} TS packet/s that do not start with 0x47`),void 0,this.logger),o.pesData=f,l.pesData=y,c.pesData=E;const w={audioTrack:l,videoTrack:o,id3Track:c,textTrack:d};return n&&this.extractRemainingSamples(w),w}flush(){const{remainderData:t}=this;let e;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e}extractRemainingSamples(t){const{audioTrack:e,videoTrack:n,id3Track:r,textTrack:o}=t,l=n.pesData,c=e.pesData,d=r.pesData;let h;if(l&&(h=Qr(l,this.logger))?(this.readyVideoParser(n.segmentCodec),null!==this.videoParser&&(this.videoParser.parsePES(n,o,h,!0),n.pesData=null)):n.pesData=l,c&&(h=Qr(c,this.logger))){switch(e.segmentCodec){case"aac":this.parseAACPES(e,h);break;case"mp3":this.parseMPEGPES(e,h);break;case"ac3":this.parseAC3PES(e,h)}e.pesData=null}else null!=c&&c.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),e.pesData=c;d&&(h=Qr(d,this.logger))?(this.parseID3PES(r,h),r.pesData=null):r.pesData=d}demuxSampleAes(data,t,e){const n=this.demux(data,e,!0,!this.config.progressive),r=this.sampleAes=new Nr(this.observer,this.config,t);return this.decrypt(n,r)}readyVideoParser(t){null===this.videoParser&&("avc"===t?this.videoParser=new $r:"hevc"===t&&(this.videoParser=new Vr))}decrypt(t,e){return new Promise((n=>{const{audioTrack:r,videoTrack:o}=t;r.samples&&"aac"===r.segmentCodec?e.decryptAacSamples(r.samples,0,(()=>{o.samples?e.decryptAvcSamples(o.samples,0,0,(()=>{n(t)})):n(t)})):o.samples&&e.decryptAvcSamples(o.samples,0,0,(()=>{n(t)}))}))}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(track,t){let e=0;const n=this.aacOverFlow;let r,o,l,data=t.data;if(n){this.aacOverFlow=null;const t=n.missing,r=n.sample.unit.byteLength;if(-1===t)data=Tt(n.sample.unit,data);else{const o=r-t;n.sample.unit.set(data.subarray(0,t),o),track.samples.push(n.sample),e=n.missing}}for(r=e,o=data.length;r<o-1&&!ir(data,r);r++);if(r!==e){let t;const e=r<o-1;if(t=e?`AAC PES did not start with ADTS header,offset:${r}`:"No ADTS header found in AAC PES",Yr(this.observer,new Error(t),e,this.logger),!e)return}if(sr(track,this.observer,data,r,this.audioCodec),void 0!==t.pts)l=t.pts;else{if(!n)return void this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");{const t=ar(track.samplerate);l=n.sample.pts+t}}let c,d=0;for(;r<o;){if(c=or(track,data,r,l,d),r+=c.length,c.missing){this.aacOverFlow=c;break}for(d++;r<o-1&&!ir(data,r);r++);}}parseMPEGPES(track,t){const data=t.data,e=data.length;let n=0,r=0;const o=t.pts;if(void 0!==o)for(;r<e;)if(xr(data,r)){const t=Ir(track,data,r,o,n);if(!t)break;r+=t.length,n++}else r++;else this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseAC3PES(track,t){{const data=t.data,e=t.pts;if(void 0===e)return void this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");const n=data.length;let r,o=0,l=0;for(;l<n&&(r=Mr(track,data,l,e,o++))>0;)l+=r}}parseID3PES(t,e){if(void 0===e.pts)return void this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");const n=O({},e,{type:this._videoTrack?yr.emsg:yr.audioId3,duration:Number.POSITIVE_INFINITY});t.samples.push(n)}}function Wr(data,t){return((31&data[t+1])<<8)+data[t+2]}function Kr(data,t){return(31&data[t+10])<<8|data[t+11]}function qr(data,t,e,n,r,o){const l={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},c=t+3+((15&data[t+1])<<8|data[t+2])-4;for(t+=12+((15&data[t+10])<<8|data[t+11]);t<c;){const c=Wr(data,t),d=(15&data[t+3])<<8|data[t+4];switch(data[t]){case 207:if(!n){zr("ADTS AAC",o);break}case 15:-1===l.audioPid&&(l.audioPid=c);break;case 21:-1===l.id3Pid&&(l.id3Pid=c);break;case 219:if(!n){zr("H.264",o);break}case 27:-1===l.videoPid&&(l.videoPid=c);break;case 3:case 4:e.mpeg||e.mp3?-1===l.audioPid&&(l.audioPid=c,l.segmentAudioCodec="mp3"):o.log("MPEG audio found, not supported in this browser");break;case 193:if(!n){zr("AC-3",o);break}case 129:e.ac3?-1===l.audioPid&&(l.audioPid=c,l.segmentAudioCodec="ac3"):o.log("AC-3 audio found, not supported in this browser");break;case 6:if(-1===l.audioPid&&d>0){let n=t+5,r=d;for(;r>2;){if(106===data[n])!0!==e.ac3?o.log("AC-3 audio found, not supported in this browser for now"):(l.audioPid=c,l.segmentAudioCodec="ac3");const t=data[n+1]+2;n+=t,r-=t}}break;case 194:case 135:return Yr(r,new Error("Unsupported EC-3 in M2TS found"),void 0,o),l;case 36:-1===l.videoPid&&(l.videoPid=c,l.segmentVideoCodec="hevc",o.log("HEVC in M2TS found"))}t+=d+5}return l}function Yr(t,e,n,r){r.warn(`parsing error: ${e.message}`),t.emit(h.ERROR,h.ERROR,{type:c.MEDIA_ERROR,details:d.FRAG_PARSING_ERROR,fatal:!1,levelRetry:n,error:e,reason:e.message})}function zr(t,e){e.log(`${t} with AES-128-CBC encryption found in unencrypted stream`)}function Qr(t,e){let n,r,o,l,c,i=0;const data=t.data;if(!t||0===t.size)return null;for(;data[0].length<19&&data.length>1;)data[0]=Tt(data[0],data[1]),data.splice(1,1);n=data[0];if(1===(n[0]<<16)+(n[1]<<8)+n[2]){if(r=(n[4]<<8)+n[5],r&&r>t.size-6)return null;const d=n[7];192&d&&(l=536870912*(14&n[9])+4194304*(255&n[10])+16384*(254&n[11])+128*(255&n[12])+(254&n[13])/2,64&d?(c=536870912*(14&n[14])+4194304*(255&n[15])+16384*(254&n[16])+128*(255&n[17])+(254&n[18])/2,l-c>54e5&&(e.warn(`${Math.round((l-c)/9e4)}s delta between PTS and DTS, align them`),l=c)):c=l),o=n[8];let h=o+9;if(t.size<=h)return null;t.size-=h;const f=new Uint8Array(t.size);for(let t=0,e=data.length;t<e;t++){n=data[t];let e=n.byteLength;if(h){if(h>e){h-=e;continue}n=n.subarray(h),e-=h,h=0}f.set(n,i),i+=e}return r&&(r-=o+3),{data:f,pts:l,dts:c,len:r}}return null}class Xr{static getSilentFrame(t,e){if("mp4a.40.2"===t){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}const Zr=Math.pow(2,32)-1;class Jr{static init(){let i;for(i in Jr.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},Jr.types)Jr.types.hasOwnProperty(i)&&(Jr.types[i]=[i.charCodeAt(0),i.charCodeAt(1),i.charCodeAt(2),i.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),e=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);Jr.HDLR_TYPES={video:t,audio:e};const n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);Jr.STTS=Jr.STSC=Jr.STCO=r,Jr.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Jr.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Jr.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Jr.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const o=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);Jr.FTYP=Jr.box(Jr.types.ftyp,o,c,o,l),Jr.DINF=Jr.box(Jr.types.dinf,Jr.box(Jr.types.dref,n))}static box(t,...e){let n=8,i=e.length;const r=i;for(;i--;)n+=e[i].byteLength;const o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=255&n,o.set(t,4),i=0,n=8;i<r;i++)o.set(e[i],n),n+=e[i].byteLength;return o}static hdlr(t){return Jr.box(Jr.types.hdlr,Jr.HDLR_TYPES[t])}static mdat(data){return Jr.box(Jr.types.mdat,data)}static mdhd(t,e){e*=t;const n=Math.floor(e/(Zr+1)),r=Math.floor(e%(Zr+1));return Jr.box(Jr.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))}static mdia(track){return Jr.box(Jr.types.mdia,Jr.mdhd(track.timescale||0,track.duration||0),Jr.hdlr(track.type),Jr.minf(track))}static mfhd(t){return Jr.box(Jr.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}static minf(track){return"audio"===track.type?Jr.box(Jr.types.minf,Jr.box(Jr.types.smhd,Jr.SMHD),Jr.DINF,Jr.stbl(track)):Jr.box(Jr.types.minf,Jr.box(Jr.types.vmhd,Jr.VMHD),Jr.DINF,Jr.stbl(track))}static moof(t,e,track){return Jr.box(Jr.types.moof,Jr.mfhd(t),Jr.traf(track,e))}static moov(t){let i=t.length;const e=[];for(;i--;)e[i]=Jr.trak(t[i]);return Jr.box.apply(null,[Jr.types.moov,Jr.mvhd(t[0].timescale||0,t[0].duration||0)].concat(e).concat(Jr.mvex(t)))}static mvex(t){let i=t.length;const e=[];for(;i--;)e[i]=Jr.trex(t[i]);return Jr.box.apply(null,[Jr.types.mvex,...e])}static mvhd(t,e){e*=t;const n=Math.floor(e/(Zr+1)),r=Math.floor(e%(Zr+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return Jr.box(Jr.types.mvhd,o)}static sdtp(track){const t=track.samples||[],e=new Uint8Array(4+t.length);let i,n;for(i=0;i<t.length;i++)n=t[i].flags,e[i+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return Jr.box(Jr.types.sdtp,e)}static stbl(track){return Jr.box(Jr.types.stbl,Jr.stsd(track),Jr.box(Jr.types.stts,Jr.STTS),Jr.box(Jr.types.stsc,Jr.STSC),Jr.box(Jr.types.stsz,Jr.STSZ),Jr.box(Jr.types.stco,Jr.STCO))}static avc1(track){let i,data,t,e=[],n=[];for(i=0;i<track.sps.length;i++)data=track.sps[i],t=data.byteLength,e.push(t>>>8&255),e.push(255&t),e=e.concat(Array.prototype.slice.call(data));for(i=0;i<track.pps.length;i++)data=track.pps[i],t=data.byteLength,n.push(t>>>8&255),n.push(255&t),n=n.concat(Array.prototype.slice.call(data));const r=Jr.box(Jr.types.avcC,new Uint8Array([1,e[3],e[4],e[5],255,224|track.sps.length].concat(e).concat([track.pps.length]).concat(n))),o=track.width,l=track.height,c=track.pixelRatio[0],d=track.pixelRatio[1];return Jr.box(Jr.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,255&o,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r,Jr.box(Jr.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Jr.box(Jr.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))}static esds(track){const t=track.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(track){const t=track.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,track.channelCount||0,0,16,0,0,0,0,t>>8&255,255&t,0,0])}static mp4a(track){return Jr.box(Jr.types.mp4a,Jr.audioStsd(track),Jr.box(Jr.types.esds,Jr.esds(track)))}static mp3(track){return Jr.box(Jr.types[".mp3"],Jr.audioStsd(track))}static ac3(track){return Jr.box(Jr.types["ac-3"],Jr.audioStsd(track),Jr.box(Jr.types.dac3,track.config))}static stsd(track){const{segmentCodec:t}=track;if("audio"===track.type){if("aac"===t)return Jr.box(Jr.types.stsd,Jr.STSD,Jr.mp4a(track));if("ac3"===t&&track.config)return Jr.box(Jr.types.stsd,Jr.STSD,Jr.ac3(track));if("mp3"===t&&"mp3"===track.codec)return Jr.box(Jr.types.stsd,Jr.STSD,Jr.mp3(track))}else{if(!track.pps||!track.sps)throw new Error("video track missing p
2ps or sps");if("avc"===t)return Jr.box(Jr.types.stsd,Jr.STSD,Jr.avc1(track));if("hevc"===t&&track.vps)return Jr.box(Jr.types.stsd,Jr.STSD,Jr.hvc1(track))}throw new Error(`unsupported ${track.type} segment codec (${t}/${track.codec})`)}static tkhd(track){const t=track.id,e=(track.duration||0)*(track.timescale||0),n=track.width||0,r=track.height||0,o=Math.floor(e/(Zr+1)),l=Math.floor(e%(Zr+1));return Jr.box(Jr.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,r>>8&255,255&r,0,0]))}static traf(track,t){const e=Jr.sdtp(track),n=track.id,r=Math.floor(t/(Zr+1)),o=Math.floor(t%(Zr+1));return Jr.box(Jr.types.traf,Jr.box(Jr.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),Jr.box(Jr.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,o>>24,o>>16&255,o>>8&255,255&o])),Jr.trun(track,e.length+16+20+8+16+8+8),e)}static trak(track){return track.duration=track.duration||4294967295,Jr.box(Jr.types.trak,Jr.tkhd(track),Jr.mdia(track))}static trex(track){const t=track.id;return Jr.box(Jr.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(track,t){const e=track.samples||[],n=e.length,r=12+16*n,o=new Uint8Array(r);let i,l,c,d,h,f;for(t+=8+r,o.set(["video"===track.type?1:0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),i=0;i<n;i++)l=e[i],c=l.duration,d=l.size,h=l.flags,f=l.cts,o.set([c>>>24&255,c>>>16&255,c>>>8&255,255&c,d>>>24&255,d>>>16&255,d>>>8&255,255&d,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,61440&h.degradPrio,15&h.degradPrio,f>>>24&255,f>>>16&255,f>>>8&255,255&f],12+16*i);return Jr.box(Jr.types.trun,o)}static initSegment(t){Jr.types||Jr.init();const e=Jr.moov(t);return Tt(Jr.FTYP,e)}static hvc1(track){const t=track.params,e=[track.vps,track.sps,track.pps],n=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),3|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),e.length]);let r=n.length;for(let i=0;i<e.length;i+=1){r+=3;for(let t=0;t<e[i].length;t+=1)r+=2+e[i][t].length}const o=new Uint8Array(r);o.set(n,0),r=n.length;const l=e.length-1;for(let i=0;i<e.length;i+=1){o.set(new Uint8Array([32+i|(i===l?128:0),0,e[i].length]),r),r+=3;for(let t=0;t<e[i].length;t+=1)o.set(new Uint8Array([e[i][t].length>>8,255&e[i][t].length]),r),r+=2,o.set(e[i][t],r),r+=e[i][t].length}const c=Jr.box(Jr.types.hvcC,o),d=track.width,h=track.height,f=track.pixelRatio[0],m=track.pixelRatio[1];return Jr.box(Jr.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,d>>8&255,255&d,h>>8&255,255&h,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,Jr.box(Jr.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Jr.box(Jr.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,255&f,m>>24,m>>16&255,m>>8&255,255&m])))}}Jr.types=void 0,Jr.HDLR_TYPES=void 0,Jr.STTS=void 0,Jr.STSC=void 0,Jr.STCO=void 0,Jr.STSZ=void 0,Jr.VMHD=void 0,Jr.SMHD=void 0,Jr.STSD=void 0,Jr.FTYP=void 0,Jr.DINF=void 0;function ts(t,e,n=1,r=!1){const o=t*e*n;return r?Math.round(o):o}function es(t,e=!1){return ts(t,1e3,1/9e4,e)}function ns(t){const{baseTime:e,timescale:n,trackId:r}=t;return`${e/n} (${e}/${n}) trackId: ${r}`}
vendor: 17,904 bytes, line 2
2let is,rs=null,ss=null;function as(t,e,n,r){return{duration:e,size:n,cts:r,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:t?2:1,isNonSync:t?0:1}}}class os extends R{constructor(t,e,n,r){if(super("mp4-remuxer",r),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=t,this.config=e,this.typeSupported=n,this.ISGenerated=!1,null===rs){const t=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);rs=t?parseInt(t[1]):0}if(null===ss){const t=navigator.userAgent.match(/Safari\/(\d+)/i);ss=t?parseInt(t[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(t){const e=this._initPTS;e&&t&&t.trackId===e.trackId&&t.baseTime===e.baseTime&&t.timescale===e.timescale||this.log(`Reset initPTS: ${e?ns(e):e} > ${t?ns(t):t}`),this._initPTS=this._initDTS=t}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(t){let e=!1;const n=t[0].pts,r=t.reduce(((t,r)=>{let o=r.pts,l=o-t;return l<-4294967296&&(e=!0,o=ls(o,n),l=o-t),l>0?t:o}),n);return e&&this.debug("PTS rollover detected"),r}remux(t,e,n,r,o,l,c,d){let video,audio,h,text,f,m,v=o,y=o;const E=t.pid>-1,k=e.pid>-1,S=e.samples.length,_=t.samples.length>0,A=c&&S>0||S>1;if((!E||_)&&(!k||A)||this.ISGenerated||c){if(this.ISGenerated){var O,w,I,R;const t=this.videoTrackConfig;(t&&(e.width!==t.width||e.height!==t.height||(null==(O=e.pixelRatio)?void 0:O[0])!==(null==(w=t.pixelRatio)?void 0:w[0])||(null==(I=e.pixelRatio)?void 0:I[1])!==(null==(R=t.pixelRatio)?void 0:R[1]))||!t&&A||null===this.nextAudioTs&&_)&&this.resetInitSegment()}this.ISGenerated||(h=this.generateIS(t,e,o,l));const n=this.isVideoContiguous;let r,c=-1;if(A&&(c=function(t){for(let i=0;i<t.length;i++)if(t[i].key)return i;return-1}(e.samples),!n&&this.config.forceKeyFrameOnDiscontinuity))if(m=!0,c>0){this.warn(`Dropped ${c} out of ${S} video samples due to a missing keyframe`);const t=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(c),e.dropped+=c,y+=(e.samples[0].pts-t)/e.inputTimeScale,r=y}else-1===c&&(this.warn(`No keyframe found out of ${S} video samples`),m=!1);if(this.ISGenerated){if(_&&A){const n=this.getVideoStartPts(e.samples),r=(ls(t.samples[0].pts,n)-n)/e.inputTimeScale;v+=Math.max(0,r),y+=Math.max(0,-r)}if(_){if(t.samplerate||(this.warn("regenerate InitSegment as audio detected"),h=this.generateIS(t,e,o,l)),audio=this.remuxAudio(t,v,this.isAudioContiguous,l,k||A||d===T?y:void 0),A){const r=audio?audio.endPTS-audio.startPTS:0;e.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),h=this.generateIS(t,e,o,l)),video=this.remuxVideo(e,y,n,r)}}else A&&(video=this.remuxVideo(e,y,n,0));video&&(video.firstKeyFrame=c,video.independent=-1!==c,video.firstKeyFramePTS=r)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(f=cs(n,o,this._initPTS,this._initDTS)),r.samples.length&&(text=us(r,o,this._initPTS))),{audio:audio,video:video,initSegment:h,independent:m,text:text,id3:f}}computeInitPts(t,e,n,r){const o=Math.round(n*e);let l=ls(t,o);if(l<o+e)for(this.log(`Adjusting PTS for rollover in timeline near ${(o-l)/e} ${r}`);l<o+e;)l+=8589934592;return l-o}generateIS(t,e,n,r){const o=t.samples,l=e.samples,c=this.typeSupported,d={},h=this._initPTS;let f,m,v,y=!h||r,E="audio/mp4",T=-1;if(y&&(f=m=1/0),t.config&&o.length){switch(t.timescale=t.samplerate,t.segmentCodec){case"mp3":c.mpeg?(E="audio/mpeg",t.codec=""):c.mp3&&(t.codec="mp3");break;case"ac3":t.codec="ac-3"}d.audio={id:"audio",container:E,codec:t.codec,initSegment:"mp3"===t.segmentCodec&&c.mpeg?new Uint8Array(0):Jr.initSegment([t]),metadata:{channelCount:t.channelCount}},y&&(T=t.id,v=t.inputTimeScale,h&&v===h.timescale?y=!1:f=m=this.computeInitPts(o[0].pts,v,n,"audio"))}if(e.sps&&e.pps&&l.length){if(e.timescale=e.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:Jr.initSegment([e]),metadata:{width:e.width,height:e.height}},y)if(T=e.id,v=e.inputTimeScale,h&&v===h.timescale)y=!1;else{const t=this.getVideoStartPts(l),e=ls(l[0].dts,t),r=this.computeInitPts(e,v,n,"video"),o=this.computeInitPts(t,v,n,"video");m=Math.min(m,r),f=Math.min(f,o)}this.videoTrackConfig={width:e.width,height:e.height,pixelRatio:e.pixelRatio}}if(Object.keys(d).length)return this.ISGenerated=!0,y?(h&&this.warn(`Timestamps at playlist time: ${r?"":"~"}${n} ${f/v} != initPTS: ${h.baseTime/h.timescale} (${h.baseTime}/${h.timescale}) trackId: ${h.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${f/v} (${f}/${v}) trackId: ${T}`),this._initPTS={baseTime:f,timescale:v,trackId:T},this._initDTS={baseTime:m,timescale:v,trackId:T}):f=v=void 0,{tracks:d,initPTS:f,timescale:v,trackId:T}}remuxVideo(track,t,e,n){const r=track.inputTimeScale,o=track.samples,l=[],f=o.length,m=this._initPTS,v=m.baseTime*r/m.timescale;let y,E,T=this.nextVideoTs,k=8,S=this.videoSampleDuration,_=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,w=!1;if(!e||null===T){const n=v+t*r,l=o[0].pts-ls(o[0].dts,o[0].pts);rs&&null!==T&&Math.abs(n-l-(T+v))<15e3?e=!0:T=n-l-v}const I=T+v;for(let i=0;i<f;i++){const t=o[i];t.pts=ls(t.pts,I),t.dts=ls(t.dts,I),t.dts<o[i>0?i-1:i].dts&&(w=!0)}w&&o.sort((function(a,b){const t=a.dts-b.dts,e=a.pts-b.pts;return t||e})),y=o[0].dts,E=o[o.length-1].dts;const R=E-y,L=R?Math.round(R/(f-1)):S||track.inputTimeScale/30;if(e){const e=y-I,n=e>L,r=e<-1;if((n||r)&&(n?this.warn(`${(track.segmentCodec||"").toUpperCase()}: ${es(e,!0)} ms (${e}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(track.segmentCodec||"").toUpperCase()}: ${es(-e,!0)} ms (${e}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!r||I>=o[0].pts||rs)){y=I;const t=o[0].pts-e;if(n)o[0].dts=y,o[0].pts=t;else{let n=!0;for(let i=0;i<o.length&&!(o[i].dts>t&&n);i++){const t=o[i].pts;if(o[i].dts-=e,o[i].pts-=e,i<o.length-1){const e=o[i+1].pts;n=e<=o[i].pts==e<=t}}}this.log(`Video: Initial PTS/DTS adjusted: ${es(t,!0)}/${es(y,!0)}, delta: ${es(e,!0)} ms`)}}y=Math.max(0,y);let x=0,D=0,C=y;for(let i=0;i<f;i++){const t=o[i],e=t.units,n=e.length;let r=0;for(let t=0;t<n;t++)r+=e[t].data.length;D+=r,x+=n,t.length=r,t.dts<C?(t.dts=C,C+=L/4|0||1):C=t.dts,_=Math.min(t.pts,_),A=Math.max(t.pts,A)}E=o[f-1].dts;const P=D+4*x+8;let M;try{M=new Uint8Array(P)}catch(t){return void this.observer.emit(h.ERROR,h.ERROR,{type:c.MUX_ERROR,details:d.REMUX_ALLOC_ERROR,fatal:!1,error:t,bytes:P,reason:`fail allocating video mdat ${P}`})}const view=new DataView(M.buffer);view.setUint32(0,P),M.set(Jr.types.mdat,4);let j=!1,F=Number.POSITIVE_INFINITY,N=Number.POSITIVE_INFINITY,U=Number.NEGATIVE_INFINITY,B=Number.NEGATIVE_INFINITY;for(let i=0;i<f;i++){const t=o[i],e=t.units;let c,d=0;for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.data,o=n.data.byteLength;view.setUint32(k,o),k+=4,M.set(r,k),k+=o,d+=4+o}if(i<f-1)S=o[i+1].dts-t.dts,c=o[i+1].pts-t.pts;else{const e=this.config,l=i>0?t.dts-o[i-1].dts:L;if(c=i>0?t.pts-o[i-1].pts:L,e.stretchShortVideoTrack&&null!==this.nextAudioTs){const o=Math.floor(e.maxBufferHole*r),c=(n?_+n*r:this.nextAudioTs+v)-t.pts;c>o?(S=c-l,S<0?S=l:j=!0,this.log(`It is approximately ${c/90} ms to the next segment; using duration ${S/90} ms for the last video frame.`)):S=l}else S=l}const h=Math.round(t.pts-t.dts);F=Math.min(F,S),U=Math.max(U,S),N=Math.min(N,c),B=Math.max(B,c),l.push(as(t.key,S,d,h))}if(l.length)if(rs){if(rs<70){const t=l[0].flags;t.dependsOn=2,t.isNonSync=0}}else if(ss&&B-N<U-F&&L/U<.025&&0===l[0].cts){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let t=y;for(let i=0,e=l.length;i<e;i++){const n=t+l[i].duration,r=t+l[i].cts;if(i<e-1){const t=n+l[i+1].cts;l[i].duration=t-r}else l[i].duration=i?l[i-1].duration:L;l[i].cts=0,t=n}}S=j||!S?L:S;const $=E+S;this.nextVideoTs=T=$-v,this.videoSampleDuration=S,this.isVideoContiguous=!0;const data={data1:Jr.moof(track.sequenceNumber++,y,O(track,{samples:l})),data2:M,startPTS:(_-v)/r,endPTS:(A+S-v)/r,startDTS:(y-v)/r,endDTS:T/r,type:"video",hasAudio:!1,hasVideo:!0,nb:l.length,dropped:track.dropped};return track.samples=[],track.dropped=0,data}getSamplesPerFrame(track){switch(track.segmentCodec){case"mp3":return 1152;case"ac3":return 1536;default:return 1024}}remuxAudio(track,t,e,n,r){const o=track.inputTimeScale,l=o/(track.samplerate?track.samplerate:o),f=this.getSamplesPerFrame(track),m=f*l,v=this._initPTS,y="mp3"===track.segmentCodec&&this.typeSupported.mpeg,E=[],T=void 0!==r;let k=track.samples,S=y?0:8,_=this.nextAudioTs||-1;const A=v.baseTime*o/v.timescale,w=A+t*o;if(this.isAudioContiguous=e=e||k.length&&_>0&&(n&&Math.abs(w-(_+A))<9e3||Math.abs(ls(k[0].pts,w)-(_+A))<20*m),k.forEach((function(t){t.pts=ls(t.pts,w)})),!e||_<0){const t=k.length;if(k=k.filter((t=>t.pts>=0)),t!==k.length&&this.warn(`Removed ${k.length-t} of ${t} samples (initPTS ${A} / ${o})`),!k.length)return;_=0===r?0:n&&!T?Math.max(0,w-A):k[0].pts-A}if("aac"===track.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let i=0,e=_+A;i<k.length;i++){const n=k[i],r=n.pts,l=r-e,c=Math.abs(1e3*l/o);if(l<=-t*m&&T)0===i&&(this.warn(`Audio frame @ ${(r/o).toFixed(3)}s overlaps marker by ${Math.round(1e3*l/o)} ms.`),this.nextAudioTs=_=r-A,e=r);else if(l>=t*m&&c<1e4&&T){let t=Math.round(l/m);for(e=r-t*m;e<0&&t&&m;)t--,e+=m;0===i&&(this.nextAudioTs=_=e-A),this.warn(`Injecting ${t} audio frames @ ${((e-A)/o).toFixed(3)}s due to ${Math.round(1e3*l/o)} ms gap.`);for(let r=0;r<t;r++){let t=Xr.getSilentFrame(track.parsedCodec||track.manifestCodec||track.codec,track.channelCount);t||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),t=n.unit.subarray()),k.splice(i,0,{unit:t,pts:e}),e+=m,i++}}n.pts=e,e+=m}}let I,R=null,L=null,x=0,D=k.length;for(;D--;)x+=k[D].unit.byteLength;for(let t=0,n=k.length;t<n;t++){const n=k[t],r=n.unit;let o=n.pts;if(null!==L){E[t-1].duration=Math.round((o-L)/l)}else{if(e&&"aac"===track.segmentCodec&&(o=_+A),R=o,!(x>0))return;x+=S;try{I=new Uint8Array(x)}catch(t){return void this.observer.emit(h.ERROR,h.ERROR,{type:c.MUX_ERROR,details:d.REMUX_ALLOC_ERROR,fatal:!1,error:t,bytes:x,reason:`fail allocating audio mdat ${x}`})}if(!y){new DataView(I.buffer).setUint32(0,x),I.set(Jr.types.mdat,4)}}I.set(r,S);const m=r.byteLength;S+=m,E.push(as(!0,f,m,0)),L=o}const C=E.length;if(!C)return;const P=E[E.length-1];_=L-A,this.nextAudioTs=_+l*P.duration;const M=y?new Uint8Array(0):Jr.moof(track.sequenceNumber++,R/l,O({},track,{samples:E}));track.samples=[];const j=(R-A)/o,F=this.nextAudioTs/o,N={data1:M,data2:I,startPTS:j,endPTS:F,startDTS:j,endDTS:F,type:"audio",hasAudio:!0,hasVideo:!1,nb:C};return this.isAudioContiguous=!0,N}}function ls(t,e){let n;if(null===e)return t;for(n=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=n;return t}function cs(track,t,e,n){const r=track.samples.length;if(!r)return;const o=track.inputTimeScale;for(let l=0;l<r;l++){const r=track.samples[l];r.pts=ls(r.pts-e.baseTime*o/e.timescale,t*o)/o,r.dts=ls(r.dts-n.baseTime*o/n.timescale,t*o)/o}const l=track.samples;return track.samples=[],{samples:l}}function us(track,t,e){const n=track.samples.length;if(!n)return;const r=track.inputTimeScale;for(let o=0;o<n;o++){const n=track.samples[o];n.pts=ls(n.pts-e.baseTime*r/e.timescale,t*r)/r}track.samples.sort(((a,b)=>a.pts-b.pts));const o=track.samples;return track.samples=[],{samples:o}}function ds(t,e,n=!1){return void 0!==(null==t?void 0:t.start)?(t.start+(n?t.duration:0))/t.timescale:e}function hs(track,t,e){const n=track.codec;if(n&&n.length>4)return n;if(t===K){if("ec-3"===n||"ac-3"===n||"alac"===n)return n;if("fLaC"===n||"Opus"===n){return Ut(n,!1)}return e.warn(`Unhandled audio codec "${n}" in mp4 MAP`),n||"mp4a"}return e.warn(`Unhandled video codec "${n}" in mp4 MAP`),n||"avc1"}try{is=self.performance.now.bind(self.performance)}catch(t){is=Date.now}const fs=[{demux:class{constructor(t,e){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=e}resetTimeStamp(){}resetInitSegment(t,e,n,r){const o=this.videoTrack=Er("video",1),l=this.audioTrack=Er("audio",1),c=this.txtTrack=Er("text",1);if(this.id3Track=Er("id3",1),this.timeOffset=0,null==t||!t.byteLength)return;const d=ft(t);if(d.video){const{id:t,timescale:e,codec:n,supplemental:r}=d.video;o.id=t,o.timescale=c.timescale=e,o.codec=n,o.supplemental=r}if(d.audio){const{id:t,timescale:e,codec:n}=d.audio;l.id=t,l.timescale=e,l.codec=n}c.id=it.text,o.sampleDuration=0,o.duration=l.duration=r}resetContiguity(){this.remainderData=null}static probe(data){return function(data){const t=data.byteLength;for(let i=0;i<t;){const e=ot(data,i);if(e>8&&109===data[i+4]&&111===data[i+5]&&111===data[i+6]&&102===data[i+7])return!0;i=e>1?i+e:t}return!1}(data)}demux(data,t){this.timeOffset=t;let e=data;const n=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(e=Tt(this.remainderData,data));const t=function(data){const t={valid:null,remainder:null},e=ut(data,["moof"]);if(e.length<2)return t.remainder=data,t;const n=e[e.length-1];return t.valid=data.slice(0,n.byteOffset-8),t.remainder=data.slice(n.byteOffset-8),t}(e);this.remainderData=t.remainder,n.samples=t.valid||new Uint8Array}else n.samples=e;const o=this.extractID3Track(n,t);return r.samples=kt(t,n),{videoTrack:n,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}}flush(){const t=this.timeOffset,e=this.videoTrack,n=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(e,this.timeOffset);return n.samples=kt(t,e),{videoTrack:e,audioTrack:Er(),id3Track:r,textTrack:Er()}}extractID3Track(t,e){const n=this.id3Track;if(t.samples.length){const r=ut(t.samples,["emsg"]);r&&r.forEach((data=>{const t=function(data){const t=data[0];let e="",n="",r=0,l=0,c=0,d=0,h=0,f=0;if(0===t){for(;"\0"!==st(data.subarray(f,f+1));)e+=st(data.subarray(f,f+1)),f+=1;for(e+=st(data.subarray(f,f+1)),f+=1;"\0"!==st(data.subarray(f,f+1));)n+=st(data.subarray(f,f+1)),f+=1;n+=st(data.subarray(f,f+1)),f+=1,r=ot(data,12),l=ot(data,16),d=ot(data,20),h=ot(data,24),f=28}else if(1===t){f+=4,r=ot(data,f),f+=4;const t=ot(data,f);f+=4;const l=ot(data,f);for(f+=4,c=2**32*t+l,o(c)||(c=Number.MAX_SAFE_INTEGER,M.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),d=ot(data,f),f+=4,h=ot(data,f),f+=4;"\0"!==st(data.subarray(f,f+1));)e+=st(data.subarray(f,f+1)),f+=1;for(e+=st(data.subarray(f,f+1)),f+=1;"\0"!==st(data.subarray(f,f+1));)n+=st(data.subarray(f,f+1)),f+=1;n+=st(data.subarray(f,f+1)),f+=1}return{schemeIdUri:e,value:n,timeScale:r,presentationTime:c,presentationTimeDelta:l,eventDuration:d,id:h,payload:data.subarray(f,data.byteLength)}}(data);if(jr.test(t.schemeIdUri)){const r=Fr(t,e);let o=4294967295===t.eventDuration?Number.POSITIVE_INFINITY:t.eventDuration/t.timeScale;o<=.001&&(o=Number.POSITIVE_INFINITY);const l=t.payload;n.samples.push({data:l,len:l.byteLength,dts:r,pts:r,type:yr.emsg,duration:o})}else if(this.config.enableEmsgKLVMetadata&&t.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const r=Fr(t,e);n.samples.push({data:t.payload,len:t.payload.byteLength,dts:r,pts:r,type:yr.misbklv,duration:Number.POSITIVE_INFINITY})}}))}return n}demuxSampleAes(data,t,e){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}},remux:class extends R{constructor(t,e,n,r){super("passthrough-remuxer",r),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(t){this.lastEndTime=null;const e=this.initPTS;e&&t&&e.baseTime===t.baseTime&&e.timescale===t.timescale||(this.initPTS=t)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(t,e,n,r){this.audioCodec=e,this.videoCodec=n,this.generateInitSegment(t,r),this.emitInitSegment=!0}generateInitSegment(t,e){let{audioCodec:n,videoCodec:r}=this;if(null==t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const{audio:audio,video:video}=this.initData=ft(t);if(e)!function(t,e){if(!t||!e)return;const n=e.keyId;n&&e.isCommonEncryption&&bt(t,((t,e)=>{const r=t.subarray(8,24);r.some((b=>0!==b))||(M.log(`[eme] Patching keyId in 'enc${e?"a":"v"}>sinf>>tenc' box: ${U(r)} -> ${U(n)}`),t.set(n,8))}))}(t,e);else{const t=audio||video;null!=t&&t.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${t.codec}")!`)}audio&&(n=hs(audio,K,this)),video&&(r=hs(video,Y,this));const o={};audio&&video?o.audiovideo={container:"video/mp4",codec:n+","+r,supplemental:video.supplemental,encrypted:video.encrypted,initSegment:t,id:"main"}:audio?o.audio={container:"audio/mp4",codec:n,encrypted:audio.encrypted,initSegment:t,id:"audio"}:video?o.video={container:"video/mp4",codec:r,supplemental:video.supplemental,encrypted:video.encrypted,initSegment:t,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=o}remux(t,e,n,o,l,c){var d,h;let{initPTS:f,lastEndTime:m}=this;const v={audio:void 0,video:void 0,text:o,id3:n,initSegment:void 0};r(m)||(m=this.lastEndTime=l||0);const data=e.samples;if(!data.length)return v;const y={initPTS:void 0,timescale:void 0,trackId:void 0};let E=this.initData;if(null!=(d=E)&&d.length||(this.generateInitSegment(data),E=this.initData),null==(h=E)||
vendor: 5,606 bytes, line 2
2!h.length)return this.warn("Failed to generate initSegment."),v;this.emitInitSegment&&(y.tracks=this.initTracks,this.emitInitSegment=!1);const T=function(data,t,e){const n={},o=ut(data,["moof","traf"]);for(let i=0;i<o.length;i++){const l=o[i],c=ut(l,["tfhd"])[0],d=ot(c,4),track=t[d];if(!track)continue;n[d]||(n[d]={start:NaN,duration:0,sampleCount:0,timescale:track.timescale,type:track.type});const h=n[d],f=ut(l,["tfdt"])[0];if(f){const t=f[0];let n=ot(f,4);1===t&&(n===et?e.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(n*=et+1,n+=ot(f,8))),r(n)&&(!r(h.start)||n<h.start)&&(h.start=n)}const m=track.default,v=ot(c,0)|(null==m?void 0:m.flags);let y=(null==m?void 0:m.duration)||0;8&v&&(y=ot(c,2&v?12:8));const E=ut(l,["trun"]);let T=h.start||0,k=0,S=y;for(let t=0;t<E.length;t++){const e=E[t],n=ot(e,4),r=h.sampleCount;h.sampleCount+=n;const o=1&e[3],l=4&e[3],c=1&e[2],d=2&e[2],f=4&e[2],m=8&e[2];let v=8,_=n;for(o&&(v+=4),l&&n&&(1&e[v+1]||void 0!==h.keyFrameIndex||(h.keyFrameIndex=r),v+=4,c?(S=ot(e,v),v+=4):S=y,d&&(v+=4),m&&(v+=4),T+=S,k+=S,_--);_--;)c?(S=ot(e,v),v+=4):S=y,d&&(v+=4),f&&(1&e[v+1]||void 0===h.keyFrameIndex&&(h.keyFrameIndex=h.sampleCount-(_+1),h.keyFrameStart=T),v+=4),m&&(v+=4),T+=S,k+=S;!k&&y&&(k+=y*n)}h.duration+=k}if(!Object.keys(n).some((t=>n[t].duration))){let t=1/0,e=0;const o=ut(data,["sidx"]);for(let i=0;i<o.length;i++){const n=ht(o[i]);if(null!=n&&n.references){t=Math.min(t,n.earliestPresentationTime/n.timescale);const r=n.references.reduce(((t,e)=>t+e.info.duration||0),0);e=Math.max(e,r+n.earliestPresentationTime/n.timescale)}}e&&r(e)&&Object.keys(n).forEach((t=>{n[t].duration||(n[t].duration=e*n[t].timescale-n[t].start)}))}return n}(data,E,this),k=E.audio?T[E.audio.id]:null,S=E.video?T[E.video.id]:null,_=ds(S,1/0),A=ds(k,1/0),O=ds(S,0,!0),w=ds(k,0,!0);let I=l,R=0;const L=k&&(!S||!f&&A<_||f&&f.trackId===E.audio.id),x=L?k:S;if(x){const t=x.timescale,e=x.start-l*t,n=L?E.audio.id:E.video.id;I=x.start/t,R=L?w-A:O-_,!c&&f||!function(t,e,n,r){if(null===t)return!0;const o=Math.max(r,1),l=e-t.baseTime/t.timescale;return Math.abs(l-n)>o}(f,I,l,R)&&t===f.timescale||(f&&this.warn(`Timestamps at playlist time: ${c?"":"~"}${l} ${e/t} != initPTS: ${f.baseTime/f.timescale} (${f.baseTime}/${f.timescale}) trackId: ${f.trackId}`),this.log(`Found initPTS at playlist time: ${l} offset: ${I-l} (${e}/${t}) trackId: ${n}`),f=null,y.initPTS=e,y.timescale=t,y.trackId=n)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${l}`);f?(y.initPTS=f.baseTime,y.timescale=f.timescale,y.trackId=f.trackId):(y.timescale&&void 0!==y.trackId&&void 0!==y.initPTS||(this.warn("Could not set initPTS"),y.initPTS=I,y.timescale=1,y.trackId=-1),this.initPTS=f={baseTime:y.initPTS,timescale:y.timescale,trackId:y.trackId});const D=I-f.baseTime/f.timescale,C=D+R;R>0?this.lastEndTime=C:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const P=!!E.audio,M=!!E.video;let j="";P&&(j+="audio"),M&&(j+="video");const track={data1:data,startPTS:D,startDTS:D,endPTS:C,endDTS:C,type:j,hasAudio:P,hasVideo:M,nb:1,dropped:0,encrypted:!!E.audio&&E.audio.encrypted||!!E.video&&E.video.encrypted};v.audio=P&&!M?track:void 0,v.video=M?track:void 0;const F=null==S?void 0:S.sampleCount;if(F){const t=S.keyFrameIndex,e=-1!==t;track.nb=F,track.dropped=0===t||this.isVideoContiguous?0:e?t:F,track.independent=e,track.firstKeyFrame=t,e&&S.keyFrameStart&&(track.firstKeyFramePTS=(S.keyFrameStart-f.baseTime)/f.timescale),this.isVideoContiguous||(v.independent=e),this.isVideoContiguous||(this.isVideoContiguous=e),track.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${t}/${F} dropped: ${track.dropped} start: ${track.firstKeyFramePTS||"NA"}`)}return v.initSegment=y,v.id3=cs(n,l,f,f),o.samples.length&&(v.text=us(o,l,f)),v}}},{demux:Hr,remux:os},{demux:class extends Tr{constructor(t,e){super(),this.observer=void 0,this.config=void 0,this.observer=t,this.config=e}resetInitSegment(t,e,n,r){super.resetInitSegment(t,e,n,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}}static probe(data,t){if(!data)return!1;const e=Zi(data,0);let n=(null==e?void 0:e.length)||0;if(Dr(data,n))return!1;for(let e=data.length;n<e;n++)if(rr(data,n))return t.log("ADTS sync word found !"),!0;return!1}canParse(data,t){return function(data,t){return function(data,t){return t+5<data.length}(data,t)&&Ji(data,t)&&nr(data,t)<=data.length-t}(data,t)}appendFrame(track,data,t){sr(track,this.observer,data,t,track.manifestCodec);const e=or(track,data,t,this.basePTS,this.frameIndex);if(e&&0===e.missing)return e}},remux:os},{demux:class extends Tr{resetInitSegment(t,e,n,r){super.resetInitSegment(t,e,n,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}}static probe(data){if(!data)return!1;const t=Zi(data,0);let e=(null==t?void 0:t.length)||0;if(t&&11===data[e]&&119===data[e+1]&&void 0!==vr(t)&&Cr(data,e)<=16)return!1;for(let t=data.length;e<t;e++)if(Dr(data,e))return M.log("MPEG Audio sync word found !"),!0;return!1}canParse(data,t){return function(data,t){return Lr(data,t)&&4<=data.length-t}(data,t)}appendFrame(track,data,t){if(null!==this.basePTS)return Ir(track,data,t,this.basePTS,this.frameIndex)}},remux:os}];fs.splice(2,0,{demux:Pr,remux:os});class ps{constructor(t,e,n,r,o,l){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupp
vendor: 4,452 bytes, line 2
2orted=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=t,this.typeSupported=e,this.config=n,this.id=o,this.logger=l}configure(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()}push(data,t,e,n){const r=e.transmuxing;r.executeStart=is();let o=new Uint8Array(data);const{currentTransmuxState:l,transmuxConfig:f}=this;n&&(this.currentTransmuxState=n);const{contiguous:m,discontinuity:v,trackSwitch:y,accurateTimeOffset:E,timeOffset:T,initSegmentChange:k}=n||l,{audioCodec:S,videoCodec:_,defaultInitPts:A,duration:O,initSegmentData:w}=f,I=function(data,t){let e=null;data.byteLength>0&&null!=(null==t?void 0:t.key)&&null!==t.iv&&null!=t.method&&(e=t);return e}(o,t);if(I&&kn(I.method)){const t=this.getDecrypter(),n=Sn(I.method);if(!t.isSync())return this.asyncResult=!0,this.decryptionPromise=t.webCryptoDecrypt(o,I.key.buffer,I.iv.buffer,n).then((t=>{const n=this.push(t,null,e);return this.decryptionPromise=null,n})),this.decryptionPromise;{let l=t.softwareDecrypt(o,I.key.buffer,I.iv.buffer,n);if(e.part>-1){const e=t.flush();l=e?e.buffer:e}if(!l)return r.executeEnd=is(),ms(e);o=new Uint8Array(l)}}const R=this.needsProbing(v,y);if(R){const t=this.configureTransmuxer(o);if(t)return this.logger.warn(`[transmuxer] ${t.message}`),this.observer.emit(h.ERROR,h.ERROR,{type:c.MEDIA_ERROR,details:d.FRAG_PARSING_ERROR,fatal:!1,error:t,reason:t.message}),r.executeEnd=is(),ms(e)}(v||y||k||R)&&this.resetInitSegment(w,S,_,O,t),(v||k||R)&&this.resetInitialTimestamp(A),m||this.resetContiguity();const L=this.transmux(o,I,T,E,e);this.asyncResult=gs(L);const x=this.currentTransmuxState;return x.contiguous=!0,x.discontinuity=!1,x.trackSwitch=!1,r.executeEnd=is(),L}flush(t){const e=t.transmuxing;e.executeStart=is();const{decrypter:n,currentTransmuxState:r,decryptionPromise:o}=this;if(o)return this.asyncResult=!0,o.then((()=>this.flush(t)));const l=[],{timeOffset:c}=r;if(n){const e=n.flush();e&&l.push(this.push(e.buffer,null,t))}const{demuxer:d,remuxer:h}=this;if(!d||!h){e.executeEnd=is();const n=[ms(t)];return this.asyncResult?Promise.resolve(n):n}const f=d.flush(c);return gs(f)?(this.asyncResult=!0,f.then((e=>(this.flushRemux(l,e,t),l)))):(this.flushRemux(l,f,t),this.asyncResult?Promise.resolve(l):l)}flushRemux(t,e,n){const{audioTrack:r,videoTrack:o,id3Track:l,textTrack:c}=e,{accurateTimeOffset:d,timeOffset:h}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===E?"level":"track"} ${n.level}`);const f=this.remuxer.remux(r,o,l,c,h,d,!0,this.id);t.push({remuxResult:f,chunkMeta:n}),n.transmuxing.executeEnd=is()}resetInitialTimestamp(t){const{demuxer:e,remuxer:n}=this;e&&n&&(e.resetTimeStamp(t),n.resetTimeStamp(t))}resetContiguity(){const{demuxer:t,remuxer:e}=this;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())}resetInitSegment(t,e,n,r,o){const{demuxer:l,remuxer:c}=this;l&&c&&(l.resetInitSegment(t,e,n,r),c.resetInitSegment(t,e,n,o))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(data,t,e,n,r){let o;return o=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(data,t,e,n,r):this.transmuxUnencrypted(data,e,n,r),o}transmuxUnencrypted(data,t,e,n){const{audioTrack:r,videoTrack:o,id3Track:l,textTrack:c}=this.demuxer.demux(data,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,o,l,c,t,e,!1,this.id),chunkMeta:n}}transmuxSampleAes(data,t,e,n,r){return this.demuxer.demuxSampleAes(data,t,e).then((t=>({remuxResult:this.remuxer.remux(t.audioTrack,t.videoTrack,t.id3Track,t.textTrack,e,n,!1,this.id),chunkMeta:r})))}configureTransmuxer(data){const{config:t,observer:e,typeSupported:n}=this;let r;for(let i=0,t=fs.length;i<t;i++){var o;if(null!=(o=fs[i].demux)&&o.probe(data,this.logger)){r=fs[i];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const l=this.demuxer,c=this.remuxer,d=r.remux,h=r.demux;c&&c instanceof d||(this.remuxer=new d(e,t,n,this.logger)),l&&l instanceof h||(this.demuxer=new h(e,t,n,this.logger),this.probe=h.probe)}needsProbing(t,e){return!this.demuxer||!this.remuxer||t||e}getDecrypter(){let t=this.decrypter;return t||(t=this.decrypter=new Ze(this.config)),t}}const ms=t=>({remuxResult:{},chunkMeta:t});
vendor: 3,803 bytes, line 2
2function gs(p){return"then"in p&&p.then instanceof Function}class vs{constructor(t,e,n,r,o){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=n,this.duration=r,this.defaultInitPts=o||null}}class ys{constructor(t,e,n,r,o,l){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=t,this.contiguous=e,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=o,this.initSegmentChange=l}}let bs=0;class Es{constructor(t,e,n,r){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=bs++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=t=>{const data=t.data,e=this.hls;if(e&&null!=data&&data.event&&data.instanceNo===this.instanceNo)switch(data.event){case"init":{var n;const t=null==(n=this.workerContext)?void 0:n.objectURL;t&&self.URL.revokeObjectURL(t);break}case"transmuxComplete":this.handleTransmuxComplete(data.data);break;case"flush":this.onFlush(data.data);break;case"workerLog":e.logger[data.data.logType]&&e.logger[data.data.logType](data.data.message);break;default:data.data=data.data||{},data.data.frag=this.frag,data.data.part=this.part,data.data.id=this.id,e.trigger(data.event,data.data)}},this.onWorkerError=t=>{if(!this.hls)return;const e=new Error(`${t.message} (${t.filename}:${t.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(h.ERROR,{type:c.OTHER_ERROR,details:d.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:e})};const o=t.config;this.hls=t,this.id=e,this.useWorker=!!o.enableWorker,this.onTransmuxComplete=n,this.onFlush=r;const l=(t,data)=>{(data=data||{}).frag=this.frag||void 0,t===h.ERROR&&(data.parent=this.id,data.part=this.part,this.error=data.error),this.hls.trigger(t,data)};this.observer=new Ki,this.observer.on(h.FRAG_DECRYPTED,l),this.observer.on(h.ERROR,l);const f=Gt(o.preferManagedMediaSource);if(this.useWorker&&"undefined"!=typeof Worker){const n=this.hls.logger;if(o.workerPath||"function"==typeof __HLS_WORKER_BUNDLE__){try{o.workerPath?(n.log(`loading Web Worker ${o.workerPath} for "${e}"`),this.workerContext=function(path){const t=Yi[path];if(t)return t.clientCount++,t;const e=new self.URL(path,self.location.href).href,n={worker:new self.Worker(e),scriptURL:e,clientCount:1};return Yi[path]=n,n}(o.workerPath)):(n.log(`injecting Web Worker for "${e}"`),this.workerContext=function(){const t=Yi[qi];if(t)return t.clientCount++,t;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),n=self.URL.createObjectURL(e),r={worker:new self.Worker(n),objectURL:n,clientCount:1};return Yi[qi]=r,r}());const{worker:t}=this.workerContext;t.addEventListener("message",this.onWorkerMessage),t.addEventListener("error",this.onWorkerError),t.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:f,id:e,config:le(o)})}catch(r){n.warn(`Error setting up "${e}" Web Worker, fallback to inline`,r),this.terminateWorker(),this.error=null,this.transmuxer=new ps(this.observer,f,o,"",e,t.logger)}return}}this.transmuxer=new ps(this.observer,f,o,"",e,t.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const t=this.instanceNo;this.instanceNo=bs++;const e=this.hls.config,n=Gt(e.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:t,typeSupported:n,id:this.id,c
vendor: 4,536 bytes, line 2
2onfig:le(e)})}}terminateWorker(){if(this.workerContext){const{worker:t}=this.workerContext;this.workerContext=null,t.removeEventListener("message",this.onWorkerMessage),t.removeEventListener("error",this.onWorkerError),function(path){const t=Yi[path||qi];if(t&&1==t.clientCount--){const{worker:e,objectURL:n}=t;delete Yi[path||qi],n&&self.URL.revokeObjectURL(n),e.terminate()}}(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const t=this.observer;t&&t.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(data,t,e,n,r,o,l,c,d,h){var f,m;d.transmuxing.start=self.performance.now();const{instanceNo:v,transmuxer:y}=this,T=o?o.start:r.start,k=r.decryptdata,S=this.frag,_=!(S&&r.cc===S.cc),A=!(S&&d.level===S.level),O=S?d.sn-S.sn:-1,w=this.part?d.part-this.part.index:-1,I=0===O&&d.id>1&&d.id===(null==S?void 0:S.stats.chunkCount),R=!A&&(1===O||0===O&&(1===w||I&&w<=0)),L=self.performance.now();(A||O||0===r.stats.parsing.start)&&(r.stats.parsing.start=L),!o||!w&&R||(o.stats.parsing.start=L);const x=!(S&&(null==(f=r.initSegment)?void 0:f.url)===(null==(m=S.initSegment)?void 0:m.url)),D=new ys(_,R,c,A,T,x);if(!R||_||x){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${d.sn}${d.part>-1?" part: "+d.part:""} ${this.id===E?"level":"track"}: ${d.level} id: ${d.id}\n discontinuity: ${_}\n trackSwitch: ${A}\n contiguous: ${R}\n accurateTimeOffset: ${c}\n timeOffset: ${T}\n initSegmentChange: ${x}`);const o=new vs(e,n,t,l,h);this.configureTransmuxer(o)}if(this.frag=r,this.part=o,this.workerContext)this.workerContext.worker.postMessage({instanceNo:v,cmd:"demux",data:data,decryptdata:k,chunkMeta:d,state:D},data instanceof ArrayBuffer?[data]:[]);else if(y){const t=y.push(data,k,d,D);gs(t)?t.then((data=>{this.handleTransmuxComplete(data)})).catch((t=>{this.transmuxerError(t,d,"transmuxer-interface push error")})):this.handleTransmuxComplete(t)}}flush(t){t.transmuxing.start=self.performance.now();const{instanceNo:e,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:e,cmd:"flush",chunkMeta:t});else if(n){const e=n.flush(t);gs(e)?e.then((data=>{this.handleFlushResult(data,t)})).catch((e=>{this.transmuxerError(e,t,"transmuxer-interface flush error")})):this.handleFlushResult(e,t)}}transmuxerError(t,e,n){this.hls&&(this.error=t,this.hls.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.FRAG_PARSING_ERROR,chunkMeta:e,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:t,err:t,reason:n}))}handleFlushResult(t,e){t.forEach((t=>{this.handleTransmuxComplete(t)})),this.onFlush(e)}configureTransmuxer(t){const{instanceNo:e,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:e,cmd:"configure",config:t}):n&&n.configure(t)}handleTransmuxComplete(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)}}class Ts extends R{constructor(t,e){super(e,t.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=t}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(t,e,n){const r=null==e?void 0:e.renditionReports;if(r){let o=-1;for(let i=0;i<r.length;i++){const n=r[i];let l;try{l=new self.URL(n.URI,e.url).href}catch(t){this.warn(`Could not construct new URL for Rendition Report: ${t}`),l=n.URI||""}if(l===t){o=i;break}l===t.substring(0,l.length)&&(o=i)}if(-1!==o){const t=r[o],l=parseInt(t["LAST-MSN"])||e.lastPartSn;let c=parseInt(t["LAST-PART"])||e.lastPartIndex;if(this.hls.config.lowLatencyMode){const t=Math.min(e.age-e.partTarget,e.targetduration);c>=0&&t>e.partTarget&&(c+=1)}const d=n&&ie(n);return new re(l,c>=0?c:void 0,d)}}}loadPlaylist(t){this.clearTimer()}loadingPlaylist(t,e){this.clearTimer()}shouldLoadPlaylist(t){return this.canLoad&&!!t&&!!t.url&&(!t.details||t.details.live)}getUrlWithDirectives(t,e){if(e)try{return e.addDirectives(t)}catch(t){this.warn(`Could not construct new URL with HLS Delivery Directives: ${t}`)}return t}playlistLoaded(t,data,e){const{details:details,stats:n}=data,r=self.performance.now(),o=n.loading.first?Math.max(0,r-n.loading.first):0;details.advancedDateTime=Date.now()-o;const l=this.hls.config.timelineOffset;
vendor: 2,587 bytes, line 2
2if(l!==details.appliedTimelineOffset){const t=Math.max(l||0,0);details.appliedTimelineOffset=t,details.fragments.forEach((e=>{e.setStart(e.playlistOffset+t)}))}if(details.live||null!=e&&e.live){const l="levelInfo"in data?data.levelInfo:data.track;if(details.reloaded(e),e&&details.fragments.length>0){ci(e,details,this);const t=details.playlistParsingError;if(t){this.warn(t);const e=this.hls;if(!e.config.ignorePlaylistParsingErrors){var f;const{networkDetails:r}=data;return void e.trigger(h.ERROR,{type:c.NETWORK_ERROR,details:d.LEVEL_PARSING_ERROR,fatal:!1,url:details.url,error:t,reason:t.message,level:data.level||void 0,parent:null==(f=details.fragments[0])?void 0:f.type,networkDetails:r,stats:n})}details.playlistParsingError=null}}-1===details.requestScheduled&&(details.requestScheduled=n.loading.start);const m=this.hls.mainForwardBufferInfo,v=m?m.end-m.len:0,y=fi(details,1e3*(details.edge-v));if(details.requestScheduled+y<r?details.requestScheduled=r:details.requestScheduled+=y,this.log(`live playlist ${t} ${details.advanced?"REFRESHED "+details.lastPartSn+"-"+details.lastPartIndex:details.updated?"UPDATED":"MISSED"}`),!this.canLoad||!details.live)return;let E,T,k;if(details.canBlockReload&&details.endSN&&details.advanced){const t=this.hls.config.lowLatencyMode,n=details.lastPartSn,o=details.endSN,c=details.lastPartIndex,d=n===o;-1!==c?d?(T=o+1,k=t?0:c):(T=n,k=t?c+1:details.maxPartIndex):T=o+1;const h=details.age,f=h+details.ageHeader;let m=Math.min(f-details.partTarget,1.5*details.targetduration);if(m>0){if(f>3*details.targetduration)this.log(`Playlist last advanced ${h.toFixed(2)}s ago. Omitting segment and part directives.`),T=void 0,k=void 0;else if(null!=e&&e.tuneInGoal&&f-details.partTarget>e.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${e.tuneInGoal} to: ${m} with playlist age: ${details.age}`),m=0;else{const t=Math.floor(m/details.targetduration);if(T+=t,void 0!==k){k+=Math.round(m%details.targetduration/details.partTarget)}this.log(`CDN Tune-in age: ${details.ageHeader}s last advanced ${h.toFixed(2)}s goal: ${m} skip sn ${t} to part ${k}`)}details.tuneInGoal=m}if(E=this.getDeliveryDirectives(details,data.deliveryDirectives,T,k),t||!d)return details.requestScheduled=r,void this.loadingPlaylist(l,E)}else(details.canBlockReload||details.canSkipUntil)&&(E=this.getDeliveryDirectives(details,data.deliveryDirectives,T,k));E&&void 0!==T&&details.canBlockReload&&(details.requestScheduled=n.loading.first+Math.max(y-2*o,y/2)),this.scheduleLoading(l,E,details)}else this.clearTimer()}scheduleLoading(t,e,n){const details=n||t.details;
vendor: 8,098 bytes, line 2
2if(!details)return void this.loadingPlaylist(t,e);const r=self.performance.now(),o=details.requestScheduled;if(r>=o)return void this.loadingPlaylist(t,e);const l=o-r;this.log(`reload live playlist ${t.name||t.bitrate+"bps"} in ${Math.round(l)} ms`),this.clearTimer(),this.timer=self.setTimeout((()=>this.loadingPlaylist(t,e)),l)}getDeliveryDirectives(details,t,e,n){let r=ie(details);return null!=t&&t.skip&&details.deltaUpdateFailed&&(e=t.msn,n=t.part,r=te),new re(e,n,r)}checkRetry(t){const e=t.details,n=ke(t),r=t.errorAction,{action:o,retryCount:l=0,retryConfig:c}=r||{},d=!!r&&!!c&&(o===Ce||!r.resolved&&o===xe);if(d){var h;if(l>=c.maxNumRetry)return!1;if(n&&null!=(h=t.context)&&h.deliveryDirectives)this.warn(`Retrying playlist loading ${l+1}/${c.maxNumRetry} after "${e}" without delivery-directives`),this.loadPlaylist();else{const t=Oe(c,l);this.clearTimer(),this.timer=self.setTimeout((()=>this.loadPlaylist()),t),this.warn(`Retrying playlist loading ${l+1}/${c.maxNumRetry} after "${e}" in ${t}ms`)}t.levelRetry=!0,r.resolved=!0}return d}}function ks(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!Ss(t[i].attrs,e[i].attrs))return!1;return!0}function Ss(t,e,n){const r=t["STABLE-RENDITION-ID"];return r&&!n?r===e["STABLE-RENDITION-ID"]:!(n||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some((n=>t[n]!==e[n]))}function _s(t,e){return e.label.toLowerCase()===t.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(t.lang||"").toLowerCase())}class As{constructor(t){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=t}destroy(){this.tracks=this.queues=null}append(t,e,n){if(null===this.queues||null===this.tracks)return;const r=this.queues[e];r.push(t),1!==r.length||n||this.executeNext(e)}appendBlocker(t){return new Promise((e=>{const n={label:"async-blocker",execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,t)}))}prependBlocker(t){return new Promise((e=>{if(this.queues){const n={label:"async-blocker-prepend",execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[t].unshift(n)}}))}removeBlockers(){null!==this.queues&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach((t=>{var e;const label=null==(e=t[0])?void 0:e.label;"async-blocker"!==label&&"async-blocker-prepend"!==label||(t[0].execute(),t.splice(0,1))}))}unblockAudio(t){if(null===this.queues)return;this.queues.audio[0]===t&&this.shiftAndExecuteNext("audio")}executeNext(t){if(null===this.queues||null===this.tracks)return;const e=this.queues[t];if(e.length){const r=e[0];try{r.execute()}catch(e){var n;if(r.onError(e),null===this.queues||null===this.tracks)return;const o=null==(n=this.tracks[t])?void 0:n.buffer;null!=o&&o.updating||this.shiftAndExecuteNext(t)}}}shiftAndExecuteNext(t){null!==this.queues&&(this.queues[t].shift(),this.executeNext(t))}current(t){var e;return(null==(e=this.queues)?void 0:e[t][0])||null}toString(){const{queues:t,tracks:e}=this;return null===t||null===e?"<destroyed>":`\n${this.list("video")}\n${this.list("audio")}\n${this.list("audiovideo")}}`}list(t){var e,n;return null!=(e=this.queues)&&e[t]||null!=(n=this.tracks)&&n[t]?`${t}: (${this.listSbInfo(t)}) ${this.listOps(t)}`:""}listSbInfo(t){var e;const track=null==(e=this.tracks)?void 0:e[t],n=null==track?void 0:track.buffer;return n?`SourceBuffer${n.updating?" updating":""}${track.ended?" ended":""}${track.ending?" ending":""}`:"none"}listOps(t){var e;return(null==(e=this.queues)?void 0:e[t].map((t=>t.label)).join(", "))||""}}const Os=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,ws="HlsJsTrackRemovedError";class Is extends Error{constructor(t){super(t),this.name=ws}}function Rs(t){const e=t.querySelectorAll("source");[].slice.call(e).forEach((source=>{t.removeChild(source)}))}function Ls(t){return"audio"===t?1:0}class xs{constructor(t){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(t){this.streamController=t}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:t}=this;t.on(h.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(h.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(h.MANIFEST_PARSED,this.onManifestParsed,this),t.on(h.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(h.BUFFER_CODECS,this.onBufferCodecs,this),t.on(h.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:t}=this;t.off(h.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(h.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(h.MANIFEST_PARSED,this.onManifestParsed,this),t.off(h.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(h.BUFFER_CODECS,this.onBufferCodecs,this),t.off(h.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(t,data){const e=this.hls.levels[data.droppedLevel];this.isLevelAllowed(e)&&this.restrictedLevels.push({bitrate:e.bitrate,height:e.height,width:e.width})}onMediaAttaching(t,data){this.media=data.media instanceof HTMLVideoElement?data.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(t,data){const e=this.hls;this.restrictedLevels=[],this.firstLevel=data.firstLevel,e.config.capLevelToPlayerSize&&data.video&&this.startCapping()}onLevelsUpdated(t,data){this.timer&&r(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(t,data){this.hls.config.capLevelToPlayerSize&&data.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0)return void(this.clientRect=null);const t=this.hls.levels;if(t.length){const e=this.hls,n=this.getMaxLevel(t.length-1);n!==this.autoLevelCapping&&e.logger.log(`Setting autoLevelCapping to ${n}: ${t[n].height}p@${t[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),e.autoLevelCapping=n,e.autoLevelEnabled&&e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}}getMaxLevel(t){const e=this.hls.levels;if(!e.length)return-1;const n=e.filter(((e,n)=>this.isLevelAllowed(e)&&n<=t));return this.clientRect=null,xs.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const t=this.media,e={width:0,height:0};if(t){const n=t.getBoundingClientRect();e.width=n.width,e.height=n.height,e.width||e.height||(e.width=n.right-n.left||t.width||0,e.height=n.bottom-n.top||t.height||0)}return this.clientRect=e,e}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch(t){}return Math.min(t,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(t){return!this.restrictedLevels.some((e=>t.bitrate===e.bitrate&&t.width===e.width&&t.height===e.height))}static getMaxLevelByMediaSize(t,e,n){if(null==t||!t.length)return-1;let r=t.length-1;const o=Math.max(e,n);for(let i=0;i<t.length;i+=1){const e=t[i];if((e.width>=o||e.height>=o)&&(l=e,!(c=t[i+1])||l.width!==c.width||l.height!==c.height)){r=i;break}}var l,c;return r}}const Ds={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",
vendor: 4,240 bytes, line 2
2KEY:"k",OTHER:"o"},Cs={HLS:"h"};class Ps{constructor(t,e){Array.isArray(t)&&(t=t.map((t=>t instanceof Ps?t:new Ps(t)))),this.value=t,this.params=e}}function Ms(t,e,n,r){return new Error(`failed to ${t} "${o=e,Array.isArray(o)?JSON.stringify(o):o instanceof Map?"Map{}":o instanceof Set?"Set{}":"object"==typeof o?JSON.stringify(o):String(o)}" as ${n}`,{cause:r});var o}function js(t,e,n){return Ms("serialize",t,e,n)}class Fs{constructor(t){this.description=t}}const Ns="Bare Item";function Us(t){if(!1===ArrayBuffer.isView(t))throw js(t,"Byte Sequence");return`:${e=t,btoa(String.fromCharCode(...e))}:`;var e}function Bs(t){if(function(t){return t<-999999999999999||999999999999999<t}(t))throw js(t,"Integer");return t.toString()}function $s(t,e){if(t<0)return-$s(-t,e);const n=Math.pow(10,e);if(Math.abs(t*n%1-.5)<Number.EPSILON){const e=Math.floor(t*n);return(e%2==0?e:e+1)/n}return Math.round(t*n)/n}function Vs(t){const e=$s(t,3);if(Math.floor(Math.abs(e)).toString().length>12)throw js(t,"Decimal");const n=e.toString();return n.includes(".")?n:`${n}.0`}const Gs=/[\x00-\x1f\x7f]+/;function Hs(t){const e=(symbol=t).description||symbol.toString().slice(7,-1);var symbol;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e))throw js(e,"Token");return e}function Ws(t){switch(typeof t){case"number":if(!r(t))throw js(t,Ns);return Number.isInteger(t)?Bs(t):Vs(t);case"string":return function(t){if(Gs.test(t))throw js(t,"String");return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(t);case"symbol":return Hs(t);case"boolean":return function(t){if("boolean"!=typeof t)throw js(t,"Boolean");return t?"?1":"?0"}(t);case"object":if(t instanceof Date)return function(t){return`@${Bs(t.getTime()/1e3)}`}(t);if(t instanceof Uint8Array)return Us(t);if(t instanceof Fs)return Hs(t);default:throw js(t,Ns)}}function Ks(t){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(t))throw js(t,"Key");return t}function qs(t){return null==t?"":Object.entries(t).map((([t,e])=>!0===e?`;${Ks(t)}`:`;${Ks(t)}=${Ws(e)}`)).join("")}function Ys(t){return t instanceof Ps?`${Ws(t.value)}${qs(t.params)}`:Ws(t)}function zs(t,e={whitespace:!0}){if("object"!=typeof t||null==t)throw js(t,"Dict");const n=t instanceof Map?t.entries():Object.entries(t),r=(null==e?void 0:e.whitespace)?" ":"";return Array.from(n).map((([t,e])=>{e instanceof Ps==!1&&(e=new Ps(e));let output=Ks(t);var n;return!0===e.value?output+=qs(e.params):(output+="=",Array.isArray(e.value)?output+=`(${(n=e).value.map(Ys).join(" ")})${qs(n.params)}`:output+=Ys(e)),output})).join(`,${r}`)}function Qs(t,e){return zs(t,e)}const Xs="CMCD-Object",Zs="CMCD-Request",Js="CMCD-Session",ta="CMCD-Status",ea={br:Xs,ab:Xs,d:Xs,ot:Xs,tb:Xs,tpb:Xs,lb:Xs,tab:Xs,lab:Xs,url:Xs,pb:Zs,bl:Zs,tbl:Zs,dl:Zs,ltc:Zs,mtp:Zs,nor:Zs,nrr:Zs,rc:Zs,sn:Zs,sta:Zs,su:Zs,ttfb:Zs,ttfbb:Zs,ttlb:Zs,cmsdd:Zs,cmsds:Zs,smrt:Zs,df:Zs,cs:Zs,ts:Zs,cid:Js,pr:Js,sf:Js,sid:Js,st:Js,v:Js,msd:Js,bs:ta,bsd:ta,cdn:ta,rtp:ta,bg:ta,pt:ta,ec:ta,e:ta},na=Zs;function ia(t,e){const n={};if(!t)return n;const r=Object.keys(t),o=e?(l=e,Object.keys(l).reduce(((t,e)=>{var n;return null===(n=l[e])||void 0===n||n.forEach((n=>t[n]=e)),t}),{})):{};var l;return r.reduce(((e,n)=>{var r;const l=ea[n]||o[n]||na;return(null!==(r=e[l])&&void 0!==r?r:e[l]={})[n]=t[n],e}),n)}const ra="event";const sa=t=>Math.round(t),aa=(t,e)=>Array.isArray(t)?t.map((t=>aa(t,e))):t instanceof Ps&&"string"==typeof t.value?new Ps(aa(t.value,e),t.params):(e.baseUrl&&(t=function(t,base){const e=new URL(t),n=new URL(base);if(e.origin!==n.origin)return t;const r=e.pathname.split("/").slice(1),o=n.pathname.split("/").slice(1,-1);for(;r[0]===o[0];)r.shift(),o.shift();for(;o.length;)o.shift(),r.unshift("..");return r.join("/")+e.search+e.hash}(t,e.baseUrl)),1===e.version?encodeURIComponent(t):t),oa=t=>100*sa(t/100),la={br:sa,d:sa,bl:oa,dl:oa,mtp:oa,nor:(t,e)=>{let n=t;return e.version>=2&&(t instanceof Ps&&"string"==typeof t.value?n=new Ps([t]):"string"==typeof t&&(n=[t])),aa(n,e)},rtp:oa,tb:sa},ca="request",ua="response",da=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],ha=["e"],fa=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function pa(t){return fa.test(t)}
2const ma=["d","dl","nor","ot","rtp","su"];const ga=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];const va=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function ya(t){return va.includes(t)||pa(t)}const ba={[ua]:function(t){return da.includes(t)||ma.includes(t)||ga.includes(t)||pa(t)},[ra]:function(t){return da.includes(t)||ha.includes(t)||pa(t)},[ca]:function(t){return da.includes(t)||ma.includes(t)||pa(t)}};function Ea(t,e={}){const n={};if(null==t||"object"!=typeof t)return n;const o=e.version||t.v||1,l=e.reportingMode||ca,c=1===o?ya:ba[l];let d=Object.keys(t).filter(c);const filter=e.filter;"function"==typeof filter&&(d=d.filter(filter));const h=l===ua||l===ra;h&&!d.includes("ts")&&d.push("ts"),o>1&&!d.includes("v")&&d.push("v");const f=O({},la,e.formatters),m={version:o,reportingMode:l,baseUrl:e.baseUrl};return d.sort().forEach((e=>{let l=t[e];const c=f[e];if("function"==typeof c&&(l=c(l,m)),"v"===e){if(1===o)return;l=o}"pr"==e&&1===l||(h&&"ts"===e&&!r(l)&&(l=Date.now()),function(t){return"number"==typeof t?r(t):null!=t&&""!==t&&!1!==t}(l)&&(function(t){return["ot","sf","st","e","sta"].includes(t)}(e)&&"string"==typeof l&&(l=new Fs(l)),n[e]=l))})),n}function Ta(t,e,n){return O(t,function(t,e={}){const n={};if(!t)return n;const r=ia(Ea(t,e),null==e?void 0:e.customHeaderMap);return Object.entries(r).reduce(((t,[e,n])=>{const r=Qs(n,{whitespace:!1});return r&&(t[e]=r),t}),n)}(e,n))}function ka(t,e={}){if(!t)return"";const n=function(t,e={}){return t?Qs(Ea(t,e),{whitespace:!1}):""}(t,e);return encodeURIComponent(n)}const Sa=/CMCD=[^&#]+/;function _a(t,e,n){const r=function(t,e={}){return t?`CMCD=${ka(t,e)}`:""}(e,n);if(!r)return t;if(Sa.test(t))return t.replace(Sa,r);const o=t.includes("?")?"&":"?";return`${t}${o}${r}`}function Aa(t,e,n,r){t&&Object.keys(e).forEach((o=>{const l=t.filter((track=>track.groupId===o)).map((track=>{const t=O({},track);return t.details=void 0,t.attrs=new gn(t.attrs),t.url=t.attrs.URI=Oa(track.url,track.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",n),t.groupId=t.attrs["GROUP-ID"]=e[o],t.attrs["PATHWAY-ID"]=r,t}));t.push(...l)}))}function Oa(t,e,n,r){const{HOST:o,PARAMS:l,[n]:c}=r;let d;e&&(d=null==c?void 0:c[e],d&&(t=d));const h=new self.URL(t);return o&&!d&&(h.host=o),l&&Object.keys(l).sort().forEach((t=>{t&&h.searchParams.set(t,l[t])})),h.href}class wa extends R{constructor(t){super("eme",t.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=wa.CDMCleanupPromise?[wa.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=t=>{const{initDataType:e,initData:n}=t,r=`"${t.type}" event: init data type: "${e}"`;if(this.debug(r),null!==n){if(!this.keyFormatPromise){let t=Object.keys(this.keySystemAccessPromises);t.length||(t=jn(this.config));const e=t.map(Mn).filter((t=>!!t));this.keyFormatPromise=this.getKeyFormatPromise(e)}this.keyFormatPromise.then((o=>{const l=Pn(o);if("sinf"!==e||l!==Rn.FAIRPLAY)return void this.log(`Ignoring "${t.type}" event with init data type: "${e}" for selected key-system ${l}`);let c;try{const t=st(new Uint8Array(n)),e=Et(_n(JSON.parse(t).sinf));if(!e)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(e.subarray(8,24))}catch(t){return void this.warn(`${r} Failed to parse sinf: ${t}`)}const d=U(c),{keyIdToKeySessionPromise:h,mediaKeySessions:f}=this;let m=h[d];for(let i=0;i<f.length;i++){const t=f[i],r=t.decryptdata;if(!r.keyId)continue;const o=U(r.keyId);if(En(c,r.keyId)||-1!==r.uri.replace(/-/g,"").indexOf(d)){if(m=h[o],!m)continue;if(r.pssh)break;delete h[o],r.pssh=new Uint8Array(n),r.keyId=c,m=h[d]=m.then((()=>this.generateRequestWithPreferredKeySession(t,e,n,"encrypted-event-key-match"))),m.catch((t=>this.handleError(t)));break}}m||this.handleError(new Error(`Key ID ${d} not encountered in playlist. Key-system sessions ${f.length}.`))})).catch((t=>this.handleError(t)))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=t,this.config=t.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}
2registerListeners(){this.hls.on(h.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(h.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(h.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(h.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(h.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(h.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(h.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(h.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(h.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(h.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(t){const{drmSystems:e,widevineLicenseUrl:n}=this.config,r=null==e?void 0:e[t];return r?r.licenseUrl:t===Rn.WIDEVINE&&n?n:void 0}getLicenseServerUrlOrThrow(t){const e=this.getLicenseServerUrl(t);if(void 0===e)throw new Error(`no license server URL configured for key-system "${t}"`);return e}getServerCertificateUrl(t){const{drmSystems:e}=this.config,n=null==e?void 0:e[t];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${t}"]`)}attemptKeySystemAccess(t){const e=this.hls.levels,n=(t,i,a)=>!!t&&a.indexOf(t)===i,r=e.map((t=>t.audioCodec)).filter(n),o=e.map((t=>t.videoCodec)).filter(n);return r.length+o.length===0&&o.push("avc1.42e01e"),new Promise(((e,n)=>{const l=t=>{const h=t.shift();this.getMediaKeysPromise(h,r,o).then((t=>e({keySystem:h,mediaKeys:t}))).catch((e=>{t.length?l(t):n(e instanceof La?e:new La({type:c.KEY_SYSTEM_ERROR,details:d.KEY_SYSTEM_NO_ACCESS,error:e,fatal:!0},e.message))}))};l(t)}))}requestMediaKeySystemAccess(t,e){const{requestMediaKeySystemAccessFunc:n}=this.config;if("function"!=typeof n){let t=`Configured requestMediaKeySystemAccess is not a function ${n}`;return null===Fn&&"http:"===self.location.protocol&&(t=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(t))}return n(t,e)}getMediaKeysPromise(t,e,n){var r;const o=function(t,e,n,r){let o;switch(t){case Rn.FAIRPLAY:o=["cenc","sinf"];break;case Rn.WIDEVINE:case Rn.PLAYREADY:o=["cenc"];break;case Rn.CLEARKEY:o=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${t}`)}return function(t,e,n,r){return[{initDataTypes:t,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:e.map((t=>({contentType:`audio/mp4; codecs=${t}`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null}))),videoCapabilities:n.map((t=>({contentType:`video/mp4; codecs=${t}`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null})))}]}(o,e,n,r)}(t,e,n,this.config.drmSystemOptions||{});let l=this.keySystemAccessPromises[t],c=null==(r=l)?void 0:r.keySystemAccess;if(!c){this.log(`Requesting encrypted media "${t}" key-system access with config: ${le(o)}`),c=this.requestMediaKeySystemAccess(t,o);const e=l=this.keySystemAccessPromises[t]={keySystemAccess:c};return c.catch((e=>{this.log(`Failed to obtain access to key-system "${t}": ${e}`)})),c.then((n=>{this.log(`Access for key-system "${n.keySystem}" obtained`);const r=this.fetchServerCertificate(t);this.log(`Create media-keys for "${t}"`);const o=e.mediaKeys=n.createMediaKeys().then((n=>(this.log(`Media-keys created for "${t}"`),e.hasMediaKeys=!0,r.then((e=>e?this.setMediaKeysServerCertificate(n,t,e):n)))));return o.catch((e=>{this.error(`Failed to create media-keys for "${t}"}: ${e}`)})),o}))}return c.then((()=>l.mediaKeys))}createMediaKeySessionContext({decryptdata:t,keySystem:e,mediaKeys:n}){this.log(`Creating key-system session "${e}" keyId: ${U(t.keyId||[])} keyUri: ${t.uri}`);const r=n.createSession(),o={decryptdata:t,keySystem:e,mediaKeys:n,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(o),o}renewKeySession(t){const e=t.decryptdata;if(e.pssh){const n=this.createMediaKeySessionContext(t),r=Ia(e),o="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(n,o,e.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)}updateKeySession(t,data){const e=t.mediaKeysSession;return this.log(`Updating key-session "${e.sessionId}" for keyId ${U(t.decryptdata.keyId||[])}\n } (data length: ${data.byteLength})`),e.update(data)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map((t=>({keySystem:t,hasMediaKeys:this.keySystemAccessPromises[t].hasMediaKeys}))).filter((({hasMediaKeys:t})=>!!t)).map((({keySystem:t})=>Mn(t))).filter((t=>!!t))}getKeySystemAccess(t){return this.getKeySystemSelectionPromise(t).then((({keySystem:t,mediaKeys:e})=>this.attemptSetMediaKeys(t,e)))}selectKeySystem(t){return new Promise(((e,n)=>{this.getKeySystemSelectionPromise(t).then((({keySystem:t})=>{const r=Mn(t);r?e(r):n(new Error(`Unable to find format for key-system "${t}"`))})).catch(n)}))}selectKeySystemFormat(t){const e=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${t.sn} ${t.type}: ${t.level}) key formats ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)),this.keyFormatPromise}getKeyFormatPromise(t){const e=jn(this.config),n=t.map(Pn).filter((t=>!!t&&-1!==e.indexOf(t)));return this.selectKeySystem(n)}getKeyStatus(t){const{mediaKeySessions:e}=this;for(let i=0;i<e.length;i++){const n=Ra(t,e[i]);if(n)return n}}loadKey(data){const t=data.keyInfo.decryptdata,e=Ia(t),n=this.bannedKeyIds[e];if(n||"internal-error"===this.getKeyStatus(t)){const e=xa(n||"internal-error",t);return this.handleError(e,data.frag),Promise.reject(e)}const r=`(keyId: ${e} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);const o=this.keyIdToKeySessionPromise[e];
2if(!o){const n=this.getKeySystemForKeyPromise(t).then((({keySystem:e,mediaKeys:n})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${data.frag.sn} ${data.frag.type}: ${data.frag.level} using key ${r}`),this.attemptSetMediaKeys(e,n).then((()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:e,mediaKeys:n,decryptdata:t}))))))).then((e=>{const n=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(e,"cenc",n,"playlist-key")}));return n.catch((t=>this.handleError(t,data.frag))),this.keyIdToKeySessionPromise[e]=n,n}return o.catch((e=>{if(e instanceof La){const n=I({},e.data);"internal-error"===this.getKeyStatus(t)&&(n.decryptdata=t);const r=new La(n,e.message);this.handleError(r,data.frag)}})),o}throwIfDestroyed(t="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(t,e){if(this.hls)if(t instanceof La){e&&(t.data.frag=e);const n=t.data.decryptdata;this.error(`${t.message}${n?` (${U(n.keyId||[])})`:""}`),this.hls.trigger(h.ERROR,t.data)}else this.error(t.message),this.hls.trigger(h.ERROR,{type:c.KEY_SYSTEM_ERROR,details:d.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0})}getKeySystemForKeyPromise(t){const e=Ia(t),n=this.keyIdToKeySessionPromise[e];if(!n){const e=Pn(t.keyFormat),n=e?[e]:jn(this.config);return this.attemptKeySystemAccess(n)}return n}getKeySystemSelectionPromise(t){if(t.length||(t=jn(this.config)),0===t.length)throw new La({type:c.KEY_SYSTEM_ERROR,details:d.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${le({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(t)}attemptSetMediaKeys(t,e){if(this.mediaResolved=void 0,this.mediaKeys===e)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${t}"`);const r=Promise.all(n).then((()=>this.media?this.media.setMediaKeys(e):new Promise(((t,n)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return n(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=e,this.media.setMediaKeys(e).then(t).catch(n)}}))));return this.mediaKeys=e,this.setMediaKeysQueue.push(r),r.then((()=>{this.log(`Media-keys set for "${t}"`),n.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter((p=>-1===n.indexOf(p)))}))}generateRequestWithPreferredKeySession(t,e,n,r){var o;const l=null==(o=this.config.drmSystems)||null==(o=o[t.keySystem])?void 0:o.generateRequest;if(l)try{const r=l.call(this.hls,e,n,t);if(!r)throw new Error("Invalid response from configured generateRequest filter");e=r.initDataType,n=r.initData?r.initData:null,t.decryptdata.pssh=n?new Uint8Array(n):null}catch(t){if(this.warn(t.message),this.hls&&this.hls.config.debug)throw t}if(null===n)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(t);const h=Ia(t.decryptdata),f=t.decryptdata.uri;this.log(`Generating key-session request for "${r}" keyId: ${h} URI: ${f} (init data type: ${e} length: ${n.byteLength})`);const m=new Ki,v=t._onmessage=e=>{const n=t.mediaKeysSession;if(!n)return void m.emit("error",new Error("invalid state"));const{messageType:r,message:o}=e;this.log(`"${r}" message event for session "${n.sessionId}" message size: ${o.byteLength}`),"license-request"===r||"license-renewal"===r?this.renewLicense(t,o).catch((t=>{m.eventNames().length?m.emit("error",t):this.handleError(t)})):"license-release"===r?t.keySystem===Rn.FAIRPLAY&&this.updateKeySession(t,An("acknowledged")).then((()=>this.removeSession(t))).catch((t=>this.handleError(t))):this.warn(`unhandled media key message type "${r}"`)},y=(t,e)=>{let n;e.keyStatus=t,t.startsWith("usable")?m.emit("resolved"):"internal-error"===t||"output-restricted"===t||"output-downscaled"===t?n=xa(t,e.decryptdata):"expired"===t?n=new Error(`key expired (keyId: ${h})`):"released"===t?n=new Error("key released"):"status-pending"===t||this.warn(`unhandled key status change "${t}" (keyId: ${h})`),n&&(m.eventNames().length?m.emit("error",n):this.handleError(n))},E=t._onkeystatuseschange=e=>{if(!t.mediaKeysSession)return void m.emit("error",new Error("invalid state"));const n=this.getKeyStatuses(t);if(!Object.keys(n).some((t=>"status-pending"!==n[t])))return;if("expired"===n[h])return this.log(`Expired key ${le(n)} in key-session "${t.mediaKeysSession.sessionId}"`),void this.renewKeySession(t);let r=n[h];if(r)y(r,t);else{var o;const e=1e3;t.keyStatusTimeouts||(t.keyStatusTimeouts={}
2),(o=t.keyStatusTimeouts)[h]||(o[h]=self.setTimeout((()=>{if(!t.mediaKeysSession||!this.mediaKeys)return;const n=this.getKeyStatus(t.decryptdata);if(n&&"status-pending"!==n)return this.log(`No status for keyId ${h} in key-session "${t.mediaKeysSession.sessionId}". Using session key-status ${n} from other session.`),y(n,t);this.log(`key status for ${h} in key-session "${t.mediaKeysSession.sessionId}" timed out after ${e}ms`),r="internal-error",y(r,t)}),e)),this.log(`No status for keyId ${h} (${le(n)}).`)}};Ai(t.mediaKeysSession,"message",v),Ai(t.mediaKeysSession,"keystatuseschange",E);const T=new Promise(((t,e)=>{m.on("error",e),m.on("resolved",t)}));return t.mediaKeysSession.generateRequest(e,n).then((()=>{this.log(`Request generated for key-session "${t.mediaKeysSession.sessionId}" keyId: ${h} URI: ${f}`)})).catch((e=>{throw new La({type:c.KEY_SYSTEM_ERROR,details:d.KEY_SYSTEM_NO_SESSION,error:e,decryptdata:t.decryptdata,fatal:!1},`Error generating key-session request: ${e}`)})).then((()=>T)).catch((e=>(m.removeAllListeners(),this.removeSession(t).then((()=>{throw e}))))).then((()=>(m.removeAllListeners(),t)))}getKeyStatuses(t){const e={};return t.mediaKeysSession.keyStatuses.forEach(((n,r)=>{if("string"==typeof r&&"object"==typeof n){const t=r;r=n,n=t}const o="buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r);if(t.keySystem===Rn.PLAYREADY&&16===o.length){const t=U(o);e[t]=n,On(o)}const l=U(o);"internal-error"===n&&(this.bannedKeyIds[l]=n),this.log(`key status change "${n}" for keyStatuses keyId: ${l} key-session "${t.mediaKeysSession.sessionId}"`),e[l]=n})),e}fetchServerCertificate(t){const e=this.config,n=new(0,e.loader)(e),r=this.getServerCertificateUrl(t);return r?(this.log(`Fetching server certificate for "${t}"`),new Promise(((o,l)=>{const h={responseType:"arraybuffer",url:r},f=e.certLoadPolicy.default,m={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},v={onSuccess:(t,e,n,r)=>{o(t.data)},onError:(e,n,o,f)=>{l(new La({type:c.KEY_SYSTEM_ERROR,details:d.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:I({url:h.url,data:void 0},e)},`"${t}" certificate request failed (${r}). Status: ${e.code} (${e.text})`))},onTimeout:(e,n,o)=>{l(new La({type:c.KEY_SYSTEM_ERROR,details:d.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:h.url,data:void 0}},`"${t}" certificate request timed out (${r})`))},onAbort:(t,e,n)=>{l(new Error("aborted"))}};n.load(h,m,v)}))):Promise.resolve()}setMediaKeysServerCertificate(t,e,n){return new Promise(((r,o)=>{t.setServerCertificate(n).then((o=>{this.log(`setServerCertificate ${o?"success":"not supported by CDM"} (${n.byteLength}) on "${e}"`),r(t)})).catch((t=>{o(new La({type:c.KEY_SYSTEM_ERROR,details:d.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:t,fatal:!0},t.message))}))}))}renewLicense(t,e){return this.requestLicense(t,new Uint8Array(e)).then((data=>this.updateKeySession(t,new Uint8Array(data)).catch((e=>{throw new La({type:c.KEY_SYSTEM_ERROR,details:d.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:t.decryptdata,error:e,fatal:!1},e.message)}))))}unpackPlayReadyKeyMessage(t,e){const n=String.fromCharCode.apply(null,new Uint16Array(e.buffer));if(!n.includes("PlayReadyKeyMessage"))return t.setRequestHeader("Content-Type","text/xml; charset=utf-8"),e;const r=(new DOMParser).parseFromString(n,"application/xml"),o=r.querySelectorAll("HttpHeader");if(o.length>0){let header;for(let i=0,e=o.length;i<e;i++){var l,c;header=o[i];const e=null==(l=header.querySelector("name"))?void 0:l.textContent,n=null==(c=header.querySelector("value"))?void 0:c.textContent;e&&n&&t.setRequestHeader(e,n)}}const d=r.querySelector("Challenge"),h=null==d?void 0:d.textContent;if(!h)throw new Error("Cannot find <Challenge> in key message");return An(atob(h))}setupLicenseXHR(t,e,n,r){const o=this.config.licenseXhrSetup;return o?Promise.resolve().then((()=>
2{if(!n.decryptdata)throw new Error("Key removed");return o.call(this.hls,t,e,n,r)})).catch((l=>{if(!n.decryptdata)throw l;return t.open("POST",e,!0),o.call(this.hls,t,e,n,r)})).then((n=>{t.readyState||t.open("POST",e,!0);return{xhr:t,licenseChallenge:n||r}})):(t.open("POST",e,!0),Promise.resolve({xhr:t,licenseChallenge:r}))}requestLicense(t,e){const n=this.config.keyLoadPolicy.default;return new Promise(((r,o)=>{const l=this.getLicenseServerUrlOrThrow(t.keySystem);this.log(`Sending license request to URL: ${l}`);const h=new XMLHttpRequest;h.responseType="arraybuffer",h.onreadystatechange=()=>{if(!this.hls||!t.mediaKeysSession)return o(new Error("invalid state"));if(4===h.readyState)if(200===h.status){this._requestLicenseFailureCount=0;let data=h.response;this.log(`License received ${data instanceof ArrayBuffer?data.byteLength:data}`);const e=this.config.licenseResponseCallback;if(e)try{data=e.call(this.hls,h,l,t)}catch(t){this.error(t)}r(data)}else{const f=n.errorRetry,m=f?f.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>m||h.status>=400&&h.status<500)o(new La({type:c.KEY_SYSTEM_ERROR,details:d.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:t.decryptdata,fatal:!0,networkDetails:h,response:{url:l,data:void 0,code:h.status,text:h.statusText}},`License Request XHR failed (${l}). Status: ${h.status} (${h.statusText})`));else{const n=m-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${n} attempts left`),this.requestLicense(t,e).then(r,o)}}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=h,this.setupLicenseXHR(h,l,t,e).then((({xhr:e,licenseChallenge:n})=>{t.keySystem==Rn.PLAYREADY&&(n=this.unpackPlayReadyKeyMessage(e,n)),e.send(n)})).catch(o)}))}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(t,data){if(!this.config.emeEnabled)return;const e=data.media;this.media=e,Ai(e,"encrypted",this.onMediaEncrypted),Ai(e,"waitingforkey",this.onWaitingForKey);const n=this.mediaResolved;n?n():this.mediaKeys=e.mediaKeys}onMediaDetached(){const t=this.media;t&&(Oi(t,"encrypted",this.onMediaEncrypted),Oi(t,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var t;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const e=this.mediaResolved;if(e&&e(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const n=this.media,r=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,$n.clearKeyUriToKeyIdMap();const o=r.length;wa.CDMCleanupPromise=Promise.all(r.map((t=>this.removeSession(t))).concat((null==n||null==(t=n.setMediaKeys(null))?void 0:t.catch((t=>{this.log(`Could not clear media keys: ${t}`),this.hls&&this.hls.trigger(h.ERROR,{type:c.OTHER_ERROR,details:d.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${t}`)})})))||Promise.resolve())).catch((t=>{this.log(`Could not close sessions and clear media keys: ${t}`),this.hls&&this.hls.trigger(h.ERROR,{type:c.OTHER_ERROR,details:d.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${t}`)})})).then((()=>{o&&this.log("finished closing key sessions and clearing media keys")}))}onManifestLoading(){this._clear()}onManifestLoaded(t,{sessionKeys:e}){if(e&&this.config.emeEnabled&&!this.keyFormatPromise){const t=e.reduce(((t,e)=>(-1===t.indexOf(e.keyFormat)&&t.push(e.keyFormat),t)),[]);this.log(`Selecting key-system from session-keys ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)}}removeSession(t){const{mediaKeysSession:e,licenseXhr:n,decryptdata:r}=t;if(e){this.log(`Remove licenses and keys and close session "${e.sessionId}" keyId: ${U((null==r?void 0:r.keyId)||[])}`),t._onmessage&&(e.removeEventListener("message",t._onmessage),t._onmessage=void 0),t._onkeystatuseschange&&(e.removeEventListener("keystatuseschange",t._onkeystatuseschange),t._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;const o=this.mediaKeySessions.indexOf(t);o>
2-1&&this.mediaKeySessions.splice(o,1);const{keyStatusTimeouts:l}=t;l&&Object.keys(l).forEach((t=>self.clearTimeout(l[t])));const{drmSystemOptions:f}=this.config,m=function(t){var e;return!(!t||"persistent-license"!==t.sessionType&&(null==(e=t.sessionTypes)||!e.some((t=>"persistent-license"===t))))}(f)?new Promise(((t,n)=>{self.setTimeout((()=>n(new Error("MediaKeySession.remove() timeout"))),8e3),e.remove().then(t).catch(n)})):Promise.resolve();return m.catch((t=>{this.log(`Could not remove session: ${t}`),this.hls&&this.hls.trigger(h.ERROR,{type:c.OTHER_ERROR,details:d.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${t}`)})})).then((()=>e.close())).catch((t=>{this.log(`Could not close session: ${t}`),this.hls&&this.hls.trigger(h.ERROR,{type:c.OTHER_ERROR,details:d.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${t}`)})}))}return Promise.resolve()}}function Ia(t){if(!t)throw new Error("Could not read keyId of undefined decryptdata");if(null===t.keyId)throw new Error("keyId is null");return U(t.keyId)}function Ra(t,e){return t.keyId&&e.mediaKeysSession.keyStatuses.has(t.keyId)?e.mediaKeysSession.keyStatuses.get(t.keyId):t.matches(e.decryptdata)?e.keyStatus:void 0}wa.CDMCleanupPromise=void 0;class La extends Error{constructor(data,t){super(t),this.data=void 0,data.error||(data.error=new Error(t)),this.data=data,data.err=data.error}}function xa(t,e){const n="output-restricted"===t,details=n?d.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:d.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new La({type:c.KEY_SYSTEM_ERROR,details:details,fatal:!1,decryptdata:e},n?"HDCP level output restricted":`key status changed to "${t}"`)}function Da(track,t){let e;try{e=new Event("addtrack")}catch(t){e=document.createEvent("Event"),e.initEvent("addtrack",!1,!1)}e.track=track,t.dispatchEvent(e)}function Ca(track,t){const e=track.mode;if("disabled"===e&&(track.mode="hidden"),track.cues&&!track.cues.getCueById(t.id))try{if(track.addCue(t),!track.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(e){M.debug(`[texttrack-utils]: ${e}`);try{const e=new self.TextTrackCue(t.startTime,t.endTime,t.text);e.id=t.id,track.addCue(e)}catch(t){M.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${t}`)}}"disabled"===e&&(track.mode=e)}function Pa(track,t){const e=track.mode;if("disabled"===e&&(track.mode="hidden"),track.cues)for(let i=track.cues.length;i--;)t&&track.cues[i].removeEventListener("enter",t),track.removeCue(track.cues[i]);"disabled"===e&&(track.mode=e)}function Ma(track,t,e,n){const r=track.mode;if("disabled"===r&&(track.mode="hidden"),track.cues&&track.cues.length>0){const r=function(t,e,n){const r=[],o=function(t,time){if(time<=t[0].startTime)return 0;const e=t.length-1;if(time>t[e].endTime)return-1;let n,r=0,o=e;for(;r<=o;)if(n=Math.floor((o+r)/2),time<t[n].startTime)o=n-1;else{if(!(time>t[n].startTime&&r<e))return n;r=n+1}return t[r].startTime-time<time-t[o].startTime?r:o}(t,e);if(o>-1)for(let i=o,l=t.length;i<l;i++){const o=t[i];if(o.startTime>=e&&o.endTime<=n)r.push(o);else if(o.startTime>n)return r}return r}(track.cues,t,e);for(let i=0;i<r.length;i++)n&&!n(r[i])||track.removeCue(r[i])}"disabled"===r&&(track.mode=r)}function ja(t){const e=[];for(let i=0;i<t.length;i++){const track=t[i];"subtitles"!==track.kind&&"captions"!==track.kind||!track.label||e.push(t[i])}return e}function Fa(text){let t=5381,i=text.length;for(;i;)t=33*t^text.charCodeAt(--i);return(t>>>0).toString()}const Na=.025;let Ua=function(t){return t[t.Point=0]="Point",t[t.Range=1]="Range",t}({});function Ba(t,e,n){return`${t.identifier}-${n+1}-${Fa(e)}`}class $a{constructor(t,base){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=base,this.dateRange=t,this.setDateRange(t)}setDateRange(t){this.dateRange=t,this.resumeOffset=t.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=t.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=t.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=t.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var t;this.appendInPlaceStarted=!1,null==(t=this.assetListLoader)||t.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(t){var e;if(t>0&&t>=this.assetList.length)return!0;const n=this.playoutLimit;
2if(t<=0||isNaN(n))return!1;if(0===n)return!0;return((null==(e=this.assetList[t])?void 0:e.startOffset)||0)>n}findAssetIndex(t){return this.assetList.indexOf(t)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const t=this.dateRange.startTime;if(this.snapOptions.out){const e=this.dateRange.tagAnchor;if(e)return Va(t,e)}return t}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(0===this.startTime||this.snapOptions.out)return!0;const t=this.dateRange.tagAnchor;if(t){const e=this.dateRange.startTime;return e-Va(e,t)<.1}return!1}get resumptionOffset(){const t=this.resumeOffset,e=r(t)?t:this.duration;return this.cumulativeDuration+e}get resumeTime(){const t=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const e=this.resumeAnchor;if(e)return Va(t,e)}return t}get appendInPlace(){return!!this.appendInPlaceStarted||!this.appendInPlaceDisabled&&!(this.cue.once||this.cue.pre||!this.startIsAligned||!(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<Na))}set appendInPlace(t){this.appendInPlaceStarted?this.resetOnResume=!t:this.appendInPlaceDisabled=!t}get timelineStart(){return null!==this._timelineStart?this._timelineStart:this.startTime}set timelineStart(t){this._timelineStart=t}get duration(){const t=this.playoutLimit;let e;return e=null!==this._duration?this._duration:this.dateRange.duration?this.dateRange.duration:this.dateRange.plannedDuration||0,!isNaN(t)&&t<e&&(e=t),e}set duration(t){this._duration=t}get cue(){return this.dateRange.cue}get timelineOccupancy(){return"RANGE"===this.dateRange.attr["X-TIMELINE-OCCUPIES"]?Ua.Range:Ua.Point}get supplementsPrimary(){return"PRIMARY"===this.dateRange.attr["X-TIMELINE-STYLE"]}get contentMayVary(){return"NO"!==this.dateRange.attr["X-CONTENT-MAY-VARY"]}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||null!==this.assetListResponse}toString(){return`["${(t=this).identifier}" ${t.cue.pre?"<pre>":t.cue.post?"<post>":""}${t.timelineStart.toFixed(2)}-${t.resumeTime.toFixed(2)}]`;var t}}function Va(time,t){return time-t.start<t.duration/2&&!(Math.abs(time-(t.start+t.duration))<Na)?t.start:t.start+t.duration}function Ga(t,e,n){const r=new self.URL(t,n);return"data:"!==r.protocol&&r.searchParams.set("_HLS_primary_id",e),r}function Ha(t,e){for(;null!=(n=t.assetList[++e])&&n.error;)var n;return e}function Wa(t){const e=t.timelineStart,n=t.duration||0;return`["${t.identifier}" ${e.toFixed(2)}-${(e+n).toFixed(2)}]`}class Ka{constructor(t,e,n,r){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(h.PLAYOUT_LIMIT_REACHED,{})};const o=this.hls=new t(e);this.interstitial=n,this.assetItem=r;const l=()=>{this.hasDetails=!0};o.once(h.LEVEL_LOADED,l),o.once(h.AUDIO_TRACK_LOADED,l),o.once(h.SUBTITLE_TRACK_LOADED,l),o.on(h.MEDIA_ATTACHING,((t,{media:e})=>{this.removeMediaListeners(),this.mediaAttached=e;this.interstitial.playoutLimit&&(e.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&o.on(h.BUFFER_APPENDED,(()=>{const t=this.bufferedEnd;this.reachedPlayout(t)&&(this._bufferedEosTime=t,o.trigger(h.BUFFERED_TO_END,void 0))})))}))}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const t=this.hls;if(t)if(t.url)t.levels.length&&!t.started&&t.startLoad(-1,!0);else{let e=this.assetItem.uri;try{e=Ga(e,t.config.primarySessionId||"").href}catch(t){}t.loadSource(e)}}bufferedInPlaceToEnd(t){var e;if(!this.appendInPlace)return!1;if(null!=(e=this.hls)&&e.bufferedToEnd)return!0;if(!t)return!1;const n=Math.min(this._bufferedEosTime||1/0,this.duration),r=this.timelineOffset,o=ln.bufferInfo(t,r,0);return this.getAssetTime(o.end)>=n-.02}reachedPlayout(time){const t=this.interstitial.playoutLimit;return this.startOffset+time>=t}get destroyed(){var t;return!(null!=(t=this.hls)&&t.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var t;return(null==(t=this.hls)?void 0:t.media)||null}get bufferedEnd(){const t=this.media||this.mediaAttached;if(!t)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const e=ln.bufferInfo(t,t.currentTime,.001);return this.getAssetTime(e.end)}get currentTime(){const t=this.media||this.mediaAttached;return t?this.getAssetTime(t.currentTime):this._currentTime||0}get duration(){const t=this.assetItem.duration;if(!t)return 0;const e=this.interstitial.playoutLimit;if(e){const n=e-this.startOffset;if(n>0&&n<t)return n}return t}get remaining(){const t=this.duration;return t?Math.max(0,t-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var t;return(null==(t=this.hls)?void 0:t.config.timelineOffset)||0}set timelineOffset(t){const e=this.timelineOffset;if(t!==e){const n=t-e;if(Math.abs(n)>
21/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=t}}}getAssetTime(time){const t=this.timelineOffset,e=this.duration;return Math.min(Math.max(0,time-t),e)}removeMediaListeners(){const t=this.mediaAttached;t&&(this._currentTime=t.currentTime,this.bufferSnapShot(),t.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){var t;this.mediaAttached&&(null!=(t=this.hls)&&t.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd))}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(data){var t;this.loadSource(),null==(t=this.hls)||t.attachMedia(data)}detachMedia(){var t;this.removeMediaListeners(),this.mediaAttached=null,null==(t=this.hls)||t.detachMedia()}resumeBuffering(){var t;null==(t=this.hls)||t.resumeBuffering()}pauseBuffering(){var t;null==(t=this.hls)||t.pauseBuffering()}transferMedia(){var t;return this.bufferSnapShot(),(null==(t=this.hls)?void 0:t.transferMedia())||null}resetDetails(){const t=this.hls;if(t&&this.hasDetails){t.stopLoad();const e=t=>delete t.details;t.levels.forEach(e),t.allAudioTracks.forEach(e),t.allSubtitleTracks.forEach(e),this.hasDetails=!1}}on(t,e,n){var r;null==(r=this.hls)||r.on(t,e)}once(t,e,n){var r;null==(r=this.hls)||r.once(t,e)}off(t,e,n){var r;null==(r=this.hls)||r.off(t,e)}toString(){var t;return`HlsAssetPlayer: ${Wa(this.assetItem)} ${null==(t=this.hls)?void 0:t.sessionId} ${this.appendInPlace?"append-in-place":""}`}}class qa extends R{constructor(t,e){super("interstitials-sched",e),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=t}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach((t=>t.reset())),this.events=this.items=null}resetErrorsInRange(t,e){return this.events?this.events.reduce(((n,r)=>t<=r.startOffset&&e>r.startOffset?(delete r.error,n+1):n),0):0}get duration(){const t=this.items;return t?t[t.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(t){return t&&this.eventMap[t]||null}hasEvent(t){return t in this.eventMap}findItemIndex(t,time){if(t.event)return this.findEventIndex(t.event.identifier);let e=-1;t.nextEvent?e=this.findEventIndex(t.nextEvent.identifier)-1:t.previousEvent&&(e=this.findEventIndex(t.previousEvent.identifier)+1);const n=this.items;if(n)for(n[e]||(void 0===time&&(time=t.start),e=this.findItemIndexAtTime(time));e>=0&&null!=(r=n[e])&&r.event;){var r;e--}return e}findItemIndexAtTime(t,e){const n=this.items;if(n)for(let i=0;i<n.length;i++){let r=n[i];if(e&&"primary"!==e&&(r=r[e]),t===r.start||t>r.start&&t<r.end)return i}return-1}findJumpRestrictedIndex(t,e){const n=this.items;if(n)for(let i=t;i<=e&&n[i];i++){const t=n[i].event;if(null!=t&&t.restrictions.jump&&!t.appendInPlace)return i}return-1}findEventIndex(t){const e=this.items;if(e)for(let i=e.length;i--;){var n;if((null==(n=e[i].event)?void 0:n.identifier)===t)return i}return-1}findAssetIndex(t,e){const n=t.assetList,r=n.length;if(r>1)for(let i=0;i<r;i++){const t=n[i];if(!t.error){const n=t.timelineStart;if(e===n||e>n&&(e<n+(t.duration||0)||i===r-1))return i}}return 0}get assetIdAtEnd(){var t;const e=null==(t=this.items)||null==(t=t[this.length-1])?void 0:t.event;if(e){const t=e.assetList,n=t[t.length-1];if(n)return n.identifier}return null}parseInterstitialDateRanges(t,e){const details=t.main.details,{dateRanges:n}=details,r=this.events,o=this.parseDateRanges(n,{url:details.url},e),l=Object.keys(n),c=r?r.filter((t=>!l.includes(t.identifier))):[];o.length&&o.sort(((a,b)=>{const t=a.cue.pre,e=a.cue.post,n=b.cue.pre,r=b.cue.post;if(t&&!n)return-1;if(n&&!t)return 1;if(e&&!r)return 1;if(r&&!e)return-1;if(!(t||n||e||r)){const t=a.startTime,e=b.startTime;if(t!==e)return t-e}return a.dateRange.tagOrder-b.dateRange.tagOrder})),this.events=o,c.forEach((t=>{this.removeEvent(t)})),this.updateSchedule(t,c)}updateSchedule(t,e=[],n=!1){const r=this.events||[];
2if(r.length||e.length||this.length<2){const o=this.items,l=this.parseSchedule(r,t);(n||e.length||(null==o?void 0:o.length)!==l.length||l.some(((t,i)=>Math.abs(t.playout.start-o[i].playout.start)>.005||Math.abs(t.playout.end-o[i].playout.end)>.005)))&&(this.items=l,this.onScheduleUpdate(e,o))}}parseDateRanges(t,e,n){const r=[],o=Object.keys(t);for(let i=0;i<o.length;i++){const l=o[i],c=t[l];if(c.isInterstitial){let t=this.eventMap[l];t?t.setDateRange(c):(t=new $a(c,e),this.eventMap[l]=t,!1===n&&(t.appendInPlace=n)),r.push(t)}}return r}parseSchedule(t,e){const n=[],details=e.main.details,r=details.live?1/0:details.edge;let o=0;if((t=t.filter((t=>!(t.error||t.cue.once&&t.hasPlayed)))).length){this.resolveOffsets(t,e);let c=0,d=0;if(t.forEach(((e,i)=>{const l=e.cue.pre,h=e.cue.post,f=t[i-1]||null,m=e.appendInPlace,v=h?r:e.startOffset,y=e.duration,E=e.timelineOccupancy===Ua.Range?y:0,T=e.resumptionOffset,k=(null==f?void 0:f.startTime)===v,S=v+e.cumulativeDuration;let _=m?S+y:v+T;if(l||!h&&v<=0){const t=d;d+=E,e.timelineStart=S;const r=o;o+=y,n.push({event:e,start:S,end:_,playout:{start:r,end:o},integrated:{start:t,end:d}})}else{if(!(v<=r))return;{if(!k){const r=v-c;if(r>.033){const l=c,h=d;d+=r;const f=o;o+=r;const m={previousEvent:t[i-1]||null,nextEvent:e,start:l,end:l+r,playout:{start:f,end:o},integrated:{start:h,end:d}};n.push(m)}else r>0&&f&&(f.cumulativeDuration+=r,n[n.length-1].end=v)}h&&(_=S),e.timelineStart=S;const r=d;d+=E;const l=o;o+=y,n.push({event:e,start:S,end:_,playout:{start:l,end:o},integrated:{start:r,end:d}})}}const A=e.resumeTime;c=h||A>r?r:A})),c<r){var l;const t=c,e=d,h=r-c;d+=h;const f=o;o+=h,n.push({previousEvent:(null==(l=n[n.length-1])?void 0:l.event)||null,nextEvent:null,start:c,end:t+h,playout:{start:f,end:o},integrated:{start:e,end:d}})}this.setDurations(r,o,d)}else{const t=0;n.push({previousEvent:null,nextEvent:null,start:t,end:r,playout:{start:t,end:r},integrated:{start:t,end:r}}),this.setDurations(r,r,r)}return n}setDurations(t,e,n){this.durations={primary:t,playout:e,integrated:n}}resolveOffsets(t,e){const details=e.main.details,n=details.live?1/0:details.edge;let o=0,l=-1;t.forEach(((c,i)=>{const d=c.cue.pre,h=c.cue.post,f=d?0:h?n:c.startTime;this.updateAssetDurations(c);if(l===f?c.cumulativeDuration=o:(o=0,l=f),!h&&c.snapOptions.in&&(c.resumeAnchor=ye(null,details.fragments,c.startOffset+c.resumptionOffset,0,0)||void 0),c.appendInPlace&&!c.appendInPlaceStarted){this.primaryCanResumeInPlaceAt(c,e)||(c.appendInPlace=!1)}if(!c.appendInPlace&&i+1<t.length){t[i+1].startTime-t[i].resumeTime<.033&&(t[i+1].appendInPlace=!1,t[i+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${c}`))}const m=r(c.resumeOffset)?c.resumeOffset:c.duration;o+=m}))}primaryCanResumeInPlaceAt(t,e){const n=t.resumeTime,r=t.startTime+t.resumptionOffset;if(Math.abs(n-r)>Na)return this.log(`"${t.identifier}" resumption ${n} not aligned with estimated timeline end ${r}`),!1;return!Object.keys(e).some((r=>{const details=e[r].details,o=details.edge;if(n>=o)return this.log(`"${t.identifier}" resumption ${n} past ${r} playlist end ${o}`),!1;const l=ye(null,details.fragments,n);if(!l)return this.log(`"${t.identifier}" resumption ${n} does not align with any fragments in ${r} playlist (${details.fragStart}-${details.fragmentEnd})`),!0;const c="audio"===r?.175:0;return!(Math.abs(l.start-n)<Na+c||Math.abs(l.end-n)<Na+c)&&(this.log(`"${t.identifier}" resumption ${n} not aligned with ${r} fragment bounds (${l.start}-${l.end} sn: ${l.sn} cc: ${l.cc})`),!0)}))}updateAssetDurations(t){if(!t.assetListLoaded)return;const e=t.timelineStart;let n=0,r=!1,o=!1;for(let i=0;i<t.assetList.length;i++){const l=t.assetList[i],c=e+n;l.startOffset=n,l.timelineStart=c,r||(r=null===l.duration),o||(o=!!l.error);n+=l.error?0:l.duration||0}t.duration=r&&!o?Math.max(n,t.duration):n}removeEvent(t){t.reset(),delete this.eventMap[t.identifier]}}function Ya(t){return`[${t.event?'"'+t.event.identifier+'"':"primary"}: ${t.start.toFixed(2)}-${t.end.toFixed(2)}]`}class za{constructor(t){this.hls=void 0,this.hls=t}destroy(){this.hls=null}loadAssetList(t,e){const n=t.assetListUrl;let r;try{r=Ga(n,this.hls.sessionId,t.baseUrl)}catch(e){const r=this.assignAssetListError(t,d.ASSET_LIST_LOAD_ERROR,e,n);return void this.hls.trigger(h.ERROR,r)}e&&"data:"!==r.protocol&&r.searchParams.set("_HLS_start_offset",""+e);
2const o=this.hls.config,l=new(0,o.loader)(o),c={responseType:"json",url:r.href},f=o.interstitialAssetListLoadPolicy.default,m={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},v={onSuccess:(e,n,r,o)=>{const l=e.data,c=null==l?void 0:l.ASSETS;if(Array.isArray(c))t.assetListResponse=l,this.hls.trigger(h.ASSET_LIST_LOADED,{event:t,assetListResponse:l,networkDetails:o});else{const e=this.assignAssetListError(t,d.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),r.url,n,o);this.hls.trigger(h.ERROR,e)}},onError:(e,n,r,o)=>{const l=this.assignAssetListError(t,d.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${e.code} ${e.text} (${n.url})`),n.url,o,r);this.hls.trigger(h.ERROR,l)},onTimeout:(e,n,r)=>{const o=this.assignAssetListError(t,d.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${n.url})`),n.url,e,r);this.hls.trigger(h.ERROR,o)}};return l.load(c,m,v),this.hls.trigger(h.ASSET_LIST_LOADING,{event:t}),l}assignAssetListError(t,details,e,n,r,o){return t.error=e,{type:c.NETWORK_ERROR,details:details,fatal:!1,interstitial:t,url:n,error:e,networkDetails:o,stats:r}}}function Qa(t){var e;null==t||null==(e=t.play())||e.catch((()=>{}))}function Xa(label,time){return`[${label}] Advancing timeline position to ${time}`}class Za{constructor(t){this.buffered=void 0;const e=(e,n,r)=>{if((n>>>=0)>r-1)throw new DOMException(`Failed to execute '${e}' on 'TimeRanges': The index provided (${n}) is greater than the maximum bound (${r})`);return t[n][e]};this.buffered={get length(){return t.length},end:n=>e("end",n,t.length),start:n=>e("start",n,t.length)}}}const Ja={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},to=t=>String.fromCharCode(Ja[t]||t),eo=15,no=100,io={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ro={17:2,18:4,21:6,22:8,23:10,19:13,20:15},so={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},ao={25:2,26:4,29:6,30:8,31:10,27:13,28:15},oo=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class lo{constructor(){this.time=null,this.verboseLevel=0}log(t,e){if(this.verboseLevel>=t){const n="function"==typeof e?e():e;M.log(`${this.time} [${t}] ${n}`)}}}const co=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].toString(16));return e};class uo{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(t){const e=["foreground","underline","italics","background","flash"];for(let i=0;i<e.length;i++){const style=e[i];t.hasOwnProperty(style)&&(this[style]=t[style])}}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}equals(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash}copy(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class ho{constructor(){this.uchar=" ",this.penState=new uo}reset(){this.uchar=" ",this.penState.reset()}setChar(t,e){this.uchar=t,this.penState.copy(e)}setPenState(t){this.penState.copy(t)}equals(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)}copy(t){this.uchar=t.uchar,this.penState.copy(t.penState)}isEmpty(){return" "===this.uchar&&this.penState.isDefault()}}class fo{constructor(t){this.chars=[],this.pos=0,this.currPenState=new uo,this.cueStartTime=null,this.logger=void 0;for(let i=0;i<no;i++)this.chars.push(new ho);this.logger=t}equals(t){for(let i=0;i<no;i++)if(!this.chars[i].equals(t.chars[i]))return!1;return!0}copy(t){for(let i=0;i<no;i++)this.chars[i].copy(t.chars[i])}isEmpty(){let t=!0;for(let i=0;i<no;i++)if(!this.chars[i].isEmpty()){t=!1;break}return t}
vendor: 14,798 bytes, line 2
2setCursor(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>no&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=no)}moveCursor(t){const e=this.pos+t;if(t>1)for(let i=this.pos+1;i<e+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(e)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(t){t>=144&&this.backSpace();const e=to(t);this.pos>=no?this.logger.log(0,(()=>"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))}clearFromPos(t){let i;for(i=t;i<no;i++)this.chars[i].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const t=[];let e=!0;for(let i=0;i<no;i++){const n=this.chars[i].uchar;" "!==n&&(e=!1),t.push(n)}return e?"":t.join("")}setPenStyles(t){this.currPenState.setStyles(t);this.chars[this.pos].setPenState(this.currPenState)}}class po{constructor(t){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let i=0;i<eo;i++)this.rows.push(new fo(t));this.logger=t}reset(){for(let i=0;i<eo;i++)this.rows[i].clear();this.currRow=14}equals(t){let e=!0;for(let i=0;i<eo;i++)if(!this.rows[i].equals(t.rows[i])){e=!1;break}return e}copy(t){for(let i=0;i<eo;i++)this.rows[i].copy(t.rows[i])}isEmpty(){let t=!0;for(let i=0;i<eo;i++)if(!this.rows[i].isEmpty()){t=!1;break}return t}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(t){this.rows[this.currRow].insertChar(t)}setPen(t){this.rows[this.currRow].setPenStyles(t)}moveCursor(t){this.rows[this.currRow].moveCursor(t)}setCursor(t){this.logger.log(2,"setCursor: "+t);this.rows[this.currRow].setCursor(t)}setPAC(t){this.logger.log(2,(()=>"pacData = "+le(t)));let e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(let i=0;i<eo;i++)this.rows[i].clear();const t=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){const r=n.rows[t].cueStartTime,time=this.logger.time;if(null!==r&&null!==time&&r<time)for(let i=0;i<this.nrRollUpRows;i++)this.rows[e-this.nrRollUpRows+i+1].copy(n.rows[t+i])}}this.currRow=e;const n=this.rows[this.currRow];if(null!==t.indent){const e=t.indent,r=Math.max(e-1,0);n.setCursor(t.indent),t.color=n.chars[r].penState.foreground}const r={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(t){this.logger.log(2,(()=>"bkgData = "+le(t))),this.backSpace(),this.setPen(t),this.insertChar(32)}setRollUpRows(t){this.nrRollUpRows=t}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(2,"Rolling up")}getDisplayText(t){t=t||!1;const e=[];let text="",n=-1;for(let i=0;i<eo;i++){const r=this.rows[i].getTextString();r&&(n=i+1,t?e.push("Row "+n+": '"+r+"'"):e.push(r.trim()))}return e.length>0&&(text=t?"["+e.join(" | ")+"]":e.join("\n")),text}getTextAndFormat(){return this.rows}}class mo{constructor(t,e,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new po(n),this.nonDisplayedMemory=new po(n),this.lastOutputScreen=new po(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(t){this.outputFilter=t}setPAC(t){this.writeScreen.setPAC(t)}setBkgData(t){this.writeScreen.setBkgData(t)}setMode(t){t!==this.mode&&(this.mode=t,this.logger.log(2,(()=>"MODE="+t)),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)}insertChars(t){for(let i=0;i<t.length;i++)this.writeScreen.insertChar(t[i]);const e=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(()=>e+": "+this.writeScreen.getDisplayText(!0))),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,(()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0))),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(t){this.logger.log(2,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(t){this.logger.log(2,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)}ccMIDROW(t){const e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{const n=Math.floor(t/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=r[n]}this.logger.log(2,"MIDROW: "+le(e)),this.writeScreen.setPen(e)}outputDataUpdate(t=!1){const time=this.logger.time;null!==time&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,time,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:time):this.cueStartTime=time,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))}}class go{constructor(t,e,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;const r=this.logger=new lo;this.channels=[null,new mo(t,e,r),new mo(t+1,n,r)]}getHandler(t){return this.channels[t].getHandler()}setHandler(t,e){this.channels[t].setHandler(e)}addData(time,t){this.logger.time=time;for(let i=0;i<t.length;i+=2){const a=127&t[i],b=127&t[i+1];let e=!1,n=null;if(0===a&&0===b)continue;this.logger.log(3,(()=>"["+co([t[i],t[i+1]])+"] -> ("+co([a,b])+")"));const r=this.cmdHistory;if(a>=16&&a<=31){if(yo(a,b,r)){vo(null,null,r),this.logger.log(3,(()=>"Repeated command ("+co([a,b])+") is dropped"));continue}vo(a,b,this.cmdHistory),e=this.parseCmd(a,b),e||(e=this.parseMidrow(a,b)),e||(e=this.parsePAC(a,b)),e||(e=this.parseBackgroundAttributes(a,b))}else vo(null,null,r);if(!e&&(n=this.parseChars(a,b),n)){const t=this.currentChannel;if(t&&t>0){this.channels[t].insertChars(n)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}e||n||this.logger.log(2,(()=>"Couldn't parse cleaned data "+co([a,b])+" orig: "+co([t[i],t[i+1]])))}}parseCmd(a,b){if(!((20===a||28===a||21===a||29===a)&&b>=32&&b<=47)&&!((23===a||31===a)&&b>=33&&b<=35))return!1;const t=20===a||21===a||23===a?1:2,e=this.channels[t];return 20===a||21===a||28===a||29===a?32===b?e.ccRCL():33===b?e.ccBS():34===b?e.ccAOF():35===b?e.ccAON():36===b?e.ccDER():37===b?e.ccRU(2):38===b?e.ccRU(3):39===b?e.ccRU(4):40===b?e.ccFON():41===b?e.ccRDC():42===b?e.ccTR():43===b?e.ccRTD():44===b?e.ccEDM():45===b?e.ccCR():46===b?e.ccENM():47===b&&e.ccEOC():e.ccTO(b-32),this.currentChannel=t,!0}parseMidrow(a,b){let t=0;if((17===a||25===a)&&b>=32&&b<=47){if(t=17===a?1:2,t!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const e=this.channels[t];return!!e&&(e.ccMIDROW(b),this.logger.log(3,(()=>"MIDROW ("+co([a,b])+")")),!0)}return!1}parsePAC(a,b){let t;if(!((a>=17&&a<=23||a>=25&&a<=31)&&b>=64&&b<=127)&&!((16===a||24===a)&&b>=64&&b<=95))return!1;const e=a<=23?1:2;t=b>=64&&b<=95?1===e?io[a]:so[a]:1===e?ro[a]:ao[a];const n=this.channels[e];return!!n&&(n.setPAC(this.interpretPAC(t,b)),this.currentChannel=e,!0)}interpretPAC(t,e){let n;const r={color:null,italics:!1,indent:null,underline:!1,row:t};return n=e>95?e-96:e-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r}parseChars(a,b){let t,e=null,n=null;if(a>=25?(t=2,n=a-8):(t=1,n=a),n>=17&&n<=19){let r;r=17===n?b+80:18===n?b+112:b+144,this.logger.log(2,(()=>"Special char '"+to(r)+"' in channel "+t)),e=[r]}else a>=32&&a<=127&&(e=0===b?[a]:[a,b]);return e&&this.logger.log(3,(()=>"Char codes = "+co(e).join(","))),e}parseBackgroundAttributes(a,b){if(!((16===a||24===a)&&b>=32&&b<=47)&&!((23===a||31===a)&&b>=45&&b<=47))return!1;let t;const e={};16===a||24===a?(t=Math.floor((b-32)/2),e.background=oo[t],b%2==1&&(e.background=e.background+"_semi")):45===b?e.background="transparent":(e.foreground="black",47===b&&(e.underline=!0));const n=a<=23?1:2;return this.channels[n].setBkgData(e),!0}reset(){for(let i=0;i<Object.keys(this.channels).length;i++){const t=this.channels[i];t&&t.reset()}vo(null,null,this.cmdHistory)}cueSplitAtTime(t){for(let i=0;i<this.channels.length;i++){const e=this.channels[i];e&&e.cueSplitAtTime(t)}}}function vo(a,b,t){t.a=a,t.b=b}function yo(a,b,t){return t.a===a&&t.b===b}var bo=function(){if(null!=In&&In.VTTCue)return self.VTTCue;const t=["","lr","rl"],e=["start","middle","end","left","right"];function n(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;const n=e.toLowerCase();return!!~t.indexOf(n)&&n}function r(t){return n(e,t)}function o(t,...e){let i=1;for(;i<arguments.length;i++){const e=arguments[i];for(const p in e)t[p]=e[p]}return t}function l(e,l,text){const c=this,d={enumerable:!0};c.hasBeenReset=!1;let h="",f=!1,m=e,v=l,y=text,E=null,T="",k=!0,S="auto",_="start",A=50,O="middle",w=50,I="middle";Object.defineProperty(c,"id",o({},d,{get:function(){return h},set:function(t){h=""+t}})),Object.defineProperty(c,"pauseOnExit",o({},d,{get:function(){return f},set:function(t){f=!!t}})),Object.defineProperty(c,"startTime",o({},d,{get:function(){return m},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",o({},d,{get:function(){return v},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");v=t,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",o({},d,{get:function(){return y},set:function(t){y=""+t,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",o({},d,{get:function(){return E},set:function(t){E=t,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",o({},d,{get:function(){return T},set:function(e){const r=function(e){return n(t,e)}(e);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");T=r,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",o({},d,{get:function(){return k},set:function(t){k=!!t,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",o({},d,{get:function(){return S},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("An invalid number or illegal string was specified.");S=t,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",o({},d,{get:function(){return _},set:function(t){const e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",o({},d,{get:function(){return A},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");A=t,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",o({},d,{get:function(){return O},set:function(t){const e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");O=e,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",o({},d,{get:function(){return w},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");w=t,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",o({},d,{get:function(){return I},set:function(t){const e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");I=e,this.hasBeenReset=!0}})),c.displayState=void 0}return l.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},l}();class Eo{decode(data,t){if(!data)return"";if("string"!=typeof data)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(data))}}function To(input){function t(t,e,s,n){return 3600*(0|t)+60*(0|e)+(0|s)+parseFloat(n||0)}const e=input.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return e?parseFloat(e[2])>59?t(e[2],e[3],0,e[4]):t(e[1],e[2],e[3],e[4]):null}class ko{constructor(){this.values=Object.create(null)}set(t,e){this.get(t)||""===e||(this.values[t]=e)}get(t,e,n){return n?this.has(t)?this.values[t]:e[n]:this.has(t)?this.values[t]:e}has(t){return t in this.values}alt(t,e,a){for(let n=0;n<a.length;++n)if(e===a[n]){this.set(t,e);break}}integer(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))}percent(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){const n=parseFloat(e);
vendor: 4,191 bytes, line 2
2if(n>=0&&n<=100)return this.set(t,n),!0}return!1}}function So(input,t,e,n){const r=n?input.split(n):[input];for(const i in r){if("string"!=typeof r[i])continue;const n=r[i].split(e);if(2!==n.length)continue;t(n[0],n[1])}}const _o=new bo(0,0,""),Ao="middle"===_o.align?"middle":"center";function Oo(input,t,e){const n=input;function r(){const t=To(input);if(null===t)throw new Error("Malformed timestamp: "+n);return input=input.replace(/^[^\sa-zA-Z-]+/,""),t}function o(){input=input.replace(/^\s+/,"")}if(o(),t.startTime=r(),o(),"--\x3e"!==input.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);input=input.slice(3),o(),t.endTime=r(),o(),function(input,t){const n=new ko;So(input,(function(t,r){let o;switch(t){case"region":for(let i=e.length-1;i>=0;i--)if(e[i].id===r){n.set(t,e[i].region);break}break;case"vertical":n.alt(t,r,["rl","lr"]);break;case"line":o=r.split(","),n.integer(t,o[0]),n.percent(t,o[0])&&n.set("snapToLines",!1),n.alt(t,o[0],["auto"]),2===o.length&&n.alt("lineAlign",o[1],["start",Ao,"end"]);break;case"position":o=r.split(","),n.percent(t,o[0]),2===o.length&&n.alt("positionAlign",o[1],["start",Ao,"end","line-left","line-right","auto"]);break;case"size":n.percent(t,r);break;case"align":n.alt(t,r,["start",Ao,"end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");let line=n.get("line","auto");"auto"===line&&-1===_o.line&&(line=-1),t.line=line,t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align",Ao);let r=n.get("position","auto");"auto"===r&&50===_o.position&&(r="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=r}(input,t)}function wo(input){return input.replace(/<br(?: \/)?>/gi,"\n")}class Io{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Eo,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(data){const t=this;function e(){let e=t.buffer,n=0;for(e=wo(e);n<e.length&&"\r"!==e[n]&&"\n"!==e[n];)++n;const line=e.slice(0,n);return"\r"===e[n]&&++n,"\n"===e[n]&&++n,t.buffer=e.slice(n),line}data&&(t.buffer+=t.decoder.decode(data,{stream:!0}));try{let line="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;line=e();const n=line.match(/^()?WEBVTT([ \t].*)?$/);if(null==n||!n[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let n=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(n?n=!1:line=e(),t.state){case"HEADER":/:/.test(line)?So(line,(function(t,e){}),/:/):line||(t.state="ID");continue;case"NOTE":line||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(line)){t.state="NOTE";break}if(!line)continue;if(t.cue=new bo(0,0,""),t.state="CUE",-1===line.indexOf("--\x3e")){t.cue.id=line;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{Oo(line,t.cue,t.regionList)}catch(e){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const e=-1!==line.indexOf("--\x3e");if(!line||e&&(n=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=line}continue;case"BADCUE":line||(t.state="ID")}}}catch(e){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this}flush(){const t=this;try{if((t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state||"BADWEBVTT"===t.state)throw new Error("Malformed WebVTT signature.")}catch(e){t.onparsingerror&&t.onparsingerror(e)}return t.onflush&&t.onflush(),this}}const Ro=/\r\n|\n\r|\n|\r/g,Lo=function(t,e,n=0){return t.slice(n,n+e.length)===e};function xo(t,e,text){return Fa(t.toString())+Fa(e.toString())+Fa(text)}function Do(t,e,n,o,l,c,d){const h=new Io,f=N(new Uint8Array(t)).trim().replace(Ro,"\n").split("\n"),m=[],v=e?function(t,e=1){return ts(t,9e4,1/e)}(e.baseTime,e.timescale):0;let y,E="00:00.000",T=0,k=0,S=!0;h.oncue=function(t){const r=n[o];let c=n.ccOffset;const d=(T-v)/9e4;if(null!=r&&r.new&&(void 0!==k?c=n.ccOffset=r.start:function(t,e,n){let r=t[e],o=t[r.prevCC
2];if(!o||!o.new&&r.new)return t.ccOffset=t.presentationOffset=r.start,void(r.new=!1);for(;null!=(l=o)&&l.new;){var l;t.ccOffset+=r.start-o.start,r.new=!1,r=o,o=t[r.prevCC]}t.presentationOffset=n}(n,o,d)),d){if(!e)return void(y=new Error("Missing initPTS for VTT MPEGTS"));c=d-n.presentationOffset}const h=t.endTime-t.startTime,f=ls(9e4*(t.startTime+c-k),9e4*l)/9e4;t.startTime=Math.max(f,0),t.endTime=Math.max(f+h,0);const text=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(text)),t.id||(t.id=xo(t.startTime,t.endTime,text)),t.endTime>0&&m.push(t)},h.onparsingerror=function(t){y=t},h.onflush=function(){y?d(y):c(m)},f.forEach((line=>{if(S){if(Lo(line,"X-TIMESTAMP-MAP=")){S=!1,line.slice(16).split(",").forEach((t=>{Lo(t,"LOCAL:")?E=t.slice(6):Lo(t,"MPEGTS:")&&(T=parseInt(t.slice(7)))}));try{k=function(t){let e=parseInt(t.slice(-3));const n=parseInt(t.slice(-6,-4)),o=parseInt(t.slice(-9,-7)),l=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!(r(e)&&r(n)&&r(o)&&r(l)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${t}`);return e+=1e3*n,e+=6e4*o,e+=36e5*l,e}(E)/1e3}catch(t){y=t}return}""===line&&(S=!1)}h.parse(line+"\n")})),h.flush()}const Co="stpp.ttml.im1t",Po=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Mo=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,jo={left:"start",center:"center",right:"end",start:"start",end:"end"};function Fo(t,e,n,r){const o=ut(new Uint8Array(t),["mdat"]);if(0===o.length)return void r(new Error("Could not parse IMSC1 mdat"));const l=o.map((t=>N(t))),c=function(t,e,n=1,r=!1){return ts(t,e,1/n,r)}(e.baseTime,1,e.timescale);try{l.forEach((t=>n(function(t,e){const n=new DOMParser,r=n.parseFromString(t,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const o={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},l=Object.keys(o).reduce(((t,e)=>(t[e]=r.getAttribute(`ttp:${e}`)||o[e],t)),{}),c="preserve"!==r.getAttribute("xml:space"),d=Uo(No(r,"styling","style")),h=Uo(No(r,"layout","region")),f=No(r,"body","[begin]");return[].map.call(f,(t=>{const n=Bo(t,c);if(!n||!t.hasAttribute("begin"))return null;const r=Go(t.getAttribute("begin"),l),o=Go(t.getAttribute("dur"),l);let f=Go(t.getAttribute("end"),l);if(null===r)throw Vo(t);if(null===f){if(null===o)throw Vo(t);f=r+o}const m=new bo(r-e,f-e,n);m.id=xo(m.startTime,m.endTime,m.text);const v=function(t,style,e){const n="http://www.w3.org/ns/ttml#styling";let r=null;const o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],l=null!=t&&t.hasAttribute("style")?t.getAttribute("style"):null;l&&e.hasOwnProperty(l)&&(r=e[l]);return o.reduce(((e,o)=>{const l=$o(style,n,o)||$o(t,n,o)||$o(r,n,o);return l&&(e[o]=l),e}),{})}(h[t.getAttribute("region")],d[t.getAttribute("style")],d),{textAlign:y}=v;if(y){const t=jo[y];t&&(m.lineAlign=t),m.align=y}return O(m,v),m})).filter((t=>null!==t))}(t,c))))}catch(t){r(t)}}function No(t,e,n){const r=t.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(n)):[]}function Uo(t){return t.reduce(((t,element)=>{const e=element.getAttribute("xml:id");return e&&(t[e]=element),t}),{})}function Bo(element,t){return[].slice.call(element.childNodes).reduce(((e,n,i)=>{var r;return"br"===n.nodeName&&i?e+"\n":null!=(r=n.childNodes)&&r.length?Bo(n,t):t?e+n.textContent.trim().replace(/\s+/g," "):e+n.textContent}),"")}function $o(element,t,e){return element&&element.hasAttributeNS(t,e)?element.getAttributeNS(t,e):null}function Vo(t){return new Error(`Could not parse ttml timestamp ${t}`)}function Go(t,e){if(!t)return null;let n=To(t);return null===n&&(Po.test(t)?n=function(t,e){const n=Po.exec(t),r=(0|n[4])+(0|n[5])/e.subFrameRate;return 3600*(0|n[1])+60*(0|n[2])+(0|n[3])+r/e.frameRate}(t,e):Mo.test(t)&&(n=function(t,e){const n=Mo.exec(t),r=Number(n[1]);switch(n[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/e.frameRate;case"t":return r/e.tickRate}return r}(t,e))),n}class Ho{constructor(t,e){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=e}dispatchCue(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(t,e,n){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}function Wo(track){return track.characteristics&&/transcribes-spoken-dialog/gi.test(track.characteristics)&&/describes-music-and-sound/gi.test(track.characteristics)?"captions":"subtitles"}function Ko(t,e){return!!t&&t.kind===Wo(e)&&_s(e,t)}const qo=/\s/,Yo={newCue(track,t,e,n){const r=[];let o,l,c,d,text;const h=self.VTTCue||self.TextTrackCue;for(let m=0;m<n.rows.length;m++)if(o=n.rows[m],c=!0,d=0,text="",!o.isEmpty()){var f;for(let t=0;t<o.chars.length;t++)qo.test(o.chars[t].uchar)&&c?d++:(text+=o.chars[t].uchar,c=!1);o.cueStartTime=t,t===e&&(e+=1e-4),d>=16?d--:d++;const n=wo(text.trim()),v=xo(t,e,n);null!=track&&null!=(f=track.cues)&&f.getCueById(v)||(l=new h(t,e,n),l.id=v,l.line=m+1,l.align="left",l.position=10+Math.min(80,10*Math.floor(8*d/32)),r.push(l))}return track&&r.length&&(r.sort(((t,e)=>"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line)),r.forEach((t=>Ca(track,t)))),r}};const zo=/(\d+)-(\d+)\/(\d+)/;class Qo{constructor(t){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||Xo,this.controller=new self.AbortController,this.stats=new W}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var t;this.abortInternal(),null!=(t=this.callbacks)&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(t,e,n){const o=this.stats;if(o.loading.start)throw new Error("Loader can only be used once.");o.loading.start=self.performance.now();const l=function(t,e){const n={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(O({},t.headers))};t.rangeEnd&&n.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1));return n}(t,this.controller.signal),c="arraybuffer"===t.responseType,d=c?"byteLength":"length",{maxTimeToFirstByteMs:h,maxLoadTimeMs:f}=e.loadPolicy;this.context=t,this.config=e,this.callbacks=n,this.request=this.fetchSetup(t,l),self.clearTimeout(this.requestTimeout),e.timeout=h&&r(h)?h:f,this.requestTimeout=self.setTimeout((()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(o,t,this.response))}),e.timeout);(gs(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then((n=>{var l;this.response=this.loader=n;const d=Math.max(self.performance.now(),o.loading.start);if(self.clearTimeout(this.requestTimeout),e.timeout=f,this.requestTimeout=self.setTimeout((()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(o,t,this.response))}),f-(d-o.loading.start)),!n.ok){const{status:t,statusText:e}=n;throw new Zo(e||"fetch, bad network response",t,n)}o.loading.first=d,o.total=function(t){const e=t.get("Content-Range");if(e){const t=function(t){const e=zo.exec(t);if(e)return parseInt(e[2])-parseInt(e[1])+1}(e);if(r(t))return t}const n=t.get("Content-Length");if(n)return parseInt(n)}(n.headers)||o.total;const h=null==(l=this.callbacks)?void 0:l.onProgress;return h&&r(e.highWaterMark)?this.loadProgressively(n,o,t,e.highWaterMark,h):c?n.arrayBuffer():"json"===t.responseType?n.json():n.text()})).then((n=>{var l,c;const h=this.response;if(!h)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),o.loading.end=Math.max(self.performance.now(),o.loading.first);const f=n[d];f&&(o.loaded=o.total=f);const m={url:h.url,data:n,code:h.status},v=null==(l=this.callbacks)?void 0:l.onProgress;v&&!r(e.highWaterMark)&&v(o,t,n,h),null==(c=this.callbacks)||c.onSuccess(m,o,t,h)})).catch((e=>{var n;if(self.clearTimeout(this.requestTimeout),o.aborted)return;const code=e&&e.code||0,text=e?e.message:null;null==(n=this.callbacks)||n.onError({code:code,text:text},t,e?e.details:null,o)}))}getCacheAge(){let t=null;if(this.response){const e=this.response.headers.get("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.response?this.response.headers.get(t):null}
vendor: 14,519 bytes, line 2
2loadProgressively(t,e,n,r=0,o){const l=new Vi,c=t.body.getReader(),d=()=>c.read().then((data=>{if(data.done)return l.dataLength&&o(e,n,l.flush().buffer,t),Promise.resolve(new ArrayBuffer(0));const c=data.value,h=c.length;return e.loaded+=h,h<r||l.dataLength?(l.push(c),l.dataLength>=r&&o(e,n,l.flush().buffer,t)):o(e,n,c.buffer,t),d()})).catch((()=>Promise.reject()));return d()}}function Xo(t,e){return new self.Request(t.url,e)}class Zo extends Error{constructor(t,code,details){super(t),this.code=void 0,this.details=void 0,this.code=code,this.details=details}}const Jo=/^age:\s*[\d.]+\s*$/im;class tl{constructor(t){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=t&&t.xhrSetup||null,this.stats=new W,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,4!==t.readyState&&(this.stats.aborted=!0,t.abort()))}abort(){var t;this.abortInternal(),null!=(t=this.callbacks)&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(t,e,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:t,context:e}=this;if(!t||!e)return;const n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const o=this.xhrSetup;o?Promise.resolve().then((()=>{if(this.loader===n&&!this.stats.aborted)return o(n,e.url)})).catch((t=>{if(this.loader===n&&!this.stats.aborted)return n.open("GET",e.url,!0),o(n,e.url)})).then((()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,e,t)})).catch((t=>{var o;null==(o=this.callbacks)||o.onError({code:n.status,text:t.message},e,n,r)})):this.openAndSendXhr(n,e,t)}openAndSendXhr(t,e,n){t.readyState||t.open("GET",e.url,!0);const o=e.headers,{maxTimeToFirstByteMs:l,maxLoadTimeMs:c}=n.loadPolicy;if(o)for(const header in o)t.setRequestHeader(header,o[header]);e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,self.clearTimeout(this.requestTimeout),n.timeout=l&&r(l)?l:c,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),t.send()}readystatechange(){const{context:t,loader:e,stats:n}=this;if(!t||!e)return;const r=e.readyState,o=this.config;if(!n.aborted&&r>=2&&(0===n.loading.first&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),o.timeout!==o.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),o.timeout=o.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),4===r)){self.clearTimeout(this.requestTimeout),e.onreadystatechange=null,e.onprogress=null;const r=e.status,h="text"===e.responseType?e.responseText:null;if(r>=200&&r<300){const data=null!=h?h:e.response;if(null!=data){var l,c;n.loading.end=Math.max(self.performance.now(),n.loading.first);const o="arraybuffer"===e.responseType?data.byteLength:data.length;n.loaded=n.total=o,n.bwEstimate=8e3*n.total/(n.loading.end-n.loading.first);const d=null==(l=this.callbacks)?void 0:l.onProgress;d&&d(n,t,data,e);const h={url:e.responseURL,data:data,code:r};return void(null==(c=this.callbacks)||c.onSuccess(h,n,t,e))}}const f=o.loadPolicy.errorRetry;var d;if(Ie(f,n.retry,!1,{url:t.url,data:void 0,code:r}))this.retry(f);else M.error(`${r} while loading ${t.url}`),null==(d=this.callbacks)||d.onError({code:r,text:e.statusText},t,e,n)}}loadtimeout(){if(!this.config)return;const t=this.config.loadPolicy.timeoutRetry;if(Ie(t,this.stats.retry,!0))this.retry(t);else{var e;M.warn(`timeout while loading ${null==(e=this.context)?void 0:e.url}`);const t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))}}retry(t){const{context:e,stats:n}=this;this.retryDelay=Oe(t,n.retry),n.retry++,M.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${null==e?void 0:e.url}, retrying ${n.retry}/${t.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(t){const e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)}getCacheAge(){let t=null;if(this.loader&&Jo.test(this.loader.getAllResponseHeaders())){const e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.loader&&new RegExp(`^${t}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(t):null}}const el=I(I({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:6e7,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:tl,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class extends R{constructor(t){super("abr",t.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var e;const{fragCurrent:n,partCurrent:o,hls:l}=this,{autoLevelEnabled:c,media:d}=l;if(!n||!d)return;const f=performance.now(),m=o?o.stats:n.stats,v=o?o.duration:n.duration,y=f-m.loading.start,E=l.minAutoLevel,T=n.level,k=this._nextAutoLevel;if(m.aborted||m.loaded&&m.loaded===m.total||T<=E)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!c)return;const S=k>-1&&k!==T,_=!!t||S;if(!_&&(d.paused||!d.playbackRate||!d.readyState))return;const A=l.mainForwardBufferInfo;if(!_&&null===A)return;const O=this.bwEstimator.getEstimateTTFB(),w=Math.abs(d.playbackRate);if(y<=Math.max(O,v/(2*w)*1e3))return;const I=A?A.len/w:0,R=m.loading.first?m.loading.first-m.loading.start:-1,L=m.loaded&&R>-1,x=this.getBwEstimate(),D=l.levels,C=D[T],P=Math.max(m.loaded,Math.round(v*(n.bitrate||C.averageBitrate)/8));let M=L?y-R:y;M<1&&L&&(M=Math.min(y,8*m.loaded/x));const j=L?1e3*m.loaded/M:0,F=O/1e3,N=j?(P-m.loaded)/j:8*P/x+F;if(N<=I)return;const U=j?8*j:x,B=!0===(null==(e=(null==t?void 0:t.details)||this.hls.latestLevelDetails)?void 0:e.live),$=this.hls.config.abrBandWidthUpFactor;let V,G=Number.POSITIVE_INFINITY;for(V=T-1;V>E;V--){const t=D[V].maxBitrate,e=!D[V].details||B;if(G=this.getTimeToLoadFrag(F,U,v*t,e),G<Math.min(I,v+F))break}if(G>=N)return;if(G>10*v)return;L?this.bwEstimator.sample(y-Math.min(O,R),m.loaded):this.bwEstimator.sampleTTFB(y);const H=D[V].maxBitrate;this.getBwEstimate()*$>H&&this.resetEstimator(H);const W=this.findBestLevel(H,E,V,0,I,1,1);W>-1&&(V=W),this.warn(`Fragment ${n.sn}${o?" part "+o.index:""} of level ${T} is loading too slowly;\n Fragment duration: ${n.duration.toFixed(3)}\n Time to underbuffer: ${I.toFixed(3)} s\n Estimated load time for current fragment: ${N.toFixed(3)} s\n Estimated load time for down switch fragment: ${G.toFixed(3)} s\n TTFB estimate: ${0|R} ms\n Current BW estimate: ${r(x)?0|x:"Unknown"} bps\n New BW estimate: ${0|this.getBwEstimate()} bps\n Switching to level ${V} @ ${0|H} bps`),l.nextLoadLevel=l.nextAutoLevel=V,this.clearTimer();const K=()=>{if(this.clearTimer(),this.fragCurrent===n&&this.hls.loadLevel===V&&V>0){const t=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${V>0?"and switching down":""}\n Fragment duration: ${n.duration.toFixed(3)} s\n Time to underbuffer: ${t.toFixed(3)} s`),n.abortRequests(),this.fragCurrent=this.partCurrent=null,V>E){let e=this.findBestLevel(this.hls.levels[E].bitrate,E,V,0,t,1,1);-1===e&&(e=E),this.hls.nextLoadLevel=this.hls.nextAutoLevel=e,this.resetEstimator(this.hls.levels[e].bitrate)}}};S||N>2*G?K():this.timer=self.setInterval(K,1e3*G),l.trigger(h.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,part:o,stats:m})},this.hls=t,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(t){t&&(this.log(`setting initial bwe to ${t}`),this.hls.config.abrEwmaDefaultEstimate=t),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const t=this.hls.config;return new _(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate)}registerListeners(){const{hls:t}=this;t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.FRAG_LOADING,this.onFragLoading,this),t.on(h.FRAG_LOADED,this.onFragLoaded,this),t.on(h.FRAG_BUFFERED,this.onFragBuffered,this),t.on(h.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(h.LEVEL_LOADED,this.onLevelLoaded,this),t.on(h.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(h.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.on(h.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t&&(t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.FRAG_LOADING,this.onFragLoading,this),t.off(h.FRAG_LOADED,this.onFragLoaded,this),t.off(h.FRAG_BUFFERED,this.onFragBuffered,this),t.off(h.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(h.LEVEL_LOADED,this.onLevelLoaded,this),t.off(h.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(h.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.off(h.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(t,data){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(t,data){const e=data.frag;if(!this.ignoreFragment(e)){var n;if(!e.bitrateTest)this.fragCurrent=e,this.partCurrent=null!=(n=data.part)?n:null;this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(t,data){this.clearTimer()}onError(t,data){if(!data.fatal)switch(data.details){case d.BUFFER_ADD_CODEC_ERROR:case d.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case d.FRAG_LOAD_TIMEOUT:{const t=data.frag,{fragCurrent:e,partCurrent:n}=this;if(t&&e&&t.sn===e.sn&&t.level===e.level){const e=performance.now(),r=n?n.stats:t.stats,o=e-r.loading.start,l=r.loading.first?r.loading.first-r.loading.start:-1;if(r.loaded&&l>-1){const t=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(o-Math.min(t,l),r.loaded)}else this.bwEstimator.sampleTTFB(o)}break}}}getTimeToLoadFrag(t,e,n,r){return t+n/e+(r?t+this.lastLevelLoadSec:0)}onLevelLoaded(t,data){const e=this.hls.config,{loading:n}=data.stats,o=n.end-n.first;r(o)&&(this.lastLevelLoadSec=o/1e3),data.details.live?this.bwEstimator.update(e.abrEwmaSlowLive,e.abrEwmaFastLive):this.bwEstimator.update(e.abrEwmaSlowVoD,e.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(data.levelInfo)}onFragLoaded(t,{frag:e,part:n}){const r=n?n.stats:e.stats;if(e.type===E&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(e)){if(this.clearTimer(),e.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const t=n?n.duration:e.duration,o=this.hls.levels[e.level],l=(o.loaded?o.loaded.bytes:0)+r.loaded,c=(o.loaded?o.loaded.duration:0)+t;o.loaded={bytes:l,duration:c},o.realBitrate=Math.round(8*l/c)}if(e.bitrateTest){const t={stats:r,frag:e,part:n,id:e.type};this.onFragBuffered(h.FRAG_BUFFERED,t),e.bitrateTest=!1}else this.lastLoadedFragLevel=e.level}}onFragBuffered(t,data){const{frag:e,part:n}=data,r=null!=n&&n.stats.loaded?n.stats:e.stats;if(r.aborted)return;if(this.ignoreFragment(e))return;const o=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,r.loaded),r.bwEstimate=this.getBwEstimate(),e.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}ignoreFragment(t){return t.type!==E||"initSegment"===t.sn}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:t,minAutoLevel:e}=this.hls,n=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,o=this.findBestLevel(n,e,t,0,r,1,1);if(o>-1)return o;const l=this.hls.firstLevel,c=Math.min(Math.max(l,e),t);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${l} clamped to ${c}`),c}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const t=this.forcedAutoLevel,e=this.bwEstimator.canEstimate(),n=this.lastLoadedFragLevel>-1;if(!(-1===t||e&&n&&this.nextAutoLevelKey!==this.getAutoLevelKey()))return t;const r=e&&n?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==t){const e=this.hls.levels;if(e.length>Math.max(t,r)&&e[t].loadError<=e[r].loadError)return t}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}
2_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:t,partCurrent:e,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:r,config:o,minAutoLevel:l}=n,c=e?e.duration:t?t.duration:0,d=this.getBwEstimate(),h=this.getStarvationDelay();let f=o.abrBandWidthFactor,m=o.abrBandWidthUpFactor;if(h){const t=this.findBestLevel(d,l,r,h,0,f,m);if(t>=0)return this.rebufferNotice=-1,t}let v=c?Math.min(c,o.maxStarvationDelay):o.maxStarvationDelay;if(!h){const t=this.bitrateTestDelay;if(t){v=(c?Math.min(c,o.maxLoadingDelay):o.maxLoadingDelay)-t,this.info(`bitrate test took ${Math.round(1e3*t)}ms, set first fragment max fetchDuration to ${Math.round(1e3*v)} ms`),f=m=1}}const y=this.findBestLevel(d,l,r,h,v,f,m);if(this.rebufferNotice!==y&&(this.rebufferNotice=y,this.info(`${h?"rebuffering expected":"buffer is empty"}, optimal quality level ${y}`)),y>-1)return y;const E=n.levels[l],T=n.loadLevelObj;return T&&(null==E?void 0:E.bitrate)<T.bitrate?l:n.loadLevel}getStarvationDelay(){const t=this.hls,e=t.media;if(!e)return 1/0;const n=e&&0!==e.playbackRate?Math.abs(e.playbackRate):1,r=t.mainForwardBufferInfo;return(r?r.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(t,e,n,o,l,c,d){var h;const f=o+l,m=this.lastLoadedFragLevel,v=-1===m?this.hls.firstLevel:m,{fragCurrent:y,partCurrent:E}=this,{levels:T,allAudioTracks:k,loadLevel:S,config:_}=this.hls;if(1===T.length)return 0;const A=T[v],O=!(null==(h=this.hls.latestLevelDetails)||!h.live),w=-1===S||-1===m;let I,R="SDR",L=(null==A?void 0:A.frameRate)||0;const{audioPreference:x,videoPreference:D}=_,C=this.audioTracksByGroup||(this.audioTracksByGroup=ue(k));let P=-1;if(w){if(-1!==this.firstSelection)return this.firstSelection;const o=this.codecTiers||(this.codecTiers=function(t,e,n,r){return t.slice(n,r+1).reduce(((t,n,r)=>{if(!n.codecSet)return t;const o=n.audioGroups;let l=t[n.codecSet];l||(t[n.codecSet]=l={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:r,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),l.minBitrate=Math.min(l.minBitrate,n.bitrate);const c=Math.min(n.height,n.width);return l.minHeight=Math.min(l.minHeight,c),l.minFramerate=Math.min(l.minFramerate,n.frameRate),l.minIndex=Math.min(l.minIndex,r),l.maxScore=Math.max(l.maxScore,n.score),l.fragmentError+=n.fragmentError,l.videoRanges[n.videoRange]=(l.videoRanges[n.videoRange]||0)+1,o&&o.forEach((t=>{if(!t)return;const n=e.groups[t];n&&(l.hasDefaultAudio=l.hasDefaultAudio||e.hasDefaultAudio?n.hasDefault:n.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(n.channels).forEach((t=>{l.channels[t]=(l.channels[t]||0)+n.channels[t]})))})),t}),{})}(T,C,e,n)),l=function(t,e,n,o,l){const c=Object.keys(t),d=null==o?void 0:o.channels,h=null==o?void 0:o.audioCodec,f=null==l?void 0:l.videoCodec,m=d&&2===parseInt(d);let v=!1,y=!1,E=1/0,T=1/0,k=1/0,S=1/0,_=0,A=[];const{preferHDR:O,allowedVideoRanges:w}=oe(e,l);for(let i=c.length;i--;){const e=t[c[i]];v||(v=e.channels[2]>0),E=Math.min(E,e.minHeight),T=Math.min(T,e.minFramerate),k=Math.min(k,e.minBitrate),w.filter((t=>e.videoRanges[t]>0)).length>0&&(y=!0)}E=r(E)?E:0,T=r(T)?T:0;const I=Math.max(1080,E),R=Math.max(30,T);k=r(k)?k:n,n=Math.max(k,n),y||(e=void 0);const L=c.length>1;return{codecSet:c.reduce(((e,r)=>{const o=t[r];if(r===e)return e;if(A=y?w.filter((t=>o.videoRanges[t]>0)):[],L){if(o.minBitrate>n)return ce(r,`min bitrate of ${o.minBitrate} > current estimate of ${n}`),e;if(!o.hasDefaultAudio)return ce(r,"no renditions with default or auto-select sound found"),e;if(h&&r.indexOf(h.substring(0,4))%5!=0)return ce(r,`audio codec preference "${h}" not found`),e;if(d&&!m){if(!o.channels[d])return ce(r,`no renditions with ${d} channel sound found (channels options: ${Object.keys(o.channels)})`),e}else if((!h||m)&&v&&0===o.channels[2])return ce(r,"no renditions with stereo sound found"),e;if(o.minHeight>I)return ce(r,`min resolution of ${o.minHeight} > maximum of ${I}`),e;if(o.minFramerate>R)return ce(r,`min framerate of ${o.minFramerate} > maximum of ${R}`),e;if(!A.some((t=>o.videoRanges[t]>0)))return ce(r,`no variants with VIDEO-RANGE of ${le(A)} found`),e;if(f&&r.indexOf(f.substring(0,4))%5!=0)return ce(r,`video codec preference "${f}" not found`),e;if(o.maxScore<_)return ce(r,`max score of ${o.maxScore} < selected max of ${_}`),e}return e&&(jt(r)>=jt(e)||o.fragmentError>t[e].fragmentError)?e:(S=o.minIndex,_=o.maxScore,r)}),void 0),videoRanges:A,preferHDR:O,minFramerate:T,minBitrate:k,minIndex:S}}(o,R,t,x,D),{codecSet:c,videoRanges:d,minFramerate:h,minBitrate:f,minIndex:m,preferHDR:v}=l;P=m,I=c,R=v?d[d.length-1]:d[0],L=h,t=Math.max(t,f),this.log(`picked start tier ${le(l)}`)}else I=null==A?void 0:A.codecSet,R=null==A?void 0:A.videoRange;const M=E?E.duration:y?y.duration:0,j=this.bwEstimator.getEstimateTTFB()/1e3,F=[];for(let i=n;i>=e;i--){var N;const e=T[i],h=i>v;if(!e)continue;if(_.useMediaCapabilities&&!e.supportedResult&&!e.supportedPromise){const n=navigator.mediaCapabilities;"function"==typeof(null==n?void 0:n.decodingInfo)&&Yt(e,C,R,L,t,x)?(e.supportedPromise=zt(e,C,n,this.supportedCache),e.supportedPromise.then((t=>{if(!this.hls)return;
vendor: 4,694 bytes, line 2
2e.supportedResult=t;const n=this.hls.levels,r=n.indexOf(e);t.error?this.warn(`MediaCapabilities decodingInfo error: "${t.error}" for level ${r} ${le(t)}`):t.supported?t.decodingInfoResults.some((t=>!1===t.smooth||!1===t.powerEfficient))&&this.log(`MediaCapabilities decodingInfo for level ${r} not smooth or powerEfficient: ${le(t)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${r} ${le(t)}`),r>-1&&n.length>1&&(this.log(`Removing unsupported level ${r}`),this.hls.removeLevel(r),-1===this.hls.loadLevel&&(this.hls.nextLoadLevel=0)))})).catch((t=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${t}`)}))):e.supportedResult=Kt}if((I&&e.codecSet!==I||R&&e.videoRange!==R||h&&L>e.frameRate||!h&&L>0&&L<e.frameRate||null!=(N=e.supportedResult)&&null!=(N=N.decodingInfoResults)&&N.some((t=>!1===t.smooth)))&&(!w||i!==P)){F.push(i);continue}const y=e.details,k=(E?null==y?void 0:y.partTarget:null==y?void 0:y.averagetargetduration)||M;let A;A=h?d*t:c*t;const D=M&&o>=2*M&&0===l?e.averageBitrate:e.maxBitrate,U=this.getTimeToLoadFrag(j,A,D*k,void 0===y);if(A>=D&&(i===m||0===e.loadError&&0===e.fragmentError)&&(U<=j||!r(U)||O&&!this.bitrateTestDelay||U<f)){const t=this.forcedAutoLevel;return i===S||-1!==t&&t===S||(F.length&&this.trace(`Skipped level(s) ${F.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${T[F[0]].codecs}" ${T[F[0]].videoRange}; not compatible with "${I}" ${R}`),this.info(`switch candidate:${v}->${i} adjustedbw(${Math.round(A)})-bitrate=${Math.round(A-D)} ttfb:${j.toFixed(1)} avgDuration:${k.toFixed(1)} maxFetchDuration:${f.toFixed(1)} fetchDuration:${U.toFixed(1)} firstSelection:${w} codecSet:${e.codecSet} videoRange:${e.videoRange} hls.loadLevel:${S}`)),w&&(this.firstSelection=i),i}}return-1}set nextAutoLevel(t){const e=this.deriveNextAutoLevel(t);this._nextAutoLevel!==e&&(this.nextAutoLevelKey="",this._nextAutoLevel=e)}deriveNextAutoLevel(t){const{maxAutoLevel:e,minAutoLevel:n}=this.hls;return Math.min(Math.max(t,n),e)}},bufferController:class extends R{constructor(t,e){var source;super("buffer-controller",t.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=t=>{var e;this.hls&&"open"===(null==(e=this.mediaSource)?void 0:e.readyState)&&this.hls.pauseBuffering()},this._onStartStreaming=t=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=t=>{const{media:e,mediaSource:n}=this;t&&this.log("Media source opened"),e&&n&&(n.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(h.MEDIA_ATTACHED,{media:e,mediaSource:n}),null!==this.mediaSource&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:t,_objectUrl:e}=this;t!==e&&this.error(`Media element src was set while attaching MediaSource (${e} > ${t})`)},this.hls=t,this.fragmentTracker=e,this.appendSource=(source=j(t.config.preferManagedMediaSource),"undefined"!=typeof self&&source===self.ManagedMediaSource),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:t}=this;t.on(h.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.MANIFEST_PARSED,this.onManifestParsed,this),t.on(h.BUFFER_RESET,this.onBufferReset,this),t.on(h.BUFFER_APPENDING,this.onBufferAppending,this),t.on(h.BUFFER_CODECS,this.onBufferCodecs,this),t.on(h.BUFFER_EOS,this.onBufferEos,this),t.on(h.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(h.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(h.FRAG_PARSED,this.onFragParsed,this),t.on(h.FRAG_CHANGED,this.onFragChanged,this),t.on(h.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;
vendor: 36,449 bytes, line 2
2t.off(h.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.MANIFEST_PARSED,this.onManifestParsed,this),t.off(h.BUFFER_RESET,this.onBufferReset,this),t.off(h.BUFFER_APPENDING,this.onBufferAppending,this),t.off(h.BUFFER_CODECS,this.onBufferCodecs,this),t.off(h.BUFFER_EOS,this.onBufferEos,this),t.off(h.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(h.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(h.FRAG_PARSED,this.onFragParsed,this),t.off(h.FRAG_CHANGED,this.onFragChanged,this),t.off(h.ERROR,this.onError,this)}transferMedia(){const{media:t,mediaSource:e}=this;if(!t)return null;const n={};if(this.operationQueue){const t=this.isUpdating();t||this.operationQueue.removeBlockers();const e=this.isQueued();(t||e)&&this.warn(`Transfering MediaSource with${e?" operations in queue":""}${t?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const r=this.transferData;return!this.sourceBufferCount&&r&&r.mediaSource===e?O(n,r.tracks):this.sourceBuffers.forEach((t=>{const[e]=t;e&&(n[e]=O({},this.tracks[e]),this.removeBuffer(e)),t[0]=t[1]=null})),{media:t,mediaSource:e,tracks:n}}initTracks(){this.sourceBuffers=[[null,null],[null,null]],this.tracks={},this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(t,data){var e;let n=2;(data.audio&&!data.video||!data.altAudio)&&(n=1),this.bufferCodecEventsTotal=n,this.log(`${n} bufferCodec event(s) expected.`),null!=(e=this.transferData)&&e.mediaSource&&this.sourceBufferCount&&n&&this.bufferCreated()}onMediaAttaching(t,data){const e=this.media=data.media;this.transferData=this.overrides=void 0;const n=j(this.appendSource);if(n){const t=!!data.mediaSource;(t||data.overrides)&&(this.transferData=data,this.overrides=data.overrides);const r=this.mediaSource=data.mediaSource||new n;if(this.assignMediaSource(r),t)this._objectUrl=e.src,this.attachTransferred();else{const t=this._objectUrl=self.URL.createObjectURL(r);if(this.appendSource)try{e.removeAttribute("src");const n=self.ManagedMediaSource;e.disableRemotePlayback=e.disableRemotePlayback||n&&r instanceof n,Rs(e),function(t,e){const source=self.document.createElement("source");source.type="video/mp4",source.src=e,t.appendChild(source)}(e,t),e.load()}catch(n){e.src=t}else e.src=t}e.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(t){var e,n;this.log(`${(null==(e=this.transferData)?void 0:e.mediaSource)===t?"transferred":"created"} media source: ${null==(n=t.constructor)?void 0:n.name}`),t.addEventListener("sourceopen",this._onMediaSourceOpen),t.addEventListener("sourceended",this._onMediaSourceEnded),t.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.addEventListener("startstreaming",this._onStartStreaming),t.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const t=this.media,data=this.transferData;if(!data||!t)return;const e=this.tracks,n=data.tracks,r=n?Object.keys(n):null,o=r?r.length:0,l=()=>{Promise.resolve().then((()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()}))};if(n&&r&&o){if(!this.tracksReady)return this.hls.config.startFragPrefetch=!0,void this.log("attachTransferred: waiting for SourceBuffer track info");if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})\nrequired tracks: ${le(e,((t,e)=>"initSegment"===t?void 0:e))};\ntransfer tracks: ${le(n,((t,e)=>"initSegment"===t?void 0:e))}}`),!F(n,e)){data.mediaSource=null,data.tracks=void 0;const r=t.currentTime,details=this.details,o=Math.max(r,(null==details?void 0:details.fragments[0].start)||0);return o-r>1?void this.log(`attachTransferred: waiting for playback to reach new tracks start time ${r} -> ${o}`):(this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(n)}"->"${Object.keys(e)}") start time: ${o} currentTime: ${r}`),this.onMediaDetaching(h.MEDIA_DETACHING,{}),this.onMediaAttaching(h.MEDIA_ATTACHING,data),void(t.currentTime=o))}this.transferData=void 0,r.forEach((t=>{const e=t,track=n[e];if(track){const t=track.buffer;if(t){const n=this.fragmentTracker,r=track.id;if(n.hasFragments(r)||n.hasParts(r)){const o=ln.getBuffered(t);n.detectEvictedFragments(e,o,r,null,!0)}const o=Ls(e),l=[e,t];this.sourceBuffers[o]=l,t.updating&&this.operationQueue&&this.operationQueue.prependBlocker(e),this.trackSourceBuffer(e,track)}}})),l(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),l()}get mediaSourceOpenOrEnded(){var t;const e=null==(t=this.mediaSource)?void 0:t.readyState;return"open"===e||"ended"===e}onMediaDetaching(t,data){const e=!!data.transferMedia;this.transferData=this.overrides=void 0;const{media:n,mediaSource:r,_objectUrl:o}=this;if(r){if(this.log("media source "+(e?"transferring":"detaching")),e)this.sourceBuffers.forEach((([t])=>{t&&this.removeBuffer(t)})),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const t="open"===r.readyState;try{const e=r.sourceBuffers;for(let i=e.length;i--;)t&&e[i].abort(),r.removeSourceBuffer(e[i]);t&&r.endOfStream()}catch(t){this.warn(`onMediaDetaching: ${t.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(r.removeEventListener("startstreaming",this._onStartStreaming),r.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}n&&(n.removeEventListener("emptied",this._onMediaEmptied),e||(o&&self.URL.revokeObjectURL(o),this.mediaSrc===o?(n.removeAttribute("src"),this.appendSource&&Rs(n),n.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(h.MEDIA_DETACHED,data)}onBufferReset(){this.sourceBuffers.forEach((([t])=>{t&&this.resetBuffer(t)})),this.initTracks()}resetBuffer(t){var e;const n=null==(e=this.tracks[t])?void 0:e.buffer;if(this.removeBuffer(t),n)try{var r;null!=(r=this.mediaSource)&&r.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(e){this.warn(`onBufferReset ${t}`,e)}delete this.tracks[t]}removeBuffer(t){this.removeBufferListeners(t),this.sourceBuffers[Ls(t)]=[null,null];const track=this.tracks[t];track&&(track.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new As(this.tracks)}onBufferCodecs(t,data){var e;const n=this.tracks,r=Object.keys(data);this.log(`BUFFER_CODECS: "${r}" (current SB count ${this.sourceBufferCount})`);const o="audiovideo"in data&&(n.audio||n.video)||n.audiovideo&&("audio"in data||"video"in data),l=!o&&this.sourceBufferCount&&this.media&&r.some((t=>!n[t]));o||l?this.warn(`Unsupported transition between "${Object.keys(n)}" and "${r}" SourceBuffers`):(r.forEach((t=>{var e,r;const o=data[t],{id:l,codec:c,levelCodec:d,container:h,metadata:f,supplemental:m}=o;let track=n[t];const v=null==(e=this.transferData)||null==(e=e.tracks)?void 0:e[t],y=null!=v&&v.buffer?v:track,E=(null==y?void 0:y.pendingCodec)||(null==y?void 0:y.codec),T=null==y?void 0:y.levelCodec;track||(track=n[t]={buffer:void 0,listeners:[],codec:c,supplemental:m,container:h,levelCodec:d,metadata:f,id:l});const k=Bt(E,T),S=null==k?void 0:k.replace(Os,"$1");let _=Bt(c,d);const A=null==(r=_)?void 0:r.replace(Os,"$1");_&&k&&S!==A&&("audio"===t.slice(0,5)&&(_=Ut(_,this.appendSource)),this.log(`switching codec ${E} to ${_}`),_!==(track.pendingCodec||track.codec)&&(track.pendingCodec=_),track.container=h,this.appendChangeType(t,h,_))})),(this.tracksReady||this.sourceBufferCount)&&(data.tracks=this.sourceBufferTracks),this.sourceBufferCount||(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!data.video&&"main"===(null==(e=data.audio)?void 0:e.id)&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks()))}get sourceBufferTracks(){return Object.keys(this.tracks).reduce(((t,e)=>{const track=this.tracks[e];return t[e]={id:track.id,container:track.container,codec:track.codec,levelCodec:track.levelCodec},t}),{})}appendChangeType(t,e,n){const r=`${e};codecs=${n}`,o={label:`change-type=${r}`,execute:()=>{const track=this.tracks[t];if(track){const o=track.buffer;null!=o&&o.changeType&&(this.log(`changing ${t} sourceBuffer type to ${r}`),o.changeType(r),track.codec=n,track.container=e)}this.shiftAndExecuteNext(t)},onStart:()=>{},onComplete:()=>{},onError:e=>{this.warn(`Failed to change ${t} SourceBuffer type`,e)}};this.append(o,t,this.isPending(this.tracks[t]))}blockAudio(t){var e;const n=t.start,r=n+.05*t.duration;if(!0===(null==(e=this.fragmentTracker.getAppendedFrag(n,E))?void 0:e.gap))return;const o={label:"block-audio",execute:()=>{var t;const e=this.tracks.video;(this.lastVideoAppendEnd>r||null!=e&&e.buffer&&ln.isBuffered(e.buffer,r)||!0===(null==(t=this.fragmentTracker.getAppendedFrag(r,E))?void 0:t.gap))&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:t=>{this.warn("Error executing block-audio operation",t)}};this.blockedAudioAppend={op:o,frag:t},this.append(o,"audio",!0)}unblockAudio(){const{blockedAudioAppend:t,operationQueue:e}=this;t&&e&&(this.blockedAudioAppend=null,e.unblockAudio(t.op))}onBufferAppending(t,e){const{tracks:n}=this,{data:data,type:o,parent:l,frag:f,part:m,chunkMeta:v,offset:y}=e,T=v.buffering[o],{sn:k,cc:S}=f,_=self.performance.now();T.start=_;const A=f.stats.buffering,O=m?m.stats.buffering:null;0===A.start&&(A.start=_),O&&0===O.start&&(O.start=_);const w=n.audio;let I=!1;"audio"===o&&"audio/mpeg"===(null==w?void 0:w.container)&&(I=!this.lastMpegAudioChunk||1===v.id||this.lastMpegAudioChunk.sn!==v.sn,this.lastMpegAudioChunk=v);const R=n.video,L=null==R?void 0:R.buffer;if(L&&"initSegment"!==k){const t=m||f,e=this.blockedAudioAppend;if("audio"!==o||"main"===l||this.blockedAudioAppend||R.ending||R.ended){if("video"===o){const n=t.end;if(e){const t=e.frag.start;(n>t||n<this.lastVideoAppendEnd||ln.isBuffered(L,t))&&this.unblockAudio()}this.lastVideoAppendEnd=n}}else{const e=t.start+.05*t.duration,n=L.buffered,r=this.currentOp("video");n.length||r?!r&&!ln.isBuffered(L,e)&&this.lastVideoAppendEnd<e&&this.blockAudio(t):this.blockAudio(t)}}const x=(m||f).start,D={label:`append-${o}`,execute:()=>{var t;T.executeStart=self.performance.now();const e=null==(t=this.tracks[o])?void 0:t.buffer;e&&(I?this.updateTimestampOffset(e,x,.1,o,k,S):void 0!==y&&r(y)&&this.updateTimestampOffset(e,y,1e-6,o,k,S)),this.appendExecutor(data,o)},onStart:()=>{},onComplete:()=>{const t=self.performance.now();T.executeEnd=T.end=t,0===A.first&&(A.first=t),O&&0===O.first&&(O.first=t);const e={};this.sourceBuffers.forEach((([t,n])=>{t&&(e[t]=ln.getBuffered(n))})),this.appendErrors[o]=0,"audio"===o||"video"===o?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(h.BUFFER_APPENDED,{type:o,frag:f,part:m,chunkMeta:v,parent:f.type,timeRanges:e})},onError:t=>{var e;const n={type:c.MEDIA_ERROR,parent:f.type,details:d.BUFFER_APPEND_ERROR,sourceBufferName:o,frag:f,part:m,chunkMeta:v,error:t,err:t,fatal:!1},r=null==(e=this.media)?void 0:e.error;if(t.code===DOMException.QUOTA_EXCEEDED_ERR||"QuotaExceededError"==t.name||"quota"in t)n.details=d.BUFFER_FULL_ERROR;else if(t.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!r)n.errorAction=Ne(!0);else if(t.name===ws&&0===this.sourceBufferCount)n.errorAction=Ne(!0);else{const t=++this.appendErrors[o];this.warn(`Failed ${t}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${o}" sourceBuffer (${r||"no media error"})`),(t>=this.hls.config.appendErrorMaxRetry||r)&&(n.fatal=!0)}this.hls.trigger(h.ERROR,n)}};this.log(`queuing "${o}" append sn: ${k}${m?" p: "+m.index:""} of ${f.type===E?"level":"track"} ${f.level} cc: ${S}`),this.append(D,o,this.isPending(this.tracks[o]))}getFlushOp(t,e,n){return this.log(`queuing "${t}" remove ${e}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(t,e,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(h.BUFFER_FLUSHED,{type:t})},onError:r=>{this.warn(`Failed to remove ${e}-${n} from "${t}" SourceBuffer`,r)}}}onBufferFlushing(t,data){const{type:e,startOffset:n,endOffset:r}=data;e?this.append(this.getFlushOp(e,n,r),e):this.sourceBuffers.forEach((([t])=>{t&&this.append(this.getFlushOp(t,n,r),t)}))}onFragParsed(t,data){const{frag:e,part:n}=data,r=[],o=n?n.elementaryStreams:e.elementaryStreams;o[z]?r.push("audiovideo"):(o[K]&&r.push("audio"),o[Y]&&r.push("video"));0===r.length&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${e.type} level: ${e.level} sn: ${e.sn}`),this.blockBuffers((()=>{const t=self.performance.now();e.stats.buffering.end=t,n&&(n.stats.buffering.end=t);const r=n?n.stats:e.stats;this.hls.trigger(h.FRAG_BUFFERED,{frag:e,part:n,stats:r,id:e.type})}),r).catch((t=>{this.warn(`Fragment buffered callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)}))}onFragChanged(t,data){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some((([t])=>{if(t){const track=this.tracks[t];if(track)return!track.ended||track.ending}return!1}))}onBufferEos(t,data){var e;this.sourceBuffers.forEach((([t])=>{if(t){const track=this.tracks[t];data.type&&data.type!==t||(track.ending=!0,track.ended||(track.ended=!0,this.log(`${t} buffer reached EOS`)))}}));const n=!1!==(null==(e=this.overrides)?void 0:e.endOfStream);this.sourceBufferCount>0&&!this.sourceBuffers.some((([t])=>{var e;return t&&!(null!=(e=this.tracks[t])&&e.ended)}))?n?(this.log("Queueing EOS"),this.blockUntilOpen((()=>{this.tracksEnded();const{mediaSource:t}=this;t&&"open"===t.readyState?(this.log("Calling mediaSource.endOfStream()"),t.endOfStream(),this.hls.trigger(h.BUFFERED_TO_END,void 0)):t&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${t.readyState}`)}))):(this.tracksEnded(),this.hls.trigger(h.BUFFERED_TO_END,void 0)):"video"===data.type&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach((([t])=>{if(null!==t){const track=this.tracks[t];track&&(track.ending=!1)}}))}onLevelUpdated(t,{details:details}){details.fragments.length&&(this.details=details,this.updateDuration())}updateDuration(){this.blockUntilOpen((()=>{const t=this.getDurationAndRange();t&&this.updateMediaSource(t)}))}onError(t,data){if(data.details===d.BUFFER_APPEND_ERROR&&data.frag){var e;const t=null==(e=data.errorAction)?void 0:e.nextAutoLevel;r(t)&&t!==data.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:t,details:details,media:e}=this;if(!e||null===details)return;if(!this.sourceBufferCount)return;const n=t.config,o=e.currentTime,l=details.levelTargetDuration,c=details.live&&null!==n.liveBackBufferLength?n.liveBackBufferLength:n.backBufferLength;if(r(c)&&c>=0){const t=Math.max(c,l),e=Math.floor(o/l)*l-t;this.flushBackBuffer(o,l,e)}const d=n.frontBufferFlushThreshold;if(r(d)&&d>0){const t=Math.max(n.maxBufferLength,d),e=Math.max(t,l),r=Math.floor(o/l)*l+e;this.flushFrontBuffer(o,l,r)}}flushBackBuffer(t,e,n){this.sourceBuffers.forEach((([t,e])=>{if(e){const o=ln.getBuffered(e);if(o.length>0&&n>o.start(0)){var r;this.hls.trigger(h.BACK_BUFFER_REACHED,{bufferEnd:n});const track=this.tracks[t];if(null!=(r=this.details)&&r.live)this.hls.trigger(h.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(null!=track&&track.ended)return void this.log(`Cannot flush ${t} back buffer while SourceBuffer is in ended state`);this.hls.trigger(h.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:t})}}}))}flushFrontBuffer(t,e,n){this.sourceBuffers.forEach((([e,r])=>{if(r){const o=ln.getBuffered(r),l=o.length;if(l<2)return;const c=o.start(l-1),d=o.end(l-1);if(n>c||t>=c&&t<=d)return;this.hls.trigger(h.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:e})}}))}getDurationAndRange(){var t;const{details:details,mediaSource:e}=this;if(!details||!this.media||"open"!==(null==e?void 0:e.readyState))return null;const n=details.edge;if(details.live&&this.hls.config.liveDurationInfinity){if(details.fragments.length&&e.setLiveSeekableRange){const t=Math.max(0,details.fragmentStart);return{duration:1/0,start:t,end:Math.max(t,n)}}return{duration:1/0}}const o=null==(t=this.overrides)?void 0:t.duration;if(o)return r(o)?{duration:o}:null;const l=this.media.duration;return n>(r(e.duration)?e.duration:0)&&n>l||!r(l)?{duration:n}:null}updateMediaSource({duration:t,start:e,end:n}){const o=this.mediaSource;this.media&&o&&"open"===o.readyState&&(o.duration!==t&&(r(t)&&this.log(`Updating MediaSource duration to ${t.toFixed(3)}`),o.duration=t),void 0!==e&&void 0!==n&&(this.log(`MediaSource duration is set to ${o.duration}. Setting seekable range to ${e}-${n}.`),o.setLiveSeekableRange(e,n)))}get tracksReady(){const t=this.pendingTrackCount;return t>0&&(t>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:t,pendingTrackCount:e,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${e} codec events expected: ${t}) ${le(n)}`),this.tracksReady){var r;const t=null==(r=this.transferData)?void 0:r.tracks;t&&Object.keys(t).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const t={};this.sourceBuffers.forEach((([e,n])=>{if(e){const track=this.tracks[e];t[e]={buffer:n,container:track.container,codec:track.codec,supplemental:track.supplemental,levelCodec:track.levelCodec,id:track.id,metadata:track.metadata}}})),this.hls.trigger(h.BUFFER_CREATED,{tracks:t}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach((([t])=>{this.executeNext(t)}))}else{const t=new Error("could not create source buffer for media codec(s)");this.hls.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:t,reason:t.message})}}createSourceBuffers(){const{tracks:t,sourceBuffers:e,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const o in t){const l=o,track=t[l];if(this.isPending(track)){const t=this.getTrackCodec(track,l),o=`${track.container};codecs=${t}`;track.codec=t,this.log(`creating sourceBuffer(${o})${this.currentOp(l)?" Queued":""} ${le(track)}`);try{const t=n.addSourceBuffer(o),r=Ls(l),c=[l,t];e[r]=c,track.buffer=t}catch(t){var r;return this.error(`error while trying to add sourceBuffer: ${t.message}`),this.shiftAndExecuteNext(l),null==(r=this.operationQueue)||r.removeBlockers(),delete this.tracks[l],void this.hls.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,sourceBufferName:l,mimeType:o,parent:track.id})}this.trackSourceBuffer(l,track)}}this.bufferCreated()}getTrackCodec(track,t){const e=track.supplemental;let n=track.codec;e&&("video"===t||"audiovideo"===t)&&Dt(e,"video")&&(n=function(t,e){const n=[];if(t){const e=t.split(",");for(let i=0;i<e.length;i++)xt(e[i],"video")||n.push(e[i])}return e&&n.push(e),n.join(",")}(n,e));const r=Bt(n,track.levelCodec);return r?"audio"===t.slice(0,5)?Ut(r,this.appendSource):r:""}trackSourceBuffer(t,track){const e=track.buffer;if(!e)return;const n=this.getTrackCodec(track,t);this.tracks[t]={buffer:e,codec:n,container:track.container,levelCodec:track.levelCodec,supplemental:track.supplemental,metadata:track.metadata,id:track.id,listeners:[]},this.removeBufferListeners(t),this.addBufferListener(t,"updatestart",this.onSBUpdateStart),this.addBufferListener(t,"updateend",this.onSBUpdateEnd),this.addBufferListener(t,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(t,"bufferedchange",((t,e)=>{const n=e.removedRanges;null!=n&&n.length&&this.hls.trigger(h.BUFFER_FLUSHED,{type:t})}))}get mediaSrc(){var t,e;const n=(null==(t=this.media)||null==(e=t.querySelector)?void 0:e.call(t,"source"))||this.media;return null==n?void 0:n.src}onSBUpdateStart(t){const e=this.currentOp(t);e&&e.onStart()}onSBUpdateEnd(t){var e;if("closed"===(null==(e=this.mediaSource)?void 0:e.readyState))return void this.resetBuffer(t);const n=this.currentOp(t);n&&(n.onComplete(),this.shiftAndExecuteNext(t))}onSBUpdateError(t,e){var n;const r=new Error(`${t} SourceBuffer error. MediaSource readyState: ${null==(n=this.mediaSource)?void 0:n.readyState}`);this.error(`${r}`,e),this.hls.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.BUFFER_APPENDING_ERROR,sourceBufferName:t,error:r,fatal:!1});const o=this.currentOp(t);o&&o.onError(r)}updateTimestampOffset(t,e,n,r,o,l){const c=e-t.timestampOffset;Math.abs(c)>=n&&(this.log(`Updating ${r} SourceBuffer timestampOffset to ${e} (sn: ${o} cc: ${l})`),t.timestampOffset=e)}removeExecutor(t,e,n){const{media:o,mediaSource:l}=this,track=this.tracks[t],c=null==track?void 0:track.buffer;if(!o||!l||!c)return this.warn(`Attempting to remove from the ${t} SourceBuffer, but it does not exist`),void this.shiftAndExecuteNext(t);const d=r(o.duration)?o.duration:1/0,h=r(l.duration)?l.duration:1/0,f=Math.max(0,e),m=Math.min(n,d,h);m>f&&(!track.ending||track.ended)?(track.ended=!1,this.log(`Removing [${f},${m}] from the ${t} SourceBuffer`),c.remove(f,m)):this.shiftAndExecuteNext(t)}appendExecutor(data,t){const track=this.tracks[t],e=null==track?void 0:track.buffer;if(!e)throw new Is(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);track.ending=!1,track.ended=!1,e.appendBuffer(data)}blockUntilOpen(t){if(this.isUpdating()||this.isQueued())this.blockBuffers(t).catch((t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)}));else try{t()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some((([t,e])=>t&&e.updating))}isQueued(){return this.sourceBuffers.some((([t])=>t&&!!this.currentOp(t)))}isPending(track){return!!track&&!track.buffer}blockBuffers(t,e=this.sourceBufferTypes){if(!e.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(t);const{operationQueue:n}=this,r=e.map((t=>this.appendBlocker(t)));return e.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(r).then((e=>{n===this.operationQueue&&(t(),this.stepOperationQueue(this.sourceBufferTypes))}))}stepOperationQueue(t){t.forEach((t=>{var e;const n=null==(e=this.tracks[t])?void 0:e.buffer;n&&!n.updating&&this.shiftAndExecuteNext(t)}))}append(t,e,n){this.operationQueue&&this.operationQueue.append(t,e,n)}appendBlocker(t){if(this.operationQueue)return this.operationQueue.appendBlocker(t)}currentOp(t){return this.operationQueue?this.operationQueue.current(t):null}executeNext(t){t&&this.operationQueue&&this.operationQueue.executeNext(t)}shiftAndExecuteNext(t){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(t)}get pendingTrackCount(){return Object.keys(this.tracks).reduce(((t,e)=>t+(this.isPending(this.tracks[e])?1:0)),0)}get sourceBufferCount(){return this.sourceBuffers.reduce(((t,[e])=>t+(e?1:0)),0)}get sourceBufferTypes(){return this.sourceBuffers.map((([t])=>t)).filter((t=>!!t))}addBufferListener(t,e,n){const track=this.tracks[t];if(!track)return;const r=track.buffer;if(!r)return;const o=n.bind(this,t);track.listeners.push({event:e,listener:o}),r.addEventListener(e,o)}removeBufferListeners(t){const track=this.tracks[t];if(!track)return;const e=track.buffer;e&&(track.listeners.forEach((t=>{e.removeEventListener(t.event,t.listener)})),track.listeners.length=0)}},capLevelController:xs,errorController:class extends R{constructor(t){super("error-controller",t.logger),this.hls=void 0,this.playlistError=0,this.hls=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(h.ERROR,this.onError,this),t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const t=this.hls;t&&(t.off(h.ERROR,this.onError,this),t.off(h.ERROR,this.onErrorOut,this),t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(t){}stopLoad(){this.playlistError=0}getVariantLevelIndex(t){return(null==t?void 0:t.type)===E?t.level:this.getVariantIndex()}getVariantIndex(){var t;const e=this.hls,n=e.currentLevel;return null!=(t=e.loadLevelObj)&&t.details||-1===n?e.loadLevel:n}variantHasKey(t,e){if(t){var n;if(null!=(n=t.details)&&n.hasKey(e))return!0;const r=t.audioGroups;if(r){return this.hls.allAudioTracks.filter((track=>r.indexOf(track.groupId)>=0)).some((track=>{var t;return null==(t=track.details)?void 0:t.hasKey(e)}))}}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(t,data){var e;if(data.fatal)return;const n=this.hls,r=data.context;switch(data.details){case d.FRAG_LOAD_ERROR:case d.FRAG_LOAD_TIMEOUT:case d.KEY_LOAD_ERROR:case d.KEY_LOAD_TIMEOUT:return void(data.errorAction=this.getFragRetryOrSwitchAction(data));case d.FRAG_PARSING_ERROR:if(null!=(e=data.frag)&&e.gap)return void(data.errorAction=Ne());case d.FRAG_GAP:case d.FRAG_DECRYPT_ERROR:return data.errorAction=this.getFragRetryOrSwitchAction(data),void(data.errorAction.action=xe);case d.LEVEL_EMPTY_ERROR:case d.LEVEL_PARSING_ERROR:{var o;const t=data.parent===E?data.level:n.loadLevel;data.details===d.LEVEL_EMPTY_ERROR&&null!=(o=data.context)&&null!=(o=o.levelDetails)&&o.live?data.errorAction=this.getPlaylistRetryOrSwitchAction(data,t):(data.levelRetry=!1,data.errorAction=this.getLevelSwitchAction(data,t))}return;case d.LEVEL_LOAD_ERROR:case d.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==r?void 0:r.level)&&(data.errorAction=this.getPlaylistRetryOrSwitchAction(data,r.level)));case d.AUDIO_TRACK_LOAD_ERROR:case d.AUDIO_TRACK_LOAD_TIMEOUT:case d.SUBTITLE_LOAD_ERROR:case d.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const t=n.loadLevelObj;if(t&&(r.type===v&&t.hasAudioGroup(r.groupId)||r.type===y&&t.hasSubtitleGroup(r.groupId)))return data.errorAction=this.getPlaylistRetryOrSwitchAction(data,n.loadLevel),data.errorAction.action=xe,void(data.errorAction.flags=Me)}return;case d.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:return void(data.errorAction={action:xe,flags:je});case d.KEY_SYSTEM_SESSION_UPDATE_FAILED:case d.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case d.KEY_SYSTEM_NO_SESSION:return void(data.errorAction={action:xe,flags:Fe});case d.BUFFER_ADD_CODEC_ERROR:case d.REMUX_ALLOC_ERROR:case d.BUFFER_APPEND_ERROR:var l;if(!data.errorAction)data.errorAction=this.getLevelSwitchAction(data,null!=(l=data.level)?l:n.loadLevel);return;case d.INTERNAL_EXCEPTION:case d.BUFFER_APPENDING_ERROR:case d.BUFFER_FULL_ERROR:case d.LEVEL_SWITCH_ERROR:case d.BUFFER_STALLED_ERROR:case d.BUFFER_SEEK_OVER_HOLE:case d.BUFFER_NUDGE_ON_STALL:return void(data.errorAction=Ne())}data.type===c.KEY_SYSTEM_ERROR&&(data.levelRetry=!1,data.errorAction=Ne())}getPlaylistRetryOrSwitchAction(data,t){const e=Ae(this.hls.config.playlistLoadPolicy,data),n=this.playlistError++;if(Ie(e,n,ke(data),data.response))return{action:Ce,flags:Pe,retryConfig:e,retryCount:n};const r=this.getLevelSwitchAction(data,t);return e&&(r.retryConfig=e,r.retryCount=n),r}getFragRetryOrSwitchAction(data){const t=this.hls,e=this.getVariantLevelIndex(data.frag),n=t.levels[e],{fragLoadPolicy:r,keyLoadPolicy:o}=t.config,l=Ae(Se(data)?o:r,data),c=t.levels.reduce(((t,e)=>t+e.fragmentError),0);if(n&&(data.details!==d.FRAG_GAP&&n.fragmentError++,!_e(data))){if(Ie(l,c,ke(data),data.response))return{action:Ce,flags:Pe,retryConfig:l,retryCount:c}}const h=this.getLevelSwitchAction(data,e);return l&&(h.retryConfig=l,h.retryCount=c),h}getLevelSwitchAction(data,t){const e=this.hls;null==t&&(t=e.loadLevel);const n=this.hls.levels[t];if(n){var r,o;const t=data.details;n.loadError++,t===d.BUFFER_APPEND_ERROR&&n.fragmentError++;let h=-1;const{levels:f,loadLevel:m,minAutoLevel:S,maxAutoLevel:_}=e;e.autoLevelEnabled||e.config.preserveManualLevelOnError||(e.loadLevel=-1);const A=null==(r=data.frag)?void 0:r.type,O=(A===T&&t===d.FRAG_PARSING_ERROR||"audio"===data.sourceBufferName&&(t===d.BUFFER_ADD_CODEC_ERROR||t===d.BUFFER_APPEND_ERROR))&&f.some((({audioCodec:t})=>n.audioCodec!==t)),w="video"===data.sourceBufferName&&(t===d.BUFFER_ADD_CODEC_ERROR||t===d.BUFFER_APPEND_ERROR)&&f.some((({codecSet:t,audioCodec:e})=>n.codecSet!==t&&n.audioCodec===e)),{type:I,groupId:R}=null!=(o=data.context)?o:{};for(let i=f.length;i--;){const e=(i+m)%f.length;if(e!==m&&e>=S&&e<=_&&0===f[e].loadError){var l,c;const r=f[e];if(t===d.FRAG_GAP&&A===E&&data.frag){const t=f[e].details;if(t){const e=ye(data.frag,t.fragments,data.frag.start);if(null!=e&&e.gap)continue}}else{if(I===v&&r.hasAudioGroup(R)||I===y&&r.hasSubtitleGroup(R))continue;if(A===T&&null!=(l=n.audioGroups)&&l.some((t=>r.hasAudioGroup(t)))||A===k&&null!=(c=n.subtitleGroups)&&c.some((t=>r.hasSubtitleGroup(t)))||O&&n.audioCodec===r.audioCodec||w&&n.codecSet===r.codecSet||!O&&n.codecSet!==r.codecSet)continue}h=e;break}}if(h>-1&&e.loadLevel!==h)return data.levelRetry=!0,this.playlistError=0,{action:xe,flags:Pe,nextAutoLevel:h}}return{action:xe,flags:Me}}onErrorOut(t,data){var e;switch(null==(e=data.errorAction)?void 0:e.action){case Le:break;case xe:this.sendAlternateToPenaltyBox(data),data.errorAction.resolved||data.details===d.FRAG_GAP?/MediaSource readyState: ended/.test(data.error.message)&&(this.warn(`MediaSource ended after "${data.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError()):data.fatal=!0}data.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(data){const t=this.hls,e=data.errorAction;if(!e)return;const{flags:n}=e,r=e.nextAutoLevel;switch(n){case Pe:this.switchLevel(data,r);break;case je:{const n=this.getVariantLevelIndex(data.frag),r=t.levels[n],o=null==r?void 0:r.attrs["HDCP-LEVEL"];if(e.hdcpLevel=o,"NONE"===o)this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(o){t.maxHdcpLevel=Zt[Zt.indexOf(o)-1],e.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case Fe:{const t=data.decryptdata;if(t){const n=this.hls.levels,r=n.length;for(let i=r;i--;){var o,l;if(this.variantHasKey(n[i],t))this.log(`Banned key found in level ${i} (${n[i].bitrate}bps) or audio group "${null==(o=n[i].audioGroups)?void 0:o.join(",")}" (${null==(l=data.frag)?void 0:l.type} fragment) ${U(t.keyId||[])}`),n[i].fragmentError++,n[i].loadError++,this.log(`Removing level ${i} with key error (${data.error})`),this.hls.removeLevel(i)}const c=data.frag;if(this.hls.levels.length<r)e.resolved=!0;else if(c&&c.type!==E){const n=c.decryptdata;n&&!t.matches(n)&&(e.resolved=!0)}}break}}e.resolved||this.switchLevel(data,r)}switchLevel(data,t){if(void 0!==t&&data.errorAction&&(this.warn(`switching to level ${t} after ${data.details}`),this.hls.nextAutoLevel=t,data.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,data.details===d.BUFFER_ADD_CODEC_ERROR&&data.mimeType&&"audiovideo"!==data.sourceBufferName)){const t=Ht(data.mimeType),e=this.hls.levels;for(let i=e.length;i--;)e[i][`${data.sourceBufferName}Codec`]===t&&(this.log(`Removing level ${i} for ${data.details} ("${t}" not supported)`),this.hls.removeLevel(i))}}},fpsController:class{constructor(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}setStreamController(t){this.streamController=t}registerListeners(){this.hls.on(h.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(h.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(h.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(h.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(t,data){const e=this.hls.config;if(e.capLevelOnFPSDrop){const t=data.media instanceof self.HTMLVideoElement?data.media:null;this.media=t,t&&"function"==typeof t.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),e.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(video,t,e){const n=performance.now();if(t){if(this.lastTime){const r=n-this.lastTime,o=e-this.lastDroppedFrames,l=t-this.lastDecodedFrames,c=1e3*o/r,d=this.hls;if(d.trigger(h.FPS_DROP,{currentDropped:o,currentDecoded:l,totalDroppedFrames:e}),c>0&&o>d.config.fpsDroppedMonitoringThreshold*l){let t=d.currentLevel;d.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(-1===d.autoLevelCapping||d.autoLevelCapping>=t)&&(t-=1,d.trigger(h.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:d.currentLevel}),d.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=e,this.lastDecodedFrames=t}}checkFPSInterval(){const video=this.media;if(video)if(this.isVideoPlaybackQualityAvailable){const t=video.getVideoPlaybackQuality();this.checkFPS(video,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(video,video.webkitDecodedFrameCount,video.webkitDroppedFrameCount)}},stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Fn,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:Yo,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends Bi{constructor(t,e,n){super(t,e,n,"subt
2itle-stream-controller",k),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(h.LEVEL_LOADED,this.onLevelLoaded,this),t.on(h.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(h.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(h.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(h.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(h.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(h.LEVEL_LOADED,this.onLevelLoaded,this),t.off(h.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(h.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(h.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(h.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(h.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(t,e){this.stopLoad(),this.state=Ri,this.setInterval(500),this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(t,data){this.tracksBuffered=[],super.onMediaDetaching(t,data)}onLevelLoaded(t,data){this.mainDetails=data.details}onSubtitleFragProcessed(t,data){const{frag:e,success:n}=data;if(this.fragContextChanged(e)||(X(e)&&(this.fragPrevious=e),this.state=Ri),!n)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let o;const l=e.start;for(let i=0;i<r.length;i++)if(l>=r[i].start&&l<=r[i].end){o=r[i];break}const c=e.start+e.duration;o?o.end=c:(o={start:l,end:c},r.push(o)),this.fragmentTracker.fragBuffered(e),this.fragBufferedComplete(e,null),this.media&&this.tick()}onBufferFlushing(t,data){const{startOffset:e,endOffset:n}=data;if(0===e&&n!==Number.POSITIVE_INFINITY){const t=n-1;if(t<=0)return;data.endOffsetSubtitles=Math.max(0,t),this.tracksBuffered.forEach((e=>{for(let i=0;i<e.length;)if(e[i].end<=t)e.shift();else{if(!(e[i].start<t))break;e[i].start=t,i++}})),this.fragmentTracker.removeFragmentsInRange(e,t,k)}}onError(t,data){const e=data.frag;(null==e?void 0:e.type)===k&&(data.details===d.FRAG_GAP&&this.fragmentTracker.fragBuffered(e,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Ii&&(this.state=Ri))}onSubtitleTracksUpdated(t,{subtitleTracks:e}){this.levels&&ks(this.levels,e)?this.levels=e.map((t=>new se(t))):(this.tracksBuffered=[],this.levels=e.map((t=>{const e=new se(t);return this.tracksBuffered[e.id]=[],e})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,k),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(t,data){var e;if(this.currentTrackId=data.id,null==(e=this.levels)||!e.length||-1===this.currentTrackId)return void this.clearInterval();const n=this.levels[this.currentTrackId];null!=n&&n.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,n&&this.state!==Ii&&this.setInterval(500)}onSubtitleTrackLoaded(t,data){var e;const{currentTrackId:n,levels:r}=this,{details:o,id:l}=data;if(!r)return void this.warn(`Subtitle tracks were reset while loading level ${l}`);const track=r[l];if(l>=r.length||!track)return;this.log(`Subtitle track ${l} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""},duration:${o.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let c=0;if(o.live||null!=(e=track.details)&&e.live){if(o.deltaUpdateFailed)return;const t=this.mainDetails;if(!t)return void(this.startFragRequested=!1);const e=t.fragments[0];var d;if(track.details)c=this.alignPlaylists(o,track.details,null==(d=this.levelLastLoaded)?void 0:d.details),0===c&&e&&(c=e.start,hi(o,c));else o.hasProgramDateTime&&t.hasProgramDateTime?(_i(o,t),c=o.fragmentStart):e&&(c=e.start,hi(o,c));t&&!this.startFragRequested&&this.setStartPosition(t,c)}if(track.details=o,this.levelLastLoaded=track,l===n&&(this.hls.trigger(h.SUBTITLE_TRACK_UPDATED,{details:o,id:l,groupId:data.groupId}),this.tick(),o.live&&!this.fragCurrent&&this.media&&this.state===Ri)){ye(null,o.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),track.details=void 0)}}_handleFragmentLoadComplete(t){const{frag:e,payload:n}=t,r=e.decryptdata,o=this.hls;if(!this.fragContextChanged(e)&&n&&n.byteLength>
20&&null!=r&&r.key&&r.iv&&kn(r.method)){const t=performance.now();this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer,Sn(r.method)).catch((t=>{throw o.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((n=>{const r=performance.now();o.trigger(h.FRAG_DECRYPTED,{frag:e,payload:n,stats:{tstart:t,tdecrypt:r}})})).catch((t=>{this.warn(`${t.name}: ${t.message}`),this.state=Ri}))}}doTick(){if(this.media){if(this.state===Ri){const{currentTrackId:t,levels:e}=this,track=null==e?void 0:e[t];if(!track||!e.length||!track.details)return;if(this.waitForLive(track))return;const{config:n}=this,r=this.getLoadPosition(),o=ln.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,n.maxBufferHole),{end:l,len:c}=o,d=track.details;if(c>this.hls.maxBufferLength+d.levelTargetDuration)return;const h=d.fragments,f=h.length,m=d.edge;let v=null;const y=this.fragPrevious;if(l<m){const t=n.maxFragLookUpTolerance,e=l>m-t?0:t;v=ye(y,h,Math.max(h[0].start,l),e),!v&&y&&y.start<h[0].start&&(v=h[0])}else v=h[f-1];if(v=this.filterReplacedPrimary(v,track.details),!v)return;const E=h[v.sn-d.startSN-1];if(E&&E.cc===v.cc&&this.fragmentTracker.getState(E)===Ue&&(v=E),this.fragmentTracker.getState(v)===Ue){const t=this.mapToInitFragWhenRequired(v);t&&this.loadFragment(t,track,l)}}}else this.state=Ri}loadFragment(t,e,n){X(t)?super.loadFragment(t,e,n):this._loadInitSegment(t,e)}get mediaBufferTimeRanges(){return new Za(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends Ts{constructor(t){super(t,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const e=ja(this.media.textTracks);for(let i=0;i<e.length;i++)if("hidden"===e[i].mode)t=e[i];else if("showing"===e[i].mode){t=e[i];break}const n=this.findTrackForTextTrack(t);this.subtitleTrack!==n&&this.setSubtitleTrack(n)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(t){this._subtitleDisplay=t,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:t}=this;t.on(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.MANIFEST_PARSED,this.onManifestParsed,this),t.on(h.LEVEL_LOADING,this.onLevelLoading,this),t.on(h.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(h.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(h.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.MANIFEST_PARSED,this.onManifestParsed,this),t.off(h.LEVEL_LOADING,this.onLevelLoading,this),t.off(h.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(h.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(h.ERROR,this.onError,this)}onMediaAttached(t,data){this.media=data.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,t)}onMediaDetaching(t,data){const e=this.media;if(!e)return;const n=!!data.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||e.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,n)return;
2ja(e.textTracks).forEach((track=>{Pa(track)}))}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(t,data){this.tracks=data.subtitleTracks}onSubtitleTrackLoaded(t,data){const{id:e,groupId:n,details:details}=data,r=this.tracksInGroup[e];if(!r||r.groupId!==n)return void this.warn(`Subtitle track with id:${e} and group:${n} not found in active group ${null==r?void 0:r.groupId}`);const o=r.details;r.details=data.details,this.log(`Subtitle track ${e} "${r.name}" lang:${r.lang} group:${n} loaded [${details.startSN}-${details.endSN}]`),e===this.trackId&&this.playlistLoaded(e,data,o)}onLevelLoading(t,data){this.switchLevel(data.level)}onLevelSwitching(t,data){this.switchLevel(data.level)}switchLevel(t){const e=this.hls.levels[t];if(!e)return;const n=e.subtitleGroups||null,r=this.groupIds;let o=this.currentTrack;if(!n||(null==r?void 0:r.length)!==(null==n?void 0:n.length)||null!=n&&n.some((t=>-1===(null==r?void 0:r.indexOf(t))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const t=this.tracks.filter((track=>!n||-1!==n.indexOf(track.groupId)));if(t.length)this.selectDefaultTrack&&!t.some((track=>track.default))&&(this.selectDefaultTrack=!1),t.forEach(((track,i)=>{track.id=i}));else if(!o&&!this.tracksInGroup.length)return;this.tracksInGroup=t;const e=this.hls.config.subtitlePreference;if(!o&&e){this.selectDefaultTrack=!1;const n=he(e,t);if(n>-1)o=t[n];else{const t=he(e,this.tracks);o=this.tracks[t]}}let r=this.findTrackId(o);-1===r&&o&&(r=this.findTrackId(null));const l={subtitleTracks:t};this.log(`Updating subtitle tracks, ${t.length} track(s) found in "${null==n?void 0:n.join(",")}" group-id`),this.hls.trigger(h.SUBTITLE_TRACKS_UPDATED,l),-1!==r&&-1===this.trackId&&this.setSubtitleTrack(r)}}findTrackId(t){const e=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<e.length;i++){const track=e[i];if((!n||track.default)&&(n||t)&&(!t||fe(track,t)))return i}if(t){for(let i=0;i<e.length;i++){const track=e[i];if(Ss(t.attrs,track.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<e.length;i++){const track=e[i];if(Ss(t.attrs,track.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(t){if(t){const e=this.tracksInGroup;for(let i=0;i<e.length;i++){if(_s(e[i],t))return i}}return-1}onError(t,data){!data.fatal&&data.context&&(data.context.type!==y||data.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(data.context.groupId)||this.checkRetry(data))}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(t){this.selectDefaultTrack=!1,this.setSubtitleTrack(t)}setSubtitleOption(t){if(this.hls.config.subtitlePreference=t,t){if(-1===t.id)return this.setSubtitleTrack(-1),null;const e=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,e.length){const n=this.currentTrack;if(n&&fe(t,n))return n;const r=he(t,this.tracksInGroup);if(r>-1){const track=this.tracksInGroup[r];return this.setSubtitleTrack(r),track}if(n)return null;{const n=he(t,e);if(n>-1)return e[n]}}}return null}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const n=t.id,r=t.groupId,o=this.getUrlWithDirectives(t.url,e),details=t.details,l=null==details?void 0:details.age;this.log(`Loading subtitle ${n} "${t.name}" lang:${t.lang} group:${r}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${l&&details.live?" age "+l.toFixed(1)+(details.type?" "+details.type||!1:""):""} ${o}`),this.hls.trigger(h.SUBTITLE_TRACK_LOADING,{url:o,id:n,groupId:r,deliveryDirectives:e||null,track:t})}toggleTrackModes(){const{media:t}=this;if(!t)return;const e=ja(t.textTracks),n=this.currentTrack;let r;if(n&&(r=e.filter((t=>_s(n,t)))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(e).forEach((track=>{"disabled"!==track.mode&&track!==r&&(track.mode="disabled")})),r){const t=this.subtitleDisplay?"showing":"hidden";r.mode!==t&&(r.mode=t)}
2}setSubtitleTrack(t){const e=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=t);if(t<-1||t>=e.length||!r(t))return void this.warn(`Invalid subtitle track id: ${t}`);this.selectDefaultTrack=!1;const n=this.currentTrack,track=e[t]||null;if(this.trackId=t,this.currentTrack=track,this.toggleTrackModes(),!track)return void this.hls.trigger(h.SUBTITLE_TRACK_SWITCH,{id:t});const o=!!track.details&&!track.details.live;if(t===this.trackId&&track===n&&o)return;this.log(`Switching to subtitle-track ${t}`+(track?` "${track.name}" lang:${track.lang} group:${track.groupId}`:""));const{id:l,groupId:c="",name:d,type:f,url:m}=track;this.hls.trigger(h.SUBTITLE_TRACK_SWITCH,{id:l,groupId:c,name:d,type:f,url:m});const v=this.switchParams(track.url,null==n?void 0:n.details,track.details);this.loadPlaylist(v)}},timelineController:class{constructor(t){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},t.on(h.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(h.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(h.FRAG_LOADING,this.onFragLoading,this),t.on(h.FRAG_LOADED,this.onFragLoaded,this),t.on(h.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(h.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(h.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(h.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(h.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:t}=this;t.off(h.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(h.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(h.FRAG_LOADING,this.onFragLoading,this),t.off(h.FRAG_LOADED,this.onFragLoaded,this),t.off(h.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(h.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(h.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(h.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(h.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const t=new Ho(this,"textTrack1"),e=new Ho(this,"textTrack2"),n=new Ho(this,"textTrack3"),r=new Ho(this,"textTrack4");this.cea608Parser1=new go(1,t,e),this.cea608Parser2=new go(3,n,r)}addCues(t,e,n,r,o){let l=!1;for(let i=o.length;i--;){const t=o[i],r=(c=t[0],d=t[1],f=e,m=n,Math.min(d,m)-Math.max(c,f));if(r>=0&&(t[0]=Math.min(t[0],e),t[1]=Math.max(t[1],n),l=!0,r/(n-e)>.5))return}var c,d,f,m;if(l||o.push([e,n]),this.config.renderTextTracksNatively){const track=this.captionsTracks[t];this.Cues.newCue(track,e,n,r)}else{const o=this.Cues.newCue(null,e,n,r);this.hls.trigger(h.CUES_PARSED,{type:"captions",cues:o,track:t})}}onInitPtsFound(t,{frag:e,id:n,initPTS:r,timescale:o,trackId:l}){const{unparsedVttFrags:c}=this;n===E&&(this.initPTS[e.cc]={baseTime:r,timescale:o,trackId:l}),c.length&&(this.unparsedVttFrags=[],c.forEach((data=>{this.initPTS[data.frag.cc]?this.onFragLoaded(h.FRAG_LOADED,data):this.hls.trigger(h.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:data.frag,error:new Error("Subtitle discontinuity domain does not match main")})})))}getExistingTrack(label,t){const{media:e}=this;if(e)for(let i=0;i<e.textTracks.length;i++){const n=e.textTracks[i];if(Ko(n,{name:label,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return n}return null}createCaptionsTrack(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)}createNativeTrack(t){if(this.captionsTracks[t])return;const{captionsProperties:e,captionsTracks:n,media:r}=this,{label:label,languageCode:o}=e[t],l=this.getExistingTrack(label,o);if(l)n[t]=l,Pa(n[t]),Da(n[t],r);else{const e=this.createTextTrack("captions",label,o);e&&(e[t]=!0,n[t]=e)}}createNonNativeTrack(t){if(this.nonNativeCaptionsTracks[t])return;const e=this.captionsProperties[t];
2if(!e)return;const track={_id:t,label:e.label,kind:"captions",default:!!e.media&&!!e.media.default,closedCaptions:e.media};this.nonNativeCaptionsTracks[t]=track,this.hls.trigger(h.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[track]})}createTextTrack(t,label,e){const n=this.media;if(n)return n.addTextTrack(t,label,e)}onMediaAttaching(t,data){this.media=data.media,data.mediaSource||this._cleanTracks()}onMediaDetaching(t,data){const e=!!data.transferMedia;if(this.media=null,e)return;const{captionsTracks:n}=this;Object.keys(n).forEach((t=>{Pa(n[t]),delete n[t]})),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:t}=this;if(!t)return;const e=t.textTracks;if(e)for(let i=0;i<e.length;i++)Pa(e[i])}onSubtitleTracksUpdated(t,data){const e=data.subtitleTracks||[],n=e.some((track=>track.textCodec===Co));if(this.config.enableWebVTT||n&&this.config.enableIMSC1){if(ks(this.tracks,e))return void(this.tracks=e);if(this.textTracks=[],this.tracks=e,this.config.renderTextTracksNatively){const t=this.media,e=t?ja(t.textTracks):null;if(this.tracks.forEach(((track,t)=>{let n;if(e){let t=null;for(let i=0;i<e.length;i++)if(e[i]&&Ko(e[i],track)){t=e[i],e[i]=null;break}t&&(n=t)}if(n)Pa(n);else{const t=Wo(track);n=this.createTextTrack(t,track.name,track.lang),n&&(n.mode="disabled")}n&&this.textTracks.push(n)})),null!=e&&e.length){const t=e.filter((t=>null!==t)).map((t=>t.label));t.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${t.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const t=this.tracks.map((track=>({label:track.name,kind:track.type.toLowerCase(),default:track.default,subtitleTrack:track})));this.hls.trigger(h.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:t})}}}onManifestLoaded(t,data){this.config.enableCEA708Captions&&data.captions&&data.captions.forEach((t=>{const e=/(?:CC|SERVICE)([1-4])/.exec(t.instreamId);if(!e)return;const n=`textTrack${e[1]}`,r=this.captionsProperties[n];r&&(r.label=t.name,t.lang&&(r.languageCode=t.lang),r.media=t)}))}closedCaptionsForLevel(t){const e=this.hls.levels[t.level];return null==e?void 0:e.attrs["CLOSED-CAPTIONS"]}onFragLoading(t,data){if(this.enabled&&data.frag.type===E){var e,n;const{cea608Parser1:t,cea608Parser2:r,lastSn:o}=this,{cc:l,sn:c}=data.frag,d=null!=(e=null==(n=data.part)?void 0:n.index)?e:-1;t&&r&&(c!==o+1||c===o&&d!==this.lastPartIndex+1||l!==this.lastCc)&&(t.reset(),r.reset()),this.lastCc=l,this.lastSn=c,this.lastPartIndex=d}}onFragLoaded(t,data){const{frag:e,payload:n}=data;if(e.type===k)if(n.byteLength){const t=e.decryptdata,r="stats"in data;if(null==t||!t.encrypted||r){const t=this.tracks[e.level],r=this.vttCCs;r[e.cc]||(r[e.cc]={start:e.start,prevCC:this.prevCC,new:!0},this.prevCC=e.cc),t&&t.textCodec===Co?this._parseIMSC1(e,n):this._parseVTTs(data)}}else this.hls.trigger(h.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:new Error("Empty subtitle payload")})}_parseIMSC1(t,e){const n=this.hls;Fo(e,this.initPTS[t.cc],(e=>{this._appendCues(e,t.level),n.trigger(h.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(e=>{n.logger.log(`Failed to parse IMSC1: ${e}`),n.trigger(h.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:e})}))}_parseVTTs(data){var t;const{frag:e,payload:n}=data,{initPTS:r,unparsedVttFrags:o}=this,l=r.length-1;if(!r[e.cc]&&-1===l)return void o.push(data);const c=this.hls;Do(null!=(t=e.initSegment)&&t.data?Tt(e.initSegment.data,new Uint8Array(n)).buffer:n,this.initPTS[e.cc],this.vttCCs,e.cc,e.start,(t=>{this._appendCues(t,e.level),c.trigger(h.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(t=>{const r="Missing initPTS for VTT MPEGTS"===t.message;r?o.push(data):this._fallbackToIMSC1(e,n),c.logger.log(`Failed to parse VTT cue: ${t}`),r&&l>e.cc||c.trigger(h.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))}_fallbackToIMSC1(t,e){const n=this.tracks[t.level];n.textCodec||Fo(e,this.initPTS[t.cc],(()=>{n.textCodec=Co,this._parseIMSC1(t,e)}),(()=>{n.textCodec="wvtt"}))}_appendCues(t,e){const n=this.hls;if(this.config.renderTextTracksNatively){const n=this.textTracks[e];if(!n||"disabled"===n.mode)return;t.forEach((t=>Ca(n,t)))}else{const r=this.tracks[e];if(!r)return;const track=r.default?"default":"subtitles"+e;n.trigger(h.CUES_PARSED,{type:"subtitles",cues:t,track:track})}}onFragDecrypted(t,data){const{frag:e}=data;e.type===k&&this.onFragLoaded(h.FRAG_LOADED,data)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(t,data){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:e,samples:n}=data;if(e.type!==E||"NONE"!==this.closedCaptionsForLevel(e))for(let i=0;i<n.length;i++){const t=n[i].bytes;if(t){this.cea608Parser1||this.initCea608Parsers();const e=this.extractCea608Data(t);this.cea608Parser1.addData(n[i].pts,e[0]),this.cea608Parser2.addData(n[i].pts,e[1])}}}onBufferFlushing(t,{startOffset:e,endOffset:n,endOffsetSubtitles:r,type:o}){const{media:l}=this;
2if(l&&!(l.currentTime<n)){if(!o||"video"===o){const{captionsTracks:t}=this;Object.keys(t).forEach((r=>Ma(t[r],e,n)))}if(this.config.renderTextTracksNatively&&0===e&&void 0!==r){const{textTracks:t}=this;Object.keys(t).forEach((n=>Ma(t[n],e,r)))}}}extractCea608Data(t){const e=[[],[]],n=31&t[0];let r=2;for(let o=0;o<n;o++){const n=t[r++],o=127&t[r++],l=127&t[r++];if(0===o&&0===l)continue;if(0!=(4&n)){const t=3&n;0!==t&&1!==t||(e[t].push(o),e[t].push(l))}}return e}},audioStreamController:class extends Bi{constructor(t,e,n){super(t,e,n,"audio-stream-controller",T),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(h.LEVEL_LOADED,this.onLevelLoaded,this),t.on(h.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(h.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(h.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(h.BUFFER_RESET,this.onBufferReset,this),t.on(h.BUFFER_CREATED,this.onBufferCreated,this),t.on(h.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(h.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(h.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(h.FRAG_LOADING,this.onFragLoading,this),t.on(h.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:t}=this;t&&(super.unregisterListeners(),t.off(h.LEVEL_LOADED,this.onLevelLoaded,this),t.off(h.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(h.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(h.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(h.BUFFER_RESET,this.onBufferReset,this),t.off(h.BUFFER_CREATED,this.onBufferCreated,this),t.off(h.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(h.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(h.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(h.FRAG_LOADING,this.onFragLoading,this),t.off(h.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(t,{frag:e,id:n,initPTS:r,timescale:o,trackId:l}){if(n===E){const t=e.cc,n=this.fragCurrent;if(this.initPTS[t]={baseTime:r,timescale:o,trackId:l},this.log(`InitPTS for cc: ${t} found from main: ${r/o} (${r}/${o}) trackId: ${l}`),this.mainAnchor=e,this.state===Ni){const n=this.waitingData;(!n&&!this.loadingParts||n&&n.frag.cc!==t)&&this.syncWithAnchor(e,null==n?void 0:n.frag)}else!this.hls.hasEnoughToStart&&n&&n.cc!==t?(n.abortRequests(),this.syncWithAnchor(e,n)):this.state===Ri&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(t,e){var n;const r=(null==(n=this.mainFragLoading)?void 0:n.frag)||null;if(e&&(null==r?void 0:r.cc)===e.cc)return;const o=(r||t).cc,l=Te(this.getLevelDetails(),o,this.getLoadPosition());l&&(this.log(`Syncing with main frag at ${l.start} cc ${l.cc}`),this.startFragRequested=!1,this.nextLoadPosition=l.start,this.resetLoadingState(),this.state===Ri&&this.doTickIdle())}startLoad(t,e){if(!this.levels)return this.startPosition=t,void(this.state=Ii);const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),n>0&&-1===t?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),t=n,this.state=Ri):this.state=Ci,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}doTick(){switch(this.state){case Ri:this.doTickIdle();break;case Ci:{const{levels:t,trackId:e}=this,n=null==t?void 0:t[e],details=null==n?void 0:n.details;if(details&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(details))break;this.state=Ni}break}case Di:this.checkRetryDate();break;case Ni:{const t=this.waitingData;if(t){const{frag:e,part:n,cache:r,complete:o}=t,l=this.mainAnchor;if(void 0!==this.initPTS[e.cc]){this.waitingData=null,this.state=xi;const data={frag:e,part:n,payload:r.flush().buffer,networkDetails:null};this._handleFragmentLoadProgress(data),o&&super._handleFragmentLoadComplete(data)}else l&&l.cc!==t.frag.cc&&this.syncWithAnchor(l,t.frag)}else this.state=Ri}}this.onTickEnd()}
2resetLoadingState(){const t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:t}=this;null!=t&&t.readyState&&(this.lastCurrentTime=t.currentTime)}doTickIdle(){var t;const{hls:e,levels:n,media:r,trackId:o}=this,l=e.config;if(!this.buffering||!r&&!this.primaryPrefetch&&(this.startFragRequested||!l.startFragPrefetch)||null==n||!n[o])return;const c=n[o],d=c.details;if(!d||this.waitForLive(c)||this.waitForCdnTuneIn(d))return this.state=Ci,void(this.startFragRequested=!1);const f=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&f&&(this.bufferFlushed=!1,this.afterBufferFlushed(f,K,T));const m=this.getFwdBufferInfo(f,T);if(null===m)return;if(!this.switchingTrack&&this._streamEnded(m,d))return e.trigger(h.BUFFER_EOS,{type:"audio"}),void(this.state=ji);const v=m.len,y=e.maxBufferLength,k=d.fragments,S=k[0].start,_=this.getLoadPosition(),A=this.flushing?_:m.end;if(this.switchingTrack&&r){const t=_;d.PTSKnown&&t<S&&(m.end>S||m.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=S+.05)}if(v>=y&&!this.switchingTrack&&A<k[k.length-1].start)return;let O=this.getNextFragment(A,d);if(O&&this.isLoopLoading(O,A)&&(O=this.getNextFragmentLoopLoading(O,d,m,E,y)),!O)return void(this.bufferFlushed=!0);if(this.exceedsMaxBuffer(m,y,O))return;let w=(null==(t=this.mainFragLoading)?void 0:t.frag)||null;if(!this.audioOnly&&this.startFragRequested&&w&&X(O)&&!O.endList&&(!d.live||!this.loadingParts&&A<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(w)===Ve&&(this.mainFragLoading=w=null),w&&X(w))){if(O.start>w.end){const t=this.fragmentTracker.getFragAtPos(A,E);t&&t.end>w.end&&(w=t,this.mainFragLoading={frag:t,targetBufferTime:null})}if(O.start>w.end)return}this.loadFragment(O,c,A)}onMediaDetaching(t,data){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(t,data)}onAudioTracksUpdated(t,{audioTracks:e}){this.resetTransmuxer(),this.levels=e.map((t=>new se(t)))}onAudioTrackSwitching(t,data){const e=!!data.url;this.trackId=data.id;const{fragCurrent:n}=this;n&&(n.abortRequests(),this.removeUnbufferedFrags(n.start)),this.resetLoadingState(),e?(this.switchingTrack=data,this.flushAudioIfNeeded(data),this.state!==Ii&&(this.setInterval(100),this.state=Ri,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=data,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(t,data){this.mainDetails=data.details;const e=this.cachedTrackLoadedData;e&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(h.AUDIO_TRACK_LOADED,e))}onAudioTrackLoaded(t,data){var e;const{levels:n}=this,{details:r,id:o,groupId:l,track:track}=data;if(!n)return void this.warn(`Audio tracks reset while loading track ${o} "${track.name}" of "${l}"`);const c=this.mainDetails;if(!c||r.endCC>c.endCC||c.expired)return this.cachedTrackLoadedData=data,void(this.state!==Ii&&(this.state=Ci));this.cachedTrackLoadedData=null,this.log(`Audio track ${o} "${track.name}" of "${l}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const d=n[o];let f=0;if(r.live||null!=(e=d.details)&&e.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;var m;if(d.details)f=this.alignPlaylists(r,d.details,null==(m=this.levelLastLoaded)?void 0:m.details);r.alignedSliding||(Si(r,c),r.alignedSliding||_i(r,c),f=r.fragmentStart)}d.details=r,this.levelLastLoaded=d,this.startFragRequested||this.setStartPosition(c,f),this.hls.trigger(h.AUDIO_TRACK_UPDATED,{details:r,id:o,groupId:data.groupId}),this.state!==Ci||this.waitForCdnTuneIn(r)||(this.state=Ri),this.tick()}_handleFragmentLoadProgress(data){var t;const e=data.frag,{part:n,payload:r}=data,{config:o,trackId:l,levels:c}=this;if(!c)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${e.sn} of level ${e.level} will not be buffered`);const track=c[l];if(!track)return void this.warn("Audio track is undefined on fragment load progress");const details=track.details;
2if(!details)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(e.start);const d=o.defaultAudioCodec||track.audioCodec||"mp4a.40.2";let h=this.transmuxer;h||(h=this.transmuxer=new Es(this.hls,T,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const f=this.initPTS[e.cc],m=null==(t=e.initSegment)?void 0:t.data;if(void 0!==f){const t=!1,o=n?n.index:-1,l=-1!==o,c=new an(e.level,e.sn,e.stats.chunkCount,r.byteLength,o,l);h.push(r,m,d,"",e,n,details.totalduration,t,c,f)}else{this.log(`Unknown video PTS for cc ${e.cc}, waiting for video PTS before demuxing audio frag ${e.sn} of [${details.startSN} ,${details.endSN}],track ${l}`);const{cache:t}=this.waitingData=this.waitingData||{frag:e,part:n,cache:new Vi,complete:!1};t.push(new Uint8Array(r)),this.state!==Ii&&(this.state=Ni)}}_handleFragmentLoadComplete(t){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(t)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(t,data){this.bufferFlushed=this.flushing=!1;const e=data.tracks.audio;e&&(this.mediaBuffer=e.buffer||null)}onFragLoading(t,data){!this.audioOnly&&data.frag.type===E&&X(data.frag)&&(this.mainFragLoading=data,this.state===Ri&&this.tick())}onFragBuffered(t,data){const{frag:e,part:n}=data;if(e.type===T)if(this.fragContextChanged(e))this.warn(`Fragment ${e.sn}${n?" p: "+n.index:""} of level ${e.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if(X(e)){this.fragPrevious=e;const track=this.switchingTrack;track&&(this.bufferedTrack=track,this.switchingTrack=null,this.hls.trigger(h.AUDIO_TRACK_SWITCHED,I({},track)))}this.fragBufferedComplete(e,n),this.media&&this.tick()}else this.audioOnly||e.type!==E||e.elementaryStreams.video||e.elementaryStreams.audiovideo||(this.audioOnly=!0,this.mainFragLoading=null)}onError(t,data){var e;if(data.fatal)this.state=Fi;else switch(data.details){case d.FRAG_GAP:case d.FRAG_PARSING_ERROR:case d.FRAG_DECRYPT_ERROR:case d.FRAG_LOAD_ERROR:case d.FRAG_LOAD_TIMEOUT:case d.KEY_LOAD_ERROR:case d.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(T,data);break;case d.AUDIO_TRACK_LOAD_ERROR:case d.AUDIO_TRACK_LOAD_TIMEOUT:case d.LEVEL_PARSING_ERROR:data.levelRetry||this.state!==Ci||(null==(e=data.context)?void 0:e.type)!==v||(this.state=Ri);break;case d.BUFFER_ADD_CODEC_ERROR:case d.BUFFER_APPEND_ERROR:if("audio"!==data.parent)return;this.reduceLengthAndFlushBuffer(data)||this.resetLoadingState();break;case d.BUFFER_FULL_ERROR:if("audio"!==data.parent)return;this.reduceLengthAndFlushBuffer(data)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case d.INTERNAL_EXCEPTION:this.recoverWorkerError(data)}}onBufferFlushing(t,{type:e}){e!==Y&&(this.flushing=!0)}onBufferFlushed(t,{type:e}){if(e!==Y){this.flushing=!1,this.bufferFlushed=!0,this.state===ji&&(this.state=Ri);const t=this.mediaBuffer||this.media;t&&(this.afterBufferFlushed(t,e,T),this.tick())}}_handleTransmuxComplete(t){var e;const n="audio",{hls:r}=this,{remuxResult:o,chunkMeta:l}=t,c=this.getCurrentContext(l);if(!c)return void this.resetWhenMissingContext(l);const{frag:d,part:f,level:m}=c,{details:details}=m,{audio:audio,text:text,id3:v,initSegment:y}=o;if(!this.fragContextChanged(d)&&details){if(this.state=Pi,this.switchingTrack&&audio&&this.completeAudioSwitch(this.switchingTrack),null!=y&&y.tracks){const t=d.initSegment||d;if(this.unhandledEncryptionError(y,d))return;this._bufferInitSegment(m,y.tracks,t,l),r.trigger(h.FRAG_PARSING_INIT_SEGMENT,{frag:t,id:n,tracks:y.tracks})}if(audio){const{startPTS:t,endPTS:e,startDTS:n,endDTS:r}=audio;f&&(f.elementaryStreams[K]={startPTS:t,endPTS:e,startDTS:n,endDTS:r}),d.setElementaryStreamInfo(K,t,e,n,r),this.bufferFragmentData(audio,d,f,l)}if(null!=v&&null!=(e=v.samples)&&e.length){const t=O({id:n,frag:d,details:details},v);r.trigger(h.FRAG_PARSING_METADATA,t)}if(text){const t=O({id:n,frag:d,details:details},text);r.trigger(h.FRAG_PARSING_USERDATA,t)}}else this.fragmentTracker.removeFragment(d)}_bufferInitSegment(t,e,n,r){if(this.state!==Pi)return;if(e.video&&delete e.video,e.audiovideo&&delete e.audiovideo,!e.audio)return;const track=e.audio;track.id=T;const o=t.audioCodec;this.log(`Init audio buffer, container:${track.container}, codecs[level/parsed]=[${o}/${track.codec}]`),o&&1===o.split(",").length&&(track.levelCodec=o),this.hls.trigger(h.BUFFER_CODECS,e);const l=track.initSegment;if(null!=l&&l.byteLength){const t={type:"audio",frag:n,part:null,chunkMeta:r,parent:n.type,data:l};this.hls.trigger(h.BUFFER_APPENDING,t)}this.tickImmediate()}loadFragment(t,track,e){const n=this.fragmentTracker.getState(t);var r;if(this.switchingTrack||n===Ue||n===$e)if(X(t))if(null!=(r=track.details)&&r.live&&!this.initPTS[t.cc]){this.log(`Waiting for video PTS in continuity counter ${t.cc} of live stream before loading audio fragment ${t.sn} of level ${this.trackId}`),this.state=Ni;const e=this.mainDetails;e&&e.fragmentStart!==track.details.fragmentStart&&_i(track.details,e)}else super.loadFragment(t,track,e);else this._loadInitSegment(t,track);else this.clearTrackerIfNeeded(t)}flushAudioIfNeeded(t){if(this.media&&this.bufferedTrack){const{name:e,lang:n,assocLang:r,characteristics:o,audioCodec:l,channels:c}=this.bufferedTrack;
2fe({name:e,lang:n,assocLang:r,characteristics:o,audioCodec:l,channels:c},t,pe)||(ge(t.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=t)}}completeAudioSwitch(t){const{hls:e}=this;this.flushAudioIfNeeded(t),this.bufferedTrack=t,this.switchingTrack=null,e.trigger(h.AUDIO_TRACK_SWITCHED,I({},t))}},audioTrackController:class extends Ts{constructor(t){super(t,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:t}=this;t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.MANIFEST_PARSED,this.onManifestParsed,this),t.on(h.LEVEL_LOADING,this.onLevelLoading,this),t.on(h.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(h.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(h.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.MANIFEST_PARSED,this.onManifestParsed,this),t.off(h.LEVEL_LOADING,this.onLevelLoading,this),t.off(h.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(h.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(h.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(t,data){this.tracks=data.audioTracks||[]}onAudioTrackLoaded(t,data){const{id:e,groupId:n,details:details}=data,r=this.tracksInGroup[e];if(!r||r.groupId!==n)return void this.warn(`Audio track with id:${e} and group:${n} not found in active group ${null==r?void 0:r.groupId}`);const o=r.details;r.details=data.details,this.log(`Audio track ${e} "${r.name}" lang:${r.lang} group:${n} loaded [${details.startSN}-${details.endSN}]`),e===this.trackId&&this.playlistLoaded(e,data,o)}onLevelLoading(t,data){this.switchLevel(data.level)}onLevelSwitching(t,data){this.switchLevel(data.level)}switchLevel(t){const e=this.hls.levels[t];if(!e)return;const n=e.audioGroups||null,r=this.groupIds;let o=this.currentTrack;if(!n||(null==r?void 0:r.length)!==(null==n?void 0:n.length)||null!=n&&n.some((t=>-1===(null==r?void 0:r.indexOf(t))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const t=this.tracks.filter((track=>!n||-1!==n.indexOf(track.groupId)));if(t.length)this.selectDefaultTrack&&!t.some((track=>track.default))&&(this.selectDefaultTrack=!1),t.forEach(((track,i)=>{track.id=i}));else if(!o&&!this.tracksInGroup.length)return;this.tracksInGroup=t;const e=this.hls.config.audioPreference;if(!o&&e){const n=he(e,t,pe);if(n>-1)o=t[n];else{const t=he(e,this.tracks);o=this.tracks[t]}}let r=this.findTrackId(o);-1===r&&o&&(r=this.findTrackId(null));const f={audioTracks:t};this.log(`Updating audio tracks, ${t.length} track(s) found in group(s): ${null==n?void 0:n.join(",")}`),this.hls.trigger(h.AUDIO_TRACKS_UPDATED,f);const m=this.trackId;if(-1!==r&&-1===m)this.setAudioTrack(r);else if(t.length&&-1===m){var l;const e=new Error(`No audio track selected for current audio group-ID(s): ${null==(l=this.groupIds)?void 0:l.join(",")} track count: ${t.length}`);this.warn(e.message),this.hls.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:e})}}}onError(t,data){!data.fatal&&data.context&&(data.context.type!==v||data.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(data.context.groupId)||this.checkRetry(data))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}setAudioOption(t){const e=this.hls;if(e.config.audioPreference=t,t){const n=this.allAudioTracks;
2if(this.selectDefaultTrack=!1,n.length){const r=this.currentTrack;if(r&&fe(t,r,pe))return r;const o=he(t,this.tracksInGroup,pe);if(o>-1){const track=this.tracksInGroup[o];return this.setAudioTrack(o),track}if(r){let r=e.loadLevel;-1===r&&(r=e.firstAutoLevel);const o=function(option,t,e,n,r){const o=t[n],l=t.reduce(((t,e,n)=>{const r=e.uri;return(t[r]||(t[r]=[])).push(n),t}),{})[o.uri];l.length>1&&(n=Math.max.apply(Math,l));const c=o.videoRange,d=o.frameRate,h=o.codecSet.substring(0,4),f=me(t,n,(t=>{if(t.videoRange!==c||t.frameRate!==d||t.codecSet.substring(0,4)!==h)return!1;const n=t.audioGroups,o=e.filter((track=>!n||-1!==n.indexOf(track.groupId)));return he(option,o,r)>-1}));return f>-1?f:me(t,n,(t=>{const n=t.audioGroups,o=e.filter((track=>!n||-1!==n.indexOf(track.groupId)));return he(option,o,r)>-1}))}(t,e.levels,n,r,pe);if(-1===o)return null;e.nextLoadLevel=o}if(t.channels||t.audioCodec){const e=he(t,n);if(e>-1)return n[e]}}}return null}setAudioTrack(t){const e=this.tracksInGroup;if(t<0||t>=e.length)return void this.warn(`Invalid audio track id: ${t}`);this.selectDefaultTrack=!1;const n=this.currentTrack,track=e[t],r=track.details&&!track.details.live;if(t===this.trackId&&track===n&&r)return;if(this.log(`Switching to audio-track ${t} "${track.name}" lang:${track.lang} group:${track.groupId} channels:${track.channels}`),this.trackId=t,this.currentTrack=track,this.hls.trigger(h.AUDIO_TRACK_SWITCHING,I({},track)),r)return;const o=this.switchParams(track.url,null==n?void 0:n.details,track.details);this.loadPlaylist(o)}findTrackId(t){const e=this.tracksInGroup;for(let i=0;i<e.length;i++){const track=e[i];if((!this.selectDefaultTrack||track.default)&&(!t||fe(t,track,pe)))return i}if(t){const{name:n,lang:r,assocLang:o,characteristics:l,audioCodec:c,channels:d}=t;for(let i=0;i<e.length;i++){if(fe({name:n,lang:r,assocLang:o,characteristics:l,audioCodec:c,channels:d},e[i],pe))return i}for(let i=0;i<e.length;i++){const track=e[i];if(Ss(t.attrs,track.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<e.length;i++){const track=e[i];if(Ss(t.attrs,track.attrs,["LANGUAGE"]))return i}}return-1}loadPlaylist(t){super.loadPlaylist();const e=this.currentTrack;this.shouldLoadPlaylist(e)&&ge(e.url,this.hls)&&this.scheduleLoading(e,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const n=t.id,r=t.groupId,o=this.getUrlWithDirectives(t.url,e),details=t.details,l=null==details?void 0:details.age;this.log(`Loading audio-track ${n} "${t.name}" lang:${t.lang} group:${r}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${l&&details.live?" age "+l.toFixed(1)+(details.type?" "+details.type||!1:""):""} ${o}`),this.hls.trigger(h.AUDIO_TRACK_LOADING,{url:o,id:n,groupId:r,deliveryDirectives:e||null,track:t})}},emeController:wa,cmcdController:class{constructor(t){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=t=>{try{this.apply(t,{ot:Ds.MANIFEST,su:!this.initialized})}catch(t){this.hls.logger.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=t=>{try{const{frag:e,part:n}=t,r=this.hls.levels[e.level],o=this.getObjectType(e),data={d:1e3*(n||e).duration,ot:o};o!==Ds.VIDEO&&o!==Ds.AUDIO&&o!=Ds.MUXED||(data.br=r.bitrate/1e3,data.tb=this.getTopBandwidth(o)/1e3,data.bl=this.getBufferLength(o));const l=n?this.getNextPart(n):this.getNextFrag(e);null!=l&&l.url&&l.url!==e.url&&(data.nor=l.url),this.apply(t,data)}catch(t){this.hls.logger.warn("Could not generate segment CMCD data.",t)}},this.hls=t;const e=this.config=t.config,{cmcd:n}=e;null!=n&&(e.pLoader=this.createPlaylistLoader(),e.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||t.sessionId,this.cid=n.contentId,this.useHeaders=!0===n.useHeaders,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const t=this.hls;
2t.on(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(h.MEDIA_DETACHED,this.onMediaDetached,this),t.on(h.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const t=this.hls;t.off(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(h.MEDIA_DETACHED,this.onMediaDetached,this),t.off(h.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(t,data){this.media=data.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(t,data){var e,n;this.audioBuffer=null==(e=data.tracks.audio)?void 0:e.buffer,this.videoBuffer=null==(n=data.tracks.video)?void 0:n.buffer}createData(){var t;return{v:1,sf:Cs.HLS,sid:this.sid,cid:this.cid,pr:null==(t=this.media)?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(t,data={}){O(data,this.createData());const e=data.ot===Ds.INIT||data.ot===Ds.VIDEO||data.ot===Ds.MUXED;this.starved&&e&&(data.bs=!0,data.su=!0,this.starved=!1),null==data.su&&(data.su=this.buffering);const{includeKeys:n}=this;n&&(data=Object.keys(data).reduce(((t,e)=>(n.includes(e)&&(t[e]=data[e]),t)),{}));const r={baseUrl:t.url};this.useHeaders?(t.headers||(t.headers={}),Ta(t.headers,data,r)):t.url=_a(t.url,data,r)}getNextFrag(t){var e;const n=null==(e=this.hls.levels[t.level])?void 0:e.details;if(n){const e=t.sn-n.startSN;return n.fragments[e+1]}}getNextPart(t){var e;const{index:n,fragment:r}=t,o=null==(e=this.hls.levels[r.level])||null==(e=e.details)?void 0:e.partList;if(o){const{sn:t}=r;for(let i=o.length-1;i>=0;i--){const p=o[i];if(p.index===n&&p.fragment.sn===t)return o[i+1]}}}getObjectType(t){const{type:e}=t;return"subtitle"===e?Ds.TIMED_TEXT:"initSegment"===t.sn?Ds.INIT:"audio"===e?Ds.AUDIO:"main"===e?this.hls.audioTracks.length?Ds.VIDEO:Ds.MUXED:void 0}getTopBandwidth(t){let e,n=0;const r=this.hls;if(t===Ds.AUDIO)e=r.audioTracks;else{const t=r.maxAutoLevel,n=t>-1?t+1:r.levels.length;e=r.levels.slice(0,n)}return e.forEach((t=>{t.bitrate>n&&(n=t.bitrate)})),n>0?n:NaN}getBufferLength(t){const e=this.media,n=t===Ds.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!e)return NaN;return 1e3*ln.bufferInfo(n,e.currentTime,this.config.maxBufferHole).len}createPlaylistLoader(){const{pLoader:t}=this.config,e=this.applyPlaylistData,n=t||this.config.loader;return class{constructor(t){this.loader=void 0,this.loader=new n(t)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(t,n,r){e(t),this.loader.load(t,n,r)}}}createFragmentLoader(){const{fLoader:t}=this.config,e=this.applyFragmentData,n=t||this.config.loader;return class{constructor(t){this.loader=void 0,this.loader=new n(t)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(t,n,r){e(t),this.loader.load(t,n,r)}}}},contentSteeringController:class extends R{constructor(t){super("content-steering",t.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(h.MANIFEST_PARSED,this.onManifestParsed,this),t.on(h.ERROR,this.onError,this)}unregisterListeners(){const t=this.hls;t&&(t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(h.MANIFEST_PARSED,this.onManifestParsed,this),t.off(h.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce(((t,e)=>
vendor: 7,072 bytes, line 2
2(-1===t.indexOf(e.pathwayId)&&t.push(e.pathwayId),t)),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(t){this.updatePathwayPriority(t)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const t=1e3*this.timeToLoad-(performance.now()-this.updated);if(t>0)return void this.scheduleRefresh(this.uri,t)}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(t){const e=this.levels;e&&(this.levels=e.filter((e=>e!==t)))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(t,data){const{contentSteering:e}=data;null!==e&&(this.pathwayId=e.pathwayId,this.uri=e.uri,this.started&&this.startLoad())}onManifestParsed(t,data){this.audioTracks=data.audioTracks,this.subtitleTracks=data.subtitleTracks}onError(t,data){const{errorAction:e}=data;if((null==e?void 0:e.action)===xe&&e.flags===Me){const t=this.levels;let n=this._pathwayPriority,r=this.pathwayId;if(data.context){const{groupId:e,pathwayId:n,type:o}=data.context;e&&t?r=this.getPathwayForGroupId(e,o,r):n&&(r=n)}r in this.penalizedPathways||(this.penalizedPathways[r]=performance.now()),!n&&t&&(n=this.pathways()),n&&n.length>1&&(this.updatePathwayPriority(n),e.resolved=this.pathwayId!==r),data.details!==d.BUFFER_APPEND_ERROR||data.fatal?e.resolved||this.warn(`Could not resolve ${data.details} ("${data.error.message}") with content-steering for Pathway: ${r} levels: ${t?t.length:t} priorities: ${le(n)} penalized: ${le(this.penalizedPathways)}`):e.resolved=!0}}filterParsedLevels(t){this.levels=t;let e=this.getLevelsForPathway(this.pathwayId);if(0===e.length){const n=t[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),e=this.getLevelsForPathway(n),this.pathwayId=n}return e.length!==t.length&&this.log(`Found ${e.length}/${t.length} levels in Pathway "${this.pathwayId}"`),e}getLevelsForPathway(t){return null===this.levels?[]:this.levels.filter((e=>t===e.pathwayId))}updatePathwayPriority(t){let e;this._pathwayPriority=t;const n=this.penalizedPathways,r=performance.now();Object.keys(n).forEach((t=>{r-n[t]>3e5&&delete n[t]}));for(let i=0;i<t.length;i++){const r=t[i];if(r in n)continue;if(r===this.pathwayId)return;const o=this.hls.nextLoadLevel,l=this.hls.levels[o];if(e=this.getLevelsForPathway(r),e.length>0){this.log(`Setting Pathway to "${r}"`),this.pathwayId=r,vi(e),this.hls.trigger(h.LEVELS_UPDATED,{levels:e});const t=this.hls.levels[o];l&&t&&this.levels&&(t.attrs["STABLE-VARIANT-ID"]!==l.attrs["STABLE-VARIANT-ID"]&&t.bitrate!==l.bitrate&&this.log(`Unstable Pathways change from bitrate ${l.bitrate} to ${t.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(t,e,n){const r=this.getLevelsForPathway(n).concat(this.levels||[]);for(let i=0;i<r.length;i++)if(e===v&&r[i].hasAudioGroup(t)||e===y&&r[i].hasSubtitleGroup(t))return r[i].pathwayId;return n}clonePathways(t){const e=this.levels;if(!e)return;const n={},r={};t.forEach((t=>{const{ID:o,"BASE-ID":l,"URI-REPLACEMENT":c}=t;if(e.some((t=>t.pathwayId===o)))return;const d=this.getLevelsForPathway(l).map((t=>{const e=new gn(t.attrs);e["PATHWAY-ID"]=o;const l=e.AUDIO&&`${e.AUDIO}_clone_${o}`,d=e.SUBTITLES&&`${e.SUBTITLES}_clone_${o}`;l&&(n[e.AUDIO]=l,e.AUDIO=l),d&&(r[e.SUBTITLES]=d,e.SUBTITLES=d);const h=Oa(t.uri,e["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),f=new se({attrs:e,audioCodec:t.audioCodec,bitrate:t.bitrate,height:t.height,name:t.name,url:h,videoCodec:t.videoCodec,width:t.width});if(t.audioGroups)for(let i=1;i<t.audioGroups.length;i++)f.addGroupId("audio",`${t.audioGroups[i]}_clone_${o}`);if(t.subtitleGroups)for(let i=1;i<t.subtitleGroups.length;i++)f.addGroupId("text",`${t.subtitleGroups[i]}_clone_${o}`);return f}));e.push(...d),Aa(this.audioTracks,n,c,o),Aa(this.subtitleTracks,r,c,o)}))}loadSteeringManifest(t){const e=this.hls.config,n=e.loader;let r;this.loader&&this.loader.destroy(),this.loader=new n(e);try{r=new self.URL(t)}catch(e){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest URI: ${t}`)}if("data:"!==r.protocol){const t=0|(this.hls.bandwidthEstimate||e.abrEwmaDefaultEstimate);r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+t)}const o={responseType:"json",url:r.href},l=e.steeringManifestLoadPolicy.default,c=l.errorRetry||l.timeoutRetry||{},d={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:c.maxNumRetry||0,retryDelay:c.retryDelayMs||0,maxRetryDelay:c.maxRetryDelayMs||0},f={onSuccess:(t,e,n,o)=>{this.log(`Loaded steering manifest: "${r}"`);const l=t.data;if(1!==(null==l?void 0:l.VERSION))return void this.log(`Steering VERSION ${l.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=l.TTL;const{"RELOAD-URI":c,"PATHWAY-CLONES":d,"PATHWAY-PRIORITY":f}=l;if(c)try{this.uri=new self.URL(c,r).href}catch(t){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${c}`)}this.scheduleRefresh(this.uri||n.url),d&&this.clonePathways(d);const m={steeringManifest:l,url:r.toString()};this.hls.trigger(h.STEERING_MANIFEST_LOADED,m),f&&this.updatePathwayPriority(f)},onError:(t,e,n,r)=>{if(this.log(`Error loading steering manifest: ${t.code} ${t.text} (${e.url})`),this.stopLoad(),410===t.code)return this.enabled=!1,void this.log(`Steering manifest ${e.url} no longer available`);let o=1e3*this.timeToLoad;if(429!==t.code)this.scheduleRefresh(this.uri||e.url,o);else{const t=this.loader;if("function"==typeof(null==t?void 0:t.getResponseHeader)){const e=t.getResponseHeader("Retry-After");e&&(o=1e3*parseFloat(e))}this.log(`Steering manifest ${e.url} rate limited`)}},onTimeout:(t,e,n)=>{this.log(`Timeout loading steering manifest (${e.url})`),this.scheduleRefresh(this.uri||e.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(o,d,f)}scheduleRefresh(t,e=1e3*this.timeToLoad){this.clearTimeout(),this.reloadTimer=self.setTimeout((()=>{var e;const n=null==(e=this.hls)?void 0:e.media;!n||n.ended?this.scheduleRefresh(t,1e3*this.timeToLoad):this.loadSteeringManifest(t)}),e)}},interstitialsController:class extends R{constructor(t,e){super("interstitials",t.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1}
2,this.onSeeking=()=>{const t=this.currentTime;if(void 0===t||this.playbackDisabled||!this.schedule)return;const e=t-this.timelinePos;if(Math.abs(e)<1/7056e5)return;const n=e<=-.01;-1!==this.timelinePos||this.effectivePlayingItem||this.checkStart(),this.timelinePos=t,this.bufferedPos=t;const r=this.playingItem;if(!r)return void this.checkBuffer();if(n){this.schedule.resetErrorsInRange(t,t-e)&&this.updateSchedule(!0)}if(this.checkBuffer(),n&&t<r.start||t>=r.end){var o;const e=this.findItemIndex(r);let l=this.schedule.findItemIndexAtTime(t);if(-1===l&&(l=e+(n?-1:1),this.log(`seeked ${n?"back ":""}to position not covered by schedule ${t} (resolving from ${e} to ${l})`)),!this.isInterstitial(r)&&null!=(o=this.media)&&o.paused&&(this.shouldPlay=!1),!n&&l>e){const t=this.schedule.findJumpRestrictedIndex(e+1,l);if(t>e)return void this.setSchedulePosition(t)}return void this.setSchedulePosition(l)}const l=this.playingAsset;if(!l){if(this.playingLastItem&&this.isInterstitial(r)){const e=r.event.assetList[0];e&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(t,e))}return}const c=l.timelineStart,d=l.duration||0;var h;(n&&t<c||t>=c+d)&&(null!=(h=r.event)&&h.appendInPlace&&(this.clearAssetPlayers(r.event,r),this.flushFrontBuffer(t)),this.setScheduleToAssetAtTime(t,l))},this.onTimeupdate=()=>{const t=this.currentTime;if(void 0===t||this.playbackDisabled)return;if(-1!==this.timelinePos||this.effectivePlayingItem||this.checkStart(),!(t>this.timelinePos))return;this.timelinePos=t,t>this.bufferedPos&&this.checkBuffer();const e=this.playingItem;if(!e||this.playingLastItem)return;if(t>=e.end){this.timelinePos=e.end;const t=this.findItemIndex(e);this.setSchedulePosition(t+1)}const n=this.playingAsset;if(!n)return;t>=n.timelineStart+(n.duration||0)&&this.setScheduleToAssetAtTime(t,n)},this.onScheduleUpdate=(t,e)=>{const n=this.schedule;if(!n)return;const r=this.playingItem,o=n.events||[],l=n.items||[],c=n.durations,d=t.map((t=>t.identifier)),f=!(!o.length&&!d.length);(f||e)&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}\nSchedule: ${l.map((t=>Ya(t)))} pos: ${this.timelinePos}`),d.length&&this.log(`Removed events ${d}`);let m=null,v=null;r&&(m=this.updateItem(r,this.timelinePos),this.itemsMatch(r,m)?this.playingItem=m:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const y=this.bufferingItem;if(y&&(v=this.updateItem(y,this.bufferedPos),this.itemsMatch(y,v)?this.bufferingItem=v:y.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(y.event,null))),t.forEach((t=>{t.assetList.forEach((t=>{this.clearAssetPlayer(t.identifier,null)}))})),this.playerQueue.forEach((t=>{if(t.interstitial.appendInPlace){const e=t.assetItem.timelineStart,n=t.timelineOffset-e;if(n)try{t.timelineOffset=e}catch(r){Math.abs(n)>Na&&this.warn(`${r} ("${t.assetId}" ${t.timelineOffset}->${e})`)}}})),f||e){if(this.hls.trigger(h.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:l.slice(0),durations:c,removedIds:d}),this.isInterstitial(r)&&d.includes(r.event.identifier))return this.warn(`Interstitial "${r.event.identifier}" removed while playing`),void this.primaryFallback(r.event);r&&this.trimInPlace(m,r),y&&v!==m&&this.trimInPlace(v,y),this.checkBuffer()}},this.hls=t,this.HlsPlayerClass=e,this.assetListLoader=new za(t),this.schedule=new qa(this.onScheduleUpdate,t.logger),this.registerListeners()}registerListeners(){const t=this.hls;t&&(t.on(h.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(h.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(h.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.on(h.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(h.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.on(h.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.on(h.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.on(h.BUFFER_APPENDED,this.onBufferAppended,this),t.on(h.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(h.BUFFERED_TO_END,this.onBufferedToEnd,this),t.on(h.MEDIA_ENDED,this.onMediaEnded,this),t.on(h.ERROR,this.onError,this),t.on(h.DESTROYING,this.onDestroying,this))}unregisterListeners(){const t=this.hls;
2t&&(t.off(h.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(h.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(h.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.off(h.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(h.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.off(h.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.off(h.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.off(h.BUFFER_CODECS,this.onBufferCodecs,this),t.off(h.BUFFER_APPENDED,this.onBufferAppended,this),t.off(h.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(h.BUFFERED_TO_END,this.onBufferedToEnd,this),t.off(h.MEDIA_ENDED,this.onMediaEnded,this),t.off(h.ERROR,this.onError,this),t.off(h.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var t;null==(t=this.getBufferingPlayer())||t.resumeBuffering()}pauseBuffering(){var t;null==(t=this.getBufferingPlayer())||t.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const t=this.primaryMedia||this.media;t&&this.removeMediaListeners(t)}removeMediaListeners(t){Oi(t,"play",this.onPlay),Oi(t,"pause",this.onPause),Oi(t,"seeking",this.onSeeking),Oi(t,"timeupdate",this.onTimeupdate)}onMediaAttaching(t,data){const e=this.media=data.media;Ai(e,"seeking",this.onSeeking),Ai(e,"timeupdate",this.onTimeupdate),Ai(e,"play",this.onPlay),Ai(e,"pause",this.onPause)}onMediaAttached(t,data){const e=this.effectivePlayingItem,n=this.detachedData;if(this.detachedData=null,null===e)this.checkStart();else if(!n){this.clearScheduleState();const t=this.findItemIndex(e);this.setSchedulePosition(t)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(t,data){const e=!!data.transferMedia,n=this.media;if(this.media=null,!e&&(n&&this.removeMediaListeners(n),this.detachedData)){const t=this.getBufferingPlayer();t&&(this.log(`Removing schedule state for detachedData and ${t}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,t.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const t=this,e=()=>t.bufferingItem||t.waitingItem,n=e=>e?t.getAssetPlayer(e.identifier):e,r=(e,r,l,c,d)=>{if(e){let time=e[r].start;const h=e.event;if(h){if("playout"===r||h.timelineOccupancy!==Ua.Point){const t=n(l);(null==t?void 0:t.interstitial)===h&&(time+=t.assetItem.startOffset+t[d])}}else{time+=("bufferedPos"===c?o():t[c])-e.start}return time}return 0},o=()=>{const e=t.bufferedPos;return e===Number.MAX_VALUE?l("primary"):Math.max(e,0)},l=e=>{var n,r;return null!=(n=t.primaryDetails)&&n.live?t.primaryDetails.edge:(null==(r=t.schedule)?void 0:r.durations[e])||0},c=(time,e)=>{var o,l;const c=t.effectivePlayingItem;if(null!=c&&null!=(o=c.event)&&o.restrictions.skip||!t.schedule)return;t.log(`seek to ${time} "${e}"`);const d=t.effectivePlayingItem,h=t.schedule.findItemIndexAtTime(time,e),f=null==(l=t.schedule.items)?void 0:l[h],m=t.getBufferingPlayer(),v=null==m?void 0:m.interstitial,y=null==v?void 0:v.appendInPlace,E=d&&t.itemsMatch(d,f);if(d&&(y||E)){const o=n(t.playingAsset),l=(null==o?void 0:o.media)||t.primaryMedia;if(l){const n="primary"===e?l.currentTime:r(d,e,t.playingAsset,"timelinePos","currentTime"),c=time-n,h=(y?n:l.currentTime)+c;if(h>=0&&(!o||y||h<=o.duration))return void(l.currentTime=h)}}if(f){let n=time;if("primary"!==e){const t=time-f[e].start;n=f.start+t}const r=!t.isInterstitial(f);if(t.isInterstitial(d)&&!d.event.appendInPlace||!r&&!f.event.appendInPlace){if(d){const o=t.findItemIndex(d);if(h>o){const e=t.schedule.findJumpRestrictedIndex(o+1,h);if(e>o)return void t.setSchedulePosition(e)}let l=0;if(r)t.timelinePos=n,t.checkBuffer();else{const t=f.event.assetList,n=time-(f[e]||f).start;for(let i=t.length;i--;){const e=t[i];if(e.duration&&n>=e.startOffset&&n<e.startOffset+e.duration){l=i;break}}}t.setSchedulePosition(h,l)}}else{const e=t.media||(y?null==m?void 0:m.media:null);e&&(e.currentTime=n)}}},d=()=>{const n=t.effectivePlayingItem;if(t.isInterstitial(n))return n;const r=e();return t.isInterstitial(r)?r:null},h={get bufferedEnd(){const n=e(),o=t.bufferingItem;var l;return o&&o===n&&(r(o,"playout",t.bufferingAsset,"bufferedPos","bufferedEnd")-o.playout.start||(null==(l=t.bufferingAsset)?void 0:l.startOffset))||0},get currentTime(){const e=d(),n=t.effectivePlayingItem;return n&&n===e?r(n,"playout",t.effectivePlayingAsset,"timelinePos","currentTime")-n.playout.start:0},set currentTime(time){const e=d(),n=t.effectivePlayingItem;n&&n===e&&c(time+n.playout.start,"playout")},get duration(){const t=d();return t?t.playout.end-t.playout.start:0},get assetPlayers(){var e;
2const n=null==(e=d())?void 0:e.event.assetList;return n?n.map((e=>t.getAssetPlayer(e.identifier))):[]},get playingIndex(){var e;const n=null==(e=d())?void 0:e.event;return n&&t.effectivePlayingAsset?n.findAssetIndex(t.effectivePlayingAsset):-1},get scheduleItem(){return d()}};return this.manager={get events(){var e;return(null==(e=t.schedule)||null==(e=e.events)?void 0:e.slice(0))||[]},get schedule(){var e;return(null==(e=t.schedule)||null==(e=e.items)?void 0:e.slice(0))||[]},get interstitialPlayer(){return d()?h:null},get playerQueue(){return t.playerQueue.slice(0)},get bufferingAsset(){return t.bufferingAsset},get bufferingItem(){return e()},get bufferingIndex(){const n=e();return t.findItemIndex(n)},get playingAsset(){return t.effectivePlayingAsset},get playingItem(){return t.effectivePlayingItem},get playingIndex(){const e=t.effectivePlayingItem;return t.findItemIndex(e)},primary:{get bufferedEnd(){return o()},get currentTime(){const e=t.timelinePos;return e>0?e:0},set currentTime(time){c(time,"primary")},get duration(){return l("primary")},get seekableStart(){var e;return(null==(e=t.primaryDetails)?void 0:e.fragmentStart)||0}},integrated:{get bufferedEnd(){return r(e(),"integrated",t.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return r(t.effectivePlayingItem,"integrated",t.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(time){c(time,"integrated")},get duration(){return l("integrated")},get seekableStart(){var e;return((e,n)=>{var r;if(0!==e&&"primary"!==n&&null!=(r=t.schedule)&&r.length){var o;const r=t.schedule.findItemIndexAtTime(e),l=null==(o=t.schedule.items)?void 0:o[r];if(l)return e+(l[n].start-l.start)}return e})((null==(e=t.primaryDetails)?void 0:e.fragmentStart)||0,"integrated")}},skip:()=>{const e=t.effectivePlayingItem,n=null==e?void 0:e.event;if(n&&!n.restrictions.skip){const r=t.findItemIndex(e);if(n.appendInPlace){const time=e.playout.start+e.event.duration;c(time+.001,"playout")}else t.advanceAfterAssetEnded(n,r,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var t;const e=this.playingItem,n=null==(t=this.schedule)?void 0:t.items;return!!(this.playbackStarted&&e&&n)&&this.findItemIndex(e)===n.length-1}get playbackStarted(){return null!==this.effectivePlayingItem}get currentTime(){var t,e;if(null===this.mediaSelection)return;const n=this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&!n.event.appendInPlace)return;let o=this.media;!o&&null!=(t=this.bufferingItem)&&null!=(t=t.event)&&t.appendInPlace&&(o=this.primaryMedia);const l=null==(e=o)?void 0:e.currentTime;return void 0!==l&&r(l)?l:void 0}get primaryMedia(){var t;return this.media||(null==(t=this.detachedData)?void 0:t.media)||null}isInterstitial(t){return!(null==t||!t.event)}retreiveMediaSource(t,e){const n=this.getAssetPlayer(t);n&&this.transferMediaFromPlayer(n,e)}transferMediaFromPlayer(t,e){const n=t.interstitial.appendInPlace,r=t.media;if(n&&r===this.primaryMedia){if(this.bufferingAsset=null,(!e||this.isInterstitial(e)&&!e.event.appendInPlace)&&e&&r)return void(this.detachedData={media:r});const n=t.transferMedia();this.log(`transfer MediaSource from ${t} ${le(n)}`),this.detachedData=n}else e&&r&&(this.shouldPlay||(this.shouldPlay=!r.paused))}transferMediaTo(t,e){var n,r;if(t.media===e)return;let o=null;const l=this.hls,c=t!==l,d=c&&t.interstitial.appendInPlace,h=null==(n=this.detachedData)?void 0:n.mediaSource;let f;if(l.media)d&&(o=l.transferMedia(),this.detachedData=o),f="Primary";else if(h){const t=this.getBufferingPlayer();t?(o=t.transferMedia(),f=`${t}`):f="detached MediaSource"}else f="detached media";if(!o)if(h)o=this.detachedData,this.log(`using detachedData: MediaSource ${le(o)}`);else if(!this.detachedData||l.media===e){const t=this.playerQueue;t.length>1&&t.forEach((t=>{if(c&&t.interstitial.appendInPlace!==d){const e=t.interstitial;this.clearInterstitial(t.interstitial,null),e.appendInPlace=!1,e.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${e}`)}})),this.hls.detachMedia(),this.detachedData={media:e}}const m=o&&"mediaSource"in o&&"closed"!==(null==(r=o.mediaSource)?void 0:r.readyState),v=m&&o?o:e;this.log(`${m?"transfering MediaSource":"attaching media"} to ${c?t:"Primary"} from ${f} (media.currentTime: ${e.currentTime})`);const y=this.schedule;if(v===o&&y){const e=c&&t.assetId===y.assetIdAtEnd;
2v.overrides={duration:y.duration,endOfStream:!c||e,cueRemoval:!c}}t.attachMedia(v)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const t=this.schedule,e=null==t?void 0:t.events;if(!e||this.playbackDisabled||!this.media)return;-1===this.bufferedPos&&(this.bufferedPos=0);const n=this.timelinePos,r=this.effectivePlayingItem;if(-1===n){const n=this.hls.startPosition;if(this.timelinePos=n,0===e.length)this.setSchedulePosition(0);else if(e[0].cue.pre){this.log(Xa("checkStart (preroll)",n));const r=t.findEventIndex(e[0].identifier);this.setSchedulePosition(r)}else if(n>=0||!this.primaryLive){this.log(Xa("checkStart",n));const e=this.timelinePos=n>0?n:0,r=t.findItemIndexAtTime(e);this.setSchedulePosition(r)}else 0===this.hls.liveSyncPosition?this.setSchedulePosition(0):this.log("[checkStart] waiting for live start")}else if(r&&!this.playingItem){this.log(Xa("checkStart (playing item)",r.start));const e=t.findItemIndex(r);this.setSchedulePosition(e)}}advanceAssetBuffering(t,e){const n=t.event,r=n.findAssetIndex(e),o=Ha(n,r);if(n.isAssetPastPlayoutLimit(o)){if(this.schedule){var l;const e=null==(l=this.schedule.items)?void 0:l[this.findItemIndex(t)+1];e&&this.bufferedToItem(e)}}else this.bufferedToEvent(t,o)}advanceAfterAssetEnded(t,e,n){const r=Ha(t,n);if(t.isAssetPastPlayoutLimit(r)){if(this.schedule){const n=this.schedule.items;if(n){const r=e+1;if(r>=n.length)return void this.setSchedulePosition(-1);const o=t.resumeTime;this.timelinePos<o&&(this.log(Xa("advanceAfterAssetEnded",o)),this.timelinePos=o,t.appendInPlace&&this.advanceInPlace(o),this.checkBuffer(this.bufferedPos<o)),this.setSchedulePosition(r)}}}else{if(t.appendInPlace){const e=t.assetList[r];e&&this.advanceInPlace(e.timelineStart)}this.setSchedulePosition(e,r)}}setScheduleToAssetAtTime(time,t){const e=this.schedule;if(!e)return;const n=t.parentIdentifier,r=e.getEvent(n);if(r){const t=e.findEventIndex(n),o=e.findAssetIndex(r,time);this.advanceAfterAssetEnded(r,t,o-1)}}setSchedulePosition(t,e){var n;const r=null==(n=this.schedule)?void 0:n.items;if(!r||this.playbackDisabled)return;const o=t>=0?r[t]:null;this.log(`setSchedulePosition ${t}, ${e} (${o?Ya(o):o}) pos: ${this.timelinePos}`);const l=this.waitingItem||this.playingItem,c=this.playingLastItem;if(this.isInterstitial(l)){const n=l.event,m=this.playingAsset,v=null==m?void 0:m.identifier,y=v?this.getAssetPlayer(v):null;if(y&&v&&(!this.eventItemsMatch(l,o)||void 0!==e&&v!==n.assetList[e].identifier)){var d;const e=n.findAssetIndex(m);if(this.log(`INTERSTITIAL_ASSET_ENDED ${e+1}/${n.assetList.length} ${Wa(m)}`),this.endedAsset=m,this.playingAsset=null,this.hls.trigger(h.INTERSTITIAL_ASSET_ENDED,{asset:m,assetListIndex:e,event:n,schedule:r.slice(0),scheduleIndex:t,player:y}),l!==this.playingItem)return void(this.itemsMatch(l,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(n,this.findItemIndex(this.playingItem),e));this.retreiveMediaSource(v,o),!y.media||null!=(d=this.detachedData)&&d.mediaSource||y.detachMedia()}if(!this.eventItemsMatch(l,o)&&(this.endedItem=l,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${n} ${Ya(l)}`),n.hasPlayed=!0,this.hls.trigger(h.INTERSTITIAL_ENDED,{event:n,schedule:r.slice(0),scheduleIndex:t}),n.cue.once)){var f;this.updateSchedule();const t=null==(f=this.schedule)?void 0:f.items;if(o&&t){const n=this.findItemIndex(o);this.advanceSchedule(n,t,e,l,c)}return}}this.advanceSchedule(t,r,e,l,c)}advanceSchedule(t,e,n,r,o){const l=this.schedule;if(!l)return;const c=e[t]||null,d=this.primaryMedia,f=this.playerQueue;if(f.length&&f.forEach((e=>{const n=e.interstitial,r=l.findEventIndex(n.identifier);(r<t||r>t+1)&&this.clearInterstitial(n,c)})),this.isInterstitial(c)){this.timelinePos=Math.min(Math.max(this.timelinePos,c.start),c.end);const o=c.event;if(void 0===n){const e=Ha(o,(n=l.findAssetIndex(o,this.timelinePos))-1);if(o.isAssetPastPlayoutLimit(e)||o.appendInPlace&&this.timelinePos===c.end)return void this.advanceAfterAssetEnded(o,t,n);n=e}const f=this.waitingItem;this.assetsBuffered(c,d)||this.setBufferingItem(c);let m=this.preloadAssets(o,n);if(this.eventItemsMatch(c,f||r)||(this.waitingItem=c,this.log(`INTERSTITIAL_STARTED ${Ya(c)} ${o.appendInPlace?"append in place":""}`),this.hls.trigger(h.INTERSTITIAL_STARTED,{event:o,schedule:e.slice(0),scheduleIndex:t})),!o.assetListLoaded)return void this.log(`Waiting for ASSET-LIST to complete loading ${o}`);if(o.assetListLoader&&(o.assetListLoader.destroy(),o.assetListLoader=void 0),!d)return void this.log(`Waiting for attachMedia to start Interstitial ${o}`);this.waitingItem=this.endedItem=null,this.playingItem=c;const v=o.assetList[n];if(!v)return void this.advanceAfterAssetEnded(o,t,n||0);if(m||(m=this.getAssetPlayer(v.identifier)),null===m||m.destroyed){const t=o.assetList.length;this.warn(`asset ${n+1}/${t} player destroyed ${o}`),m=this.createAssetPlayer(o,v,n),m.loadSource()}if(!this.eventItemsMatch(c,this.bufferingItem)&&o.appendInPlace&&this.isAssetBuffered(v))return;this.startAssetPlayer(m,n,e,t,d),this.shouldPlay&&Qa(m.media)}else c?(this.resumePrimary(c,t,r),this.shouldPlay&&Qa(this.hls.media)):o&&this.isInterstitial(r)&&(this.endedItem=null,this.playingItem=r,r.event.appendInPlace||this.attachPrimary(l.durations.primary,null))}get playbackDisabled(){return!1===this.hls.config.enableInterstitialPlayback}get primaryDetails(){var t;return null==(t=this.mediaSelection)?void 0:t.main.details}get primaryLive(){var t;return!(null==(t=this.primaryDetails)||!t.live)}resumePrimary(t,e,n){var r,o;
2if(this.playingItem=t,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(t),this.log(`resuming ${Ya(t)}`),null==(r=this.detachedData)||!r.mediaSource){let n=this.timelinePos;(n<t.start||n>=t.end)&&(n=this.getPrimaryResumption(t,e),this.log(Xa("resumePrimary",n)),this.timelinePos=n),this.attachPrimary(n,t)}if(!n)return;const l=null==(o=this.schedule)?void 0:o.items;l&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Ya(t)}`),this.hls.trigger(h.INTERSTITIALS_PRIMARY_RESUMED,{schedule:l.slice(0),scheduleIndex:e}),this.checkBuffer())}getPrimaryResumption(t,e){const n=t.start;if(this.primaryLive){const details=this.primaryDetails;if(0===e)return this.hls.startPosition;if(details&&(n<details.fragmentStart||n>details.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(t){const e=this.getAssetPlayer(t.identifier);if(null!=e&&e.hls)return e.hls.bufferedToEnd;return ln.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=t.timelineStart+(t.duration||0)}attachPrimary(t,e,n){e?this.setBufferingItem(e):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const r=this.primaryMedia;if(!r)return;const o=this.hls;o.media?this.checkBuffer():(this.transferMediaTo(o,r),n&&this.startLoadingPrimaryAt(t,n)),n||(this.log(Xa("attachPrimary",t)),this.timelinePos=t,this.startLoadingPrimaryAt(t,n))}startLoadingPrimaryAt(t,e){var n;const r=this.hls;!r.loadingEnabled||!r.media||Math.abs(((null==(n=r.mainForwardBufferInfo)?void 0:n.start)||r.media.currentTime)-t)>.5?r.startLoad(t,e):r.bufferingEnabled||r.resumeBuffering()}onManifestLoading(){var t;this.stopLoad(),null==(t=this.schedule)||t.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(h.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(h.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(t,data){if(-1===data.level||!this.schedule)return;const main=this.hls.levels[data.level];if(!main.details)return;const e=I(I({},this.mediaSelection||this.altSelection),{},{main:main});this.mediaSelection=e,this.schedule.parseInterstitialDateRanges(e,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(t,data){const audio=this.hls.audioTracks[data.id],e=this.mediaSelection;if(!e)return void(this.altSelection=I(I({},this.altSelection),{},{audio:audio}));const n=I(I({},e),{},{audio:audio});this.mediaSelection=n}onSubtitleTrackUpdated(t,data){const e=this.hls.subtitleTracks[data.id],n=this.mediaSelection;if(!n)return void(this.altSelection=I(I({},this.altSelection),{},{subtitles:e}));const r=I(I({},n),{},{subtitles:e});this.mediaSelection=r}
2onAudioTrackSwitching(t,data){const e=de(data);this.playerQueue.forEach((({hls:t})=>t&&(t.setAudioOption(data)||t.setAudioOption(e))))}onSubtitleTrackSwitch(t,data){const e=de(data);this.playerQueue.forEach((({hls:t})=>t&&(t.setSubtitleOption(data)||-1!==data.id&&t.setSubtitleOption(e))))}onBufferCodecs(t,data){const e=data.tracks;e&&(this.requiredTracks=e)}onBufferAppended(t,data){this.checkBuffer()}onBufferFlushed(t,data){const e=this.playingItem;if(e&&!this.itemsMatch(e,this.bufferingItem)&&!this.isInterstitial(e)){const t=this.timelinePos;this.bufferedPos=t,this.checkBuffer()}}onBufferedToEnd(t){if(!this.schedule)return;const e=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&e){for(let i=0;i<e.length;i++){const t=e[i];if(t.cue.post){var n;const e=this.schedule.findEventIndex(t.identifier),r=null==(n=this.schedule.items)?void 0:n[e];this.isInterstitial(r)&&this.eventItemsMatch(r,this.bufferingItem)&&this.bufferedToItem(r,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(t){const e=this.playingItem;if(!this.playingLastItem&&e){const t=this.findItemIndex(e);this.setSchedulePosition(t+1)}else this.shouldPlay=!1}updateItem(t,time){var e;const n=null==(e=this.schedule)?void 0:e.items;if(t&&n){return n[this.findItemIndex(t,time)]||null}return null}trimInPlace(t,e){if(this.isInterstitial(t)&&t.event.appendInPlace&&e.end-t.end>.25){t.event.assetList.forEach(((e,n)=>{t.event.isAssetPastPlayoutLimit(n)&&this.clearAssetPlayer(e.identifier,null)}));const n=t.end+.25,r=ln.bufferInfo(this.primaryMedia,n,0);if(r.end>n||(r.nextStart||0)>n){this.log(`trim buffered interstitial ${Ya(t)} (was ${Ya(e)})`);const r=!0;this.attachPrimary(n,null,r),this.flushFrontBuffer(n)}}}itemsMatch(a,b){return!!b&&(a===b||a.event&&b.event&&this.eventItemsMatch(a,b)||!a.event&&!b.event&&this.findItemIndex(a)===this.findItemIndex(b))}eventItemsMatch(a,b){var t;return!!b&&(a===b||a.event.identifier===(null==(t=b.event)?void 0:t.identifier))}findItemIndex(t,time){return t&&this.schedule?this.schedule.findItemIndex(t,time):-1}updateSchedule(t=!1){var e;const n=this.mediaSelection;n&&(null==(e=this.schedule)||e.updateSchedule(n,[],t))}checkBuffer(t){var e;const n=null==(e=this.schedule)?void 0:e.items;if(!n)return;const r=ln.bufferInfo(this.primaryMedia,this.timelinePos,0);t&&(this.bufferedPos=this.timelinePos),t||(t=r.len<1),this.updateBufferedPos(r.end,n,t)}updateBufferedPos(t,e,n){const r=this.schedule,o=this.bufferingItem;if(this.bufferedPos>t||!r)return;if(1===e.length&&this.itemsMatch(e[0],o))return void(this.bufferedPos=t);const l=this.playingItem,c=this.findItemIndex(l);let d=r.findItemIndexAtTime(t);if(this.bufferedPos<t){var h;const n=this.findItemIndex(o),r=Math.min(n+1,e.length-1),l=e[r];if((-1===d&&o&&t>=o.end||null!=(h=l.event)&&h.appendInPlace&&t+.01>=l.start)&&(d=r),this.isInterstitial(o)){const t=o.event;if(r-c>1&&!1===t.appendInPlace)return;if(0===t.assetList.length&&t.assetListLoader)return}if(this.bufferedPos=t,d>n&&d>c)this.bufferedToItem(l);else{const details=this.primaryDetails;this.primaryLive&&details&&t>details.edge-details.targetduration&&l.start<details.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(l)&&this.preloadAssets(l.event,0)}}else n&&l&&!this.itemsMatch(l,o)&&(d===c?this.bufferedToItem(l):d===c+1&&this.bufferedToItem(e[d]))}assetsBuffered(t,e){return 0!==t.event.assetList.length&&!t.event.assetList.some((t=>{const n=this.getAssetPlayer(t.identifier);return!(null!=n&&n.bufferedInPlaceToEnd(e))}))}setBufferingItem(t){const e=this.bufferingItem,n=this.schedule;if(!this.itemsMatch(t,e)&&n){const{items:r,events:o}=n;if(!r||!o)return e;const l=this.isInterstitial(t),c=this.getBufferingPlayer();this.bufferingItem=t,this.bufferedPos=Math.max(t.start,Math.min(t.end,this.timelinePos));const d=c?c.remaining:e?e.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Ya(t)}`+(e?` (${d.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(l){const e=n.findAssetIndex(t.event,this.bufferedPos);t.event.assetList.forEach(((t,i)=>{const n=this.getAssetPlayer(t.identifier);n&&(i===e&&n.loadSource(),n.resumeBuffering())}))}else this.hls.resumeBuffering(),this.playerQueue.forEach((t=>
2t.pauseBuffering()));this.hls.trigger(h.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:o.slice(0),schedule:r.slice(0),bufferingIndex:this.findItemIndex(t),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==t&&(this.bufferingItem=t);return e}bufferedToItem(t,e=0){const n=this.setBufferingItem(t);if(!this.playbackDisabled)if(this.isInterstitial(t))this.bufferedToEvent(t,e);else if(null!==n){this.bufferingAsset=null;const e=this.detachedData;if(e)if(e.mediaSource){const e=!0;this.attachPrimary(t.start,t,e)}else this.preloadPrimary(t);else this.preloadPrimary(t)}}preloadPrimary(t){const e=this.findItemIndex(t),n=this.getPrimaryResumption(t,e);this.startLoadingPrimaryAt(n)}bufferedToEvent(t,e){const n=t.event,r=0===n.assetList.length&&!n.assetListLoader,o=n.cue.once;if(r||!o){const t=this.preloadAssets(n,e);if(null!=t&&t.interstitial.appendInPlace){const e=this.primaryMedia;e&&this.bufferAssetPlayer(t,e)}}}preloadAssets(t,e){const n=t.assetUrl,r=t.assetList.length,o=0===r&&!t.assetListLoader,l=t.cue.once;if(o){const o=t.timelineStart;if(t.appendInPlace){var c;const e=this.playingItem;this.isInterstitial(e)||(null==e||null==(c=e.nextEvent)?void 0:c.identifier)!==t.identifier||this.flushFrontBuffer(o+.25)}let l,d=0;if(!this.playingItem&&this.primaryLive&&(d=this.hls.startPosition,-1===d&&(d=this.hls.liveSyncPosition||0)),d&&!t.cue.pre&&!t.cue.post){const t=d-o;t>0&&(l=Math.round(1e3*t)/1e3)}if(this.log(`Load interstitial asset ${e+1}/${n?1:r} ${t}${l?` live-start: ${d} start-offset: ${l}`:""}`),n)return this.createAsset(t,0,0,o,t.duration,n);const h=this.assetListLoader.loadAssetList(t,l);h&&(t.assetListLoader=h)}else if(!l&&r){for(let i=e;i<r;i++){const e=t.assetList[i],n=this.getAssetPlayerQueueIndex(e.identifier);-1!==n&&!this.playerQueue[n].destroyed||e.error||this.createAssetPlayer(t,e,i)}const n=t.assetList[e];if(n){const t=this.getAssetPlayer(n.identifier);return t&&t.loadSource(),t}}return null}flushFrontBuffer(t){const e=this.requiredTracks;if(!e)return;this.log(`Removing front buffer starting at ${t}`);Object.keys(e).forEach((e=>{this.hls.trigger(h.BUFFER_FLUSHING,{startOffset:t,endOffset:1/0,type:e})}))}getAssetPlayerQueueIndex(t){const e=this.playerQueue;for(let i=0;i<e.length;i++)if(t===e[i].assetId)return i;return-1}getAssetPlayer(t){const e=this.getAssetPlayerQueueIndex(t);return this.playerQueue[e]||null}getBufferingPlayer(){const{playerQueue:t,primaryMedia:e}=this;if(e)for(let i=0;i<t.length;i++)if(t[i].media===e)return t[i];return null}createAsset(t,e,n,r,o,l){const c={parentIdentifier:t.identifier,identifier:Ba(t,l,e),duration:o,startOffset:n,timelineStart:r,uri:l};return this.createAssetPlayer(t,c,e)}createAssetPlayer(t,e,n){const r=this.hls,o=r.userConfig;let l=o.videoPreference;const f=r.loadLevelObj||r.levels[r.currentLevel];(l||f)&&(l=O({},l),f.videoCodec&&(l.videoCodec=f.videoCodec),f.videoRange&&(l.allowedVideoRanges=[f.videoRange]));const m=r.audioTracks[r.audioTrack],v=r.subtitleTracks[r.subtitleTrack];let y=0;if(this.primaryLive||t.appendInPlace){const t=this.timelinePos-e.timelineStart;if(t>1){const n=e.duration;n&&t<n&&(y=t)}}const E=e.identifier,T=I(I({},o),{},{maxMaxBufferLength:Math.min(180,r.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:r.sessionId,assetPlayerId:E,abrEwmaDefaultEstimate:r.bandwidthEstimate,interstitialsController:void 0,startPosition:y,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:l,audioPreference:m||o.audioPreference,subtitlePreference:v||o.subtitlePreference});t.appendInPlace&&(t.appendInPlaceStarted=!0,e.timelineStart&&(T.timelineOffset=e.timelineStart));const k=T.cmcd;null!=k&&k.sessionId&&k.contentId&&(T.cmcd=O({},k,{contentId:Fa(e.uri)})),this.getAssetPlayer(E)&&this.warn(`Duplicate date range identifier ${t} and asset ${E}`);const S=new Ka(this.HlsPlayerClass,T,t,e);this.playerQueue.push(S),t.assetList[n]=e;let _=!0;const A=details=>{if(details.live){var r;const e=new Error(`Interstitials MUST be VOD assets ${t}`),o={fatal:!0,type:c.OTHER_ERROR,details:d.INTERSTITIAL_ASSET_ITEM_ERROR,error:e},l=(null==(r=this.schedule)?void 0:r.findEventIndex(t.identifier))||-1;return void this.handleAssetItemError(o,t,l,n,e.message)}
2const o=details.edge-details.fragmentStart,l=e.duration;(_||null===l||o>l)&&(_=!1,this.log(`Interstitial asset "${E}" duration change ${l} > ${o}`),e.duration=o,this.updateSchedule())};S.on(h.LEVEL_UPDATED,((t,{details:details})=>A(details))),S.on(h.LEVEL_PTS_UPDATED,((t,{details:details})=>A(details))),S.on(h.EVENT_CUE_ENTER,(()=>this.onInterstitialCueEnter()));const w=(t,data)=>{const e=this.getAssetPlayer(E);if(e&&data.tracks){e.off(h.BUFFER_CODECS,w),e.tracks=data.tracks;const t=this.primaryMedia;this.bufferingAsset===e.assetItem&&t&&!e.media&&this.bufferAssetPlayer(e,t)}};S.on(h.BUFFER_CODECS,w);S.on(h.BUFFERED_TO_END,(()=>{var n;const r=this.getAssetPlayer(E);if(this.log(`buffered to end of asset ${r}`),!r||!this.schedule)return;const o=this.schedule.findEventIndex(t.identifier),l=null==(n=this.schedule.items)?void 0:n[o];this.isInterstitial(l)&&this.advanceAssetBuffering(l,e)}));const R=e=>()=>{if(!this.getAssetPlayer(E)||!this.schedule)return;this.shouldPlay=!0;const n=this.schedule.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,n,e)};return S.once(h.MEDIA_ENDED,R(n)),S.once(h.PLAYOUT_LIMIT_REACHED,R(1/0)),S.on(h.ERROR,((e,data)=>{if(!this.schedule)return;const r=this.getAssetPlayer(E);if(data.details===d.BUFFER_STALLED_ERROR)return null!=r&&r.appendInPlace?void this.handleInPlaceStall(t):(this.onTimeupdate(),void this.checkBuffer(!0));this.handleAssetItemError(data,t,this.schedule.findEventIndex(t.identifier),n,`Asset player error ${data.error} ${t}`)})),S.on(h.DESTROYING,(()=>{if(!this.getAssetPlayer(E)||!this.schedule)return;const e=new Error(`Asset player destroyed unexpectedly ${E}`),r={fatal:!0,type:c.OTHER_ERROR,details:d.INTERSTITIAL_ASSET_ITEM_ERROR,error:e};this.handleAssetItemError(r,t,this.schedule.findEventIndex(t.identifier),n,e.message)})),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${Wa(e)}`),this.hls.trigger(h.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:e,assetListIndex:n,event:t,player:S}),S}clearInterstitial(t,e){this.clearAssetPlayers(t,e),t.reset()}clearAssetPlayers(t,e){t.assetList.forEach((t=>{this.clearAssetPlayer(t.identifier,e)}))}resetAssetPlayer(t){const e=this.getAssetPlayerQueueIndex(t);if(-1!==e){this.log(`reset asset player "${t}" after error`);const n=this.playerQueue[e];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(t,e){const n=this.getAssetPlayerQueueIndex(t);if(-1!==n){const t=this.playerQueue[n];this.log(`clear ${t} toSegment: ${e?Ya(e):e}`),this.transferMediaFromPlayer(t,e),this.playerQueue.splice(n,1),t.destroy()}}emptyPlayerQueue(){let t;for(;t=this.playerQueue.pop();)t.destroy();this.playerQueue=[]}startAssetPlayer(t,e,n,r,o){const{interstitial:l,assetItem:c,assetId:d}=t,f=l.assetList.length,m=this.playingAsset;this.endedAsset=null,this.playingAsset=c,m&&m.identifier===d||(m&&(this.clearAssetPlayer(m.identifier,n[r]),delete m.error),this.log(`INTERSTITIAL_ASSET_STARTED ${e+1}/${f} ${Wa(c)}`),this.hls.trigger(h.INTERSTITIAL_ASSET_STARTED,{asset:c,assetListIndex:e,event:l,schedule:n.slice(0),scheduleIndex:r,player:t})),this.bufferAssetPlayer(t,o)}bufferAssetPlayer(t,e){var n,r;if(!this.schedule)return;const{interstitial:o,assetItem:l}=t,h=this.schedule.findEventIndex(o.identifier),f=null==(n=this.schedule.items)?void 0:n[h];if(!f)return;t.loadSource(),this.setBufferingItem(f),this.bufferingAsset=l;const m=this.getBufferingPlayer();if(m===t)return;const v=o.appendInPlace;if(v&&!1===(null==m?void 0:m.interstitial.appendInPlace))return;const y=(null==m?void 0:m.tracks)||(null==(r=this.detachedData)?void 0:r.tracks)||this.requiredTracks;if(v&&l!==this.playingAsset){if(!t.tracks)return void this.log(`Waiting for track info before buffering ${t}`);if(y&&!F(y,t.tracks)){const e=new Error(`Asset ${Wa(l)} SourceBuffer tracks ('${Object.keys(t.tracks)}') are not compatible with primary content tracks ('${Object.keys(y)}')`),n={fatal:!0,type:c.OTHER_ERROR,details:d.INTERSTITIAL_ASSET_ITEM_ERROR,error:e},r=o.findAssetIndex(l);return void this.handleAssetItemError(n,o,h,r,e.message)}}this.transferMediaTo(t,e)}handleInPlaceStall(t){const e=this.schedule,n=this.primaryMedia;if(!e||!n)return;const r=n.currentTime,o=e.findAssetIndex(t,r),l=t.assetList[o];if(l){const c=this.getAssetPlayer(l.identifier);if(c){const d=c.currentTime||r-l.timelineStart,h=c.duration-d;if(this.warn(`Stalled at ${d} of ${d+h} in ${c} ${t} (media.currentTime: ${r})`),d&&(h/n.playbackRate<.5||c.bufferedInPlaceToEnd(n))&&c.hls){const n=e.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,n,o)}}}}advanceInPlace(time){const t=this.primaryMedia;t&&t.currentTime<time&&(t.currentTime=time)}handleAssetItemError(data,t,e,n,r){if(data.details===d.BUFFER_STALLED_ERROR)return;const o=t.assetList[n]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${o?Wa(o):o} ${data.error}`),!this.schedule)return;const l=(null==o?void 0:o.identifier)||"",c=this.getAssetPlayerQueueIndex(l),f=this.playerQueue[c]||null,m=this.schedule.items,v=O({},data,{fatal:!1,errorAction:Ne(!0),asset:o,assetListIndex:n,event:t,schedule:m,scheduleIndex:e,player:f});if(this.hls.trigger(h.INTERSTITIAL_ASSET_ERROR,v),!data.fatal)return;
2const y=this.playingAsset,E=this.bufferingAsset,T=new Error(r);if(o&&(this.clearAssetPlayer(l,null),o.error=T),t.assetList.some((t=>!t.error)))for(let i=n;i<t.assetList.length;i++)this.resetAssetPlayer(t.assetList[i].identifier);else t.error=T;this.updateSchedule(!0),t.error?this.primaryFallback(t):y&&y.identifier===l?this.advanceAfterAssetEnded(t,e,n):E&&E.identifier===l&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,E)}primaryFallback(t){const e=t.timelineStart,n=this.effectivePlayingItem;let r=this.timelinePos;if(n){this.log(`Fallback to primary from event "${t.identifier}" start: ${e} pos: ${r} playing: ${Ya(n)} error: ${t.error}`),-1===r&&(r=this.hls.startPosition);const o=this.updateItem(n,r);this.itemsMatch(n,o)&&this.clearInterstitial(t,null),t.appendInPlace&&(this.attachPrimary(e,null),this.flushFrontBuffer(e))}else if(-1===r)return void this.checkStart();if(!this.schedule)return;const o=this.schedule.findItemIndexAtTime(r);this.setSchedulePosition(o)}onAssetListLoaded(t,data){var e,n;const r=data.event,o=r.identifier,l=data.assetListResponse.ASSETS;if(null==(e=this.schedule)||!e.hasEvent(o))return;const c=r.timelineStart,d=r.duration;let h=0;l.forEach(((t,e)=>{const n=parseFloat(t.DURATION);this.createAsset(r,e,h,c+h,n,t.URI),h+=n})),r.duration=h,this.log(`Loaded asset-list with duration: ${h} (was: ${d}) ${r}`);const f=this.waitingItem,m=(null==f?void 0:f.event.identifier)===o;this.updateSchedule();const v=null==(n=this.bufferingItem)?void 0:n.event;if(m){var y;const t=this.schedule.findEventIndex(o),e=null==(y=this.schedule.items)?void 0:y[t];if(e){if(!this.playingItem&&this.timelinePos>e.end){if(this.schedule.findItemIndexAtTime(this.timelinePos)!==t)return r.error=new Error(`Interstitial ${l.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${r}`),this.log(r.error.message),this.updateSchedule(!0),void this.primaryFallback(r)}this.setBufferingItem(e)}this.setSchedulePosition(t)}else if((null==v?void 0:v.identifier)===o){const t=r.assetList[0];if(t){const e=this.getAssetPlayer(t.identifier);if(v.appendInPlace){const t=this.primaryMedia;e&&t&&this.bufferAssetPlayer(e,t)}else e&&e.loadSource()}}}onError(t,data){if(this.schedule)switch(data.details){case d.ASSET_LIST_PARSING_ERROR:case d.ASSET_LIST_LOAD_ERROR:case d.ASSET_LIST_LOAD_TIMEOUT:{const t=data.interstitial;t&&(this.updateSchedule(!0),this.primaryFallback(t));break}case d.BUFFER_STALLED_ERROR:{const t=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(t)&&t.event.appendInPlace)return void this.handleInPlaceStall(t.event);this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}});function nl(t){return t&&"object"==typeof t?Array.isArray(t)?t.map(nl):Object.keys(t).reduce(((e,n)=>(e[n]=nl(t[n]),e)),{}):t}function il(t,e){const n=t.loader;if(n!==Qo&&n!==tl)e.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1;else{(function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1})()&&(t.loader=Qo,t.progressive=!0,t.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class rl extends sn{constructor(t,e){super("gap-controller",t.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var t;null!=(t=this.media)&&t.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{var t;this.hls&&(this.ended=(null==(t=this.media)?void 0:t.currentTime)||1,this.hls.trigger(h.MEDIA_ENDED,{stalled:!1}))},this.hls=t,this.fragmentTracker=e,this.registerListeners()}registerListeners(){const{hls:t}=this;t&&(t.on(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(h.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:t}=this;
vendor: 4,798 bytes, line 2
2t&&(t.off(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(h.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(t,data){this.setInterval(100),this.mediaSource=data.mediaSource;const e=this.media=data.media;Ai(e,"playing",this.onMediaPlaying),Ai(e,"waiting",this.onMediaWaiting),Ai(e,"ended",this.onMediaEnded)}onMediaDetaching(t,data){this.clearInterval();const{media:e}=this;e&&(Oi(e,"playing",this.onMediaPlaying),Oi(e,"waiting",this.onMediaWaiting),Oi(e,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(t,data){this.buffered=data.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var t;if(null==(t=this.media)||!t.readyState||!this.hasBuffered)return;const e=this.media.currentTime;this.poll(e,this.lastCurrentTime),this.lastCurrentTime=e}poll(t,e){var n,r;const o=null==(n=this.hls)?void 0:n.config;if(!o)return;const l=this.media;if(!l)return;const{seeking:c}=l,d=this.seeking&&!c,f=!this.seeking&&c,m=l.paused&&!c||l.ended||0===l.playbackRate;if(this.seeking=c,t!==e)return e&&(this.ended=0),this.moved=!0,c||(this.nudgeRetry=0,o.nudgeOnVideoHole&&!m&&t>e&&this.nudgeOnVideoHole(t,e)),void(0===this.waiting&&this.stallResolved(t));if(f||d)return void(d&&this.stallResolved(t));if(m)return this.nudgeRetry=0,this.stallResolved(t),void(!this.ended&&l.ended&&this.hls&&(this.ended=t||1,this.hls.trigger(h.MEDIA_ENDED,{stalled:!1})));if(!ln.getBuffered(l).length)return void(this.nudgeRetry=0);const v=ln.bufferInfo(l,t,0),y=v.nextStart||0,E=this.fragmentTracker;if(c&&E&&this.hls){const e=sl(this.hls.inFlightFragments,t),n=v.len>2,r=!y||e||y-t>2&&!E.getPartialFragment(t);if(n||r)return;this.moved=!1}const T=null==(r=this.hls)?void 0:r.latestLevelDetails;if(!this.moved&&null!==this.stalled&&E){if(!(v.len>0)&&!y)return;const e=Math.max(y,v.start||0)-t,n=!(null==T||!T.live)?2*T.targetduration:2,r=ll(t,E);if(e>0&&(e<=n||r))return void(l.paused||this._trySkipBufferHole(r))}const k=o.detectStallWithCurrentTimeMs,S=self.performance.now(),_=this.waiting;let A=this.stalled;if(null===A){if(!(_>0&&S-_<k))return void(this.stalled=S);A=this.stalled=_}const O=S-A;if(!c&&(O>=k||_)&&this.hls){var w;if("ended"===(null==(w=this.mediaSource)?void 0:w.readyState)&&(null==T||!T.live)&&Math.abs(t-((null==T?void 0:T.edge)||0))<1){if(this.ended)return;return this.ended=t||1,void this.hls.trigger(h.MEDIA_ENDED,{stalled:!0})}if(this._reportStall(v),!this.media||!this.hls)return}const I=ln.bufferInfo(l,t,o.maxBufferHole);this._tryFixBufferStall(I,O,t)}stallResolved(t){const e=this.stalled;if(e&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-e;this.log(`playback not stuck anymore @${t}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(h.STALL_RESOLVED,{})}}nudgeOnVideoHole(t,e){var n;const r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&null!=(n=this.buffered.audio)&&n.length&&r&&r.length>1&&t>r.end(0)){const n=ln.bufferedInfo(ln.timeRangesToArray(this.buffered.audio),t,0);if(n.len>1&&e>=n.start){const n=ln.timeRangesToArray(r),o=ln.bufferedInfo(n,e,0).bufferedIndex;if(o>-1&&o<n.length-1){const e=ln.bufferedInfo(n,t,0).bufferedIndex,r=n[o].end,l=n[o+1].start;if((-1===e||e>o)&&l-r<1&&t-r<2){const n=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${t} hole: ${r} -> ${l} buffered index: ${e}`);this.warn(n.message),this.media.currentTime+=1e-6;let o=ll(t,this.fragmentTracker);o&&"fragment"in o?o=o.fragment:o||(o=void 0);const f=ln.bufferInfo(this.media,t,0);this.hls.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,frag:o,buffer:f.len,bufferInfo:f})}}}}}_tryFixBufferStall(t,e,n){var r,o;const{fragmentTracker:l,media:c}=this,d=null==(r=this.hls)?void 0:r.config;if(!c||!l||!d)return;const h=null==(o=this.hls)?void 0:o.latestLevelDetails,f=ll(n,l);if(f||null!=h&&h.live&&n<h.fragmentStart){if(this._trySkipBufferHole(f)||!this.media)return}const m=t.buffered,v=this.adjacentTraversal(t,n);(m&&m.length>1&&t.len>d.maxBufferHole||t.nextStart&&(t.nextStart-n<d.maxBufferHole||v))&&(e>1e3*d.highBufferWatchdogPeriod||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(t))}adjacentTraversal(t,e){const n=this.fragmentTracker,r=t.nextStart;if(n&&r){const t=n.getFragAtPos(e,E),o=n.getFragAtPos(r,E);if(t&&o)return o.sn-t.sn<2}return!1}_reportStall(t){const{hls:e,media:n,stallReported:r,stalled:o}=this;if(!r&&null!==o&&n&&e){this.stallReported=!0;const r=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${le(t)}
2)`);this.warn(r.message),e.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:t.len,bufferInfo:t,stalled:{start:o}})}}_trySkipBufferHole(t){var e;const{fragmentTracker:n,media:r}=this,o=null==(e=this.hls)?void 0:e.config;if(!r||!n||!o)return 0;const l=r.currentTime,f=ln.bufferInfo(r,l,0),m=l<f.start?f.start:f.nextStart;if(m&&this.hls){const e=f.len<=o.maxBufferHole,y=f.len>0&&f.len<1&&r.readyState<3,T=m-l;if(T>0&&(e||y)){if(T>o.maxBufferHole){let e=!1;if(0===l){const t=n.getAppendedFrag(0,E);t&&m<t.end&&(e=!0)}if(!e&&t){var v;if(null==(v=this.hls.loadLevelObj)||!v.details)return 0;if(sl(this.hls.inFlightFragments,m))return 0;let e=!1,r=t.end;for(;r<m;){const t=ll(r,n);if(!t){e=!0;break}r+=t.duration}if(e)return 0}}const e=Math.max(m+.05,l+.1);if(this.warn(`skipping hole, adjusting currentTime from ${l} to ${e}`),this.moved=!0,r.currentTime=e,null==t||!t.gap){const n=new Error(`fragment loaded with buffer holes, seeking from ${l} to ${e}`),r={type:c.MEDIA_ERROR,details:d.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,buffer:f.len,bufferInfo:f};t&&("fragment"in t?r.part=t:r.frag=t),this.hls.trigger(h.ERROR,r)}return e}}return 0}_tryNudgeBuffer(t){const{hls:e,media:n,nudgeRetry:r}=this,o=null==e?void 0:e.config;if(!n||!o)return 0;const l=n.currentTime;if(this.nudgeRetry++,r<o.nudgeMaxRetry){const f=l+(r+1)*o.nudgeOffset,m=new Error(`Nudging 'currentTime' from ${l} to ${f}`);this.warn(m.message),n.currentTime=f,e.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.BUFFER_NUDGE_ON_STALL,error:m,fatal:!1,buffer:t.len,bufferInfo:t})}else{const n=new Error(`Playhead still not moving while enough data buffered @${l} after ${o.nudgeMaxRetry} nudges`);this.error(n.message),e.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.BUFFER_STALLED_ERROR,error:n,fatal:!0,buffer:t.len,bufferInfo:t})}}}function sl(t,e){const main=al(t.main);if(main&&main.start<=e)return main;const audio=al(t.audio);return audio&&audio.start<=e?audio:null}function al(t){if(!t)return null;switch(t.state){case Ri:case Ii:case ji:case Fi:return null}return t.frag}function ll(t,e){return e.getAppendedFrag(t,E)||e.getPartialFragment(t)}function cl(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function hl(t,e,n,data,r){let o=new t(e,n,"");try{o.value=data,r&&(o.type=r)}catch(l){o=new t(e,n,le(r?I({type:r},data):data))}return o}const fl=(()=>{const t=cl();try{t&&new t(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class pl{constructor(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(h.EVENT_CUE_ENTER,{})},this.hls=t,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:t}=this;t&&(t.on(h.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(h.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(h.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(h.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:t}=this;t&&(t.off(h.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(h.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(h.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(h.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(t,data){var e;this.media=data.media,!1===(null==(e=data.overrides)?void 0:e.cueRemoval)&&(this.removeCues=!1)}onMediaAttached(){var t;const details=null==(t=this.hls)?void 0:t.latestLevelDetails;
vendor: 41,413 bytes, line 2
2details&&this.updateDateRangeCues(details)}onMediaDetaching(t,data){this.media=null;!!data.transferMedia||(this.id3Track&&(this.removeCues&&Pa(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(t){const track=this.getID3Track(t.textTracks);return track.mode="hidden",track}getID3Track(t){if(this.media){for(let i=0;i<t.length;i++){const e=t[i];if("metadata"===e.kind&&"id3"===e.label)return Da(e,this.media),e}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(t,data){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:e,enableID3MetadataCues:n}=this.hls.config;if(!e&&!n)return;const{samples:r}=data;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=cl();if(o)for(let i=0;i<r.length;i++){const t=r[i].type;if(t===yr.emsg&&!e||!n)continue;const l=pr(r[i].data),c=r[i].pts;let d=c+r[i].duration;d>fl&&(d=fl);d-c<=0&&(d=c+.25);for(let e=0;e<l.length;e++){const n=l[e];if(!mr(n)){this.updateId3CueEnds(c,t);const e=hl(o,c,d,n,t);e&&this.id3Track.addCue(e)}}}}updateId3CueEnds(t,e){var n;const r=null==(n=this.id3Track)?void 0:n.cues;if(r)for(let i=r.length;i--;){const n=r[i];n.type===e&&n.startTime<t&&n.endTime===fl&&(n.endTime=t)}}onBufferFlushing(t,{startOffset:e,endOffset:n,type:r}){const{id3Track:o,hls:l}=this;if(!l)return;const{config:{enableEmsgMetadataCues:c,enableID3MetadataCues:d}}=l;if(o&&(c||d)){let t;t="audio"===r?t=>t.type===yr.audioId3&&d:"video"===r?t=>t.type===yr.emsg&&c:t=>t.type===yr.audioId3&&d||t.type===yr.emsg&&c,Ma(o,e,n,t)}}onLevelUpdated(t,{details:details}){this.updateDateRangeCues(details,!0)}onLevelPtsUpdated(t,data){Math.abs(data.drift)>.01&&this.updateDateRangeCues(data.details)}updateDateRangeCues(details,t){if(!this.hls||!this.media)return;const{assetPlayerId:e,timelineOffset:n,enableDateRangeMetadataCues:o,interstitialsController:l}=this.hls.config;if(!o)return;const c=cl();if(e&&n&&!l){const{fragmentStart:t,fragmentEnd:n}=details;let r=this.assetCue;r?(r.startTime=t,r.endTime=n):c&&(r=this.assetCue=hl(c,t,n,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),r&&(r.id=e,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(r),r.addEventListener("enter",this.onEventCueEnter)))}if(!details.hasProgramDateTime)return;const{id3Track:d}=this,{dateRanges:h}=details,f=Object.keys(h);let m=this.dateRangeCuesAppended;var v;if(d&&t)if(null!=(v=d.cues)&&v.length){const t=Object.keys(m).filter((t=>!f.includes(t)));for(let i=t.length;i--;){var y;const e=t[i],n=null==(y=m[e])?void 0:y.cues;delete m[e],n&&Object.keys(n).forEach((t=>{const e=n[t];if(e){e.removeEventListener("enter",this.onEventCueEnter);try{d.removeCue(e)}catch(t){}}}))}}else m=this.dateRangeCuesAppended={};const E=details.fragments[details.fragments.length-1];if(0!==f.length&&r(null==E?void 0:E.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let i=0;i<f.length;i++){const t=f[i],e=h[t],n=e.startTime,r=m[t],o=(null==r?void 0:r.cues)||{};let d=(null==r?void 0:r.durationKnown)||!1,v=fl;const{duration:y,endDate:E}=e;if(E&&null!==y)v=n+y,d=!0;else if(e.endOnNext&&!d){const t=f.reduce(((t,n)=>{if(n!==e.id){const r=h[n];if(r.class===e.class&&r.startDate>e.startDate&&(!t||e.startDate<t.startDate))return r}return t}),null);t&&(v=t.startTime,d=!0)}const k=Object.keys(e.attr);for(let h=0;h<k.length;h++){const f=k[h];if("ID"===(T=f)||"CLASS"===T||"CUE"===T||"START-DATE"===T||"DURATION"===T||"END-DATE"===T||"END-ON-NEXT"===T)continue;const m=o[f];if(m)!d||null!=r&&r.durationKnown?Math.abs(m.startTime-n)>.01&&(m.startTime=n,m.endTime=v):m.endTime=v;else if(c){let data=e.attr[f];vn(f)&&(data=B(data));const r=hl(c,n,v,{key:f,data:data},yr.dateRange);r&&(r.id=t,this.id3Track.addCue(r),o[f]=r,l&&("X-ASSET-LIST"!==f&&"X-ASSET-URL"!==f||r.addEventListener("enter",this.onEventCueEnter)))}}m[t]={cues:o,dateRange:e,durationKnown:d}}var T}}}class ml{constructor(t){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,e=this.levelDetails;if(!t||!e)return;this.currentTime=t.currentTime;const n=this.computeLatency();if(null===n)return;this._latency=n;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:o}=this.config;if(!r||1===o||!e.live)return;const l=this.targetLatency;if(null===l)return;const c=n-l;if(c<Math.min(this.maxLatency,l+e.targetduration)&&c>.05&&this.forwardBufferLength>1){const e=Math.min(2,Math.max(1,o)),n=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,r=Math.min(e,Math.max(1,n));this.changeMediaPlaybackRate(t,r)}else 1!==t.playbackRate&&0!==t.playbackRate&&this.changeMediaPlaybackRate(t,1)},this.hls=t,this.config=t.config,this.registerListeners()}get levelDetails(){var t;return(null==(t=this.hls)?void 0:t.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:t}=this;if(void 0!==t.liveMaxLatencyDuration)return t.liveMaxLatencyDuration;const e=this.levelDetails;return e?t.liveMaxLatencyDurationCount*e.targetduration:0}get targetLatency(){const t=this.levelDetails;if(null===t||null===this.hls)return null;const{holdBack:e,partHoldBack:n,targetduration:r}=t,{liveSyncDuration:o,liveSyncDurationCount:l,lowLatencyMode:c}=this.config,d=this.hls.userConfig;let h=c&&n||e;(this._targetLatencyUpdated||d.liveSyncDuration||d.liveSyncDurationCount||0===h)&&(h=void 0!==o?o:l*r);const f=r;return h+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,f)}set targetLatency(t){this.stallCount=0,this.config.liveSyncDuration=t,this._targetLatencyUpdated=!0}get liveSyncPosition(){const t=this.estimateLiveEdge(),e=this.targetLatency;if(null===t||null===e)return null;const n=this.levelDetails;if(null===n)return null;const r=n.edge,o=t-e-this.edgeStalled,l=r-n.totalduration,c=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(l,o),c)}get drift(){const t=this.levelDetails;return null===t?1:t.drift}get edgeStalled(){const t=this.levelDetails;if(null===t)return 0;const e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}get forwardBufferLength(){const{media:t}=this,e=this.levelDetails;if(!t||!e)return 0;const n=t.buffered.length;return(n?t.buffered.end(n-1):e.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:t}=this;t&&(t.on(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(h.ERROR,this.onError,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(h.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(h.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(h.ERROR,this.onError,this))}onMediaAttached(t,data){this.media=data.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(t,{details:details}){details.advanced&&this.onTimeupdate(),!details.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(t,data){var e;data.details===d.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&null!=(e=this.levelDetails)&&e.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(t,e){var n,r;t.playbackRate!==e&&(null==(n=this.hls)||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${null==(r=this.targetLatency)?void 0:r.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${t.playbackRate} to ${e}`),t.playbackRate=e)}estimateLiveEdge(){const t=this.levelDetails;return null===t?null:t.edge+t.age}computeLatency(){const t=this.estimateLiveEdge();return null===t?null:t-this.currentTime}}class gl extends Ts{constructor(t,e){super(t,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=e,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(h.LEVEL_LOADED,this.onLevelLoaded,this),t.on(h.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(h.FRAG_BUFFERED,this.onFragBuffered,this),t.on(h.ERROR,this.onError,this)}_unregisterListeners(){const{hls:t}=this;t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(h.LEVEL_LOADED,this.onLevelLoaded,this),t.off(h.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(h.FRAG_BUFFERED,this.onFragBuffered,this),t.off(h.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach((t=>{t.loadError=0,t.fragmentError=0})),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(t,data){this.resetLevels()}onManifestLoaded(t,data){const e=this.hls.config.preferManagedMediaSource,n=[],r={},o={};let l=!1,c=!1,d=!1;data.levels.forEach((t=>{const h=t.attrs;let{audioCodec:f,videoCodec:m}=t;f&&(t.audioCodec=f=Ut(f,e)||void 0),m&&(m=t.videoCodec=function(t){const e=t.split(",");for(let i=0;i<e.length;i++){const t=e[i].split(".");t.length>2&&"avc1"===t[0]&&(e[i]=`avc1.${parseInt(t[1]).toString(16)}${("000"+parseInt(t[2]).toString(16)).slice(-4)}`)}return e.join(",")}(m));const{width:v,height:y,unknownCodecs:E}=t,T=(null==E?void 0:E.length)||0;if(l||(l=!(!v||!y)),c||(c=!!m),d||(d=!!f),T||f&&!this.isAudioSupported(f)||m&&!this.isVideoSupported(m))return void this.log(`Some or all CODECS not supported "${h.CODECS}"`);const{CODECS:k,"FRAME-RATE":S,"HDCP-LEVEL":_,"PATHWAY-ID":A,RESOLUTION:O,"VIDEO-RANGE":w}=h,I=`${`${A||"."}-`}${t.bitrate}-${O}-${S}-${k}-${w}-${_}`;if(r[I])if(r[I].uri===t.url||t.attrs["PATHWAY-ID"])r[I].addGroupId("audio",h.AUDIO),r[I].addGroupId("text",h.SUBTITLES);else{const e=o[I]+=1;t.attrs["PATHWAY-ID"]=new Array(e+1).join(".");const l=this.createLevel(t);r[I]=l,n.push(l)}else{const e=this.createLevel(t);r[I]=e,o[I]=1,n.push(e)}})),this.filterAndSortMediaOptions(n,data,l,c,d)}createLevel(t){const e=new se(t),n=t.supplemental;if(null!=n&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const t=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(t.message),e.supportedResult=qt(t,[])}return e}isAudioSupported(t){return Dt(t,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(t){return Dt(t,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(t,data,e,n,r){var o;let l=[],f=[],m=t;const v=(null==(o=data.stats)?void 0:o.parsing)||{};if((e||n)&&r&&(m=m.filter((({videoCodec:t,videoRange:e,width:n,height:r})=>{return(!!t||!(!n||!r))&&(!!(o=e)&&Jt.indexOf(o)>-1);var o}))),0===m.length)return Promise.resolve().then((()=>{if(this.hls){let t="no level with compatible codecs found in manifest",e=t;data.levels.length&&(e=`one or more CODECS in variant not supported: ${le(data.levels.map((t=>t.attrs.CODECS)).filter(((t,e,n)=>n.indexOf(t)===e)))}`,this.warn(e),t+=` (${e})`);const n=new Error(t);this.hls.trigger(h.ERROR,{type:c.MEDIA_ERROR,details:d.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:data.url,error:n,reason:e})}})),void(v.end=performance.now());data.audioTracks&&(l=data.audioTracks.filter((track=>!track.audioCodec||this.isAudioSupported(track.audioCodec))),vl(l)),data.subtitles&&(f=data.subtitles,vl(f));const y=m.slice(0);m.sort(((a,b)=>{if(a.attrs["HDCP-LEVEL"]!==b.attrs["HDCP-LEVEL"])return(a.attrs["HDCP-LEVEL"]||"")>(b.attrs["HDCP-LEVEL"]||"")?1:-1;if(e&&a.height!==b.height)return a.height-b.height;if(a.frameRate!==b.frameRate)return a.frameRate-b.frameRate;if(a.videoRange!==b.videoRange)return Jt.indexOf(a.videoRange)-Jt.indexOf(b.videoRange);if(a.videoCodec!==b.videoCodec){const t=Mt(a.videoCodec),e=Mt(b.videoCodec);if(t!==e)return e-t}if(a.uri===b.uri&&a.codecSet!==b.codecSet){const t=jt(a.codecSet),e=jt(b.codecSet);if(t!==e)return e-t}return a.averageBitrate!==b.averageBitrate?a.averageBitrate-b.averageBitrate:0}));let E=y[0];if(this.steering&&(m=this.steering.filterParsedLevels(m),m.length!==y.length))for(let i=0;i<y.length;i++)if(y[i].pathwayId===m[0].pathwayId){E=y[i];break}this._levels=m;for(let i=0;i<m.length;i++)if(m[i]===E){var T;this._firstLevel=i;const t=E.bitrate,e=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${m.length} level(s) found, first bitrate: ${t}`),void 0===(null==(T=this.hls.userConfig)?void 0:T.abrEwmaDefaultEstimate)){const n=Math.min(t,this.hls.config.abrEwmaDefaultEstimateMax);n>e&&e===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=n)}break}const k=r&&!n,S=this.hls.config,_=!(!S.audioStreamController||!S.audioTrackController),A={levels:m,audioTracks:l,subtitleTracks:f,sessionData:data.sessionData,sessionKeys:data.sessionKeys,firstLevel:this._firstLevel,stats:data.stats,audio:r,video:n,altAudio:_&&!k&&l.some((t=>!!t.url))};v.end=performance.now(),this.hls.trigger(h.MANIFEST_PARSED,A)}get levels(){return 0===this._levels.length?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(t){const e=this._levels;if(0===e.length)return;if(t<0||t>=e.length){const n=new Error("invalid level idx"),r=t<0;if(this.hls.trigger(h.ERROR,{type:c.OTHER_ERROR,details:d.LEVEL_SWITCH_ERROR,level:t,fatal:r,error:n,reason:n.message}),r)return;t=Math.min(t,e.length-1)}const n=this.currentLevelIndex,r=this.currentLevel,o=r?r.attrs["PATHWAY-ID"]:void 0,l=e[t],f=l.attrs["PATHWAY-ID"];if(this.currentLevelIndex=t,this.currentLevel=l,n===t&&r&&o===f)return;this.log(`Switching to level ${t} (${l.height?l.height+"p ":""}${l.videoRange?l.videoRange+" ":""}${l.codecSet?l.codecSet+" ":""}@${l.bitrate})${f?" with Pathway "+f:""} from level ${n}${o?" with Pathway "+o:""}`);const m={level:t,attrs:l.attrs,details:l.details,bitrate:l.bitrate,averageBitrate:l.averageBitrate,maxBitrate:l.maxBitrate,realBitrate:l.realBitrate,width:l.width,height:l.height,codecSet:l.codecSet,audioCodec:l.audioCodec,videoCodec:l.videoCodec,audioGroups:l.audioGroups,subtitleGroups:l.subtitleGroups,loaded:l.loaded,loadError:l.loadError,fragmentError:l.fragmentError,name:l.name,id:l.id,uri:l.uri,url:l.url,urlId:0,audioGroupIds:l.audioGroupIds,textGroupIds:l.textGroupIds};this.hls.trigger(h.LEVEL_SWITCHING,m);const v=l.details;if(!v||v.live){const t=this.switchParams(l.uri,null==r?void 0:r.details,v);this.loadPlaylist(t)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}get firstLevel(){return this._firstLevel}set firstLevel(t){this._firstLevel=t}get startLevel(){if(void 0===this._startLevel){const t=this.hls.config.startLevel;return void 0!==t?t:this.hls.firstAutoLevel}return this._startLevel}set startLevel(t){this._startLevel=t}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(t){if(this.steering){const e=this.steering.pathways(),n=t.filter((t=>-1!==e.indexOf(t)));if(t.length<1)return void this.warn(`pathwayPriority ${t} should contain at least one pathway from list: ${e}`);this.steering.pathwayPriority=n}}onError(t,data){!data.fatal&&data.context&&data.context.type===m&&data.context.level===this.level&&this.checkRetry(data)}onFragBuffered(t,{frag:e}){if(void 0!==e&&e.type===E){const t=e.elementaryStreams;if(!Object.keys(t).some((e=>!!t[e])))return;const n=this._levels[e.level];null!=n&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(t,data){var e;const{level:n,details:details}=data,r=data.levelInfo;var o;if(!r)return this.warn(`Invalid level index ${n}`),void(null!=(o=data.deliveryDirectives)&&o.skip&&(details.deltaUpdateFailed=!0));if(r===this.currentLevel||data.withoutMultiVariant){0===r.fragmentError&&(r.loadError=0);let t=r.details;t===data.details&&t.advanced&&(t=void 0),this.playlistLoaded(n,data,t)}else null!=(e=data.deliveryDirectives)&&e.skip&&(details.deltaUpdateFailed=!0)}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const n=this.getUrlWithDirectives(t.uri,e),r=this.currentLevelIndex,o=t.attrs["PATHWAY-ID"],details=t.details,l=null==details?void 0:details.age;this.log(`Loading level index ${r}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${o?" Pathway "+o:""}${l&&details.live?" age "+l.toFixed(1)+(details.type?" "+details.type||!1:""):""} ${n}`),this.hls.trigger(h.LEVEL_LOADING,{url:n,level:r,levelInfo:t,pathwayId:t.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}removeLevel(t){var e;if(1===this._levels.length)return;const n=this._levels.filter(((e,n)=>n!==t||(this.steering&&this.steering.removeLevel(e),e===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,e.details&&e.details.fragments.forEach((t=>t.level=-1))),!1)));vi(n),this._levels=n,this.currentLevelIndex>-1&&null!=(e=this.currentLevel)&&e.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const r=n.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&(this._startLevel=Math.min(this._startLevel,r)),this.hls.trigger(h.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(t,{levels:e}){this._levels=e}checkMaxAutoUpdated(){const{autoLevelCapping:t,maxAutoLevel:e,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==e&&(this._maxAutoLevel=e,this.hls.trigger(h.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:t,levels:this.levels,maxAutoLevel:e,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function vl(t){const e={};t.forEach((track=>{const t=track.groupId||"";track.id=e[t]=e[t]||0,e[t]++}))}function yl(){return self.SourceBuffer||self.WebKitSourceBuffer}function bl(){if(!j())return!1;const t=yl();return!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove}class El extends Bi{constructor(t,e,n){super(t,e,n,"stream-controller",E),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const t=this.media,e=t?t.currentTime:null;if(null===e||!r(e))return;if(this.log(`Media seeked to ${e.toFixed(3)}`),!this.getBufferedFrag(e))return;const n=this.getFwdBufferInfoAtPos(t,e,E,0);null!==n&&0!==n.len?this.tick():this.warn(`Main forward buffer length at ${e} on "seeked" event ${n?n.len:"empty"})`)},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(h.MANIFEST_PARSED,this.onManifestParsed,this),t.on(h.LEVEL_LOADING,this.onLevelLoading,this),t.on(h.LEVEL_LOADED,this.onLevelLoaded,this),t.on(h.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(h.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(h.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(h.BUFFER_CREATED,this.onBufferCreated,this),t.on(h.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(h.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(h.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(h.MANIFEST_PARSED,this.onManifestParsed,this),t.off(h.LEVEL_LOADED,this.onLevelLoaded,this),t.off(h.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(h.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(h.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(h.BUFFER_CREATED,this.onBufferCreated,this),t.off(h.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(h.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(h.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(t,e){if(this.levels){const{lastCurrentTime:n,hls:r}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let t=r.startLevel;-1===t&&(r.config.testBandwidth&&this.levels.length>1?(t=0,this.bitrateTest=!0):t=r.firstAutoLevel),r.nextLoadLevel=t,this.level=r.loadLevel,this._hasEnoughToStart=!!e}n>0&&-1===t&&!e&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),t=n),this.state=Ri,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}else this._forceStartLoad=!0,this.state=Ii}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Ui:{const{levels:t,level:e}=this,n=null==t?void 0:t[e],details=null==n?void 0:n.details;if(details&&(!details.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(details))break;this.state=Ri;break}if(this.hls.nextLoadLevel!==this.level){this.state=Ri;break}break}case Di:this.checkRetryDate()}this.state===Ri&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var t;super.onTickEnd(),null!=(t=this.media)&&t.readyState&&!1===this.media.seeking&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:t,levelLastLoaded:e,levels:n,media:r}=this;if(null===e||!r&&!this.primaryPrefetch&&(this.startFragRequested||!t.config.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;const o=this.buffering?t.nextLoadLevel:t.loadLevel;if(null==n||!n[o])return;const l=n[o],c=this.getMainFwdBufferInfo();if(null===c)return;const d=this.getLevelDetails();if(d&&this._streamEnded(c,d)){const data={};return 2===this.altAudio&&(data.type="video"),this.hls.trigger(h.BUFFER_EOS,data),void(this.state=ji)}if(!this.buffering)return;t.loadLevel!==o&&-1===t.manualLevel&&this.log(`Adapting to level ${o} from level ${this.level}`),this.level=t.nextLoadLevel=o;const f=l.details;if(!f||this.state===Ui||this.waitForLive(l))return this.level=o,this.state=Ui,void(this.startFragRequested=!1);const m=c.len,v=this.getMaxBufferLength(l.maxBitrate);if(m>=v)return;this.backtrackFragment&&this.backtrackFragment.start>c.end&&(this.backtrackFragment=null);const y=this.backtrackFragment?this.backtrackFragment.start:c.end;let T=this.getNextFragment(y,f);if(this.couldBacktrack&&!this.fragPrevious&&T&&X(T)&&this.fragmentTracker.getState(T)!==Ve){var k;const t=(null!=(k=this.backtrackFragment)?k:T).sn-f.startSN,e=f.fragments[t-1];e&&T.cc===e.cc&&(T=e,this.fragmentTracker.removeFragment(e))}else this.backtrackFragment&&c.len&&(this.backtrackFragment=null);if(T&&this.isLoopLoading(T,y)){if(!T.gap){const t=this.audioOnly&&!this.altAudio?K:Y,e=(t===Y?this.videoBuffer:this.mediaBuffer)||this.media;e&&this.afterBufferFlushed(e,t,E)}T=this.getNextFragmentLoopLoading(T,f,c,E,v)}T&&(this.exceedsMaxBuffer(c,v,T)||(!T.initSegment||T.initSegment.data||this.bitrateTest||(T=T.initSegment),this.loadFragment(T,l,y)))}loadFragment(t,e,n){const r=this.fragmentTracker.getState(t);r===Ue||r===$e?X(t)?this.bitrateTest?(this.log(`Fragment ${t.sn} of level ${t.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(t,e)):super.loadFragment(t,e,n):this._loadInitSegment(t,e):this.clearTrackerIfNeeded(t)}getBufferedFrag(t){return this.fragmentTracker.getBufferedFrag(t,E)}followingBufferedFrag(t){return t?this.getBufferedFrag(t.end+.5):null}immediateLevelSwitch(){if(this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY),0!==this.altAudio){var t;((null==(t=this.getLevelDetails())?void 0:t.fragmentStart)||0)>this.lastCurrentTime&&super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")}}nextLevelSwitch(){const{levels:t,media:e}=this;if(null!=e&&e.readyState){let n;const r=this.getAppendedFrag(e.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const o=this.getLevelDetails();if(null!=o&&o.live){const t=this.getMainFwdBufferInfo();if(!t||t.len<2*o.targetduration)return}if(!e.paused&&t){const e=t[this.hls.nextLoadLevel],r=this.fragLastKbps;n=r&&this.fragCurrent?this.fragCurrent.duration*e.maxBitrate/(1e3*r)+1:0}else n=0;const l=this.getBufferedFrag(e.currentTime+n);if(l){const t=this.followingBufferedFrag(l);if(t){this.abortCurrentFrag();const e=t.maxStartPTS?t.maxStartPTS:t.start,n=t.duration,r=Math.max(l.end,e+Math.min(Math.max(n-this.config.maxFragLookUpTolerance,n*(this.couldBacktrack?.5:.125)),n*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(r,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const t=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,t&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.state){case Li:case xi:case Di:case Pi:case Mi:this.state=Ri}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(t,e){super.flushMainBuffer(t,e,2===this.altAudio?"video":null)}onMediaAttached(t,data){super.onMediaAttached(t,data);const e=data.media;Ai(e,"playing",this.onMediaPlaying),Ai(e,"seeked",this.onMediaSeeked)}onMediaDetaching(t,data){const{media:e}=this;e&&(Oi(e,"playing",this.onMediaPlaying),Oi(e,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(t,data);!!data.transferMedia||(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(h.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(t,data){let e=!1,n=!1;for(let i=0;i<data.levels.length;i++){const t=data.levels[i].audioCodec;t&&(e=e||-1!==t.indexOf("mp4a.40.2"),n=n||-1!==t.indexOf("mp4a.40.5"))}this.audioCodecSwitch=e&&n&&!function(){var t;const e=yl();return"function"==typeof(null==e||null==(t=e.prototype)?void 0:t.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=data.levels,this.startFragRequested=!1}onLevelLoading(t,data){const{levels:e}=this;if(!e||this.state!==Ri)return;const n=data.levelInfo;(!n.details||n.details.live&&(this.levelLastLoaded!==n||n.details.expired)||this.waitForCdnTuneIn(n.details))&&(this.state=Ui)}onLevelLoaded(t,data){var e;const{levels:n,startFragRequested:r}=this,o=data.level,l=data.details,c=l.totalduration;if(!n)return void this.warn(`Levels were reset while loading level ${o}`);this.log(`Level ${o} loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""}, cc [${l.startCC}, ${l.endCC}] duration:${c}`);const d=data.levelInfo,f=this.fragCurrent;!f||this.state!==xi&&this.state!==Di||f.level!==data.level&&f.loader&&this.abortCurrentFrag();let m=0;if(l.live||null!=(e=d.details)&&e.live){var v;if(this.checkLiveUpdate(l),l.deltaUpdateFailed)return;m=this.alignPlaylists(l,d.details,null==(v=this.levelLastLoaded)?void 0:v.details)}if(d.details=l,this.levelLastLoaded=d,r||this.setStartPosition(l,m),this.hls.trigger(h.LEVEL_UPDATED,{details:l,level:o}),this.state===Ui){if(this.waitForCdnTuneIn(l))return;this.state=Ri}r&&l.live&&this.synchronizeToLiveEdge(l),this.tick()}synchronizeToLiveEdge(t){const{config:e,media:n}=this;if(!n)return;const r=this.hls.liveSyncPosition,o=this.getLoadPosition(),l=t.fragmentStart,c=t.edge,d=o>=l-e.maxFragLookUpTolerance&&o<=c;if(null!==r&&n.duration>r&&(o<r||!d)){const l=void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;if((!d&&n.readyState<4||o<c-l)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),n.readyState))if(this.warn(`Playback: ${o.toFixed(3)} is located too far from the end of live sliding playlist: ${c}, reset currentTime to : ${r.toFixed(3)}`),"buffered"===this.config.liveSyncMode){var h;const t=ln.bufferInfo(n,r,0);if(null==(h=t.buffered)||!h.length)return void(n.currentTime=r);if(t.start<=o)return void(n.currentTime=r);const{nextStart:e}=ln.bufferedInfo(t.buffered,o,0);e&&(n.currentTime=e)}else n.currentTime=r}}_handleFragmentLoadProgress(data){var t;const e=data.frag,{part:n,payload:r}=data,{levels:o}=this;if(!o)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${e.sn} of level ${e.level} will not be buffered`);const l=o[e.level];if(!l)return void this.warn(`Level ${e.level} not found on progress`);const details=l.details;if(!details)return this.warn(`Dropping fragment ${e.sn} of level ${e.level} after level details were reset`),void this.fragmentTracker.removeFragment(e);const c=l.videoCodec,d=details.PTSKnown||!details.live,h=null==(t=e.initSegment)?void 0:t.data,f=this._getAudioCodec(l),m=this.transmuxer=this.transmuxer||new Es(this.hls,E,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),v=n?n.index:-1,y=-1!==v,T=new an(e.level,e.sn,e.stats.chunkCount,r.byteLength,v,y),k=this.initPTS[e.cc];m.push(r,h,f,c,e,n,details.totalduration,d,T,k)}onAudioTrackSwitching(t,data){const e=this.hls,n=0!==this.altAudio;if(ge(data.url,e))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const t=this.fragCurrent;t&&(this.log("Switching to main audio track, cancel main fragment load"),t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(n)return this.altAudio=0,this.fragmentTracker.removeAllFragments(),e.once(h.BUFFER_FLUSHED,(()=>{this.hls&&this.hls.trigger(h.AUDIO_TRACK_SWITCHED,data)})),void e.trigger(h.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});e.trigger(h.AUDIO_TRACK_SWITCHED,data)}}onAudioTrackSwitched(t,data){const e=ge(data.url,this.hls);if(e){const t=this.videoBuffer;t&&this.mediaBuffer!==t&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=t)}this.altAudio=e?2:0,this.tick()}onBufferCreated(t,data){const e=data.tracks;let n,r,o=!1;for(const t in e){const track=e[t];if("main"===track.id){if(r=t,n=track,"video"===t){const n=e[t];n&&(this.videoBuffer=n.buffer)}}else o=!0}o&&n?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=n.buffer):this.mediaBuffer=this.media}onFragBuffered(t,data){const{frag:e,part:n}=data,r=e.type===E;if(r){if(this.fragContextChanged(e))return this.warn(`Fragment ${e.sn}${n?" p: "+n.index:""} of level ${e.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Mi&&(this.state=Ri));const t=n?n.stats:e.stats;this.fragLastKbps=Math.round(8*t.total/(t.buffering.end-t.loading.first)),X(e)&&(this.fragPrevious=e),this.fragBufferedComplete(e,n)}const o=this.media;o&&(!this._hasEnoughToStart&&ln.getBuffered(o).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),r&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(t,data){var e;if(data.fatal)this.state=Fi;else switch(data.details){case d.FRAG_GAP:case d.FRAG_PARSING_ERROR:case d.FRAG_DECRYPT_ERROR:case d.FRAG_LOAD_ERROR:case d.FRAG_LOAD_TIMEOUT:case d.KEY_LOAD_ERROR:case d.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(E,data);break;case d.LEVEL_LOAD_ERROR:case d.LEVEL_LOAD_TIMEOUT:case d.LEVEL_PARSING_ERROR:data.levelRetry||this.state!==Ui||(null==(e=data.context)?void 0:e.type)!==m||(this.state=Ri);break;case d.BUFFER_ADD_CODEC_ERROR:case d.BUFFER_APPEND_ERROR:if("main"!==data.parent)return;this.reduceLengthAndFlushBuffer(data)&&this.resetLoadingState();break;case d.BUFFER_FULL_ERROR:if("main"!==data.parent)return;if(this.reduceLengthAndFlushBuffer(data)){!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}break;case d.INTERNAL_EXCEPTION:this.recoverWorkerError(data)}}onFragLoadEmergencyAborted(){this.state=Ri,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(t,{type:e}){if(e!==K||!this.altAudio){const t=(e===Y?this.videoBuffer:this.mediaBuffer)||this.media;t&&(this.afterBufferFlushed(t,e,E),this.tick())}}onLevelsUpdated(t,data){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,-1===this.level&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=data.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:t}=this;if(!t)return;const e=t.currentTime;let n=this.startPosition;if(n>=0&&e<n){if(t.seeking)return void this.log(`could not seek to ${n}, already seeking at ${e}`);const r=this.timelineOffset;r&&n&&(n+=r);const details=this.getLevelDetails(),o=ln.getBuffered(t),l=o.length?o.start(0):0,c=l-n,d=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<d||this.loadingParts&&c<2*((null==details?void 0:details.partTarget)||0)))&&(this.log(`adjusting start position by ${c} to match buffer start`),n+=c,this.startPosition=n),e<n&&(this.log(`seek to target start position ${n} from current time ${e} buffer start ${l}`),t.currentTime=n)}}_getAudioCodec(t){let e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),e}_loadBitrateTestFrag(t,e){t.bitrateTest=!0,this._doFragLoad(t,e).then((data=>{const{hls:t}=this,n=null==data?void 0:data.frag;if(!n||this.fragContextChanged(n))return;e.fragmentError=0,this.state=Ri,this.startFragRequested=!1,this.bitrateTest=!1;const r=n.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),t.trigger(h.FRAG_LOADED,data),n.bitrateTest=!1})).catch((e=>{this.state!==Ii&&this.state!==Fi&&(this.warn(e),this.resetFragmentLoading(t))}))}_handleTransmuxComplete(t){const e=this.playlistType,{hls:n}=this,{remuxResult:o,chunkMeta:l}=t,c=this.getCurrentContext(l);if(!c)return void this.resetWhenMissingContext(l);const{frag:d,part:f,level:m}=c,{video:video,text:text,id3:v,initSegment:y}=o,{details:details}=m,audio=this.altAudio?void 0:o.audio;if(this.fragContextChanged(d))this.fragmentTracker.removeFragment(d);else{if(this.state=Pi,y){const t=y.tracks;if(t){const r=d.initSegment||d;if(this.unhandledEncryptionError(y,d))return;this._bufferInitSegment(m,t,r,l),n.trigger(h.FRAG_PARSING_INIT_SEGMENT,{frag:r,id:e,tracks:t})}const o=y.initPTS,c=y.timescale,f=this.initPTS[d.cc];if(r(o)&&(!f||f.baseTime!==o||f.timescale!==c)){const t=y.trackId;this.initPTS[d.cc]={baseTime:o,timescale:c,trackId:t},n.trigger(h.INIT_PTS_FOUND,{frag:d,id:e,initPTS:o,timescale:c,trackId:t})}}if(video&&details){audio&&"audiovideo"===video.type&&this.logMuxedErr(d);const t=details.fragments[d.sn-1-details.startSN],e=d.sn===details.startSN,n=!t||d.cc>t.cc;if(!1!==o.independent){const{startPTS:t,endPTS:r,startDTS:o,endDTS:c}=video;if(f)f.elementaryStreams[video.type]={startPTS:t,endPTS:r,startDTS:o,endDTS:c};else if(video.firstKeyFrame&&video.independent&&1===l.id&&!n&&(this.couldBacktrack=!0),video.dropped&&video.independent){const o=this.getMainFwdBufferInfo(),l=(o?o.end:this.getLoadPosition())+this.config.maxBufferHole,h=video.firstKeyFramePTS?video.firstKeyFramePTS:t;if(!e&&l<h-this.config.maxBufferHole&&!n)return void this.backtrack(d);n&&(d.gap=!0),d.setElementaryStreamInfo(video.type,d.start,r,d.start,c,!0)}else e&&t-(details.appliedTimelineOffset||0)>2&&(d.gap=!0);d.setElementaryStreamInfo(video.type,t,r,o,c),this.backtrackFragment&&(this.backtrackFragment=d),this.bufferFragmentData(video,d,f,l,e||n)}else{if(!e&&!n)return void this.backtrack(d);d.gap=!0}}if(audio){const{startPTS:t,endPTS:e,startDTS:n,endDTS:r}=audio;f&&(f.elementaryStreams[K]={startPTS:t,endPTS:e,startDTS:n,endDTS:r}),d.setElementaryStreamInfo(K,t,e,n,r),this.bufferFragmentData(audio,d,f,l)}if(details&&null!=v&&v.samples.length){const t={id:e,frag:d,details:details,samples:v.samples};n.trigger(h.FRAG_PARSING_METADATA,t)}if(details&&text){const t={id:e,frag:d,details:details,samples:text.samples};n.trigger(h.FRAG_PARSING_USERDATA,t)}}}logMuxedErr(t){this.warn(`${X(t)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${t.url}`)}_bufferInitSegment(t,e,n,r){if(this.state!==Pi)return;this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&(delete e.audio,e.audiovideo&&this.logMuxedErr(n));const{audio:audio,video:video,audiovideo:o}=e;if(audio){const n=t.audioCodec;let r=Bt(audio.codec,n);"mp4a"===r&&(r="mp4a.40.5");const o=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){r&&(r=-1!==r.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5");const t=audio.metadata;t&&"channelCount"in t&&1!==(t.channelCount||1)&&-1===o.indexOf("firefox")&&(r="mp4a.40.5")}r&&-1!==r.indexOf("mp4a.40.5")&&-1!==o.indexOf("android")&&"audio/mpeg"!==audio.container&&(r="mp4a.40.2",this.log(`Android: force audio codec to ${r}`)),n&&n!==r&&this.log(`Swapping manifest audio codec "${n}" for "${r}"`),audio.levelCodec=r,audio.id=E,this.log(`Init audio buffer, container:${audio.container}, codecs[selected/level/parsed]=[${r||""}/${n||""}/${audio.codec}]`),delete e.audiovideo}if(video){video.levelCodec=t.videoCodec,video.id=E;const n=video.codec;if(4===(null==n?void 0:n.length))switch(n){case"hvc1":case"hev1":video.codec="hvc1.1.6.L120.90";break;case"av01":video.codec="av01.0.04M.08";break;case"avc1":video.codec="avc1.42e01e"}this.log(`Init video buffer, container:${video.container}, codecs[level/parsed]=[${t.videoCodec||""}/${n}]${video.codec!==n?" parsed-corrected="+video.codec:""}${video.supplemental?" supplemental="+video.supplemental:""}`),delete e.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${t.codecs}/${o.codec}]`),delete e.video,delete e.audio);const l=Object.keys(e);if(l.length){if(this.hls.trigger(h.BUFFER_CODECS,e),!this.hls)return;l.forEach((t=>{const o=e[t].initSegment;null!=o&&o.byteLength&&this.hls.trigger(h.BUFFER_APPENDING,{type:t,data:o,frag:n,part:null,chunkMeta:r,parent:n.type})}))}this.tickImmediate()}getMainFwdBufferInfo(){const t=this.mediaBuffer&&2===this.altAudio?this.mediaBuffer:this.media;return this.getFwdBufferInfo(t,E)}get maxBufferLength(){const{levels:t,level:e}=this,n=null==t?void 0:t[e];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(t){this.couldBacktrack=!0,this.backtrackFragment=t,this.resetTransmuxer(),this.flushBufferGap(t),this.fragmentTracker.removeFragment(t),this.fragPrevious=null,this.nextLoadPosition=t.start,this.state=Ri}checkFragmentChanged(){const video=this.media;let t=null;if(video&&video.readyState>1&&!1===video.seeking){const e=video.currentTime;if(ln.isBuffered(video,e)?t=this.getAppendedFrag(e):ln.isBuffered(video,e+.1)&&(t=this.getAppendedFrag(e+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,n=t.level;e&&t.sn===e.sn&&e.level===n||(this.fragPlaying=t,this.hls.trigger(h.FRAG_CHANGED,{frag:t}),e&&e.level===n||this.hls.trigger(h.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const t=this.nextBufferedFrag;return t?t.level:-1}get currentFrag(){var t;if(this.fragPlaying)return this.fragPlaying;const e=(null==(t=this.media)?void 0:t.currentTime)||this.lastCurrentTime;return r(e)?this.getAppendedFrag(e):null}get currentProgramDateTime(){var t;const e=(null==(t=this.media)?void 0:t.currentTime)||this.lastCurrentTime;if(r(e)){const details=this.getLevelDetails(),t=this.currentFrag||(details?ye(null,details.fragments,e):null);if(t){const n=t.programDateTime;if(null!==n){const r=n+1e3*(e-t.start);return new Date(r)}}}return null}get currentLevel(){const t=this.currentFrag;return t?t.level:-1}get nextBufferedFrag(){const t=this.currentFrag;return t?this.followingBufferedFrag(t):null}get forceStartLoad(){return this._forceStartLoad}}class Tl extends R{constructor(t,e){super("key-loader",e),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=t}abort(t){for(const n in this.keyIdToKeyInfo){const r=this.keyIdToKeyInfo[n].loader;if(r){var e;if(t&&t!==(null==(e=r.context)?void 0:e.frag.type))return;r.abort()}}}detach(){for(const t in this.keyIdToKeyInfo){const e=this.keyIdToKeyInfo[t];(e.mediaKeySessionContext||e.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[t]}}destroy(){this.detach();for(const t in this.keyIdToKeyInfo){const e=this.keyIdToKeyInfo[t].loader;e&&e.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(t,details=d.KEY_LOAD_ERROR,e,n,r){return new rn({type:c.NETWORK_E
2RROR,details:details,fatal:!1,frag:t,response:r,error:e,networkDetails:n})}loadClear(t,e,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(e.length)for(let i=0,r=e.length;i<r;i++){const o=e[i];if(t.cc<=o.cc&&(!X(t)||!X(o)||t.sn<o.sn)||!n&&i==r-1)return this.emeController.selectKeySystemFormat(o).then((t=>{if(!this.emeController)return;o.setKeyFormat(t);const e=Pn(t);return e?this.emeController.getKeySystemAccess([e]):void 0}))}if(this.config.requireKeySystemAccessOnStart){const t=jn(this.config);if(t.length)return this.emeController.getKeySystemAccess(t)}}return null}load(t){return!t.decryptdata&&t.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(t).then((e=>this.loadInternal(t,e))):this.loadInternal(t)}loadInternal(t,e){var n,r;e&&t.setKeyFormat(e);const o=t.decryptdata;if(!o){const n=new Error(e?`Expected frag.decryptdata to be defined after setting format ${e}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(t,d.KEY_LOAD_ERROR,n))}const l=o.uri;if(!l)return Promise.reject(this.createKeyLoadError(t,d.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${l}"`)));const c=kl(o);let h=this.keyIdToKeyInfo[c];if(null!=(n=h)&&n.decryptdata.key)return o.key=h.decryptdata.key,Promise.resolve({frag:t,keyInfo:h});if(this.emeController&&null!=(r=h)&&r.keyLoadPromise){switch(this.emeController.getKeyStatus(h.decryptdata)){case"usable":case"usable-in-future":return h.keyLoadPromise.then((e=>{const{keyInfo:n}=e;return o.key=n.decryptdata.key,{frag:t,keyInfo:n}}))}}switch(this.log(`${this.keyIdToKeyInfo[c]?"Rel":"L"}oading${o.keyId?" keyId: "+U(o.keyId):""} URI: ${o.uri} from ${t.type} ${t.level}`),h=this.keyIdToKeyInfo[c]={decryptdata:o,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},o.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===o.keyFormat?this.loadKeyHTTP(h,t):this.loadKeyEME(h,t);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(h,t);default:return Promise.reject(this.createKeyLoadError(t,d.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${o.method}"`)))}}loadKeyEME(t,e){const n={frag:e,keyInfo:t};if(this.emeController&&this.config.emeEnabled){var r;if(!t.decryptdata.keyId&&null!=(r=e.initSegment)&&r.data){const n=function(t){const e=[];return bt(t,(t=>e.push(t.subarray(8,24)))),e}(e.initSegment.data);if(n.length){let e=n[0];e.some((b=>0!==b))?(this.log(`Using keyId found in init segment ${U(e)}`),$n.setKeyIdForUri(t.decryptdata.uri,e)):(e=$n.addKeyIdForUri(t.decryptdata.uri),this.log(`Generating keyId to patch media ${U(e)}`)),t.decryptdata.keyId=e}}if(!t.decryptdata.keyId&&!X(e))return Promise.resolve(n);const o=this.emeController.loadKey(n);return(t.keyLoadPromise=o.then((e=>(t.mediaKeySessionContext=e,n)))).catch((n=>{throw t.keyLoadPromise=null,"data"in n&&(n.data.frag=e),n}))}return Promise.resolve(n)}loadKeyHTTP(t,e){const n=this.config,r=new(0,n.loader)(n);return e.keyLoader=t.loader=r,t.keyLoadPromise=new Promise(((o,l)=>{const c={keyInfo:t,frag:e,responseType:"arraybuffer",url:t.decryptdata.uri},h=n.keyLoadPolicy.default,f={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},m={onSuccess:(t,e,n,r)=>{const{frag:c,keyInfo:h}=n,f=kl(h.decryptdata);if(!c.decryptdata||h!==this.keyIdToKeyInfo[f])return l(this.createKeyLoadError(c,d.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),r));h.decryptdata.key=c.decryptdata.key=new Uint8Array(t.data),c.keyLoader=null,h.loader=null,o({frag:c,keyInfo:h})},onError:(t,n,r,o)=>{this.resetLoader(n),l(this.createKeyLoadError(e,d.KEY_LOAD_ERROR,new Error(`HTTP Error ${t.code} loading key ${t.text}`),r,I({url:c.url,data:void 0},t)))},onTimeout:(t,n,r)=>{this.resetLoader(n),l(this.createKeyLoadError(e,d.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),r))},onAbort:(t,n,r)=>{this.resetLoader(n),l(this.createKeyLoadError(e,d.INTERNAL_ABORTED,new Error("key loading aborted"),r))}};r.load(c,f,m)}))}
vendor: 23,539 bytes, line 2
2resetLoader(t){const{frag:e,keyInfo:n,url:r}=t,o=n.loader;e.keyLoader===o&&(e.keyLoader=null,n.loader=null);const l=kl(n.decryptdata)||r;delete this.keyIdToKeyInfo[l],o&&o.destroy()}}function kl(t){if(t.keyFormat!==xn){const e=t.keyId;if(e)return U(e)}return t.uri}function Sl(t){const{type:e}=t;switch(e){case v:return T;case y:return k;default:return E}}function _l(t,e){let n=t.url;return void 0!==n&&0!==n.indexOf("data:")||(n=e.url),n}class Al{constructor(t){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=t,this.registerListeners()}startLoad(t){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:t}=this;t.on(h.MANIFEST_LOADING,this.onManifestLoading,this),t.on(h.LEVEL_LOADING,this.onLevelLoading,this),t.on(h.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(h.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.on(h.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:t}=this;t.off(h.MANIFEST_LOADING,this.onManifestLoading,this),t.off(h.LEVEL_LOADING,this.onLevelLoading,this),t.off(h.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(h.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.off(h.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(t){const e=this.hls.config,n=e.pLoader,r=e.loader,o=new(n||r)(e);return this.loaders[t.type]=o,o}getInternalLoader(t){return this.loaders[t.type]}resetInternalLoader(t){this.loaders[t]&&delete this.loaders[t]}destroyInternalLoaders(){for(const t in this.loaders){const e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(t,data){const{url:e}=data;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:f,url:e,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(t,data){const{id:e,level:n,pathwayId:r,url:o,deliveryDirectives:l,levelInfo:c}=data;this.load({id:e,level:n,pathwayId:r,responseType:"text",type:m,url:o,deliveryDirectives:l,levelOrTrack:c})}onAudioTrackLoading(t,data){const{id:e,groupId:n,url:r,deliveryDirectives:o,track:track}=data;this.load({id:e,groupId:n,level:null,responseType:"text",type:v,url:r,deliveryDirectives:o,levelOrTrack:track})}onSubtitleTrackLoading(t,data){const{id:e,groupId:n,url:r,deliveryDirectives:o,track:track}=data;this.load({id:e,groupId:n,level:null,responseType:"text",type:y,url:r,deliveryDirectives:o,levelOrTrack:track})}onLevelsUpdated(t,data){const e=this.loaders[m];if(e){const t=e.context;t&&!data.levels.some((e=>e===t.levelOrTrack))&&(e.abort(),delete this.loaders[m])}}load(t){var e;const n=this.hls.config;let o,l=this.getInternalLoader(t);if(l){const e=this.hls.logger,n=l.context;if(n&&n.levelOrTrack===t.levelOrTrack&&(n.url===t.url||n.deliveryDirectives&&!t.deliveryDirectives))return void(n.url===t.url?e.log(`[playlist-loader]: ignore ${t.url} ongoing request`):e.log(`[playlist-loader]: ignore ${t.url} in favor of ${n.url}`));e.log(`[playlist-loader]: aborting previous loader for type: ${t.type}`),l.abort()}if(o=t.type===f?n.manifestLoadPolicy.default:O({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),l=this.createInternalLoader(t),r(null==(e=t.deliveryDirectives)?void 0:e.part)){let e;if(t.type===m&&null!==t.level?e=this.hls.levels[t.level].details:t.type===v&&null!==t.id?e=this.hls.audioTracks[t.id].details:t.type===y&&null!==t.id&&(e=this.hls.subtitleTracks[t.id].details),e){const t=e.partTarget,n=e.targetduration;if(t&&n){const e=1e3*Math.max(3*t,.8*n);o=O({},o,{maxTimeToFirstByteMs:Math.min(e,o.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(e,o.maxTimeToFirstByteMs)})}}}const c=o.errorRetry||o.timeoutRetry||{},d={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:c.maxNumRetry||0,retryDelay:c.retryDelayMs||0,maxRetryDelay:c.maxRetryDelayMs||0},h={onSuccess:(t,e,n,r)=>{const o=this.getInternalLoader(n);this.resetInternalLoader(n.type);const l=t.data;e.parsing.start=performance.now(),Yn.isMediaPlaylist(l)||n.type!==f?this.handleTrackOrLevelPlaylist(t,e,n,r||null,o):this.handleMasterPlaylist(t,e,n,r)},onError:(t,e,n,r)=>{this.handleNetworkError(e,n,!1,t,r)},onTimeout:(t,e,n)=>{this.handleNetworkError(e,n,!0,void 0,t)}};l.load(t,d,h)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:t,startPosition:e},forceStartLoad:n}=this.hls;(t||n)&&(this.hls.logger.log(`${t?"auto":"force"} startLoad with configured startPosition ${e}`),this.hls.startLoad(e))}handleMasterPlaylist(t,e,n,r){const o=this.hls,l=t.data,c=_l(t,n),d=Yn.parseMasterPlaylist(l,c);if(d.playlistParsingError)return e.parsing.end=performance.now(),void this.handleManifestParsingError(t,n,d.playlistParsingError,r,e);const{contentSteering:f,levels:m,sessionData:v,sessionKeys:y,startTimeOffset:E,variableList:T}=d;this.variableList=T,m.forEach((t=>{const{unknownCodecs:e}=t;if(e){const{preferManagedMediaSource:n}=this.hls.config;let{audioCodec:r,videoCodec:o}=t;for(let i=e.length;i--;){const l=e[i];Dt(l,"audio",n)?(t.audioCodec=r=r?`${r},${l}`:l,Lt.audio[r.substring(0,4)]=2,e.splice(i,1)):Dt(l,"video",n)&&(t.videoCodec=o=o?`${o},${l}`:l,Lt.video[o.substring(0,4)]=2,e.splice(i,1))}}}));const{AUDIO:k=[],SUBTITLES:S,"CLOSED-CAPTIONS":_}=Yn.parseMasterPlaylistMedia(l,c,d);if(k.length){k.some((t=>!t.url))||!m[0].audioCodec||m[0].attrs.AUDIO||(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),k.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new gn({}),bitrate:0,url:""}))}o.trigger(h.MANIFEST_LOADED,{levels:m,audioTracks:k,subtitles:S,captions:_,contentSteering:f,url:c,stats:e,networkDetails:r,sessionData:v,sessionKeys:y,startTimeOffset:E,variableList:T})}handleTrackOrLevelPlaylist(t,e,n,o,l){const c=this.hls,{id:d,level:m,type:v}=n,y=_l(t,n),E=r(m)?m:r(d)?d:0,T=Sl(n),k=Yn.parseLevelPlaylist(t.data,y,E,T,0,this.variableList);if(v===f){const t={attrs:new gn({}),bitrate:0,details:k,name:"",url:y};k.requestScheduled=e.loading.start+fi(k,0),c.trigger(h.MANIFEST_LOADED,{levels:[t],audioTracks:[],url:y,stats:e,networkDetails:o,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}e.parsing.end=performance.now(),n.levelDetails=k,this.handlePlaylistLoaded(k,t,e,n,o,l)}handleManifestParsingError(t,e,n,r,o){this.hls.trigger(h.ERROR,{type:c.NETWORK_ERROR,details:d.MANIFEST_PARSING_ERROR,fatal:e.type===f,url:t.url,err:n,error:n,reason:n.message,response:t,context:e,networkDetails:r,stats:o})}handleNetworkError(t,e,n=!1,r,o){let l=`A network ${n?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${t.type}`;t.type===m?l+=`: ${t.level} id: ${t.id}`:t.type!==v&&t.type!==y||(l+=` id: ${t.id} group-id: "${t.groupId}"`);const E=new Error(l);this.hls.logger.warn(`[playlist-loader]: ${l}`);let details=d.UNKNOWN,T=!1;const k=this.getInternalLoader(t);switch(t.type){case f:details=n?d.MANIFEST_LOAD_TIMEOUT:d.MANIFEST_LOAD_ERROR,T=!0;break;case m:details=n?d.LEVEL_LOAD_TIMEOUT:d.LEVEL_LOAD_ERROR,T=!1;break;case v:details=n?d.AUDIO_TRACK_LOAD_TIMEOUT:d.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case y:details=n?d.SUBTITLE_TRACK_LOAD_TIMEOUT:d.SUBTITLE_LOAD_ERROR,T=!1}k&&this.resetInternalLoader(t.type);const S={type:c.NETWORK_ERROR,details:details,fatal:T,url:t.url,loader:k,context:t,error:E,networkDetails:e,stats:o};if(r){const n=(null==e?void 0:e.url)||t.url;S.response=I({url:n,data:void 0},r)}this.hls.trigger(h.ERROR,S)}handlePlaylistLoaded(t,e,n,r,o,l){const T=this.hls,{type:k,level:S,levelOrTrack:_,id:A,groupId:O,deliveryDirectives:w}=r,I=_l(e,r),R=Sl(r);let L="number"==typeof r.level&&R===E?S:void 0;const x=t.playlistParsingError;if(x){if(this.hls.logger.warn(`${x} ${t.url}`),!T.config.ignorePlaylistParsingErrors)return void T.trigger(h.ERROR,{type:c.NETWORK_ERROR,details:d.LEVEL_PARSING_ERROR,fatal:!1,url:I,error:x,reason:x.message,response:e,context:r,level:L,parent:R,networkDetails:o,stats:n});t.playlistParsingError=null}if(t.fragments.length)switch(t.live&&l&&(l.getCacheAge&&(t.ageHeader=l.getCacheAge()||0),l.getCacheAge&&!isNaN(t.ageHeader)||(t.ageHeader=0)),k){case f:case m:if(L)if(_){if(_!==T.levels[L]){const t=T.levels.indexOf(_);t>-1&&(L=t)}}else L=0;T.trigger(h.LEVEL_LOADED,{details:t,levelInfo:_||T.levels[0],level:L||0,id:A||0,stats:n,networkDetails:o,deliveryDirectives:w,withoutMultiVariant:k===f});break;case v:T.trigger(h.AUDIO_TRACK_LOADED,{details:t,track:_,id:A||0,groupId:O||"",stats:n,networkDetails:o,deliveryDirectives:w});break;case y:T.trigger(h.SUBTITLE_TRACK_LOADED,{details:t,track:_,id:A||0,groupId:O||"",stats:n,networkDetails:o,deliveryDirectives:w})}else{const l=t.playlistParsingError=new Error("No Segments found in Playlist");T.trigger(h.ERROR,{type:c.NETWORK_ERROR,details:d.LEVEL_EMPTY_ERROR,fatal:!1,url:I,error:l,reason:l.message,response:e,context:r,level:L,parent:R,networkDetails:o,stats:n})}}}class Ol{static get version(){return qi}static isMSESupported(){return bl()}static isSupported(){return function(){if(!bl())return!1;const t=j();return"function"==typeof(null==t?void 0:t.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some((e=>t.isTypeSupported(Pt(e,"video"))))||["mp4a.40.2","fLaC"].some((e=>t.isTypeSupported(Pt(e,"audio")))))}()}static getMediaSource(){return j()}static get Events(){return h}static get MetadataSchema(){return yr}static get ErrorTypes(){return c}static get ErrorDetails(){return d}static get DefaultConfig(){return Ol.defaultConfig?Ol.defaultConfig:el}static set DefaultConfig(t){Ol.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Ki,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const e=this.logger=function(t,e,n){const r=D();if("object"==typeof console&&!0===t||"object"==typeof t){const o=["debug","log","info","warn","error"];o.forEach((e=>{r[e]=C(e,t,n)}));try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.16`)}catch(t){return D()}o.forEach((e=>{P[e]=C(e,t)}))}else O(P,r);return r}(t.debug||!1,"Hls instance",t.assetPlayerId),n=this.config=function(t,e,n){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==e.liveMaxLatencyDurationCount&&(void 0===e.liveSyncDurationCount||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(void 0===e.liveSyncDuration||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const r=nl(t),o=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((t=>{const l=`${"level"===t?"playlist":t}LoadPolicy`,c=void 0===e[l],d=[];o.forEach((n=>{const o=`${t}Loading${n}`,h=e[o];if(void 0!==h&&c){d.push(o);const t=r[l].default;switch(e[l]={default:t},n){case"TimeOut":t.maxLoadTimeMs=h,t.maxTimeToFirstByteMs=h;break;case"MaxRetry":t.errorRetry.maxNumRetry=h,t.timeoutRetry.maxNumRetry=h;break;case"RetryDelay":t.errorRetry.retryDelayMs=h,t.timeoutRetry.retryDelayMs=h;break;case"MaxRetryTimeout":t.errorRetry.maxRetryDelayMs=h,t.timeoutRetry.maxRetryDelayMs=h}}})),d.length&&n.warn(`hls.js config: "${d.join('", "')}" setting(s) are deprecated, use "${l}": ${le(e[l])}`)})),I(I({},r),e)}(Ol.DefaultConfig,t,e);this.userConfig=t,n.progressive&&il(n,e);const{abrController:r,bufferController:o,capLevelController:l,errorController:c,fpsController:d}=n,f=new c(this),m=this.abrController=new r(this),v=new Ge(this),y=n.interstitialsController,E=y?this.interstitialsController=new y(this,Ol):null,T=this.bufferController=new o(this,v),k=this.capLevelController=new l(this),S=new d(this),_=new Al(this),A=n.contentSteeringController,w=A?new A(this):null,R=this.levelController=new gl(this,w),L=new pl(this),x=new Tl(this.config,this.logger),M=this.streamController=new El(this,v,x),j=this.gapController=new rl(this,v);k.setStreamController(M),S.setStreamController(M);const F=[_,R,M];E&&F.splice(1,0,E),w&&F.splice(1,0,w),this.networkControllers=F;const N=[m,T,j,k,S,L,v];this.audioTrackController=this.createController(n.audioTrackController,F);const U=n.audioStreamController;U&&F.push(this.audioStreamController=new U(this,v,x)),this.subtitleTrackController=this.createController(n.subtitleTrackController,F);const B=n.subtitleStreamController;B&&F.push(this.subtititleStreamController=new B(this,v,x)),this.createController(n.timelineController,N),x.emeController=this.emeController=this.createController(n.emeController,N),this.cmcdController=this.createController(n.cmcdController,N),this.latencyController=this.createController(ml,N),this.coreComponents=N,F.push(f);const $=f.onErrorOut;"function"==typeof $&&this.on(h.ERROR,$,f),this.on(h.MANIFEST_LOADED,_.onManifestLoaded,_)}createController(t,e){if(t){const n=new t(this);return e&&e.push(n),n}return null}on(t,e,n=this){this._emitter.on(t,e,n)}once(t,e,n=this){this._emitter.once(t,e,n)}removeAllListeners(t){this._emitter.removeAllListeners(t)}off(t,e,n=this,r){this._emitter.off(t,e,n,r)}listeners(t){return this._emitter.listeners(t)}emit(t,e,n){return this._emitter.emit(t,e,n)}trigger(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(e){if(this.logger.error("An internal error happened while handling event "+t+'. Error message: "'+e.message+'". Here is a stacktrace:',e),!this.triggeringException){this.triggeringException=!0;const n=t===h.ERROR;this.trigger(h.ERROR,{type:c.OTHER_ERROR,details:d.INTERNAL_EXCEPTION,fatal:n,event:t,error:e}),this.triggeringException=!1}}return!1}listenerCount(t){return this._emitter.listenerCount(t)}destroy(){this.logger.log("destroy"),this.trigger(h.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach((component=>component.destroy())),this.networkControllers.length=0,this.coreComponents.forEach((component=>component.destroy())),this.coreComponents.length=0;const t=this.config;t.xhrSetup=t.fetchSetup=void 0,this.userConfig=null}attachMedia(data){if(!data||"media"in data&&!data.media){const t=new Error(`attachMedia failed: invalid argument (${data})`);return void this.trigger(h.ERROR,{type:c.OTHER_ERROR,details:d.ATTACH_MEDIA_ERROR,fatal:!0,error:t})}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in data,e=t?data.media:data,n=t?data:{media:e};this._media=e,this.trigger(h.MEDIA_ATTACHING,n)}detachMedia(){this.logger.log("detachMedia"),this.trigger(h.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const t=this.bufferController.transferMedia();return this.trigger(h.MEDIA_DETACHING,{transferMedia:t}),t}loadSource(t){this.stopLoad();const e=this.media,n=this._url,r=this._url=H.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),e&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(e)),this.trigger(h.MANIFEST_LOADING,{url:t})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(t=-1,e){this.logger.log(`startLoad(${t+(e?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let i=0;i<this.networkControllers.length&&(this.networkControllers[i].startLoad(t,e),this.started&&this.networkControllers);i++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let i=0;i<this.networkControllers.length&&(this.networkControllers[i].stopLoad(),!this.started&&this.networkControllers);i++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach((t=>{t.resumeBuffering&&t.resumeBuffering()})))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach((t=>{t.pauseBuffering&&t.pauseBuffering()})))}get inFlightFragments(){const t={[E]:this.streamController.inFlightFrag};return this.audioStreamController&&(t[T]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(t[k]=this.subtititleStreamController.inFlightFrag),t}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const t=this._media,time=null==t?void 0:t.currentTime;this.detachMedia(),t&&(this.attachMedia(t),time&&this.startLoad(time))}removeLevel(t){this.levelController.removeLevel(t)}get sessionId(){let t=this._sessionId;return t||(t=this._sessionId=function(){try{return crypto.randomUUID()}catch(t){try{const t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.slice(e.lastIndexOf("/")+1)}catch(t){let dt=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const e=(dt+16*Math.random())%16|0;return dt=Math.floor(dt/16),("x"==t?e:3&e|8).toString(16)}))}}}()),t}get levels(){const t=this.levelController.levels;return t||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(t){this.logger.log(`set currentLevel:${t}`),this.levelController.manualLevel=t,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(t){this.logger.log(`set nextLevel:${t}`),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(t){this.logger.log(`set loadLevel:${t}`),this.levelController.manualLevel=t}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(t){this.levelController.nextLoadLevel=t}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(t){this.logger.log(`set firstLevel:${t}`),this.levelController.firstLevel=t}get startLevel(){const t=this.levelController.startLevel;return-1===t&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:t}set startLevel(t){this.logger.log(`set startLevel:${t}`),-1!==t&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(t){const e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimate():NaN}set bandwidthEstimate(t){this.abrController.resetEstimator(t)}get abrEwmaDefaultEstimate(){const{bwEstimator:t}=this.abrController;return t?t.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimateTTFB():NaN}set autoLevelCapping(t){this._autoLevelCapping!==t&&(this.logger.log(`set autoLevelCapping:${t}`),this._autoLevelCapping=t,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(t){(function(t){return Zt.indexOf(t)>-1})(t)&&this._maxHdcpLevel!==t&&(this._maxHdcpLevel=t,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:t,config:{minAutoBitrate:e}}=this;if(!t)return 0;const n=t.length;for(let i=0;i<n;i++)if(t[i].maxBitrate>=e)return i;return 0}get maxAutoLevel(){const{levels:t,autoLevelCapping:e,maxHdcpLevel:n}=this;let r;if(r=-1===e&&null!=t&&t.length?t.length-1:e,n)for(let i=r;i--;){const e=t[i].attrs["HDCP-LEVEL"];if(e&&e<=n)return i}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(t){this.abrController.nextAutoLevel=t}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(t){var e;return(null==(e=this.audioTrackController)?void 0:e.setAudioOption(t))||null}setSubtitleOption(t){var e;return(null==(e=this.subtitleTrackController)?void 0:e.setSubtitleOption(t))||null}get allAudioTracks(){const t=this.audioTrackController;return t?t.allAudioTracks:[]}get audioTracks(){const t=this.audioTrackController;return t?t.audioTracks:[]}get audioTrack(){const t=this.audioTrackController;return t?t.audioTrack:-1}set audioTrack(t){const e=this.audioTrackController;e&&(e.audioTrack=t)}get allSubtitleTracks(){const t=this.subtitleTrackController;return t?t.allSubtitleTracks:[]}get subtitleTracks(){const t=this.subtitleTrackController;return t?t.subtitleTracks:[]}get subtitleTrack(){const t=this.subtitleTrackController;return t?t.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(t){const e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}get subtitleDisplay(){const t=this.subtitleTrackController;return!!t&&t.subtitleDisplay}set subtitleDisplay(t){const e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(t){this.config.lowLatencyMode=t}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(t){this.latencyController.targetLatency=t}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(t){this.levelController.pathwayPriority=t}get bufferedToEnd(){var t;return!(null==(t=this.bufferController)||!t.bufferedToEnd)}get interstitialsManager(){var t;return(null==(t=this.interstitialsController)?void 0:t.interstitialsManager)||null}getMediaDecodingInfo(t,e=this.allAudioTracks){return zt(t,ue(e),navigator.mediaCapabilities)}}Ol.defaultConfig=void 0},65:function(t,e,n){"use strict";
vendor: 3,660 bytes, line 2
2t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var content=t(e);return e[2]?"@media ".concat(e[2]," {").concat(content,"}"):content})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(o[l]=!0)}for(var c=0;c<t.length;c++){var d=[].concat(t[c]);r&&o[d[0]]||(n&&(d[2]?d[2]="".concat(n," and ").concat(d[2]):d[2]=n),e.push(d))}},e}},66:function(t,e,n){"use strict";function r(t,e){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],l=o[0],c={id:t+":"+i,css:o[1],media:o[2],sourceMap:o[3]};r[l]?r[l].parts.push(c):n.push(r[l]={id:l,parts:[c]})}return n}n.r(e),n.d(e,"default",(function(){return E}));var o="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!o)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var l={},head=o&&(document.head||document.getElementsByTagName("head")[0]),c=null,d=0,h=!1,f=function(){},m=null,v="data-vue-ssr-id",y="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function E(t,e,n,o){h=n,m=o||{};var c=r(t,e);return T(c),function(e){for(var n=[],i=0;i<c.length;i++){var o=c[i];(d=l[o.id]).refs--,n.push(d)}e?T(c=r(t,e)):c=[];for(i=0;i<n.length;i++){var d;if(0===(d=n[i]).refs){for(var h=0;h<d.parts.length;h++)d.parts[h]();delete l[d.id]}}}}function T(t){for(var i=0;i<t.length;i++){var e=t[i],n=l[e.id];if(n){n.refs++;for(var r=0;r<n.parts.length;r++)n.parts[r](e.parts[r]);for(;r<e.parts.length;r++)n.parts.push(S(e.parts[r]));n.parts.length>e.parts.length&&(n.parts.length=e.parts.length)}else{var o=[];for(r=0;r<e.parts.length;r++)o.push(S(e.parts[r]));l[e.id]={id:e.id,refs:1,parts:o}}}}function k(){var t=document.createElement("style");return t.type="text/css",head.appendChild(t),t}function S(t){var e,n,r=document.querySelector("style["+v+'~="'+t.id+'"]');if(r){if(h)return f;r.parentNode.removeChild(r)}if(y){var o=d++;r=c||(c=k()),e=O.bind(null,r,o,!1),n=O.bind(null,r,o,!0)}else r=k(),e=w.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}var _,A=(_=[],function(t,e){return _[t]=e,_.filter(Boolean).join("\n")});function O(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=A(e,o);else{var l=document.createTextNode(o),c=t.childNodes;c[e]&&t.removeChild(c[e]),c.length?t.insertBefore(l,c[e]):t.appendChild(l)}}function w(t,e){var n=e.css,r=e.media,o=e.sourceMap;if(r&&t.setAttribute("media",r),m.ssrId&&t.setAttribute(v,e.id),o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}},71:function(t,e,n){"use strict";n.d(e,"e",(function(){return l})),n.d(e,"c",(function(){return c})),n.d(e,"a",(function(){return d})),n.d(e,"d",(function(){return h})),n.d(e,"b",(function(){return f}));var r=n(12),o=(n(330),n(50),n(85),n(19),n(73),{SET_INITIAL_DATA:"typo3/SET_INITIAL_DATA",SET_LOCALE_ACTIVE:"typo3/SET_LOCALE_ACTIVE",SET_AVAILABLE_LOCALES:"typo3/SET_AVAILABLE_LOCALES",SET_PAGE_DATA:"typo3/SET_PAGE_DATA",SET_DOMAIN:"typo3/SET_DOMAIN"}),l=Object.fromEntries(Object.entries(o).map((function(t){var e=Object(r.a)(t,2);return[e[0],e[1].replace("typo3/","")]}))),c=o.SET_LOCALE_ACTIVE,d=o.SET_AVAILABLE_LOCALES,h=o.SET_PAGE_DATA,f=o.SET_DOMAIN}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.