var Purs_EntryPoints_Livestream_MiniPromo=(()=>{var kM=Object.create;var Uv=Object.defineProperty;var $M=Object.getOwnPropertyDescriptor;var WM=Object.getOwnPropertyNames;var HM=Object.getPrototypeOf,BM=Object.prototype.hasOwnProperty;var JM=(e,n)=>()=>(e&&(n=e(e=0)),n);var cu=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),kD=(e,n)=>{for(var r in n)Uv(e,r,{get:n[r],enumerable:!0})},$D=(e,n,r,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of WM(n))!BM.call(e,c)&&c!==r&&Uv(e,c,{get:()=>n[c],enumerable:!(u=$M(n,c))||u.enumerable});return e};var kv=(e,n,r)=>(r=e!=null?kM(HM(e)):{},$D(n||!e||!e.__esModule?Uv(r,"default",{value:e,enumerable:!0}):r,e)),Gh=e=>$D(Uv({},"__esModule",{value:!0}),e);var Wg={};kD(Wg,{Children:()=>d7,Component:()=>p7,Fragment:()=>D7,PureComponent:()=>T7,Suspense:()=>E7,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>s7,cloneElement:()=>v7,createContext:()=>m7,createElement:()=>_7,createRef:()=>h7,default:()=>nr,forwardRef:()=>g7,isValidElement:()=>y7,lazy:()=>R7,memo:()=>b7,useCallback:()=>w7,useContext:()=>F7,useEffect:()=>$g,useImperativeHandle:()=>C7,useLayoutEffect:()=>S7,useMemo:()=>M7,useReducer:()=>I7,useRef:()=>A7,useState:()=>L7,version:()=>x7});var nr,s7,d7,v7,p7,m7,_7,h7,g7,D7,y7,R7,b7,T7,E7,w7,F7,$g,C7,S7,M7,I7,A7,L7,x7,Hu=JM(()=>{nr=window.React,{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:s7,Children:d7,cloneElement:v7,Component:p7,createContext:m7,createElement:_7,createRef:h7,forwardRef:g7,Fragment:D7,isValidElement:y7,lazy:R7,memo:b7,PureComponent:T7,Suspense:E7,useCallback:w7,useContext:F7,useEffect:$g,useImperativeHandle:C7,useLayoutEffect:S7,useMemo:M7,useReducer:I7,useRef:A7,useState:L7,version:x7}=window.React});var t1=cu((LZ,Vb)=>{"use strict";var zb=Object.getOwnPropertySymbols,KA=Object.prototype.hasOwnProperty,YA=Object.prototype.propertyIsEnumerable;function QA(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function XA(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var n={},r=0;r<10;r++)n["_"+String.fromCharCode(r)]=r;var u=Object.getOwnPropertyNames(n).map(function(p){return n[p]});if(u.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(p){c[p]=p}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Vb.exports=XA()?Object.assign:function(e,n){for(var r,u=QA(e),c,p=1;p{"use strict";var r1=t1(),mf=60103,Qb=60106;hn.Fragment=60107;hn.StrictMode=60108;hn.Profiler=60114;var Xb=60109,Zb=60110,eT=60112;hn.Suspense=60113;var tT=60115,nT=60116;typeof Symbol=="function"&&Symbol.for&&(qo=Symbol.for,mf=qo("react.element"),Qb=qo("react.portal"),hn.Fragment=qo("react.fragment"),hn.StrictMode=qo("react.strict_mode"),hn.Profiler=qo("react.profiler"),Xb=qo("react.provider"),Zb=qo("react.context"),eT=qo("react.forward_ref"),hn.Suspense=qo("react.suspense"),tT=qo("react.memo"),nT=qo("react.lazy"));var qo,Kb=typeof Symbol=="function"&&Symbol.iterator;function ZA(e){return e===null||typeof e!="object"?null:(e=Kb&&e[Kb]||e["@@iterator"],typeof e=="function"?e:null)}function id(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r{"use strict";sT.exports=fT()});var PT=cu(hf=>{"use strict";var yu=t1(),Fi=dT();function rr(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;rld;ld++)ta[ld]=ld+1;var ta,ld;ta[15]=0;var uL=/^[: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]*$/,vT=Object.prototype.hasOwnProperty,pT={},mT={};function MT(e){return vT.call(mT,e)?!0:vT.call(pT,e)?!1:uL.test(e)?mT[e]=!0:(pT[e]=!0,!1)}function iL(e,n,r,u){if(r!==null&&r.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return u?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function lL(e,n,r,u){if(n===null||typeof n>"u"||iL(e,n,r,u))return!0;if(u)return!1;if(r!==null)switch(r.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function Ia(e,n,r,u,c,p,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=c,this.mustUseProperty=r,this.propertyName=e,this.type=n,this.sanitizeURL=p,this.removeEmptyString=E}var na={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){na[e]=new Ia(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];na[n]=new Ia(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){na[e]=new Ia(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){na[e]=new Ia(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){na[e]=new Ia(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){na[e]=new Ia(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){na[e]=new Ia(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){na[e]=new Ia(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){na[e]=new Ia(e,5,!1,e.toLowerCase(),null,!1,!1)});var D1=/[\-:]([a-z])/g;function y1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(D1,y1);na[n]=new Ia(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(D1,y1);na[n]=new Ia(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(D1,y1);na[n]=new Ia(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){na[e]=new Ia(e,1,!1,e.toLowerCase(),null,!1,!1)});na.xlinkHref=new Ia("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){na[e]=new Ia(e,1,!1,e.toLowerCase(),null,!0,!0)});var cL=/["'&<>]/;function Xl(e){if(typeof e=="boolean"||typeof e=="number")return""+e;e=""+e;var n=cL.exec(e);if(n){var r="",u,c=0;for(u=n.index;uDm))throw Error(rr(301));if(e===Ju)if(gm=!0,e={action:r,next:null},rl===null&&(rl=new Map),r=rl.get(n),r===void 0)rl.set(n,e);else{for(n=r;n.next!==null;)n=n.next;n.next=e}}function l1(){}var ec=null,pL={readContext:function(e){var n=ec.threadID;return dd(e,n),e[n]},useContext:function(e){Zl();var n=ec.threadID;return dd(e,n),e[n]},useMemo:gT,useReducer:hT,useRef:function(e){Ju=Zl(),Hn=R1();var n=Hn.memoizedState;return n===null?(e={current:e},Hn.memoizedState=e):n},useState:function(e){return hT(LT,e)},useLayoutEffect:function(){},useCallback:function(e,n){return gT(function(){return e},n)},useImperativeHandle:l1,useEffect:l1,useDebugValue:l1,useDeferredValue:function(e){return Zl(),e},useTransition:function(){return Zl(),[function(e){e()},!1]},useOpaqueIdentifier:function(){return(ec.identifierPrefix||"")+"R:"+(ec.uniqueID++).toString(36)},useMutableSource:function(e,n){return Zl(),n(e._source)}},DT={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function yT(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var xT={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},mL=yu({menuitem:!0},xT),sd={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},_L=["Webkit","ms","Moz","O"];Object.keys(sd).forEach(function(e){_L.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),sd[n]=sd[e]})});var hL=/([A-Z])/g,gL=/^ms-/,nl=Fi.Children.toArray,c1=aL.ReactCurrentDispatcher,DL={listing:!0,pre:!0,textarea:!0},yL=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,RT={},f1={};function RL(e){if(e==null)return e;var n="";return Fi.Children.forEach(e,function(r){r!=null&&(n+=r)}),n}var bL=Object.prototype.hasOwnProperty,TL={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function bT(e,n){if(e===void 0)throw Error(rr(152,fd(n)||"Component"))}function EL(e,n,r){function u(E,d){var h=d.prototype&&d.prototype.isReactComponent,O=oL(d,n,r,h),y=[],w=!1,L={isMounted:function(){return!1},enqueueForceUpdate:function(){if(y===null)return null},enqueueReplaceState:function(ee,ae){w=!0,y=[ae]},enqueueSetState:function(ee,ae){if(y===null)return null;y.push(ae)}};if(h){if(h=new d(E.props,O,L),typeof d.getDerivedStateFromProps=="function"){var C=d.getDerivedStateFromProps.call(null,E.props,h.state);C!=null&&(h.state=yu({},h.state,C))}}else if(Ju={},h=d(E.props,O,L),h=IT(d,E.props,h,O),h==null||h.render==null){e=h,bT(e,d);return}if(h.props=E.props,h.context=O,h.updater=L,L=h.state,L===void 0&&(h.state=L=null),typeof h.UNSAFE_componentWillMount=="function"||typeof h.componentWillMount=="function")if(typeof h.componentWillMount=="function"&&typeof d.getDerivedStateFromProps!="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&typeof d.getDerivedStateFromProps!="function"&&h.UNSAFE_componentWillMount(),y.length){L=y;var M=w;if(y=null,w=!1,M&&L.length===1)h.state=L[0];else{C=M?L[0]:h.state;var k=!0;for(M=M?1:0;M=d))throw Error(rr(304));var h=new Uint16Array(d);for(h.set(E),ta=h,ta[0]=p+1,E=p;E=h.children.length){var O=h.footer;if(O!==""&&(this.previousWasTextNode=!1),this.stack.pop(),h.type==="select")this.currentSelectValue=null;else if(h.type!=null&&h.type.type!=null&&h.type.type.$$typeof===_m)this.popProvider(h.type);else if(h.type===hm){this.suspenseDepth--;var y=p.pop();if(E){E=!1;var w=h.fallbackFrame;if(!w)throw Error(rr(303));this.stack.push(w),p[this.suspenseDepth]+="";continue}else p[this.suspenseDepth]+=y}p[this.suspenseDepth]+=O}else{var L=h.children[h.childIndex++],C="";try{C+=this.render(L,h.context,h.domNamespace)}catch(M){throw M!=null&&typeof M.then=="function"?Error(rr(294)):M}p.length<=this.suspenseDepth&&p.push(""),p[this.suspenseDepth]+=C}}return p[0]}finally{c1.current=c,ec=u,AT()}},n.render=function(r,u,c){if(typeof r=="string"||typeof r=="number")return c=""+r,c===""?"":this.makeStaticMarkup?Xl(c):this.previousWasTextNode?""+Xl(c):(this.previousWasTextNode=!0,Xl(c));if(u=EL(r,u,this.threadID),r=u.child,u=u.context,r===null||r===!1)return"";if(!Fi.isValidElement(r)){if(r!=null&&r.$$typeof!=null)throw c=r.$$typeof,Error(c===s1?rr(257):rr(258,c.toString()));return r=nl(r),this.stack.push({type:null,domNamespace:c,children:r,childIndex:0,context:u,footer:""}),""}var p=r.type;if(typeof p=="string")return this.renderDOM(r,u,c);switch(p){case CT:case FT:case d1:case v1:case _1:case mm:return r=nl(r.props.children),this.stack.push({type:null,domNamespace:c,children:r,childIndex:0,context:u,footer:""}),"";case hm:throw Error(rr(294));case wT:throw Error(rr(343))}if(typeof p=="object"&&p!==null)switch(p.$$typeof){case m1:Ju={};var E=p.render(r.props,r.ref);return E=IT(p.render,r.props,E,r.ref),E=nl(E),this.stack.push({type:null,domNamespace:c,children:E,childIndex:0,context:u,footer:""}),"";case h1:return r=[Fi.createElement(p.type,yu({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:c,children:r,childIndex:0,context:u,footer:""}),"";case _m:return p=nl(r.props.children),c={type:r,domNamespace:c,children:p,childIndex:0,context:u,footer:""},this.pushProvider(r),this.stack.push(c),"";case p1:p=r.type,E=r.props;var d=this.threadID;return dd(p,d),p=nl(E.children(p[d])),this.stack.push({type:r,domNamespace:c,children:p,childIndex:0,context:u,footer:""}),"";case ET:throw Error(rr(338));case g1:return p=r.type,E=p._init,p=E(p._payload),r=[Fi.createElement(p,yu({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:c,children:r,childIndex:0,context:u,footer:""}),""}throw Error(rr(130,p==null?p:typeof p,""))},n.renderDOM=function(r,u,c){var p=r.type.toLowerCase();if(c===DT.html&&yT(p),!RT.hasOwnProperty(p)){if(!yL.test(p))throw Error(rr(65,p));RT[p]=!0}var E=r.props;if(p==="input")E=yu({type:void 0},E,{defaultChecked:void 0,defaultValue:void 0,value:E.value!=null?E.value:E.defaultValue,checked:E.checked!=null?E.checked:E.defaultChecked});else if(p==="textarea"){var d=E.value;if(d==null){d=E.defaultValue;var h=E.children;if(h!=null){if(d!=null)throw Error(rr(92));if(Array.isArray(h)){if(!(1>=h.length))throw Error(rr(93));h=h[0]}d=""+h}d==null&&(d="")}E=yu({},E,{value:void 0,children:""+d})}else if(p==="select")this.currentSelectValue=E.value!=null?E.value:E.defaultValue,E=yu({},E,{value:void 0});else if(p==="option"){h=this.currentSelectValue;var O=RL(E.children);if(h!=null){var y=E.value!=null?E.value+"":O;if(d=!1,Array.isArray(h)){for(var w=0;w":(ae+=">",d="");e:{if(h=E.dangerouslySetInnerHTML,h!=null){if(h.__html!=null){h=h.__html;break e}}else if(h=E.children,typeof h=="string"||typeof h=="number"){h=Xl(h);break e}h=null}return h!=null?(E=[],DL.hasOwnProperty(p)&&h.charAt(0)===` `&&(ae+=` `),ae+=h):E=nl(E.children),r=r.type,c=c==null||c==="http://www.w3.org/1999/xhtml"?yT(r):c==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":c,this.stack.push({domNamespace:c,type:p,children:E,childIndex:0,context:u,footer:d}),this.previousWasTextNode=!1,ae},e})();hf.renderToNodeStream=function(){throw Error(rr(207))};hf.renderToStaticMarkup=function(e,n){e=new NT(e,!0,n);try{return e.read(1/0)}finally{e.destroy()}};hf.renderToStaticNodeStream=function(){throw Error(rr(208))};hf.renderToString=function(e,n){e=new NT(e,!1,n);try{return e.read(1/0)}finally{e.destroy()}};hf.version="17.0.2"});var UT=cu((OZ,OT)=>{"use strict";OT.exports=PT()});var T2=cu((F_,tD)=>{(function(n,r){typeof F_=="object"&&typeof tD=="object"?tD.exports=r():typeof define=="function"&&define.amd?define([],r):typeof F_=="object"?F_.Pusher=r():n.Pusher=r()})(window,function(){return(function(e){var n={};function r(u){if(n[u])return n[u].exports;var c=n[u]={i:u,l:!1,exports:{}};return e[u].call(c.exports,c,c.exports,r),c.l=!0,c.exports}return r.m=e,r.c=n,r.d=function(u,c,p){r.o(u,c)||Object.defineProperty(u,c,{enumerable:!0,get:p})},r.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},r.t=function(u,c){if(c&1&&(u=r(u)),c&8||c&4&&typeof u=="object"&&u&&u.__esModule)return u;var p=Object.create(null);if(r.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:u}),c&2&&typeof u!="string")for(var E in u)r.d(p,E,function(d){return u[d]}.bind(null,E));return p},r.n=function(u){var c=u&&u.__esModule?function(){return u.default}:function(){return u};return r.d(c,"a",c),c},r.o=function(u,c){return Object.prototype.hasOwnProperty.call(u,c)},r.p="",r(r.s=2)})([(function(e,n,r){"use strict";var u=this&&this.__extends||(function(){var C=function(M,k){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,k)};return function(M,k){C(M,k);function B(){this.constructor=M}M.prototype=k===null?Object.create(k):(B.prototype=k.prototype,new B)}})();Object.defineProperty(n,"__esModule",{value:!0});var c=256,p=(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 k="",B=0;B>>18&63),k+=this._encodeByte(Q>>>12&63),k+=this._encodeByte(Q>>>6&63),k+=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);k+=this._encodeByte(Q>>>18&63),k+=this._encodeByte(Q>>>12&63),z===2?k+=this._encodeByte(Q>>>6&63):k+=this._paddingCharacter||"",k+=this._paddingCharacter||""}return k},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 k=this._getPaddingLength(M),B=M.length-k,Q=new Uint8Array(this.maxDecodedLength(B)),z=0,ee=0,ae=0,ne=0,me=0,_e=0,nt=0;ee>>4,Q[z++]=me<<4|_e>>>2,Q[z++]=_e<<6|nt,ae|=ne&c,ae|=me&c,ae|=_e&c,ae|=nt&c;if(ee>>4,ae|=ne&c,ae|=me&c),ee>>2,ae|=_e&c),ee>>8&6,k+=51-M>>>8&-75,k+=61-M>>>8&-15,k+=62-M>>>8&3,String.fromCharCode(k)},C.prototype._decodeChar=function(M){var k=c;return k+=(42-M&M-44)>>>8&-c+M-43+62,k+=(46-M&M-48)>>>8&-c+M-47+63,k+=(47-M&M-58)>>>8&-c+M-48+52,k+=(64-M&M-91)>>>8&-c+M-65+0,k+=(96-M&M-123)>>>8&-c+M-97+26,k},C.prototype._getPaddingLength=function(M){var k=0;if(this._paddingCharacter){for(var B=M.length-1;B>=0&&M[B]===this._paddingCharacter;B--)k++;if(M.length<4||k>2)throw new Error("Base64Coder: incorrect padding")}return k},C})();n.Coder=p;var E=new p;function d(C){return E.encode(C)}n.encode=d;function h(C){return E.decode(C)}n.decode=h;var O=(function(C){u(M,C);function M(){return C!==null&&C.apply(this,arguments)||this}return M.prototype._encodeByte=function(k){var B=k;return B+=65,B+=25-k>>>8&6,B+=51-k>>>8&-75,B+=61-k>>>8&-13,B+=62-k>>>8&49,String.fromCharCode(B)},M.prototype._decodeChar=function(k){var B=c;return B+=(44-k&k-46)>>>8&-c+k-45+62,B+=(94-k&k-96)>>>8&-c+k-95+63,B+=(47-k&k-58)>>>8&-c+k-48+52,B+=(64-k&k-91)>>>8&-c+k-65+0,B+=(96-k&k-123)>>>8&-c+k-97+26,B},M})(p);n.URLSafeCoder=O;var y=new O;function w(C){return y.encode(C)}n.encodeURLSafe=w;function L(C){return y.decode(C)}n.decodeURLSafe=L,n.encodedLength=function(C){return E.encodedLength(C)},n.maxDecodedLength=function(C){return E.maxDecodedLength(C)},n.decodedLength=function(C){return E.decodedLength(C)}}),(function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var u="utf8: invalid string",c="utf8: invalid source encoding";function p(h){for(var O=new Uint8Array(E(h)),y=0,w=0;w>6,O[y++]=128|L&63):L<55296?(O[y++]=224|L>>12,O[y++]=128|L>>6&63,O[y++]=128|L&63):(w++,L=(L&1023)<<10,L|=h.charCodeAt(w)&1023,L+=65536,O[y++]=240|L>>18,O[y++]=128|L>>12&63,O[y++]=128|L>>6&63,O[y++]=128|L&63)}return O}n.encode=p;function E(h){for(var O=0,y=0;y=h.length-1)throw new Error(u);y++,O+=4}else throw new Error(u)}return O}n.encodedLength=E;function d(h){for(var O=[],y=0;y=h.length)throw new Error(c);var C=h[++y];if((C&192)!==128)throw new Error(c);w=(w&31)<<6|C&63,L=128}else if(w<240){if(y>=h.length-1)throw new Error(c);var C=h[++y],M=h[++y];if((C&192)!==128||(M&192)!==128)throw new Error(c);w=(w&15)<<12|(C&63)<<6|M&63,L=2048}else if(w<248){if(y>=h.length-2)throw new Error(c);var C=h[++y],M=h[++y],k=h[++y];if((C&192)!==128||(M&192)!==128||(k&192)!==128)throw new Error(c);w=(w&15)<<18|(C&63)<<12|(M&63)<<6|k&63,L=65536}else throw new Error(c);if(w=55296&&w<=57343)throw new Error(c);if(w>=65536){if(w>1114111)throw new Error(c);w-=65536,O.push(String.fromCharCode(55296|w>>10)),w=56320|w&1023}}O.push(String.fromCharCode(w))}return O.join("")}n.decode=d}),(function(e,n,r){e.exports=r(3).default}),(function(e,n,r){"use strict";r.r(n);var u=(function(){function s(f,m){this.lastId=0,this.prefix=f,this.name=m}return s.prototype.create=function(f){this.lastId++;var m=this.lastId,T=this.prefix+m,F=this.name+"["+m+"]",J=!1,le=function(){J||(f.apply(null,arguments),J=!0)};return this[m]=le,{number:m,id:T,name:F,callback:le}},s.prototype.remove=function(f){delete this[f.number]},s})(),c=new u("_pusher_script_","Pusher.ScriptReceivers"),p={VERSION:"6.0.3",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},E=p,d=(function(){function s(f){this.options=f,this.receivers=f.receivers||c,this.loading={}}return s.prototype.load=function(f,m,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=jt.createScriptRequest(F.getPath(f,m)),le=F.receivers.create(function(Ie){if(F.receivers.remove(le),F.loading[f]){var mt=F.loading[f];delete F.loading[f];for(var Dn=function(Vr){Vr||J.cleanup()},Un=0;Un>>6)+L(128|f&63):L(224|f>>>12&15)+L(128|f>>>6&63)+L(128|f&63)},z=function(s){return s.replace(/[^\x00-\x7F]/g,Q)},ee=function(s){var f=[0,2,1][s.length%3],m=s.charCodeAt(0)<<16|(s.length>1?s.charCodeAt(1):0)<<8|(s.length>2?s.charCodeAt(2):0),T=[C.charAt(m>>>18),C.charAt(m>>>12&63),f>=2?"=":C.charAt(m>>>6&63),f>=1?"=":C.charAt(m&63)];return T.join("")},ae=window.btoa||function(s){return s.replace(/[\s\S]{1,3}/g,ee)},ne=(function(){function s(f,m,T,F){var J=this;this.clear=m,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})(),me=ne,_e=(function(){var s=function(f,m){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,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})();function nt(s){window.clearTimeout(s)}function ot(s){window.clearInterval(s)}var ct=(function(s){_e(f,s);function f(m,T){return s.call(this,setTimeout,nt,m,function(F){return T(),null})||this}return f})(me),Mn=(function(s){_e(f,s);function f(m,T){return s.call(this,setInterval,ot,m,function(F){return T(),F})||this}return f})(me),Ln={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(s){return new ct(0,s)},method:function(s){for(var f=[],m=1;m0)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}},re=Zu,au=(function(){var s=function(f,m){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,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),ou=(function(s){au(f,s);function f(m,T){var F=s.call(this)||this;return F.id=m,F.transport=T,F.activityTimeout=T.activityTimeout,F.bindListeners(),F}return f.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},f.prototype.send=function(m){return this.transport.send(m)},f.prototype.send_event=function(m,T,F){var J={event:m,data:T};return F&&(J.channel=F),at.debug("Event sent",J),this.send(re.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 m=this,T={message:function(J){var le;try{le=re.decodeMessage(J)}catch(Ie){m.emit("error",{type:"MessageParseError",error:Ie,data:J.data})}if(le!==void 0){switch(at.debug("Event recd",le),le.event){case"pusher:error":m.emit("error",{type:"PusherError",data:le.data});break;case"pusher:ping":m.emit("ping");break;case"pusher:pong":m.emit("pong");break}m.emit("message",le)}},activity:function(){m.emit("activity")},error:function(J){m.emit("error",{type:"WebSocketError",error:J})},closed:function(J){F(),J&&J.code&&m.handleCloseEvent(J),m.transport=null,m.emit("closed")}},F=function(){fn(T,function(J,le){m.transport.unbind(le,J)})};fn(T,function(J,le){m.transport.bind(le,J)})},f.prototype.handleCloseEvent=function(m){var T=re.getCloseAction(m),F=re.getCloseError(m);F&&this.emit("error",F),T&&this.emit(T,{action:T,error:F})},f})(dt),ei=ou,uu=(function(){function s(f,m){this.transport=f,this.callback=m,this.bindListeners()}return s.prototype.close=function(){this.unbindListeners(),this.transport.close()},s.prototype.bindListeners=function(){var f=this;this.onMessage=function(m){f.unbindListeners();var T;try{T=re.processHandshake(m)}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(m){f.unbindListeners();var T=re.getCloseAction(m)||"backoff",F=re.getCloseError(m);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,m){this.callback(Wt({transport:this.transport,action:f},m))},s})(),To=uu,Jf=(function(){function s(f,m){this.channel=f;var T=m.authTransport;if(typeof jt.getAuthorizers()[T]>"u")throw"'"+T+"' is not a recognized auth transport";this.type=T,this.options=m,this.authOptions=m.auth||{}}return s.prototype.composeQuery=function(f){var m="socket_id="+encodeURIComponent(f)+"&channel_name="+encodeURIComponent(this.channel.name);for(var T in this.authOptions.params)m+="&"+encodeURIComponent(T)+"="+encodeURIComponent(this.authOptions.params[T]);return m},s.prototype.authorize=function(f,m){s.authorizers=s.authorizers||jt.getAuthorizers(),s.authorizers[this.type].call(this,jt,f,m)},s})(),Dl=Jf,hc=(function(){function s(f,m){this.timeline=f,this.options=m||{}}return s.prototype.send=function(f,m){this.timeline.isEmpty()||this.timeline.send(jt.TimelineTransport.getAgent(this,f),m)},s})(),gc=hc,Eo=(function(){var s=function(f,m){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,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),ga=(function(s){Eo(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),ti=(function(s){Eo(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),Dc=(function(s){Eo(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),Gf=(function(s){Eo(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),yc=(function(s){Eo(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),av=(function(s){Eo(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),xi=(function(s){Eo(f,s);function f(m){var T=this.constructor,F=s.call(this,m)||this;return Object.setPrototypeOf(F,T.prototype),F}return f})(Error),B_=(function(){var s=function(f,m){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,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),J_=(function(s){B_(f,s);function f(m,T){var F=s.call(this,function(J,le){at.debug("No callbacks on "+m+" for "+J)})||this;return F.name=m,F.pusher=T,F.subscribed=!1,F.subscriptionPending=!1,F.subscriptionCancelled=!1,F}return f.prototype.authorize=function(m,T){return T(!1,{auth:""})},f.prototype.trigger=function(m,T){if(m.indexOf("client-")!==0)throw new ga("Event '"+m+"' does not start with 'client-'");if(!this.subscribed){var F=Jt.buildLogSuffix("triggeringClientEvents");at.warn("Client event triggered before channel 'subscription_succeeded' event . "+F)}return this.pusher.send_event(m,T,this.name)},f.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},f.prototype.handleEvent=function(m){var T=m.event,F=m.data;if(T==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(m);else if(T.indexOf("pusher_internal:")!==0){var J={};this.emit(T,F,J)}},f.prototype.handleSubscriptionSucceededEvent=function(m){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",m.data)},f.prototype.subscribe=function(){var m=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(T,F){T?(at.error(F),m.emit("pusher:subscription_error",F)):(F=F,m.pusher.send_event("pusher:subscribe",{auth:F.auth,channel_data:F.channel_data,channel:m.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})(dt),ov=J_,G_=(function(){var s=function(f,m){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,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),q_=(function(s){G_(f,s);function f(){return s!==null&&s.apply(this,arguments)||this}return f.prototype.authorize=function(m,T){var F=wo.createAuthorizer(this,this.pusher.config);return F.authorize(m,T)},f})(ov),qf=q_,uv=(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 m=this;fn(this.members,function(T,F){f(m.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 m=this.get(f.user_id);return m&&(delete this.members[f.user_id],this.count--),m},s.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},s})(),j_=uv,z_=(function(){var s=function(f,m){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,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),iv=(function(s){z_(f,s);function f(m,T){var F=s.call(this,m,T)||this;return F.members=new j_,F}return f.prototype.authorize=function(m,T){var F=this;s.prototype.authorize.call(this,m,function(J,le){if(!J){if(le=le,le.channel_data===void 0){var Ie=Jt.buildLogSuffix("authenticationEndpoint");at.error("Invalid auth response for channel '"+F.name+"',"+("expected 'channel_data' field. "+Ie)),T("Invalid auth response");return}var mt=JSON.parse(le.channel_data);F.members.setMyID(mt.user_id)}T(J,le)})},f.prototype.handleEvent=function(m){var T=m.event;if(T.indexOf("pusher_internal:")===0)this.handleInternalEvent(m);else{var F=m.data,J={};m.user_id&&(J.user_id=m.user_id),this.emit(T,F,J)}},f.prototype.handleInternalEvent=function(m){var T=m.event,F=m.data;switch(T){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(m);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 le=this.members.removeMember(F);le&&this.emit("pusher:member_removed",le);break}},f.prototype.handleSubscriptionSucceededEvent=function(m){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(m.data),this.emit("pusher:subscription_succeeded",this.members))},f.prototype.disconnect=function(){this.members.reset(),s.prototype.disconnect.call(this)},f})(qf),V_=iv,lv=r(1),jf=r(0),K_=(function(){var s=function(f,m){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,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),Y_=(function(s){K_(f,s);function f(m,T,F){var J=s.call(this,m,T)||this;return J.key=null,J.nacl=F,J}return f.prototype.authorize=function(m,T){var F=this;s.prototype.authorize.call(this,m,function(J,le){if(J){T(!0,le);return}var Ie=le.shared_secret;if(!Ie){var mt="No shared_secret key in auth payload for encrypted channel: "+F.name;T(!0,mt);return}F.key=Object(jf.decode)(Ie),delete le.shared_secret,T(!1,le)})},f.prototype.trigger=function(m,T){throw new yc("Client events are not currently supported for encrypted channels")},f.prototype.handleEvent=function(m){var T=m.event,F=m.data;if(T.indexOf("pusher_internal:")===0||T.indexOf("pusher:")===0){s.prototype.handleEvent.call(this,m);return}this.handleEncryptedEvent(T,F)},f.prototype.handleEncryptedEvent=function(m,T){var F=this;if(!this.key){at.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!T.ciphertext||!T.nonce){at.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+T);return}var J=Object(jf.decode)(T.ciphertext);if(J.length0&&this.emit("connecting_in",Math.round(m/1e3)),this.retryTimer=new ct(m||0,function(){T.disconnectInternally(),T.connect()})},f.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},f.prototype.setUnavailableTimer=function(){var m=this;this.unavailableTimer=new ct(this.options.unavailableTimeout,function(){m.updateState("unavailable")})},f.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},f.prototype.sendActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new ct(this.options.pongTimeout,function(){m.timeline.error({pong_timed_out:m.options.pongTimeout}),m.retryIn(0)})},f.prototype.resetActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new ct(this.activityTimeout,function(){m.sendActivityCheck()}))},f.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},f.prototype.buildConnectionCallbacks=function(m){var T=this;return Wt({},m,{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(m){var T=this;return Wt({},m,{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 m=this,T=function(F){return function(J){J.error&&m.emit("error",{type:"WebSocketError",error:J.error}),F(J)}};return{tls_only:T(function(){m.usingTLS=!0,m.updateStrategy(),m.retryIn(0)}),refused:T(function(){m.disconnect()}),backoff:T(function(){m.retryIn(1e3)}),retry:T(function(){m.retryIn(0)})}},f.prototype.setConnection=function(m){this.connection=m;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 m in this.connectionCallbacks)this.connection.unbind(m,this.connectionCallbacks[m]);var T=this.connection;return this.connection=null,T}},f.prototype.updateState=function(m,T){var F=this.state;if(this.state=m,F!==m){var J=m;J==="connected"&&(J+=" with new socket ID "+T.socket_id),at.debug("State changed",F+" -> "+J),this.timeline.info({state:m,params:T}),this.emit("state_change",{previous:F,current:m}),this.emit(m,T)}},f.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},f})(dt),cv=Z_,eh=(function(){function s(){this.channels={}}return s.prototype.add=function(f,m){return this.channels[f]||(this.channels[f]=fv(f,m)),this.channels[f]},s.prototype.all=function(){return Rn(this.channels)},s.prototype.find=function(f){return this.channels[f]},s.prototype.remove=function(f){var m=this.channels[f];return delete this.channels[f],m},s.prototype.disconnect=function(){fn(this.channels,function(f){f.disconnect()})},s})(),th=eh;function fv(s,f){if(s.indexOf("private-encrypted-")===0){if(f.config.nacl)return wo.createEncryptedChannel(s,f,f.config.nacl);var m="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",T=Jt.buildLogSuffix("encryptedChannelSupport");throw new yc(m+". "+T)}else return s.indexOf("private-")===0?wo.createPrivateChannel(s,f):s.indexOf("presence-")===0?wo.createPresenceChannel(s,f):wo.createChannel(s,f)}var nh={createChannels:function(){return new th},createConnectionManager:function(s,f){return new cv(s,f)},createChannel:function(s,f){return new ov(s,f)},createPrivateChannel:function(s,f){return new qf(s,f)},createPresenceChannel:function(s,f){return new V_(s,f)},createEncryptedChannel:function(s,f,m){return new Q_(s,f,m)},createTimelineSender:function(s,f){return new gc(s,f)},createAuthorizer:function(s,f){return f.authorizer?f.authorizer(s,f):new Dl(s,f)},createHandshake:function(s,f){return new To(s,f)},createAssistantToTheTransportManager:function(s,f,m){return new Mu(s,f,m)}},wo=nh,rh=(function(){function s(f){this.options=f||{},this.livesLeft=this.options.lives||1/0}return s.prototype.getAssistant=function(f){return wo.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})(),sv=rh,ah=(function(){function s(f,m){this.strategies=f,this.loop=!!m.loop,this.failFast=!!m.failFast,this.timeout=m.timeout,this.timeoutLimit=m.timeoutLimit}return s.prototype.isSupported=function(){return je(this.strategies,wt.method("isSupported"))},s.prototype.connect=function(f,m){var T=this,F=this.strategies,J=0,le=this.timeout,Ie=null,mt=function(Dn,Un){Un?m(null,Un):(J=J+1,T.loop&&(J=J%F.length),J0&&(J=new ct(T.timeout,function(){le.abort(),F(!0)})),le=f.connect(m,function(Ie,mt){Ie&&J&&J.isRunning()&&!T.failFast||(J&&J.ensureAborted(),F(Ie,mt))}),{abort:function(){J&&J.ensureAborted(),le.abort()},forceMinPriority:function(Ie){le.forceMinPriority(Ie)}}},s})(),ni=ah,oh=(function(){function s(f){this.strategies=f}return s.prototype.isSupported=function(){return je(this.strategies,wt.method("isSupported"))},s.prototype.connect=function(f,m){return uh(this.strategies,f,function(T,F){return function(J,le){if(F[T].error=J,J){dv(F)&&m(!0);return}rn(F,function(Ie){Ie.forceMinPriority(le.transport.priority)}),m(null,le)}})},s})(),zf=oh;function uh(s,f,m){var T=It(s,function(F,J,le,Ie){return F.connect(f,m(J,Ie))});return{abort:function(){rn(T,Vf)},forceMinPriority:function(F){rn(T,function(J){J.forceMinPriority(F)})}}}function dv(s){return We(s,function(f){return!!f.error})}function Vf(s){!s.error&&!s.aborted&&(s.abort(),s.aborted=!0)}var ih=(function(){function s(f,m,T){this.strategy=f,this.transports=m,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,m){var T=this.usingTLS,F=vv(T),J=[this.strategy];if(F&&F.timestamp+this.ttl>=wt.now()){var le=this.transports[F.transport];le&&(this.timeline.info({cached:!0,transport:F.transport,latency:F.latency}),J.push(new ni([le],{timeout:F.latency*2+1e3,failFast:!0})))}var Ie=wt.now(),mt=J.pop().connect(f,function Dn(Un,Vr){Un?(pv(T),J.length>0?(Ie=wt.now(),mt=J.pop().connect(f,Dn)):m(Un)):(ch(T,Vr.transport.name,wt.now()-Ie),m(null,Vr))});return{abort:function(){mt.abort()},forceMinPriority:function(Dn){f=Dn,mt&&mt.forceMinPriority(Dn)}}},s})(),lh=ih;function Kf(s){return"pusherTransport"+(s?"TLS":"NonTLS")}function vv(s){var f=jt.getLocalStorage();if(f)try{var m=f[Kf(s)];if(m)return JSON.parse(m)}catch{pv(s)}return null}function ch(s,f,m){var T=jt.getLocalStorage();if(T)try{T[Kf(s)]=zt({timestamp:wt.now(),transport:f,latency:m})}catch{}}function pv(s){var f=jt.getLocalStorage();if(f)try{delete f[Kf(s)]}catch{}}var fh=(function(){function s(f,m){var T=m.delay;this.strategy=f,this.options={delay:T}}return s.prototype.isSupported=function(){return this.strategy.isSupported()},s.prototype.connect=function(f,m){var T=this.strategy,F,J=new ct(this.options.delay,function(){F=T.connect(f,m)});return{abort:function(){J.ensureAborted(),F&&F.abort()},forceMinPriority:function(le){f=le,F&&F.forceMinPriority(le)}}},s})(),Rc=fh,mv=(function(){function s(f,m,T){this.test=f,this.trueBranch=m,this.falseBranch=T}return s.prototype.isSupported=function(){var f=this.test()?this.trueBranch:this.falseBranch;return f.isSupported()},s.prototype.connect=function(f,m){var T=this.test()?this.trueBranch:this.falseBranch;return T.connect(f,m)},s})(),yl=mv,sh=(function(){function s(f){this.strategy=f}return s.prototype.isSupported=function(){return this.strategy.isSupported()},s.prototype.connect=function(f,m){var T=this.strategy.connect(f,function(F,J){J&&T.abort(),m(F,J)});return T},s})(),dh=sh;function iu(s){return function(){return s.isSupported()}}var _v=function(s,f,m){var T={};function F(mr,Nv,Pv,Hh,Ov){var g=m(s,mr,Nv,Pv,Hh,Ov);return T[mr]=g,g}var J=Object.assign({},f,{hostNonTLS:s.wsHost+":"+s.wsPort,hostTLS:s.wsHost+":"+s.wssPort,httpPath:s.wsPath}),le=Object.assign({},J,{useTLS:!0}),Ie=Object.assign({},f,{hostNonTLS:s.httpHost+":"+s.httpPort,hostTLS:s.httpHost+":"+s.httpsPort,httpPath:s.httpPath}),mt={loop:!0,timeout:15e3,timeoutLimit:6e4},Dn=new sv({lives:2,minPingDelay:1e4,maxPingDelay:s.activityTimeout}),Un=new sv({lives:2,minPingDelay:1e4,maxPingDelay:s.activityTimeout}),Vr=F("ws","ws",3,J,Dn),Va=F("wss","ws",3,le,Dn),Uh=F("sockjs","sockjs",1,Ie),Cv=F("xhr_streaming","xhr_streaming",1,Ie,Un),Sv=F("xdr_streaming","xdr_streaming",1,Ie,Un),Mv=F("xhr_polling","xhr_polling",1,Ie),kh=F("xdr_polling","xdr_polling",1,Ie),Iv=new ni([Vr],mt),$h=new ni([Va],mt),Wh=new ni([Uh],mt),Av=new ni([new yl(iu(Cv),Cv,Sv)],mt),Lv=new ni([new yl(iu(Mv),Mv,kh)],mt),xv=new ni([new yl(iu(Av),new zf([Av,new Rc(Lv,{delay:4e3})]),Lv)],mt),ts=new yl(iu(xv),xv,Wh),ns;return f.useTLS?ns=new zf([Iv,new Rc(ts,{delay:2e3})]):ns=new zf([Iv,new Rc($h,{delay:2e3}),new Rc(ts,{delay:5e3})]),new lh(new dh(new yl(iu(Vr),ns,ts)),T,{ttl:18e5,timeline:f.timeline,useTLS:f.useTLS})},vh=_v,ph=(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,m){s.hooks.isInitialized()?(s.changeState("initialized"),m(!0)):(f&&s.onError(f),s.onClose(),m(!1))})):s.onClose()}),hv={getRequest:function(s){var f=new window.XDomainRequest;return f.ontimeout=function(){s.emit("error",new ti),s.close()},f.onerror=function(m){s.emit("error",m),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()}},mh=hv,gv=(function(){var s=function(f,m){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,m)};return function(f,m){s(f,m);function T(){this.constructor=f}f.prototype=m===null?Object.create(m):(T.prototype=m.prototype,new T)}})(),_h=256*1024,Dv=(function(s){gv(f,s);function f(m,T,F){var J=s.call(this)||this;return J.hooks=m,J.method=T,J.url=F,J}return f.prototype.start=function(m){var T=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){T.close()},jt.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(m)},f.prototype.close=function(){this.unloader&&(jt.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},f.prototype.onChunk=function(m,T){for(;;){var F=this.advanceBuffer(T);if(F)this.emit("chunk",{status:m,data:F});else break}this.isBufferTooLong(T)&&this.emit("buffer_too_long")},f.prototype.advanceBuffer=function(m){var T=m.slice(this.position),F=T.indexOf(` `);return F!==-1?(this.position+=F+1,T.slice(0,F)):null},f.prototype.isBufferTooLong=function(m){return this.position===m.length&&m.length>_h},f})(dt),yv=Dv,Rl;(function(s){s[s.CONNECTING=0]="CONNECTING",s[s.OPEN=1]="OPEN",s[s.CLOSED=3]="CLOSED"})(Rl||(Rl={}));var Fo=Rl,hh=1,Rv=(function(){function s(f,m){this.hooks=f,this.session=Pa(1e3)+"/"+lu(8),this.location=gh(m),this.readyState=Fo.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,m){this.onClose(f,m,!0)},s.prototype.sendRaw=function(f){if(this.readyState===Fo.OPEN)try{return jt.createSocketRequest("POST",Yf(Dh(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,m,T){this.closeStream(),this.readyState=Fo.CLOSED,this.onclose&&this.onclose({code:f,reason:m,wasClean:T})},s.prototype.onChunk=function(f){if(f.status===200){this.readyState===Fo.OPEN&&this.onActivity();var m,T=f.data.slice(0,1);switch(T){case"o":m=JSON.parse(f.data.slice(1)||"{}"),this.onOpen(m);break;case"a":m=JSON.parse(f.data.slice(1)||"[]");for(var F=0;F0&&s.onChunk(m.status,m.responseText);break;case 4:m.responseText&&m.responseText.length>0&&s.onChunk(m.status,m.responseText),s.emit("finished",m.status),s.close();break}},m},abortRequest:function(s){s.onreadystatechange=null,s.abort()}},qt=Tv,ri={createStreamingSocket:function(s){return this.createSocket(bh,s)},createPollingSocket:function(s){return this.createSocket(Eh,s)},createSocket:function(s,f){return new yh(s,f)},createXHR:function(s,f){return this.createRequest(qt,s,f)},createRequest:function(s,f,m){return new yv(s,f,m)}},Qf=ri;Qf.createXDR=function(s,f){return this.createRequest(mh,s,f)};var wh=Qf,Fh={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:c,DependenciesReceivers:O,getDefaultStrategy:vh,Transports:zr,transportConnectionInitializer:ph,HTTPFactory:wh,TimelineTransport:K,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(s){var f=this;window.Pusher=s;var m=function(){f.onDocumentBody(s.ready)};window.JSON?m():y.load("json2",{},m)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:U,jsonp:x}},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 za},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:",m=this.getProtocol();return!!window.XDomainRequest&&m===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)}},jt=Fh,bc;(function(s){s[s.ERROR=3]="ERROR",s[s.INFO=6]="INFO",s[s.DEBUG=7]="DEBUG"})(bc||(bc={}));var Tc=bc,Ch=(function(){function s(f,m,T){this.key=f,this.session=m,this.events=[],this.options=T||{},this.sent=0,this.uniqueID=0}return s.prototype.log=function(f,m){f<=this.options.level&&(this.events.push(Wt({},m,{timestamp:wt.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},s.prototype.error=function(f){this.log(Tc.ERROR,f)},s.prototype.info=function(f){this.log(Tc.INFO,f)},s.prototype.debug=function(f){this.log(Tc.DEBUG,f)},s.prototype.isEmpty=function(){return this.events.length===0},s.prototype.send=function(f,m){var T=this,F=Wt({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,le){J||T.sent++,m&&m(J,le)}),!0},s.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},s})(),Ev=Ch,Xf=(function(){function s(f,m,T,F){this.name=f,this.priority=m,this.transport=T,this.options=F||{}}return s.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},s.prototype.connect=function(f,m){var T=this;if(this.isSupported()){if(this.priority{typeof window<"u"&&(function(n,r){typeof Qd=="object"&&typeof dD=="object"?dD.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Qd=="object"?Qd.Hls=r():n.Hls=r()})(Qd,function(){return(function(e){var n={};function r(u){if(n[u])return n[u].exports;var c=n[u]={i:u,l:!1,exports:{}};return e[u].call(c.exports,c,c.exports,r),c.l=!0,c.exports}return r.m=e,r.c=n,r.d=function(u,c,p){r.o(u,c)||Object.defineProperty(u,c,{enumerable:!0,get:p})},r.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},r.t=function(u,c){if(c&1&&(u=r(u)),c&8||c&4&&typeof u=="object"&&u&&u.__esModule)return u;var p=Object.create(null);if(r.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:u}),c&2&&typeof u!="string")for(var E in u)r.d(p,E,function(d){return u[d]}.bind(null,E));return p},r.n=function(u){var c=u&&u.__esModule?function(){return u.default}:function(){return u};return r.d(c,"a",c),c},r.o=function(u,c){return Object.prototype.hasOwnProperty.call(u,c)},r.p="/dist/",r(r.s="./src/hls.ts")})({"./node_modules/eventemitter3/index.js":(function(e,n,r){"use strict";var u=Object.prototype.hasOwnProperty,c="~";function p(){}Object.create&&(p.prototype=Object.create(null),new p().__proto__||(c=!1));function E(y,w,L){this.fn=y,this.context=w,this.once=L||!1}function d(y,w,L,C,M){if(typeof L!="function")throw new TypeError("The listener must be a function");var k=new E(L,C||y,M),B=c?c+w:w;return y._events[B]?y._events[B].fn?y._events[B]=[y._events[B],k]:y._events[B].push(k):(y._events[B]=k,y._eventsCount++),y}function h(y,w){--y._eventsCount===0?y._events=new p:delete y._events[w]}function O(){this._events=new p,this._eventsCount=0}O.prototype.eventNames=function(){var w=[],L,C;if(this._eventsCount===0)return w;for(C in L=this._events)u.call(L,C)&&w.push(c?C.slice(1):C);return Object.getOwnPropertySymbols?w.concat(Object.getOwnPropertySymbols(L)):w},O.prototype.listeners=function(w){var L=c?c+w:w,C=this._events[L];if(!C)return[];if(C.fn)return[C.fn];for(var M=0,k=C.length,B=new Array(k);M0},!1)}function y(w,L){for(var C={main:[L]},M={main:[]},k={main:{}};O(C);)for(var B=Object.keys(C),Q=0;Q>>8^Rn&255^99,ee[Fn]=Rn,ae[Rn]=Fn;var rn=un[Fn],It=un[rn],Rr=un[It],he=un[Rn]*257^Rn*16843008;me[Fn]=he<<24|he>>>8,_e[Fn]=he<<16|he>>>16,nt[Fn]=he<<8|he>>>24,ot[Fn]=he,he=Rr*16843009^It*65537^rn*257^Fn*16843008,Mn[Rn]=he<<24|he>>>8,Ln[Rn]=he<<16|he>>>16,wt[Rn]=he<<8|he>>>24,Wt[Rn]=he,Fn?(Fn=rn^un[un[un[Rr^rn]]],fn^=un[un[fn]]):Fn=fn=1}},Q.expandKey=function(ee){for(var ae=this.uint8ArrayToUint32Array_(ee),ne=!0,me=0;me>>6)+1,A=(q[x+2]&60)>>>2,A>ce.length-1){U.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[x+2]&1)<<2,W|=(q[x+3]&192)>>>6,d.logger.log("manifest codec:"+D+",ADTS data:type:"+S+",sampleingIndex:"+A+"["+ce[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:ce[A],channelCount:W,codec:"mp4a.40."+S,manifestCodec:oe}}function y(U,q){return U[q]===255&&(U[q+1]&246)===240}function w(U,q){return U[q+1]&1?7:9}function L(U,q){return(U[q+3]&3)<<11|U[q+4]<<3|(U[q+5]&224)>>>5}function C(U,q){return!!(q+10&&q+A+$<=X)return W=x+D*S,{headerLength:A,frameLength:$,stamp:W}}function z(U,q,x,D,S){var A=B(U.samplerate),$=Q(q,x,D,S,A);if($){var W=$.stamp,X=$.headerLength,K=$.frameLength,oe={unit:q.subarray(x+X,x+X+K),pts:W,dts:W};return U.samples.push(oe),{sample:oe,length:K+X}}}var ee=r("./src/demux/id3.js"),ae=(function(){function U(x,D,S){this.observer=x,this.config=S,this.remuxer=D}var q=U.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(){},U.probe=function(D){if(!D)return!1;for(var S=ee.default.getID3Data(D,0)||[],A=S.length,$=D.length;A<$;A++)if(M(D,A))return d.logger.log("ADTS sync word found !"),!0;return!1},q.append=function(D,S,A,$){for(var W=this._audioTrack,X=ee.default.getID3Data(D,0)||[],K=ee.default.getTimeStamp(X),oe=Object(E.isFiniteNumber)(K)?K*90:S*9e4,ce=0,fe=oe,se=D.length,Re=X.length,Le=[{pts:fe,dts:fe,data:X}];Rex.length)){var $=this.parseHeader(x,D);if($&&D+$.frameLength<=x.length){var W=$.samplesPerFrame*9e4/$.sampleRate,X=S+A*W,K={unit:x.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,x){var D=q[x+1]>>3&3,S=q[x+1]>>1&3,A=q[x+2]>>4&15,$=q[x+2]>>2&3,W=q[x+2]>>1&1;if(D!==1&&A!==0&&A!==15&&$!==3){var X=D===3?3-S:S===3?3:4,K=_e.BitratesMap[X*14+A-1]*1e3,oe=D===3?0:D===2?1:2,ce=_e.SamplingRateMap[oe*3+$],fe=q[x+3]>>6===3?1:2,se=_e.SamplesCoefficients[D][S],Re=_e.BytesInSlot[S],Le=se*8*Re,ve=parseInt(se*K/ce+W,10)*Re;return{sampleRate:ce,channelCount:fe,frameLength:ve,samplesPerFrame:Le}}},isHeaderPattern:function(q,x){return q[x]===255&&(q[x+1]&224)===224&&(q[x+1]&6)!==0},isHeader:function(q,x){return!!(x+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&&d.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),oe=this.getAvcEncryptedData(K),ce=this;this.decryptBuffer(oe.buffer,function(fe){W.data=ce.getAvcDecryptedUnit(K,fe),X||ce.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}}}},U})(),Ln=Mn,wt={video:1,audio:2,id3:3,text:4},Wt=(function(){function U(x,D,S,A){this.observer=x,this.config=S,this.typeSupported=A,this.remuxer=D,this.sampleAes=null}var q=U.prototype;return q.setDecryptData=function(D){D!=null&&D.key!=null&&D.method==="SAMPLE-AES"?this.sampleAes=new Ln(this.observer,this.config,D,this.discardEPB):this.sampleAes=null},U.probe=function(D){var S=U._syncOffset(D);return S<0?!1:(S&&d.logger.warn("MPEG2-TS detected but first sync word found @ offset "+S+", junk ahead ?"),!0)},U._syncOffset=function(D){for(var S=Math.min(1e3,D.length-564),A=0;A>4,ce>1){if(fe=W+5+D[W+4],fe===W+188)continue}else fe=W+4;switch(oe){case dt:K&&(sn&&(se=zn(sn))&&vr(se,!1),sn={data:[],size:0}),sn&&(sn.data.push(D.subarray(fe,W+188)),sn.size+=W+188-fe);break;case Zt:K&&(Ot&&(se=zn(Ot))&&(Ue.isAAC?Or(se):or(se)),Ot={data:[],size:0}),Ot&&(Ot.data.push(D.subarray(fe,W+188)),Ot.size+=W+188-fe);break;case Cn:K&&(An&&(se=zn(An))&&oa(se),An={data:[],size:0}),An&&(An.data.push(D.subarray(fe,W+188)),An.size+=W+188-fe);break;case 0:K&&(fe+=D[fe]+1),Tt=this._pmtId=Gt(D,fe);break;case Tt:K&&(fe+=D[fe]+1);var Bn=bn(D,fe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,this.sampleAes!=null);dt=Bn.avc,dt>0&&(ve.pid=dt),Zt=Bn.audio,Zt>0&&(Ue.pid=Zt,Ue.isAAC=Bn.isAAC),Cn=Bn.id3,Cn>0&&(Ve.pid=Cn),Re&&!Le&&(d.logger.log("reparse from beginning"),Re=!1,W=pr-188),Le=this.pmtParsed=!0;break;case 17:case 8191:break;default:Re=!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"});sn&&(se=zn(sn))?(vr(se,!0),ve.pesData=null):ve.pesData=sn,Ot&&(se=zn(Ot))?(Ue.isAAC?Or(se):or(se),Ue.pesData=null):(Ot&&Ot.size&&d.logger.log("last AAC PES packet truncated,might overlap between fragments"),Ue.pesData=Ot),An&&(se=zn(An))?(oa(se),Ve.pesData=null):Ve.pesData=An,this.sampleAes==null?this.remuxer.remux(Ue,ve,Ve,this._txtTrack,S,A,$):this.decryptAndRemux(Ue,ve,Ve,this._txtTrack,S,A,$)},q.decryptAndRemux=function(D,S,A,$,W,X,K){if(D.samples&&D.isAAC){var oe=this;this.sampleAes.decryptAacSamples(D.samples,0,function(){oe.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 oe=this;this.sampleAes.decryptAvcSamples(S.samples,0,0,function(){oe.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,oe,ce={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 Le=new Uint8Array(Re[0].length+Re[1].length);Le.set(Re[0]),Le.set(Re[1],Re[0].length),Re[0]=Le,Re.splice(1,1)}if(A=Re[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&&(ce=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,ce>4294967295&&(ce-=8589934592),$&64?(fe=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,fe>4294967295&&(fe-=8589934592),ce-fe>60*9e4&&(d.logger.warn(Math.round((ce-fe)/9e4)+"s delta between PTS and DTS, align them"),ce=fe)):fe=ce),K=A[8],se=K+9,D.size<=se))return null;D.size-=se,oe=new Uint8Array(D.size);for(var ve=0,Ue=Re.length;veVe){se-=Ve;continue}else A=A.subarray(se),Ve-=se,se=0;oe.set(A,S),S+=Ve}return X&&(X-=K+3),{data:oe,pts:ce,dts:fe,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&&d.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,oe=this.avcSample,ce,fe=!1,se,Re=this.pushAccesUnit.bind(this),Le=function(Ue,Ve,dt,Zt){return{key:Ue,pts:Ve,dts:dt,units:[],debug:Zt}};D.data=null,oe&&W.length&&!$.audFound&&(Re(oe,$),oe=this.avcSample=Le(!1,D.pts,D.dts,"")),W.forEach(function(ve){switch(ve.type){case 1:ce=!0,oe||(oe=A.avcSample=Le(!0,D.pts,D.dts,"")),X&&(oe.debug+="NDR "),oe.frame=!0;var Ue=ve.data;if(fe&&Ue.length>4){var Ve=new ct(Ue).readSliceType();(Ve===2||Ve===4||Ve===7||Ve===9)&&(oe.key=!0)}break;case 5:ce=!0,oe||(oe=A.avcSample=Le(!0,D.pts,D.dts,"")),X&&(oe.debug+="IDR "),oe.key=!0,oe.frame=!0;break;case 6:ce=!0,X&&oe&&(oe.debug+="SEI "),K=new ct(A.discardEPB(ve.data)),K.readUByte();for(var dt=0,Zt=0,Cn=!1,Tt=0;!Cn&&K.bytesAvailable>1;){dt=0;do Tt=K.readUByte(),dt+=Tt;while(Tt===255);Zt=0;do Tt=K.readUByte(),Zt+=Tt;while(Tt===255);if(dt===4&&K.bytesAvailable!==0){Cn=!0;var sn=K.readUByte();if(sn===181){var Ot=K.readUShort();if(Ot===49){var An=K.readUInt();if(An===1195456820){var Gt=K.readUByte();if(Gt===3){var bn=K.readUByte(),zn=K.readUByte(),vr=31&bn,Or=[bn,zn];for(se=0;se16){var or=[];for(se=0;se<16;se++)or.push(K.readUByte().toString(16)),(se===3||se===5||se===7||se===9)&&or.push("-");var oa=Zt-16,pr=new Uint8Array(oa);for(se=0;se0){if(S.pts>=D[A-1].pts)D.push(S);else for(var $=A-1;$>=0;$--)if(S.pts=0)fe={data:D.subarray(Re,S-K-1),type:Le},ce.push(fe);else{var ve=this._getLastNalUnit();if(ve&&(oe&&S<=4-oe&&ve.state&&(ve.data=ve.data.subarray(0,ve.data.byteLength-oe)),W=S-K-1,W>0)){var Ue=new Uint8Array(ve.data.byteLength+W);Ue.set(ve.data,0),Ue.set(D.subarray(0,W),ve.data.byteLength),ve.data=Ue}}S=0&&K>=0&&(fe={data:D.subarray(Re,A),type:Le,state:K},ce.push(fe)),ce.length===0){var Ve=this._getLastNalUnit();if(Ve){var dt=new Uint8Array(Ve.data.byteLength+D.byteLength);dt.set(Ve.data,0),dt.set(D,Ve.data.byteLength),Ve.data=dt}}return X.naluState=K,ce},q.discardEPB=function(D){for(var S=D.byteLength,A=[],$=1,W,X;$1&&(d.logger.log("AAC: align PTS for overlapping frames by "+Math.round((Ve-$)/90)),$=Ve)}for(;fe>24&255,W[1]=S>>16&255,W[2]=S>>8&255,W[3]=S&255,W.set(x,4),A=0,S=8;A<$;A++)W.set(D[A],S),S+=D[A].byteLength;return W},U.hdlr=function(x){return U.box(U.types.hdlr,U.HDLR_TYPES[x])},U.mdat=function(x){return U.box(U.types.mdat,x)},U.mdhd=function(x,D){D*=x;var S=Math.floor(D/(rn+1)),A=Math.floor(D%(rn+1));return U.box(U.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,x>>24&255,x>>16&255,x>>8&255,x&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]))},U.mdia=function(x){return U.box(U.types.mdia,U.mdhd(x.timescale,x.duration),U.hdlr(x.type),U.minf(x))},U.mfhd=function(x){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,x>>24,x>>16&255,x>>8&255,x&255]))},U.minf=function(x){return x.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(x)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(x))},U.moof=function(x,D,S){return U.box(U.types.moof,U.mfhd(x),U.traf(S,D))},U.moov=function(x){for(var D=x.length,S=[];D--;)S[D]=U.trak(x[D]);return U.box.apply(null,[U.types.moov,U.mvhd(x[0].timescale,x[0].duration)].concat(S).concat(U.mvex(x)))},U.mvex=function(x){for(var D=x.length,S=[];D--;)S[D]=U.trex(x[D]);return U.box.apply(null,[U.types.mvex].concat(S))},U.mvhd=function(x,D){D*=x;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,x>>24&255,x>>16&255,x>>8&255,x&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 U.box(U.types.mvhd,$)},U.sdtp=function(x){var D=x.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=U.box(U.types.avcC,new Uint8Array([1,D[3],D[4],D[5],255,224|x.sps.length].concat(D).concat([x.pps.length]).concat(S))),K=x.width,oe=x.height,ce=x.pixelRatio[0],fe=x.pixelRatio[1];return U.box(U.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,K>>8&255,K&255,oe>>8&255,oe&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,U.box(U.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),U.box(U.types.pasp,new Uint8Array([ce>>24,ce>>16&255,ce>>8&255,ce&255,fe>>24,fe>>16&255,fe>>8&255,fe&255])))},U.esds=function(x){var D=x.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(x.config).concat([6,1,2]))},U.mp4a=function(x){var D=x.samplerate;return U.box(U.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,x.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]),U.box(U.types.esds,U.esds(x)))},U.mp3=function(x){var D=x.samplerate;return U.box(U.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,x.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]))},U.stsd=function(x){return x.type==="audio"?!x.isAAC&&x.codec==="mp3"?U.box(U.types.stsd,U.STSD,U.mp3(x)):U.box(U.types.stsd,U.STSD,U.mp4a(x)):U.box(U.types.stsd,U.STSD,U.avc1(x))},U.tkhd=function(x){var D=x.id,S=x.duration*x.timescale,A=x.width,$=x.height,W=Math.floor(S/(rn+1)),X=Math.floor(S%(rn+1));return U.box(U.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,D>>24&255,D>>16&255,D>>8&255,D&255,0,0,0,0,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]))},U.traf=function(x,D){var S=U.sdtp(x),A=x.id,$=Math.floor(D/(rn+1)),W=Math.floor(D%(rn+1));return U.box(U.types.traf,U.box(U.types.tfhd,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255])),U.box(U.types.tfdt,new Uint8Array([1,0,0,0,$>>24,$>>16&255,$>>8&255,$&255,W>>24,W>>16&255,W>>8&255,W&255])),U.trun(x,S.length+16+20+8+16+8+8),S)},U.trak=function(x){return x.duration=x.duration||4294967295,U.box(U.types.trak,U.tkhd(x),U.mdia(x))},U.trex=function(x){var D=x.id;return U.box(U.types.trex,new Uint8Array([0,0,0,0,D>>24,D>>16&255,D>>8&255,D&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},U.trun=function(x,D){var S=x.samples||[],A=S.length,$=12+16*A,W=new Uint8Array($),X,K,oe,ce,fe,se;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,oe>>>16&255,oe>>>8&255,oe&255,ce>>>24&255,ce>>>16&255,ce>>>8&255,ce&255,fe.isLeading<<2|fe.dependsOn,fe.isDependedOn<<6|fe.hasRedundancy<<4|fe.paddingValue<<1|fe.isNonSync,fe.degradPrio&61440,fe.degradPrio&15,se>>>24&255,se>>>16&255,se>>>8&255,se&255],12+16*X);return U.box(U.types.trun,W)},U.initSegment=function(x){U.types||U.init();var D=U.moov(x),S;return S=new Uint8Array(U.FTYP.byteLength+D.byteLength),S.set(U.FTYP),S.set(D,U.FTYP.byteLength),S},U})(),Rr=It,he=9e4;function At(U,q,x,D){return x===void 0&&(x=1),D===void 0&&(D=!1),an(U,q,1/x)}function an(U,q,x,D){x===void 0&&(x=1),D===void 0&&(D=!1);var S=U*q*x;return D?Math.round(S):S}function je(U,q){return q===void 0&&(q=!1),an(U,1e3,1/he,q)}function We(U,q){return q===void 0&&(q=1),an(U,he,1/q)}var ge=We(10),bt=We(.2),ht=(function(){function U(x,D,S,A){this.observer=x,this.config=D,this.typeSupported=S;var $=navigator.userAgent;this.isSafari=A&&A.indexOf("Apple")>-1&&$&&!$.match("CriOS"),this.ISGenerated=!1}var q=U.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 oe=D.samples.length,ce=S.samples.length,fe=W,se=W;if(oe&&ce){var Re=(D.samples[0].pts-S.samples[0].pts)/S.inputTimeScale;fe+=Math.max(0,Re),se+=Math.max(0,-Re)}if(oe){D.timescale||(d.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(D,S,W));var Le=this.remuxAudio(D,fe,X,K);if(ce){var ve;Le&&(ve=Le.endPTS-Le.startPTS),S.timescale||(d.logger.warn("regenerate InitSegment as video detected"),this.generateIS(D,S,W)),this.remuxVideo(S,se,X,ve,K)}}else if(ce){var Ue=this.remuxVideo(S,se,X,0,K);Ue&&D.codec&&this.remuxEmptyAudio(D,fe,X,Ue)}}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,oe="audio/mp4",ce={},fe={tracks:ce},se=this._initPTS===void 0,Re,Le;if(se&&(Re=Le=1/0),D.config&&W.length&&(D.timescale=D.samplerate,d.logger.log("audio sampling rate : "+D.samplerate),D.isAAC||(K.mpeg?(oe="audio/mpeg",D.codec=""):K.mp3&&(D.codec="mp3")),ce.audio={container:oe,codec:D.codec,initSegment:!D.isAAC&&K.mpeg?new Uint8Array:Rr.initSegment([D]),metadata:{channelCount:D.channelCount}},se&&(Re=Le=W[0].pts-D.inputTimeScale*A)),S.sps&&S.pps&&X.length){var ve=S.inputTimeScale;S.timescale=ve,ce.video={container:"video/mp4",codec:S.codec,initSegment:Rr.initSegment([S]),metadata:{width:S.width,height:S.height}},se&&(Re=Math.min(Re,X[0].pts-ve*A),Le=Math.min(Le,X[0].dts-ve*A),this.observer.trigger(u.default.INIT_PTS_FOUND,{initPTS:Re}))}Object.keys(ce).length?($.trigger(u.default.FRAG_PARSING_INIT_SEGMENT,fe),this.ISGenerated=!0,se&&(this._initPTS=Re,this._initDTS=Le)):$.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,oe,ce,fe,se,Re,Le,ve=D.timescale,Ue=D.samples,Ve=[],dt=Ue.length,Zt=this._PTSNormalize,Cn=this._initPTS,Tt=this.nextAvcDts,sn=this.isSafari;if(dt!==0){sn&&(A|=Ue.length&&Tt&&(W&&Math.abs(S-Tt/ve)<.1||Math.abs(Ue[0].pts-Tt-Cn)1?d.logger.log("AVC: "+je(bn,!0)+" ms hole between fragments detected,filling it"):bn<-1&&d.logger.log("AVC: "+je(-bn,!0)+" ms overlapping between fragments detected"),se=Tt,Ue[0].dts=se,fe=Math.max(fe-bn,Tt),Ue[0].pts=fe,d.logger.log("Video: PTS/DTS adjusted: "+je(fe,!0)+"/"+je(se,!0)+", delta: "+je(bn,!0)+" ms")),Gt=Ue[Ue.length-1],Le=Math.max(Gt.dts,0),Re=Math.max(Gt.pts,0,Le),sn&&(K=Math.round((Le-se)/(Ue.length-1)));for(var zn=0,vr=0,Or=0;Or0?zr-1:zr].dts;if(ei.stretchShortVideoTrack){var To=ei.maxBufferHole,Jf=Math.floor(To*ve),Dl=($?fe+$*ve:this.nextAudioPts)-Er.pts;Dl>Jf?(K=Dl-uu,K<0&&(K=uu),d.logger.log("It is approximately "+je(Dl,!1)+" ms to the next segment; using duration "+je(K,!1)+" ms for the last video frame.")):K=uu}else K=uu}bo=Math.round(Er.pts-Er.dts)}Ve.push({size:za,duration:K,cts:bo,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:Er.key?2:1,isNonSync:Er.key?0:1}})}this.nextAvcDts=Le+K;var hc=D.dropped;if(D.nbNalu=0,D.dropped=0,Ve.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var gc=Ve[0].flags;gc.dependsOn=2,gc.isNonSync=0}D.samples=Ve,ce=Rr.moof(D.sequenceNumber++,se,D),D.samples=[];var Eo={data1:ce,data2:oe,startPTS:fe/ve,endPTS:(Re+K)/ve,startDTS:se/ve,endDTS:this.nextAvcDts/ve,type:"video",hasAudio:!1,hasVideo:!0,nb:Ve.length,dropped:hc};return this.observer.trigger(u.default.FRAG_PARSING_DATA,Eo),Eo}},q.remuxAudio=function(D,S,A,$){var W=D.inputTimeScale,X=D.timescale,K=W/X,oe=D.isAAC?1024:1152,ce=oe*K,fe=this._PTSNormalize,se=this._initPTS,Re=!D.isAAC&&this.typeSupported.mpeg,Le,ve,Ue,Ve,dt,Zt,Cn=Re?0:8,Tt=D.samples,sn=[],Ot=this.nextAudioPts;if(A|=Tt.length&&Ot&&($&&Math.abs(S-Ot/W)<.1||Math.abs(Tt[0].pts-Ot-se)<20*ce),Tt.forEach(function(To){To.pts=To.dts=fe(To.pts-se,S*W)}),Tt=Tt.filter(function(To){return To.pts>=0}),Tt.length!==0){if(A||($?Ot=S*W:Ot=Tt[0].pts),D.isAAC)for(var An=this.config.maxAudioFramesDrift,Gt=0,bn=Ot;Gt=An*ce&&vr.1*ce,zn.pts=zn.dts=bn,bn+=ce,Gt++}for(var Bn=Tt.length,Tr=0;Bn--;)Tr+=Tt[Bn].unit.byteLength;for(var _a=0,ha=Tt.length;_a0&&za0&&(ve=Rn.getSilentFrame(D.manifestCodec||D.codec,D.channelCount),ve||(ve=Er.subarray()),Tr+=bo*ve.length);else if(za<-12){d.logger.log("drop overlapping AAC sample, expected/parsed/delta: "+je(Ot,!0)+" ms / "+je(Na,!0)+" ms / "+je(-za,!0)+" ms"),Tr-=Er.byteLength;continue}Na=Ot}if(dt=Na,Tr>0){Tr+=Cn;try{Ue=new Uint8Array(Tr)}catch{this.observer.trigger(u.default.ERROR,{type:c.ErrorTypes.MUX_ERROR,details:c.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Tr,reason:"fail allocating audio mdat "+Tr});return}if(!Re){var Mu=new DataView(Ue.buffer);Mu.setUint32(0,Tr),Ue.set(Rr.types.mdat,4)}}else return;for(var Zu=0;Zu=2&&(au=sn[Bn-2].duration,Le.duration=au),Bn){this.nextAudioPts=Ot=Zt+K*au,D.samples=sn,Re?Ve=new Uint8Array:Ve=Rr.moof(D.sequenceNumber++,dt/K,D),D.samples=[];var ou=dt/W,ei=Ot/W,uu={data1:Ve,data2:Ue,startPTS:ou,endPTS:ei,startDTS:ou,endDTS:ei,type:"audio",hasAudio:!0,hasVideo:!1,nb:Bn};return this.observer.trigger(u.default.FRAG_PARSING_DATA,uu),uu}return null}},q.remuxEmptyAudio=function(D,S,A,$){var W=D.inputTimeScale,X=D.samplerate?D.samplerate:W,K=W/X,oe=this.nextAudioPts,ce=(oe!==void 0?oe:$.startDTS*W)+this._initDTS,fe=$.endDTS*W+this._initDTS,se=1024,Re=K*se,Le=Math.ceil((fe-ce)/Re),ve=Rn.getSilentFrame(D.manifestCodec||D.codec,D.channelCount);if(d.logger.warn("remux empty Audio"),!ve){d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");return}for(var Ue=[],Ve=0;Ve4294967296;)D+=A;return D},U})(),zt=ht,In=(function(){function U(x){this.observer=x}var q=U.prototype;return q.destroy=function(){},q.resetTimeStamp=function(){},q.resetInitSegment=function(){},q.remux=function(D,S,A,$,W,X,K,oe){var ce=this.observer,fe="";D&&(fe+="audio"),S&&(fe+="video"),ce.trigger(u.default.FRAG_PARSING_DATA,{data1:oe,startPTS:W,startDTS:W,type:fe,hasAudio:!!D,hasVideo:!!S,nb:1,dropped:0}),ce.trigger(u.default.FRAG_PARSED)},U})(),at=In,Lt=Object(h.getSelfScope)(),br;try{br=Lt.performance.now.bind(Lt.performance)}catch{d.logger.debug("Unable to use Performance API on this environment"),br=Lt.Date.now}var Jt=(function(){function U(x,D,S,A){this.observer=x,this.typeSupported=D,this.config=S,this.vendor=A}var q=U.prototype;return q.destroy=function(){var D=this.demuxer;D&&D.destroy()},q.push=function(D,S,A,$,W,X,K,oe,ce,fe,se,Re){var Le=this;if(D.byteLength>0&&S!=null&&S.key!=null&&S.method==="AES-128"){var ve=this.decrypter;ve==null&&(ve=this.decrypter=new p.default(this.observer,this.config));var Ue=br();ve.decrypt(D,S.key.buffer,S.iv.buffer,function(Ve){var dt=br();Le.observer.trigger(u.default.FRAG_DECRYPTED,{stats:{tstart:Ue,tdecrypt:dt}}),Le.pushDecrypted(new Uint8Array(Ve),S,new Uint8Array(A),$,W,X,K,oe,ce,fe,se,Re)})}else this.pushDecrypted(new Uint8Array(D),S,new Uint8Array(A),$,W,X,K,oe,ce,fe,se,Re)},q.pushDecrypted=function(D,S,A,$,W,X,K,oe,ce,fe,se,Re){var Le=this.demuxer;if(!Le||(K||oe)&&!this.probe(D)){for(var ve=this.observer,Ue=this.typeSupported,Ve=this.config,dt=[{demux:un,remux:zt},{demux:me.default,remux:at},{demux:ne,remux:zt},{demux:fn,remux:zt}],Zt=0,Cn=dt.length;Zt1?k-1:0),Q=1;Q1?k-1:0),Q=1;Q0)return y.subarray(L,L+C)},h._readSize=function(y,w){var L=0;return L=(y[w]&127)<<21,L|=(y[w+1]&127)<<14,L|=(y[w+2]&127)<<7,L|=y[w+3]&127,L},h.getTimeStamp=function(y){for(var w=h.getID3Frames(y),L=0;L>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:ee+=String.fromCharCode(B);break;case 12:case 13:Q=y[ae++],ee+=String.fromCharCode((B&31)<<6|Q&63);break;case 14:Q=y[ae++],z=y[ae++],ee+=String.fromCharCode((B&15)<<12|(Q&63)<<6|(z&63)<<0);break;default:}}return ee},h})(),p;function E(){var h=Object(u.getSelfScope)();return!p&&typeof h.TextDecoder<"u"&&(p=new h.TextDecoder("utf-8")),p}var d=c._utf8ArrayToStr;n.default=c}),"./src/demux/mp4demuxer.js":(function(e,n,r){"use strict";r.r(n);var u=r("./src/utils/logger.js"),c=r("./src/events.js"),p=Math.pow(2,32)-1,E=(function(){function d(O,y){this.observer=O,this.remuxer=y}var h=d.prototype;return h.resetTimeStamp=function(y){this.initPTS=y},h.resetInitSegment=function(y,w,L,C){if(y&&y.byteLength){var M=this.initData=d.parseInitSegment(y);w==null&&(w="mp4a.40.5"),L==null&&(L="avc1.42e01e");var k={};M.audio&&M.video?k.audiovideo={container:"video/mp4",codec:w+","+L,initSegment:C?y:null}:(M.audio&&(k.audio={container:"audio/mp4",codec:w,initSegment:C?y:null}),M.video&&(k.video={container:"video/mp4",codec:L,initSegment:C?y:null})),this.observer.trigger(c.default.FRAG_PARSING_INIT_SEGMENT,{tracks:k})}else w&&(this.audioCodec=w),L&&(this.videoCodec=L)},d.probe=function(y){return d.findBox({data:y,start:0,end:Math.min(y.length,16384)},["moof"]).length>0},d.bin2str=function(y){return String.fromCharCode.apply(null,y)},d.readUint16=function(y,w){y.data&&(w+=y.start,y=y.data);var L=y[w]<<8|y[w+1];return L<0?65536+L:L},d.readUint32=function(y,w){y.data&&(w+=y.start,y=y.data);var L=y[w]<<24|y[w+1]<<16|y[w+2]<<8|y[w+3];return L<0?4294967296+L:L},d.writeUint32=function(y,w,L){y.data&&(w+=y.start,y=y.data),y[w]=L>>24,y[w+1]=L>>16&255,y[w+2]=L>>8&255,y[w+3]=L&255},d.findBox=function(y,w){var L=[],C,M,k,B,Q,z,ee;if(y.data?(z=y.start,B=y.end,y=y.data):(z=0,B=y.byteLength),!w.length)return null;for(C=z;C1?C+M:B,k===w[0]&&(w.length===1?L.push({data:y,start:C+8,end:ee}):(Q=d.findBox({data:y,start:C+8,end:ee},w.slice(1)),Q.length&&(L=L.concat(Q)))),C=ee;return L},d.parseSegmentIndex=function(y){var w=d.findBox(y,["moov"])[0],L=w?w.end:null,C=0,M=d.findBox(y,["sidx"]),k;if(!M||!M[0])return null;k=[],M=M[0];var B=M.data[0];C=B===0?8:16;var Q=d.readUint32(M,C);C+=4;var z=0,ee=0;B===0?C+=8:C+=16,C+=2;var ae=M.end+ee,ne=d.readUint16(M,C);C+=2;for(var me=0;me>>31;if(ct===1){console.warn("SIDX has hierarchical references (not supported)");return}var Mn=d.readUint32(M,_e);_e+=4,k.push({referenceSize:ot,subsegmentDuration:Mn,info:{duration:Mn/Q,start:ae,end:ae+ot-1}}),ae+=ot,_e+=4,C=_e}return{earliestPresentationTime:z,timescale:Q,version:B,referencesCount:ne,references:k,moovEndOffset:L}},d.parseInitSegment=function(y){var w=[],L=d.findBox(y,["moov","trak"]);return L.forEach(function(C){var M=d.findBox(C,["tkhd"])[0];if(M){var k=M.data[M.start],B=k===0?12:20,Q=d.readUint32(M,B),z=d.findBox(C,["mdia","mdhd"])[0];if(z){k=z.data[z.start],B=k===0?12:20;var ee=d.readUint32(z,B),ae=d.findBox(C,["mdia","hdlr"])[0];if(ae){var ne=d.bin2str(ae.data.subarray(ae.start+8,ae.start+12)),me={soun:"audio",vide:"video"}[ne];if(me){var _e=d.findBox(C,["mdia","minf","stbl","stsd"]);if(_e.length){_e=_e[0];var nt=d.bin2str(_e.data.subarray(_e.start+12,_e.start+16));u.logger.log("MP4Demuxer:"+me+":"+nt+" found")}w[Q]={timescale:ee,type:me},w[me]={timescale:ee,id:Q}}}}}}),w},d.getStartDTS=function(y,w){var L,C,M;return L=d.findBox(w,["moof","traf"]),C=[].concat.apply([],L.map(function(k){return d.findBox(k,["tfhd"]).map(function(B){var Q,z,ee;return Q=d.readUint32(B,4),z=y[Q].timescale||9e4,ee=d.findBox(k,["tfdt"]).map(function(ae){var ne,me;return ne=ae.data[ae.start],me=d.readUint32(ae,4),ne===1&&(me*=Math.pow(2,32),me+=d.readUint32(ae,8)),me})[0],ee/z})})),M=Math.min.apply(null,C),isFinite(M)?M:0},d.offsetStartDTS=function(y,w,L){d.findBox(w,["moof","traf"]).map(function(C){return d.findBox(C,["tfhd"]).map(function(M){var k=d.readUint32(M,4),B=y[k].timescale||9e4;d.findBox(C,["tfdt"]).map(function(Q){var z=Q.data[Q.start],ee=d.readUint32(Q,4);if(z===0)d.writeUint32(Q,4,ee-L*B);else{ee*=Math.pow(2,32),ee+=d.readUint32(Q,8),ee-=L*B,ee=Math.max(ee,0);var ae=Math.floor(ee/(p+1)),ne=Math.floor(ee%(p+1));d.writeUint32(Q,4,ae),d.writeUint32(Q,8,ne)}})})})},h.append=function(y,w,L,C){var M=this.initData;M||(this.resetInitSegment(y,this.audioCodec,this.videoCodec,!1),M=this.initData);var k,B=this.initPTS;if(B===void 0){var Q=d.getStartDTS(M,y);this.initPTS=B=Q-w,this.observer.trigger(c.default.INIT_PTS_FOUND,{initPTS:B})}d.offsetStartDTS(M,y,B),k=d.getStartDTS(M,y),this.remuxer.remux(M.audio,M.video,null,null,k,L,C,y)},h.destroy=function(){},d})();n.default=E}),"./src/errors.ts":(function(e,n,r){"use strict";r.r(n),r.d(n,"ErrorTypes",function(){return u}),r.d(n,"ErrorDetails",function(){return c});var u;(function(p){p.NETWORK_ERROR="networkError",p.MEDIA_ERROR="mediaError",p.KEY_SYSTEM_ERROR="keySystemError",p.MUX_ERROR="muxError",p.OTHER_ERROR="otherError"})(u||(u={}));var c;(function(p){p.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",p.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",p.KEY_SYSTEM_NO_SESSION="keySystemNoSession",p.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",p.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",p.MANIFEST_LOAD_ERROR="manifestLoadError",p.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",p.MANIFEST_PARSING_ERROR="manifestParsingError",p.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",p.LEVEL_LOAD_ERROR="levelLoadError",p.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",p.LEVEL_SWITCH_ERROR="levelSwitchError",p.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",p.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",p.FRAG_LOAD_ERROR="fragLoadError",p.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",p.FRAG_DECRYPT_ERROR="fragDecryptError",p.FRAG_PARSING_ERROR="fragParsingError",p.REMUX_ALLOC_ERROR="remuxAllocError",p.KEY_LOAD_ERROR="keyLoadError",p.KEY_LOAD_TIMEOUT="keyLoadTimeOut",p.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",p.BUFFER_APPEND_ERROR="bufferAppendError",p.BUFFER_APPENDING_ERROR="bufferAppendingError",p.BUFFER_STALLED_ERROR="bufferStalledError",p.BUFFER_FULL_ERROR="bufferFullError",p.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",p.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",p.INTERNAL_EXCEPTION="internalException"})(c||(c={}))}),"./src/events.js":(function(e,n,r){"use strict";r.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(e,n,r){"use strict";r.r(n);var u={};r.r(u),r.d(u,"newCue",function(){return Dh});var c=r("./node_modules/url-toolkit/src/url-toolkit.js"),p=r("./src/errors.ts"),E=r("./src/polyfills/number-isFinite.js"),d=r("./src/events.js"),h=r("./src/utils/logger.js"),O={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},y=(function(){function g(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,t=new Array(o>1?o-1:0),a=1;a>8*(15-a)&255;return t},v.setDecryptDataFromLevelKey=function(o,t){var a=o;return o&&o.method&&o.uri&&!o.iv&&(a=new Q(o.baseuri,o.reluri),a.method=o.method,a.iv=this.createInitializationVector(t)),a},ee(g,[{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&&h.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),o=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,o)}return this._decryptdata}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!Object(E.isFiniteNumber)(this.programDateTime))return null;var o=Object(E.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+o*1e3}},{key:"encrypted",get:function(){return!!(this.decryptdata&&this.decryptdata.uri!==null&&this.decryptdata.key===null)}}]),g})();function me(g,v){for(var i=0;iNumber.MAX_SAFE_INTEGER?1/0:t},v.hexadecimalInteger=function(o){if(this[o]){var t=(this[o]||"0x").slice(2);t=(t.length&1?"0":"")+t;for(var a=new Uint8Array(t.length/2),l=0;lNumber.MAX_SAFE_INTEGER?1/0:t},v.decimalFloatingPoint=function(o){return parseFloat(this[o])},v.enumeratedString=function(o){return this[o]},v.decimalResolution=function(o){var t=ot.exec(this[o]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},g.parseAttrList=function(o){var t,a={};for(ct.lastIndex=0;(t=ct.exec(o))!==null;){var l=t[2],_='"';l.indexOf(_)===0&&l.lastIndexOf(_)===l.length-1&&(l=l.slice(1,-1)),a[t[1]]=l}return a},g})(),Ln=Mn,wt={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 Wt(g,v){var i=wt[v];return!!i&&i[g.slice(0,4)]===!0}function un(g,v){return MediaSource.isTypeSupported((v||"video")+'/mp4;codecs="'+g+'"')}var Fn=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,fn=/#EXT-X-MEDIA:(.*)/g,Kt=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),Rn=/(?:(?:#(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,It=(function(){function g(){}return g.findGroup=function(i,o){for(var t=0;t2?(t=o.shift()+".",t+=parseInt(o.shift()).toString(16),t+=("000"+parseInt(o.shift()).toString(16)).substr(-4)):t=i,t},g.resolve=function(i,o){return c.buildAbsoluteURL(o,i,{alwaysNormalize:!0})},g.parseMasterPlaylist=function(i,o){var t=[];Fn.lastIndex=0;function a(I,P){["video","audio"].forEach(function(N){var j=I.filter(function(pe){return Wt(pe,N)});if(j.length){var ue=j.filter(function(pe){return pe.lastIndexOf("avc1",0)===0||pe.lastIndexOf("mp4a",0)===0});P[N+"Codec"]=ue.length>0?ue[0]:j[0],I=I.filter(function(pe){return j.indexOf(pe)===-1})}}),P.unknownCodecs=I}for(var l;(l=Fn.exec(i))!=null;){var _={},R=_.attrs=new Ln(l[1]);_.url=g.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,a([].concat((R.CODECS||"").split(/[ ,]+/)),_),_.videoCodec&&_.videoCodec.indexOf("avc1")!==-1&&(_.videoCodec=g.convertAVC1ToAVCOTI(_.videoCodec)),t.push(_)}return t},g.parseMasterPlaylistMedia=function(i,o,t,a){a===void 0&&(a=[]);var l,_=[],R=0;for(fn.lastIndex=0;(l=fn.exec(i))!==null;){var b=new Ln(l[1]);if(b.TYPE===t){var I={id:R++,groupId:b["GROUP-ID"],name:b.NAME||b.LANGUAGE,type:t,default:b.DEFAULT==="YES",autoselect:b.AUTOSELECT==="YES",forced:b.FORCED==="YES",lang:b.LANGUAGE};if(b.URI&&(I.url=g.resolve(b.URI,o)),a.length){var P=g.findGroup(a,I.groupId);I.audioCodec=P?P.codec:a[0].codec}_.push(I)}}return _},g.parseLevelPlaylist=function(i,o,t,a,l){var _=0,R=0,b=new nt(o),I=0,P=null,N=new ne,j,ue,pe,Se=null;for(Kt.lastIndex=0;(j=Kt.exec(i))!==null;){var ft=j[1];if(ft){N.duration=parseFloat(ft);var rt=(" "+j[2]).slice(1);N.title=rt||null,N.tagList.push(rt?["INF",ft,rt]:["INF",ft])}else if(j[3]){if(Object(E.isFiniteNumber)(N.duration)){var it=_++;N.type=a,N.start=R,pe&&(N.levelkey=pe),N.sn=it,N.level=t,N.cc=I,N.urlId=l,N.baseurl=o,N.relurl=(" "+j[3]).slice(1),he(N,P),b.fragments.push(N),P=N,R+=N.duration,N=new ne}}else if(j[4]){var Rt=(" "+j[4]).slice(1);P?N.setByteRange(Rt,P):N.setByteRange(Rt)}else if(j[5])N.rawProgramDateTime=(" "+j[5]).slice(1),N.tagList.push(["PROGRAM-DATE-TIME",N.rawProgramDateTime]),Se===null&&(Se=b.fragments.length);else{if(j=j[0].match(Rn),!j){h.logger.warn("No matches on slow regex match for level playlist!");continue}for(ue=1;ue=0&&(pe.method=ln,pe.key=null,pe.iv=Ut));break}case"START":{var Kr=new Ln(kt),wc=Kr.decimalFloatingPoint("TIME-OFFSET");Object(E.isFiniteNumber)(wc)&&(b.startTimeOffset=wc);break}case"MAP":{var Fc=new Ln(kt);N.relurl=Fc.URI,Fc.BYTERANGE&&N.setByteRange(Fc.BYTERANGE),N.baseurl=o,N.level=t,N.type=a,N.sn="initSegment",b.initSegment=N,N=new ne,N.rawProgramDateTime=b.initSegment.rawProgramDateTime;break}default:h.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(Bh){return rn.test(Bh.relurl)})&&(h.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),N=new ne,N.relurl=b.fragments[0].relurl,N.baseurl=o,N.level=t,N.type=a,N.sn="initSegment",b.initSegment=N,b.needSidxRanges=!0),Se&&Rr(b.fragments,Se),b},g})();function Rr(g,v){for(var i=g[v],o=v-1;o>=0;o--){var t=g[o];t.programDateTime=i.programDateTime-t.duration*1e3,i=t}}function he(g,v){g.rawProgramDateTime?g.programDateTime=Date.parse(g.rawProgramDateTime):v&&v.programDateTime&&(g.programDateTime=v.endProgramDateTime),Object(E.isFiniteNumber)(g.programDateTime)||(g.programDateTime=null,g.rawProgramDateTime=null)}function At(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var an=window,je=an.performance,We=(function(g){At(v,g);function v(o){var t;return t=g.call(this,o,d.default.MANIFEST_LOADING,d.default.LEVEL_LOADING,d.default.AUDIO_TRACK_LOADING,d.default.SUBTITLE_TRACK_LOADING)||this,t.loaders={},t}v.canHaveQualityLevels=function(t){return t!==L.AUDIO_TRACK&&t!==L.SUBTITLE_TRACK},v.mapContextToLevelType=function(t){var a=t.type;switch(a){case L.AUDIO_TRACK:return C.AUDIO;case L.SUBTITLE_TRACK:return C.SUBTITLE;default:return C.MAIN}},v.getResponseUrl=function(t,a){var l=t.url;return(l===void 0||l.indexOf("data:")===0)&&(l=a.url),l};var i=v.prototype;return i.createInternalLoader=function(t){var a=this.hls.config,l=a.pLoader,_=a.loader,R=l||_,b=new R(a);return t.loader=b,this.loaders[t.type]=b,b},i.getInternalLoader=function(t){return this.loaders[t.type]},i.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},i.destroyInternalLoaders=function(){for(var t in this.loaders){var a=this.loaders[t];a&&a.destroy(),this.resetInternalLoader(t)}},i.destroy=function(){this.destroyInternalLoaders(),g.prototype.destroy.call(this)},i.onManifestLoading=function(t){this.load({url:t.url,type:L.MANIFEST,level:0,id:null,responseType:"text"})},i.onLevelLoading=function(t){this.load({url:t.url,type:L.LEVEL,level:t.level,id:t.id,responseType:"text"})},i.onAudioTrackLoading=function(t){this.load({url:t.url,type:L.AUDIO_TRACK,level:null,id:t.id,responseType:"text"})},i.onSubtitleTrackLoading=function(t){this.load({url:t.url,type:L.SUBTITLE_TRACK,level:null,id:t.id,responseType:"text"})},i.load=function(t){var a=this.hls.config;h.logger.debug("Loading playlist of type "+t.type+", level: "+t.level+", id: "+t.id);var l=this.getInternalLoader(t);if(l){var _=l.context;if(_&&_.url===t.url)return h.logger.trace("playlist request ongoing"),!1;h.logger.warn("aborting previous loader for type: "+t.type),l.abort()}var R,b,I,P;switch(t.type){case L.MANIFEST:R=a.manifestLoadingMaxRetry,b=a.manifestLoadingTimeOut,I=a.manifestLoadingRetryDelay,P=a.manifestLoadingMaxRetryTimeout;break;case L.LEVEL:R=0,P=0,I=0,b=a.levelLoadingTimeOut;break;default:R=a.levelLoadingMaxRetry,b=a.levelLoadingTimeOut,I=a.levelLoadingRetryDelay,P=a.levelLoadingMaxRetryTimeout;break}l=this.createInternalLoader(t);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 h.logger.debug("Calling internal loader delegate for URL: "+t.url),l.load(t,N,j),!0},i.loadsuccess=function(t,a,l,_){if(_===void 0&&(_=null),l.isSidxRequest){this._handleSidxRequest(t,l),this._handlePlaylistLoaded(t,a,l,_);return}if(this.resetInternalLoader(l.type),typeof t.data!="string")throw new Error('expected responseType of "text" for PlaylistLoader');var R=t.data;if(a.tload=je.now(),R.indexOf("#EXTM3U")!==0){this._handleManifestParsingError(t,l,"no EXTM3U delimiter",_);return}R.indexOf("#EXTINF:")>0||R.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(t,a,l,_):this._handleMasterPlaylist(t,a,l,_)},i.loaderror=function(t,a,l){l===void 0&&(l=null),this._handleNetworkError(a,l,!1,t)},i.loadtimeout=function(t,a,l){l===void 0&&(l=null),this._handleNetworkError(a,l,!0)},i._handleMasterPlaylist=function(t,a,l,_){var R=this.hls,b=t.data,I=v.getResponseUrl(t,l),P=It.parseMasterPlaylist(b,I);if(!P.length){this._handleManifestParsingError(t,l,"no level found in manifest",_);return}var N=P.map(function(Se){return{id:Se.attrs.AUDIO,codec:Se.audioCodec}}),j=It.parseMasterPlaylistMedia(b,I,"AUDIO",N),ue=It.parseMasterPlaylistMedia(b,I,"SUBTITLES");if(j.length){var pe=!1;j.forEach(function(Se){Se.url||(pe=!0)}),pe===!1&&P[0].audioCodec&&!P[0].attrs.AUDIO&&(h.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(d.default.MANIFEST_LOADED,{levels:P,audioTracks:j,subtitles:ue,url:I,stats:a,networkDetails:_})},i._handleTrackOrLevelPlaylist=function(t,a,l,_){var R=this.hls,b=l.id,I=l.level,P=l.type,N=v.getResponseUrl(t,l),j=Object(E.isFiniteNumber)(b)?b:0,ue=Object(E.isFiniteNumber)(I)?I:j,pe=v.mapContextToLevelType(l),Se=It.parseLevelPlaylist(t.data,N,ue,pe,j);if(Se.tload=a.tload,P===L.MANIFEST){var ft={url:N,details:Se};R.trigger(d.default.MANIFEST_LOADED,{levels:[ft],audioTracks:[],url:N,stats:a,networkDetails:_})}if(a.tparsed=je.now(),Se.needSidxRanges){var rt=Se.initSegment.url;this.load({url:rt,isSidxRequest:!0,type:P,level:I,levelDetails:Se,id:b,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"});return}l.levelDetails=Se,this._handlePlaylistLoaded(t,a,l,_)},i._handleSidxRequest=function(t,a){if(typeof t.data=="string")throw new Error("sidx request must be made with responseType of array buffer");var l=M.default.parseSegmentIndex(new Uint8Array(t.data));if(l){var _=l.references,R=a.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(t,a,l,_){this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:t.url,reason:l,networkDetails:_})},i._handleNetworkError=function(t,a,l,_){l===void 0&&(l=!1),_===void 0&&(_=null),h.logger.info("A network error occured while loading a "+t.type+"-type playlist");var R,b,I=this.getInternalLoader(t);switch(t.type){case L.MANIFEST:R=l?p.ErrorDetails.MANIFEST_LOAD_TIMEOUT:p.ErrorDetails.MANIFEST_LOAD_ERROR,b=!0;break;case L.LEVEL:R=l?p.ErrorDetails.LEVEL_LOAD_TIMEOUT:p.ErrorDetails.LEVEL_LOAD_ERROR,b=!1;break;case L.AUDIO_TRACK:R=l?p.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:p.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,b=!1;break;default:b=!1}I&&(I.abort(),this.resetInternalLoader(t.type));var P={type:p.ErrorTypes.NETWORK_ERROR,details:R,fatal:b,url:t.url,loader:I,context:t,networkDetails:a};_&&(P.response=_),this.hls.trigger(d.default.ERROR,P)},i._handlePlaylistLoaded=function(t,a,l,_){var R=l.type,b=l.level,I=l.id,P=l.levelDetails;if(!P||!P.targetduration){this._handleManifestParsingError(t,l,"invalid target duration",_);return}var N=v.canHaveQualityLevels(l.type);if(N)this.hls.trigger(d.default.LEVEL_LOADED,{details:P,level:b||0,id:I||0,stats:a,networkDetails:_});else switch(R){case L.AUDIO_TRACK:this.hls.trigger(d.default.AUDIO_TRACK_LOADED,{details:P,id:I,stats:a,networkDetails:_});break;case L.SUBTITLE_TRACK:this.hls.trigger(d.default.SUBTITLE_TRACK_LOADED,{details:P,id:I,stats:a,networkDetails:_});break}},v})(w),ge=We;function bt(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var ht=(function(g){bt(v,g);function v(o){var t;return t=g.call(this,o,d.default.FRAG_LOADING)||this,t.loaders={},t}var i=v.prototype;return i.destroy=function(){var t=this.loaders;for(var a in t){var l=t[a];l&&l.destroy()}this.loaders={},g.prototype.destroy.call(this)},i.onFragLoading=function(t){var a=t.frag,l=a.type,_=this.loaders,R=this.hls.config,b=R.fLoader,I=R.loader;a.loaded=0;var P=_[l];P&&(h.logger.warn("abort previous fragment loader for type: "+l),P.abort()),P=_[l]=a.loader=R.fLoader?new b(R):new I(R);var N,j,ue;N={url:a.url,frag:a,responseType:"arraybuffer",progressData:!1};var pe=a.byteRangeStartOffset,Se=a.byteRangeEndOffset;Object(E.isFiniteNumber)(pe)&&Object(E.isFiniteNumber)(Se)&&(N.rangeStart=pe,N.rangeEnd=Se),j={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout},ue={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},P.load(N,j,ue)},i.loadsuccess=function(t,a,l,_){_===void 0&&(_=null);var R=t.data,b=l.frag;b.loader=void 0,this.loaders[b.type]=void 0,this.hls.trigger(d.default.FRAG_LOADED,{payload:R,frag:b,stats:a,networkDetails:_})},i.loaderror=function(t,a,l){l===void 0&&(l=null);var _=a.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a.frag,response:t,networkDetails:l})},i.loadtimeout=function(t,a,l){l===void 0&&(l=null);var _=a.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a.frag,networkDetails:l})},i.loadprogress=function(t,a,l,_){_===void 0&&(_=null);var R=a.frag;R.loaded=t.loaded,this.hls.trigger(d.default.FRAG_LOAD_PROGRESS,{frag:R,stats:t,networkDetails:_})},v})(w),zt=ht;function In(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var at=(function(g){In(v,g);function v(o){var t;return t=g.call(this,o,d.default.KEY_LOADING)||this,t.loaders={},t.decryptkey=null,t.decrypturl=null,t}var i=v.prototype;return i.destroy=function(){for(var t in this.loaders){var a=this.loaders[t];a&&a.destroy()}this.loaders={},g.prototype.destroy.call(this)},i.onKeyLoading=function(t){var a=t.frag,l=a.type,_=this.loaders[l];if(!a.decryptdata){h.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var R=a.decryptdata.uri;if(R!==this.decrypturl||this.decryptkey===null){var b=this.hls.config;if(_&&(h.logger.warn("abort previous key loader for type:"+l),_.abort()),!R){h.logger.warn("key uri is falsy");return}a.loader=this.loaders[l]=new b.loader(b),this.decrypturl=R,this.decryptkey=null;var I={url:R,frag:a,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)};a.loader.load(I,P,N)}else this.decryptkey&&(a.decryptdata.key=this.decryptkey,this.hls.trigger(d.default.KEY_LOADED,{frag:a}))},i.loadsuccess=function(t,a,l){var _=l.frag;if(!_.decryptdata){h.logger.error("after key load, decryptdata unset");return}this.decryptkey=_.decryptdata.key=new Uint8Array(t.data),_.loader=void 0,delete this.loaders[_.type],this.hls.trigger(d.default.KEY_LOADED,{frag:_})},i.loaderror=function(t,a){var l=a.frag,_=l.loader;_&&_.abort(),delete this.loaders[l.type],this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:l,response:t})},i.loadtimeout=function(t,a){var l=a.frag,_=l.loader;_&&_.abort(),delete this.loaders[l.type],this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:l})},v})(w),Lt=at;function br(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var Jt={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"},ja=(function(g){br(v,g);function v(o){var t;return t=g.call(this,o,d.default.BUFFER_APPENDED,d.default.FRAG_BUFFERED,d.default.FRAG_LOADED)||this,t.bufferPadding=.2,t.fragments=Object.create(null),t.timeRanges=Object.create(null),t.config=o.config,t}var i=v.prototype;return i.destroy=function(){this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.config=null,w.prototype.destroy.call(this),g.prototype.destroy.call(this)},i.getBufferedFrag=function(t,a){var l=this.fragments,_=Object.keys(l).filter(function(b){var I=l[b];if(I.body.type!==a||!I.buffered)return!1;var P=I.body;return P.startPTS<=t&&t<=P.endPTS});if(_.length===0)return null;var R=_.pop();return l[R].body},i.detectEvictedFragments=function(t,a){var l=this,_,R;Object.keys(this.fragments).forEach(function(b){var I=l.fragments[b];if(I.buffered===!0){var P=I.range[t];if(P){_=P.time;for(var N=0;N<_.length;N++)if(R=_[N],l.isTimeBuffered(R.startPTS,R.endPTS,a)===!1){l.removeFragment(I.body);break}}}})},i.detectPartialFragments=function(t){var a=this,l=this.getFragmentKey(t),_=this.fragments[l];_&&(_.buffered=!0,Object.keys(this.timeRanges).forEach(function(R){if(t.hasElementaryStream(R)){var b=a.timeRanges[R];_.range[R]=a.getBufferedTimes(t.startPTS,t.endPTS,b)}}))},i.getBufferedTimes=function(t,a,l){for(var _=[],R,b,I=!1,P=0;P=R&&a<=b){_.push({startPTS:Math.max(t,l.start(P)),endPTS:Math.min(a,l.end(P))});break}else if(tR)_.push({startPTS:Math.max(t,l.start(P)),endPTS:Math.min(a,l.end(P))}),I=!0;else if(a<=R)break;return{time:_,partial:I}},i.getFragmentKey=function(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn},i.getPartialFragment=function(t){var a=this,l,_,R,b=null,I=0;return Object.keys(this.fragments).forEach(function(P){var N=a.fragments[P];a.isPartial(N)&&(_=N.body.startPTS-a.bufferPadding,R=N.body.endPTS+a.bufferPadding,t>=_&&t<=R&&(l=Math.min(t-_,R-t),I<=l&&(b=N.body,I=l)))}),b},i.getState=function(t){var a=this.getFragmentKey(t),l=this.fragments[a],_=Jt.NOT_LOADED;return l!==void 0&&(l.buffered?this.isPartial(l)===!0?_=Jt.PARTIAL:_=Jt.OK:_=Jt.APPENDING),_},i.isPartial=function(t){return t.buffered===!0&&(t.range.video!==void 0&&t.range.video.partial===!0||t.range.audio!==void 0&&t.range.audio.partial===!0)},i.isTimeBuffered=function(t,a,l){for(var _,R,b=0;b=_&&a<=R)return!0;if(a<=_)return!1}return!1},i.onFragLoaded=function(t){var a=t.frag;!Object(E.isFiniteNumber)(a.sn)||a.bitrateTest||(this.fragments[this.getFragmentKey(a)]={body:a,range:Object.create(null),buffered:!1})},i.onBufferAppended=function(t){var a=this;this.timeRanges=t.timeRanges,Object.keys(this.timeRanges).forEach(function(l){var _=a.timeRanges[l];a.detectEvictedFragments(l,_)})},i.onFragBuffered=function(t){this.detectPartialFragments(t.frag)},i.hasFragment=function(t){var a=this.getFragmentKey(t);return this.fragments[a]!==void 0},i.removeFragment=function(t){var a=this.getFragmentKey(t);delete this.fragments[a]},i.removeAllFragments=function(){this.fragments=Object.create(null)},v})(w),U={search:function(v,i){for(var o=0,t=v.length-1,a=null,l=null;o<=t;){a=(o+t)/2|0,l=v[a];var _=i(l);if(_>0)o=a+1;else if(_<0)t=a-1;else return l}return null}},q=U,x=(function(){function g(){}return g.isBuffered=function(i,o){try{if(i){for(var t=i.buffered,a=0;a=t.start(a)&&o<=t.end(a))return!0}}catch{}return!1},g.bufferInfo=function(i,o,t){try{if(i){var a=i.buffered,l=[],_;for(_=0;_R&&(a[_-1].end=i[l].end):a.push(i[l])}else a.push(i[l])}else a=i;for(var b=0,I,P=o,N=o,j=0;j=ue&&o1?a-1:0),_=1;_v?(o.duration=a-o.start,o.duration<0&&h.logger.warn("negative duration computed for frag "+o.sn+",level "+o.level+", there should be some duration drift between playlist and fragment!")):(t.duration=o.start-a,t.duration<0&&h.logger.warn("negative duration computed for frag "+t.sn+",level "+t.level+", there should be some duration drift between playlist and fragment!")):i>v?t.start=o.start+o.duration:t.start=Math.max(o.start-t.duration,0)}function ve(g,v,i,o,t,a){var l=i;if(Object(E.isFiniteNumber)(v.startPTS)){var _=Math.abs(v.startPTS-i);Object(E.isFiniteNumber)(v.deltaPTS)?v.deltaPTS=Math.max(_,v.deltaPTS):v.deltaPTS=_,l=Math.max(i,v.startPTS),i=Math.min(i,v.startPTS),o=Math.max(o,v.endPTS),t=Math.min(t,v.startDTS),a=Math.max(a,v.endDTS)}var R=i-v.start;v.start=v.startPTS=i,v.maxStartPTS=l,v.endPTS=o,v.startDTS=t,v.endDTS=a,v.duration=o-i;var b=v.sn;if(!g||bg.endSN)return 0;var I,P,N;for(I=b-g.startSN,P=g.fragments,P[I]=v,N=I;N>0;N--)Le(P,N,N-1);for(N=I;No.length))for(var a=0;av?-1:0})}function Gt(g,v,i){var o=!1;return v&&v.details&&i&&(i.endCC>i.startCC||g&&g.cc=(t||0))return null;i=i||0;for(var a=0;ag&&i.start?-1:0}function Tr(g,v,i){var o=Math.min(v,i.duration+(i.deltaPTS?i.deltaPTS:0))*1e3,t=i.endProgramDateTime||0;return t-o>g}var _a=250,ha=2,zr=.1,Er=.05,Na=(function(){function g(i,o,t,a){this.config=i,this.media=o,this.fragmentTracker=t,this.hls=a,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1}var v=g.prototype;return v.poll=function(o){var t=this.config,a=this.media,l=this.stalled,_=a.currentTime,R=a.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;h.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),!(a.paused||a.ended||a.playbackRate===0||!a.buffered.length)){var N=x.bufferInfo(a,_,0),j=N.len>0,ue=N.nextStart||0;if(!(!j&&!ue)){if(R){var pe=N.len>ha,Se=!ue||ue-_>ha;if(pe||Se)return;this.moved=!1}if(!this.moved&&this.stalled){var ft=Math.max(ue,N.start||0)-_;if(ft>0&&ft<=ha){this._trySkipBufferHole(null);return}}var rt=self.performance.now();if(l===null){this.stalled=rt;return}var it=rt-l;!R&&it>=_a&&this._reportStall(N.len);var Rt=x.bufferInfo(a,_,t.maxBufferHole);this._tryFixBufferStall(Rt,it)}}},v._tryFixBufferStall=function(o,t){var a=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>a.maxBufferHole&&t>a.highBufferWatchdogPeriod*1e3&&(h.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},v._reportStall=function(o){var t=this.hls,a=this.media,l=this.stallReported;l||(this.stallReported=!0,h.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer"),t.trigger(d.default.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o}))},v._trySkipBufferHole=function(o){for(var t=this.config,a=this.hls,l=this.media,_=l.currentTime,R=0,b=0;b=R&&_1?a-1:0),_=1;_1&&(this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)),this._tickCallCount=0)},i.doTick=function(){},v})(w);function Zu(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var re={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"},au=(function(g){Zu(v,g);function v(){return g.apply(this,arguments)||this}var i=v.prototype;return i.doTick=function(){},i.startLoad=function(){},i.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragmentTracker.removeFragment(t)),this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=re.STOPPED},i._streamEnded=function(t,a){var l=this.fragCurrent,_=this.fragmentTracker;if(!a.live&&l&&!l.backtracked&&l.sn===a.endSN&&!t.nextStart){var R=_.getState(l);return R===Jt.PARTIAL||R===Jt.OK}return!1},i.onMediaSeeking=function(){var t=this.config,a=this.media,l=this.mediaBuffer,_=this.state,R=a?a.currentTime:null,b=x.bufferInfo(l||a,R,this.config.maxBufferHole);if(Object(E.isFiniteNumber)(R)&&h.logger.log("media seeking to "+R.toFixed(3)),_===re.FRAG_LOADING){var I=this.fragCurrent;if(b.len===0&&I){var P=t.maxFragLookUpTolerance,N=I.start-P,j=I.start+I.duration+P;Rj?(I.loader&&(h.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),I.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=re.IDLE):h.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else _===re.ENDED&&(b.len===0&&(this.fragPrevious=null,this.fragCurrent=null),this.state=re.IDLE);a&&(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(),g.prototype.onHandlerDestroying.call(this)},i.onHandlerDestroyed=function(){this.state=re.STOPPED,this.fragmentTracker=null},i.computeLivePosition=function(t,a){var l=this.config.liveSyncDuration!==void 0?this.config.liveSyncDuration:this.config.liveSyncDurationCount*a.targetduration;return t+Math.max(0,a.totalduration-l)},v})(Mu);function ou(g,v){for(var i=0;i0&&t===-1&&(h.logger.log("override startPosition with lastCurrentTime @"+a.toFixed(3)),t=a),this.state=re.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=re.STOPPED},i.stopLoad=function(){this.forceStartLoad=!1,g.prototype.stopLoad.call(this)},i.doTick=function(){switch(this.state){case re.BUFFER_FLUSHING:this.fragLoadError=0;break;case re.IDLE:this._doTickIdle();break;case re.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=re.IDLE);break;case re.FRAG_LOADING_WAITING_RETRY:var a=window.performance.now(),l=this.retryDate;(!l||a>=l||this.media&&this.media.seeking)&&(h.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=re.IDLE);break;case re.ERROR:case re.STOPPED:case re.FRAG_LOADING:case re.PARSING:case re.PARSED:case re.ENDED:break;default:break}this._checkBuffer(),this._checkFragmentChanged()},i._doTickIdle=function(){var t=this.hls,a=t.config,l=this.media;if(!(this.levelLastLoaded===void 0||!l&&(this.startFragRequested||!a.startFragPrefetch))){var _;this.loadedmetadata?_=l.currentTime:_=this.nextLoadPosition;var R=t.nextLoadLevel,b=this.levels[R];if(b){var I=b.bitrate,P;I?P=Math.max(8*a.maxBufferSize/I,a.maxBufferLength):P=a.maxBufferLength,P=Math.min(P,a.maxMaxBufferLength);var N=x.bufferInfo(this.mediaBuffer?this.mediaBuffer:l,_,a.maxBufferHole),j=N.len;if(!(j>=P)){h.logger.trace("buffer length of "+j.toFixed(3)+" is below max of "+P.toFixed(3)+". checking for more payload ..."),this.level=t.nextLoadLevel=R;var ue=b.details;if(!ue||ue.live&&this.levelLastLoaded!==R){this.state=re.WAITING_LEVEL;return}if(this._streamEnded(N,ue)){var pe={};this.altAudio&&(pe.type="video"),this.hls.trigger(d.default.BUFFER_EOS,pe),this.state=re.ENDED;return}this._fetchPayloadOrEos(_,N,ue)}}}},i._fetchPayloadOrEos=function(t,a,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=a.end,ue;if(l.initSegment&&!l.initSegment.data)ue=l.initSegment;else if(l.live){var pe=this.config.initialLiveManifestSize;if(Ipe&&pe>N.currentTime&&(h.logger.log("buffer end: "+a.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+pe.toFixed(3)),N.currentTime=pe),this.nextLoadPosition=pe}if(t.PTSKnown&&a>_&&N&&N.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(R)if(t.hasProgramDateTime)h.logger.log("live playlist, switching playlist, load frag with same PDT: "+R.programDateTime),j=oa(b,R.endProgramDateTime,P.maxFragLookUpTolerance);else{var Se=R.sn+1;if(Se>=t.startSN&&Se<=t.endSN){var ft=b[Se-t.startSN];R.cc===ft.cc&&(j=ft,h.logger.log("live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=q.search(b,function(rt){return R.cc-rt.cc}),j&&h.logger.log("live playlist, switching playlist, load frag with same CC: "+j.sn))}j||(j=b[Math.min(I-1,Math.round(I/2))],h.logger.log("live playlist, switching playlist, unknown, load middle frag : "+j.sn))}return j},i._findFragment=function(t,a,l,_,R,b,I){var P=this.hls.config,N;if(Rb-P.maxFragLookUpTolerance?0:P.maxFragLookUpTolerance;N=pr(a,_,R,j)}else N=_[l-1];if(N){var ue=N.sn-I.startSN,pe=a&&N.level===a.level,Se=_[ue-1],ft=_[ue+1];if(a&&N.sn===a.sn)if(pe&&!N.backtracked)if(N.snP.maxBufferHole&&a.dropped&&ue?(N=Se,h.logger.warn("Previous fragment was dropped with large PTS gap between audio and video. Maybe fragment is not starting with a keyframe? Loading previous one to try to overcome this")):(N=ft,h.logger.log("Re-loading fragment with SN: "+N.sn))}else N=null;else N.backtracked&&(ft&&ft.backtracked?(h.logger.warn("Already backtracked from fragment "+ft.sn+", will not backtrack to fragment "+N.sn+". Loading fragment "+ft.sn),N=ft):(h.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),N.dropped=0,Se?(N=Se,N.backtracked=!0):ue&&(N=null)))}return N},i._loadKey=function(t){this.state=re.KEY_LOADING,this.hls.trigger(d.default.KEY_LOADING,{frag:t})},i._loadFragment=function(t){var a=this.fragmentTracker.getState(t);this.fragCurrent=t,t.sn!=="initSegment"&&(this.startFragRequested=!0),Object(E.isFiniteNumber)(t.sn)&&!t.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),t.backtracked||a===Jt.NOT_LOADED||a===Jt.PARTIAL?(t.autoLevel=this.hls.autoLevelEnabled,t.bitrateTest=this.bitrateTest,this.hls.trigger(d.default.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new se(this.hls,"main")),this.state=re.FRAG_LOADING):a===Jt.APPENDING&&this._reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t)},i.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,C.MAIN)},i.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.endPTS+.5):null},i._checkFragmentChanged=function(){var t,a,l=this.media;if(l&&l.readyState&&l.seeking===!1&&(a=l.currentTime,a>this.lastCurrentTime&&(this.lastCurrentTime=a),x.isBuffered(l,a)?t=this.getBufferedFrag(a):x.isBuffered(l,a+.1)&&(t=this.getBufferedFrag(a+.1)),t)){var _=t;if(_!==this.fragPlaying){this.hls.trigger(d.default.FRAG_CHANGED,{frag:_});var R=_.level;(!this.fragPlaying||this.fragPlaying.level!==R)&&this.hls.trigger(d.default.LEVEL_SWITCHED,{level:R}),this.fragPlaying=_}}},i.immediateLevelSwitch=function(){if(h.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,a;t?(a=t.paused,t.pause()):a=!0,this.previouslyPaused=a}var l=this.fragCurrent;l&&l.loader&&l.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},i.immediateLevelSwitchEnd=function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,x.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())},i.nextLevelSwitch=function(){var t=this.media;if(t&&t.readyState){var a,l,_;if(l=this.getBufferedFrag(t.currentTime),l&&l.startPTS>1&&this.flushMainBuffer(0,l.startPTS-1),t.paused)a=0;else{var R=this.hls.nextLoadLevel,b=this.levels[R],I=this.fragLastKbps;I&&this.fragCurrent?a=this.fragCurrent.duration*b.bitrate/(1e3*I)+1:a=0}if(_=this.getBufferedFrag(t.currentTime+a),_&&(_=this.followingBufferedFrag(_),_)){var P=this.fragCurrent;P&&P.loader&&P.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(_.maxStartPTS,Number.POSITIVE_INFINITY)}}},i.flushMainBuffer=function(t,a){this.state=re.BUFFER_FLUSHING;var l={startOffset:t,endOffset:a};this.altAudio&&(l.type="video"),this.hls.trigger(d.default.BUFFER_FLUSHING,l)},i.onMediaAttached=function(t){var a=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("seeked",this.onvseeked),a.addEventListener("ended",this.onvended);var l=this.config;this.levels&&l.autoStartLoad&&this.hls.startLoad(l.startPosition),this.gapController=new Na(l,a,this.fragmentTracker,this.hls)},i.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var a=this.levels;a&&a.forEach(function(l){l.details&&l.details.fragments.forEach(function(_){_.backtracked=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("seeked",this.onvseeked),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.fragmentTracker.removeAllFragments(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},i.onMediaSeeked=function(){var t=this.media,a=t?t.currentTime:void 0;Object(E.isFiniteNumber)(a)&&h.logger.log("media seeked to "+a.toFixed(3)),this.tick()},i.onManifestLoading=function(){h.logger.log("trigger BUFFER_RESET"),this.hls.trigger(d.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},i.onManifestParsed=function(t){var a=!1,l=!1,_;t.levels.forEach(function(b){_=b.audioCodec,_&&(_.indexOf("mp4a.40.2")!==-1&&(a=!0),_.indexOf("mp4a.40.5")!==-1&&(l=!0))}),this.audioCodecSwitch=a&&l,this.audioCodecSwitch&&h.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.altAudio=t.altAudio,this.levels=t.levels,this.startFragRequested=!1;var R=this.config;(R.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(R.startPosition)},i.onLevelLoaded=function(t){var a=t.details,l=t.level,_=this.levels[this.levelLastLoaded],R=this.levels[l],b=a.totalduration,I=0;if(h.logger.log("level "+l+" loaded ["+a.startSN+","+a.endSN+"],duration:"+b),a.live){var P=R.details;P&&a.fragments.length>0?(Ue(P,a),I=a.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(I,P),a.PTSKnown&&Object(E.isFiniteNumber)(I)?h.logger.log("live playlist sliding:"+I.toFixed(3)):(h.logger.log("live playlist - outdated PTS, unknown sliding"),vr(this.fragPrevious,_,a))):(h.logger.log("live playlist - first load, unknown sliding"),a.PTSKnown=!1,vr(this.fragPrevious,_,a))}else a.PTSKnown=!1;if(R.details=a,this.levelLastLoaded=l,this.hls.trigger(d.default.LEVEL_UPDATED,{details:a,level:l}),this.startFragRequested===!1){if(this.startPosition===-1||this.lastCurrentTime===-1){var N=a.startTimeOffset;Object(E.isFiniteNumber)(N)?(N<0&&(h.logger.log("negative start time offset "+N+", count from end of last fragment"),N=I+b+N),h.logger.log("start time offset found in playlist, adjust startPosition to "+N),this.startPosition=N):a.live?(this.startPosition=this.computeLivePosition(I,a),h.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===re.WAITING_LEVEL&&(this.state=re.IDLE),this.tick()},i.onKeyLoaded=function(){this.state===re.KEY_LOADING&&(this.state=re.IDLE,this.tick())},i.onFragLoaded=function(t){var a=this.fragCurrent,l=this.hls,_=this.levels,R=this.media,b=t.frag;if(this.state===re.FRAG_LOADING&&a&&b.type==="main"&&b.level===a.level&&b.sn===a.sn){var I=t.stats,P=_[a.level],N=P.details;if(this.bitrateTest=!1,this.stats=I,h.logger.log("Loaded "+a.sn+" of ["+N.startSN+" ,"+N.endSN+"],level "+a.level),b.bitrateTest&&l.nextLoadLevel)this.state=re.IDLE,this.startFragRequested=!1,I.tparsed=I.tbuffered=window.performance.now(),l.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else if(b.sn==="initSegment")this.state=re.IDLE,I.tparsed=I.tbuffered=window.performance.now(),N.initSegment.data=t.payload,l.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else{h.logger.log("Parsing "+a.sn+" of ["+N.startSN+" ,"+N.endSN+"],level "+a.level+", cc "+a.cc),this.state=re.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),ue=N.initSegment?N.initSegment.data:[],pe=this._getAudioCodec(P),Se=this.demuxer=this.demuxer||new se(this.hls,"main");Se.push(t.payload,ue,pe,P.videoCodec,a,N.totalduration,j)}}this.fragLoadError=0},i.onFragParsingInitSegment=function(t){var a=this.fragCurrent,l=t.frag;if(a&&t.id==="main"&&l.sn===a.sn&&l.level===a.level&&this.state===re.PARSING){var _=t.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&&(h.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",h.logger.log("Android: force audio codec to "+I)),b.levelCodec=I,b.id=t.id}b=_.video,b&&(b.levelCodec=this.levels[this.level].videoCodec,b.id=t.id),this.hls.trigger(d.default.BUFFER_CODECS,_);for(R in _){b=_[R],h.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(d.default.BUFFER_APPENDING,{type:R,data:N,parent:"main",content:"initSegment"}))}this.tick()}},i.onFragParsingData=function(t){var a=this,l=this.fragCurrent,_=t.frag;if(l&&t.id==="main"&&_.sn===l.sn&&_.level===l.level&&!(t.type==="audio"&&this.altAudio)&&this.state===re.PARSING){var R=this.levels[this.level],b=l;if(Object(E.isFiniteNumber)(t.endPTS)||(t.endPTS=t.startPTS+l.duration,t.endDTS=t.startDTS+l.duration),t.hasAudio===!0&&b.addElementaryStream(ae.AUDIO),t.hasVideo===!0&&b.addElementaryStream(ae.VIDEO),h.logger.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),t.type==="video")if(b.dropped=t.dropped,b.dropped)if(b.backtracked)h.logger.warn("Already backtracked on this fragment, appending with the gap",b.sn);else{var I=R.details;if(I&&b.sn===I.startSN)h.logger.warn("missing video frame(s) on first frag, appending with gap",b.sn);else{h.logger.warn("missing video frame(s), backtracking fragment",b.sn),this.fragmentTracker.removeFragment(b),b.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=re.IDLE,this.fragPrevious=b,this.tick();return}}else b.backtracked=!1;var P=ve(R.details,b,t.startPTS,t.endPTS,t.startDTS,t.endDTS),N=this.hls;N.trigger(d.default.LEVEL_PTS_UPDATED,{details:R.details,level:this.level,drift:P,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(j){j&&j.length&&a.state===re.PARSING&&(a.appended=!0,a.pendingBuffering=!0,N.trigger(d.default.BUFFER_APPENDING,{type:t.type,data:j,parent:"main",content:"data"}))}),this.tick()}},i.onFragParsed=function(t){var a=this.fragCurrent,l=t.frag;a&&t.id==="main"&&l.sn===a.sn&&l.level===a.level&&this.state===re.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=re.PARSED,this._checkAppendedParsed())},i.onAudioTrackSwitching=function(t){var a=!!t.url,l=t.id;if(!a){if(this.mediaBuffer!==this.media){h.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_.loader&&(h.logger.log("switching to main audio track, cancel main fragment load"),_.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=re.IDLE}var R=this.hls;R.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),R.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:l}),this.altAudio=!1}},i.onAudioTrackSwitched=function(t){var a=t.id,l=!!this.hls.audioTracks[a].url;if(l){var _=this.videoBuffer;_&&this.mediaBuffer!==_&&(h.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=_)}this.altAudio=l,this.tick()},i.onBufferCreated=function(t){var a=t.tracks,l,_,R=!1;for(var b in a){var I=a[b];I.id==="main"?(_=b,l=I,b==="video"&&(this.videoBuffer=a[b].buffer)):R=!0}R&&l?(h.logger.log("alternate track found, use "+_+".buffered to schedule main fragment loading"),this.mediaBuffer=l.buffer):this.mediaBuffer=this.media},i.onBufferAppended=function(t){if(t.parent==="main"){var a=this.state;(a===re.PARSING||a===re.PARSED)&&(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},i._checkAppendedParsed=function(){if(this.state===re.PARSED&&(!this.appended||!this.pendingBuffering)){var t=this.fragCurrent;if(t){var a=this.mediaBuffer?this.mediaBuffer:this.media;h.logger.log("main buffered : "+sn.toString(a.buffered)),this.fragPrevious=t;var l=this.stats;l.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*l.total/(l.tbuffered-l.tfirst)),this.hls.trigger(d.default.FRAG_BUFFERED,{stats:l,frag:t,id:"main"}),this.state=re.IDLE}this.tick()}},i.onError=function(t){var a=t.frag||this.fragCurrent;if(!(a&&a.type!=="main")){var l=!!this.media&&x.isBuffered(this.media,this.media.currentTime)&&x.isBuffered(this.media,this.media.currentTime+.5);switch(t.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:if(!t.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var _=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);h.logger.warn("mediaController: frag loading failed, retry in "+_+" ms"),this.retryDate=window.performance.now()+_,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=re.FRAG_LOADING_WAITING_RETRY}else h.logger.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=re.ERROR;break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==re.ERROR&&(t.fatal?(this.state=re.ERROR,h.logger.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):!t.levelRetry&&this.state===re.WAITING_LEVEL&&(this.state=re.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:t.parent==="main"&&(this.state===re.PARSING||this.state===re.PARSED)&&(l?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=re.IDLE):(h.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)));break;default:break}}},i._reduceMaxBufferLength=function(t){var a=this.config;return a.maxMaxBufferLength>=t?(a.maxMaxBufferLength/=2,h.logger.warn("main:reduce max buffer length to "+a.maxMaxBufferLength+"s"),!0):!1},i._checkBuffer=function(){var t=this.media;if(!(!t||t.readyState===0)){var a=this.mediaBuffer?this.mediaBuffer:t,l=a.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=re.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},i.onBufferFlushed=function(){var t=this.mediaBuffer?this.mediaBuffer:this.media;t&&this.fragmentTracker.detectEvictedFragments(ae.VIDEO,t.buffered),this.state=re.IDLE,this.fragPrevious=null},i.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},i._seekToStartPos=function(){var t=this.media,a=t.currentTime,l=t.seeking?a:this.startPosition;a!==l&&l>=0&&(h.logger.log("target start position not buffered, seek to buffered.start(0) "+l+" from current time "+a+" "),t.currentTime=l)},i._getAudioCodec=function(t){var a=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),a&&(a.indexOf("mp4a.40.5")!==-1?a="mp4a.40.2":a="mp4a.40.5")),a},ei(v,[{key:"state",set:function(t){if(this.state!==t){var a=this.state;this._state=t,h.logger.log("main stream-controller: "+a+"->"+t),this.hls.trigger(d.default.STREAM_STATE_TRANSITION,{previousState:a,nextState:t})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var t=this.media;if(t){var a=this.getBufferedFrag(t.currentTime);if(a)return a.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;return t?this.followingBufferedFrag(this.getBufferedFrag(t.currentTime)):null}},{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(t){this._liveSyncPosition=t}}]),v})(au),Dl=Jf;function hc(g,v){for(var i=0;i0){_=a[0].bitrate,a.sort(function(j,ue){return j.bitrate-ue.bitrate}),this._levels=a;for(var N=0;N=0&&t1&&P.loadError0){var a=this.currentLevelIndex,l=t.urlId,_=t.url[l];h.logger.log("Attempt loading level index "+a+" with URL-id "+l),this.hls.trigger(d.default.LEVEL_LOADING,{url:_,level:a,id:l})}}},gc(v,[{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var a=this._levels;a&&(t=Math.min(t,a.length-1),(this.currentLevelIndex!==t||!a[t].details)&&this.setLevelInternal(t))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,this._startLevel===void 0&&(this._startLevel=t),t!==-1&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var t=this.hls.config.startLevel;return t!==void 0?t:this._firstLevel}else return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=t)}}]),v})(w),yc=r("./src/demux/id3.js");function av(g,v){var i;try{i=new Event("addtrack")}catch{i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=g,v.dispatchEvent(i)}function xi(g){if(g&&g.cues)for(;g.cues.length>0;)g.removeCue(g.cues[0])}function B_(g,v){if(vg[g.length-1].endTime)return g[g.length-1];for(var i=0,o=g.length-1;i<=o;){var t=Math.floor((o+i)/2);if(vg[t].endTime)i=t+1;else return g[t]}return g[i].endTime-vP&&(h.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_},v.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},v.destroy=function(){},g})(),z_=j_;function iv(g,v){for(var i=0;i500*l.duration/P){var N=t.levels,j=Math.max(1,b.bw?b.bw/8:b.loaded*1e3/I),ue=N[l.level],pe=ue.realBitrate?Math.max(ue.realBitrate,ue.bitrate):ue.bitrate,Se=b.total?b.total:Math.max(b.loaded,Math.round(l.duration*pe/8)),ft=a.currentTime,rt=(Se-b.loaded)/j,it=(x.bufferInfo(a,ft,t.config.maxBufferHole).end-ft)/P;if(it<2*l.duration/P&&rt>it){var Rt,kt;for(kt=l.level-1;kt>R;kt--){var Oa=N[kt].realBitrate?Math.max(N[kt].realBitrate,N[kt].bitrate):N[kt].bitrate,ua=l.duration*Oa/(8*.8*j);if(ua=_;j--){var ue=N[j];if(ue){var pe=ue.details,Se=pe?pe.totalduration/pe.fragments.length:a,ft=pe?pe.live:!1,rt=void 0;j<=t?rt=I*l:rt=P*l;var it=N[j].realBitrate?Math.max(N[j].realBitrate,N[j].bitrate):N[j].bitrate,Rt=it*Se/rt;if(h.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+j+"/"+Math.round(rt)+"/"+it+"/"+Se+"/"+b+"/"+Rt),rt>it&&(!Rt||ft&&!this.bitrateTestDelay||Rt=0)return Se;h.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var ft=P?Math.min(P,_.maxStarvationDelay):_.maxStarvationDelay,rt=_.abrBandWidthFactor,it=_.abrBandWidthUpFactor;if(pe===0){var Rt=this.bitrateTestDelay;if(Rt){var kt=P?Math.min(P,_.maxLoadingDelay):_.maxLoadingDelay;ft=kt-Rt,h.logger.trace("bitrate test took "+Math.round(1e3*Rt)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*ft)+" ms"),rt=it=1}}return Se=this._findBestLevel(I,P,ue,R,a,pe+ft,rt,it,l),Math.max(Se,0)}}]),v})(w),X_=Q_;function Z_(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var cv=$(),eh=(function(g){Z_(v,g);function v(o){var t;return t=g.call(this,o,d.default.MEDIA_ATTACHING,d.default.MEDIA_DETACHING,d.default.MANIFEST_PARSED,d.default.BUFFER_RESET,d.default.BUFFER_APPENDING,d.default.BUFFER_CODECS,d.default.BUFFER_EOS,d.default.BUFFER_FLUSHING,d.default.LEVEL_PTS_UPDATED,d.default.LEVEL_UPDATED)||this,t._msDuration=null,t._levelDuration=null,t._levelTargetDuration=10,t._live=null,t._objectUrl=null,t._needsFlush=!1,t._needsEos=!1,t.config=void 0,t.audioTimestampOffset=void 0,t.bufferCodecEventsExpected=0,t._bufferCodecEventsTotal=0,t.media=null,t.mediaSource=null,t.segments=[],t.parent=void 0,t.appending=!1,t.appended=0,t.appendError=0,t.flushBufferCounter=0,t.tracks={},t.pendingTracks={},t.sourceBuffer={},t.flushRange=[],t._onMediaSourceOpen=function(){h.logger.log("media source opened"),t.hls.trigger(d.default.MEDIA_ATTACHED,{media:t.media});var a=t.mediaSource;a&&a.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},t._onMediaSourceClose=function(){h.logger.log("media source closed")},t._onMediaSourceEnded=function(){h.logger.log("media source ended")},t._onSBUpdateEnd=function(){if(t.audioTimestampOffset&&t.sourceBuffer.audio){var a=t.sourceBuffer.audio;h.logger.warn("change mpeg audio timestamp offset from "+a.timestampOffset+" to "+t.audioTimestampOffset),a.timestampOffset=t.audioTimestampOffset,delete t.audioTimestampOffset}t._needsFlush&&t.doFlush(),t._needsEos&&t.checkEos(),t.appending=!1;var l=t.parent,_=t.segments.reduce(function(N,j){return j.parent===l?N+1:N},0),R={},b=t.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}t.hls.trigger(d.default.BUFFER_APPENDED,{parent:l,pending:_,timeRanges:R}),t._needsFlush||t.doAppending(),t.updateMediaElementDuration(),_===0&&t.flushLiveBackBuffer()},t._onSBUpdateError=function(a){h.logger.error("sourceBuffer error:",a),t.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},t.config=o.config,t}var i=v.prototype;return i.destroy=function(){w.prototype.destroy.call(this)},i.onLevelPtsUpdated=function(t){var a=t.type,l=this.tracks.audio;if(a==="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-t.start);if(R>.1){var b=_.updating;try{_.abort()}catch(I){h.logger.warn("can not abort audio buffer: "+I)}b?this.audioTimestampOffset=t.start:(h.logger.warn("change mpeg audio timestamp offset from "+_.timestampOffset+" to "+t.start),_.timestampOffset=t.start)}}},i.onManifestParsed=function(t){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t.altAudio?2:1,h.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},i.onMediaAttaching=function(t){var a=this.media=t.media;if(a&&cv){var l=this.mediaSource=new cv;l.addEventListener("sourceopen",this._onMediaSourceOpen),l.addEventListener("sourceended",this._onMediaSourceEnded),l.addEventListener("sourceclose",this._onMediaSourceClose),a.src=window.URL.createObjectURL(l),this._objectUrl=a.src}},i.onMediaDetaching=function(){h.logger.log("media source detaching");var t=this.mediaSource;if(t){if(t.readyState==="open")try{t.endOfStream()}catch(a){h.logger.warn("onMediaDetaching:"+a.message+" while calling endOfStream")}t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.media&&(this._objectUrl&&window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):h.logger.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.hls.trigger(d.default.MEDIA_DETACHED)},i.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,a=this.pendingTracks,l=Object.keys(a).length;(l&&!t||l===2)&&(this.createSourceBuffers(a),this.pendingTracks={},this.doAppending())},i.onBufferReset=function(){var t=this.sourceBuffer;for(var a in t){var l=t[a];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(t){var a=this;Object.keys(this.sourceBuffer).length||(Object.keys(t).forEach(function(l){a.pendingTracks[l]=t[l]}),this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())},i.createSourceBuffers=function(t){var a=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");for(var _ in t)if(!a[_]){var R=t[_];if(!R)throw Error("source buffer exists for track "+_+", however track does not");var b=R.levelCodec||R.codec,I=R.container+";codecs="+b;h.logger.log("creating sourceBuffer("+I+")");try{var P=a[_]=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){h.logger.error("error while trying to add sourceBuffer:"+N.message),this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:N,mimeType:I})}}this.hls.trigger(d.default.BUFFER_CREATED,{tracks:this.tracks})},i.onBufferAppending=function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())},i.onBufferEos=function(t){for(var a in this.sourceBuffer)if(!t.type||t.type===a){var l=this.sourceBuffer[a];l&&!l.ended&&(l.ended=!0,h.logger.log(a+" sourceBuffer now EOS"))}this.checkEos()},i.checkEos=function(){var t=this.sourceBuffer,a=this.mediaSource;if(!a||a.readyState!=="open"){this._needsEos=!1;return}for(var l in t){var _=t[l];if(_){if(!_.ended)return;if(_.updating){this._needsEos=!0;return}}}h.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{a.endOfStream()}catch{h.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},i.onBufferFlushing=function(t){t.type?this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}):(this.flushRange.push({start:t.startOffset,end:t.endOffset,type:"video"}),this.flushRange.push({start:t.startOffset,end:t.endOffset,type:"audio"})),this.flushBufferCounter=0,this.doFlush()},i.flushLiveBackBuffer=function(){if(this._live){var t=this.config.liveBackBufferLength;if(!(!isFinite(t)||t<0)){if(!this.media){h.logger.error("flushLiveBackBuffer called without attaching media");return}for(var a=this.media.currentTime,l=this.sourceBuffer,_=Object.keys(l),R=a-Math.max(t,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(d.default.LIVE_BACK_BUFFER_REACHED,{bufferEnd:R})}}}}},i.onLevelUpdated=function(t){var a=t.details;a.fragments.length>0&&(this._levelDuration=a.totalduration+a.fragments[0].start,this._levelTargetDuration=a.averagetargetduration||a.targetduration||10,this._live=a.live,this.updateMediaElementDuration())},i.updateMediaElementDuration=function(){var t=this.config,a;if(!(this._levelDuration===null||!this.media||!this.mediaSource||!this.sourceBuffer||this.media.readyState===0||this.mediaSource.readyState!=="open")){for(var l in this.sourceBuffer){var _=this.sourceBuffer[l];if(_&&_.updating===!0)return}a=this.media.duration,this._msDuration===null&&(this._msDuration=this.mediaSource.duration),this._live===!0&&t.liveDurationInfinity===!0?(h.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>a||!Object(E.isFiniteNumber)(a))&&(h.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},i.doFlush=function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(this.flushBuffer(t.start,t.end,t.type))this.flushRange.shift(),this.flushBufferCounter=0;else{this._needsFlush=!0;return}}if(this.flushRange.length===0){this._needsFlush=!1;var a=0,l=this.sourceBuffer;try{for(var _ in l){var R=l[_];R&&(a+=R.buffered.length)}}catch{h.logger.error("error while accessing sourceBuffer.buffered")}this.appended=a,this.hls.trigger(d.default.BUFFER_FLUSHED)}},i.doAppending=function(){var t=this.config,a=this.hls,l=this.segments,_=this.sourceBuffer;if(Object.keys(_).length){if(!this.media||this.media.error){this.segments=[],h.logger.error("trying to append although a media error occured, flush segment and abort");return}if(!this.appending){var R=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){h.logger.error("error while trying to append buffer:"+P.message),l.unshift(R);var I={type:p.ErrorTypes.MEDIA_ERROR,parent:R.parent,details:"",fatal:!1};P.code===22?(this.segments=[],I.details=p.ErrorDetails.BUFFER_FULL_ERROR):(this.appendError++,I.details=p.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>t.appendErrorMaxRetry&&(h.logger.log("fail "+t.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],I.fatal=!0)),a.trigger(d.default.ERROR,I)}}}},i.flushBuffer=function(t,a,l){var _=this.sourceBuffer;if(!Object.keys(_).length)return!0;var R="null";if(this.media&&(R=this.media.currentTime.toFixed(3)),h.logger.log("flushBuffer,pos/start/end: "+R+"/"+t+"/"+a),this.flushBufferCounter>=this.appended)return h.logger.warn("abort flushing too many retries"),!0;var b=_[l];if(b){if(b.ended=!1,b.updating)return h.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(l,b,t,a))return this.flushBufferCounter++,!1}return h.logger.log("buffer flushed"),!0},i.removeBufferRange=function(t,a,l,_){try{for(var R=0;R.5){var j="null";return this.media&&(j=this.media.currentTime.toString()),h.logger.log("sb remove "+t+" ["+P+","+N+"], of ["+b+","+I+"], pos:"+j),a.remove(P,N),!0}}}catch(ue){h.logger.warn("removeBufferRange failed",ue)}return!1},v})(w),th=eh;function fv(g,v){for(var i=0;ithis.autoLevelCapping&&a.streamController.nextLevelSwitch(),this.autoLevelCapping=a.autoLevelCapping}}},i.getMaxLevel=function(t){var a=this;if(!this.levels)return-1;var l=this.levels.filter(function(_,R){return v.isLevelAllowed(R,a.restrictedLevels)&&R<=t});return v.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)},v.isLevelAllowed=function(t,a){return a===void 0&&(a=[]),a.indexOf(t)===-1},v.getMaxLevelByMediaSize=function(t,a,l){if(!t||t&&!t.length)return-1;for(var _=function(N,j){return j?N.width!==j.width||N.height!==j.height:!0},R=t.length-1,b=0;b=a||I.height>=l)&&_(I,t[b+1])){R=b;break}}return R},nh(v,[{key:"mediaWidth",get:function(){var t,a=this.media;return a&&(t=a.width||a.clientWidth||a.offsetWidth,t*=v.contentScaleFactor),t}},{key:"mediaHeight",get:function(){var t,a=this.media;return a&&(t=a.height||a.clientHeight||a.offsetHeight,t*=v.contentScaleFactor),t}}],[{key:"contentScaleFactor",get:function(){var t=1;try{t=window.devicePixelRatio}catch{}return t}}]),v})(w),sv=rh;function ah(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var ni=window,oh=ni.performance,zf=(function(g){ah(v,g);function v(o){return g.call(this,o,d.default.MEDIA_ATTACHING)||this}var i=v.prototype;return i.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},i.onMediaAttaching=function(t){var a=this.hls.config;if(a.capLevelOnFPSDrop){var l=this.video=t.media instanceof window.HTMLVideoElement?t.media:null;typeof l.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),a.fpsDroppedMonitoringPeriod)}},i.checkFPS=function(t,a,l){var _=oh.now();if(a){if(this.lastTime){var R=_-this.lastTime,b=l-this.lastDroppedFrames,I=a-this.lastDecodedFrames,P=1e3*b/R,N=this.hls;if(N.trigger(d.default.FPS_DROP,{currentDropped:b,currentDecoded:I,totalDroppedFrames:l}),P>0&&b>N.config.fpsDroppedMonitoringThreshold*I){var j=N.currentLevel;h.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(d.default.FPS_DROP_LEVEL_CAPPING,{level:j,droppedLevel:N.currentLevel}),N.autoLevelCapping=j,N.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=l,this.lastDecodedFrames=a}},i.checkFPSInterval=function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var a=t.getVideoPlaybackQuality();this.checkFPS(t,a.totalVideoFrames,a.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},v})(w),uh=zf,dv=window,Vf=dv.performance,ih=dv.XMLHttpRequest,lh=(function(){function g(i){i&&i.xhrSetup&&(this.xhrSetup=i.xhrSetup)}var v=g.prototype;return v.destroy=function(){this.abort(),this.loader=null},v.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},v.load=function(o,t,a){this.context=o,this.config=t,this.callbacks=a,this.stats={trequest:Vf.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()},v.loadInternal=function(){var o,t=this.context;o=this.loader=new ih;var a=this.stats;a.tfirst=0,a.loaded=0;var l=this.xhrSetup;try{if(l)try{l(o,t.url)}catch{o.open("GET",t.url,!0),l(o,t.url)}o.readyState||o.open("GET",t.url,!0)}catch(_){this.callbacks.onError({code:o.status,text:_.message},t,o);return}t.rangeEnd&&o.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),o.send()},v.readystatechange=function(o){var t=o.currentTarget,a=t.readyState,l=this.stats,_=this.context,R=this.config;if(!l.aborted&&a>=2)if(window.clearTimeout(this.requestTimeout),l.tfirst===0&&(l.tfirst=Math.max(Vf.now(),l.trequest)),a===4){var b=t.status;if(b>=200&&b<300){l.tload=Math.max(l.tfirst,Vf.now());var I,P;_.responseType==="arraybuffer"?(I=t.response,P=I.byteLength):(I=t.responseText,P=I.length),l.loaded=l.total=P;var N={url:t.responseURL,data:I};this.callbacks.onSuccess(N,l,_,t)}else l.retry>=R.maxRetry||b>=400&&b<499?(h.logger.error(b+" while loading "+_.url),this.callbacks.onError({code:b,text:t.statusText},_,t)):(h.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)},v.loadtimeout=function(){h.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},v.loadprogress=function(o){var t=o.currentTarget,a=this.stats;a.loaded=o.loaded,o.lengthComputable&&(a.total=o.total);var l=this.callbacks.onProgress;l&&l(a,this.context,null,t)},g})(),Kf=lh;function vv(g,v){for(var i=0;i=this.tracks.length){h.logger.warn("Invalid audio track id:",t.id);return}if(h.logger.log("audioTrack "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.hasInterval()){var a=t.details.targetduration*1e3;this.setInterval(a)}!t.details.live&&this.hasInterval()&&this.clearInterval()},i.onAudioTrackSwitched=function(t){var a=this.tracks[t.id].groupId;a&&this.audioGroupId!==a&&(this.audioGroupId=a)},i.onLevelLoaded=function(t){this._selectAudioGroup(t.level)},i.onError=function(t){t.type===p.ErrorTypes.NETWORK_ERROR&&(t.fatal&&this.clearInterval(),t.details===p.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&(h.logger.warn("Network failure on audio-track id:",t.context.id),this._handleLoadError()))},i._setAudioTrack=function(t){if(this._trackId===t&&this.tracks[this._trackId].details){h.logger.debug("Same id as current audio-track passed, and track details available -> no-op");return}if(t<0||t>=this.tracks.length){h.logger.warn("Invalid id passed to audio-track controller");return}var a=this.tracks[t];h.logger.log("Now switching to audio-track index "+t),this.clearInterval(),this._trackId=t;var l=a.url,_=a.type,R=a.id;this.hls.trigger(d.default.AUDIO_TRACK_SWITCHING,{id:R,type:_,url:l}),this._loadTrackDetailsIfNeeded(a)},i.doTick=function(){this._updateTrack(this._trackId)},i._selectAudioGroup=function(t){var a=this.hls.levels[t];if(!(!a||!a.audioGroupIds)){var l=a.audioGroupIds[a.urlId];this.audioGroupId!==l&&(this.audioGroupId=l,this._selectInitialAudioTrack())}},i._selectInitialAudioTrack=function(){var t=this,a=this.tracks;if(a.length){var l=this.tracks[this._trackId],_=null;if(l&&(_=l.name),this._selectDefaultTrack){var R=a.filter(function(P){return P.default});R.length?a=R:h.logger.warn("No default audio tracks defined")}var b=!1,I=function(){a.forEach(function(N){b||(!t.audioGroupId||N.groupId===t.audioGroupId)&&(!_||_===N.name)&&(t._setAudioTrack(N.id),b=!0)})};I(),b||(_=null,I()),b||(h.logger.error("No track found for running audio group-ID: "+this.audioGroupId),this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))}},i._needsTrackLoading=function(t){var a=t.details,l=t.url;return!a||a.live?!!l:!1},i._loadTrackDetailsIfNeeded=function(t){if(this._needsTrackLoading(t)){var a=t.url,l=t.id;h.logger.log("loading audio-track playlist for id: "+l),this.hls.trigger(d.default.AUDIO_TRACK_LOADING,{url:a,id:l})}},i._updateTrack=function(t){if(!(t<0||t>=this.tracks.length)){this.clearInterval(),this._trackId=t,h.logger.log("trying to update audio-track "+t);var a=this.tracks[t];this._loadTrackDetailsIfNeeded(a)}},i._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var t=this._trackId,a=this.tracks[t],l=a.name,_=a.language,R=a.groupId;h.logger.warn("Loading failed on audio track id: "+t+", group-id: "+R+', name/language: "'+l+'" / "'+_+'"');for(var b=t,I=0;I0&&t===-1?(h.logger.log("audio:override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=re.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:t,this.state=re.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=t,this.state=re.STOPPED},i.doTick=function(){var t,a,l,_=this.hls,R=_.config;switch(this.state){case re.ERROR:case re.PAUSED:case re.BUFFER_FLUSHING:break;case re.STARTING:this.state=re.WAITING_TRACK,this.loadedmetadata=!1;break;case re.IDLE:var b=this.tracks;if(!b||!this.media&&(this.startFragRequested||!R.startFragPrefetch))break;if(this.loadedmetadata)t=this.media.currentTime;else if(t=this.nextLoadPosition,t===void 0)break;var I=this.mediaBuffer?this.mediaBuffer:this.media,P=this.videoBuffer?this.videoBuffer:this.media,N=x.bufferInfo(I,t,R.maxBufferHole),j=x.bufferInfo(P,t,R.maxBufferHole),ue=N.len,pe=N.end,Se=this.fragPrevious,ft=Math.min(R.maxBufferLength,R.maxMaxBufferLength),rt=Math.max(ft,j.len),it=this.audioSwitch,Rt=this.trackId;if((ue"u"){this.state=re.WAITING_TRACK;break}if(!it&&this._streamEnded(N,l)){this.hls.trigger(d.default.BUFFER_EOS,{type:"audio"}),this.state=re.ENDED;return}var kt=l.fragments,Oa=kt.length,ua=kt[0].start,Co=kt[Oa-1].start+kt[Oa-1].duration,ln;if(it){if(l.live&&!l.PTSKnown)h.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),pe=0;else if(pe=t,l.PTSKnown&&tua||N.nextStart)h.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=ua+.05;else return}if(l.initSegment&&!l.initSegment.data)ln=l.initSegment;else if(pe<=ua){if(ln=kt[0],this.videoTrackCC!==null&&ln.cc!==this.videoTrackCC&&(ln=An(kt,this.videoTrackCC)),l.live&&ln.loadIdx&&ln.loadIdx===this.fragLoadIdx){var dn=N.nextStart?N.nextStart:ua;h.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(dn+.05)),this.media.currentTime=dn+.05;return}}else{var Ut,Kr=R.maxFragLookUpTolerance,wc=Se?kt[Se.sn-kt[0].sn+1]:void 0,Fc=function(rs){var UD=Math.min(Kr,rs.duration);return rs.start+rs.duration-UD<=pe?1:rs.start-UD>pe&&rs.start?-1:0};peCo-Kr&&(Kr=0),wc&&!Fc(wc)?Ut=wc:Ut=q.search(kt,Fc)):Ut=kt[Oa-1],Ut&&(ln=Ut,ua=Ut.start,Se&&ln.level===Se.level&&ln.sn===Se.sn&&(ln.sn=ND||UM)&&(h.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=re.IDLE);break;case re.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?(a=this.tracks[this.trackId],a.details&&a.details.live&&(h.logger.warn("Waiting fragment CC ("+OD+") does not match video track CC ("+Jh+")"),this.waitingFragment=null,this.state=re.IDLE)):(this.state=re.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=re.IDLE;break;case re.STOPPED:case re.FRAG_LOADING:case re.PARSING:case re.PARSED:case re.ENDED:break;default:break}},i.onMediaAttached=function(t){var a=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("ended",this.onvended);var l=this.config;this.tracks&&l.autoStartLoad&&this.startLoad(l.startPosition)},i.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},i.onAudioTracksUpdated=function(t){h.logger.log("audio tracks updated"),this.tracks=t.audioTracks},i.onAudioTrackSwitching=function(t){var a=!!t.url;this.trackId=t.id,this.fragCurrent=null,this.state=re.PAUSED,this.waitingFragment=null,a?this.setInterval(_v):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),a&&(this.audioSwitch=!0,this.state=re.IDLE),this.tick()},i.onAudioTrackLoaded=function(t){var a=t.details,l=t.id,_=this.tracks[l],R=a.totalduration,b=0;if(h.logger.log("track "+l+" loaded ["+a.startSN+","+a.endSN+"],duration:"+R),a.live){var I=_.details;I&&a.fragments.length>0?(Ue(I,a),b=a.fragments[0].start,a.PTSKnown?h.logger.log("live audio playlist sliding:"+b.toFixed(3)):h.logger.log("live audio playlist - outdated PTS, unknown sliding")):(a.PTSKnown=!1,h.logger.log("live audio playlist - first load, unknown sliding"))}else a.PTSKnown=!1;if(_.details=a,!this.startFragRequested){if(this.startPosition===-1){var P=a.startTimeOffset;Object(E.isFiniteNumber)(P)?(h.logger.log("start time offset found in playlist, adjust startPosition to "+P),this.startPosition=P):a.live?(this.startPosition=this.computeLivePosition(b,a),h.logger.log("compute startPosition for audio-track to "+this.startPosition)):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===re.WAITING_TRACK&&(this.state=re.IDLE),this.tick()},i.onKeyLoaded=function(){this.state===re.KEY_LOADING&&(this.state=re.IDLE,this.tick())},i.onFragLoaded=function(t){var a=this.fragCurrent,l=t.frag;if(this.state===re.FRAG_LOADING&&a&&l.type==="audio"&&l.level===a.level&&l.sn===a.sn){var _=this.tracks[this.trackId],R=_.details,b=R.totalduration,I=a.level,P=a.sn,N=a.cc,j=this.config.defaultAudioCodec||_.audioCodec||"mp4a.40.2",ue=this.stats=t.stats;if(P==="initSegment")this.state=re.IDLE,ue.tparsed=ue.tbuffered=iu.now(),R.initSegment.data=t.payload,this.hls.trigger(d.default.FRAG_BUFFERED,{stats:ue,frag:a,id:"audio"}),this.tick();else{this.state=re.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new se(this.hls,"audio"));var pe=this.initPTS[N],Se=R.initSegment?R.initSegment.data:[];if(R.initSegment||pe!==void 0){this.pendingBuffering=!0,h.logger.log("Demuxing "+P+" of ["+R.startSN+" ,"+R.endSN+"],track "+I);var ft=!1;this.demuxer.push(t.payload,Se,j,null,a,b,ft,pe)}else h.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=t,this.state=re.WAITING_INIT_PTS}}this.fragLoadError=0},i.onFragParsingInitSegment=function(t){var a=this.fragCurrent,l=t.frag;if(a&&t.id==="audio"&&l.sn===a.sn&&l.level===a.level&&this.state===re.PARSING){var _=t.tracks,R;if(_.video&&delete _.video,R=_.audio,R){R.levelCodec=R.codec,R.id=t.id,this.hls.trigger(d.default.BUFFER_CODECS,_),h.logger.log("audio track:audio,container:"+R.container+",codecs[level/parsed]=["+R.levelCodec+"/"+R.codec+"]");var 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(d.default.BUFFER_APPENDING,I))}this.tick()}}},i.onFragParsingData=function(t){var a=this,l=this.fragCurrent,_=t.frag;if(l&&t.id==="audio"&&t.type==="audio"&&_.sn===l.sn&&_.level===l.level&&this.state===re.PARSING){var R=this.trackId,b=this.tracks[R],I=this.hls;Object(E.isFiniteNumber)(t.endPTS)||(t.endPTS=t.startPTS+l.duration,t.endDTS=t.startDTS+l.duration),l.addElementaryStream(ae.AUDIO),h.logger.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),ve(b.details,l,t.startPTS,t.endPTS);var P=this.audioSwitch,N=this.media,j=!1;if(P)if(N&&N.readyState){var ue=N.currentTime;h.logger.log("switching audio track : currentTime:"+ue),ue>=t.startPTS&&(h.logger.log("switching audio track : flushing all audio"),this.state=re.BUFFER_FLUSHING,I.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j=!0,this.audioSwitch=!1,I.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:R}))}else this.audioSwitch=!1,I.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:R});var pe=this.pendingData;if(!pe){h.logger.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),I.trigger(d.default.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:null,fatal:!0});return}this.audioSwitch||([t.data1,t.data2].forEach(function(Se){Se&&Se.length&&pe.push({type:t.type,data:Se,parent:"audio",content:"data"})}),!j&&pe.length&&(pe.forEach(function(Se){a.state===re.PARSING&&(a.pendingBuffering=!0,a.hls.trigger(d.default.BUFFER_APPENDING,Se))}),this.pendingData=[],this.appended=!0)),this.tick()}},i.onFragParsed=function(t){var a=this.fragCurrent,l=t.frag;a&&t.id==="audio"&&l.sn===a.sn&&l.level===a.level&&this.state===re.PARSING&&(this.stats.tparsed=iu.now(),this.state=re.PARSED,this._checkAppendedParsed())},i.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},i.onBufferCreated=function(t){var a=t.tracks.audio;a&&(this.mediaBuffer=a.buffer,this.loadedmetadata=!0),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},i.onBufferAppended=function(t){if(t.parent==="audio"){var a=this.state;(a===re.PARSING||a===re.PARSED)&&(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},i._checkAppendedParsed=function(){if(this.state===re.PARSED&&(!this.appended||!this.pendingBuffering)){var t=this.fragCurrent,a=this.stats,l=this.hls;if(t){this.fragPrevious=t,a.tbuffered=iu.now(),l.trigger(d.default.FRAG_BUFFERED,{stats:a,frag:t,id:"audio"});var _=this.mediaBuffer?this.mediaBuffer:this.media;_&&h.logger.log("audio buffered : "+sn.toString(_.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,l.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=re.IDLE}this.tick()}},i.onError=function(t){var a=t.frag;if(!(a&&a.type!=="audio"))switch(t.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:var l=t.frag;if(l&&l.type!=="audio")break;if(!t.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);h.logger.warn("AudioStreamController: frag loading failed, retry in "+b+" ms"),this.retryDate=iu.now()+b,this.state=re.FRAG_LOADING_WAITING_RETRY}else h.logger.error("AudioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=re.ERROR}break;case p.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case p.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==re.ERROR&&(this.state=t.fatal?re.ERROR:re.IDLE,h.logger.warn("AudioStreamController: "+t.details+" while loading frag, now switching to "+this.state+" state ..."));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if(t.parent==="audio"&&(this.state===re.PARSING||this.state===re.PARSED)){var I=this.mediaBuffer,P=this.media.currentTime,N=I&&x.isBuffered(I,P)&&x.isBuffered(I,P+.5);if(N){var j=this.config;j.maxMaxBufferLength>=j.maxBufferLength&&(j.maxMaxBufferLength/=2,h.logger.warn("AudioStreamController: reduce max buffer length to "+j.maxMaxBufferLength+"s")),this.state=re.IDLE}else h.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=re.BUFFER_FLUSHING,this.hls.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}break;default:break}},i.onBufferFlushed=function(){var t=this,a=this.pendingData;a&&a.length?(h.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),a.forEach(function(l){t.hls.trigger(d.default.BUFFER_APPENDING,l)}),this.appended=!0,this.pendingData=[],this.state=re.PARSED):(this.state=re.IDLE,this.fragPrevious=null,this.tick())},yl(v,[{key:"state",set:function(t){if(this.state!==t){var a=this.state;this._state=t,h.logger.log("audio stream:"+a+"->"+t)}},get:function(){return this._state}}]),v})(au),ph=vh,hv=(function(){if(typeof window<"u"&&window.VTTCue)return window.VTTCue;var g="auto",v={"":!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=v[_.toLowerCase()];return R?_.toLowerCase():!1}function t(_){if(typeof _!="string")return!1;var R=i[_.toLowerCase()];return R?_.toLowerCase():!1}function a(_){for(var R=1;R100)throw new Error("Position must be between 0 and 100.");Oa=Ut,this.hasBeenReset=!0}})),Object.defineProperty(I,"positionAlign",a({},P,{get:function(){return ua},set:function(Ut){var Kr=t(Ut);if(!Kr)throw new SyntaxError("An invalid or illegal string was specified.");ua=Kr,this.hasBeenReset=!0}})),Object.defineProperty(I,"size",a({},P,{get:function(){return Co},set:function(Ut){if(Ut<0||Ut>100)throw new Error("Size must be between 0 and 100.");Co=Ut,this.hasBeenReset=!0}})),Object.defineProperty(I,"align",a({},P,{get:function(){return ln},set:function(Ut){var Kr=t(Ut);if(!Kr)throw new SyntaxError("An invalid or illegal string was specified.");ln=Kr,this.hasBeenReset=!0}})),I.displayState=void 0}return l.prototype.getCueAsHTML=function(){var _=window.WebVTT;return _.convertCueToDOMTree(window,this.text)},l})(),mh=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};function gv(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new mh,this.regionList=[]}function _h(g){function v(o,t,a,l){return(o|0)*3600+(t|0)*60+(a|0)+(l|0)/1e3}var i=g.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?v(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?v(i[1],i[2],0,i[4]):v(0,i[1],i[2],i[4]):null}function Dv(){this.values=Object.create(null)}Dv.prototype={set:function(v,i){!this.get(v)&&i!==""&&(this.values[v]=i)},get:function(v,i,o){return o?this.has(v)?this.values[v]:i[o]:this.has(v)?this.values[v]:i},has:function(v){return v in this.values},alt:function(v,i,o){for(var t=0;t=0&&i<=100)?(this.set(v,i),!0):!1}};function yv(g,v,i,o){var t=o?g.split(o):[g];for(var a in t)if(typeof t[a]=="string"){var l=t[a].split(i);if(l.length===2){var _=l[0],R=l[1];v(_,R)}}}var Rl=new hv(0,0,0),Fo=Rl.align==="middle"?"middle":"center";function hh(g,v,i){var o=g;function t(){var _=_h(g);if(_===null)throw new Error("Malformed timestamp: "+o);return g=g.replace(/^[^\sa-zA-Z-]+/,""),_}function a(_,R){var b=new Dv;yv(_,function(N,j){switch(N){case"region":for(var ue=i.length-1;ue>=0;ue--)if(i[ue].id===j){b.set(N,i[ue].region);break}break;case"vertical":b.alt(N,j,["rl","lr"]);break;case"line":var pe=j.split(","),Se=pe[0];b.integer(N,Se),b.percent(N,Se)&&b.set("snapToLines",!1),b.alt(N,Se,["auto"]),pe.length===2&&b.alt("lineAlign",pe[1],["start",Fo,"end"]);break;case"position":pe=j.split(","),b.percent(N,pe[0]),pe.length===2&&b.alt("positionAlign",pe[1],["start",Fo,"end","line-left","line-right","auto"]);break;case"size":b.percent(N,j);break;case"align":b.alt(N,j,["start",Fo,"end","left","right"]);break}},/:/,/\s/),R.region=b.get("region",null),R.vertical=b.get("vertical","");var I=b.get("line","auto");I==="auto"&&Rl.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",Fo);var P=b.get("position","auto");P==="auto"&&Rl.position===50&&(P=R.align==="start"||R.align==="left"?0:R.align==="end"||R.align==="right"?100:50),R.position=P}function l(){g=g.replace(/^\s+/,"")}if(l(),v.startTime=t(),l(),g.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);g=g.substr(3),l(),v.endTime=t(),l(),a(g,v)}function Rv(g){return g.replace(//gi,` `)}gv.prototype={parse:function(v){var i=this;v&&(i.buffer+=i.decoder.decode(v,{stream:!0}));function o(){var b=i.buffer,I=0;for(b=Rv(b);I")===-1){i.cue.id=a;continue}case"CUE":try{hh(a,i.cue,i.regionList)}catch{i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var R=a.indexOf("-->")!==-1;if(!a||R&&(_=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+=` `),i.cue.text+=a;continue;case"BADCUE":a||(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 v=this;try{if(v.buffer+=v.decoder.decode(),(v.cue||v.state==="HEADER")&&(v.buffer+=` `,v.parse()),v.state==="INITIAL")throw new Error("Malformed WebVTT signature.")}catch(i){throw i}return v.onflush&&v.onflush(),this}};var gh=gv;function Dh(g,v,i,o){for(var t,a,l,_,R,b=window.VTTCue||TextTrackCue,I=0;I=16?_--:_++,navigator.userAgent.match(/Firefox\//)?a.line=I+1:a.line=I>7?I-2:I+1,a.align="left",a.position=Math.max(0,Math.min(100,100*(_/32))),g.addCue(a)}}var Yf={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},bv=function(v){var i=v;return Yf.hasOwnProperty(v)&&(i=Yf[v]),String.fromCharCode(i)},Pa=15,lu=100,yh={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Rh={17:2,18:4,21:6,22:8,23:10,19:13,20:15},bh={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Th={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Eh=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],Tv;(function(g){g[g.ERROR=0]="ERROR",g[g.TEXT=1]="TEXT",g[g.WARNING=2]="WARNING",g[g.INFO=2]="INFO",g[g.DEBUG=3]="DEBUG",g[g.DATA=3]="DATA"})(Tv||(Tv={}));var qt={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(v){this.time=v},log:function(v,i){var o=this.verboseFilter[v];this.verboseLevel>=o}},ri=function(v){for(var i=[],o=0;olu&&(qt.log("ERROR","Too large cursor position "+this.pos),this.pos=lu)},v.moveCursor=function(o){var t=this.pos+o;if(o>1)for(var a=this.pos+1;a=144&&this.backSpace();var t=bv(o);if(this.pos>=lu){qt.log("ERROR","Cannot insert "+o.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)},v.clearFromPos=function(o){var t;for(t=o;t0&&(o?a="["+t.join(" | ")+"]":a=t.join(` `)),a},v.getTextAndFormat=function(){return this.rows},g})(),bc=(function(){function g(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 jt,this.nonDisplayedMemory=new jt,this.lastOutputScreen=new jt,this.currRollUpRow=this.displayedMemory.rows[Pa-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}var v=g.prototype;return v.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},v.getHandler=function(){return this.outputFilter},v.setHandler=function(o){this.outputFilter=o},v.setPAC=function(o){this.writeScreen.setPAC(o)},v.setBkgData=function(o){this.writeScreen.setBkgData(o)},v.setMode=function(o){o!==this.mode&&(this.mode=o,qt.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)},v.insertChars=function(o){for(var t=0;t=46,t.italics)t.foreground="white";else{var a=Math.floor(o/2)-16,l=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=l[a]}qt.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},v.outputDataUpdate=function(o){o===void 0&&(o=!1);var t=qt.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))},v.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},g})(),Tc=(function(){function g(i,o,t){this.field=void 0,this.outputs=void 0,this.channels=void 0,this.currChNr=void 0,this.lastCmdA=void 0,this.lastCmdB=void 0,this.lastTime=void 0,this.dataCounters=void 0,this.field=i||1,this.outputs=[o,t],this.channels=[new bc(1,o),new bc(2,t)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}var v=g.prototype;return v.getHandler=function(o){return this.channels[o].getHandler()},v.setHandler=function(o,t){this.channels[o].setHandler(t)},v.addData=function(o,t){var a,l,_,R=!1;this.lastTime=o,qt.setTime(o);for(var b=0;b ("+ri([l,_])+")");if(a=this.parseCmd(l,_),a||(a=this.parseMidrow(l,_)),a||(a=this.parsePAC(l,_)),a||(a=this.parseBackgroundAttributes(l,_)),!a&&(R=this.parseChars(l,_),R))if(this.currChNr&&this.currChNr>=0){var I=this.channels[this.currChNr-1];I.insertChars(R)}else qt.log("WARNING","No channel found yet. TEXT-MODE?");a?this.dataCounters.cmd+=2:R?this.dataCounters.char+=2:(this.dataCounters.other+=2,qt.log("WARNING","Couldn't parse cleaned data "+ri([l,_])+" orig: "+ri([t[b],t[b+1]])))}},v.parseCmd=function(o,t){var a=null,l=(o===20||o===28)&&t>=32&&t<=47,_=(o===23||o===31)&&t>=33&&t<=35;if(!(l||_))return!1;if(o===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,qt.log("DEBUG","Repeated command ("+ri([o,t])+") is dropped"),!0;o===20||o===23?a=1:a=2;var R=this.channels[a-1];return o===20||o===28?t===32?R.ccRCL():t===33?R.ccBS():t===34?R.ccAOF():t===35?R.ccAON():t===36?R.ccDER():t===37?R.ccRU(2):t===38?R.ccRU(3):t===39?R.ccRU(4):t===40?R.ccFON():t===41?R.ccRDC():t===42?R.ccTR():t===43?R.ccRTD():t===44?R.ccEDM():t===45?R.ccCR():t===46?R.ccENM():t===47&&R.ccEOC():R.ccTO(t-32),this.lastCmdA=o,this.lastCmdB=t,this.currChNr=a,!0},v.parseMidrow=function(o,t){var a=null;if((o===17||o===25)&&t>=32&&t<=47){if(o===17?a=1:a=2,a!==this.currChNr)return qt.log("ERROR","Mismatch channel in midrow parsing"),!1;var l=this.channels[a-1];return l.ccMIDROW(t),qt.log("DEBUG","MIDROW ("+ri([o,t])+")"),!0}return!1},v.parsePAC=function(o,t){var a=null,l=null,_=(o>=17&&o<=23||o>=25&&o<=31)&&t>=64&&t<=127,R=(o===16||o===24)&&t>=64&&t<=95;if(!(_||R))return!1;if(o===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;a=o<=23?1:2,t>=64&&t<=95?l=a===1?yh[o]:bh[o]:l=a===1?Rh[o]:Th[o];var b=this.interpretPAC(l,t),I=this.channels[a-1];return I.setPAC(b),this.lastCmdA=o,this.lastCmdB=t,this.currChNr=a,!0},v.interpretPAC=function(o,t){var a=t,l={color:null,italics:!1,indent:null,underline:!1,row:o};return t>95?a=t-96:a=t-64,l.underline=(a&1)===1,a<=13?l.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(a/2)]:a<=15?(l.italics=!0,l.color="white"):l.indent=Math.floor((a-16)/2)*4,l},v.parseChars=function(o,t){var a=null,l=null,_=null;if(o>=25?(a=2,_=o-8):(a=1,_=o),_>=17&&_<=19){var R=t;_===17?R=t+80:_===18?R=t+112:R=t+144,qt.log("INFO","Special char '"+bv(R)+"' in channel "+a),l=[R]}else o>=32&&o<=127&&(l=t===0?[o]:[o,t]);if(l){var b=ri(l);qt.log("DEBUG","Char codes = "+b.join(",")),this.lastCmdA=null,this.lastCmdB=null}return l},v.parseBackgroundAttributes=function(o,t){var a,l,_,R,b=(o===16||o===24)&&t>=32&&t<=47,I=(o===23||o===31)&&t>=45&&t<=47;return b||I?(a={},o===16||o===24?(l=Math.floor((t-32)/2),a.background=Eh[l],t%2===1&&(a.background=a.background+"_semi")):t===45?a.background="transparent":(a.foreground="black",t===47&&(a.underline=!0)),_=o<24?1:2,R=this.channels[_-1],R.setBkgData(a),this.lastCmdA=null,this.lastCmdB=null,!0):!1},v.reset=function(){for(var o=0;oo)&&(this.startTime=o),this.endTime=t,this.screen=a,this.timelineController.createCaptionsTrack(this.trackName)},g})(),Xf=function(v,i,o){return v.substr(o||0,i.length)===i},Sh=function(v){var i=parseInt(v.substr(-3)),o=parseInt(v.substr(-6,2)),t=parseInt(v.substr(-9,2)),a=v.length>9?parseInt(v.substr(0,v.indexOf(":"))):0;if(!Object(E.isFiniteNumber)(i)||!Object(E.isFiniteNumber)(o)||!Object(E.isFiniteNumber)(t)||!Object(E.isFiniteNumber)(a))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+v);return i+=1e3*o,i+=60*1e3*t,i+=3600*1e3*a,i},Ec=function(v){for(var i=5381,o=v.length;o;)i=i*33^v.charCodeAt(--o);return(i>>>0).toString()},Mh=function(v,i,o){var t=v[i],a=v[t.prevCC];if(!a||!a.new&&t.new){v.ccOffset=v.presentationOffset=t.start,t.new=!1;return}for(;a&&a.new;)v.ccOffset+=t.start-a.start,t.new=!1,t=a,a=v[t.prevCC];v.presentationOffset=o},Ih={parse:function(v,i,o,t,a,l){var _=/\r\n|\n\r|\n|\r/g,R=Object(yc.utf8ArrayToStr)(new Uint8Array(v)).trim().replace(_,` `).split(` `),b="00:00.000",I=0,P=0,N=0,j=[],ue,pe=!0,Se=!1,ft=new gh;ft.oncue=function(rt){var it=o[t],Rt=o.ccOffset;it&&it.new&&(P!==void 0?Rt=o.ccOffset=it.start:Mh(o,t,N)),N&&(Rt=N-o.presentationOffset),Se&&(rt.startTime+=Rt-P,rt.endTime+=Rt-P),rt.id=Ec(rt.startTime.toString())+Ec(rt.endTime.toString())+Ec(rt.text),rt.text=decodeURIComponent(encodeURIComponent(rt.text)),rt.endTime>0&&j.push(rt)},ft.onparsingerror=function(rt){ue=rt},ft.onflush=function(){if(ue&&l){l(ue);return}a(j)},R.forEach(function(rt){if(pe)if(Xf(rt,"X-TIMESTAMP-MAP=")){pe=!1,Se=!0,rt.substr(16).split(",").forEach(function(it){Xf(it,"LOCAL:")?b=it.substr(6):Xf(it,"MPEGTS:")&&(I=parseInt(it.substr(7)))});try{i+(o[t].start*9e4||0)<0&&(i+=8589934592),I-=i,P=Sh(b)/1e3,N=I/9e4}catch(it){Se=!1,ue=it}return}else rt===""&&(pe=!1);ft.parse(rt+` `)}),ft.flush()}},Ah=Ih;function wv(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function Lh(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var xh=(function(g){Lh(v,g);function v(o){var t;if(t=g.call(this,o,d.default.MEDIA_ATTACHING,d.default.MEDIA_DETACHING,d.default.FRAG_PARSING_USERDATA,d.default.FRAG_DECRYPTED,d.default.MANIFEST_LOADING,d.default.MANIFEST_LOADED,d.default.FRAG_LOADED,d.default.INIT_PTS_FOUND)||this,t.media=null,t.config=void 0,t.enabled=!0,t.Cues=void 0,t.textTracks=[],t.tracks=[],t.initPTS=[],t.unparsedVttFrags=[],t.cueRanges=[],t.captionsTracks={},t.captionsProperties=void 0,t.cea608Parser=void 0,t.lastSn=-1,t.prevCC=-1,t.vttCCs=null,t.hls=o,t.config=o.config,t.Cues=o.config.cueHandler,t.captionsProperties={textTrack1:{label:t.config.captionsTextTrack1Label,languageCode:t.config.captionsTextTrack1LanguageCode},textTrack2:{label:t.config.captionsTextTrack2Label,languageCode:t.config.captionsTextTrack2LanguageCode}},t.config.enableCEA708Captions){var a=new Ev(wv(t),"textTrack1"),l=new Ev(wv(t),"textTrack2");t.cea608Parser=new Ch(0,a,l)}return t}var i=v.prototype;return i.addCues=function(t,a,l,_){for(var R=this.cueRanges,b=!1,I=R.length;I--;){var P=R[I],N=Nh(P[0],P[1],a,l);if(N>=0&&(P[0]=Math.min(P[0],a),P[1]=Math.max(P[1],l),b=!0,N/(l-a)>.5))return}b||R.push([a,l]),this.Cues.newCue(this.captionsTracks[t],a,l,_)},i.onInitPtsFound=function(t){var a=this,l=t.frag,_=t.id,R=t.initPTS,b=this.unparsedVttFrags;_==="main"&&(this.initPTS[l.cc]=R),b.length&&(this.unparsedVttFrags=[],b.forEach(function(I){a.onFragLoaded(I)}))},i.getExistingTrack=function(t){var a=this.media;if(a)for(var l=0;l=b.length||l!==R||!I||this.stopped){this._clearReloadTimer();return}if(h.logger.log("subtitle track "+l+" loaded"),_.live){var P=Cn(I.details,_,t.stats.trequest);h.logger.log("Reloading live subtitle playlist in "+P+"ms"),this.timer=setTimeout(function(){a._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 t=this.trackId,a=this.tracks,l=this.hls,_=a[t];t<0||!_||_.details&&!_.details.live||(h.logger.log("Loading subtitle track "+t),l.trigger(d.default.SUBTITLE_TRACK_LOADING,{url:_.url,id:t}))},i._toggleTrackModes=function(t){var a=this.media,l=this.subtitleDisplay,_=this.trackId;if(a){var R=f(a.textTracks);if(t===-1)[].slice.call(R).forEach(function(P){P.mode="disabled"});else{var b=R[_];b&&(b.mode="disabled")}var I=R[t];I&&(I.mode=l?"showing":"hidden")}},i._setSubtitleTrackInternal=function(t){var a=this.hls,l=this.tracks;!Object(E.isFiniteNumber)(t)||t<-1||t>=l.length||(this.trackId=t,h.logger.log("Switching to subtitle track "+t),a.trigger(d.default.SUBTITLE_TRACK_SWITCH,{id:t}),this._loadCurrentTrack())},i._onTextTracksChanged=function(){if(this.media){for(var t=-1,a=f(this.media.textTracks),l=0;l=_[I].start&&b<=_[I].end){R=_[I];break}var P=a.start+a.duration;R?R.end=P:(R={start:b,end:P},_.push(R))}}},i.onMediaAttached=function(t){var a=t.media;this.media=a,a.addEventListener("seeking",this._onMediaSeeking),this.state=re.IDLE},i.onMediaDetaching=function(){var t=this;this.media&&(this.media.removeEventListener("seeking",this._onMediaSeeking),this.fragmentTracker.removeAllFragments(),this.currentTrackId=-1,this.tracks.forEach(function(a){t.tracksBuffered[a.id]=[]}),this.media=null,this.state=re.STOPPED)},i.onError=function(t){var a=t.frag;!a||a.type!=="subtitle"||(this.state=re.IDLE)},i.onSubtitleTracksUpdated=function(t){var a=this;h.logger.log("subtitle tracks updated"),this.tracksBuffered=[],this.tracks=t.subtitleTracks,this.tracks.forEach(function(l){a.tracksBuffered[l.id]=[]})},i.onSubtitleTrackSwitch=function(t){if(this.currentTrackId=t.id,!this.tracks||!this.tracks.length||this.currentTrackId===-1){this.clearInterval();return}var a=this.tracks[this.currentTrackId];a&&a.details&&this.setInterval(mt)},i.onSubtitleTrackLoaded=function(t){var a=t.id,l=t.details,_=this.currentTrackId,R=this.tracks,b=R[_];a>=R.length||a!==_||!b||(l.live&&Ve(b.details,l,this.lastAVStart),b.details=l,this.setInterval(mt))},i.onKeyLoaded=function(){this.state===re.KEY_LOADING&&(this.state=re.IDLE)},i.onFragLoaded=function(t){var a=this.fragCurrent,l=t.frag.decryptdata,_=t.frag,R=this.hls;if(this.state===re.FRAG_LOADING&&a&&t.frag.type==="subtitle"&&a.sn===t.frag.sn&&t.payload.byteLength>0&&l&&l.key&&l.method==="AES-128"){var b=Ie.now();this.decrypter.decrypt(t.payload,l.key.buffer,l.iv.buffer,function(I){var P=Ie.now();R.trigger(d.default.FRAG_DECRYPTED,{frag:_,payload:I,stats:{tstart:b,tdecrypt:P}})})}},i.onLevelUpdated=function(t){var a=t.details,l=a.fragments;this.lastAVStart=l.length?l[0].start:0},i.doTick=function(){if(!this.media){this.state=re.IDLE;return}switch(this.state){case re.IDLE:{var t=this.config,a=this.currentTrackId,l=this.fragmentTracker,_=this.media,R=this.tracks;if(!R||!R[a]||!R[a].details)break;var b=t.maxBufferHole,I=t.maxFragLookUpTolerance,P=Math.min(t.maxBufferLength,t.maxMaxBufferLength),N=x.bufferedInfo(this._getBuffered(),_.currentTime,b),j=N.end,ue=N.len,pe=R[a].details,Se=pe.fragments,ft=Se.length,rt=Se[ft-1].start+Se[ft-1].duration;if(ue>P)return;var it,Rt=this.fragPrevious;jSv){this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.KEY_SYSTEM_ERROR,details:p.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var R=Sv-this._requestLicenseFailureCount+1;h.logger.warn("Retrying license request, "+R+" attempts left"),this._requestLicense(l,_)}break}},i._generateLicenseRequestChallenge=function(t,a){if(t.mediaKeySystemDomain===Un.WIDEVINE)return a;throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},i._requestLicense=function(t,a){h.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){h.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.KEY_SYSTEM_ERROR,details:p.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var _=this.getLicenseServerUrl(l.mediaKeySystemDomain),R=this._createLicenseXhr(_,t,a);h.logger.log("Sending license request to URL: "+_);var b=this._generateLicenseRequestChallenge(l,t);R.send(b)}catch(I){h.logger.error("Failure requesting DRM license: "+I),this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.KEY_SYSTEM_ERROR,details:p.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},i.onMediaAttached=function(t){if(this._emeEnabled){var a=t.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)}},i.onMediaDetached=function(){this._media&&(this._media.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null)},i.onManifestParsed=function(t){if(this._emeEnabled){var a=t.levels.map(function(_){return _.audioCodec}),l=t.levels.map(function(_){return _.videoCodec});this._attemptKeySystemAccess(Un.WIDEVINE,a,l)}},Uh(v,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),v})(w),$h=Iv;function Wh(g){for(var v=1;va)return _}return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,a=this.autoLevelCapping,l;return a===-1&&t&&t.length?l=t.length-1:l=a,l}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var a=this.audioTrackController;a&&(a.audioTrack=t)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var a=this.subtitleTrackController;a&&(a.subtitleTrack=t)}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return t?t.subtitleDisplay:!1},set:function(t){var a=this.subtitleTrackController;a&&(a.subtitleDisplay=t)}}]),v})(K);Ov.defaultConfig=void 0}),"./src/polyfills/number-isFinite.js":(function(e,n,r){"use strict";r.r(n),r.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(e,n,r){"use strict";r.r(n),r.d(n,"getSelfScope",function(){return u});function u(){return typeof window>"u"?self:window}}),"./src/utils/logger.js":(function(e,n,r){"use strict";r.r(n),r.d(n,"enableLogs",function(){return w}),r.d(n,"logger",function(){return L});var u=r("./src/utils/get-self-scope.js");function c(){}var p={trace:c,debug:c,log:c,warn:c,info:c,error:c},E=p;function d(C,M){return M="["+C+"] > "+M,M}var h=Object(u.getSelfScope)();function O(C){var M=h.console[C];return M?function(){for(var k=arguments.length,B=new Array(k),Q=0;Q1?M-1:0),B=1;B{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.Direction=void 0;var Ik;(function(e){e.Right="to right",e.Left="to left",e.Down="to bottom",e.Up="to top"})(Ik=Xd.Direction||(Xd.Direction={}))});var pD=cu(Mt=>{"use strict";var Zd=Mt&&Mt.__spreadArray||function(e,n,r){if(r||arguments.length===2)for(var u=0,c=n.length,p;ue)return h;if(O&&Ou)return u;if(e=r)throw new RangeError("min (".concat(n,") is equal/bigger than max (").concat(r,")"));if(er)throw new RangeError("value (".concat(e,") is bigger than max (").concat(r,")"))}Mt.checkBoundaries=Ok;function Uk(e,n,r){return er?r:e}Mt.checkValuesAgainstBoundaries=Uk;function kk(e){if(!(e.length<2)&&!e.slice(1).every(function(n,r){return e[r]<=n}))throw new RangeError("values={[".concat(e,"]} needs to be sorted when allowOverlap={false}"))}Mt.checkInitialOverlap=kk;function $k(e){var n=window.getComputedStyle(e);return{top:parseInt(n["margin-top"],10),bottom:parseInt(n["margin-bottom"],10),left:parseInt(n["margin-left"],10),right:parseInt(n["margin-right"],10)}}Mt.getMargin=$k;function Wk(e){var n=window.getComputedStyle(e);return{top:parseInt(n["padding-top"],10)+parseInt(n["border-top-width"],10),bottom:parseInt(n["padding-bottom"],10)+parseInt(n["border-bottom-width"],10),left:parseInt(n["padding-left"],10)+parseInt(n["border-left-width"],10),right:parseInt(n["padding-right"],10)+parseInt(n["border-right-width"],10)}}Mt.getPaddingAndBorder=Wk;function Hk(e,n,r){var u=r?-1:1;e.forEach(function(c,p){return yS(c,u*n[p].x,n[p].y)})}Mt.translateThumbs=Hk;function Bk(e,n,r,u){for(var c=0,p=gS(e[0],n,r,u),E=1;EE?h:E},e.getBoundingClientRect().width));return p},Vk=function(e,n,r,u,c,p,E){E===void 0&&(E=function(O){return O});var d=[],h=function(O){var y=hS(r[O],u[O],c,p,E),w=n[O].x;n.forEach(function(L,C){var M=L.x,k=hS(r[C],u[C],c,p,E);O!==C&&(w>=M&&w<=M+k||w+y>=M&&w+y<=M+k)&&(d.includes(C)||(d.push(O),d.push(C),d=Zd(Zd([],d,!0),[O,C],!1),h(C)))})};return h(e),Array.from(new Set(d.sort()))},Kk=function(e,n,r,u,c,p){u===void 0&&(u=.1),c===void 0&&(c=" - "),p===void 0&&(p=function(C){return C});var E=(0,Mt.getStepDecimals)(u),d=(0,vD.useState)({}),h=d[0],O=d[1],y=(0,vD.useState)(p(n[r].toFixed(E))),w=y[0],L=y[1];return(0,vD.useEffect)(function(){if(e){var C=e.getThumbs();if(C.length<1)return;var M={},k=e.getOffsets(),B=Vk(r,k,C,n,c,E,p),Q=p(n[r].toFixed(E));if(B.length){var z=B.reduce(function(_e,nt,ot,ct){return _e.length?Zd(Zd([],_e,!0),[k[ct[ot]].x],!1):[k[ct[ot]].x]},[]);if(Math.min.apply(Math,z)===k[r].x){var ee=[];B.forEach(function(_e){ee.push(n[_e].toFixed(E))}),Q=Array.from(new Set(ee.sort(function(_e,nt){return parseFloat(_e)-parseFloat(nt)}))).map(p).join(c);var ae=Math.min.apply(Math,z),ne=Math.max.apply(Math,z),me=C[B[z.indexOf(ne)]].getBoundingClientRect().width;M.left="".concat(Math.abs(ae-(ne+me))/2,"px"),M.transform="translate(-50%, 0)"}else M.visibility="hidden"}L(Q),O(M)}},[e,n]),[w,h]};Mt.useThumbOverlap=Kk;function gS(e,n,r,u){var c=e.getBoundingClientRect(),p=c.left,E=c.top,d=c.width,h=c.height;return DS(u)?Math.abs(r-(E+h/2)):Math.abs(n-(p+d/2))}});var bS=cu(yo=>{"use strict";var Yk=yo&&yo.__extends||(function(){var e=function(n,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(u[p]=c[p])},e(n,r)};return function(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(n,r);function u(){this.constructor=n}n.prototype=r===null?Object.create(r):(u.prototype=r.prototype,new u)}})(),Qk=yo&&yo.__createBinding||(Object.create?(function(e,n,r,u){u===void 0&&(u=r);var c=Object.getOwnPropertyDescriptor(n,r);(!c||("get"in c?!n.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(e,u,c)}):(function(e,n,r,u){u===void 0&&(u=r),e[u]=n[r]})),Xk=yo&&yo.__setModuleDefault||(Object.create?(function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}):function(e,n){e.default=n}),Zk=yo&&yo.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Qk(n,e,r);return Xk(n,e),n},RS=yo&&yo.__spreadArray||function(e,n,r){if(r||arguments.length===2)for(var u=0,c=n.length,p;u1&&u.props.draggableTrack){if(u.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.contains(c.target)}))return;u.setState({draggedTrackPos:[c.clientX,c.clientY]},function(){return u.onMove(c.clientX,c.clientY)})}else{var E=(0,gn.getClosestThumbIndex)(u.thumbRefs.map(function(d){return d.current}),c.clientX,c.clientY,u.props.direction);(p=u.thumbRefs[E].current)===null||p===void 0||p.focus(),u.setState({draggedThumbIndex:E},function(){return u.onMove(c.clientX,c.clientY)})}},u.onResize=function(){(0,gn.translateThumbs)(u.getThumbs(),u.getOffsets(),u.props.rtl),u.calculateMarkOffsets()},u.onTouchStartTrack=function(c){var p;if(c.persist(),u.addTouchEvents(c.nativeEvent),u.props.values.length>1&&u.props.draggableTrack){if(u.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.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 E=(0,gn.getClosestThumbIndex)(u.thumbRefs.map(function(d){return d.current}),c.touches[0].clientX,c.touches[0].clientY,u.props.direction);(p=u.thumbRefs[E].current)===null||p===void 0||p.focus(),u.setState({draggedThumbIndex:E},function(){return u.onMove(c.touches[0].clientX,c.touches[0].clientY)})}},u.onMouseOrTouchStart=function(c){if(!u.props.disabled){var p=(0,gn.isTouchEvent)(c);if(!(!p&&c.button!==0)){var E=u.getTargetIndex(c);E!==-1&&(p?u.addTouchEvents(c):u.addMouseEvents(c),u.setState({draggedThumbIndex:E,thumbZIndexes:u.state.thumbZIndexes.map(function(d,h){return h===E?Math.max.apply(Math,u.state.thumbZIndexes):d<=u.state.thumbZIndexes[E]?d:d-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 p=u.props,E=p.values,d=p.onChange,h=p.step,O=p.rtl,y=p.direction,w=u.state.isChanged,L=u.getTargetIndex(c.nativeEvent),C=O||y===xr.Direction.Left||y===xr.Direction.Down?-1:1;L!==-1&&(e$.includes(c.key)?(c.preventDefault(),u.setState({draggedThumbIndex:L,isChanged:!0}),d((0,gn.replaceAt)(E,L,u.normalizeValue(E[L]+C*(c.key==="PageUp"?h*10:h),L)))):t$.includes(c.key)?(c.preventDefault(),u.setState({draggedThumbIndex:L,isChanged:!0}),d((0,gn.replaceAt)(E,L,u.normalizeValue(E[L]-C*(c.key==="PageDown"?h*10:h),L)))):c.key==="Tab"?u.setState({draggedThumbIndex:-1},function(){w&&u.fireOnFinalChange()}):w&&u.fireOnFinalChange())},u.onKeyUp=function(c){var p=u.state.isChanged;u.setState({draggedThumbIndex:-1},function(){p&&u.fireOnFinalChange()})},u.onMove=function(c,p){var E=u.state,d=E.draggedThumbIndex,h=E.draggedTrackPos,O=u.props,y=O.direction,w=O.min,L=O.max,C=O.onChange,M=O.values,k=O.step,B=O.rtl;if(d===-1&&h[0]===-1&&h[1]===-1)return null;var Q=u.trackRef.current;if(!Q)return null;var z=Q.getBoundingClientRect(),ee=(0,gn.isVertical)(y)?z.height:z.width;if(h[0]!==-1&&h[1]!==-1){var ae=c-h[0],ne=p-h[1],me=0;switch(y){case xr.Direction.Right:case xr.Direction.Left:me=ae/ee*(L-w);break;case xr.Direction.Down:case xr.Direction.Up:me=ne/ee*(L-w);break;default:(0,gn.assertUnreachable)(y)}if(B&&(me*=-1),Math.abs(me)>=k/2){for(var _e=0;_eL?me=L-M[_e]:nt=k/2&&C((0,gn.replaceAt)(M,d,u.normalizeValue(ct,d)))}},u.normalizeValue=function(c,p){var E=u.props,d=E.min,h=E.max,O=E.step,y=E.allowOverlap,w=E.values;return(0,gn.normalizeValue)(c,p,d,h,O,y,w)},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,p=c.onFinalChange,E=c.values;p&&p(E)},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 p=0;p-1?"grabbing":this.props.draggableTrack?(0,gn.isVertical)(this.props.direction)?"ns-resize":"ew-resize":h.length===1&&!L?"pointer":"inherit"},onMouseDown:L?gn.voidFn:this.onMouseDownTrack,onTouchStart:L?gn.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:L,children:RS(RS([],B.map(function(Q,z,ee){return d({props:{style:r.props.direction===xr.Direction.Left||r.props.direction===xr.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:r.markRefs[z]},index:z})}),!0),h.map(function(Q,z){var ee=r.state.draggedThumbIndex===z;return p({index:z,value:Q,isDragged:ee,props:{style:{position:"absolute",zIndex:k[z],cursor:L?"inherit":ee?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:z,tabIndex:L?void 0:0,"aria-valuemax":w?y:h[z+1]||y,"aria-valuemin":w?O:h[z-1]||O,"aria-valuenow":Q,draggable:!1,ref:r.thumbRefs[z],role:"slider",onKeyDown:L?gn.voidFn:r.onKeyDown,onKeyUp:L?gn.voidFn:r.onKeyUp}})}),!0)})},n.defaultProps={step:1,direction:xr.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},n})(x_.Component);yo.default=n$});var TS=cu(ma=>{"use strict";var r$=ma&&ma.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ma,"__esModule",{value:!0});ma.checkValuesAgainstBoundaries=ma.relativeValue=ma.useThumbOverlap=ma.Direction=ma.getTrackBackground=ma.Range=void 0;var a$=r$(bS());ma.Range=a$.default;var N_=pD();Object.defineProperty(ma,"getTrackBackground",{enumerable:!0,get:function(){return N_.getTrackBackground}});Object.defineProperty(ma,"useThumbOverlap",{enumerable:!0,get:function(){return N_.useThumbOverlap}});Object.defineProperty(ma,"relativeValue",{enumerable:!0,get:function(){return N_.relativeValue}});Object.defineProperty(ma,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return N_.checkValuesAgainstBoundaries}});var o$=L_();Object.defineProperty(ma,"Direction",{enumerable:!0,get:function(){return o$.Direction}})});var VG={};kD(VG,{boot:()=>zG});var as={compose:function(e){return function(n){return function(r){return e(n(r))}}}};var ke=function(e){return e.identity},Be={identity:function(e){return e},Semigroupoid0:function(){return as}};var lt=!0;var us=function(e){return function(n){return function(r){return function(u){return e(n(r))(n(u))}}}},en=function(e){return function(n){return function(r){return e(r)(n)}}},Ze=function(e){return function(n){return e}};var WD=function(e){return function(n){for(var r=n.length,u=new Array(r),c=0;c="0"&&e[c]<="9"?"\\&":"";return"\\"+r.charCodeAt(0).toString(10)+p})+'"'};var ir={show:ly};var En={show:iy};var De=function(e){return e.show};var Nt=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),_t=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})();var mn=(function(){function e(){}return e.value=new e,e})(),ss=function(e){return e};var Lc=function(e){return e.to};var ds=function(e){return e.from};var D3=ke(Be),G=(function(){function e(){}return e.value=new e,e})(),H=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})();var Ht=function(e){return function(n){return function(r){if(r instanceof G)return e;if(r instanceof H)return n(r.value0);throw new Error("Failed pattern match at Data.Maybe (line 237, column 1 - line 237, column 51): "+[e.constructor.name,n.constructor.name,r.constructor.name])}}},Io=Ht(!0)(Ze(!1)),ci=Ht(!1)(Ze(!0));var Oe={map:function(e){return function(n){return n instanceof H?new H(e(n.value0)):G.value}}},y3=V(Oe);var _n=function(e){return Ht(e)(D3)},Kn=function(){return function(e){if(e instanceof H)return e.value0;throw new Error("Failed pattern match at Data.Maybe (line 288, column 1 - line 288, column 46): "+[e.constructor.name])}};var fu=function(e){var n=He(e);return{eq:function(r){return function(u){return r instanceof G&&u instanceof G?!0:r instanceof H&&u instanceof H?n(r.value0)(u.value0):!1}}}};var ka={apply:function(e){return function(n){if(e instanceof H)return y3(e.value0)(n);if(e instanceof G)return G.value;throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 69, column 30): "+[e.constructor.name,n.constructor.name])}},Functor0:function(){return Oe}};var nn={bind:function(e){return function(n){if(e instanceof H)return n(e.value0);if(e instanceof G)return G.value;throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 127, column 28): "+[e.constructor.name,n.constructor.name])}},Apply0:function(){return ka}};var Yr=(function(){return{pure:H.create,Apply0:function(){return ka}}})();var qv={alt:function(e){return function(n){return e instanceof G?n:e}},Functor0:function(){return Oe}},R3=(function(){return{empty:G.value,Alt0:function(){return qv}}})(),Xh={Applicative0:function(){return Yr},Plus1:function(){return R3}};var Te=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),Ce=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})();var Iu=function(e){return Ht(new Te(e))(Ce.create)};var lr={map:function(e){return function(n){if(n instanceof Te)return new Te(n.value0);if(n instanceof Ce)return new Ce(e(n.value0));throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): "+[n.constructor.name])}}},T3=V(lr);var qn=function(e){return function(n){return function(r){if(r instanceof Te)return e(r.value0);if(r instanceof Ce)return n(r.value0);throw new Error("Failed pattern match at Data.Either (line 208, column 1 - line 208, column 64): "+[e.constructor.name,n.constructor.name,r.constructor.name])}}},xc=(function(){return qn(Ze(G.value))(H.create)})();var jv={apply:function(e){return function(n){if(e instanceof Te)return new Te(e.value0);if(e instanceof Ce)return T3(e.value0)(n);throw new Error("Failed pattern match at Data.Either (line 70, column 1 - line 72, column 30): "+[e.constructor.name,n.constructor.name])}},Functor0:function(){return lr}};var eo={bind:qn(function(e){return function(n){return new Te(e)}})(function(e){return function(n){return n(e)}}),Apply0:function(){return jv}};var su=function(e){return e};var fi={map:function(e){return function(n){return e(n)}}};var cy={apply:function(e){return function(n){return e(n)}},Functor0:function(){return fi}},E3={bind:function(e){return function(n){return n(e)}},Apply0:function(){return cy}},zv={pure:su,Apply0:function(){return cy}},hr={Applicative0:function(){return zv},Bind1:function(){return E3}};var Lu={mempty:"",Semigroup0:function(){return qh}};var Yt=function(e){return e.mempty};var dy=function(e){return function(){return e}},vy=function(e){return function(n){return function(){return n(e())()}}};var eg=function(e){return function(n){return function(){for(var r=0,u=e.length;r=0;p--)u=e(r[p])(u);return u}}},Ly=function(e){return function(n){return function(r){for(var u=n,c=r.length,p=0;p=0&&e<100&&d.setUTCFullYear(e),d.getTime()};function aR(e){return function(n){return function(r){return function(u){var c=f8(u.year,u.month-1,u.day,u.hour,u.minute,u.second,u.millisecond),p=new Date(c+r);return isNaN(p.getTime())?n:e({year:p.getUTCFullYear(),month:p.getUTCMonth()+1,day:p.getUTCDate(),hour:p.getUTCHours(),minute:p.getUTCMinutes(),second:p.getUTCSeconds(),millisecond:p.getUTCMilliseconds()})}}}}var d8=function(e,n,r){var u=new Date(Date.UTC(e,n,r));return e>=0&&e<100&&u.setUTCFullYear(e),u};function oR(e,n,r,u){var c=d8(n,r-1,u);return e(c.getUTCFullYear())(c.getUTCMonth()+1)(c.getUTCDate())}function Hi(e){return e.charCodeAt(0)}function uR(e){return String.fromCharCode(e)}var _p=function(e){var n=ie(e.Applicative0()),r=ca(e.Plus1());return function(u){if(u)return n(void 0);if(!u)return r;throw new Error("Failed pattern match at Control.Alternative (line 48, column 1 - line 48, column 54): "+[u.constructor.name])}};var lR=pn(Ac),cR=Pn(Ac);var St=function(e){return e.toEnum};var Bt=function(e){return e.fromEnum};var Cs=function(e){return function(n){return function(r){return e(n(r)+1|0)}}},Ss=function(e){return function(n){return function(r){return e(n(r)-1|0)}}};var _g=function(e){return e>=Hi(lR)&&e<=Hi(cR)?new H(uR(e)):G.value},m8={succ:Cs(_g)(Hi),pred:Ss(_g)(Hi),Ord0:function(){return Bv}};var Ms=(function(){return{cardinality:Hi(cR)-Hi(lR)|0,toEnum:_g,fromEnum:Hi,Bounded0:function(){return Ac},Enum1:function(){return m8}}})();var Dg=function(e,n,r){var u=0,c;return function(p){if(u===2)return c;if(u===1)throw new ReferenceError(e+" was needed before it finished initializing (module "+n+", line "+p+")",n,p);return u=1,c=r(),u=2,c}};var $a=(function(){function e(){}return e.value=new e,e})(),ro=(function(){function e(){}return e.value=new e,e})(),ao=(function(){function e(){}return e.value=new e,e})(),oo=(function(){function e(){}return e.value=new e,e})(),uo=(function(){function e(){}return e.value=new e,e})(),io=(function(){function e(){}return e.value=new e,e})(),lo=(function(){function e(){}return e.value=new e,e})(),co=(function(){function e(){}return e.value=new e,e})(),fo=(function(){function e(){}return e.value=new e,e})(),so=(function(){function e(){}return e.value=new e,e})(),vo=(function(){function e(){}return e.value=new e,e})(),Uo=(function(){function e(){}return e.value=new e,e})();var hp=vn,gp=vn,fR=ia;var yg={eq:function(e){return function(n){return e instanceof $a&&n instanceof $a||e instanceof ro&&n instanceof ro||e instanceof ao&&n instanceof ao||e instanceof oo&&n instanceof oo||e instanceof uo&&n instanceof uo||e instanceof io&&n instanceof io||e instanceof lo&&n instanceof lo||e instanceof co&&n instanceof co||e instanceof fo&&n instanceof fo||e instanceof so&&n instanceof so||e instanceof vo&&n instanceof vo||e instanceof Uo&&n instanceof Uo}}},Dp={compare:function(e){return function(n){if(e instanceof $a&&n instanceof $a)return vt.value;if(e instanceof $a)return xe.value;if(n instanceof $a)return Ae.value;if(e instanceof ro&&n instanceof ro)return vt.value;if(e instanceof ro)return xe.value;if(n instanceof ro)return Ae.value;if(e instanceof ao&&n instanceof ao)return vt.value;if(e instanceof ao)return xe.value;if(n instanceof ao)return Ae.value;if(e instanceof oo&&n instanceof oo)return vt.value;if(e instanceof oo)return xe.value;if(n instanceof oo)return Ae.value;if(e instanceof uo&&n instanceof uo)return vt.value;if(e instanceof uo)return xe.value;if(n instanceof uo)return Ae.value;if(e instanceof io&&n instanceof io)return vt.value;if(e instanceof io)return xe.value;if(n instanceof io)return Ae.value;if(e instanceof lo&&n instanceof lo)return vt.value;if(e instanceof lo)return xe.value;if(n instanceof lo)return Ae.value;if(e instanceof co&&n instanceof co)return vt.value;if(e instanceof co)return xe.value;if(n instanceof co)return Ae.value;if(e instanceof fo&&n instanceof fo)return vt.value;if(e instanceof fo)return xe.value;if(n instanceof fo)return Ae.value;if(e instanceof so&&n instanceof so)return vt.value;if(e instanceof so)return xe.value;if(n instanceof so)return Ae.value;if(e instanceof vo&&n instanceof vo)return vt.value;if(e instanceof vo)return xe.value;if(n instanceof vo)return Ae.value;if(e instanceof Uo&&n instanceof Uo)return vt.value;throw new Error("Failed pattern match at Data.Date.Component (line 0, column 0 - line 0, column 0): "+[e.constructor.name,n.constructor.name])}},Eq0:function(){return yg}},sR=ia,yp=(function(){return{bottom:-271820,top:275759,Ord0:function(){return hp}}})();var Rp=(function(){return{bottom:$a.value,top:Uo.value,Ord0:function(){return Dp}}})(),Wa={cardinality:547580,toEnum:function(e){if(e>=-271820&&e<=275759)return new H(e);if(lt)return G.value;throw new Error("Failed pattern match at Data.Date.Component (line 35, column 1 - line 40, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return yp},Enum1:function(){return _8(0)}},_8=Dg("enumYear","Data.Date.Component",function(){return{succ:(function(){var e=St(Wa),n=Bt(Wa);return function(r){return e((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var e=St(Wa),n=Bt(Wa);return function(r){return e((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return hp}}});var Jr={cardinality:12,toEnum:function(e){return e===1?new H($a.value):e===2?new H(ro.value):e===3?new H(ao.value):e===4?new H(oo.value):e===5?new H(uo.value):e===6?new H(io.value):e===7?new H(lo.value):e===8?new H(co.value):e===9?new H(fo.value):e===10?new H(so.value):e===11?new H(vo.value):e===12?new H(Uo.value):G.value},fromEnum:function(e){if(e instanceof $a)return 1;if(e instanceof ro)return 2;if(e instanceof ao)return 3;if(e instanceof oo)return 4;if(e instanceof uo)return 5;if(e instanceof io)return 6;if(e instanceof lo)return 7;if(e instanceof co)return 8;if(e instanceof fo)return 9;if(e instanceof so)return 10;if(e instanceof vo)return 11;if(e instanceof Uo)return 12;throw new Error("Failed pattern match at Data.Date.Component (line 87, column 14 - line 99, column 19): "+[e.constructor.name])},Bounded0:function(){return Rp},Enum1:function(){return h8(0)}},h8=Dg("enumMonth","Data.Date.Component",function(){return{succ:(function(){var e=St(Jr),n=Bt(Jr);return function(r){return e((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var e=St(Jr),n=Bt(Jr);return function(r){return e((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return Dp}}});var Is={bottom:1,top:31,Ord0:function(){return gp}},po={cardinality:31,toEnum:function(e){if(e>=1&&e<=31)return new H(e);if(lt)return G.value;throw new Error("Failed pattern match at Data.Date.Component (line 133, column 1 - line 138, column 23): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return Is},Enum1:function(){return g8(0)}},g8=Dg("enumDay","Data.Date.Component",function(){return{succ:(function(){var e=St(po),n=Bt(po);return function(r){return e((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var e=St(po),n=Bt(po);return function(r){return e((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return gp}}});var dR=function(e){return function(n){return function(r){return(r|0)===r?e(r):n}}};var Ji=(function(){return dR(H.create)(G.value)})();var _R=ke(Be);var bp=function(e){return e.fromDuration};var Tp={fromDuration:_R,toDuration:_R};var L8=Bt(Jr),x8=Kn();var N8=He(fR),P8=He(yg),O8=He(sR),U8=Pe(hp),k8=Pe(Dp),$8=Pe(gp);var W8=St(Jr);var Ep=(function(){function e(n,r,u){this.value0=n,this.value1=r,this.value2=u}return e.create=function(n){return function(r){return function(u){return new e(n,r,u)}}},e})(),Gi=function(e){return e.value0};var qi=function(e){return e.value1};var Fp={eq:function(e){return function(n){return N8(e.value0)(n.value0)&&P8(e.value1)(n.value1)&&O8(e.value2)(n.value2)}}},H8=He(Fp),Tg={compare:function(e){return function(n){var r=U8(e.value0)(n.value0);if(r instanceof xe)return xe.value;if(r instanceof Ae)return Ae.value;var u=k8(e.value1)(n.value1);return u instanceof xe?xe.value:u instanceof Ae?Ae.value:$8(e.value2)(n.value2)}},Eq0:function(){return Fp}};var Hl=function(e){return e.value2},ji=function(e){return function(n){return function(r){var u=function(c){return function(p){return function(E){return new Ep(c,x8(W8(p)),E)}}};return oR(u,e,L8(n),r)}}},Eg=function(e){return function(n){return function(r){var u=new Ep(e,n,r),c=H8(ji(e)(n)(r))(u);return c?new H(u):G.value}}},wg=(function(){return{bottom:new Ep(pn(yp),pn(Rp),pn(Is)),top:new Ep(Pn(yp),Pn(Rp),Pn(Is)),Ord0:function(){return Tg}}})();var Cp=function(e,n,r){var u=0,c;return function(p){if(u===2)return c;if(u===1)throw new ReferenceError(e+" was needed before it finished initializing (module "+n+", line "+p+")",n,p);return u=1,c=r(),u=2,c}};var Sp=vn,Mp=vn,Ip=vn,Ap=vn,CR=ia,SR=ia,MR=ia,IR=ia,As={bottom:0,top:59,Ord0:function(){return Sp}},Ls={bottom:0,top:59,Ord0:function(){return Mp}},xs={bottom:0,top:999,Ord0:function(){return Ip}},Ns={bottom:0,top:23,Ord0:function(){return Ap}},ko={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new H(e);if(lt)return G.value;throw new Error("Failed pattern match at Data.Time.Component (line 90, column 1 - line 95, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return As},Enum1:function(){return B8(0)}},B8=Cp("enumSecond","Data.Time.Component",function(){return{succ:(function(){var e=St(ko),n=Bt(ko);return function(r){return e((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var e=St(ko),n=Bt(ko);return function(r){return e((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return Sp}}});var $o={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new H(e);if(lt)return G.value;throw new Error("Failed pattern match at Data.Time.Component (line 61, column 1 - line 66, column 26): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return Ls},Enum1:function(){return J8(0)}},J8=Cp("enumMinute","Data.Time.Component",function(){return{succ:(function(){var e=St($o),n=Bt($o);return function(r){return e((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var e=St($o),n=Bt($o);return function(r){return e((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return Mp}}});var Wo={cardinality:1e3,toEnum:function(e){if(e>=0&&e<=999)return new H(e);if(lt)return G.value;throw new Error("Failed pattern match at Data.Time.Component (line 120, column 1 - line 125, column 31): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return xs},Enum1:function(){return G8(0)}},G8=Cp("enumMillisecond","Data.Time.Component",function(){return{succ:(function(){var e=St(Wo),n=Bt(Wo);return function(r){return e((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var e=St(Wo),n=Bt(Wo);return function(r){return e((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return Ip}}});var Ho={cardinality:24,toEnum:function(e){if(e>=0&&e<=23)return new H(e);if(lt)return G.value;throw new Error("Failed pattern match at Data.Time.Component (line 32, column 1 - line 37, column 24): "+[e.constructor.name])},fromEnum:function(e){return e},Bounded0:function(){return Ns},Enum1:function(){return q8(0)}},q8=Cp("enumHour","Data.Time.Component",function(){return{succ:(function(){var e=St(Ho),n=Bt(Ho);return function(r){return e((function(u){return u+1|0})(n(r)))}})(),pred:(function(){var e=St(Ho),n=Bt(Ho);return function(r){return e((function(u){return u-1|0})(n(r)))}})(),Ord0:function(){return Ap}}});var K8=He(IR),Y8=He(SR),Q8=He(CR),X8=He(MR),Z8=Pe(Ap),eI=Pe(Mp),tI=Pe(Sp),nI=Pe(Ip);var Ou=(function(){function e(n,r,u,c){this.value0=n,this.value1=r,this.value2=u,this.value3=c}return e.create=function(n){return function(r){return function(u){return function(c){return new e(n,r,u,c)}}}},e})();var Vc=function(e){return e.value2},Kc=function(e){return e.value1},Yc=function(e){return e.value3};var Qc=function(e){return e.value0};var Fg={eq:function(e){return function(n){return K8(e.value0)(n.value0)&&Y8(e.value1)(n.value1)&&Q8(e.value2)(n.value2)&&X8(e.value3)(n.value3)}}},Cg={compare:function(e){return function(n){var r=Z8(e.value0)(n.value0);if(r instanceof xe)return xe.value;if(r instanceof Ae)return Ae.value;var u=eI(e.value1)(n.value1);if(u instanceof xe)return xe.value;if(u instanceof Ae)return Ae.value;var c=tI(e.value2)(n.value2);return c instanceof xe?xe.value:c instanceof Ae?Ae.value:nI(e.value3)(n.value3)}},Eq0:function(){return Fg}};var Ps=(function(){return{bottom:new Ou(pn(Ns),pn(Ls),pn(As),pn(xs)),top:new Ou(Pn(Ns),Pn(Ls),Pn(As),Pn(xs)),Ord0:function(){return Cg}}})();var aI=Bt(Wa),oI=Bt(Jr),uI=Bt(po),iI=Bt(Ho),lI=Bt($o),cI=Bt(ko),fI=Bt(Wo);var sI=He(Fp),dI=He(Fg),vI=Pe(Tg),pI=Pe(Cg),mI=de(nn),Xc=gt(ka),Sg=V(Oe),_I=Pi(nn),hI=St(Wa),gI=St(Jr),DI=St(po),yI=St(Ho),RI=St($o),bI=St(ko),TI=St(Wo),mu=(function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e})(),EI=function(e){return{year:aI(Gi(e.value0)),month:oI(qi(e.value0)),day:uI(Hl(e.value0)),hour:iI(Qc(e.value1)),minute:lI(Kc(e.value1)),second:cI(Vc(e.value1)),millisecond:fI(Yc(e.value1))}};var wI={eq:function(e){return function(n){return sI(e.value0)(n.value0)&&dI(e.value1)(n.value1)}}},Os={compare:function(e){return function(n){var r=vI(e.value0)(n.value0);return r instanceof xe?xe.value:r instanceof Ae?Ae.value:pI(e.value1)(n.value1)}},Eq0:function(){return wI}};var Lp=(function(){return{bottom:new mu(pn(wg),pn(Ps)),top:new mu(Pn(wg),Pn(Ps)),Ord0:function(){return Os}}})(),AR=function(e){var n=bp(e);return function(r){return function(u){return mI(aR(H.create)(G.value)(n(r))(EI(u)))(function(c){return Xc(Sg(mu.create)(_I(Xc(Xc(Sg(Eg)(hI(c.year)))(gI(c.month)))(DI(c.day)))))(Xc(Xc(Xc(Sg(Ou.create)(yI(c.hour)))(RI(c.minute)))(bI(c.second)))(TI(c.millisecond)))})}}};var da=(function(){var e={},n="Pure",r="Throw",u="Catch",c="Sync",p="Async",E="Bind",d="Bracket",h="Fork",O="Sequential",y="Map",w="Apply",L="Alt",C="Cons",M="Resume",k="Release",B="Finalizer",Q="Finalized",z="Forked",ee="Fiber",ae="Thunk";function ne(he,At,an,je){this.tag=he,this._1=At,this._2=an,this._3=je}function me(he){var At=function(an,je,We){return new ne(he,an,je,We)};return At.tag=he,At}function _e(he){return new ne(n,void 0)}function nt(he){try{he()}catch(At){setTimeout(function(){throw At},0)}}function ot(he,At,an){try{return At(an())}catch(je){return he(je)}}function ct(he,At,an){try{return At(an)()}catch(je){return an(he(je))(),_e}}var Mn=(function(){var he=1024,At=0,an=0,je=new Array(he),We=!1;function ge(){var bt;for(We=!0;At!==0;)At--,bt=je[an],je[an]=void 0,an=(an+1)%he,bt();We=!1}return{isDraining:function(){return We},enqueue:function(bt){var ht,zt;At===he&&(zt=We,ge(),We=zt),je[(an+At)%he]=bt,At++,We||ge()}}})();function Ln(he){var At={},an=0,je=0;return{register:function(We){var ge=an++;We.onComplete({rethrow:!0,handler:function(bt){return function(){je--,delete At[ge]}}})(),At[ge]=We,je++},isEmpty:function(){return je===0},killAll:function(We,ge){return function(){if(je===0)return ge();var bt=0,ht={};function zt(at){ht[at]=At[at].kill(We,function(Lt){return function(){delete ht[at],bt--,he.isLeft(Lt)&&he.fromLeft(Lt)&&setTimeout(function(){throw he.fromLeft(Lt)},0),bt===0&&ge()}})()}for(var In in At)At.hasOwnProperty(In)&&(bt++,zt(In));return At={},an=0,je=0,function(at){return new ne(c,function(){for(var Lt in ht)ht.hasOwnProperty(Lt)&&ht[Lt]()})}}}}}var wt=0,Wt=1,un=2,Fn=3,fn=4,Kt=5,Rn=6;function rn(he,At,an){var je=0,We=wt,ge=an,bt=null,ht=null,zt=null,In=null,at=null,Lt=0,br=0,Jt=null,ja=!0;function U(S){for(var A,$,W;;)switch(A=null,$=null,W=null,We){case un:We=Wt;try{ge=zt(ge),In===null?zt=null:(zt=In._1,In=In._2)}catch(K){We=Kt,bt=he.left(K),ge=null}break;case Fn:he.isLeft(ge)?(We=Kt,bt=ge,ge=null):zt===null?We=Kt:(We=un,ge=he.fromRight(ge));break;case Wt:switch(ge.tag){case E:zt&&(In=new ne(C,zt,In)),zt=ge._2,We=Wt,ge=ge._1;break;case n:zt===null?(We=Kt,ge=he.right(ge._1)):(We=un,ge=ge._1);break;case c:We=Fn,ge=ot(he.left,he.right,ge._1);break;case p:We=fn,ge=ct(he.left,ge._1,function(K){return function(){je===S&&(je++,Mn.enqueue(function(){je===S+1&&(We=Fn,ge=K,U(je))}))}});return;case r:We=Kt,bt=he.left(ge._1),ge=null;break;case u:zt===null?at=new ne(C,ge,at,ht):at=new ne(C,ge,new ne(C,new ne(M,zt,In),at,ht),ht),zt=null,In=null,We=Wt,ge=ge._1;break;case d:Lt++,zt===null?at=new ne(C,ge,at,ht):at=new ne(C,ge,new ne(C,new ne(M,zt,In),at,ht),ht),zt=null,In=null,We=Wt,ge=ge._1;break;case h:We=Fn,A=rn(he,At,ge._2),At&&At.register(A),ge._1&&A.run(),ge=he.right(A);break;case O:We=Wt,ge=Rr(he,At,ge._1);break}break;case Kt:if(zt=null,In=null,at===null)We=Rn,ge=ht||bt||ge;else switch(A=at._3,W=at._1,at=at._2,W.tag){case u:ht&&ht!==A&&Lt===0?We=Kt:bt&&(We=Wt,ge=W._2(he.fromLeft(bt)),bt=null);break;case M:ht&&ht!==A&&Lt===0||bt?We=Kt:(zt=W._1,In=W._2,We=un,ge=he.fromRight(ge));break;case d:Lt--,bt===null&&($=he.fromRight(ge),at=new ne(C,new ne(k,W._2,$),at,A),(ht===A||Lt>0)&&(We=Wt,ge=W._3($)));break;case k:at=new ne(C,new ne(Q,ge,bt),at,ht),We=Wt,ht&&ht!==A&&Lt===0?ge=W._1.killed(he.fromLeft(ht))(W._2):bt?ge=W._1.failed(he.fromLeft(bt))(W._2):ge=W._1.completed(he.fromRight(ge))(W._2),bt=null,Lt++;break;case B:Lt++,at=new ne(C,new ne(Q,ge,bt),at,ht),We=Wt,ge=W._1;break;case Q:Lt--,We=Kt,ge=W._1,bt=W._2;break}break;case Rn:for(var X in Jt)Jt.hasOwnProperty(X)&&(ja=ja&&Jt[X].rethrow,nt(Jt[X].handler(ge)));Jt=null,ht&&bt?setTimeout(function(){throw he.fromLeft(bt)},0):he.isLeft(ge)&&ja&&setTimeout(function(){if(ja)throw he.fromLeft(ge)},0);return;case wt:We=Wt;break;case fn:return}}function q(S){return function(){if(We===Rn)return ja=ja&&S.rethrow,S.handler(ge)(),function(){};var A=br++;return Jt=Jt||{},Jt[A]=S,function(){Jt!==null&&delete Jt[A]}}}function x(S,A){return function(){if(We===Rn)return A(he.right(void 0))(),function(){};var $=q({rethrow:!1,handler:function(){return A(he.right(void 0))}})();switch(We){case wt:ht=he.left(S),We=Rn,ge=ht,U(je);break;case fn:ht===null&&(ht=he.left(S)),Lt===0&&(We===fn&&(at=new ne(C,new ne(B,ge(S)),at,ht)),We=Kt,ge=null,bt=null,U(++je));break;default:ht===null&&(ht=he.left(S)),Lt===0&&(We=Kt,ge=null,bt=null)}return $}}function D(S){return function(){var A=q({rethrow:!1,handler:S})();return We===wt&&U(je),A}}return{kill:x,join:D,onComplete:q,isSuspended:function(){return We===wt},run:function(){We===wt&&(Mn.isDraining()?U(je):Mn.enqueue(function(){U(je)}))}}}function It(he,At,an,je){var We=0,ge={},bt=0,ht={},zt=new Error("[ParAff] Early exit"),In=null,at=e;function Lt(q,x,D){var S=x,A=null,$=null,W=0,X={},K,oe;e:for(;;)switch(K=null,S.tag){case z:if(S._3===e&&(K=ge[S._1],X[W++]=K.kill(q,function(ce){return function(){W--,W===0&&D(ce)()}})),A===null)break e;S=A._2,$===null?A=null:(A=$._1,$=$._2);break;case y:S=S._2;break;case w:case L:A&&($=new ne(C,A,$)),A=S,S=S._1;break}if(W===0)D(he.right(void 0))();else for(oe=0,K=W;oe()=>e.props.def;function N7(e){class n extends nr.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=e?"Elmish_"+e:"ElmishRoot",n}var zp=typeof module>"u"?void 0:module.require,YY=(function(){try{return zp===void 0?void 0:zp("util")}catch{return}})();var QY=(function(){var e;if(typeof performance<"u")e=performance;else if(zp)try{e=zp("perf_hooks").performance}catch{}return(function(){return(e||Date).now()})})();function db(e){return typeof e=="string"}function Hg(e){return typeof e=="number"}function vb(e){return typeof e=="boolean"}function pb(e){return e instanceof Object}function mb(e){return e instanceof Function}function qs(e){return e===null?"":e===void 0?"":e instanceof Date?e.toString():typeof Blob<"u"&&e instanceof Blob?"file["+e.name+"]":JSON.stringify(e)}var $7=On(Pt),_b=Wi(bs),W7=Wn(Pt);var ff=function(e){return e.foldrWithIndex};var js=function(e){return e.foldlWithIndex};var H7=function(e){var n=ff(e);return function(r){var u=Je(r.Semigroup0()),c=Yt(r);return function(p){return n(function(E){return function(d){return function(h){return u(p(E)(d))(h)}}})(c)}}},zs={foldrWithIndex:function(e){return function(n){var r=$7(function(c){return function(p){return e(c.value0)(c.value1)(p)}})(n),u=_b(Qe.create);return function(c){return r(u(c))}}},foldlWithIndex:function(e){return function(n){var r=W7(function(c){return function(p){return e(p.value0)(c)(p.value1)}})(n),u=_b(Qe.create);return function(c){return r(u(c))}}},foldMapWithIndex:function(e){return H7(zs)(e)},Foldable0:function(){return Pt}};var hb=function(e){var n=js(e);return function(r){var u=function(c){return function(p){return function(E){return p instanceof G?r(c)(E):p}}};return n(u)(G.value)}};function Vp(e){return Object.prototype.toString.call(e).slice(8,-1)}function Vs(e){return e===null}function Ks(e){return e===void 0}var Kp=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};var Du=(function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e})();var Qp=function(e){var n=ca(e);return function(r){return new Du(r,n)}};var Sr=(function(){function e(){}return e.value=new e,e})(),cn=(function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e})(),Xp=function(e){return e},Z7=function(e){return new cn(e.value0,e.value1)};var eA=function(e){var n=function(r){return function(u){var c=r,p=!1,E;function d(h,O){if(O instanceof cn&&O.value1 instanceof cn&&O.value1.value1 instanceof cn){c=new cn(O,h),u=O.value1.value1.value1;return}var y=function(L){return L instanceof cn&&L.value1 instanceof cn&&L.value1.value1 instanceof Sr?new cn(e(L.value0),new cn(e(L.value1.value0),Sr.value)):L instanceof cn&&L.value1 instanceof Sr?new cn(e(L.value0),Sr.value):Sr.value},w=function(L){return function(C){var M=L,k=!1,B;function Q(z,ee){if(z instanceof cn&&z.value0 instanceof cn&&z.value0.value1 instanceof cn&&z.value0.value1.value1 instanceof cn){M=z.value1,C=new cn(e(z.value0.value0),new cn(e(z.value0.value1.value0),new cn(e(z.value0.value1.value1.value0),ee)));return}return k=!0,ee}for(;!k;)B=Q(M,C);return B}};return p=!0,w(h)(y(O))}for(;!p;)E=d(c,u);return E}};return n(Sr.value)},Rb={map:eA};var Ja={foldr:function(e){return function(n){var r=(function(){var c=function(p){return function(E){var d=p,h=!1,O;function y(w,L){if(L instanceof Sr)return h=!0,w;if(L instanceof cn){d=new cn(L.value0,w),E=L.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 107, column 7 - line 107, column 23): "+[w.constructor.name,L.constructor.name])}for(;!h;)O=y(d,E);return O}};return c(Sr.value)})(),u=Wn(Ja)(en(e))(n);return function(c){return u(r(c))}}},foldl:function(e){var n=function(r){return function(u){var c=r,p=!1,E;function d(h,O){if(O instanceof Sr)return p=!0,h;if(O instanceof cn){c=e(h)(O.value0),u=O.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 111, column 12 - line 113, column 30): "+[O.constructor.name])}for(;!p;)E=d(c,u);return E}};return n},foldMap:function(e){var n=Je(e.Semigroup0()),r=Yt(e);return function(u){return Wn(Ja)(function(c){var p=n(c);return function(E){return p(u(E))}})(r)}}};var tA=On(Ja);var Zp={append:function(e){return function(n){return tA(cn.create)(n)(e)}}},bb=Je(Zp);var em={append:function(e){return function(n){return new Du(e.value0,bb(e.value1)(Z7(n)))}}};var Tb={alt:bb,Functor0:function(){return Rb}},Bg=(function(){return{empty:Sr.value,Alt0:function(){return Tb}}})();var Jg=(function(){var e=Qp(Bg);return function(n){return Xp(e(n))}})();var Sb=function(e){return e.value0};var Qi=function(e){return e.length};var Mb=function(e){return function(n){return function(r){return function(u){var c=u.indexOf(r);return c===-1?n:e(c)}}}};var df=function(e){return function(n){return n.substr(0,e)}},Xi=function(e){return function(n){return n.substring(e)}};var Ti=function(e){return function(n){if(e>=0&&en[e],Bb=(e,n,r)=>r[e]=n;var od=function(n){return function(r){return n(r)()}};var Yl=function(n){return function(r){return function(u){return function(){return n(r,u)}}}},Ql=function(n){return function(r){return function(u){return function(c){return function(){return n(r,u,c)}}}}};var jA=xt(Et),ud=(function(){function e(){}return e.value=new e,e})(),qb=function(){return function(e){var n=Gn(e);return function(r){return Ql(Bb)(n(wn.value))}}},Zg=function(e){var n=ad(e);return function(r){var u=Gn(r);return function(c){return function(p){return jA(function(){return Hb(u(wn.value),p)})(n)}}}};function jb(e,n,r){return e==null?n:r(e)}function e1(e){return e}var Bu=Ht(null)(e1),Ge=function(e){return jb(e,G.value,H.create)};Hu();var sm=window.ReactDOM,{createPortal:CZ,findDOMNode:SZ,flushSync:MZ,unstable_batchedUpdates:IZ}=window.ReactDOM;var b1=kv(UT(),1);function kT(e,n,r){return e.setState({s:n},r)}var $T=sm.render,WT=sm.hydrate,T1=b1.default&&b1.default.renderToString||(e=>""),wL=sm.unmountComponentAtNode,HT=nr.Fragment;function BT(e,n,r){return nr.createElement.apply(null,[e,FL(e,n)].concat(r))}function FL(e,n){if(typeof e!="string"||n._data==null)return n;var r={_data:void 0};for(var u in n._data){var c=n._data[u];r["data-"+u]=c}return Object.assign({},n,r)}var Gu={asReactChildren:function(e){return[e]}},qu={asReactChildren:function(e){return[e]}},Ru={asReactChildren:ke(Be)};var tc=ye,GT=Ql(kT),qT=Yl($T),jT=Yl(WT);var ra=!1;var IL=function(e){return e.asReactChildren},nc=function(){return function(e){var n=IL(e);return function(r){return function(u){return function(c){return BT(r,u,n(c))}}}}},zT=nc()(Ru),rc=function(){return function(e){return function(n){return zT(e)(n)([])}}},vd=zT(HT)({});var VT=V(Et),AL=ie(fr);var KT=(function(){var e=function(n){return function(r){return{initialize:function(u){return Sl(new H(r.initialState))(n)},getState:function(u){return VT(_n(r.initialState))(Pc(n))},setState:function(u){return function(c){return function(p){return function(){return Sl(new H(c))(n)(),GT(u)(c)(AL(void 0))(),p()}}}}}}};return VT(e)(vs(G.value))})();var XT=xt(tn),ZT=Je(kr);var xL=ie(fr),eE=qb(),tE={reflectSymbol:function(){return"__unmounted"}},NL=eE(tE),nE={reflectSymbol:function(){return"__subscriptions"}},PL=eE(nE),ym=xt(Et),OL=Zg(Lr)(tE),YT=V(Et),UL=Zg(Ma($b))(nE),kL=Jn(tr),$L=Vn(to),WL=np(fr)(Pt),HL=kL(Gr),rE=Qt(tf),BL=Hv(Oi),JL=Je(jh(ng(Wv)));var al=(function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e})(),GL={map:function(e){return function(n){return new al(e(n.value0),n.value1)}}},Rm=function(e){return{bimap:function(n){return function(r){return function(u){return new al(r(u.value0),XT(u.value1)(function(c){return function(p){return c({dispatch:function(E){return p.dispatch(n(E))},onStop:p.onStop})}}))}}}}},aE={apply:function(e){return function(n){return new al(e.value0(n.value0),ZT(e.value1)(n.value1))}},Functor0:function(){return GL}},Ci={bind:function(e){return function(n){var r=n(e.value0);return new al(r.value0,ZT(e.value1)(r.value1))}},Apply0:function(){return aE}},ho={pure:function(e){return new al(e,[])},Apply0:function(){return aE}};var oE=function(e){var n=de(e);return function(r){var u=Qt(r);return function(c){return function(p){return new al(c,XT(p)(function(E){return function(d){return n(E)(function(h){return u(d.dispatch(h))})}}))}}}};var gf=function(e){return new al(void 0,[e])},ju=function(e){return gf(Ze(e))},ol=function(e){var n=de(e.Monad0().Bind1()),r=Qt(e);return function(u){return gf(function(c){return n(u)(function(p){return r(Ht(xL(void 0))(c.dispatch)(p))})})}},ul=function(e){var n=oE(e.Monad0().Bind1())(e);return function(r){return n(void 0)([r])}},qL=function(e){return function(n){var r=NL(ud.value),u=PL(ud.value),c=function(C){return function(M){return function(k){return function(){var Q=ym(Gs(C))(function(z){return z.init})();return n({initialState:Q.value0}).setState(C)(M)(k)()}}}},p=(function(){var C=YT(_n(!1)),M=OL(ud.value);return function(k){return C(M(k))}})(),E=(function(){var C=YT(_n([])),M=UL(ud.value);return function(k){return C(M(k))}})(),d=function(C){return function(){return $L(WL)(E(C))(),u([])(C)()}},h=function(C){return function(){var k=ym(Gs(C))(function(B){return B.init})();return n({initialState:k.value0}).getState(C)()}},O=function(C){return function(M){return function(){var B=E(C)();return u(Oo(Jp(M))(B))(C)()}}},y=function(C){return function(M){var k=function(B){return Jp(HL(Wu(0))(function(){return B({dispatch:(function(){var Q=w(M);return function(z){return rE(Q(z))}})(),onStop:O(M)})}))};return eg(C)(k)}},w=function(C){return function(M){return BL(p(C))(function(){var B=h(C)(),Q=ym(Gs(C))(function(ee){return ee.update})(),z=Q(B)(M);return c(C)(z.value0)(y(z.value1)(C))()})}},L=function(C){return function(){var k=h(C)(),B=ym(Gs(C))(function(Q){return Q.view})();return B(k)(w(C))}};return function(C){return sb(e,{def:C,init:n({initialState:C.init.value0}).initialize,render:L,componentDidMount:y(C.init.value1),componentWillUnmount:JL(r(!0))(d)})}}},E1=function(e){return function(){var r=rE(KT)();return fb(function(u){return qL(u)(r)(e)})}};var bm={handle:function(e){return function(n){return function(r){return e(n(r))()}}}},uE={handleEffect:function(e){return od(e)}};var Df={handle:function(e){return function(n){return function(r){return e(n)()}}}};var iE=function(e){return e.handleEffect},Si=function(e){return e.handle};function Tm(e,n){var r={};for(var u in n)({}).hasOwnProperty.call(n,u)&&(r[u]=n[u]);for(var c in e)({}).hasOwnProperty.call(e,c)&&(r[c]=e[c]);return r}var Em=function(){return function(){return function(e){return function(n){return Tm(e,n)}}}};var w1=nc(),VL=Em()();var F1=ye;var lE=function(e){var n=w1(e);return function(r){return function(u){return n(F1(r))(u)}}},C1=function(e){var n=w1(e);return function(r){return function(u){return function(c){return n(F1(r))(VL(c)({className:u}))}}}};var wm=function(e){return function(n){var r=w1(n);return function(u){return function(c){return r(F1(e))({className:u})(c)}}}};var Mi=ye;var Fm=function(e){var n=C1(e);return function(){return function(){return n("video")}}};var _d=function(e){return wm("span")(e)};var Cm=function(e){return wm("i")(e)};var Vu=function(e){var n=C1(e);return function(){return function(){return n("div")}}},bu=function(e){return wm("div")(e)};var cE=Hs(Wp);var fE={map:function(e){return function(n){return cE(cE(e))(n)}}},KL=xt(fE),YL=function(e){var n=de(e.Monad0().Bind1()),r=Qt(e);return function(u){return gf(function(c){return n(u(c.dispatch))(function(p){return r(c.onStop(p))})})}},gd=function(e){var n=YL(e);return function(r){return function(u){return n(KL(u)(r))}}};var jo=(function(){return{"genericTop'":mn.value}})();var M1=function(e){return e["genericTop'"]},zo=function(e){return{"genericTop'":M1(e)}};var Vo=(function(){return{"genericBottom'":mn.value}})();var Dd=function(e){return e["genericBottom'"]},Ko=function(e){return{"genericBottom'":Dd(e)}};var Yo=function(e){return{"genericBottom'":new Nt(Dd(e))}},sE=function(e){var n=Lc(e);return function(r){return n(Dd(r))}};var il=V(Oe),Sm=$n();var I1=function(e){return e["genericToEnum'"]};var Mm=function(e){return e["genericSucc'"]},vE=function(e){var n=Lc(e),r=ds(e);return function(u){var c=il(n),p=Mm(u);return function(E){return c(p(r(E)))}}},A1=function(e){return e["genericPred'"]};var L1=function(e){return e["genericFromEnum'"]};var Qo=function(e){var n=A1(e),r=Mm(e);return function(u){var c=M1(u);return function(p){var E=A1(p),d=Mm(p);return function(h){var O=Dd(h);return{"genericPred'":function(y){if(y instanceof Nt)return il(Nt.create)(n(y.value0));if(y instanceof _t){var w=E(y.value0);if(w instanceof G)return new H(new Nt(c));if(w instanceof H)return new H(new _t(w.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 30, column 14 - line 32, column 31): "+[w.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 Nt){var w=r(y.value0);if(w instanceof G)return new H(new _t(O));if(w instanceof H)return new H(new Nt(w.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 34, column 14 - line 36, column 31): "+[w.constructor.name])}if(y instanceof _t)return il(_t.create)(d(y.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 33, column 18 - line 37, column 36): "+[y.constructor.name])}}}}}};var Xo={"genericPred'":function(e){return G.value},"genericSucc'":function(e){return G.value}},Zo=function(e){var n=A1(e),r=Mm(e);return{"genericPred'":function(u){return il(ss)(n(u))},"genericSucc'":function(u){return il(ss)(r(u))}}};var x1=function(e){return e["genericCardinality'"]};var eu=function(e){var n=x1(e),r=I1(e),u=L1(e);return function(c){var p=I1(c),E=L1(c);return{"genericCardinality'":Sm(n)+Sm(x1(c))|0,"genericToEnum'":function(d){var h=function(O){if(d>=0&&d1;if(r){var u=Ed(Ti(1)(e)),c=PE(u);return c?NE(n)(u):n}return n},t6=ME(e6),wd=IE(Zx)(t6),Ai=function(e){return Ua(wd(e))};var Pm=function(e){return function(n){return xE(function(r){return Ai(df(r)(n))})(jg(e)(n))}};var zE=qe;var D6=im(Pt),y6=xt(tn),R6=kl(P1),La=function(e){return function(n){var r=D6(y6(n)(function(u){return new Qe(e(u),u)}));return function(u){return Kl(u)(r)}}},VE=function(e){var n=vE(e),r=sE(e);return function(u){var c=n(u);return function(p){return function(E){return R6(function(d){return new Qe(d,c(d))})(r(E))}}}},go=function(e){var n=VE(e);return function(r){var u=n(r);return function(c){var p=u(c);return function(E){return fl(p(E))}}}};var b6={info:"info",warning:"warn",error:"error"},Md=e=>n=>r=>u=>{let c=b6[e];if(typeof console<"u"&&console[c]&&console[c](n,r),typeof window<"u"){let p=new Error(n);typeof window.Sentry<"u"&&window.Sentry.captureException(p,{extra:r})}return u()},KE=(e,n)=>(n.__sentryFingerprint=e,n);var YE=function(e){return Pu(KE)(e)};var $m="error";var Wm={parseOrPanic:function(e){return function(n){var r=e.parse(n);if(r instanceof Ce)return r.value0;if(r instanceof Te)return Md($m)("Failed to parse "+e.diagnosticName)({error:r.value0,value:n})(function(u){return e.default});throw new Error("Failed pattern match at Utils.Parse (line 49, column 5 - line 57, column 24): "+[r.constructor.name])}}},qr=function(e){return e.parseOrPanic},E6=qr(Wm),dl=function(e){var n=qr(e);return function(r){var u=V(r);return function(c){return n({parse:function(p){return u(H.create)(c.parse(p))},default:G.value,diagnosticName:c.diagnosticName})}}},w6=dl(Wm)(lr),vl=function(e){var n=tl(e);return function(r){return w6({parse:n,diagnosticName:r})}},jr={parseOrPanic:function(e){return E6({default:e.default,diagnosticName:e.diagnosticName,parse:(function(){var n=Ht(new Te(""))(Ce.create);return function(r){return n(e.parse(r))}})()})}};var XE=Zo(Xo),ZE=Ko(Vo),ew=nu(tu),Tf=(function(){function e(){}return e.value=new e,e})(),Id=(function(){function e(){}return e.value=new e,e})(),F6={to:function(e){if(e instanceof Nt)return Tf.value;if(e instanceof _t)return Id.value;throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 16, column 1 - line 16, column 32): "+[e.constructor.name])},from:function(e){if(e instanceof Tf)return new Nt(mn.value);if(e instanceof Id)return new _t(mn.value);throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 16, column 1 - line 16, column 32): "+[e.constructor.name])}};var C6=function(e){if(e instanceof Tf)return"school";if(e instanceof Id)return"vine";throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 28, column 1 - line 28, column 29): "+[e.constructor.name])},rw=(function(){return qr(jr)({parse:La(C6)(go(F6)(Qo(XE)(zo(jo))(XE)(ZE))(eu(ew)(ew))(Yo(ZE))),default:Tf.value,diagnosticName:"Sem.Connections.Types.Actor"})})();var iw=Zo(Xo),aw=Qo(iw)(zo(jo)),lw=Ko(Vo),ow=Yo(lw),cw=nu(tu),uw=eu(cw),M6=Tn(qv),Ef=(function(){function e(){}return e.value=new e,e})(),Ad=(function(){function e(){}return e.value=new e,e})(),wf=(function(){function e(){}return e.value=new e,e})(),I6={to:function(e){if(e instanceof Nt)return Ef.value;if(e instanceof _t&&e.value0 instanceof Nt)return Ad.value;if(e instanceof _t&&e.value0 instanceof _t)return wf.value;throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 18, column 1 - line 18, column 33): "+[e.constructor.name])},from:function(e){if(e instanceof Ef)return new Nt(mn.value);if(e instanceof Ad)return new _t(new Nt(mn.value));if(e instanceof wf)return new _t(new _t(mn.value));throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 18, column 1 - line 18, column 33): "+[e.constructor.name])}};var A6=function(e){if(e instanceof Ef)return"pending";if(e instanceof Ad)return"connected";if(e instanceof wf)return"ignored";throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 34, column 1 - line 34, column 30): "+[e.constructor.name])},fw=(function(){var e=La(A6)(go(I6)(aw(aw(iw)(lw))(ow))(uw(uw(cw)))(ow)),n=function(r){return r==="cold"?new H(wf.value):G.value};return qr(jr)({parse:function(r){return M6(e(r))(n(r))},default:Ef.value,diagnosticName:"Sem.Connections.Types.Status"})})();var sw=function(e){return{initiator:rw(e.initiator),status:fw(e.status),introMessage:_n("")(Ge(e.introMessage))}};var Jm=(function(){function e(){}return e.value=new e,e})(),dw=(function(){function e(){}return e.value=new e,e})();var vw=(function(){var e=qr(jr)({parse:function(n){return n instanceof H&&n.value0==="paid"?new H(dw.value):n instanceof H&&n.value0==="free"?new H(Jm.value):n instanceof H&&n.value0==="churned"?new H(Jm.value):n instanceof G?new H(Jm.value):G.value},default:Jm.value,diagnosticName:"Sem.Types.PartnerStatus"});return function(n){return e(Ge(n))}})();var pw=function(e){return{allowedToContact:e.allowedToContact,id:e.id,name:e.name,imageUrl:Ge(e.imageUrl),partnerStatus:vw(e.partnerStatus)}};var U6=de(nn),G1=Ei(),Ld=dr(qe),mw=Y({reflectSymbol:function(){return"id"}}),k6=Jn(tr)(nn),$6=_p(Xh),W6=V(Oe);var H6=qe,B6=vl(G1(Y({reflectSymbol:function(){return"avatarUrl"}})(Ld)(Y({reflectSymbol:function(){return"bio"}})(Ld)(Y({reflectSymbol:function(){return"connection"}})(dr(G1(Y({reflectSymbol:function(){return"initiator"}})(qe)(Y({reflectSymbol:function(){return"introMessage"}})(Ld)(Y({reflectSymbol:function(){return"status"}})(qe)(on))))))(Y({reflectSymbol:function(){return"firstName"}})(qe)(mw(H6)(Y({reflectSymbol:function(){return"lastName"}})(qe)(Y({reflectSymbol:function(){return"school"}})(G1(Y({reflectSymbol:function(){return"allowedToContact"}})(Lr)(mw(zE)(Y({reflectSymbol:function(){return"imageUrl"}})(Ld)(Y({reflectSymbol:function(){return"name"}})(qe)(Y({reflectSymbol:function(){return"partnerStatus"}})(Ld)(on)))))))(Y({reflectSymbol:function(){return"title"}})(qe)(Y({reflectSymbol:function(){return"type"}})(qe)(Y({reflectSymbol:function(){return"unreadMessageCountFromSemUser"}})(yt)(on))))))))))));var _w=function(e){return U6(B6("SemUser")(e))(function(n){return k6($6(n.type==="Sem::User"))(function(){return new H({school:pw(n.school),firstName:n.firstName,lastName:n.lastName,avatarUrl:Ge(n.avatarUrl),title:n.title,bio:Ge(n.bio),connection:W6(sw)(Ge(n.connection)),unreadMessageCountFromSemUser:n.unreadMessageCountFromSemUser,id:n.id})})})};var ww=(function(){function e(){}return e.value=new e,e})(),Fw=(function(){function e(){}return e.value=new e,e})(),Cw=(function(){function e(){}return e.value=new e,e})();var R5=function(e){if(e instanceof ww)return"disabled";if(e instanceof Fw)return"free-consultation";if(e instanceof Cw)return"more-information";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types.InquiryMode (line 27, column 13 - line 30, column 40): "+[e.constructor.name])};var b5=(function(){return[ww.value,Fw.value,Cw.value]})(),Sw=dl(jr)(Oe)({parse:La(R5)(b5),diagnosticName:"InquiryMode"});var Joe=new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short",maximumFractionDigits:2});Hu();var D9=nr.Fragment;var Kw=function(e){var n=lE(e);return function(){return function(){return n("button")}}};function Yw(e){return function(n){return function(){return n.getElementById(e)}}}var b9=V(Et),qm=function(e){var n=b9(Ge),r=Yw(e);return function(u){return n(r(u))}};var jm=function(e){return function(n){return function(){return n[e]}}},T9=jm("children"),E9=jm("firstElementChild"),w9=jm("lastElementChild"),F9=jm("childElementCount");var Fu=function(){return window};function Xw(e,n,r,u){if(typeof window<"u"){var c=window[r];if(c!=null&&u instanceof c)return n(u)}for(var p=u;p!=null;){var E=Object.getPrototypeOf(p),d=E.constructor.name;if(d===r)return n(u);if(d==="Object")return e;p=E}return e}var ze=function(e){return function(n){return Xw(G.value,H.create,e,n)}};var zm=ye;function eF(e,n,r){var u=Object.prototype.toString.call(r);return u.indexOf("[object HTML")===0&&u.indexOf("Element]")===u.length-8?n(r):e}var tF=function(e){return eF(G.value,H.create,e)};function Vm(e){return function(){return e.currentTime}}function s0(e){return function(){return e.volume}}function d0(e){return function(n){return function(){n.volume=e}}}function v0(e){return function(){return e.muted}}function lc(e){return function(n){return function(){n.muted=e}}}var rF=ze("HTMLMediaElement");var aF=ze("HTMLMediaElement");function m0(e){return function(n){return function(){n.href=e}}}function _0(e){return function(){return e.platform}}function Hd(e){return function(){return e.document}}function h0(e){return function(){return e.navigator}}function g0(e){return function(){return e.location}}function Km(e){return function(){return e.localStorage}}var vN=Es(fr)(sp),oF=de(to),lF=xt(Et),pN=de(nn);var D0=en(Ht(ra));var cF=function(e){return function(n){if(e)return n(void 0);if(lt)return ra;throw new Error("Failed pattern match at Utils.HTML (line 100, column 1 - line 100, column 61): "+[e.constructor.name,n.constructor.name])}},pl=function(e){return function(n){return cF(e)(Ze(n))}};var Zm=function(e){return vN(aF(e.target))(Vm)};var mN=function(e){return oF(lF(oF(Fu)(Hd))(zm))(qm(e))},fF=function(e){return lF(mN(e))(function(n){return pN(n)(tF)})};var Bd=yt;var vF=({just:e,nothing:n})=>r=>{try{let u=new Date(r);return isNaN(u.getTime())?n:e(u)}catch{return n}},pF=e=>({year:e.getFullYear(),month:e.getMonth(),day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),millisecond:e.getMilliseconds()});var hN=(()=>{let e=new Date().toString(),n=(e.match(/\(([\w\s]+)\)$/)||[])[1];return n?/\s/.test(n)?(n.match(/\b(\w)/g)||[]).join(""):n:(n=(e.match(/(\w{3,4})\s\d{4}$/)||[])[1],n||(n=(e.match(/(UTC[\+\-]\d+)/)||[])[1],n)||(n=(e.match(/(GMT[\+\-]\d+)/)||[])[1],n)?n:"")})();var _F={liftAff:ke(Be),MonadEffect0:function(){return jn}};var Wbe=(function(){function e(){this.head=null,this.last=null,this.size=0}function n(y,w){this.queue=y,this.value=w,this.next=null,this.prev=null}function r(y){this.draining=!1,this.error=null,this.value=y,this.takes=new e,this.reads=new e,this.puts=new e}var u={};function c(y){try{y()}catch(w){setTimeout(function(){throw w},0)}}function p(y,w){var L=new n(y,w);switch(y.size){case 0:y.head=L;break;case 1:L.prev=y.head,y.head.next=L,y.last=L;break;default:L.prev=y.last,y.last.next=L,y.last=L}return y.size++,L}function E(y){var w;switch(y.size){case 0:return null;case 1:w=y.head,y.head=null;break;case 2:w=y.last,y.head.next=null,y.last=null;break;default:w=y.last,y.last=w.prev,y.last.next=null}return w.prev=null,w.queue=null,y.size--,w.value}function d(y){var w;switch(y.size){case 0:return null;case 1:w=y.head,y.head=null;break;case 2:w=y.head,y.last.prev=null,y.head=y.last,y.last=null;break;default:w=y.head,y.head=w.next,y.head.prev=null}return w.next=null,w.queue=null,y.size--,w.value}function h(y){if(y.queue!==null){if(y.queue.last===y){E(y.queue);return}if(y.queue.head===y){d(y.queue);return}y.prev&&(y.prev.next=y.next),y.next&&(y.next.prev=y.prev),y.queue.size--,y.queue=null,y.value=null,y.next=null,y.prev=null}}function O(y,w){if(!w.draining){var L=w.puts,C=w.takes,M=w.reads,k,B,Q,z,ee;for(w.draining=!0;;){if(k=null,B=null,Q=null,z=w.value,ee=M.size,w.error!==null){for(z=y.left(w.error);k=d(L);)c(k.cb(z));for(;B=d(M);)c(B(z));for(;Q=d(C);)c(Q(z));break}if(z===u&&(k=d(L))&&(w.value=z=k.value),z!==u){for(Q=d(C);ee--&&(B=d(M));)c(B(y.right(z)));Q!==null&&(w.value=u,c(Q(y.right(z))))}if(k!==null&&c(k.cb(y.right(void 0))),w.value===u&&L.size===0||w.value!==u&&C.size===0)break}w.draining=!1}}return r.EMPTY=u,r.putLast=p,r.takeLast=E,r.takeHead=d,r.deleteCell=h,r.drainVar=O,r})();var ml=de(nn),HN=St(Wa),BN=St(Jr),JN=St(po),GN=St(Ho),qN=St($o),jN=St(ko),zN=St(Wo),VN=ie(Yr);var KN=xt(Oe);var YN=function(e){return ml(HN(e.year))(function(n){return ml(BN(e.month+1|0))(function(r){return ml(JN(e.day))(function(u){return ml(GN(e.hour))(function(c){return ml(qN(e.minute))(function(p){return ml(jN(e.second))(function(E){return ml(zN(e.millisecond))(function(d){return VN(new mu(ji(n)(r)(u),new Ou(c,p,E,d)))})})})})})})})};var Li=function(e){return ml(KN(vF({just:H.create,nothing:G.value})(e))(pF))(YN)};var R0=ie(Yr),QN=V(Oe),DF=de(nn);var TF=Zo(Xo),yF=Qo(TF)(zo(jo)),EF=Ko(Vo),RF=Yo(EF),wF=nu(tu),bF=eu(wF);var b0=(function(){function e(){}return e.value=new e,e})(),T0=(function(){function e(){}return e.value=new e,e})(),E0=(function(){function e(){}return e.value=new e,e})();var XN={to:function(e){if(e instanceof Nt)return b0.value;if(e instanceof _t&&e.value0 instanceof Nt)return T0.value;if(e instanceof _t&&e.value0 instanceof _t)return E0.value;throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 174, column 1 - line 174, column 41): "+[e.constructor.name])},from:function(e){if(e instanceof b0)return new Nt(mn.value);if(e instanceof T0)return new _t(new Nt(mn.value));if(e instanceof E0)return new _t(new _t(mn.value));throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 174, column 1 - line 174, column 41): "+[e.constructor.name])}};var ZN=function(e){if(e instanceof b0)return"stuffed";if(e instanceof T0)return"satisfied";if(e instanceof E0)return"hungry";throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 233, column 27 - line 236, column 35): "+[e.constructor.name])};var eP=dl(jr)(Oe)({parse:La(ZN)(go(XN)(yF(yF(TF)(EF))(RF))(bF(bF(wF)))(RF)),diagnosticName:"ClientAppetite"}),FF=function(e){return DF(Ht(R0(G.value))((function(){var n=QN(R0);return function(r){return n(eP(r))}})())(Ge(e.clientAppetite)))(function(n){return DF(Sw(e.inquiryMode))(function(r){return R0({packages:e.packages,pricePerHourCents:e.pricePerHourCents,singleSessionDurationMinutes:e.singleSessionDurationMinutes,singleSessionRefundPeriodLengthDays:e.singleSessionRefundPeriodLengthDays,themes:e.themes,freeConsultationDurationMinutes:Ge(e.freeConsultationDurationMinutes),canSubmitConsultInquiry:Ge(e.canSubmitConsultInquiry),clientAppetite:n,inquiryMode:r})})})};var CF=de(nn),Mf=Ei(),w0=dr(qe),SF=Y({reflectSymbol:function(){return"description"}})(qe),e_=Y({reflectSymbol:function(){return"id"}})(yt),C0=Y({reflectSymbol:function(){return"name"}})(qe),IF=Mf(e_(C0(Y({reflectSymbol:function(){return"slug"}})(qe)(on)))),MF=Ma(IF),nP=vl(Mf(Y({reflectSymbol:function(){return"advisingConfig"}})(dr(Mf(Y({reflectSymbol:function(){return"canSubmitConsultInquiry"}})(dr(Lr))(Y({reflectSymbol:function(){return"clientAppetite"}})(w0)(Y({reflectSymbol:function(){return"freeConsultationDurationMinutes"}})(dr(yt))(Y({reflectSymbol:function(){return"inquiryMode"}})(qe)(Y({reflectSymbol:function(){return"packages"}})(Ma(Mf(Y({reflectSymbol:function(){return"activeForSale"}})(Lr)(SF(e_(C0(Y({reflectSymbol:function(){return"numMinutes"}})(yt)(Y({reflectSymbol:function(){return"packageCategories"}})(MF)(Y({reflectSymbol:function(){return"refundPeriodLengthDays"}})(yt)(Y({reflectSymbol:function(){return"totalPriceCents"}})(Bd)(on)))))))))))(Y({reflectSymbol:function(){return"pricePerHourCents"}})(Bd)(Y({reflectSymbol:function(){return"singleSessionDurationMinutes"}})(yt)(Y({reflectSymbol:function(){return"singleSessionRefundPeriodLengthDays"}})(yt)(Y({reflectSymbol:function(){return"themes"}})(Ma(Mf(Y({reflectSymbol:function(){return"active"}})(Lr)(Y({reflectSymbol:function(){return"category"}})(IF)(SF(Y({reflectSymbol:function(){return"durationMinutes"}})(yt)(e_(Y({reflectSymbol:function(){return"priceCents"}})(Bd)(Y({reflectSymbol:function(){return"title"}})(qe)(on))))))))))(on))))))))))))(Y({reflectSymbol:function(){return"entity"}})(Mf(Y({reflectSymbol:function(){return"bio"}})(qe)(e_(Y({reflectSymbol:function(){return"imageUrl"}})(w0)(C0(Y({reflectSymbol:function(){return"organizationId"}})(yt)(Y({reflectSymbol:function(){return"organizationName"}})(qe)(Y({reflectSymbol:function(){return"shortEducation"}})(w0)(Y({reflectSymbol:function(){return"tags"}})(MF)(on))))))))))(on)))),F0=ie(Yr),S0=V(Oe),rP=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),aP=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),oP=function(e){return CF(nP("ServiceProviderPresenter")(e))(function(n){return CF(Ht(F0(G.value))((function(){var r=S0(F0);return function(u){return r(FF(u))}})())(Ge(n.advisingConfig)))(function(r){return F0({entity:n.entity,advisingConfig:r})})})},AF=dl(jr)(Oe)({parse:function(e){return e.type==="Sem::User"?S0(rP.create)(_w(e.presenter)):e.type==="ServiceProviders::Individual"?S0(aP.create)(oP(e.presenter)):G.value},diagnosticName:"Livestream Guest Presenter"});var PF=Zo(Xo),LF=Qo(PF)(zo(jo)),OF=Ko(Vo),xF=Yo(OF),UF=nu(tu),NF=eu(UF),Gd=(function(){function e(){}return e.value=new e,e})(),t_=(function(){function e(){}return e.value=new e,e})(),n_=(function(){function e(){}return e.value=new e,e})(),iP={to:function(e){if(e instanceof Nt)return Gd.value;if(e instanceof _t&&e.value0 instanceof Nt)return t_.value;if(e instanceof _t&&e.value0 instanceof _t)return n_.value;throw new Error("Failed pattern match at Livestream.Types.Poll (line 36, column 1 - line 36, column 37): "+[e.constructor.name])},from:function(e){if(e instanceof Gd)return new Nt(mn.value);if(e instanceof t_)return new _t(new Nt(mn.value));if(e instanceof n_)return new _t(new _t(mn.value));throw new Error("Failed pattern match at Livestream.Types.Poll (line 36, column 1 - line 36, column 37): "+[e.constructor.name])}};var M0=function(e){if(e instanceof Gd)return"ready";if(e instanceof t_)return"live";if(e instanceof n_)return"closed";throw new Error("Failed pattern match at Livestream.Types.Poll (line 59, column 23 - line 62, column 21): "+[e.constructor.name])};var r_=(function(){return qr(jr)({parse:La(M0)(go(iP)(LF(LF(PF)(OF))(xF))(NF(NF(UF)))(xF)),default:Gd.value,diagnosticName:"livestream poll status"})})(),I0=function(e){return{id:e.id,question:e.question,multiSelect:e.multiSelect,options:e.options,autoDisplayMinutesFromStart:Ge(e.autoDisplayMinutesFromStart)}};var $F=function(e){return{fullName:e.fullName,firstName:e.firstName,totalStreams:e.totalStreams,undergrad:{college:Ge(e.undergrad.college),major:Ge(e.undergrad.major),year:Ge(e.undergrad.year)},gradCollege:Ge(e.gradCollege),workExperience:Ge(e.workExperience),admissionsStory:Ge(e.admissionsStory),pictureUrl:Ge(e.pictureUrl),allStreamsUrl:Ge(e.allStreamsUrl)}};var cP=xt(Oe),qF=Zo(Xo),WF=Qo(qF)(zo(jo)),jF=Ko(Vo),HF=Yo(jF),zF=nu(tu),BF=eu(zF),VF=qr(jr),JF=Bc(),GF=Vn(nn),fP=xt(tn),sP=V(Oe),dP=de(nn),cc=(function(){function e(){}return e.value=new e,e})(),If=(function(){function e(){}return e.value=new e,e})(),Af=(function(){function e(){}return e.value=new e,e})();var KF=En;var vP={to:function(e){if(e instanceof Nt)return cc.value;if(e instanceof _t&&e.value0 instanceof Nt)return If.value;if(e instanceof _t&&e.value0 instanceof _t)return Af.value;throw new Error("Failed pattern match at Livestream.Types.Conference (line 167, column 1 - line 167, column 39): "+[e.constructor.name])},from:function(e){if(e instanceof cc)return new Nt(mn.value);if(e instanceof If)return new _t(new Nt(mn.value));if(e instanceof Af)return new _t(new _t(mn.value));throw new Error("Failed pattern match at Livestream.Types.Conference (line 167, column 1 - line 167, column 39): "+[e.constructor.name])}};var YF=(function(){var e=function(n){if(n instanceof cc)return"waiting_room";if(n instanceof If)return"on_air";if(n instanceof Af)return"complete";throw new Error("Failed pattern match at Livestream.Types.Conference (line 180, column 17 - line 183, column 35): "+[n.constructor.name])};return La(e)(go(vP)(WF(WF(qF)(jF))(HF))(BF(BF(zF)))(HF))})(),QF=(function(){return VF({parse:YF,default:cc.value,diagnosticName:"livestream status"})})(),pP=VF({parse:Li,default:pn(Lp),diagnosticName:"livestream scheduled start time"}),a_=function(e){return{uid:e.uid,title:e.title,description:e.description,url:e.url,imageUrl:e.imageUrl,duration:e.duration,tailTime:e.tailTime,stats:e.stats,isPrivate:e.isPrivate,legacyRecording:e.legacyRecording,collegeFair:e.collegeFair,id:e.id,school:cP(Ge(e.school))(function(n){return{cityState:n.cityState,name:n.name,id:JF(n.id),slug:JF(n.slug)}}),scheduledStartTime:pP(e.scheduledStartTime),onAirTime:GF(Li)(Ge(e.onAirTime)),streamStatus:QF(e.streamStatus),watchUrl:Ge(e.watchUrl),streamingStartTime:GF(Li)(Ge(e.streamingStartTime)),polls:fP(e.polls)(function(n){return{poll:I0(n.poll),status:r_(n.status)}}),presenter:sP($F)(Ge(e.presenter)),partnerType:Ge(e.partnerType),guestPresenter:dP(Ge(e.guestPresenter))(AF),zoomJoinUrl:Ge(e.zoomJoinUrl),zoomStartUrl:Ge(e.zoomStartUrl)}};var gP=typeof CV<"u"&&CV.pathInfo||typeof global<"u"&&global.CV&&global.CV.pathInfo||(e=>null);function ZF(e,n){let r=typeof CV<"u"&&CV.apiEndpoint||typeof global<"u"&&global.CV&&global.CV.apiEndpoint;return r||console.error("Missing `CV.apiEndpoint` function"),r&&r(e,n)}function eC(e,n,r,u,c){return function(p,E){var d=e.newXHR(),h=e.fixupUrl(c.url,d);if(d.open(c.method||"GET",h,!0,c.username,c.password),c.headers)try{for(var O=0,y;(y=c.headers[O])!=null;O++)d.setRequestHeader(y.field,y.value)}catch(L){p(L)}var w=function(L){return function(){p(new Error(L))}};return d.onerror=w(r),d.ontimeout=w(n),d.onload=function(){E({status:d.status,statusText:d.statusText,headers:d.getAllResponseHeaders().split(`\r `).filter(function(L){return L.length>0}).map(function(L){var C=L.indexOf(":");return u(L.substring(0,C))(L.substring(C+2))}),body:d.response})},d.responseType=c.responseType,d.withCredentials=c.withCredentials,d.timeout=c.timeout,d.send(c.content),function(L,C,M){try{d.abort()}catch(k){return C(k)}return M()}}}var o_="application/json",tC="application/x-www-form-urlencoded";var rC=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),aC=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),oC=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),uC=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),iC=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),A0=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),u_=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),lC=function(e){return e instanceof A0?new H(tC):e instanceof u_?new H(o_):G.value};var cC=(function(){return u_.create})();var sC=$n();var i_=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),l_=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),fc=(function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e})(),dC=function(e){if(e instanceof i_||e instanceof l_)return sC(e.value0);if(e instanceof fc)return e.value1;throw new Error("Failed pattern match at Affjax.RequestHeader (line 26, column 1 - line 26, column 33): "+[e.constructor.name])};var L0=function(e){if(e instanceof i_)return"Accept";if(e instanceof l_)return"Content-Type";if(e instanceof fc)return e.value0;throw new Error("Failed pattern match at Affjax.RequestHeader (line 21, column 1 - line 21, column 32): "+[e.constructor.name])};var pC=ke(Be),x0=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),N0=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),P0=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),c_=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),f_=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),s_=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),mC=function(e){if(e instanceof x0)return"arraybuffer";if(e instanceof N0)return"blob";if(e instanceof P0)return"document";if(e instanceof c_||e instanceof f_)return"text";if(e instanceof s_)return"";throw new Error("Failed pattern match at Affjax.ResponseFormat (line 44, column 3 - line 50, column 19): "+[e.constructor.name])},_C=function(e){return e instanceof c_?new H(o_):G.value},hC=(function(){return new f_(pC)})();var gC=(function(){return new s_(pC)})();var yC=(function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e})();var EP=$n();var qd=function(e){return EP(Pp(e))};function RC(e,n,r){try{return n(JSON.parse(r))}catch(u){return e(u.message)}}var d_=function(e){return RC(Te.create,Ce.create,e)};function FP(e){return e.replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16)})}function TC(e,n,r){try{return n(FP(encodeURIComponent(r)).replace(/%20/g,"+"))}catch(u){return e(u)}}var v_=(function(){return rp(TC)(Ze(G.value))(H.create)})();var MP=gt(ka),wC=V(Oe),IP=sa(pi)(Yr);var AP=function(e){return e};var FC=(function(){var e=function(u){if(u.value1 instanceof G)return v_(u.value0);if(u.value1 instanceof H)return MP(wC(function(c){return function(p){return c+("="+p)}})(v_(u.value0)))(v_(u.value1.value0));throw new Error("Failed pattern match at Data.FormURLEncoded (line 37, column 16 - line 39, column 114): "+[u.constructor.name])},n=wC(wu("&")),r=IP(e);return function(u){return n(r(AP(u)))}})();var k0=(function(){function e(){}return e.value=new e,e})(),sc=(function(){function e(){}return e.value=new e,e})(),$0=(function(){function e(){}return e.value=new e,e})(),Lf=(function(){function e(){}return e.value=new e,e})(),p_=(function(){function e(){}return e.value=new e,e})(),jd=(function(){function e(){}return e.value=new e,e})(),W0=(function(){function e(){}return e.value=new e,e})(),H0=(function(){function e(){}return e.value=new e,e})(),B0=(function(){function e(){}return e.value=new e,e})(),J0=(function(){function e(){}return e.value=new e,e})(),G0=(function(){function e(){}return e.value=new e,e})(),q0=(function(){function e(){}return e.value=new e,e})(),j0=(function(){function e(){}return e.value=new e,e})(),z0=(function(){function e(){}return e.value=new e,e})(),V0=(function(){function e(){}return e.value=new e,e})(),m_=(function(){function e(){}return e.value=new e,e})();var xP=function(e){return e},NP={show:function(e){if(e instanceof k0)return"OPTIONS";if(e instanceof sc)return"GET";if(e instanceof $0)return"HEAD";if(e instanceof Lf)return"POST";if(e instanceof p_)return"PUT";if(e instanceof jd)return"DELETE";if(e instanceof W0)return"TRACE";if(e instanceof H0)return"CONNECT";if(e instanceof B0)return"PROPFIND";if(e instanceof J0)return"PROPPATCH";if(e instanceof G0)return"MKCOL";if(e instanceof q0)return"COPY";if(e instanceof j0)return"MOVE";if(e instanceof z0)return"LOCK";if(e instanceof V0)return"UNLOCK";if(e instanceof m_)return"PATCH";throw new Error("Failed pattern match at Data.HTTP.Method (line 43, column 1 - line 59, column 23): "+[e.constructor.name])}};var CC=qn(De(NP))(xP);var SC={eq:function(e){return function(n){return e instanceof k0&&n instanceof k0||e instanceof sc&&n instanceof sc||e instanceof $0&&n instanceof $0||e instanceof Lf&&n instanceof Lf||e instanceof p_&&n instanceof p_||e instanceof jd&&n instanceof jd||e instanceof W0&&n instanceof W0||e instanceof H0&&n instanceof H0||e instanceof B0&&n instanceof B0||e instanceof J0&&n instanceof J0||e instanceof G0&&n instanceof G0||e instanceof q0&&n instanceof q0||e instanceof j0&&n instanceof j0||e instanceof z0&&n instanceof z0||e instanceof V0&&n instanceof V0||e instanceof m_&&n instanceof m_}}};var IC=function(e){return zi(function(n){return function(){var u=e(function(c){return n(Te.create(c))()},function(c){return n(Ce.create(c))()});return function(c){return zi(function(p){return function(){return u(c,function(d){return p(Te.create(d))()},function(d){return p(Ce.create(d))()}),Pg}})}}})};var K0=ie(ku(hr)),OP=ed(hr),dc=vf(hr),AC=Tn(kp(em)(hr)),UP=Ni(of(hr)),__=V(Oe),kP=no(Pt)(Ir),$P=He(Da),WP=Vn(nn),HP=V(tn),BP=xt(gu),JP=ef(Bs),GP=ie(Ba);var h_=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),g_=(function(){function e(n,r){this.value0=n,this.value1=r}return e.create=function(n){return function(r){return new e(n,r)}},e})(),D_=(function(){function e(){}return e.value=new e,e})(),y_=(function(){function e(){}return e.value=new e,e})(),R_=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),LC=function(e){return function(n){var r=function(y){return y===""?K0(pE):qn(function(w){return OP(Zs.create(w))})(K0)(d_(y))},u=(function(){if(n.responseFormat instanceof x0)return dc("ArrayBuffer");if(n.responseFormat instanceof N0)return dc("Blob");if(n.responseFormat instanceof P0)return function(y){return AC(dc("Document")(y))(AC(dc("XMLDocument")(y))(dc("HTMLDocument")(y)))};if(n.responseFormat instanceof c_)return UP(function(y){return n.responseFormat.value0(r(y))})(dc("String"));if(n.responseFormat instanceof f_)return dc("String");if(n.responseFormat instanceof s_)return Ze(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 rC)return new Ce(y.value0(Ca));if(y instanceof aC)return new Ce(Ca(y.value0));if(y instanceof oC)return new Ce(Ca(y.value0));if(y instanceof uC)return new Ce(Ca(y.value0));if(y instanceof iC)return new Ce(Ca(y.value0));if(y instanceof A0)return Iu("Body contains values that cannot be encoded as application/x-www-form-urlencoded")(__(Ca)(FC(y.value0)));if(y instanceof u_)return new Ce(Ca(Im(y.value0)));throw new Error("Failed pattern match at Affjax (line 235, column 20 - line 250, column 69): "+[y.constructor.name])},p=function(y){return function(w){return y instanceof H&&!kP(us($P)(L0)(y.value0))(w)?ws(w)(y.value0):w}},E=function(y){return p(__(l_.create)(WP(lC)(y)))(p(__(i_.create)(_C(n.responseFormat)))(n.headers))},d=function(y){return{method:CC(n.method),url:n.url,headers:HP(function(w){return{field:L0(w),value:dC(w)}})(E(n.content)),content:y,responseType:mC(n.responseFormat),username:Bu(n.username),password:Bu(n.password),withCredentials:n.withCredentials,timeout:_n(0)(__(function(w){return w})(n.timeout))}},h=function(y){return BP(JP(IC(eC(e,"AffjaxTimeoutErrorMessageIdent","AffjaxRequestFailedMessageIdent",yC.create,d(y)))))(function(w){if(w instanceof Ce){var L=qd(u(w.value0.body));if(L instanceof Te)return new Te(new g_(Sb(L.value0),w.value0));if(L instanceof Ce)return new Ce({headers:w.value0.headers,status:w.value0.status,statusText:w.value0.statusText,body:L.value0});throw new Error("Failed pattern match at Affjax (line 209, column 9 - line 211, column 52): "+[L.constructor.name])}if(w instanceof Te)return new Te((function(){var C=Zc(w.value0),M=C==="AffjaxTimeoutErrorMessageIdent";if(M)return D_.value;var k=C==="AffjaxRequestFailedMessageIdent";return k?y_.value:new R_(w.value0)})());throw new Error("Failed pattern match at Affjax (line 207, column 144 - line 219, column 28): "+[w.constructor.name])})};if(n.content instanceof G)return h(Bu(G.value));if(n.content instanceof H){var O=c(n.content.value0);if(O instanceof Ce)return h(Bu(new H(O.value0)));if(O instanceof Te)return GP(new Te(new h_(O.value0)));throw new Error("Failed pattern match at Affjax (line 199, column 7 - line 203, column 48): "+[O.constructor.name])}throw new Error("Failed pattern match at Affjax (line 195, column 3 - line 203, column 48): "+[n.content.constructor.name])}};var xf=(function(){return{method:new Te(sc.value),url:"/",headers:[],content:G.value,username:G.value,password:G.value,withCredentials:!1,responseFormat:gC,timeout:G.value}})();var NC={eq:function(e){return function(n){return e===n}}};var Y0={newXHR:function(){return new XMLHttpRequest},fixupUrl:function(e){return e||"/"}};var PC=LC(Y0);function r2(e){return Buffer.from(e).toString("base64")}function a2(e,n,r){let u;try{u=n(btoa(r))}catch(c){u=e(c)}return u}var eD=typeof btoa=="function";function o2(e){let r=[];for(let u=0;u{let e=null,n=0,r=()=>{if(!Ku||!Ku.key)return Ku||console.error("Pusher config is missing in global context"),new zO;let u={auth:{headers:{"X-CSRF-Token":Ku.authToken}},authEndpoint:Ku.authPath,cluster:Ku.cluster};return Ku.dev&&Object.assign(u,{wsHost:Ku.dev.wsHost,wsPort:Ku.dev.wsPort,enabledTransports:["ws"],forceTLS:!1,disableStats:!0}),new E2.default(Ku.key,u)};return{acquireConnection:()=>(e||(e=r(),n=0),n++,e),releaseConnection:()=>{--n<=0&&(e&&e.disconnect(),e=null)}}})(),w2=e=>{let n=qO().subscribe(e.channel);return n.bind(e.event,e.handler),()=>{n.unbind(e.event,e.handler),jO()}};function zO(){typeof document<"u"&&(document.mockPusher=this),this.localObject={},this.channels=[],this.disconnect=function(){document.mockPusher=null},this.subscribe=function(e){let n=this.channels.find(u=>u.name===e);if(n)return n;let r=new VO(e);return this.channels.push(r),r},this.channelNames=function(){return this.channels.map(e=>e.name)}}function VO(e){this.name=e,this.handlers={},this.triggered=[],this.disconnect=()=>{},this.bind=function(n,r){this.handlers[n]=r},this.unbind=function(n,r){this.handlers[n]===r&&(this.handlers[n]=null)},this.trigger=function(n,r){this.triggered.push({eventName:n,eventData:r})}}var C_=function(e){return function(){console.error(e)}};var N2=function(e){var n=Qt(e);return function(r){return n(C_(r))}};var mU=ie(fr),P2=de(to),_U=V(Et),hU=N2(tf),nD=function(e){var n=function(u){var c=e(u);return T1(c.view(c.init.value0)(Ze(mU(void 0))))},r=function(u){return function(c){return function(p){return function(){var d=P2(P2(Fu)((function(){var O=_U(zm);return function(y){return O(Hd(y))}})()))(qm(c))();if(d instanceof G)return hU("Element #"+(c+" not found"))();if(d instanceof H){var h=E1(e(p))();return u(h)(d.value0)()}throw new Error("Failed pattern match at Elmish.Boot (line 117, column 11 - line 122, column 21): "+[d.constructor.name])}}}};return{mount:r(qT),renderToString:n,hydrate:r(jT)}};Hu();var U2=class extends nr.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 G2=ie(ho),UU=qr(Wm),kU=de(eo);var $U={init:G2(void 0),update:function(e){return function(n){return G2(void 0)}},view:function(e){return function(n){return ra}}},oD=function(e){var n=tl(e);return function(r){return nD(UU({parse:function(u){return kU(n(u))(function(c){return Ht(new Te("Component construction failed"))(Ce.create)(r.def(c))})},diagnosticName:"Props for "+r.diagnosticName,default:$U}))}};var ar=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),er=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})();var uk=Nu(Pt)(Lu),ik=ki(fr)(xl);var lk={show:function(e){return e}},ck=De(lk);var sD=qe;var fk=function(e){var n=vl(e);return function(r){return function(u){return function(c){var p=uk(["Pusher event ",u," over channel ",ck(r)]),E=function(d){return ik(n(p)(d))(c)()};return function(){return w2({channel:r,event:u,handler:E})}}}}},lS=function(e){var n=fk(e);return function(r){var u=r.Monad0(),c=de(u.Bind1()),p=Qt(r),E=ie(u.Applicative0());return function(d){return function(h){return function(O){return c(p(n(d)(h)(O)))(function(y){return E(p(y))})}}}}};var sk=R2(h2),dk=b2(sk),vk=de(Gr);var pk=xt(Oe),Cu=Ei();var mk=Y({reflectSymbol:function(){return"status"}})(qe)(on);var sS=Y({reflectSymbol:function(){return"id"}}),dS=sS(yt);var _k=xt(gu),hk=Y({reflectSymbol:function(){return"description"}}),fS=Y({reflectSymbol:function(){return"presenter"}}),Ga=dr(qe),gk=Y({reflectSymbol:function(){return"autoDisplayMinutesFromStart"}})(dr(yt)),Dk=Cu(gk(dS(Y({reflectSymbol:function(){return"multiSelect"}})(Lr)(Y({reflectSymbol:function(){return"options"}})(Ma(qe))(Y({reflectSymbol:function(){return"question"}})(qe)(on)))))),yk=Y({reflectSymbol:function(){return"name"}})(qe),Rk=Y({reflectSymbol:function(){return"title"}})(qe),bk=Y({reflectSymbol:function(){return"url"}})(qe),Tk=g2(dr(Cu(Y({reflectSymbol:function(){return"pusher"}})(Cu(Y({reflectSymbol:function(){return"dataChannel"}})(sD)(Y({reflectSymbol:function(){return"presenceChannel"}})(sD)(on))))(Y({reflectSymbol:function(){return"stream"}})(Cu(Y({reflectSymbol:function(){return"collegeFair"}})(Lr)(hk(qe)(Y({reflectSymbol:function(){return"duration"}})(yt)(Y({reflectSymbol:function(){return"guestPresenter"}})(dr(Cu(fS(td)(Y({reflectSymbol:function(){return"type"}})(qe)(on)))))(dS(Y({reflectSymbol:function(){return"imageUrl"}})(qe)(Y({reflectSymbol:function(){return"isPrivate"}})(Lr)(Y({reflectSymbol:function(){return"legacyRecording"}})(Lr)(Y({reflectSymbol:function(){return"onAirTime"}})(Ga)(Y({reflectSymbol:function(){return"partnerType"}})(Ga)(Y({reflectSymbol:function(){return"polls"}})(Ma(Cu(Y({reflectSymbol:function(){return"poll"}})(Dk)(mk))))(fS(dr(Cu(Y({reflectSymbol:function(){return"admissionsStory"}})(Ga)(Y({reflectSymbol:function(){return"allStreamsUrl"}})(Ga)(Y({reflectSymbol:function(){return"firstName"}})(qe)(Y({reflectSymbol:function(){return"fullName"}})(qe)(Y({reflectSymbol:function(){return"gradCollege"}})(Ga)(Y({reflectSymbol:function(){return"pictureUrl"}})(Ga)(Y({reflectSymbol:function(){return"totalStreams"}})(yt)(Y({reflectSymbol:function(){return"undergrad"}})(Cu(Y({reflectSymbol:function(){return"college"}})(Ga)(Y({reflectSymbol:function(){return"major"}})(Ga)(Y({reflectSymbol:function(){return"year"}})(Ga)(on)))))(Y({reflectSymbol:function(){return"workExperience"}})(Ga)(on))))))))))))(Y({reflectSymbol:function(){return"scheduledStartTime"}})(qe)(Y({reflectSymbol:function(){return"school"}})(dr(Cu(Y({reflectSymbol:function(){return"cityState"}})(qe)(sS(qe)(yk(Y({reflectSymbol:function(){return"slug"}})(qe)(on)))))))(Y({reflectSymbol:function(){return"stats"}})(Cu(Y({reflectSymbol:function(){return"parentAttendances"}})(yt)(Y({reflectSymbol:function(){return"parentRecordingWatchers"}})(yt)(Y({reflectSymbol:function(){return"parentRegistrations"}})(yt)(Y({reflectSymbol:function(){return"registrationsBySource"}})(Ma(Cu(Y({reflectSymbol:function(){return"parentCount"}})(yt)(Y({reflectSymbol:function(){return"source"}})(qe)(Y({reflectSymbol:function(){return"studentCount"}})(yt)(on))))))(Y({reflectSymbol:function(){return"studentAttendances"}})(yt)(Y({reflectSymbol:function(){return"studentRecordingWatchers"}})(yt)(Y({reflectSymbol:function(){return"studentRegistrations"}})(yt)(Y({reflectSymbol:function(){return"totalAttendances"}})(yt)(Y({reflectSymbol:function(){return"totalRecordingWatchers"}})(yt)(Y({reflectSymbol:function(){return"totalRegistrations"}})(yt)(on))))))))))))(Y({reflectSymbol:function(){return"streamStatus"}})(qe)(Y({reflectSymbol:function(){return"streamingStartTime"}})(Ga)(Y({reflectSymbol:function(){return"tailTime"}})(yt)(Rk(Y({reflectSymbol:function(){return"uid"}})(qe)(bk(Y({reflectSymbol:function(){return"watchUrl"}})(Ga)(Y({reflectSymbol:function(){return"zoomJoinUrl"}})(Ga)(Y({reflectSymbol:function(){return"zoomStartUrl"}})(Ga)(on))))))))))))))))))))))))))(on)))));var vS=dk("livestreams_live_promo_stream_path")(function(e){return function(n){return vk(e({}))(D2(function(r){return _k(Tk("Livestream Mini-Promo")(r))(function(u){return pk(Ge(u))(function(c){return{pusher:c.pusher,stream:a_(c.stream)}})})}))}});var A_=e=>e.play();var _l=kv(pS(),1);Hu();var mS=e=>{let[n,r]=nr.useState(),[u,c]=nr.useState(),p=nr.useRef();return p.current=e,$g(()=>{if(!u)return _l.default.isSupported()?r(Fk(e.videoStreamUrl,e.videoElementId,p)):e.onNotSupported(),c(!0),()=>{n&&n.destroy()}}),null},Fk=(e,n,r)=>{let u=document.getElementById(n);return u?(hls=new _l.default,r.current.onInstanceCreated&&r.current.onInstanceCreated(hls),hls.on(_l.default.Events.ERROR,function(c,p){r.current.onError&&r.current.onError("HLS error: "+p.type,p),p.fatal&&(p.type===_l.default.ErrorTypes.MEDIA_ERROR?hls.recoverMediaError():(hls.destroy(),r.current.onCriticalFail&&r.current.onCriticalFail(p.type)))}),hls.on(_l.default.Events.MEDIA_ATTACHED,()=>hls.loadSource(e)),hls.on(_l.default.Events.MANIFEST_PARSED,()=>r.current.onReady&&r.current.onReady()),hls.on(_l.default.Events.INIT_PTS_FOUND,(c,p)=>r.current.onInitialPts&&r.current.onInitialPts({initPTS:p.initPTS})),hls.attachMedia(u),hls):(r.current.onCriticalFail&&r.current.onCriticalFail("Couldn't find element #"+n),null)};var Sk=rc();var _S=function(){return function(){return Sk(mS)}};Hu();var Su={PRIMARY:"#008CFD",SECONDARY:"#6E84A3",WHITE:"#FFF",GRAY_300:"#E3EBF6"};var ev=kv(TS(),1),ES=4,u$=({trackColor:e,background:n})=>({props:r,children:u})=>nr.createElement("div",Object.assign({},r,{style:Object.assign({},r.style,{height:`${ES}px`,borderRadius:`${ES*2}px`,background:n||e})}),...u),i$=({horizontal:e})=>({props:n,isDragged:r})=>nr.createElement("svg",Object.assign({},n,{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18"}),nr.createElement("circle",{cx:"9",cy:"9",r:"8.5",fill:r?Su.SECONDARY:Su.WHITE,stroke:Su.SECONDARY}),nr.createElement("path",{stroke:r?Su.WHITE:Su.SECONDARY,d:e?"M7.5 6L7.5 12":"M6 7.5L12 7.5"}),nr.createElement("path",{stroke:r?Su.WHITE:Su.SECONDARY,d:e?"M10.5 6L10.5 12":"M6 10.5L12 10.5"})),wS=e=>nr.createElement("div",{"aria-label":e.ariaLabel},nr.createElement(ev.Range,{step:e.step,min:e.min,max:e.max,values:[e.value],onChange:(([n])=>e.onChange(n)),onFinalChange:(([n])=>e.onFinalChange&&e.onFinalChange(n)),renderTrack:u$({trackColor:e.trackColor||Su.GRAY_300,background:e.fillBefore?(0,ev.getTrackBackground)({values:[e.value],colors:[Su.PRIMARY,Su.GRAY_300],min:e.min,max:e.max,"aria-valuemax":e.max,"aria-valuemin":e.min,"aria-valuenow":e.value}):void 0}),renderThumb:i$({horizontal:!0})}));var c$=rc(),FS={CanPassToJavaScript0:function(){},CanReceiveFromJavaScript1:function(){return Xg}};var CS=function(e){return function(){return function(){return c$(wS)}}};var s$=function(e){return e},mD=Ca(null);var _D=function(e){return s$(Ca(e))};var TJ=iE(uE),EJ=Em()(),Uf=function(e){return TJ(e)},P_=function(e){var n=Kw(e)()();return function(){return function(){return function(r){return function(u){return function(c){return function(p){return n(EJ(c)({className:r,"aria-label":u}))(p)}}}}}}};var wJ=Vu(qu)()(),FJ=CS(FS)()(),CJ=Si(bm),SJ=P_(qu)()(),MJ=Si(Df),MS=bu(Ru),IJ=_d(Gu),O_=ul(jn),DD=ie(Ba),PS=Jn(tr),AJ=pn(Lp),Yu=ie(ho),LJ=ol(jn),gD=Qt(jn),xJ=V(Oe),NJ=AR(Tp),PJ=PS(Gr),hl=PS(Ci),OJ=Ka(ho),UJ=de(Gr),kJ=Jv(Os),$J=Ka(fr),yD=(function(){function e(){}return e.value=new e,e})(),RD=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),TD=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),IS=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),bD=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),AS=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),LS=(function(){function e(){}return e.value=new e,e})(),WJ=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),OS=function(e){return function(n){if(e.videoState instanceof G)return ra;if(e.videoState instanceof H){var r=wJ("")({style:Mi({minWidth:"6rem",width:"6rem"})})(FJ({value:(function(){return e.videoState.value0.muted?0:e.videoState.value0.volume})(),min:0,max:1,step:.05,onChange:CJ(n)(function(E){return ar.create(RD.create(E))}),ariaLabel:"Volume slider"})),u=(function(){if(e.videoState.value0.muted)return"fe-volume-x";if(lt)return"fe-volume-2";throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 119, column 5 - line 121, column 34): ")})(),c=SJ("btn large px-3 py-1 mr-3 text-white fe "+u)(_D("Mute the video"))({onClick:MJ(n)(new ar(yD.value))})(ra),p=MS("d-flex align-items-center text-white px-3")([tc("LIVE"),IJ("text-danger x-large ml-2 mt-n1")("\u25CF")]);return MS("mb-2 w-100 d-flex align-items-center bg-semi-transparent-black "+(function(){return e.visible?"":"hidden"})())([pl(e.config.liveIndicator)(p),pl(e.config.mute)(c),pl(e.config.volume)(r)])}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 95, column 1 - line 95, column 50): "+[e.constructor.name,n.constructor.name])}},US=function(e){return ar.create(TD.create(e))},xS=function(e){return O_(DD(new er(new WJ(function(n){return function(){return e(n)(),new ar(new TD(n))}}))))},U_=(function(){return new ar(new bD(!0))})(),kS=function(e){return{config:e,videoState:G.value,visible:!1,visibilityExpiration:AJ}},NS=2e3,$S=function(e){return function(n){if(n instanceof er)return Yu(e);if(n instanceof ar){var r=LJ(gD(function(){var E=Js();return xJ(function(d){return ar.create(AS.create(d))})(NJ(NS)(E))})),u=PJ(Wu(NS))(function(){return DD(new ar(LS.value))}),c=function(p){if(n.value0 instanceof yD)return Yu(e);var E=function(d){if(n.value0 instanceof RD)return Yu(e);if(n.value0 instanceof TD)return hl(O_(gD(function(){var O=v0(n.value0.value0)(),y=s0(n.value0.value0)();return new ar(new IS({muted:O,volume:y}))})))(function(){return Yu(e)});if(n.value0 instanceof IS)return Yu({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new H(n.value0.value0)});if(n.value0 instanceof bD)return hl(OJ(n.value0.value0)(r))(function(){return hl(O_(u))(function(){return Yu({config:e.config,videoState:e.videoState,visibilityExpiration:e.visibilityExpiration,visible:n.value0.value0})})});if(n.value0 instanceof AS)return Yu({config:e.config,videoState:e.videoState,visible:e.visible,visibilityExpiration:n.value0.value0});if(n.value0 instanceof LS)return hl(O_(UJ(gD(Js))(function(h){var O=kJ(h)(e.visibilityExpiration);return O?DD(new ar(new bD(!1))):u})))(function(){return Yu(e)});throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 135, column 1 - line 135, column 55): "+[n.value0.constructor.name])};return n.value0 instanceof RD&&e.videoState instanceof H?hl(r)(function(){return hl(xS(function(d){return function(){return $J(n.value0.value0>0)(lc(!1)(d))(),d0(n.value0.value0)(d)()}}))(function(){return Yu({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new H({muted:e.videoState.value0.muted,volume:n.value0.value0})})})}):E(!0)};return n.value0 instanceof yD&&e.videoState instanceof H?hl(r)(function(){return hl(xS(lc(!e.videoState.value0.muted)))(function(){return Yu({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new H({volume:e.videoState.value0.volume,muted:!e.videoState.value0.muted})})})}):c(!0)}throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 135, column 1 - line 135, column 55): "+[e.constructor.name,n.constructor.name])}},WS=function(e){if(e instanceof H)return!1;if(e instanceof G)return!0;throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 204, column 1 - line 204, column 37): "+[e.constructor.name])};var HS=e=>n=>r=>()=>e.then(r,n),BS=e=>e instanceof Error,JS=e=>e===null?"null":typeof e>"u"?"undefined":e.toString();var JJ=ie(ku(hr)),GJ=ed(hr),qJ=ke(Be),GS=Tn(kp(em)(hr)),jJ=vf(hr),zJ=V($s(fi)),VJ=Nb(hr),KJ=$v(Et),YJ=Yt(lb);var QJ=function(e){var n=function(r){if(BS(r))return JJ(r);if(lt)return GJ(new Zs(""));throw new Error("Failed pattern match at Utils.Promise (line 49, column 5 - line 51, column 43): "+[r.constructor.name])};return qn(function(r){return Ha("Promise failed: "+JS(e))})(qJ)(qd(GS(n(e))(GS(jJ("Error")(e))(zJ(Ha)(VJ(e))))))},k_=function(e){return zi(function(n){return KJ(YJ)(HS(e)(function(r){return n(Te.create(QJ(r)))()})(function(r){return n(Ce.create(r))()}))})};function qS(e,n){typeof CV<"u"&&CV.tracking&&CV.tracking.event(e,n)}var tG=um();var nG=function(e){var n=Qt(e);return function(r){return function(u){return n(function(){return qS(r,u)})}}},jS=function(e){var n=nG(e);return function(){return function(r){return function(u){return n(r)(tG(u))}}}};var aG=de(nn),oG=bu(qu),tv=de(to),ED=di(fr)(xl),mc=Si(Df),zS=Fm(Gu)()(),uG=_S()();var VS=Si(bm),KS=Vu(qu)()(),iG=P_(Ru)()(),lG=Cm(Gu),cG=bu(Ru),eM=Jn(tr),fG=jS(jn)(),sG=no(Pt)(Ir),dG=He(fu(ia)),kf=eM(Gr),vG=oi(Ba),pG=sr(cf),Pr=ie(Ba),tM=Qt(jn),YS=va(Bs),nM=is(Gr),Mr=ie(ho),Nr=eM(Ci),xa=ul(jn),QS=V(gu),XS=ol(jn),mG=V(Et),_G=Ta(Rm(gu)),hG=V(Oe);var rM=(function(){function e(){}return e.value=new e,e})(),aM=(function(){function e(){}return e.value=new e,e})(),nv=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),oM=(function(){function e(){}return e.value=new e,e})(),$f=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),uM=(function(){function e(){}return e.value=new e,e})(),iM=(function(){function e(){}return e.value=new e,e})(),ZS=(function(){function e(){}return e.value=new e,e})(),wD=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),FD=(function(){function e(){}return e.value=new e,e})(),W_=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),H_=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),$_=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),lM=(function(){function e(){}return e.value=new e,e})(),CD=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),SD=(function(){function e(){}return e.value=new e,e})(),cM=(function(){function e(){}return e.value=new e,e})(),fM=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),_c=(function(){function e(){}return e.value=new e,e})(),Qu=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),sM=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),gG=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),Wf=(function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e})(),dM=function(e){var n=e.Monad0(),r=de(n.Bind1()),u=Qt(e),c=ie(n.Applicative0());return function(p){return function(E){return function(d){return r(u(fF(p.videoId)))(function(h){return Ht(c(E.whenNotFound))(d)(aG(h)(rF))})}}}};var MD=dM(jn),vM=function(e){var n=dM(e);return function(r){return n(r)({whenNotFound:void 0})}},DG=vM(tf),yG=vM(jn),pM=function(e){return function(n){return function(r){var u=(function(){var M=oG("position-absolute-fullsize py-6 d-flex align-items-center justify-content-around");if(n.stage instanceof oM)return M(e.errorScreen("It appears that video playback is not supported in your browser."));if(n.stage instanceof uM)return M(e.errorScreen("The video didn't load correctly, try refreshing the page."));if(n.stage instanceof nv)return M(e.introScreen);if(n.stage instanceof $f)return ra;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 242, column 20 - line 253, column 16): "+[n.stage.constructor.name])})(),c=(function(){return n.stage instanceof nv?n.stage.value0.reset:!1})(),p=Uf(function(M){return tv(Zm(M))(ED(function(k){return r(new ar(new gG({time:k})))}))}),E=Uf(function(M){return tv(Zm(M))(ED(function(k){return r(new ar(new sM({playing:!0,time:k})))}))}),d=function(M){return r(er.create(M))},h=Uf(function(M){return tv(Zm(M))(ED(function(k){return d(new CD(k))}))}),O=mc(d)(lM.value),y=vd([zS("w-100 t--real-video")({id:n.videoId,controls:Io(n.customControls),onVolumeChange:O,onTimeUpdate:p,onPlay:E,onPause:h})(""),pl(!c)(uG({videoStreamUrl:e.watchUrl,videoElementId:n.videoId,onNotSupported:d(iM.value),onError:function(M,k){return void 0},onCriticalFail:VS(d)(function(M){var k=M==="networkError";return k?FD.value:new W_("HLS player crashed")}),onReady:d(new H_({autoPlay:e.autoPlay})),onInitialPts:VS(d)(function(M){return new fM(M.initPTS)})}))]),w=(function(){return n.stage instanceof $f&&n.stage.value0.unmuteOverlay?KS("position-absolute-fullsize d-flex align-items-center justify-content-center t--unmute-overlay")({style:Mi({pointerEvents:"none"})})(iG("btn btn-sm btn-light border-dark px-4 d-flex align-items-center")(mD)({onClick:mc(d)(cM.value),style:Mi({pointerEvents:"all"})})([tc("click for sound"),lG("fe fe-volume-2 ml-2")("")])):ra})(),L=function(M){return KS("position-absolute-fullsize d-flex align-items-end t--controls-overlay")({onMouseMove:mc(d)(new Qu(U_)),onMouseDown:mc(d)(new Qu(U_)),onTouchStart:mc(d)(new Qu(U_))})(OS(M)(function(k){return d(Qu.create(k))}))},C=zS("w-100 t--real-video")({id:n.videoId,controls:Io(n.customControls),playsInline:!0,onVolumeChange:O,onTimeUpdate:p,onPlay:E,onPause:h,onLoadedMetadata:mc(d)(new H_({autoPlay:e.autoPlay})),onError:mc(d)(FD.value),src:(function(){return c?"":e.watchUrl})()})("");return cG("position-relative w-100")([(function(){if(n.support instanceof rM)return y;if(n.support instanceof aM)return C;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 163, column 7 - line 165, column 40): "+[n.support.constructor.name])})(),D0(n.customControls)(L),pl(n.allowSound)(w),u])}}},RG=function(e){var n=Qt(e.MonadEffect0());return function(r){return n(function(){return DG(r)(lc(!1))(),SD.value})}},bG=RG(_F),ID=function(e){return fG("Livestream: Error")({livestream_error_message:e})};var TG=function(e){return Qt(e)(function(){var r=tv(tv(Fu)(h0))(_0)();return sG(function(u){return dG(Pm(u)(r))(new H(0))})(["iPad","iPod","iPhone"])})},mM=TG(jn),EG=function(e){var n=function(u){return kf(vG(e.allowSound)(pG(Ha("Skipping attempt to play unmuted because sound was programmatically disallowed"))))(function(){return kf(k_(A_(u)))(function(){return Pr(new $_({unmuteOverlay:!1}))})})},r=function(u){return kf(tM(lc(!0)(u)))(function(){return kf(k_(A_(u)))(function(){return Pr(new $_({unmuteOverlay:!0}))})})};return MD(e)({whenNotFound:new W_("