var Purs_EntryPoints_Livestream_MiniPromo=(()=>{var wb=Object.create;var Ns=Object.defineProperty;var Cb=Object.getOwnPropertyDescriptor;var xb=Object.getOwnPropertyNames;var Mb=Object.getPrototypeOf,Sb=Object.prototype.hasOwnProperty;var Rh=e=>Ns(e,"__esModule",{value:!0});var Ib=(e,n)=>()=>(e&&(n=e(e=0)),n);var Ha=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),Th=(e,n)=>{Rh(e);for(var r in n)Ns(e,r,{get:n[r],enumerable:!0})},Lb=(e,n,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of xb(n))!Sb.call(e,i)&&i!=="default"&&Ns(e,i,{get:()=>n[i],enumerable:!(r=Cb(n,i))||r.enumerable});return e},Pl=e=>Lb(Rh(Ns(e!=null?wb(Mb(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var im={};Th(im,{Children:()=>dx,Component:()=>px,Fragment:()=>Dx,Suspense:()=>Tx,cloneElement:()=>vx,createContext:()=>mx,createElement:()=>_x,createRef:()=>hx,default:()=>ar,forwardRef:()=>gx,isValidElement:()=>yx,lazy:()=>Rx,useCallback:()=>Ex,useContext:()=>bx,useEffect:()=>om,useImperativeHandle:()=>Fx,useLayoutEffect:()=>wx,useMemo:()=>Cx,useReducer:()=>xx,useRef:()=>Mx,useState:()=>Sx});var ar,dx,vx,px,mx,_x,hx,gx,Dx,yx,Rx,Tx,Ex,bx,om,Fx,wx,Cx,xx,Mx,Sx,ti=Ib(()=>{ar=window.React,{Children:dx,cloneElement:vx,Component:px,createContext:mx,createElement:_x,createRef:hx,forwardRef:gx,Fragment:Dx,isValidElement:yx,lazy:Rx,Suspense:Tx,useCallback:Ex,useContext:bx,useEffect:om,useImperativeHandle:Fx,useLayoutEffect:wx,useMemo:Cx,useReducer:xx,useRef:Mx,useState:Sx}=window.React});var Rm=Ha((Sre,p0)=>{"use strict";var v0=Object.getOwnPropertySymbols,R2=Object.prototype.hasOwnProperty,T2=Object.prototype.propertyIsEnumerable;function E2(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function b2(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var n={},r=0;r<10;r++)n["_"+String.fromCharCode(r)]=r;var i=Object.getOwnPropertyNames(n).map(function(v){return n[v]});if(i.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(v){l[v]=v}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}p0.exports=b2()?Object.assign:function(e,n){for(var r,i=E2(e),l,v=1;v{"use strict";var Tm=Rm(),qu=60103,m0=60106;Ht.Fragment=60107;Ht.StrictMode=60108;Ht.Profiler=60114;var _0=60109,h0=60110,g0=60112;Ht.Suspense=60113;var D0=60115,y0=60116;typeof Symbol=="function"&&Symbol.for&&(Ta=Symbol.for,qu=Ta("react.element"),m0=Ta("react.portal"),Ht.Fragment=Ta("react.fragment"),Ht.StrictMode=Ta("react.strict_mode"),Ht.Profiler=Ta("react.profiler"),_0=Ta("react.provider"),h0=Ta("react.context"),g0=Ta("react.forward_ref"),Ht.Suspense=Ta("react.suspense"),D0=Ta("react.memo"),y0=Ta("react.lazy"));var Ta,R0=typeof Symbol=="function"&&Symbol.iterator;function F2(e){return e===null||typeof e!="object"?null:(e=R0&&e[R0]||e["@@iterator"],typeof e=="function"?e:null)}function bc(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r{"use strict";I0.exports=S0()});var eD=Ha(zu=>{"use strict";var to=Rm(),Wo=xm();function yn(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;rCc;Cc++)ur[Cc]=Cc+1;var ur,Cc;ur[15]=0;var L2=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,U0=Object.prototype.hasOwnProperty,W0={},k0={};function H0(e){return U0.call(k0,e)?!0:U0.call(W0,e)?!1:L2.test(e)?k0[e]=!0:(W0[e]=!0,!1)}function A2(e,n,r,i){if(r!==null&&r.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function P2(e,n,r,i){if(n===null||typeof n=="undefined"||A2(e,n,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function Mr(e,n,r,i,l,v,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=i,this.attributeNamespace=l,this.mustUseProperty=r,this.propertyName=e,this.type=n,this.sanitizeURL=v,this.removeEmptyString=E}var lr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){lr[e]=new Mr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];lr[n]=new Mr(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){lr[e]=new Mr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){lr[e]=new Mr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){lr[e]=new Mr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){lr[e]=new Mr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){lr[e]=new Mr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){lr[e]=new Mr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){lr[e]=new Mr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Om=/[\-:]([a-z])/g;function Um(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(Om,Um);lr[n]=new Mr(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(Om,Um);lr[n]=new Mr(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(Om,Um);lr[n]=new Mr(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){lr[e]=new Mr(e,1,!1,e.toLowerCase(),null,!1,!1)});lr.xlinkHref=new Mr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){lr[e]=new Mr(e,1,!1,e.toLowerCase(),null,!0,!0)});var j2=/["'&<>]/;function Ui(e){if(typeof e=="boolean"||typeof e=="number")return""+e;e=""+e;var n=j2.exec(e);if(n){var r="",i,l=0;for(i=n.index;iKf))throw Error(yn(301));if(e===go)if(Vf=!0,e={action:r,next:null},ai===null&&(ai=new Map),r=ai.get(n),r===void 0)ai.set(n,e);else{for(n=r;n.next!==null;)n=n.next;n.next=e}}function km(){}var ki=null,k2={readContext:function(e){var n=ki.threadID;return wc(e,n),e[n]},useContext:function(e){Wi();var n=ki.threadID;return wc(e,n),e[n]},useMemo:z0,useReducer:J0,useRef:function(e){go=Wi(),cn=Wm();var n=cn.memoizedState;return n===null?(e={current:e},cn.memoizedState=e):n},useState:function(e){return J0(q0,e)},useLayoutEffect:function(){},useCallback:function(e,n){return z0(function(){return e},n)},useImperativeHandle:km,useEffect:km,useDebugValue:km,useDeferredValue:function(e){return Wi(),e},useTransition:function(){return Wi(),[function(e){e()},!1]},useOpaqueIdentifier:function(){return(ki.identifierPrefix||"")+"R:"+(ki.uniqueID++).toString(36)},useMutableSource:function(e,n){return Wi(),n(e._source)}},V0={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function K0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var Y0={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},H2=to({menuitem:!0},Y0),Mc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},B2=["Webkit","ms","Moz","O"];Object.keys(Mc).forEach(function(e){B2.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Mc[n]=Mc[e]})});var G2=/([A-Z])/g,$2=/^ms-/,oi=Wo.Children.toArray,Hm=S2.ReactCurrentDispatcher,q2={listing:!0,pre:!0,textarea:!0},J2=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Q0={},Bm={};function z2(e){if(e==null)return e;var n="";return Wo.Children.forEach(e,function(r){r!=null&&(n+=r)}),n}var V2=Object.prototype.hasOwnProperty,K2={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function X0(e,n){if(e===void 0)throw Error(yn(152,Fc(n)||"Component"))}function Y2(e,n,r){function i(E,d){var h=d.prototype&&d.prototype.isReactComponent,N=I2(d,n,r,h),y=[],b=!1,S={isMounted:function(){return!1},enqueueForceUpdate:function(){if(y===null)return null},enqueueReplaceState:function(Z,ne){b=!0,y=[ne]},enqueueSetState:function(Z,ne){if(y===null)return null;y.push(ne)}};if(h){if(h=new d(E.props,N,S),typeof d.getDerivedStateFromProps=="function"){var C=d.getDerivedStateFromProps.call(null,E.props,h.state);C!=null&&(h.state=to({},h.state,C))}}else if(go={},h=d(E.props,N,S),h=G0(d,E.props,h,N),h==null||h.render==null){e=h,X0(e,d);return}if(h.props=E.props,h.context=N,h.updater=S,S=h.state,S===void 0&&(h.state=S=null),typeof h.UNSAFE_componentWillMount=="function"||typeof h.componentWillMount=="function")if(typeof h.componentWillMount=="function"&&typeof d.getDerivedStateFromProps!="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&typeof d.getDerivedStateFromProps!="function"&&h.UNSAFE_componentWillMount(),y.length){S=y;var M=b;if(y=null,b=!1,M&&S.length===1)h.state=S[0];else{C=M?S[0]:h.state;var O=!0;for(M=M?1:0;M=d))throw Error(yn(304));var h=new Uint16Array(d);for(h.set(E),ur=h,ur[0]=v+1,E=v;E=h.children.length){var N=h.footer;if(N!==""&&(this.previousWasTextNode=!1),this.stack.pop(),h.type==="select")this.currentSelectValue=null;else if(h.type!=null&&h.type.type!=null&&h.type.type.$$typeof===qf)this.popProvider(h.type);else if(h.type===Jf){this.suspenseDepth--;var y=v.pop();if(E){E=!1;var b=h.fallbackFrame;if(!b)throw Error(yn(303));this.stack.push(b),v[this.suspenseDepth]+="";continue}else v[this.suspenseDepth]+=y}v[this.suspenseDepth]+=N}else{var S=h.children[h.childIndex++],C="";try{C+=this.render(S,h.context,h.domNamespace)}catch(M){throw M!=null&&typeof M.then=="function"?Error(yn(294)):M}finally{}v.length<=this.suspenseDepth&&v.push(""),v[this.suspenseDepth]+=C}}return v[0]}finally{Hm.current=l,ki=i,$0()}},n.render=function(r,i,l){if(typeof r=="string"||typeof r=="number")return l=""+r,l===""?"":this.makeStaticMarkup?Ui(l):this.previousWasTextNode?""+Ui(l):(this.previousWasTextNode=!0,Ui(l));if(i=Y2(r,i,this.threadID),r=i.child,i=i.context,r===null||r===!1)return"";if(!Wo.isValidElement(r)){if(r!=null&&r.$$typeof!=null)throw l=r.$$typeof,Error(l===Mm?yn(257):yn(258,l.toString()));return r=oi(r),this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),""}var v=r.type;if(typeof v=="string")return this.renderDOM(r,i,l);switch(v){case N0:case j0:case Sm:case Im:case Pm:case $f:return r=oi(r.props.children),this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),"";case Jf:throw Error(yn(294));case P0:throw Error(yn(343))}if(typeof v=="object"&&v!==null)switch(v.$$typeof){case Am:go={};var E=v.render(r.props,r.ref);return E=G0(v.render,r.props,E,r.ref),E=oi(E),this.stack.push({type:null,domNamespace:l,children:E,childIndex:0,context:i,footer:""}),"";case jm:return r=[Wo.createElement(v.type,to({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),"";case qf:return v=oi(r.props.children),l={type:r,domNamespace:l,children:v,childIndex:0,context:i,footer:""},this.pushProvider(r),this.stack.push(l),"";case Lm:v=r.type,E=r.props;var d=this.threadID;return wc(v,d),v=oi(E.children(v[d])),this.stack.push({type:r,domNamespace:l,children:v,childIndex:0,context:i,footer:""}),"";case A0:throw Error(yn(338));case Nm:return v=r.type,E=v._init,v=E(v._payload),r=[Wo.createElement(v,to({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),""}throw Error(yn(130,v==null?v:typeof v,""))},n.renderDOM=function(r,i,l){var v=r.type.toLowerCase();if(l===V0.html&&K0(v),!Q0.hasOwnProperty(v)){if(!J2.test(v))throw Error(yn(65,v));Q0[v]=!0}var E=r.props;if(v==="input")E=to({type:void 0},E,{defaultChecked:void 0,defaultValue:void 0,value:E.value!=null?E.value:E.defaultValue,checked:E.checked!=null?E.checked:E.defaultChecked});else if(v==="textarea"){var d=E.value;if(d==null){d=E.defaultValue;var h=E.children;if(h!=null){if(d!=null)throw Error(yn(92));if(Array.isArray(h)){if(!(1>=h.length))throw Error(yn(93));h=h[0]}d=""+h}d==null&&(d="")}E=to({},E,{value:void 0,children:""+d})}else if(v==="select")this.currentSelectValue=E.value!=null?E.value:E.defaultValue,E=to({},E,{value:void 0});else if(v==="option"){h=this.currentSelectValue;var N=z2(E.children);if(h!=null){var y=E.value!=null?E.value+"":N;if(d=!1,Array.isArray(h)){for(var b=0;b":(ne+=">",d="");e:{if(h=E.dangerouslySetInnerHTML,h!=null){if(h.__html!=null){h=h.__html;break e}}else if(h=E.children,typeof h=="string"||typeof h=="number"){h=Ui(h);break e}h=null}return h!=null?(E=[],q2.hasOwnProperty(v)&&h.charAt(0)===` `&&(ne+=` `),ne+=h):E=oi(E.children),r=r.type,l=l==null||l==="http://www.w3.org/1999/xhtml"?K0(r):l==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":l,this.stack.push({domNamespace:l,type:v,children:E,childIndex:0,context:i,footer:d}),this.previousWasTextNode=!1,ne},e}();zu.renderToNodeStream=function(){throw Error(yn(207))};zu.renderToStaticMarkup=function(e,n){e=new Z0(e,!0,n);try{return e.read(1/0)}finally{e.destroy()}};zu.renderToStaticNodeStream=function(){throw Error(yn(208))};zu.renderToString=function(e,n){e=new Z0(e,!1,n);try{return e.read(1/0)}finally{e.destroy()}};zu.version="17.0.2"});var nD=Ha((Pre,tD)=>{"use strict";tD.exports=eD()});var HT=Ha((qd,K_)=>{(function(n,r){typeof qd=="object"&&typeof K_=="object"?K_.exports=r():typeof define=="function"&&define.amd?define([],r):typeof qd=="object"?qd.Pusher=r():n.Pusher=r()})(window,function(){return function(e){var n={};function r(i){if(n[i])return n[i].exports;var l=n[i]={i,l:!1,exports:{}};return e[i].call(l.exports,l,l.exports,r),l.l=!0,l.exports}return r.m=e,r.c=n,r.d=function(i,l,v){r.o(i,l)||Object.defineProperty(i,l,{enumerable:!0,get:v})},r.r=function(i){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,l){if(l&1&&(i=r(i)),l&8||l&4&&typeof i=="object"&&i&&i.__esModule)return i;var v=Object.create(null);if(r.r(v),Object.defineProperty(v,"default",{enumerable:!0,value:i}),l&2&&typeof i!="string")for(var E in i)r.d(v,E,function(d){return i[d]}.bind(null,E));return v},r.n=function(i){var l=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(l,"a",l),l},r.o=function(i,l){return Object.prototype.hasOwnProperty.call(i,l)},r.p="",r(r.s=2)}([function(e,n,r){"use strict";var i=this&&this.__extends||function(){var C=function(M,O){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Y){H.__proto__=Y}||function(H,Y){for(var z in Y)Y.hasOwnProperty(z)&&(H[z]=Y[z])},C(M,O)};return function(M,O){C(M,O);function H(){this.constructor=M}M.prototype=O===null?Object.create(O):(H.prototype=O.prototype,new H)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=256,v=function(){function C(M){M===void 0&&(M="="),this._paddingCharacter=M}return C.prototype.encodedLength=function(M){return this._paddingCharacter?(M+2)/3*4|0:(M*8+5)/6|0},C.prototype.encode=function(M){for(var O="",H=0;H>>3*6&63),O+=this._encodeByte(Y>>>2*6&63),O+=this._encodeByte(Y>>>1*6&63),O+=this._encodeByte(Y>>>0*6&63)}var z=M.length-H;if(z>0){var Y=M[H]<<16|(z===2?M[H+1]<<8:0);O+=this._encodeByte(Y>>>3*6&63),O+=this._encodeByte(Y>>>2*6&63),z===2?O+=this._encodeByte(Y>>>1*6&63):O+=this._paddingCharacter||"",O+=this._paddingCharacter||""}return O},C.prototype.maxDecodedLength=function(M){return this._paddingCharacter?M/4*3|0:(M*6+7)/8|0},C.prototype.decodedLength=function(M){return this.maxDecodedLength(M.length-this._getPaddingLength(M))},C.prototype.decode=function(M){if(M.length===0)return new Uint8Array(0);for(var O=this._getPaddingLength(M),H=M.length-O,Y=new Uint8Array(this.maxDecodedLength(H)),z=0,Z=0,ne=0,ee=0,de=0,pe=0,He=0;Z>>4,Y[z++]=de<<4|pe>>>2,Y[z++]=pe<<6|He,ne|=ee&l,ne|=de&l,ne|=pe&l,ne|=He&l;if(Z>>4,ne|=ee&l,ne|=de&l),Z>>2,ne|=pe&l),Z>>8&0-65-26+97,O+=51-M>>>8&26-97-52+48,O+=61-M>>>8&52-48-62+43,O+=62-M>>>8&62-43-63+47,String.fromCharCode(O)},C.prototype._decodeChar=function(M){var O=l;return O+=(42-M&M-44)>>>8&-l+M-43+62,O+=(46-M&M-48)>>>8&-l+M-47+63,O+=(47-M&M-58)>>>8&-l+M-48+52,O+=(64-M&M-91)>>>8&-l+M-65+0,O+=(96-M&M-123)>>>8&-l+M-97+26,O},C.prototype._getPaddingLength=function(M){var O=0;if(this._paddingCharacter){for(var H=M.length-1;H>=0&&M[H]===this._paddingCharacter;H--)O++;if(M.length<4||O>2)throw new Error("Base64Coder: incorrect padding")}return O},C}();n.Coder=v;var E=new v;function d(C){return E.encode(C)}n.encode=d;function h(C){return E.decode(C)}n.decode=h;var N=function(C){i(M,C);function M(){return C!==null&&C.apply(this,arguments)||this}return M.prototype._encodeByte=function(O){var H=O;return H+=65,H+=25-O>>>8&0-65-26+97,H+=51-O>>>8&26-97-52+48,H+=61-O>>>8&52-48-62+45,H+=62-O>>>8&62-45-63+95,String.fromCharCode(H)},M.prototype._decodeChar=function(O){var H=l;return H+=(44-O&O-46)>>>8&-l+O-45+62,H+=(94-O&O-96)>>>8&-l+O-95+63,H+=(47-O&O-58)>>>8&-l+O-48+52,H+=(64-O&O-91)>>>8&-l+O-65+0,H+=(96-O&O-123)>>>8&-l+O-97+26,H},M}(v);n.URLSafeCoder=N;var y=new N;function b(C){return y.encode(C)}n.encodeURLSafe=b;function S(C){return y.decode(C)}n.decodeURLSafe=S,n.encodedLength=function(C){return E.encodedLength(C)},n.maxDecodedLength=function(C){return E.maxDecodedLength(C)},n.decodedLength=function(C){return E.decodedLength(C)}},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i="utf8: invalid string",l="utf8: invalid source encoding";function v(h){for(var N=new Uint8Array(E(h)),y=0,b=0;b>6,N[y++]=128|S&63):S<55296?(N[y++]=224|S>>12,N[y++]=128|S>>6&63,N[y++]=128|S&63):(b++,S=(S&1023)<<10,S|=h.charCodeAt(b)&1023,S+=65536,N[y++]=240|S>>18,N[y++]=128|S>>12&63,N[y++]=128|S>>6&63,N[y++]=128|S&63)}return N}n.encode=v;function E(h){for(var N=0,y=0;y=h.length-1)throw new Error(i);y++,N+=4}else throw new Error(i)}return N}n.encodedLength=E;function d(h){for(var N=[],y=0;y=h.length)throw new Error(l);var C=h[++y];if((C&192)!=128)throw new Error(l);b=(b&31)<<6|C&63,S=128}else if(b<240){if(y>=h.length-1)throw new Error(l);var C=h[++y],M=h[++y];if((C&192)!=128||(M&192)!=128)throw new Error(l);b=(b&15)<<12|(C&63)<<6|M&63,S=2048}else if(b<248){if(y>=h.length-2)throw new Error(l);var C=h[++y],M=h[++y],O=h[++y];if((C&192)!=128||(M&192)!=128||(O&192)!=128)throw new Error(l);b=(b&15)<<18|(C&63)<<12|(M&63)<<6|O&63,S=65536}else throw new Error(l);if(b=55296&&b<=57343)throw new Error(l);if(b>=65536){if(b>1114111)throw new Error(l);b-=65536,N.push(String.fromCharCode(55296|b>>10)),b=56320|b&1023}}N.push(String.fromCharCode(b))}return N.join("")}n.decode=d},function(e,n,r){e.exports=r(3).default},function(e,n,r){"use strict";r.r(n);var i=function(){function f(s,m){this.lastId=0,this.prefix=s,this.name=m}return f.prototype.create=function(s){this.lastId++;var m=this.lastId,F=this.prefix+m,w=this.name+"["+m+"]",B=!1,oe=function(){B||(s.apply(null,arguments),B=!0)};return this[m]=oe,{number:m,id:F,name:w,callback:oe}},f.prototype.remove=function(s){delete this[s.number]},f}(),l=new i("_pusher_script_","Pusher.ScriptReceivers"),v={VERSION:"6.0.3",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},E=v,d=function(){function f(s){this.options=s,this.receivers=s.receivers||l,this.loading={}}return f.prototype.load=function(s,m,F){var w=this;if(w.loading[s]&&w.loading[s].length>0)w.loading[s].push(F);else{w.loading[s]=[F];var B=Tt.createScriptRequest(w.getPath(s,m)),oe=w.receivers.create(function(Re){if(w.receivers.remove(oe),w.loading[s]){var Ye=w.loading[s];delete w.loading[s];for(var Gt=function(Zn){Zn||B.cleanup()},ln=0;ln>>6)+S(128|s&63):S(224|s>>>12&15)+S(128|s>>>6&63)+S(128|s&63)},z=function(f){return f.replace(/[^\x00-\x7F]/g,Y)},Z=function(f){var s=[0,2,1][f.length%3],m=f.charCodeAt(0)<<16|(f.length>1?f.charCodeAt(1):0)<<8|(f.length>2?f.charCodeAt(2):0),F=[C.charAt(m>>>18),C.charAt(m>>>12&63),s>=2?"=":C.charAt(m>>>6&63),s>=1?"=":C.charAt(m&63)];return F.join("")},ne=window.btoa||function(f){return f.replace(/[\s\S]{1,3}/g,Z)},ee=function(){function f(s,m,F,w){var B=this;this.clear=m,this.timer=s(function(){B.timer&&(B.timer=w(B.timer))},F)}return f.prototype.isRunning=function(){return this.timer!==null},f.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},f}(),de=ee,pe=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}();function He(f){window.clearTimeout(f)}function $e(f){window.clearInterval(f)}var Je=function(f){pe(s,f);function s(m,F){return f.call(this,setTimeout,He,m,function(w){return F(),null})||this}return s}(de),en=function(f){pe(s,f);function s(m,F){return f.call(this,setInterval,$e,m,function(w){return F(),w})||this}return s}(de),un={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(f){return new Je(0,f)},method:function(f){for(var s=[],m=1;m0)for(var w=0;w=1002&&f.code<=1004?"backoff":null:f.code===4e3?"tls_only":f.code<4100?"refused":f.code<4200?"backoff":f.code<4300?"retry":"refused"},getCloseError:function(f){return f.code!==1e3&&f.code!==1001?{type:"PusherError",data:{code:f.code,message:f.reason||f.message}}:null}},te=Eo,Na=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),Oa=function(f){Na(s,f);function s(m,F){var w=f.call(this)||this;return w.id=m,w.transport=F,w.activityTimeout=F.activityTimeout,w.bindListeners(),w}return s.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},s.prototype.send=function(m){return this.transport.send(m)},s.prototype.send_event=function(m,F,w){var B={event:m,data:F};return w&&(B.channel=w),Ge.debug("Event sent",B),this.send(te.encodeMessage(B))},s.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},s.prototype.close=function(){this.transport.close()},s.prototype.bindListeners=function(){var m=this,F={message:function(B){var oe;try{oe=te.decodeMessage(B)}catch(Re){m.emit("error",{type:"MessageParseError",error:Re,data:B.data})}if(oe!==void 0){switch(Ge.debug("Event recd",oe),oe.event){case"pusher:error":m.emit("error",{type:"PusherError",data:oe.data});break;case"pusher:ping":m.emit("ping");break;case"pusher:pong":m.emit("pong");break}m.emit("message",oe)}},activity:function(){m.emit("activity")},error:function(B){m.emit("error",{type:"WebSocketError",error:B})},closed:function(B){w(),B&&B.code&&m.handleCloseEvent(B),m.transport=null,m.emit("closed")}},w=function(){Ut(F,function(B,oe){m.transport.unbind(oe,B)})};Ut(F,function(B,oe){m.transport.bind(oe,B)})},s.prototype.handleCloseEvent=function(m){var F=te.getCloseAction(m),w=te.getCloseError(m);w&&this.emit("error",w),F&&this.emit(F,{action:F,error:w})},s}(Ve),bo=Oa,Ua=function(){function f(s,m){this.transport=s,this.callback=m,this.bindListeners()}return f.prototype.close=function(){this.unbindListeners(),this.transport.close()},f.prototype.bindListeners=function(){var s=this;this.onMessage=function(m){s.unbindListeners();var F;try{F=te.processHandshake(m)}catch(w){s.finish("error",{error:w}),s.transport.close();return}F.action==="connected"?s.finish("connected",{connection:new bo(F.id,s.transport),activityTimeout:F.activityTimeout}):(s.finish(F.action,{error:F.error}),s.transport.close())},this.onClosed=function(m){s.unbindListeners();var F=te.getCloseAction(m)||"backoff",w=te.getCloseError(m);s.finish(F,{error:w})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},f.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},f.prototype.finish=function(s,m){this.callback(gt({transport:this.transport,action:s},m))},f}(),Zr=Ua,Dl=function(){function f(s,m){this.channel=s;var F=m.authTransport;if(typeof Tt.getAuthorizers()[F]=="undefined")throw"'"+F+"' is not a recognized auth transport";this.type=F,this.options=m,this.authOptions=m.auth||{}}return f.prototype.composeQuery=function(s){var m="socket_id="+encodeURIComponent(s)+"&channel_name="+encodeURIComponent(this.channel.name);for(var F in this.authOptions.params)m+="&"+encodeURIComponent(F)+"="+encodeURIComponent(this.authOptions.params[F]);return m},f.prototype.authorize=function(s,m){f.authorizers=f.authorizers||Tt.getAuthorizers(),f.authorizers[this.type].call(this,Tt,s,m)},f}(),vi=Dl,nu=function(){function f(s,m){this.timeline=s,this.options=m||{}}return f.prototype.send=function(s,m){this.timeline.isEmpty()||this.timeline.send(Tt.TimelineTransport.getAgent(this,s),m)},f}(),ru=nu,ea=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),Rr=function(f){ea(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),Fo=function(f){ea(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),au=function(f){ea(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),yl=function(f){ea(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),ou=function(f){ea(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),rs=function(f){ea(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),$o=function(f){ea(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),av=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),ov=function(f){av(s,f);function s(m,F){var w=f.call(this,function(B,oe){Ge.debug("No callbacks on "+m+" for "+B)})||this;return w.name=m,w.pusher=F,w.subscribed=!1,w.subscriptionPending=!1,w.subscriptionCancelled=!1,w}return s.prototype.authorize=function(m,F){return F(!1,{auth:""})},s.prototype.trigger=function(m,F){if(m.indexOf("client-")!==0)throw new Rr("Event '"+m+"' does not start with 'client-'");if(!this.subscribed){var w=Dt.buildLogSuffix("triggeringClientEvents");Ge.warn("Client event triggered before channel 'subscription_succeeded' event . "+w)}return this.pusher.send_event(m,F,this.name)},s.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},s.prototype.handleEvent=function(m){var F=m.event,w=m.data;if(F==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(m);else if(F.indexOf("pusher_internal:")!==0){var B={};this.emit(F,w,B)}},s.prototype.handleSubscriptionSucceededEvent=function(m){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",m.data)},s.prototype.subscribe=function(){var m=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(F,w){F?(Ge.error(w),m.emit("pusher:subscription_error",w)):(w=w,m.pusher.send_event("pusher:subscribe",{auth:w.auth,channel_data:w.channel_data,channel:m.name}))}))},s.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},s.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},s.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},s}(Ve),as=ov,iv=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),uv=function(f){iv(s,f);function s(){return f!==null&&f.apply(this,arguments)||this}return s.prototype.authorize=function(m,F){var w=ta.createAuthorizer(this,this.pusher.config);return w.authorize(m,F)},s}(as),Rl=uv,os=function(){function f(){this.reset()}return f.prototype.get=function(s){return Object.prototype.hasOwnProperty.call(this.members,s)?{id:s,info:this.members[s]}:null},f.prototype.each=function(s){var m=this;Ut(this.members,function(F,w){s(m.get(w))})},f.prototype.setMyID=function(s){this.myID=s},f.prototype.onSubscription=function(s){this.members=s.presence.hash,this.count=s.presence.count,this.me=this.get(this.myID)},f.prototype.addMember=function(s){return this.get(s.user_id)===null&&this.count++,this.members[s.user_id]=s.user_info,this.get(s.user_id)},f.prototype.removeMember=function(s){var m=this.get(s.user_id);return m&&(delete this.members[s.user_id],this.count--),m},f.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},f}(),lv=os,cv=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),is=function(f){cv(s,f);function s(m,F){var w=f.call(this,m,F)||this;return w.members=new lv,w}return s.prototype.authorize=function(m,F){var w=this;f.prototype.authorize.call(this,m,function(B,oe){if(!B){if(oe=oe,oe.channel_data===void 0){var Re=Dt.buildLogSuffix("authenticationEndpoint");Ge.error("Invalid auth response for channel '"+w.name+"',"+("expected 'channel_data' field. "+Re)),F("Invalid auth response");return}var Ye=JSON.parse(oe.channel_data);w.members.setMyID(Ye.user_id)}F(B,oe)})},s.prototype.handleEvent=function(m){var F=m.event;if(F.indexOf("pusher_internal:")===0)this.handleInternalEvent(m);else{var w=m.data,B={};m.user_id&&(B.user_id=m.user_id),this.emit(F,w,B)}},s.prototype.handleInternalEvent=function(m){var F=m.event,w=m.data;switch(F){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(m);break;case"pusher_internal:member_added":var B=this.members.addMember(w);this.emit("pusher:member_added",B);break;case"pusher_internal:member_removed":var oe=this.members.removeMember(w);oe&&this.emit("pusher:member_removed",oe);break}},s.prototype.handleSubscriptionSucceededEvent=function(m){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(m.data),this.emit("pusher:subscription_succeeded",this.members))},s.prototype.disconnect=function(){this.members.reset(),f.prototype.disconnect.call(this)},s}(Rl),sv=is,us=r(1),Tl=r(0),fv=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),dv=function(f){fv(s,f);function s(m,F,w){var B=f.call(this,m,F)||this;return B.key=null,B.nacl=w,B}return s.prototype.authorize=function(m,F){var w=this;f.prototype.authorize.call(this,m,function(B,oe){if(B){F(!0,oe);return}var Re=oe.shared_secret;if(!Re){var Ye="No shared_secret key in auth payload for encrypted channel: "+w.name;F(!0,Ye);return}w.key=Object(Tl.decode)(Re),delete oe.shared_secret,F(!1,oe)})},s.prototype.trigger=function(m,F){throw new ou("Client events are not currently supported for encrypted channels")},s.prototype.handleEvent=function(m){var F=m.event,w=m.data;if(F.indexOf("pusher_internal:")===0||F.indexOf("pusher:")===0){f.prototype.handleEvent.call(this,m);return}this.handleEncryptedEvent(F,w)},s.prototype.handleEncryptedEvent=function(m,F){var w=this;if(!this.key){Ge.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!F.ciphertext||!F.nonce){Ge.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+F);return}var B=Object(Tl.decode)(F.ciphertext);if(B.length0&&this.emit("connecting_in",Math.round(m/1e3)),this.retryTimer=new Je(m||0,function(){F.disconnectInternally(),F.connect()})},s.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},s.prototype.setUnavailableTimer=function(){var m=this;this.unavailableTimer=new Je(this.options.unavailableTimeout,function(){m.updateState("unavailable")})},s.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},s.prototype.sendActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Je(this.options.pongTimeout,function(){m.timeline.error({pong_timed_out:m.options.pongTimeout}),m.retryIn(0)})},s.prototype.resetActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Je(this.activityTimeout,function(){m.sendActivityCheck()}))},s.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},s.prototype.buildConnectionCallbacks=function(m){var F=this;return gt({},m,{message:function(w){F.resetActivityCheck(),F.emit("message",w)},ping:function(){F.send_event("pusher:pong",{})},activity:function(){F.resetActivityCheck()},error:function(w){F.emit("error",{type:"WebSocketError",error:w})},closed:function(){F.abandonConnection(),F.shouldRetry()&&F.retryIn(1e3)}})},s.prototype.buildHandshakeCallbacks=function(m){var F=this;return gt({},m,{connected:function(w){F.activityTimeout=Math.min(F.options.activityTimeout,w.activityTimeout,w.connection.activityTimeout||1/0),F.clearUnavailableTimer(),F.setConnection(w.connection),F.socket_id=F.connection.id,F.updateState("connected",{socket_id:F.socket_id})}})},s.prototype.buildErrorCallbacks=function(){var m=this,F=function(w){return function(B){B.error&&m.emit("error",{type:"WebSocketError",error:B.error}),w(B)}};return{tls_only:F(function(){m.usingTLS=!0,m.updateStrategy(),m.retryIn(0)}),refused:F(function(){m.disconnect()}),backoff:F(function(){m.retryIn(1e3)}),retry:F(function(){m.retryIn(0)})}},s.prototype.setConnection=function(m){this.connection=m;for(var F in this.connectionCallbacks)this.connection.bind(F,this.connectionCallbacks[F]);this.resetActivityCheck()},s.prototype.abandonConnection=function(){if(!!this.connection){this.stopActivityCheck();for(var m in this.connectionCallbacks)this.connection.unbind(m,this.connectionCallbacks[m]);var F=this.connection;return this.connection=null,F}},s.prototype.updateState=function(m,F){var w=this.state;if(this.state=m,w!==m){var B=m;B==="connected"&&(B+=" with new socket ID "+F.socket_id),Ge.debug("State changed",w+" -> "+B),this.timeline.info({state:m,params:F}),this.emit("state_change",{previous:w,current:m}),this.emit(m,F)}},s.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},s}(Ve),ls=mv,_v=function(){function f(){this.channels={}}return f.prototype.add=function(s,m){return this.channels[s]||(this.channels[s]=cs(s,m)),this.channels[s]},f.prototype.all=function(){return Jt(this.channels)},f.prototype.find=function(s){return this.channels[s]},f.prototype.remove=function(s){var m=this.channels[s];return delete this.channels[s],m},f.prototype.disconnect=function(){Ut(this.channels,function(s){s.disconnect()})},f}(),hv=_v;function cs(f,s){if(f.indexOf("private-encrypted-")===0){if(s.config.nacl)return ta.createEncryptedChannel(f,s,s.config.nacl);var m="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",F=Dt.buildLogSuffix("encryptedChannelSupport");throw new ou(m+". "+F)}else return f.indexOf("private-")===0?ta.createPrivateChannel(f,s):f.indexOf("presence-")===0?ta.createPresenceChannel(f,s):ta.createChannel(f,s)}var gv={createChannels:function(){return new hv},createConnectionManager:function(f,s){return new ls(f,s)},createChannel:function(f,s){return new as(f,s)},createPrivateChannel:function(f,s){return new Rl(f,s)},createPresenceChannel:function(f,s){return new sv(f,s)},createEncryptedChannel:function(f,s,m){return new vv(f,s,m)},createTimelineSender:function(f,s){return new ru(f,s)},createAuthorizer:function(f,s){return s.authorizer?s.authorizer(f,s):new vi(f,s)},createHandshake:function(f,s){return new Zr(f,s)},createAssistantToTheTransportManager:function(f,s,m){return new uo(f,s,m)}},ta=gv,Dv=function(){function f(s){this.options=s||{},this.livesLeft=this.options.lives||1/0}return f.prototype.getAssistant=function(s){return ta.createAssistantToTheTransportManager(this,s,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},f.prototype.isAlive=function(){return this.livesLeft>0},f.prototype.reportDeath=function(){this.livesLeft-=1},f}(),ss=Dv,yv=function(){function f(s,m){this.strategies=s,this.loop=Boolean(m.loop),this.failFast=Boolean(m.failFast),this.timeout=m.timeout,this.timeoutLimit=m.timeoutLimit}return f.prototype.isSupported=function(){return Pe(this.strategies,ut.method("isSupported"))},f.prototype.connect=function(s,m){var F=this,w=this.strategies,B=0,oe=this.timeout,Re=null,Ye=function(Gt,ln){ln?m(null,ln):(B=B+1,F.loop&&(B=B%w.length),B0&&(B=new Je(F.timeout,function(){oe.abort(),w(!0)})),oe=s.connect(m,function(Re,Ye){Re&&B&&B.isRunning()&&!F.failFast||(B&&B.ensureAborted(),w(Re,Ye))}),{abort:function(){B&&B.ensureAborted(),oe.abort()},forceMinPriority:function(Re){oe.forceMinPriority(Re)}}},f}(),wo=yv,Rv=function(){function f(s){this.strategies=s}return f.prototype.isSupported=function(){return Pe(this.strategies,ut.method("isSupported"))},f.prototype.connect=function(s,m){return Tv(this.strategies,s,function(F,w){return function(B,oe){if(w[F].error=B,B){fs(w)&&m(!0);return}St(w,function(Re){Re.forceMinPriority(oe.transport.priority)}),m(null,oe)}})},f}(),El=Rv;function Tv(f,s,m){var F=ct(f,function(w,B,oe,Re){return w.connect(s,m(B,Re))});return{abort:function(){St(F,bl)},forceMinPriority:function(w){St(F,function(B){B.forceMinPriority(w)})}}}function fs(f){return xe(f,function(s){return Boolean(s.error)})}function bl(f){!f.error&&!f.aborted&&(f.abort(),f.aborted=!0)}var Ev=function(){function f(s,m,F){this.strategy=s,this.transports=m,this.ttl=F.ttl||1800*1e3,this.usingTLS=F.useTLS,this.timeline=F.timeline}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.usingTLS,w=ds(F),B=[this.strategy];if(w&&w.timestamp+this.ttl>=ut.now()){var oe=this.transports[w.transport];oe&&(this.timeline.info({cached:!0,transport:w.transport,latency:w.latency}),B.push(new wo([oe],{timeout:w.latency*2+1e3,failFast:!0})))}var Re=ut.now(),Ye=B.pop().connect(s,function Gt(ln,Zn){ln?(vs(F),B.length>0?(Re=ut.now(),Ye=B.pop().connect(s,Gt)):m(ln)):(Fv(F,Zn.transport.name,ut.now()-Re),m(null,Zn))});return{abort:function(){Ye.abort()},forceMinPriority:function(Gt){s=Gt,Ye&&Ye.forceMinPriority(Gt)}}},f}(),bv=Ev;function Fl(f){return"pusherTransport"+(f?"TLS":"NonTLS")}function ds(f){var s=Tt.getLocalStorage();if(s)try{var m=s[Fl(f)];if(m)return JSON.parse(m)}catch{vs(f)}return null}function Fv(f,s,m){var F=Tt.getLocalStorage();if(F)try{F[Fl(f)]=Ft({timestamp:ut.now(),transport:s,latency:m})}catch{}}function vs(f){var s=Tt.getLocalStorage();if(s)try{delete s[Fl(f)]}catch{}}var wv=function(){function f(s,m){var F=m.delay;this.strategy=s,this.options={delay:F}}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.strategy,w,B=new Je(this.options.delay,function(){w=F.connect(s,m)});return{abort:function(){B.ensureAborted(),w&&w.abort()},forceMinPriority:function(oe){s=oe,w&&w.forceMinPriority(oe)}}},f}(),iu=wv,ps=function(){function f(s,m,F){this.test=s,this.trueBranch=m,this.falseBranch=F}return f.prototype.isSupported=function(){var s=this.test()?this.trueBranch:this.falseBranch;return s.isSupported()},f.prototype.connect=function(s,m){var F=this.test()?this.trueBranch:this.falseBranch;return F.connect(s,m)},f}(),pi=ps,Cv=function(){function f(s){this.strategy=s}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.strategy.connect(s,function(w,B){B&&F.abort(),m(w,B)});return F},f}(),xv=Cv;function Wa(f){return function(){return f.isSupported()}}var ms=function(f,s,m){var F={};function w(Mn,As,Ps,rp,js){var g=m(f,Mn,As,Ps,rp,js);return F[Mn]=g,g}var B=Object.assign({},s,{hostNonTLS:f.wsHost+":"+f.wsPort,hostTLS:f.wsHost+":"+f.wssPort,httpPath:f.wsPath}),oe=Object.assign({},B,{useTLS:!0}),Re=Object.assign({},s,{hostNonTLS:f.httpHost+":"+f.httpPort,hostTLS:f.httpHost+":"+f.httpsPort,httpPath:f.httpPath}),Ye={loop:!0,timeout:15e3,timeoutLimit:6e4},Gt=new ss({lives:2,minPingDelay:1e4,maxPingDelay:f.activityTimeout}),ln=new ss({lives:2,minPingDelay:1e4,maxPingDelay:f.activityTimeout}),Zn=w("ws","ws",3,B,Gt),$r=w("wss","ws",3,oe,Gt),Zv=w("sockjs","sockjs",1,Re),ws=w("xhr_streaming","xhr_streaming",1,Re,ln),Cs=w("xdr_streaming","xdr_streaming",1,Re,ln),xs=w("xhr_polling","xhr_polling",1,Re),ep=w("xdr_polling","xdr_polling",1,Re),Ms=new wo([Zn],Ye),tp=new wo([$r],Ye),np=new wo([Zv],Ye),Ss=new wo([new pi(Wa(ws),ws,Cs)],Ye),Is=new wo([new pi(Wa(xs),xs,ep)],Ye),Ls=new wo([new pi(Wa(Ss),new El([Ss,new iu(Is,{delay:4e3})]),Is)],Ye),Il=new pi(Wa(Ls),Ls,np),Ll;return s.useTLS?Ll=new El([Ms,new iu(Il,{delay:2e3})]):Ll=new El([Ms,new iu(tp,{delay:2e3}),new iu(Il,{delay:5e3})]),new bv(new xv(new pi(Wa(Zn),Ll,Il)),F,{ttl:18e5,timeline:s.timeline,useTLS:s.useTLS})},Mv=ms,Sv=function(){var f=this;f.timeline.info(f.buildTimelineMessage({transport:f.name+(f.options.useTLS?"s":"")})),f.hooks.isInitialized()?f.changeState("initialized"):f.hooks.file?(f.changeState("initializing"),y.load(f.hooks.file,{useTLS:f.options.useTLS},function(s,m){f.hooks.isInitialized()?(f.changeState("initialized"),m(!0)):(s&&f.onError(s),f.onClose(),m(!1))})):f.onClose()},_s={getRequest:function(f){var s=new window.XDomainRequest;return s.ontimeout=function(){f.emit("error",new Fo),f.close()},s.onerror=function(m){f.emit("error",m),f.close()},s.onprogress=function(){s.responseText&&s.responseText.length>0&&f.onChunk(200,s.responseText)},s.onload=function(){s.responseText&&s.responseText.length>0&&f.onChunk(200,s.responseText),f.emit("finished",200),f.close()},s},abortRequest:function(f){f.ontimeout=f.onerror=f.onprogress=f.onload=null,f.abort()}},Iv=_s,hs=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var B in w)w.hasOwnProperty(B)&&(F[B]=w[B])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),Lv=256*1024,gs=function(f){hs(s,f);function s(m,F,w){var B=f.call(this)||this;return B.hooks=m,B.method=F,B.url=w,B}return s.prototype.start=function(m){var F=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){F.close()},Tt.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(m)},s.prototype.close=function(){this.unloader&&(Tt.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},s.prototype.onChunk=function(m,F){for(;;){var w=this.advanceBuffer(F);if(w)this.emit("chunk",{status:m,data:w});else break}this.isBufferTooLong(F)&&this.emit("buffer_too_long")},s.prototype.advanceBuffer=function(m){var F=m.slice(this.position),w=F.indexOf(` `);return w!==-1?(this.position+=w+1,F.slice(0,w)):null},s.prototype.isBufferTooLong=function(m){return this.position===m.length&&m.length>Lv},s}(Ve),Ds=gs,mi;(function(f){f[f.CONNECTING=0]="CONNECTING",f[f.OPEN=1]="OPEN",f[f.CLOSED=3]="CLOSED"})(mi||(mi={}));var na=mi,Av=1,ys=function(){function f(s,m){this.hooks=s,this.session=Ar(1e3)+"/"+ka(8),this.location=Pv(m),this.readyState=na.CONNECTING,this.openStream()}return f.prototype.send=function(s){return this.sendRaw(JSON.stringify([s]))},f.prototype.ping=function(){this.hooks.sendHeartbeat(this)},f.prototype.close=function(s,m){this.onClose(s,m,!0)},f.prototype.sendRaw=function(s){if(this.readyState===na.OPEN)try{return Tt.createSocketRequest("POST",wl(jv(this.location,this.session))).start(s),!0}catch{return!1}else return!1},f.prototype.reconnect=function(){this.closeStream(),this.openStream()},f.prototype.onClose=function(s,m,F){this.closeStream(),this.readyState=na.CLOSED,this.onclose&&this.onclose({code:s,reason:m,wasClean:F})},f.prototype.onChunk=function(s){if(s.status===200){this.readyState===na.OPEN&&this.onActivity();var m,F=s.data.slice(0,1);switch(F){case"o":m=JSON.parse(s.data.slice(1)||"{}"),this.onOpen(m);break;case"a":m=JSON.parse(s.data.slice(1)||"[]");for(var w=0;w0&&f.onChunk(m.status,m.responseText);break;case 4:m.responseText&&m.responseText.length>0&&f.onChunk(m.status,m.responseText),f.emit("finished",m.status),f.close();break}},m},abortRequest:function(f){f.onreadystatechange=null,f.abort()}},Rt=Ts,Co={createStreamingSocket:function(f){return this.createSocket(Uv,f)},createPollingSocket:function(f){return this.createSocket(kv,f)},createSocket:function(f,s){return new Nv(f,s)},createXHR:function(f,s){return this.createRequest(Rt,f,s)},createRequest:function(f,s,m){return new Ds(f,s,m)}},Cl=Co;Cl.createXDR=function(f,s){return this.createRequest(Iv,f,s)};var Hv=Cl,Bv={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:l,DependenciesReceivers:N,getDefaultStrategy:Mv,Transports:Xn,transportConnectionInitializer:Sv,HTTPFactory:Hv,TimelineTransport:V,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(f){var s=this;window.Pusher=f;var m=function(){s.onDocumentBody(f.ready)};window.JSON?m():y.load("json2",{},m)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:U,jsonp:A}},onDocumentBody:function(f){var s=this;document.body?f():setTimeout(function(){s.onDocumentBody(f)},0)},createJSONPRequest:function(f,s){return new W(f,s)},createScriptRequest:function(f){return new x(f)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var f=this.getXHRAPI();return new f},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return Gr},createWebSocket:function(f){var s=this.getWebSocketAPI();return new s(f)},createSocketRequest:function(f,s){if(this.isXHRSupported())return this.HTTPFactory.createXHR(f,s);if(this.isXDRSupported(s.indexOf("https:")===0))return this.HTTPFactory.createXDR(f,s);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var f=this.getXHRAPI();return Boolean(f)&&new f().withCredentials!==void 0},isXDRSupported:function(f){var s=f?"https:":"http:",m=this.getProtocol();return Boolean(window.XDomainRequest)&&m===s},addUnloadListener:function(f){window.addEventListener!==void 0?window.addEventListener("unload",f,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",f)},removeUnloadListener:function(f){window.addEventListener!==void 0?window.removeEventListener("unload",f,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",f)}},Tt=Bv,uu;(function(f){f[f.ERROR=3]="ERROR",f[f.INFO=6]="INFO",f[f.DEBUG=7]="DEBUG"})(uu||(uu={}));var lu=uu,Gv=function(){function f(s,m,F){this.key=s,this.session=m,this.events=[],this.options=F||{},this.sent=0,this.uniqueID=0}return f.prototype.log=function(s,m){s<=this.options.level&&(this.events.push(gt({},m,{timestamp:ut.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},f.prototype.error=function(s){this.log(lu.ERROR,s)},f.prototype.info=function(s){this.log(lu.INFO,s)},f.prototype.debug=function(s){this.log(lu.DEBUG,s)},f.prototype.isEmpty=function(){return this.events.length===0},f.prototype.send=function(s,m){var F=this,w=gt({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],s(w,function(B,oe){B||F.sent++,m&&m(B,oe)}),!0},f.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},f}(),Es=Gv,xl=function(){function f(s,m,F,w){this.name=s,this.priority=m,this.transport=F,this.options=w||{}}return f.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},f.prototype.connect=function(s,m){var F=this;if(this.isSupported()){if(this.priority{typeof window!="undefined"&&function(n,r){typeof Kc=="object"&&typeof Q_=="object"?Q_.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Kc=="object"?Kc.Hls=r():n.Hls=r()}(Kc,function(){return function(e){var n={};function r(i){if(n[i])return n[i].exports;var l=n[i]={i,l:!1,exports:{}};return e[i].call(l.exports,l,l.exports,r),l.l=!0,l.exports}return r.m=e,r.c=n,r.d=function(i,l,v){r.o(i,l)||Object.defineProperty(i,l,{enumerable:!0,get:v})},r.r=function(i){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,l){if(l&1&&(i=r(i)),l&8||l&4&&typeof i=="object"&&i&&i.__esModule)return i;var v=Object.create(null);if(r.r(v),Object.defineProperty(v,"default",{enumerable:!0,value:i}),l&2&&typeof i!="string")for(var E in i)r.d(v,E,function(d){return i[d]}.bind(null,E));return v},r.n=function(i){var l=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(l,"a",l),l},r.o=function(i,l){return Object.prototype.hasOwnProperty.call(i,l)},r.p="/dist/",r(r.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(e,n,r){"use strict";var i=Object.prototype.hasOwnProperty,l="~";function v(){}Object.create&&(v.prototype=Object.create(null),new v().__proto__||(l=!1));function E(y,b,S){this.fn=y,this.context=b,this.once=S||!1}function d(y,b,S,C,M){if(typeof S!="function")throw new TypeError("The listener must be a function");var O=new E(S,C||y,M),H=l?l+b:b;return y._events[H]?y._events[H].fn?y._events[H]=[y._events[H],O]:y._events[H].push(O):(y._events[H]=O,y._eventsCount++),y}function h(y,b){--y._eventsCount==0?y._events=new v:delete y._events[b]}function N(){this._events=new v,this._eventsCount=0}N.prototype.eventNames=function(){var b=[],S,C;if(this._eventsCount===0)return b;for(C in S=this._events)i.call(S,C)&&b.push(l?C.slice(1):C);return Object.getOwnPropertySymbols?b.concat(Object.getOwnPropertySymbols(S)):b},N.prototype.listeners=function(b){var S=l?l+b:b,C=this._events[S];if(!C)return[];if(C.fn)return[C.fn];for(var M=0,O=C.length,H=new Array(O);M0},!1)}function y(b,S){for(var C={main:[S]},M={main:[]},O={main:{}};N(C);)for(var H=Object.keys(C),Y=0;Y>>8^Jt&255^99,Z[Qt]=Jt,ne[Jt]=Qt;var St=Pt[Qt],ct=Pt[St],In=Pt[ct],me=Pt[Jt]*257^Jt*16843008;de[Qt]=me<<24|me>>>8,pe[Qt]=me<<16|me>>>16,He[Qt]=me<<8|me>>>24,$e[Qt]=me,me=In*16843009^ct*65537^St*257^Qt*16843008,en[Jt]=me<<24|me>>>8,un[Jt]=me<<16|me>>>16,ut[Jt]=me<<8|me>>>24,gt[Jt]=me,Qt?(Qt=St^Pt[Pt[Pt[In^St]]],Ut^=Pt[Pt[Ut]]):Qt=Ut=1}},Y.expandKey=function(Z){for(var ne=this.uint8ArrayToUint32Array_(Z),ee=!0,de=0;de>>6)+1,L=($[A+2]&60)>>>2,L>ie.length-1){U.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+L});return}return k=($[A+2]&1)<<2,k|=($[A+3]&192)>>>6,d.logger.log("manifest codec:"+D+",ADTS data:type:"+x+",sampleingIndex:"+L+"["+ie[L]+"Hz],channelConfig:"+k),/firefox/i.test(V)?L>=6?(x=5,Q=new Array(4),W=L-3):(x=2,Q=new Array(2),W=L):V.indexOf("android")!==-1?(x=2,Q=new Array(2),W=L):(x=5,Q=new Array(4),D&&(D.indexOf("mp4a.40.29")!==-1||D.indexOf("mp4a.40.5")!==-1)||!D&&L>=6?W=L-3:((D&&D.indexOf("mp4a.40.2")!==-1&&(L>=6&&k===1||/vivaldi/i.test(V))||!D&&k===1)&&(x=2,Q=new Array(2)),W=L)),Q[0]=x<<3,Q[0]|=(L&14)>>1,Q[1]|=(L&1)<<7,Q[1]|=k<<3,x===5&&(Q[1]|=(W&14)>>1,Q[2]=(W&1)<<7,Q[2]|=2<<2,Q[3]=0),{config:Q,samplerate:ie[L],channelCount:k,codec:"mp4a.40."+x,manifestCodec:re}}function y(U,$){return U[$]===255&&(U[$+1]&246)==240}function b(U,$){return U[$+1]&1?7:9}function S(U,$){return(U[$+3]&3)<<11|U[$+4]<<3|(U[$+5]&224)>>>5}function C(U,$){return!!($+10&&$+L+W<=Q)return k=A+D*x,{headerLength:L,frameLength:W,stamp:k}}function z(U,$,A,D,x){var L=H(U.samplerate),W=Y($,A,D,x,L);if(W){var k=W.stamp,Q=W.headerLength,V=W.frameLength,re={unit:$.subarray(A+Q,A+Q+V),pts:k,dts:k};return U.samples.push(re),{sample:re,length:V+Q}}}var Z=r("./src/demux/id3.js"),ne=function(){function U(A,D,x){this.observer=A,this.config=x,this.remuxer=D}var $=U.prototype;return $.resetInitSegment=function(D,x,L,W){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:x,duration:W,inputTimeScale:9e4}},$.resetTimeStamp=function(){},U.probe=function(D){if(!D)return!1;for(var x=Z.default.getID3Data(D,0)||[],L=x.length,W=D.length;LA.length)){var W=this.parseHeader(A,D);if(W&&D+W.frameLength<=A.length){var k=W.samplesPerFrame*9e4/W.sampleRate,Q=x+L*k,V={unit:A.subarray(D,D+W.frameLength),pts:Q,dts:Q};return $.config=[],$.channelCount=W.channelCount,$.samplerate=W.sampleRate,$.samples.push(V),{sample:V,length:W.frameLength}}}},parseHeader:function($,A){var D=$[A+1]>>3&3,x=$[A+1]>>1&3,L=$[A+2]>>4&15,W=$[A+2]>>2&3,k=$[A+2]>>1&1;if(D!==1&&L!==0&&L!==15&&W!==3){var Q=D===3?3-x:x===3?3:4,V=pe.BitratesMap[Q*14+L-1]*1e3,re=D===3?0:D===2?1:2,ie=pe.SamplingRateMap[re*3+W],ue=$[A+3]>>6==3?1:2,le=pe.SamplesCoefficients[D][x],ge=pe.BytesInSlot[x],Ee=le*8*ge,se=parseInt(le*V/ie+k,10)*ge;return{sampleRate:ie,channelCount:ue,frameLength:se,samplesPerFrame:Ee}}},isHeaderPattern:function($,A){return $[A]===255&&($[A+1]&224)==224&&($[A+1]&6)!=0},isHeader:function($,A){return!!(A+1<$.length&&this.isHeaderPattern($,A))},probe:function($,A){if(A+1<$.length&&this.isHeaderPattern($,A)){var D=4,x=this.parseHeader($,A),L=D;x&&x.frameLength&&(L=x.frameLength);var W=A+L;if(W===$.length||W+1<$.length&&this.isHeaderPattern($,W))return!0}return!1}},He=pe,$e=function(){function U(A){this.data=A,this.bytesAvailable=A.byteLength,this.word=0,this.bitsAvailable=0}var $=U.prototype;return $.loadWord=function(){var D=this.data,x=this.bytesAvailable,L=D.byteLength-x,W=new Uint8Array(4),k=Math.min(4,x);if(k===0)throw new Error("no bytes available");W.set(D.subarray(L,L+k)),this.word=new DataView(W.buffer).getUint32(0),this.bitsAvailable=k*8,this.bytesAvailable-=k},$.skipBits=function(D){var x;this.bitsAvailable>D?(this.word<<=D,this.bitsAvailable-=D):(D-=this.bitsAvailable,x=D>>3,D-=x>>3,this.bytesAvailable-=x,this.loadWord(),this.word<<=D,this.bitsAvailable-=D)},$.readBits=function(D){var x=Math.min(this.bitsAvailable,D),L=this.word>>>32-x;return D>32&&d.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=x,this.bitsAvailable>0?this.word<<=x:this.bytesAvailable>0&&this.loadWord(),x=D-x,x>0&&this.bitsAvailable?L<>>D)!=0)return this.word<<=D,this.bitsAvailable-=D,D;return this.loadWord(),D+this.skipLZ()},$.skipUEG=function(){this.skipBits(1+this.skipLZ())},$.skipEG=function(){this.skipBits(1+this.skipLZ())},$.readUEG=function(){var D=this.skipLZ();return this.readBits(D+1)-1},$.readEG=function(){var D=this.readUEG();return 1&D?1+D>>>1:-1*(D>>>1)},$.readBoolean=function(){return this.readBits(1)===1},$.readUByte=function(){return this.readBits(8)},$.readUShort=function(){return this.readBits(16)},$.readUInt=function(){return this.readBits(32)},$.skipScalingList=function(D){var x=8,L=8,W,k;for(W=0;W=D.length){L();return}if(!(D[x].unit.length<32)){var W=this.decrypter.isSync();if(this.decryptAacSample(D,x,L,W),!W)return}}},$.getAvcEncryptedData=function(D){for(var x=Math.floor((D.length-48)/160)*16+16,L=new Int8Array(x),W=0,k=32;k<=D.length-16;k+=160,W+=16)L.set(D.subarray(k,k+16),W);return L},$.getAvcDecryptedUnit=function(D,x){x=new Uint8Array(x);for(var L=0,W=32;W<=D.length-16;W+=160,L+=16)D.set(x.subarray(L,L+16),W);return D},$.decryptAvcSample=function(D,x,L,W,k,Q){var V=this.discardEPB(k.data),re=this.getAvcEncryptedData(V),ie=this;this.decryptBuffer(re.buffer,function(ue){k.data=ie.getAvcDecryptedUnit(V,ue),Q||ie.decryptAvcSamples(D,x,L+1,W)})},$.decryptAvcSamples=function(D,x,L,W){for(;;x++,L=0){if(x>=D.length){W();return}for(var k=D[x].units;!(L>=k.length);L++){var Q=k[L];if(!(Q.length<=48||Q.type!==1&&Q.type!==5)){var V=this.decrypter.isSync();if(this.decryptAvcSample(D,x,L,W,Q,V),!V)return}}}},U}(),un=en,ut={video:1,audio:2,id3:3,text:4},gt=function(){function U(A,D,x,L){this.observer=A,this.config=x,this.typeSupported=L,this.remuxer=D,this.sampleAes=null}var $=U.prototype;return $.setDecryptData=function(D){D!=null&&D.key!=null&&D.method==="SAMPLE-AES"?this.sampleAes=new un(this.observer,this.config,D,this.discardEPB):this.sampleAes=null},U.probe=function(D){var x=U._syncOffset(D);return x<0?!1:(x&&d.logger.warn("MPEG2-TS detected but first sync word found @ offset "+x+", junk ahead ?"),!0)},U._syncOffset=function(D){for(var x=Math.min(1e3,D.length-3*188),L=0;L>4,ie>1){if(ue=k+5+D[k+4],ue===k+188)continue}else ue=k+4;switch(re){case Ve:V&&(Wt&&(le=fn(Wt))&&Cn(le,!1),Wt={data:[],size:0}),Wt&&(Wt.data.push(D.subarray(ue,k+188)),Wt.size+=k+188-ue);break;case xt:V&&(pt&&(le=fn(pt))&&(we.isAAC?zn(le):En(le)),pt={data:[],size:0}),pt&&(pt.data.push(D.subarray(ue,k+188)),pt.size+=k+188-ue);break;case Xt:V&&(nn&&(le=fn(nn))&&sr(le),nn={data:[],size:0}),nn&&(nn.data.push(D.subarray(ue,k+188)),nn.size+=k+188-ue);break;case 0:V&&(ue+=D[ue]+1),rt=this._pmtId=yt(D,ue);break;case rt:V&&(ue+=D[ue]+1);var sn=zt(D,ue,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,this.sampleAes!=null);Ve=sn.avc,Ve>0&&(se.pid=Ve),xt=sn.audio,xt>0&&(we.pid=xt,we.isAAC=sn.isAAC),Xt=sn.id3,Xt>0&&(Oe.pid=Xt),ge&&!Ee&&(d.logger.log("reparse from beginning"),ge=!1,k=xn-188),Ee=this.pmtParsed=!0;break;case 17:case 8191:break;default:ge=!0;break}}else this.observer.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});Wt&&(le=fn(Wt))?(Cn(le,!0),se.pesData=null):se.pesData=Wt,pt&&(le=fn(pt))?(we.isAAC?zn(le):En(le),we.pesData=null):(pt&&pt.size&&d.logger.log("last AAC PES packet truncated,might overlap between fragments"),we.pesData=pt),nn&&(le=fn(nn))?(sr(le),Oe.pesData=null):Oe.pesData=nn,this.sampleAes==null?this.remuxer.remux(we,se,Oe,this._txtTrack,x,L,W):this.decryptAndRemux(we,se,Oe,this._txtTrack,x,L,W)},$.decryptAndRemux=function(D,x,L,W,k,Q,V){if(D.samples&&D.isAAC){var re=this;this.sampleAes.decryptAacSamples(D.samples,0,function(){re.decryptAndRemuxAvc(D,x,L,W,k,Q,V)})}else this.decryptAndRemuxAvc(D,x,L,W,k,Q,V)},$.decryptAndRemuxAvc=function(D,x,L,W,k,Q,V){if(x.samples){var re=this;this.sampleAes.decryptAvcSamples(x.samples,0,0,function(){re.remuxer.remux(D,x,L,W,k,Q,V)})}else this.remuxer.remux(D,x,L,W,k,Q,V)},$.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},$._parsePAT=function(D,x){return(D[x+10]&31)<<8|D[x+11]},$._parsePMT=function(D,x,L,W){var k,Q,V,re,ie={audio:-1,avc:-1,id3:-1,isAAC:!0};for(k=(D[x+1]&15)<<8|D[x+2],Q=x+3+k-4,V=(D[x+10]&15)<<8|D[x+11],x+=12+V;x1;){var Ee=new Uint8Array(ge[0].length+ge[1].length);Ee.set(ge[0]),Ee.set(ge[1],ge[0].length),ge[0]=Ee,ge.splice(1,1)}if(L=ge[0],k=(L[0]<<16)+(L[1]<<8)+L[2],k===1){if(Q=(L[4]<<8)+L[5],Q&&Q>D.size-6||(W=L[7],W&192&&(ie=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,ie>4294967295&&(ie-=8589934592),W&64?(ue=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,ue>4294967295&&(ue-=8589934592),ie-ue>60*9e4&&(d.logger.warn(Math.round((ie-ue)/9e4)+"s delta between PTS and DTS, align them"),ie=ue)):ue=ie),V=L[8],le=V+9,D.size<=le))return null;D.size-=le,re=new Uint8Array(D.size);for(var se=0,we=ge.length;seOe){le-=Oe;continue}else L=L.subarray(le),Oe-=le,le=0;re.set(L,x),x+=Oe}return Q&&(Q-=V+3),{data:re,pts:ie,dts:ue,len:Q}}else return null},$.pushAccesUnit=function(D,x){if(D.units.length&&D.frame){var L=x.samples,W=L.length;if(isNaN(D.pts))if(W){var k=L[W-1];D.pts=k.pts,D.dts=k.dts}else{x.dropped++;return}!this.config.forceKeyFrameOnDiscontinuity||D.key===!0||x.sps&&(W||this.contiguous)?(D.id=W,L.push(D)):x.dropped++}D.debug.length&&d.logger.log(D.pts+"/"+D.dts+":"+D.debug)},$._parseAVCPES=function(D,x){var L=this,W=this._avcTrack,k=this._parseAVCNALu(D.data),Q=!1,V,re=this.avcSample,ie,ue=!1,le,ge=this.pushAccesUnit.bind(this),Ee=function(we,Oe,Ve,xt){return{key:we,pts:Oe,dts:Ve,units:[],debug:xt}};D.data=null,re&&k.length&&!W.audFound&&(ge(re,W),re=this.avcSample=Ee(!1,D.pts,D.dts,"")),k.forEach(function(se){switch(se.type){case 1:ie=!0,re||(re=L.avcSample=Ee(!0,D.pts,D.dts,"")),Q&&(re.debug+="NDR "),re.frame=!0;var we=se.data;if(ue&&we.length>4){var Oe=new Je(we).readSliceType();(Oe===2||Oe===4||Oe===7||Oe===9)&&(re.key=!0)}break;case 5:ie=!0,re||(re=L.avcSample=Ee(!0,D.pts,D.dts,"")),Q&&(re.debug+="IDR "),re.key=!0,re.frame=!0;break;case 6:ie=!0,Q&&re&&(re.debug+="SEI "),V=new Je(L.discardEPB(se.data)),V.readUByte();for(var Ve=0,xt=0,Xt=!1,rt=0;!Xt&&V.bytesAvailable>1;){Ve=0;do rt=V.readUByte(),Ve+=rt;while(rt===255);xt=0;do rt=V.readUByte(),xt+=rt;while(rt===255);if(Ve===4&&V.bytesAvailable!==0){Xt=!0;var Wt=V.readUByte();if(Wt===181){var pt=V.readUShort();if(pt===49){var nn=V.readUInt();if(nn===1195456820){var yt=V.readUByte();if(yt===3){var zt=V.readUByte(),fn=V.readUByte(),Cn=31&zt,zn=[zt,fn];for(le=0;le16){var En=[];for(le=0;le<16;le++)En.push(V.readUByte().toString(16)),(le===3||le===5||le===7||le===9)&&En.push("-");var sr=xt-16,xn=new Uint8Array(sr);for(le=0;le0){if(x.pts>=D[L-1].pts)D.push(x);else for(var W=L-1;W>=0;W--)if(x.pts=0)ue={data:D.subarray(ge,x-V-1),type:Ee},ie.push(ue);else{var se=this._getLastNalUnit();if(se&&(re&&x<=4-re&&se.state&&(se.data=se.data.subarray(0,se.data.byteLength-re)),k=x-V-1,k>0)){var we=new Uint8Array(se.data.byteLength+k);we.set(se.data,0),we.set(D.subarray(0,k),se.data.byteLength),se.data=we}}x=0&&V>=0&&(ue={data:D.subarray(ge,L),type:Ee,state:V},ie.push(ue)),ie.length===0){var Oe=this._getLastNalUnit();if(Oe){var Ve=new Uint8Array(Oe.data.byteLength+D.byteLength);Ve.set(Oe.data,0),Ve.set(D,Oe.data.byteLength),Oe.data=Ve}}return Q.naluState=V,ie},$.discardEPB=function(D){for(var x=D.byteLength,L=[],W=1,k,Q;W1&&(d.logger.log("AAC: align PTS for overlapping frames by "+Math.round((Oe-W)/90)),W=Oe)}for(;ue>24&255,k[1]=x>>16&255,k[2]=x>>8&255,k[3]=x&255,k.set(A,4),L=0,x=8;L>24&255,A>>16&255,A>>8&255,A&255,x>>24,x>>16&255,x>>8&255,x&255,L>>24,L>>16&255,L>>8&255,L&255,85,196,0,0]))},U.mdia=function(A){return U.box(U.types.mdia,U.mdhd(A.timescale,A.duration),U.hdlr(A.type),U.minf(A))},U.mfhd=function(A){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255]))},U.minf=function(A){return A.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(A)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(A))},U.moof=function(A,D,x){return U.box(U.types.moof,U.mfhd(A),U.traf(x,D))},U.moov=function(A){for(var D=A.length,x=[];D--;)x[D]=U.trak(A[D]);return U.box.apply(null,[U.types.moov,U.mvhd(A[0].timescale,A[0].duration)].concat(x).concat(U.mvex(A)))},U.mvex=function(A){for(var D=A.length,x=[];D--;)x[D]=U.trex(A[D]);return U.box.apply(null,[U.types.mvex].concat(x))},U.mvhd=function(A,D){D*=A;var x=Math.floor(D/(St+1)),L=Math.floor(D%(St+1)),W=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,A>>24&255,A>>16&255,A>>8&255,A&255,x>>24,x>>16&255,x>>8&255,x&255,L>>24,L>>16&255,L>>8&255,L&255,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 U.box(U.types.mvhd,W)},U.sdtp=function(A){var D=A.samples||[],x=new Uint8Array(4+D.length),L,W;for(W=0;W>>8&255),D.push(k&255),D=D.concat(Array.prototype.slice.call(W));for(L=0;L>>8&255),x.push(k&255),x=x.concat(Array.prototype.slice.call(W));var Q=U.box(U.types.avcC,new Uint8Array([1,D[3],D[4],D[5],252|3,224|A.sps.length].concat(D).concat([A.pps.length]).concat(x))),V=A.width,re=A.height,ie=A.pixelRatio[0],ue=A.pixelRatio[1];return U.box(U.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,V>>8&255,V&255,re>>8&255,re&255,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]),Q,U.box(U.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),U.box(U.types.pasp,new Uint8Array([ie>>24,ie>>16&255,ie>>8&255,ie&255,ue>>24,ue>>16&255,ue>>8&255,ue&255])))},U.esds=function(A){var D=A.config.length;return new Uint8Array([0,0,0,0,3,23+D,0,1,0,4,15+D,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([D]).concat(A.config).concat([6,1,2]))},U.mp4a=function(A){var D=A.samplerate;return U.box(U.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,A.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]),U.box(U.types.esds,U.esds(A)))},U.mp3=function(A){var D=A.samplerate;return U.box(U.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,A.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]))},U.stsd=function(A){return A.type==="audio"?!A.isAAC&&A.codec==="mp3"?U.box(U.types.stsd,U.STSD,U.mp3(A)):U.box(U.types.stsd,U.STSD,U.mp4a(A)):U.box(U.types.stsd,U.STSD,U.avc1(A))},U.tkhd=function(A){var D=A.id,x=A.duration*A.timescale,L=A.width,W=A.height,k=Math.floor(x/(St+1)),Q=Math.floor(x%(St+1));return U.box(U.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,D>>24&255,D>>16&255,D>>8&255,D&255,0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,Q>>24,Q>>16&255,Q>>8&255,Q&255,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,L>>8&255,L&255,0,0,W>>8&255,W&255,0,0]))},U.traf=function(A,D){var x=U.sdtp(A),L=A.id,W=Math.floor(D/(St+1)),k=Math.floor(D%(St+1));return U.box(U.types.traf,U.box(U.types.tfhd,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255])),U.box(U.types.tfdt,new Uint8Array([1,0,0,0,W>>24,W>>16&255,W>>8&255,W&255,k>>24,k>>16&255,k>>8&255,k&255])),U.trun(A,x.length+16+20+8+16+8+8),x)},U.trak=function(A){return A.duration=A.duration||4294967295,U.box(U.types.trak,U.tkhd(A),U.mdia(A))},U.trex=function(A){var D=A.id;return U.box(U.types.trex,new Uint8Array([0,0,0,0,D>>24,D>>16&255,D>>8&255,D&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},U.trun=function(A,D){var x=A.samples||[],L=x.length,W=12+16*L,k=new Uint8Array(W),Q,V,re,ie,ue,le;for(D+=8+W,k.set([0,0,15,1,L>>>24&255,L>>>16&255,L>>>8&255,L&255,D>>>24&255,D>>>16&255,D>>>8&255,D&255],0),Q=0;Q>>24&255,re>>>16&255,re>>>8&255,re&255,ie>>>24&255,ie>>>16&255,ie>>>8&255,ie&255,ue.isLeading<<2|ue.dependsOn,ue.isDependedOn<<6|ue.hasRedundancy<<4|ue.paddingValue<<1|ue.isNonSync,ue.degradPrio&240<<8,ue.degradPrio&15,le>>>24&255,le>>>16&255,le>>>8&255,le&255],12+16*Q);return U.box(U.types.trun,k)},U.initSegment=function(A){U.types||U.init();var D=U.moov(A),x;return x=new Uint8Array(U.FTYP.byteLength+D.byteLength),x.set(U.FTYP),x.set(D,U.FTYP.byteLength),x},U}(),In=ct,me=9e4;function st(U,$,A,D){return A===void 0&&(A=1),D===void 0&&(D=!1),It(U,$,1/A)}function It(U,$,A,D){A===void 0&&(A=1),D===void 0&&(D=!1);var x=U*$*A;return D?Math.round(x):x}function Pe(U,$){return $===void 0&&($=!1),It(U,1e3,1/me,$)}function xe(U,$){return $===void 0&&($=1),It(U,me,1/$)}var _e=xe(10),nt=xe(.2),Qe=function(){function U(A,D,x,L){this.observer=A,this.config=D,this.typeSupported=x;var W=navigator.userAgent;this.isSafari=L&&L.indexOf("Apple")>-1&&W&&!W.match("CriOS"),this.ISGenerated=!1}var $=U.prototype;return $.destroy=function(){},$.resetTimeStamp=function(D){this._initPTS=this._initDTS=D},$.resetInitSegment=function(){this.ISGenerated=!1},$.remux=function(D,x,L,W,k,Q,V){if(this.ISGenerated||this.generateIS(D,x,k),this.ISGenerated){var re=D.samples.length,ie=x.samples.length,ue=k,le=k;if(re&&ie){var ge=(D.samples[0].pts-x.samples[0].pts)/x.inputTimeScale;ue+=Math.max(0,ge),le+=Math.max(0,-ge)}if(re){D.timescale||(d.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(D,x,k));var Ee=this.remuxAudio(D,ue,Q,V);if(ie){var se;Ee&&(se=Ee.endPTS-Ee.startPTS),x.timescale||(d.logger.warn("regenerate InitSegment as video detected"),this.generateIS(D,x,k)),this.remuxVideo(x,le,Q,se,V)}}else if(ie){var we=this.remuxVideo(x,le,Q,0,V);we&&D.codec&&this.remuxEmptyAudio(D,ue,Q,we)}}L.samples.length&&this.remuxID3(L,k),W.samples.length&&this.remuxText(W,k),this.observer.trigger(i.default.FRAG_PARSED)},$.generateIS=function(D,x,L){var W=this.observer,k=D.samples,Q=x.samples,V=this.typeSupported,re="audio/mp4",ie={},ue={tracks:ie},le=this._initPTS===void 0,ge,Ee;if(le&&(ge=Ee=1/0),D.config&&k.length&&(D.timescale=D.samplerate,d.logger.log("audio sampling rate : "+D.samplerate),D.isAAC||(V.mpeg?(re="audio/mpeg",D.codec=""):V.mp3&&(D.codec="mp3")),ie.audio={container:re,codec:D.codec,initSegment:!D.isAAC&&V.mpeg?new Uint8Array:In.initSegment([D]),metadata:{channelCount:D.channelCount}},le&&(ge=Ee=k[0].pts-D.inputTimeScale*L)),x.sps&&x.pps&&Q.length){var se=x.inputTimeScale;x.timescale=se,ie.video={container:"video/mp4",codec:x.codec,initSegment:In.initSegment([x]),metadata:{width:x.width,height:x.height}},le&&(ge=Math.min(ge,Q[0].pts-se*L),Ee=Math.min(Ee,Q[0].dts-se*L),this.observer.trigger(i.default.INIT_PTS_FOUND,{initPTS:ge}))}Object.keys(ie).length?(W.trigger(i.default.FRAG_PARSING_INIT_SEGMENT,ue),this.ISGenerated=!0,le&&(this._initPTS=ge,this._initDTS=Ee)):W.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},$.remuxVideo=function(D,x,L,W,k){var Q=8,V,re,ie,ue,le,ge,Ee,se=D.timescale,we=D.samples,Oe=[],Ve=we.length,xt=this._PTSNormalize,Xt=this._initPTS,rt=this.nextAvcDts,Wt=this.isSafari;if(Ve!==0){Wt&&(L|=we.length&&rt&&(k&&Math.abs(x-rt/se)<.1||Math.abs(we[0].pts-rt-Xt)1?d.logger.log("AVC: "+Pe(zt,!0)+" ms hole between fragments detected,filling it"):zt<-1&&d.logger.log("AVC: "+Pe(-zt,!0)+" ms overlapping between fragments detected"),le=rt,we[0].dts=le,ue=Math.max(ue-zt,rt),we[0].pts=ue,d.logger.log("Video: PTS/DTS adjusted: "+Pe(ue,!0)+"/"+Pe(le,!0)+", delta: "+Pe(zt,!0)+" ms")),yt=we[we.length-1],Ee=Math.max(yt.dts,0),ge=Math.max(yt.pts,0,Ee),Wt&&(V=Math.round((Ee-le)/(we.length-1)));for(var fn=0,Cn=0,zn=0;zn0?Xn-1:Xn].dts;if(bo.stretchShortVideoTrack){var Zr=bo.maxBufferHole,Dl=Math.floor(Zr*se),vi=(W?ue+W*se:this.nextAudioPts)-Pn.pts;vi>Dl?(V=vi-Ua,V<0&&(V=Ua),d.logger.log("It is approximately "+Pe(vi,!1)+" ms to the next segment; using duration "+Pe(V,!1)+" ms for the last video frame.")):V=Ua}else V=Ua}Xr=Math.round(Pn.pts-Pn.dts)}Oe.push({size:Gr,duration:V,cts:Xr,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:Pn.key?2:1,isNonSync:Pn.key?0:1}})}this.nextAvcDts=Ee+V;var nu=D.dropped;if(D.nbNalu=0,D.dropped=0,Oe.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var ru=Oe[0].flags;ru.dependsOn=2,ru.isNonSync=0}D.samples=Oe,ie=In.moof(D.sequenceNumber++,le,D),D.samples=[];var ea={data1:ie,data2:re,startPTS:ue/se,endPTS:(ge+V)/se,startDTS:le/se,endDTS:this.nextAvcDts/se,type:"video",hasAudio:!1,hasVideo:!0,nb:Oe.length,dropped:nu};return this.observer.trigger(i.default.FRAG_PARSING_DATA,ea),ea}},$.remuxAudio=function(D,x,L,W){var k=D.inputTimeScale,Q=D.timescale,V=k/Q,re=D.isAAC?1024:1152,ie=re*V,ue=this._PTSNormalize,le=this._initPTS,ge=!D.isAAC&&this.typeSupported.mpeg,Ee,se,we,Oe,Ve,xt,Xt=ge?0:8,rt=D.samples,Wt=[],pt=this.nextAudioPts;if(L|=rt.length&&pt&&(W&&Math.abs(x-pt/k)<.1||Math.abs(rt[0].pts-pt-le)<20*ie),rt.forEach(function(Zr){Zr.pts=Zr.dts=ue(Zr.pts-le,x*k)}),rt=rt.filter(function(Zr){return Zr.pts>=0}),rt.length!==0){if(L||(W?pt=x*k:pt=rt[0].pts),D.isAAC)for(var nn=this.config.maxAudioFramesDrift,yt=0,zt=pt;yt=nn*ie&&Cn<_e&&zt){var En=Math.round(Cn/ie);d.logger.warn("Injecting "+En+" audio frames @ "+Pe(zt,!0)+" ms due to "+Pe(zt,!0)+" ms gap.");for(var sr=0;sr.1*ie,fn.pts=fn.dts=zt,zt+=ie,yt++}for(var sn=rt.length,An=0;sn--;)An+=rt[sn].unit.byteLength;for(var Dr=0,yr=rt.length;Dr0&&Gr<_e)Xr=Math.round((Lr-pt)/ie),d.logger.log(Pe(Gr,!0)+" ms hole between AAC samples detected,filling it"),Xr>0&&(se=Jt.getSilentFrame(D.manifestCodec||D.codec,D.channelCount),se||(se=Pn.subarray()),An+=Xr*se.length);else if(Gr<-12){d.logger.log("drop overlapping AAC sample, expected/parsed/delta: "+Pe(pt,!0)+" ms / "+Pe(Lr,!0)+" ms / "+Pe(-Gr,!0)+" ms"),An-=Pn.byteLength;continue}Lr=pt}if(Ve=Lr,An>0){An+=Xt;try{we=new Uint8Array(An)}catch{this.observer.trigger(i.default.ERROR,{type:l.ErrorTypes.MUX_ERROR,details:l.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:An,reason:"fail allocating audio mdat "+An});return}if(!ge){var uo=new DataView(we.buffer);uo.setUint32(0,An),we.set(In.types.mdat,4)}}else return;for(var Eo=0;Eo=2&&(Na=Wt[sn-2].duration,Ee.duration=Na),sn){this.nextAudioPts=pt=xt+V*Na,D.samples=Wt,ge?Oe=new Uint8Array:Oe=In.moof(D.sequenceNumber++,Ve/V,D),D.samples=[];var Oa=Ve/k,bo=pt/k,Ua={data1:Oe,data2:we,startPTS:Oa,endPTS:bo,startDTS:Oa,endDTS:bo,type:"audio",hasAudio:!0,hasVideo:!1,nb:sn};return this.observer.trigger(i.default.FRAG_PARSING_DATA,Ua),Ua}return null}},$.remuxEmptyAudio=function(D,x,L,W){var k=D.inputTimeScale,Q=D.samplerate?D.samplerate:k,V=k/Q,re=this.nextAudioPts,ie=(re!==void 0?re:W.startDTS*k)+this._initDTS,ue=W.endDTS*k+this._initDTS,le=1024,ge=V*le,Ee=Math.ceil((ue-ie)/ge),se=Jt.getSilentFrame(D.manifestCodec||D.codec,D.channelCount);if(d.logger.warn("remux empty Audio"),!se){d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");return}for(var we=[],Oe=0;Oe4294967296;)D+=L;return D},U}(),Ft=Qe,tn=function(){function U(A){this.observer=A}var $=U.prototype;return $.destroy=function(){},$.resetTimeStamp=function(){},$.resetInitSegment=function(){},$.remux=function(D,x,L,W,k,Q,V,re){var ie=this.observer,ue="";D&&(ue+="audio"),x&&(ue+="video"),ie.trigger(i.default.FRAG_PARSING_DATA,{data1:re,startPTS:k,startDTS:k,type:ue,hasAudio:!!D,hasVideo:!!x,nb:1,dropped:0}),ie.trigger(i.default.FRAG_PARSED)},U}(),Ge=tn,ft=Object(h.getSelfScope)(),Ln;try{Ln=ft.performance.now.bind(ft.performance)}catch{d.logger.debug("Unable to use Performance API on this environment"),Ln=ft.Date.now}var Dt=function(){function U(A,D,x,L){this.observer=A,this.typeSupported=D,this.config=x,this.vendor=L}var $=U.prototype;return $.destroy=function(){var D=this.demuxer;D&&D.destroy()},$.push=function(D,x,L,W,k,Q,V,re,ie,ue,le,ge){var Ee=this;if(D.byteLength>0&&x!=null&&x.key!=null&&x.method==="AES-128"){var se=this.decrypter;se==null&&(se=this.decrypter=new v.default(this.observer,this.config));var we=Ln();se.decrypt(D,x.key.buffer,x.iv.buffer,function(Oe){var Ve=Ln();Ee.observer.trigger(i.default.FRAG_DECRYPTED,{stats:{tstart:we,tdecrypt:Ve}}),Ee.pushDecrypted(new Uint8Array(Oe),x,new Uint8Array(L),W,k,Q,V,re,ie,ue,le,ge)})}else this.pushDecrypted(new Uint8Array(D),x,new Uint8Array(L),W,k,Q,V,re,ie,ue,le,ge)},$.pushDecrypted=function(D,x,L,W,k,Q,V,re,ie,ue,le,ge){var Ee=this.demuxer;if(!Ee||(V||re)&&!this.probe(D)){for(var se=this.observer,we=this.typeSupported,Oe=this.config,Ve=[{demux:Pt,remux:Ft},{demux:de.default,remux:Ge},{demux:ee,remux:Ft},{demux:Ut,remux:Ft}],xt=0,Xt=Ve.length;xt1?O-1:0),Y=1;Y1?O-1:0),Y=1;Y0)return y.subarray(S,S+C)},h._readSize=function(y,b){var S=0;return S=(y[b]&127)<<21,S|=(y[b+1]&127)<<14,S|=(y[b+2]&127)<<7,S|=y[b+3]&127,S},h.getTimeStamp=function(y){for(var b=h.getID3Frames(y),S=0;S>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:Z+=String.fromCharCode(H);break;case 12:case 13:Y=y[ne++],Z+=String.fromCharCode((H&31)<<6|Y&63);break;case 14:Y=y[ne++],z=y[ne++],Z+=String.fromCharCode((H&15)<<12|(Y&63)<<6|(z&63)<<0);break;default:}}return Z},h}(),v;function E(){var h=Object(i.getSelfScope)();return!v&&typeof h.TextDecoder!="undefined"&&(v=new h.TextDecoder("utf-8")),v}var d=l._utf8ArrayToStr;n.default=l},"./src/demux/mp4demuxer.js":function(e,n,r){"use strict";r.r(n);var i=r("./src/utils/logger.js"),l=r("./src/events.js"),v=Math.pow(2,32)-1,E=function(){function d(N,y){this.observer=N,this.remuxer=y}var h=d.prototype;return h.resetTimeStamp=function(y){this.initPTS=y},h.resetInitSegment=function(y,b,S,C){if(y&&y.byteLength){var M=this.initData=d.parseInitSegment(y);b==null&&(b="mp4a.40.5"),S==null&&(S="avc1.42e01e");var O={};M.audio&&M.video?O.audiovideo={container:"video/mp4",codec:b+","+S,initSegment:C?y:null}:(M.audio&&(O.audio={container:"audio/mp4",codec:b,initSegment:C?y:null}),M.video&&(O.video={container:"video/mp4",codec:S,initSegment:C?y:null})),this.observer.trigger(l.default.FRAG_PARSING_INIT_SEGMENT,{tracks:O})}else b&&(this.audioCodec=b),S&&(this.videoCodec=S)},d.probe=function(y){return d.findBox({data:y,start:0,end:Math.min(y.length,16384)},["moof"]).length>0},d.bin2str=function(y){return String.fromCharCode.apply(null,y)},d.readUint16=function(y,b){y.data&&(b+=y.start,y=y.data);var S=y[b]<<8|y[b+1];return S<0?65536+S:S},d.readUint32=function(y,b){y.data&&(b+=y.start,y=y.data);var S=y[b]<<24|y[b+1]<<16|y[b+2]<<8|y[b+3];return S<0?4294967296+S:S},d.writeUint32=function(y,b,S){y.data&&(b+=y.start,y=y.data),y[b]=S>>24,y[b+1]=S>>16&255,y[b+2]=S>>8&255,y[b+3]=S&255},d.findBox=function(y,b){var S=[],C,M,O,H,Y,z,Z;if(y.data?(z=y.start,H=y.end,y=y.data):(z=0,H=y.byteLength),!b.length)return null;for(C=z;C1?C+M:H,O===b[0]&&(b.length===1?S.push({data:y,start:C+8,end:Z}):(Y=d.findBox({data:y,start:C+8,end:Z},b.slice(1)),Y.length&&(S=S.concat(Y)))),C=Z;return S},d.parseSegmentIndex=function(y){var b=d.findBox(y,["moov"])[0],S=b?b.end:null,C=0,M=d.findBox(y,["sidx"]),O;if(!M||!M[0])return null;O=[],M=M[0];var H=M.data[0];C=H===0?8:16;var Y=d.readUint32(M,C);C+=4;var z=0,Z=0;H===0?C+=8:C+=16,C+=2;var ne=M.end+Z,ee=d.readUint16(M,C);C+=2;for(var de=0;de>>31;if(Je===1){console.warn("SIDX has hierarchical references (not supported)");return}var en=d.readUint32(M,pe);pe+=4,O.push({referenceSize:$e,subsegmentDuration:en,info:{duration:en/Y,start:ne,end:ne+$e-1}}),ne+=$e,pe+=4,C=pe}return{earliestPresentationTime:z,timescale:Y,version:H,referencesCount:ee,references:O,moovEndOffset:S}},d.parseInitSegment=function(y){var b=[],S=d.findBox(y,["moov","trak"]);return S.forEach(function(C){var M=d.findBox(C,["tkhd"])[0];if(M){var O=M.data[M.start],H=O===0?12:20,Y=d.readUint32(M,H),z=d.findBox(C,["mdia","mdhd"])[0];if(z){O=z.data[z.start],H=O===0?12:20;var Z=d.readUint32(z,H),ne=d.findBox(C,["mdia","hdlr"])[0];if(ne){var ee=d.bin2str(ne.data.subarray(ne.start+8,ne.start+12)),de={soun:"audio",vide:"video"}[ee];if(de){var pe=d.findBox(C,["mdia","minf","stbl","stsd"]);if(pe.length){pe=pe[0];var He=d.bin2str(pe.data.subarray(pe.start+12,pe.start+16));i.logger.log("MP4Demuxer:"+de+":"+He+" found")}b[Y]={timescale:Z,type:de},b[de]={timescale:Z,id:Y}}}}}}),b},d.getStartDTS=function(y,b){var S,C,M;return S=d.findBox(b,["moof","traf"]),C=[].concat.apply([],S.map(function(O){return d.findBox(O,["tfhd"]).map(function(H){var Y,z,Z;return Y=d.readUint32(H,4),z=y[Y].timescale||9e4,Z=d.findBox(O,["tfdt"]).map(function(ne){var ee,de;return ee=ne.data[ne.start],de=d.readUint32(ne,4),ee===1&&(de*=Math.pow(2,32),de+=d.readUint32(ne,8)),de})[0],Z/z})})),M=Math.min.apply(null,C),isFinite(M)?M:0},d.offsetStartDTS=function(y,b,S){d.findBox(b,["moof","traf"]).map(function(C){return d.findBox(C,["tfhd"]).map(function(M){var O=d.readUint32(M,4),H=y[O].timescale||9e4;d.findBox(C,["tfdt"]).map(function(Y){var z=Y.data[Y.start],Z=d.readUint32(Y,4);if(z===0)d.writeUint32(Y,4,Z-S*H);else{Z*=Math.pow(2,32),Z+=d.readUint32(Y,8),Z-=S*H,Z=Math.max(Z,0);var ne=Math.floor(Z/(v+1)),ee=Math.floor(Z%(v+1));d.writeUint32(Y,4,ne),d.writeUint32(Y,8,ee)}})})})},h.append=function(y,b,S,C){var M=this.initData;M||(this.resetInitSegment(y,this.audioCodec,this.videoCodec,!1),M=this.initData);var O,H=this.initPTS;if(H===void 0){var Y=d.getStartDTS(M,y);this.initPTS=H=Y-b,this.observer.trigger(l.default.INIT_PTS_FOUND,{initPTS:H})}d.offsetStartDTS(M,y,H),O=d.getStartDTS(M,y),this.remuxer.remux(M.audio,M.video,null,null,O,S,C,y)},h.destroy=function(){},d}();n.default=E},"./src/errors.ts":function(e,n,r){"use strict";r.r(n),r.d(n,"ErrorTypes",function(){return i}),r.d(n,"ErrorDetails",function(){return l});var i;(function(v){v.NETWORK_ERROR="networkError",v.MEDIA_ERROR="mediaError",v.KEY_SYSTEM_ERROR="keySystemError",v.MUX_ERROR="muxError",v.OTHER_ERROR="otherError"})(i||(i={}));var l;(function(v){v.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",v.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",v.KEY_SYSTEM_NO_SESSION="keySystemNoSession",v.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",v.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",v.MANIFEST_LOAD_ERROR="manifestLoadError",v.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",v.MANIFEST_PARSING_ERROR="manifestParsingError",v.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",v.LEVEL_LOAD_ERROR="levelLoadError",v.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",v.LEVEL_SWITCH_ERROR="levelSwitchError",v.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",v.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",v.FRAG_LOAD_ERROR="fragLoadError",v.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",v.FRAG_DECRYPT_ERROR="fragDecryptError",v.FRAG_PARSING_ERROR="fragParsingError",v.REMUX_ALLOC_ERROR="remuxAllocError",v.KEY_LOAD_ERROR="keyLoadError",v.KEY_LOAD_TIMEOUT="keyLoadTimeOut",v.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",v.BUFFER_APPEND_ERROR="bufferAppendError",v.BUFFER_APPENDING_ERROR="bufferAppendingError",v.BUFFER_STALLED_ERROR="bufferStalledError",v.BUFFER_FULL_ERROR="bufferFullError",v.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",v.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",v.INTERNAL_EXCEPTION="internalException"})(l||(l={}))},"./src/events.js":function(e,n,r){"use strict";r.r(n);var i={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition",LIVE_BACK_BUFFER_REACHED:"hlsLiveBackBufferReached"};n.default=i},"./src/hls.ts":function(e,n,r){"use strict";r.r(n);var i={};r.r(i),r.d(i,"newCue",function(){return jv});var l=r("./node_modules/url-toolkit/src/url-toolkit.js"),v=r("./src/errors.ts"),E=r("./src/polyfills/number-isFinite.js"),d=r("./src/events.js"),h=r("./src/utils/logger.js"),N={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},y=function(){function g(u){this.hls=void 0,this.handledEvents=void 0,this.useGenericHandler=void 0,this.hls=u,this.onEvent=this.onEvent.bind(this);for(var o=arguments.length,t=new Array(o>1?o-1:0),a=1;a>8*(15-a)&255;return t},p.setDecryptDataFromLevelKey=function(o,t){var a=o;return o&&o.method&&o.uri&&!o.iv&&(a=new Y(o.baseuri,o.reluri),a.method=o.method,a.iv=this.createInitializationVector(t)),a},Z(g,[{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=Object(l.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(o){this._url=o}},{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var o=this.sn;typeof o!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&h.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),o=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,o)}return this._decryptdata}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!Object(E.isFiniteNumber)(this.programDateTime))return null;var o=Object(E.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+o*1e3}},{key:"encrypted",get:function(){return!!(this.decryptdata&&this.decryptdata.uri!==null&&this.decryptdata.key===null)}}]),g}();function de(g,p){for(var u=0;uNumber.MAX_SAFE_INTEGER?1/0:t},p.hexadecimalInteger=function(o){if(this[o]){var t=(this[o]||"0x").slice(2);t=(t.length&1?"0":"")+t;for(var a=new Uint8Array(t.length/2),c=0;cNumber.MAX_SAFE_INTEGER?1/0:t},p.decimalFloatingPoint=function(o){return parseFloat(this[o])},p.enumeratedString=function(o){return this[o]},p.decimalResolution=function(o){var t=$e.exec(this[o]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},g.parseAttrList=function(o){var t,a={};for(Je.lastIndex=0;(t=Je.exec(o))!==null;){var c=t[2],_='"';c.indexOf(_)===0&&c.lastIndexOf(_)===c.length-1&&(c=c.slice(1,-1)),a[t[1]]=c}return a},g}(),un=en,ut={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};function gt(g,p){var u=ut[p];return!!u&&u[g.slice(0,4)]===!0}function Pt(g,p){return MediaSource.isTypeSupported((p||"video")+'/mp4;codecs="'+g+'"')}var Qt=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,Ut=/#EXT-X-MEDIA:(.*)/g,wt=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),Jt=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,St=/\.(mp4|m4s|m4v|m4a)$/i,ct=function(){function g(){}return g.findGroup=function(u,o){for(var t=0;t2?(t=o.shift()+".",t+=parseInt(o.shift()).toString(16),t+=("000"+parseInt(o.shift()).toString(16)).substr(-4)):t=u,t},g.resolve=function(u,o){return l.buildAbsoluteURL(o,u,{alwaysNormalize:!0})},g.parseMasterPlaylist=function(u,o){var t=[];Qt.lastIndex=0;function a(I,j){["video","audio"].forEach(function(P){var q=I.filter(function(fe){return gt(fe,P)});if(q.length){var ae=q.filter(function(fe){return fe.lastIndexOf("avc1",0)===0||fe.lastIndexOf("mp4a",0)===0});j[P+"Codec"]=ae.length>0?ae[0]:q[0],I=I.filter(function(fe){return q.indexOf(fe)===-1})}}),j.unknownCodecs=I}for(var c;(c=Qt.exec(u))!=null;){var _={},R=_.attrs=new un(c[1]);_.url=g.resolve(c[2],o);var T=R.decimalResolution("RESOLUTION");T&&(_.width=T.width,_.height=T.height),_.bitrate=R.decimalInteger("AVERAGE-BANDWIDTH")||R.decimalInteger("BANDWIDTH"),_.name=R.NAME,a([].concat((R.CODECS||"").split(/[ ,]+/)),_),_.videoCodec&&_.videoCodec.indexOf("avc1")!==-1&&(_.videoCodec=g.convertAVC1ToAVCOTI(_.videoCodec)),t.push(_)}return t},g.parseMasterPlaylistMedia=function(u,o,t,a){a===void 0&&(a=[]);var c,_=[],R=0;for(Ut.lastIndex=0;(c=Ut.exec(u))!==null;){var T=new un(c[1]);if(T.TYPE===t){var I={id:R++,groupId:T["GROUP-ID"],name:T.NAME||T.LANGUAGE,type:t,default:T.DEFAULT==="YES",autoselect:T.AUTOSELECT==="YES",forced:T.FORCED==="YES",lang:T.LANGUAGE};if(T.URI&&(I.url=g.resolve(T.URI,o)),a.length){var j=g.findGroup(a,I.groupId);I.audioCodec=j?j.codec:a[0].codec}_.push(I)}}return _},g.parseLevelPlaylist=function(u,o,t,a,c){var _=0,R=0,T=new He(o),I=0,j=null,P=new ee,q,ae,fe,De=null;for(wt.lastIndex=0;(q=wt.exec(u))!==null;){var ze=q[1];if(ze){P.duration=parseFloat(ze);var Be=(" "+q[2]).slice(1);P.title=Be||null,P.tagList.push(Be?["INF",ze,Be]:["INF",ze])}else if(q[3]){if(Object(E.isFiniteNumber)(P.duration)){var qe=_++;P.type=a,P.start=R,fe&&(P.levelkey=fe),P.sn=qe,P.level=t,P.cc=I,P.urlId=c,P.baseurl=o,P.relurl=(" "+q[3]).slice(1),me(P,j),T.fragments.push(P),j=P,R+=P.duration,P=new ee}}else if(q[4]){var tt=(" "+q[4]).slice(1);j?P.setByteRange(tt,j):P.setByteRange(tt)}else if(q[5])P.rawProgramDateTime=(" "+q[5]).slice(1),P.tagList.push(["PROGRAM-DATE-TIME",P.rawProgramDateTime]),De===null&&(De=T.fragments.length);else{if(q=q[0].match(Jt),!q){h.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae=0&&(fe.method=jt,fe.key=null,fe.iv=mt));break}case"START":{var er=new un(ht),su=er.decimalFloatingPoint("TIME-OFFSET");Object(E.isFiniteNumber)(su)&&(T.startTimeOffset=su);break}case"MAP":{var fu=new un(ht);P.relurl=fu.URI,fu.BYTERANGE&&P.setByteRange(fu.BYTERANGE),P.baseurl=o,P.level=t,P.type=a,P.sn="initSegment",T.initSegment=P,P=new ee,P.rawProgramDateTime=T.initSegment.rawProgramDateTime;break}default:h.logger.warn("line parsed but not handled: "+q);break}}}return P=j,P&&!P.relurl&&(T.fragments.pop(),R-=P.duration),T.totalduration=R,T.averagetargetduration=R/T.fragments.length,T.endSN=_-1,T.startCC=T.fragments[0]?T.fragments[0].cc:0,T.endCC=I,!T.initSegment&&T.fragments.length&&T.fragments.every(function(ap){return St.test(ap.relurl)})&&(h.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),P=new ee,P.relurl=T.fragments[0].relurl,P.baseurl=o,P.level=t,P.type=a,P.sn="initSegment",T.initSegment=P,T.needSidxRanges=!0),De&&In(T.fragments,De),T},g}();function In(g,p){for(var u=g[p],o=p-1;o>=0;o--){var t=g[o];t.programDateTime=u.programDateTime-t.duration*1e3,u=t}}function me(g,p){g.rawProgramDateTime?g.programDateTime=Date.parse(g.rawProgramDateTime):p&&p.programDateTime&&(g.programDateTime=p.endProgramDateTime),Object(E.isFiniteNumber)(g.programDateTime)||(g.programDateTime=null,g.rawProgramDateTime=null)}function st(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var It=window,Pe=It.performance,xe=function(g){st(p,g);function p(o){var t;return t=g.call(this,o,d.default.MANIFEST_LOADING,d.default.LEVEL_LOADING,d.default.AUDIO_TRACK_LOADING,d.default.SUBTITLE_TRACK_LOADING)||this,t.loaders={},t}p.canHaveQualityLevels=function(t){return t!==S.AUDIO_TRACK&&t!==S.SUBTITLE_TRACK},p.mapContextToLevelType=function(t){var a=t.type;switch(a){case S.AUDIO_TRACK:return C.AUDIO;case S.SUBTITLE_TRACK:return C.SUBTITLE;default:return C.MAIN}},p.getResponseUrl=function(t,a){var c=t.url;return(c===void 0||c.indexOf("data:")===0)&&(c=a.url),c};var u=p.prototype;return u.createInternalLoader=function(t){var a=this.hls.config,c=a.pLoader,_=a.loader,R=c||_,T=new R(a);return t.loader=T,this.loaders[t.type]=T,T},u.getInternalLoader=function(t){return this.loaders[t.type]},u.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},u.destroyInternalLoaders=function(){for(var t in this.loaders){var a=this.loaders[t];a&&a.destroy(),this.resetInternalLoader(t)}},u.destroy=function(){this.destroyInternalLoaders(),g.prototype.destroy.call(this)},u.onManifestLoading=function(t){this.load({url:t.url,type:S.MANIFEST,level:0,id:null,responseType:"text"})},u.onLevelLoading=function(t){this.load({url:t.url,type:S.LEVEL,level:t.level,id:t.id,responseType:"text"})},u.onAudioTrackLoading=function(t){this.load({url:t.url,type:S.AUDIO_TRACK,level:null,id:t.id,responseType:"text"})},u.onSubtitleTrackLoading=function(t){this.load({url:t.url,type:S.SUBTITLE_TRACK,level:null,id:t.id,responseType:"text"})},u.load=function(t){var a=this.hls.config;h.logger.debug("Loading playlist of type "+t.type+", level: "+t.level+", id: "+t.id);var c=this.getInternalLoader(t);if(c){var _=c.context;if(_&&_.url===t.url)return h.logger.trace("playlist request ongoing"),!1;h.logger.warn("aborting previous loader for type: "+t.type),c.abort()}var R,T,I,j;switch(t.type){case S.MANIFEST:R=a.manifestLoadingMaxRetry,T=a.manifestLoadingTimeOut,I=a.manifestLoadingRetryDelay,j=a.manifestLoadingMaxRetryTimeout;break;case S.LEVEL:R=0,j=0,I=0,T=a.levelLoadingTimeOut;break;default:R=a.levelLoadingMaxRetry,T=a.levelLoadingTimeOut,I=a.levelLoadingRetryDelay,j=a.levelLoadingMaxRetryTimeout;break}c=this.createInternalLoader(t);var P={timeout:T,maxRetry:R,retryDelay:I,maxRetryDelay:j},q={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return h.logger.debug("Calling internal loader delegate for URL: "+t.url),c.load(t,P,q),!0},u.loadsuccess=function(t,a,c,_){if(_===void 0&&(_=null),c.isSidxRequest){this._handleSidxRequest(t,c),this._handlePlaylistLoaded(t,a,c,_);return}if(this.resetInternalLoader(c.type),typeof t.data!="string")throw new Error('expected responseType of "text" for PlaylistLoader');var R=t.data;if(a.tload=Pe.now(),R.indexOf("#EXTM3U")!==0){this._handleManifestParsingError(t,c,"no EXTM3U delimiter",_);return}R.indexOf("#EXTINF:")>0||R.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(t,a,c,_):this._handleMasterPlaylist(t,a,c,_)},u.loaderror=function(t,a,c){c===void 0&&(c=null),this._handleNetworkError(a,c,!1,t)},u.loadtimeout=function(t,a,c){c===void 0&&(c=null),this._handleNetworkError(a,c,!0)},u._handleMasterPlaylist=function(t,a,c,_){var R=this.hls,T=t.data,I=p.getResponseUrl(t,c),j=ct.parseMasterPlaylist(T,I);if(!j.length){this._handleManifestParsingError(t,c,"no level found in manifest",_);return}var P=j.map(function(De){return{id:De.attrs.AUDIO,codec:De.audioCodec}}),q=ct.parseMasterPlaylistMedia(T,I,"AUDIO",P),ae=ct.parseMasterPlaylistMedia(T,I,"SUBTITLES");if(q.length){var fe=!1;q.forEach(function(De){De.url||(fe=!0)}),fe===!1&&j[0].audioCodec&&!j[0].attrs.AUDIO&&(h.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),q.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1}))}R.trigger(d.default.MANIFEST_LOADED,{levels:j,audioTracks:q,subtitles:ae,url:I,stats:a,networkDetails:_})},u._handleTrackOrLevelPlaylist=function(t,a,c,_){var R=this.hls,T=c.id,I=c.level,j=c.type,P=p.getResponseUrl(t,c),q=Object(E.isFiniteNumber)(T)?T:0,ae=Object(E.isFiniteNumber)(I)?I:q,fe=p.mapContextToLevelType(c),De=ct.parseLevelPlaylist(t.data,P,ae,fe,q);if(De.tload=a.tload,j===S.MANIFEST){var ze={url:P,details:De};R.trigger(d.default.MANIFEST_LOADED,{levels:[ze],audioTracks:[],url:P,stats:a,networkDetails:_})}if(a.tparsed=Pe.now(),De.needSidxRanges){var Be=De.initSegment.url;this.load({url:Be,isSidxRequest:!0,type:j,level:I,levelDetails:De,id:T,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"});return}c.levelDetails=De,this._handlePlaylistLoaded(t,a,c,_)},u._handleSidxRequest=function(t,a){if(typeof t.data=="string")throw new Error("sidx request must be made with responseType of array buffer");var c=M.default.parseSegmentIndex(new Uint8Array(t.data));if(!!c){var _=c.references,R=a.levelDetails;_.forEach(function(T,I){var j=T.info;if(!!R){var P=R.fragments[I];P.byteRange.length===0&&P.setByteRange(String(1+j.end-j.start)+"@"+String(j.start))}}),R&&R.initSegment.setByteRange(String(c.moovEndOffset)+"@0")}},u._handleManifestParsingError=function(t,a,c,_){this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:t.url,reason:c,networkDetails:_})},u._handleNetworkError=function(t,a,c,_){c===void 0&&(c=!1),_===void 0&&(_=null),h.logger.info("A network error occured while loading a "+t.type+"-type playlist");var R,T,I=this.getInternalLoader(t);switch(t.type){case S.MANIFEST:R=c?v.ErrorDetails.MANIFEST_LOAD_TIMEOUT:v.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case S.LEVEL:R=c?v.ErrorDetails.LEVEL_LOAD_TIMEOUT:v.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case S.AUDIO_TRACK:R=c?v.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;default:T=!1}I&&(I.abort(),this.resetInternalLoader(t.type));var j={type:v.ErrorTypes.NETWORK_ERROR,details:R,fatal:T,url:t.url,loader:I,context:t,networkDetails:a};_&&(j.response=_),this.hls.trigger(d.default.ERROR,j)},u._handlePlaylistLoaded=function(t,a,c,_){var R=c.type,T=c.level,I=c.id,j=c.levelDetails;if(!j||!j.targetduration){this._handleManifestParsingError(t,c,"invalid target duration",_);return}var P=p.canHaveQualityLevels(c.type);if(P)this.hls.trigger(d.default.LEVEL_LOADED,{details:j,level:T||0,id:I||0,stats:a,networkDetails:_});else switch(R){case S.AUDIO_TRACK:this.hls.trigger(d.default.AUDIO_TRACK_LOADED,{details:j,id:I,stats:a,networkDetails:_});break;case S.SUBTITLE_TRACK:this.hls.trigger(d.default.SUBTITLE_TRACK_LOADED,{details:j,id:I,stats:a,networkDetails:_});break}},p}(b),_e=xe;function nt(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var Qe=function(g){nt(p,g);function p(o){var t;return t=g.call(this,o,d.default.FRAG_LOADING)||this,t.loaders={},t}var u=p.prototype;return u.destroy=function(){var t=this.loaders;for(var a in t){var c=t[a];c&&c.destroy()}this.loaders={},g.prototype.destroy.call(this)},u.onFragLoading=function(t){var a=t.frag,c=a.type,_=this.loaders,R=this.hls.config,T=R.fLoader,I=R.loader;a.loaded=0;var j=_[c];j&&(h.logger.warn("abort previous fragment loader for type: "+c),j.abort()),j=_[c]=a.loader=R.fLoader?new T(R):new I(R);var P,q,ae;P={url:a.url,frag:a,responseType:"arraybuffer",progressData:!1};var fe=a.byteRangeStartOffset,De=a.byteRangeEndOffset;Object(E.isFiniteNumber)(fe)&&Object(E.isFiniteNumber)(De)&&(P.rangeStart=fe,P.rangeEnd=De),q={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout},ae={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},j.load(P,q,ae)},u.loadsuccess=function(t,a,c,_){_===void 0&&(_=null);var R=t.data,T=c.frag;T.loader=void 0,this.loaders[T.type]=void 0,this.hls.trigger(d.default.FRAG_LOADED,{payload:R,frag:T,stats:a,networkDetails:_})},u.loaderror=function(t,a,c){c===void 0&&(c=null);var _=a.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a.frag,response:t,networkDetails:c})},u.loadtimeout=function(t,a,c){c===void 0&&(c=null);var _=a.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a.frag,networkDetails:c})},u.loadprogress=function(t,a,c,_){_===void 0&&(_=null);var R=a.frag;R.loaded=t.loaded,this.hls.trigger(d.default.FRAG_LOAD_PROGRESS,{frag:R,stats:t,networkDetails:_})},p}(b),Ft=Qe;function tn(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var Ge=function(g){tn(p,g);function p(o){var t;return t=g.call(this,o,d.default.KEY_LOADING)||this,t.loaders={},t.decryptkey=null,t.decrypturl=null,t}var u=p.prototype;return u.destroy=function(){for(var t in this.loaders){var a=this.loaders[t];a&&a.destroy()}this.loaders={},g.prototype.destroy.call(this)},u.onKeyLoading=function(t){var a=t.frag,c=a.type,_=this.loaders[c];if(!a.decryptdata){h.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var R=a.decryptdata.uri;if(R!==this.decrypturl||this.decryptkey===null){var T=this.hls.config;if(_&&(h.logger.warn("abort previous key loader for type:"+c),_.abort()),!R){h.logger.warn("key uri is falsy");return}a.loader=this.loaders[c]=new T.loader(T),this.decrypturl=R,this.decryptkey=null;var I={url:R,frag:a,responseType:"arraybuffer"},j={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:T.fragLoadingRetryDelay,maxRetryDelay:T.fragLoadingMaxRetryTimeout},P={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.loader.load(I,j,P)}else this.decryptkey&&(a.decryptdata.key=this.decryptkey,this.hls.trigger(d.default.KEY_LOADED,{frag:a}))},u.loadsuccess=function(t,a,c){var _=c.frag;if(!_.decryptdata){h.logger.error("after key load, decryptdata unset");return}this.decryptkey=_.decryptdata.key=new Uint8Array(t.data),_.loader=void 0,delete this.loaders[_.type],this.hls.trigger(d.default.KEY_LOADED,{frag:_})},u.loaderror=function(t,a){var c=a.frag,_=c.loader;_&&_.abort(),delete this.loaders[c.type],this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:c,response:t})},u.loadtimeout=function(t,a){var c=a.frag,_=c.loader;_&&_.abort(),delete this.loaders[c.type],this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.NETWORK_ERROR,details:v.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:c})},p}(b),ft=Ge;function Ln(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var Dt={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"},Br=function(g){Ln(p,g);function p(o){var t;return t=g.call(this,o,d.default.BUFFER_APPENDED,d.default.FRAG_BUFFERED,d.default.FRAG_LOADED)||this,t.bufferPadding=.2,t.fragments=Object.create(null),t.timeRanges=Object.create(null),t.config=o.config,t}var u=p.prototype;return u.destroy=function(){this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.config=null,b.prototype.destroy.call(this),g.prototype.destroy.call(this)},u.getBufferedFrag=function(t,a){var c=this.fragments,_=Object.keys(c).filter(function(T){var I=c[T];if(I.body.type!==a||!I.buffered)return!1;var j=I.body;return j.startPTS<=t&&t<=j.endPTS});if(_.length===0)return null;var R=_.pop();return c[R].body},u.detectEvictedFragments=function(t,a){var c=this,_,R;Object.keys(this.fragments).forEach(function(T){var I=c.fragments[T];if(I.buffered===!0){var j=I.range[t];if(j){_=j.time;for(var P=0;P<_.length;P++)if(R=_[P],c.isTimeBuffered(R.startPTS,R.endPTS,a)===!1){c.removeFragment(I.body);break}}}})},u.detectPartialFragments=function(t){var a=this,c=this.getFragmentKey(t),_=this.fragments[c];_&&(_.buffered=!0,Object.keys(this.timeRanges).forEach(function(R){if(t.hasElementaryStream(R)){var T=a.timeRanges[R];_.range[R]=a.getBufferedTimes(t.startPTS,t.endPTS,T)}}))},u.getBufferedTimes=function(t,a,c){for(var _=[],R,T,I=!1,j=0;j=R&&a<=T){_.push({startPTS:Math.max(t,c.start(j)),endPTS:Math.min(a,c.end(j))});break}else if(tR)_.push({startPTS:Math.max(t,c.start(j)),endPTS:Math.min(a,c.end(j))}),I=!0;else if(a<=R)break;return{time:_,partial:I}},u.getFragmentKey=function(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn},u.getPartialFragment=function(t){var a=this,c,_,R,T=null,I=0;return Object.keys(this.fragments).forEach(function(j){var P=a.fragments[j];a.isPartial(P)&&(_=P.body.startPTS-a.bufferPadding,R=P.body.endPTS+a.bufferPadding,t>=_&&t<=R&&(c=Math.min(t-_,R-t),I<=c&&(T=P.body,I=c)))}),T},u.getState=function(t){var a=this.getFragmentKey(t),c=this.fragments[a],_=Dt.NOT_LOADED;return c!==void 0&&(c.buffered?this.isPartial(c)===!0?_=Dt.PARTIAL:_=Dt.OK:_=Dt.APPENDING),_},u.isPartial=function(t){return t.buffered===!0&&(t.range.video!==void 0&&t.range.video.partial===!0||t.range.audio!==void 0&&t.range.audio.partial===!0)},u.isTimeBuffered=function(t,a,c){for(var _,R,T=0;T=_&&a<=R)return!0;if(a<=_)return!1}return!1},u.onFragLoaded=function(t){var a=t.frag;!Object(E.isFiniteNumber)(a.sn)||a.bitrateTest||(this.fragments[this.getFragmentKey(a)]={body:a,range:Object.create(null),buffered:!1})},u.onBufferAppended=function(t){var a=this;this.timeRanges=t.timeRanges,Object.keys(this.timeRanges).forEach(function(c){var _=a.timeRanges[c];a.detectEvictedFragments(c,_)})},u.onFragBuffered=function(t){this.detectPartialFragments(t.frag)},u.hasFragment=function(t){var a=this.getFragmentKey(t);return this.fragments[a]!==void 0},u.removeFragment=function(t){var a=this.getFragmentKey(t);delete this.fragments[a]},u.removeAllFragments=function(){this.fragments=Object.create(null)},p}(b),U={search:function(p,u){for(var o=0,t=p.length-1,a=null,c=null;o<=t;){a=(o+t)/2|0,c=p[a];var _=u(c);if(_>0)o=a+1;else if(_<0)t=a-1;else return c}return null}},$=U,A=function(){function g(){}return g.isBuffered=function(u,o){try{if(u){for(var t=u.buffered,a=0;a=t.start(a)&&o<=t.end(a))return!0}}catch{}return!1},g.bufferInfo=function(u,o,t){try{if(u){var a=u.buffered,c=[],_;for(_=0;_R&&(a[_-1].end=u[c].end):a.push(u[c])}else a.push(u[c])}else a=u;for(var T=0,I,j=o,P=o,q=0;q=ae&&o1?a-1:0),_=1;_p?(o.duration=a-o.start,o.duration<0&&h.logger.warn("negative duration computed for frag "+o.sn+",level "+o.level+", there should be some duration drift between playlist and fragment!")):(t.duration=o.start-a,t.duration<0&&h.logger.warn("negative duration computed for frag "+t.sn+",level "+t.level+", there should be some duration drift between playlist and fragment!")):u>p?t.start=o.start+o.duration:t.start=Math.max(o.start-t.duration,0)}function se(g,p,u,o,t,a){var c=u;if(Object(E.isFiniteNumber)(p.startPTS)){var _=Math.abs(p.startPTS-u);Object(E.isFiniteNumber)(p.deltaPTS)?p.deltaPTS=Math.max(_,p.deltaPTS):p.deltaPTS=_,c=Math.max(u,p.startPTS),u=Math.min(u,p.startPTS),o=Math.max(o,p.endPTS),t=Math.min(t,p.startDTS),a=Math.max(a,p.endDTS)}var R=u-p.start;p.start=p.startPTS=u,p.maxStartPTS=c,p.endPTS=o,p.startDTS=t,p.endDTS=a,p.duration=o-u;var T=p.sn;if(!g||Tg.endSN)return 0;var I,j,P;for(I=T-g.startSN,j=g.fragments,j[I]=p,P=I;P>0;P--)Ee(j,P,P-1);for(P=I;Po.length))for(var a=0;ap?-1:0})}function yt(g,p,u){var o=!1;return p&&p.details&&u&&(u.endCC>u.startCC||g&&g.cc=(t||0))return null;u=u||0;for(var a=0;ag&&u.start?-1:0}function An(g,p,u){var o=Math.min(p,u.duration+(u.deltaPTS?u.deltaPTS:0))*1e3,t=u.endProgramDateTime||0;return t-o>g}var Dr=250,yr=2,Xn=.1,Pn=.05,Lr=function(){function g(u,o,t,a){this.config=u,this.media=o,this.fragmentTracker=t,this.hls=a,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1}var p=g.prototype;return p.poll=function(o){var t=this.config,a=this.media,c=this.stalled,_=a.currentTime,R=a.seeking,T=this.seeking&&!R,I=!this.seeking&&R;if(this.seeking=R,_!==o){if(this.moved=!0,c!==null){if(this.stallReported){var j=self.performance.now()-c;h.logger.warn("playback not stuck anymore @"+_+", after "+Math.round(j)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((I||T)&&(this.stalled=null),!(a.paused||a.ended||a.playbackRate===0||!a.buffered.length)){var P=A.bufferInfo(a,_,0),q=P.len>0,ae=P.nextStart||0;if(!(!q&&!ae)){if(R){var fe=P.len>yr,De=!ae||ae-_>yr;if(fe||De)return;this.moved=!1}if(!this.moved&&this.stalled){var ze=Math.max(ae,P.start||0)-_;if(ze>0&&ze<=yr){this._trySkipBufferHole(null);return}}var Be=self.performance.now();if(c===null){this.stalled=Be;return}var qe=Be-c;!R&&qe>=Dr&&this._reportStall(P.len);var tt=A.bufferInfo(a,_,t.maxBufferHole);this._tryFixBufferStall(tt,qe)}}},p._tryFixBufferStall=function(o,t){var a=this.config,c=this.fragmentTracker,_=this.media,R=_.currentTime,T=c.getPartialFragment(R);if(T){var I=this._trySkipBufferHole(T);if(I)return}o.len>a.maxBufferHole&&t>a.highBufferWatchdogPeriod*1e3&&(h.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},p._reportStall=function(o){var t=this.hls,a=this.media,c=this.stallReported;c||(this.stallReported=!0,h.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer"),t.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o}))},p._trySkipBufferHole=function(o){for(var t=this.config,a=this.hls,c=this.media,_=c.currentTime,R=0,T=0;T=R&&_1?a-1:0),_=1;_1&&(this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)),this._tickCallCount=0)},u.doTick=function(){},p}(b);function Eo(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var te={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},Na=function(g){Eo(p,g);function p(){return g.apply(this,arguments)||this}var u=p.prototype;return u.doTick=function(){},u.startLoad=function(){},u.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragmentTracker.removeFragment(t)),this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=te.STOPPED},u._streamEnded=function(t,a){var c=this.fragCurrent,_=this.fragmentTracker;if(!a.live&&c&&!c.backtracked&&c.sn===a.endSN&&!t.nextStart){var R=_.getState(c);return R===Dt.PARTIAL||R===Dt.OK}return!1},u.onMediaSeeking=function(){var t=this.config,a=this.media,c=this.mediaBuffer,_=this.state,R=a?a.currentTime:null,T=A.bufferInfo(c||a,R,this.config.maxBufferHole);if(Object(E.isFiniteNumber)(R)&&h.logger.log("media seeking to "+R.toFixed(3)),_===te.FRAG_LOADING){var I=this.fragCurrent;if(T.len===0&&I){var j=t.maxFragLookUpTolerance,P=I.start-j,q=I.start+I.duration+j;Rq?(I.loader&&(h.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),I.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=te.IDLE):h.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else _===te.ENDED&&(T.len===0&&(this.fragPrevious=null,this.fragCurrent=null),this.state=te.IDLE);a&&(this.lastCurrentTime=R),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=R),this.tick()},u.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},u.onHandlerDestroying=function(){this.stopLoad(),g.prototype.onHandlerDestroying.call(this)},u.onHandlerDestroyed=function(){this.state=te.STOPPED,this.fragmentTracker=null},u.computeLivePosition=function(t,a){var c=this.config.liveSyncDuration!==void 0?this.config.liveSyncDuration:this.config.liveSyncDurationCount*a.targetduration;return t+Math.max(0,a.totalduration-c)},p}(uo);function Oa(g,p){for(var u=0;u0&&t===-1&&(h.logger.log("override startPosition with lastCurrentTime @"+a.toFixed(3)),t=a),this.state=te.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=te.STOPPED},u.stopLoad=function(){this.forceStartLoad=!1,g.prototype.stopLoad.call(this)},u.doTick=function(){switch(this.state){case te.BUFFER_FLUSHING:this.fragLoadError=0;break;case te.IDLE:this._doTickIdle();break;case te.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=te.IDLE);break;case te.FRAG_LOADING_WAITING_RETRY:var a=window.performance.now(),c=this.retryDate;(!c||a>=c||this.media&&this.media.seeking)&&(h.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=te.IDLE);break;case te.ERROR:case te.STOPPED:case te.FRAG_LOADING:case te.PARSING:case te.PARSED:case te.ENDED:break;default:break}this._checkBuffer(),this._checkFragmentChanged()},u._doTickIdle=function(){var t=this.hls,a=t.config,c=this.media;if(!(this.levelLastLoaded===void 0||!c&&(this.startFragRequested||!a.startFragPrefetch))){var _;this.loadedmetadata?_=c.currentTime:_=this.nextLoadPosition;var R=t.nextLoadLevel,T=this.levels[R];if(!!T){var I=T.bitrate,j;I?j=Math.max(8*a.maxBufferSize/I,a.maxBufferLength):j=a.maxBufferLength,j=Math.min(j,a.maxMaxBufferLength);var P=A.bufferInfo(this.mediaBuffer?this.mediaBuffer:c,_,a.maxBufferHole),q=P.len;if(!(q>=j)){h.logger.trace("buffer length of "+q.toFixed(3)+" is below max of "+j.toFixed(3)+". checking for more payload ..."),this.level=t.nextLoadLevel=R;var ae=T.details;if(!ae||ae.live&&this.levelLastLoaded!==R){this.state=te.WAITING_LEVEL;return}if(this._streamEnded(P,ae)){var fe={};this.altAudio&&(fe.type="video"),this.hls.trigger(d.default.BUFFER_EOS,fe),this.state=te.ENDED;return}this._fetchPayloadOrEos(_,P,ae)}}}},u._fetchPayloadOrEos=function(t,a,c){var _=this.fragPrevious,R=this.level,T=c.fragments,I=T.length;if(I!==0){var j=T[0].start,P=T[I-1].start+T[I-1].duration,q=a.end,ae;if(c.initSegment&&!c.initSegment.data)ae=c.initSegment;else if(c.live){var fe=this.config.initialLiveManifestSize;if(Ife&&fe>P.currentTime&&(h.logger.log("buffer end: "+a.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+fe.toFixed(3)),P.currentTime=fe),this.nextLoadPosition=fe}if(t.PTSKnown&&a>_&&P&&P.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(R)if(t.hasProgramDateTime)h.logger.log("live playlist, switching playlist, load frag with same PDT: "+R.programDateTime),q=sr(T,R.endProgramDateTime,j.maxFragLookUpTolerance);else{var De=R.sn+1;if(De>=t.startSN&&De<=t.endSN){var ze=T[De-t.startSN];R.cc===ze.cc&&(q=ze,h.logger.log("live playlist, switching playlist, load frag with next SN: "+q.sn))}q||(q=$.search(T,function(Be){return R.cc-Be.cc}),q&&h.logger.log("live playlist, switching playlist, load frag with same CC: "+q.sn))}q||(q=T[Math.min(I-1,Math.round(I/2))],h.logger.log("live playlist, switching playlist, unknown, load middle frag : "+q.sn))}return q},u._findFragment=function(t,a,c,_,R,T,I){var j=this.hls.config,P;if(RT-j.maxFragLookUpTolerance?0:j.maxFragLookUpTolerance;P=xn(a,_,R,q)}else P=_[c-1];if(P){var ae=P.sn-I.startSN,fe=a&&P.level===a.level,De=_[ae-1],ze=_[ae+1];if(a&&P.sn===a.sn)if(fe&&!P.backtracked)if(P.snj.maxBufferHole&&a.dropped&&ae?(P=De,h.logger.warn("Previous fragment was dropped with large PTS gap between audio and video. Maybe fragment is not starting with a keyframe? Loading previous one to try to overcome this")):(P=ze,h.logger.log("Re-loading fragment with SN: "+P.sn))}else P=null;else P.backtracked&&(ze&&ze.backtracked?(h.logger.warn("Already backtracked from fragment "+ze.sn+", will not backtrack to fragment "+P.sn+". Loading fragment "+ze.sn),P=ze):(h.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),P.dropped=0,De?(P=De,P.backtracked=!0):ae&&(P=null)))}return P},u._loadKey=function(t){this.state=te.KEY_LOADING,this.hls.trigger(d.default.KEY_LOADING,{frag:t})},u._loadFragment=function(t){var a=this.fragmentTracker.getState(t);this.fragCurrent=t,t.sn!=="initSegment"&&(this.startFragRequested=!0),Object(E.isFiniteNumber)(t.sn)&&!t.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),t.backtracked||a===Dt.NOT_LOADED||a===Dt.PARTIAL?(t.autoLevel=this.hls.autoLevelEnabled,t.bitrateTest=this.bitrateTest,this.hls.trigger(d.default.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new le(this.hls,"main")),this.state=te.FRAG_LOADING):a===Dt.APPENDING&&this._reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t)},u.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,C.MAIN)},u.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.endPTS+.5):null},u._checkFragmentChanged=function(){var t,a,c=this.media;if(c&&c.readyState&&c.seeking===!1&&(a=c.currentTime,a>this.lastCurrentTime&&(this.lastCurrentTime=a),A.isBuffered(c,a)?t=this.getBufferedFrag(a):A.isBuffered(c,a+.1)&&(t=this.getBufferedFrag(a+.1)),t)){var _=t;if(_!==this.fragPlaying){this.hls.trigger(d.default.FRAG_CHANGED,{frag:_});var R=_.level;(!this.fragPlaying||this.fragPlaying.level!==R)&&this.hls.trigger(d.default.LEVEL_SWITCHED,{level:R}),this.fragPlaying=_}}},u.immediateLevelSwitch=function(){if(h.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,a;t?(a=t.paused,t.pause()):a=!0,this.previouslyPaused=a}var c=this.fragCurrent;c&&c.loader&&c.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},u.immediateLevelSwitchEnd=function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,A.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())},u.nextLevelSwitch=function(){var t=this.media;if(t&&t.readyState){var a,c,_;if(c=this.getBufferedFrag(t.currentTime),c&&c.startPTS>1&&this.flushMainBuffer(0,c.startPTS-1),t.paused)a=0;else{var R=this.hls.nextLoadLevel,T=this.levels[R],I=this.fragLastKbps;I&&this.fragCurrent?a=this.fragCurrent.duration*T.bitrate/(1e3*I)+1:a=0}if(_=this.getBufferedFrag(t.currentTime+a),_&&(_=this.followingBufferedFrag(_),_)){var j=this.fragCurrent;j&&j.loader&&j.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(_.maxStartPTS,Number.POSITIVE_INFINITY)}}},u.flushMainBuffer=function(t,a){this.state=te.BUFFER_FLUSHING;var c={startOffset:t,endOffset:a};this.altAudio&&(c.type="video"),this.hls.trigger(d.default.BUFFER_FLUSHING,c)},u.onMediaAttached=function(t){var a=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("seeked",this.onvseeked),a.addEventListener("ended",this.onvended);var c=this.config;this.levels&&c.autoStartLoad&&this.hls.startLoad(c.startPosition),this.gapController=new Lr(c,a,this.fragmentTracker,this.hls)},u.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var a=this.levels;a&&a.forEach(function(c){c.details&&c.details.fragments.forEach(function(_){_.backtracked=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("seeked",this.onvseeked),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.fragmentTracker.removeAllFragments(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},u.onMediaSeeked=function(){var t=this.media,a=t?t.currentTime:void 0;Object(E.isFiniteNumber)(a)&&h.logger.log("media seeked to "+a.toFixed(3)),this.tick()},u.onManifestLoading=function(){h.logger.log("trigger BUFFER_RESET"),this.hls.trigger(d.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},u.onManifestParsed=function(t){var a=!1,c=!1,_;t.levels.forEach(function(T){_=T.audioCodec,_&&(_.indexOf("mp4a.40.2")!==-1&&(a=!0),_.indexOf("mp4a.40.5")!==-1&&(c=!0))}),this.audioCodecSwitch=a&&c,this.audioCodecSwitch&&h.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.altAudio=t.altAudio,this.levels=t.levels,this.startFragRequested=!1;var R=this.config;(R.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(R.startPosition)},u.onLevelLoaded=function(t){var a=t.details,c=t.level,_=this.levels[this.levelLastLoaded],R=this.levels[c],T=a.totalduration,I=0;if(h.logger.log("level "+c+" loaded ["+a.startSN+","+a.endSN+"],duration:"+T),a.live){var j=R.details;j&&a.fragments.length>0?(we(j,a),I=a.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(I,j),a.PTSKnown&&Object(E.isFiniteNumber)(I)?h.logger.log("live playlist sliding:"+I.toFixed(3)):(h.logger.log("live playlist - outdated PTS, unknown sliding"),Cn(this.fragPrevious,_,a))):(h.logger.log("live playlist - first load, unknown sliding"),a.PTSKnown=!1,Cn(this.fragPrevious,_,a))}else a.PTSKnown=!1;if(R.details=a,this.levelLastLoaded=c,this.hls.trigger(d.default.LEVEL_UPDATED,{details:a,level:c}),this.startFragRequested===!1){if(this.startPosition===-1||this.lastCurrentTime===-1){var P=a.startTimeOffset;Object(E.isFiniteNumber)(P)?(P<0&&(h.logger.log("negative start time offset "+P+", count from end of last fragment"),P=I+T+P),h.logger.log("start time offset found in playlist, adjust startPosition to "+P),this.startPosition=P):a.live?(this.startPosition=this.computeLivePosition(I,a),h.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===te.WAITING_LEVEL&&(this.state=te.IDLE),this.tick()},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE,this.tick())},u.onFragLoaded=function(t){var a=this.fragCurrent,c=this.hls,_=this.levels,R=this.media,T=t.frag;if(this.state===te.FRAG_LOADING&&a&&T.type==="main"&&T.level===a.level&&T.sn===a.sn){var I=t.stats,j=_[a.level],P=j.details;if(this.bitrateTest=!1,this.stats=I,h.logger.log("Loaded "+a.sn+" of ["+P.startSN+" ,"+P.endSN+"],level "+a.level),T.bitrateTest&&c.nextLoadLevel)this.state=te.IDLE,this.startFragRequested=!1,I.tparsed=I.tbuffered=window.performance.now(),c.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else if(T.sn==="initSegment")this.state=te.IDLE,I.tparsed=I.tbuffered=window.performance.now(),P.initSegment.data=t.payload,c.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else{h.logger.log("Parsing "+a.sn+" of ["+P.startSN+" ,"+P.endSN+"],level "+a.level+", cc "+a.cc),this.state=te.PARSING,this.pendingBuffering=!0,this.appended=!1,T.bitrateTest&&(T.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:T}));var q=!(R&&R.seeking)&&(P.PTSKnown||!P.live),ae=P.initSegment?P.initSegment.data:[],fe=this._getAudioCodec(j),De=this.demuxer=this.demuxer||new le(this.hls,"main");De.push(t.payload,ae,fe,j.videoCodec,a,P.totalduration,q)}}this.fragLoadError=0},u.onFragParsingInitSegment=function(t){var a=this.fragCurrent,c=t.frag;if(a&&t.id==="main"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING){var _=t.tracks,R,T;if(_.audio&&this.altAudio&&delete _.audio,T=_.audio,T){var I=this.levels[this.level].audioCodec,j=navigator.userAgent.toLowerCase();I&&this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),I.indexOf("mp4a.40.5")!==-1?I="mp4a.40.2":I="mp4a.40.5"),this.audioCodecSwitch&&T.metadata.channelCount!==1&&j.indexOf("firefox")===-1&&(I="mp4a.40.5"),j.indexOf("android")!==-1&&T.container!=="audio/mpeg"&&(I="mp4a.40.2",h.logger.log("Android: force audio codec to "+I)),T.levelCodec=I,T.id=t.id}T=_.video,T&&(T.levelCodec=this.levels[this.level].videoCodec,T.id=t.id),this.hls.trigger(d.default.BUFFER_CODECS,_);for(R in _){T=_[R],h.logger.log("main track:"+R+",container:"+T.container+",codecs[level/parsed]=["+T.levelCodec+"/"+T.codec+"]");var P=T.initSegment;P&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(d.default.BUFFER_APPENDING,{type:R,data:P,parent:"main",content:"initSegment"}))}this.tick()}},u.onFragParsingData=function(t){var a=this,c=this.fragCurrent,_=t.frag;if(c&&t.id==="main"&&_.sn===c.sn&&_.level===c.level&&!(t.type==="audio"&&this.altAudio)&&this.state===te.PARSING){var R=this.levels[this.level],T=c;if(Object(E.isFiniteNumber)(t.endPTS)||(t.endPTS=t.startPTS+c.duration,t.endDTS=t.startDTS+c.duration),t.hasAudio===!0&&T.addElementaryStream(ne.AUDIO),t.hasVideo===!0&&T.addElementaryStream(ne.VIDEO),h.logger.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),t.type==="video")if(T.dropped=t.dropped,T.dropped)if(T.backtracked)h.logger.warn("Already backtracked on this fragment, appending with the gap",T.sn);else{var I=R.details;if(I&&T.sn===I.startSN)h.logger.warn("missing video frame(s) on first frag, appending with gap",T.sn);else{h.logger.warn("missing video frame(s), backtracking fragment",T.sn),this.fragmentTracker.removeFragment(T),T.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=te.IDLE,this.fragPrevious=T,this.tick();return}}else T.backtracked=!1;var j=se(R.details,T,t.startPTS,t.endPTS,t.startDTS,t.endDTS),P=this.hls;P.trigger(d.default.LEVEL_PTS_UPDATED,{details:R.details,level:this.level,drift:j,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(q){q&&q.length&&a.state===te.PARSING&&(a.appended=!0,a.pendingBuffering=!0,P.trigger(d.default.BUFFER_APPENDING,{type:t.type,data:q,parent:"main",content:"data"}))}),this.tick()}},u.onFragParsed=function(t){var a=this.fragCurrent,c=t.frag;a&&t.id==="main"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=te.PARSED,this._checkAppendedParsed())},u.onAudioTrackSwitching=function(t){var a=!!t.url,c=t.id;if(!a){if(this.mediaBuffer!==this.media){h.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_.loader&&(h.logger.log("switching to main audio track, cancel main fragment load"),_.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=te.IDLE}var R=this.hls;R.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),R.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:c}),this.altAudio=!1}},u.onAudioTrackSwitched=function(t){var a=t.id,c=!!this.hls.audioTracks[a].url;if(c){var _=this.videoBuffer;_&&this.mediaBuffer!==_&&(h.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=_)}this.altAudio=c,this.tick()},u.onBufferCreated=function(t){var a=t.tracks,c,_,R=!1;for(var T in a){var I=a[T];I.id==="main"?(_=T,c=I,T==="video"&&(this.videoBuffer=a[T].buffer)):R=!0}R&&c?(h.logger.log("alternate track found, use "+_+".buffered to schedule main fragment loading"),this.mediaBuffer=c.buffer):this.mediaBuffer=this.media},u.onBufferAppended=function(t){if(t.parent==="main"){var a=this.state;(a===te.PARSING||a===te.PARSED)&&(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},u._checkAppendedParsed=function(){if(this.state===te.PARSED&&(!this.appended||!this.pendingBuffering)){var t=this.fragCurrent;if(t){var a=this.mediaBuffer?this.mediaBuffer:this.media;h.logger.log("main buffered : "+Wt.toString(a.buffered)),this.fragPrevious=t;var c=this.stats;c.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*c.total/(c.tbuffered-c.tfirst)),this.hls.trigger(d.default.FRAG_BUFFERED,{stats:c,frag:t,id:"main"}),this.state=te.IDLE}this.tick()}},u.onError=function(t){var a=t.frag||this.fragCurrent;if(!(a&&a.type!=="main")){var c=!!this.media&&A.isBuffered(this.media,this.media.currentTime)&&A.isBuffered(this.media,this.media.currentTime+.5);switch(t.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:case v.ErrorDetails.KEY_LOAD_ERROR:case v.ErrorDetails.KEY_LOAD_TIMEOUT:if(!t.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var _=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);h.logger.warn("mediaController: frag loading failed, retry in "+_+" ms"),this.retryDate=window.performance.now()+_,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=te.FRAG_LOADING_WAITING_RETRY}else h.logger.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=te.ERROR;break;case v.ErrorDetails.LEVEL_LOAD_ERROR:case v.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==te.ERROR&&(t.fatal?(this.state=te.ERROR,h.logger.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):!t.levelRetry&&this.state===te.WAITING_LEVEL&&(this.state=te.IDLE));break;case v.ErrorDetails.BUFFER_FULL_ERROR:t.parent==="main"&&(this.state===te.PARSING||this.state===te.PARSED)&&(c?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=te.IDLE):(h.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)));break;default:break}}},u._reduceMaxBufferLength=function(t){var a=this.config;return a.maxMaxBufferLength>=t?(a.maxMaxBufferLength/=2,h.logger.warn("main:reduce max buffer length to "+a.maxMaxBufferLength+"s"),!0):!1},u._checkBuffer=function(){var t=this.media;if(!(!t||t.readyState===0)){var a=this.mediaBuffer?this.mediaBuffer:t,c=a.buffered;!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,c)}},u.onFragLoadEmergencyAborted=function(){this.state=te.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},u.onBufferFlushed=function(){var t=this.mediaBuffer?this.mediaBuffer:this.media;t&&this.fragmentTracker.detectEvictedFragments(ne.VIDEO,t.buffered),this.state=te.IDLE,this.fragPrevious=null},u.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},u._seekToStartPos=function(){var t=this.media,a=t.currentTime,c=t.seeking?a:this.startPosition;a!==c&&c>=0&&(h.logger.log("target start position not buffered, seek to buffered.start(0) "+c+" from current time "+a+" "),t.currentTime=c)},u._getAudioCodec=function(t){var a=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),a&&(a.indexOf("mp4a.40.5")!==-1?a="mp4a.40.2":a="mp4a.40.5")),a},bo(p,[{key:"state",set:function(t){if(this.state!==t){var a=this.state;this._state=t,h.logger.log("main stream-controller: "+a+"->"+t),this.hls.trigger(d.default.STREAM_STATE_TRANSITION,{previousState:a,nextState:t})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var t=this.media;if(t){var a=this.getBufferedFrag(t.currentTime);if(a)return a.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;return t?this.followingBufferedFrag(this.getBufferedFrag(t.currentTime)):null}},{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(t){this._liveSyncPosition=t}}]),p}(Na),vi=Dl;function nu(g,p){for(var u=0;u0){_=a[0].bitrate,a.sort(function(q,ae){return q.bitrate-ae.bitrate}),this._levels=a;for(var P=0;P=0&&t1&&j.loadError0){var a=this.currentLevelIndex,c=t.urlId,_=t.url[c];h.logger.log("Attempt loading level index "+a+" with URL-id "+c),this.hls.trigger(d.default.LEVEL_LOADING,{url:_,level:a,id:c})}}},ru(p,[{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var a=this._levels;a&&(t=Math.min(t,a.length-1),(this.currentLevelIndex!==t||!a[t].details)&&this.setLevelInternal(t))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,this._startLevel===void 0&&(this._startLevel=t),t!==-1&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var t=this.hls.config.startLevel;return t!==void 0?t:this._firstLevel}else return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=t)}}]),p}(b),ou=r("./src/demux/id3.js");function rs(g,p){var u;try{u=new Event("addtrack")}catch{u=document.createEvent("Event"),u.initEvent("addtrack",!1,!1)}u.track=g,p.dispatchEvent(u)}function $o(g){if(g&&g.cues)for(;g.cues.length>0;)g.removeCue(g.cues[0])}function av(g,p){if(pg[g.length-1].endTime)return g[g.length-1];for(var u=0,o=g.length-1;u<=o;){var t=Math.floor((o+u)/2);if(pg[t].endTime)u=t+1;else return g[t]}return g[u].endTime-pj&&(h.logger.warn("detected an id3 sample with endTime < startTime, adjusting endTime to (startTime + 0.25)"),j=I+.25);for(var P=0;P=this.minWeight_},p.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},p.destroy=function(){},g}(),cv=lv;function is(g,p){for(var u=0;u500*c.duration/j){var P=t.levels,q=Math.max(1,T.bw?T.bw/8:T.loaded*1e3/I),ae=P[c.level],fe=ae.realBitrate?Math.max(ae.realBitrate,ae.bitrate):ae.bitrate,De=T.total?T.total:Math.max(T.loaded,Math.round(c.duration*fe/8)),ze=a.currentTime,Be=(De-T.loaded)/q,qe=(A.bufferInfo(a,ze,t.config.maxBufferHole).end-ze)/j;if(qe<2*c.duration/j&&Be>qe){var tt,ht;for(ht=c.level-1;ht>R;ht--){var Pr=P[ht].realBitrate?Math.max(P[ht].realBitrate,P[ht].bitrate):P[ht].bitrate,fr=c.duration*Pr/(8*.8*q);if(fr=_;q--){var ae=P[q];if(!!ae){var fe=ae.details,De=fe?fe.totalduration/fe.fragments.length:a,ze=fe?fe.live:!1,Be=void 0;q<=t?Be=I*c:Be=j*c;var qe=P[q].realBitrate?Math.max(P[q].realBitrate,P[q].bitrate):P[q].bitrate,tt=qe*De/Be;if(h.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+q+"/"+Math.round(Be)+"/"+qe+"/"+De+"/"+T+"/"+tt),Be>qe&&(!tt||ze&&!this.bitrateTestDelay||tt=0)return De;h.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var ze=j?Math.min(j,_.maxStarvationDelay):_.maxStarvationDelay,Be=_.abrBandWidthFactor,qe=_.abrBandWidthUpFactor;if(fe===0){var tt=this.bitrateTestDelay;if(tt){var ht=j?Math.min(j,_.maxLoadingDelay):_.maxLoadingDelay;ze=ht-tt,h.logger.trace("bitrate test took "+Math.round(1e3*tt)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*ze)+" ms"),Be=qe=1}}return De=this._findBestLevel(I,j,ae,R,a,fe+ze,Be,qe,c),Math.max(De,0)}}]),p}(b),pv=vv;function mv(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var ls=W(),_v=function(g){mv(p,g);function p(o){var t;return t=g.call(this,o,d.default.MEDIA_ATTACHING,d.default.MEDIA_DETACHING,d.default.MANIFEST_PARSED,d.default.BUFFER_RESET,d.default.BUFFER_APPENDING,d.default.BUFFER_CODECS,d.default.BUFFER_EOS,d.default.BUFFER_FLUSHING,d.default.LEVEL_PTS_UPDATED,d.default.LEVEL_UPDATED)||this,t._msDuration=null,t._levelDuration=null,t._levelTargetDuration=10,t._live=null,t._objectUrl=null,t._needsFlush=!1,t._needsEos=!1,t.config=void 0,t.audioTimestampOffset=void 0,t.bufferCodecEventsExpected=0,t._bufferCodecEventsTotal=0,t.media=null,t.mediaSource=null,t.segments=[],t.parent=void 0,t.appending=!1,t.appended=0,t.appendError=0,t.flushBufferCounter=0,t.tracks={},t.pendingTracks={},t.sourceBuffer={},t.flushRange=[],t._onMediaSourceOpen=function(){h.logger.log("media source opened"),t.hls.trigger(d.default.MEDIA_ATTACHED,{media:t.media});var a=t.mediaSource;a&&a.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},t._onMediaSourceClose=function(){h.logger.log("media source closed")},t._onMediaSourceEnded=function(){h.logger.log("media source ended")},t._onSBUpdateEnd=function(){if(t.audioTimestampOffset&&t.sourceBuffer.audio){var a=t.sourceBuffer.audio;h.logger.warn("change mpeg audio timestamp offset from "+a.timestampOffset+" to "+t.audioTimestampOffset),a.timestampOffset=t.audioTimestampOffset,delete t.audioTimestampOffset}t._needsFlush&&t.doFlush(),t._needsEos&&t.checkEos(),t.appending=!1;var c=t.parent,_=t.segments.reduce(function(P,q){return q.parent===c?P+1:P},0),R={},T=t.sourceBuffer;for(var I in T){var j=T[I];if(!j)throw Error("handling source buffer update end error: source buffer for "+I+" uninitilized and unable to update buffered TimeRanges.");R[I]=j.buffered}t.hls.trigger(d.default.BUFFER_APPENDED,{parent:c,pending:_,timeRanges:R}),t._needsFlush||t.doAppending(),t.updateMediaElementDuration(),_===0&&t.flushLiveBackBuffer()},t._onSBUpdateError=function(a){h.logger.error("sourceBuffer error:",a),t.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},t.config=o.config,t}var u=p.prototype;return u.destroy=function(){b.prototype.destroy.call(this)},u.onLevelPtsUpdated=function(t){var a=t.type,c=this.tracks.audio;if(a==="audio"&&c&&c.container==="audio/mpeg"){var _=this.sourceBuffer.audio;if(!_)throw Error("Level PTS Updated and source buffer for audio uninitalized");var R=Math.abs(_.timestampOffset-t.start);if(R>.1){var T=_.updating;try{_.abort()}catch(I){h.logger.warn("can not abort audio buffer: "+I)}T?this.audioTimestampOffset=t.start:(h.logger.warn("change mpeg audio timestamp offset from "+_.timestampOffset+" to "+t.start),_.timestampOffset=t.start)}}},u.onManifestParsed=function(t){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t.altAudio?2:1,h.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},u.onMediaAttaching=function(t){var a=this.media=t.media;if(a&&ls){var c=this.mediaSource=new ls;c.addEventListener("sourceopen",this._onMediaSourceOpen),c.addEventListener("sourceended",this._onMediaSourceEnded),c.addEventListener("sourceclose",this._onMediaSourceClose),a.src=window.URL.createObjectURL(c),this._objectUrl=a.src}},u.onMediaDetaching=function(){h.logger.log("media source detaching");var t=this.mediaSource;if(t){if(t.readyState==="open")try{t.endOfStream()}catch(a){h.logger.warn("onMediaDetaching:"+a.message+" while calling endOfStream")}t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.media&&(this._objectUrl&&window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):h.logger.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.hls.trigger(d.default.MEDIA_DETACHED)},u.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,a=this.pendingTracks,c=Object.keys(a).length;(c&&!t||c===2)&&(this.createSourceBuffers(a),this.pendingTracks={},this.doAppending())},u.onBufferReset=function(){var t=this.sourceBuffer;for(var a in t){var c=t[a];try{c&&(this.mediaSource&&this.mediaSource.removeSourceBuffer(c),c.removeEventListener("updateend",this._onSBUpdateEnd),c.removeEventListener("error",this._onSBUpdateError))}catch{}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},u.onBufferCodecs=function(t){var a=this;Object.keys(this.sourceBuffer).length||(Object.keys(t).forEach(function(c){a.pendingTracks[c]=t[c]}),this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())},u.createSourceBuffers=function(t){var a=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");for(var _ in t)if(!a[_]){var R=t[_];if(!R)throw Error("source buffer exists for track "+_+", however track does not");var T=R.levelCodec||R.codec,I=R.container+";codecs="+T;h.logger.log("creating sourceBuffer("+I+")");try{var j=a[_]=c.addSourceBuffer(I);j.addEventListener("updateend",this._onSBUpdateEnd),j.addEventListener("error",this._onSBUpdateError),this.tracks[_]={buffer:j,codec:T,id:R.id,container:R.container,levelCodec:R.levelCodec}}catch(P){h.logger.error("error while trying to add sourceBuffer:"+P.message),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:P,mimeType:I})}}this.hls.trigger(d.default.BUFFER_CREATED,{tracks:this.tracks})},u.onBufferAppending=function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())},u.onBufferEos=function(t){for(var a in this.sourceBuffer)if(!t.type||t.type===a){var c=this.sourceBuffer[a];c&&!c.ended&&(c.ended=!0,h.logger.log(a+" sourceBuffer now EOS"))}this.checkEos()},u.checkEos=function(){var t=this.sourceBuffer,a=this.mediaSource;if(!a||a.readyState!=="open"){this._needsEos=!1;return}for(var c in t){var _=t[c];if(!!_){if(!_.ended)return;if(_.updating){this._needsEos=!0;return}}}h.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{a.endOfStream()}catch{h.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},u.onBufferFlushing=function(t){t.type?this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}):(this.flushRange.push({start:t.startOffset,end:t.endOffset,type:"video"}),this.flushRange.push({start:t.startOffset,end:t.endOffset,type:"audio"})),this.flushBufferCounter=0,this.doFlush()},u.flushLiveBackBuffer=function(){if(!!this._live){var t=this.config.liveBackBufferLength;if(!(!isFinite(t)||t<0)){if(!this.media){h.logger.error("flushLiveBackBuffer called without attaching media");return}for(var a=this.media.currentTime,c=this.sourceBuffer,_=Object.keys(c),R=a-Math.max(t,this._levelTargetDuration),T=_.length-1;T>=0;T--){var I=_[T],j=c[I];if(j){var P=j.buffered;P.length>0&&R>P.start(0)&&this.removeBufferRange(I,j,0,R)&&this.hls.trigger(d.default.LIVE_BACK_BUFFER_REACHED,{bufferEnd:R})}}}}},u.onLevelUpdated=function(t){var a=t.details;a.fragments.length>0&&(this._levelDuration=a.totalduration+a.fragments[0].start,this._levelTargetDuration=a.averagetargetduration||a.targetduration||10,this._live=a.live,this.updateMediaElementDuration())},u.updateMediaElementDuration=function(){var t=this.config,a;if(!(this._levelDuration===null||!this.media||!this.mediaSource||!this.sourceBuffer||this.media.readyState===0||this.mediaSource.readyState!=="open")){for(var c in this.sourceBuffer){var _=this.sourceBuffer[c];if(_&&_.updating===!0)return}a=this.media.duration,this._msDuration===null&&(this._msDuration=this.mediaSource.duration),this._live===!0&&t.liveDurationInfinity===!0?(h.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>a||!Object(E.isFiniteNumber)(a))&&(h.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},u.doFlush=function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(this.flushBuffer(t.start,t.end,t.type))this.flushRange.shift(),this.flushBufferCounter=0;else{this._needsFlush=!0;return}}if(this.flushRange.length===0){this._needsFlush=!1;var a=0,c=this.sourceBuffer;try{for(var _ in c){var R=c[_];R&&(a+=R.buffered.length)}}catch{h.logger.error("error while accessing sourceBuffer.buffered")}this.appended=a,this.hls.trigger(d.default.BUFFER_FLUSHED)}},u.doAppending=function(){var t=this.config,a=this.hls,c=this.segments,_=this.sourceBuffer;if(!!Object.keys(_).length){if(!this.media||this.media.error){this.segments=[],h.logger.error("trying to append although a media error occured, flush segment and abort");return}if(!this.appending){var R=c.shift();if(!!R)try{var T=_[R.type];if(!T){this._onSBUpdateEnd();return}if(T.updating){c.unshift(R);return}T.ended=!1,this.parent=R.parent,T.appendBuffer(R.data),this.appendError=0,this.appended++,this.appending=!0}catch(j){h.logger.error("error while trying to append buffer:"+j.message),c.unshift(R);var I={type:v.ErrorTypes.MEDIA_ERROR,parent:R.parent,details:"",fatal:!1};j.code===22?(this.segments=[],I.details=v.ErrorDetails.BUFFER_FULL_ERROR):(this.appendError++,I.details=v.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>t.appendErrorMaxRetry&&(h.logger.log("fail "+t.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],I.fatal=!0)),a.trigger(d.default.ERROR,I)}}}},u.flushBuffer=function(t,a,c){var _=this.sourceBuffer;if(!Object.keys(_).length)return!0;var R="null";if(this.media&&(R=this.media.currentTime.toFixed(3)),h.logger.log("flushBuffer,pos/start/end: "+R+"/"+t+"/"+a),this.flushBufferCounter>=this.appended)return h.logger.warn("abort flushing too many retries"),!0;var T=_[c];if(T){if(T.ended=!1,T.updating)return h.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(c,T,t,a))return this.flushBufferCounter++,!1}return h.logger.log("buffer flushed"),!0},u.removeBufferRange=function(t,a,c,_){try{for(var R=0;R.5){var q="null";return this.media&&(q=this.media.currentTime.toString()),h.logger.log("sb remove "+t+" ["+j+","+P+"], of ["+T+","+I+"], pos:"+q),a.remove(j,P),!0}}}catch(ae){h.logger.warn("removeBufferRange failed",ae)}return!1},p}(b),hv=_v;function cs(g,p){for(var u=0;uthis.autoLevelCapping&&a.streamController.nextLevelSwitch(),this.autoLevelCapping=a.autoLevelCapping}}},u.getMaxLevel=function(t){var a=this;if(!this.levels)return-1;var c=this.levels.filter(function(_,R){return p.isLevelAllowed(R,a.restrictedLevels)&&R<=t});return p.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},u.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},u.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},p.isLevelAllowed=function(t,a){return a===void 0&&(a=[]),a.indexOf(t)===-1},p.getMaxLevelByMediaSize=function(t,a,c){if(!t||t&&!t.length)return-1;for(var _=function(P,q){return q?P.width!==q.width||P.height!==q.height:!0},R=t.length-1,T=0;T=a||I.height>=c)&&_(I,t[T+1])){R=T;break}}return R},gv(p,[{key:"mediaWidth",get:function(){var t,a=this.media;return a&&(t=a.width||a.clientWidth||a.offsetWidth,t*=p.contentScaleFactor),t}},{key:"mediaHeight",get:function(){var t,a=this.media;return a&&(t=a.height||a.clientHeight||a.offsetHeight,t*=p.contentScaleFactor),t}}],[{key:"contentScaleFactor",get:function(){var t=1;try{t=window.devicePixelRatio}catch{}return t}}]),p}(b),ss=Dv;function yv(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var wo=window,Rv=wo.performance,El=function(g){yv(p,g);function p(o){return g.call(this,o,d.default.MEDIA_ATTACHING)||this}var u=p.prototype;return u.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},u.onMediaAttaching=function(t){var a=this.hls.config;if(a.capLevelOnFPSDrop){var c=this.video=t.media instanceof window.HTMLVideoElement?t.media:null;typeof c.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),a.fpsDroppedMonitoringPeriod)}},u.checkFPS=function(t,a,c){var _=Rv.now();if(a){if(this.lastTime){var R=_-this.lastTime,T=c-this.lastDroppedFrames,I=a-this.lastDecodedFrames,j=1e3*T/R,P=this.hls;if(P.trigger(d.default.FPS_DROP,{currentDropped:T,currentDecoded:I,totalDroppedFrames:c}),j>0&&T>P.config.fpsDroppedMonitoringThreshold*I){var q=P.currentLevel;h.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+q),q>0&&(P.autoLevelCapping===-1||P.autoLevelCapping>=q)&&(q=q-1,P.trigger(d.default.FPS_DROP_LEVEL_CAPPING,{level:q,droppedLevel:P.currentLevel}),P.autoLevelCapping=q,P.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=c,this.lastDecodedFrames=a}},u.checkFPSInterval=function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var a=t.getVideoPlaybackQuality();this.checkFPS(t,a.totalVideoFrames,a.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},p}(b),Tv=El,fs=window,bl=fs.performance,Ev=fs.XMLHttpRequest,bv=function(){function g(u){u&&u.xhrSetup&&(this.xhrSetup=u.xhrSetup)}var p=g.prototype;return p.destroy=function(){this.abort(),this.loader=null},p.abort=function(){var o=this.loader;o&&o.readyState!==4&&(this.stats.aborted=!0,o.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},p.load=function(o,t,a){this.context=o,this.config=t,this.callbacks=a,this.stats={trequest:bl.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()},p.loadInternal=function(){var o,t=this.context;o=this.loader=new Ev;var a=this.stats;a.tfirst=0,a.loaded=0;var c=this.xhrSetup;try{if(c)try{c(o,t.url)}catch{o.open("GET",t.url,!0),c(o,t.url)}o.readyState||o.open("GET",t.url,!0)}catch(_){this.callbacks.onError({code:o.status,text:_.message},t,o);return}t.rangeEnd&&o.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),o.send()},p.readystatechange=function(o){var t=o.currentTarget,a=t.readyState,c=this.stats,_=this.context,R=this.config;if(!c.aborted&&a>=2)if(window.clearTimeout(this.requestTimeout),c.tfirst===0&&(c.tfirst=Math.max(bl.now(),c.trequest)),a===4){var T=t.status;if(T>=200&&T<300){c.tload=Math.max(c.tfirst,bl.now());var I,j;_.responseType==="arraybuffer"?(I=t.response,j=I.byteLength):(I=t.responseText,j=I.length),c.loaded=c.total=j;var P={url:t.responseURL,data:I};this.callbacks.onSuccess(P,c,_,t)}else c.retry>=R.maxRetry||T>=400&&T<499?(h.logger.error(T+" while loading "+_.url),this.callbacks.onError({code:T,text:t.statusText},_,t)):(h.logger.warn(T+" while loading "+_.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,R.maxRetryDelay),c.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),R.timeout)},p.loadtimeout=function(){h.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},p.loadprogress=function(o){var t=o.currentTarget,a=this.stats;a.loaded=o.loaded,o.lengthComputable&&(a.total=o.total);var c=this.callbacks.onProgress;c&&c(a,this.context,null,t)},g}(),Fl=bv;function ds(g,p){for(var u=0;u=this.tracks.length){h.logger.warn("Invalid audio track id:",t.id);return}if(h.logger.log("audioTrack "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.hasInterval()){var a=t.details.targetduration*1e3;this.setInterval(a)}!t.details.live&&this.hasInterval()&&this.clearInterval()},u.onAudioTrackSwitched=function(t){var a=this.tracks[t.id].groupId;a&&this.audioGroupId!==a&&(this.audioGroupId=a)},u.onLevelLoaded=function(t){this._selectAudioGroup(t.level)},u.onError=function(t){t.type===v.ErrorTypes.NETWORK_ERROR&&(t.fatal&&this.clearInterval(),t.details===v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&(h.logger.warn("Network failure on audio-track id:",t.context.id),this._handleLoadError()))},u._setAudioTrack=function(t){if(this._trackId===t&&this.tracks[this._trackId].details){h.logger.debug("Same id as current audio-track passed, and track details available -> no-op");return}if(t<0||t>=this.tracks.length){h.logger.warn("Invalid id passed to audio-track controller");return}var a=this.tracks[t];h.logger.log("Now switching to audio-track index "+t),this.clearInterval(),this._trackId=t;var c=a.url,_=a.type,R=a.id;this.hls.trigger(d.default.AUDIO_TRACK_SWITCHING,{id:R,type:_,url:c}),this._loadTrackDetailsIfNeeded(a)},u.doTick=function(){this._updateTrack(this._trackId)},u._selectAudioGroup=function(t){var a=this.hls.levels[t];if(!(!a||!a.audioGroupIds)){var c=a.audioGroupIds[a.urlId];this.audioGroupId!==c&&(this.audioGroupId=c,this._selectInitialAudioTrack())}},u._selectInitialAudioTrack=function(){var t=this,a=this.tracks;if(!!a.length){var c=this.tracks[this._trackId],_=null;if(c&&(_=c.name),this._selectDefaultTrack){var R=a.filter(function(j){return j.default});R.length?a=R:h.logger.warn("No default audio tracks defined")}var T=!1,I=function(){a.forEach(function(P){T||(!t.audioGroupId||P.groupId===t.audioGroupId)&&(!_||_===P.name)&&(t._setAudioTrack(P.id),T=!0)})};I(),T||(_=null,I()),T||(h.logger.error("No track found for running audio group-ID: "+this.audioGroupId),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))}},u._needsTrackLoading=function(t){var a=t.details,c=t.url;return!a||a.live?!!c:!1},u._loadTrackDetailsIfNeeded=function(t){if(this._needsTrackLoading(t)){var a=t.url,c=t.id;h.logger.log("loading audio-track playlist for id: "+c),this.hls.trigger(d.default.AUDIO_TRACK_LOADING,{url:a,id:c})}},u._updateTrack=function(t){if(!(t<0||t>=this.tracks.length)){this.clearInterval(),this._trackId=t,h.logger.log("trying to update audio-track "+t);var a=this.tracks[t];this._loadTrackDetailsIfNeeded(a)}},u._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var t=this._trackId,a=this.tracks[t],c=a.name,_=a.language,R=a.groupId;h.logger.warn("Loading failed on audio track id: "+t+", group-id: "+R+', name/language: "'+c+'" / "'+_+'"');for(var T=t,I=0;I0&&t===-1?(h.logger.log("audio:override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=te.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:t,this.state=te.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=t,this.state=te.STOPPED},u.doTick=function(){var t,a,c,_=this.hls,R=_.config;switch(this.state){case te.ERROR:case te.PAUSED:case te.BUFFER_FLUSHING:break;case te.STARTING:this.state=te.WAITING_TRACK,this.loadedmetadata=!1;break;case te.IDLE:var T=this.tracks;if(!T||!this.media&&(this.startFragRequested||!R.startFragPrefetch))break;if(this.loadedmetadata)t=this.media.currentTime;else if(t=this.nextLoadPosition,t===void 0)break;var I=this.mediaBuffer?this.mediaBuffer:this.media,j=this.videoBuffer?this.videoBuffer:this.media,P=A.bufferInfo(I,t,R.maxBufferHole),q=A.bufferInfo(j,t,R.maxBufferHole),ae=P.len,fe=P.end,De=this.fragPrevious,ze=Math.min(R.maxBufferLength,R.maxMaxBufferLength),Be=Math.max(ze,q.len),qe=this.audioSwitch,tt=this.trackId;if((aefr||P.nextStart)h.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=fr+.05;else return}if(c.initSegment&&!c.initSegment.data)jt=c.initSegment;else if(fe<=fr){if(jt=ht[0],this.videoTrackCC!==null&&jt.cc!==this.videoTrackCC&&(jt=nn(ht,this.videoTrackCC)),c.live&&jt.loadIdx&&jt.loadIdx===this.fragLoadIdx){var kt=P.nextStart?P.nextStart:fr;h.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(kt+.05)),this.media.currentTime=kt+.05;return}}else{var mt,er=R.maxFragLookUpTolerance,su=De?ht[De.sn-ht[0].sn+1]:void 0,fu=function(Al){var yh=Math.min(er,Al.duration);return Al.start+Al.duration-yh<=fe?1:Al.start-yh>fe&&Al.start?-1:0};fera-er&&(er=0),su&&!fu(su)?mt=su:mt=$.search(ht,fu)):mt=ht[Pr-1],mt&&(jt=mt,fr=mt.start,De&&jt.level===De.level&&jt.sn===De.sn&&(jt.sn=hh||Fb)&&(h.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=te.IDLE);break;case te.WAITING_INIT_PTS:var op=this.videoTrackCC;if(this.initPTS[op]===void 0)break;var gh=this.waitingFragment;if(gh){var Dh=gh.frag.cc;op!==Dh?(a=this.tracks[this.trackId],a.details&&a.details.live&&(h.logger.warn("Waiting fragment CC ("+Dh+") does not match video track CC ("+op+")"),this.waitingFragment=null,this.state=te.IDLE)):(this.state=te.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=te.IDLE;break;case te.STOPPED:case te.FRAG_LOADING:case te.PARSING:case te.PARSED:case te.ENDED:break;default:break}},u.onMediaAttached=function(t){var a=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("ended",this.onvended);var c=this.config;this.tracks&&c.autoStartLoad&&this.startLoad(c.startPosition)},u.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},u.onAudioTracksUpdated=function(t){h.logger.log("audio tracks updated"),this.tracks=t.audioTracks},u.onAudioTrackSwitching=function(t){var a=!!t.url;this.trackId=t.id,this.fragCurrent=null,this.state=te.PAUSED,this.waitingFragment=null,a?this.setInterval(ms):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),a&&(this.audioSwitch=!0,this.state=te.IDLE),this.tick()},u.onAudioTrackLoaded=function(t){var a=t.details,c=t.id,_=this.tracks[c],R=a.totalduration,T=0;if(h.logger.log("track "+c+" loaded ["+a.startSN+","+a.endSN+"],duration:"+R),a.live){var I=_.details;I&&a.fragments.length>0?(we(I,a),T=a.fragments[0].start,a.PTSKnown?h.logger.log("live audio playlist sliding:"+T.toFixed(3)):h.logger.log("live audio playlist - outdated PTS, unknown sliding")):(a.PTSKnown=!1,h.logger.log("live audio playlist - first load, unknown sliding"))}else a.PTSKnown=!1;if(_.details=a,!this.startFragRequested){if(this.startPosition===-1){var j=a.startTimeOffset;Object(E.isFiniteNumber)(j)?(h.logger.log("start time offset found in playlist, adjust startPosition to "+j),this.startPosition=j):a.live?(this.startPosition=this.computeLivePosition(T,a),h.logger.log("compute startPosition for audio-track to "+this.startPosition)):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===te.WAITING_TRACK&&(this.state=te.IDLE),this.tick()},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE,this.tick())},u.onFragLoaded=function(t){var a=this.fragCurrent,c=t.frag;if(this.state===te.FRAG_LOADING&&a&&c.type==="audio"&&c.level===a.level&&c.sn===a.sn){var _=this.tracks[this.trackId],R=_.details,T=R.totalduration,I=a.level,j=a.sn,P=a.cc,q=this.config.defaultAudioCodec||_.audioCodec||"mp4a.40.2",ae=this.stats=t.stats;if(j==="initSegment")this.state=te.IDLE,ae.tparsed=ae.tbuffered=Wa.now(),R.initSegment.data=t.payload,this.hls.trigger(d.default.FRAG_BUFFERED,{stats:ae,frag:a,id:"audio"}),this.tick();else{this.state=te.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new le(this.hls,"audio"));var fe=this.initPTS[P],De=R.initSegment?R.initSegment.data:[];if(R.initSegment||fe!==void 0){this.pendingBuffering=!0,h.logger.log("Demuxing "+j+" of ["+R.startSN+" ,"+R.endSN+"],track "+I);var ze=!1;this.demuxer.push(t.payload,De,q,null,a,T,ze,fe)}else h.logger.log("unknown video PTS for continuity counter "+P+", waiting for video PTS before demuxing audio frag "+j+" of ["+R.startSN+" ,"+R.endSN+"],track "+I),this.waitingFragment=t,this.state=te.WAITING_INIT_PTS}}this.fragLoadError=0},u.onFragParsingInitSegment=function(t){var a=this.fragCurrent,c=t.frag;if(a&&t.id==="audio"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING){var _=t.tracks,R;if(_.video&&delete _.video,R=_.audio,R){R.levelCodec=R.codec,R.id=t.id,this.hls.trigger(d.default.BUFFER_CODECS,_),h.logger.log("audio track:audio,container:"+R.container+",codecs[level/parsed]=["+R.levelCodec+"/"+R.codec+"]");var T=R.initSegment;if(T){var I={type:"audio",data:T,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[I]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(d.default.BUFFER_APPENDING,I))}this.tick()}}},u.onFragParsingData=function(t){var a=this,c=this.fragCurrent,_=t.frag;if(c&&t.id==="audio"&&t.type==="audio"&&_.sn===c.sn&&_.level===c.level&&this.state===te.PARSING){var R=this.trackId,T=this.tracks[R],I=this.hls;Object(E.isFiniteNumber)(t.endPTS)||(t.endPTS=t.startPTS+c.duration,t.endDTS=t.startDTS+c.duration),c.addElementaryStream(ne.AUDIO),h.logger.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),se(T.details,c,t.startPTS,t.endPTS);var j=this.audioSwitch,P=this.media,q=!1;if(j)if(P&&P.readyState){var ae=P.currentTime;h.logger.log("switching audio track : currentTime:"+ae),ae>=t.startPTS&&(h.logger.log("switching audio track : flushing all audio"),this.state=te.BUFFER_FLUSHING,I.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),q=!0,this.audioSwitch=!1,I.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:R}))}else this.audioSwitch=!1,I.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:R});var fe=this.pendingData;if(!fe){h.logger.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),I.trigger(d.default.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:null,fatal:!0});return}this.audioSwitch||([t.data1,t.data2].forEach(function(De){De&&De.length&&fe.push({type:t.type,data:De,parent:"audio",content:"data"})}),!q&&fe.length&&(fe.forEach(function(De){a.state===te.PARSING&&(a.pendingBuffering=!0,a.hls.trigger(d.default.BUFFER_APPENDING,De))}),this.pendingData=[],this.appended=!0)),this.tick()}},u.onFragParsed=function(t){var a=this.fragCurrent,c=t.frag;a&&t.id==="audio"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING&&(this.stats.tparsed=Wa.now(),this.state=te.PARSED,this._checkAppendedParsed())},u.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},u.onBufferCreated=function(t){var a=t.tracks.audio;a&&(this.mediaBuffer=a.buffer,this.loadedmetadata=!0),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},u.onBufferAppended=function(t){if(t.parent==="audio"){var a=this.state;(a===te.PARSING||a===te.PARSED)&&(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},u._checkAppendedParsed=function(){if(this.state===te.PARSED&&(!this.appended||!this.pendingBuffering)){var t=this.fragCurrent,a=this.stats,c=this.hls;if(t){this.fragPrevious=t,a.tbuffered=Wa.now(),c.trigger(d.default.FRAG_BUFFERED,{stats:a,frag:t,id:"audio"});var _=this.mediaBuffer?this.mediaBuffer:this.media;_&&h.logger.log("audio buffered : "+Wt.toString(_.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,c.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=te.IDLE}this.tick()}},u.onError=function(t){var a=t.frag;if(!(a&&a.type!=="audio"))switch(t.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:var c=t.frag;if(c&&c.type!=="audio")break;if(!t.fatal){var _=this.fragLoadError;_?_++:_=1;var R=this.config;if(_<=R.fragLoadingMaxRetry){this.fragLoadError=_;var T=Math.min(Math.pow(2,_-1)*R.fragLoadingRetryDelay,R.fragLoadingMaxRetryTimeout);h.logger.warn("AudioStreamController: frag loading failed, retry in "+T+" ms"),this.retryDate=Wa.now()+T,this.state=te.FRAG_LOADING_WAITING_RETRY}else h.logger.error("AudioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=te.ERROR}break;case v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case v.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case v.ErrorDetails.KEY_LOAD_ERROR:case v.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==te.ERROR&&(this.state=t.fatal?te.ERROR:te.IDLE,h.logger.warn("AudioStreamController: "+t.details+" while loading frag, now switching to "+this.state+" state ..."));break;case v.ErrorDetails.BUFFER_FULL_ERROR:if(t.parent==="audio"&&(this.state===te.PARSING||this.state===te.PARSED)){var I=this.mediaBuffer,j=this.media.currentTime,P=I&&A.isBuffered(I,j)&&A.isBuffered(I,j+.5);if(P){var q=this.config;q.maxMaxBufferLength>=q.maxBufferLength&&(q.maxMaxBufferLength/=2,h.logger.warn("AudioStreamController: reduce max buffer length to "+q.maxMaxBufferLength+"s")),this.state=te.IDLE}else h.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=te.BUFFER_FLUSHING,this.hls.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}break;default:break}},u.onBufferFlushed=function(){var t=this,a=this.pendingData;a&&a.length?(h.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),a.forEach(function(c){t.hls.trigger(d.default.BUFFER_APPENDING,c)}),this.appended=!0,this.pendingData=[],this.state=te.PARSED):(this.state=te.IDLE,this.fragPrevious=null,this.tick())},pi(p,[{key:"state",set:function(t){if(this.state!==t){var a=this.state;this._state=t,h.logger.log("audio stream:"+a+"->"+t)}},get:function(){return this._state}}]),p}(Na),Sv=Mv,_s=function(){if(typeof window!="undefined"&&window.VTTCue)return window.VTTCue;var g="auto",p={"":!0,lr:!0,rl:!0},u={start:!0,middle:!0,end:!0,left:!0,right:!0};function o(_){if(typeof _!="string")return!1;var R=p[_.toLowerCase()];return R?_.toLowerCase():!1}function t(_){if(typeof _!="string")return!1;var R=u[_.toLowerCase()];return R?_.toLowerCase():!1}function a(_){for(var R=1;R100)throw new Error("Position must be between 0 and 100.");Pr=mt,this.hasBeenReset=!0}})),Object.defineProperty(I,"positionAlign",a({},j,{get:function(){return fr},set:function(mt){var er=t(mt);if(!er)throw new SyntaxError("An invalid or illegal string was specified.");fr=er,this.hasBeenReset=!0}})),Object.defineProperty(I,"size",a({},j,{get:function(){return ra},set:function(mt){if(mt<0||mt>100)throw new Error("Size must be between 0 and 100.");ra=mt,this.hasBeenReset=!0}})),Object.defineProperty(I,"align",a({},j,{get:function(){return jt},set:function(mt){var er=t(mt);if(!er)throw new SyntaxError("An invalid or illegal string was specified.");jt=er,this.hasBeenReset=!0}})),I.displayState=void 0}return c.prototype.getCueAsHTML=function(){var _=window.WebVTT;return _.convertCueToDOMTree(window,this.text)},c}(),Iv=function(){return{decode:function(u){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))}}};function hs(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new Iv,this.regionList=[]}function Lv(g){function p(o,t,a,c){return(o|0)*3600+(t|0)*60+(a|0)+(c|0)/1e3}var u=g.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return u?u[3]?p(u[1],u[2],u[3].replace(":",""),u[4]):u[1]>59?p(u[1],u[2],0,u[4]):p(0,u[1],u[2],u[4]):null}function gs(){this.values=Object.create(null)}gs.prototype={set:function(p,u){!this.get(p)&&u!==""&&(this.values[p]=u)},get:function(p,u,o){return o?this.has(p)?this.values[p]:u[o]:this.has(p)?this.values[p]:u},has:function(p){return p in this.values},alt:function(p,u,o){for(var t=0;t=0&&u<=100)?(this.set(p,u),!0):!1}};function Ds(g,p,u,o){var t=o?g.split(o):[g];for(var a in t)if(typeof t[a]=="string"){var c=t[a].split(u);if(c.length===2){var _=c[0],R=c[1];p(_,R)}}}var mi=new _s(0,0,0),na=mi.align==="middle"?"middle":"center";function Av(g,p,u){var o=g;function t(){var _=Lv(g);if(_===null)throw new Error("Malformed timestamp: "+o);return g=g.replace(/^[^\sa-zA-Z-]+/,""),_}function a(_,R){var T=new gs;Ds(_,function(P,q){switch(P){case"region":for(var ae=u.length-1;ae>=0;ae--)if(u[ae].id===q){T.set(P,u[ae].region);break}break;case"vertical":T.alt(P,q,["rl","lr"]);break;case"line":var fe=q.split(","),De=fe[0];T.integer(P,De),T.percent(P,De)&&T.set("snapToLines",!1),T.alt(P,De,["auto"]),fe.length===2&&T.alt("lineAlign",fe[1],["start",na,"end"]);break;case"position":fe=q.split(","),T.percent(P,fe[0]),fe.length===2&&T.alt("positionAlign",fe[1],["start",na,"end","line-left","line-right","auto"]);break;case"size":T.percent(P,q);break;case"align":T.alt(P,q,["start",na,"end","left","right"]);break}},/:/,/\s/),R.region=T.get("region",null),R.vertical=T.get("vertical","");var I=T.get("line","auto");I==="auto"&&mi.line===-1&&(I=-1),R.line=I,R.lineAlign=T.get("lineAlign","start"),R.snapToLines=T.get("snapToLines",!0),R.size=T.get("size",100),R.align=T.get("align",na);var j=T.get("position","auto");j==="auto"&&mi.position===50&&(j=R.align==="start"||R.align==="left"?0:R.align==="end"||R.align==="right"?100:50),R.position=j}function c(){g=g.replace(/^\s+/,"")}if(c(),p.startTime=t(),c(),g.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);g=g.substr(3),c(),p.endTime=t(),c(),a(g,p)}function ys(g){return g.replace(//gi,` `)}hs.prototype={parse:function(p){var u=this;p&&(u.buffer+=u.decoder.decode(p,{stream:!0}));function o(){var T=u.buffer,I=0;for(T=ys(T);I")===-1){u.cue.id=a;continue}case"CUE":try{Av(a,u.cue,u.regionList)}catch{u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":var R=a.indexOf("-->")!==-1;if(!a||R&&(_=!0)){u.oncue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}u.cue.text&&(u.cue.text+=` `),u.cue.text+=a;continue;case"BADCUE":a||(u.state="ID");continue}}}catch{u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var p=this;try{if(p.buffer+=p.decoder.decode(),(p.cue||p.state==="HEADER")&&(p.buffer+=` `,p.parse()),p.state==="INITIAL")throw new Error("Malformed WebVTT signature.")}catch(u){throw u}return p.onflush&&p.onflush(),this}};var Pv=hs;function jv(g,p,u,o){for(var t,a,c,_,R,T=window.VTTCue||TextTrackCue,I=0;I=16?_--:_++,navigator.userAgent.match(/Firefox\//)?a.line=I+1:a.line=I>7?I-2:I+1,a.align="left",a.position=Math.max(0,Math.min(100,100*(_/32))),g.addCue(a)}}var wl={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},Rs=function(p){var u=p;return wl.hasOwnProperty(p)&&(u=wl[p]),String.fromCharCode(u)},Ar=15,ka=100,Nv={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ov={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Uv={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Wv={25:2,26:4,29:6,30:8,31:10,27:13,28:15},kv=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],Ts;(function(g){g[g.ERROR=0]="ERROR",g[g.TEXT=1]="TEXT",g[g.WARNING=2]="WARNING",g[g.INFO=2]="INFO",g[g.DEBUG=3]="DEBUG",g[g.DATA=3]="DATA"})(Ts||(Ts={}));var Rt={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(p){this.time=p},log:function(p,u){var o=this.verboseFilter[p];this.verboseLevel>=o}},Co=function(p){for(var u=[],o=0;oka&&(Rt.log("ERROR","Too large cursor position "+this.pos),this.pos=ka)},p.moveCursor=function(o){var t=this.pos+o;if(o>1)for(var a=this.pos+1;a=144&&this.backSpace();var t=Rs(o);if(this.pos>=ka){Rt.log("ERROR","Cannot insert "+o.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)},p.clearFromPos=function(o){var t;for(t=o;t0&&(o?a="["+t.join(" | ")+"]":a=t.join(` `)),a},p.getTextAndFormat=function(){return this.rows},g}(),uu=function(){function g(u,o){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.lastCueEndTime=void 0,this.chNr=u,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new Tt,this.nonDisplayedMemory=new Tt,this.lastOutputScreen=new Tt,this.currRollUpRow=this.displayedMemory.rows[Ar-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}var p=g.prototype;return p.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[Ar-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},p.getHandler=function(){return this.outputFilter},p.setHandler=function(o){this.outputFilter=o},p.setPAC=function(o){this.writeScreen.setPAC(o)},p.setBkgData=function(o){this.writeScreen.setBkgData(o)},p.setMode=function(o){o!==this.mode&&(this.mode=o,Rt.log("INFO","MODE="+o),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=o)},p.insertChars=function(o){for(var t=0;t=46,t.italics)t.foreground="white";else{var a=Math.floor(o/2)-16,c=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=c[a]}Rt.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},p.outputDataUpdate=function(o){o===void 0&&(o=!1);var t=Rt.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))},p.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},g}(),lu=function(){function g(u,o,t){this.field=void 0,this.outputs=void 0,this.channels=void 0,this.currChNr=void 0,this.lastCmdA=void 0,this.lastCmdB=void 0,this.lastTime=void 0,this.dataCounters=void 0,this.field=u||1,this.outputs=[o,t],this.channels=[new uu(1,o),new uu(2,t)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}var p=g.prototype;return p.getHandler=function(o){return this.channels[o].getHandler()},p.setHandler=function(o,t){this.channels[o].setHandler(t)},p.addData=function(o,t){var a,c,_,R=!1;this.lastTime=o,Rt.setTime(o);for(var T=0;T ("+Co([c,_])+")");if(a=this.parseCmd(c,_),a||(a=this.parseMidrow(c,_)),a||(a=this.parsePAC(c,_)),a||(a=this.parseBackgroundAttributes(c,_)),!a&&(R=this.parseChars(c,_),R))if(this.currChNr&&this.currChNr>=0){var I=this.channels[this.currChNr-1];I.insertChars(R)}else Rt.log("WARNING","No channel found yet. TEXT-MODE?");a?this.dataCounters.cmd+=2:R?this.dataCounters.char+=2:(this.dataCounters.other+=2,Rt.log("WARNING","Couldn't parse cleaned data "+Co([c,_])+" orig: "+Co([t[T],t[T+1]])))}},p.parseCmd=function(o,t){var a=null,c=(o===20||o===28)&&t>=32&&t<=47,_=(o===23||o===31)&&t>=33&&t<=35;if(!(c||_))return!1;if(o===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,Rt.log("DEBUG","Repeated command ("+Co([o,t])+") is dropped"),!0;o===20||o===23?a=1:a=2;var R=this.channels[a-1];return o===20||o===28?t===32?R.ccRCL():t===33?R.ccBS():t===34?R.ccAOF():t===35?R.ccAON():t===36?R.ccDER():t===37?R.ccRU(2):t===38?R.ccRU(3):t===39?R.ccRU(4):t===40?R.ccFON():t===41?R.ccRDC():t===42?R.ccTR():t===43?R.ccRTD():t===44?R.ccEDM():t===45?R.ccCR():t===46?R.ccENM():t===47&&R.ccEOC():R.ccTO(t-32),this.lastCmdA=o,this.lastCmdB=t,this.currChNr=a,!0},p.parseMidrow=function(o,t){var a=null;if((o===17||o===25)&&t>=32&&t<=47){if(o===17?a=1:a=2,a!==this.currChNr)return Rt.log("ERROR","Mismatch channel in midrow parsing"),!1;var c=this.channels[a-1];return c.ccMIDROW(t),Rt.log("DEBUG","MIDROW ("+Co([o,t])+")"),!0}return!1},p.parsePAC=function(o,t){var a=null,c=null,_=(o>=17&&o<=23||o>=25&&o<=31)&&t>=64&&t<=127,R=(o===16||o===24)&&t>=64&&t<=95;if(!(_||R))return!1;if(o===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;a=o<=23?1:2,t>=64&&t<=95?c=a===1?Nv[o]:Uv[o]:c=a===1?Ov[o]:Wv[o];var T=this.interpretPAC(c,t),I=this.channels[a-1];return I.setPAC(T),this.lastCmdA=o,this.lastCmdB=t,this.currChNr=a,!0},p.interpretPAC=function(o,t){var a=t,c={color:null,italics:!1,indent:null,underline:!1,row:o};return t>95?a=t-96:a=t-64,c.underline=(a&1)==1,a<=13?c.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(a/2)]:a<=15?(c.italics=!0,c.color="white"):c.indent=Math.floor((a-16)/2)*4,c},p.parseChars=function(o,t){var a=null,c=null,_=null;if(o>=25?(a=2,_=o-8):(a=1,_=o),_>=17&&_<=19){var R=t;_===17?R=t+80:_===18?R=t+112:R=t+144,Rt.log("INFO","Special char '"+Rs(R)+"' in channel "+a),c=[R]}else o>=32&&o<=127&&(c=t===0?[o]:[o,t]);if(c){var T=Co(c);Rt.log("DEBUG","Char codes = "+T.join(",")),this.lastCmdA=null,this.lastCmdB=null}return c},p.parseBackgroundAttributes=function(o,t){var a,c,_,R,T=(o===16||o===24)&&t>=32&&t<=47,I=(o===23||o===31)&&t>=45&&t<=47;return T||I?(a={},o===16||o===24?(c=Math.floor((t-32)/2),a.background=kv[c],t%2==1&&(a.background=a.background+"_semi")):t===45?a.background="transparent":(a.foreground="black",t===47&&(a.underline=!0)),_=o<24?1:2,R=this.channels[_-1],R.setBkgData(a),this.lastCmdA=null,this.lastCmdB=null,!0):!1},p.reset=function(){for(var o=0;oo)&&(this.startTime=o),this.endTime=t,this.screen=a,this.timelineController.createCaptionsTrack(this.trackName)},g}(),xl=function(p,u,o){return p.substr(o||0,u.length)===u},$v=function(p){var u=parseInt(p.substr(-3)),o=parseInt(p.substr(-6,2)),t=parseInt(p.substr(-9,2)),a=p.length>9?parseInt(p.substr(0,p.indexOf(":"))):0;if(!Object(E.isFiniteNumber)(u)||!Object(E.isFiniteNumber)(o)||!Object(E.isFiniteNumber)(t)||!Object(E.isFiniteNumber)(a))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+p);return u+=1e3*o,u+=60*1e3*t,u+=60*60*1e3*a,u},cu=function(p){for(var u=5381,o=p.length;o;)u=u*33^p.charCodeAt(--o);return(u>>>0).toString()},qv=function(p,u,o){var t=p[u],a=p[t.prevCC];if(!a||!a.new&&t.new){p.ccOffset=p.presentationOffset=t.start,t.new=!1;return}for(;a&&a.new;)p.ccOffset+=t.start-a.start,t.new=!1,t=a,a=p[t.prevCC];p.presentationOffset=o},Jv={parse:function(p,u,o,t,a,c){var _=/\r\n|\n\r|\n|\r/g,R=Object(ou.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(_,` `).split(` `),T="00:00.000",I=0,j=0,P=0,q=[],ae,fe=!0,De=!1,ze=new Pv;ze.oncue=function(Be){var qe=o[t],tt=o.ccOffset;qe&&qe.new&&(j!==void 0?tt=o.ccOffset=qe.start:qv(o,t,P)),P&&(tt=P-o.presentationOffset),De&&(Be.startTime+=tt-j,Be.endTime+=tt-j),Be.id=cu(Be.startTime.toString())+cu(Be.endTime.toString())+cu(Be.text),Be.text=decodeURIComponent(encodeURIComponent(Be.text)),Be.endTime>0&&q.push(Be)},ze.onparsingerror=function(Be){ae=Be},ze.onflush=function(){if(ae&&c){c(ae);return}a(q)},R.forEach(function(Be){if(fe)if(xl(Be,"X-TIMESTAMP-MAP=")){fe=!1,De=!0,Be.substr(16).split(",").forEach(function(qe){xl(qe,"LOCAL:")?T=qe.substr(6):xl(qe,"MPEGTS:")&&(I=parseInt(qe.substr(7)))});try{u+(o[t].start*9e4||0)<0&&(u+=8589934592),I-=u,j=$v(T)/1e3,P=I/9e4}catch(qe){De=!1,ae=qe}return}else Be===""&&(fe=!1);ze.parse(Be+` `)}),ze.flush()}},zv=Jv;function bs(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function Vv(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,g.__proto__=p}var Kv=function(g){Vv(p,g);function p(o){var t;if(t=g.call(this,o,d.default.MEDIA_ATTACHING,d.default.MEDIA_DETACHING,d.default.FRAG_PARSING_USERDATA,d.default.FRAG_DECRYPTED,d.default.MANIFEST_LOADING,d.default.MANIFEST_LOADED,d.default.FRAG_LOADED,d.default.INIT_PTS_FOUND)||this,t.media=null,t.config=void 0,t.enabled=!0,t.Cues=void 0,t.textTracks=[],t.tracks=[],t.initPTS=[],t.unparsedVttFrags=[],t.cueRanges=[],t.captionsTracks={},t.captionsProperties=void 0,t.cea608Parser=void 0,t.lastSn=-1,t.prevCC=-1,t.vttCCs=null,t.hls=o,t.config=o.config,t.Cues=o.config.cueHandler,t.captionsProperties={textTrack1:{label:t.config.captionsTextTrack1Label,languageCode:t.config.captionsTextTrack1LanguageCode},textTrack2:{label:t.config.captionsTextTrack2Label,languageCode:t.config.captionsTextTrack2LanguageCode}},t.config.enableCEA708Captions){var a=new Es(bs(t),"textTrack1"),c=new Es(bs(t),"textTrack2");t.cea608Parser=new Gv(0,a,c)}return t}var u=p.prototype;return u.addCues=function(t,a,c,_){for(var R=this.cueRanges,T=!1,I=R.length;I--;){var j=R[I],P=Yv(j[0],j[1],a,c);if(P>=0&&(j[0]=Math.min(j[0],a),j[1]=Math.max(j[1],c),T=!0,P/(c-a)>.5))return}T||R.push([a,c]),this.Cues.newCue(this.captionsTracks[t],a,c,_)},u.onInitPtsFound=function(t){var a=this,c=t.frag,_=t.id,R=t.initPTS,T=this.unparsedVttFrags;_==="main"&&(this.initPTS[c.cc]=R),T.length&&(this.unparsedVttFrags=[],T.forEach(function(I){a.onFragLoaded(I)}))},u.getExistingTrack=function(t){var a=this.media;if(a)for(var c=0;c=T.length||c!==R||!I||this.stopped){this._clearReloadTimer();return}if(h.logger.log("subtitle track "+c+" loaded"),_.live){var j=Xt(I.details,_,t.stats.trequest);h.logger.log("Reloading live subtitle playlist in "+j+"ms"),this.timer=setTimeout(function(){a._loadCurrentTrack()},j)}else this._clearReloadTimer()},u.startLoad=function(){this.stopped=!1,this._loadCurrentTrack()},u.stopLoad=function(){this.stopped=!0,this._clearReloadTimer()},u._clearReloadTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},u._loadCurrentTrack=function(){var t=this.trackId,a=this.tracks,c=this.hls,_=a[t];t<0||!_||_.details&&!_.details.live||(h.logger.log("Loading subtitle track "+t),c.trigger(d.default.SUBTITLE_TRACK_LOADING,{url:_.url,id:t}))},u._toggleTrackModes=function(t){var a=this.media,c=this.subtitleDisplay,_=this.trackId;if(!!a){var R=s(a.textTracks);if(t===-1)[].slice.call(R).forEach(function(j){j.mode="disabled"});else{var T=R[_];T&&(T.mode="disabled")}var I=R[t];I&&(I.mode=c?"showing":"hidden")}},u._setSubtitleTrackInternal=function(t){var a=this.hls,c=this.tracks;!Object(E.isFiniteNumber)(t)||t<-1||t>=c.length||(this.trackId=t,h.logger.log("Switching to subtitle track "+t),a.trigger(d.default.SUBTITLE_TRACK_SWITCH,{id:t}),this._loadCurrentTrack())},u._onTextTracksChanged=function(){if(!!this.media){for(var t=-1,a=s(this.media.textTracks),c=0;c=_[I].start&&T<=_[I].end){R=_[I];break}var j=a.start+a.duration;R?R.end=j:(R={start:T,end:j},_.push(R))}}},u.onMediaAttached=function(t){var a=t.media;this.media=a,a.addEventListener("seeking",this._onMediaSeeking),this.state=te.IDLE},u.onMediaDetaching=function(){var t=this;!this.media||(this.media.removeEventListener("seeking",this._onMediaSeeking),this.fragmentTracker.removeAllFragments(),this.currentTrackId=-1,this.tracks.forEach(function(a){t.tracksBuffered[a.id]=[]}),this.media=null,this.state=te.STOPPED)},u.onError=function(t){var a=t.frag;!a||a.type!=="subtitle"||(this.state=te.IDLE)},u.onSubtitleTracksUpdated=function(t){var a=this;h.logger.log("subtitle tracks updated"),this.tracksBuffered=[],this.tracks=t.subtitleTracks,this.tracks.forEach(function(c){a.tracksBuffered[c.id]=[]})},u.onSubtitleTrackSwitch=function(t){if(this.currentTrackId=t.id,!this.tracks||!this.tracks.length||this.currentTrackId===-1){this.clearInterval();return}var a=this.tracks[this.currentTrackId];a&&a.details&&this.setInterval(Ye)},u.onSubtitleTrackLoaded=function(t){var a=t.id,c=t.details,_=this.currentTrackId,R=this.tracks,T=R[_];a>=R.length||a!==_||!T||(c.live&&Oe(T.details,c,this.lastAVStart),T.details=c,this.setInterval(Ye))},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE)},u.onFragLoaded=function(t){var a=this.fragCurrent,c=t.frag.decryptdata,_=t.frag,R=this.hls;if(this.state===te.FRAG_LOADING&&a&&t.frag.type==="subtitle"&&a.sn===t.frag.sn&&t.payload.byteLength>0&&c&&c.key&&c.method==="AES-128"){var T=Re.now();this.decrypter.decrypt(t.payload,c.key.buffer,c.iv.buffer,function(I){var j=Re.now();R.trigger(d.default.FRAG_DECRYPTED,{frag:_,payload:I,stats:{tstart:T,tdecrypt:j}})})}},u.onLevelUpdated=function(t){var a=t.details,c=a.fragments;this.lastAVStart=c.length?c[0].start:0},u.doTick=function(){if(!this.media){this.state=te.IDLE;return}switch(this.state){case te.IDLE:{var t=this.config,a=this.currentTrackId,c=this.fragmentTracker,_=this.media,R=this.tracks;if(!R||!R[a]||!R[a].details)break;var T=t.maxBufferHole,I=t.maxFragLookUpTolerance,j=Math.min(t.maxBufferLength,t.maxMaxBufferLength),P=A.bufferedInfo(this._getBuffered(),_.currentTime,T),q=P.end,ae=P.len,fe=R[a].details,De=fe.fragments,ze=De.length,Be=De[ze-1].start+De[ze-1].duration;if(ae>j)return;var qe,tt=this.fragPrevious;qCs){this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var R=Cs-this._requestLicenseFailureCount+1;h.logger.warn("Retrying license request, "+R+" attempts left"),this._requestLicense(c,_)}break}},u._generateLicenseRequestChallenge=function(t,a){switch(t.mediaKeySystemDomain){case ln.WIDEVINE:return a}throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},u._requestLicense=function(t,a){h.logger.log("Requesting content license for key-system");var c=this._mediaKeysList[0];if(!c){h.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var _=this.getLicenseServerUrl(c.mediaKeySystemDomain),R=this._createLicenseXhr(_,t,a);h.logger.log("Sending license request to URL: "+_);var T=this._generateLicenseRequestChallenge(c,t);R.send(T)}catch(I){h.logger.error("Failure requesting DRM license: "+I),this.hls.trigger(d.default.ERROR,{type:v.ErrorTypes.KEY_SYSTEM_ERROR,details:v.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},u.onMediaAttached=function(t){if(!!this._emeEnabled){var a=t.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)}},u.onMediaDetached=function(){this._media&&(this._media.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null)},u.onManifestParsed=function(t){if(!!this._emeEnabled){var a=t.levels.map(function(_){return _.audioCodec}),c=t.levels.map(function(_){return _.videoCodec});this._attemptKeySystemAccess(ln.WIDEVINE,a,c)}},Zv(p,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),p}(b),tp=Ms;function np(g){for(var p=1;pa)return _}return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,a=this.autoLevelCapping,c;return a===-1&&t&&t.length?c=t.length-1:c=a,c}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var a=this.audioTrackController;a&&(a.audioTrack=t)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var a=this.subtitleTrackController;a&&(a.subtitleTrack=t)}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return t?t.subtitleDisplay:!1},set:function(t){var a=this.subtitleTrackController;a&&(a.subtitleDisplay=t)}}]),p}(V);js.defaultConfig=void 0},"./src/polyfills/number-isFinite.js":function(e,n,r){"use strict";r.r(n),r.d(n,"isFiniteNumber",function(){return i});var i=Number.isFinite||function(l){return typeof l=="number"&&isFinite(l)}},"./src/utils/get-self-scope.js":function(e,n,r){"use strict";r.r(n),r.d(n,"getSelfScope",function(){return i});function i(){return typeof window=="undefined"?self:window}},"./src/utils/logger.js":function(e,n,r){"use strict";r.r(n),r.d(n,"enableLogs",function(){return b}),r.d(n,"logger",function(){return S});var i=r("./src/utils/get-self-scope.js");function l(){}var v={trace:l,debug:l,log:l,warn:l,info:l,error:l},E=v;function d(C,M){return M="["+C+"] > "+M,M}var h=Object(i.getSelfScope)();function N(C){var M=h.console[C];return M?function(){for(var O=arguments.length,H=new Array(O),Y=0;Y1?M-1:0),H=1;H{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.Direction=void 0;var K8;(function(e){e.Right="to right",e.Left="to left",e.Down="to bottom",e.Up="to top"})(K8=Yc.Direction||(Yc.Direction={}))});var Z_=Ha(lt=>{"use strict";var Qc=lt&<.__spreadArray||function(e,n,r){if(r||arguments.length===2)for(var i=0,l=n.length,v;ie)return h;if(N&&Ni)return i;if(e=r)throw new RangeError("min (".concat(n,") is equal/bigger than max (").concat(r,")"));if(er)throw new RangeError("value (".concat(e,") is bigger than max (").concat(r,")"))}lt.checkBoundaries=tI;function nI(e,n,r){return er?r:e}lt.checkValuesAgainstBoundaries=nI;function rI(e){if(!(e.length<2)&&!e.slice(1).every(function(n,r){return e[r]<=n}))throw new RangeError("values={[".concat(e,"]} needs to be sorted when allowOverlap={false}"))}lt.checkInitialOverlap=rI;function aI(e){var n=window.getComputedStyle(e);return{top:parseInt(n["margin-top"],10),bottom:parseInt(n["margin-bottom"],10),left:parseInt(n["margin-left"],10),right:parseInt(n["margin-right"],10)}}lt.getMargin=aI;function oI(e){var n=window.getComputedStyle(e);return{top:parseInt(n["padding-top"],10)+parseInt(n["border-top-width"],10),bottom:parseInt(n["padding-bottom"],10)+parseInt(n["border-bottom-width"],10),left:parseInt(n["padding-left"],10)+parseInt(n["border-left-width"],10),right:parseInt(n["padding-right"],10)+parseInt(n["border-right-width"],10)}}lt.getPaddingAndBorder=oI;function iI(e,n,r){var i=r?-1:1;e.forEach(function(l,v){return ZT(l,i*n[v].x,n[v].y)})}lt.translateThumbs=iI;function uI(e,n,r,i){for(var l=0,v=tE(e[0],n,r,i),E=1;EE?h:E},e.getBoundingClientRect().width));return v},vI=function(e,n,r,i,l,v,E){E===void 0&&(E=function(N){return N});var d=[],h=function(N){var y=eE(r[N],i[N],l,v,E),b=n[N].x;n.forEach(function(S,C){var M=S.x,O=eE(r[C],i[C],l,v,E);N!==C&&(b>=M&&b<=M+O||b+y>=M&&b+y<=M+O)&&(d.includes(C)||(d.push(N),d.push(C),d=Qc(Qc([],d,!0),[N,C],!1),h(C)))})};return h(e),Array.from(new Set(d.sort()))},pI=function(e,n,r,i,l,v){i===void 0&&(i=.1),l===void 0&&(l=" - "),v===void 0&&(v=function(C){return C});var E=(0,lt.getStepDecimals)(i),d=(0,X_.useState)({}),h=d[0],N=d[1],y=(0,X_.useState)(v(n[r].toFixed(E))),b=y[0],S=y[1];return(0,X_.useEffect)(function(){if(e){var C=e.getThumbs();if(C.length<1)return;var M={},O=e.getOffsets(),H=vI(r,O,C,n,l,E,v),Y=v(n[r].toFixed(E));if(H.length){var z=H.reduce(function(pe,He,$e,Je){return pe.length?Qc(Qc([],pe,!0),[O[Je[$e]].x],!1):[O[Je[$e]].x]},[]);if(Math.min.apply(Math,z)===O[r].x){var Z=[];H.forEach(function(pe){Z.push(n[pe].toFixed(E))}),Y=Array.from(new Set(Z.sort(function(pe,He){return parseFloat(pe)-parseFloat(He)}))).map(v).join(l);var ne=Math.min.apply(Math,z),ee=Math.max.apply(Math,z),de=C[H[z.indexOf(ee)]].getBoundingClientRect().width;M.left="".concat(Math.abs(ne-(ee+de))/2,"px"),M.transform="translate(-50%, 0)"}else M.visibility="hidden"}S(Y),N(M)}},[e,n]),[b,h]};lt.useThumbOverlap=pI;function tE(e,n,r,i){var l=e.getBoundingClientRect(),v=l.left,E=l.top,d=l.width,h=l.height;return XT(i)?Math.abs(r-(E+h/2)):Math.abs(n-(v+d/2))}});var rE=Ha(Yr=>{"use strict";var mI=Yr&&Yr.__extends||function(){var e=function(n,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,l){i.__proto__=l}||function(i,l){for(var v in l)Object.prototype.hasOwnProperty.call(l,v)&&(i[v]=l[v])},e(n,r)};return function(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(n,r);function i(){this.constructor=n}n.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),_I=Yr&&Yr.__createBinding||(Object.create?function(e,n,r,i){i===void 0&&(i=r);var l=Object.getOwnPropertyDescriptor(n,r);(!l||("get"in l?!n.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(e,i,l)}:function(e,n,r,i){i===void 0&&(i=r),e[i]=n[r]}),hI=Yr&&Yr.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),gI=Yr&&Yr.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&_I(n,e,r);return hI(n,e),n},nE=Yr&&Yr.__spreadArray||function(e,n,r){if(r||arguments.length===2)for(var i=0,l=n.length,v;i1&&i.props.draggableTrack){if(i.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.contains(l.target)}))return;i.setState({draggedTrackPos:[l.clientX,l.clientY]},function(){return i.onMove(l.clientX,l.clientY)})}else{var E=(0,Bt.getClosestThumbIndex)(i.thumbRefs.map(function(d){return d.current}),l.clientX,l.clientY,i.props.direction);(v=i.thumbRefs[E].current)===null||v===void 0||v.focus(),i.setState({draggedThumbIndex:E},function(){return i.onMove(l.clientX,l.clientY)})}},i.onResize=function(){(0,Bt.translateThumbs)(i.getThumbs(),i.getOffsets(),i.props.rtl),i.calculateMarkOffsets()},i.onTouchStartTrack=function(l){var v;if(l.persist(),i.addTouchEvents(l.nativeEvent),i.props.values.length>1&&i.props.draggableTrack){if(i.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.contains(l.target)}))return;i.setState({draggedTrackPos:[l.touches[0].clientX,l.touches[0].clientY]},function(){return i.onMove(l.touches[0].clientX,l.touches[0].clientY)})}else{var E=(0,Bt.getClosestThumbIndex)(i.thumbRefs.map(function(d){return d.current}),l.touches[0].clientX,l.touches[0].clientY,i.props.direction);(v=i.thumbRefs[E].current)===null||v===void 0||v.focus(),i.setState({draggedThumbIndex:E},function(){return i.onMove(l.touches[0].clientX,l.touches[0].clientY)})}},i.onMouseOrTouchStart=function(l){if(!i.props.disabled){var v=(0,Bt.isTouchEvent)(l);if(!(!v&&l.button!==0)){var E=i.getTargetIndex(l);E!==-1&&(v?i.addTouchEvents(l):i.addMouseEvents(l),i.setState({draggedThumbIndex:E,thumbZIndexes:i.state.thumbZIndexes.map(function(d,h){return h===E?Math.max.apply(Math,i.state.thumbZIndexes):d<=i.state.thumbZIndexes[E]?d:d-1})}))}}},i.onMouseMove=function(l){l.preventDefault(),i.onMove(l.clientX,l.clientY)},i.onTouchMove=function(l){l.preventDefault(),i.onMove(l.touches[0].clientX,l.touches[0].clientY)},i.onKeyDown=function(l){var v=i.props,E=v.values,d=v.onChange,h=v.step,N=v.rtl,y=v.direction,b=i.state.isChanged,S=i.getTargetIndex(l.nativeEvent),C=N||y===$n.Direction.Left||y===$n.Direction.Down?-1:1;S!==-1&&(DI.includes(l.key)?(l.preventDefault(),i.setState({draggedThumbIndex:S,isChanged:!0}),d((0,Bt.replaceAt)(E,S,i.normalizeValue(E[S]+C*(l.key==="PageUp"?h*10:h),S)))):yI.includes(l.key)?(l.preventDefault(),i.setState({draggedThumbIndex:S,isChanged:!0}),d((0,Bt.replaceAt)(E,S,i.normalizeValue(E[S]-C*(l.key==="PageDown"?h*10:h),S)))):l.key==="Tab"?i.setState({draggedThumbIndex:-1},function(){b&&i.fireOnFinalChange()}):b&&i.fireOnFinalChange())},i.onKeyUp=function(l){var v=i.state.isChanged;i.setState({draggedThumbIndex:-1},function(){v&&i.fireOnFinalChange()})},i.onMove=function(l,v){var E=i.state,d=E.draggedThumbIndex,h=E.draggedTrackPos,N=i.props,y=N.direction,b=N.min,S=N.max,C=N.onChange,M=N.values,O=N.step,H=N.rtl;if(d===-1&&h[0]===-1&&h[1]===-1)return null;var Y=i.trackRef.current;if(!Y)return null;var z=Y.getBoundingClientRect(),Z=(0,Bt.isVertical)(y)?z.height:z.width;if(h[0]!==-1&&h[1]!==-1){var ne=l-h[0],ee=v-h[1],de=0;switch(y){case $n.Direction.Right:case $n.Direction.Left:de=ne/Z*(S-b);break;case $n.Direction.Down:case $n.Direction.Up:de=ee/Z*(S-b);break;default:(0,Bt.assertUnreachable)(y)}if(H&&(de*=-1),Math.abs(de)>=O/2){for(var pe=0;peS?de=S-M[pe]:He=O/2&&C((0,Bt.replaceAt)(M,d,i.normalizeValue(Je,d)))}},i.normalizeValue=function(l,v){var E=i.props,d=E.min,h=E.max,N=E.step,y=E.allowOverlap,b=E.values;return(0,Bt.normalizeValue)(l,v,d,h,N,y,b)},i.onEnd=function(l){if(l.preventDefault(),document.removeEventListener("mousemove",i.schdOnMouseMove),document.removeEventListener("touchmove",i.schdOnTouchMove),document.removeEventListener("mouseup",i.schdOnEnd),document.removeEventListener("touchend",i.schdOnEnd),document.removeEventListener("touchcancel",i.schdOnEnd),i.state.draggedThumbIndex===-1&&i.state.draggedTrackPos[0]===-1&&i.state.draggedTrackPos[1]===-1)return null;i.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){i.fireOnFinalChange()})},i.fireOnFinalChange=function(){i.setState({isChanged:!1});var l=i.props,v=l.onFinalChange,E=l.values;v&&v(E)},i.updateMarkRefs=function(l){if(!l.renderMark){i.numOfMarks=void 0,i.markRefs=void 0;return}i.numOfMarks=(l.max-l.min)/i.props.step,i.markRefs=[];for(var v=0;v-1?"grabbing":this.props.draggableTrack?(0,Bt.isVertical)(this.props.direction)?"ns-resize":"ew-resize":h.length===1&&!S?"pointer":"inherit"},onMouseDown:S?Bt.voidFn:this.onMouseDownTrack,onTouchStart:S?Bt.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:S,children:nE(nE([],H.map(function(Y,z,Z){return d({props:{style:r.props.direction===$n.Direction.Left||r.props.direction===$n.Direction.Right?{position:"absolute",left:"".concat(Y[0],"px"),marginTop:"".concat(Y[1],"px")}:{position:"absolute",top:"".concat(Y[0],"px"),marginLeft:"".concat(Y[1],"px")},key:"mark".concat(z),ref:r.markRefs[z]},index:z})}),!0),h.map(function(Y,z){var Z=r.state.draggedThumbIndex===z;return v({index:z,value:Y,isDragged:Z,props:{style:{position:"absolute",zIndex:O[z],cursor:S?"inherit":Z?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:z,tabIndex:S?void 0:0,"aria-valuemax":b?y:h[z+1]||y,"aria-valuemin":b?N:h[z-1]||N,"aria-valuenow":Y,draggable:!1,ref:r.thumbRefs[z],role:"slider",onKeyDown:S?Bt.voidFn:r.onKeyDown,onKeyUp:S?Bt.voidFn:r.onKeyUp}})}),!0)})},n.defaultProps={step:1,direction:$n.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},n}(Vd.Component);Yr.default=RI});var aE=Ha(gr=>{"use strict";var TI=gr&&gr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gr,"__esModule",{value:!0});gr.checkValuesAgainstBoundaries=gr.relativeValue=gr.useThumbOverlap=gr.Direction=gr.getTrackBackground=gr.Range=void 0;var EI=TI(rE());gr.Range=EI.default;var Kd=Z_();Object.defineProperty(gr,"getTrackBackground",{enumerable:!0,get:function(){return Kd.getTrackBackground}});Object.defineProperty(gr,"useThumbOverlap",{enumerable:!0,get:function(){return Kd.useThumbOverlap}});Object.defineProperty(gr,"relativeValue",{enumerable:!0,get:function(){return Kd.relativeValue}});Object.defineProperty(gr,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return Kd.checkValuesAgainstBoundaries}});var bI=zd();Object.defineProperty(gr,"Direction",{enumerable:!0,get:function(){return bI.Direction}})});var Z7={};Th(Z7,{boot:()=>X7});var Os={compose:function(e){return function(n){return function(r){return e(n(r))}}}};var Ue=function(e){return e.identity},We={identity:function(e){return e},Semigroupoid0:function(){return Os}};var at=!0;var up=function(e){return function(n){return function(r){return function(i){return e(n(r))(n(i))}}}},Nt=function(e){return function(n){return function(r){return e(r)(n)}}},Ke=function(e){return function(n){return e}};var Eh=function(e){return function(n){for(var r=n.length,i=new Array(r),l=0;l>1),d-v>1&&e(n,r,l,i,v,d),E-d>1&&e(n,r,l,i,d,E),h=v,N=d,y=v;h0?(i[y++]=S,++N):(i[y++]=b,++h);for(;h="0"&&e[l]<="9"?"\\&":"";return"\\"+r.charCodeAt(0).toString(10)+v})+'"'};var tr={show:zh};var on={show:Jh};var ye=function(e){return e.show};var _t=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Xe=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var qt=function(){function e(){}return e.value=new e,e}(),Hl=function(e){return e};var pu=function(e){return e.to};var Bl=function(e){return e.from};var Xb=Ue(We),J=function(){function e(){}return e.value=new e,e}(),G=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var Et=function(e){return function(n){return function(r){if(r instanceof J)return e;if(r instanceof G)return n(r.value0);throw new Error("Failed pattern match at Data.Maybe (line 237, column 1 - line 237, column 51): "+[e.constructor.name,n.constructor.name,r.constructor.name])}}},Ja=Et(!0)(Ke(!1)),Di=Et(!1)(Ke(!0));var Se={map:function(e){return function(n){return n instanceof G?new G(e(n.value0)):J.value}}},Zb=X(Se);var Zt=function(e){return Et(e)(Xb)},Hn=function(){return function(e){if(e instanceof G)return e.value0;throw new Error("Failed pattern match at Data.Maybe (line 288, column 1 - line 288, column 46): "+[e.constructor.name])}};var co=function(e){var n=je(e);return{eq:function(r){return function(i){return r instanceof J&&i instanceof J?!0:r instanceof G&&i instanceof G?n(r.value0)(i.value0):!1}}}};var oa={apply:function(e){return function(n){if(e instanceof G)return Zb(e.value0)(n);if(e instanceof J)return J.value;throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 69, column 30): "+[e.constructor.name,n.constructor.name])}},Functor0:function(){return Se}};var Yt={bind:function(e){return function(n){if(e instanceof G)return n(e.value0);if(e instanceof J)return J.value;throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 127, column 28): "+[e.constructor.name,n.constructor.name])}},Apply0:function(){return oa}};var pr=function(){return{pure:G.create,Apply0:function(){return oa}}}();var Bs={alt:function(e){return function(n){return e instanceof J?n:e}},Functor0:function(){return Se}},eF=function(){return{empty:J.value,Alt0:function(){return Bs}}}(),hp={Applicative0:function(){return pr},Plus1:function(){return eF}};var be=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Fe=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var _u=function(e){return Et(new be(e))(Fe.create)};var Kn={map:function(e){return function(n){if(n instanceof be)return new be(n.value0);if(n instanceof Fe)return new Fe(e(n.value0));throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): "+[n.constructor.name])}}},tF=X(Kn);var mn=function(e){return function(n){return function(r){if(r instanceof be)return e(r.value0);if(r instanceof Fe)return n(r.value0);throw new Error("Failed pattern match at Data.Either (line 208, column 1 - line 208, column 64): "+[e.constructor.name,n.constructor.name,r.constructor.name])}}},gp=function(){return mn(Ke(J.value))(G.create)}();var Dp={apply:function(e){return function(n){if(e instanceof be)return new be(e.value0);if(e instanceof Fe)return tF(e.value0)(n);throw new Error("Failed pattern match at Data.Either (line 70, column 1 - line 72, column 30): "+[e.constructor.name,n.constructor.name])}},Functor0:function(){return Kn}};var za={bind:mn(function(e){return function(n){return new be(e)}})(function(e){return function(n){return n(e)}}),Apply0:function(){return Dp}};var Va=function(e){return e};var Jo={map:function(e){return function(n){return e(n)}}};var Vh={apply:function(e){return function(n){return e(n)}},Functor0:function(){return Jo}},nF={bind:function(e){return function(n){return n(e)}},Apply0:function(){return Vh}},rF={pure:Va,Apply0:function(){return Vh}},Yn={Applicative0:function(){return rF},Bind1:function(){return nF}};var fo={mempty:"",Semigroup0:function(){return sp}};var Ot=function(e){return e.mempty};var Yh=function(e){return function(){return e}},Qh=function(e){return function(n){return function(){return n(e())()}}};var Rp=function(e){return function(n){return function(){for(var r=0,i=e.length;r>1),d-v>1&&e(n,r,l,i,v,d),E-d>1&&e(n,r,l,i,d,E),h=v,N=d,y=v;h0?(i[y++]=S,++N):(i[y++]=b,++h);for(;h=0;v--)i=e(r[v])(i);return i}}},_g=function(e){return function(n){return function(r){for(var i=n,l=r.length,v=0;v=0&&e<100&&d.setUTCFullYear(e),d.getTime()};function Pg(e){return function(n){return function(r){return function(i){var l=Cw(i.year,i.month-1,i.day,i.hour,i.minute,i.second,i.millisecond),v=new Date(l+r);return isNaN(v.getTime())?n:e({year:v.getUTCFullYear(),month:v.getUTCMonth()+1,day:v.getUTCDate(),hour:v.getUTCHours(),minute:v.getUTCMinutes(),second:v.getUTCSeconds(),millisecond:v.getUTCMilliseconds()})}}}}var xw=function(e,n,r){var i=new Date(Date.UTC(e,n,r));return e>=0&&e<100&&i.setUTCFullYear(e),i};function jg(e,n,r,i){var l=xw(n,r-1,i);return e(l.getUTCFullYear())(l.getUTCMonth()+1)(l.getUTCDate())}function Qo(e){return e.charCodeAt(0)}function Ng(e){return String.fromCharCode(e)}var nf=function(e){var n=ce(e.Applicative0()),r=Fr(e.Plus1());return function(i){if(i)return n(Te);if(!i)return r;throw new Error("Failed pattern match at Control.Alternative (line 48, column 1 - line 48, column 54): "+[i.constructor.name])}};var Wg=an(vu),kg=vn(vu);var vt=function(e){return e.toEnum};var bt=function(e){return e.fromEnum};var ec=function(e){return function(n){return function(r){return e(n(r)+1|0)}}},tc=function(e){return function(n){return function(r){return e(n(r)-1|0)}}};var Hp=function(e){return e>=Qo(Wg)&&e<=Qo(kg)?new G(Ng(e)):J.value},Mw={succ:ec(Hp)(Qo),pred:tc(Hp)(Qo),Ord0:function(){return ks}};var nc=function(){return{cardinality:Qo(kg)-Qo(Wg)|0,toEnum:Hp,fromEnum:Qo,Bounded0:function(){return vu},Enum1:function(){return Mw}}}();var Bp=function(e,n,r){var i=0,l;return function(v){if(i===2)return l;if(i===1)throw new ReferenceError(e+" was needed before it finished initializing (module "+n+", line "+v+")",n,v);return i=1,l=r(),i=2,l}};var Vr=function(){function e(){}return e.value=new e,e}(),ua=function(){function e(){}return e.value=new e,e}(),la=function(){function e(){}return e.value=new e,e}(),ca=function(){function e(){}return e.value=new e,e}(),sa=function(){function e(){}return e.value=new e,e}(),fa=function(){function e(){}return e.value=new e,e}(),da=function(){function e(){}return e.value=new e,e}(),va=function(){function e(){}return e.value=new e,e}(),pa=function(){function e(){}return e.value=new e,e}(),ma=function(){function e(){}return e.value=new e,e}(),_a=function(){function e(){}return e.value=new e,e}(),Ka=function(){function e(){}return e.value=new e,e}();var rf=$t,af=$t,Hg=vr;var Gp={eq:function(e){return function(n){return e instanceof Vr&&n instanceof Vr||e instanceof ua&&n instanceof ua||e instanceof la&&n instanceof la||e instanceof ca&&n instanceof ca||e instanceof sa&&n instanceof sa||e instanceof fa&&n instanceof fa||e instanceof da&&n instanceof da||e instanceof va&&n instanceof va||e instanceof pa&&n instanceof pa||e instanceof ma&&n instanceof ma||e instanceof _a&&n instanceof _a||e instanceof Ka&&n instanceof Ka}}},of={compare:function(e){return function(n){if(e instanceof Vr&&n instanceof Vr)return ot.value;if(e instanceof Vr)return Me.value;if(n instanceof Vr)return Ce.value;if(e instanceof ua&&n instanceof ua)return ot.value;if(e instanceof ua)return Me.value;if(n instanceof ua)return Ce.value;if(e instanceof la&&n instanceof la)return ot.value;if(e instanceof la)return Me.value;if(n instanceof la)return Ce.value;if(e instanceof ca&&n instanceof ca)return ot.value;if(e instanceof ca)return Me.value;if(n instanceof ca)return Ce.value;if(e instanceof sa&&n instanceof sa)return ot.value;if(e instanceof sa)return Me.value;if(n instanceof sa)return Ce.value;if(e instanceof fa&&n instanceof fa)return ot.value;if(e instanceof fa)return Me.value;if(n instanceof fa)return Ce.value;if(e instanceof da&&n instanceof da)return ot.value;if(e instanceof da)return Me.value;if(n instanceof da)return Ce.value;if(e instanceof va&&n instanceof va)return ot.value;if(e instanceof va)return Me.value;if(n instanceof va)return Ce.value;if(e instanceof pa&&n instanceof pa)return ot.value;if(e instanceof pa)return Me.value;if(n instanceof pa)return Ce.value;if(e instanceof ma&&n instanceof ma)return ot.value;if(e instanceof ma)return Me.value;if(n instanceof ma)return Ce.value;if(e instanceof _a&&n instanceof _a)return ot.value;if(e instanceof _a)return Me.value;if(n instanceof _a)return Ce.value;if(e instanceof Ka&&n instanceof Ka)return ot.value;throw new Error("Failed pattern match at Data.Date.Component (line 0, column 0 - line 0, column 0): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return Gp}},Bg=vr,uf=function(){return{bottom:-271820|0,top:275759,Ord0:function(){return rf}}}();var lf=function(){return{bottom:Vr.value,top:Ka.value,Ord0:function(){return of}}}(),Kr={cardinality:547580,toEnum:function(e){if(e>=(-271820|0)&&e<=275759)return new G(e);if(at)return J.value;throw new Error("Failed pattern match at Data.Date.Component (line 35, column 1 - line 40, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return uf},Enum1:function(){return Sw(0)}},Sw=Bp("enumYear","Data.Date.Component",function(){return{succ:function(){var e=vt(Kr),n=bt(Kr);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(Kr),n=bt(Kr);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return rf}}});var nr={cardinality:12,toEnum:function(e){return e===1?new G(Vr.value):e===2?new G(ua.value):e===3?new G(la.value):e===4?new G(ca.value):e===5?new G(sa.value):e===6?new G(fa.value):e===7?new G(da.value):e===8?new G(va.value):e===9?new G(pa.value):e===10?new G(ma.value):e===11?new G(_a.value):e===12?new G(Ka.value):J.value},fromEnum:function(e){if(e instanceof Vr)return 1;if(e instanceof ua)return 2;if(e instanceof la)return 3;if(e instanceof ca)return 4;if(e instanceof sa)return 5;if(e instanceof fa)return 6;if(e instanceof da)return 7;if(e instanceof va)return 8;if(e instanceof pa)return 9;if(e instanceof ma)return 10;if(e instanceof _a)return 11;if(e instanceof Ka)return 12;throw new Error("Failed pattern match at Data.Date.Component (line 87, column 14 - line 99, column 19): "+[e.constructor.name])},Bounded0:function(){return lf},Enum1:function(){return Iw(0)}},Iw=Bp("enumMonth","Data.Date.Component",function(){return{succ:function(){var e=vt(nr),n=bt(nr);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(nr),n=bt(nr);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return of}}});var cf={bottom:1,top:31,Ord0:function(){return af}},ha={cardinality:31,toEnum:function(e){if(e>=1&&e<=31)return new G(e);if(at)return J.value;throw new Error("Failed pattern match at Data.Date.Component (line 133, column 1 - line 138, column 23): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return cf},Enum1:function(){return Lw(0)}},Lw=Bp("enumDay","Data.Date.Component",function(){return{succ:function(){var e=vt(ha),n=bt(ha);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(ha),n=bt(ha);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return af}}});var Gg=function(e){return function(n){return function(r){return(r|0)===r?e(r):n}}};var Fu=function(){return Gg(G.create)(J.value)}();var Vg=Ue(We);var sf=function(e){return e.fromDuration};var ff={fromDuration:Vg,toDuration:Vg};var qw=bt(nr),Jw=Hn();var zw=je(Hg),Vw=je(Gp),Kw=je(Bg),Yw=Ie(rf),Qw=Ie(of),Xw=Ie(af);var Zw=vt(nr);var vf=function(){function e(n,r,i){this.value0=n,this.value1=r,this.value2=i}return e.create=function(n){return function(r){return function(i){return new e(n,r,i)}}},e}(),Li=function(e){return e.value0};var Ai=function(e){return e.value1};var pf={eq:function(e){return function(n){return zw(e.value0)(n.value0)&&Vw(e.value1)(n.value1)&&Kw(e.value2)(n.value2)}}},eC=je(pf),Jp={compare:function(e){return function(n){var r=Yw(e.value0)(n.value0);if(r instanceof Me)return Me.value;if(r instanceof Ce)return Ce.value;var i=Qw(e.value1)(n.value1);return i instanceof Me?Me.value:i instanceof Ce?Ce.value:Xw(e.value2)(n.value2)}},Eq0:function(){return pf}};var wu=function(e){return e.value2},Pi=function(e){return function(n){return function(r){var i=function(l){return function(v){return function(E){return new vf(l,Jw(Zw(v)),E)}}};return jg(i,e,qw(n),r)}}},zp=function(e){return function(n){return function(r){var i=new vf(e,n,r),l=eC(Pi(e)(n)(r))(i);return l?new G(i):J.value}}},Vp=function(){return{bottom:new vf(an(uf),an(lf),an(cf)),top:new vf(vn(uf),vn(lf),vn(cf)),Ord0:function(){return Jp}}}();var mf=function(e,n,r){var i=0,l;return function(v){if(i===2)return l;if(i===1)throw new ReferenceError(e+" was needed before it finished initializing (module "+n+", line "+v+")",n,v);return i=1,l=r(),i=2,l}};var _f=$t,hf=$t,gf=$t,Df=$t,r1=vr,a1=vr,o1=vr,i1=vr,rc={bottom:0,top:59,Ord0:function(){return _f}},ac={bottom:0,top:59,Ord0:function(){return hf}},oc={bottom:0,top:999,Ord0:function(){return gf}},ic={bottom:0,top:23,Ord0:function(){return Df}},ga={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new G(e);if(at)return J.value;throw new Error("Failed pattern match at Data.Time.Component (line 90, column 1 - line 95, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return rc},Enum1:function(){return tC(0)}},tC=mf("enumSecond","Data.Time.Component",function(){return{succ:function(){var e=vt(ga),n=bt(ga);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(ga),n=bt(ga);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return _f}}});var Da={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new G(e);if(at)return J.value;throw new Error("Failed pattern match at Data.Time.Component (line 61, column 1 - line 66, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return ac},Enum1:function(){return nC(0)}},nC=mf("enumMinute","Data.Time.Component",function(){return{succ:function(){var e=vt(Da),n=bt(Da);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(Da),n=bt(Da);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return hf}}});var ya={cardinality:1e3,toEnum:function(e){if(e>=0&&e<=999)return new G(e);if(at)return J.value;throw new Error("Failed pattern match at Data.Time.Component (line 120, column 1 - line 125, column 31): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return oc},Enum1:function(){return rC(0)}},rC=mf("enumMillisecond","Data.Time.Component",function(){return{succ:function(){var e=vt(ya),n=bt(ya);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(ya),n=bt(ya);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return gf}}});var Ra={cardinality:24,toEnum:function(e){if(e>=0&&e<=23)return new G(e);if(at)return J.value;throw new Error("Failed pattern match at Data.Time.Component (line 32, column 1 - line 37, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return ic},Enum1:function(){return aC(0)}},aC=mf("enumHour","Data.Time.Component",function(){return{succ:function(){var e=vt(Ra),n=bt(Ra);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=vt(Ra),n=bt(Ra);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return Df}}});var lC=je(i1),cC=je(a1),sC=je(r1),fC=je(o1),dC=Ie(Df),vC=Ie(hf),pC=Ie(_f),mC=Ie(gf);var mo=function(){function e(n,r,i,l){this.value0=n,this.value1=r,this.value2=i,this.value3=l}return e.create=function(n){return function(r){return function(i){return function(l){return new e(n,r,i,l)}}}},e}();var xu=function(e){return e.value2},Mu=function(e){return e.value1},Su=function(e){return e.value3};var Iu=function(e){return e.value0};var Kp={eq:function(e){return function(n){return lC(e.value0)(n.value0)&&cC(e.value1)(n.value1)&&sC(e.value2)(n.value2)&&fC(e.value3)(n.value3)}}},Yp={compare:function(e){return function(n){var r=dC(e.value0)(n.value0);if(r instanceof Me)return Me.value;if(r instanceof Ce)return Ce.value;var i=vC(e.value1)(n.value1);if(i instanceof Me)return Me.value;if(i instanceof Ce)return Ce.value;var l=pC(e.value2)(n.value2);return l instanceof Me?Me.value:l instanceof Ce?Ce.value:mC(e.value3)(n.value3)}},Eq0:function(){return Kp}};var Qp=function(){return{bottom:new mo(an(ic),an(ac),an(rc),an(oc)),top:new mo(vn(ic),vn(ac),vn(rc),vn(oc)),Ord0:function(){return Yp}}}();var hC=bt(Kr),gC=bt(nr),DC=bt(ha),yC=bt(Ra),RC=bt(Da),TC=bt(ga),EC=bt(ya);var bC=je(pf),FC=je(Kp),wC=Ie(Jp),CC=Ie(Yp),xC=ve(Yt),Lu=dt(oa),Xp=X(Se),MC=Nl(Yt),SC=vt(Kr),IC=vt(nr),LC=vt(ha),AC=vt(Ra),PC=vt(Da),jC=vt(ga),NC=vt(ya),Xo=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),OC=function(e){return{year:hC(Li(e.value0)),month:gC(Ai(e.value0)),day:DC(wu(e.value0)),hour:yC(Iu(e.value1)),minute:RC(Mu(e.value1)),second:TC(xu(e.value1)),millisecond:EC(Su(e.value1))}};var UC={eq:function(e){return function(n){return bC(e.value0)(n.value0)&&FC(e.value1)(n.value1)}}},uc={compare:function(e){return function(n){var r=wC(e.value0)(n.value0);return r instanceof Me?Me.value:r instanceof Ce?Ce.value:CC(e.value1)(n.value1)}},Eq0:function(){return UC}};var yf=function(){return{bottom:new Xo(an(Vp),an(Qp)),top:new Xo(vn(Vp),vn(Qp)),Ord0:function(){return uc}}}(),u1=function(e){var n=sf(e);return function(r){return function(i){return xC(Pg(G.create)(J.value)(n(r))(OC(i)))(function(l){return Lu(Xp(Xo.create)(MC(Lu(Lu(Xp(zp)(SC(l.year)))(IC(l.month)))(LC(l.day)))))(Lu(Lu(Lu(Xp(mo.create)(AC(l.hour)))(PC(l.minute)))(jC(l.second)))(NC(l.millisecond)))})}}};var hr=function(){var e={},n="Pure",r="Throw",i="Catch",l="Sync",v="Async",E="Bind",d="Bracket",h="Fork",N="Sequential",y="Map",b="Apply",S="Alt",C="Cons",M="Resume",O="Release",H="Finalizer",Y="Finalized",z="Forked",Z="Fiber",ne="Thunk";function ee(me,st,It,Pe){this.tag=me,this._1=st,this._2=It,this._3=Pe}function de(me){var st=function(It,Pe,xe){return new ee(me,It,Pe,xe)};return st.tag=me,st}function pe(me){return new ee(n,void 0)}function He(me){try{me()}catch(st){setTimeout(function(){throw st},0)}}function $e(me,st,It){try{return st(It())}catch(Pe){return me(Pe)}}function Je(me,st,It){try{return st(It)()}catch(Pe){return It(me(Pe))(),pe}}var en=function(){var me=1024,st=0,It=0,Pe=new Array(me),xe=!1;function _e(){var nt;for(xe=!0;st!==0;)st--,nt=Pe[It],Pe[It]=void 0,It=(It+1)%me,nt();xe=!1}return{isDraining:function(){return xe},enqueue:function(nt){var Qe,Ft;st===me&&(Ft=xe,_e(),xe=Ft),Pe[(It+st)%me]=nt,st++,xe||_e()}}}();function un(me){var st={},It=0,Pe=0;return{register:function(xe){var _e=It++;xe.onComplete({rethrow:!0,handler:function(nt){return function(){Pe--,delete st[_e]}}})(),st[_e]=xe,Pe++},isEmpty:function(){return Pe===0},killAll:function(xe,_e){return function(){if(Pe===0)return _e();var nt=0,Qe={};function Ft(Ge){Qe[Ge]=st[Ge].kill(xe,function(ft){return function(){delete Qe[Ge],nt--,me.isLeft(ft)&&me.fromLeft(ft)&&setTimeout(function(){throw me.fromLeft(ft)},0),nt===0&&_e()}})()}for(var tn in st)st.hasOwnProperty(tn)&&(nt++,Ft(tn));return st={},It=0,Pe=0,function(Ge){return new ee(l,function(){for(var ft in Qe)Qe.hasOwnProperty(ft)&&Qe[ft]()})}}}}}var ut=0,gt=1,Pt=2,Qt=3,Ut=4,wt=5,Jt=6;function St(me,st,It){var Pe=0,xe=ut,_e=It,nt=null,Qe=null,Ft=null,tn=null,Ge=null,ft=0,Ln=0,Dt=null,Br=!0;function U(x){for(var L,W,k;;)switch(L=null,W=null,k=null,xe){case Pt:xe=gt;try{_e=Ft(_e),tn===null?Ft=null:(Ft=tn._1,tn=tn._2)}catch(V){xe=wt,nt=me.left(V),_e=null}break;case Qt:me.isLeft(_e)?(xe=wt,nt=_e,_e=null):Ft===null?xe=wt:(xe=Pt,_e=me.fromRight(_e));break;case gt:switch(_e.tag){case E:Ft&&(tn=new ee(C,Ft,tn)),Ft=_e._2,xe=gt,_e=_e._1;break;case n:Ft===null?(xe=wt,_e=me.right(_e._1)):(xe=Pt,_e=_e._1);break;case l:xe=Qt,_e=$e(me.left,me.right,_e._1);break;case v:xe=Ut,_e=Je(me.left,_e._1,function(V){return function(){Pe===x&&(Pe++,en.enqueue(function(){Pe===x+1&&(xe=Qt,_e=V,U(Pe))}))}});return;case r:xe=wt,nt=me.left(_e._1),_e=null;break;case i:Ft===null?Ge=new ee(C,_e,Ge,Qe):Ge=new ee(C,_e,new ee(C,new ee(M,Ft,tn),Ge,Qe),Qe),Ft=null,tn=null,xe=gt,_e=_e._1;break;case d:ft++,Ft===null?Ge=new ee(C,_e,Ge,Qe):Ge=new ee(C,_e,new ee(C,new ee(M,Ft,tn),Ge,Qe),Qe),Ft=null,tn=null,xe=gt,_e=_e._1;break;case h:xe=Qt,L=St(me,st,_e._2),st&&st.register(L),_e._1&&L.run(),_e=me.right(L);break;case N:xe=gt,_e=In(me,st,_e._1);break}break;case wt:if(Ft=null,tn=null,Ge===null)xe=Jt,_e=Qe||nt||_e;else switch(L=Ge._3,k=Ge._1,Ge=Ge._2,k.tag){case i:Qe&&Qe!==L&&ft===0?xe=wt:nt&&(xe=gt,_e=k._2(me.fromLeft(nt)),nt=null);break;case M:Qe&&Qe!==L&&ft===0||nt?xe=wt:(Ft=k._1,tn=k._2,xe=Pt,_e=me.fromRight(_e));break;case d:ft--,nt===null&&(W=me.fromRight(_e),Ge=new ee(C,new ee(O,k._2,W),Ge,L),(Qe===L||ft>0)&&(xe=gt,_e=k._3(W)));break;case O:Ge=new ee(C,new ee(Y,_e,nt),Ge,Qe),xe=gt,Qe&&Qe!==L&&ft===0?_e=k._1.killed(me.fromLeft(Qe))(k._2):nt?_e=k._1.failed(me.fromLeft(nt))(k._2):_e=k._1.completed(me.fromRight(_e))(k._2),nt=null,ft++;break;case H:ft++,Ge=new ee(C,new ee(Y,_e,nt),Ge,Qe),xe=gt,_e=k._1;break;case Y:ft--,xe=wt,_e=k._1,nt=k._2;break}break;case Jt:for(var Q in Dt)Dt.hasOwnProperty(Q)&&(Br=Br&&Dt[Q].rethrow,He(Dt[Q].handler(_e)));Dt=null,Qe&&nt?setTimeout(function(){throw me.fromLeft(nt)},0):me.isLeft(_e)&&Br&&setTimeout(function(){if(Br)throw me.fromLeft(_e)},0);return;case ut:xe=gt;break;case Ut:return}}function $(x){return function(){if(xe===Jt)return Br=Br&&x.rethrow,x.handler(_e)(),function(){};var L=Ln++;return Dt=Dt||{},Dt[L]=x,function(){Dt!==null&&delete Dt[L]}}}function A(x,L){return function(){if(xe===Jt)return L(me.right(void 0))(),function(){};var W=$({rethrow:!1,handler:function(){return L(me.right(void 0))}})();switch(xe){case ut:Qe=me.left(x),xe=Jt,_e=Qe,U(Pe);break;case Ut:Qe===null&&(Qe=me.left(x)),ft===0&&(xe===Ut&&(Ge=new ee(C,new ee(H,_e(x)),Ge,Qe)),xe=wt,_e=null,nt=null,U(++Pe));break;default:Qe===null&&(Qe=me.left(x)),ft===0&&(xe=wt,_e=null,nt=null)}return W}}function D(x){return function(){var L=$({rethrow:!1,handler:x})();return xe===ut&&U(Pe),L}}return{kill:A,join:D,onComplete:$,isSuspended:function(){return xe===ut},run:function(){xe===ut&&(en.isDraining()?U(Pe):en.enqueue(function(){U(Pe)}))}}}function ct(me,st,It,Pe){var xe=0,_e={},nt=0,Qe={},Ft=new Error("[ParAff] Early exit"),tn=null,Ge=e;function ft($,A,D){var x=A,L=null,W=null,k=0,Q={},V,re;e:for(;;)switch(V=null,x.tag){case z:if(x._3===e&&(V=_e[x._1],Q[k++]=V.kill($,function(ie){return function(){k--,k===0&&D(ie)()}})),L===null)break e;x=L._2,W===null?L=null:(L=W._1,W=W._2);break;case y:x=x._2;break;case b:case S:L&&(W=new ee(C,L,W)),L=x,x=x._1;break}if(k===0)D(me.right(void 0))();else for(re=0,V=k;re":e===void 0?"":e instanceof Date?e.toString():typeof Blob!="undefined"&&e instanceof Blob?"file["+e.name+"]":JSON.stringify(e)}var Lx=pn(Mt),$1=Mi(Yl),Ax=gn(Mt);var mc=function(e){return e.foldrWithIndex};var _c=function(e){return e.foldlWithIndex};var Px=function(e){var n=mc(e);return function(r){var i=ke(r.Semigroup0()),l=Ot(r);return function(v){return n(function(E){return function(d){return function(h){return i(v(E)(d))(h)}}})(l)}}},hc={foldrWithIndex:function(e){return function(n){var r=Lx(function(l){return function(v){return e(l.value0)(l.value1)(v)}})(n),i=$1(Ze.create);return function(l){return r(i(l))}}},foldlWithIndex:function(e){return function(n){var r=Ax(function(l){return function(v){return e(v.value0)(l)(v.value1)}})(n),i=$1(Ze.create);return function(l){return r(i(l))}}},foldMapWithIndex:function(e){return Px(hc)(e)},Foldable0:function(){return Mt}};var q1=function(e){var n=_c(e);return function(r){var i=function(l){return function(v){return function(E){return v instanceof J?r(l)(E):v}}};return n(i)(J.value)}};function Sf(e){return Object.prototype.toString.call(e).slice(8,-1)}function If(e){return e===null}function gc(e){return e===void 0}var Lf=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};var Xa=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}();var Pf=function(e){var n=Fr(e);return function(r){return new Xa(r,n)}};var Bn=function(){function e(){}return e.value=new e,e}(),Kt=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),jf=function(e){return e},Jx=function(e){return new Kt(e.value0,e.value1)};var zx=function(e){var n=function(r){return function(i){var l=r,v=!1,E;function d(h,N){if(N instanceof Kt&&N.value1 instanceof Kt&&N.value1.value1 instanceof Kt){l=new Kt(N,h),i=N.value1.value1.value1;return}var y=function(S){return S instanceof Kt&&S.value1 instanceof Kt&&S.value1.value1 instanceof Bn?new Kt(e(S.value0),new Kt(e(S.value1.value0),Bn.value)):S instanceof Kt&&S.value1 instanceof Bn?new Kt(e(S.value0),Bn.value):Bn.value},b=function(S){return function(C){var M=S,O=!1,H;function Y(z,Z){if(z instanceof Kt&&z.value0 instanceof Kt&&z.value0.value1 instanceof Kt&&z.value0.value1.value1 instanceof Kt){M=z.value1,C=new Kt(e(z.value0.value0),new Kt(e(z.value0.value1.value0),new Kt(e(z.value0.value1.value1.value0),Z)));return}return O=!0,Z}for(;!O;)H=Y(M,C);return H}};return v=!0,b(h)(y(N))}for(;!v;)E=d(l,i);return E}};return n(Bn.value)},Vx={map:zx};var _o={foldr:function(e){return function(n){var r=function(){var l=function(v){return function(E){var d=v,h=!1,N;function y(b,S){if(S instanceof Bn)return h=!0,b;if(S instanceof Kt){d=new Kt(S.value0,b),E=S.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 107, column 7 - line 107, column 23): "+[b.constructor.name,S.constructor.name])}for(;!h;)N=y(d,E);return N}};return l(Bn.value)}(),i=gn(_o)(Nt(e))(n);return function(l){return i(r(l))}}},foldl:function(e){var n=function(r){return function(i){var l=r,v=!1,E;function d(h,N){if(N instanceof Bn)return v=!0,h;if(N instanceof Kt){l=e(h)(N.value0),i=N.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 111, column 12 - line 113, column 30): "+[N.constructor.name])}for(;!v;)E=d(l,i);return E}};return n},foldMap:function(e){var n=ke(e.Semigroup0()),r=Ot(e);return function(i){return gn(_o)(function(l){var v=n(l);return function(E){return v(i(E))}})(r)}}};var Kx=pn(_o);var lm={append:function(e){return function(n){return Kx(Kt.create)(n)(e)}}},K1=ke(lm);var Nf={append:function(e){return function(n){return new Xa(e.value0,K1(e.value1)(Jx(n)))}}};var Yx={alt:K1,Functor0:function(){return Vx}},Y1=function(){return{empty:Bn.value,Alt0:function(){return Yx}}}();var fm=function(){var e=Pf(Y1);return function(n){return jf(e(n))}}();var t0=function(e){return e.value0};var ni=function(e){return e.length};var n0=function(e){return function(n){return function(r){return function(i){var l=i.indexOf(r);return l===-1?n:e(l)}}}};var Wu=function(e){return function(n){return n.substr(0,e)}},ri=function(e){return function(n){return n.substring(e)}};var No=function(e){return function(n){if(e>=0&&e""),Q2=Hf.unmountComponentAtNode;function iD(e,n,r){return ar.createElement.apply(null,[e,X2(e,n)].concat(r))}function X2(e,n){if(typeof e!="string"||n._data==null)return n;var r={_data:void 0};for(var i in n._data){var l=n._data[i];r["data-"+i]=l}return Object.assign({},n,r)}var uD=(e,n)=>n[e],lD=(e,n,r)=>r[e]=n;var Vu=function(n){return function(r){return n(r)()}};var Hi=function(n){return function(r){return function(i){return function(){return n(r,i)}}}},Ku=function(n){return function(r){return function(i){return function(l){return function(){return n(r,i,l)}}}}};var qm=null;function fD(e,n,r){return e==null?n:r(e)}function Jm(e){return e}var ko=Et(qm)(Jm),Le=function(e){return fD(e,J.value,G.create)};var vM=Ct(it);var no={asReactChildren:function(e){return[e]}},Ho={asReactChildren:function(e){return[e]}},ro={asReactChildren:Ue(We)};var dD=Ku(rD),vD=function(){return Ku(lD)},pD=Hi(aD),mD=Hi(oD);var zm=function(e){var n=kf(e);return function(r){return function(i){return vM(function(){return uD(r,i)})(n)}}};var pM=function(e){return e.asReactChildren},Sc=function(){return function(e){var n=pM(e);return function(r){return function(i){return function(l){return iD(r,i,n(l))}}}}},mM=Sc()(ro),Ic=function(){return function(e){return function(n){return mM(e)(n)([])}}};var _D=X(it),_M=ce(_n);var hD=function(){var e=function(n){return function(r){return{initialize:function(i){return yi(new G(r.initialState))(n)},getState:function(i){return _D(Zt(r.initialState))(hu(n))},setState:function(i){return function(l){return function(v){return function(){return yi(new G(l))(n)(),dD(i)(l)(_M(Te))(),v()}}}}}}};return _D(e)(Gl(J.value))}();var gD=Ct(Vt),DD=ke(dr);var gM=ce(_n),yD=vD(),DM=zm(Gn),RD=X(it),yM=zm(xr(f0)),RM=jn(On),TM=Nn(Jr),EM=Ap(_n)(Mt),bM=RM(rr),TD=Lt(Pu),FM=Lh(Vo),wM=ke(fp(Ep(Ws)));var Bi=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),CM={map:function(e){return function(n){return new Bi(e(n.value0),n.value1)}}},Qf=function(e){return{bimap:function(n){return function(r){return function(i){return new Bi(r(i.value0),gD(i.value1)(function(l){return function(v){return l({dispatch:function(E){return v.dispatch(n(E))},onStop:v.onStop})}}))}}}}},ED={apply:function(e){return function(n){return new Bi(e.value0(n.value0),DD(e.value1)(n.value1))}},Functor0:function(){return CM}},Gi={bind:function(e){return function(n){var r=n(e.value0);return new Bi(r.value0,DD(e.value1)(r.value1))}},Apply0:function(){return ED}},Bo={pure:function(e){return new Bi(e,[])},Apply0:function(){return ED}};var xM=function(e){var n=ve(e);return function(r){var i=Lt(r);return function(l){return function(v){return new Bi(l,gD(v)(function(E){return function(d){return n(E)(function(h){return i(d.dispatch(h))})}}))}}}};var Xf=function(e){return new Bi(Te,[e])},Yu=function(e){return Xf(Ke(e))},Qu=function(e){var n=ve(e.Monad0().Bind1()),r=Lt(e);return function(i){return Xf(function(l){return n(i)(function(v){return r(Et(gM(Te))(l.dispatch)(v))})})}},Xu=function(e){var n=xM(e.Monad0().Bind1())(e);return function(r){return n(Te)([r])}},MM=function(e){return function(n){return function(r){var i=r({initialState:n.init.value0}),l=yD("__unmounted"),v=yD("__subscriptions"),E=function(){var C=RD(Zt(!1)),M=DM("__unmounted");return function(O){return C(M(O))}}(),d=function(){var C=RD(Zt([])),M=yM("__subscriptions");return function(O){return C(M(O))}}(),h=function(C){return function(){return TM(EM)(d(C))(),v([])(C)()}},N=function(C){return function(M){return function(){var H=d(C)();return v(Ao(nm(M))(H))(C)()}}},y=function(C){return function(M){var O=function(H){return nm(bM(jo(0))(function(){return H({dispatch:function(){var Y=b(M);return function(z){return TD(Y(z))}}(),onStop:N(M)})}))};return Rp(C)(O)}},b=function(C){return function(M){return FM(E(C))(function(){var H=i.getState(C)(),Y=n.update(H)(M);return i.setState(C)(Y.value0)(y(Y.value1)(C))()})}},S=function(C){return function(){var O=i.getState(C)();return n.view(O)(b(C))}};return U1(e,{init:i.initialize,render:S,componentDidMount:y(n.init.value1),componentWillUnmount:wM(l(!0))(h)})}}},bD=function(e){return function(){var r=TD(hD)();return O1(function(i){return MM(i)(e)(r)})}};var Zf={handle:function(e){return function(n){return function(r){return e(n(r))()}}}},FD={handleEffect:function(e){return Vu(e)}},wD={handleEffect:function(e){return Vu(Ke(e))}},Zu={handle:function(e){return function(n){return function(r){return e(n)()}}}};var ed=function(e){return e.handleEffect},ii=function(e){return e.handle};function td(e,n){var r={};for(var i in n)({}).hasOwnProperty.call(n,i)&&(r[i]=n[i]);for(var l in e)({}).hasOwnProperty.call(e,l)&&(r[l]=e[l]);return r}var CD=function(){return function(){return function(e){return function(n){return td(e,n)}}}};var xD=Sc(),SM=CD()();var MD=he;var Lc=function(e){var n=xD(e);return function(r){return function(i){return function(l){return n(MD(r))(SM(l)({className:i}))}}}};var nd=function(e){return function(n){var r=xD(n);return function(i){return function(l){return r(MD(e))({className:i})(l)}}}};var $i=he;var SD=function(e){var n=Lc(e);return function(){return function(){return n("video")}}};var Vm=function(e){return nd("span")(e)};var ID=function(e){return nd("i")(e)};var ui=function(e){var n=Lc(e);return function(){return function(){return n("div")}}},Go=function(e){return nd("div")(e)};var rd=function(e){var n=Lc(e);return function(){return function(){return n("button")}}};var LD=function(e){var n=Lc(e);return function(){return function(){return n("a")}}};var AD=Pl(xm()),PD=AD.Fragment;var Ac=he,Km=Sc()(ro)(PD)({}),Sr=!1;var IM=ce(_n);var LM=function(e){var n=ve(e.Monad0().Bind1()),r=Lt(e);return function(i){return function(l){return Xf(function(v){return n(l(function(){var E=Et(IM(Te))(v.dispatch);return function(d){return E(i(d))}}()))(function(E){return r(v.onStop(E))})})}}},jD=function(e){var n=LM(e);return function(r){return n(function(i){return G.create(r(i))})}};var Ea=function(){return{"genericTop'":qt.value}}();var Ym=function(e){return e["genericTop'"]},ba=function(e){return{"genericTop'":Ym(e)}};var Fa=function(){return{"genericBottom'":qt.value}}();var Pc=function(e){return e["genericBottom'"]},wa=function(e){return{"genericBottom'":Pc(e)}};var Ca=function(e){return{"genericBottom'":new _t(Pc(e))}},ND=function(e){var n=pu(e);return function(r){return n(Pc(r))}};var li=X(Se),ad=hn();var Qm=function(e){return e["genericToEnum'"]};var od=function(e){return e["genericSucc'"]},UD=function(e){var n=pu(e),r=Bl(e);return function(i){var l=li(n),v=od(i);return function(E){return l(v(r(E)))}}},Xm=function(e){return e["genericPred'"]};var Zm=function(e){return e["genericFromEnum'"]};var xa=function(e){var n=Xm(e),r=od(e);return function(i){var l=Ym(i);return function(v){var E=Xm(v),d=od(v);return function(h){var N=Pc(h);return{"genericPred'":function(y){if(y instanceof _t)return li(_t.create)(n(y.value0));if(y instanceof Xe){var b=E(y.value0);if(b instanceof J)return new G(new _t(l));if(b instanceof G)return new G(new Xe(b.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 30, column 14 - line 32, column 31): "+[b.constructor.name])}throw new Error("Failed pattern match at Data.Enum.Generic (line 28, column 18 - line 32, column 31): "+[y.constructor.name])},"genericSucc'":function(y){if(y instanceof _t){var b=r(y.value0);if(b instanceof J)return new G(new Xe(N));if(b instanceof G)return new G(new _t(b.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 34, column 14 - line 36, column 31): "+[b.constructor.name])}if(y instanceof Xe)return li(Xe.create)(d(y.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 33, column 18 - line 37, column 36): "+[y.constructor.name])}}}}}};var Ma={"genericPred'":function(e){return J.value},"genericSucc'":function(e){return J.value}},Sa=function(e){var n=Xm(e),r=od(e);return{"genericPred'":function(i){return li(Hl)(n(i))},"genericSucc'":function(i){return li(Hl)(r(i))}}};var e_=function(e){return e["genericCardinality'"]};var Ia=function(e){var n=e_(e),r=Qm(e),i=Zm(e);return function(l){var v=Qm(l),E=Zm(l);return{"genericCardinality'":ad(n)+ad(e_(l))|0,"genericToEnum'":function(d){var h=function(N){if(d>=0&&d1;if(r){var i=Oc(No(1)(e)),l=YD(i);return l?KD(n)(i):n}return n},uS=GD(iS),ZD=$D(oS)(uS),el=function(e){return Ga(ZD(e))};var ey=function(e){return function(n){return VD(function(r){return el(Wu(r)(n))})(pm(e)(n))}};var iy=Ae;var RS=Dm(Mt),TS=Ct(Vt),ES=Eu(kD),Wr=function(e){return function(n){var r=RS(TS(n)(function(i){return new Ze(e(i),i)}));return function(i){return $u(i)(r)}}},bS=function(e){var n=UD(e),r=ND(e);return function(i){var l=n(i);return function(v){return function(E){return ES(function(d){return new Ze(d,l(d))})(r(E))}}}},Pa=function(e){var n=bS(e);return function(r){var i=n(r);return function(l){var v=i(l);return function(E){return jc(v(E))}}}};var FS={info:"info",warning:"warn",error:"error"},a_=e=>n=>r=>i=>{let l=FS[e];if(typeof console!="undefined"&&console[l]&&console[l](n,r),typeof window!="undefined"){let v=new Error(n);typeof window.Sentry!="undefined"&&window.Sentry.captureException(v,{extra:r})}return i()},uy=(e,n)=>(n.__sentryFingerprint=e,n);var ly=function(e){return Lo(uy)(e)};var cy="error";var cd={parseOrPanic:function(e){return function(n){var r=e.parse(n);if(r instanceof Fe)return r.value0;if(r instanceof be)return a_(cy)("Failed to parse "+e.diagnosticName)({error:r.value0,value:n})(function(i){return e.default});throw new Error("Failed pattern match at Utils.Parse (line 49, column 5 - line 57, column 24): "+[r.constructor.name])}}},cr=function(e){return e.parseOrPanic},wS=cr(cd),Ji=function(e){var n=cr(e);return function(r){var i=X(r);return function(l){return n({parse:function(v){return i(G.create)(l.parse(v))},default:J.value,diagnosticName:l.diagnosticName})}}},CS=Ji(cd)(Kn),zi=function(e){var n=Oi(e);return function(r){return CS({parse:n,diagnosticName:r})}},Qn={parseOrPanic:function(e){return wS({default:e.default,diagnosticName:e.diagnosticName,parse:function(){var n=Et(new be(""))(Fe.create);return function(r){return n(e.parse(r))}}()})}};var dy=Sa(Ma),vy=wa(Fa),py=Aa(La),tl=function(){function e(){}return e.value=new e,e}(),Uc=function(){function e(){}return e.value=new e,e}(),xS={to:function(e){if(e instanceof _t)return tl.value;if(e instanceof Xe)return Uc.value;throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 20, column 1 - line 20, column 32): "+[e.constructor.name])},from:function(e){if(e instanceof tl)return new _t(qt.value);if(e instanceof Uc)return new Xe(qt.value);throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 20, column 1 - line 20, column 32): "+[e.constructor.name])}};var MS=function(e){if(e instanceof tl)return"school";if(e instanceof Uc)return"vine";throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 32, column 1 - line 32, column 29): "+[e.constructor.name])},my=function(){return cr(Qn)({parse:Wr(MS)(Pa(xS)(xa(dy)(ba(Ea))(dy)(vy))(Ia(py)(py))(Ca(vy))),default:tl.value,diagnosticName:"Sem.Connections.Types.Actor"})}();var _y=Sa(Ma),hy=xa(_y)(ba(Ea)),gy=wa(Fa),Dy=Ca(gy),yy=Aa(La),Ry=Ia(yy),SS=rn(Bs),nl=function(){function e(){}return e.value=new e,e}(),Wc=function(){function e(){}return e.value=new e,e}(),rl=function(){function e(){}return e.value=new e,e}(),IS={to:function(e){if(e instanceof _t)return nl.value;if(e instanceof Xe&&e.value0 instanceof _t)return Wc.value;if(e instanceof Xe&&e.value0 instanceof Xe)return rl.value;throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 24, column 1 - line 24, column 33): "+[e.constructor.name])},from:function(e){if(e instanceof nl)return new _t(qt.value);if(e instanceof Wc)return new Xe(new _t(qt.value));if(e instanceof rl)return new Xe(new Xe(qt.value));throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 24, column 1 - line 24, column 33): "+[e.constructor.name])}};var LS=function(e){if(e instanceof nl)return"pending";if(e instanceof Wc)return"connected";if(e instanceof rl)return"ignored";throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 40, column 1 - line 40, column 30): "+[e.constructor.name])},Ty=function(){var e=Wr(LS)(Pa(IS)(hy(hy(_y)(gy))(Dy))(Ry(Ry(yy)))(Dy)),n=function(r){return r==="cold"?new G(rl.value):J.value};return cr(Qn)({parse:function(r){return SS(e(r))(n(r))},default:nl.value,diagnosticName:"Sem.Connections.Types.Status"})}();var Ey=function(e){return{initiator:my(e.initiator),status:Ty(e.status),introMessage:Zt("")(Le(e.introMessage))}};var dd=function(){function e(){}return e.value=new e,e}(),by=function(){function e(){}return e.value=new e,e}();var Fy=function(){var e=cr(Qn)({parse:function(n){return n instanceof G&&n.value0==="paid"?new G(by.value):n instanceof G&&n.value0==="free"?new G(dd.value):n instanceof G&&n.value0==="churned"?new G(dd.value):n instanceof J?new G(dd.value):J.value},default:dd.value,diagnosticName:"Sem.Types.PartnerStatus"});return function(n){return e(Le(n))}}();var wy=function(e){return{allowedToContact:e.allowedToContact,id:e.id,name:e.name,imageUrl:Le(e.imageUrl),partnerStatus:Fy(e.partnerStatus)}};var AS=ve(Yt),i_=Oo(),kc=Fn(Ae),Cy=K({reflectSymbol:function(){return"id"}}),PS=jn(On)(Yt),jS=nf(hp),NS=X(Se);var OS=Ae,US=zi(i_(K({reflectSymbol:function(){return"avatarUrl"}})(kc)(K({reflectSymbol:function(){return"bio"}})(kc)(K({reflectSymbol:function(){return"connection"}})(Fn(i_(K({reflectSymbol:function(){return"initiator"}})(Ae)(K({reflectSymbol:function(){return"introMessage"}})(kc)(K({reflectSymbol:function(){return"status"}})(Ae)(At))))))(K({reflectSymbol:function(){return"firstName"}})(Ae)(Cy(OS)(K({reflectSymbol:function(){return"lastName"}})(Ae)(K({reflectSymbol:function(){return"school"}})(i_(K({reflectSymbol:function(){return"allowedToContact"}})(Gn)(Cy(iy)(K({reflectSymbol:function(){return"imageUrl"}})(kc)(K({reflectSymbol:function(){return"name"}})(Ae)(K({reflectSymbol:function(){return"partnerStatus"}})(kc)(At)))))))(K({reflectSymbol:function(){return"title"}})(Ae)(K({reflectSymbol:function(){return"type"}})(Ae)(K({reflectSymbol:function(){return"unreadMessageCountFromSemUser"}})(et)(At))))))))))));var xy=function(e){return AS(US("SemUser")(e))(function(n){return PS(jS(n.type==="Sem::User"))(function(){return new G({school:wy(n.school),firstName:n.firstName,lastName:n.lastName,avatarUrl:Le(n.avatarUrl),title:n.title,bio:Le(n.bio),connection:NS(Ey)(Le(n.connection)),unreadMessageCountFromSemUser:n.unreadMessageCountFromSemUser,id:n.id})})})};var Oy=function(){function e(){}return e.value=new e,e}(),Uy=function(){function e(){}return e.value=new e,e}(),Wy=function(){function e(){}return e.value=new e,e}();var e3=function(e){if(e instanceof Oy)return"disabled";if(e instanceof Uy)return"free-consultation";if(e instanceof Wy)return"more-information";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types.InquiryMode (line 31, column 13 - line 34, column 40): "+[e.constructor.name])};var t3=function(){return[Oy.value,Uy.value,Wy.value]}(),ky=Ji(Qn)(Se)({parse:Wr(e3)(t3),diagnosticName:"InquiryMode"});function Zy(e){return function(n){return function(){return n.getElementById(e)}}}var J3=X(it),pd=function(e){var n=J3(Le),r=Zy(e);return function(i){return n(r(i))}};var md=function(e){return function(n){return function(){return n[e]}}},z3=md("children"),V3=md("firstElementChild"),K3=md("lastElementChild"),Y3=md("childElementCount");var ao=function(){return window};function eR(e,n,r,i){if(typeof window!="undefined"){var l=window[r];if(l!=null&&i instanceof l)return n(i)}for(var v=i;v!=null;){var E=Object.getPrototypeOf(v),d=E.constructor.name;if(d===r)return n(i);if(d==="Object")return e;v=E}return e}var Ne=function(e){return function(n){return eR(J.value,G.create,e,n)}};var _d=he;function tR(e,n,r){var i=Object.prototype.toString.call(r);return i.indexOf("[object HTML")===0&&i.indexOf("Element]")===i.length-8?n(r):e}var nR=function(e){return tR(J.value,G.create,e)};function hd(e){return function(){return e.currentTime}}function v_(e){return function(){return e.volume}}function p_(e){return function(n){return function(){n.volume=e}}}function m_(e){return function(){return e.muted}}function Vi(e){return function(n){return function(){n.muted=e}}}var rR=Ne("HTMLMediaElement");var aR=Ne("HTMLMediaElement");function __(e){return function(n){return function(){n.href=e}}}function h_(e){return function(){return e.platform}}function qc(e){return function(){return e.document}}function g_(e){return function(){return e.navigator}}function D_(e){return function(){return e.location}}function gd(e){return function(){return e.localStorage}}var Z3=Zs(_n)(Xs),oR=ve(Jr),iR=Ct(it),e4=ve(Yt);var uR=Nt(Et(Sr));var t4=function(e){return function(n){if(e)return n(Te);if(at)return Sr;throw new Error("Failed pattern match at Utils.HTML (line 94, column 1 - line 94, column 61): "+[e.constructor.name,n.constructor.name])}},Ki=function(e){return function(n){return t4(e)(Ke(n))}};var yd=function(e){return Z3(aR(e.target))(hd)};var n4=function(e){return oR(iR(oR(ao)(qc))(_d))(pd(e))},lR=function(e){return iR(n4(e))(function(n){return e4(n)(nR)})};var Jc=et;var cR=({just:e,nothing:n})=>r=>{try{let i=new Date(r);return isNaN(i.getTime())?n:e(i)}catch{return n}},sR=e=>({year:e.getFullYear(),month:e.getMonth(),day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),millisecond:e.getMilliseconds()});var r4=(()=>{let e=new Date;return typeof window!="undefined"?()=>e:()=>{let n=new Date;return n-e>1e3&&(e=n),e}})();var a4=(()=>{let e=new Date().toString(),n=(e.match(/\(([\w\s]+)\)$/)||[])[1];return n?/\s/.test(n)?(n.match(/\b(\w)/g)||[]).join(""):n:(n=(e.match(/(\w{3,4})\s\d{4}$/)||[])[1],n||(n=(e.match(/(UTC[\+\-]\d+)/)||[])[1],n)||(n=(e.match(/(GMT[\+\-]\d+)/)||[])[1],n)?n:"")})();var dR={liftAff:Ue(We),MonadEffect0:function(){return Dn}};var Iqe=function(){function e(){this.head=null,this.last=null,this.size=0}function n(y,b){this.queue=y,this.value=b,this.next=null,this.prev=null}function r(y){this.draining=!1,this.error=null,this.value=y,this.takes=new e,this.reads=new e,this.puts=new e}var i={};function l(y){try{y()}catch(b){setTimeout(function(){throw b},0)}}function v(y,b){var S=new n(y,b);switch(y.size){case 0:y.head=S;break;case 1:S.prev=y.head,y.head.next=S,y.last=S;break;default:S.prev=y.last,y.last.next=S,y.last=S}return y.size++,S}function E(y){var b;switch(y.size){case 0:return null;case 1:b=y.head,y.head=null;break;case 2:b=y.last,y.head.next=null,y.last=null;break;default:b=y.last,y.last=b.prev,y.last.next=null}return b.prev=null,b.queue=null,y.size--,b.value}function d(y){var b;switch(y.size){case 0:return null;case 1:b=y.head,y.head=null;break;case 2:b=y.head,y.last.prev=null,y.head=y.last,y.last=null;break;default:b=y.head,y.head=b.next,y.head.prev=null}return b.next=null,b.queue=null,y.size--,b.value}function h(y){if(y.queue!==null){if(y.queue.last===y){E(y.queue);return}if(y.queue.head===y){d(y.queue);return}y.prev&&(y.prev.next=y.next),y.next&&(y.next.prev=y.prev),y.queue.size--,y.queue=null,y.value=null,y.next=null,y.prev=null}}function N(y,b){if(!b.draining){var S=b.puts,C=b.takes,M=b.reads,O,H,Y,z,Z;for(b.draining=!0;;){if(O=null,H=null,Y=null,z=b.value,Z=M.size,b.error!==null){for(z=y.left(b.error);O=d(S);)l(O.cb(z));for(;H=d(M);)l(H(z));for(;Y=d(C);)l(Y(z));break}if(z===i&&(O=d(S))&&(b.value=z=O.value),z!==i){for(Y=d(C);Z--&&(H=d(M));)l(H(y.right(z)));Y!==null&&(b.value=i,l(Y(y.right(z))))}if(O!==null&&l(O.cb(y.right(void 0))),b.value===i&&S.size===0||b.value!==i&&C.size===0)break}b.draining=!1}}return r.EMPTY=i,r.putLast=v,r.takeLast=E,r.takeHead=d,r.deleteCell=h,r.drainVar=N,r}();var ci=ve(Yt),m4=vt(Kr),_4=vt(nr),h4=vt(ha),g4=vt(Ra),D4=vt(Da),y4=vt(ga),R4=vt(ya),T4=ce(pr);var E4=Ct(Se);var b4=function(e){return ci(m4(e.year))(function(n){return ci(_4(e.month+1|0))(function(r){return ci(h4(e.day))(function(i){return ci(g4(e.hour))(function(l){return ci(D4(e.minute))(function(v){return ci(y4(e.second))(function(E){return ci(R4(e.millisecond))(function(d){return T4(new Xo(Pi(n)(r)(i),new mo(l,v,E,d)))})})})})})})})};var il=function(e){return ci(E4(cR({just:G.create,nothing:J.value})(e))(sR))(b4)};var y_=ce(pr),F4=X(Se),vR=ve(Yt);var pR=Sa(Ma),mR=xa(pR)(ba(Ea)),_R=wa(Fa),hR=Ca(_R),gR=Aa(La),DR=Ia(gR);var R_=function(){function e(){}return e.value=new e,e}(),T_=function(){function e(){}return e.value=new e,e}(),E_=function(){function e(){}return e.value=new e,e}();var w4={to:function(e){if(e instanceof _t)return R_.value;if(e instanceof Xe&&e.value0 instanceof _t)return T_.value;if(e instanceof Xe&&e.value0 instanceof Xe)return E_.value;throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 183, column 1 - line 183, column 41): "+[e.constructor.name])},from:function(e){if(e instanceof R_)return new _t(qt.value);if(e instanceof T_)return new Xe(new _t(qt.value));if(e instanceof E_)return new Xe(new Xe(qt.value));throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 183, column 1 - line 183, column 41): "+[e.constructor.name])}};var C4=function(e){if(e instanceof R_)return"stuffed";if(e instanceof T_)return"satisfied";if(e instanceof E_)return"hungry";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 242, column 27 - line 245, column 35): "+[e.constructor.name])};var x4=Ji(Qn)(Se)({parse:Wr(C4)(Pa(w4)(mR(mR(pR)(_R))(hR))(DR(DR(gR)))(hR)),diagnosticName:"ClientAppetite"}),yR=function(e){return vR(Et(y_(J.value))(function(){var n=F4(y_);return function(r){return n(x4(r))}}())(Le(e.clientAppetite)))(function(n){return vR(ky(e.inquiryMode))(function(r){return y_({packages:e.packages,pricePerHourCents:e.pricePerHourCents,singleSessionDurationMinutes:e.singleSessionDurationMinutes,singleSessionRefundPeriodLengthDays:e.singleSessionRefundPeriodLengthDays,themes:e.themes,freeConsultationDurationMinutes:Le(e.freeConsultationDurationMinutes),canSubmitConsultInquiry:Le(e.canSubmitConsultInquiry),clientAppetite:n,inquiryMode:r})})})};var RR=ve(Yt),ul=Oo(),b_=Fn(Ae),TR=K({reflectSymbol:function(){return"description"}})(Ae),Rd=K({reflectSymbol:function(){return"id"}})(et),F_=K({reflectSymbol:function(){return"name"}})(Ae),ER=ul(Rd(F_(K({reflectSymbol:function(){return"slug"}})(Ae)(At)))),bR=xr(ER),M4=zi(ul(K({reflectSymbol:function(){return"advisingConfig"}})(Fn(ul(K({reflectSymbol:function(){return"canSubmitConsultInquiry"}})(Fn(Gn))(K({reflectSymbol:function(){return"clientAppetite"}})(b_)(K({reflectSymbol:function(){return"freeConsultationDurationMinutes"}})(Fn(et))(K({reflectSymbol:function(){return"inquiryMode"}})(Ae)(K({reflectSymbol:function(){return"packages"}})(xr(ul(K({reflectSymbol:function(){return"activeForSale"}})(Gn)(TR(Rd(F_(K({reflectSymbol:function(){return"numMinutes"}})(et)(K({reflectSymbol:function(){return"packageCategories"}})(bR)(K({reflectSymbol:function(){return"refundPeriodLengthDays"}})(et)(K({reflectSymbol:function(){return"totalPriceCents"}})(Jc)(At)))))))))))(K({reflectSymbol:function(){return"pricePerHourCents"}})(Jc)(K({reflectSymbol:function(){return"singleSessionDurationMinutes"}})(et)(K({reflectSymbol:function(){return"singleSessionRefundPeriodLengthDays"}})(et)(K({reflectSymbol:function(){return"themes"}})(xr(ul(K({reflectSymbol:function(){return"active"}})(Gn)(K({reflectSymbol:function(){return"category"}})(ER)(TR(K({reflectSymbol:function(){return"durationMinutes"}})(et)(Rd(K({reflectSymbol:function(){return"priceCents"}})(Jc)(K({reflectSymbol:function(){return"title"}})(Ae)(At))))))))))(At))))))))))))(K({reflectSymbol:function(){return"entity"}})(ul(K({reflectSymbol:function(){return"bio"}})(Ae)(Rd(K({reflectSymbol:function(){return"imageUrl"}})(b_)(F_(K({reflectSymbol:function(){return"organizationId"}})(et)(K({reflectSymbol:function(){return"organizationName"}})(Ae)(K({reflectSymbol:function(){return"shortEducation"}})(b_)(K({reflectSymbol:function(){return"tags"}})(bR)(At))))))))))(At)))),w_=ce(pr),C_=X(Se),S4=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),I4=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),L4=function(e){return RR(M4("ServiceProviderPresenter")(e))(function(n){return RR(Et(w_(J.value))(function(){var r=C_(w_);return function(i){return r(yR(i))}}())(Le(n.advisingConfig)))(function(r){return w_({entity:n.entity,advisingConfig:r})})})},FR=Ji(Qn)(Se)({parse:function(e){return e.type==="Sem::User"?C_(S4.create)(xy(e.presenter)):e.type==="ServiceProviders::Individual"?C_(I4.create)(L4(e.presenter)):J.value},diagnosticName:"Livestream Guest Presenter"});var wR=Sa(Ma),CR=xa(wR)(ba(Ea)),xR=wa(Fa),MR=Ca(xR),SR=Aa(La),IR=Ia(SR),zc=function(){function e(){}return e.value=new e,e}(),Td=function(){function e(){}return e.value=new e,e}(),Ed=function(){function e(){}return e.value=new e,e}(),A4={to:function(e){if(e instanceof _t)return zc.value;if(e instanceof Xe&&e.value0 instanceof _t)return Td.value;if(e instanceof Xe&&e.value0 instanceof Xe)return Ed.value;throw new Error("Failed pattern match at Livestream.Types.Poll (line 41, column 1 - line 41, column 37): "+[e.constructor.name])},from:function(e){if(e instanceof zc)return new _t(qt.value);if(e instanceof Td)return new Xe(new _t(qt.value));if(e instanceof Ed)return new Xe(new Xe(qt.value));throw new Error("Failed pattern match at Livestream.Types.Poll (line 41, column 1 - line 41, column 37): "+[e.constructor.name])}};var x_=function(e){if(e instanceof zc)return"ready";if(e instanceof Td)return"live";if(e instanceof Ed)return"closed";throw new Error("Failed pattern match at Livestream.Types.Poll (line 64, column 23 - line 67, column 21): "+[e.constructor.name])};var bd=function(){return cr(Qn)({parse:Wr(x_)(Pa(A4)(CR(CR(wR)(xR))(MR))(IR(IR(SR)))(MR)),default:zc.value,diagnosticName:"livestream poll status"})}(),M_=function(e){return{id:e.id,question:e.question,multiSelect:e.multiSelect,options:e.options,autoDisplayMinutesFromStart:Le(e.autoDisplayMinutesFromStart)}};var LR=function(e){return{fullName:e.fullName,firstName:e.firstName,totalStreams:e.totalStreams,undergrad:{college:Le(e.undergrad.college),major:Le(e.undergrad.major),year:Le(e.undergrad.year)},gradCollege:Le(e.gradCollege),workExperience:Le(e.workExperience),admissionsStory:Le(e.admissionsStory),pictureUrl:Le(e.pictureUrl),allStreamsUrl:Le(e.allStreamsUrl)}};var P4=Ct(Se),AR=Sa(Ma),PR=xa(AR)(ba(Ea)),jR=wa(Fa),NR=Ca(jR),OR=Aa(La),UR=Ia(OR),WR=cr(Qn),kR=zs(),HR=Nn(Yt),j4=Ct(Vt),N4=X(Se),O4=ve(Yt),Yi=function(){function e(){}return e.value=new e,e}(),ll=function(){function e(){}return e.value=new e,e}(),cl=function(){function e(){}return e.value=new e,e}();var BR=on;var U4={to:function(e){if(e instanceof _t)return Yi.value;if(e instanceof Xe&&e.value0 instanceof _t)return ll.value;if(e instanceof Xe&&e.value0 instanceof Xe)return cl.value;throw new Error("Failed pattern match at Livestream.Types.Conference (line 175, column 1 - line 175, column 39): "+[e.constructor.name])},from:function(e){if(e instanceof Yi)return new _t(qt.value);if(e instanceof ll)return new Xe(new _t(qt.value));if(e instanceof cl)return new Xe(new Xe(qt.value));throw new Error("Failed pattern match at Livestream.Types.Conference (line 175, column 1 - line 175, column 39): "+[e.constructor.name])}};var GR=function(){var e=function(n){if(n instanceof Yi)return"waiting_room";if(n instanceof ll)return"on_air";if(n instanceof cl)return"complete";throw new Error("Failed pattern match at Livestream.Types.Conference (line 188, column 17 - line 191, column 35): "+[n.constructor.name])};return Wr(e)(Pa(U4)(PR(PR(AR)(jR))(NR))(UR(UR(OR)))(NR))}(),$R=function(){return WR({parse:GR,default:Yi.value,diagnosticName:"livestream status"})}(),W4=WR({parse:il,default:an(yf),diagnosticName:"livestream scheduled start time"}),Fd=function(e){return{uid:e.uid,title:e.title,description:e.description,url:e.url,imageUrl:e.imageUrl,duration:e.duration,tailTime:e.tailTime,stats:e.stats,isPrivate:e.isPrivate,legacyRecording:e.legacyRecording,collegeFair:e.collegeFair,id:e.id,school:P4(Le(e.school))(function(n){return{cityState:n.cityState,name:n.name,id:kR(n.id),slug:kR(n.slug)}}),scheduledStartTime:W4(e.scheduledStartTime),onAirTime:HR(il)(Le(e.onAirTime)),streamStatus:$R(e.streamStatus),watchUrl:Le(e.watchUrl),streamingStartTime:HR(il)(Le(e.streamingStartTime)),polls:j4(e.polls)(function(n){return{poll:M_(n.poll),status:bd(n.status)}}),presenter:N4(LR)(Le(e.presenter)),partnerType:Le(e.partnerType),guestPresenter:O4(Le(e.guestPresenter))(FR),zoomJoinUrl:Le(e.zoomJoinUrl),zoomStartUrl:Le(e.zoomStartUrl)}};var k4=typeof CV!="undefined"&&CV.pathInfo||typeof global!="undefined"&&global.CV&&global.CV.pathInfo||(e=>null);function qR(e,n){let r=typeof CV!="undefined"&&CV.apiEndpoint||typeof global!="undefined"&&global.CV&&global.CV.apiEndpoint;return r||console.error("Missing `CV.apiEndpoint` function"),r&&r(e,n)}function JR(e,n,r,i,l){return function(v,E){var d=e.newXHR(),h=e.fixupUrl(l.url,d);if(d.open(l.method||"GET",h,!0,l.username,l.password),l.headers)try{for(var N=0,y;(y=l.headers[N])!=null;N++)d.setRequestHeader(y.field,y.value)}catch(S){v(S)}var b=function(S){return function(){v(new Error(S))}};return d.onerror=b(r),d.ontimeout=b(n),d.onload=function(){E({status:d.status,statusText:d.statusText,headers:d.getAllResponseHeaders().split(`\r `).filter(function(S){return S.length>0}).map(function(S){var C=S.indexOf(":");return i(S.substring(0,C))(S.substring(C+2))}),body:d.response})},d.responseType=l.responseType,d.withCredentials=l.withCredentials,d.timeout=l.timeout,d.send(l.content),function(S,C,M){try{d.abort()}catch(O){return C(O)}return M()}}}var wd="application/json",zR="application/x-www-form-urlencoded";var VR=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),KR=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),YR=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),QR=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),XR=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),S_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Cd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),ZR=function(e){return e instanceof S_?new G(zR):e instanceof Cd?new G(wd):J.value};var eT=function(){return Cd.create}();var tT=hn();var xd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Md=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),sl=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),nT=function(e){if(e instanceof xd||e instanceof Md)return tT(e.value0);if(e instanceof sl)return e.value1;throw new Error("Failed pattern match at Affjax.RequestHeader (line 26, column 1 - line 26, column 33): "+[e.constructor.name])};var I_=function(e){if(e instanceof xd)return"Accept";if(e instanceof Md)return"Content-Type";if(e instanceof sl)return e.value0;throw new Error("Failed pattern match at Affjax.RequestHeader (line 21, column 1 - line 21, column 32): "+[e.constructor.name])};var rT=Ue(We),L_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),A_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),P_=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Sd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Id=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Ld=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),aT=function(e){if(e instanceof L_)return"arraybuffer";if(e instanceof A_)return"blob";if(e instanceof P_)return"document";if(e instanceof Sd||e instanceof Id)return"text";if(e instanceof Ld)return"";throw new Error("Failed pattern match at Affjax.ResponseFormat (line 44, column 3 - line 50, column 19): "+[e.constructor.name])},oT=function(e){return e instanceof Sd?new G(wd):J.value},iT=function(){return new Id(rT)}();var uT=function(){return new Ld(rT)}();var lT=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}();var B4=hn();var Ad=function(e){return B4(Ef(e))};function cT(e,n,r){try{return n(JSON.parse(r))}catch(i){return e(i.message)}}var Pd=function(e){return cT(be.create,Fe.create,e)};function G4(e){return e.replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16)})}function sT(e,n,r){try{return n(G4(encodeURIComponent(r)).replace(/%20/g,"+"))}catch(i){return e(i)}}var jd=function(){return Ks(sT)(Ke(J.value))(G.create)}();var $4=dt(oa),fT=X(Se),q4=Nr(Yo)(pr);var J4=function(e){return e};var dT=function(){var e=function(i){if(i.value1 instanceof J)return jd(i.value0);if(i.value1 instanceof G)return $4(fT(function(l){return function(v){return l+("="+v)}})(jd(i.value0)))(jd(i.value1.value0));throw new Error("Failed pattern match at Data.FormURLEncoded (line 37, column 16 - line 39, column 114): "+[i.constructor.name])},n=fT(qi("&")),r=q4(e);return function(i){return n(r(J4(i)))}}();var j_=function(){function e(){}return e.value=new e,e}(),Qi=function(){function e(){}return e.value=new e,e}(),N_=function(){function e(){}return e.value=new e,e}(),fl=function(){function e(){}return e.value=new e,e}(),Nd=function(){function e(){}return e.value=new e,e}(),Vc=function(){function e(){}return e.value=new e,e}(),O_=function(){function e(){}return e.value=new e,e}(),U_=function(){function e(){}return e.value=new e,e}(),W_=function(){function e(){}return e.value=new e,e}(),k_=function(){function e(){}return e.value=new e,e}(),H_=function(){function e(){}return e.value=new e,e}(),B_=function(){function e(){}return e.value=new e,e}(),G_=function(){function e(){}return e.value=new e,e}(),$_=function(){function e(){}return e.value=new e,e}(),q_=function(){function e(){}return e.value=new e,e}(),Od=function(){function e(){}return e.value=new e,e}();var z4=function(e){return e},V4={show:function(e){if(e instanceof j_)return"OPTIONS";if(e instanceof Qi)return"GET";if(e instanceof N_)return"HEAD";if(e instanceof fl)return"POST";if(e instanceof Nd)return"PUT";if(e instanceof Vc)return"DELETE";if(e instanceof O_)return"TRACE";if(e instanceof U_)return"CONNECT";if(e instanceof W_)return"PROPFIND";if(e instanceof k_)return"PROPPATCH";if(e instanceof H_)return"MKCOL";if(e instanceof B_)return"COPY";if(e instanceof G_)return"MOVE";if(e instanceof $_)return"LOCK";if(e instanceof q_)return"UNLOCK";if(e instanceof Od)return"PATCH";throw new Error("Failed pattern match at Data.HTTP.Method (line 43, column 1 - line 59, column 23): "+[e.constructor.name])}};var vT=mn(ye(V4))(z4);var pT={eq:function(e){return function(n){return e instanceof j_&&n instanceof j_||e instanceof Qi&&n instanceof Qi||e instanceof N_&&n instanceof N_||e instanceof fl&&n instanceof fl||e instanceof Nd&&n instanceof Nd||e instanceof Vc&&n instanceof Vc||e instanceof O_&&n instanceof O_||e instanceof U_&&n instanceof U_||e instanceof W_&&n instanceof W_||e instanceof k_&&n instanceof k_||e instanceof H_&&n instanceof H_||e instanceof B_&&n instanceof B_||e instanceof G_&&n instanceof G_||e instanceof $_&&n instanceof $_||e instanceof q_&&n instanceof q_||e instanceof Od&&n instanceof Od}}};var mT=function(e){return Zo(function(n){return function(){var i=e(function(l){return n(be.create(l))()},function(l){return n(Fe.create(l))()});return function(l){return Zo(function(v){return function(){return i(l,function(d){return v(be.create(d))()},function(d){return v(Fe.create(d))()}),rm}})}}})};var J_=ce(Ni(Yn)),K4=Rc(Yn),Xi=Hu(Yn),_T=rn(wf(Nf)(Yn)),Y4=du(tm(Yn)),Ud=X(Se),Q4=ia(Mt)(br),X4=je(qr),Z4=Nn(Yt),e8=X(Vt),t8=Ct(Qa),n8=lc(dc),r8=ce(Ur);var Wd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),kd=function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e}(),Hd=function(){function e(){}return e.value=new e,e}(),Bd=function(){function e(){}return e.value=new e,e}(),Gd=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),hT=function(e){return function(n){var r=function(y){return y===""?J_(WD):mn(function(b){return K4(Dc.create(b))})(J_)(Pd(y))},i=function(){if(n.responseFormat instanceof L_)return Xi("ArrayBuffer");if(n.responseFormat instanceof A_)return Xi("Blob");if(n.responseFormat instanceof P_)return function(y){return _T(Xi("Document")(y))(_T(Xi("XMLDocument")(y))(Xi("HTMLDocument")(y)))};if(n.responseFormat instanceof Sd)return Y4(function(y){return n.responseFormat.value0(r(y))})(Xi("String"));if(n.responseFormat instanceof Id)return Xi("String");if(n.responseFormat instanceof Ld)return Ke(n.responseFormat.value0(J_(Te)));throw new Error("Failed pattern match at Affjax (line 274, column 18 - line 283, column 57): "+[n.responseFormat.constructor.name])}(),l=function(y){if(y instanceof VR)return new Fe(y.value0(Za));if(y instanceof KR)return new Fe(Za(y.value0));if(y instanceof YR)return new Fe(Za(y.value0));if(y instanceof QR)return new Fe(Za(y.value0));if(y instanceof XR)return new Fe(Za(y.value0));if(y instanceof S_)return _u("Body contains values that cannot be encoded as application/x-www-form-urlencoded")(Ud(Za)(dT(y.value0)));if(y instanceof Cd)return new Fe(Za(id(y.value0)));throw new Error("Failed pattern match at Affjax (line 235, column 20 - line 250, column 69): "+[y.constructor.name])},v=function(y){return function(b){return y instanceof G&&!Q4(up(X4)(I_)(y.value0))(b)?tf(b)(y.value0):b}},E=function(y){return v(Ud(Md.create)(Z4(ZR)(y)))(v(Ud(xd.create)(oT(n.responseFormat)))(n.headers))},d=function(y){return{method:vT(n.method),url:n.url,headers:e8(function(b){return{field:I_(b),value:nT(b)}})(E(n.content)),content:y,responseType:aT(n.responseFormat),username:ko(n.username),password:ko(n.password),withCredentials:n.withCredentials,timeout:Zt(0)(Ud(function(b){return b})(n.timeout))}},h=function(y){return t8(n8(mT(JR(e,"AffjaxTimeoutErrorMessageIdent","AffjaxRequestFailedMessageIdent",lT.create,d(y)))))(function(b){if(b instanceof Fe){var S=Ad(i(b.value0.body));if(S instanceof be)return new be(new kd(t0(S.value0),b.value0));if(S instanceof Fe)return new Fe({headers:b.value0.headers,status:b.value0.status,statusText:b.value0.statusText,body:S.value0});throw new Error("Failed pattern match at Affjax (line 209, column 9 - line 211, column 52): "+[S.constructor.name])}if(b instanceof be)return new be(function(){var C=Au(b.value0),M=C==="AffjaxTimeoutErrorMessageIdent";if(M)return Hd.value;var O=C==="AffjaxRequestFailedMessageIdent";return O?Bd.value:new Gd(b.value0)}());throw new Error("Failed pattern match at Affjax (line 207, column 144 - line 219, column 28): "+[b.constructor.name])})};if(n.content instanceof J)return h(ko(J.value));if(n.content instanceof G){var N=l(n.content.value0);if(N instanceof Fe)return h(ko(new G(N.value0)));if(N instanceof be)return r8(new be(new Wd(N.value0)));throw new Error("Failed pattern match at Affjax (line 199, column 7 - line 203, column 48): "+[N.constructor.name])}throw new Error("Failed pattern match at Affjax (line 195, column 3 - line 203, column 48): "+[n.content.constructor.name])}};var dl=function(){return{method:new be(Qi.value),url:"/",headers:[],content:J.value,username:J.value,password:J.value,withCredentials:!1,responseFormat:uT,timeout:J.value}}();var gT={eq:function(e){return function(n){return e===n}}};var z_={newXHR:function(){return new XMLHttpRequest},fixupUrl:function(e){return e||"/"}};var DT=hT(z_);function yT(e){return Buffer.from(e).toString("base64")}function RT(e,n,r){let i;try{i=n(btoa(r))}catch(l){i=e(l)}return i}var V_=typeof btoa=="function";function TT(e){let n=32768,r=[];for(let i=0;i{let e=null,n=0,r=()=>{if(!Do||!Do.key)return Do||console.error("Pusher config is missing in global context"),new C8;let i={auth:{headers:{"X-CSRF-Token":Do.authToken}},authEndpoint:Do.authPath,cluster:Do.cluster};return Do.dev&&Object.assign(i,{wsHost:Do.dev.wsHost,wsPort:Do.dev.wsPort,enabledTransports:["ws"],forceTLS:!1,disableStats:!0}),new BT.default(Do.key,i)};return{acquireConnection:()=>(e||(e=r(),n=0),n++,e),releaseConnection:()=>{--n<=0&&(e.disconnect(),e=null)}}})(),GT=e=>{let n=F8().subscribe(e.channel);return n.bind(e.event,e.handler),()=>{n.unbind(e.event,e.handler),w8()}};function C8(){typeof document!="undefined"&&(document.mockPusher=this),this.localObject={},this.channels=[],this.disconnect=function(){document.mockPusher=null},this.subscribe=function(e){let n=this.channels.find(i=>i.name===e);if(n)return n;let r=new x8(e);return this.channels.push(r),r},this.channelNames=function(){return this.channels.map(e=>e.name)}}function x8(e){this.name=e,this.handlers={},this.triggered=[],this.disconnect=()=>{},this.bind=function(n,r){this.handlers[n]=r},this.unbind=function(n,r){this.handlers[n]===r&&(this.handlers[n]=null)},this.trigger=function(n,r){this.triggered.push({eventName:n,eventData:r})}}var M8=Xl(fo),S8=Ci(_n)(xi);var I8={show:function(e){return e}},L8=ye(I8),Y_=Ae,A8=function(e){var n=zi(e);return function(r){return function(i){return function(l){var v=M8(["Pusher event ",i," over channel ",L8(r)]),E=function(d){return S8(n(v)(d))(l)()};return function(){return GT({channel:r,event:i,handler:E})}}}}},$T=function(e){var n=A8(e);return function(r){var i=r.Monad0(),l=ve(i.Bind1()),v=Lt(r),E=ce(i.Applicative0());return function(d){return function(h){return function(N){return l(v(n(d)(h)(N)))(function(y){return E(v(y))})}}}}};var P8=UT(PT),j8=kT(P8),N8=ve(rr);var O8=Ct(Se),oo=Oo();var U8=K({reflectSymbol:function(){return"status"}})(Ae)(At);var qT=K({reflectSymbol:function(){return"id"}}),JT=qT(et);var W8=Ct(Qa),k8=K({reflectSymbol:function(){return"description"}}),zT=K({reflectSymbol:function(){return"presenter"}}),kr=Fn(Ae),H8=K({reflectSymbol:function(){return"autoDisplayMinutesFromStart"}})(Fn(et)),B8=oo(H8(JT(K({reflectSymbol:function(){return"multiSelect"}})(Gn)(K({reflectSymbol:function(){return"options"}})(xr(Ae))(K({reflectSymbol:function(){return"question"}})(Ae)(At)))))),G8=K({reflectSymbol:function(){return"name"}})(Ae),$8=K({reflectSymbol:function(){return"title"}})(Ae),q8=K({reflectSymbol:function(){return"url"}})(Ae),J8=jT(Fn(oo(K({reflectSymbol:function(){return"pusher"}})(oo(K({reflectSymbol:function(){return"dataChannel"}})(Y_)(K({reflectSymbol:function(){return"presenceChannel"}})(Y_)(At))))(K({reflectSymbol:function(){return"stream"}})(oo(K({reflectSymbol:function(){return"collegeFair"}})(Gn)(k8(Ae)(K({reflectSymbol:function(){return"duration"}})(et)(K({reflectSymbol:function(){return"guestPresenter"}})(Fn(oo(zT(Tc)(K({reflectSymbol:function(){return"type"}})(Ae)(At)))))(JT(K({reflectSymbol:function(){return"imageUrl"}})(Ae)(K({reflectSymbol:function(){return"isPrivate"}})(Gn)(K({reflectSymbol:function(){return"legacyRecording"}})(Gn)(K({reflectSymbol:function(){return"onAirTime"}})(kr)(K({reflectSymbol:function(){return"partnerType"}})(kr)(K({reflectSymbol:function(){return"polls"}})(xr(oo(K({reflectSymbol:function(){return"poll"}})(B8)(U8))))(zT(Fn(oo(K({reflectSymbol:function(){return"admissionsStory"}})(kr)(K({reflectSymbol:function(){return"allStreamsUrl"}})(kr)(K({reflectSymbol:function(){return"firstName"}})(Ae)(K({reflectSymbol:function(){return"fullName"}})(Ae)(K({reflectSymbol:function(){return"gradCollege"}})(kr)(K({reflectSymbol:function(){return"pictureUrl"}})(kr)(K({reflectSymbol:function(){return"totalStreams"}})(et)(K({reflectSymbol:function(){return"undergrad"}})(oo(K({reflectSymbol:function(){return"college"}})(kr)(K({reflectSymbol:function(){return"major"}})(kr)(K({reflectSymbol:function(){return"year"}})(kr)(At)))))(K({reflectSymbol:function(){return"workExperience"}})(kr)(At))))))))))))(K({reflectSymbol:function(){return"scheduledStartTime"}})(Ae)(K({reflectSymbol:function(){return"school"}})(Fn(oo(K({reflectSymbol:function(){return"cityState"}})(Ae)(qT(Ae)(G8(K({reflectSymbol:function(){return"slug"}})(Ae)(At)))))))(K({reflectSymbol:function(){return"stats"}})(oo(K({reflectSymbol:function(){return"parentAttendances"}})(et)(K({reflectSymbol:function(){return"parentRecordingWatchers"}})(et)(K({reflectSymbol:function(){return"parentRegistrations"}})(et)(K({reflectSymbol:function(){return"registrationsBySource"}})(xr(oo(K({reflectSymbol:function(){return"parentCount"}})(et)(K({reflectSymbol:function(){return"source"}})(Ae)(K({reflectSymbol:function(){return"studentCount"}})(et)(At))))))(K({reflectSymbol:function(){return"studentAttendances"}})(et)(K({reflectSymbol:function(){return"studentRecordingWatchers"}})(et)(K({reflectSymbol:function(){return"studentRegistrations"}})(et)(K({reflectSymbol:function(){return"totalAttendances"}})(et)(K({reflectSymbol:function(){return"totalRecordingWatchers"}})(et)(K({reflectSymbol:function(){return"totalRegistrations"}})(et)(At))))))))))))(K({reflectSymbol:function(){return"streamStatus"}})(Ae)(K({reflectSymbol:function(){return"streamingStartTime"}})(kr)(K({reflectSymbol:function(){return"tailTime"}})(et)($8(K({reflectSymbol:function(){return"uid"}})(Ae)(q8(K({reflectSymbol:function(){return"watchUrl"}})(kr)(K({reflectSymbol:function(){return"zoomJoinUrl"}})(kr)(K({reflectSymbol:function(){return"zoomStartUrl"}})(kr)(At))))))))))))))))))))))))))(At)))));var VT=j8("livestreams_live_promo_stream_path")(function(e){return function(n){return N8(e({}))(NT(function(r){return W8(J8("Livestream Mini-Promo")(r))(function(i){return O8(Le(i))(function(l){return{pusher:l.pusher,stream:Fd(l.stream)}})})}))}});var Jd=e=>e.play();var si=Pl(KT());ti();var YT=e=>{let[n,r]=ar.useState(),[i,l]=ar.useState(),v=ar.useRef();return v.current=e,om(()=>{if(!i)return si.default.isSupported()?r(z8(e.videoStreamUrl,e.videoElementId,v)):e.onNotSupported(),l(!0),()=>{n&&n.destroy()}}),null},z8=(e,n,r)=>{let i=document.getElementById(n);return i?(hls=new si.default,r.current.onInstanceCreated&&r.current.onInstanceCreated(hls),hls.on(si.default.Events.ERROR,function(l,v){if(r.current.onError&&r.current.onError("HLS error: "+v.type,v),v.fatal)switch(v.type){case si.default.ErrorTypes.MEDIA_ERROR:hls.recoverMediaError();break;default:hls.destroy(),r.current.onCriticalFail&&r.current.onCriticalFail(v.type);break}}),hls.on(si.default.Events.MEDIA_ATTACHED,()=>hls.loadSource(e)),hls.on(si.default.Events.MANIFEST_PARSED,()=>r.current.onReady&&r.current.onReady()),hls.on(si.default.Events.INIT_PTS_FOUND,(l,v)=>r.current.onInitialPts&&r.current.onInitialPts({initPTS:v.initPTS})),hls.attachMedia(i),hls):(r.current.onCriticalFail&&r.current.onCriticalFail("Couldn't find element #"+n),null)};var V8=Ic();var QT=function(){return function(){return V8(YT)}};ti();var io={PRIMARY:"#008CFD",SECONDARY:"#6E84A3",WHITE:"#FFF",GRAY_300:"#E3EBF6"};var Xc=Pl(aE()),oE=4,FI=({trackColor:e,background:n})=>({props:r,children:i})=>ar.createElement("div",Object.assign({},r,{style:Object.assign({},r.style,{height:`${oE}px`,borderRadius:`${oE*2}px`,background:n||e})}),...i),wI=({horizontal:e})=>({props:n,isDragged:r})=>ar.createElement("svg",Object.assign({},n,{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18"}),ar.createElement("circle",{cx:"9",cy:"9",r:"8.5",fill:r?io.SECONDARY:io.WHITE,stroke:io.SECONDARY}),ar.createElement("path",{stroke:r?io.WHITE:io.SECONDARY,d:e?"M7.5 6L7.5 12":"M6 7.5L12 7.5"}),ar.createElement("path",{stroke:r?io.WHITE:io.SECONDARY,d:e?"M10.5 6L10.5 12":"M6 10.5L12 10.5"})),iE=e=>ar.createElement(Xc.Range,{step:e.step,min:e.min,max:e.max,values:[e.value],onChange:([n])=>e.onChange(n),onFinalChange:([n])=>e.onFinalChange&&e.onFinalChange(n),renderTrack:FI({trackColor:e.trackColor||io.GRAY_300,background:e.fillBefore?(0,Xc.getTrackBackground)({values:[e.value],colors:[io.PRIMARY,io.GRAY_300],min:e.min,max:e.max}):void 0}),renderThumb:wI({horizontal:!0})});var CI=Ic(),uE={CanPassToJavaScript0:function(){},CanReceiveFromJavaScript1:function(){return ym}};var lE=function(e){return function(){return function(){return CI(iE)}}};var wn=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Tn=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var xI=ui(Ho)()(),MI=lE(uE)()(),SI=ii(Zf),II=rd(Ho)()(),LI=ii(Zu),cE=Go(ro),AI=Vm(no),Yd=Xu(Dn),eh=ce(Ur),sE=jn(On),PI=an(yf),yo=ce(Bo),jI=Qu(Dn),th=Lt(Dn),NI=X(Se),OI=u1(ff),UI=sE(rr),fi=sE(Gi),WI=Ba(Bo),kI=ve(rr),HI=Hs(uc),BI=Ba(_n),nh=function(){function e(){}return e.value=new e,e}(),rh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),ah=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),fE=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),oh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),dE=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),vE=function(){function e(){}return e.value=new e,e}(),GI=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),pE=function(e){return function(n){if(e.videoState instanceof J)return Sr;if(e.videoState instanceof G){var r=xI("")({style:$i({minWidth:"6rem",width:"6rem"})})(MI({value:function(){return e.videoState.value0.muted?0:e.videoState.value0.volume}(),min:0,max:1,step:.05,onChange:SI(n)(function(E){return wn.create(rh.create(E))})})),i=function(){if(e.videoState.value0.muted)return"fe-volume-x";if(at)return"fe-volume-2";throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 128, column 5 - line 130, column 34): "+[])}(),l=II("btn large px-3 py-1 mr-3 text-white fe "+i)({onClick:LI(n)(new wn(nh.value))})(Sr),v=cE("d-flex align-items-center text-white px-3")([Ac("LIVE"),AI("text-danger x-large ml-2 mt-n1")("\u25CF")]);return cE("mb-2 w-100 d-flex align-items-center bg-semi-transparent-black "+function(){return e.visible?"":"hidden"}())([Ki(e.config.liveIndicator)(v),Ki(e.config.mute)(l),Ki(e.config.volume)(r)])}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 105, column 1 - line 105, column 50): "+[e.constructor.name,n.constructor.name])}},mE=function(e){return wn.create(ah.create(e))},_E=function(e){return Yd(eh(new Tn(new GI(function(n){return function(){return e(n)(),new wn(new ah(n))}}))))},Qd=function(){return new wn(new oh(!0))}(),hE=function(e){return{config:e,videoState:J.value,visible:!1,visibilityExpiration:PI}},gE=2e3,DE=function(e){return function(n){if(n instanceof Tn)return yo(e);if(n instanceof wn){var r=jI(th(function(){var E=vc();return NI(function(d){return wn.create(dE.create(d))})(OI(gE)(E))})),i=UI(jo(gE))(function(){return eh(new wn(vE.value))}),l=function(v){if(n.value0 instanceof nh)return yo(e);var E=function(d){if(n.value0 instanceof rh)return yo(e);if(n.value0 instanceof ah)return fi(Yd(th(function(){var N=m_(n.value0.value0)(),y=v_(n.value0.value0)();return new wn(new fE({muted:N,volume:y}))})))(function(){return yo(e)});if(n.value0 instanceof fE)return yo({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new G(n.value0.value0)});if(n.value0 instanceof oh)return fi(WI(n.value0.value0)(r))(function(){return fi(Yd(i))(function(){return yo({config:e.config,videoState:e.videoState,visibilityExpiration:e.visibilityExpiration,visible:n.value0.value0})})});if(n.value0 instanceof dE)return yo({config:e.config,videoState:e.videoState,visible:e.visible,visibilityExpiration:n.value0.value0});if(n.value0 instanceof vE)return fi(Yd(kI(th(vc))(function(h){var N=HI(h)(e.visibilityExpiration);return N?eh(new wn(new oh(!1))):i})))(function(){return yo(e)});throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 143, column 1 - line 143, column 55): "+[n.value0.constructor.name])};return n.value0 instanceof rh&&e.videoState instanceof G?fi(r)(function(){return fi(_E(function(d){return function(){return BI(n.value0.value0>0)(Vi(!1)(d))(),p_(n.value0.value0)(d)()}}))(function(){return yo({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new G({muted:e.videoState.value0.muted,volume:n.value0.value0})})})}):E(!0)};return n.value0 instanceof nh&&e.videoState instanceof G?fi(r)(function(){return fi(_E(Vi(!e.videoState.value0.muted)))(function(){return yo({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new G({volume:e.videoState.value0.volume,muted:!e.videoState.value0.muted})})})}):l(!0)}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 143, column 1 - line 143, column 55): "+[e.constructor.name,n.constructor.name])}},yE=function(e){if(e instanceof G)return!1;if(e instanceof J)return!0;throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 212, column 1 - line 212, column 37): "+[e.constructor.name])};var RE=e=>n=>r=>()=>e.then(r,n),TE=e=>e instanceof Error,EE=e=>e===null?"null":typeof e=="undefined"?"undefined":e.toString();var $I=ce(Ni(Yn)),qI=Rc(Yn),JI=Ue(We),bE=rn(wf(Nf)(Yn)),zI=Hu(Yn),VI=X(Ff(Jo)),KI=i0(Yn),YI=Us(it),QI=Ot(P1);var XI=function(e){var n=function(r){if(TE(r))return $I(r);if(at)return qI(new Dc(""));throw new Error("Failed pattern match at Utils.Promise (line 53, column 5 - line 55, column 43): "+[r.constructor.name])};return mn(function(r){return Or("Promise failed: "+EE(e))})(JI)(Ad(bE(n(e))(bE(zI("Error")(e))(VI(Or)(KI(e))))))},Xd=function(e){return Zo(function(n){return YI(QI)(RE(e)(function(r){return n(be.create(XI(r)))()})(function(r){return n(Fe.create(r))()}))})};function FE(e,n){typeof CV!="undefined"&&CV.tracking&&CV.tracking.event(e,n)}var ZI=Uf();var e7=function(e){var n=Lt(e);return function(r){return function(i){return n(function(){return FE(r,i)})}}},wE=function(e){var n=e7(e);return function(){return function(r){return function(i){return n(r)(ZI(i))}}}};var t7=ve(Yt),n7=Go(Ho),ih=ed(FD),Zc=ve(Jr),uh=Ko(_n)(xi),Zd=ii(Zu),CE=SD(no)()(),r7=QT()();var es=ii(Zf),xE=ui(Ho)()(),a7=rd(ro)()(),o7=ID(no),i7=Go(ro),ME=jn(On),u7=wE(Dn)(),l7=ia(Mt)(br),c7=je(co(vr)),pl=ME(rr),s7=hi(Ur),f7=Un(Uu),qn=ce(Ur),SE=Lt(Dn),IE=Cr(dc),LE=lp(rr),Wn=ce(Bo),Jn=ME(Gi),Ir=Xu(Dn),AE=X(Qa),PE=Qu(Dn),d7=X(it),v7=zr(Qf(Qa)),p7=X(Se);var jE=function(){function e(){}return e.value=new e,e}(),NE=function(){function e(){}return e.value=new e,e}(),ts=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),OE=function(){function e(){}return e.value=new e,e}(),ml=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),UE=function(){function e(){}return e.value=new e,e}(),WE=function(){function e(){}return e.value=new e,e}(),kE=function(){function e(){}return e.value=new e,e}(),lh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),ch=function(){function e(){}return e.value=new e,e}(),ev=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),tv=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),nv=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),HE=function(){function e(){}return e.value=new e,e}(),sh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),fh=function(){function e(){}return e.value=new e,e}(),BE=function(){function e(){}return e.value=new e,e}(),GE=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),tu=function(){function e(){}return e.value=new e,e}(),Ro=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),$E=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),m7=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),_l=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),qE=function(e){var n=e.Monad0(),r=ve(n.Bind1()),i=Lt(e),l=ce(n.Applicative0());return function(v){return function(E){return function(d){return r(i(lR(v.videoId)))(function(h){return Et(l(E.whenNotFound))(d)(t7(h)(rR))})}}}};var dh=qE(Dn),JE=function(e){var n=qE(e);return function(r){return n(r)({whenNotFound:Te})}},_7=JE(Pu),h7=JE(Dn),zE=function(e){return function(n){return function(r){var i=function(){var M=n7("position-absolute-fullsize py-6 d-flex align-items-center justify-content-around");if(n.stage instanceof OE)return M(e.errorScreen("It appears that video playback is not supported in your browser."));if(n.stage instanceof UE)return M(e.errorScreen("The video didn't load correctly, try refreshing the page."));if(n.stage instanceof ts)return M(e.introScreen);if(n.stage instanceof ml)return Sr;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 253, column 20 - line 264, column 16): "+[n.stage.constructor.name])}(),l=function(){return n.stage instanceof ts?n.stage.value0.reset:!1}(),v=ih(function(M){return Zc(yd(M))(uh(function(O){return r(new wn(new m7({time:O})))}))}),E=ih(function(M){return Zc(yd(M))(uh(function(O){return r(new wn(new $E({playing:!0,time:O})))}))}),d=function(M){return r(Tn.create(M))},h=ih(function(M){return Zc(yd(M))(uh(function(O){return d(new sh(O))}))}),N=Zd(d)(HE.value),y=Km([CE("w-100 t--real-video")({id:n.videoId,controls:Ja(n.customControls),onVolumeChange:N,onTimeUpdate:v,onPlay:E,onPause:h})(""),Ki(!l)(r7({videoStreamUrl:e.watchUrl,videoElementId:n.videoId,onNotSupported:d(WE.value),onError:function(M,O){return Te},onCriticalFail:es(d)(function(M){var O=M==="networkError";return O?ch.value:new ev("HLS player crashed")}),onReady:d(new tv({autoPlay:e.autoPlay})),onInitialPts:es(d)(function(M){return new GE(M.initPTS)})}))]),b=function(){return n.stage instanceof ml&&n.stage.value0.unmuteOverlay?xE("position-absolute-fullsize d-flex align-items-center justify-content-center t--unmute-overlay")({style:$i({pointerEvents:"none"})})(a7("btn btn-sm btn-light border-dark px-4 d-flex align-items-center")({onClick:Zd(d)(BE.value),style:$i({pointerEvents:"all"})})([Ac("click for sound"),o7("fe fe-volume-2 ml-2")("")])):Sr}(),S=function(M){return xE("position-absolute-fullsize d-flex align-items-end t--controls-overlay")({onMouseMove:es(d)(function(O){return new Ro(Qd)}),onMouseDown:es(d)(function(O){return new Ro(Qd)}),onTouchStart:es(d)(function(O){return new Ro(Qd)})})(pE(M)(function(O){return d(Ro.create(O))}))},C=CE("w-100 t--real-video")({id:n.videoId,controls:Ja(n.customControls),playsInline:!0,onVolumeChange:N,onTimeUpdate:v,onPlay:E,onPause:h,onLoadedMetadata:Zd(d)(new tv({autoPlay:e.autoPlay})),onError:Zd(d)(ch.value),src:function(){return l?"":e.watchUrl}()})("");return i7("position-relative w-100")([function(){if(n.support instanceof jE)return y;if(n.support instanceof NE)return C;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 175, column 7 - line 177, column 40): "+[n.support.constructor.name])}(),uR(n.customControls)(S),Ki(n.allowSound)(b),i])}}},g7=function(e){var n=Lt(e.MonadEffect0());return function(r){return n(function(){return _7(r)(Vi(!1))(),fh.value})}},D7=g7(dR),vh=function(e){return u7("Livestream: Error")({livestream_error_message:e})};var y7=function(e){return Lt(e)(function(){var r=Zc(Zc(ao)(g_))(h_)();return l7(function(i){return c7(ey(i)(r))(new G(0))})(["iPad","iPod","iPhone"])})},VE=y7(Dn),R7=function(e){var n=function(i){return pl(s7(e.allowSound)(f7(Or("Skipping attempt to play unmuted because sound was programmatically disallowed"))))(function(){return pl(Xd(Jd(i)))(function(){return qn(new nv({unmuteOverlay:!1}))})})},r=function(i){return pl(SE(Vi(!0)(i)))(function(){return pl(Xd(Jd(i)))(function(){return qn(new nv({unmuteOverlay:!0}))})})};return dh(e)({whenNotFound:new ev("