var Purs_EntryPoints_Livestream_MiniPromo=(()=>{var SM=Object.create;var Jp=Object.defineProperty;var MM=Object.getOwnPropertyDescriptor;var IM=Object.getOwnPropertyNames;var AM=Object.getPrototypeOf,xM=Object.prototype.hasOwnProperty;var LM=(t,n)=>()=>(t&&(n=t(t=0)),n);var oi=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),kD=(t,n)=>{for(var a in n)Jp(t,a,{get:n[a],enumerable:!0})},$D=(t,n,a,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of IM(n))!xM.call(t,c)&&c!==a&&Jp(t,c,{get:()=>n[c],enumerable:!(u=MM(n,c))||u.enumerable});return t};var Gp=(t,n,a)=>(a=t!=null?SM(AM(t)):{},$D(n||!t||!t.__esModule?Jp(a,"default",{value:t,enumerable:!0}):a,t)),qp=t=>$D(Jp({},"__esModule",{value:!0}),t);var Qv={};kD(Qv,{Children:()=>K8,Component:()=>Q8,Fragment:()=>n7,PureComponent:()=>u7,Suspense:()=>i7,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>V8,cloneElement:()=>Y8,createContext:()=>X8,createElement:()=>Z8,createRef:()=>t7,default:()=>or,forwardRef:()=>e7,isValidElement:()=>r7,lazy:()=>a7,memo:()=>o7,useCallback:()=>l7,useContext:()=>c7,useDebugValue:()=>f7,useEffect:()=>Hg,useImperativeHandle:()=>s7,useLayoutEffect:()=>d7,useMemo:()=>p7,useReducer:()=>v7,useRef:()=>m7,useState:()=>_7,version:()=>h7});var or,V8,K8,Y8,Q8,X8,Z8,t7,e7,n7,r7,a7,o7,u7,i7,l7,c7,f7,Hg,s7,d7,p7,v7,m7,_7,h7,bu=LM(()=>{or=window.React,{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:V8,Children:K8,cloneElement:Y8,Component:Q8,createContext:X8,createElement:Z8,createRef:t7,forwardRef:e7,Fragment:n7,isValidElement:r7,lazy:a7,memo:o7,PureComponent:u7,Suspense:i7,useCallback:l7,useContext:c7,useDebugValue:f7,useEffect:Hg,useImperativeHandle:s7,useLayoutEffect:d7,useMemo:p7,useReducer:v7,useRef:m7,useState:_7,version:h7}=window.React});var Xb=oi((bZ,Qb)=>{"use strict";var Yb=Object.getOwnPropertySymbols,LA=Object.prototype.hasOwnProperty,NA=Object.prototype.propertyIsEnumerable;function PA(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function OA(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var n={},a=0;a<10;a++)n["_"+String.fromCharCode(a)]=a;var u=Object.getOwnPropertyNames(n).map(function(m){return n[m]});if(u.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(m){c[m]=m}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Qb.exports=OA()?Object.assign:function(t,n){for(var a,u=PA(t),c,m=1;m{"use strict";var Fu=Xb(),Mi=(bu(),qp(Qv));function ir(t){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+t,a=1;aDd;Dd++)oa[Dd]=Dd+1;var oa,Dd;oa[15]=0;var $A=/^[: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]*$/,Zb=Object.prototype.hasOwnProperty,tT={},eT={};function mT(t){return Zb.call(eT,t)?!0:Zb.call(tT,t)?!1:$A.test(t)?eT[t]=!0:(tT[t]=!0,!1)}function WA(t,n,a,u){if(a!==null&&a.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return u?!1:a!==null?!a.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function HA(t,n,a,u){if(n===null||typeof n>"u"||WA(t,n,a,u))return!0;if(u)return!1;if(a!==null)switch(a.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 Aa(t,n,a,u,c,m,w){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=c,this.mustUseProperty=a,this.propertyName=t,this.type=n,this.sanitizeURL=m,this.removeEmptyString=w}var ua={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ua[t]=new Aa(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var n=t[0];ua[n]=new Aa(n,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ua[t]=new Aa(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ua[t]=new Aa(t,2,!1,t,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(t){ua[t]=new Aa(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ua[t]=new Aa(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ua[t]=new Aa(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ua[t]=new Aa(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ua[t]=new Aa(t,5,!1,t.toLowerCase(),null,!1,!1)});var m1=/[\-:]([a-z])/g;function _1(t){return t[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(t){var n=t.replace(m1,_1);ua[n]=new Aa(n,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var n=t.replace(m1,_1);ua[n]=new Aa(n,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var n=t.replace(m1,_1);ua[n]=new Aa(n,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ua[t]=new Aa(t,1,!1,t.toLowerCase(),null,!1,!1)});ua.xlinkHref=new Aa("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ua[t]=new Aa(t,1,!1,t.toLowerCase(),null,!0,!0)});var BA=/["'&<>]/;function ic(t){if(typeof t=="boolean"||typeof t=="number")return""+t;t=""+t;var n=BA.exec(t);if(n){var a="",u,c=0;for(u=n.index;ugm))throw Error(ir(301));if(t===Ju)if(hm=!0,t={action:a,next:null},fl===null&&(fl=new Map),a=fl.get(n),a===void 0)fl.set(n,t);else{for(n=a;n.next!==null;)n=n.next;n.next=t}}function a1(){}var cc=null,zA={readContext:function(t){var n=cc.threadID;return Td(t,n),t[n]},useContext:function(t){lc();var n=cc.threadID;return Td(t,n),t[n]},useMemo:aT,useReducer:rT,useRef:function(t){Ju=lc(),Gn=h1();var n=Gn.memoizedState;return n===null?(t={current:t},Gn.memoizedState=t):n},useState:function(t){return rT(gT,t)},useLayoutEffect:function(){},useCallback:function(t,n){return aT(function(){return t},n)},useImperativeHandle:a1,useEffect:a1,useDebugValue:a1,useDeferredValue:function(t){return lc(),t},useTransition:function(){return lc(),[function(t){t()},!1]},useOpaqueIdentifier:function(){return(cc.identifierPrefix||"")+"R:"+(cc.uniqueID++).toString(36)},useMutableSource:function(t,n){return lc(),n(t._source)}},oT={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function uT(t){switch(t){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 DT={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},VA=Fu({menuitem:!0},DT),bd={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},KA=["Webkit","ms","Moz","O"];Object.keys(bd).forEach(function(t){KA.forEach(function(n){n=n+t.charAt(0).toUpperCase()+t.substring(1),bd[n]=bd[t]})});var YA=/([A-Z])/g,QA=/^ms-/,cl=Mi.Children.toArray,o1=UA.ReactCurrentDispatcher,XA={listing:!0,pre:!0,textarea:!0},ZA=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,iT={},u1={};function tx(t){if(t==null)return t;var n="";return Mi.Children.forEach(t,function(a){a!=null&&(n+=a)}),n}var ex=Object.prototype.hasOwnProperty,nx={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function lT(t,n){if(t===void 0)throw Error(ir(152,Rd(n)||"Component"))}function rx(t,n,a){function u(w,v){var g=v.prototype&&v.prototype.isReactComponent,k=kA(v,n,a,g),y=[],E=!1,x={isMounted:function(){return!1},enqueueForceUpdate:function(){if(y===null)return null},enqueueReplaceState:function(et,at){E=!0,y=[at]},enqueueSetState:function(et,at){if(y===null)return null;y.push(at)}};if(g){if(g=new v(w.props,k,x),typeof v.getDerivedStateFromProps=="function"){var C=v.getDerivedStateFromProps.call(null,w.props,g.state);C!=null&&(g.state=Fu({},g.state,C))}}else if(Ju={},g=v(w.props,k,x),g=_T(v,w.props,g,k),g==null||g.render==null){t=g,lT(t,v);return}if(g.props=w.props,g.context=k,g.updater=x,x=g.state,x===void 0&&(g.state=x=null),typeof g.UNSAFE_componentWillMount=="function"||typeof g.componentWillMount=="function")if(typeof g.componentWillMount=="function"&&typeof v.getDerivedStateFromProps!="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&typeof v.getDerivedStateFromProps!="function"&&g.UNSAFE_componentWillMount(),y.length){x=y;var M=E;if(y=null,E=!1,M&&x.length===1)g.state=x[0];else{C=M?x[0]:g.state;var U=!0;for(M=M?1:0;M=v))throw Error(ir(304));var g=new Uint16Array(v);for(g.set(w),oa=g,oa[0]=m+1,w=m;w=g.children.length){var k=g.footer;if(k!==""&&(this.previousWasTextNode=!1),this.stack.pop(),g.type==="select")this.currentSelectValue=null;else if(g.type!=null&&g.type.type!=null&&g.type.type.$$typeof===mm)this.popProvider(g.type);else if(g.type===_m){this.suspenseDepth--;var y=m.pop();if(w){w=!1;var E=g.fallbackFrame;if(!E)throw Error(ir(303));this.stack.push(E),m[this.suspenseDepth]+="";continue}else m[this.suspenseDepth]+=y}m[this.suspenseDepth]+=k}else{var x=g.children[g.childIndex++],C="";try{C+=this.render(x,g.context,g.domNamespace)}catch(M){throw M!=null&&typeof M.then=="function"?Error(ir(294)):M}m.length<=this.suspenseDepth&&m.push(""),m[this.suspenseDepth]+=C}}return m[0]}finally{o1.current=c,cc=u,hT()}},n.render=function(a,u,c){if(typeof a=="string"||typeof a=="number")return c=""+a,c===""?"":this.makeStaticMarkup?ic(c):this.previousWasTextNode?""+ic(c):(this.previousWasTextNode=!0,ic(c));if(u=rx(a,u,this.threadID),a=u.child,u=u.context,a===null||a===!1)return"";if(!Mi.isValidElement(a)){if(a!=null&&a.$$typeof!=null)throw c=a.$$typeof,Error(c===i1?ir(257):ir(258,c.toString()));return a=cl(a),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:u,footer:""}),""}var m=a.type;if(typeof m=="string")return this.renderDOM(a,u,c);switch(m){case pT:case dT:case l1:case c1:case d1:case vm:return a=cl(a.props.children),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:u,footer:""}),"";case _m:throw Error(ir(294));case sT:throw Error(ir(343))}if(typeof m=="object"&&m!==null)switch(m.$$typeof){case s1:Ju={};var w=m.render(a.props,a.ref);return w=_T(m.render,a.props,w,a.ref),w=cl(w),this.stack.push({type:null,domNamespace:c,children:w,childIndex:0,context:u,footer:""}),"";case p1:return a=[Mi.createElement(m.type,Fu({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:u,footer:""}),"";case mm:return m=cl(a.props.children),c={type:a,domNamespace:c,children:m,childIndex:0,context:u,footer:""},this.pushProvider(a),this.stack.push(c),"";case f1:m=a.type,w=a.props;var v=this.threadID;return Td(m,v),m=cl(w.children(m[v])),this.stack.push({type:a,domNamespace:c,children:m,childIndex:0,context:u,footer:""}),"";case fT:throw Error(ir(338));case v1:return m=a.type,w=m._init,m=w(m._payload),a=[Mi.createElement(m,Fu({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:u,footer:""}),""}throw Error(ir(130,m==null?m:typeof m,""))},n.renderDOM=function(a,u,c){var m=a.type.toLowerCase();if(c===oT.html&&uT(m),!iT.hasOwnProperty(m)){if(!ZA.test(m))throw Error(ir(65,m));iT[m]=!0}var w=a.props;if(m==="input")w=Fu({type:void 0},w,{defaultChecked:void 0,defaultValue:void 0,value:w.value!=null?w.value:w.defaultValue,checked:w.checked!=null?w.checked:w.defaultChecked});else if(m==="textarea"){var v=w.value;if(v==null){v=w.defaultValue;var g=w.children;if(g!=null){if(v!=null)throw Error(ir(92));if(Array.isArray(g)){if(!(1>=g.length))throw Error(ir(93));g=g[0]}v=""+g}v==null&&(v="")}w=Fu({},w,{value:void 0,children:""+v})}else if(m==="select")this.currentSelectValue=w.value!=null?w.value:w.defaultValue,w=Fu({},w,{value:void 0});else if(m==="option"){g=this.currentSelectValue;var k=tx(w.children);if(g!=null){var y=w.value!=null?w.value+"":k;if(v=!1,Array.isArray(g)){for(var E=0;E":(at+=">",v="");t:{if(g=w.dangerouslySetInnerHTML,g!=null){if(g.__html!=null){g=g.__html;break t}}else if(g=w.children,typeof g=="string"||typeof g=="number"){g=ic(g);break t}g=null}return g!=null?(w=[],XA.hasOwnProperty(m)&&g.charAt(0)===` `&&(at+=` `),at+=g):w=cl(w.children),a=a.type,c=c==null||c==="http://www.w3.org/1999/xhtml"?uT(a):c==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":c,this.stack.push({domNamespace:c,type:m,children:w,childIndex:0,context:u,footer:v}),this.previousWasTextNode=!1,at},t})();wf.renderToNodeStream=function(){throw Error(ir(207))};wf.renderToStaticMarkup=function(t,n){t=new yT(t,!0,n);try{return t.read(1/0)}finally{t.destroy()}};wf.renderToStaticNodeStream=function(){throw Error(ir(208))};wf.renderToString=function(t,n){t=new yT(t,!1,n);try{return t.read(1/0)}finally{t.destroy()}};wf.version="17.0.2"});var TT=oi((EZ,bT)=>{"use strict";bT.exports=RT()});var i2=oi((F_,eD)=>{(function(n,a){typeof F_=="object"&&typeof eD=="object"?eD.exports=a():typeof define=="function"&&define.amd?define([],a):typeof F_=="object"?F_.Pusher=a():n.Pusher=a()})(window,function(){return(function(t){var n={};function a(u){if(n[u])return n[u].exports;var c=n[u]={i:u,l:!1,exports:{}};return t[u].call(c.exports,c,c.exports,a),c.l=!0,c.exports}return a.m=t,a.c=n,a.d=function(u,c,m){a.o(u,c)||Object.defineProperty(u,c,{enumerable:!0,get:m})},a.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},a.t=function(u,c){if(c&1&&(u=a(u)),c&8||c&4&&typeof u=="object"&&u&&u.__esModule)return u;var m=Object.create(null);if(a.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:u}),c&2&&typeof u!="string")for(var w in u)a.d(m,w,function(v){return u[v]}.bind(null,w));return m},a.n=function(u){var c=u&&u.__esModule?function(){return u.default}:function(){return u};return a.d(c,"a",c),c},a.o=function(u,c){return Object.prototype.hasOwnProperty.call(u,c)},a.p="",a(a.s=2)})([(function(t,n,a){"use strict";var u=this&&this.__extends||(function(){var C=function(M,U){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,Q){B.__proto__=Q}||function(B,Q){for(var z in Q)Q.hasOwnProperty(z)&&(B[z]=Q[z])},C(M,U)};return function(M,U){C(M,U);function B(){this.constructor=M}M.prototype=U===null?Object.create(U):(B.prototype=U.prototype,new B)}})();Object.defineProperty(n,"__esModule",{value:!0});var c=256,m=(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 U="",B=0;B>>18&63),U+=this._encodeByte(Q>>>12&63),U+=this._encodeByte(Q>>>6&63),U+=this._encodeByte(Q>>>0&63)}var z=M.length-B;if(z>0){var Q=M[B]<<16|(z===2?M[B+1]<<8:0);U+=this._encodeByte(Q>>>18&63),U+=this._encodeByte(Q>>>12&63),z===2?U+=this._encodeByte(Q>>>6&63):U+=this._paddingCharacter||"",U+=this._paddingCharacter||""}return U},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 U=this._getPaddingLength(M),B=M.length-U,Q=new Uint8Array(this.maxDecodedLength(B)),z=0,et=0,at=0,nt=0,mt=0,_t=0,ne=0;et>>4,Q[z++]=mt<<4|_t>>>2,Q[z++]=_t<<6|ne,at|=nt&c,at|=mt&c,at|=_t&c,at|=ne&c;if(et>>4,at|=nt&c,at|=mt&c),et>>2,at|=_t&c),et>>8&6,U+=51-M>>>8&-75,U+=61-M>>>8&-15,U+=62-M>>>8&3,String.fromCharCode(U)},C.prototype._decodeChar=function(M){var U=c;return U+=(42-M&M-44)>>>8&-c+M-43+62,U+=(46-M&M-48)>>>8&-c+M-47+63,U+=(47-M&M-58)>>>8&-c+M-48+52,U+=(64-M&M-91)>>>8&-c+M-65+0,U+=(96-M&M-123)>>>8&-c+M-97+26,U},C.prototype._getPaddingLength=function(M){var U=0;if(this._paddingCharacter){for(var B=M.length-1;B>=0&&M[B]===this._paddingCharacter;B--)U++;if(M.length<4||U>2)throw new Error("Base64Coder: incorrect padding")}return U},C})();n.Coder=m;var w=new m;function v(C){return w.encode(C)}n.encode=v;function g(C){return w.decode(C)}n.decode=g;var k=(function(C){u(M,C);function M(){return C!==null&&C.apply(this,arguments)||this}return M.prototype._encodeByte=function(U){var B=U;return B+=65,B+=25-U>>>8&6,B+=51-U>>>8&-75,B+=61-U>>>8&-13,B+=62-U>>>8&49,String.fromCharCode(B)},M.prototype._decodeChar=function(U){var B=c;return B+=(44-U&U-46)>>>8&-c+U-45+62,B+=(94-U&U-96)>>>8&-c+U-95+63,B+=(47-U&U-58)>>>8&-c+U-48+52,B+=(64-U&U-91)>>>8&-c+U-65+0,B+=(96-U&U-123)>>>8&-c+U-97+26,B},M})(m);n.URLSafeCoder=k;var y=new k;function E(C){return y.encode(C)}n.encodeURLSafe=E;function x(C){return y.decode(C)}n.decodeURLSafe=x,n.encodedLength=function(C){return w.encodedLength(C)},n.maxDecodedLength=function(C){return w.maxDecodedLength(C)},n.decodedLength=function(C){return w.decodedLength(C)}}),(function(t,n,a){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var u="utf8: invalid string",c="utf8: invalid source encoding";function m(g){for(var k=new Uint8Array(w(g)),y=0,E=0;E>6,k[y++]=128|x&63):x<55296?(k[y++]=224|x>>12,k[y++]=128|x>>6&63,k[y++]=128|x&63):(E++,x=(x&1023)<<10,x|=g.charCodeAt(E)&1023,x+=65536,k[y++]=240|x>>18,k[y++]=128|x>>12&63,k[y++]=128|x>>6&63,k[y++]=128|x&63)}return k}n.encode=m;function w(g){for(var k=0,y=0;y=g.length-1)throw new Error(u);y++,k+=4}else throw new Error(u)}return k}n.encodedLength=w;function v(g){for(var k=[],y=0;y=g.length)throw new Error(c);var C=g[++y];if((C&192)!==128)throw new Error(c);E=(E&31)<<6|C&63,x=128}else if(E<240){if(y>=g.length-1)throw new Error(c);var C=g[++y],M=g[++y];if((C&192)!==128||(M&192)!==128)throw new Error(c);E=(E&15)<<12|(C&63)<<6|M&63,x=2048}else if(E<248){if(y>=g.length-2)throw new Error(c);var C=g[++y],M=g[++y],U=g[++y];if((C&192)!==128||(M&192)!==128||(U&192)!==128)throw new Error(c);E=(E&15)<<18|(C&63)<<12|(M&63)<<6|U&63,x=65536}else throw new Error(c);if(E=55296&&E<=57343)throw new Error(c);if(E>=65536){if(E>1114111)throw new Error(c);E-=65536,k.push(String.fromCharCode(55296|E>>10)),E=56320|E&1023}}k.push(String.fromCharCode(E))}return k.join("")}n.decode=v}),(function(t,n,a){t.exports=a(3).default}),(function(t,n,a){"use strict";a.r(n);var u=(function(){function s(f,p){this.lastId=0,this.prefix=f,this.name=p}return s.prototype.create=function(f){this.lastId++;var p=this.lastId,T=this.prefix+p,F=this.name+"["+p+"]",J=!1,lt=function(){J||(f.apply(null,arguments),J=!0)};return this[p]=lt,{number:p,id:T,name:F,callback:lt}},s.prototype.remove=function(f){delete this[f.number]},s})(),c=new u("_pusher_script_","Pusher.ScriptReceivers"),m={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:""},w=m,v=(function(){function s(f){this.options=f,this.receivers=f.receivers||c,this.loading={}}return s.prototype.load=function(f,p,T){var F=this;if(F.loading[f]&&F.loading[f].length>0)F.loading[f].push(T);else{F.loading[f]=[T];var J=je.createScriptRequest(F.getPath(f,p)),lt=F.receivers.create(function(It){if(F.receivers.remove(lt),F.loading[f]){var he=F.loading[f];delete F.loading[f];for(var yn=function(Kr){Kr||J.cleanup()},kn=0;kn>>6)+x(128|f&63):x(224|f>>>12&15)+x(128|f>>>6&63)+x(128|f&63)},z=function(s){return s.replace(/[^\x00-\x7F]/g,Q)},et=function(s){var f=[0,2,1][s.length%3],p=s.charCodeAt(0)<<16|(s.length>1?s.charCodeAt(1):0)<<8|(s.length>2?s.charCodeAt(2):0),T=[C.charAt(p>>>18),C.charAt(p>>>12&63),f>=2?"=":C.charAt(p>>>6&63),f>=1?"=":C.charAt(p&63)];return T.join("")},at=window.btoa||function(s){return s.replace(/[\s\S]{1,3}/g,et)},nt=(function(){function s(f,p,T,F){var J=this;this.clear=p,this.timer=f(function(){J.timer&&(J.timer=F(J.timer))},T)}return s.prototype.isRunning=function(){return this.timer!==null},s.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},s})(),mt=nt,_t=(function(){var s=function(f,p){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,p)};return function(f,p){s(f,p);function T(){this.constructor=f}f.prototype=p===null?Object.create(p):(T.prototype=p.prototype,new T)}})();function ne(s){window.clearTimeout(s)}function le(s){window.clearInterval(s)}var fe=(function(s){_t(f,s);function f(p,T){return s.call(this,setTimeout,ne,p,function(F){return T(),null})||this}return f})(mt),In=(function(s){_t(f,s);function f(p,T){return s.call(this,setInterval,le,p,function(F){return T(),F})||this}return f})(mt),Pn={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(s){return new fe(0,s)},method:function(s){for(var f=[],p=1;p0)for(var F=0;F=1002&&s.code<=1004?"backoff":null:s.code===4e3?"tls_only":s.code<4100?"refused":s.code<4200?"backoff":s.code<4300?"retry":"refused"},getCloseError:function(s){return s.code!==1e3&&s.code!==1001?{type:"PusherError",data:{code:s.code,message:s.reason||s.message}}:null}},rt=ti,lu=(function(){var s=function(f,p){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,p)};return function(f,p){s(f,p);function T(){this.constructor=f}f.prototype=p===null?Object.create(p):(T.prototype=p.prototype,new T)}})(),cu=(function(s){lu(f,s);function f(p,T){var F=s.call(this)||this;return F.id=p,F.transport=T,F.activityTimeout=T.activityTimeout,F.bindListeners(),F}return f.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},f.prototype.send=function(p){return this.transport.send(p)},f.prototype.send_event=function(p,T,F){var J={event:p,data:T};return F&&(J.channel=F),oe.debug("Event sent",J),this.send(rt.encodeMessage(J))},f.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},f.prototype.close=function(){this.transport.close()},f.prototype.bindListeners=function(){var p=this,T={message:function(J){var lt;try{lt=rt.decodeMessage(J)}catch(It){p.emit("error",{type:"MessageParseError",error:It,data:J.data})}if(lt!==void 0){switch(oe.debug("Event recd",lt),lt.event){case"pusher:error":p.emit("error",{type:"PusherError",data:lt.data});break;case"pusher:ping":p.emit("ping");break;case"pusher:pong":p.emit("pong");break}p.emit("message",lt)}},activity:function(){p.emit("activity")},error:function(J){p.emit("error",{type:"WebSocketError",error:J})},closed:function(J){F(),J&&J.code&&p.handleCloseEvent(J),p.transport=null,p.emit("closed")}},F=function(){vn(T,function(J,lt){p.transport.unbind(lt,J)})};vn(T,function(J,lt){p.transport.bind(lt,J)})},f.prototype.handleCloseEvent=function(p){var T=rt.getCloseAction(p),F=rt.getCloseError(p);F&&this.emit("error",F),T&&this.emit(T,{action:T,error:F})},f})(ve),ei=cu,fu=(function(){function s(f,p){this.transport=f,this.callback=p,this.bindListeners()}return s.prototype.close=function(){this.unbindListeners(),this.transport.close()},s.prototype.bindListeners=function(){var f=this;this.onMessage=function(p){f.unbindListeners();var T;try{T=rt.processHandshake(p)}catch(F){f.finish("error",{error:F}),f.transport.close();return}T.action==="connected"?f.finish("connected",{connection:new ei(T.id,f.transport),activityTimeout:T.activityTimeout}):(f.finish(T.action,{error:T.error}),f.transport.close())},this.onClosed=function(p){f.unbindListeners();var T=rt.getCloseAction(p)||"backoff",F=rt.getCloseError(p);f.finish(T,{error:F})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},s.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},s.prototype.finish=function(f,p){this.callback(Be({transport:this.transport,action:f},p))},s})(),Fo=fu,Zf=(function(){function s(f,p){this.channel=f;var T=p.authTransport;if(typeof je.getAuthorizers()[T]>"u")throw"'"+T+"' is not a recognized auth transport";this.type=T,this.options=p,this.authOptions=p.auth||{}}return s.prototype.composeQuery=function(f){var p="socket_id="+encodeURIComponent(f)+"&channel_name="+encodeURIComponent(this.channel.name);for(var T in this.authOptions.params)p+="&"+encodeURIComponent(T)+"="+encodeURIComponent(this.authOptions.params[T]);return p},s.prototype.authorize=function(f,p){s.authorizers=s.authorizers||je.getAuthorizers(),s.authorizers[this.type].call(this,je,f,p)},s})(),wl=Zf,Ac=(function(){function s(f,p){this.timeline=f,this.options=p||{}}return s.prototype.send=function(f,p){this.timeline.isEmpty()||this.timeline.send(je.TimelineTransport.getAgent(this,f),p)},s})(),xc=Ac,Co=(function(){var s=function(f,p){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,p)};return function(f,p){s(f,p);function T(){this.constructor=f}f.prototype=p===null?Object.create(p):(T.prototype=p.prototype,new T)}})(),ba=(function(s){Co(f,s);function f(p){var T=this.constructor,F=s.call(this,p)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),ni=(function(s){Co(f,s);function f(p){var T=this.constructor,F=s.call(this,p)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),Lc=(function(s){Co(f,s);function f(p){var T=this.constructor,F=s.call(this,p)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),ts=(function(s){Co(f,s);function f(p){var T=this.constructor,F=s.call(this,p)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),Nc=(function(s){Co(f,s);function f(p){var T=this.constructor,F=s.call(this,p)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),fp=(function(s){Co(f,s);function f(p){var T=this.constructor,F=s.call(this,p)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),Pi=(function(s){Co(f,s);function f(p){var T=this.constructor,F=s.call(this,p)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),q_=(function(){var s=function(f,p){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,p)};return function(f,p){s(f,p);function T(){this.constructor=f}f.prototype=p===null?Object.create(p):(T.prototype=p.prototype,new T)}})(),j_=(function(s){q_(f,s);function f(p,T){var F=s.call(this,function(J,lt){oe.debug("No callbacks on "+p+" for "+J)})||this;return F.name=p,F.pusher=T,F.subscribed=!1,F.subscriptionPending=!1,F.subscriptionCancelled=!1,F}return f.prototype.authorize=function(p,T){return T(!1,{auth:""})},f.prototype.trigger=function(p,T){if(p.indexOf("client-")!==0)throw new ba("Event '"+p+"' does not start with 'client-'");if(!this.subscribed){var F=Je.buildLogSuffix("triggeringClientEvents");oe.warn("Client event triggered before channel 'subscription_succeeded' event . "+F)}return this.pusher.send_event(p,T,this.name)},f.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},f.prototype.handleEvent=function(p){var T=p.event,F=p.data;if(T==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(p);else if(T.indexOf("pusher_internal:")!==0){var J={};this.emit(T,F,J)}},f.prototype.handleSubscriptionSucceededEvent=function(p){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",p.data)},f.prototype.subscribe=function(){var p=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(T,F){T?(oe.error(F),p.emit("pusher:subscription_error",F)):(F=F,p.pusher.send_event("pusher:subscribe",{auth:F.auth,channel_data:F.channel_data,channel:p.name}))}))},f.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},f.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},f.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},f})(ve),sp=j_,z_=(function(){var s=function(f,p){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,p)};return function(f,p){s(f,p);function T(){this.constructor=f}f.prototype=p===null?Object.create(p):(T.prototype=p.prototype,new T)}})(),V_=(function(s){z_(f,s);function f(){return s!==null&&s.apply(this,arguments)||this}return f.prototype.authorize=function(p,T){var F=So.createAuthorizer(this,this.pusher.config);return F.authorize(p,T)},f})(sp),es=V_,dp=(function(){function s(){this.reset()}return s.prototype.get=function(f){return Object.prototype.hasOwnProperty.call(this.members,f)?{id:f,info:this.members[f]}:null},s.prototype.each=function(f){var p=this;vn(this.members,function(T,F){f(p.get(F))})},s.prototype.setMyID=function(f){this.myID=f},s.prototype.onSubscription=function(f){this.members=f.presence.hash,this.count=f.presence.count,this.me=this.get(this.myID)},s.prototype.addMember=function(f){return this.get(f.user_id)===null&&this.count++,this.members[f.user_id]=f.user_info,this.get(f.user_id)},s.prototype.removeMember=function(f){var p=this.get(f.user_id);return p&&(delete this.members[f.user_id],this.count--),p},s.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},s})(),K_=dp,Y_=(function(){var s=function(f,p){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,p)};return function(f,p){s(f,p);function T(){this.constructor=f}f.prototype=p===null?Object.create(p):(T.prototype=p.prototype,new T)}})(),pp=(function(s){Y_(f,s);function f(p,T){var F=s.call(this,p,T)||this;return F.members=new K_,F}return f.prototype.authorize=function(p,T){var F=this;s.prototype.authorize.call(this,p,function(J,lt){if(!J){if(lt=lt,lt.channel_data===void 0){var It=Je.buildLogSuffix("authenticationEndpoint");oe.error("Invalid auth response for channel '"+F.name+"',"+("expected 'channel_data' field. "+It)),T("Invalid auth response");return}var he=JSON.parse(lt.channel_data);F.members.setMyID(he.user_id)}T(J,lt)})},f.prototype.handleEvent=function(p){var T=p.event;if(T.indexOf("pusher_internal:")===0)this.handleInternalEvent(p);else{var F=p.data,J={};p.user_id&&(J.user_id=p.user_id),this.emit(T,F,J)}},f.prototype.handleInternalEvent=function(p){var T=p.event,F=p.data;switch(T){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(p);break;case"pusher_internal:member_added":var J=this.members.addMember(F);this.emit("pusher:member_added",J);break;case"pusher_internal:member_removed":var lt=this.members.removeMember(F);lt&&this.emit("pusher:member_removed",lt);break}},f.prototype.handleSubscriptionSucceededEvent=function(p){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(p.data),this.emit("pusher:subscription_succeeded",this.members))},f.prototype.disconnect=function(){this.members.reset(),s.prototype.disconnect.call(this)},f})(es),Q_=pp,vp=a(1),ns=a(0),X_=(function(){var s=function(f,p){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,p)};return function(f,p){s(f,p);function T(){this.constructor=f}f.prototype=p===null?Object.create(p):(T.prototype=p.prototype,new T)}})(),Z_=(function(s){X_(f,s);function f(p,T,F){var J=s.call(this,p,T)||this;return J.key=null,J.nacl=F,J}return f.prototype.authorize=function(p,T){var F=this;s.prototype.authorize.call(this,p,function(J,lt){if(J){T(!0,lt);return}var It=lt.shared_secret;if(!It){var he="No shared_secret key in auth payload for encrypted channel: "+F.name;T(!0,he);return}F.key=Object(ns.decode)(It),delete lt.shared_secret,T(!1,lt)})},f.prototype.trigger=function(p,T){throw new Nc("Client events are not currently supported for encrypted channels")},f.prototype.handleEvent=function(p){var T=p.event,F=p.data;if(T.indexOf("pusher_internal:")===0||T.indexOf("pusher:")===0){s.prototype.handleEvent.call(this,p);return}this.handleEncryptedEvent(T,F)},f.prototype.handleEncryptedEvent=function(p,T){var F=this;if(!this.key){oe.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!T.ciphertext||!T.nonce){oe.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+T);return}var J=Object(ns.decode)(T.ciphertext);if(J.length0&&this.emit("connecting_in",Math.round(p/1e3)),this.retryTimer=new fe(p||0,function(){T.disconnectInternally(),T.connect()})},f.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},f.prototype.setUnavailableTimer=function(){var p=this;this.unavailableTimer=new fe(this.options.unavailableTimeout,function(){p.updateState("unavailable")})},f.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},f.prototype.sendActivityCheck=function(){var p=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new fe(this.options.pongTimeout,function(){p.timeline.error({pong_timed_out:p.options.pongTimeout}),p.retryIn(0)})},f.prototype.resetActivityCheck=function(){var p=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new fe(this.activityTimeout,function(){p.sendActivityCheck()}))},f.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},f.prototype.buildConnectionCallbacks=function(p){var T=this;return Be({},p,{message:function(F){T.resetActivityCheck(),T.emit("message",F)},ping:function(){T.send_event("pusher:pong",{})},activity:function(){T.resetActivityCheck()},error:function(F){T.emit("error",{type:"WebSocketError",error:F})},closed:function(){T.abandonConnection(),T.shouldRetry()&&T.retryIn(1e3)}})},f.prototype.buildHandshakeCallbacks=function(p){var T=this;return Be({},p,{connected:function(F){T.activityTimeout=Math.min(T.options.activityTimeout,F.activityTimeout,F.connection.activityTimeout||1/0),T.clearUnavailableTimer(),T.setConnection(F.connection),T.socket_id=T.connection.id,T.updateState("connected",{socket_id:T.socket_id})}})},f.prototype.buildErrorCallbacks=function(){var p=this,T=function(F){return function(J){J.error&&p.emit("error",{type:"WebSocketError",error:J.error}),F(J)}};return{tls_only:T(function(){p.usingTLS=!0,p.updateStrategy(),p.retryIn(0)}),refused:T(function(){p.disconnect()}),backoff:T(function(){p.retryIn(1e3)}),retry:T(function(){p.retryIn(0)})}},f.prototype.setConnection=function(p){this.connection=p;for(var T in this.connectionCallbacks)this.connection.bind(T,this.connectionCallbacks[T]);this.resetActivityCheck()},f.prototype.abandonConnection=function(){if(this.connection){this.stopActivityCheck();for(var p in this.connectionCallbacks)this.connection.unbind(p,this.connectionCallbacks[p]);var T=this.connection;return this.connection=null,T}},f.prototype.updateState=function(p,T){var F=this.state;if(this.state=p,F!==p){var J=p;J==="connected"&&(J+=" with new socket ID "+T.socket_id),oe.debug("State changed",F+" -> "+J),this.timeline.info({state:p,params:T}),this.emit("state_change",{previous:F,current:p}),this.emit(p,T)}},f.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},f})(ve),mp=nh,rh=(function(){function s(){this.channels={}}return s.prototype.add=function(f,p){return this.channels[f]||(this.channels[f]=_p(f,p)),this.channels[f]},s.prototype.all=function(){return bn(this.channels)},s.prototype.find=function(f){return this.channels[f]},s.prototype.remove=function(f){var p=this.channels[f];return delete this.channels[f],p},s.prototype.disconnect=function(){vn(this.channels,function(f){f.disconnect()})},s})(),ah=rh;function _p(s,f){if(s.indexOf("private-encrypted-")===0){if(f.config.nacl)return So.createEncryptedChannel(s,f,f.config.nacl);var p="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",T=Je.buildLogSuffix("encryptedChannelSupport");throw new Nc(p+". "+T)}else return s.indexOf("private-")===0?So.createPrivateChannel(s,f):s.indexOf("presence-")===0?So.createPresenceChannel(s,f):So.createChannel(s,f)}var oh={createChannels:function(){return new ah},createConnectionManager:function(s,f){return new mp(s,f)},createChannel:function(s,f){return new sp(s,f)},createPrivateChannel:function(s,f){return new es(s,f)},createPresenceChannel:function(s,f){return new Q_(s,f)},createEncryptedChannel:function(s,f,p){return new th(s,f,p)},createTimelineSender:function(s,f){return new xc(s,f)},createAuthorizer:function(s,f){return f.authorizer?f.authorizer(s,f):new wl(s,f)},createHandshake:function(s,f){return new Fo(s,f)},createAssistantToTheTransportManager:function(s,f,p){return new Lu(s,f,p)}},So=oh,uh=(function(){function s(f){this.options=f||{},this.livesLeft=this.options.lives||1/0}return s.prototype.getAssistant=function(f){return So.createAssistantToTheTransportManager(this,f,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},s.prototype.isAlive=function(){return this.livesLeft>0},s.prototype.reportDeath=function(){this.livesLeft-=1},s})(),hp=uh,ih=(function(){function s(f,p){this.strategies=f,this.loop=!!p.loop,this.failFast=!!p.failFast,this.timeout=p.timeout,this.timeoutLimit=p.timeoutLimit}return s.prototype.isSupported=function(){return zt(this.strategies,Fe.method("isSupported"))},s.prototype.connect=function(f,p){var T=this,F=this.strategies,J=0,lt=this.timeout,It=null,he=function(yn,kn){kn?p(null,kn):(J=J+1,T.loop&&(J=J%F.length),J0&&(J=new fe(T.timeout,function(){lt.abort(),F(!0)})),lt=f.connect(p,function(It,he){It&&J&&J.isRunning()&&!T.failFast||(J&&J.ensureAborted(),F(It,he))}),{abort:function(){J&&J.ensureAborted(),lt.abort()},forceMinPriority:function(It){lt.forceMinPriority(It)}}},s})(),ri=ih,lh=(function(){function s(f){this.strategies=f}return s.prototype.isSupported=function(){return zt(this.strategies,Fe.method("isSupported"))},s.prototype.connect=function(f,p){return ch(this.strategies,f,function(T,F){return function(J,lt){if(F[T].error=J,J){gp(F)&&p(!0);return}rn(F,function(It){It.forceMinPriority(lt.transport.priority)}),p(null,lt)}})},s})(),rs=lh;function ch(s,f,p){var T=Le(s,function(F,J,lt,It){return F.connect(f,p(J,It))});return{abort:function(){rn(T,as)},forceMinPriority:function(F){rn(T,function(J){J.forceMinPriority(F)})}}}function gp(s){return Bt(s,function(f){return!!f.error})}function as(s){!s.error&&!s.aborted&&(s.abort(),s.aborted=!0)}var fh=(function(){function s(f,p,T){this.strategy=f,this.transports=p,this.ttl=T.ttl||1800*1e3,this.usingTLS=T.useTLS,this.timeline=T.timeline}return s.prototype.isSupported=function(){return this.strategy.isSupported()},s.prototype.connect=function(f,p){var T=this.usingTLS,F=Dp(T),J=[this.strategy];if(F&&F.timestamp+this.ttl>=Fe.now()){var lt=this.transports[F.transport];lt&&(this.timeline.info({cached:!0,transport:F.transport,latency:F.latency}),J.push(new ri([lt],{timeout:F.latency*2+1e3,failFast:!0})))}var It=Fe.now(),he=J.pop().connect(f,function yn(kn,Kr){kn?(yp(T),J.length>0?(It=Fe.now(),he=J.pop().connect(f,yn)):p(kn)):(dh(T,Kr.transport.name,Fe.now()-It),p(null,Kr))});return{abort:function(){he.abort()},forceMinPriority:function(yn){f=yn,he&&he.forceMinPriority(yn)}}},s})(),sh=fh;function os(s){return"pusherTransport"+(s?"TLS":"NonTLS")}function Dp(s){var f=je.getLocalStorage();if(f)try{var p=f[os(s)];if(p)return JSON.parse(p)}catch{yp(s)}return null}function dh(s,f,p){var T=je.getLocalStorage();if(T)try{T[os(s)]=Qe({timestamp:Fe.now(),transport:f,latency:p})}catch{}}function yp(s){var f=je.getLocalStorage();if(f)try{delete f[os(s)]}catch{}}var ph=(function(){function s(f,p){var T=p.delay;this.strategy=f,this.options={delay:T}}return s.prototype.isSupported=function(){return this.strategy.isSupported()},s.prototype.connect=function(f,p){var T=this.strategy,F,J=new fe(this.options.delay,function(){F=T.connect(f,p)});return{abort:function(){J.ensureAborted(),F&&F.abort()},forceMinPriority:function(lt){f=lt,F&&F.forceMinPriority(lt)}}},s})(),Pc=ph,Rp=(function(){function s(f,p,T){this.test=f,this.trueBranch=p,this.falseBranch=T}return s.prototype.isSupported=function(){var f=this.test()?this.trueBranch:this.falseBranch;return f.isSupported()},s.prototype.connect=function(f,p){var T=this.test()?this.trueBranch:this.falseBranch;return T.connect(f,p)},s})(),Fl=Rp,vh=(function(){function s(f){this.strategy=f}return s.prototype.isSupported=function(){return this.strategy.isSupported()},s.prototype.connect=function(f,p){var T=this.strategy.connect(f,function(F,J){J&&T.abort(),p(F,J)});return T},s})(),mh=vh;function su(s){return function(){return s.isSupported()}}var bp=function(s,f,p){var T={};function F(gr,Wp,Hp,Gh,Bp){var h=p(s,gr,Wp,Hp,Gh,Bp);return T[gr]=h,h}var J=Object.assign({},f,{hostNonTLS:s.wsHost+":"+s.wsPort,hostTLS:s.wsHost+":"+s.wssPort,httpPath:s.wsPath}),lt=Object.assign({},J,{useTLS:!0}),It=Object.assign({},f,{hostNonTLS:s.httpHost+":"+s.httpPort,hostTLS:s.httpHost+":"+s.httpsPort,httpPath:s.httpPath}),he={loop:!0,timeout:15e3,timeoutLimit:6e4},yn=new hp({lives:2,minPingDelay:1e4,maxPingDelay:s.activityTimeout}),kn=new hp({lives:2,minPingDelay:1e4,maxPingDelay:s.activityTimeout}),Kr=F("ws","ws",3,J,yn),Xa=F("wss","ws",3,lt,yn),Wh=F("sockjs","sockjs",1,It),Lp=F("xhr_streaming","xhr_streaming",1,It,kn),Np=F("xdr_streaming","xdr_streaming",1,It,kn),Pp=F("xhr_polling","xhr_polling",1,It),Hh=F("xdr_polling","xdr_polling",1,It),Op=new ri([Kr],he),Bh=new ri([Xa],he),Jh=new ri([Wh],he),Up=new ri([new Fl(su(Lp),Lp,Np)],he),kp=new ri([new Fl(su(Pp),Pp,Hh)],he),$p=new ri([new Fl(su(Up),new rs([Up,new Pc(kp,{delay:4e3})]),kp)],he),ss=new Fl(su($p),$p,Jh),ds;return f.useTLS?ds=new rs([Op,new Pc(ss,{delay:2e3})]):ds=new rs([Op,new Pc(Bh,{delay:2e3}),new Pc(ss,{delay:5e3})]),new sh(new mh(new Fl(su(Kr),ds,ss)),T,{ttl:18e5,timeline:f.timeline,useTLS:f.useTLS})},_h=bp,hh=(function(){var s=this;s.timeline.info(s.buildTimelineMessage({transport:s.name+(s.options.useTLS?"s":"")})),s.hooks.isInitialized()?s.changeState("initialized"):s.hooks.file?(s.changeState("initializing"),y.load(s.hooks.file,{useTLS:s.options.useTLS},function(f,p){s.hooks.isInitialized()?(s.changeState("initialized"),p(!0)):(f&&s.onError(f),s.onClose(),p(!1))})):s.onClose()}),Tp={getRequest:function(s){var f=new window.XDomainRequest;return f.ontimeout=function(){s.emit("error",new ni),s.close()},f.onerror=function(p){s.emit("error",p),s.close()},f.onprogress=function(){f.responseText&&f.responseText.length>0&&s.onChunk(200,f.responseText)},f.onload=function(){f.responseText&&f.responseText.length>0&&s.onChunk(200,f.responseText),s.emit("finished",200),s.close()},f},abortRequest:function(s){s.ontimeout=s.onerror=s.onprogress=s.onload=null,s.abort()}},gh=Tp,Ep=(function(){var s=function(f,p){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,F){T.__proto__=F}||function(T,F){for(var J in F)F.hasOwnProperty(J)&&(T[J]=F[J])},s(f,p)};return function(f,p){s(f,p);function T(){this.constructor=f}f.prototype=p===null?Object.create(p):(T.prototype=p.prototype,new T)}})(),Dh=256*1024,wp=(function(s){Ep(f,s);function f(p,T,F){var J=s.call(this)||this;return J.hooks=p,J.method=T,J.url=F,J}return f.prototype.start=function(p){var T=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){T.close()},je.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(p)},f.prototype.close=function(){this.unloader&&(je.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},f.prototype.onChunk=function(p,T){for(;;){var F=this.advanceBuffer(T);if(F)this.emit("chunk",{status:p,data:F});else break}this.isBufferTooLong(T)&&this.emit("buffer_too_long")},f.prototype.advanceBuffer=function(p){var T=p.slice(this.position),F=T.indexOf(` `);return F!==-1?(this.position+=F+1,T.slice(0,F)):null},f.prototype.isBufferTooLong=function(p){return this.position===p.length&&p.length>Dh},f})(ve),Fp=wp,Cl;(function(s){s[s.CONNECTING=0]="CONNECTING",s[s.OPEN=1]="OPEN",s[s.CLOSED=3]="CLOSED"})(Cl||(Cl={}));var Mo=Cl,yh=1,Cp=(function(){function s(f,p){this.hooks=f,this.session=Pa(1e3)+"/"+du(8),this.location=Rh(p),this.readyState=Mo.CONNECTING,this.openStream()}return s.prototype.send=function(f){return this.sendRaw(JSON.stringify([f]))},s.prototype.ping=function(){this.hooks.sendHeartbeat(this)},s.prototype.close=function(f,p){this.onClose(f,p,!0)},s.prototype.sendRaw=function(f){if(this.readyState===Mo.OPEN)try{return je.createSocketRequest("POST",us(bh(this.location,this.session))).start(f),!0}catch{return!1}else return!1},s.prototype.reconnect=function(){this.closeStream(),this.openStream()},s.prototype.onClose=function(f,p,T){this.closeStream(),this.readyState=Mo.CLOSED,this.onclose&&this.onclose({code:f,reason:p,wasClean:T})},s.prototype.onChunk=function(f){if(f.status===200){this.readyState===Mo.OPEN&&this.onActivity();var p,T=f.data.slice(0,1);switch(T){case"o":p=JSON.parse(f.data.slice(1)||"{}"),this.onOpen(p);break;case"a":p=JSON.parse(f.data.slice(1)||"[]");for(var F=0;F0&&s.onChunk(p.status,p.responseText);break;case 4:p.responseText&&p.responseText.length>0&&s.onChunk(p.status,p.responseText),s.emit("finished",p.status),s.close();break}},p},abortRequest:function(s){s.onreadystatechange=null,s.abort()}},qe=Mp,ai={createStreamingSocket:function(s){return this.createSocket(wh,s)},createPollingSocket:function(s){return this.createSocket(Ch,s)},createSocket:function(s,f){return new Th(s,f)},createXHR:function(s,f){return this.createRequest(qe,s,f)},createRequest:function(s,f,p){return new Fp(s,f,p)}},is=ai;is.createXDR=function(s,f){return this.createRequest(gh,s,f)};var Sh=is,Mh={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:c,DependenciesReceivers:k,getDefaultStrategy:_h,Transports:Vr,transportConnectionInitializer:hh,HTTPFactory:Sh,TimelineTransport:K,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(s){var f=this;window.Pusher=s;var p=function(){f.onDocumentBody(s.ready)};window.JSON?p():y.load("json2",{},p)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:O,jsonp:L}},onDocumentBody:function(s){var f=this;document.body?s():setTimeout(function(){f.onDocumentBody(s)},0)},createJSONPRequest:function(s,f){return new $(s,f)},createScriptRequest:function(s){return new S(s)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var s=this.getXHRAPI();return new s},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return Qa},createWebSocket:function(s){var f=this.getWebSocketAPI();return new f(s)},createSocketRequest:function(s,f){if(this.isXHRSupported())return this.HTTPFactory.createXHR(s,f);if(this.isXDRSupported(f.indexOf("https:")===0))return this.HTTPFactory.createXDR(s,f);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var s=this.getXHRAPI();return!!s&&new s().withCredentials!==void 0},isXDRSupported:function(s){var f=s?"https:":"http:",p=this.getProtocol();return!!window.XDomainRequest&&p===f},addUnloadListener:function(s){window.addEventListener!==void 0?window.addEventListener("unload",s,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",s)},removeUnloadListener:function(s){window.addEventListener!==void 0?window.removeEventListener("unload",s,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",s)}},je=Mh,Oc;(function(s){s[s.ERROR=3]="ERROR",s[s.INFO=6]="INFO",s[s.DEBUG=7]="DEBUG"})(Oc||(Oc={}));var Uc=Oc,Ih=(function(){function s(f,p,T){this.key=f,this.session=p,this.events=[],this.options=T||{},this.sent=0,this.uniqueID=0}return s.prototype.log=function(f,p){f<=this.options.level&&(this.events.push(Be({},p,{timestamp:Fe.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},s.prototype.error=function(f){this.log(Uc.ERROR,f)},s.prototype.info=function(f){this.log(Uc.INFO,f)},s.prototype.debug=function(f){this.log(Uc.DEBUG,f)},s.prototype.isEmpty=function(){return this.events.length===0},s.prototype.send=function(f,p){var T=this,F=Be({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=[],f(F,function(J,lt){J||T.sent++,p&&p(J,lt)}),!0},s.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},s})(),Ip=Ih,ls=(function(){function s(f,p,T,F){this.name=f,this.priority=p,this.transport=T,this.options=F||{}}return s.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},s.prototype.connect=function(f,p){var T=this;if(this.isSupported()){if(this.priority{typeof window<"u"&&(function(n,a){typeof rp=="object"&&typeof dD=="object"?dD.exports=a():typeof define=="function"&&define.amd?define([],a):typeof rp=="object"?rp.Hls=a():n.Hls=a()})(rp,function(){return(function(t){var n={};function a(u){if(n[u])return n[u].exports;var c=n[u]={i:u,l:!1,exports:{}};return t[u].call(c.exports,c,c.exports,a),c.l=!0,c.exports}return a.m=t,a.c=n,a.d=function(u,c,m){a.o(u,c)||Object.defineProperty(u,c,{enumerable:!0,get:m})},a.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},a.t=function(u,c){if(c&1&&(u=a(u)),c&8||c&4&&typeof u=="object"&&u&&u.__esModule)return u;var m=Object.create(null);if(a.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:u}),c&2&&typeof u!="string")for(var w in u)a.d(m,w,function(v){return u[v]}.bind(null,w));return m},a.n=function(u){var c=u&&u.__esModule?function(){return u.default}:function(){return u};return a.d(c,"a",c),c},a.o=function(u,c){return Object.prototype.hasOwnProperty.call(u,c)},a.p="/dist/",a(a.s="./src/hls.ts")})({"./node_modules/eventemitter3/index.js":(function(t,n,a){"use strict";var u=Object.prototype.hasOwnProperty,c="~";function m(){}Object.create&&(m.prototype=Object.create(null),new m().__proto__||(c=!1));function w(y,E,x){this.fn=y,this.context=E,this.once=x||!1}function v(y,E,x,C,M){if(typeof x!="function")throw new TypeError("The listener must be a function");var U=new w(x,C||y,M),B=c?c+E:E;return y._events[B]?y._events[B].fn?y._events[B]=[y._events[B],U]:y._events[B].push(U):(y._events[B]=U,y._eventsCount++),y}function g(y,E){--y._eventsCount===0?y._events=new m:delete y._events[E]}function k(){this._events=new m,this._eventsCount=0}k.prototype.eventNames=function(){var E=[],x,C;if(this._eventsCount===0)return E;for(C in x=this._events)u.call(x,C)&&E.push(c?C.slice(1):C);return Object.getOwnPropertySymbols?E.concat(Object.getOwnPropertySymbols(x)):E},k.prototype.listeners=function(E){var x=c?c+E:E,C=this._events[x];if(!C)return[];if(C.fn)return[C.fn];for(var M=0,U=C.length,B=new Array(U);M0},!1)}function y(E,x){for(var C={main:[x]},M={main:[]},U={main:{}};k(C);)for(var B=Object.keys(C),Q=0;Q>>8^bn&255^99,et[Fn]=bn,at[bn]=Fn;var rn=ln[Fn],Le=ln[rn],Er=ln[Le],gt=ln[bn]*257^bn*16843008;mt[Fn]=gt<<24|gt>>>8,_t[Fn]=gt<<16|gt>>>16,ne[Fn]=gt<<8|gt>>>24,le[Fn]=gt,gt=Er*16843009^Le*65537^rn*257^Fn*16843008,In[bn]=gt<<24|gt>>>8,Pn[bn]=gt<<16|gt>>>16,Fe[bn]=gt<<8|gt>>>24,Be[bn]=gt,Fn?(Fn=rn^ln[ln[ln[Er^rn]]],vn^=ln[ln[vn]]):Fn=vn=1}},Q.expandKey=function(et){for(var at=this.uint8ArrayToUint32Array_(et),nt=!0,mt=0;mt>>6)+1,A=(q[L+2]&60)>>>2,A>ct.length-1){O.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+A});return}return W=(q[L+2]&1)<<2,W|=(q[L+3]&192)>>>6,v.logger.log("manifest codec:"+D+",ADTS data:type:"+S+",sampleingIndex:"+A+"["+ct[A]+"Hz],channelConfig:"+W),/firefox/i.test(K)?A>=6?(S=5,X=new Array(4),$=A-3):(S=2,X=new Array(2),$=A):K.indexOf("android")!==-1?(S=2,X=new Array(2),$=A):(S=5,X=new Array(4),D&&(D.indexOf("mp4a.40.29")!==-1||D.indexOf("mp4a.40.5")!==-1)||!D&&A>=6?$=A-3:((D&&D.indexOf("mp4a.40.2")!==-1&&(A>=6&&W===1||/vivaldi/i.test(K))||!D&&W===1)&&(S=2,X=new Array(2)),$=A)),X[0]=S<<3,X[0]|=(A&14)>>1,X[1]|=(A&1)<<7,X[1]|=W<<3,S===5&&(X[1]|=($&14)>>1,X[2]=($&1)<<7,X[2]|=8,X[3]=0),{config:X,samplerate:ct[A],channelCount:W,codec:"mp4a.40."+S,manifestCodec:ot}}function y(O,q){return O[q]===255&&(O[q+1]&246)===240}function E(O,q){return O[q+1]&1?7:9}function x(O,q){return(O[q+3]&3)<<11|O[q+4]<<3|(O[q+5]&224)>>>5}function C(O,q){return!!(q+10&&q+A+$<=X)return W=L+D*S,{headerLength:A,frameLength:$,stamp:W}}function z(O,q,L,D,S){var A=B(O.samplerate),$=Q(q,L,D,S,A);if($){var W=$.stamp,X=$.headerLength,K=$.frameLength,ot={unit:q.subarray(L+X,L+X+K),pts:W,dts:W};return O.samples.push(ot),{sample:ot,length:K+X}}}var et=a("./src/demux/id3.js"),at=(function(){function O(L,D,S){this.observer=L,this.config=S,this.remuxer=D}var q=O.prototype;return q.resetInitSegment=function(D,S,A,$){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:S,duration:$,inputTimeScale:9e4}},q.resetTimeStamp=function(){},O.probe=function(D){if(!D)return!1;for(var S=et.default.getID3Data(D,0)||[],A=S.length,$=D.length;A<$;A++)if(M(D,A))return v.logger.log("ADTS sync word found !"),!0;return!1},q.append=function(D,S,A,$){for(var W=this._audioTrack,X=et.default.getID3Data(D,0)||[],K=et.default.getTimeStamp(X),ot=Object(w.isFiniteNumber)(K)?K*90:S*9e4,ct=0,ft=ot,st=D.length,wt=X.length,Pt=[{pts:ft,dts:ft,data:X}];wtL.length)){var $=this.parseHeader(L,D);if($&&D+$.frameLength<=L.length){var W=$.samplesPerFrame*9e4/$.sampleRate,X=S+A*W,K={unit:L.subarray(D,D+$.frameLength),pts:X,dts:X};return q.config=[],q.channelCount=$.channelCount,q.samplerate=$.sampleRate,q.samples.push(K),{sample:K,length:$.frameLength}}}},parseHeader:function(q,L){var D=q[L+1]>>3&3,S=q[L+1]>>1&3,A=q[L+2]>>4&15,$=q[L+2]>>2&3,W=q[L+2]>>1&1;if(D!==1&&A!==0&&A!==15&&$!==3){var X=D===3?3-S:S===3?3:4,K=_t.BitratesMap[X*14+A-1]*1e3,ot=D===3?0:D===2?1:2,ct=_t.SamplingRateMap[ot*3+$],ft=q[L+3]>>6===3?1:2,st=_t.SamplesCoefficients[D][S],wt=_t.BytesInSlot[S],Pt=st*8*wt,pt=parseInt(st*K/ct+W,10)*wt;return{sampleRate:ct,channelCount:ft,frameLength:pt,samplesPerFrame:Pt}}},isHeaderPattern:function(q,L){return q[L]===255&&(q[L+1]&224)===224&&(q[L+1]&6)!==0},isHeader:function(q,L){return!!(L+1D?(this.word<<=D,this.bitsAvailable-=D):(D-=this.bitsAvailable,S=D>>3,D-=S>>3,this.bytesAvailable-=S,this.loadWord(),this.word<<=D,this.bitsAvailable-=D)},q.readBits=function(D){var S=Math.min(this.bitsAvailable,D),A=this.word>>>32-S;return D>32&&v.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=S,this.bitsAvailable>0?this.word<<=S:this.bytesAvailable>0&&this.loadWord(),S=D-S,S>0&&this.bitsAvailable?A<>>D)!==0)return this.word<<=D,this.bitsAvailable-=D,D;return this.loadWord(),D+this.skipLZ()},q.skipUEG=function(){this.skipBits(1+this.skipLZ())},q.skipEG=function(){this.skipBits(1+this.skipLZ())},q.readUEG=function(){var D=this.skipLZ();return this.readBits(D+1)-1},q.readEG=function(){var D=this.readUEG();return 1&D?1+D>>>1:-1*(D>>>1)},q.readBoolean=function(){return this.readBits(1)===1},q.readUByte=function(){return this.readBits(8)},q.readUShort=function(){return this.readBits(16)},q.readUInt=function(){return this.readBits(32)},q.skipScalingList=function(D){var S=8,A=8,$,W;for($=0;$=D.length){A();return}if(!(D[S].unit.length<32)){var $=this.decrypter.isSync();if(this.decryptAacSample(D,S,A,$),!$)return}}},q.getAvcEncryptedData=function(D){for(var S=Math.floor((D.length-48)/160)*16+16,A=new Int8Array(S),$=0,W=32;W<=D.length-16;W+=160,$+=16)A.set(D.subarray(W,W+16),$);return A},q.getAvcDecryptedUnit=function(D,S){S=new Uint8Array(S);for(var A=0,$=32;$<=D.length-16;$+=160,A+=16)D.set(S.subarray(A,A+16),$);return D},q.decryptAvcSample=function(D,S,A,$,W,X){var K=this.discardEPB(W.data),ot=this.getAvcEncryptedData(K),ct=this;this.decryptBuffer(ot.buffer,function(ft){W.data=ct.getAvcDecryptedUnit(K,ft),X||ct.decryptAvcSamples(D,S,A+1,$)})},q.decryptAvcSamples=function(D,S,A,$){for(;;S++,A=0){if(S>=D.length){$();return}for(var W=D[S].units;!(A>=W.length);A++){var X=W[A];if(!(X.length<=48||X.type!==1&&X.type!==5)){var K=this.decrypter.isSync();if(this.decryptAvcSample(D,S,A,$,X,K),!K)return}}}},O})(),Pn=In,Fe={video:1,audio:2,id3:3,text:4},Be=(function(){function O(L,D,S,A){this.observer=L,this.config=S,this.typeSupported=A,this.remuxer=D,this.sampleAes=null}var q=O.prototype;return q.setDecryptData=function(D){D!=null&&D.key!=null&&D.method==="SAMPLE-AES"?this.sampleAes=new Pn(this.observer,this.config,D,this.discardEPB):this.sampleAes=null},O.probe=function(D){var S=O._syncOffset(D);return S<0?!1:(S&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+S+", junk ahead ?"),!0)},O._syncOffset=function(D){for(var S=Math.min(1e3,D.length-564),A=0;A>4,ct>1){if(ft=W+5+D[W+4],ft===W+188)continue}else ft=W+4;switch(ot){case ve:K&&(mn&&(st=Qn(mn))&&_r(st,!1),mn={data:[],size:0}),mn&&(mn.data.push(D.subarray(ft,W+188)),mn.size+=W+188-ft);break;case en:K&&(Oe&&(st=Qn(Oe))&&(Ht.isAAC?Ur(st):cr(st)),Oe={data:[],size:0}),Oe&&(Oe.data.push(D.subarray(ft,W+188)),Oe.size+=W+188-ft);break;case Cn:K&&(xn&&(st=Qn(xn))&&la(st),xn={data:[],size:0}),xn&&(xn.data.push(D.subarray(ft,W+188)),xn.size+=W+188-ft);break;case 0:K&&(ft+=D[ft]+1),Te=this._pmtId=Ge(D,ft);break;case Te:K&&(ft+=D[ft]+1);var qn=Tn(D,ft,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,this.sampleAes!=null);ve=qn.avc,ve>0&&(pt.pid=ve),en=qn.audio,en>0&&(Ht.pid=en,Ht.isAAC=qn.isAAC),Cn=qn.id3,Cn>0&&(Xt.pid=Cn),wt&&!Pt&&(v.logger.log("reparse from beginning"),wt=!1,W=hr-188),Pt=this.pmtParsed=!0;break;case 17:case 8191:break;default:wt=!0;break}}else this.observer.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});mn&&(st=Qn(mn))?(_r(st,!0),pt.pesData=null):pt.pesData=mn,Oe&&(st=Qn(Oe))?(Ht.isAAC?Ur(st):cr(st),Ht.pesData=null):(Oe&&Oe.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),Ht.pesData=Oe),xn&&(st=Qn(xn))?(la(st),Xt.pesData=null):Xt.pesData=xn,this.sampleAes==null?this.remuxer.remux(Ht,pt,Xt,this._txtTrack,S,A,$):this.decryptAndRemux(Ht,pt,Xt,this._txtTrack,S,A,$)},q.decryptAndRemux=function(D,S,A,$,W,X,K){if(D.samples&&D.isAAC){var ot=this;this.sampleAes.decryptAacSamples(D.samples,0,function(){ot.decryptAndRemuxAvc(D,S,A,$,W,X,K)})}else this.decryptAndRemuxAvc(D,S,A,$,W,X,K)},q.decryptAndRemuxAvc=function(D,S,A,$,W,X,K){if(S.samples){var ot=this;this.sampleAes.decryptAvcSamples(S.samples,0,0,function(){ot.remuxer.remux(D,S,A,$,W,X,K)})}else this.remuxer.remux(D,S,A,$,W,X,K)},q.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},q._parsePAT=function(D,S){return(D[S+10]&31)<<8|D[S+11]},q._parsePMT=function(D,S,A,$){var W,X,K,ot,ct={audio:-1,avc:-1,id3:-1,isAAC:!0};for(W=(D[S+1]&15)<<8|D[S+2],X=S+3+W-4,K=(D[S+10]&15)<<8|D[S+11],S+=12+K;S1;){var Pt=new Uint8Array(wt[0].length+wt[1].length);Pt.set(wt[0]),Pt.set(wt[1],wt[0].length),wt[0]=Pt,wt.splice(1,1)}if(A=wt[0],W=(A[0]<<16)+(A[1]<<8)+A[2],W===1){if(X=(A[4]<<8)+A[5],X&&X>D.size-6||($=A[7],$&192&&(ct=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,ct>4294967295&&(ct-=8589934592),$&64?(ft=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,ft>4294967295&&(ft-=8589934592),ct-ft>60*9e4&&(v.logger.warn(Math.round((ct-ft)/9e4)+"s delta between PTS and DTS, align them"),ct=ft)):ft=ct),K=A[8],st=K+9,D.size<=st))return null;D.size-=st,ot=new Uint8Array(D.size);for(var pt=0,Ht=wt.length;ptXt){st-=Xt;continue}else A=A.subarray(st),Xt-=st,st=0;ot.set(A,S),S+=Xt}return X&&(X-=K+3),{data:ot,pts:ct,dts:ft,len:X}}else return null},q.pushAccesUnit=function(D,S){if(D.units.length&&D.frame){var A=S.samples,$=A.length;if(isNaN(D.pts))if($){var W=A[$-1];D.pts=W.pts,D.dts=W.dts}else{S.dropped++;return}!this.config.forceKeyFrameOnDiscontinuity||D.key===!0||S.sps&&($||this.contiguous)?(D.id=$,A.push(D)):S.dropped++}D.debug.length&&v.logger.log(D.pts+"/"+D.dts+":"+D.debug)},q._parseAVCPES=function(D,S){var A=this,$=this._avcTrack,W=this._parseAVCNALu(D.data),X=!1,K,ot=this.avcSample,ct,ft=!1,st,wt=this.pushAccesUnit.bind(this),Pt=function(Ht,Xt,ve,en){return{key:Ht,pts:Xt,dts:ve,units:[],debug:en}};D.data=null,ot&&W.length&&!$.audFound&&(wt(ot,$),ot=this.avcSample=Pt(!1,D.pts,D.dts,"")),W.forEach(function(pt){switch(pt.type){case 1:ct=!0,ot||(ot=A.avcSample=Pt(!0,D.pts,D.dts,"")),X&&(ot.debug+="NDR "),ot.frame=!0;var Ht=pt.data;if(ft&&Ht.length>4){var Xt=new fe(Ht).readSliceType();(Xt===2||Xt===4||Xt===7||Xt===9)&&(ot.key=!0)}break;case 5:ct=!0,ot||(ot=A.avcSample=Pt(!0,D.pts,D.dts,"")),X&&(ot.debug+="IDR "),ot.key=!0,ot.frame=!0;break;case 6:ct=!0,X&&ot&&(ot.debug+="SEI "),K=new fe(A.discardEPB(pt.data)),K.readUByte();for(var ve=0,en=0,Cn=!1,Te=0;!Cn&&K.bytesAvailable>1;){ve=0;do Te=K.readUByte(),ve+=Te;while(Te===255);en=0;do Te=K.readUByte(),en+=Te;while(Te===255);if(ve===4&&K.bytesAvailable!==0){Cn=!0;var mn=K.readUByte();if(mn===181){var Oe=K.readUShort();if(Oe===49){var xn=K.readUInt();if(xn===1195456820){var Ge=K.readUByte();if(Ge===3){var Tn=K.readUByte(),Qn=K.readUByte(),_r=31&Tn,Ur=[Tn,Qn];for(st=0;st<_r;st++)Ur.push(K.readUByte()),Ur.push(K.readUByte()),Ur.push(K.readUByte());A._insertSampleInOrder(A._txtTrack.samples,{type:3,pts:D.pts,bytes:Ur})}}}}}else if(ve===5&&K.bytesAvailable!==0){if(Cn=!0,en>16){var cr=[];for(st=0;st<16;st++)cr.push(K.readUByte().toString(16)),(st===3||st===5||st===7||st===9)&&cr.push("-");var la=en-16,hr=new Uint8Array(la);for(st=0;st0){if(S.pts>=D[A-1].pts)D.push(S);else for(var $=A-1;$>=0;$--)if(S.pts=0)ft={data:D.subarray(wt,S-K-1),type:Pt},ct.push(ft);else{var pt=this._getLastNalUnit();if(pt&&(ot&&S<=4-ot&&pt.state&&(pt.data=pt.data.subarray(0,pt.data.byteLength-ot)),W=S-K-1,W>0)){var Ht=new Uint8Array(pt.data.byteLength+W);Ht.set(pt.data,0),Ht.set(D.subarray(0,W),pt.data.byteLength),pt.data=Ht}}S=0&&K>=0&&(ft={data:D.subarray(wt,A),type:Pt,state:K},ct.push(ft)),ct.length===0){var Xt=this._getLastNalUnit();if(Xt){var ve=new Uint8Array(Xt.data.byteLength+D.byteLength);ve.set(Xt.data,0),ve.set(D,Xt.data.byteLength),Xt.data=ve}}return X.naluState=K,ct},q.discardEPB=function(D){for(var S=D.byteLength,A=[],$=1,W,X;$1&&(v.logger.log("AAC: align PTS for overlapping frames by "+Math.round((Xt-$)/90)),$=Xt)}for(;ft>24&255,W[1]=S>>16&255,W[2]=S>>8&255,W[3]=S&255,W.set(L,4),A=0,S=8;A<$;A++)W.set(D[A],S),S+=D[A].byteLength;return W},O.hdlr=function(L){return O.box(O.types.hdlr,O.HDLR_TYPES[L])},O.mdat=function(L){return O.box(O.types.mdat,L)},O.mdhd=function(L,D){D*=L;var S=Math.floor(D/(rn+1)),A=Math.floor(D%(rn+1));return O.box(O.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,S>>24,S>>16&255,S>>8&255,S&255,A>>24,A>>16&255,A>>8&255,A&255,85,196,0,0]))},O.mdia=function(L){return O.box(O.types.mdia,O.mdhd(L.timescale,L.duration),O.hdlr(L.type),O.minf(L))},O.mfhd=function(L){return O.box(O.types.mfhd,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255]))},O.minf=function(L){return L.type==="audio"?O.box(O.types.minf,O.box(O.types.smhd,O.SMHD),O.DINF,O.stbl(L)):O.box(O.types.minf,O.box(O.types.vmhd,O.VMHD),O.DINF,O.stbl(L))},O.moof=function(L,D,S){return O.box(O.types.moof,O.mfhd(L),O.traf(S,D))},O.moov=function(L){for(var D=L.length,S=[];D--;)S[D]=O.trak(L[D]);return O.box.apply(null,[O.types.moov,O.mvhd(L[0].timescale,L[0].duration)].concat(S).concat(O.mvex(L)))},O.mvex=function(L){for(var D=L.length,S=[];D--;)S[D]=O.trex(L[D]);return O.box.apply(null,[O.types.mvex].concat(S))},O.mvhd=function(L,D){D*=L;var S=Math.floor(D/(rn+1)),A=Math.floor(D%(rn+1)),$=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,S>>24,S>>16&255,S>>8&255,S&255,A>>24,A>>16&255,A>>8&255,A&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 O.box(O.types.mvhd,$)},O.sdtp=function(L){var D=L.samples||[],S=new Uint8Array(4+D.length),A,$;for($=0;$>>8&255),D.push(W&255),D=D.concat(Array.prototype.slice.call($));for(A=0;A>>8&255),S.push(W&255),S=S.concat(Array.prototype.slice.call($));var X=O.box(O.types.avcC,new Uint8Array([1,D[3],D[4],D[5],255,224|L.sps.length].concat(D).concat([L.pps.length]).concat(S))),K=L.width,ot=L.height,ct=L.pixelRatio[0],ft=L.pixelRatio[1];return O.box(O.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,K>>8&255,K&255,ot>>8&255,ot&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]),X,O.box(O.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),O.box(O.types.pasp,new Uint8Array([ct>>24,ct>>16&255,ct>>8&255,ct&255,ft>>24,ft>>16&255,ft>>8&255,ft&255])))},O.esds=function(L){var D=L.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(L.config).concat([6,1,2]))},O.mp4a=function(L){var D=L.samplerate;return O.box(O.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,L.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]),O.box(O.types.esds,O.esds(L)))},O.mp3=function(L){var D=L.samplerate;return O.box(O.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,L.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]))},O.stsd=function(L){return L.type==="audio"?!L.isAAC&&L.codec==="mp3"?O.box(O.types.stsd,O.STSD,O.mp3(L)):O.box(O.types.stsd,O.STSD,O.mp4a(L)):O.box(O.types.stsd,O.STSD,O.avc1(L))},O.tkhd=function(L){var D=L.id,S=L.duration*L.timescale,A=L.width,$=L.height,W=Math.floor(S/(rn+1)),X=Math.floor(S%(rn+1));return O.box(O.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,W>>24,W>>16&255,W>>8&255,W&255,X>>24,X>>16&255,X>>8&255,X&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,A>>8&255,A&255,0,0,$>>8&255,$&255,0,0]))},O.traf=function(L,D){var S=O.sdtp(L),A=L.id,$=Math.floor(D/(rn+1)),W=Math.floor(D%(rn+1));return O.box(O.types.traf,O.box(O.types.tfhd,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255])),O.box(O.types.tfdt,new Uint8Array([1,0,0,0,$>>24,$>>16&255,$>>8&255,$&255,W>>24,W>>16&255,W>>8&255,W&255])),O.trun(L,S.length+16+20+8+16+8+8),S)},O.trak=function(L){return L.duration=L.duration||4294967295,O.box(O.types.trak,O.tkhd(L),O.mdia(L))},O.trex=function(L){var D=L.id;return O.box(O.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]))},O.trun=function(L,D){var S=L.samples||[],A=S.length,$=12+16*A,W=new Uint8Array($),X,K,ot,ct,ft,st;for(D+=8+$,W.set([0,0,15,1,A>>>24&255,A>>>16&255,A>>>8&255,A&255,D>>>24&255,D>>>16&255,D>>>8&255,D&255],0),X=0;X>>24&255,ot>>>16&255,ot>>>8&255,ot&255,ct>>>24&255,ct>>>16&255,ct>>>8&255,ct&255,ft.isLeading<<2|ft.dependsOn,ft.isDependedOn<<6|ft.hasRedundancy<<4|ft.paddingValue<<1|ft.isNonSync,ft.degradPrio&61440,ft.degradPrio&15,st>>>24&255,st>>>16&255,st>>>8&255,st&255],12+16*X);return O.box(O.types.trun,W)},O.initSegment=function(L){O.types||O.init();var D=O.moov(L),S;return S=new Uint8Array(O.FTYP.byteLength+D.byteLength),S.set(O.FTYP),S.set(D,O.FTYP.byteLength),S},O})(),Er=Le,gt=9e4;function Ne(O,q,L,D){return L===void 0&&(L=1),D===void 0&&(D=!1),an(O,q,1/L)}function an(O,q,L,D){L===void 0&&(L=1),D===void 0&&(D=!1);var S=O*q*L;return D?Math.round(S):S}function zt(O,q){return q===void 0&&(q=!1),an(O,1e3,1/gt,q)}function Bt(O,q){return q===void 0&&(q=1),an(O,gt,1/q)}var Dt=Bt(10),be=Bt(.2),De=(function(){function O(L,D,S,A){this.observer=L,this.config=D,this.typeSupported=S;var $=navigator.userAgent;this.isSafari=A&&A.indexOf("Apple")>-1&&$&&!$.match("CriOS"),this.ISGenerated=!1}var q=O.prototype;return q.destroy=function(){},q.resetTimeStamp=function(D){this._initPTS=this._initDTS=D},q.resetInitSegment=function(){this.ISGenerated=!1},q.remux=function(D,S,A,$,W,X,K){if(this.ISGenerated||this.generateIS(D,S,W),this.ISGenerated){var ot=D.samples.length,ct=S.samples.length,ft=W,st=W;if(ot&&ct){var wt=(D.samples[0].pts-S.samples[0].pts)/S.inputTimeScale;ft+=Math.max(0,wt),st+=Math.max(0,-wt)}if(ot){D.timescale||(v.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(D,S,W));var Pt=this.remuxAudio(D,ft,X,K);if(ct){var pt;Pt&&(pt=Pt.endPTS-Pt.startPTS),S.timescale||(v.logger.warn("regenerate InitSegment as video detected"),this.generateIS(D,S,W)),this.remuxVideo(S,st,X,pt,K)}}else if(ct){var Ht=this.remuxVideo(S,st,X,0,K);Ht&&D.codec&&this.remuxEmptyAudio(D,ft,X,Ht)}}A.samples.length&&this.remuxID3(A,W),$.samples.length&&this.remuxText($,W),this.observer.trigger(u.default.FRAG_PARSED)},q.generateIS=function(D,S,A){var $=this.observer,W=D.samples,X=S.samples,K=this.typeSupported,ot="audio/mp4",ct={},ft={tracks:ct},st=this._initPTS===void 0,wt,Pt;if(st&&(wt=Pt=1/0),D.config&&W.length&&(D.timescale=D.samplerate,v.logger.log("audio sampling rate : "+D.samplerate),D.isAAC||(K.mpeg?(ot="audio/mpeg",D.codec=""):K.mp3&&(D.codec="mp3")),ct.audio={container:ot,codec:D.codec,initSegment:!D.isAAC&&K.mpeg?new Uint8Array:Er.initSegment([D]),metadata:{channelCount:D.channelCount}},st&&(wt=Pt=W[0].pts-D.inputTimeScale*A)),S.sps&&S.pps&&X.length){var pt=S.inputTimeScale;S.timescale=pt,ct.video={container:"video/mp4",codec:S.codec,initSegment:Er.initSegment([S]),metadata:{width:S.width,height:S.height}},st&&(wt=Math.min(wt,X[0].pts-pt*A),Pt=Math.min(Pt,X[0].dts-pt*A),this.observer.trigger(u.default.INIT_PTS_FOUND,{initPTS:wt}))}Object.keys(ct).length?($.trigger(u.default.FRAG_PARSING_INIT_SEGMENT,ft),this.ISGenerated=!0,st&&(this._initPTS=wt,this._initDTS=Pt)):$.trigger(u.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},q.remuxVideo=function(D,S,A,$,W){var X=8,K,ot,ct,ft,st,wt,Pt,pt=D.timescale,Ht=D.samples,Xt=[],ve=Ht.length,en=this._PTSNormalize,Cn=this._initPTS,Te=this.nextAvcDts,mn=this.isSafari;if(ve!==0){mn&&(A|=Ht.length&&Te&&(W&&Math.abs(S-Te/pt)<.1||Math.abs(Ht[0].pts-Te-Cn)1?v.logger.log("AVC: "+zt(Tn,!0)+" ms hole between fragments detected,filling it"):Tn<-1&&v.logger.log("AVC: "+zt(-Tn,!0)+" ms overlapping between fragments detected"),st=Te,Ht[0].dts=st,ft=Math.max(ft-Tn,Te),Ht[0].pts=ft,v.logger.log("Video: PTS/DTS adjusted: "+zt(ft,!0)+"/"+zt(st,!0)+", delta: "+zt(Tn,!0)+" ms")),Ge=Ht[Ht.length-1],Pt=Math.max(Ge.dts,0),wt=Math.max(Ge.pts,0,Pt),mn&&(K=Math.round((Pt-st)/(Ht.length-1)));for(var Qn=0,_r=0,Ur=0;Ur0?Vr-1:Vr].dts;if(ei.stretchShortVideoTrack){var Fo=ei.maxBufferHole,Zf=Math.floor(Fo*pt),wl=($?ft+$*pt:this.nextAudioPts)-Cr.pts;wl>Zf?(K=wl-fu,K<0&&(K=fu),v.logger.log("It is approximately "+zt(wl,!1)+" ms to the next segment; using duration "+zt(K,!1)+" ms for the last video frame.")):K=fu}else K=fu}wo=Math.round(Cr.pts-Cr.dts)}Xt.push({size:Qa,duration:K,cts:wo,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:Cr.key?2:1,isNonSync:Cr.key?0:1}})}this.nextAvcDts=Pt+K;var Ac=D.dropped;if(D.nbNalu=0,D.dropped=0,Xt.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var xc=Xt[0].flags;xc.dependsOn=2,xc.isNonSync=0}D.samples=Xt,ct=Er.moof(D.sequenceNumber++,st,D),D.samples=[];var Co={data1:ct,data2:ot,startPTS:ft/pt,endPTS:(wt+K)/pt,startDTS:st/pt,endDTS:this.nextAvcDts/pt,type:"video",hasAudio:!1,hasVideo:!0,nb:Xt.length,dropped:Ac};return this.observer.trigger(u.default.FRAG_PARSING_DATA,Co),Co}},q.remuxAudio=function(D,S,A,$){var W=D.inputTimeScale,X=D.timescale,K=W/X,ot=D.isAAC?1024:1152,ct=ot*K,ft=this._PTSNormalize,st=this._initPTS,wt=!D.isAAC&&this.typeSupported.mpeg,Pt,pt,Ht,Xt,ve,en,Cn=wt?0:8,Te=D.samples,mn=[],Oe=this.nextAudioPts;if(A|=Te.length&&Oe&&($&&Math.abs(S-Oe/W)<.1||Math.abs(Te[0].pts-Oe-st)<20*ct),Te.forEach(function(Fo){Fo.pts=Fo.dts=ft(Fo.pts-st,S*W)}),Te=Te.filter(function(Fo){return Fo.pts>=0}),Te.length!==0){if(A||($?Oe=S*W:Oe=Te[0].pts),D.isAAC)for(var xn=this.config.maxAudioFramesDrift,Ge=0,Tn=Oe;Ge=xn*ct&&_r.1*ct,Qn.pts=Qn.dts=Tn,Tn+=ct,Ge++}for(var qn=Te.length,Fr=0;qn--;)Fr+=Te[qn].unit.byteLength;for(var ya=0,Ra=Te.length;ya0&&Qa0&&(pt=bn.getSilentFrame(D.manifestCodec||D.codec,D.channelCount),pt||(pt=Cr.subarray()),Fr+=wo*pt.length);else if(Qa<-12){v.logger.log("drop overlapping AAC sample, expected/parsed/delta: "+zt(Oe,!0)+" ms / "+zt(Na,!0)+" ms / "+zt(-Qa,!0)+" ms"),Fr-=Cr.byteLength;continue}Na=Oe}if(ve=Na,Fr>0){Fr+=Cn;try{Ht=new Uint8Array(Fr)}catch{this.observer.trigger(u.default.ERROR,{type:c.ErrorTypes.MUX_ERROR,details:c.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Fr,reason:"fail allocating audio mdat "+Fr});return}if(!wt){var Lu=new DataView(Ht.buffer);Lu.setUint32(0,Fr),Ht.set(Er.types.mdat,4)}}else return;for(var ti=0;ti=2&&(lu=mn[qn-2].duration,Pt.duration=lu),qn){this.nextAudioPts=Oe=en+K*lu,D.samples=mn,wt?Xt=new Uint8Array:Xt=Er.moof(D.sequenceNumber++,ve/K,D),D.samples=[];var cu=ve/W,ei=Oe/W,fu={data1:Xt,data2:Ht,startPTS:cu,endPTS:ei,startDTS:cu,endDTS:ei,type:"audio",hasAudio:!0,hasVideo:!1,nb:qn};return this.observer.trigger(u.default.FRAG_PARSING_DATA,fu),fu}return null}},q.remuxEmptyAudio=function(D,S,A,$){var W=D.inputTimeScale,X=D.samplerate?D.samplerate:W,K=W/X,ot=this.nextAudioPts,ct=(ot!==void 0?ot:$.startDTS*W)+this._initDTS,ft=$.endDTS*W+this._initDTS,st=1024,wt=K*st,Pt=Math.ceil((ft-ct)/wt),pt=bn.getSilentFrame(D.manifestCodec||D.codec,D.channelCount);if(v.logger.warn("remux empty Audio"),!pt){v.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");return}for(var Ht=[],Xt=0;Xt4294967296;)D+=A;return D},O})(),Qe=De,An=(function(){function O(L){this.observer=L}var q=O.prototype;return q.destroy=function(){},q.resetTimeStamp=function(){},q.resetInitSegment=function(){},q.remux=function(D,S,A,$,W,X,K,ot){var ct=this.observer,ft="";D&&(ft+="audio"),S&&(ft+="video"),ct.trigger(u.default.FRAG_PARSING_DATA,{data1:ot,startPTS:W,startDTS:W,type:ft,hasAudio:!!D,hasVideo:!!S,nb:1,dropped:0}),ct.trigger(u.default.FRAG_PARSED)},O})(),oe=An,Pe=Object(g.getSelfScope)(),wr;try{wr=Pe.performance.now.bind(Pe.performance)}catch{v.logger.debug("Unable to use Performance API on this environment"),wr=Pe.Date.now}var Je=(function(){function O(L,D,S,A){this.observer=L,this.typeSupported=D,this.config=S,this.vendor=A}var q=O.prototype;return q.destroy=function(){var D=this.demuxer;D&&D.destroy()},q.push=function(D,S,A,$,W,X,K,ot,ct,ft,st,wt){var Pt=this;if(D.byteLength>0&&S!=null&&S.key!=null&&S.method==="AES-128"){var pt=this.decrypter;pt==null&&(pt=this.decrypter=new m.default(this.observer,this.config));var Ht=wr();pt.decrypt(D,S.key.buffer,S.iv.buffer,function(Xt){var ve=wr();Pt.observer.trigger(u.default.FRAG_DECRYPTED,{stats:{tstart:Ht,tdecrypt:ve}}),Pt.pushDecrypted(new Uint8Array(Xt),S,new Uint8Array(A),$,W,X,K,ot,ct,ft,st,wt)})}else this.pushDecrypted(new Uint8Array(D),S,new Uint8Array(A),$,W,X,K,ot,ct,ft,st,wt)},q.pushDecrypted=function(D,S,A,$,W,X,K,ot,ct,ft,st,wt){var Pt=this.demuxer;if(!Pt||(K||ot)&&!this.probe(D)){for(var pt=this.observer,Ht=this.typeSupported,Xt=this.config,ve=[{demux:ln,remux:Qe},{demux:mt.default,remux:oe},{demux:nt,remux:Qe},{demux:vn,remux:Qe}],en=0,Cn=ve.length;en1?U-1:0),Q=1;Q1?U-1:0),Q=1;Q0)return y.subarray(x,x+C)},g._readSize=function(y,E){var x=0;return x=(y[E]&127)<<21,x|=(y[E+1]&127)<<14,x|=(y[E+2]&127)<<7,x|=y[E+3]&127,x},g.getTimeStamp=function(y){for(var E=g.getID3Frames(y),x=0;x>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:et+=String.fromCharCode(B);break;case 12:case 13:Q=y[at++],et+=String.fromCharCode((B&31)<<6|Q&63);break;case 14:Q=y[at++],z=y[at++],et+=String.fromCharCode((B&15)<<12|(Q&63)<<6|(z&63)<<0);break;default:}}return et},g})(),m;function w(){var g=Object(u.getSelfScope)();return!m&&typeof g.TextDecoder<"u"&&(m=new g.TextDecoder("utf-8")),m}var v=c._utf8ArrayToStr;n.default=c}),"./src/demux/mp4demuxer.js":(function(t,n,a){"use strict";a.r(n);var u=a("./src/utils/logger.js"),c=a("./src/events.js"),m=Math.pow(2,32)-1,w=(function(){function v(k,y){this.observer=k,this.remuxer=y}var g=v.prototype;return g.resetTimeStamp=function(y){this.initPTS=y},g.resetInitSegment=function(y,E,x,C){if(y&&y.byteLength){var M=this.initData=v.parseInitSegment(y);E==null&&(E="mp4a.40.5"),x==null&&(x="avc1.42e01e");var U={};M.audio&&M.video?U.audiovideo={container:"video/mp4",codec:E+","+x,initSegment:C?y:null}:(M.audio&&(U.audio={container:"audio/mp4",codec:E,initSegment:C?y:null}),M.video&&(U.video={container:"video/mp4",codec:x,initSegment:C?y:null})),this.observer.trigger(c.default.FRAG_PARSING_INIT_SEGMENT,{tracks:U})}else E&&(this.audioCodec=E),x&&(this.videoCodec=x)},v.probe=function(y){return v.findBox({data:y,start:0,end:Math.min(y.length,16384)},["moof"]).length>0},v.bin2str=function(y){return String.fromCharCode.apply(null,y)},v.readUint16=function(y,E){y.data&&(E+=y.start,y=y.data);var x=y[E]<<8|y[E+1];return x<0?65536+x:x},v.readUint32=function(y,E){y.data&&(E+=y.start,y=y.data);var x=y[E]<<24|y[E+1]<<16|y[E+2]<<8|y[E+3];return x<0?4294967296+x:x},v.writeUint32=function(y,E,x){y.data&&(E+=y.start,y=y.data),y[E]=x>>24,y[E+1]=x>>16&255,y[E+2]=x>>8&255,y[E+3]=x&255},v.findBox=function(y,E){var x=[],C,M,U,B,Q,z,et;if(y.data?(z=y.start,B=y.end,y=y.data):(z=0,B=y.byteLength),!E.length)return null;for(C=z;C1?C+M:B,U===E[0]&&(E.length===1?x.push({data:y,start:C+8,end:et}):(Q=v.findBox({data:y,start:C+8,end:et},E.slice(1)),Q.length&&(x=x.concat(Q)))),C=et;return x},v.parseSegmentIndex=function(y){var E=v.findBox(y,["moov"])[0],x=E?E.end:null,C=0,M=v.findBox(y,["sidx"]),U;if(!M||!M[0])return null;U=[],M=M[0];var B=M.data[0];C=B===0?8:16;var Q=v.readUint32(M,C);C+=4;var z=0,et=0;B===0?C+=8:C+=16,C+=2;var at=M.end+et,nt=v.readUint16(M,C);C+=2;for(var mt=0;mt>>31;if(fe===1){console.warn("SIDX has hierarchical references (not supported)");return}var In=v.readUint32(M,_t);_t+=4,U.push({referenceSize:le,subsegmentDuration:In,info:{duration:In/Q,start:at,end:at+le-1}}),at+=le,_t+=4,C=_t}return{earliestPresentationTime:z,timescale:Q,version:B,referencesCount:nt,references:U,moovEndOffset:x}},v.parseInitSegment=function(y){var E=[],x=v.findBox(y,["moov","trak"]);return x.forEach(function(C){var M=v.findBox(C,["tkhd"])[0];if(M){var U=M.data[M.start],B=U===0?12:20,Q=v.readUint32(M,B),z=v.findBox(C,["mdia","mdhd"])[0];if(z){U=z.data[z.start],B=U===0?12:20;var et=v.readUint32(z,B),at=v.findBox(C,["mdia","hdlr"])[0];if(at){var nt=v.bin2str(at.data.subarray(at.start+8,at.start+12)),mt={soun:"audio",vide:"video"}[nt];if(mt){var _t=v.findBox(C,["mdia","minf","stbl","stsd"]);if(_t.length){_t=_t[0];var ne=v.bin2str(_t.data.subarray(_t.start+12,_t.start+16));u.logger.log("MP4Demuxer:"+mt+":"+ne+" found")}E[Q]={timescale:et,type:mt},E[mt]={timescale:et,id:Q}}}}}}),E},v.getStartDTS=function(y,E){var x,C,M;return x=v.findBox(E,["moof","traf"]),C=[].concat.apply([],x.map(function(U){return v.findBox(U,["tfhd"]).map(function(B){var Q,z,et;return Q=v.readUint32(B,4),z=y[Q].timescale||9e4,et=v.findBox(U,["tfdt"]).map(function(at){var nt,mt;return nt=at.data[at.start],mt=v.readUint32(at,4),nt===1&&(mt*=Math.pow(2,32),mt+=v.readUint32(at,8)),mt})[0],et/z})})),M=Math.min.apply(null,C),isFinite(M)?M:0},v.offsetStartDTS=function(y,E,x){v.findBox(E,["moof","traf"]).map(function(C){return v.findBox(C,["tfhd"]).map(function(M){var U=v.readUint32(M,4),B=y[U].timescale||9e4;v.findBox(C,["tfdt"]).map(function(Q){var z=Q.data[Q.start],et=v.readUint32(Q,4);if(z===0)v.writeUint32(Q,4,et-x*B);else{et*=Math.pow(2,32),et+=v.readUint32(Q,8),et-=x*B,et=Math.max(et,0);var at=Math.floor(et/(m+1)),nt=Math.floor(et%(m+1));v.writeUint32(Q,4,at),v.writeUint32(Q,8,nt)}})})})},g.append=function(y,E,x,C){var M=this.initData;M||(this.resetInitSegment(y,this.audioCodec,this.videoCodec,!1),M=this.initData);var U,B=this.initPTS;if(B===void 0){var Q=v.getStartDTS(M,y);this.initPTS=B=Q-E,this.observer.trigger(c.default.INIT_PTS_FOUND,{initPTS:B})}v.offsetStartDTS(M,y,B),U=v.getStartDTS(M,y),this.remuxer.remux(M.audio,M.video,null,null,U,x,C,y)},g.destroy=function(){},v})();n.default=w}),"./src/errors.ts":(function(t,n,a){"use strict";a.r(n),a.d(n,"ErrorTypes",function(){return u}),a.d(n,"ErrorDetails",function(){return c});var u;(function(m){m.NETWORK_ERROR="networkError",m.MEDIA_ERROR="mediaError",m.KEY_SYSTEM_ERROR="keySystemError",m.MUX_ERROR="muxError",m.OTHER_ERROR="otherError"})(u||(u={}));var c;(function(m){m.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",m.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",m.KEY_SYSTEM_NO_SESSION="keySystemNoSession",m.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",m.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",m.MANIFEST_LOAD_ERROR="manifestLoadError",m.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",m.MANIFEST_PARSING_ERROR="manifestParsingError",m.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",m.LEVEL_LOAD_ERROR="levelLoadError",m.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",m.LEVEL_SWITCH_ERROR="levelSwitchError",m.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",m.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",m.FRAG_LOAD_ERROR="fragLoadError",m.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",m.FRAG_DECRYPT_ERROR="fragDecryptError",m.FRAG_PARSING_ERROR="fragParsingError",m.REMUX_ALLOC_ERROR="remuxAllocError",m.KEY_LOAD_ERROR="keyLoadError",m.KEY_LOAD_TIMEOUT="keyLoadTimeOut",m.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",m.BUFFER_APPEND_ERROR="bufferAppendError",m.BUFFER_APPENDING_ERROR="bufferAppendingError",m.BUFFER_STALLED_ERROR="bufferStalledError",m.BUFFER_FULL_ERROR="bufferFullError",m.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",m.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",m.INTERNAL_EXCEPTION="internalException"})(c||(c={}))}),"./src/events.js":(function(t,n,a){"use strict";a.r(n);var u={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=u}),"./src/hls.ts":(function(t,n,a){"use strict";a.r(n);var u={};a.r(u),a.d(u,"newCue",function(){return bh});var c=a("./node_modules/url-toolkit/src/url-toolkit.js"),m=a("./src/errors.ts"),w=a("./src/polyfills/number-isFinite.js"),v=a("./src/events.js"),g=a("./src/utils/logger.js"),k={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},y=(function(){function h(i){this.hls=void 0,this.handledEvents=void 0,this.useGenericHandler=void 0,this.hls=i,this.onEvent=this.onEvent.bind(this);for(var o=arguments.length,e=new Array(o>1?o-1:0),r=1;r>8*(15-r)&255;return e},d.setDecryptDataFromLevelKey=function(o,e){var r=o;return o&&o.method&&o.uri&&!o.iv&&(r=new Q(o.baseuri,o.reluri),r.method=o.method,r.iv=this.createInitializationVector(e)),r},et(h,[{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=Object(c.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&&g.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(w.isFiniteNumber)(this.programDateTime))return null;var o=Object(w.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)}}]),h})();function mt(h,d){for(var i=0;iNumber.MAX_SAFE_INTEGER?1/0:e},d.hexadecimalInteger=function(o){if(this[o]){var e=(this[o]||"0x").slice(2);e=(e.length&1?"0":"")+e;for(var r=new Uint8Array(e.length/2),l=0;lNumber.MAX_SAFE_INTEGER?1/0:e},d.decimalFloatingPoint=function(o){return parseFloat(this[o])},d.enumeratedString=function(o){return this[o]},d.decimalResolution=function(o){var e=le.exec(this[o]);if(e!==null)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},h.parseAttrList=function(o){var e,r={};for(fe.lastIndex=0;(e=fe.exec(o))!==null;){var l=e[2],_='"';l.indexOf(_)===0&&l.lastIndexOf(_)===l.length-1&&(l=l.slice(1,-1)),r[e[1]]=l}return r},h})(),Pn=In,Fe={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 Be(h,d){var i=Fe[d];return!!i&&i[h.slice(0,4)]===!0}function ln(h,d){return MediaSource.isTypeSupported((d||"video")+'/mp4;codecs="'+h+'"')}var Fn=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,vn=/#EXT-X-MEDIA:(.*)/g,Xe=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),bn=/(?:(?:#(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?/,rn=/\.(mp4|m4s|m4v|m4a)$/i,Le=(function(){function h(){}return h.findGroup=function(i,o){for(var e=0;e2?(e=o.shift()+".",e+=parseInt(o.shift()).toString(16),e+=("000"+parseInt(o.shift()).toString(16)).substr(-4)):e=i,e},h.resolve=function(i,o){return c.buildAbsoluteURL(o,i,{alwaysNormalize:!0})},h.parseMasterPlaylist=function(i,o){var e=[];Fn.lastIndex=0;function r(I,P){["video","audio"].forEach(function(N){var j=I.filter(function(vt){return Be(vt,N)});if(j.length){var it=j.filter(function(vt){return vt.lastIndexOf("avc1",0)===0||vt.lastIndexOf("mp4a",0)===0});P[N+"Codec"]=it.length>0?it[0]:j[0],I=I.filter(function(vt){return j.indexOf(vt)===-1})}}),P.unknownCodecs=I}for(var l;(l=Fn.exec(i))!=null;){var _={},R=_.attrs=new Pn(l[1]);_.url=h.resolve(l[2],o);var b=R.decimalResolution("RESOLUTION");b&&(_.width=b.width,_.height=b.height),_.bitrate=R.decimalInteger("AVERAGE-BANDWIDTH")||R.decimalInteger("BANDWIDTH"),_.name=R.NAME,r([].concat((R.CODECS||"").split(/[ ,]+/)),_),_.videoCodec&&_.videoCodec.indexOf("avc1")!==-1&&(_.videoCodec=h.convertAVC1ToAVCOTI(_.videoCodec)),e.push(_)}return e},h.parseMasterPlaylistMedia=function(i,o,e,r){r===void 0&&(r=[]);var l,_=[],R=0;for(vn.lastIndex=0;(l=vn.exec(i))!==null;){var b=new Pn(l[1]);if(b.TYPE===e){var I={id:R++,groupId:b["GROUP-ID"],name:b.NAME||b.LANGUAGE,type:e,default:b.DEFAULT==="YES",autoselect:b.AUTOSELECT==="YES",forced:b.FORCED==="YES",lang:b.LANGUAGE};if(b.URI&&(I.url=h.resolve(b.URI,o)),r.length){var P=h.findGroup(r,I.groupId);I.audioCodec=P?P.codec:r[0].codec}_.push(I)}}return _},h.parseLevelPlaylist=function(i,o,e,r,l){var _=0,R=0,b=new ne(o),I=0,P=null,N=new nt,j,it,vt,Mt=null;for(Xe.lastIndex=0;(j=Xe.exec(i))!==null;){var se=j[1];if(se){N.duration=parseFloat(se);var re=(" "+j[2]).slice(1);N.title=re||null,N.tagList.push(re?["INF",se,re]:["INF",se])}else if(j[3]){if(Object(w.isFiniteNumber)(N.duration)){var ce=_++;N.type=r,N.start=R,vt&&(N.levelkey=vt),N.sn=ce,N.level=e,N.cc=I,N.urlId=l,N.baseurl=o,N.relurl=(" "+j[3]).slice(1),gt(N,P),b.fragments.push(N),P=N,R+=N.duration,N=new nt}}else if(j[4]){var Re=(" "+j[4]).slice(1);P?N.setByteRange(Re,P):N.setByteRange(Re)}else if(j[5])N.rawProgramDateTime=(" "+j[5]).slice(1),N.tagList.push(["PROGRAM-DATE-TIME",N.rawProgramDateTime]),Mt===null&&(Mt=b.fragments.length);else{if(j=j[0].match(bn),!j){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(it=1;it=0&&(vt.method=cn,vt.key=null,vt.iv=Ue));break}case"START":{var Yr=new Pn(We),$c=Yr.decimalFloatingPoint("TIME-OFFSET");Object(w.isFiniteNumber)($c)&&(b.startTimeOffset=$c);break}case"MAP":{var Wc=new Pn(We);N.relurl=Wc.URI,Wc.BYTERANGE&&N.setByteRange(Wc.BYTERANGE),N.baseurl=o,N.level=e,N.type=r,N.sn="initSegment",b.initSegment=N,N=new nt,N.rawProgramDateTime=b.initSegment.rawProgramDateTime;break}default:g.logger.warn("line parsed but not handled: "+j);break}}}return N=P,N&&!N.relurl&&(b.fragments.pop(),R-=N.duration),b.totalduration=R,b.averagetargetduration=R/b.fragments.length,b.endSN=_-1,b.startCC=b.fragments[0]?b.fragments[0].cc:0,b.endCC=I,!b.initSegment&&b.fragments.length&&b.fragments.every(function(qh){return rn.test(qh.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),N=new nt,N.relurl=b.fragments[0].relurl,N.baseurl=o,N.level=e,N.type=r,N.sn="initSegment",b.initSegment=N,b.needSidxRanges=!0),Mt&&Er(b.fragments,Mt),b},h})();function Er(h,d){for(var i=h[d],o=d-1;o>=0;o--){var e=h[o];e.programDateTime=i.programDateTime-e.duration*1e3,i=e}}function gt(h,d){h.rawProgramDateTime?h.programDateTime=Date.parse(h.rawProgramDateTime):d&&d.programDateTime&&(h.programDateTime=d.endProgramDateTime),Object(w.isFiniteNumber)(h.programDateTime)||(h.programDateTime=null,h.rawProgramDateTime=null)}function Ne(h,d){h.prototype=Object.create(d.prototype),h.prototype.constructor=h,h.__proto__=d}var an=window,zt=an.performance,Bt=(function(h){Ne(d,h);function d(o){var e;return e=h.call(this,o,v.default.MANIFEST_LOADING,v.default.LEVEL_LOADING,v.default.AUDIO_TRACK_LOADING,v.default.SUBTITLE_TRACK_LOADING)||this,e.loaders={},e}d.canHaveQualityLevels=function(e){return e!==x.AUDIO_TRACK&&e!==x.SUBTITLE_TRACK},d.mapContextToLevelType=function(e){var r=e.type;switch(r){case x.AUDIO_TRACK:return C.AUDIO;case x.SUBTITLE_TRACK:return C.SUBTITLE;default:return C.MAIN}},d.getResponseUrl=function(e,r){var l=e.url;return(l===void 0||l.indexOf("data:")===0)&&(l=r.url),l};var i=d.prototype;return i.createInternalLoader=function(e){var r=this.hls.config,l=r.pLoader,_=r.loader,R=l||_,b=new R(r);return e.loader=b,this.loaders[e.type]=b,b},i.getInternalLoader=function(e){return this.loaders[e.type]},i.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},i.destroyInternalLoaders=function(){for(var e in this.loaders){var r=this.loaders[e];r&&r.destroy(),this.resetInternalLoader(e)}},i.destroy=function(){this.destroyInternalLoaders(),h.prototype.destroy.call(this)},i.onManifestLoading=function(e){this.load({url:e.url,type:x.MANIFEST,level:0,id:null,responseType:"text"})},i.onLevelLoading=function(e){this.load({url:e.url,type:x.LEVEL,level:e.level,id:e.id,responseType:"text"})},i.onAudioTrackLoading=function(e){this.load({url:e.url,type:x.AUDIO_TRACK,level:null,id:e.id,responseType:"text"})},i.onSubtitleTrackLoading=function(e){this.load({url:e.url,type:x.SUBTITLE_TRACK,level:null,id:e.id,responseType:"text"})},i.load=function(e){var r=this.hls.config;g.logger.debug("Loading playlist of type "+e.type+", level: "+e.level+", id: "+e.id);var l=this.getInternalLoader(e);if(l){var _=l.context;if(_&&_.url===e.url)return g.logger.trace("playlist request ongoing"),!1;g.logger.warn("aborting previous loader for type: "+e.type),l.abort()}var R,b,I,P;switch(e.type){case x.MANIFEST:R=r.manifestLoadingMaxRetry,b=r.manifestLoadingTimeOut,I=r.manifestLoadingRetryDelay,P=r.manifestLoadingMaxRetryTimeout;break;case x.LEVEL:R=0,P=0,I=0,b=r.levelLoadingTimeOut;break;default:R=r.levelLoadingMaxRetry,b=r.levelLoadingTimeOut,I=r.levelLoadingRetryDelay,P=r.levelLoadingMaxRetryTimeout;break}l=this.createInternalLoader(e);var N={timeout:b,maxRetry:R,retryDelay:I,maxRetryDelay:P},j={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return g.logger.debug("Calling internal loader delegate for URL: "+e.url),l.load(e,N,j),!0},i.loadsuccess=function(e,r,l,_){if(_===void 0&&(_=null),l.isSidxRequest){this._handleSidxRequest(e,l),this._handlePlaylistLoaded(e,r,l,_);return}if(this.resetInternalLoader(l.type),typeof e.data!="string")throw new Error('expected responseType of "text" for PlaylistLoader');var R=e.data;if(r.tload=zt.now(),R.indexOf("#EXTM3U")!==0){this._handleManifestParsingError(e,l,"no EXTM3U delimiter",_);return}R.indexOf("#EXTINF:")>0||R.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(e,r,l,_):this._handleMasterPlaylist(e,r,l,_)},i.loaderror=function(e,r,l){l===void 0&&(l=null),this._handleNetworkError(r,l,!1,e)},i.loadtimeout=function(e,r,l){l===void 0&&(l=null),this._handleNetworkError(r,l,!0)},i._handleMasterPlaylist=function(e,r,l,_){var R=this.hls,b=e.data,I=d.getResponseUrl(e,l),P=Le.parseMasterPlaylist(b,I);if(!P.length){this._handleManifestParsingError(e,l,"no level found in manifest",_);return}var N=P.map(function(Mt){return{id:Mt.attrs.AUDIO,codec:Mt.audioCodec}}),j=Le.parseMasterPlaylistMedia(b,I,"AUDIO",N),it=Le.parseMasterPlaylistMedia(b,I,"SUBTITLES");if(j.length){var vt=!1;j.forEach(function(Mt){Mt.url||(vt=!0)}),vt===!1&&P[0].audioCodec&&!P[0].attrs.AUDIO&&(g.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),j.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1}))}R.trigger(v.default.MANIFEST_LOADED,{levels:P,audioTracks:j,subtitles:it,url:I,stats:r,networkDetails:_})},i._handleTrackOrLevelPlaylist=function(e,r,l,_){var R=this.hls,b=l.id,I=l.level,P=l.type,N=d.getResponseUrl(e,l),j=Object(w.isFiniteNumber)(b)?b:0,it=Object(w.isFiniteNumber)(I)?I:j,vt=d.mapContextToLevelType(l),Mt=Le.parseLevelPlaylist(e.data,N,it,vt,j);if(Mt.tload=r.tload,P===x.MANIFEST){var se={url:N,details:Mt};R.trigger(v.default.MANIFEST_LOADED,{levels:[se],audioTracks:[],url:N,stats:r,networkDetails:_})}if(r.tparsed=zt.now(),Mt.needSidxRanges){var re=Mt.initSegment.url;this.load({url:re,isSidxRequest:!0,type:P,level:I,levelDetails:Mt,id:b,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"});return}l.levelDetails=Mt,this._handlePlaylistLoaded(e,r,l,_)},i._handleSidxRequest=function(e,r){if(typeof e.data=="string")throw new Error("sidx request must be made with responseType of array buffer");var l=M.default.parseSegmentIndex(new Uint8Array(e.data));if(l){var _=l.references,R=r.levelDetails;_.forEach(function(b,I){var P=b.info;if(R){var N=R.fragments[I];N.byteRange.length===0&&N.setByteRange(String(1+P.end-P.start)+"@"+String(P.start))}}),R&&R.initSegment.setByteRange(String(l.moovEndOffset)+"@0")}},i._handleManifestParsingError=function(e,r,l,_){this.hls.trigger(v.default.ERROR,{type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:e.url,reason:l,networkDetails:_})},i._handleNetworkError=function(e,r,l,_){l===void 0&&(l=!1),_===void 0&&(_=null),g.logger.info("A network error occured while loading a "+e.type+"-type playlist");var R,b,I=this.getInternalLoader(e);switch(e.type){case x.MANIFEST:R=l?m.ErrorDetails.MANIFEST_LOAD_TIMEOUT:m.ErrorDetails.MANIFEST_LOAD_ERROR,b=!0;break;case x.LEVEL:R=l?m.ErrorDetails.LEVEL_LOAD_TIMEOUT:m.ErrorDetails.LEVEL_LOAD_ERROR,b=!1;break;case x.AUDIO_TRACK:R=l?m.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:m.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,b=!1;break;default:b=!1}I&&(I.abort(),this.resetInternalLoader(e.type));var P={type:m.ErrorTypes.NETWORK_ERROR,details:R,fatal:b,url:e.url,loader:I,context:e,networkDetails:r};_&&(P.response=_),this.hls.trigger(v.default.ERROR,P)},i._handlePlaylistLoaded=function(e,r,l,_){var R=l.type,b=l.level,I=l.id,P=l.levelDetails;if(!P||!P.targetduration){this._handleManifestParsingError(e,l,"invalid target duration",_);return}var N=d.canHaveQualityLevels(l.type);if(N)this.hls.trigger(v.default.LEVEL_LOADED,{details:P,level:b||0,id:I||0,stats:r,networkDetails:_});else switch(R){case x.AUDIO_TRACK:this.hls.trigger(v.default.AUDIO_TRACK_LOADED,{details:P,id:I,stats:r,networkDetails:_});break;case x.SUBTITLE_TRACK:this.hls.trigger(v.default.SUBTITLE_TRACK_LOADED,{details:P,id:I,stats:r,networkDetails:_});break}},d})(E),Dt=Bt;function be(h,d){h.prototype=Object.create(d.prototype),h.prototype.constructor=h,h.__proto__=d}var De=(function(h){be(d,h);function d(o){var e;return e=h.call(this,o,v.default.FRAG_LOADING)||this,e.loaders={},e}var i=d.prototype;return i.destroy=function(){var e=this.loaders;for(var r in e){var l=e[r];l&&l.destroy()}this.loaders={},h.prototype.destroy.call(this)},i.onFragLoading=function(e){var r=e.frag,l=r.type,_=this.loaders,R=this.hls.config,b=R.fLoader,I=R.loader;r.loaded=0;var P=_[l];P&&(g.logger.warn("abort previous fragment loader for type: "+l),P.abort()),P=_[l]=r.loader=R.fLoader?new b(R):new I(R);var N,j,it;N={url:r.url,frag:r,responseType:"arraybuffer",progressData:!1};var vt=r.byteRangeStartOffset,Mt=r.byteRangeEndOffset;Object(w.isFiniteNumber)(vt)&&Object(w.isFiniteNumber)(Mt)&&(N.rangeStart=vt,N.rangeEnd=Mt),j={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout},it={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},P.load(N,j,it)},i.loadsuccess=function(e,r,l,_){_===void 0&&(_=null);var R=e.data,b=l.frag;b.loader=void 0,this.loaders[b.type]=void 0,this.hls.trigger(v.default.FRAG_LOADED,{payload:R,frag:b,stats:r,networkDetails:_})},i.loaderror=function(e,r,l){l===void 0&&(l=null);var _=r.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(v.default.ERROR,{type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:r.frag,response:e,networkDetails:l})},i.loadtimeout=function(e,r,l){l===void 0&&(l=null);var _=r.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(v.default.ERROR,{type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:r.frag,networkDetails:l})},i.loadprogress=function(e,r,l,_){_===void 0&&(_=null);var R=r.frag;R.loaded=e.loaded,this.hls.trigger(v.default.FRAG_LOAD_PROGRESS,{frag:R,stats:e,networkDetails:_})},d})(E),Qe=De;function An(h,d){h.prototype=Object.create(d.prototype),h.prototype.constructor=h,h.__proto__=d}var oe=(function(h){An(d,h);function d(o){var e;return e=h.call(this,o,v.default.KEY_LOADING)||this,e.loaders={},e.decryptkey=null,e.decrypturl=null,e}var i=d.prototype;return i.destroy=function(){for(var e in this.loaders){var r=this.loaders[e];r&&r.destroy()}this.loaders={},h.prototype.destroy.call(this)},i.onKeyLoading=function(e){var r=e.frag,l=r.type,_=this.loaders[l];if(!r.decryptdata){g.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var R=r.decryptdata.uri;if(R!==this.decrypturl||this.decryptkey===null){var b=this.hls.config;if(_&&(g.logger.warn("abort previous key loader for type:"+l),_.abort()),!R){g.logger.warn("key uri is falsy");return}r.loader=this.loaders[l]=new b.loader(b),this.decrypturl=R,this.decryptkey=null;var I={url:R,frag:r,responseType:"arraybuffer"},P={timeout:b.fragLoadingTimeOut,maxRetry:0,retryDelay:b.fragLoadingRetryDelay,maxRetryDelay:b.fragLoadingMaxRetryTimeout},N={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};r.loader.load(I,P,N)}else this.decryptkey&&(r.decryptdata.key=this.decryptkey,this.hls.trigger(v.default.KEY_LOADED,{frag:r}))},i.loadsuccess=function(e,r,l){var _=l.frag;if(!_.decryptdata){g.logger.error("after key load, decryptdata unset");return}this.decryptkey=_.decryptdata.key=new Uint8Array(e.data),_.loader=void 0,delete this.loaders[_.type],this.hls.trigger(v.default.KEY_LOADED,{frag:_})},i.loaderror=function(e,r){var l=r.frag,_=l.loader;_&&_.abort(),delete this.loaders[l.type],this.hls.trigger(v.default.ERROR,{type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:l,response:e})},i.loadtimeout=function(e,r){var l=r.frag,_=l.loader;_&&_.abort(),delete this.loaders[l.type],this.hls.trigger(v.default.ERROR,{type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:l})},d})(E),Pe=oe;function wr(h,d){h.prototype=Object.create(d.prototype),h.prototype.constructor=h,h.__proto__=d}var Je={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"},Ya=(function(h){wr(d,h);function d(o){var e;return e=h.call(this,o,v.default.BUFFER_APPENDED,v.default.FRAG_BUFFERED,v.default.FRAG_LOADED)||this,e.bufferPadding=.2,e.fragments=Object.create(null),e.timeRanges=Object.create(null),e.config=o.config,e}var i=d.prototype;return i.destroy=function(){this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.config=null,E.prototype.destroy.call(this),h.prototype.destroy.call(this)},i.getBufferedFrag=function(e,r){var l=this.fragments,_=Object.keys(l).filter(function(b){var I=l[b];if(I.body.type!==r||!I.buffered)return!1;var P=I.body;return P.startPTS<=e&&e<=P.endPTS});if(_.length===0)return null;var R=_.pop();return l[R].body},i.detectEvictedFragments=function(e,r){var l=this,_,R;Object.keys(this.fragments).forEach(function(b){var I=l.fragments[b];if(I.buffered===!0){var P=I.range[e];if(P){_=P.time;for(var N=0;N<_.length;N++)if(R=_[N],l.isTimeBuffered(R.startPTS,R.endPTS,r)===!1){l.removeFragment(I.body);break}}}})},i.detectPartialFragments=function(e){var r=this,l=this.getFragmentKey(e),_=this.fragments[l];_&&(_.buffered=!0,Object.keys(this.timeRanges).forEach(function(R){if(e.hasElementaryStream(R)){var b=r.timeRanges[R];_.range[R]=r.getBufferedTimes(e.startPTS,e.endPTS,b)}}))},i.getBufferedTimes=function(e,r,l){for(var _=[],R,b,I=!1,P=0;P=R&&r<=b){_.push({startPTS:Math.max(e,l.start(P)),endPTS:Math.min(r,l.end(P))});break}else if(eR)_.push({startPTS:Math.max(e,l.start(P)),endPTS:Math.min(r,l.end(P))}),I=!0;else if(r<=R)break;return{time:_,partial:I}},i.getFragmentKey=function(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn},i.getPartialFragment=function(e){var r=this,l,_,R,b=null,I=0;return Object.keys(this.fragments).forEach(function(P){var N=r.fragments[P];r.isPartial(N)&&(_=N.body.startPTS-r.bufferPadding,R=N.body.endPTS+r.bufferPadding,e>=_&&e<=R&&(l=Math.min(e-_,R-e),I<=l&&(b=N.body,I=l)))}),b},i.getState=function(e){var r=this.getFragmentKey(e),l=this.fragments[r],_=Je.NOT_LOADED;return l!==void 0&&(l.buffered?this.isPartial(l)===!0?_=Je.PARTIAL:_=Je.OK:_=Je.APPENDING),_},i.isPartial=function(e){return e.buffered===!0&&(e.range.video!==void 0&&e.range.video.partial===!0||e.range.audio!==void 0&&e.range.audio.partial===!0)},i.isTimeBuffered=function(e,r,l){for(var _,R,b=0;b=_&&r<=R)return!0;if(r<=_)return!1}return!1},i.onFragLoaded=function(e){var r=e.frag;!Object(w.isFiniteNumber)(r.sn)||r.bitrateTest||(this.fragments[this.getFragmentKey(r)]={body:r,range:Object.create(null),buffered:!1})},i.onBufferAppended=function(e){var r=this;this.timeRanges=e.timeRanges,Object.keys(this.timeRanges).forEach(function(l){var _=r.timeRanges[l];r.detectEvictedFragments(l,_)})},i.onFragBuffered=function(e){this.detectPartialFragments(e.frag)},i.hasFragment=function(e){var r=this.getFragmentKey(e);return this.fragments[r]!==void 0},i.removeFragment=function(e){var r=this.getFragmentKey(e);delete this.fragments[r]},i.removeAllFragments=function(){this.fragments=Object.create(null)},d})(E),O={search:function(d,i){for(var o=0,e=d.length-1,r=null,l=null;o<=e;){r=(o+e)/2|0,l=d[r];var _=i(l);if(_>0)o=r+1;else if(_<0)e=r-1;else return l}return null}},q=O,L=(function(){function h(){}return h.isBuffered=function(i,o){try{if(i){for(var e=i.buffered,r=0;r=e.start(r)&&o<=e.end(r))return!0}}catch{}return!1},h.bufferInfo=function(i,o,e){try{if(i){var r=i.buffered,l=[],_;for(_=0;_R&&(r[_-1].end=i[l].end):r.push(i[l])}else r.push(i[l])}else r=i;for(var b=0,I,P=o,N=o,j=0;j=it&&o1?r-1:0),_=1;_d?(o.duration=r-o.start,o.duration<0&&g.logger.warn("negative duration computed for frag "+o.sn+",level "+o.level+", there should be some duration drift between playlist and fragment!")):(e.duration=o.start-r,e.duration<0&&g.logger.warn("negative duration computed for frag "+e.sn+",level "+e.level+", there should be some duration drift between playlist and fragment!")):i>d?e.start=o.start+o.duration:e.start=Math.max(o.start-e.duration,0)}function pt(h,d,i,o,e,r){var l=i;if(Object(w.isFiniteNumber)(d.startPTS)){var _=Math.abs(d.startPTS-i);Object(w.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(_,d.deltaPTS):d.deltaPTS=_,l=Math.max(i,d.startPTS),i=Math.min(i,d.startPTS),o=Math.max(o,d.endPTS),e=Math.min(e,d.startDTS),r=Math.max(r,d.endDTS)}var R=i-d.start;d.start=d.startPTS=i,d.maxStartPTS=l,d.endPTS=o,d.startDTS=e,d.endDTS=r,d.duration=o-i;var b=d.sn;if(!h||bh.endSN)return 0;var I,P,N;for(I=b-h.startSN,P=h.fragments,P[I]=d,N=I;N>0;N--)Pt(P,N,N-1);for(N=I;No.length))for(var r=0;rd?-1:0})}function Ge(h,d,i){var o=!1;return d&&d.details&&i&&(i.endCC>i.startCC||h&&h.cc=(e||0))return null;i=i||0;for(var r=0;rh&&i.start?-1:0}function Fr(h,d,i){var o=Math.min(d,i.duration+(i.deltaPTS?i.deltaPTS:0))*1e3,e=i.endProgramDateTime||0;return e-o>h}var ya=250,Ra=2,Vr=.1,Cr=.05,Na=(function(){function h(i,o,e,r){this.config=i,this.media=o,this.fragmentTracker=e,this.hls=r,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1}var d=h.prototype;return d.poll=function(o){var e=this.config,r=this.media,l=this.stalled,_=r.currentTime,R=r.seeking,b=this.seeking&&!R,I=!this.seeking&&R;if(this.seeking=R,_!==o){if(this.moved=!0,l!==null){if(this.stallReported){var P=self.performance.now()-l;g.logger.warn("playback not stuck anymore @"+_+", after "+Math.round(P)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((I||b)&&(this.stalled=null),!(r.paused||r.ended||r.playbackRate===0||!r.buffered.length)){var N=L.bufferInfo(r,_,0),j=N.len>0,it=N.nextStart||0;if(!(!j&&!it)){if(R){var vt=N.len>Ra,Mt=!it||it-_>Ra;if(vt||Mt)return;this.moved=!1}if(!this.moved&&this.stalled){var se=Math.max(it,N.start||0)-_;if(se>0&&se<=Ra){this._trySkipBufferHole(null);return}}var re=self.performance.now();if(l===null){this.stalled=re;return}var ce=re-l;!R&&ce>=ya&&this._reportStall(N.len);var Re=L.bufferInfo(r,_,e.maxBufferHole);this._tryFixBufferStall(Re,ce)}}},d._tryFixBufferStall=function(o,e){var r=this.config,l=this.fragmentTracker,_=this.media,R=_.currentTime,b=l.getPartialFragment(R);if(b){var I=this._trySkipBufferHole(b);if(I)return}o.len>r.maxBufferHole&&e>r.highBufferWatchdogPeriod*1e3&&(g.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},d._reportStall=function(o){var e=this.hls,r=this.media,l=this.stallReported;l||(this.stallReported=!0,g.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer"),e.trigger(v.default.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o}))},d._trySkipBufferHole=function(o){for(var e=this.config,r=this.hls,l=this.media,_=l.currentTime,R=0,b=0;b=R&&_1?r-1:0),_=1;_1&&(this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)),this._tickCallCount=0)},i.doTick=function(){},d})(E);function ti(h,d){h.prototype=Object.create(d.prototype),h.prototype.constructor=h,h.__proto__=d}var rt={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"},lu=(function(h){ti(d,h);function d(){return h.apply(this,arguments)||this}var i=d.prototype;return i.doTick=function(){},i.startLoad=function(){},i.stopLoad=function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragmentTracker.removeFragment(e)),this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=rt.STOPPED},i._streamEnded=function(e,r){var l=this.fragCurrent,_=this.fragmentTracker;if(!r.live&&l&&!l.backtracked&&l.sn===r.endSN&&!e.nextStart){var R=_.getState(l);return R===Je.PARTIAL||R===Je.OK}return!1},i.onMediaSeeking=function(){var e=this.config,r=this.media,l=this.mediaBuffer,_=this.state,R=r?r.currentTime:null,b=L.bufferInfo(l||r,R,this.config.maxBufferHole);if(Object(w.isFiniteNumber)(R)&&g.logger.log("media seeking to "+R.toFixed(3)),_===rt.FRAG_LOADING){var I=this.fragCurrent;if(b.len===0&&I){var P=e.maxFragLookUpTolerance,N=I.start-P,j=I.start+I.duration+P;Rj?(I.loader&&(g.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=rt.IDLE):g.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else _===rt.ENDED&&(b.len===0&&(this.fragPrevious=null,this.fragCurrent=null),this.state=rt.IDLE);r&&(this.lastCurrentTime=R),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=R),this.tick()},i.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},i.onHandlerDestroying=function(){this.stopLoad(),h.prototype.onHandlerDestroying.call(this)},i.onHandlerDestroyed=function(){this.state=rt.STOPPED,this.fragmentTracker=null},i.computeLivePosition=function(e,r){var l=this.config.liveSyncDuration!==void 0?this.config.liveSyncDuration:this.config.liveSyncDurationCount*r.targetduration;return e+Math.max(0,r.totalduration-l)},d})(Lu);function cu(h,d){for(var i=0;i0&&e===-1&&(g.logger.log("override startPosition with lastCurrentTime @"+r.toFixed(3)),e=r),this.state=rt.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=rt.STOPPED},i.stopLoad=function(){this.forceStartLoad=!1,h.prototype.stopLoad.call(this)},i.doTick=function(){switch(this.state){case rt.BUFFER_FLUSHING:this.fragLoadError=0;break;case rt.IDLE:this._doTickIdle();break;case rt.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=rt.IDLE);break;case rt.FRAG_LOADING_WAITING_RETRY:var r=window.performance.now(),l=this.retryDate;(!l||r>=l||this.media&&this.media.seeking)&&(g.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=rt.IDLE);break;case rt.ERROR:case rt.STOPPED:case rt.FRAG_LOADING:case rt.PARSING:case rt.PARSED:case rt.ENDED:break;default:break}this._checkBuffer(),this._checkFragmentChanged()},i._doTickIdle=function(){var e=this.hls,r=e.config,l=this.media;if(!(this.levelLastLoaded===void 0||!l&&(this.startFragRequested||!r.startFragPrefetch))){var _;this.loadedmetadata?_=l.currentTime:_=this.nextLoadPosition;var R=e.nextLoadLevel,b=this.levels[R];if(b){var I=b.bitrate,P;I?P=Math.max(8*r.maxBufferSize/I,r.maxBufferLength):P=r.maxBufferLength,P=Math.min(P,r.maxMaxBufferLength);var N=L.bufferInfo(this.mediaBuffer?this.mediaBuffer:l,_,r.maxBufferHole),j=N.len;if(!(j>=P)){g.logger.trace("buffer length of "+j.toFixed(3)+" is below max of "+P.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=R;var it=b.details;if(!it||it.live&&this.levelLastLoaded!==R){this.state=rt.WAITING_LEVEL;return}if(this._streamEnded(N,it)){var vt={};this.altAudio&&(vt.type="video"),this.hls.trigger(v.default.BUFFER_EOS,vt),this.state=rt.ENDED;return}this._fetchPayloadOrEos(_,N,it)}}}},i._fetchPayloadOrEos=function(e,r,l){var _=this.fragPrevious,R=this.level,b=l.fragments,I=b.length;if(I!==0){var P=b[0].start,N=b[I-1].start+b[I-1].duration,j=r.end,it;if(l.initSegment&&!l.initSegment.data)it=l.initSegment;else if(l.live){var vt=this.config.initialLiveManifestSize;if(Ivt&&vt>N.currentTime&&(g.logger.log("buffer end: "+r.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+vt.toFixed(3)),N.currentTime=vt),this.nextLoadPosition=vt}if(e.PTSKnown&&r>_&&N&&N.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(R)if(e.hasProgramDateTime)g.logger.log("live playlist, switching playlist, load frag with same PDT: "+R.programDateTime),j=la(b,R.endProgramDateTime,P.maxFragLookUpTolerance);else{var Mt=R.sn+1;if(Mt>=e.startSN&&Mt<=e.endSN){var se=b[Mt-e.startSN];R.cc===se.cc&&(j=se,g.logger.log("live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=q.search(b,function(re){return R.cc-re.cc}),j&&g.logger.log("live playlist, switching playlist, load frag with same CC: "+j.sn))}j||(j=b[Math.min(I-1,Math.round(I/2))],g.logger.log("live playlist, switching playlist, unknown, load middle frag : "+j.sn))}return j},i._findFragment=function(e,r,l,_,R,b,I){var P=this.hls.config,N;if(Rb-P.maxFragLookUpTolerance?0:P.maxFragLookUpTolerance;N=hr(r,_,R,j)}else N=_[l-1];if(N){var it=N.sn-I.startSN,vt=r&&N.level===r.level,Mt=_[it-1],se=_[it+1];if(r&&N.sn===r.sn)if(vt&&!N.backtracked)if(N.snP.maxBufferHole&&r.dropped&&it?(N=Mt,g.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")):(N=se,g.logger.log("Re-loading fragment with SN: "+N.sn))}else N=null;else N.backtracked&&(se&&se.backtracked?(g.logger.warn("Already backtracked from fragment "+se.sn+", will not backtrack to fragment "+N.sn+". Loading fragment "+se.sn),N=se):(g.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),N.dropped=0,Mt?(N=Mt,N.backtracked=!0):it&&(N=null)))}return N},i._loadKey=function(e){this.state=rt.KEY_LOADING,this.hls.trigger(v.default.KEY_LOADING,{frag:e})},i._loadFragment=function(e){var r=this.fragmentTracker.getState(e);this.fragCurrent=e,e.sn!=="initSegment"&&(this.startFragRequested=!0),Object(w.isFiniteNumber)(e.sn)&&!e.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),e.backtracked||r===Je.NOT_LOADED||r===Je.PARTIAL?(e.autoLevel=this.hls.autoLevelEnabled,e.bitrateTest=this.bitrateTest,this.hls.trigger(v.default.FRAG_LOADING,{frag:e}),this.demuxer||(this.demuxer=new st(this.hls,"main")),this.state=rt.FRAG_LOADING):r===Je.APPENDING&&this._reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e)},i.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,C.MAIN)},i.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.endPTS+.5):null},i._checkFragmentChanged=function(){var e,r,l=this.media;if(l&&l.readyState&&l.seeking===!1&&(r=l.currentTime,r>this.lastCurrentTime&&(this.lastCurrentTime=r),L.isBuffered(l,r)?e=this.getBufferedFrag(r):L.isBuffered(l,r+.1)&&(e=this.getBufferedFrag(r+.1)),e)){var _=e;if(_!==this.fragPlaying){this.hls.trigger(v.default.FRAG_CHANGED,{frag:_});var R=_.level;(!this.fragPlaying||this.fragPlaying.level!==R)&&this.hls.trigger(v.default.LEVEL_SWITCHED,{level:R}),this.fragPlaying=_}}},i.immediateLevelSwitch=function(){if(g.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,r;e?(r=e.paused,e.pause()):r=!0,this.previouslyPaused=r}var l=this.fragCurrent;l&&l.loader&&l.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},i.immediateLevelSwitchEnd=function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,L.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())},i.nextLevelSwitch=function(){var e=this.media;if(e&&e.readyState){var r,l,_;if(l=this.getBufferedFrag(e.currentTime),l&&l.startPTS>1&&this.flushMainBuffer(0,l.startPTS-1),e.paused)r=0;else{var R=this.hls.nextLoadLevel,b=this.levels[R],I=this.fragLastKbps;I&&this.fragCurrent?r=this.fragCurrent.duration*b.bitrate/(1e3*I)+1:r=0}if(_=this.getBufferedFrag(e.currentTime+r),_&&(_=this.followingBufferedFrag(_),_)){var P=this.fragCurrent;P&&P.loader&&P.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(_.maxStartPTS,Number.POSITIVE_INFINITY)}}},i.flushMainBuffer=function(e,r){this.state=rt.BUFFER_FLUSHING;var l={startOffset:e,endOffset:r};this.altAudio&&(l.type="video"),this.hls.trigger(v.default.BUFFER_FLUSHING,l)},i.onMediaAttached=function(e){var r=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),r.addEventListener("seeking",this.onvseeking),r.addEventListener("seeked",this.onvseeked),r.addEventListener("ended",this.onvended);var l=this.config;this.levels&&l.autoStartLoad&&this.hls.startLoad(l.startPosition),this.gapController=new Na(l,r,this.fragmentTracker,this.hls)},i.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(g.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var r=this.levels;r&&r.forEach(function(l){l.details&&l.details.fragments.forEach(function(_){_.backtracked=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.fragmentTracker.removeAllFragments(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},i.onMediaSeeked=function(){var e=this.media,r=e?e.currentTime:void 0;Object(w.isFiniteNumber)(r)&&g.logger.log("media seeked to "+r.toFixed(3)),this.tick()},i.onManifestLoading=function(){g.logger.log("trigger BUFFER_RESET"),this.hls.trigger(v.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},i.onManifestParsed=function(e){var r=!1,l=!1,_;e.levels.forEach(function(b){_=b.audioCodec,_&&(_.indexOf("mp4a.40.2")!==-1&&(r=!0),_.indexOf("mp4a.40.5")!==-1&&(l=!0))}),this.audioCodecSwitch=r&&l,this.audioCodecSwitch&&g.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.altAudio=e.altAudio,this.levels=e.levels,this.startFragRequested=!1;var R=this.config;(R.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(R.startPosition)},i.onLevelLoaded=function(e){var r=e.details,l=e.level,_=this.levels[this.levelLastLoaded],R=this.levels[l],b=r.totalduration,I=0;if(g.logger.log("level "+l+" loaded ["+r.startSN+","+r.endSN+"],duration:"+b),r.live){var P=R.details;P&&r.fragments.length>0?(Ht(P,r),I=r.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(I,P),r.PTSKnown&&Object(w.isFiniteNumber)(I)?g.logger.log("live playlist sliding:"+I.toFixed(3)):(g.logger.log("live playlist - outdated PTS, unknown sliding"),_r(this.fragPrevious,_,r))):(g.logger.log("live playlist - first load, unknown sliding"),r.PTSKnown=!1,_r(this.fragPrevious,_,r))}else r.PTSKnown=!1;if(R.details=r,this.levelLastLoaded=l,this.hls.trigger(v.default.LEVEL_UPDATED,{details:r,level:l}),this.startFragRequested===!1){if(this.startPosition===-1||this.lastCurrentTime===-1){var N=r.startTimeOffset;Object(w.isFiniteNumber)(N)?(N<0&&(g.logger.log("negative start time offset "+N+", count from end of last fragment"),N=I+b+N),g.logger.log("start time offset found in playlist, adjust startPosition to "+N),this.startPosition=N):r.live?(this.startPosition=this.computeLivePosition(I,r),g.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===rt.WAITING_LEVEL&&(this.state=rt.IDLE),this.tick()},i.onKeyLoaded=function(){this.state===rt.KEY_LOADING&&(this.state=rt.IDLE,this.tick())},i.onFragLoaded=function(e){var r=this.fragCurrent,l=this.hls,_=this.levels,R=this.media,b=e.frag;if(this.state===rt.FRAG_LOADING&&r&&b.type==="main"&&b.level===r.level&&b.sn===r.sn){var I=e.stats,P=_[r.level],N=P.details;if(this.bitrateTest=!1,this.stats=I,g.logger.log("Loaded "+r.sn+" of ["+N.startSN+" ,"+N.endSN+"],level "+r.level),b.bitrateTest&&l.nextLoadLevel)this.state=rt.IDLE,this.startFragRequested=!1,I.tparsed=I.tbuffered=window.performance.now(),l.trigger(v.default.FRAG_BUFFERED,{stats:I,frag:r,id:"main"}),this.tick();else if(b.sn==="initSegment")this.state=rt.IDLE,I.tparsed=I.tbuffered=window.performance.now(),N.initSegment.data=e.payload,l.trigger(v.default.FRAG_BUFFERED,{stats:I,frag:r,id:"main"}),this.tick();else{g.logger.log("Parsing "+r.sn+" of ["+N.startSN+" ,"+N.endSN+"],level "+r.level+", cc "+r.cc),this.state=rt.PARSING,this.pendingBuffering=!0,this.appended=!1,b.bitrateTest&&(b.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:b}));var j=!(R&&R.seeking)&&(N.PTSKnown||!N.live),it=N.initSegment?N.initSegment.data:[],vt=this._getAudioCodec(P),Mt=this.demuxer=this.demuxer||new st(this.hls,"main");Mt.push(e.payload,it,vt,P.videoCodec,r,N.totalduration,j)}}this.fragLoadError=0},i.onFragParsingInitSegment=function(e){var r=this.fragCurrent,l=e.frag;if(r&&e.id==="main"&&l.sn===r.sn&&l.level===r.level&&this.state===rt.PARSING){var _=e.tracks,R,b;if(_.audio&&this.altAudio&&delete _.audio,b=_.audio,b){var I=this.levels[this.level].audioCodec,P=navigator.userAgent.toLowerCase();I&&this.audioCodecSwap&&(g.logger.log("swapping playlist audio codec"),I.indexOf("mp4a.40.5")!==-1?I="mp4a.40.2":I="mp4a.40.5"),this.audioCodecSwitch&&b.metadata.channelCount!==1&&P.indexOf("firefox")===-1&&(I="mp4a.40.5"),P.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(I="mp4a.40.2",g.logger.log("Android: force audio codec to "+I)),b.levelCodec=I,b.id=e.id}b=_.video,b&&(b.levelCodec=this.levels[this.level].videoCodec,b.id=e.id),this.hls.trigger(v.default.BUFFER_CODECS,_);for(R in _){b=_[R],g.logger.log("main track:"+R+",container:"+b.container+",codecs[level/parsed]=["+b.levelCodec+"/"+b.codec+"]");var N=b.initSegment;N&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(v.default.BUFFER_APPENDING,{type:R,data:N,parent:"main",content:"initSegment"}))}this.tick()}},i.onFragParsingData=function(e){var r=this,l=this.fragCurrent,_=e.frag;if(l&&e.id==="main"&&_.sn===l.sn&&_.level===l.level&&!(e.type==="audio"&&this.altAudio)&&this.state===rt.PARSING){var R=this.levels[this.level],b=l;if(Object(w.isFiniteNumber)(e.endPTS)||(e.endPTS=e.startPTS+l.duration,e.endDTS=e.startDTS+l.duration),e.hasAudio===!0&&b.addElementaryStream(at.AUDIO),e.hasVideo===!0&&b.addElementaryStream(at.VIDEO),g.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0)),e.type==="video")if(b.dropped=e.dropped,b.dropped)if(b.backtracked)g.logger.warn("Already backtracked on this fragment, appending with the gap",b.sn);else{var I=R.details;if(I&&b.sn===I.startSN)g.logger.warn("missing video frame(s) on first frag, appending with gap",b.sn);else{g.logger.warn("missing video frame(s), backtracking fragment",b.sn),this.fragmentTracker.removeFragment(b),b.backtracked=!0,this.nextLoadPosition=e.startPTS,this.state=rt.IDLE,this.fragPrevious=b,this.tick();return}}else b.backtracked=!1;var P=pt(R.details,b,e.startPTS,e.endPTS,e.startDTS,e.endDTS),N=this.hls;N.trigger(v.default.LEVEL_PTS_UPDATED,{details:R.details,level:this.level,drift:P,type:e.type,start:e.startPTS,end:e.endPTS}),[e.data1,e.data2].forEach(function(j){j&&j.length&&r.state===rt.PARSING&&(r.appended=!0,r.pendingBuffering=!0,N.trigger(v.default.BUFFER_APPENDING,{type:e.type,data:j,parent:"main",content:"data"}))}),this.tick()}},i.onFragParsed=function(e){var r=this.fragCurrent,l=e.frag;r&&e.id==="main"&&l.sn===r.sn&&l.level===r.level&&this.state===rt.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=rt.PARSED,this._checkAppendedParsed())},i.onAudioTrackSwitching=function(e){var r=!!e.url,l=e.id;if(!r){if(this.mediaBuffer!==this.media){g.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_.loader&&(g.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=rt.IDLE}var R=this.hls;R.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),R.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:l}),this.altAudio=!1}},i.onAudioTrackSwitched=function(e){var r=e.id,l=!!this.hls.audioTracks[r].url;if(l){var _=this.videoBuffer;_&&this.mediaBuffer!==_&&(g.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=_)}this.altAudio=l,this.tick()},i.onBufferCreated=function(e){var r=e.tracks,l,_,R=!1;for(var b in r){var I=r[b];I.id==="main"?(_=b,l=I,b==="video"&&(this.videoBuffer=r[b].buffer)):R=!0}R&&l?(g.logger.log("alternate track found, use "+_+".buffered to schedule main fragment loading"),this.mediaBuffer=l.buffer):this.mediaBuffer=this.media},i.onBufferAppended=function(e){if(e.parent==="main"){var r=this.state;(r===rt.PARSING||r===rt.PARSED)&&(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}},i._checkAppendedParsed=function(){if(this.state===rt.PARSED&&(!this.appended||!this.pendingBuffering)){var e=this.fragCurrent;if(e){var r=this.mediaBuffer?this.mediaBuffer:this.media;g.logger.log("main buffered : "+mn.toString(r.buffered)),this.fragPrevious=e;var l=this.stats;l.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*l.total/(l.tbuffered-l.tfirst)),this.hls.trigger(v.default.FRAG_BUFFERED,{stats:l,frag:e,id:"main"}),this.state=rt.IDLE}this.tick()}},i.onError=function(e){var r=e.frag||this.fragCurrent;if(!(r&&r.type!=="main")){var l=!!this.media&&L.isBuffered(this.media,this.media.currentTime)&&L.isBuffered(this.media,this.media.currentTime+.5);switch(e.details){case m.ErrorDetails.FRAG_LOAD_ERROR:case m.ErrorDetails.FRAG_LOAD_TIMEOUT:case m.ErrorDetails.KEY_LOAD_ERROR:case m.ErrorDetails.KEY_LOAD_TIMEOUT:if(!e.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var _=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);g.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=rt.FRAG_LOADING_WAITING_RETRY}else g.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=rt.ERROR;break;case m.ErrorDetails.LEVEL_LOAD_ERROR:case m.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==rt.ERROR&&(e.fatal?(this.state=rt.ERROR,g.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):!e.levelRetry&&this.state===rt.WAITING_LEVEL&&(this.state=rt.IDLE));break;case m.ErrorDetails.BUFFER_FULL_ERROR:e.parent==="main"&&(this.state===rt.PARSING||this.state===rt.PARSED)&&(l?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=rt.IDLE):(g.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}}},i._reduceMaxBufferLength=function(e){var r=this.config;return r.maxMaxBufferLength>=e?(r.maxMaxBufferLength/=2,g.logger.warn("main:reduce max buffer length to "+r.maxMaxBufferLength+"s"),!0):!1},i._checkBuffer=function(){var e=this.media;if(!(!e||e.readyState===0)){var r=this.mediaBuffer?this.mediaBuffer:e,l=r.buffered;!this.loadedmetadata&&l.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,l)}},i.onFragLoadEmergencyAborted=function(){this.state=rt.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},i.onBufferFlushed=function(){var e=this.mediaBuffer?this.mediaBuffer:this.media;e&&this.fragmentTracker.detectEvictedFragments(at.VIDEO,e.buffered),this.state=rt.IDLE,this.fragPrevious=null},i.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},i._seekToStartPos=function(){var e=this.media,r=e.currentTime,l=e.seeking?r:this.startPosition;r!==l&&l>=0&&(g.logger.log("target start position not buffered, seek to buffered.start(0) "+l+" from current time "+r+" "),e.currentTime=l)},i._getAudioCodec=function(e){var r=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&(g.logger.log("swapping playlist audio codec"),r&&(r.indexOf("mp4a.40.5")!==-1?r="mp4a.40.2":r="mp4a.40.5")),r},ei(d,[{key:"state",set:function(e){if(this.state!==e){var r=this.state;this._state=e,g.logger.log("main stream-controller: "+r+"->"+e),this.hls.trigger(v.default.STREAM_STATE_TRANSITION,{previousState:r,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var r=this.getBufferedFrag(e.currentTime);if(r)return r.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),d})(lu),wl=Zf;function Ac(h,d){for(var i=0;i0){_=r[0].bitrate,r.sort(function(j,it){return j.bitrate-it.bitrate}),this._levels=r;for(var N=0;N=0&&e1&&P.loadError0){var r=this.currentLevelIndex,l=e.urlId,_=e.url[l];g.logger.log("Attempt loading level index "+r+" with URL-id "+l),this.hls.trigger(v.default.LEVEL_LOADING,{url:_,level:r,id:l})}}},xc(d,[{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var r=this._levels;r&&(e=Math.min(e,r.length-1),(this.currentLevelIndex!==e||!r[e].details)&&this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var e=this.hls.config.startLevel;return e!==void 0?e:this._firstLevel}else return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}}]),d})(E),Nc=a("./src/demux/id3.js");function fp(h,d){var i;try{i=new Event("addtrack")}catch{i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=h,d.dispatchEvent(i)}function Pi(h){if(h&&h.cues)for(;h.cues.length>0;)h.removeCue(h.cues[0])}function q_(h,d){if(dh[h.length-1].endTime)return h[h.length-1];for(var i=0,o=h.length-1;i<=o;){var e=Math.floor((o+i)/2);if(dh[e].endTime)i=e+1;else return h[e]}return h[i].endTime-dP&&(g.logger.warn("detected an id3 sample with endTime < startTime, adjusting endTime to (startTime + 0.25)"),P=I+.25);for(var N=0;N=this.minWeight_},d.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},d.destroy=function(){},h})(),Y_=K_;function pp(h,d){for(var i=0;i500*l.duration/P){var N=e.levels,j=Math.max(1,b.bw?b.bw/8:b.loaded*1e3/I),it=N[l.level],vt=it.realBitrate?Math.max(it.realBitrate,it.bitrate):it.bitrate,Mt=b.total?b.total:Math.max(b.loaded,Math.round(l.duration*vt/8)),se=r.currentTime,re=(Mt-b.loaded)/j,ce=(L.bufferInfo(r,se,e.config.maxBufferHole).end-se)/P;if(ce<2*l.duration/P&&re>ce){var Re,We;for(We=l.level-1;We>R;We--){var Oa=N[We].realBitrate?Math.max(N[We].realBitrate,N[We].bitrate):N[We].bitrate,ca=l.duration*Oa/(8*.8*j);if(ca=_;j--){var it=N[j];if(it){var vt=it.details,Mt=vt?vt.totalduration/vt.fragments.length:r,se=vt?vt.live:!1,re=void 0;j<=e?re=I*l:re=P*l;var ce=N[j].realBitrate?Math.max(N[j].realBitrate,N[j].bitrate):N[j].bitrate,Re=ce*Mt/re;if(g.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+j+"/"+Math.round(re)+"/"+ce+"/"+Mt+"/"+b+"/"+Re),re>ce&&(!Re||se&&!this.bitrateTestDelay||Re=0)return Mt;g.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var se=P?Math.min(P,_.maxStarvationDelay):_.maxStarvationDelay,re=_.abrBandWidthFactor,ce=_.abrBandWidthUpFactor;if(vt===0){var Re=this.bitrateTestDelay;if(Re){var We=P?Math.min(P,_.maxLoadingDelay):_.maxLoadingDelay;se=We-Re,g.logger.trace("bitrate test took "+Math.round(1e3*Re)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*se)+" ms"),re=ce=1}}return Mt=this._findBestLevel(I,P,it,R,r,vt+se,re,ce,l),Math.max(Mt,0)}}]),d})(E),eh=th;function nh(h,d){h.prototype=Object.create(d.prototype),h.prototype.constructor=h,h.__proto__=d}var mp=$(),rh=(function(h){nh(d,h);function d(o){var e;return e=h.call(this,o,v.default.MEDIA_ATTACHING,v.default.MEDIA_DETACHING,v.default.MANIFEST_PARSED,v.default.BUFFER_RESET,v.default.BUFFER_APPENDING,v.default.BUFFER_CODECS,v.default.BUFFER_EOS,v.default.BUFFER_FLUSHING,v.default.LEVEL_PTS_UPDATED,v.default.LEVEL_UPDATED)||this,e._msDuration=null,e._levelDuration=null,e._levelTargetDuration=10,e._live=null,e._objectUrl=null,e._needsFlush=!1,e._needsEos=!1,e.config=void 0,e.audioTimestampOffset=void 0,e.bufferCodecEventsExpected=0,e._bufferCodecEventsTotal=0,e.media=null,e.mediaSource=null,e.segments=[],e.parent=void 0,e.appending=!1,e.appended=0,e.appendError=0,e.flushBufferCounter=0,e.tracks={},e.pendingTracks={},e.sourceBuffer={},e.flushRange=[],e._onMediaSourceOpen=function(){g.logger.log("media source opened"),e.hls.trigger(v.default.MEDIA_ATTACHED,{media:e.media});var r=e.mediaSource;r&&r.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},e._onMediaSourceClose=function(){g.logger.log("media source closed")},e._onMediaSourceEnded=function(){g.logger.log("media source ended")},e._onSBUpdateEnd=function(){if(e.audioTimestampOffset&&e.sourceBuffer.audio){var r=e.sourceBuffer.audio;g.logger.warn("change mpeg audio timestamp offset from "+r.timestampOffset+" to "+e.audioTimestampOffset),r.timestampOffset=e.audioTimestampOffset,delete e.audioTimestampOffset}e._needsFlush&&e.doFlush(),e._needsEos&&e.checkEos(),e.appending=!1;var l=e.parent,_=e.segments.reduce(function(N,j){return j.parent===l?N+1:N},0),R={},b=e.sourceBuffer;for(var I in b){var P=b[I];if(!P)throw Error("handling source buffer update end error: source buffer for "+I+" uninitilized and unable to update buffered TimeRanges.");R[I]=P.buffered}e.hls.trigger(v.default.BUFFER_APPENDED,{parent:l,pending:_,timeRanges:R}),e._needsFlush||e.doAppending(),e.updateMediaElementDuration(),_===0&&e.flushLiveBackBuffer()},e._onSBUpdateError=function(r){g.logger.error("sourceBuffer error:",r),e.hls.trigger(v.default.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},e.config=o.config,e}var i=d.prototype;return i.destroy=function(){E.prototype.destroy.call(this)},i.onLevelPtsUpdated=function(e){var r=e.type,l=this.tracks.audio;if(r==="audio"&&l&&l.container==="audio/mpeg"){var _=this.sourceBuffer.audio;if(!_)throw Error("Level PTS Updated and source buffer for audio uninitalized");var R=Math.abs(_.timestampOffset-e.start);if(R>.1){var b=_.updating;try{_.abort()}catch(I){g.logger.warn("can not abort audio buffer: "+I)}b?this.audioTimestampOffset=e.start:(g.logger.warn("change mpeg audio timestamp offset from "+_.timestampOffset+" to "+e.start),_.timestampOffset=e.start)}}},i.onManifestParsed=function(e){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=e.altAudio?2:1,g.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},i.onMediaAttaching=function(e){var r=this.media=e.media;if(r&&mp){var l=this.mediaSource=new mp;l.addEventListener("sourceopen",this._onMediaSourceOpen),l.addEventListener("sourceended",this._onMediaSourceEnded),l.addEventListener("sourceclose",this._onMediaSourceClose),r.src=window.URL.createObjectURL(l),this._objectUrl=r.src}},i.onMediaDetaching=function(){g.logger.log("media source detaching");var e=this.mediaSource;if(e){if(e.readyState==="open")try{e.endOfStream()}catch(r){g.logger.warn("onMediaDetaching:"+r.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.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()):g.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(v.default.MEDIA_DETACHED)},i.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,r=this.pendingTracks,l=Object.keys(r).length;(l&&!e||l===2)&&(this.createSourceBuffers(r),this.pendingTracks={},this.doAppending())},i.onBufferReset=function(){var e=this.sourceBuffer;for(var r in e){var l=e[r];try{l&&(this.mediaSource&&this.mediaSource.removeSourceBuffer(l),l.removeEventListener("updateend",this._onSBUpdateEnd),l.removeEventListener("error",this._onSBUpdateError))}catch{}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},i.onBufferCodecs=function(e){var r=this;Object.keys(this.sourceBuffer).length||(Object.keys(e).forEach(function(l){r.pendingTracks[l]=e[l]}),this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())},i.createSourceBuffers=function(e){var r=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");for(var _ in e)if(!r[_]){var R=e[_];if(!R)throw Error("source buffer exists for track "+_+", however track does not");var b=R.levelCodec||R.codec,I=R.container+";codecs="+b;g.logger.log("creating sourceBuffer("+I+")");try{var P=r[_]=l.addSourceBuffer(I);P.addEventListener("updateend",this._onSBUpdateEnd),P.addEventListener("error",this._onSBUpdateError),this.tracks[_]={buffer:P,codec:b,id:R.id,container:R.container,levelCodec:R.levelCodec}}catch(N){g.logger.error("error while trying to add sourceBuffer:"+N.message),this.hls.trigger(v.default.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:N,mimeType:I})}}this.hls.trigger(v.default.BUFFER_CREATED,{tracks:this.tracks})},i.onBufferAppending=function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())},i.onBufferEos=function(e){for(var r in this.sourceBuffer)if(!e.type||e.type===r){var l=this.sourceBuffer[r];l&&!l.ended&&(l.ended=!0,g.logger.log(r+" sourceBuffer now EOS"))}this.checkEos()},i.checkEos=function(){var e=this.sourceBuffer,r=this.mediaSource;if(!r||r.readyState!=="open"){this._needsEos=!1;return}for(var l in e){var _=e[l];if(_){if(!_.ended)return;if(_.updating){this._needsEos=!0;return}}}g.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{r.endOfStream()}catch{g.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},i.onBufferFlushing=function(e){e.type?this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}):(this.flushRange.push({start:e.startOffset,end:e.endOffset,type:"video"}),this.flushRange.push({start:e.startOffset,end:e.endOffset,type:"audio"})),this.flushBufferCounter=0,this.doFlush()},i.flushLiveBackBuffer=function(){if(this._live){var e=this.config.liveBackBufferLength;if(!(!isFinite(e)||e<0)){if(!this.media){g.logger.error("flushLiveBackBuffer called without attaching media");return}for(var r=this.media.currentTime,l=this.sourceBuffer,_=Object.keys(l),R=r-Math.max(e,this._levelTargetDuration),b=_.length-1;b>=0;b--){var I=_[b],P=l[I];if(P){var N=P.buffered;N.length>0&&R>N.start(0)&&this.removeBufferRange(I,P,0,R)&&this.hls.trigger(v.default.LIVE_BACK_BUFFER_REACHED,{bufferEnd:R})}}}}},i.onLevelUpdated=function(e){var r=e.details;r.fragments.length>0&&(this._levelDuration=r.totalduration+r.fragments[0].start,this._levelTargetDuration=r.averagetargetduration||r.targetduration||10,this._live=r.live,this.updateMediaElementDuration())},i.updateMediaElementDuration=function(){var e=this.config,r;if(!(this._levelDuration===null||!this.media||!this.mediaSource||!this.sourceBuffer||this.media.readyState===0||this.mediaSource.readyState!=="open")){for(var l in this.sourceBuffer){var _=this.sourceBuffer[l];if(_&&_.updating===!0)return}r=this.media.duration,this._msDuration===null&&(this._msDuration=this.mediaSource.duration),this._live===!0&&e.liveDurationInfinity===!0?(g.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>r||!Object(w.isFiniteNumber)(r))&&(g.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},i.doFlush=function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(this.flushBuffer(e.start,e.end,e.type))this.flushRange.shift(),this.flushBufferCounter=0;else{this._needsFlush=!0;return}}if(this.flushRange.length===0){this._needsFlush=!1;var r=0,l=this.sourceBuffer;try{for(var _ in l){var R=l[_];R&&(r+=R.buffered.length)}}catch{g.logger.error("error while accessing sourceBuffer.buffered")}this.appended=r,this.hls.trigger(v.default.BUFFER_FLUSHED)}},i.doAppending=function(){var e=this.config,r=this.hls,l=this.segments,_=this.sourceBuffer;if(Object.keys(_).length){if(!this.media||this.media.error){this.segments=[],g.logger.error("trying to append although a media error occured, flush segment and abort");return}if(!this.appending){var R=l.shift();if(R)try{var b=_[R.type];if(!b){this._onSBUpdateEnd();return}if(b.updating){l.unshift(R);return}b.ended=!1,this.parent=R.parent,b.appendBuffer(R.data),this.appendError=0,this.appended++,this.appending=!0}catch(P){g.logger.error("error while trying to append buffer:"+P.message),l.unshift(R);var I={type:m.ErrorTypes.MEDIA_ERROR,parent:R.parent,details:"",fatal:!1};P.code===22?(this.segments=[],I.details=m.ErrorDetails.BUFFER_FULL_ERROR):(this.appendError++,I.details=m.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.appendErrorMaxRetry&&(g.logger.log("fail "+e.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],I.fatal=!0)),r.trigger(v.default.ERROR,I)}}}},i.flushBuffer=function(e,r,l){var _=this.sourceBuffer;if(!Object.keys(_).length)return!0;var R="null";if(this.media&&(R=this.media.currentTime.toFixed(3)),g.logger.log("flushBuffer,pos/start/end: "+R+"/"+e+"/"+r),this.flushBufferCounter>=this.appended)return g.logger.warn("abort flushing too many retries"),!0;var b=_[l];if(b){if(b.ended=!1,b.updating)return g.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(l,b,e,r))return this.flushBufferCounter++,!1}return g.logger.log("buffer flushed"),!0},i.removeBufferRange=function(e,r,l,_){try{for(var R=0;R.5){var j="null";return this.media&&(j=this.media.currentTime.toString()),g.logger.log("sb remove "+e+" ["+P+","+N+"], of ["+b+","+I+"], pos:"+j),r.remove(P,N),!0}}}catch(it){g.logger.warn("removeBufferRange failed",it)}return!1},d})(E),ah=rh;function _p(h,d){for(var i=0;ithis.autoLevelCapping&&r.streamController.nextLevelSwitch(),this.autoLevelCapping=r.autoLevelCapping}}},i.getMaxLevel=function(e){var r=this;if(!this.levels)return-1;var l=this.levels.filter(function(_,R){return d.isLevelAllowed(R,r.restrictedLevels)&&R<=e});return d.getMaxLevelByMediaSize(l,this.mediaWidth,this.mediaHeight)},i.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())},i.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},d.isLevelAllowed=function(e,r){return r===void 0&&(r=[]),r.indexOf(e)===-1},d.getMaxLevelByMediaSize=function(e,r,l){if(!e||e&&!e.length)return-1;for(var _=function(N,j){return j?N.width!==j.width||N.height!==j.height:!0},R=e.length-1,b=0;b=r||I.height>=l)&&_(I,e[b+1])){R=b;break}}return R},oh(d,[{key:"mediaWidth",get:function(){var e,r=this.media;return r&&(e=r.width||r.clientWidth||r.offsetWidth,e*=d.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e,r=this.media;return r&&(e=r.height||r.clientHeight||r.offsetHeight,e*=d.contentScaleFactor),e}}],[{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch{}return e}}]),d})(E),hp=uh;function ih(h,d){h.prototype=Object.create(d.prototype),h.prototype.constructor=h,h.__proto__=d}var ri=window,lh=ri.performance,rs=(function(h){ih(d,h);function d(o){return h.call(this,o,v.default.MEDIA_ATTACHING)||this}var i=d.prototype;return i.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},i.onMediaAttaching=function(e){var r=this.hls.config;if(r.capLevelOnFPSDrop){var l=this.video=e.media instanceof window.HTMLVideoElement?e.media:null;typeof l.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}},i.checkFPS=function(e,r,l){var _=lh.now();if(r){if(this.lastTime){var R=_-this.lastTime,b=l-this.lastDroppedFrames,I=r-this.lastDecodedFrames,P=1e3*b/R,N=this.hls;if(N.trigger(v.default.FPS_DROP,{currentDropped:b,currentDecoded:I,totalDroppedFrames:l}),P>0&&b>N.config.fpsDroppedMonitoringThreshold*I){var j=N.currentLevel;g.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+j),j>0&&(N.autoLevelCapping===-1||N.autoLevelCapping>=j)&&(j=j-1,N.trigger(v.default.FPS_DROP_LEVEL_CAPPING,{level:j,droppedLevel:N.currentLevel}),N.autoLevelCapping=j,N.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=l,this.lastDecodedFrames=r}},i.checkFPSInterval=function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var r=e.getVideoPlaybackQuality();this.checkFPS(e,r.totalVideoFrames,r.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},d})(E),ch=rs,gp=window,as=gp.performance,fh=gp.XMLHttpRequest,sh=(function(){function h(i){i&&i.xhrSetup&&(this.xhrSetup=i.xhrSetup)}var d=h.prototype;return d.destroy=function(){this.abort(),this.loader=null},d.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},d.load=function(o,e,r){this.context=o,this.config=e,this.callbacks=r,this.stats={trequest:as.now(),retry:0},this.retryDelay=e.retryDelay,this.loadInternal()},d.loadInternal=function(){var o,e=this.context;o=this.loader=new fh;var r=this.stats;r.tfirst=0,r.loaded=0;var l=this.xhrSetup;try{if(l)try{l(o,e.url)}catch{o.open("GET",e.url,!0),l(o,e.url)}o.readyState||o.open("GET",e.url,!0)}catch(_){this.callbacks.onError({code:o.status,text:_.message},e,o);return}e.rangeEnd&&o.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=e.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),o.send()},d.readystatechange=function(o){var e=o.currentTarget,r=e.readyState,l=this.stats,_=this.context,R=this.config;if(!l.aborted&&r>=2)if(window.clearTimeout(this.requestTimeout),l.tfirst===0&&(l.tfirst=Math.max(as.now(),l.trequest)),r===4){var b=e.status;if(b>=200&&b<300){l.tload=Math.max(l.tfirst,as.now());var I,P;_.responseType==="arraybuffer"?(I=e.response,P=I.byteLength):(I=e.responseText,P=I.length),l.loaded=l.total=P;var N={url:e.responseURL,data:I};this.callbacks.onSuccess(N,l,_,e)}else l.retry>=R.maxRetry||b>=400&&b<499?(g.logger.error(b+" while loading "+_.url),this.callbacks.onError({code:b,text:e.statusText},_,e)):(g.logger.warn(b+" 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),l.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),R.timeout)},d.loadtimeout=function(){g.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},d.loadprogress=function(o){var e=o.currentTarget,r=this.stats;r.loaded=o.loaded,o.lengthComputable&&(r.total=o.total);var l=this.callbacks.onProgress;l&&l(r,this.context,null,e)},h})(),os=sh;function Dp(h,d){for(var i=0;i=this.tracks.length){g.logger.warn("Invalid audio track id:",e.id);return}if(g.logger.log("audioTrack "+e.id+" loaded"),this.tracks[e.id].details=e.details,e.details.live&&!this.hasInterval()){var r=e.details.targetduration*1e3;this.setInterval(r)}!e.details.live&&this.hasInterval()&&this.clearInterval()},i.onAudioTrackSwitched=function(e){var r=this.tracks[e.id].groupId;r&&this.audioGroupId!==r&&(this.audioGroupId=r)},i.onLevelLoaded=function(e){this._selectAudioGroup(e.level)},i.onError=function(e){e.type===m.ErrorTypes.NETWORK_ERROR&&(e.fatal&&this.clearInterval(),e.details===m.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&(g.logger.warn("Network failure on audio-track id:",e.context.id),this._handleLoadError()))},i._setAudioTrack=function(e){if(this._trackId===e&&this.tracks[this._trackId].details){g.logger.debug("Same id as current audio-track passed, and track details available -> no-op");return}if(e<0||e>=this.tracks.length){g.logger.warn("Invalid id passed to audio-track controller");return}var r=this.tracks[e];g.logger.log("Now switching to audio-track index "+e),this.clearInterval(),this._trackId=e;var l=r.url,_=r.type,R=r.id;this.hls.trigger(v.default.AUDIO_TRACK_SWITCHING,{id:R,type:_,url:l}),this._loadTrackDetailsIfNeeded(r)},i.doTick=function(){this._updateTrack(this._trackId)},i._selectAudioGroup=function(e){var r=this.hls.levels[e];if(!(!r||!r.audioGroupIds)){var l=r.audioGroupIds[r.urlId];this.audioGroupId!==l&&(this.audioGroupId=l,this._selectInitialAudioTrack())}},i._selectInitialAudioTrack=function(){var e=this,r=this.tracks;if(r.length){var l=this.tracks[this._trackId],_=null;if(l&&(_=l.name),this._selectDefaultTrack){var R=r.filter(function(P){return P.default});R.length?r=R:g.logger.warn("No default audio tracks defined")}var b=!1,I=function(){r.forEach(function(N){b||(!e.audioGroupId||N.groupId===e.audioGroupId)&&(!_||_===N.name)&&(e._setAudioTrack(N.id),b=!0)})};I(),b||(_=null,I()),b||(g.logger.error("No track found for running audio group-ID: "+this.audioGroupId),this.hls.trigger(v.default.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))}},i._needsTrackLoading=function(e){var r=e.details,l=e.url;return!r||r.live?!!l:!1},i._loadTrackDetailsIfNeeded=function(e){if(this._needsTrackLoading(e)){var r=e.url,l=e.id;g.logger.log("loading audio-track playlist for id: "+l),this.hls.trigger(v.default.AUDIO_TRACK_LOADING,{url:r,id:l})}},i._updateTrack=function(e){if(!(e<0||e>=this.tracks.length)){this.clearInterval(),this._trackId=e,g.logger.log("trying to update audio-track "+e);var r=this.tracks[e];this._loadTrackDetailsIfNeeded(r)}},i._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var e=this._trackId,r=this.tracks[e],l=r.name,_=r.language,R=r.groupId;g.logger.warn("Loading failed on audio track id: "+e+", group-id: "+R+', name/language: "'+l+'" / "'+_+'"');for(var b=e,I=0;I0&&e===-1?(g.logger.log("audio:override startPosition with lastCurrentTime @"+r.toFixed(3)),this.state=rt.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=rt.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=rt.STOPPED},i.doTick=function(){var e,r,l,_=this.hls,R=_.config;switch(this.state){case rt.ERROR:case rt.PAUSED:case rt.BUFFER_FLUSHING:break;case rt.STARTING:this.state=rt.WAITING_TRACK,this.loadedmetadata=!1;break;case rt.IDLE:var b=this.tracks;if(!b||!this.media&&(this.startFragRequested||!R.startFragPrefetch))break;if(this.loadedmetadata)e=this.media.currentTime;else if(e=this.nextLoadPosition,e===void 0)break;var I=this.mediaBuffer?this.mediaBuffer:this.media,P=this.videoBuffer?this.videoBuffer:this.media,N=L.bufferInfo(I,e,R.maxBufferHole),j=L.bufferInfo(P,e,R.maxBufferHole),it=N.len,vt=N.end,Mt=this.fragPrevious,se=Math.min(R.maxBufferLength,R.maxMaxBufferLength),re=Math.max(se,j.len),ce=this.audioSwitch,Re=this.trackId;if((it"u"){this.state=rt.WAITING_TRACK;break}if(!ce&&this._streamEnded(N,l)){this.hls.trigger(v.default.BUFFER_EOS,{type:"audio"}),this.state=rt.ENDED;return}var We=l.fragments,Oa=We.length,ca=We[0].start,Io=We[Oa-1].start+We[Oa-1].duration,cn;if(ce){if(l.live&&!l.PTSKnown)g.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),vt=0;else if(vt=e,l.PTSKnown&&eca||N.nextStart)g.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=ca+.05;else return}if(l.initSegment&&!l.initSegment.data)cn=l.initSegment;else if(vt<=ca){if(cn=We[0],this.videoTrackCC!==null&&cn.cc!==this.videoTrackCC&&(cn=xn(We,this.videoTrackCC)),l.live&&cn.loadIdx&&cn.loadIdx===this.fragLoadIdx){var _n=N.nextStart?N.nextStart:ca;g.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(_n+.05)),this.media.currentTime=_n+.05;return}}else{var Ue,Yr=R.maxFragLookUpTolerance,$c=Mt?We[Mt.sn-We[0].sn+1]:void 0,Wc=function(ps){var UD=Math.min(Yr,ps.duration);return ps.start+ps.duration-UD<=vt?1:ps.start-UD>vt&&ps.start?-1:0};vtIo-Yr&&(Yr=0),$c&&!Wc($c)?Ue=$c:Ue=q.search(We,Wc)):Ue=We[Oa-1],Ue&&(cn=Ue,ca=Ue.start,Mt&&cn.level===Mt.level&&cn.sn===Mt.sn&&(cn.sn=ND||CM)&&(g.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=rt.IDLE);break;case rt.WAITING_INIT_PTS:var jh=this.videoTrackCC;if(this.initPTS[jh]===void 0)break;var PD=this.waitingFragment;if(PD){var OD=PD.frag.cc;jh!==OD?(r=this.tracks[this.trackId],r.details&&r.details.live&&(g.logger.warn("Waiting fragment CC ("+OD+") does not match video track CC ("+jh+")"),this.waitingFragment=null,this.state=rt.IDLE)):(this.state=rt.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=rt.IDLE;break;case rt.STOPPED:case rt.FRAG_LOADING:case rt.PARSING:case rt.PARSED:case rt.ENDED:break;default:break}},i.onMediaAttached=function(e){var r=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),r.addEventListener("seeking",this.onvseeking),r.addEventListener("ended",this.onvended);var l=this.config;this.tracks&&l.autoStartLoad&&this.startLoad(l.startPosition)},i.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(g.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&(e.removeEventListener("seeking",this.onvseeking),e.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()},i.onAudioTracksUpdated=function(e){g.logger.log("audio tracks updated"),this.tracks=e.audioTracks},i.onAudioTrackSwitching=function(e){var r=!!e.url;this.trackId=e.id,this.fragCurrent=null,this.state=rt.PAUSED,this.waitingFragment=null,r?this.setInterval(bp):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),r&&(this.audioSwitch=!0,this.state=rt.IDLE),this.tick()},i.onAudioTrackLoaded=function(e){var r=e.details,l=e.id,_=this.tracks[l],R=r.totalduration,b=0;if(g.logger.log("track "+l+" loaded ["+r.startSN+","+r.endSN+"],duration:"+R),r.live){var I=_.details;I&&r.fragments.length>0?(Ht(I,r),b=r.fragments[0].start,r.PTSKnown?g.logger.log("live audio playlist sliding:"+b.toFixed(3)):g.logger.log("live audio playlist - outdated PTS, unknown sliding")):(r.PTSKnown=!1,g.logger.log("live audio playlist - first load, unknown sliding"))}else r.PTSKnown=!1;if(_.details=r,!this.startFragRequested){if(this.startPosition===-1){var P=r.startTimeOffset;Object(w.isFiniteNumber)(P)?(g.logger.log("start time offset found in playlist, adjust startPosition to "+P),this.startPosition=P):r.live?(this.startPosition=this.computeLivePosition(b,r),g.logger.log("compute startPosition for audio-track to "+this.startPosition)):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===rt.WAITING_TRACK&&(this.state=rt.IDLE),this.tick()},i.onKeyLoaded=function(){this.state===rt.KEY_LOADING&&(this.state=rt.IDLE,this.tick())},i.onFragLoaded=function(e){var r=this.fragCurrent,l=e.frag;if(this.state===rt.FRAG_LOADING&&r&&l.type==="audio"&&l.level===r.level&&l.sn===r.sn){var _=this.tracks[this.trackId],R=_.details,b=R.totalduration,I=r.level,P=r.sn,N=r.cc,j=this.config.defaultAudioCodec||_.audioCodec||"mp4a.40.2",it=this.stats=e.stats;if(P==="initSegment")this.state=rt.IDLE,it.tparsed=it.tbuffered=su.now(),R.initSegment.data=e.payload,this.hls.trigger(v.default.FRAG_BUFFERED,{stats:it,frag:r,id:"audio"}),this.tick();else{this.state=rt.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new st(this.hls,"audio"));var vt=this.initPTS[N],Mt=R.initSegment?R.initSegment.data:[];if(R.initSegment||vt!==void 0){this.pendingBuffering=!0,g.logger.log("Demuxing "+P+" of ["+R.startSN+" ,"+R.endSN+"],track "+I);var se=!1;this.demuxer.push(e.payload,Mt,j,null,r,b,se,vt)}else g.logger.log("unknown video PTS for continuity counter "+N+", waiting for video PTS before demuxing audio frag "+P+" of ["+R.startSN+" ,"+R.endSN+"],track "+I),this.waitingFragment=e,this.state=rt.WAITING_INIT_PTS}}this.fragLoadError=0},i.onFragParsingInitSegment=function(e){var r=this.fragCurrent,l=e.frag;if(r&&e.id==="audio"&&l.sn===r.sn&&l.level===r.level&&this.state===rt.PARSING){var _=e.tracks,R;if(_.video&&delete _.video,R=_.audio,R){R.levelCodec=R.codec,R.id=e.id,this.hls.trigger(v.default.BUFFER_CODECS,_),g.logger.log("audio track:audio,container:"+R.container+",codecs[level/parsed]=["+R.levelCodec+"/"+R.codec+"]");var b=R.initSegment;if(b){var I={type:"audio",data:b,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[I]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(v.default.BUFFER_APPENDING,I))}this.tick()}}},i.onFragParsingData=function(e){var r=this,l=this.fragCurrent,_=e.frag;if(l&&e.id==="audio"&&e.type==="audio"&&_.sn===l.sn&&_.level===l.level&&this.state===rt.PARSING){var R=this.trackId,b=this.tracks[R],I=this.hls;Object(w.isFiniteNumber)(e.endPTS)||(e.endPTS=e.startPTS+l.duration,e.endDTS=e.startDTS+l.duration),l.addElementaryStream(at.AUDIO),g.logger.log("parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb),pt(b.details,l,e.startPTS,e.endPTS);var P=this.audioSwitch,N=this.media,j=!1;if(P)if(N&&N.readyState){var it=N.currentTime;g.logger.log("switching audio track : currentTime:"+it),it>=e.startPTS&&(g.logger.log("switching audio track : flushing all audio"),this.state=rt.BUFFER_FLUSHING,I.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j=!0,this.audioSwitch=!1,I.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:R}))}else this.audioSwitch=!1,I.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:R});var vt=this.pendingData;if(!vt){g.logger.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),I.trigger(v.default.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:null,fatal:!0});return}this.audioSwitch||([e.data1,e.data2].forEach(function(Mt){Mt&&Mt.length&&vt.push({type:e.type,data:Mt,parent:"audio",content:"data"})}),!j&&vt.length&&(vt.forEach(function(Mt){r.state===rt.PARSING&&(r.pendingBuffering=!0,r.hls.trigger(v.default.BUFFER_APPENDING,Mt))}),this.pendingData=[],this.appended=!0)),this.tick()}},i.onFragParsed=function(e){var r=this.fragCurrent,l=e.frag;r&&e.id==="audio"&&l.sn===r.sn&&l.level===r.level&&this.state===rt.PARSING&&(this.stats.tparsed=su.now(),this.state=rt.PARSED,this._checkAppendedParsed())},i.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},i.onBufferCreated=function(e){var r=e.tracks.audio;r&&(this.mediaBuffer=r.buffer,this.loadedmetadata=!0),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},i.onBufferAppended=function(e){if(e.parent==="audio"){var r=this.state;(r===rt.PARSING||r===rt.PARSED)&&(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}},i._checkAppendedParsed=function(){if(this.state===rt.PARSED&&(!this.appended||!this.pendingBuffering)){var e=this.fragCurrent,r=this.stats,l=this.hls;if(e){this.fragPrevious=e,r.tbuffered=su.now(),l.trigger(v.default.FRAG_BUFFERED,{stats:r,frag:e,id:"audio"});var _=this.mediaBuffer?this.mediaBuffer:this.media;_&&g.logger.log("audio buffered : "+mn.toString(_.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,l.trigger(v.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=rt.IDLE}this.tick()}},i.onError=function(e){var r=e.frag;if(!(r&&r.type!=="audio"))switch(e.details){case m.ErrorDetails.FRAG_LOAD_ERROR:case m.ErrorDetails.FRAG_LOAD_TIMEOUT:var l=e.frag;if(l&&l.type!=="audio")break;if(!e.fatal){var _=this.fragLoadError;_?_++:_=1;var R=this.config;if(_<=R.fragLoadingMaxRetry){this.fragLoadError=_;var b=Math.min(Math.pow(2,_-1)*R.fragLoadingRetryDelay,R.fragLoadingMaxRetryTimeout);g.logger.warn("AudioStreamController: frag loading failed, retry in "+b+" ms"),this.retryDate=su.now()+b,this.state=rt.FRAG_LOADING_WAITING_RETRY}else g.logger.error("AudioStreamController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=rt.ERROR}break;case m.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case m.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case m.ErrorDetails.KEY_LOAD_ERROR:case m.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==rt.ERROR&&(this.state=e.fatal?rt.ERROR:rt.IDLE,g.logger.warn("AudioStreamController: "+e.details+" while loading frag, now switching to "+this.state+" state ..."));break;case m.ErrorDetails.BUFFER_FULL_ERROR:if(e.parent==="audio"&&(this.state===rt.PARSING||this.state===rt.PARSED)){var I=this.mediaBuffer,P=this.media.currentTime,N=I&&L.isBuffered(I,P)&&L.isBuffered(I,P+.5);if(N){var j=this.config;j.maxMaxBufferLength>=j.maxBufferLength&&(j.maxMaxBufferLength/=2,g.logger.warn("AudioStreamController: reduce max buffer length to "+j.maxMaxBufferLength+"s")),this.state=rt.IDLE}else g.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=rt.BUFFER_FLUSHING,this.hls.trigger(v.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}break;default:break}},i.onBufferFlushed=function(){var e=this,r=this.pendingData;r&&r.length?(g.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),r.forEach(function(l){e.hls.trigger(v.default.BUFFER_APPENDING,l)}),this.appended=!0,this.pendingData=[],this.state=rt.PARSED):(this.state=rt.IDLE,this.fragPrevious=null,this.tick())},Fl(d,[{key:"state",set:function(e){if(this.state!==e){var r=this.state;this._state=e,g.logger.log("audio stream:"+r+"->"+e)}},get:function(){return this._state}}]),d})(lu),hh=_h,Tp=(function(){if(typeof window<"u"&&window.VTTCue)return window.VTTCue;var h="auto",d={"":!0,lr:!0,rl:!0},i={start:!0,middle:!0,end:!0,left:!0,right:!0};function o(_){if(typeof _!="string")return!1;var R=d[_.toLowerCase()];return R?_.toLowerCase():!1}function e(_){if(typeof _!="string")return!1;var R=i[_.toLowerCase()];return R?_.toLowerCase():!1}function r(_){for(var R=1;R100)throw new Error("Position must be between 0 and 100.");Oa=Ue,this.hasBeenReset=!0}})),Object.defineProperty(I,"positionAlign",r({},P,{get:function(){return ca},set:function(Ue){var Yr=e(Ue);if(!Yr)throw new SyntaxError("An invalid or illegal string was specified.");ca=Yr,this.hasBeenReset=!0}})),Object.defineProperty(I,"size",r({},P,{get:function(){return Io},set:function(Ue){if(Ue<0||Ue>100)throw new Error("Size must be between 0 and 100.");Io=Ue,this.hasBeenReset=!0}})),Object.defineProperty(I,"align",r({},P,{get:function(){return cn},set:function(Ue){var Yr=e(Ue);if(!Yr)throw new SyntaxError("An invalid or illegal string was specified.");cn=Yr,this.hasBeenReset=!0}})),I.displayState=void 0}return l.prototype.getCueAsHTML=function(){var _=window.WebVTT;return _.convertCueToDOMTree(window,this.text)},l})(),gh=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};function Ep(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new gh,this.regionList=[]}function Dh(h){function d(o,e,r,l){return(o|0)*3600+(e|0)*60+(r|0)+(l|0)/1e3}var i=h.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?d(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?d(i[1],i[2],0,i[4]):d(0,i[1],i[2],i[4]):null}function wp(){this.values=Object.create(null)}wp.prototype={set:function(d,i){!this.get(d)&&i!==""&&(this.values[d]=i)},get:function(d,i,o){return o?this.has(d)?this.values[d]:i[o]:this.has(d)?this.values[d]:i},has:function(d){return d in this.values},alt:function(d,i,o){for(var e=0;e=0&&i<=100)?(this.set(d,i),!0):!1}};function Fp(h,d,i,o){var e=o?h.split(o):[h];for(var r in e)if(typeof e[r]=="string"){var l=e[r].split(i);if(l.length===2){var _=l[0],R=l[1];d(_,R)}}}var Cl=new Tp(0,0,0),Mo=Cl.align==="middle"?"middle":"center";function yh(h,d,i){var o=h;function e(){var _=Dh(h);if(_===null)throw new Error("Malformed timestamp: "+o);return h=h.replace(/^[^\sa-zA-Z-]+/,""),_}function r(_,R){var b=new wp;Fp(_,function(N,j){switch(N){case"region":for(var it=i.length-1;it>=0;it--)if(i[it].id===j){b.set(N,i[it].region);break}break;case"vertical":b.alt(N,j,["rl","lr"]);break;case"line":var vt=j.split(","),Mt=vt[0];b.integer(N,Mt),b.percent(N,Mt)&&b.set("snapToLines",!1),b.alt(N,Mt,["auto"]),vt.length===2&&b.alt("lineAlign",vt[1],["start",Mo,"end"]);break;case"position":vt=j.split(","),b.percent(N,vt[0]),vt.length===2&&b.alt("positionAlign",vt[1],["start",Mo,"end","line-left","line-right","auto"]);break;case"size":b.percent(N,j);break;case"align":b.alt(N,j,["start",Mo,"end","left","right"]);break}},/:/,/\s/),R.region=b.get("region",null),R.vertical=b.get("vertical","");var I=b.get("line","auto");I==="auto"&&Cl.line===-1&&(I=-1),R.line=I,R.lineAlign=b.get("lineAlign","start"),R.snapToLines=b.get("snapToLines",!0),R.size=b.get("size",100),R.align=b.get("align",Mo);var P=b.get("position","auto");P==="auto"&&Cl.position===50&&(P=R.align==="start"||R.align==="left"?0:R.align==="end"||R.align==="right"?100:50),R.position=P}function l(){h=h.replace(/^\s+/,"")}if(l(),d.startTime=e(),l(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);h=h.substr(3),l(),d.endTime=e(),l(),r(h,d)}function Cp(h){return h.replace(//gi,` `)}Ep.prototype={parse:function(d){var i=this;d&&(i.buffer+=i.decoder.decode(d,{stream:!0}));function o(){var b=i.buffer,I=0;for(b=Cp(b);I")===-1){i.cue.id=r;continue}case"CUE":try{yh(r,i.cue,i.regionList)}catch{i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var R=r.indexOf("-->")!==-1;if(!r||R&&(_=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+=` `),i.cue.text+=r;continue;case"BADCUE":r||(i.state="ID");continue}}}catch{i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var d=this;try{if(d.buffer+=d.decoder.decode(),(d.cue||d.state==="HEADER")&&(d.buffer+=` `,d.parse()),d.state==="INITIAL")throw new Error("Malformed WebVTT signature.")}catch(i){throw i}return d.onflush&&d.onflush(),this}};var Rh=Ep;function bh(h,d,i,o){for(var e,r,l,_,R,b=window.VTTCue||TextTrackCue,I=0;I=16?_--:_++,navigator.userAgent.match(/Firefox\//)?r.line=I+1:r.line=I>7?I-2:I+1,r.align="left",r.position=Math.max(0,Math.min(100,100*(_/32))),h.addCue(r)}}var us={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},Sp=function(d){var i=d;return us.hasOwnProperty(d)&&(i=us[d]),String.fromCharCode(i)},Pa=15,du=100,Th={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Eh={17:2,18:4,21:6,22:8,23:10,19:13,20:15},wh={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Fh={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Ch=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],Mp;(function(h){h[h.ERROR=0]="ERROR",h[h.TEXT=1]="TEXT",h[h.WARNING=2]="WARNING",h[h.INFO=2]="INFO",h[h.DEBUG=3]="DEBUG",h[h.DATA=3]="DATA"})(Mp||(Mp={}));var qe={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(d){this.time=d},log:function(d,i){var o=this.verboseFilter[d];this.verboseLevel>=o}},ai=function(d){for(var i=[],o=0;odu&&(qe.log("ERROR","Too large cursor position "+this.pos),this.pos=du)},d.moveCursor=function(o){var e=this.pos+o;if(o>1)for(var r=this.pos+1;r=144&&this.backSpace();var e=Sp(o);if(this.pos>=du){qe.log("ERROR","Cannot insert "+o.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1)},d.clearFromPos=function(o){var e;for(e=o;e0&&(o?r="["+e.join(" | ")+"]":r=e.join(` `)),r},d.getTextAndFormat=function(){return this.rows},h})(),Oc=(function(){function h(i,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=i,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new je,this.nonDisplayedMemory=new je,this.lastOutputScreen=new je,this.currRollUpRow=this.displayedMemory.rows[Pa-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}var d=h.prototype;return d.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[Pa-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},d.getHandler=function(){return this.outputFilter},d.setHandler=function(o){this.outputFilter=o},d.setPAC=function(o){this.writeScreen.setPAC(o)},d.setBkgData=function(o){this.writeScreen.setBkgData(o)},d.setMode=function(o){o!==this.mode&&(this.mode=o,qe.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)},d.insertChars=function(o){for(var e=0;e=46,e.italics)e.foreground="white";else{var r=Math.floor(o/2)-16,l=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=l[r]}qe.log("INFO","MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},d.outputDataUpdate=function(o){o===void 0&&(o=!1);var e=qe.time;e!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=e:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e),this.lastOutputScreen.copy(this.displayedMemory))},d.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},h})(),Uc=(function(){function h(i,o,e){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=i||1,this.outputs=[o,e],this.channels=[new Oc(1,o),new Oc(2,e)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}var d=h.prototype;return d.getHandler=function(o){return this.channels[o].getHandler()},d.setHandler=function(o,e){this.channels[o].setHandler(e)},d.addData=function(o,e){var r,l,_,R=!1;this.lastTime=o,qe.setTime(o);for(var b=0;b ("+ai([l,_])+")");if(r=this.parseCmd(l,_),r||(r=this.parseMidrow(l,_)),r||(r=this.parsePAC(l,_)),r||(r=this.parseBackgroundAttributes(l,_)),!r&&(R=this.parseChars(l,_),R))if(this.currChNr&&this.currChNr>=0){var I=this.channels[this.currChNr-1];I.insertChars(R)}else qe.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:R?this.dataCounters.char+=2:(this.dataCounters.other+=2,qe.log("WARNING","Couldn't parse cleaned data "+ai([l,_])+" orig: "+ai([e[b],e[b+1]])))}},d.parseCmd=function(o,e){var r=null,l=(o===20||o===28)&&e>=32&&e<=47,_=(o===23||o===31)&&e>=33&&e<=35;if(!(l||_))return!1;if(o===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,qe.log("DEBUG","Repeated command ("+ai([o,e])+") is dropped"),!0;o===20||o===23?r=1:r=2;var R=this.channels[r-1];return o===20||o===28?e===32?R.ccRCL():e===33?R.ccBS():e===34?R.ccAOF():e===35?R.ccAON():e===36?R.ccDER():e===37?R.ccRU(2):e===38?R.ccRU(3):e===39?R.ccRU(4):e===40?R.ccFON():e===41?R.ccRDC():e===42?R.ccTR():e===43?R.ccRTD():e===44?R.ccEDM():e===45?R.ccCR():e===46?R.ccENM():e===47&&R.ccEOC():R.ccTO(e-32),this.lastCmdA=o,this.lastCmdB=e,this.currChNr=r,!0},d.parseMidrow=function(o,e){var r=null;if((o===17||o===25)&&e>=32&&e<=47){if(o===17?r=1:r=2,r!==this.currChNr)return qe.log("ERROR","Mismatch channel in midrow parsing"),!1;var l=this.channels[r-1];return l.ccMIDROW(e),qe.log("DEBUG","MIDROW ("+ai([o,e])+")"),!0}return!1},d.parsePAC=function(o,e){var r=null,l=null,_=(o>=17&&o<=23||o>=25&&o<=31)&&e>=64&&e<=127,R=(o===16||o===24)&&e>=64&&e<=95;if(!(_||R))return!1;if(o===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=o<=23?1:2,e>=64&&e<=95?l=r===1?Th[o]:wh[o]:l=r===1?Eh[o]:Fh[o];var b=this.interpretPAC(l,e),I=this.channels[r-1];return I.setPAC(b),this.lastCmdA=o,this.lastCmdB=e,this.currChNr=r,!0},d.interpretPAC=function(o,e){var r=e,l={color:null,italics:!1,indent:null,underline:!1,row:o};return e>95?r=e-96:r=e-64,l.underline=(r&1)===1,r<=13?l.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(l.italics=!0,l.color="white"):l.indent=Math.floor((r-16)/2)*4,l},d.parseChars=function(o,e){var r=null,l=null,_=null;if(o>=25?(r=2,_=o-8):(r=1,_=o),_>=17&&_<=19){var R=e;_===17?R=e+80:_===18?R=e+112:R=e+144,qe.log("INFO","Special char '"+Sp(R)+"' in channel "+r),l=[R]}else o>=32&&o<=127&&(l=e===0?[o]:[o,e]);if(l){var b=ai(l);qe.log("DEBUG","Char codes = "+b.join(",")),this.lastCmdA=null,this.lastCmdB=null}return l},d.parseBackgroundAttributes=function(o,e){var r,l,_,R,b=(o===16||o===24)&&e>=32&&e<=47,I=(o===23||o===31)&&e>=45&&e<=47;return b||I?(r={},o===16||o===24?(l=Math.floor((e-32)/2),r.background=Ch[l],e%2===1&&(r.background=r.background+"_semi")):e===45?r.background="transparent":(r.foreground="black",e===47&&(r.underline=!0)),_=o<24?1:2,R=this.channels[_-1],R.setBkgData(r),this.lastCmdA=null,this.lastCmdB=null,!0):!1},d.reset=function(){for(var o=0;oo)&&(this.startTime=o),this.endTime=e,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},h})(),ls=function(d,i,o){return d.substr(o||0,i.length)===i},Ah=function(d){var i=parseInt(d.substr(-3)),o=parseInt(d.substr(-6,2)),e=parseInt(d.substr(-9,2)),r=d.length>9?parseInt(d.substr(0,d.indexOf(":"))):0;if(!Object(w.isFiniteNumber)(i)||!Object(w.isFiniteNumber)(o)||!Object(w.isFiniteNumber)(e)||!Object(w.isFiniteNumber)(r))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+d);return i+=1e3*o,i+=60*1e3*e,i+=3600*1e3*r,i},kc=function(d){for(var i=5381,o=d.length;o;)i=i*33^d.charCodeAt(--o);return(i>>>0).toString()},xh=function(d,i,o){var e=d[i],r=d[e.prevCC];if(!r||!r.new&&e.new){d.ccOffset=d.presentationOffset=e.start,e.new=!1;return}for(;r&&r.new;)d.ccOffset+=e.start-r.start,e.new=!1,e=r,r=d[e.prevCC];d.presentationOffset=o},Lh={parse:function(d,i,o,e,r,l){var _=/\r\n|\n\r|\n|\r/g,R=Object(Nc.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(_,` `).split(` `),b="00:00.000",I=0,P=0,N=0,j=[],it,vt=!0,Mt=!1,se=new Rh;se.oncue=function(re){var ce=o[e],Re=o.ccOffset;ce&&ce.new&&(P!==void 0?Re=o.ccOffset=ce.start:xh(o,e,N)),N&&(Re=N-o.presentationOffset),Mt&&(re.startTime+=Re-P,re.endTime+=Re-P),re.id=kc(re.startTime.toString())+kc(re.endTime.toString())+kc(re.text),re.text=decodeURIComponent(encodeURIComponent(re.text)),re.endTime>0&&j.push(re)},se.onparsingerror=function(re){it=re},se.onflush=function(){if(it&&l){l(it);return}r(j)},R.forEach(function(re){if(vt)if(ls(re,"X-TIMESTAMP-MAP=")){vt=!1,Mt=!0,re.substr(16).split(",").forEach(function(ce){ls(ce,"LOCAL:")?b=ce.substr(6):ls(ce,"MPEGTS:")&&(I=parseInt(ce.substr(7)))});try{i+(o[e].start*9e4||0)<0&&(i+=8589934592),I-=i,P=Ah(b)/1e3,N=I/9e4}catch(ce){Mt=!1,it=ce}return}else re===""&&(vt=!1);se.parse(re+` `)}),se.flush()}},Nh=Lh;function Ap(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function Ph(h,d){h.prototype=Object.create(d.prototype),h.prototype.constructor=h,h.__proto__=d}var Oh=(function(h){Ph(d,h);function d(o){var e;if(e=h.call(this,o,v.default.MEDIA_ATTACHING,v.default.MEDIA_DETACHING,v.default.FRAG_PARSING_USERDATA,v.default.FRAG_DECRYPTED,v.default.MANIFEST_LOADING,v.default.MANIFEST_LOADED,v.default.FRAG_LOADED,v.default.INIT_PTS_FOUND)||this,e.media=null,e.config=void 0,e.enabled=!0,e.Cues=void 0,e.textTracks=[],e.tracks=[],e.initPTS=[],e.unparsedVttFrags=[],e.cueRanges=[],e.captionsTracks={},e.captionsProperties=void 0,e.cea608Parser=void 0,e.lastSn=-1,e.prevCC=-1,e.vttCCs=null,e.hls=o,e.config=o.config,e.Cues=o.config.cueHandler,e.captionsProperties={textTrack1:{label:e.config.captionsTextTrack1Label,languageCode:e.config.captionsTextTrack1LanguageCode},textTrack2:{label:e.config.captionsTextTrack2Label,languageCode:e.config.captionsTextTrack2LanguageCode}},e.config.enableCEA708Captions){var r=new Ip(Ap(e),"textTrack1"),l=new Ip(Ap(e),"textTrack2");e.cea608Parser=new Ih(0,r,l)}return e}var i=d.prototype;return i.addCues=function(e,r,l,_){for(var R=this.cueRanges,b=!1,I=R.length;I--;){var P=R[I],N=Uh(P[0],P[1],r,l);if(N>=0&&(P[0]=Math.min(P[0],r),P[1]=Math.max(P[1],l),b=!0,N/(l-r)>.5))return}b||R.push([r,l]),this.Cues.newCue(this.captionsTracks[e],r,l,_)},i.onInitPtsFound=function(e){var r=this,l=e.frag,_=e.id,R=e.initPTS,b=this.unparsedVttFrags;_==="main"&&(this.initPTS[l.cc]=R),b.length&&(this.unparsedVttFrags=[],b.forEach(function(I){r.onFragLoaded(I)}))},i.getExistingTrack=function(e){var r=this.media;if(r)for(var l=0;l=b.length||l!==R||!I||this.stopped){this._clearReloadTimer();return}if(g.logger.log("subtitle track "+l+" loaded"),_.live){var P=Cn(I.details,_,e.stats.trequest);g.logger.log("Reloading live subtitle playlist in "+P+"ms"),this.timer=setTimeout(function(){r._loadCurrentTrack()},P)}else this._clearReloadTimer()},i.startLoad=function(){this.stopped=!1,this._loadCurrentTrack()},i.stopLoad=function(){this.stopped=!0,this._clearReloadTimer()},i._clearReloadTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},i._loadCurrentTrack=function(){var e=this.trackId,r=this.tracks,l=this.hls,_=r[e];e<0||!_||_.details&&!_.details.live||(g.logger.log("Loading subtitle track "+e),l.trigger(v.default.SUBTITLE_TRACK_LOADING,{url:_.url,id:e}))},i._toggleTrackModes=function(e){var r=this.media,l=this.subtitleDisplay,_=this.trackId;if(r){var R=f(r.textTracks);if(e===-1)[].slice.call(R).forEach(function(P){P.mode="disabled"});else{var b=R[_];b&&(b.mode="disabled")}var I=R[e];I&&(I.mode=l?"showing":"hidden")}},i._setSubtitleTrackInternal=function(e){var r=this.hls,l=this.tracks;!Object(w.isFiniteNumber)(e)||e<-1||e>=l.length||(this.trackId=e,g.logger.log("Switching to subtitle track "+e),r.trigger(v.default.SUBTITLE_TRACK_SWITCH,{id:e}),this._loadCurrentTrack())},i._onTextTracksChanged=function(){if(this.media){for(var e=-1,r=f(this.media.textTracks),l=0;l=_[I].start&&b<=_[I].end){R=_[I];break}var P=r.start+r.duration;R?R.end=P:(R={start:b,end:P},_.push(R))}}},i.onMediaAttached=function(e){var r=e.media;this.media=r,r.addEventListener("seeking",this._onMediaSeeking),this.state=rt.IDLE},i.onMediaDetaching=function(){var e=this;this.media&&(this.media.removeEventListener("seeking",this._onMediaSeeking),this.fragmentTracker.removeAllFragments(),this.currentTrackId=-1,this.tracks.forEach(function(r){e.tracksBuffered[r.id]=[]}),this.media=null,this.state=rt.STOPPED)},i.onError=function(e){var r=e.frag;!r||r.type!=="subtitle"||(this.state=rt.IDLE)},i.onSubtitleTracksUpdated=function(e){var r=this;g.logger.log("subtitle tracks updated"),this.tracksBuffered=[],this.tracks=e.subtitleTracks,this.tracks.forEach(function(l){r.tracksBuffered[l.id]=[]})},i.onSubtitleTrackSwitch=function(e){if(this.currentTrackId=e.id,!this.tracks||!this.tracks.length||this.currentTrackId===-1){this.clearInterval();return}var r=this.tracks[this.currentTrackId];r&&r.details&&this.setInterval(he)},i.onSubtitleTrackLoaded=function(e){var r=e.id,l=e.details,_=this.currentTrackId,R=this.tracks,b=R[_];r>=R.length||r!==_||!b||(l.live&&Xt(b.details,l,this.lastAVStart),b.details=l,this.setInterval(he))},i.onKeyLoaded=function(){this.state===rt.KEY_LOADING&&(this.state=rt.IDLE)},i.onFragLoaded=function(e){var r=this.fragCurrent,l=e.frag.decryptdata,_=e.frag,R=this.hls;if(this.state===rt.FRAG_LOADING&&r&&e.frag.type==="subtitle"&&r.sn===e.frag.sn&&e.payload.byteLength>0&&l&&l.key&&l.method==="AES-128"){var b=It.now();this.decrypter.decrypt(e.payload,l.key.buffer,l.iv.buffer,function(I){var P=It.now();R.trigger(v.default.FRAG_DECRYPTED,{frag:_,payload:I,stats:{tstart:b,tdecrypt:P}})})}},i.onLevelUpdated=function(e){var r=e.details,l=r.fragments;this.lastAVStart=l.length?l[0].start:0},i.doTick=function(){if(!this.media){this.state=rt.IDLE;return}switch(this.state){case rt.IDLE:{var e=this.config,r=this.currentTrackId,l=this.fragmentTracker,_=this.media,R=this.tracks;if(!R||!R[r]||!R[r].details)break;var b=e.maxBufferHole,I=e.maxFragLookUpTolerance,P=Math.min(e.maxBufferLength,e.maxMaxBufferLength),N=L.bufferedInfo(this._getBuffered(),_.currentTime,b),j=N.end,it=N.len,vt=R[r].details,Mt=vt.fragments,se=Mt.length,re=Mt[se-1].start+Mt[se-1].duration;if(it>P)return;var ce,Re=this.fragPrevious;jNp){this.hls.trigger(v.default.ERROR,{type:m.ErrorTypes.KEY_SYSTEM_ERROR,details:m.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var R=Np-this._requestLicenseFailureCount+1;g.logger.warn("Retrying license request, "+R+" attempts left"),this._requestLicense(l,_)}break}},i._generateLicenseRequestChallenge=function(e,r){if(e.mediaKeySystemDomain===kn.WIDEVINE)return r;throw new Error("unsupported key-system: "+e.mediaKeySystemDomain)},i._requestLicense=function(e,r){g.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){g.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(v.default.ERROR,{type:m.ErrorTypes.KEY_SYSTEM_ERROR,details:m.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var _=this.getLicenseServerUrl(l.mediaKeySystemDomain),R=this._createLicenseXhr(_,e,r);g.logger.log("Sending license request to URL: "+_);var b=this._generateLicenseRequestChallenge(l,e);R.send(b)}catch(I){g.logger.error("Failure requesting DRM license: "+I),this.hls.trigger(v.default.ERROR,{type:m.ErrorTypes.KEY_SYSTEM_ERROR,details:m.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},i.onMediaAttached=function(e){if(this._emeEnabled){var r=e.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)}},i.onMediaDetached=function(){this._media&&(this._media.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null)},i.onManifestParsed=function(e){if(this._emeEnabled){var r=e.levels.map(function(_){return _.audioCodec}),l=e.levels.map(function(_){return _.videoCodec});this._attemptKeySystemAccess(kn.WIDEVINE,r,l)}},Wh(d,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),d})(E),Bh=Op;function Jh(h){for(var d=1;dr)return _}return 0}},{key:"maxAutoLevel",get:function(){var e=this.levels,r=this.autoLevelCapping,l;return r===-1&&e&&e.length?l=e.length-1:l=r,l}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var r=this.audioTrackController;r&&(r.audioTrack=e)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var r=this.subtitleTrackController;r&&(r.subtitleTrack=e)}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return e?e.subtitleDisplay:!1},set:function(e){var r=this.subtitleTrackController;r&&(r.subtitleDisplay=e)}}]),d})(K);Bp.defaultConfig=void 0}),"./src/polyfills/number-isFinite.js":(function(t,n,a){"use strict";a.r(n),a.d(n,"isFiniteNumber",function(){return u});var u=Number.isFinite||function(c){return typeof c=="number"&&isFinite(c)}}),"./src/utils/get-self-scope.js":(function(t,n,a){"use strict";a.r(n),a.d(n,"getSelfScope",function(){return u});function u(){return typeof window>"u"?self:window}}),"./src/utils/logger.js":(function(t,n,a){"use strict";a.r(n),a.d(n,"enableLogs",function(){return E}),a.d(n,"logger",function(){return x});var u=a("./src/utils/get-self-scope.js");function c(){}var m={trace:c,debug:c,log:c,warn:c,info:c,error:c},w=m;function v(C,M){return M="["+C+"] > "+M,M}var g=Object(u.getSelfScope)();function k(C){var M=g.console[C];return M?function(){for(var U=arguments.length,B=new Array(U),Q=0;Q1?M-1:0),B=1;B{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.Direction=void 0;var wk;(function(t){t.Right="to right",t.Left="to left",t.Down="to bottom",t.Up="to top"})(wk=ap.Direction||(ap.Direction={}))});var vD=oi(xe=>{"use strict";var op=xe&&xe.__spreadArray||function(t,n,a){if(a||arguments.length===2)for(var u=0,c=n.length,m;ut)return g;if(k&&ku)return u;if(t=a)throw new RangeError("min (".concat(n,") is equal/bigger than max (").concat(a,")"));if(ta)throw new RangeError("value (".concat(t,") is bigger than max (").concat(a,")"))}xe.checkBoundaries=Ak;function xk(t,n,a){return ta?a:t}xe.checkValuesAgainstBoundaries=xk;function Lk(t){if(!(t.length<2)&&!t.slice(1).every(function(n,a){return t[a]<=n}))throw new RangeError("values={[".concat(t,"]} needs to be sorted when allowOverlap={false}"))}xe.checkInitialOverlap=Lk;function Nk(t){var n=window.getComputedStyle(t);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)}}xe.getMargin=Nk;function Pk(t){var n=window.getComputedStyle(t);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)}}xe.getPaddingAndBorder=Pk;function Ok(t,n,a){var u=a?-1:1;t.forEach(function(c,m){return cS(c,u*n[m].x,n[m].y)})}xe.translateThumbs=Ok;function Uk(t,n,a,u){for(var c=0,m=iS(t[0],n,a,u),w=1;ww?g:w},t.getBoundingClientRect().width));return m},Jk=function(t,n,a,u,c,m,w){w===void 0&&(w=function(k){return k});var v=[],g=function(k){var y=uS(a[k],u[k],c,m,w),E=n[k].x;n.forEach(function(x,C){var M=x.x,U=uS(a[C],u[C],c,m,w);k!==C&&(E>=M&&E<=M+U||E+y>=M&&E+y<=M+U)&&(v.includes(C)||(v.push(k),v.push(C),v=op(op([],v,!0),[k,C],!1),g(C)))})};return g(t),Array.from(new Set(v.sort()))},Gk=function(t,n,a,u,c,m){u===void 0&&(u=.1),c===void 0&&(c=" - "),m===void 0&&(m=function(C){return C});var w=(0,xe.getStepDecimals)(u),v=(0,pD.useState)({}),g=v[0],k=v[1],y=(0,pD.useState)(m(n[a].toFixed(w))),E=y[0],x=y[1];return(0,pD.useEffect)(function(){if(t){var C=t.getThumbs();if(C.length<1)return;var M={},U=t.getOffsets(),B=Jk(a,U,C,n,c,w,m),Q=m(n[a].toFixed(w));if(B.length){var z=B.reduce(function(_t,ne,le,fe){return _t.length?op(op([],_t,!0),[U[fe[le]].x],!1):[U[fe[le]].x]},[]);if(Math.min.apply(Math,z)===U[a].x){var et=[];B.forEach(function(_t){et.push(n[_t].toFixed(w))}),Q=Array.from(new Set(et.sort(function(_t,ne){return parseFloat(_t)-parseFloat(ne)}))).map(m).join(c);var at=Math.min.apply(Math,z),nt=Math.max.apply(Math,z),mt=C[B[z.indexOf(nt)]].getBoundingClientRect().width;M.left="".concat(Math.abs(at-(nt+mt))/2,"px"),M.transform="translate(-50%, 0)"}else M.visibility="hidden"}x(Q),k(M)}},[t,n]),[E,g]};xe.useThumbOverlap=Gk;function iS(t,n,a,u){var c=t.getBoundingClientRect(),m=c.left,w=c.top,v=c.width,g=c.height;return lS(u)?Math.abs(a-(w+g/2)):Math.abs(n-(m+v/2))}});var sS=oi(To=>{"use strict";var qk=To&&To.__extends||(function(){var t=function(n,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var m in c)Object.prototype.hasOwnProperty.call(c,m)&&(u[m]=c[m])},t(n,a)};return function(n,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");t(n,a);function u(){this.constructor=n}n.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u)}})(),jk=To&&To.__createBinding||(Object.create?(function(t,n,a,u){u===void 0&&(u=a);var c=Object.getOwnPropertyDescriptor(n,a);(!c||("get"in c?!n.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return n[a]}}),Object.defineProperty(t,u,c)}):(function(t,n,a,u){u===void 0&&(u=a),t[u]=n[a]})),zk=To&&To.__setModuleDefault||(Object.create?(function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}):function(t,n){t.default=n}),Vk=To&&To.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var a in t)a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)&&jk(n,t,a);return zk(n,t),n},fS=To&&To.__spreadArray||function(t,n,a){if(a||arguments.length===2)for(var u=0,c=n.length,m;u1&&u.props.draggableTrack){if(u.thumbRefs.some(function(v){var g;return(g=v.current)===null||g===void 0?void 0:g.contains(c.target)}))return;u.setState({draggedTrackPos:[c.clientX,c.clientY]},function(){return u.onMove(c.clientX,c.clientY)})}else{var w=(0,Dn.getClosestThumbIndex)(u.thumbRefs.map(function(v){return v.current}),c.clientX,c.clientY,u.props.direction);(m=u.thumbRefs[w].current)===null||m===void 0||m.focus(),u.setState({draggedThumbIndex:w},function(){return u.onMove(c.clientX,c.clientY)})}},u.onResize=function(){(0,Dn.translateThumbs)(u.getThumbs(),u.getOffsets(),u.props.rtl),u.calculateMarkOffsets()},u.onTouchStartTrack=function(c){var m;if(c.persist(),u.addTouchEvents(c.nativeEvent),u.props.values.length>1&&u.props.draggableTrack){if(u.thumbRefs.some(function(v){var g;return(g=v.current)===null||g===void 0?void 0:g.contains(c.target)}))return;u.setState({draggedTrackPos:[c.touches[0].clientX,c.touches[0].clientY]},function(){return u.onMove(c.touches[0].clientX,c.touches[0].clientY)})}else{var w=(0,Dn.getClosestThumbIndex)(u.thumbRefs.map(function(v){return v.current}),c.touches[0].clientX,c.touches[0].clientY,u.props.direction);(m=u.thumbRefs[w].current)===null||m===void 0||m.focus(),u.setState({draggedThumbIndex:w},function(){return u.onMove(c.touches[0].clientX,c.touches[0].clientY)})}},u.onMouseOrTouchStart=function(c){if(!u.props.disabled){var m=(0,Dn.isTouchEvent)(c);if(!(!m&&c.button!==0)){var w=u.getTargetIndex(c);w!==-1&&(m?u.addTouchEvents(c):u.addMouseEvents(c),u.setState({draggedThumbIndex:w,thumbZIndexes:u.state.thumbZIndexes.map(function(v,g){return g===w?Math.max.apply(Math,u.state.thumbZIndexes):v<=u.state.thumbZIndexes[w]?v:v-1})}))}}},u.onMouseMove=function(c){c.preventDefault(),u.onMove(c.clientX,c.clientY)},u.onTouchMove=function(c){c.preventDefault(),u.onMove(c.touches[0].clientX,c.touches[0].clientY)},u.onKeyDown=function(c){var m=u.props,w=m.values,v=m.onChange,g=m.step,k=m.rtl,y=m.direction,E=u.state.isChanged,x=u.getTargetIndex(c.nativeEvent),C=k||y===Nr.Direction.Left||y===Nr.Direction.Down?-1:1;x!==-1&&(Kk.includes(c.key)?(c.preventDefault(),u.setState({draggedThumbIndex:x,isChanged:!0}),v((0,Dn.replaceAt)(w,x,u.normalizeValue(w[x]+C*(c.key==="PageUp"?g*10:g),x)))):Yk.includes(c.key)?(c.preventDefault(),u.setState({draggedThumbIndex:x,isChanged:!0}),v((0,Dn.replaceAt)(w,x,u.normalizeValue(w[x]-C*(c.key==="PageDown"?g*10:g),x)))):c.key==="Tab"?u.setState({draggedThumbIndex:-1},function(){E&&u.fireOnFinalChange()}):E&&u.fireOnFinalChange())},u.onKeyUp=function(c){var m=u.state.isChanged;u.setState({draggedThumbIndex:-1},function(){m&&u.fireOnFinalChange()})},u.onMove=function(c,m){var w=u.state,v=w.draggedThumbIndex,g=w.draggedTrackPos,k=u.props,y=k.direction,E=k.min,x=k.max,C=k.onChange,M=k.values,U=k.step,B=k.rtl;if(v===-1&&g[0]===-1&&g[1]===-1)return null;var Q=u.trackRef.current;if(!Q)return null;var z=Q.getBoundingClientRect(),et=(0,Dn.isVertical)(y)?z.height:z.width;if(g[0]!==-1&&g[1]!==-1){var at=c-g[0],nt=m-g[1],mt=0;switch(y){case Nr.Direction.Right:case Nr.Direction.Left:mt=at/et*(x-E);break;case Nr.Direction.Down:case Nr.Direction.Up:mt=nt/et*(x-E);break;default:(0,Dn.assertUnreachable)(y)}if(B&&(mt*=-1),Math.abs(mt)>=U/2){for(var _t=0;_tx?mt=x-M[_t]:ne=U/2&&C((0,Dn.replaceAt)(M,v,u.normalizeValue(fe,v)))}},u.normalizeValue=function(c,m){var w=u.props,v=w.min,g=w.max,k=w.step,y=w.allowOverlap,E=w.values;return(0,Dn.normalizeValue)(c,m,v,g,k,y,E)},u.onEnd=function(c){if(c.preventDefault(),document.removeEventListener("mousemove",u.schdOnMouseMove),document.removeEventListener("touchmove",u.schdOnTouchMove),document.removeEventListener("mouseup",u.schdOnEnd),document.removeEventListener("touchend",u.schdOnEnd),document.removeEventListener("touchcancel",u.schdOnEnd),u.state.draggedThumbIndex===-1&&u.state.draggedTrackPos[0]===-1&&u.state.draggedTrackPos[1]===-1)return null;u.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){u.fireOnFinalChange()})},u.fireOnFinalChange=function(){u.setState({isChanged:!1});var c=u.props,m=c.onFinalChange,w=c.values;m&&m(w)},u.updateMarkRefs=function(c){if(!c.renderMark){u.numOfMarks=void 0,u.markRefs=void 0;return}u.numOfMarks=(c.max-c.min)/u.props.step,u.markRefs=[];for(var m=0;m-1?"grabbing":this.props.draggableTrack?(0,Dn.isVertical)(this.props.direction)?"ns-resize":"ew-resize":g.length===1&&!x?"pointer":"inherit"},onMouseDown:x?Dn.voidFn:this.onMouseDownTrack,onTouchStart:x?Dn.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:x,children:fS(fS([],B.map(function(Q,z,et){return v({props:{style:a.props.direction===Nr.Direction.Left||a.props.direction===Nr.Direction.Right?{position:"absolute",left:"".concat(Q[0],"px"),marginTop:"".concat(Q[1],"px")}:{position:"absolute",top:"".concat(Q[0],"px"),marginLeft:"".concat(Q[1],"px")},key:"mark".concat(z),ref:a.markRefs[z]},index:z})}),!0),g.map(function(Q,z){var et=a.state.draggedThumbIndex===z;return m({index:z,value:Q,isDragged:et,props:{style:{position:"absolute",zIndex:U[z],cursor:x?"inherit":et?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:z,tabIndex:x?void 0:0,"aria-valuemax":E?y:g[z+1]||y,"aria-valuemin":E?k:g[z-1]||k,"aria-valuenow":Q,draggable:!1,ref:a.thumbRefs[z],role:"slider",onKeyDown:x?Dn.voidFn:a.onKeyDown,onKeyUp:x?Dn.voidFn:a.onKeyUp}})}),!0)})},n.defaultProps={step:1,direction:Nr.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},n})(O_.Component);To.default=Qk});var dS=oi(Da=>{"use strict";var Xk=Da&&Da.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Da,"__esModule",{value:!0});Da.checkValuesAgainstBoundaries=Da.relativeValue=Da.useThumbOverlap=Da.Direction=Da.getTrackBackground=Da.Range=void 0;var Zk=Xk(sS());Da.Range=Zk.default;var U_=vD();Object.defineProperty(Da,"getTrackBackground",{enumerable:!0,get:function(){return U_.getTrackBackground}});Object.defineProperty(Da,"useThumbOverlap",{enumerable:!0,get:function(){return U_.useThumbOverlap}});Object.defineProperty(Da,"relativeValue",{enumerable:!0,get:function(){return U_.relativeValue}});Object.defineProperty(Da,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return U_.checkValuesAgainstBoundaries}});var t$=P_();Object.defineProperty(Da,"Direction",{enumerable:!0,get:function(){return t$.Direction}})});var WG={};kD(WG,{boot:()=>$G});var Hc={compose:function(t){return function(n){return function(a){return t(n(a))}}}};var Ot=function(t){return t.identity},$t={identity:function(t){return t},Semigroupoid0:function(){return Hc}};var ue=!0;var vs=function(t){return function(n){return function(a){return function(u){return t(n(a))(n(u))}}}},Ve=function(t){return function(n){return function(a){return t(a)(n)}}},Kt=function(t){return function(n){return t}};var WD=function(t){return function(n){for(var a=n.length,u=new Array(a),c=0;c="0"&&t[c]<="9"?"\\&":"";return"\\"+a.charCodeAt(0).toString(10)+m})+'"'};var Xn={show:cy};var wn={show:ly};var ht=function(t){return t.show};var Ie=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),_e=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})();var dn=(function(){function t(){}return t.value=new t,t})(),Ds=function(t){return t};var zc=function(t){return t.to};var ys=function(t){return t.from};var u3=Ot($t),G=(function(){function t(){}return t.value=new t,t})(),H=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})();var ke=function(t){return function(n){return function(a){if(a instanceof G)return t;if(a instanceof H)return n(a.value0);throw new Error("Failed pattern match at Data.Maybe (line 237, column 1 - line 237, column 51): "+[t.constructor.name,n.constructor.name,a.constructor.name])}}},Lo=ke(!0)(Kt(!1)),di=ke(!1)(Kt(!0));var Ut={map:function(t){return function(n){return n instanceof H?new H(t(n.value0)):G.value}}},i3=V(Ut);var gn=function(t){return ke(t)(u3)},zn=function(){return function(t){if(t instanceof H)return t.value0;throw new Error("Failed pattern match at Data.Maybe (line 288, column 1 - line 288, column 46): "+[t.constructor.name])}};var No=function(t){var n=Wt(t);return{eq:function(a){return function(u){return a instanceof G&&u instanceof G?!0:a instanceof H&&u instanceof H?n(a.value0)(u.value0):!1}}}};var $a={apply:function(t){return function(n){if(t instanceof H)return i3(t.value0)(n);if(t instanceof G)return G.value;throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 69, column 30): "+[t.constructor.name,n.constructor.name])}},Functor0:function(){return Ut}};var nn={bind:function(t){return function(n){if(t instanceof H)return n(t.value0);if(t instanceof G)return G.value;throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 127, column 28): "+[t.constructor.name,n.constructor.name])}},Apply0:function(){return $a}};var Xr=(function(){return{pure:H.create,Apply0:function(){return $a}}})();var Xp={alt:function(t){return function(n){return t instanceof G?n:t}},Functor0:function(){return Ut}},l3=(function(){return{empty:G.value,Alt0:function(){return Xp}}})(),rg={Applicative0:function(){return Xr},Plus1:function(){return l3}};var Et=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),Ct=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})();var Po=function(t){return ke(new Et(t))(Ct.create)};var sr={map:function(t){return function(n){if(n instanceof Et)return new Et(n.value0);if(n instanceof Ct)return new Ct(t(n.value0));throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): "+[n.constructor.name])}}},f3=V(sr);var Bn=function(t){return function(n){return function(a){if(a instanceof Et)return t(a.value0);if(a instanceof Ct)return n(a.value0);throw new Error("Failed pattern match at Data.Either (line 208, column 1 - line 208, column 64): "+[t.constructor.name,n.constructor.name,a.constructor.name])}}},xl=(function(){return Bn(Kt(G.value))(H.create)})();var Zp={apply:function(t){return function(n){if(t instanceof Et)return new Et(t.value0);if(t instanceof Ct)return f3(t.value0)(n);throw new Error("Failed pattern match at Data.Either (line 70, column 1 - line 72, column 30): "+[t.constructor.name,n.constructor.name])}},Functor0:function(){return sr}};var no={bind:Bn(function(t){return function(n){return new Et(t)}})(function(t){return function(n){return n(t)}}),Apply0:function(){return Zp}};var Oo=function(t){return t};var Nu={map:function(t){return function(n){return t(n)}}};var fy={apply:function(t){return function(n){return t(n)}},Functor0:function(){return Nu}},s3={bind:function(t){return function(n){return n(t)}},Apply0:function(){return fy}},Rs={pure:Oo,Apply0:function(){return fy}},ar={Applicative0:function(){return Rs},Bind1:function(){return s3}};var mu={mempty:"",Semigroup0:function(){return zh}};var Ze=function(t){return t.mempty};var py=function(t){return function(){return t}},vy=function(t){return function(n){return function(){return n(t())()}}};var og=function(t){return function(n){return function(){for(var a=0,u=t.length;a=0;m--)u=t(a[m])(u);return u}}},Ly=function(t){return function(n){return function(a){for(var u=n,c=a.length,m=0;m=0&&t<100&&v.setUTCFullYear(t),v.getTime()};function oR(t){return function(n){return function(a){return function(u){var c=Q4(u.year,u.month-1,u.day,u.hour,u.minute,u.second,u.millisecond),m=new Date(c+a);return isNaN(m.getTime())?n:t({year:m.getUTCFullYear(),month:m.getUTCMonth()+1,day:m.getUTCDate(),hour:m.getUTCHours(),minute:m.getUTCMinutes(),second:m.getUTCSeconds(),millisecond:m.getUTCMilliseconds()})}}}}var Z4=function(t,n,a){var u=new Date(Date.UTC(t,n,a));return t>=0&&t<100&&u.setUTCFullYear(t),u};function uR(t,n,a,u){var c=Z4(n,a-1,u);return t(c.getUTCFullYear())(c.getUTCMonth()+1)(c.getUTCDate())}function Vi(t){return t.charCodeAt(0)}function iR(t){return String.fromCharCode(t)}var Rv=function(t){var n=ut(t.Applicative0()),a=Hr(t.Plus1());return function(u){if(u)return n(void 0);if(!u)return a;throw new Error("Failed pattern match at Control.Alternative (line 48, column 1 - line 48, column 54): "+[u.constructor.name])}};var cR=sn(jc),fR=Nn(jc);var Se=function(t){return t.toEnum};var He=function(t){return t.fromEnum};var Us=function(t){return function(n){return function(a){return t(n(a)+1|0)}}},ks=function(t){return function(n){return function(a){return t(n(a)-1|0)}}};var Rg=function(t){return t>=Vi(cR)&&t<=Vi(fR)?new H(iR(t)):G.value},nI={succ:Us(Rg)(Vi),pred:ks(Rg)(Vi),Ord0:function(){return Kp}};var $s=(function(){return{cardinality:Vi(fR)-Vi(cR)|0,toEnum:Rg,fromEnum:Vi,Bounded0:function(){return jc},Enum1:function(){return nI}}})();var Eg=function(t,n,a){var u=0,c;return function(m){if(u===2)return c;if(u===1)throw new ReferenceError(t+" was needed before it finished initializing (module "+n+", line "+m+")",n,m);return u=1,c=a(),u=2,c}};var Ba=(function(){function t(){}return t.value=new t,t})(),oo=(function(){function t(){}return t.value=new t,t})(),uo=(function(){function t(){}return t.value=new t,t})(),io=(function(){function t(){}return t.value=new t,t})(),lo=(function(){function t(){}return t.value=new t,t})(),co=(function(){function t(){}return t.value=new t,t})(),fo=(function(){function t(){}return t.value=new t,t})(),so=(function(){function t(){}return t.value=new t,t})(),po=(function(){function t(){}return t.value=new t,t})(),vo=(function(){function t(){}return t.value=new t,t})(),mo=(function(){function t(){}return t.value=new t,t})(),Wo=(function(){function t(){}return t.value=new t,t})();var bv=fn,Tv=fn,sR=Qr;var wg={eq:function(t){return function(n){return t instanceof Ba&&n instanceof Ba||t instanceof oo&&n instanceof oo||t instanceof uo&&n instanceof uo||t instanceof io&&n instanceof io||t instanceof lo&&n instanceof lo||t instanceof co&&n instanceof co||t instanceof fo&&n instanceof fo||t instanceof so&&n instanceof so||t instanceof po&&n instanceof po||t instanceof vo&&n instanceof vo||t instanceof mo&&n instanceof mo||t instanceof Wo&&n instanceof Wo}}},Ev={compare:function(t){return function(n){if(t instanceof Ba&&n instanceof Ba)return de.value;if(t instanceof Ba)return Nt.value;if(n instanceof Ba)return At.value;if(t instanceof oo&&n instanceof oo)return de.value;if(t instanceof oo)return Nt.value;if(n instanceof oo)return At.value;if(t instanceof uo&&n instanceof uo)return de.value;if(t instanceof uo)return Nt.value;if(n instanceof uo)return At.value;if(t instanceof io&&n instanceof io)return de.value;if(t instanceof io)return Nt.value;if(n instanceof io)return At.value;if(t instanceof lo&&n instanceof lo)return de.value;if(t instanceof lo)return Nt.value;if(n instanceof lo)return At.value;if(t instanceof co&&n instanceof co)return de.value;if(t instanceof co)return Nt.value;if(n instanceof co)return At.value;if(t instanceof fo&&n instanceof fo)return de.value;if(t instanceof fo)return Nt.value;if(n instanceof fo)return At.value;if(t instanceof so&&n instanceof so)return de.value;if(t instanceof so)return Nt.value;if(n instanceof so)return At.value;if(t instanceof po&&n instanceof po)return de.value;if(t instanceof po)return Nt.value;if(n instanceof po)return At.value;if(t instanceof vo&&n instanceof vo)return de.value;if(t instanceof vo)return Nt.value;if(n instanceof vo)return At.value;if(t instanceof mo&&n instanceof mo)return de.value;if(t instanceof mo)return Nt.value;if(n instanceof mo)return At.value;if(t instanceof Wo&&n instanceof Wo)return de.value;throw new Error("Failed pattern match at Data.Date.Component (line 0, column 0 - line 0, column 0): "+[t.constructor.name,n.constructor.name])}},Eq0:function(){return wg}},dR=Qr,wv=(function(){return{bottom:-271820,top:275759,Ord0:function(){return bv}}})();var Fv=(function(){return{bottom:Ba.value,top:Wo.value,Ord0:function(){return Ev}}})(),_o={cardinality:547580,toEnum:function(t){if(t>=-271820&&t<=275759)return new H(t);if(ue)return G.value;throw new Error("Failed pattern match at Data.Date.Component (line 35, column 1 - line 40, column 24): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return wv},Enum1:function(){return rI(0)}},rI=Eg("enumYear","Data.Date.Component",function(){return{succ:(function(){var t=Se(_o),n=He(_o);return function(a){return t((function(u){return u+1|0})(n(a)))}})(),pred:(function(){var t=Se(_o),n=He(_o);return function(a){return t((function(u){return u-1|0})(n(a)))}})(),Ord0:function(){return bv}}});var na={cardinality:12,toEnum:function(t){return t===1?new H(Ba.value):t===2?new H(oo.value):t===3?new H(uo.value):t===4?new H(io.value):t===5?new H(lo.value):t===6?new H(co.value):t===7?new H(fo.value):t===8?new H(so.value):t===9?new H(po.value):t===10?new H(vo.value):t===11?new H(mo.value):t===12?new H(Wo.value):G.value},fromEnum:function(t){if(t instanceof Ba)return 1;if(t instanceof oo)return 2;if(t instanceof uo)return 3;if(t instanceof io)return 4;if(t instanceof lo)return 5;if(t instanceof co)return 6;if(t instanceof fo)return 7;if(t instanceof so)return 8;if(t instanceof po)return 9;if(t instanceof vo)return 10;if(t instanceof mo)return 11;if(t instanceof Wo)return 12;throw new Error("Failed pattern match at Data.Date.Component (line 87, column 14 - line 99, column 19): "+[t.constructor.name])},Bounded0:function(){return Fv},Enum1:function(){return aI(0)}},aI=Eg("enumMonth","Data.Date.Component",function(){return{succ:(function(){var t=Se(na),n=He(na);return function(a){return t((function(u){return u+1|0})(n(a)))}})(),pred:(function(){var t=Se(na),n=He(na);return function(a){return t((function(u){return u-1|0})(n(a)))}})(),Ord0:function(){return Ev}}});var Ws={bottom:1,top:31,Ord0:function(){return Tv}},$o={cardinality:31,toEnum:function(t){if(t>=1&&t<=31)return new H(t);if(ue)return G.value;throw new Error("Failed pattern match at Data.Date.Component (line 133, column 1 - line 138, column 23): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return Ws},Enum1:function(){return oI(0)}},oI=Eg("enumDay","Data.Date.Component",function(){return{succ:(function(){var t=Se($o),n=He($o);return function(a){return t((function(u){return u+1|0})(n(a)))}})(),pred:(function(){var t=Se($o),n=He($o);return function(a){return t((function(u){return u-1|0})(n(a)))}})(),Ord0:function(){return Tv}}});var pR=function(t){return function(n){return function(a){return(a|0)===a?t(a):n}}};var Qi=(function(){return pR(H.create)(G.value)})();var hR=Ot($t);var Sg=function(t){return t.fromDuration};var Cv={fromDuration:hR,toDuration:hR};var hI=He(na),gI=zn();var DI=Wt(sR),yI=Wt(wg),RI=Wt(dR),bI=xt(bv),TI=xt(Ev),EI=xt(Tv);var wI=Se(na);var Sv=(function(){function t(n,a,u){this.value0=n,this.value1=a,this.value2=u}return t.create=function(n){return function(a){return function(u){return new t(n,a,u)}}},t})(),Zi=function(t){return t.value0};var tl=function(t){return t.value1};var Mv={eq:function(t){return function(n){return DI(t.value0)(n.value0)&&yI(t.value1)(n.value1)&&RI(t.value2)(n.value2)}}},FI=Wt(Mv),Ig={compare:function(t){return function(n){var a=bI(t.value0)(n.value0);if(a instanceof Nt)return Nt.value;if(a instanceof At)return At.value;var u=TI(t.value1)(n.value1);return u instanceof Nt?Nt.value:u instanceof At?At.value:EI(t.value2)(n.value2)}},Eq0:function(){return Mv}};var ql=function(t){return t.value2},el=function(t){return function(n){return function(a){var u=function(c){return function(m){return function(w){return new Sv(c,gI(wI(m)),w)}}};return uR(u,t,hI(n),a)}}},Ag=function(t){return function(n){return function(a){var u=new Sv(t,n,a),c=FI(el(t)(n)(a))(u);return c?new H(u):G.value}}},xg=(function(){return{bottom:new Sv(sn(wv),sn(Fv),sn(Ws)),top:new Sv(Nn(wv),Nn(Fv),Nn(Ws)),Ord0:function(){return Ig}}})();var Iv=function(t,n,a){var u=0,c;return function(m){if(u===2)return c;if(u===1)throw new ReferenceError(t+" was needed before it finished initializing (module "+n+", line "+m+")",n,m);return u=1,c=a(),u=2,c}};var Av=fn,xv=fn,Lv=fn,Nv=fn,IR=Qr,AR=Qr,xR=Qr,LR=Qr,Hs={bottom:0,top:59,Ord0:function(){return Av}},Bs={bottom:0,top:59,Ord0:function(){return xv}},Js={bottom:0,top:999,Ord0:function(){return Lv}},Gs={bottom:0,top:23,Ord0:function(){return Nv}},Ho={cardinality:60,toEnum:function(t){if(t>=0&&t<=59)return new H(t);if(ue)return G.value;throw new Error("Failed pattern match at Data.Time.Component (line 90, column 1 - line 95, column 26): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return Hs},Enum1:function(){return CI(0)}},CI=Iv("enumSecond","Data.Time.Component",function(){return{succ:(function(){var t=Se(Ho),n=He(Ho);return function(a){return t((function(u){return u+1|0})(n(a)))}})(),pred:(function(){var t=Se(Ho),n=He(Ho);return function(a){return t((function(u){return u-1|0})(n(a)))}})(),Ord0:function(){return Av}}});var Bo={cardinality:60,toEnum:function(t){if(t>=0&&t<=59)return new H(t);if(ue)return G.value;throw new Error("Failed pattern match at Data.Time.Component (line 61, column 1 - line 66, column 26): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return Bs},Enum1:function(){return SI(0)}},SI=Iv("enumMinute","Data.Time.Component",function(){return{succ:(function(){var t=Se(Bo),n=He(Bo);return function(a){return t((function(u){return u+1|0})(n(a)))}})(),pred:(function(){var t=Se(Bo),n=He(Bo);return function(a){return t((function(u){return u-1|0})(n(a)))}})(),Ord0:function(){return xv}}});var Jo={cardinality:1e3,toEnum:function(t){if(t>=0&&t<=999)return new H(t);if(ue)return G.value;throw new Error("Failed pattern match at Data.Time.Component (line 120, column 1 - line 125, column 31): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return Js},Enum1:function(){return MI(0)}},MI=Iv("enumMillisecond","Data.Time.Component",function(){return{succ:(function(){var t=Se(Jo),n=He(Jo);return function(a){return t((function(u){return u+1|0})(n(a)))}})(),pred:(function(){var t=Se(Jo),n=He(Jo);return function(a){return t((function(u){return u-1|0})(n(a)))}})(),Ord0:function(){return Lv}}});var Go={cardinality:24,toEnum:function(t){if(t>=0&&t<=23)return new H(t);if(ue)return G.value;throw new Error("Failed pattern match at Data.Time.Component (line 32, column 1 - line 37, column 24): "+[t.constructor.name])},fromEnum:function(t){return t},Bounded0:function(){return Gs},Enum1:function(){return II(0)}},II=Iv("enumHour","Data.Time.Component",function(){return{succ:(function(){var t=Se(Go),n=He(Go);return function(a){return t((function(u){return u+1|0})(n(a)))}})(),pred:(function(){var t=Se(Go),n=He(Go);return function(a){return t((function(u){return u-1|0})(n(a)))}})(),Ord0:function(){return Nv}}});var NI=Wt(LR),PI=Wt(AR),OI=Wt(IR),UI=Wt(xR),kI=xt(Nv),$I=xt(xv),WI=xt(Av),HI=xt(Lv);var $u=(function(){function t(n,a,u,c){this.value0=n,this.value1=a,this.value2=u,this.value3=c}return t.create=function(n){return function(a){return function(u){return function(c){return new t(n,a,u,c)}}}},t})();var uf=function(t){return t.value2},zl=function(t){return t.value1},lf=function(t){return t.value3};var Vl=function(t){return t.value0};var Lg={eq:function(t){return function(n){return NI(t.value0)(n.value0)&&PI(t.value1)(n.value1)&&OI(t.value2)(n.value2)&&UI(t.value3)(n.value3)}}},Ng={compare:function(t){return function(n){var a=kI(t.value0)(n.value0);if(a instanceof Nt)return Nt.value;if(a instanceof At)return At.value;var u=$I(t.value1)(n.value1);if(u instanceof Nt)return Nt.value;if(u instanceof At)return At.value;var c=WI(t.value2)(n.value2);return c instanceof Nt?Nt.value:c instanceof At?At.value:HI(t.value3)(n.value3)}},Eq0:function(){return Lg}};var qs=(function(){return{bottom:new $u(sn(Gs),sn(Bs),sn(Hs),sn(Js)),top:new $u(Nn(Gs),Nn(Bs),Nn(Hs),Nn(Js)),Ord0:function(){return Ng}}})();var JI=He(_o),GI=He(na),qI=He($o),jI=He(Go),zI=He(Bo),VI=He(Ho),KI=He(Jo);var YI=Wt(Mv),QI=Wt(Lg),XI=xt(Ig),ZI=xt(Ng),t8=dt(nn),cf=ge($a),Pg=V(Ut),e8=ki(nn),n8=Se(_o),r8=Se(na),a8=Se($o),o8=Se(Go),u8=Se(Bo),i8=Se(Ho),l8=Se(Jo),gu=(function(){function t(n,a){this.value0=n,this.value1=a}return t.create=function(n){return function(a){return new t(n,a)}},t})(),c8=function(t){return{year:JI(Zi(t.value0)),month:GI(tl(t.value0)),day:qI(ql(t.value0)),hour:jI(Vl(t.value1)),minute:zI(zl(t.value1)),second:VI(uf(t.value1)),millisecond:KI(lf(t.value1))}};var f8={eq:function(t){return function(n){return YI(t.value0)(n.value0)&&QI(t.value1)(n.value1)}}},js={compare:function(t){return function(n){var a=XI(t.value0)(n.value0);return a instanceof Nt?Nt.value:a instanceof At?At.value:ZI(t.value1)(n.value1)}},Eq0:function(){return f8}};var Pv=(function(){return{bottom:new gu(sn(xg),sn(qs)),top:new gu(Nn(xg),Nn(qs)),Ord0:function(){return js}}})(),NR=function(t){var n=Sg(t);return function(a){return function(u){return t8(oR(H.create)(G.value)(n(a))(c8(u)))(function(c){return cf(Pg(gu.create)(e8(cf(cf(Pg(Ag)(n8(c.year)))(r8(c.month)))(a8(c.day)))))(cf(cf(cf(Pg($u.create)(o8(c.hour)))(u8(c.minute)))(i8(c.second)))(l8(c.millisecond)))})}}};var pa=(function(){var t={},n="Pure",a="Throw",u="Catch",c="Sync",m="Async",w="Bind",v="Bracket",g="Fork",k="Sequential",y="Map",E="Apply",x="Alt",C="Cons",M="Resume",U="Release",B="Finalizer",Q="Finalized",z="Forked",et="Fiber",at="Thunk";function nt(gt,Ne,an,zt){this.tag=gt,this._1=Ne,this._2=an,this._3=zt}function mt(gt){var Ne=function(an,zt,Bt){return new nt(gt,an,zt,Bt)};return Ne.tag=gt,Ne}function _t(gt){return new nt(n,void 0)}function ne(gt){try{gt()}catch(Ne){setTimeout(function(){throw Ne},0)}}function le(gt,Ne,an){try{return Ne(an())}catch(zt){return gt(zt)}}function fe(gt,Ne,an){try{return Ne(an)()}catch(zt){return an(gt(zt))(),_t}}var In=(function(){var gt=1024,Ne=0,an=0,zt=new Array(gt),Bt=!1;function Dt(){var be;for(Bt=!0;Ne!==0;)Ne--,be=zt[an],zt[an]=void 0,an=(an+1)%gt,be();Bt=!1}return{isDraining:function(){return Bt},enqueue:function(be){var De,Qe;Ne===gt&&(Qe=Bt,Dt(),Bt=Qe),zt[(an+Ne)%gt]=be,Ne++,Bt||Dt()}}})();function Pn(gt){var Ne={},an=0,zt=0;return{register:function(Bt){var Dt=an++;Bt.onComplete({rethrow:!0,handler:function(be){return function(){zt--,delete Ne[Dt]}}})(),Ne[Dt]=Bt,zt++},isEmpty:function(){return zt===0},killAll:function(Bt,Dt){return function(){if(zt===0)return Dt();var be=0,De={};function Qe(oe){De[oe]=Ne[oe].kill(Bt,function(Pe){return function(){delete De[oe],be--,gt.isLeft(Pe)&>.fromLeft(Pe)&&setTimeout(function(){throw gt.fromLeft(Pe)},0),be===0&&Dt()}})()}for(var An in Ne)Ne.hasOwnProperty(An)&&(be++,Qe(An));return Ne={},an=0,zt=0,function(oe){return new nt(c,function(){for(var Pe in De)De.hasOwnProperty(Pe)&&De[Pe]()})}}}}}var Fe=0,Be=1,ln=2,Fn=3,vn=4,Xe=5,bn=6;function rn(gt,Ne,an){var zt=0,Bt=Fe,Dt=an,be=null,De=null,Qe=null,An=null,oe=null,Pe=0,wr=0,Je=null,Ya=!0;function O(S){for(var A,$,W;;)switch(A=null,$=null,W=null,Bt){case ln:Bt=Be;try{Dt=Qe(Dt),An===null?Qe=null:(Qe=An._1,An=An._2)}catch(K){Bt=Xe,be=gt.left(K),Dt=null}break;case Fn:gt.isLeft(Dt)?(Bt=Xe,be=Dt,Dt=null):Qe===null?Bt=Xe:(Bt=ln,Dt=gt.fromRight(Dt));break;case Be:switch(Dt.tag){case w:Qe&&(An=new nt(C,Qe,An)),Qe=Dt._2,Bt=Be,Dt=Dt._1;break;case n:Qe===null?(Bt=Xe,Dt=gt.right(Dt._1)):(Bt=ln,Dt=Dt._1);break;case c:Bt=Fn,Dt=le(gt.left,gt.right,Dt._1);break;case m:Bt=vn,Dt=fe(gt.left,Dt._1,function(K){return function(){zt===S&&(zt++,In.enqueue(function(){zt===S+1&&(Bt=Fn,Dt=K,O(zt))}))}});return;case a:Bt=Xe,be=gt.left(Dt._1),Dt=null;break;case u:Qe===null?oe=new nt(C,Dt,oe,De):oe=new nt(C,Dt,new nt(C,new nt(M,Qe,An),oe,De),De),Qe=null,An=null,Bt=Be,Dt=Dt._1;break;case v:Pe++,Qe===null?oe=new nt(C,Dt,oe,De):oe=new nt(C,Dt,new nt(C,new nt(M,Qe,An),oe,De),De),Qe=null,An=null,Bt=Be,Dt=Dt._1;break;case g:Bt=Fn,A=rn(gt,Ne,Dt._2),Ne&&Ne.register(A),Dt._1&&A.run(),Dt=gt.right(A);break;case k:Bt=Be,Dt=Er(gt,Ne,Dt._1);break}break;case Xe:if(Qe=null,An=null,oe===null)Bt=bn,Dt=De||be||Dt;else switch(A=oe._3,W=oe._1,oe=oe._2,W.tag){case u:De&&De!==A&&Pe===0?Bt=Xe:be&&(Bt=Be,Dt=W._2(gt.fromLeft(be)),be=null);break;case M:De&&De!==A&&Pe===0||be?Bt=Xe:(Qe=W._1,An=W._2,Bt=ln,Dt=gt.fromRight(Dt));break;case v:Pe--,be===null&&($=gt.fromRight(Dt),oe=new nt(C,new nt(U,W._2,$),oe,A),(De===A||Pe>0)&&(Bt=Be,Dt=W._3($)));break;case U:oe=new nt(C,new nt(Q,Dt,be),oe,De),Bt=Be,De&&De!==A&&Pe===0?Dt=W._1.killed(gt.fromLeft(De))(W._2):be?Dt=W._1.failed(gt.fromLeft(be))(W._2):Dt=W._1.completed(gt.fromRight(Dt))(W._2),be=null,Pe++;break;case B:Pe++,oe=new nt(C,new nt(Q,Dt,be),oe,De),Bt=Be,Dt=W._1;break;case Q:Pe--,Bt=Xe,Dt=W._1,be=W._2;break}break;case bn:for(var X in Je)Je.hasOwnProperty(X)&&(Ya=Ya&&Je[X].rethrow,ne(Je[X].handler(Dt)));Je=null,De&&be?setTimeout(function(){throw gt.fromLeft(be)},0):gt.isLeft(Dt)&&Ya&&setTimeout(function(){if(Ya)throw gt.fromLeft(Dt)},0);return;case Fe:Bt=Be;break;case vn:return}}function q(S){return function(){if(Bt===bn)return Ya=Ya&&S.rethrow,S.handler(Dt)(),function(){};var A=wr++;return Je=Je||{},Je[A]=S,function(){Je!==null&&delete Je[A]}}}function L(S,A){return function(){if(Bt===bn)return A(gt.right(void 0))(),function(){};var $=q({rethrow:!1,handler:function(){return A(gt.right(void 0))}})();switch(Bt){case Fe:De=gt.left(S),Bt=bn,Dt=De,O(zt);break;case vn:De===null&&(De=gt.left(S)),Pe===0&&(Bt===vn&&(oe=new nt(C,new nt(B,Dt(S)),oe,De)),Bt=Xe,Dt=null,be=null,O(++zt));break;default:De===null&&(De=gt.left(S)),Pe===0&&(Bt=Xe,Dt=null,be=null)}return $}}function D(S){return function(){var A=q({rethrow:!1,handler:S})();return Bt===Fe&&O(zt),A}}return{kill:L,join:D,onComplete:q,isSuspended:function(){return Bt===Fe},run:function(){Bt===Fe&&(In.isDraining()?O(zt):In.enqueue(function(){O(zt)}))}}}function Le(gt,Ne,an,zt){var Bt=0,Dt={},be=0,De={},Qe=new Error("[ParAff] Early exit"),An=null,oe=t;function Pe(q,L,D){var S=L,A=null,$=null,W=0,X={},K,ot;t:for(;;)switch(K=null,S.tag){case z:if(S._3===t&&(K=Dt[S._1],X[W++]=K.kill(q,function(ct){return function(){W--,W===0&&D(ct)()}})),A===null)break t;S=A._2,$===null?A=null:(A=$._1,$=$._2);break;case y:S=S._2;break;case E:case x:A&&($=new nt(C,A,$)),A=S,S=S._1;break}if(W===0)D(gt.right(void 0))();else for(ot=0,K=W;ot()=>t.props.def;function g7(t){class n extends or.Component{constructor(u){super(u),u.init&&u.init(this)()}render(){return this.props.render(this)()}componentDidMount(){this.props.componentDidMount(this)()}componentWillUnmount(){this.props.componentWillUnmount(this)()}}return n.displayName=t?"Elmish_"+t:"ElmishRoot",n}var Xv=typeof module>"u"?void 0:module.require,BY=(function(){try{return Xv===void 0?void 0:Xv("util")}catch{return}})();var JY=(function(){var t;if(typeof performance<"u")t=performance;else if(Xv)try{t=Xv("perf_hooks").performance}catch{}return(function(){return(t||Date).now()})})();function hb(t){return typeof t=="string"}function Bg(t){return typeof t=="number"}function gb(t){return typeof t=="boolean"}function Db(t){return t instanceof Object}function yb(t){return t instanceof Function}function rd(t){return t===null?"":t===void 0?"":t instanceof Date?t.toString():typeof Blob<"u"&&t instanceof Blob?"file["+t.name+"]":JSON.stringify(t)}var T7=On(Ce),Rb=qi(As),E7=Un(Ce);var Df=function(t){return t.foldrWithIndex};var yf=function(t){return t.foldlWithIndex};var w7=function(t){var n=Df(t);return function(a){var u=Jt(a.Semigroup0()),c=Ze(a);return function(m){return n(function(w){return function(v){return function(g){return u(m(w)(v))(g)}}})(c)}}},ad={foldrWithIndex:function(t){return function(n){var a=T7(function(c){return function(m){return t(c.value0)(c.value1)(m)}})(n),u=Rb(Qt.create);return function(c){return a(u(c))}}},foldlWithIndex:function(t){return function(n){var a=E7(function(c){return function(m){return t(m.value0)(c)(m.value1)}})(n),u=Rb(Qt.create);return function(c){return a(u(c))}}},foldMapWithIndex:function(t){return w7(ad)(t)},Foldable0:function(){return Ce}};var bb=function(t){var n=yf(t);return function(a){var u=function(c){return function(m){return function(w){return m instanceof G?a(c)(w):m}}};return n(u)(G.value)}};function od(t){return Object.prototype.toString.call(t).slice(8,-1)}function Zl(t){return t===null}function tc(t){return t===void 0}var Zv=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};var Tu=(function(){function t(n,a){this.value0=n,this.value1=a}return t.create=function(n){return function(a){return new t(n,a)}},t})();var em=function(t){var n=Hr(t);return function(a){return new Tu(a,n)}};var vr=(function(){function t(){}return t.value=new t,t})(),on=(function(){function t(n,a){this.value0=n,this.value1=a}return t.create=function(n){return function(a){return new t(n,a)}},t})(),nm=function(t){return t},U7=function(t){return new on(t.value0,t.value1)};var k7=function(t){var n=function(a){return function(u){var c=a,m=!1,w;function v(g,k){if(k instanceof on&&k.value1 instanceof on&&k.value1.value1 instanceof on){c=new on(k,g),u=k.value1.value1.value1;return}var y=function(x){return x instanceof on&&x.value1 instanceof on&&x.value1.value1 instanceof vr?new on(t(x.value0),new on(t(x.value1.value0),vr.value)):x instanceof on&&x.value1 instanceof vr?new on(t(x.value0),vr.value):vr.value},E=function(x){return function(C){var M=x,U=!1,B;function Q(z,et){if(z instanceof on&&z.value0 instanceof on&&z.value0.value1 instanceof on&&z.value0.value1.value1 instanceof on){M=z.value1,C=new on(t(z.value0.value0),new on(t(z.value0.value1.value0),new on(t(z.value0.value1.value1.value0),et)));return}return U=!0,et}for(;!U;)B=Q(M,C);return B}};return m=!0,E(g)(y(k))}for(;!m;)w=v(c,u);return w}};return n(vr.value)},Fb={map:k7};var za={foldr:function(t){return function(n){var a=(function(){var c=function(m){return function(w){var v=m,g=!1,k;function y(E,x){if(x instanceof vr)return g=!0,E;if(x instanceof on){v=new on(x.value0,E),w=x.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 107, column 7 - line 107, column 23): "+[E.constructor.name,x.constructor.name])}for(;!g;)k=y(v,w);return k}};return c(vr.value)})(),u=Un(za)(Ve(t))(n);return function(c){return u(a(c))}}},foldl:function(t){var n=function(a){return function(u){var c=a,m=!1,w;function v(g,k){if(k instanceof vr)return m=!0,g;if(k instanceof on){c=t(g)(k.value0),u=k.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 111, column 12 - line 113, column 30): "+[k.constructor.name])}for(;!m;)w=v(c,u);return w}};return n},foldMap:function(t){var n=Jt(t.Semigroup0()),a=Ze(t);return function(u){return Un(za)(function(c){var m=n(c);return function(w){return m(u(w))}})(a)}}};var $7=On(za);var rm={append:function(t){return function(n){return $7(on.create)(n)(t)}}},Cb=Jt(rm);var ud={append:function(t){return function(n){return new Tu(t.value0,Cb(t.value1)(U7(n)))}}};var Sb={alt:Cb,Functor0:function(){return Fb}},Jg=(function(){return{empty:vr.value,Alt0:function(){return Sb}}})();var om=(function(){var t=em(Jg);return function(n){return nm(t(n))}})();var Lb=function(t){return t.value0};var wi=function(t){return t.length};var Nb=function(t){return function(n){return function(a){return function(u){var c=u.indexOf(a);return c===-1?n:t(c)}}}};var bf=function(t){return function(n){return n.substr(0,t)}},ul=function(t){return function(n){return n.substring(t)}};var Fi=function(t){return function(n){if(t>=0&&tn[t],qb=(t,n,a)=>a[t]=n;var md=function(n){return function(a){return n(a)()}};var oc=function(n){return function(a){return function(u){return function(){return n(a,u)}}}},uc=function(n){return function(a){return function(u){return function(c){return function(){return n(a,u,c)}}}}};var IA=Me(Ee),gd=(function(){function t(){}return t.value=new t,t})(),Vb=function(){return function(t){var n=Sn(t);return function(a){return uc(qb)(n(hn.value))}}},n1=function(t){var n=vd(t);return function(a){var u=Sn(a);return function(c){return function(m){return IA(function(){return Gb(u(hn.value),m)})(n)}}}};function Kb(t,n,a){return t==null?n:a(t)}function r1(t){return t}var wu=ke(null)(r1),Gt=function(t){return Kb(t,G.value,H.create)};bu();var dm=window.ReactDOM,{createPortal:hZ,findDOMNode:gZ,flushSync:DZ,unstable_batchedUpdates:yZ}=window.ReactDOM;var g1=Gp(TT(),1);function ET(t,n,a){return t.setState({s:n},a)}var wT=dm.render,FT=dm.hydrate,D1=g1.default&&g1.default.renderToString||(t=>""),ax=dm.unmountComponentAtNode,CT=or.Fragment;function ST(t,n,a){return or.createElement.apply(null,[t,ox(t,n)].concat(a))}function ox(t,n){if(typeof t!="string"||n._data==null)return n;var a={_data:void 0};for(var u in n._data){var c=n._data[u];a["data-"+u]=c}return Object.assign({},n,a)}var Gu={asReactChildren:function(t){return[t]}},qu={asReactChildren:function(t){return[t]}},Cu={asReactChildren:Ot($t)};var fc=yt,IT=uc(ET),AT=oc(wT),xT=oc(FT);var ia=!1;var cx=function(t){return t.asReactChildren},sc=function(){return function(t){var n=cx(t);return function(a){return function(u){return function(c){return ST(a,u,n(c))}}}}},LT=sc()(Cu),dc=function(){return function(t){return function(n){return LT(t)(n)([])}}},Ed=LT(CT)({});var NT=V(Ee),fx=ut(dr);var PT=(function(){var t=function(n){return function(a){return{initialize:function(u){return Ll(new H(a.initialState))(n)},getState:function(u){return NT(gn(a.initialState))(Kc(n))},setState:function(u){return function(c){return function(m){return function(){return Ll(new H(c))(n)(),IT(u)(c)(fx(void 0))(),m()}}}}}}};return NT(t)(bs(G.value))})();var kT=Me(Ke),$T=Jt(Ar);var dx=ut(dr),WT=Vb(),HT={reflectSymbol:function(){return"__unmounted"}},px=WT(HT),BT={reflectSymbol:function(){return"__subscriptions"}},vx=WT(BT),Dm=Me(Ee),mx=n1(Lr)(HT),OT=V(Ee),_x=n1(Ia(Bb))(BT),hx=jn(rr),gx=Wn(ro),Dx=lv(dr)(Ce),yx=hx(Gr),JT=tn(sf),Rx=Vp(Wi),bx=Jt(Vh(ig(zp)));var sl=(function(){function t(n,a){this.value0=n,this.value1=a}return t.create=function(n){return function(a){return new t(n,a)}},t})(),Tx={map:function(t){return function(n){return new sl(t(n.value0),n.value1)}}},ym=function(t){return{bimap:function(n){return function(a){return function(u){return new sl(a(u.value0),kT(u.value1)(function(c){return function(m){return c({dispatch:function(w){return m.dispatch(n(w))},onStop:m.onStop})}}))}}}}},GT={apply:function(t){return function(n){return new sl(t.value0(n.value0),$T(t.value1)(n.value1))}},Functor0:function(){return Tx}},Ii={bind:function(t){return function(n){var a=n(t.value0);return new sl(a.value0,$T(t.value1)(a.value1))}},Apply0:function(){return GT}},yo={pure:function(t){return new sl(t,[])},Apply0:function(){return GT}};var qT=function(t){var n=dt(t);return function(a){var u=tn(a);return function(c){return function(m){return new sl(c,kT(m)(function(w){return function(v){return n(w)(function(g){return u(v.dispatch(g))})}}))}}}};var Ff=function(t){return new sl(void 0,[t])},ju=function(t){return Ff(Kt(t))},dl=function(t){var n=dt(t.Monad0().Bind1()),a=tn(t);return function(u){return Ff(function(c){return n(u)(function(m){return a(ke(dx(void 0))(c.dispatch)(m))})})}},pl=function(t){var n=qT(t.Monad0().Bind1())(t);return function(a){return n(void 0)([a])}},Ex=function(t){return function(n){var a=px(gd.value),u=vx(gd.value),c=function(C){return function(M){return function(U){return function(){var Q=Dm(nd(C))(function(z){return z.init})();return n({initialState:Q.value0}).setState(C)(M)(U)()}}}},m=(function(){var C=OT(gn(!1)),M=mx(gd.value);return function(U){return C(M(U))}})(),w=(function(){var C=OT(gn([])),M=_x(gd.value);return function(U){return C(M(U))}})(),v=function(C){return function(){return gx(Dx)(w(C))(),u([])(C)()}},g=function(C){return function(){var U=Dm(nd(C))(function(B){return B.init})();return n({initialState:U.value0}).getState(C)()}},k=function(C){return function(M){return function(){var B=w(C)();return u(ko(Vv(M))(B))(C)()}}},y=function(C){return function(M){var U=function(B){return Vv(yx(Hu(0))(function(){return B({dispatch:(function(){var Q=E(M);return function(z){return JT(Q(z))}})(),onStop:k(M)})}))};return og(C)(U)}},E=function(C){return function(M){return Rx(m(C))(function(){var B=g(C)(),Q=Dm(nd(C))(function(et){return et.update})(),z=Q(B)(M);return c(C)(z.value0)(y(z.value1)(C))()})}},x=function(C){return function(){var U=g(C)(),B=Dm(nd(C))(function(Q){return Q.view})();return B(U)(E(C))}};return function(C){return _b(t,{def:C,init:n({initialState:C.init.value0}).initialize,render:x,componentDidMount:y(C.init.value1),componentWillUnmount:bx(a(!0))(v)})}}},y1=function(t){return function(){var a=JT(PT)();return mb(function(u){return Ex(u)(a)(t)})}};function wd(t,n){var a={};for(var u in n)({}).hasOwnProperty.call(n,u)&&(a[u]=n[u]);for(var c in t)({}).hasOwnProperty.call(t,c)&&(a[c]=t[c]);return a}var Rm=function(){return function(){return function(t){return function(n){return wd(t,n)}}}};var R1=sc(),Fx=Rm()();var b1=yt;var zT=function(t){var n=R1(t);return function(a){return function(u){return n(b1(a))(u)}}},T1=function(t){var n=R1(t);return function(a){return function(u){return function(c){return n(b1(a))(Fx(c)({className:u}))}}}};var bm=function(t){return function(n){var a=R1(n);return function(u){return function(c){return a(b1(t))({className:u})(c)}}}};var Ai=yt;var Tm=function(t){var n=T1(t);return function(){return function(){return n("video")}}};var Cd=function(t){return bm("span")(t)};var Em=function(t){return bm("i")(t)};var Vu=function(t){var n=T1(t);return function(){return function(){return n("div")}}},Su=function(t){return bm("div")(t)};var VT=Xs(Jv);var KT={map:function(t){return function(n){return VT(VT(t))(n)}}},Cx=Me(KT),Sx=function(t){var n=dt(t.Monad0().Bind1()),a=tn(t);return function(u){return Ff(function(c){return n(u(c.dispatch))(function(m){return a(c.onStop(m))})})}},Sd=function(t){var n=Sx(t);return function(a){return function(u){return n(Cx(u)(a))}}};var Vo=(function(){return{"genericTop'":dn.value}})();var w1=function(t){return t["genericTop'"]},Ko=function(t){return{"genericTop'":w1(t)}};var Yo=(function(){return{"genericBottom'":dn.value}})();var Md=function(t){return t["genericBottom'"]},Qo=function(t){return{"genericBottom'":Md(t)}};var Xo=function(t){return{"genericBottom'":new Ie(Md(t))}},YT=function(t){var n=zc(t);return function(a){return n(Md(a))}};var vl=V(Ut),wm=Vn();var F1=function(t){return t["genericToEnum'"]};var Fm=function(t){return t["genericSucc'"]},XT=function(t){var n=zc(t),a=ys(t);return function(u){var c=vl(n),m=Fm(u);return function(w){return c(m(a(w)))}}},C1=function(t){return t["genericPred'"]};var S1=function(t){return t["genericFromEnum'"]};var Zo=function(t){var n=C1(t),a=Fm(t);return function(u){var c=w1(u);return function(m){var w=C1(m),v=Fm(m);return function(g){var k=Md(g);return{"genericPred'":function(y){if(y instanceof Ie)return vl(Ie.create)(n(y.value0));if(y instanceof _e){var E=w(y.value0);if(E instanceof G)return new H(new Ie(c));if(E instanceof H)return new H(new _e(E.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 30, column 14 - line 32, column 31): "+[E.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 Ie){var E=a(y.value0);if(E instanceof G)return new H(new _e(k));if(E instanceof H)return new H(new Ie(E.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 34, column 14 - line 36, column 31): "+[E.constructor.name])}if(y instanceof _e)return vl(_e.create)(v(y.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 33, column 18 - line 37, column 36): "+[y.constructor.name])}}}}}};var tu={"genericPred'":function(t){return G.value},"genericSucc'":function(t){return G.value}},eu=function(t){var n=C1(t),a=Fm(t);return{"genericPred'":function(u){return vl(Ds)(n(u))},"genericSucc'":function(u){return vl(Ds)(a(u))}}};var M1=function(t){return t["genericCardinality'"]};var nu=function(t){var n=M1(t),a=F1(t),u=S1(t);return function(c){var m=F1(c),w=S1(c);return{"genericCardinality'":wm(n)+wm(M1(c))|0,"genericToEnum'":function(v){var g=function(k){if(v>=0&&v1;if(a){var u=Ld(Fi(1)(t)),c=hE(u);return c?_E(n)(u):n}return n},NL=pE(LL),Nd=vE(xL)(NL),Ku=function(t){return Ua(Nd(t))};var Lm=function(t){return function(n){return mE(function(a){return Ku(bf(a)(n))})(jg(t)(n))}};var ME=jt;var t6=fm(Ce),e6=Me(Ke),n6=Bl(x1),xa=function(t){return function(n){var a=t6(e6(n)(function(u){return new Qt(t(u),u)}));return function(u){return ac(u)(a)}}},IE=function(t){var n=XT(t),a=YT(t);return function(u){var c=n(u);return function(m){return function(w){return n6(function(v){return new Qt(v,c(v))})(a(w))}}}},Ro=function(t){var n=IE(t);return function(a){var u=n(a);return function(c){var m=u(c);return function(w){return Li(m(w))}}}};var r6={info:"info",warning:"warn",error:"error"},Od=t=>n=>a=>u=>{let c=r6[t];if(typeof console<"u"&&console[c]&&console[c](n,a),typeof window<"u"){let m=new Error(n);typeof window.Sentry<"u"&&window.Sentry.captureException(m,{extra:a})}return u()},AE=(t,n)=>(n.__sentryFingerprint=t,n);var xE=function(t){return ku(AE)(t)};var Um="error";var km={parseOrPanic:function(t){return function(n){var a=t.parse(n);if(a instanceof Ct)return a.value0;if(a instanceof Et)return Od(Um)("Failed to parse "+t.diagnosticName)({error:a.value0,value:n})(function(u){return t.default});throw new Error("Failed pattern match at Utils.Parse (line 49, column 5 - line 57, column 24): "+[a.constructor.name])}}},jr=function(t){return t.parseOrPanic},o6=jr(km),gl=function(t){var n=jr(t);return function(a){var u=V(a);return function(c){return n({parse:function(m){return u(H.create)(c.parse(m))},default:G.value,diagnosticName:c.diagnosticName})}}},u6=gl(km)(sr),Dl=function(t){var n=ll(t);return function(a){return u6({parse:n,diagnosticName:a})}},zr={parseOrPanic:function(t){return o6({default:t.default,diagnosticName:t.diagnosticName,parse:(function(){var n=ke(new Et(""))(Ct.create);return function(a){return n(t.parse(a))}})()})}};var NE=eu(tu),PE=Qo(Yo),OE=au(ru),xf=(function(){function t(){}return t.value=new t,t})(),Ud=(function(){function t(){}return t.value=new t,t})(),i6={to:function(t){if(t instanceof Ie)return xf.value;if(t instanceof _e)return Ud.value;throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 17, column 1 - line 17, column 32): "+[t.constructor.name])},from:function(t){if(t instanceof xf)return new Ie(dn.value);if(t instanceof Ud)return new _e(dn.value);throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 17, column 1 - line 17, column 32): "+[t.constructor.name])}};var l6=function(t){if(t instanceof xf)return"school";if(t instanceof Ud)return"vine";throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 28, column 1 - line 28, column 29): "+[t.constructor.name])},UE=(function(){return jr(zr)({parse:xa(l6)(Ro(i6)(Zo(NE)(Ko(Vo))(NE)(PE))(nu(OE)(OE))(Xo(PE))),default:xf.value,diagnosticName:"Sem.Connections.Types.Actor"})})();var HE=eu(tu),kE=Zo(HE)(Ko(Vo)),BE=Qo(Yo),$E=Xo(BE),JE=au(ru),WE=nu(JE),f6=Rn(Xp),Lf=(function(){function t(){}return t.value=new t,t})(),Wd=(function(){function t(){}return t.value=new t,t})(),Nf=(function(){function t(){}return t.value=new t,t})(),s6={to:function(t){if(t instanceof Ie)return Lf.value;if(t instanceof _e&&t.value0 instanceof Ie)return Wd.value;if(t instanceof _e&&t.value0 instanceof _e)return Nf.value;throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 18, column 1 - line 18, column 33): "+[t.constructor.name])},from:function(t){if(t instanceof Lf)return new Ie(dn.value);if(t instanceof Wd)return new _e(new Ie(dn.value));if(t instanceof Nf)return new _e(new _e(dn.value));throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 18, column 1 - line 18, column 33): "+[t.constructor.name])}};var d6=function(t){if(t instanceof Lf)return"pending";if(t instanceof Wd)return"connected";if(t instanceof Nf)return"ignored";throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 35, column 1 - line 35, column 30): "+[t.constructor.name])},GE=(function(){var t=xa(d6)(Ro(s6)(kE(kE(HE)(BE))($E))(WE(WE(JE)))($E)),n=function(a){return a==="cold"?new H(Nf.value):G.value};return jr(zr)({parse:function(a){return f6(t(a))(n(a))},default:Lf.value,diagnosticName:"Sem.Connections.Types.Status"})})();var qE=function(t){return{initiator:UE(t.initiator),status:GE(t.status),introMessage:gn("")(Gt(t.introMessage))}};var $m=(function(){function t(){}return t.value=new t,t})(),jE=(function(){function t(){}return t.value=new t,t})();var zE=(function(){var t=jr(zr)({parse:function(n){return n instanceof H&&n.value0==="paid"?new H(jE.value):n instanceof H&&n.value0==="free"?new H($m.value):n instanceof H&&n.value0==="churned"?new H($m.value):n instanceof G?new H($m.value):G.value},default:$m.value,diagnosticName:"Sem.Types.PartnerStatus"});return function(n){return t(Gt(n))}})();var VE=function(t){return{allowedToContact:t.allowedToContact,id:t.id,name:t.name,imageUrl:Gt(t.imageUrl),partnerStatus:zE(t.partnerStatus)}};var g6=dt(nn),q1=Si(),Hd=mr(jt),KE=Y({reflectSymbol:function(){return"id"}}),D6=jn(rr)(nn),y6=Rv(rg),R6=V(Ut);var b6=jt,T6=Dl(q1(Y({reflectSymbol:function(){return"avatarUrl"}})(Hd)(Y({reflectSymbol:function(){return"bio"}})(Hd)(Y({reflectSymbol:function(){return"connection"}})(mr(q1(Y({reflectSymbol:function(){return"initiator"}})(jt)(Y({reflectSymbol:function(){return"introMessage"}})(Hd)(Y({reflectSymbol:function(){return"status"}})(jt)(un))))))(Y({reflectSymbol:function(){return"firstName"}})(jt)(KE(b6)(Y({reflectSymbol:function(){return"lastName"}})(jt)(Y({reflectSymbol:function(){return"school"}})(q1(Y({reflectSymbol:function(){return"allowedToContact"}})(Lr)(KE(ME)(Y({reflectSymbol:function(){return"imageUrl"}})(Hd)(Y({reflectSymbol:function(){return"name"}})(jt)(Y({reflectSymbol:function(){return"partnerStatus"}})(Hd)(un)))))))(Y({reflectSymbol:function(){return"title"}})(jt)(Y({reflectSymbol:function(){return"type"}})(jt)(Y({reflectSymbol:function(){return"unreadMessageCountFromSemUser"}})(ye)(un))))))))))));var YE=function(t){return g6(T6("SemUser")(t))(function(n){return D6(y6(n.type==="Sem::User"))(function(){return new H({school:VE(n.school),firstName:n.firstName,lastName:n.lastName,avatarUrl:Gt(n.avatarUrl),title:n.title,bio:Gt(n.bio),connection:R6(qE)(Gt(n.connection)),unreadMessageCountFromSemUser:n.unreadMessageCountFromSemUser,id:n.id})})})};var uw=(function(){function t(){}return t.value=new t,t})(),iw=(function(){function t(){}return t.value=new t,t})(),lw=(function(){function t(){}return t.value=new t,t})();var e5=function(t){if(t instanceof uw)return"disabled";if(t instanceof iw)return"free-consultation";if(t instanceof lw)return"more-information";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types.InquiryMode (line 26, column 13 - line 29, column 40): "+[t.constructor.name])};var n5=(function(){return[uw.value,iw.value,lw.value]})(),cw=gl(zr)(Ut)({parse:xa(e5)(n5),diagnosticName:"InquiryMode"});var Sot=new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short",maximumFractionDigits:2});bu();var Q5=or.Fragment;function Aw(t){return function(n){return function(){return n.getElementById(t)}}}var t9=V(Ee),Jm=function(t){var n=t9(Gt),a=Aw(t);return function(u){return n(a(u))}};var Gm=function(t){return function(n){return function(){return n[t]}}},e9=Gm("children"),n9=Gm("firstElementChild"),r9=Gm("lastElementChild"),a9=Gm("childElementCount");var Iu=function(){return window};function Lw(t,n,a,u){if(typeof window<"u"){var c=window[a];if(c!=null&&u instanceof c)return n(u)}for(var m=u;m!=null;){var w=Object.getPrototypeOf(m),v=w.constructor.name;if(v===a)return n(u);if(v==="Object")return t;m=w}return t}var Vt=function(t){return function(n){return Lw(G.value,H.create,t,n)}};var qm=yt;function Pw(t,n,a){var u=Object.prototype.toString.call(a);return u.indexOf("[object HTML")===0&&u.indexOf("Element]")===u.length-8?n(a):t}var Ow=function(t){return Pw(G.value,H.create,t)};function jm(t){return function(){return t.currentTime}}function p0(t){return function(){return t.volume}}function v0(t){return function(n){return function(){n.volume=t}}}function m0(t){return function(){return t.muted}}function yc(t){return function(n){return function(){n.muted=t}}}var kw=Vt("HTMLMediaElement");var $w=Vt("HTMLMediaElement");function h0(t){return function(n){return function(){n.href=t}}}function g0(t){return function(){return t.platform}}function Vd(t){return function(){return t.document}}function D0(t){return function(){return t.navigator}}function y0(t){return function(){return t.location}}function zm(t){return function(){return t.localStorage}}var q9=Ns(dr)(Ls),Ww=dt(ro),qw=Me(Ee),j9=dt(nn);var R0=Ve(ke(ia));var jw=function(t){return function(n){if(t)return n(void 0);if(ue)return ia;throw new Error("Failed pattern match at Utils.HTML (line 100, column 1 - line 100, column 61): "+[t.constructor.name,n.constructor.name])}},yl=function(t){return function(n){return jw(t)(Kt(n))}};var Qm=function(t){return q9($w(t.target))(jm)};var z9=function(t){return Ww(qw(Ww(Iu)(Vd))(qm))(Jm(t))},zw=function(t){return qw(z9(t))(function(n){return j9(n)(Ow)})};var Kd=ye;var Yw=({just:t,nothing:n})=>a=>{try{let u=new Date(a);return isNaN(u.getTime())?n:t(u)}catch{return n}},Qw=t=>({year:t.getFullYear(),month:t.getMonth(),day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),millisecond:t.getMilliseconds()});var K9=(()=>{let t=new Date().toString(),n=(t.match(/\(([\w\s]+)\)$/)||[])[1];return n?/\s/.test(n)?(n.match(/\b(\w)/g)||[]).join(""):n:(n=(t.match(/(\w{3,4})\s\d{4}$/)||[])[1],n||(n=(t.match(/(UTC[\+\-]\d+)/)||[])[1],n)||(n=(t.match(/(GMT[\+\-]\d+)/)||[])[1],n)?n:"")})();var Zw={liftAff:Ot($t),MonadEffect0:function(){return Yn}};var ybt=(function(){function t(){this.head=null,this.last=null,this.size=0}function n(y,E){this.queue=y,this.value=E,this.next=null,this.prev=null}function a(y){this.draining=!1,this.error=null,this.value=y,this.takes=new t,this.reads=new t,this.puts=new t}var u={};function c(y){try{y()}catch(E){setTimeout(function(){throw E},0)}}function m(y,E){var x=new n(y,E);switch(y.size){case 0:y.head=x;break;case 1:x.prev=y.head,y.head.next=x,y.last=x;break;default:x.prev=y.last,y.last.next=x,y.last=x}return y.size++,x}function w(y){var E;switch(y.size){case 0:return null;case 1:E=y.head,y.head=null;break;case 2:E=y.last,y.head.next=null,y.last=null;break;default:E=y.last,y.last=E.prev,y.last.next=null}return E.prev=null,E.queue=null,y.size--,E.value}function v(y){var E;switch(y.size){case 0:return null;case 1:E=y.head,y.head=null;break;case 2:E=y.head,y.last.prev=null,y.head=y.last,y.last=null;break;default:E=y.head,y.head=E.next,y.head.prev=null}return E.next=null,E.queue=null,y.size--,E.value}function g(y){if(y.queue!==null){if(y.queue.last===y){w(y.queue);return}if(y.queue.head===y){v(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 k(y,E){if(!E.draining){var x=E.puts,C=E.takes,M=E.reads,U,B,Q,z,et;for(E.draining=!0;;){if(U=null,B=null,Q=null,z=E.value,et=M.size,E.error!==null){for(z=y.left(E.error);U=v(x);)c(U.cb(z));for(;B=v(M);)c(B(z));for(;Q=v(C);)c(Q(z));break}if(z===u&&(U=v(x))&&(E.value=z=U.value),z!==u){for(Q=v(C);et--&&(B=v(M));)c(B(y.right(z)));Q!==null&&(E.value=u,c(Q(y.right(z))))}if(U!==null&&c(U.cb(y.right(void 0))),E.value===u&&x.size===0||E.value!==u&&C.size===0)break}E.draining=!1}}return a.EMPTY=u,a.putLast=m,a.takeLast=w,a.takeHead=v,a.deleteCell=g,a.drainVar=k,a})();var Rl=dt(nn),DN=Se(_o),yN=Se(na),RN=Se($o),bN=Se(Go),TN=Se(Bo),EN=Se(Ho),wN=Se(Jo),FN=ut(Xr);var CN=Me(Ut);var SN=function(t){return Rl(DN(t.year))(function(n){return Rl(yN(t.month+1|0))(function(a){return Rl(RN(t.day))(function(u){return Rl(bN(t.hour))(function(c){return Rl(TN(t.minute))(function(m){return Rl(EN(t.second))(function(w){return Rl(wN(t.millisecond))(function(v){return FN(new gu(el(n)(a)(u),new $u(c,m,w,v)))})})})})})})})};var Ni=function(t){return Rl(CN(Yw({just:H.create,nothing:G.value})(t))(Qw))(SN)};var T0=ut(Xr),MN=V(Ut),nF=dt(nn);var uF=eu(tu),rF=Zo(uF)(Ko(Vo)),iF=Qo(Yo),aF=Xo(iF),lF=au(ru),oF=nu(lF);var E0=(function(){function t(){}return t.value=new t,t})(),w0=(function(){function t(){}return t.value=new t,t})(),F0=(function(){function t(){}return t.value=new t,t})();var IN={to:function(t){if(t instanceof Ie)return E0.value;if(t instanceof _e&&t.value0 instanceof Ie)return w0.value;if(t instanceof _e&&t.value0 instanceof _e)return F0.value;throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 175, column 1 - line 175, column 41): "+[t.constructor.name])},from:function(t){if(t instanceof E0)return new Ie(dn.value);if(t instanceof w0)return new _e(new Ie(dn.value));if(t instanceof F0)return new _e(new _e(dn.value));throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 175, column 1 - line 175, column 41): "+[t.constructor.name])}};var AN=function(t){if(t instanceof E0)return"stuffed";if(t instanceof w0)return"satisfied";if(t instanceof F0)return"hungry";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 235, column 27 - line 238, column 35): "+[t.constructor.name])};var xN=gl(zr)(Ut)({parse:xa(AN)(Ro(IN)(rF(rF(uF)(iF))(aF))(oF(oF(lF)))(aF)),diagnosticName:"ClientAppetite"}),cF=function(t){return nF(ke(T0(G.value))((function(){var n=MN(T0);return function(a){return n(xN(a))}})())(Gt(t.clientAppetite)))(function(n){return nF(cw(t.inquiryMode))(function(a){return T0({packages:t.packages,pricePerHourCents:t.pricePerHourCents,singleSessionDurationMinutes:t.singleSessionDurationMinutes,singleSessionRefundPeriodLengthDays:t.singleSessionRefundPeriodLengthDays,themes:t.themes,freeConsultationDurationMinutes:Gt(t.freeConsultationDurationMinutes),canSubmitConsultInquiry:Gt(t.canSubmitConsultInquiry),clientAppetite:n,inquiryMode:a})})})};var fF=dt(nn),$f=Si(),C0=mr(jt),sF=Y({reflectSymbol:function(){return"description"}})(jt),Xm=Y({reflectSymbol:function(){return"id"}})(ye),M0=Y({reflectSymbol:function(){return"name"}})(jt),pF=$f(Xm(M0(Y({reflectSymbol:function(){return"slug"}})(jt)(un)))),dF=Ia(pF),NN=Dl($f(Y({reflectSymbol:function(){return"advisingConfig"}})(mr($f(Y({reflectSymbol:function(){return"canSubmitConsultInquiry"}})(mr(Lr))(Y({reflectSymbol:function(){return"clientAppetite"}})(C0)(Y({reflectSymbol:function(){return"freeConsultationDurationMinutes"}})(mr(ye))(Y({reflectSymbol:function(){return"inquiryMode"}})(jt)(Y({reflectSymbol:function(){return"packages"}})(Ia($f(Y({reflectSymbol:function(){return"activeForSale"}})(Lr)(sF(Xm(M0(Y({reflectSymbol:function(){return"numMinutes"}})(ye)(Y({reflectSymbol:function(){return"packageCategories"}})(dF)(Y({reflectSymbol:function(){return"refundPeriodLengthDays"}})(ye)(Y({reflectSymbol:function(){return"totalPriceCents"}})(Kd)(un)))))))))))(Y({reflectSymbol:function(){return"pricePerHourCents"}})(Kd)(Y({reflectSymbol:function(){return"singleSessionDurationMinutes"}})(ye)(Y({reflectSymbol:function(){return"singleSessionRefundPeriodLengthDays"}})(ye)(Y({reflectSymbol:function(){return"themes"}})(Ia($f(Y({reflectSymbol:function(){return"active"}})(Lr)(Y({reflectSymbol:function(){return"category"}})(pF)(sF(Y({reflectSymbol:function(){return"durationMinutes"}})(ye)(Xm(Y({reflectSymbol:function(){return"priceCents"}})(Kd)(Y({reflectSymbol:function(){return"title"}})(jt)(un))))))))))(un))))))))))))(Y({reflectSymbol:function(){return"entity"}})($f(Y({reflectSymbol:function(){return"bio"}})(jt)(Xm(Y({reflectSymbol:function(){return"imageUrl"}})(C0)(M0(Y({reflectSymbol:function(){return"organizationId"}})(ye)(Y({reflectSymbol:function(){return"organizationName"}})(jt)(Y({reflectSymbol:function(){return"shortEducation"}})(C0)(Y({reflectSymbol:function(){return"tags"}})(dF)(un))))))))))(un)))),S0=ut(Xr),I0=V(Ut),PN=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),ON=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),UN=function(t){return fF(NN("ServiceProviderPresenter")(t))(function(n){return fF(ke(S0(G.value))((function(){var a=I0(S0);return function(u){return a(cF(u))}})())(Gt(n.advisingConfig)))(function(a){return S0({entity:n.entity,advisingConfig:a})})})},vF=gl(zr)(Ut)({parse:function(t){return t.type==="Sem::User"?I0(PN.create)(YE(t.presenter)):t.type==="ServiceProviders::Individual"?I0(ON.create)(UN(t.presenter)):G.value},diagnosticName:"Livestream Guest Presenter"});var gF=eu(tu),mF=Zo(gF)(Ko(Vo)),DF=Qo(Yo),_F=Xo(DF),yF=au(ru),hF=nu(yF),Qd=(function(){function t(){}return t.value=new t,t})(),Zm=(function(){function t(){}return t.value=new t,t})(),t_=(function(){function t(){}return t.value=new t,t})(),$N={to:function(t){if(t instanceof Ie)return Qd.value;if(t instanceof _e&&t.value0 instanceof Ie)return Zm.value;if(t instanceof _e&&t.value0 instanceof _e)return t_.value;throw new Error("Failed pattern match at Livestream.Types.Poll (line 39, column 1 - line 39, column 37): "+[t.constructor.name])},from:function(t){if(t instanceof Qd)return new Ie(dn.value);if(t instanceof Zm)return new _e(new Ie(dn.value));if(t instanceof t_)return new _e(new _e(dn.value));throw new Error("Failed pattern match at Livestream.Types.Poll (line 39, column 1 - line 39, column 37): "+[t.constructor.name])}};var A0=function(t){if(t instanceof Qd)return"ready";if(t instanceof Zm)return"live";if(t instanceof t_)return"closed";throw new Error("Failed pattern match at Livestream.Types.Poll (line 64, column 23 - line 67, column 21): "+[t.constructor.name])};var e_=(function(){return jr(zr)({parse:xa(A0)(Ro($N)(mF(mF(gF)(DF))(_F))(hF(hF(yF)))(_F)),default:Qd.value,diagnosticName:"livestream poll status"})})(),x0=function(t){return{id:t.id,question:t.question,multiSelect:t.multiSelect,options:t.options,autoDisplayMinutesFromStart:Gt(t.autoDisplayMinutesFromStart)}};var bF=function(t){return{fullName:t.fullName,firstName:t.firstName,totalStreams:t.totalStreams,undergrad:{college:Gt(t.undergrad.college),major:Gt(t.undergrad.major),year:Gt(t.undergrad.year)},gradCollege:Gt(t.gradCollege),workExperience:Gt(t.workExperience),admissionsStory:Gt(t.admissionsStory),pictureUrl:Gt(t.pictureUrl),allStreamsUrl:Gt(t.allStreamsUrl)}};var HN=Me(Ut),SF=eu(tu),TF=Zo(SF)(Ko(Vo)),MF=Qo(Yo),EF=Xo(MF),IF=au(ru),wF=nu(IF),AF=jr(zr),FF=Ul(),CF=Wn(nn),BN=Me(Ke),JN=V(Ut),GN=dt(nn),Rc=(function(){function t(){}return t.value=new t,t})(),Wf=(function(){function t(){}return t.value=new t,t})(),Hf=(function(){function t(){}return t.value=new t,t})();var xF=wn;var qN={to:function(t){if(t instanceof Ie)return Rc.value;if(t instanceof _e&&t.value0 instanceof Ie)return Wf.value;if(t instanceof _e&&t.value0 instanceof _e)return Hf.value;throw new Error("Failed pattern match at Livestream.Types.Conference (line 172, column 1 - line 172, column 39): "+[t.constructor.name])},from:function(t){if(t instanceof Rc)return new Ie(dn.value);if(t instanceof Wf)return new _e(new Ie(dn.value));if(t instanceof Hf)return new _e(new _e(dn.value));throw new Error("Failed pattern match at Livestream.Types.Conference (line 172, column 1 - line 172, column 39): "+[t.constructor.name])}};var LF=(function(){var t=function(n){if(n instanceof Rc)return"waiting_room";if(n instanceof Wf)return"on_air";if(n instanceof Hf)return"complete";throw new Error("Failed pattern match at Livestream.Types.Conference (line 185, column 15 - line 188, column 33): "+[n.constructor.name])};return xa(t)(Ro(qN)(TF(TF(SF)(MF))(EF))(wF(wF(IF)))(EF))})(),NF=(function(){return AF({parse:LF,default:Rc.value,diagnosticName:"livestream status"})})(),jN=AF({parse:Ni,default:sn(Pv),diagnosticName:"livestream scheduled start time"}),n_=function(t){return{uid:t.uid,title:t.title,description:t.description,url:t.url,imageUrl:t.imageUrl,duration:t.duration,tailTime:t.tailTime,stats:t.stats,isPrivate:t.isPrivate,legacyRecording:t.legacyRecording,collegeFair:t.collegeFair,id:t.id,school:HN(Gt(t.school))(function(n){return{cityState:n.cityState,name:n.name,id:FF(n.id),slug:FF(n.slug)}}),scheduledStartTime:jN(t.scheduledStartTime),onAirTime:CF(Ni)(Gt(t.onAirTime)),streamStatus:NF(t.streamStatus),watchUrl:Gt(t.watchUrl),streamingStartTime:CF(Ni)(Gt(t.streamingStartTime)),polls:BN(t.polls)(function(n){return{poll:x0(n.poll),status:e_(n.status)}}),presenter:JN(bF)(Gt(t.presenter)),partnerType:Gt(t.partnerType),guestPresenter:GN(Gt(t.guestPresenter))(vF),zoomJoinUrl:Gt(t.zoomJoinUrl),zoomStartUrl:Gt(t.zoomStartUrl)}};var YN=typeof CV<"u"&&CV.pathInfo||typeof global<"u"&&global.CV&&global.CV.pathInfo||(t=>null);function OF(t,n){let a=typeof CV<"u"&&CV.apiEndpoint||typeof global<"u"&&global.CV&&global.CV.apiEndpoint;return a||console.error("Missing `CV.apiEndpoint` function"),a&&a(t,n)}function UF(t,n,a,u,c){return function(m,w){var v=t.newXHR(),g=t.fixupUrl(c.url,v);if(v.open(c.method||"GET",g,!0,c.username,c.password),c.headers)try{for(var k=0,y;(y=c.headers[k])!=null;k++)v.setRequestHeader(y.field,y.value)}catch(x){m(x)}var E=function(x){return function(){m(new Error(x))}};return v.onerror=E(a),v.ontimeout=E(n),v.onload=function(){w({status:v.status,statusText:v.statusText,headers:v.getAllResponseHeaders().split(`\r `).filter(function(x){return x.length>0}).map(function(x){var C=x.indexOf(":");return u(x.substring(0,C))(x.substring(C+2))}),body:v.response})},v.responseType=c.responseType,v.withCredentials=c.withCredentials,v.timeout=c.timeout,v.send(c.content),function(x,C,M){try{v.abort()}catch(U){return C(U)}return M()}}}var r_="application/json",kF="application/x-www-form-urlencoded";var WF=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),HF=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),BF=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),JF=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),GF=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),L0=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),a_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),qF=function(t){return t instanceof L0?new H(kF):t instanceof a_?new H(r_):G.value};var jF=(function(){return a_.create})();var VF=Vn();var o_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),u_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),bc=(function(){function t(n,a){this.value0=n,this.value1=a}return t.create=function(n){return function(a){return new t(n,a)}},t})(),KF=function(t){if(t instanceof o_||t instanceof u_)return VF(t.value0);if(t instanceof bc)return t.value1;throw new Error("Failed pattern match at Affjax.RequestHeader (line 26, column 1 - line 26, column 33): "+[t.constructor.name])};var N0=function(t){if(t instanceof o_)return"Accept";if(t instanceof u_)return"Content-Type";if(t instanceof bc)return t.value0;throw new Error("Failed pattern match at Affjax.RequestHeader (line 21, column 1 - line 21, column 32): "+[t.constructor.name])};var QF=Ot($t),P0=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),O0=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),U0=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),i_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),l_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),c_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),XF=function(t){if(t instanceof P0)return"arraybuffer";if(t instanceof O0)return"blob";if(t instanceof U0)return"document";if(t instanceof i_||t instanceof l_)return"text";if(t instanceof c_)return"";throw new Error("Failed pattern match at Affjax.ResponseFormat (line 44, column 3 - line 50, column 19): "+[t.constructor.name])},ZF=function(t){return t instanceof i_?new H(r_):G.value},tC=(function(){return new l_(QF)})();var eC=(function(){return new c_(QF)})();var rC=(function(){function t(n,a){this.value0=n,this.value1=a}return t.create=function(n){return function(a){return new t(n,a)}},t})();var nP=Vn();var Bf=function(t){return nP(Ks(t))};function aC(t,n,a){try{return n(JSON.parse(a))}catch(u){return t(u.message)}}var d_=function(t){return aC(Et.create,Ct.create,t)};function aP(t){return t.replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16)})}function uC(t,n,a){try{return n(aP(encodeURIComponent(a)).replace(/%20/g,"+"))}catch(u){return t(u)}}var p_=(function(){return cv(uC)(Kt(G.value))(H.create)})();var iP=ge($a),lC=V(Ut),lP=ea(hi)(Xr);var cP=function(t){return t};var cC=(function(){var t=function(u){if(u.value1 instanceof G)return p_(u.value0);if(u.value1 instanceof H)return iP(lC(function(c){return function(m){return c+("="+m)}})(p_(u.value0)))(p_(u.value1.value0));throw new Error("Failed pattern match at Data.FormURLEncoded (line 37, column 16 - line 39, column 114): "+[u.constructor.name])},n=lC(Mu("&")),a=lP(t);return function(u){return n(a(cP(u)))}})();var k0=(function(){function t(){}return t.value=new t,t})(),Tc=(function(){function t(){}return t.value=new t,t})(),$0=(function(){function t(){}return t.value=new t,t})(),Jf=(function(){function t(){}return t.value=new t,t})(),v_=(function(){function t(){}return t.value=new t,t})(),Xd=(function(){function t(){}return t.value=new t,t})(),W0=(function(){function t(){}return t.value=new t,t})(),H0=(function(){function t(){}return t.value=new t,t})(),B0=(function(){function t(){}return t.value=new t,t})(),J0=(function(){function t(){}return t.value=new t,t})(),G0=(function(){function t(){}return t.value=new t,t})(),q0=(function(){function t(){}return t.value=new t,t})(),j0=(function(){function t(){}return t.value=new t,t})(),z0=(function(){function t(){}return t.value=new t,t})(),V0=(function(){function t(){}return t.value=new t,t})(),m_=(function(){function t(){}return t.value=new t,t})();var sP=function(t){return t},dP={show:function(t){if(t instanceof k0)return"OPTIONS";if(t instanceof Tc)return"GET";if(t instanceof $0)return"HEAD";if(t instanceof Jf)return"POST";if(t instanceof v_)return"PUT";if(t instanceof Xd)return"DELETE";if(t instanceof W0)return"TRACE";if(t instanceof H0)return"CONNECT";if(t instanceof B0)return"PROPFIND";if(t instanceof J0)return"PROPPATCH";if(t instanceof G0)return"MKCOL";if(t instanceof q0)return"COPY";if(t instanceof j0)return"MOVE";if(t instanceof z0)return"LOCK";if(t instanceof V0)return"UNLOCK";if(t instanceof m_)return"PATCH";throw new Error("Failed pattern match at Data.HTTP.Method (line 43, column 1 - line 59, column 23): "+[t.constructor.name])}};var fC=Bn(ht(dP))(sP);var sC={eq:function(t){return function(n){return t instanceof k0&&n instanceof k0||t instanceof Tc&&n instanceof Tc||t instanceof $0&&n instanceof $0||t instanceof Jf&&n instanceof Jf||t instanceof v_&&n instanceof v_||t instanceof Xd&&n instanceof Xd||t instanceof W0&&n instanceof W0||t instanceof H0&&n instanceof H0||t instanceof B0&&n instanceof B0||t instanceof J0&&n instanceof J0||t instanceof G0&&n instanceof G0||t instanceof q0&&n instanceof q0||t instanceof j0&&n instanceof j0||t instanceof z0&&n instanceof z0||t instanceof V0&&n instanceof V0||t instanceof m_&&n instanceof m_}}};var pC=function(t){return nl(function(n){return function(){var u=t(function(c){return n(Et.create(c))()},function(c){return n(Ct.create(c))()});return function(c){return nl(function(m){return function(){return u(c,function(v){return m(Et.create(v))()},function(v){return m(Ct.create(v))()}),kg}})}}})};var K0=ut(jo(ar)),vP=rc(ar),Ec=Tf(ar),vC=Rn(Ys(ud)(ar)),mP=li(Ti(ar)),__=V(Ut),_P=ao(Ce)(xr),hP=Wt(fa),gP=Wn(nn),DP=V(Ke),yP=Me(Ru),RP=ff(Zs),bP=ut(ja);var h_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),g_=(function(){function t(n,a){this.value0=n,this.value1=a}return t.create=function(n){return function(a){return new t(n,a)}},t})(),D_=(function(){function t(){}return t.value=new t,t})(),y_=(function(){function t(){}return t.value=new t,t})(),R_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),mC=function(t){return function(n){var a=function(y){return y===""?K0(ZT):Bn(function(E){return vP(nc.create(E))})(K0)(d_(y))},u=(function(){if(n.responseFormat instanceof P0)return Ec("ArrayBuffer");if(n.responseFormat instanceof O0)return Ec("Blob");if(n.responseFormat instanceof U0)return function(y){return vC(Ec("Document")(y))(vC(Ec("XMLDocument")(y))(Ec("HTMLDocument")(y)))};if(n.responseFormat instanceof i_)return mP(function(y){return n.responseFormat.value0(a(y))})(Ec("String"));if(n.responseFormat instanceof l_)return Ec("String");if(n.responseFormat instanceof c_)return Kt(n.responseFormat.value0(K0(void 0)));throw new Error("Failed pattern match at Affjax (line 274, column 18 - line 283, column 57): "+[n.responseFormat.constructor.name])})(),c=function(y){if(y instanceof WF)return new Ct(y.value0(_a));if(y instanceof HF)return new Ct(_a(y.value0));if(y instanceof BF)return new Ct(_a(y.value0));if(y instanceof JF)return new Ct(_a(y.value0));if(y instanceof GF)return new Ct(_a(y.value0));if(y instanceof L0)return Po("Body contains values that cannot be encoded as application/x-www-form-urlencoded")(__(_a)(cC(y.value0)));if(y instanceof a_)return new Ct(_a(Cm(y.value0)));throw new Error("Failed pattern match at Affjax (line 235, column 20 - line 250, column 69): "+[y.constructor.name])},m=function(y){return function(E){return y instanceof H&&!_P(vs(hP)(N0)(y.value0))(E)?Ps(E)(y.value0):E}},w=function(y){return m(__(u_.create)(gP(qF)(y)))(m(__(o_.create)(ZF(n.responseFormat)))(n.headers))},v=function(y){return{method:fC(n.method),url:n.url,headers:DP(function(E){return{field:N0(E),value:KF(E)}})(w(n.content)),content:y,responseType:XF(n.responseFormat),username:wu(n.username),password:wu(n.password),withCredentials:n.withCredentials,timeout:gn(0)(__(function(E){return E})(n.timeout))}},g=function(y){return yP(RP(pC(UF(t,"AffjaxTimeoutErrorMessageIdent","AffjaxRequestFailedMessageIdent",rC.create,v(y)))))(function(E){if(E instanceof Ct){var x=Bf(u(E.value0.body));if(x instanceof Et)return new Et(new g_(Lb(x.value0),E.value0));if(x instanceof Ct)return new Ct({headers:E.value0.headers,status:E.value0.status,statusText:E.value0.statusText,body:x.value0});throw new Error("Failed pattern match at Affjax (line 209, column 9 - line 211, column 52): "+[x.constructor.name])}if(E instanceof Et)return new Et((function(){var C=Yl(E.value0),M=C==="AffjaxTimeoutErrorMessageIdent";if(M)return D_.value;var U=C==="AffjaxRequestFailedMessageIdent";return U?y_.value:new R_(E.value0)})());throw new Error("Failed pattern match at Affjax (line 207, column 144 - line 219, column 28): "+[E.constructor.name])})};if(n.content instanceof G)return g(wu(G.value));if(n.content instanceof H){var k=c(n.content.value0);if(k instanceof Ct)return g(wu(new H(k.value0)));if(k instanceof Et)return bP(new Et(new h_(k.value0)));throw new Error("Failed pattern match at Affjax (line 199, column 7 - line 203, column 48): "+[k.constructor.name])}throw new Error("Failed pattern match at Affjax (line 195, column 3 - line 203, column 48): "+[n.content.constructor.name])}};var Gf=(function(){return{method:new Et(Tc.value),url:"/",headers:[],content:G.value,username:G.value,password:G.value,withCredentials:!1,responseFormat:eC,timeout:G.value}})();var hC={eq:function(t){return function(n){return t===n}}};var Y0={newXHR:function(){return new XMLHttpRequest},fixupUrl:function(t){return t||"/"}};var gC=mC(Y0);function WC(t){return Buffer.from(t).toString("base64")}function HC(t,n,a){let u;try{u=n(btoa(a))}catch(c){u=t(c)}return u}var tD=typeof btoa=="function";function BC(t){let a=[];for(let u=0;u{let t=null,n=0,a=()=>{if(!Yu||!Yu.key)return Yu||console.error("Pusher config is missing in global context"),new EO;let u={auth:{headers:{"X-CSRF-Token":Yu.authToken}},authEndpoint:Yu.authPath,cluster:Yu.cluster};return Yu.dev&&Object.assign(u,{wsHost:Yu.dev.wsHost,wsPort:Yu.dev.wsPort,enabledTransports:["ws"],forceTLS:!1,disableStats:!0}),new l2.default(Yu.key,u)};return{acquireConnection:()=>(t||(t=a(),n=0),n++,t),releaseConnection:()=>{--n<=0&&(t&&t.disconnect(),t=null)}}})(),c2=t=>{let n=bO().subscribe(t.channel);return n.bind(t.event,t.handler),()=>{n.unbind(t.event,t.handler),TO()}};function EO(){typeof document<"u"&&(document.mockPusher=this),this.localObject={},this.channels=[],this.disconnect=function(){document.mockPusher=null},this.subscribe=function(t){let n=this.channels.find(u=>u.name===t);if(n)return n;let a=new wO(t);return this.channels.push(a),a},this.channelNames=function(){return this.channels.map(t=>t.name)}}function wO(t){this.name=t,this.handlers={},this.triggered=[],this.disconnect=()=>{},this.bind=function(n,a){this.handlers[n]=a},this.unbind=function(n,a){this.handlers[n]===a&&(this.handlers[n]=null)},this.trigger=function(n,a){this.triggered.push({eventName:n,eventData:a})}}var C_=function(t){return function(){console.error(t)}};var D2=function(t){var n=tn(t);return function(a){return n(C_(a))}};var zO=ut(dr),y2=dt(ro),VO=V(Ee),KO=D2(sf),nD=function(t){var n=function(u){var c=t(u);return D1(c.view(c.init.value0)(Kt(zO(void 0))))},a=function(u){return function(c){return function(m){return function(){var v=y2(y2(Iu)((function(){var k=VO(qm);return function(y){return k(Vd(y))}})()))(Jm(c))();if(v instanceof G)return KO("Element #"+(c+" not found"))();if(v instanceof H){var g=y1(t(m))();return u(g)(v.value0)()}throw new Error("Failed pattern match at Elmish.Boot (line 117, column 11 - line 122, column 21): "+[v.constructor.name])}}}};return{mount:a(AT),renderToString:n,hydrate:a(xT)}};var S_={handle:function(t){return function(n){return function(a){return t(n(a))()}}}},R2={handleEffect:function(t){return md(t)}};var M_={handle:function(t){return function(n){return function(a){return t(n)()}}}};var b2=function(t){return t.handleEffect},Fc=function(t){return t.handle};bu();var E2=class extends or.Component{componentDidUpdate(n){this.props.componentDidUpdate(n.deps)}render(){return this.props.children}};var aD=typeof CV<"u"&&CV.assetsRoot||typeof global<"u"&&global.CV&&global.CV.assetsRoot||"/";var A2=ut(yo),mU=jr(km),_U=dt(no);var hU={init:A2(void 0),update:function(t){return function(n){return A2(void 0)}},view:function(t){return function(n){return ia}}},oD=function(t){var n=ll(t);return function(a){return nD(mU({parse:function(u){return _U(n(u))(function(c){return ke(new Et("Component construction failed"))(Ct.create)(a.def(c))})},diagnosticName:"Props for "+a.diagnosticName,default:hU}))}};var lr=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),nr=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})();var ek=Uu(Ce)(mu),nk=Ji(dr)(kl);var rk={show:function(t){return t}},ak=ht(rk);var sD=jt;var ok=function(t){var n=Dl(t);return function(a){return function(u){return function(c){var m=ek(["Pusher event ",u," over channel ",ak(a)]),w=function(v){return nk(n(m)(v))(c)()};return function(){return c2({channel:a,event:u,handler:w})}}}}},Q2=function(t){var n=ok(t);return function(a){var u=a.Monad0(),c=dt(u.Bind1()),m=tn(a),w=ut(u.Applicative0());return function(v){return function(g){return function(k){return c(m(n(v)(g)(k)))(function(y){return w(m(y))})}}}}};var uk=o2(e2),ik=u2(uk),lk=dt(Gr);var ck=Me(Ut),Au=Si();var fk=Y({reflectSymbol:function(){return"status"}})(jt)(un);var tS=Y({reflectSymbol:function(){return"id"}}),eS=tS(ye);var sk=Me(Ru),dk=Y({reflectSymbol:function(){return"description"}}),Z2=Y({reflectSymbol:function(){return"presenter"}}),Va=mr(jt),pk=Y({reflectSymbol:function(){return"autoDisplayMinutesFromStart"}})(mr(ye)),vk=Au(pk(eS(Y({reflectSymbol:function(){return"multiSelect"}})(Lr)(Y({reflectSymbol:function(){return"options"}})(Ia(jt))(Y({reflectSymbol:function(){return"question"}})(jt)(un)))))),mk=Y({reflectSymbol:function(){return"name"}})(jt),_k=Y({reflectSymbol:function(){return"title"}})(jt),hk=Y({reflectSymbol:function(){return"url"}})(jt),gk=n2(mr(Au(Y({reflectSymbol:function(){return"pusher"}})(Au(Y({reflectSymbol:function(){return"dataChannel"}})(sD)(Y({reflectSymbol:function(){return"presenceChannel"}})(sD)(un))))(Y({reflectSymbol:function(){return"stream"}})(Au(Y({reflectSymbol:function(){return"collegeFair"}})(Lr)(dk(jt)(Y({reflectSymbol:function(){return"duration"}})(ye)(Y({reflectSymbol:function(){return"guestPresenter"}})(mr(Au(Z2(sd)(Y({reflectSymbol:function(){return"type"}})(jt)(un)))))(eS(Y({reflectSymbol:function(){return"imageUrl"}})(jt)(Y({reflectSymbol:function(){return"isPrivate"}})(Lr)(Y({reflectSymbol:function(){return"legacyRecording"}})(Lr)(Y({reflectSymbol:function(){return"onAirTime"}})(Va)(Y({reflectSymbol:function(){return"partnerType"}})(Va)(Y({reflectSymbol:function(){return"polls"}})(Ia(Au(Y({reflectSymbol:function(){return"poll"}})(vk)(fk))))(Z2(mr(Au(Y({reflectSymbol:function(){return"admissionsStory"}})(Va)(Y({reflectSymbol:function(){return"allStreamsUrl"}})(Va)(Y({reflectSymbol:function(){return"firstName"}})(jt)(Y({reflectSymbol:function(){return"fullName"}})(jt)(Y({reflectSymbol:function(){return"gradCollege"}})(Va)(Y({reflectSymbol:function(){return"pictureUrl"}})(Va)(Y({reflectSymbol:function(){return"totalStreams"}})(ye)(Y({reflectSymbol:function(){return"undergrad"}})(Au(Y({reflectSymbol:function(){return"college"}})(Va)(Y({reflectSymbol:function(){return"major"}})(Va)(Y({reflectSymbol:function(){return"year"}})(Va)(un)))))(Y({reflectSymbol:function(){return"workExperience"}})(Va)(un))))))))))))(Y({reflectSymbol:function(){return"scheduledStartTime"}})(jt)(Y({reflectSymbol:function(){return"school"}})(mr(Au(Y({reflectSymbol:function(){return"cityState"}})(jt)(tS(jt)(mk(Y({reflectSymbol:function(){return"slug"}})(jt)(un)))))))(Y({reflectSymbol:function(){return"stats"}})(Au(Y({reflectSymbol:function(){return"parentAttendances"}})(ye)(Y({reflectSymbol:function(){return"parentRecordingWatchers"}})(ye)(Y({reflectSymbol:function(){return"parentRegistrations"}})(ye)(Y({reflectSymbol:function(){return"registrationsBySource"}})(Ia(Au(Y({reflectSymbol:function(){return"parentCount"}})(ye)(Y({reflectSymbol:function(){return"source"}})(jt)(Y({reflectSymbol:function(){return"studentCount"}})(ye)(un))))))(Y({reflectSymbol:function(){return"studentAttendances"}})(ye)(Y({reflectSymbol:function(){return"studentRecordingWatchers"}})(ye)(Y({reflectSymbol:function(){return"studentRegistrations"}})(ye)(Y({reflectSymbol:function(){return"totalAttendances"}})(ye)(Y({reflectSymbol:function(){return"totalRecordingWatchers"}})(ye)(Y({reflectSymbol:function(){return"totalRegistrations"}})(ye)(un))))))))))))(Y({reflectSymbol:function(){return"streamStatus"}})(jt)(Y({reflectSymbol:function(){return"streamingStartTime"}})(Va)(Y({reflectSymbol:function(){return"tailTime"}})(ye)(_k(Y({reflectSymbol:function(){return"uid"}})(jt)(hk(Y({reflectSymbol:function(){return"watchUrl"}})(Va)(Y({reflectSymbol:function(){return"zoomJoinUrl"}})(Va)(Y({reflectSymbol:function(){return"zoomStartUrl"}})(Va)(un))))))))))))))))))))))))))(un)))));var nS=ik("livestreams_live_promo_stream_path")(function(t){return function(n){return lk(t({}))(r2(function(a){return sk(gk("Livestream Mini-Promo")(a))(function(u){return ck(Gt(u))(function(c){return{pusher:c.pusher,stream:n_(c.stream)}})})}))}});var N_=t=>t.play();var bl=Gp(rS(),1);bu();var aS=t=>{let[n,a]=or.useState(),[u,c]=or.useState(),m=or.useRef();return m.current=t,Hg(()=>{if(!u)return bl.default.isSupported()?a(Rk(t.videoStreamUrl,t.videoElementId,m)):t.onNotSupported(),c(!0),()=>{n&&n.destroy()}}),null},Rk=(t,n,a)=>{let u=document.getElementById(n);return u?(hls=new bl.default,a.current.onInstanceCreated&&a.current.onInstanceCreated(hls),hls.on(bl.default.Events.ERROR,function(c,m){a.current.onError&&a.current.onError("HLS error: "+m.type,m),m.fatal&&(m.type===bl.default.ErrorTypes.MEDIA_ERROR?hls.recoverMediaError():(hls.destroy(),a.current.onCriticalFail&&a.current.onCriticalFail(m.type)))}),hls.on(bl.default.Events.MEDIA_ATTACHED,()=>hls.loadSource(t)),hls.on(bl.default.Events.MANIFEST_PARSED,()=>a.current.onReady&&a.current.onReady()),hls.on(bl.default.Events.INIT_PTS_FOUND,(c,m)=>a.current.onInitialPts&&a.current.onInitialPts({initPTS:m.initPTS})),hls.attachMedia(u),hls):(a.current.onCriticalFail&&a.current.onCriticalFail("Couldn't find element #"+n),null)};var Tk=dc();var oS=function(){return function(){return Tk(aS)}};bu();var xu={PRIMARY:"#1557B0",SECONDARY:"#4A5568",SUCCESS:"#007A3D",DANGER:"#C91E3E",WHITE:"#FFF",GRAY_300:"#E3EBF6",GRAY_500:"#6B7C93",GRAY_600:"#5E7290",GRAY_700:"#4A5568"};var up=Gp(dS(),1),pS=4,e$=({trackColor:t,background:n})=>({props:a,children:u})=>or.createElement("div",Object.assign({},a,{style:Object.assign({},a.style,{height:`${pS}px`,borderRadius:`${pS*2}px`,background:n||t})}),...u),n$=({horizontal:t})=>({props:n,isDragged:a})=>or.createElement("svg",Object.assign({},n,{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18"}),or.createElement("circle",{cx:"9",cy:"9",r:"8.5",fill:a?xu.SECONDARY:xu.WHITE,stroke:xu.SECONDARY}),or.createElement("path",{stroke:a?xu.WHITE:xu.SECONDARY,d:t?"M7.5 6L7.5 12":"M6 7.5L12 7.5"}),or.createElement("path",{stroke:a?xu.WHITE:xu.SECONDARY,d:t?"M10.5 6L10.5 12":"M6 10.5L12 10.5"})),vS=t=>or.createElement("div",{"aria-label":t.ariaLabel},or.createElement(up.Range,{step:t.step,min:t.min,max:t.max,values:[t.value],onChange:(([n])=>t.onChange(n)),onFinalChange:(([n])=>t.onFinalChange&&t.onFinalChange(n)),renderTrack:e$({trackColor:t.trackColor||xu.GRAY_300,background:t.fillBefore?(0,up.getTrackBackground)({values:[t.value],colors:[xu.PRIMARY,xu.GRAY_300],min:t.min,max:t.max,"aria-valuemax":t.max,"aria-valuemin":t.min,"aria-valuenow":t.value}):void 0}),renderThumb:n$({horizontal:!0})}));var a$=dc(),mS={CanPassToJavaScript0:function(){},CanReceiveFromJavaScript1:function(){return e1}};var _S=function(t){return function(){return function(){return a$(vS)}}};var u$=function(t){return t},mD=_a(null);var _D=function(t){return u$(_a(t))};var gS=function(t){var n=zT(t);return function(){return function(){return n("button")}}};var _J=b2(R2),hJ=Rm()(),Sc=function(t){return _J(t)},k_=function(t){var n=gS(t)()();return function(){return function(){return function(a){return function(u){return function(c){return function(m){return n(hJ(c)({className:a,"aria-label":u}))(m)}}}}}}};var gJ=Vu(qu)()(),DJ=_S(mS)()(),yJ=Fc(S_),RJ=k_(qu)()(),bJ=Fc(M_),DS=Su(Cu),TJ=Cd(Gu),$_=pl(Yn),DD=ut(ja),wS=jn(rr),EJ=sn(Pv),Qu=ut(yo),wJ=dl(Yn),gD=tn(Yn),FJ=V(Ut),CJ=NR(Cv),SJ=wS(Gr),Tl=wS(Ii),MJ=Za(yo),IJ=dt(Gr),AJ=Yp(js),xJ=Za(dr),yD=(function(){function t(){}return t.value=new t,t})(),RD=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),TD=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),yS=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),bD=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),RS=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),bS=(function(){function t(){}return t.value=new t,t})(),LJ=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),FS=function(t){return function(n){if(t.videoState instanceof G)return ia;if(t.videoState instanceof H){var a=gJ("")({style:Ai({minWidth:"6rem",width:"6rem"})})(DJ({value:(function(){return t.videoState.value0.muted?0:t.videoState.value0.volume})(),min:0,max:1,step:.05,onChange:yJ(n)(function(w){return lr.create(RD.create(w))}),ariaLabel:"Volume slider"})),u=(function(){if(t.videoState.value0.muted)return"fe-volume-x";if(ue)return"fe-volume-2";throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 122, column 3 - line 124, column 32): ")})(),c=RJ("btn large px-3 py-1 mr-3 text-white fe "+u)(_D("Mute the video"))({onClick:bJ(n)(new lr(yD.value))})(ia),m=DS("d-flex align-items-center text-white px-3")([fc("LIVE"),TJ("text-danger x-large ml-2 mt-n1")("\u25CF")]);return DS("mb-2 w-100 d-flex align-items-center bg-semi-transparent-black "+(function(){return t.visible?"":"hidden"})())([yl(t.config.liveIndicator)(m),yl(t.config.mute)(c),yl(t.config.volume)(a)])}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 95, column 1 - line 95, column 50): "+[t.constructor.name,n.constructor.name])}},CS=function(t){return lr.create(TD.create(t))},TS=function(t){return $_(DD(new nr(new LJ(function(n){return function(){return t(n)(),new lr(new TD(n))}}))))},W_=(function(){return new lr(new bD(!0))})(),SS=function(t){return{config:t,videoState:G.value,visible:!1,visibilityExpiration:EJ}},ES=2e3,MS=function(t){return function(n){if(n instanceof nr)return Qu(t);if(n instanceof lr){var a=wJ(gD(function(){var w=ed();return FJ(function(v){return lr.create(RS.create(v))})(CJ(ES)(w))})),u=SJ(Hu(ES))(function(){return DD(new lr(bS.value))}),c=function(m){if(n.value0 instanceof yD)return Qu(t);var w=function(v){if(n.value0 instanceof RD)return Qu(t);if(n.value0 instanceof TD)return Tl($_(gD(function(){var k=m0(n.value0.value0)(),y=p0(n.value0.value0)();return new lr(new yS({muted:k,volume:y}))})))(function(){return Qu(t)});if(n.value0 instanceof yS)return Qu({config:t.config,visibilityExpiration:t.visibilityExpiration,visible:t.visible,videoState:new H(n.value0.value0)});if(n.value0 instanceof bD)return Tl(MJ(n.value0.value0)(a))(function(){return Tl($_(u))(function(){return Qu({config:t.config,videoState:t.videoState,visibilityExpiration:t.visibilityExpiration,visible:n.value0.value0})})});if(n.value0 instanceof RS)return Qu({config:t.config,videoState:t.videoState,visible:t.visible,visibilityExpiration:n.value0.value0});if(n.value0 instanceof bS)return Tl($_(IJ(gD(ed))(function(g){var k=AJ(g)(t.visibilityExpiration);return k?DD(new lr(new bD(!1))):u})))(function(){return Qu(t)});throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 138, column 1 - line 138, column 55): "+[n.value0.constructor.name])};return n.value0 instanceof RD&&t.videoState instanceof H?Tl(a)(function(){return Tl(TS(function(v){return function(){return xJ(n.value0.value0>0)(yc(!1)(v))(),v0(n.value0.value0)(v)()}}))(function(){return Qu({config:t.config,visibilityExpiration:t.visibilityExpiration,visible:t.visible,videoState:new H({muted:t.videoState.value0.muted,volume:n.value0.value0})})})}):w(!0)};return n.value0 instanceof yD&&t.videoState instanceof H?Tl(a)(function(){return Tl(TS(yc(!t.videoState.value0.muted)))(function(){return Qu({config:t.config,visibilityExpiration:t.visibilityExpiration,visible:t.visible,videoState:new H({volume:t.videoState.value0.volume,muted:!t.videoState.value0.muted})})})}):c(!0)}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 138, column 1 - line 138, column 55): "+[t.constructor.name,n.constructor.name])}},IS=function(t){if(t instanceof H)return!1;if(t instanceof G)return!0;throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 206, column 1 - line 206, column 37): "+[t.constructor.name])};var AS=t=>n=>a=>()=>t.then(a,n),xS=t=>t instanceof Error,LS=t=>t===null?"null":typeof t>"u"?"undefined":t.toString();var OJ=ut(jo(ar)),UJ=rc(ar),kJ=Ot($t),NS=Rn(Ys(ud)(ar)),$J=Tf(ar),WJ=V(mf(Nu)),HJ=Kg(ar),BJ=jp(Ee),JJ=Ze(sb);var GJ=function(t){var n=function(a){if(xS(a))return OJ(a);if(ue)return UJ(new nc(""));throw new Error("Failed pattern match at Utils.Promise (line 58, column 3 - line 60, column 41): "+[a.constructor.name])};return Bn(function(a){return Ja("Promise failed: "+LS(t))})(kJ)(Bf(NS(n(t))(NS($J("Error")(t))(WJ(Ja)(HJ(t))))))},H_=function(t){return nl(function(n){return BJ(JJ)(AS(t)(function(a){return n(Et.create(GJ(a)))()})(function(a){return n(Ct.create(a))()}))})};function PS(t,n){typeof CV<"u"&&CV.tracking&&CV.tracking.event(t,n)}var VJ=cm();var KJ=function(t){var n=tn(t);return function(a){return function(u){return n(function(){return PS(a,u)})}}},OS=function(t){var n=KJ(t);return function(){return function(a){return function(u){return n(a)(VJ(u))}}}};var QJ=dt(nn),XJ=Su(qu),ip=dt(ro),ED=mi(dr)(kl),Mc=Fc(M_),US=Tm(Gu)()(),ZJ=oS()();var kS=Fc(S_),$S=Vu(qu)()(),tG=k_(Cu)()(),eG=Em(Gu),nG=Su(Cu),GS=jn(rr),rG=OS(Yn)(),aG=ao(Ce)(xr),oG=Wt(No(Qr)),Vf=GS(Gr),uG=ii(ja),iG=pr(gf),Or=ut(ja),qS=tn(Yn),WS=va(Zs),jS=ms(Gr),Ir=ut(yo),Pr=GS(Ii),La=pl(Yn),HS=V(Ru),BS=dl(Yn),lG=V(Ee),cG=Ca(ym(Ru)),fG=V(Ut);var zS=(function(){function t(){}return t.value=new t,t})(),VS=(function(){function t(){}return t.value=new t,t})(),lp=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),KS=(function(){function t(){}return t.value=new t,t})(),Kf=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),YS=(function(){function t(){}return t.value=new t,t})(),QS=(function(){function t(){}return t.value=new t,t})(),JS=(function(){function t(){}return t.value=new t,t})(),wD=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),FD=(function(){function t(){}return t.value=new t,t})(),J_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),G_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),B_=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),XS=(function(){function t(){}return t.value=new t,t})(),CD=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),SD=(function(){function t(){}return t.value=new t,t})(),ZS=(function(){function t(){}return t.value=new t,t})(),tM=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),Ic=(function(){function t(){}return t.value=new t,t})(),Xu=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),eM=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),sG=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),Yf=(function(){function t(n){this.value0=n}return t.create=function(n){return new t(n)},t})(),nM=function(t){var n=t.Monad0(),a=dt(n.Bind1()),u=tn(t),c=ut(n.Applicative0());return function(m){return function(w){return function(v){return a(u(zw(m.videoId)))(function(g){return ke(c(w.whenNotFound))(v)(QJ(g)(kw))})}}}};var MD=nM(Yn),rM=function(t){var n=nM(t);return function(a){return n(a)({whenNotFound:void 0})}},dG=rM(sf),pG=rM(Yn),aM=function(t){return function(n){return function(a){var u=(function(){var M=XJ("position-absolute-fullsize py-6 d-flex align-items-center justify-content-around");if(n.stage instanceof KS)return M(t.errorScreen("It appears that video playback is not supported in your browser."));if(n.stage instanceof YS)return M(t.errorScreen("The video didn't load correctly, try refreshing the page."));if(n.stage instanceof lp)return M(t.introScreen);if(n.stage instanceof Kf)return ia;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 246, column 18 - line 258, column 14): "+[n.stage.constructor.name])})(),c=(function(){return n.stage instanceof lp?n.stage.value0.reset:!1})(),m=Sc(function(M){return ip(Qm(M))(ED(function(U){return a(new lr(new sG({time:U})))}))}),w=Sc(function(M){return ip(Qm(M))(ED(function(U){return a(new lr(new eM({playing:!0,time:U})))}))}),v=function(M){return a(nr.create(M))},g=Sc(function(M){return ip(Qm(M))(ED(function(U){return v(new CD(U))}))}),k=Mc(v)(XS.value),y=Ed([US("w-100 t--real-video")({id:n.videoId,controls:Lo(n.customControls),onVolumeChange:k,onTimeUpdate:m,onPlay:w,onPause:g})(""),yl(!c)(ZJ({videoStreamUrl:t.watchUrl,videoElementId:n.videoId,onNotSupported:v(QS.value),onError:function(M,U){return void 0},onCriticalFail:kS(v)(function(M){var U=M==="networkError";return U?FD.value:new J_("HLS player crashed")}),onReady:v(new G_({autoPlay:t.autoPlay})),onInitialPts:kS(v)(function(M){return new tM(M.initPTS)})}))]),E=(function(){return n.stage instanceof Kf&&n.stage.value0.unmuteOverlay?$S("position-absolute-fullsize d-flex align-items-center justify-content-center t--unmute-overlay")({style:Ai({pointerEvents:"none"})})(tG("btn btn-sm btn-light border-dark px-4 d-flex align-items-center")(mD)({onClick:Mc(v)(ZS.value),style:Ai({pointerEvents:"all"})})([fc("click for sound"),eG("fe fe-volume-2 ml-2")("")])):ia})(),x=function(M){return $S("position-absolute-fullsize d-flex align-items-end t--controls-overlay")({onMouseMove:Mc(v)(new Xu(W_)),onMouseDown:Mc(v)(new Xu(W_)),onTouchStart:Mc(v)(new Xu(W_))})(FS(M)(function(U){return v(Xu.create(U))}))},C=US("w-100 t--real-video")({id:n.videoId,controls:Lo(n.customControls),playsInline:!0,onVolumeChange:k,onTimeUpdate:m,onPlay:w,onPause:g,onLoadedMetadata:Mc(v)(new G_({autoPlay:t.autoPlay})),onError:Mc(v)(FD.value),src:(function(){return c?"":t.watchUrl})()})("");return nG("position-relative w-100")([(function(){if(n.support instanceof zS)return y;if(n.support instanceof VS)return C;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 165, column 7 - line 167, column 40): "+[n.support.constructor.name])})(),R0(n.customControls)(x),yl(n.allowSound)(E),u])}}},vG=function(t){var n=tn(t.MonadEffect0());return function(a){return n(function(){return dG(a)(yc(!1))(),SD.value})}},mG=vG(Zw),ID=function(t){return rG("Livestream: Error")({livestream_error_message:t})};var _G=function(t){return tn(t)(function(){var a=ip(ip(Iu)(D0))(g0)();return aG(function(u){return oG(Lm(u)(a))(new H(0))})(["iPad","iPod","iPhone"])})},oM=_G(Yn),hG=function(t){var n=function(u){return Vf(uG(t.allowSound)(iG(Ja("Skipping attempt to play unmuted because sound was programmatically disallowed"))))(function(){return Vf(H_(N_(u)))(function(){return Or(new B_({unmuteOverlay:!1}))})})},a=function(u){return Vf(qS(yc(!0)(u)))(function(){return Vf(H_(N_(u)))(function(){return Or(new B_({unmuteOverlay:!0}))})})};return MD(t)({whenNotFound:new J_("