var Purs_EntryPoints_Livestream_MiniPromo=(()=>{var rw=Object.create;var wf=Object.defineProperty;var aw=Object.getOwnPropertyDescriptor;var ow=Object.getOwnPropertyNames;var iw=Object.getPrototypeOf,uw=Object.prototype.hasOwnProperty;var Jg=e=>wf(e,"__esModule",{value:!0});var lw=(e,n)=>()=>(e&&(n=e(e=0)),n);var io=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),Gg=(e,n)=>{Jg(e);for(var r in n)wf(e,r,{get:n[r],enumerable:!0})},cw=(e,n,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of ow(n))!uw.call(e,i)&&i!=="default"&&wf(e,i,{get:()=>n[i],enumerable:!(r=aw(n,i))||r.enumerable});return e},xf=e=>cw(Jg(wf(e!=null?rw(iw(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var l_={};Gg(l_,{Children:()=>B2,Component:()=>J2,Fragment:()=>K2,PureComponent:()=>Z2,Suspense:()=>eM,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>H2,cloneElement:()=>$2,createContext:()=>G2,createElement:()=>q2,createRef:()=>z2,default:()=>Hn,forwardRef:()=>V2,isValidElement:()=>Y2,lazy:()=>Q2,memo:()=>X2,useCallback:()=>tM,useContext:()=>nM,useEffect:()=>u_,useImperativeHandle:()=>rM,useLayoutEffect:()=>aM,useMemo:()=>oM,useReducer:()=>iM,useRef:()=>uM,useState:()=>lM,version:()=>cM});var Hn,H2,B2,$2,J2,G2,q2,z2,V2,K2,Y2,Q2,X2,Z2,eM,tM,nM,u_,rM,aM,oM,iM,uM,lM,cM,oi=lw(()=>{Hn=window.React,{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:H2,Children:B2,cloneElement:$2,Component:J2,createContext:G2,createElement:q2,createRef:z2,forwardRef:V2,Fragment:K2,isValidElement:Y2,lazy:Q2,memo:X2,PureComponent:Z2,Suspense:eM,useCallback:tM,useContext:nM,useEffect:u_,useImperativeHandle:rM,useLayoutEffect:aM,useMemo:oM,useReducer:iM,useRef:uM,useState:lM,version:cM}=window.React});var b_=io((ede,G0)=>{"use strict";var J0=Object.getOwnPropertySymbols,d3=Object.prototype.hasOwnProperty,p3=Object.prototype.propertyIsEnumerable;function v3(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function m3(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var n={},r=0;r<10;r++)n["_"+String.fromCharCode(r)]=r;var i=Object.getOwnPropertyNames(n).map(function(p){return n[p]});if(i.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(p){l[p]=p}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}G0.exports=m3()?Object.assign:function(e,n){for(var r,i=v3(e),l,p=1;p{"use strict";var T_=b_(),Cl=60103,q0=60106;Vt.Fragment=60107;Vt.StrictMode=60108;Vt.Profiler=60114;var z0=60109,V0=60110,K0=60112;Vt.Suspense=60113;var Y0=60115,Q0=60116;typeof Symbol=="function"&&Symbol.for&&(Ba=Symbol.for,Cl=Ba("react.element"),q0=Ba("react.portal"),Vt.Fragment=Ba("react.fragment"),Vt.StrictMode=Ba("react.strict_mode"),Vt.Profiler=Ba("react.profiler"),z0=Ba("react.provider"),V0=Ba("react.context"),K0=Ba("react.forward_ref"),Vt.Suspense=Ba("react.suspense"),Y0=Ba("react.memo"),Q0=Ba("react.lazy"));var Ba,X0=typeof Symbol=="function"&&Symbol.iterator;function _3(e){return e===null||typeof e!="object"?null:(e=X0&&e[X0]||e["@@iterator"],typeof e=="function"?e:null)}function ls(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r{"use strict";ly.exports=uy()});var Ay=io(xl=>{"use strict";var go=b_(),ci=cy();function wn(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;rfs;fs++)mr[fs]=fs+1;var mr,fs;mr[15]=0;var T3=/^[: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]*$/,_y=Object.prototype.hasOwnProperty,hy={},gy={};function Dy(e){return _y.call(gy,e)?!0:_y.call(hy,e)?!1:T3.test(e)?gy[e]=!0:(hy[e]=!0,!1)}function E3(e,n,r,i){if(r!==null&&r.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function F3(e,n,r,i){if(n===null||typeof n=="undefined"||E3(e,n,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function Ur(e,n,r,i,l,p,T){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=i,this.attributeNamespace=l,this.mustUseProperty=r,this.propertyName=e,this.type=n,this.sanitizeURL=p,this.removeEmptyString=T}var _r={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_r[e]=new Ur(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];_r[n]=new Ur(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_r[e]=new Ur(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_r[e]=new Ur(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){_r[e]=new Ur(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_r[e]=new Ur(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_r[e]=new Ur(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_r[e]=new Ur(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_r[e]=new Ur(e,5,!1,e.toLowerCase(),null,!1,!1)});var O_=/[\-:]([a-z])/g;function U_(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(O_,U_);_r[n]=new Ur(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(O_,U_);_r[n]=new Ur(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(O_,U_);_r[n]=new Ur(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_r[e]=new Ur(e,1,!1,e.toLowerCase(),null,!1,!1)});_r.xlinkHref=new Ur("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_r[e]=new Ur(e,1,!1,e.toLowerCase(),null,!0,!0)});var C3=/["'&<>]/;function Du(e){if(typeof e=="boolean"||typeof e=="number")return""+e;e=""+e;var n=C3.exec(e);if(n){var r="",i,l=0;for(i=n.index;iep))throw Error(wn(301));if(e===Oo)if(Zd=!0,e={action:r,next:null},Ni===null&&(Ni=new Map),r=Ni.get(n),r===void 0)Ni.set(n,e);else{for(n=r;n.next!==null;)n=n.next;n.next=e}}function W_(){}var Ru=null,I3={readContext:function(e){var n=Ru.threadID;return ss(e,n),e[n]},useContext:function(e){yu();var n=Ru.threadID;return ss(e,n),e[n]},useMemo:Fy,useReducer:Ey,useRef:function(e){Oo=yu(),vn=k_();var n=vn.memoizedState;return n===null?(e={current:e},vn.memoizedState=e):n},useState:function(e){return Ey(Ty,e)},useLayoutEffect:function(){},useCallback:function(e,n){return Fy(function(){return e},n)},useImperativeHandle:W_,useEffect:W_,useDebugValue:W_,useDeferredValue:function(e){return yu(),e},useTransition:function(){return yu(),[function(e){e()},!1]},useOpaqueIdentifier:function(){return(Ru.identifierPrefix||"")+"R:"+(Ru.uniqueID++).toString(36)},useMutableSource:function(e,n){return yu(),n(e._source)}},Cy={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function wy(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 xy={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},A3=go({menuitem:!0},xy),ps={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},L3=["Webkit","ms","Moz","O"];Object.keys(ps).forEach(function(e){L3.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),ps[n]=ps[e]})});var j3=/([A-Z])/g,N3=/^ms-/,Pi=ci.Children.toArray,H_=R3.ReactCurrentDispatcher,P3={listing:!0,pre:!0,textarea:!0},O3=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Sy={},B_={};function U3(e){if(e==null)return e;var n="";return ci.Children.forEach(e,function(r){r!=null&&(n+=r)}),n}var k3=Object.prototype.hasOwnProperty,W3={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function My(e,n){if(e===void 0)throw Error(wn(152,cs(n)||"Component"))}function H3(e,n,r){function i(T,d){var h=d.prototype&&d.prototype.isReactComponent,P=b3(d,n,r,h),y=[],E=!1,M={isMounted:function(){return!1},enqueueForceUpdate:function(){if(y===null)return null},enqueueReplaceState:function(Z,ne){E=!0,y=[ne]},enqueueSetState:function(Z,ne){if(y===null)return null;y.push(ne)}};if(h){if(h=new d(T.props,P,M),typeof d.getDerivedStateFromProps=="function"){var C=d.getDerivedStateFromProps.call(null,T.props,h.state);C!=null&&(h.state=go({},h.state,C))}}else if(Oo={},h=d(T.props,P,M),h=Ry(d,T.props,h,P),h==null||h.render==null){e=h,My(e,d);return}if(h.props=T.props,h.context=P,h.updater=M,M=h.state,M===void 0&&(h.state=M=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){M=y;var S=E;if(y=null,E=!1,S&&M.length===1)h.state=M[0];else{C=S?M[0]:h.state;var O=!0;for(S=S?1:0;S=d))throw Error(wn(304));var h=new Uint16Array(d);for(h.set(T),mr=h,mr[0]=p+1,T=p;T=h.children.length){var P=h.footer;if(P!==""&&(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===Yd)this.popProvider(h.type);else if(h.type===Qd){this.suspenseDepth--;var y=p.pop();if(T){T=!1;var E=h.fallbackFrame;if(!E)throw Error(wn(303));this.stack.push(E),p[this.suspenseDepth]+="";continue}else p[this.suspenseDepth]+=y}p[this.suspenseDepth]+=P}else{var M=h.children[h.childIndex++],C="";try{C+=this.render(M,h.context,h.domNamespace)}catch(S){throw S!=null&&typeof S.then=="function"?Error(wn(294)):S}finally{}p.length<=this.suspenseDepth&&p.push(""),p[this.suspenseDepth]+=C}}return p[0]}finally{H_.current=l,Ru=i,by()}},n.render=function(r,i,l){if(typeof r=="string"||typeof r=="number")return l=""+r,l===""?"":this.makeStaticMarkup?Du(l):this.previousWasTextNode?""+Du(l):(this.previousWasTextNode=!0,Du(l));if(i=H3(r,i,this.threadID),r=i.child,i=i.context,r===null||r===!1)return"";if(!ci.isValidElement(r)){if(r!=null&&r.$$typeof!=null)throw l=r.$$typeof,Error(l===S_?wn(257):wn(258,l.toString()));return r=Pi(r),this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),""}var p=r.type;if(typeof p=="string")return this.renderDOM(r,i,l);switch(p){case vy:case py:case M_:case I_:case j_:case Kd:return r=Pi(r.props.children),this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),"";case Qd:throw Error(wn(294));case dy:throw Error(wn(343))}if(typeof p=="object"&&p!==null)switch(p.$$typeof){case L_:Oo={};var T=p.render(r.props,r.ref);return T=Ry(p.render,r.props,T,r.ref),T=Pi(T),this.stack.push({type:null,domNamespace:l,children:T,childIndex:0,context:i,footer:""}),"";case N_:return r=[ci.createElement(p.type,go({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),"";case Yd:return p=Pi(r.props.children),l={type:r,domNamespace:l,children:p,childIndex:0,context:i,footer:""},this.pushProvider(r),this.stack.push(l),"";case A_:p=r.type,T=r.props;var d=this.threadID;return ss(p,d),p=Pi(T.children(p[d])),this.stack.push({type:r,domNamespace:l,children:p,childIndex:0,context:i,footer:""}),"";case fy:throw Error(wn(338));case P_:return p=r.type,T=p._init,p=T(p._payload),r=[ci.createElement(p,go({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:l,children:r,childIndex:0,context:i,footer:""}),""}throw Error(wn(130,p==null?p:typeof p,""))},n.renderDOM=function(r,i,l){var p=r.type.toLowerCase();if(l===Cy.html&&wy(p),!Sy.hasOwnProperty(p)){if(!O3.test(p))throw Error(wn(65,p));Sy[p]=!0}var T=r.props;if(p==="input")T=go({type:void 0},T,{defaultChecked:void 0,defaultValue:void 0,value:T.value!=null?T.value:T.defaultValue,checked:T.checked!=null?T.checked:T.defaultChecked});else if(p==="textarea"){var d=T.value;if(d==null){d=T.defaultValue;var h=T.children;if(h!=null){if(d!=null)throw Error(wn(92));if(Array.isArray(h)){if(!(1>=h.length))throw Error(wn(93));h=h[0]}d=""+h}d==null&&(d="")}T=go({},T,{value:void 0,children:""+d})}else if(p==="select")this.currentSelectValue=T.value!=null?T.value:T.defaultValue,T=go({},T,{value:void 0});else if(p==="option"){h=this.currentSelectValue;var P=U3(T.children);if(h!=null){var y=T.value!=null?T.value+"":P;if(d=!1,Array.isArray(h)){for(var E=0;E":(ne+=">",d="");e:{if(h=T.dangerouslySetInnerHTML,h!=null){if(h.__html!=null){h=h.__html;break e}}else if(h=T.children,typeof h=="string"||typeof h=="number"){h=Du(h);break e}h=null}return h!=null?(T=[],P3.hasOwnProperty(p)&&h.charAt(0)===` `&&(ne+=` `),ne+=h):T=Pi(T.children),r=r.type,l=l==null||l==="http://www.w3.org/1999/xhtml"?wy(r):l==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":l,this.stack.push({domNamespace:l,type:p,children:T,childIndex:0,context:i,footer:d}),this.previousWasTextNode=!1,ne},e}();xl.renderToNodeStream=function(){throw Error(wn(207))};xl.renderToStaticMarkup=function(e,n){e=new Iy(e,!0,n);try{return e.read(1/0)}finally{e.destroy()}};xl.renderToStaticNodeStream=function(){throw Error(wn(208))};xl.renderToString=function(e,n){e=new Iy(e,!1,n);try{return e.read(1/0)}finally{e.destroy()}};xl.version="17.0.2"});var jy=io((ade,Ly)=>{"use strict";Ly.exports=Ay()});var BE=io((rv,sg)=>{(function(n,r){typeof rv=="object"&&typeof sg=="object"?sg.exports=r():typeof define=="function"&&define.amd?define([],r):typeof rv=="object"?rv.Pusher=r():n.Pusher=r()})(window,function(){return function(e){var n={};function r(i){if(n[i])return n[i].exports;var l=n[i]={i,l:!1,exports:{}};return e[i].call(l.exports,l,l.exports,r),l.l=!0,l.exports}return r.m=e,r.c=n,r.d=function(i,l,p){r.o(i,l)||Object.defineProperty(i,l,{enumerable:!0,get:p})},r.r=function(i){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,l){if(l&1&&(i=r(i)),l&8||l&4&&typeof i=="object"&&i&&i.__esModule)return i;var p=Object.create(null);if(r.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:i}),l&2&&typeof i!="string")for(var T in i)r.d(p,T,function(d){return i[d]}.bind(null,T));return p},r.n=function(i){var l=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(l,"a",l),l},r.o=function(i,l){return Object.prototype.hasOwnProperty.call(i,l)},r.p="",r(r.s=2)}([function(e,n,r){"use strict";var i=this&&this.__extends||function(){var C=function(S,O){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(S,O)};return function(S,O){C(S,O);function B(){this.constructor=S}S.prototype=O===null?Object.create(O):(B.prototype=O.prototype,new B)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=256,p=function(){function C(S){S===void 0&&(S="="),this._paddingCharacter=S}return C.prototype.encodedLength=function(S){return this._paddingCharacter?(S+2)/3*4|0:(S*8+5)/6|0},C.prototype.encode=function(S){for(var O="",B=0;B>>3*6&63),O+=this._encodeByte(Q>>>2*6&63),O+=this._encodeByte(Q>>>1*6&63),O+=this._encodeByte(Q>>>0*6&63)}var z=S.length-B;if(z>0){var Q=S[B]<<16|(z===2?S[B+1]<<8:0);O+=this._encodeByte(Q>>>3*6&63),O+=this._encodeByte(Q>>>2*6&63),z===2?O+=this._encodeByte(Q>>>1*6&63):O+=this._paddingCharacter||"",O+=this._paddingCharacter||""}return O},C.prototype.maxDecodedLength=function(S){return this._paddingCharacter?S/4*3|0:(S*6+7)/8|0},C.prototype.decodedLength=function(S){return this.maxDecodedLength(S.length-this._getPaddingLength(S))},C.prototype.decode=function(S){if(S.length===0)return new Uint8Array(0);for(var O=this._getPaddingLength(S),B=S.length-O,Q=new Uint8Array(this.maxDecodedLength(B)),z=0,Z=0,ne=0,ee=0,pe=0,ve=0,$e=0;Z>>4,Q[z++]=pe<<4|ve>>>2,Q[z++]=ve<<6|$e,ne|=ee&l,ne|=pe&l,ne|=ve&l,ne|=$e&l;if(Z>>4,ne|=ee&l,ne|=pe&l),Z>>2,ne|=ve&l),Z>>8&0-65-26+97,O+=51-S>>>8&26-97-52+48,O+=61-S>>>8&52-48-62+43,O+=62-S>>>8&62-43-63+47,String.fromCharCode(O)},C.prototype._decodeChar=function(S){var O=l;return O+=(42-S&S-44)>>>8&-l+S-43+62,O+=(46-S&S-48)>>>8&-l+S-47+63,O+=(47-S&S-58)>>>8&-l+S-48+52,O+=(64-S&S-91)>>>8&-l+S-65+0,O+=(96-S&S-123)>>>8&-l+S-97+26,O},C.prototype._getPaddingLength=function(S){var O=0;if(this._paddingCharacter){for(var B=S.length-1;B>=0&&S[B]===this._paddingCharacter;B--)O++;if(S.length<4||O>2)throw new Error("Base64Coder: incorrect padding")}return O},C}();n.Coder=p;var T=new p;function d(C){return T.encode(C)}n.encode=d;function h(C){return T.decode(C)}n.decode=h;var P=function(C){i(S,C);function S(){return C!==null&&C.apply(this,arguments)||this}return S.prototype._encodeByte=function(O){var B=O;return B+=65,B+=25-O>>>8&0-65-26+97,B+=51-O>>>8&26-97-52+48,B+=61-O>>>8&52-48-62+45,B+=62-O>>>8&62-45-63+95,String.fromCharCode(B)},S.prototype._decodeChar=function(O){var B=l;return B+=(44-O&O-46)>>>8&-l+O-45+62,B+=(94-O&O-96)>>>8&-l+O-95+63,B+=(47-O&O-58)>>>8&-l+O-48+52,B+=(64-O&O-91)>>>8&-l+O-65+0,B+=(96-O&O-123)>>>8&-l+O-97+26,B},S}(p);n.URLSafeCoder=P;var y=new P;function E(C){return y.encode(C)}n.encodeURLSafe=E;function M(C){return y.decode(C)}n.decodeURLSafe=M,n.encodedLength=function(C){return T.encodedLength(C)},n.maxDecodedLength=function(C){return T.maxDecodedLength(C)},n.decodedLength=function(C){return T.decodedLength(C)}},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i="utf8: invalid string",l="utf8: invalid source encoding";function p(h){for(var P=new Uint8Array(T(h)),y=0,E=0;E>6,P[y++]=128|M&63):M<55296?(P[y++]=224|M>>12,P[y++]=128|M>>6&63,P[y++]=128|M&63):(E++,M=(M&1023)<<10,M|=h.charCodeAt(E)&1023,M+=65536,P[y++]=240|M>>18,P[y++]=128|M>>12&63,P[y++]=128|M>>6&63,P[y++]=128|M&63)}return P}n.encode=p;function T(h){for(var P=0,y=0;y=h.length-1)throw new Error(i);y++,P+=4}else throw new Error(i)}return P}n.encodedLength=T;function d(h){for(var P=[],y=0;y=h.length)throw new Error(l);var C=h[++y];if((C&192)!=128)throw new Error(l);E=(E&31)<<6|C&63,M=128}else if(E<240){if(y>=h.length-1)throw new Error(l);var C=h[++y],S=h[++y];if((C&192)!=128||(S&192)!=128)throw new Error(l);E=(E&15)<<12|(C&63)<<6|S&63,M=2048}else if(E<248){if(y>=h.length-2)throw new Error(l);var C=h[++y],S=h[++y],O=h[++y];if((C&192)!=128||(S&192)!=128||(O&192)!=128)throw new Error(l);E=(E&15)<<18|(C&63)<<12|(S&63)<<6|O&63,M=65536}else throw new Error(l);if(E=55296&&E<=57343)throw new Error(l);if(E>=65536){if(E>1114111)throw new Error(l);E-=65536,P.push(String.fromCharCode(55296|E>>10)),E=56320|E&1023}}P.push(String.fromCharCode(E))}return P.join("")}n.decode=d},function(e,n,r){e.exports=r(3).default},function(e,n,r){"use strict";r.r(n);var i=function(){function f(s,m){this.lastId=0,this.prefix=s,this.name=m}return f.prototype.create=function(s){this.lastId++;var m=this.lastId,F=this.prefix+m,w=this.name+"["+m+"]",$=!1,ie=function(){$||(s.apply(null,arguments),$=!0)};return this[m]=ie,{number:m,id:F,name:w,callback:ie}},f.prototype.remove=function(s){delete this[s.number]},f}(),l=new i("_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:""},T=p,d=function(){function f(s){this.options=s,this.receivers=s.receivers||l,this.loading={}}return f.prototype.load=function(s,m,F){var w=this;if(w.loading[s]&&w.loading[s].length>0)w.loading[s].push(F);else{w.loading[s]=[F];var $=Ct.createScriptRequest(w.getPath(s,m)),ie=w.receivers.create(function(Ee){if(w.receivers.remove(ie),w.loading[s]){var Xe=w.loading[s];delete w.loading[s];for(var Yt=function(cr){cr||$.cleanup()},fn=0;fn>>6)+M(128|s&63):M(224|s>>>12&15)+M(128|s>>>6&63)+M(128|s&63)},z=function(f){return f.replace(/[^\x00-\x7F]/g,Q)},Z=function(f){var s=[0,2,1][f.length%3],m=f.charCodeAt(0)<<16|(f.length>1?f.charCodeAt(1):0)<<8|(f.length>2?f.charCodeAt(2):0),F=[C.charAt(m>>>18),C.charAt(m>>>12&63),s>=2?"=":C.charAt(m>>>6&63),s>=1?"=":C.charAt(m&63)];return F.join("")},ne=window.btoa||function(f){return f.replace(/[\s\S]{1,3}/g,Z)},ee=function(){function f(s,m,F,w){var $=this;this.clear=m,this.timer=s(function(){$.timer&&($.timer=w($.timer))},F)}return f.prototype.isRunning=function(){return this.timer!==null},f.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},f}(),pe=ee,ve=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var $ in w)w.hasOwnProperty($)&&(F[$]=w[$])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}();function $e(f){window.clearTimeout(f)}function qe(f){window.clearInterval(f)}var Ke=function(f){ve(s,f);function s(m,F){return f.call(this,setTimeout,$e,m,function(w){return F(),null})||this}return s}(pe),an=function(f){ve(s,f);function s(m,F){return f.call(this,setInterval,qe,m,function(w){return F(),w})||this}return s}(pe),ln={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(f){return new Ke(0,f)},method:function(f){for(var s=[],m=1;m0)for(var w=0;w<$.length;w++)$[w].fn.apply($[w].context||window,ie);else this.failThrough&&this.failThrough(s,m);return this},f}(),Qe=We,It=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var $ in w)w.hasOwnProperty($)&&(F[$]=w[$])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),rn=function(f){It(s,f);function s(m,F,w,$,ie){var Ee=f.call(this)||this;return Ee.initialize=Ct.transportConnectionInitializer,Ee.hooks=m,Ee.name=F,Ee.priority=w,Ee.key=$,Ee.options=ie,Ee.state="new",Ee.timeline=ie.timeline,Ee.activityTimeout=ie.activityTimeout,Ee.id=Ee.timeline.generateUniqueID(),Ee}return s.prototype.handlesActivityChecks=function(){return Boolean(this.hooks.handlesActivityChecks)},s.prototype.supportsPing=function(){return Boolean(this.hooks.supportsPing)},s.prototype.connect=function(){var m=this;if(this.socket||this.state!=="initialized")return!1;var F=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(F,this.options)}catch(w){return lt.defer(function(){m.onError(w),m.changeState("closed")}),!1}return this.bindListeners(),Ge.debug("Connecting",{transport:this.name,url:F}),this.changeState("connecting"),!0},s.prototype.close=function(){return this.socket?(this.socket.close(),!0):!1},s.prototype.send=function(m){var F=this;return this.state==="open"?(lt.defer(function(){F.socket&&F.socket.send(m)}),!0):!1},s.prototype.ping=function(){this.state==="open"&&this.supportsPing()&&this.socket.ping()},s.prototype.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0},s.prototype.onError=function(m){this.emit("error",{type:"WebSocketError",error:m}),this.timeline.error(this.buildTimelineMessage({error:m.toString()}))},s.prototype.onClose=function(m){m?this.changeState("closed",{code:m.code,reason:m.reason,wasClean:m.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},s.prototype.onMessage=function(m){this.emit("message",m)},s.prototype.onActivity=function(){this.emit("activity")},s.prototype.bindListeners=function(){var m=this;this.socket.onopen=function(){m.onOpen()},this.socket.onerror=function(F){m.onError(F)},this.socket.onclose=function(F){m.onClose(F)},this.socket.onmessage=function(F){m.onMessage(F)},this.supportsPing()&&(this.socket.onactivity=function(){m.onActivity()})},s.prototype.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},s.prototype.changeState=function(m,F){this.state=m,this.timeline.info(this.buildTimelineMessage({state:m,params:F})),this.emit(m,F)},s.prototype.buildTimelineMessage=function(m){return yt({cid:this.id},m)},s}(Qe),it=rn,Bt=function(){function f(s){this.hooks=s}return f.prototype.isSupported=function(s){return this.hooks.isSupported(s)},f.prototype.createConnection=function(s,m,F,w){return new it(this.hooks,s,m,F,w)},f}(),_t=Bt,un=new _t({urls:le,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return Boolean(Ct.getWebSocketAPI())},isSupported:function(){return Boolean(Ct.getWebSocketAPI())},getSocket:function(f){return Ct.createWebSocket(f)}}),Et={urls:ce,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Xt=yt({getSocket:function(f){return Ct.HTTPFactory.createStreamingSocket(f)}},Et),Rn=yt({getSocket:function(f){return Ct.HTTPFactory.createPollingSocket(f)}},Et),Nn={isSupported:function(){return Ct.isXHRSupported()}},Zn=new _t(yt({},Xt,Nn)),Mn=new _t(yt({},Rn,Nn)),gr={ws:un,xhr_streaming:Zn,xhr_polling:Mn},Pn=gr,mn=new _t({file:"sockjs",urls:De,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(f,s){return new window.SockJS(f,null,{js_path:y.getPath("sockjs",{useTLS:s.useTLS}),ignore_null_origin:s.ignoreNullOrigin})},beforeOpen:function(f,s){f.send(JSON.stringify({path:s}))}}),Jn={isSupported:function(f){var s=Ct.isXDRSupported(f.useTLS);return s}},xr=new _t(yt({},Xt,Jn)),Sr=new _t(yt({},Rn,Jn));Pn.xdr_streaming=xr,Pn.xdr_polling=Sr,Pn.sockjs=mn;var lr=Pn,Gn=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var $ in w)w.hasOwnProperty($)&&(F[$]=w[$])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),Hr=function(f){Gn(s,f);function s(){var m=f.call(this)||this,F=m;return window.addEventListener!==void 0&&(window.addEventListener("online",function(){F.emit("online")},!1),window.addEventListener("offline",function(){F.emit("offline")},!1)),m}return s.prototype.isOnline=function(){return window.navigator.onLine===void 0?!0:window.navigator.onLine},s}(Qe),ea=new Hr,Fa=function(){function f(s,m,F){this.manager=s,this.transport=m,this.minPingDelay=F.minPingDelay,this.maxPingDelay=F.maxPingDelay,this.pingDelay=void 0}return f.prototype.createConnection=function(s,m,F,w){var $=this;w=yt({},w,{activityTimeout:this.pingDelay});var ie=this.transport.createConnection(s,m,F,w),Ee=null,Xe=function(){ie.unbind("open",Xe),ie.bind("closed",Yt),Ee=lt.now()},Yt=function(fn){if(ie.unbind("closed",Yt),fn.code===1002||fn.code===1003)$.manager.reportDeath();else if(!fn.wasClean&&Ee){var cr=lt.now()-Ee;cr<2*$.maxPingDelay&&($.manager.reportDeath(),$.pingDelay=Math.max(cr/2,$.minPingDelay))}};return ie.bind("open",Xe),ie},f.prototype.isSupported=function(s){return this.manager.isAlive()&&this.transport.isSupported(s)},f}(),Fo=Fa,Go={decodeMessage:function(f){try{var s=JSON.parse(f.data),m=s.data;if(typeof m=="string")try{m=JSON.parse(s.data)}catch{}var F={event:s.event,channel:s.channel,data:m};return s.user_id&&(F.user_id=s.user_id),F}catch(w){throw{type:"MessageParseError",error:w,data:f.data}}},encodeMessage:function(f){return JSON.stringify(f)},processHandshake:function(f){var s=Go.decodeMessage(f);if(s.event==="pusher:connection_established"){if(!s.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:s.data.socket_id,activityTimeout:s.data.activity_timeout*1e3}}else{if(s.event==="pusher:error")return{action:this.getCloseAction(s.data),error:this.getCloseError(s.data)};throw"Invalid handshake"}},getCloseAction:function(f){return f.code<4e3?f.code>=1002&&f.code<=1004?"backoff":null:f.code===4e3?"tls_only":f.code<4100?"refused":f.code<4200?"backoff":f.code<4300?"retry":"refused"},getCloseError:function(f){return f.code!==1e3&&f.code!==1001?{type:"PusherError",data:{code:f.code,message:f.reason||f.message}}:null}},te=Go,to=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var $ in w)w.hasOwnProperty($)&&(F[$]=w[$])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),no=function(f){to(s,f);function s(m,F){var w=f.call(this)||this;return w.id=m,w.transport=F,w.activityTimeout=F.activityTimeout,w.bindListeners(),w}return s.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},s.prototype.send=function(m){return this.transport.send(m)},s.prototype.send_event=function(m,F,w){var $={event:m,data:F};return w&&($.channel=w),Ge.debug("Event sent",$),this.send(te.encodeMessage($))},s.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},s.prototype.close=function(){this.transport.close()},s.prototype.bindListeners=function(){var m=this,F={message:function($){var ie;try{ie=te.decodeMessage($)}catch(Ee){m.emit("error",{type:"MessageParseError",error:Ee,data:$.data})}if(ie!==void 0){switch(Ge.debug("Event recd",ie),ie.event){case"pusher:error":m.emit("error",{type:"PusherError",data:ie.data});break;case"pusher:ping":m.emit("ping");break;case"pusher:pong":m.emit("pong");break}m.emit("message",ie)}},activity:function(){m.emit("activity")},error:function($){m.emit("error",{type:"WebSocketError",error:$})},closed:function($){w(),$&&$.code&&m.handleCloseEvent($),m.transport=null,m.emit("closed")}},w=function(){Ht(F,function($,ie){m.transport.unbind(ie,$)})};Ht(F,function($,ie){m.transport.bind(ie,$)})},s.prototype.handleCloseEvent=function(m){var F=te.getCloseAction(m),w=te.getCloseError(m);w&&this.emit("error",w),F&&this.emit(F,{action:F,error:w})},s}(Qe),qo=no,ro=function(){function f(s,m){this.transport=s,this.callback=m,this.bindListeners()}return f.prototype.close=function(){this.unbindListeners(),this.transport.close()},f.prototype.bindListeners=function(){var s=this;this.onMessage=function(m){s.unbindListeners();var F;try{F=te.processHandshake(m)}catch(w){s.finish("error",{error:w}),s.transport.close();return}F.action==="connected"?s.finish("connected",{connection:new qo(F.id,s.transport),activityTimeout:F.activityTimeout}):(s.finish(F.action,{error:F.error}),s.transport.close())},this.onClosed=function(m){s.unbindListeners();var F=te.getCloseAction(m)||"backoff",w=te.getCloseError(m);s.finish(F,{error:w})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},f.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},f.prototype.finish=function(s,m){this.callback(yt({transport:this.transport,action:s},m))},f}(),Ca=ro,Yl=function(){function f(s,m){this.channel=s;var F=m.authTransport;if(typeof Ct.getAuthorizers()[F]=="undefined")throw"'"+F+"' is not a recognized auth transport";this.type=F,this.options=m,this.authOptions=m.auth||{}}return f.prototype.composeQuery=function(s){var m="socket_id="+encodeURIComponent(s)+"&channel_name="+encodeURIComponent(this.channel.name);for(var F in this.authOptions.params)m+="&"+encodeURIComponent(F)+"="+encodeURIComponent(this.authOptions.params[F]);return m},f.prototype.authorize=function(s,m){f.authorizers=f.authorizers||Ct.getAuthorizers(),f.authorizers[this.type].call(this,Ct,s,m)},f}(),Ki=Yl,Nu=function(){function f(s,m){this.timeline=s,this.options=m||{}}return f.prototype.send=function(s,m){this.timeline.isEmpty()||this.timeline.send(Ct.TimelineTransport.getAgent(this,s),m)},f}(),Pu=Nu,wa=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var $ in w)w.hasOwnProperty($)&&(F[$]=w[$])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),Mr=function(f){wa(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),zo=function(f){wa(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),Ou=function(f){wa(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),Ql=function(f){wa(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),Uu=function(f){wa(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),zs=function(f){wa(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),_i=function(f){wa(s,f);function s(m){var F=this.constructor,w=f.call(this,m)||this;return Object.setPrototypeOf(w,F.prototype),w}return s}(Error),Dv=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var $ in w)w.hasOwnProperty($)&&(F[$]=w[$])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),yv=function(f){Dv(s,f);function s(m,F){var w=f.call(this,function($,ie){Ge.debug("No callbacks on "+m+" for "+$)})||this;return w.name=m,w.pusher=F,w.subscribed=!1,w.subscriptionPending=!1,w.subscriptionCancelled=!1,w}return s.prototype.authorize=function(m,F){return F(!1,{auth:""})},s.prototype.trigger=function(m,F){if(m.indexOf("client-")!==0)throw new Mr("Event '"+m+"' does not start with 'client-'");if(!this.subscribed){var w=Tt.buildLogSuffix("triggeringClientEvents");Ge.warn("Client event triggered before channel 'subscription_succeeded' event . "+w)}return this.pusher.send_event(m,F,this.name)},s.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},s.prototype.handleEvent=function(m){var F=m.event,w=m.data;if(F==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(m);else if(F.indexOf("pusher_internal:")!==0){var $={};this.emit(F,w,$)}},s.prototype.handleSubscriptionSucceededEvent=function(m){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",m.data)},s.prototype.subscribe=function(){var m=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(F,w){F?(Ge.error(w),m.emit("pusher:subscription_error",w)):(w=w,m.pusher.send_event("pusher:subscribe",{auth:w.auth,channel_data:w.channel_data,channel:m.name}))}))},s.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},s.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},s.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},s}(Qe),Vs=yv,Rv=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var $ in w)w.hasOwnProperty($)&&(F[$]=w[$])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),bv=function(f){Rv(s,f);function s(){return f!==null&&f.apply(this,arguments)||this}return s.prototype.authorize=function(m,F){var w=xa.createAuthorizer(this,this.pusher.config);return w.authorize(m,F)},s}(Vs),Xl=bv,Ks=function(){function f(){this.reset()}return f.prototype.get=function(s){return Object.prototype.hasOwnProperty.call(this.members,s)?{id:s,info:this.members[s]}:null},f.prototype.each=function(s){var m=this;Ht(this.members,function(F,w){s(m.get(w))})},f.prototype.setMyID=function(s){this.myID=s},f.prototype.onSubscription=function(s){this.members=s.presence.hash,this.count=s.presence.count,this.me=this.get(this.myID)},f.prototype.addMember=function(s){return this.get(s.user_id)===null&&this.count++,this.members[s.user_id]=s.user_info,this.get(s.user_id)},f.prototype.removeMember=function(s){var m=this.get(s.user_id);return m&&(delete this.members[s.user_id],this.count--),m},f.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},f}(),Tv=Ks,Ev=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var $ in w)w.hasOwnProperty($)&&(F[$]=w[$])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),Ys=function(f){Ev(s,f);function s(m,F){var w=f.call(this,m,F)||this;return w.members=new Tv,w}return s.prototype.authorize=function(m,F){var w=this;f.prototype.authorize.call(this,m,function($,ie){if(!$){if(ie=ie,ie.channel_data===void 0){var Ee=Tt.buildLogSuffix("authenticationEndpoint");Ge.error("Invalid auth response for channel '"+w.name+"',"+("expected 'channel_data' field. "+Ee)),F("Invalid auth response");return}var Xe=JSON.parse(ie.channel_data);w.members.setMyID(Xe.user_id)}F($,ie)})},s.prototype.handleEvent=function(m){var F=m.event;if(F.indexOf("pusher_internal:")===0)this.handleInternalEvent(m);else{var w=m.data,$={};m.user_id&&($.user_id=m.user_id),this.emit(F,w,$)}},s.prototype.handleInternalEvent=function(m){var F=m.event,w=m.data;switch(F){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(m);break;case"pusher_internal:member_added":var $=this.members.addMember(w);this.emit("pusher:member_added",$);break;case"pusher_internal:member_removed":var ie=this.members.removeMember(w);ie&&this.emit("pusher:member_removed",ie);break}},s.prototype.handleSubscriptionSucceededEvent=function(m){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(m.data),this.emit("pusher:subscription_succeeded",this.members))},s.prototype.disconnect=function(){this.members.reset(),f.prototype.disconnect.call(this)},s}(Xl),Fv=Ys,Qs=r(1),Zl=r(0),Cv=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var $ in w)w.hasOwnProperty($)&&(F[$]=w[$])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),wv=function(f){Cv(s,f);function s(m,F,w){var $=f.call(this,m,F)||this;return $.key=null,$.nacl=w,$}return s.prototype.authorize=function(m,F){var w=this;f.prototype.authorize.call(this,m,function($,ie){if($){F(!0,ie);return}var Ee=ie.shared_secret;if(!Ee){var Xe="No shared_secret key in auth payload for encrypted channel: "+w.name;F(!0,Xe);return}w.key=Object(Zl.decode)(Ee),delete ie.shared_secret,F(!1,ie)})},s.prototype.trigger=function(m,F){throw new Uu("Client events are not currently supported for encrypted channels")},s.prototype.handleEvent=function(m){var F=m.event,w=m.data;if(F.indexOf("pusher_internal:")===0||F.indexOf("pusher:")===0){f.prototype.handleEvent.call(this,m);return}this.handleEncryptedEvent(F,w)},s.prototype.handleEncryptedEvent=function(m,F){var w=this;if(!this.key){Ge.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!F.ciphertext||!F.nonce){Ge.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+F);return}var $=Object(Zl.decode)(F.ciphertext);if($.length0&&this.emit("connecting_in",Math.round(m/1e3)),this.retryTimer=new Ke(m||0,function(){F.disconnectInternally(),F.connect()})},s.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},s.prototype.setUnavailableTimer=function(){var m=this;this.unavailableTimer=new Ke(this.options.unavailableTimeout,function(){m.updateState("unavailable")})},s.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},s.prototype.sendActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Ke(this.options.pongTimeout,function(){m.timeline.error({pong_timed_out:m.options.pongTimeout}),m.retryIn(0)})},s.prototype.resetActivityCheck=function(){var m=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Ke(this.activityTimeout,function(){m.sendActivityCheck()}))},s.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},s.prototype.buildConnectionCallbacks=function(m){var F=this;return yt({},m,{message:function(w){F.resetActivityCheck(),F.emit("message",w)},ping:function(){F.send_event("pusher:pong",{})},activity:function(){F.resetActivityCheck()},error:function(w){F.emit("error",{type:"WebSocketError",error:w})},closed:function(){F.abandonConnection(),F.shouldRetry()&&F.retryIn(1e3)}})},s.prototype.buildHandshakeCallbacks=function(m){var F=this;return yt({},m,{connected:function(w){F.activityTimeout=Math.min(F.options.activityTimeout,w.activityTimeout,w.connection.activityTimeout||1/0),F.clearUnavailableTimer(),F.setConnection(w.connection),F.socket_id=F.connection.id,F.updateState("connected",{socket_id:F.socket_id})}})},s.prototype.buildErrorCallbacks=function(){var m=this,F=function(w){return function($){$.error&&m.emit("error",{type:"WebSocketError",error:$.error}),w($)}};return{tls_only:F(function(){m.usingTLS=!0,m.updateStrategy(),m.retryIn(0)}),refused:F(function(){m.disconnect()}),backoff:F(function(){m.retryIn(1e3)}),retry:F(function(){m.retryIn(0)})}},s.prototype.setConnection=function(m){this.connection=m;for(var F in this.connectionCallbacks)this.connection.bind(F,this.connectionCallbacks[F]);this.resetActivityCheck()},s.prototype.abandonConnection=function(){if(!!this.connection){this.stopActivityCheck();for(var m in this.connectionCallbacks)this.connection.unbind(m,this.connectionCallbacks[m]);var F=this.connection;return this.connection=null,F}},s.prototype.updateState=function(m,F){var w=this.state;if(this.state=m,w!==m){var $=m;$==="connected"&&($+=" with new socket ID "+F.socket_id),Ge.debug("State changed",w+" -> "+$),this.timeline.info({state:m,params:F}),this.emit("state_change",{previous:w,current:m}),this.emit(m,F)}},s.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},s}(Qe),Xs=Mv,Iv=function(){function f(){this.channels={}}return f.prototype.add=function(s,m){return this.channels[s]||(this.channels[s]=Zs(s,m)),this.channels[s]},f.prototype.all=function(){return Qt(this.channels)},f.prototype.find=function(s){return this.channels[s]},f.prototype.remove=function(s){var m=this.channels[s];return delete this.channels[s],m},f.prototype.disconnect=function(){Ht(this.channels,function(s){s.disconnect()})},f}(),Av=Iv;function Zs(f,s){if(f.indexOf("private-encrypted-")===0){if(s.config.nacl)return xa.createEncryptedChannel(f,s,s.config.nacl);var m="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",F=Tt.buildLogSuffix("encryptedChannelSupport");throw new Uu(m+". "+F)}else return f.indexOf("private-")===0?xa.createPrivateChannel(f,s):f.indexOf("presence-")===0?xa.createPresenceChannel(f,s):xa.createChannel(f,s)}var Lv={createChannels:function(){return new Av},createConnectionManager:function(f,s){return new Xs(f,s)},createChannel:function(f,s){return new Vs(f,s)},createPrivateChannel:function(f,s){return new Xl(f,s)},createPresenceChannel:function(f,s){return new Fv(f,s)},createEncryptedChannel:function(f,s,m){return new xv(f,s,m)},createTimelineSender:function(f,s){return new Pu(f,s)},createAuthorizer:function(f,s){return s.authorizer?s.authorizer(f,s):new Ki(f,s)},createHandshake:function(f,s){return new Ca(f,s)},createAssistantToTheTransportManager:function(f,s,m){return new Fo(f,s,m)}},xa=Lv,jv=function(){function f(s){this.options=s||{},this.livesLeft=this.options.lives||1/0}return f.prototype.getAssistant=function(s){return xa.createAssistantToTheTransportManager(this,s,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},f.prototype.isAlive=function(){return this.livesLeft>0},f.prototype.reportDeath=function(){this.livesLeft-=1},f}(),ef=jv,Nv=function(){function f(s,m){this.strategies=s,this.loop=Boolean(m.loop),this.failFast=Boolean(m.failFast),this.timeout=m.timeout,this.timeoutLimit=m.timeoutLimit}return f.prototype.isSupported=function(){return Ue(this.strategies,lt.method("isSupported"))},f.prototype.connect=function(s,m){var F=this,w=this.strategies,$=0,ie=this.timeout,Ee=null,Xe=function(Yt,fn){fn?m(null,fn):($=$+1,F.loop&&($=$%w.length),$0&&($=new Ke(F.timeout,function(){ie.abort(),w(!0)})),ie=s.connect(m,function(Ee,Xe){Ee&&$&&$.isRunning()&&!F.failFast||($&&$.ensureAborted(),w(Ee,Xe))}),{abort:function(){$&&$.ensureAborted(),ie.abort()},forceMinPriority:function(Ee){ie.forceMinPriority(Ee)}}},f}(),Vo=Nv,Pv=function(){function f(s){this.strategies=s}return f.prototype.isSupported=function(){return Ue(this.strategies,lt.method("isSupported"))},f.prototype.connect=function(s,m){return Ov(this.strategies,s,function(F,w){return function($,ie){if(w[F].error=$,$){tf(w)&&m(!0);return}Nt(w,function(Ee){Ee.forceMinPriority(ie.transport.priority)}),m(null,ie)}})},f}(),ec=Pv;function Ov(f,s,m){var F=ft(f,function(w,$,ie,Ee){return w.connect(s,m($,Ee))});return{abort:function(){Nt(F,tc)},forceMinPriority:function(w){Nt(F,function($){$.forceMinPriority(w)})}}}function tf(f){return Ae(f,function(s){return Boolean(s.error)})}function tc(f){!f.error&&!f.aborted&&(f.abort(),f.aborted=!0)}var Uv=function(){function f(s,m,F){this.strategy=s,this.transports=m,this.ttl=F.ttl||1800*1e3,this.usingTLS=F.useTLS,this.timeline=F.timeline}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.usingTLS,w=nf(F),$=[this.strategy];if(w&&w.timestamp+this.ttl>=lt.now()){var ie=this.transports[w.transport];ie&&(this.timeline.info({cached:!0,transport:w.transport,latency:w.latency}),$.push(new Vo([ie],{timeout:w.latency*2+1e3,failFast:!0})))}var Ee=lt.now(),Xe=$.pop().connect(s,function Yt(fn,cr){fn?(rf(F),$.length>0?(Ee=lt.now(),Xe=$.pop().connect(s,Yt)):m(fn)):(Wv(F,cr.transport.name,lt.now()-Ee),m(null,cr))});return{abort:function(){Xe.abort()},forceMinPriority:function(Yt){s=Yt,Xe&&Xe.forceMinPriority(Yt)}}},f}(),kv=Uv;function nc(f){return"pusherTransport"+(f?"TLS":"NonTLS")}function nf(f){var s=Ct.getLocalStorage();if(s)try{var m=s[nc(f)];if(m)return JSON.parse(m)}catch{rf(f)}return null}function Wv(f,s,m){var F=Ct.getLocalStorage();if(F)try{F[nc(f)]=wt({timestamp:lt.now(),transport:s,latency:m})}catch{}}function rf(f){var s=Ct.getLocalStorage();if(s)try{delete s[nc(f)]}catch{}}var Hv=function(){function f(s,m){var F=m.delay;this.strategy=s,this.options={delay:F}}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.strategy,w,$=new Ke(this.options.delay,function(){w=F.connect(s,m)});return{abort:function(){$.ensureAborted(),w&&w.abort()},forceMinPriority:function(ie){s=ie,w&&w.forceMinPriority(ie)}}},f}(),ku=Hv,af=function(){function f(s,m,F){this.test=s,this.trueBranch=m,this.falseBranch=F}return f.prototype.isSupported=function(){var s=this.test()?this.trueBranch:this.falseBranch;return s.isSupported()},f.prototype.connect=function(s,m){var F=this.test()?this.trueBranch:this.falseBranch;return F.connect(s,m)},f}(),Yi=af,Bv=function(){function f(s){this.strategy=s}return f.prototype.isSupported=function(){return this.strategy.isSupported()},f.prototype.connect=function(s,m){var F=this.strategy.connect(s,function(w,$){$&&F.abort(),m(w,$)});return F},f}(),$v=Bv;function ao(f){return function(){return f.isSupported()}}var of=function(f,s,m){var F={};function w(On,Ef,Ff,gm,Cf){var g=m(f,On,Ef,Ff,gm,Cf);return F[On]=g,g}var $=Object.assign({},s,{hostNonTLS:f.wsHost+":"+f.wsPort,hostTLS:f.wsHost+":"+f.wssPort,httpPath:f.wsPath}),ie=Object.assign({},$,{useTLS:!0}),Ee=Object.assign({},s,{hostNonTLS:f.httpHost+":"+f.httpPort,hostTLS:f.httpHost+":"+f.httpsPort,httpPath:f.httpPath}),Xe={loop:!0,timeout:15e3,timeoutLimit:6e4},Yt=new ef({lives:2,minPingDelay:1e4,maxPingDelay:f.activityTimeout}),fn=new ef({lives:2,minPingDelay:1e4,maxPingDelay:f.activityTimeout}),cr=w("ws","ws",3,$,Yt),ta=w("wss","ws",3,ie,Yt),vm=w("sockjs","sockjs",1,Ee),hf=w("xhr_streaming","xhr_streaming",1,Ee,fn),gf=w("xdr_streaming","xdr_streaming",1,Ee,fn),Df=w("xhr_polling","xhr_polling",1,Ee),mm=w("xdr_polling","xdr_polling",1,Ee),yf=new Vo([cr],Xe),_m=new Vo([ta],Xe),hm=new Vo([vm],Xe),Rf=new Vo([new Yi(ao(hf),hf,gf)],Xe),bf=new Vo([new Yi(ao(Df),Df,mm)],Xe),Tf=new Vo([new Yi(ao(Rf),new ec([Rf,new ku(bf,{delay:4e3})]),bf)],Xe),lc=new Yi(ao(Tf),Tf,hm),cc;return s.useTLS?cc=new ec([yf,new ku(lc,{delay:2e3})]):cc=new ec([yf,new ku(_m,{delay:2e3}),new ku(lc,{delay:5e3})]),new kv(new $v(new Yi(ao(cr),cc,lc)),F,{ttl:18e5,timeline:s.timeline,useTLS:s.useTLS})},Jv=of,Gv=function(){var f=this;f.timeline.info(f.buildTimelineMessage({transport:f.name+(f.options.useTLS?"s":"")})),f.hooks.isInitialized()?f.changeState("initialized"):f.hooks.file?(f.changeState("initializing"),y.load(f.hooks.file,{useTLS:f.options.useTLS},function(s,m){f.hooks.isInitialized()?(f.changeState("initialized"),m(!0)):(s&&f.onError(s),f.onClose(),m(!1))})):f.onClose()},uf={getRequest:function(f){var s=new window.XDomainRequest;return s.ontimeout=function(){f.emit("error",new zo),f.close()},s.onerror=function(m){f.emit("error",m),f.close()},s.onprogress=function(){s.responseText&&s.responseText.length>0&&f.onChunk(200,s.responseText)},s.onload=function(){s.responseText&&s.responseText.length>0&&f.onChunk(200,s.responseText),f.emit("finished",200),f.close()},s},abortRequest:function(f){f.ontimeout=f.onerror=f.onprogress=f.onload=null,f.abort()}},qv=uf,lf=function(){var f=function(s,m){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,w){F.__proto__=w}||function(F,w){for(var $ in w)w.hasOwnProperty($)&&(F[$]=w[$])},f(s,m)};return function(s,m){f(s,m);function F(){this.constructor=s}s.prototype=m===null?Object.create(m):(F.prototype=m.prototype,new F)}}(),zv=256*1024,cf=function(f){lf(s,f);function s(m,F,w){var $=f.call(this)||this;return $.hooks=m,$.method=F,$.url=w,$}return s.prototype.start=function(m){var F=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){F.close()},Ct.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(m)},s.prototype.close=function(){this.unloader&&(Ct.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},s.prototype.onChunk=function(m,F){for(;;){var w=this.advanceBuffer(F);if(w)this.emit("chunk",{status:m,data:w});else break}this.isBufferTooLong(F)&&this.emit("buffer_too_long")},s.prototype.advanceBuffer=function(m){var F=m.slice(this.position),w=F.indexOf(` `);return w!==-1?(this.position+=w+1,F.slice(0,w)):null},s.prototype.isBufferTooLong=function(m){return this.position===m.length&&m.length>zv},s}(Qe),sf=cf,Qi;(function(f){f[f.CONNECTING=0]="CONNECTING",f[f.OPEN=1]="OPEN",f[f.CLOSED=3]="CLOSED"})(Qi||(Qi={}));var Sa=Qi,Vv=1,ff=function(){function f(s,m){this.hooks=s,this.session=Br(1e3)+"/"+oo(8),this.location=Kv(m),this.readyState=Sa.CONNECTING,this.openStream()}return f.prototype.send=function(s){return this.sendRaw(JSON.stringify([s]))},f.prototype.ping=function(){this.hooks.sendHeartbeat(this)},f.prototype.close=function(s,m){this.onClose(s,m,!0)},f.prototype.sendRaw=function(s){if(this.readyState===Sa.OPEN)try{return Ct.createSocketRequest("POST",rc(Yv(this.location,this.session))).start(s),!0}catch{return!1}else return!1},f.prototype.reconnect=function(){this.closeStream(),this.openStream()},f.prototype.onClose=function(s,m,F){this.closeStream(),this.readyState=Sa.CLOSED,this.onclose&&this.onclose({code:s,reason:m,wasClean:F})},f.prototype.onChunk=function(s){if(s.status===200){this.readyState===Sa.OPEN&&this.onActivity();var m,F=s.data.slice(0,1);switch(F){case"o":m=JSON.parse(s.data.slice(1)||"{}"),this.onOpen(m);break;case"a":m=JSON.parse(s.data.slice(1)||"[]");for(var w=0;w0&&f.onChunk(m.status,m.responseText);break;case 4:m.responseText&&m.responseText.length>0&&f.onChunk(m.status,m.responseText),f.emit("finished",m.status),f.close();break}},m},abortRequest:function(f){f.onreadystatechange=null,f.abort()}},Ft=pf,Ko={createStreamingSocket:function(f){return this.createSocket(Zv,f)},createPollingSocket:function(f){return this.createSocket(tm,f)},createSocket:function(f,s){return new Qv(f,s)},createXHR:function(f,s){return this.createRequest(Ft,f,s)},createRequest:function(f,s,m){return new sf(f,s,m)}},ac=Ko;ac.createXDR=function(f,s){return this.createRequest(qv,f,s)};var nm=ac,rm={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:l,DependenciesReceivers:P,getDefaultStrategy:Jv,Transports:lr,transportConnectionInitializer:Gv,HTTPFactory:nm,TimelineTransport:K,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(f){var s=this;window.Pusher=f;var m=function(){s.onDocumentBody(f.ready)};window.JSON?m():y.load("json2",{},m)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:U,jsonp:L}},onDocumentBody:function(f){var s=this;document.body?f():setTimeout(function(){s.onDocumentBody(f)},0)},createJSONPRequest:function(f,s){return new k(f,s)},createScriptRequest:function(f){return new x(f)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var f=this.getXHRAPI();return new f},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return ea},createWebSocket:function(f){var s=this.getWebSocketAPI();return new s(f)},createSocketRequest:function(f,s){if(this.isXHRSupported())return this.HTTPFactory.createXHR(f,s);if(this.isXDRSupported(s.indexOf("https:")===0))return this.HTTPFactory.createXDR(f,s);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var f=this.getXHRAPI();return Boolean(f)&&new f().withCredentials!==void 0},isXDRSupported:function(f){var s=f?"https:":"http:",m=this.getProtocol();return Boolean(window.XDomainRequest)&&m===s},addUnloadListener:function(f){window.addEventListener!==void 0?window.addEventListener("unload",f,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",f)},removeUnloadListener:function(f){window.addEventListener!==void 0?window.removeEventListener("unload",f,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",f)}},Ct=rm,Wu;(function(f){f[f.ERROR=3]="ERROR",f[f.INFO=6]="INFO",f[f.DEBUG=7]="DEBUG"})(Wu||(Wu={}));var Hu=Wu,am=function(){function f(s,m,F){this.key=s,this.session=m,this.events=[],this.options=F||{},this.sent=0,this.uniqueID=0}return f.prototype.log=function(s,m){s<=this.options.level&&(this.events.push(yt({},m,{timestamp:lt.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},f.prototype.error=function(s){this.log(Hu.ERROR,s)},f.prototype.info=function(s){this.log(Hu.INFO,s)},f.prototype.debug=function(s){this.log(Hu.DEBUG,s)},f.prototype.isEmpty=function(){return this.events.length===0},f.prototype.send=function(s,m){var F=this,w=yt({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],s(w,function($,ie){$||F.sent++,m&&m($,ie)}),!0},f.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},f}(),vf=am,oc=function(){function f(s,m,F,w){this.name=s,this.priority=m,this.transport=F,this.options=w||{}}return f.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},f.prototype.connect=function(s,m){var F=this;if(this.isSupported()){if(this.priority{typeof window!="undefined"&&function(n,r){typeof Ws=="object"&&typeof yg=="object"?yg.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Ws=="object"?Ws.Hls=r():n.Hls=r()}(Ws,function(){return function(e){var n={};function r(i){if(n[i])return n[i].exports;var l=n[i]={i,l:!1,exports:{}};return e[i].call(l.exports,l,l.exports,r),l.l=!0,l.exports}return r.m=e,r.c=n,r.d=function(i,l,p){r.o(i,l)||Object.defineProperty(i,l,{enumerable:!0,get:p})},r.r=function(i){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,l){if(l&1&&(i=r(i)),l&8||l&4&&typeof i=="object"&&i&&i.__esModule)return i;var p=Object.create(null);if(r.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:i}),l&2&&typeof i!="string")for(var T in i)r.d(p,T,function(d){return i[d]}.bind(null,T));return p},r.n=function(i){var l=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(l,"a",l),l},r.o=function(i,l){return Object.prototype.hasOwnProperty.call(i,l)},r.p="/dist/",r(r.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(e,n,r){"use strict";var i=Object.prototype.hasOwnProperty,l="~";function p(){}Object.create&&(p.prototype=Object.create(null),new p().__proto__||(l=!1));function T(y,E,M){this.fn=y,this.context=E,this.once=M||!1}function d(y,E,M,C,S){if(typeof M!="function")throw new TypeError("The listener must be a function");var O=new T(M,C||y,S),B=l?l+E:E;return y._events[B]?y._events[B].fn?y._events[B]=[y._events[B],O]:y._events[B].push(O):(y._events[B]=O,y._eventsCount++),y}function h(y,E){--y._eventsCount==0?y._events=new p:delete y._events[E]}function P(){this._events=new p,this._eventsCount=0}P.prototype.eventNames=function(){var E=[],M,C;if(this._eventsCount===0)return E;for(C in M=this._events)i.call(M,C)&&E.push(l?C.slice(1):C);return Object.getOwnPropertySymbols?E.concat(Object.getOwnPropertySymbols(M)):E},P.prototype.listeners=function(E){var M=l?l+E:E,C=this._events[M];if(!C)return[];if(C.fn)return[C.fn];for(var S=0,O=C.length,B=new Array(O);S0},!1)}function y(E,M){for(var C={main:[M]},S={main:[]},O={main:{}};P(C);)for(var B=Object.keys(C),Q=0;Q>>8^Qt&255^99,Z[nn]=Qt,ne[Qt]=nn;var Nt=Ut[nn],ft=Ut[Nt],Bn=Ut[ft],me=Ut[Qt]*257^Qt*16843008;pe[nn]=me<<24|me>>>8,ve[nn]=me<<16|me>>>16,$e[nn]=me<<8|me>>>24,qe[nn]=me,me=Bn*16843009^ft*65537^Nt*257^nn*16843008,an[Qt]=me<<24|me>>>8,ln[Qt]=me<<16|me>>>16,lt[Qt]=me<<8|me>>>24,yt[Qt]=me,nn?(nn=Nt^Ut[Ut[Ut[Bn^Nt]]],Ht^=Ut[Ut[Ht]]):nn=Ht=1}},Q.expandKey=function(Z){for(var ne=this.uint8ArrayToUint32Array_(Z),ee=!0,pe=0;pe>>6)+1,A=(J[L+2]&60)>>>2,A>ue.length-1){U.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+A});return}return W=(J[L+2]&1)<<2,W|=(J[L+3]&192)>>>6,d.logger.log("manifest codec:"+D+",ADTS data:type:"+x+",sampleingIndex:"+A+"["+ue[A]+"Hz],channelConfig:"+W),/firefox/i.test(K)?A>=6?(x=5,X=new Array(4),k=A-3):(x=2,X=new Array(2),k=A):K.indexOf("android")!==-1?(x=2,X=new Array(2),k=A):(x=5,X=new Array(4),D&&(D.indexOf("mp4a.40.29")!==-1||D.indexOf("mp4a.40.5")!==-1)||!D&&A>=6?k=A-3:((D&&D.indexOf("mp4a.40.2")!==-1&&(A>=6&&W===1||/vivaldi/i.test(K))||!D&&W===1)&&(x=2,X=new Array(2)),k=A)),X[0]=x<<3,X[0]|=(A&14)>>1,X[1]|=(A&1)<<7,X[1]|=W<<3,x===5&&(X[1]|=(k&14)>>1,X[2]=(k&1)<<7,X[2]|=2<<2,X[3]=0),{config:X,samplerate:ue[A],channelCount:W,codec:"mp4a.40."+x,manifestCodec:re}}function y(U,J){return U[J]===255&&(U[J+1]&246)==240}function E(U,J){return U[J+1]&1?7:9}function M(U,J){return(U[J+3]&3)<<11|U[J+4]<<3|(U[J+5]&224)>>>5}function C(U,J){return!!(J+10&&J+A+k<=X)return W=L+D*x,{headerLength:A,frameLength:k,stamp:W}}function z(U,J,L,D,x){var A=B(U.samplerate),k=Q(J,L,D,x,A);if(k){var W=k.stamp,X=k.headerLength,K=k.frameLength,re={unit:J.subarray(L+X,L+X+K),pts:W,dts:W};return U.samples.push(re),{sample:re,length:K+X}}}var Z=r("./src/demux/id3.js"),ne=function(){function U(L,D,x){this.observer=L,this.config=x,this.remuxer=D}var J=U.prototype;return J.resetInitSegment=function(D,x,A,k){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:x,duration:k,inputTimeScale:9e4}},J.resetTimeStamp=function(){},U.probe=function(D){if(!D)return!1;for(var x=Z.default.getID3Data(D,0)||[],A=x.length,k=D.length;AL.length)){var k=this.parseHeader(L,D);if(k&&D+k.frameLength<=L.length){var W=k.samplesPerFrame*9e4/k.sampleRate,X=x+A*W,K={unit:L.subarray(D,D+k.frameLength),pts:X,dts:X};return J.config=[],J.channelCount=k.channelCount,J.samplerate=k.sampleRate,J.samples.push(K),{sample:K,length:k.frameLength}}}},parseHeader:function(J,L){var D=J[L+1]>>3&3,x=J[L+1]>>1&3,A=J[L+2]>>4&15,k=J[L+2]>>2&3,W=J[L+2]>>1&1;if(D!==1&&A!==0&&A!==15&&k!==3){var X=D===3?3-x:x===3?3:4,K=ve.BitratesMap[X*14+A-1]*1e3,re=D===3?0:D===2?1:2,ue=ve.SamplingRateMap[re*3+k],le=J[L+3]>>6==3?1:2,ce=ve.SamplesCoefficients[D][x],De=ve.BytesInSlot[x],Fe=ce*8*De,fe=parseInt(ce*K/ue+W,10)*De;return{sampleRate:ue,channelCount:le,frameLength:fe,samplesPerFrame:Fe}}},isHeaderPattern:function(J,L){return J[L]===255&&(J[L+1]&224)==224&&(J[L+1]&6)!=0},isHeader:function(J,L){return!!(L+1D?(this.word<<=D,this.bitsAvailable-=D):(D-=this.bitsAvailable,x=D>>3,D-=x>>3,this.bytesAvailable-=x,this.loadWord(),this.word<<=D,this.bitsAvailable-=D)},J.readBits=function(D){var x=Math.min(this.bitsAvailable,D),A=this.word>>>32-x;return D>32&&d.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=x,this.bitsAvailable>0?this.word<<=x:this.bytesAvailable>0&&this.loadWord(),x=D-x,x>0&&this.bitsAvailable?A<>>D)!=0)return this.word<<=D,this.bitsAvailable-=D,D;return this.loadWord(),D+this.skipLZ()},J.skipUEG=function(){this.skipBits(1+this.skipLZ())},J.skipEG=function(){this.skipBits(1+this.skipLZ())},J.readUEG=function(){var D=this.skipLZ();return this.readBits(D+1)-1},J.readEG=function(){var D=this.readUEG();return 1&D?1+D>>>1:-1*(D>>>1)},J.readBoolean=function(){return this.readBits(1)===1},J.readUByte=function(){return this.readBits(8)},J.readUShort=function(){return this.readBits(16)},J.readUInt=function(){return this.readBits(32)},J.skipScalingList=function(D){var x=8,A=8,k,W;for(k=0;k=D.length){A();return}if(!(D[x].unit.length<32)){var k=this.decrypter.isSync();if(this.decryptAacSample(D,x,A,k),!k)return}}},J.getAvcEncryptedData=function(D){for(var x=Math.floor((D.length-48)/160)*16+16,A=new Int8Array(x),k=0,W=32;W<=D.length-16;W+=160,k+=16)A.set(D.subarray(W,W+16),k);return A},J.getAvcDecryptedUnit=function(D,x){x=new Uint8Array(x);for(var A=0,k=32;k<=D.length-16;k+=160,A+=16)D.set(x.subarray(A,A+16),k);return D},J.decryptAvcSample=function(D,x,A,k,W,X){var K=this.discardEPB(W.data),re=this.getAvcEncryptedData(K),ue=this;this.decryptBuffer(re.buffer,function(le){W.data=ue.getAvcDecryptedUnit(K,le),X||ue.decryptAvcSamples(D,x,A+1,k)})},J.decryptAvcSamples=function(D,x,A,k){for(;;x++,A=0){if(x>=D.length){k();return}for(var W=D[x].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,x,A,k,X,K),!K)return}}}},U}(),ln=an,lt={video:1,audio:2,id3:3,text:4},yt=function(){function U(L,D,x,A){this.observer=L,this.config=x,this.typeSupported=A,this.remuxer=D,this.sampleAes=null}var J=U.prototype;return J.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 x=U._syncOffset(D);return x<0?!1:(x&&d.logger.warn("MPEG2-TS detected but first sync word found @ offset "+x+", junk ahead ?"),!0)},U._syncOffset=function(D){for(var x=Math.min(1e3,D.length-3*188),A=0;A>4,ue>1){if(le=W+5+D[W+4],le===W+188)continue}else le=W+4;switch(re){case Qe:K&&(Bt&&(ce=Rn(Bt))&&Nn(ce,!1),Bt={data:[],size:0}),Bt&&(Bt.data.push(D.subarray(le,W+188)),Bt.size+=W+188-le);break;case It:K&&(_t&&(ce=Rn(_t))&&(Ie.isAAC?Zn(ce):Mn(ce)),_t={data:[],size:0}),_t&&(_t.data.push(D.subarray(le,W+188)),_t.size+=W+188-le);break;case rn:K&&(un&&(ce=Rn(un))&&gr(ce),un={data:[],size:0}),un&&(un.data.push(D.subarray(le,W+188)),un.size+=W+188-le);break;case 0:K&&(le+=D[le]+1),it=this._pmtId=Et(D,le);break;case it:K&&(le+=D[le]+1);var mn=Xt(D,le,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,this.sampleAes!=null);Qe=mn.avc,Qe>0&&(fe.pid=Qe),It=mn.audio,It>0&&(Ie.pid=It,Ie.isAAC=mn.isAAC),rn=mn.id3,rn>0&&(We.pid=rn),De&&!Fe&&(d.logger.log("reparse from beginning"),De=!1,W=Pn-188),Fe=this.pmtParsed=!0;break;case 17:case 8191:break;default:De=!0;break}}else this.observer.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});Bt&&(ce=Rn(Bt))?(Nn(ce,!0),fe.pesData=null):fe.pesData=Bt,_t&&(ce=Rn(_t))?(Ie.isAAC?Zn(ce):Mn(ce),Ie.pesData=null):(_t&&_t.size&&d.logger.log("last AAC PES packet truncated,might overlap between fragments"),Ie.pesData=_t),un&&(ce=Rn(un))?(gr(ce),We.pesData=null):We.pesData=un,this.sampleAes==null?this.remuxer.remux(Ie,fe,We,this._txtTrack,x,A,k):this.decryptAndRemux(Ie,fe,We,this._txtTrack,x,A,k)},J.decryptAndRemux=function(D,x,A,k,W,X,K){if(D.samples&&D.isAAC){var re=this;this.sampleAes.decryptAacSamples(D.samples,0,function(){re.decryptAndRemuxAvc(D,x,A,k,W,X,K)})}else this.decryptAndRemuxAvc(D,x,A,k,W,X,K)},J.decryptAndRemuxAvc=function(D,x,A,k,W,X,K){if(x.samples){var re=this;this.sampleAes.decryptAvcSamples(x.samples,0,0,function(){re.remuxer.remux(D,x,A,k,W,X,K)})}else this.remuxer.remux(D,x,A,k,W,X,K)},J.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},J._parsePAT=function(D,x){return(D[x+10]&31)<<8|D[x+11]},J._parsePMT=function(D,x,A,k){var W,X,K,re,ue={audio:-1,avc:-1,id3:-1,isAAC:!0};for(W=(D[x+1]&15)<<8|D[x+2],X=x+3+W-4,K=(D[x+10]&15)<<8|D[x+11],x+=12+K;x1;){var Fe=new Uint8Array(De[0].length+De[1].length);Fe.set(De[0]),Fe.set(De[1],De[0].length),De[0]=Fe,De.splice(1,1)}if(A=De[0],W=(A[0]<<16)+(A[1]<<8)+A[2],W===1){if(X=(A[4]<<8)+A[5],X&&X>D.size-6||(k=A[7],k&192&&(ue=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,ue>4294967295&&(ue-=8589934592),k&64?(le=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,le>4294967295&&(le-=8589934592),ue-le>60*9e4&&(d.logger.warn(Math.round((ue-le)/9e4)+"s delta between PTS and DTS, align them"),ue=le)):le=ue),K=A[8],ce=K+9,D.size<=ce))return null;D.size-=ce,re=new Uint8Array(D.size);for(var fe=0,Ie=De.length;feWe){ce-=We;continue}else A=A.subarray(ce),We-=ce,ce=0;re.set(A,x),x+=We}return X&&(X-=K+3),{data:re,pts:ue,dts:le,len:X}}else return null},J.pushAccesUnit=function(D,x){if(D.units.length&&D.frame){var A=x.samples,k=A.length;if(isNaN(D.pts))if(k){var W=A[k-1];D.pts=W.pts,D.dts=W.dts}else{x.dropped++;return}!this.config.forceKeyFrameOnDiscontinuity||D.key===!0||x.sps&&(k||this.contiguous)?(D.id=k,A.push(D)):x.dropped++}D.debug.length&&d.logger.log(D.pts+"/"+D.dts+":"+D.debug)},J._parseAVCPES=function(D,x){var A=this,k=this._avcTrack,W=this._parseAVCNALu(D.data),X=!1,K,re=this.avcSample,ue,le=!1,ce,De=this.pushAccesUnit.bind(this),Fe=function(Ie,We,Qe,It){return{key:Ie,pts:We,dts:Qe,units:[],debug:It}};D.data=null,re&&W.length&&!k.audFound&&(De(re,k),re=this.avcSample=Fe(!1,D.pts,D.dts,"")),W.forEach(function(fe){switch(fe.type){case 1:ue=!0,re||(re=A.avcSample=Fe(!0,D.pts,D.dts,"")),X&&(re.debug+="NDR "),re.frame=!0;var Ie=fe.data;if(le&&Ie.length>4){var We=new Ke(Ie).readSliceType();(We===2||We===4||We===7||We===9)&&(re.key=!0)}break;case 5:ue=!0,re||(re=A.avcSample=Fe(!0,D.pts,D.dts,"")),X&&(re.debug+="IDR "),re.key=!0,re.frame=!0;break;case 6:ue=!0,X&&re&&(re.debug+="SEI "),K=new Ke(A.discardEPB(fe.data)),K.readUByte();for(var Qe=0,It=0,rn=!1,it=0;!rn&&K.bytesAvailable>1;){Qe=0;do it=K.readUByte(),Qe+=it;while(it===255);It=0;do it=K.readUByte(),It+=it;while(it===255);if(Qe===4&&K.bytesAvailable!==0){rn=!0;var Bt=K.readUByte();if(Bt===181){var _t=K.readUShort();if(_t===49){var un=K.readUInt();if(un===1195456820){var Et=K.readUByte();if(Et===3){var Xt=K.readUByte(),Rn=K.readUByte(),Nn=31&Xt,Zn=[Xt,Rn];for(ce=0;ce16){var Mn=[];for(ce=0;ce<16;ce++)Mn.push(K.readUByte().toString(16)),(ce===3||ce===5||ce===7||ce===9)&&Mn.push("-");var gr=It-16,Pn=new Uint8Array(gr);for(ce=0;ce0){if(x.pts>=D[A-1].pts)D.push(x);else for(var k=A-1;k>=0;k--)if(x.pts=0)le={data:D.subarray(De,x-K-1),type:Fe},ue.push(le);else{var fe=this._getLastNalUnit();if(fe&&(re&&x<=4-re&&fe.state&&(fe.data=fe.data.subarray(0,fe.data.byteLength-re)),W=x-K-1,W>0)){var Ie=new Uint8Array(fe.data.byteLength+W);Ie.set(fe.data,0),Ie.set(D.subarray(0,W),fe.data.byteLength),fe.data=Ie}}x=0&&K>=0&&(le={data:D.subarray(De,A),type:Fe,state:K},ue.push(le)),ue.length===0){var We=this._getLastNalUnit();if(We){var Qe=new Uint8Array(We.data.byteLength+D.byteLength);Qe.set(We.data,0),Qe.set(D,We.data.byteLength),We.data=Qe}}return X.naluState=K,ue},J.discardEPB=function(D){for(var x=D.byteLength,A=[],k=1,W,X;k1&&(d.logger.log("AAC: align PTS for overlapping frames by "+Math.round((We-k)/90)),k=We)}for(;le>24&255,W[1]=x>>16&255,W[2]=x>>8&255,W[3]=x&255,W.set(L,4),A=0,x=8;A>24&255,L>>16&255,L>>8&255,L&255,x>>24,x>>16&255,x>>8&255,x&255,A>>24,A>>16&255,A>>8&255,A&255,85,196,0,0]))},U.mdia=function(L){return U.box(U.types.mdia,U.mdhd(L.timescale,L.duration),U.hdlr(L.type),U.minf(L))},U.mfhd=function(L){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255]))},U.minf=function(L){return L.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(L)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(L))},U.moof=function(L,D,x){return U.box(U.types.moof,U.mfhd(L),U.traf(x,D))},U.moov=function(L){for(var D=L.length,x=[];D--;)x[D]=U.trak(L[D]);return U.box.apply(null,[U.types.moov,U.mvhd(L[0].timescale,L[0].duration)].concat(x).concat(U.mvex(L)))},U.mvex=function(L){for(var D=L.length,x=[];D--;)x[D]=U.trex(L[D]);return U.box.apply(null,[U.types.mvex].concat(x))},U.mvhd=function(L,D){D*=L;var x=Math.floor(D/(Nt+1)),A=Math.floor(D%(Nt+1)),k=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,x>>24,x>>16&255,x>>8&255,x&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,k)},U.sdtp=function(L){var D=L.samples||[],x=new Uint8Array(4+D.length),A,k;for(k=0;k>>8&255),D.push(W&255),D=D.concat(Array.prototype.slice.call(k));for(A=0;A>>8&255),x.push(W&255),x=x.concat(Array.prototype.slice.call(k));var X=U.box(U.types.avcC,new Uint8Array([1,D[3],D[4],D[5],252|3,224|L.sps.length].concat(D).concat([L.pps.length]).concat(x))),K=L.width,re=L.height,ue=L.pixelRatio[0],le=L.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,re>>8&255,re&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),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([ue>>24,ue>>16&255,ue>>8&255,ue&255,le>>24,le>>16&255,le>>8&255,le&255])))},U.esds=function(L){var D=L.config.length;return new Uint8Array([0,0,0,0,3,23+D,0,1,0,4,15+D,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([D]).concat(L.config).concat([6,1,2]))},U.mp4a=function(L){var D=L.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,L.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]),U.box(U.types.esds,U.esds(L)))},U.mp3=function(L){var D=L.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,L.channelCount,0,16,0,0,0,0,D>>8&255,D&255,0,0]))},U.stsd=function(L){return L.type==="audio"?!L.isAAC&&L.codec==="mp3"?U.box(U.types.stsd,U.STSD,U.mp3(L)):U.box(U.types.stsd,U.STSD,U.mp4a(L)):U.box(U.types.stsd,U.STSD,U.avc1(L))},U.tkhd=function(L){var D=L.id,x=L.duration*L.timescale,A=L.width,k=L.height,W=Math.floor(x/(Nt+1)),X=Math.floor(x%(Nt+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,k>>8&255,k&255,0,0]))},U.traf=function(L,D){var x=U.sdtp(L),A=L.id,k=Math.floor(D/(Nt+1)),W=Math.floor(D%(Nt+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,k>>24,k>>16&255,k>>8&255,k&255,W>>24,W>>16&255,W>>8&255,W&255])),U.trun(L,x.length+16+20+8+16+8+8),x)},U.trak=function(L){return L.duration=L.duration||4294967295,U.box(U.types.trak,U.tkhd(L),U.mdia(L))},U.trex=function(L){var D=L.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(L,D){var x=L.samples||[],A=x.length,k=12+16*A,W=new Uint8Array(k),X,K,re,ue,le,ce;for(D+=8+k,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,re>>>16&255,re>>>8&255,re&255,ue>>>24&255,ue>>>16&255,ue>>>8&255,ue&255,le.isLeading<<2|le.dependsOn,le.isDependedOn<<6|le.hasRedundancy<<4|le.paddingValue<<1|le.isNonSync,le.degradPrio&240<<8,le.degradPrio&15,ce>>>24&255,ce>>>16&255,ce>>>8&255,ce&255],12+16*X);return U.box(U.types.trun,W)},U.initSegment=function(L){U.types||U.init();var D=U.moov(L),x;return x=new Uint8Array(U.FTYP.byteLength+D.byteLength),x.set(U.FTYP),x.set(D,U.FTYP.byteLength),x},U}(),Bn=ft,me=9e4;function dt(U,J,L,D){return L===void 0&&(L=1),D===void 0&&(D=!1),Pt(U,J,1/L)}function Pt(U,J,L,D){L===void 0&&(L=1),D===void 0&&(D=!1);var x=U*J*L;return D?Math.round(x):x}function Ue(U,J){return J===void 0&&(J=!1),Pt(U,1e3,1/me,J)}function Ae(U,J){return J===void 0&&(J=1),Pt(U,me,1/J)}var _e=Ae(10),ot=Ae(.2),et=function(){function U(L,D,x,A){this.observer=L,this.config=D,this.typeSupported=x;var k=navigator.userAgent;this.isSafari=A&&A.indexOf("Apple")>-1&&k&&!k.match("CriOS"),this.ISGenerated=!1}var J=U.prototype;return J.destroy=function(){},J.resetTimeStamp=function(D){this._initPTS=this._initDTS=D},J.resetInitSegment=function(){this.ISGenerated=!1},J.remux=function(D,x,A,k,W,X,K){if(this.ISGenerated||this.generateIS(D,x,W),this.ISGenerated){var re=D.samples.length,ue=x.samples.length,le=W,ce=W;if(re&&ue){var De=(D.samples[0].pts-x.samples[0].pts)/x.inputTimeScale;le+=Math.max(0,De),ce+=Math.max(0,-De)}if(re){D.timescale||(d.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(D,x,W));var Fe=this.remuxAudio(D,le,X,K);if(ue){var fe;Fe&&(fe=Fe.endPTS-Fe.startPTS),x.timescale||(d.logger.warn("regenerate InitSegment as video detected"),this.generateIS(D,x,W)),this.remuxVideo(x,ce,X,fe,K)}}else if(ue){var Ie=this.remuxVideo(x,ce,X,0,K);Ie&&D.codec&&this.remuxEmptyAudio(D,le,X,Ie)}}A.samples.length&&this.remuxID3(A,W),k.samples.length&&this.remuxText(k,W),this.observer.trigger(i.default.FRAG_PARSED)},J.generateIS=function(D,x,A){var k=this.observer,W=D.samples,X=x.samples,K=this.typeSupported,re="audio/mp4",ue={},le={tracks:ue},ce=this._initPTS===void 0,De,Fe;if(ce&&(De=Fe=1/0),D.config&&W.length&&(D.timescale=D.samplerate,d.logger.log("audio sampling rate : "+D.samplerate),D.isAAC||(K.mpeg?(re="audio/mpeg",D.codec=""):K.mp3&&(D.codec="mp3")),ue.audio={container:re,codec:D.codec,initSegment:!D.isAAC&&K.mpeg?new Uint8Array:Bn.initSegment([D]),metadata:{channelCount:D.channelCount}},ce&&(De=Fe=W[0].pts-D.inputTimeScale*A)),x.sps&&x.pps&&X.length){var fe=x.inputTimeScale;x.timescale=fe,ue.video={container:"video/mp4",codec:x.codec,initSegment:Bn.initSegment([x]),metadata:{width:x.width,height:x.height}},ce&&(De=Math.min(De,X[0].pts-fe*A),Fe=Math.min(Fe,X[0].dts-fe*A),this.observer.trigger(i.default.INIT_PTS_FOUND,{initPTS:De}))}Object.keys(ue).length?(k.trigger(i.default.FRAG_PARSING_INIT_SEGMENT,le),this.ISGenerated=!0,ce&&(this._initPTS=De,this._initDTS=Fe)):k.trigger(i.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},J.remuxVideo=function(D,x,A,k,W){var X=8,K,re,ue,le,ce,De,Fe,fe=D.timescale,Ie=D.samples,We=[],Qe=Ie.length,It=this._PTSNormalize,rn=this._initPTS,it=this.nextAvcDts,Bt=this.isSafari;if(Qe!==0){Bt&&(A|=Ie.length&&it&&(W&&Math.abs(x-it/fe)<.1||Math.abs(Ie[0].pts-it-rn)1?d.logger.log("AVC: "+Ue(Xt,!0)+" ms hole between fragments detected,filling it"):Xt<-1&&d.logger.log("AVC: "+Ue(-Xt,!0)+" ms overlapping between fragments detected"),ce=it,Ie[0].dts=ce,le=Math.max(le-Xt,it),Ie[0].pts=le,d.logger.log("Video: PTS/DTS adjusted: "+Ue(le,!0)+"/"+Ue(ce,!0)+", delta: "+Ue(Xt,!0)+" ms")),Et=Ie[Ie.length-1],Fe=Math.max(Et.dts,0),De=Math.max(Et.pts,0,Fe),Bt&&(K=Math.round((Fe-ce)/(Ie.length-1)));for(var Rn=0,Nn=0,Zn=0;Zn0?lr-1:lr].dts;if(qo.stretchShortVideoTrack){var Ca=qo.maxBufferHole,Yl=Math.floor(Ca*fe),Ki=(k?le+k*fe:this.nextAudioPts)-Gn.pts;Ki>Yl?(K=Ki-ro,K<0&&(K=ro),d.logger.log("It is approximately "+Ue(Ki,!1)+" ms to the next segment; using duration "+Ue(K,!1)+" ms for the last video frame.")):K=ro}else K=ro}Fa=Math.round(Gn.pts-Gn.dts)}We.push({size:ea,duration:K,cts:Fa,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:Gn.key?2:1,isNonSync:Gn.key?0:1}})}this.nextAvcDts=Fe+K;var Nu=D.dropped;if(D.nbNalu=0,D.dropped=0,We.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var Pu=We[0].flags;Pu.dependsOn=2,Pu.isNonSync=0}D.samples=We,ue=Bn.moof(D.sequenceNumber++,ce,D),D.samples=[];var wa={data1:ue,data2:re,startPTS:le/fe,endPTS:(De+K)/fe,startDTS:ce/fe,endDTS:this.nextAvcDts/fe,type:"video",hasAudio:!1,hasVideo:!0,nb:We.length,dropped:Nu};return this.observer.trigger(i.default.FRAG_PARSING_DATA,wa),wa}},J.remuxAudio=function(D,x,A,k){var W=D.inputTimeScale,X=D.timescale,K=W/X,re=D.isAAC?1024:1152,ue=re*K,le=this._PTSNormalize,ce=this._initPTS,De=!D.isAAC&&this.typeSupported.mpeg,Fe,fe,Ie,We,Qe,It,rn=De?0:8,it=D.samples,Bt=[],_t=this.nextAudioPts;if(A|=it.length&&_t&&(k&&Math.abs(x-_t/W)<.1||Math.abs(it[0].pts-_t-ce)<20*ue),it.forEach(function(Ca){Ca.pts=Ca.dts=le(Ca.pts-ce,x*W)}),it=it.filter(function(Ca){return Ca.pts>=0}),it.length!==0){if(A||(k?_t=x*W:_t=it[0].pts),D.isAAC)for(var un=this.config.maxAudioFramesDrift,Et=0,Xt=_t;Et=un*ue&&Nn<_e&&Xt){var Mn=Math.round(Nn/ue);d.logger.warn("Injecting "+Mn+" audio frames @ "+Ue(Xt,!0)+" ms due to "+Ue(Xt,!0)+" ms gap.");for(var gr=0;gr.1*ue,Rn.pts=Rn.dts=Xt,Xt+=ue,Et++}for(var mn=it.length,Jn=0;mn--;)Jn+=it[mn].unit.byteLength;for(var xr=0,Sr=it.length;xr0&&ea<_e)Fa=Math.round((Hr-_t)/ue),d.logger.log(Ue(ea,!0)+" ms hole between AAC samples detected,filling it"),Fa>0&&(fe=Qt.getSilentFrame(D.manifestCodec||D.codec,D.channelCount),fe||(fe=Gn.subarray()),Jn+=Fa*fe.length);else if(ea<-12){d.logger.log("drop overlapping AAC sample, expected/parsed/delta: "+Ue(_t,!0)+" ms / "+Ue(Hr,!0)+" ms / "+Ue(-ea,!0)+" ms"),Jn-=Gn.byteLength;continue}Hr=_t}if(Qe=Hr,Jn>0){Jn+=rn;try{Ie=new Uint8Array(Jn)}catch{this.observer.trigger(i.default.ERROR,{type:l.ErrorTypes.MUX_ERROR,details:l.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Jn,reason:"fail allocating audio mdat "+Jn});return}if(!De){var Fo=new DataView(Ie.buffer);Fo.setUint32(0,Jn),Ie.set(Bn.types.mdat,4)}}else return;for(var Go=0;Go=2&&(to=Bt[mn-2].duration,Fe.duration=to),mn){this.nextAudioPts=_t=It+K*to,D.samples=Bt,De?We=new Uint8Array:We=Bn.moof(D.sequenceNumber++,Qe/K,D),D.samples=[];var no=Qe/W,qo=_t/W,ro={data1:We,data2:Ie,startPTS:no,endPTS:qo,startDTS:no,endDTS:qo,type:"audio",hasAudio:!0,hasVideo:!1,nb:mn};return this.observer.trigger(i.default.FRAG_PARSING_DATA,ro),ro}return null}},J.remuxEmptyAudio=function(D,x,A,k){var W=D.inputTimeScale,X=D.samplerate?D.samplerate:W,K=W/X,re=this.nextAudioPts,ue=(re!==void 0?re:k.startDTS*W)+this._initDTS,le=k.endDTS*W+this._initDTS,ce=1024,De=K*ce,Fe=Math.ceil((le-ue)/De),fe=Qt.getSilentFrame(D.manifestCodec||D.codec,D.channelCount);if(d.logger.warn("remux empty Audio"),!fe){d.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");return}for(var Ie=[],We=0;We4294967296;)D+=A;return D},U}(),wt=et,on=function(){function U(L){this.observer=L}var J=U.prototype;return J.destroy=function(){},J.resetTimeStamp=function(){},J.resetInitSegment=function(){},J.remux=function(D,x,A,k,W,X,K,re){var ue=this.observer,le="";D&&(le+="audio"),x&&(le+="video"),ue.trigger(i.default.FRAG_PARSING_DATA,{data1:re,startPTS:W,startDTS:W,type:le,hasAudio:!!D,hasVideo:!!x,nb:1,dropped:0}),ue.trigger(i.default.FRAG_PARSED)},U}(),Ge=on,pt=Object(h.getSelfScope)(),$n;try{$n=pt.performance.now.bind(pt.performance)}catch{d.logger.debug("Unable to use Performance API on this environment"),$n=pt.Date.now}var Tt=function(){function U(L,D,x,A){this.observer=L,this.typeSupported=D,this.config=x,this.vendor=A}var J=U.prototype;return J.destroy=function(){var D=this.demuxer;D&&D.destroy()},J.push=function(D,x,A,k,W,X,K,re,ue,le,ce,De){var Fe=this;if(D.byteLength>0&&x!=null&&x.key!=null&&x.method==="AES-128"){var fe=this.decrypter;fe==null&&(fe=this.decrypter=new p.default(this.observer,this.config));var Ie=$n();fe.decrypt(D,x.key.buffer,x.iv.buffer,function(We){var Qe=$n();Fe.observer.trigger(i.default.FRAG_DECRYPTED,{stats:{tstart:Ie,tdecrypt:Qe}}),Fe.pushDecrypted(new Uint8Array(We),x,new Uint8Array(A),k,W,X,K,re,ue,le,ce,De)})}else this.pushDecrypted(new Uint8Array(D),x,new Uint8Array(A),k,W,X,K,re,ue,le,ce,De)},J.pushDecrypted=function(D,x,A,k,W,X,K,re,ue,le,ce,De){var Fe=this.demuxer;if(!Fe||(K||re)&&!this.probe(D)){for(var fe=this.observer,Ie=this.typeSupported,We=this.config,Qe=[{demux:Ut,remux:wt},{demux:pe.default,remux:Ge},{demux:ee,remux:wt},{demux:Ht,remux:wt}],It=0,rn=Qe.length;It1?O-1:0),Q=1;Q1?O-1:0),Q=1;Q0)return y.subarray(M,M+C)},h._readSize=function(y,E){var M=0;return M=(y[E]&127)<<21,M|=(y[E+1]&127)<<14,M|=(y[E+2]&127)<<7,M|=y[E+3]&127,M},h.getTimeStamp=function(y){for(var E=h.getID3Frames(y),M=0;M>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:Z+=String.fromCharCode(B);break;case 12:case 13:Q=y[ne++],Z+=String.fromCharCode((B&31)<<6|Q&63);break;case 14:Q=y[ne++],z=y[ne++],Z+=String.fromCharCode((B&15)<<12|(Q&63)<<6|(z&63)<<0);break;default:}}return Z},h}(),p;function T(){var h=Object(i.getSelfScope)();return!p&&typeof h.TextDecoder!="undefined"&&(p=new h.TextDecoder("utf-8")),p}var d=l._utf8ArrayToStr;n.default=l},"./src/demux/mp4demuxer.js":function(e,n,r){"use strict";r.r(n);var i=r("./src/utils/logger.js"),l=r("./src/events.js"),p=Math.pow(2,32)-1,T=function(){function d(P,y){this.observer=P,this.remuxer=y}var h=d.prototype;return h.resetTimeStamp=function(y){this.initPTS=y},h.resetInitSegment=function(y,E,M,C){if(y&&y.byteLength){var S=this.initData=d.parseInitSegment(y);E==null&&(E="mp4a.40.5"),M==null&&(M="avc1.42e01e");var O={};S.audio&&S.video?O.audiovideo={container:"video/mp4",codec:E+","+M,initSegment:C?y:null}:(S.audio&&(O.audio={container:"audio/mp4",codec:E,initSegment:C?y:null}),S.video&&(O.video={container:"video/mp4",codec:M,initSegment:C?y:null})),this.observer.trigger(l.default.FRAG_PARSING_INIT_SEGMENT,{tracks:O})}else E&&(this.audioCodec=E),M&&(this.videoCodec=M)},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,E){y.data&&(E+=y.start,y=y.data);var M=y[E]<<8|y[E+1];return M<0?65536+M:M},d.readUint32=function(y,E){y.data&&(E+=y.start,y=y.data);var M=y[E]<<24|y[E+1]<<16|y[E+2]<<8|y[E+3];return M<0?4294967296+M:M},d.writeUint32=function(y,E,M){y.data&&(E+=y.start,y=y.data),y[E]=M>>24,y[E+1]=M>>16&255,y[E+2]=M>>8&255,y[E+3]=M&255},d.findBox=function(y,E){var M=[],C,S,O,B,Q,z,Z;if(y.data?(z=y.start,B=y.end,y=y.data):(z=0,B=y.byteLength),!E.length)return null;for(C=z;C1?C+S:B,O===E[0]&&(E.length===1?M.push({data:y,start:C+8,end:Z}):(Q=d.findBox({data:y,start:C+8,end:Z},E.slice(1)),Q.length&&(M=M.concat(Q)))),C=Z;return M},d.parseSegmentIndex=function(y){var E=d.findBox(y,["moov"])[0],M=E?E.end:null,C=0,S=d.findBox(y,["sidx"]),O;if(!S||!S[0])return null;O=[],S=S[0];var B=S.data[0];C=B===0?8:16;var Q=d.readUint32(S,C);C+=4;var z=0,Z=0;B===0?C+=8:C+=16,C+=2;var ne=S.end+Z,ee=d.readUint16(S,C);C+=2;for(var pe=0;pe>>31;if(Ke===1){console.warn("SIDX has hierarchical references (not supported)");return}var an=d.readUint32(S,ve);ve+=4,O.push({referenceSize:qe,subsegmentDuration:an,info:{duration:an/Q,start:ne,end:ne+qe-1}}),ne+=qe,ve+=4,C=ve}return{earliestPresentationTime:z,timescale:Q,version:B,referencesCount:ee,references:O,moovEndOffset:M}},d.parseInitSegment=function(y){var E=[],M=d.findBox(y,["moov","trak"]);return M.forEach(function(C){var S=d.findBox(C,["tkhd"])[0];if(S){var O=S.data[S.start],B=O===0?12:20,Q=d.readUint32(S,B),z=d.findBox(C,["mdia","mdhd"])[0];if(z){O=z.data[z.start],B=O===0?12:20;var Z=d.readUint32(z,B),ne=d.findBox(C,["mdia","hdlr"])[0];if(ne){var ee=d.bin2str(ne.data.subarray(ne.start+8,ne.start+12)),pe={soun:"audio",vide:"video"}[ee];if(pe){var ve=d.findBox(C,["mdia","minf","stbl","stsd"]);if(ve.length){ve=ve[0];var $e=d.bin2str(ve.data.subarray(ve.start+12,ve.start+16));i.logger.log("MP4Demuxer:"+pe+":"+$e+" found")}E[Q]={timescale:Z,type:pe},E[pe]={timescale:Z,id:Q}}}}}}),E},d.getStartDTS=function(y,E){var M,C,S;return M=d.findBox(E,["moof","traf"]),C=[].concat.apply([],M.map(function(O){return d.findBox(O,["tfhd"]).map(function(B){var Q,z,Z;return Q=d.readUint32(B,4),z=y[Q].timescale||9e4,Z=d.findBox(O,["tfdt"]).map(function(ne){var ee,pe;return ee=ne.data[ne.start],pe=d.readUint32(ne,4),ee===1&&(pe*=Math.pow(2,32),pe+=d.readUint32(ne,8)),pe})[0],Z/z})})),S=Math.min.apply(null,C),isFinite(S)?S:0},d.offsetStartDTS=function(y,E,M){d.findBox(E,["moof","traf"]).map(function(C){return d.findBox(C,["tfhd"]).map(function(S){var O=d.readUint32(S,4),B=y[O].timescale||9e4;d.findBox(C,["tfdt"]).map(function(Q){var z=Q.data[Q.start],Z=d.readUint32(Q,4);if(z===0)d.writeUint32(Q,4,Z-M*B);else{Z*=Math.pow(2,32),Z+=d.readUint32(Q,8),Z-=M*B,Z=Math.max(Z,0);var ne=Math.floor(Z/(p+1)),ee=Math.floor(Z%(p+1));d.writeUint32(Q,4,ne),d.writeUint32(Q,8,ee)}})})})},h.append=function(y,E,M,C){var S=this.initData;S||(this.resetInitSegment(y,this.audioCodec,this.videoCodec,!1),S=this.initData);var O,B=this.initPTS;if(B===void 0){var Q=d.getStartDTS(S,y);this.initPTS=B=Q-E,this.observer.trigger(l.default.INIT_PTS_FOUND,{initPTS:B})}d.offsetStartDTS(S,y,B),O=d.getStartDTS(S,y),this.remuxer.remux(S.audio,S.video,null,null,O,M,C,y)},h.destroy=function(){},d}();n.default=T},"./src/errors.ts":function(e,n,r){"use strict";r.r(n),r.d(n,"ErrorTypes",function(){return i}),r.d(n,"ErrorDetails",function(){return l});var i;(function(p){p.NETWORK_ERROR="networkError",p.MEDIA_ERROR="mediaError",p.KEY_SYSTEM_ERROR="keySystemError",p.MUX_ERROR="muxError",p.OTHER_ERROR="otherError"})(i||(i={}));var l;(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"})(l||(l={}))},"./src/events.js":function(e,n,r){"use strict";r.r(n);var i={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition",LIVE_BACK_BUFFER_REACHED:"hlsLiveBackBufferReached"};n.default=i},"./src/hls.ts":function(e,n,r){"use strict";r.r(n);var i={};r.r(i),r.d(i,"newCue",function(){return Yv});var l=r("./node_modules/url-toolkit/src/url-toolkit.js"),p=r("./src/errors.ts"),T=r("./src/polyfills/number-isFinite.js"),d=r("./src/events.js"),h=r("./src/utils/logger.js"),P={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},y=function(){function g(u){this.hls=void 0,this.handledEvents=void 0,this.useGenericHandler=void 0,this.hls=u,this.onEvent=this.onEvent.bind(this);for(var o=arguments.length,t=new Array(o>1?o-1:0),a=1;a>8*(15-a)&255;return t},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},Z(g,[{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=Object(l.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(o){this._url=o}},{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var o=this.sn;typeof o!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&h.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),o=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,o)}return this._decryptdata}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!Object(T.isFiniteNumber)(this.programDateTime))return null;var o=Object(T.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 pe(g,v){for(var u=0;uNumber.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),c=0;cNumber.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=qe.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(Ke.lastIndex=0;(t=Ke.exec(o))!==null;){var c=t[2],_='"';c.indexOf(_)===0&&c.lastIndexOf(_)===c.length-1&&(c=c.slice(1,-1)),a[t[1]]=c}return a},g}(),ln=an,lt={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 yt(g,v){var u=lt[v];return!!u&&u[g.slice(0,4)]===!0}function Ut(g,v){return MediaSource.isTypeSupported((v||"video")+'/mp4;codecs="'+g+'"')}var nn=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,Ht=/#EXT-X-MEDIA:(.*)/g,xt=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),Qt=/(?:(?:#(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?/,Nt=/\.(mp4|m4s|m4v|m4a)$/i,ft=function(){function g(){}return g.findGroup=function(u,o){for(var t=0;t2?(t=o.shift()+".",t+=parseInt(o.shift()).toString(16),t+=("000"+parseInt(o.shift()).toString(16)).substr(-4)):t=u,t},g.resolve=function(u,o){return l.buildAbsoluteURL(o,u,{alwaysNormalize:!0})},g.parseMasterPlaylist=function(u,o){var t=[];nn.lastIndex=0;function a(I,N){["video","audio"].forEach(function(j){var q=I.filter(function(de){return yt(de,j)});if(q.length){var ae=q.filter(function(de){return de.lastIndexOf("avc1",0)===0||de.lastIndexOf("mp4a",0)===0});N[j+"Codec"]=ae.length>0?ae[0]:q[0],I=I.filter(function(de){return q.indexOf(de)===-1})}}),N.unknownCodecs=I}for(var c;(c=nn.exec(u))!=null;){var _={},R=_.attrs=new ln(c[1]);_.url=g.resolve(c[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(u,o,t,a){a===void 0&&(a=[]);var c,_=[],R=0;for(Ht.lastIndex=0;(c=Ht.exec(u))!==null;){var b=new ln(c[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 N=g.findGroup(a,I.groupId);I.audioCodec=N?N.codec:a[0].codec}_.push(I)}}return _},g.parseLevelPlaylist=function(u,o,t,a,c){var _=0,R=0,b=new $e(o),I=0,N=null,j=new ee,q,ae,de,Te=null;for(xt.lastIndex=0;(q=xt.exec(u))!==null;){var Ye=q[1];if(Ye){j.duration=parseFloat(Ye);var Je=(" "+q[2]).slice(1);j.title=Je||null,j.tagList.push(Je?["INF",Ye,Je]:["INF",Ye])}else if(q[3]){if(Object(T.isFiniteNumber)(j.duration)){var ze=_++;j.type=a,j.start=R,de&&(j.levelkey=de),j.sn=ze,j.level=t,j.cc=I,j.urlId=c,j.baseurl=o,j.relurl=(" "+q[3]).slice(1),me(j,N),b.fragments.push(j),N=j,R+=j.duration,j=new ee}}else if(q[4]){var at=(" "+q[4]).slice(1);N?j.setByteRange(at,N):j.setByteRange(at)}else if(q[5])j.rawProgramDateTime=(" "+q[5]).slice(1),j.tagList.push(["PROGRAM-DATE-TIME",j.rawProgramDateTime]),Te===null&&(Te=b.fragments.length);else{if(q=q[0].match(Qt),!q){h.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae=0&&(de.method=kt,de.key=null,de.iv=ht));break}case"START":{var sr=new ln(Dt),$u=sr.decimalFloatingPoint("TIME-OFFSET");Object(T.isFiniteNumber)($u)&&(b.startTimeOffset=$u);break}case"MAP":{var Ju=new ln(Dt);j.relurl=Ju.URI,Ju.BYTERANGE&&j.setByteRange(Ju.BYTERANGE),j.baseurl=o,j.level=t,j.type=a,j.sn="initSegment",b.initSegment=j,j=new ee,j.rawProgramDateTime=b.initSegment.rawProgramDateTime;break}default:h.logger.warn("line parsed but not handled: "+q);break}}}return j=N,j&&!j.relurl&&(b.fragments.pop(),R-=j.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(Dm){return Nt.test(Dm.relurl)})&&(h.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),j=new ee,j.relurl=b.fragments[0].relurl,j.baseurl=o,j.level=t,j.type=a,j.sn="initSegment",b.initSegment=j,b.needSidxRanges=!0),Te&&Bn(b.fragments,Te),b},g}();function Bn(g,v){for(var u=g[v],o=v-1;o>=0;o--){var t=g[o];t.programDateTime=u.programDateTime-t.duration*1e3,u=t}}function me(g,v){g.rawProgramDateTime?g.programDateTime=Date.parse(g.rawProgramDateTime):v&&v.programDateTime&&(g.programDateTime=v.endProgramDateTime),Object(T.isFiniteNumber)(g.programDateTime)||(g.programDateTime=null,g.rawProgramDateTime=null)}function dt(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var Pt=window,Ue=Pt.performance,Ae=function(g){dt(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!==M.AUDIO_TRACK&&t!==M.SUBTITLE_TRACK},v.mapContextToLevelType=function(t){var a=t.type;switch(a){case M.AUDIO_TRACK:return C.AUDIO;case M.SUBTITLE_TRACK:return C.SUBTITLE;default:return C.MAIN}},v.getResponseUrl=function(t,a){var c=t.url;return(c===void 0||c.indexOf("data:")===0)&&(c=a.url),c};var u=v.prototype;return u.createInternalLoader=function(t){var a=this.hls.config,c=a.pLoader,_=a.loader,R=c||_,b=new R(a);return t.loader=b,this.loaders[t.type]=b,b},u.getInternalLoader=function(t){return this.loaders[t.type]},u.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},u.destroyInternalLoaders=function(){for(var t in this.loaders){var a=this.loaders[t];a&&a.destroy(),this.resetInternalLoader(t)}},u.destroy=function(){this.destroyInternalLoaders(),g.prototype.destroy.call(this)},u.onManifestLoading=function(t){this.load({url:t.url,type:M.MANIFEST,level:0,id:null,responseType:"text"})},u.onLevelLoading=function(t){this.load({url:t.url,type:M.LEVEL,level:t.level,id:t.id,responseType:"text"})},u.onAudioTrackLoading=function(t){this.load({url:t.url,type:M.AUDIO_TRACK,level:null,id:t.id,responseType:"text"})},u.onSubtitleTrackLoading=function(t){this.load({url:t.url,type:M.SUBTITLE_TRACK,level:null,id:t.id,responseType:"text"})},u.load=function(t){var a=this.hls.config;h.logger.debug("Loading playlist of type "+t.type+", level: "+t.level+", id: "+t.id);var c=this.getInternalLoader(t);if(c){var _=c.context;if(_&&_.url===t.url)return h.logger.trace("playlist request ongoing"),!1;h.logger.warn("aborting previous loader for type: "+t.type),c.abort()}var R,b,I,N;switch(t.type){case M.MANIFEST:R=a.manifestLoadingMaxRetry,b=a.manifestLoadingTimeOut,I=a.manifestLoadingRetryDelay,N=a.manifestLoadingMaxRetryTimeout;break;case M.LEVEL:R=0,N=0,I=0,b=a.levelLoadingTimeOut;break;default:R=a.levelLoadingMaxRetry,b=a.levelLoadingTimeOut,I=a.levelLoadingRetryDelay,N=a.levelLoadingMaxRetryTimeout;break}c=this.createInternalLoader(t);var j={timeout:b,maxRetry:R,retryDelay:I,maxRetryDelay:N},q={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return h.logger.debug("Calling internal loader delegate for URL: "+t.url),c.load(t,j,q),!0},u.loadsuccess=function(t,a,c,_){if(_===void 0&&(_=null),c.isSidxRequest){this._handleSidxRequest(t,c),this._handlePlaylistLoaded(t,a,c,_);return}if(this.resetInternalLoader(c.type),typeof t.data!="string")throw new Error('expected responseType of "text" for PlaylistLoader');var R=t.data;if(a.tload=Ue.now(),R.indexOf("#EXTM3U")!==0){this._handleManifestParsingError(t,c,"no EXTM3U delimiter",_);return}R.indexOf("#EXTINF:")>0||R.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(t,a,c,_):this._handleMasterPlaylist(t,a,c,_)},u.loaderror=function(t,a,c){c===void 0&&(c=null),this._handleNetworkError(a,c,!1,t)},u.loadtimeout=function(t,a,c){c===void 0&&(c=null),this._handleNetworkError(a,c,!0)},u._handleMasterPlaylist=function(t,a,c,_){var R=this.hls,b=t.data,I=v.getResponseUrl(t,c),N=ft.parseMasterPlaylist(b,I);if(!N.length){this._handleManifestParsingError(t,c,"no level found in manifest",_);return}var j=N.map(function(Te){return{id:Te.attrs.AUDIO,codec:Te.audioCodec}}),q=ft.parseMasterPlaylistMedia(b,I,"AUDIO",j),ae=ft.parseMasterPlaylistMedia(b,I,"SUBTITLES");if(q.length){var de=!1;q.forEach(function(Te){Te.url||(de=!0)}),de===!1&&N[0].audioCodec&&!N[0].attrs.AUDIO&&(h.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),q.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1}))}R.trigger(d.default.MANIFEST_LOADED,{levels:N,audioTracks:q,subtitles:ae,url:I,stats:a,networkDetails:_})},u._handleTrackOrLevelPlaylist=function(t,a,c,_){var R=this.hls,b=c.id,I=c.level,N=c.type,j=v.getResponseUrl(t,c),q=Object(T.isFiniteNumber)(b)?b:0,ae=Object(T.isFiniteNumber)(I)?I:q,de=v.mapContextToLevelType(c),Te=ft.parseLevelPlaylist(t.data,j,ae,de,q);if(Te.tload=a.tload,N===M.MANIFEST){var Ye={url:j,details:Te};R.trigger(d.default.MANIFEST_LOADED,{levels:[Ye],audioTracks:[],url:j,stats:a,networkDetails:_})}if(a.tparsed=Ue.now(),Te.needSidxRanges){var Je=Te.initSegment.url;this.load({url:Je,isSidxRequest:!0,type:N,level:I,levelDetails:Te,id:b,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"});return}c.levelDetails=Te,this._handlePlaylistLoaded(t,a,c,_)},u._handleSidxRequest=function(t,a){if(typeof t.data=="string")throw new Error("sidx request must be made with responseType of array buffer");var c=S.default.parseSegmentIndex(new Uint8Array(t.data));if(!!c){var _=c.references,R=a.levelDetails;_.forEach(function(b,I){var N=b.info;if(!!R){var j=R.fragments[I];j.byteRange.length===0&&j.setByteRange(String(1+N.end-N.start)+"@"+String(N.start))}}),R&&R.initSegment.setByteRange(String(c.moovEndOffset)+"@0")}},u._handleManifestParsingError=function(t,a,c,_){this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:t.url,reason:c,networkDetails:_})},u._handleNetworkError=function(t,a,c,_){c===void 0&&(c=!1),_===void 0&&(_=null),h.logger.info("A network error occured while loading a "+t.type+"-type playlist");var R,b,I=this.getInternalLoader(t);switch(t.type){case M.MANIFEST:R=c?p.ErrorDetails.MANIFEST_LOAD_TIMEOUT:p.ErrorDetails.MANIFEST_LOAD_ERROR,b=!0;break;case M.LEVEL:R=c?p.ErrorDetails.LEVEL_LOAD_TIMEOUT:p.ErrorDetails.LEVEL_LOAD_ERROR,b=!1;break;case M.AUDIO_TRACK:R=c?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 N={type:p.ErrorTypes.NETWORK_ERROR,details:R,fatal:b,url:t.url,loader:I,context:t,networkDetails:a};_&&(N.response=_),this.hls.trigger(d.default.ERROR,N)},u._handlePlaylistLoaded=function(t,a,c,_){var R=c.type,b=c.level,I=c.id,N=c.levelDetails;if(!N||!N.targetduration){this._handleManifestParsingError(t,c,"invalid target duration",_);return}var j=v.canHaveQualityLevels(c.type);if(j)this.hls.trigger(d.default.LEVEL_LOADED,{details:N,level:b||0,id:I||0,stats:a,networkDetails:_});else switch(R){case M.AUDIO_TRACK:this.hls.trigger(d.default.AUDIO_TRACK_LOADED,{details:N,id:I,stats:a,networkDetails:_});break;case M.SUBTITLE_TRACK:this.hls.trigger(d.default.SUBTITLE_TRACK_LOADED,{details:N,id:I,stats:a,networkDetails:_});break}},v}(E),_e=Ae;function ot(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var et=function(g){ot(v,g);function v(o){var t;return t=g.call(this,o,d.default.FRAG_LOADING)||this,t.loaders={},t}var u=v.prototype;return u.destroy=function(){var t=this.loaders;for(var a in t){var c=t[a];c&&c.destroy()}this.loaders={},g.prototype.destroy.call(this)},u.onFragLoading=function(t){var a=t.frag,c=a.type,_=this.loaders,R=this.hls.config,b=R.fLoader,I=R.loader;a.loaded=0;var N=_[c];N&&(h.logger.warn("abort previous fragment loader for type: "+c),N.abort()),N=_[c]=a.loader=R.fLoader?new b(R):new I(R);var j,q,ae;j={url:a.url,frag:a,responseType:"arraybuffer",progressData:!1};var de=a.byteRangeStartOffset,Te=a.byteRangeEndOffset;Object(T.isFiniteNumber)(de)&&Object(T.isFiniteNumber)(Te)&&(j.rangeStart=de,j.rangeEnd=Te),q={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout},ae={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},N.load(j,q,ae)},u.loadsuccess=function(t,a,c,_){_===void 0&&(_=null);var R=t.data,b=c.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:_})},u.loaderror=function(t,a,c){c===void 0&&(c=null);var _=a.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a.frag,response:t,networkDetails:c})},u.loadtimeout=function(t,a,c){c===void 0&&(c=null);var _=a.frag,R=_.loader;R&&R.abort(),this.loaders[_.type]=void 0,this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a.frag,networkDetails:c})},u.loadprogress=function(t,a,c,_){_===void 0&&(_=null);var R=a.frag;R.loaded=t.loaded,this.hls.trigger(d.default.FRAG_LOAD_PROGRESS,{frag:R,stats:t,networkDetails:_})},v}(E),wt=et;function on(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var Ge=function(g){on(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 u=v.prototype;return u.destroy=function(){for(var t in this.loaders){var a=this.loaders[t];a&&a.destroy()}this.loaders={},g.prototype.destroy.call(this)},u.onKeyLoading=function(t){var a=t.frag,c=a.type,_=this.loaders[c];if(!a.decryptdata){h.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var R=a.decryptdata.uri;if(R!==this.decrypturl||this.decryptkey===null){var b=this.hls.config;if(_&&(h.logger.warn("abort previous key loader for type:"+c),_.abort()),!R){h.logger.warn("key uri is falsy");return}a.loader=this.loaders[c]=new b.loader(b),this.decrypturl=R,this.decryptkey=null;var I={url:R,frag:a,responseType:"arraybuffer"},N={timeout:b.fragLoadingTimeOut,maxRetry:0,retryDelay:b.fragLoadingRetryDelay,maxRetryDelay:b.fragLoadingMaxRetryTimeout},j={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.loader.load(I,N,j)}else this.decryptkey&&(a.decryptdata.key=this.decryptkey,this.hls.trigger(d.default.KEY_LOADED,{frag:a}))},u.loadsuccess=function(t,a,c){var _=c.frag;if(!_.decryptdata){h.logger.error("after key load, decryptdata unset");return}this.decryptkey=_.decryptdata.key=new Uint8Array(t.data),_.loader=void 0,delete this.loaders[_.type],this.hls.trigger(d.default.KEY_LOADED,{frag:_})},u.loaderror=function(t,a){var c=a.frag,_=c.loader;_&&_.abort(),delete this.loaders[c.type],this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:c,response:t})},u.loadtimeout=function(t,a){var c=a.frag,_=c.loader;_&&_.abort(),delete this.loaders[c.type],this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:c})},v}(E),pt=Ge;function $n(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var Tt={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"},Zr=function(g){$n(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 u=v.prototype;return u.destroy=function(){this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.config=null,E.prototype.destroy.call(this),g.prototype.destroy.call(this)},u.getBufferedFrag=function(t,a){var c=this.fragments,_=Object.keys(c).filter(function(b){var I=c[b];if(I.body.type!==a||!I.buffered)return!1;var N=I.body;return N.startPTS<=t&&t<=N.endPTS});if(_.length===0)return null;var R=_.pop();return c[R].body},u.detectEvictedFragments=function(t,a){var c=this,_,R;Object.keys(this.fragments).forEach(function(b){var I=c.fragments[b];if(I.buffered===!0){var N=I.range[t];if(N){_=N.time;for(var j=0;j<_.length;j++)if(R=_[j],c.isTimeBuffered(R.startPTS,R.endPTS,a)===!1){c.removeFragment(I.body);break}}}})},u.detectPartialFragments=function(t){var a=this,c=this.getFragmentKey(t),_=this.fragments[c];_&&(_.buffered=!0,Object.keys(this.timeRanges).forEach(function(R){if(t.hasElementaryStream(R)){var b=a.timeRanges[R];_.range[R]=a.getBufferedTimes(t.startPTS,t.endPTS,b)}}))},u.getBufferedTimes=function(t,a,c){for(var _=[],R,b,I=!1,N=0;N=R&&a<=b){_.push({startPTS:Math.max(t,c.start(N)),endPTS:Math.min(a,c.end(N))});break}else if(tR)_.push({startPTS:Math.max(t,c.start(N)),endPTS:Math.min(a,c.end(N))}),I=!0;else if(a<=R)break;return{time:_,partial:I}},u.getFragmentKey=function(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn},u.getPartialFragment=function(t){var a=this,c,_,R,b=null,I=0;return Object.keys(this.fragments).forEach(function(N){var j=a.fragments[N];a.isPartial(j)&&(_=j.body.startPTS-a.bufferPadding,R=j.body.endPTS+a.bufferPadding,t>=_&&t<=R&&(c=Math.min(t-_,R-t),I<=c&&(b=j.body,I=c)))}),b},u.getState=function(t){var a=this.getFragmentKey(t),c=this.fragments[a],_=Tt.NOT_LOADED;return c!==void 0&&(c.buffered?this.isPartial(c)===!0?_=Tt.PARTIAL:_=Tt.OK:_=Tt.APPENDING),_},u.isPartial=function(t){return t.buffered===!0&&(t.range.video!==void 0&&t.range.video.partial===!0||t.range.audio!==void 0&&t.range.audio.partial===!0)},u.isTimeBuffered=function(t,a,c){for(var _,R,b=0;b=_&&a<=R)return!0;if(a<=_)return!1}return!1},u.onFragLoaded=function(t){var a=t.frag;!Object(T.isFiniteNumber)(a.sn)||a.bitrateTest||(this.fragments[this.getFragmentKey(a)]={body:a,range:Object.create(null),buffered:!1})},u.onBufferAppended=function(t){var a=this;this.timeRanges=t.timeRanges,Object.keys(this.timeRanges).forEach(function(c){var _=a.timeRanges[c];a.detectEvictedFragments(c,_)})},u.onFragBuffered=function(t){this.detectPartialFragments(t.frag)},u.hasFragment=function(t){var a=this.getFragmentKey(t);return this.fragments[a]!==void 0},u.removeFragment=function(t){var a=this.getFragmentKey(t);delete this.fragments[a]},u.removeAllFragments=function(){this.fragments=Object.create(null)},v}(E),U={search:function(v,u){for(var o=0,t=v.length-1,a=null,c=null;o<=t;){a=(o+t)/2|0,c=v[a];var _=u(c);if(_>0)o=a+1;else if(_<0)t=a-1;else return c}return null}},J=U,L=function(){function g(){}return g.isBuffered=function(u,o){try{if(u){for(var t=u.buffered,a=0;a=t.start(a)&&o<=t.end(a))return!0}}catch{}return!1},g.bufferInfo=function(u,o,t){try{if(u){var a=u.buffered,c=[],_;for(_=0;_R&&(a[_-1].end=u[c].end):a.push(u[c])}else a.push(u[c])}else a=u;for(var b=0,I,N=o,j=o,q=0;q=ae&&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!")):u>v?t.start=o.start+o.duration:t.start=Math.max(o.start-t.duration,0)}function fe(g,v,u,o,t,a){var c=u;if(Object(T.isFiniteNumber)(v.startPTS)){var _=Math.abs(v.startPTS-u);Object(T.isFiniteNumber)(v.deltaPTS)?v.deltaPTS=Math.max(_,v.deltaPTS):v.deltaPTS=_,c=Math.max(u,v.startPTS),u=Math.min(u,v.startPTS),o=Math.max(o,v.endPTS),t=Math.min(t,v.startDTS),a=Math.max(a,v.endDTS)}var R=u-v.start;v.start=v.startPTS=u,v.maxStartPTS=c,v.endPTS=o,v.startDTS=t,v.endDTS=a,v.duration=o-u;var b=v.sn;if(!g||bg.endSN)return 0;var I,N,j;for(I=b-g.startSN,N=g.fragments,N[I]=v,j=I;j>0;j--)Fe(N,j,j-1);for(j=I;jo.length))for(var a=0;av?-1:0})}function Et(g,v,u){var o=!1;return v&&v.details&&u&&(u.endCC>u.startCC||g&&g.cc=(t||0))return null;u=u||0;for(var a=0;ag&&u.start?-1:0}function Jn(g,v,u){var o=Math.min(v,u.duration+(u.deltaPTS?u.deltaPTS:0))*1e3,t=u.endProgramDateTime||0;return t-o>g}var xr=250,Sr=2,lr=.1,Gn=.05,Hr=function(){function g(u,o,t,a){this.config=u,this.media=o,this.fragmentTracker=t,this.hls=a,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1}var v=g.prototype;return v.poll=function(o){var t=this.config,a=this.media,c=this.stalled,_=a.currentTime,R=a.seeking,b=this.seeking&&!R,I=!this.seeking&&R;if(this.seeking=R,_!==o){if(this.moved=!0,c!==null){if(this.stallReported){var N=self.performance.now()-c;h.logger.warn("playback not stuck anymore @"+_+", after "+Math.round(N)+"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 j=L.bufferInfo(a,_,0),q=j.len>0,ae=j.nextStart||0;if(!(!q&&!ae)){if(R){var de=j.len>Sr,Te=!ae||ae-_>Sr;if(de||Te)return;this.moved=!1}if(!this.moved&&this.stalled){var Ye=Math.max(ae,j.start||0)-_;if(Ye>0&&Ye<=Sr){this._trySkipBufferHole(null);return}}var Je=self.performance.now();if(c===null){this.stalled=Je;return}var ze=Je-c;!R&&ze>=xr&&this._reportStall(j.len);var at=L.bufferInfo(a,_,t.maxBufferHole);this._tryFixBufferStall(at,ze)}}},v._tryFixBufferStall=function(o,t){var a=this.config,c=this.fragmentTracker,_=this.media,R=_.currentTime,b=c.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,c=this.stallReported;c||(this.stallReported=!0,h.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer"),t.trigger(d.default.ERROR,{type: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,c=this.media,_=c.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)},u.doTick=function(){},v}(E);function Go(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var te={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},to=function(g){Go(v,g);function v(){return g.apply(this,arguments)||this}var u=v.prototype;return u.doTick=function(){},u.startLoad=function(){},u.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragmentTracker.removeFragment(t)),this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=te.STOPPED},u._streamEnded=function(t,a){var c=this.fragCurrent,_=this.fragmentTracker;if(!a.live&&c&&!c.backtracked&&c.sn===a.endSN&&!t.nextStart){var R=_.getState(c);return R===Tt.PARTIAL||R===Tt.OK}return!1},u.onMediaSeeking=function(){var t=this.config,a=this.media,c=this.mediaBuffer,_=this.state,R=a?a.currentTime:null,b=L.bufferInfo(c||a,R,this.config.maxBufferHole);if(Object(T.isFiniteNumber)(R)&&h.logger.log("media seeking to "+R.toFixed(3)),_===te.FRAG_LOADING){var I=this.fragCurrent;if(b.len===0&&I){var N=t.maxFragLookUpTolerance,j=I.start-N,q=I.start+I.duration+N;Rq?(I.loader&&(h.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),I.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=te.IDLE):h.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else _===te.ENDED&&(b.len===0&&(this.fragPrevious=null,this.fragCurrent=null),this.state=te.IDLE);a&&(this.lastCurrentTime=R),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=R),this.tick()},u.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},u.onHandlerDestroying=function(){this.stopLoad(),g.prototype.onHandlerDestroying.call(this)},u.onHandlerDestroyed=function(){this.state=te.STOPPED,this.fragmentTracker=null},u.computeLivePosition=function(t,a){var c=this.config.liveSyncDuration!==void 0?this.config.liveSyncDuration:this.config.liveSyncDurationCount*a.targetduration;return t+Math.max(0,a.totalduration-c)},v}(Fo);function no(g,v){for(var u=0;u0&&t===-1&&(h.logger.log("override startPosition with lastCurrentTime @"+a.toFixed(3)),t=a),this.state=te.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=te.STOPPED},u.stopLoad=function(){this.forceStartLoad=!1,g.prototype.stopLoad.call(this)},u.doTick=function(){switch(this.state){case te.BUFFER_FLUSHING:this.fragLoadError=0;break;case te.IDLE:this._doTickIdle();break;case te.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=te.IDLE);break;case te.FRAG_LOADING_WAITING_RETRY:var a=window.performance.now(),c=this.retryDate;(!c||a>=c||this.media&&this.media.seeking)&&(h.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=te.IDLE);break;case te.ERROR:case te.STOPPED:case te.FRAG_LOADING:case te.PARSING:case te.PARSED:case te.ENDED:break;default:break}this._checkBuffer(),this._checkFragmentChanged()},u._doTickIdle=function(){var t=this.hls,a=t.config,c=this.media;if(!(this.levelLastLoaded===void 0||!c&&(this.startFragRequested||!a.startFragPrefetch))){var _;this.loadedmetadata?_=c.currentTime:_=this.nextLoadPosition;var R=t.nextLoadLevel,b=this.levels[R];if(!!b){var I=b.bitrate,N;I?N=Math.max(8*a.maxBufferSize/I,a.maxBufferLength):N=a.maxBufferLength,N=Math.min(N,a.maxMaxBufferLength);var j=L.bufferInfo(this.mediaBuffer?this.mediaBuffer:c,_,a.maxBufferHole),q=j.len;if(!(q>=N)){h.logger.trace("buffer length of "+q.toFixed(3)+" is below max of "+N.toFixed(3)+". checking for more payload ..."),this.level=t.nextLoadLevel=R;var ae=b.details;if(!ae||ae.live&&this.levelLastLoaded!==R){this.state=te.WAITING_LEVEL;return}if(this._streamEnded(j,ae)){var de={};this.altAudio&&(de.type="video"),this.hls.trigger(d.default.BUFFER_EOS,de),this.state=te.ENDED;return}this._fetchPayloadOrEos(_,j,ae)}}}},u._fetchPayloadOrEos=function(t,a,c){var _=this.fragPrevious,R=this.level,b=c.fragments,I=b.length;if(I!==0){var N=b[0].start,j=b[I-1].start+b[I-1].duration,q=a.end,ae;if(c.initSegment&&!c.initSegment.data)ae=c.initSegment;else if(c.live){var de=this.config.initialLiveManifestSize;if(Ide&&de>j.currentTime&&(h.logger.log("buffer end: "+a.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+de.toFixed(3)),j.currentTime=de),this.nextLoadPosition=de}if(t.PTSKnown&&a>_&&j&&j.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(R)if(t.hasProgramDateTime)h.logger.log("live playlist, switching playlist, load frag with same PDT: "+R.programDateTime),q=gr(b,R.endProgramDateTime,N.maxFragLookUpTolerance);else{var Te=R.sn+1;if(Te>=t.startSN&&Te<=t.endSN){var Ye=b[Te-t.startSN];R.cc===Ye.cc&&(q=Ye,h.logger.log("live playlist, switching playlist, load frag with next SN: "+q.sn))}q||(q=J.search(b,function(Je){return R.cc-Je.cc}),q&&h.logger.log("live playlist, switching playlist, load frag with same CC: "+q.sn))}q||(q=b[Math.min(I-1,Math.round(I/2))],h.logger.log("live playlist, switching playlist, unknown, load middle frag : "+q.sn))}return q},u._findFragment=function(t,a,c,_,R,b,I){var N=this.hls.config,j;if(Rb-N.maxFragLookUpTolerance?0:N.maxFragLookUpTolerance;j=Pn(a,_,R,q)}else j=_[c-1];if(j){var ae=j.sn-I.startSN,de=a&&j.level===a.level,Te=_[ae-1],Ye=_[ae+1];if(a&&j.sn===a.sn)if(de&&!j.backtracked)if(j.snN.maxBufferHole&&a.dropped&&ae?(j=Te,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")):(j=Ye,h.logger.log("Re-loading fragment with SN: "+j.sn))}else j=null;else j.backtracked&&(Ye&&Ye.backtracked?(h.logger.warn("Already backtracked from fragment "+Ye.sn+", will not backtrack to fragment "+j.sn+". Loading fragment "+Ye.sn),j=Ye):(h.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),j.dropped=0,Te?(j=Te,j.backtracked=!0):ae&&(j=null)))}return j},u._loadKey=function(t){this.state=te.KEY_LOADING,this.hls.trigger(d.default.KEY_LOADING,{frag:t})},u._loadFragment=function(t){var a=this.fragmentTracker.getState(t);this.fragCurrent=t,t.sn!=="initSegment"&&(this.startFragRequested=!0),Object(T.isFiniteNumber)(t.sn)&&!t.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),t.backtracked||a===Tt.NOT_LOADED||a===Tt.PARTIAL?(t.autoLevel=this.hls.autoLevelEnabled,t.bitrateTest=this.bitrateTest,this.hls.trigger(d.default.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new ce(this.hls,"main")),this.state=te.FRAG_LOADING):a===Tt.APPENDING&&this._reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t)},u.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,C.MAIN)},u.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.endPTS+.5):null},u._checkFragmentChanged=function(){var t,a,c=this.media;if(c&&c.readyState&&c.seeking===!1&&(a=c.currentTime,a>this.lastCurrentTime&&(this.lastCurrentTime=a),L.isBuffered(c,a)?t=this.getBufferedFrag(a):L.isBuffered(c,a+.1)&&(t=this.getBufferedFrag(a+.1)),t)){var _=t;if(_!==this.fragPlaying){this.hls.trigger(d.default.FRAG_CHANGED,{frag:_});var R=_.level;(!this.fragPlaying||this.fragPlaying.level!==R)&&this.hls.trigger(d.default.LEVEL_SWITCHED,{level:R}),this.fragPlaying=_}}},u.immediateLevelSwitch=function(){if(h.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,a;t?(a=t.paused,t.pause()):a=!0,this.previouslyPaused=a}var c=this.fragCurrent;c&&c.loader&&c.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},u.immediateLevelSwitchEnd=function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,L.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())},u.nextLevelSwitch=function(){var t=this.media;if(t&&t.readyState){var a,c,_;if(c=this.getBufferedFrag(t.currentTime),c&&c.startPTS>1&&this.flushMainBuffer(0,c.startPTS-1),t.paused)a=0;else{var R=this.hls.nextLoadLevel,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 N=this.fragCurrent;N&&N.loader&&N.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(_.maxStartPTS,Number.POSITIVE_INFINITY)}}},u.flushMainBuffer=function(t,a){this.state=te.BUFFER_FLUSHING;var c={startOffset:t,endOffset:a};this.altAudio&&(c.type="video"),this.hls.trigger(d.default.BUFFER_FLUSHING,c)},u.onMediaAttached=function(t){var a=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("seeked",this.onvseeked),a.addEventListener("ended",this.onvended);var c=this.config;this.levels&&c.autoStartLoad&&this.hls.startLoad(c.startPosition),this.gapController=new Hr(c,a,this.fragmentTracker,this.hls)},u.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var a=this.levels;a&&a.forEach(function(c){c.details&&c.details.fragments.forEach(function(_){_.backtracked=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("seeked",this.onvseeked),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.fragmentTracker.removeAllFragments(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},u.onMediaSeeked=function(){var t=this.media,a=t?t.currentTime:void 0;Object(T.isFiniteNumber)(a)&&h.logger.log("media seeked to "+a.toFixed(3)),this.tick()},u.onManifestLoading=function(){h.logger.log("trigger BUFFER_RESET"),this.hls.trigger(d.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},u.onManifestParsed=function(t){var a=!1,c=!1,_;t.levels.forEach(function(b){_=b.audioCodec,_&&(_.indexOf("mp4a.40.2")!==-1&&(a=!0),_.indexOf("mp4a.40.5")!==-1&&(c=!0))}),this.audioCodecSwitch=a&&c,this.audioCodecSwitch&&h.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.altAudio=t.altAudio,this.levels=t.levels,this.startFragRequested=!1;var R=this.config;(R.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(R.startPosition)},u.onLevelLoaded=function(t){var a=t.details,c=t.level,_=this.levels[this.levelLastLoaded],R=this.levels[c],b=a.totalduration,I=0;if(h.logger.log("level "+c+" loaded ["+a.startSN+","+a.endSN+"],duration:"+b),a.live){var N=R.details;N&&a.fragments.length>0?(Ie(N,a),I=a.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(I,N),a.PTSKnown&&Object(T.isFiniteNumber)(I)?h.logger.log("live playlist sliding:"+I.toFixed(3)):(h.logger.log("live playlist - outdated PTS, unknown sliding"),Nn(this.fragPrevious,_,a))):(h.logger.log("live playlist - first load, unknown sliding"),a.PTSKnown=!1,Nn(this.fragPrevious,_,a))}else a.PTSKnown=!1;if(R.details=a,this.levelLastLoaded=c,this.hls.trigger(d.default.LEVEL_UPDATED,{details:a,level:c}),this.startFragRequested===!1){if(this.startPosition===-1||this.lastCurrentTime===-1){var j=a.startTimeOffset;Object(T.isFiniteNumber)(j)?(j<0&&(h.logger.log("negative start time offset "+j+", count from end of last fragment"),j=I+b+j),h.logger.log("start time offset found in playlist, adjust startPosition to "+j),this.startPosition=j):a.live?(this.startPosition=this.computeLivePosition(I,a),h.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===te.WAITING_LEVEL&&(this.state=te.IDLE),this.tick()},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE,this.tick())},u.onFragLoaded=function(t){var a=this.fragCurrent,c=this.hls,_=this.levels,R=this.media,b=t.frag;if(this.state===te.FRAG_LOADING&&a&&b.type==="main"&&b.level===a.level&&b.sn===a.sn){var I=t.stats,N=_[a.level],j=N.details;if(this.bitrateTest=!1,this.stats=I,h.logger.log("Loaded "+a.sn+" of ["+j.startSN+" ,"+j.endSN+"],level "+a.level),b.bitrateTest&&c.nextLoadLevel)this.state=te.IDLE,this.startFragRequested=!1,I.tparsed=I.tbuffered=window.performance.now(),c.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else if(b.sn==="initSegment")this.state=te.IDLE,I.tparsed=I.tbuffered=window.performance.now(),j.initSegment.data=t.payload,c.trigger(d.default.FRAG_BUFFERED,{stats:I,frag:a,id:"main"}),this.tick();else{h.logger.log("Parsing "+a.sn+" of ["+j.startSN+" ,"+j.endSN+"],level "+a.level+", cc "+a.cc),this.state=te.PARSING,this.pendingBuffering=!0,this.appended=!1,b.bitrateTest&&(b.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:b}));var q=!(R&&R.seeking)&&(j.PTSKnown||!j.live),ae=j.initSegment?j.initSegment.data:[],de=this._getAudioCodec(N),Te=this.demuxer=this.demuxer||new ce(this.hls,"main");Te.push(t.payload,ae,de,N.videoCodec,a,j.totalduration,q)}}this.fragLoadError=0},u.onFragParsingInitSegment=function(t){var a=this.fragCurrent,c=t.frag;if(a&&t.id==="main"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING){var _=t.tracks,R,b;if(_.audio&&this.altAudio&&delete _.audio,b=_.audio,b){var I=this.levels[this.level].audioCodec,N=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&&N.indexOf("firefox")===-1&&(I="mp4a.40.5"),N.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 j=b.initSegment;j&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(d.default.BUFFER_APPENDING,{type:R,data:j,parent:"main",content:"initSegment"}))}this.tick()}},u.onFragParsingData=function(t){var a=this,c=this.fragCurrent,_=t.frag;if(c&&t.id==="main"&&_.sn===c.sn&&_.level===c.level&&!(t.type==="audio"&&this.altAudio)&&this.state===te.PARSING){var R=this.levels[this.level],b=c;if(Object(T.isFiniteNumber)(t.endPTS)||(t.endPTS=t.startPTS+c.duration,t.endDTS=t.startDTS+c.duration),t.hasAudio===!0&&b.addElementaryStream(ne.AUDIO),t.hasVideo===!0&&b.addElementaryStream(ne.VIDEO),h.logger.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),t.type==="video")if(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=te.IDLE,this.fragPrevious=b,this.tick();return}}else b.backtracked=!1;var N=fe(R.details,b,t.startPTS,t.endPTS,t.startDTS,t.endDTS),j=this.hls;j.trigger(d.default.LEVEL_PTS_UPDATED,{details:R.details,level:this.level,drift:N,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(q){q&&q.length&&a.state===te.PARSING&&(a.appended=!0,a.pendingBuffering=!0,j.trigger(d.default.BUFFER_APPENDING,{type:t.type,data:q,parent:"main",content:"data"}))}),this.tick()}},u.onFragParsed=function(t){var a=this.fragCurrent,c=t.frag;a&&t.id==="main"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=te.PARSED,this._checkAppendedParsed())},u.onAudioTrackSwitching=function(t){var a=!!t.url,c=t.id;if(!a){if(this.mediaBuffer!==this.media){h.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_.loader&&(h.logger.log("switching to main audio track, cancel main fragment load"),_.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=te.IDLE}var R=this.hls;R.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),R.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:c}),this.altAudio=!1}},u.onAudioTrackSwitched=function(t){var a=t.id,c=!!this.hls.audioTracks[a].url;if(c){var _=this.videoBuffer;_&&this.mediaBuffer!==_&&(h.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=_)}this.altAudio=c,this.tick()},u.onBufferCreated=function(t){var a=t.tracks,c,_,R=!1;for(var b in a){var I=a[b];I.id==="main"?(_=b,c=I,b==="video"&&(this.videoBuffer=a[b].buffer)):R=!0}R&&c?(h.logger.log("alternate track found, use "+_+".buffered to schedule main fragment loading"),this.mediaBuffer=c.buffer):this.mediaBuffer=this.media},u.onBufferAppended=function(t){if(t.parent==="main"){var a=this.state;(a===te.PARSING||a===te.PARSED)&&(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},u._checkAppendedParsed=function(){if(this.state===te.PARSED&&(!this.appended||!this.pendingBuffering)){var t=this.fragCurrent;if(t){var a=this.mediaBuffer?this.mediaBuffer:this.media;h.logger.log("main buffered : "+Bt.toString(a.buffered)),this.fragPrevious=t;var c=this.stats;c.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*c.total/(c.tbuffered-c.tfirst)),this.hls.trigger(d.default.FRAG_BUFFERED,{stats:c,frag:t,id:"main"}),this.state=te.IDLE}this.tick()}},u.onError=function(t){var a=t.frag||this.fragCurrent;if(!(a&&a.type!=="main")){var c=!!this.media&&L.isBuffered(this.media,this.media.currentTime)&&L.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=te.FRAG_LOADING_WAITING_RETRY}else h.logger.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=te.ERROR;break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==te.ERROR&&(t.fatal?(this.state=te.ERROR,h.logger.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):!t.levelRetry&&this.state===te.WAITING_LEVEL&&(this.state=te.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:t.parent==="main"&&(this.state===te.PARSING||this.state===te.PARSED)&&(c?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=te.IDLE):(h.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)));break;default:break}}},u._reduceMaxBufferLength=function(t){var a=this.config;return a.maxMaxBufferLength>=t?(a.maxMaxBufferLength/=2,h.logger.warn("main:reduce max buffer length to "+a.maxMaxBufferLength+"s"),!0):!1},u._checkBuffer=function(){var t=this.media;if(!(!t||t.readyState===0)){var a=this.mediaBuffer?this.mediaBuffer:t,c=a.buffered;!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,c)}},u.onFragLoadEmergencyAborted=function(){this.state=te.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},u.onBufferFlushed=function(){var t=this.mediaBuffer?this.mediaBuffer:this.media;t&&this.fragmentTracker.detectEvictedFragments(ne.VIDEO,t.buffered),this.state=te.IDLE,this.fragPrevious=null},u.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},u._seekToStartPos=function(){var t=this.media,a=t.currentTime,c=t.seeking?a:this.startPosition;a!==c&&c>=0&&(h.logger.log("target start position not buffered, seek to buffered.start(0) "+c+" from current time "+a+" "),t.currentTime=c)},u._getAudioCodec=function(t){var a=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),a&&(a.indexOf("mp4a.40.5")!==-1?a="mp4a.40.2":a="mp4a.40.5")),a},qo(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}(to),Ki=Yl;function Nu(g,v){for(var u=0;u0){_=a[0].bitrate,a.sort(function(q,ae){return q.bitrate-ae.bitrate}),this._levels=a;for(var j=0;j=0&&t1&&N.loadError0){var a=this.currentLevelIndex,c=t.urlId,_=t.url[c];h.logger.log("Attempt loading level index "+a+" with URL-id "+c),this.hls.trigger(d.default.LEVEL_LOADING,{url:_,level:a,id:c})}}},Pu(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}(E),Uu=r("./src/demux/id3.js");function zs(g,v){var u;try{u=new Event("addtrack")}catch{u=document.createEvent("Event"),u.initEvent("addtrack",!1,!1)}u.track=g,v.dispatchEvent(u)}function _i(g){if(g&&g.cues)for(;g.cues.length>0;)g.removeCue(g.cues[0])}function Dv(g,v){if(vg[g.length-1].endTime)return g[g.length-1];for(var u=0,o=g.length-1;u<=o;){var t=Math.floor((o+u)/2);if(vg[t].endTime)u=t+1;else return g[t]}return g[u].endTime-vN&&(h.logger.warn("detected an id3 sample with endTime < startTime, adjusting endTime to (startTime + 0.25)"),N=I+.25);for(var j=0;j=this.minWeight_},v.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},v.destroy=function(){},g}(),Ev=Tv;function Ys(g,v){for(var u=0;u500*c.duration/N){var j=t.levels,q=Math.max(1,b.bw?b.bw/8:b.loaded*1e3/I),ae=j[c.level],de=ae.realBitrate?Math.max(ae.realBitrate,ae.bitrate):ae.bitrate,Te=b.total?b.total:Math.max(b.loaded,Math.round(c.duration*de/8)),Ye=a.currentTime,Je=(Te-b.loaded)/q,ze=(L.bufferInfo(a,Ye,t.config.maxBufferHole).end-Ye)/N;if(ze<2*c.duration/N&&Je>ze){var at,Dt;for(Dt=c.level-1;Dt>R;Dt--){var $r=j[Dt].realBitrate?Math.max(j[Dt].realBitrate,j[Dt].bitrate):j[Dt].bitrate,Dr=c.duration*$r/(8*.8*q);if(Dr=_;q--){var ae=j[q];if(!!ae){var de=ae.details,Te=de?de.totalduration/de.fragments.length:a,Ye=de?de.live:!1,Je=void 0;q<=t?Je=I*c:Je=N*c;var ze=j[q].realBitrate?Math.max(j[q].realBitrate,j[q].bitrate):j[q].bitrate,at=ze*Te/Je;if(h.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+q+"/"+Math.round(Je)+"/"+ze+"/"+Te+"/"+b+"/"+at),Je>ze&&(!at||Ye&&!this.bitrateTestDelay||at=0)return Te;h.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var Ye=N?Math.min(N,_.maxStarvationDelay):_.maxStarvationDelay,Je=_.abrBandWidthFactor,ze=_.abrBandWidthUpFactor;if(de===0){var at=this.bitrateTestDelay;if(at){var Dt=N?Math.min(N,_.maxLoadingDelay):_.maxLoadingDelay;Ye=Dt-at,h.logger.trace("bitrate test took "+Math.round(1e3*at)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*Ye)+" ms"),Je=ze=1}}return Te=this._findBestLevel(I,N,ae,R,a,de+Ye,Je,ze,c),Math.max(Te,0)}}]),v}(E),Sv=xv;function Mv(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var Xs=k(),Iv=function(g){Mv(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 c=t.parent,_=t.segments.reduce(function(j,q){return q.parent===c?j+1:j},0),R={},b=t.sourceBuffer;for(var I in b){var N=b[I];if(!N)throw Error("handling source buffer update end error: source buffer for "+I+" uninitilized and unable to update buffered TimeRanges.");R[I]=N.buffered}t.hls.trigger(d.default.BUFFER_APPENDED,{parent:c,pending:_,timeRanges:R}),t._needsFlush||t.doAppending(),t.updateMediaElementDuration(),_===0&&t.flushLiveBackBuffer()},t._onSBUpdateError=function(a){h.logger.error("sourceBuffer error:",a),t.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},t.config=o.config,t}var u=v.prototype;return u.destroy=function(){E.prototype.destroy.call(this)},u.onLevelPtsUpdated=function(t){var a=t.type,c=this.tracks.audio;if(a==="audio"&&c&&c.container==="audio/mpeg"){var _=this.sourceBuffer.audio;if(!_)throw Error("Level PTS Updated and source buffer for audio uninitalized");var R=Math.abs(_.timestampOffset-t.start);if(R>.1){var 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)}}},u.onManifestParsed=function(t){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t.altAudio?2:1,h.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},u.onMediaAttaching=function(t){var a=this.media=t.media;if(a&&Xs){var c=this.mediaSource=new Xs;c.addEventListener("sourceopen",this._onMediaSourceOpen),c.addEventListener("sourceended",this._onMediaSourceEnded),c.addEventListener("sourceclose",this._onMediaSourceClose),a.src=window.URL.createObjectURL(c),this._objectUrl=a.src}},u.onMediaDetaching=function(){h.logger.log("media source detaching");var t=this.mediaSource;if(t){if(t.readyState==="open")try{t.endOfStream()}catch(a){h.logger.warn("onMediaDetaching:"+a.message+" while calling endOfStream")}t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.media&&(this._objectUrl&&window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):h.logger.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.hls.trigger(d.default.MEDIA_DETACHED)},u.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,a=this.pendingTracks,c=Object.keys(a).length;(c&&!t||c===2)&&(this.createSourceBuffers(a),this.pendingTracks={},this.doAppending())},u.onBufferReset=function(){var t=this.sourceBuffer;for(var a in t){var c=t[a];try{c&&(this.mediaSource&&this.mediaSource.removeSourceBuffer(c),c.removeEventListener("updateend",this._onSBUpdateEnd),c.removeEventListener("error",this._onSBUpdateError))}catch{}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},u.onBufferCodecs=function(t){var a=this;Object.keys(this.sourceBuffer).length||(Object.keys(t).forEach(function(c){a.pendingTracks[c]=t[c]}),this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())},u.createSourceBuffers=function(t){var a=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");for(var _ in t)if(!a[_]){var R=t[_];if(!R)throw Error("source buffer exists for track "+_+", however track does not");var b=R.levelCodec||R.codec,I=R.container+";codecs="+b;h.logger.log("creating sourceBuffer("+I+")");try{var N=a[_]=c.addSourceBuffer(I);N.addEventListener("updateend",this._onSBUpdateEnd),N.addEventListener("error",this._onSBUpdateError),this.tracks[_]={buffer:N,codec:b,id:R.id,container:R.container,levelCodec:R.levelCodec}}catch(j){h.logger.error("error while trying to add sourceBuffer:"+j.message),this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:j,mimeType:I})}}this.hls.trigger(d.default.BUFFER_CREATED,{tracks:this.tracks})},u.onBufferAppending=function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())},u.onBufferEos=function(t){for(var a in this.sourceBuffer)if(!t.type||t.type===a){var c=this.sourceBuffer[a];c&&!c.ended&&(c.ended=!0,h.logger.log(a+" sourceBuffer now EOS"))}this.checkEos()},u.checkEos=function(){var t=this.sourceBuffer,a=this.mediaSource;if(!a||a.readyState!=="open"){this._needsEos=!1;return}for(var c in t){var _=t[c];if(!!_){if(!_.ended)return;if(_.updating){this._needsEos=!0;return}}}h.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{a.endOfStream()}catch{h.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},u.onBufferFlushing=function(t){t.type?this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}):(this.flushRange.push({start:t.startOffset,end:t.endOffset,type:"video"}),this.flushRange.push({start:t.startOffset,end:t.endOffset,type:"audio"})),this.flushBufferCounter=0,this.doFlush()},u.flushLiveBackBuffer=function(){if(!!this._live){var t=this.config.liveBackBufferLength;if(!(!isFinite(t)||t<0)){if(!this.media){h.logger.error("flushLiveBackBuffer called without attaching media");return}for(var a=this.media.currentTime,c=this.sourceBuffer,_=Object.keys(c),R=a-Math.max(t,this._levelTargetDuration),b=_.length-1;b>=0;b--){var I=_[b],N=c[I];if(N){var j=N.buffered;j.length>0&&R>j.start(0)&&this.removeBufferRange(I,N,0,R)&&this.hls.trigger(d.default.LIVE_BACK_BUFFER_REACHED,{bufferEnd:R})}}}}},u.onLevelUpdated=function(t){var a=t.details;a.fragments.length>0&&(this._levelDuration=a.totalduration+a.fragments[0].start,this._levelTargetDuration=a.averagetargetduration||a.targetduration||10,this._live=a.live,this.updateMediaElementDuration())},u.updateMediaElementDuration=function(){var t=this.config,a;if(!(this._levelDuration===null||!this.media||!this.mediaSource||!this.sourceBuffer||this.media.readyState===0||this.mediaSource.readyState!=="open")){for(var c in this.sourceBuffer){var _=this.sourceBuffer[c];if(_&&_.updating===!0)return}a=this.media.duration,this._msDuration===null&&(this._msDuration=this.mediaSource.duration),this._live===!0&&t.liveDurationInfinity===!0?(h.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>a||!Object(T.isFiniteNumber)(a))&&(h.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},u.doFlush=function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(this.flushBuffer(t.start,t.end,t.type))this.flushRange.shift(),this.flushBufferCounter=0;else{this._needsFlush=!0;return}}if(this.flushRange.length===0){this._needsFlush=!1;var a=0,c=this.sourceBuffer;try{for(var _ in c){var R=c[_];R&&(a+=R.buffered.length)}}catch{h.logger.error("error while accessing sourceBuffer.buffered")}this.appended=a,this.hls.trigger(d.default.BUFFER_FLUSHED)}},u.doAppending=function(){var t=this.config,a=this.hls,c=this.segments,_=this.sourceBuffer;if(!!Object.keys(_).length){if(!this.media||this.media.error){this.segments=[],h.logger.error("trying to append although a media error occured, flush segment and abort");return}if(!this.appending){var R=c.shift();if(!!R)try{var b=_[R.type];if(!b){this._onSBUpdateEnd();return}if(b.updating){c.unshift(R);return}b.ended=!1,this.parent=R.parent,b.appendBuffer(R.data),this.appendError=0,this.appended++,this.appending=!0}catch(N){h.logger.error("error while trying to append buffer:"+N.message),c.unshift(R);var I={type:p.ErrorTypes.MEDIA_ERROR,parent:R.parent,details:"",fatal:!1};N.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)}}}},u.flushBuffer=function(t,a,c){var _=this.sourceBuffer;if(!Object.keys(_).length)return!0;var R="null";if(this.media&&(R=this.media.currentTime.toFixed(3)),h.logger.log("flushBuffer,pos/start/end: "+R+"/"+t+"/"+a),this.flushBufferCounter>=this.appended)return h.logger.warn("abort flushing too many retries"),!0;var b=_[c];if(b){if(b.ended=!1,b.updating)return h.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(c,b,t,a))return this.flushBufferCounter++,!1}return h.logger.log("buffer flushed"),!0},u.removeBufferRange=function(t,a,c,_){try{for(var R=0;R.5){var q="null";return this.media&&(q=this.media.currentTime.toString()),h.logger.log("sb remove "+t+" ["+N+","+j+"], of ["+b+","+I+"], pos:"+q),a.remove(N,j),!0}}}catch(ae){h.logger.warn("removeBufferRange failed",ae)}return!1},v}(E),Av=Iv;function Zs(g,v){for(var u=0;uthis.autoLevelCapping&&a.streamController.nextLevelSwitch(),this.autoLevelCapping=a.autoLevelCapping}}},u.getMaxLevel=function(t){var a=this;if(!this.levels)return-1;var c=this.levels.filter(function(_,R){return v.isLevelAllowed(R,a.restrictedLevels)&&R<=t});return v.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},u.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},u.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},v.isLevelAllowed=function(t,a){return a===void 0&&(a=[]),a.indexOf(t)===-1},v.getMaxLevelByMediaSize=function(t,a,c){if(!t||t&&!t.length)return-1;for(var _=function(j,q){return q?j.width!==q.width||j.height!==q.height:!0},R=t.length-1,b=0;b=a||I.height>=c)&&_(I,t[b+1])){R=b;break}}return R},Lv(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}(E),ef=jv;function Nv(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var Vo=window,Pv=Vo.performance,ec=function(g){Nv(v,g);function v(o){return g.call(this,o,d.default.MEDIA_ATTACHING)||this}var u=v.prototype;return u.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},u.onMediaAttaching=function(t){var a=this.hls.config;if(a.capLevelOnFPSDrop){var c=this.video=t.media instanceof window.HTMLVideoElement?t.media:null;typeof c.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),a.fpsDroppedMonitoringPeriod)}},u.checkFPS=function(t,a,c){var _=Pv.now();if(a){if(this.lastTime){var R=_-this.lastTime,b=c-this.lastDroppedFrames,I=a-this.lastDecodedFrames,N=1e3*b/R,j=this.hls;if(j.trigger(d.default.FPS_DROP,{currentDropped:b,currentDecoded:I,totalDroppedFrames:c}),N>0&&b>j.config.fpsDroppedMonitoringThreshold*I){var q=j.currentLevel;h.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+q),q>0&&(j.autoLevelCapping===-1||j.autoLevelCapping>=q)&&(q=q-1,j.trigger(d.default.FPS_DROP_LEVEL_CAPPING,{level:q,droppedLevel:j.currentLevel}),j.autoLevelCapping=q,j.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=c,this.lastDecodedFrames=a}},u.checkFPSInterval=function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var a=t.getVideoPlaybackQuality();this.checkFPS(t,a.totalVideoFrames,a.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},v}(E),Ov=ec,tf=window,tc=tf.performance,Uv=tf.XMLHttpRequest,kv=function(){function g(u){u&&u.xhrSetup&&(this.xhrSetup=u.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:tc.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()},v.loadInternal=function(){var o,t=this.context;o=this.loader=new Uv;var a=this.stats;a.tfirst=0,a.loaded=0;var c=this.xhrSetup;try{if(c)try{c(o,t.url)}catch{o.open("GET",t.url,!0),c(o,t.url)}o.readyState||o.open("GET",t.url,!0)}catch(_){this.callbacks.onError({code:o.status,text:_.message},t,o);return}t.rangeEnd&&o.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),o.send()},v.readystatechange=function(o){var t=o.currentTarget,a=t.readyState,c=this.stats,_=this.context,R=this.config;if(!c.aborted&&a>=2)if(window.clearTimeout(this.requestTimeout),c.tfirst===0&&(c.tfirst=Math.max(tc.now(),c.trequest)),a===4){var b=t.status;if(b>=200&&b<300){c.tload=Math.max(c.tfirst,tc.now());var I,N;_.responseType==="arraybuffer"?(I=t.response,N=I.byteLength):(I=t.responseText,N=I.length),c.loaded=c.total=N;var j={url:t.responseURL,data:I};this.callbacks.onSuccess(j,c,_,t)}else c.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),c.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 c=this.callbacks.onProgress;c&&c(a,this.context,null,t)},g}(),nc=kv;function nf(g,v){for(var u=0;u=this.tracks.length){h.logger.warn("Invalid audio track id:",t.id);return}if(h.logger.log("audioTrack "+t.id+" loaded"),this.tracks[t.id].details=t.details,t.details.live&&!this.hasInterval()){var a=t.details.targetduration*1e3;this.setInterval(a)}!t.details.live&&this.hasInterval()&&this.clearInterval()},u.onAudioTrackSwitched=function(t){var a=this.tracks[t.id].groupId;a&&this.audioGroupId!==a&&(this.audioGroupId=a)},u.onLevelLoaded=function(t){this._selectAudioGroup(t.level)},u.onError=function(t){t.type===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()))},u._setAudioTrack=function(t){if(this._trackId===t&&this.tracks[this._trackId].details){h.logger.debug("Same id as current audio-track passed, and track details available -> no-op");return}if(t<0||t>=this.tracks.length){h.logger.warn("Invalid id passed to audio-track controller");return}var a=this.tracks[t];h.logger.log("Now switching to audio-track index "+t),this.clearInterval(),this._trackId=t;var c=a.url,_=a.type,R=a.id;this.hls.trigger(d.default.AUDIO_TRACK_SWITCHING,{id:R,type:_,url:c}),this._loadTrackDetailsIfNeeded(a)},u.doTick=function(){this._updateTrack(this._trackId)},u._selectAudioGroup=function(t){var a=this.hls.levels[t];if(!(!a||!a.audioGroupIds)){var c=a.audioGroupIds[a.urlId];this.audioGroupId!==c&&(this.audioGroupId=c,this._selectInitialAudioTrack())}},u._selectInitialAudioTrack=function(){var t=this,a=this.tracks;if(!!a.length){var c=this.tracks[this._trackId],_=null;if(c&&(_=c.name),this._selectDefaultTrack){var R=a.filter(function(N){return N.default});R.length?a=R:h.logger.warn("No default audio tracks defined")}var b=!1,I=function(){a.forEach(function(j){b||(!t.audioGroupId||j.groupId===t.audioGroupId)&&(!_||_===j.name)&&(t._setAudioTrack(j.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}))}},u._needsTrackLoading=function(t){var a=t.details,c=t.url;return!a||a.live?!!c:!1},u._loadTrackDetailsIfNeeded=function(t){if(this._needsTrackLoading(t)){var a=t.url,c=t.id;h.logger.log("loading audio-track playlist for id: "+c),this.hls.trigger(d.default.AUDIO_TRACK_LOADING,{url:a,id:c})}},u._updateTrack=function(t){if(!(t<0||t>=this.tracks.length)){this.clearInterval(),this._trackId=t,h.logger.log("trying to update audio-track "+t);var a=this.tracks[t];this._loadTrackDetailsIfNeeded(a)}},u._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var t=this._trackId,a=this.tracks[t],c=a.name,_=a.language,R=a.groupId;h.logger.warn("Loading failed on audio track id: "+t+", group-id: "+R+', name/language: "'+c+'" / "'+_+'"');for(var b=t,I=0;I0&&t===-1?(h.logger.log("audio:override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=te.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:t,this.state=te.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=t,this.state=te.STOPPED},u.doTick=function(){var t,a,c,_=this.hls,R=_.config;switch(this.state){case te.ERROR:case te.PAUSED:case te.BUFFER_FLUSHING:break;case te.STARTING:this.state=te.WAITING_TRACK,this.loadedmetadata=!1;break;case te.IDLE:var 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,N=this.videoBuffer?this.videoBuffer:this.media,j=L.bufferInfo(I,t,R.maxBufferHole),q=L.bufferInfo(N,t,R.maxBufferHole),ae=j.len,de=j.end,Te=this.fragPrevious,Ye=Math.min(R.maxBufferLength,R.maxMaxBufferLength),Je=Math.max(Ye,q.len),ze=this.audioSwitch,at=this.trackId;if((aeDr||j.nextStart)h.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=Dr+.05;else return}if(c.initSegment&&!c.initSegment.data)kt=c.initSegment;else if(de<=Dr){if(kt=Dt[0],this.videoTrackCC!==null&&kt.cc!==this.videoTrackCC&&(kt=un(Dt,this.videoTrackCC)),c.live&&kt.loadIdx&&kt.loadIdx===this.fragLoadIdx){var $t=j.nextStart?j.nextStart:Dr;h.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+($t+.05)),this.media.currentTime=$t+.05;return}}else{var ht,sr=R.maxFragLookUpTolerance,$u=Te?Dt[Te.sn-Dt[0].sn+1]:void 0,Ju=function(sc){var $g=Math.min(sr,sc.duration);return sc.start+sc.duration-$g<=de?1:sc.start-$g>de&&sc.start?-1:0};deMa-sr&&(sr=0),$u&&!Ju($u)?ht=$u:ht=J.search(Dt,Ju)):ht=Dt[$r-1],ht&&(kt=ht,Dr=ht.start,Te&&kt.level===Te.level&&kt.sn===Te.sn&&(kt.sn=Wg||nw)&&(h.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=te.IDLE);break;case te.WAITING_INIT_PTS:var ym=this.videoTrackCC;if(this.initPTS[ym]===void 0)break;var Hg=this.waitingFragment;if(Hg){var Bg=Hg.frag.cc;ym!==Bg?(a=this.tracks[this.trackId],a.details&&a.details.live&&(h.logger.warn("Waiting fragment CC ("+Bg+") does not match video track CC ("+ym+")"),this.waitingFragment=null,this.state=te.IDLE)):(this.state=te.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=te.IDLE;break;case te.STOPPED:case te.FRAG_LOADING:case te.PARSING:case te.PARSED:case te.ENDED:break;default:break}},u.onMediaAttached=function(t){var a=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("ended",this.onvended);var c=this.config;this.tracks&&c.autoStartLoad&&this.startLoad(c.startPosition)},u.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},u.onAudioTracksUpdated=function(t){h.logger.log("audio tracks updated"),this.tracks=t.audioTracks},u.onAudioTrackSwitching=function(t){var a=!!t.url;this.trackId=t.id,this.fragCurrent=null,this.state=te.PAUSED,this.waitingFragment=null,a?this.setInterval(of):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),a&&(this.audioSwitch=!0,this.state=te.IDLE),this.tick()},u.onAudioTrackLoaded=function(t){var a=t.details,c=t.id,_=this.tracks[c],R=a.totalduration,b=0;if(h.logger.log("track "+c+" loaded ["+a.startSN+","+a.endSN+"],duration:"+R),a.live){var I=_.details;I&&a.fragments.length>0?(Ie(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 N=a.startTimeOffset;Object(T.isFiniteNumber)(N)?(h.logger.log("start time offset found in playlist, adjust startPosition to "+N),this.startPosition=N):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===te.WAITING_TRACK&&(this.state=te.IDLE),this.tick()},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE,this.tick())},u.onFragLoaded=function(t){var a=this.fragCurrent,c=t.frag;if(this.state===te.FRAG_LOADING&&a&&c.type==="audio"&&c.level===a.level&&c.sn===a.sn){var _=this.tracks[this.trackId],R=_.details,b=R.totalduration,I=a.level,N=a.sn,j=a.cc,q=this.config.defaultAudioCodec||_.audioCodec||"mp4a.40.2",ae=this.stats=t.stats;if(N==="initSegment")this.state=te.IDLE,ae.tparsed=ae.tbuffered=ao.now(),R.initSegment.data=t.payload,this.hls.trigger(d.default.FRAG_BUFFERED,{stats:ae,frag:a,id:"audio"}),this.tick();else{this.state=te.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new ce(this.hls,"audio"));var de=this.initPTS[j],Te=R.initSegment?R.initSegment.data:[];if(R.initSegment||de!==void 0){this.pendingBuffering=!0,h.logger.log("Demuxing "+N+" of ["+R.startSN+" ,"+R.endSN+"],track "+I);var Ye=!1;this.demuxer.push(t.payload,Te,q,null,a,b,Ye,de)}else h.logger.log("unknown video PTS for continuity counter "+j+", waiting for video PTS before demuxing audio frag "+N+" of ["+R.startSN+" ,"+R.endSN+"],track "+I),this.waitingFragment=t,this.state=te.WAITING_INIT_PTS}}this.fragLoadError=0},u.onFragParsingInitSegment=function(t){var a=this.fragCurrent,c=t.frag;if(a&&t.id==="audio"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING){var _=t.tracks,R;if(_.video&&delete _.video,R=_.audio,R){R.levelCodec=R.codec,R.id=t.id,this.hls.trigger(d.default.BUFFER_CODECS,_),h.logger.log("audio track:audio,container:"+R.container+",codecs[level/parsed]=["+R.levelCodec+"/"+R.codec+"]");var 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()}}},u.onFragParsingData=function(t){var a=this,c=this.fragCurrent,_=t.frag;if(c&&t.id==="audio"&&t.type==="audio"&&_.sn===c.sn&&_.level===c.level&&this.state===te.PARSING){var R=this.trackId,b=this.tracks[R],I=this.hls;Object(T.isFiniteNumber)(t.endPTS)||(t.endPTS=t.startPTS+c.duration,t.endDTS=t.startDTS+c.duration),c.addElementaryStream(ne.AUDIO),h.logger.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),fe(b.details,c,t.startPTS,t.endPTS);var N=this.audioSwitch,j=this.media,q=!1;if(N)if(j&&j.readyState){var ae=j.currentTime;h.logger.log("switching audio track : currentTime:"+ae),ae>=t.startPTS&&(h.logger.log("switching audio track : flushing all audio"),this.state=te.BUFFER_FLUSHING,I.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),q=!0,this.audioSwitch=!1,I.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:R}))}else this.audioSwitch=!1,I.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:R});var de=this.pendingData;if(!de){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(Te){Te&&Te.length&&de.push({type:t.type,data:Te,parent:"audio",content:"data"})}),!q&&de.length&&(de.forEach(function(Te){a.state===te.PARSING&&(a.pendingBuffering=!0,a.hls.trigger(d.default.BUFFER_APPENDING,Te))}),this.pendingData=[],this.appended=!0)),this.tick()}},u.onFragParsed=function(t){var a=this.fragCurrent,c=t.frag;a&&t.id==="audio"&&c.sn===a.sn&&c.level===a.level&&this.state===te.PARSING&&(this.stats.tparsed=ao.now(),this.state=te.PARSED,this._checkAppendedParsed())},u.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},u.onBufferCreated=function(t){var a=t.tracks.audio;a&&(this.mediaBuffer=a.buffer,this.loadedmetadata=!0),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},u.onBufferAppended=function(t){if(t.parent==="audio"){var a=this.state;(a===te.PARSING||a===te.PARSED)&&(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},u._checkAppendedParsed=function(){if(this.state===te.PARSED&&(!this.appended||!this.pendingBuffering)){var t=this.fragCurrent,a=this.stats,c=this.hls;if(t){this.fragPrevious=t,a.tbuffered=ao.now(),c.trigger(d.default.FRAG_BUFFERED,{stats:a,frag:t,id:"audio"});var _=this.mediaBuffer?this.mediaBuffer:this.media;_&&h.logger.log("audio buffered : "+Bt.toString(_.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,c.trigger(d.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=te.IDLE}this.tick()}},u.onError=function(t){var a=t.frag;if(!(a&&a.type!=="audio"))switch(t.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:var c=t.frag;if(c&&c.type!=="audio")break;if(!t.fatal){var _=this.fragLoadError;_?_++:_=1;var R=this.config;if(_<=R.fragLoadingMaxRetry){this.fragLoadError=_;var b=Math.min(Math.pow(2,_-1)*R.fragLoadingRetryDelay,R.fragLoadingMaxRetryTimeout);h.logger.warn("AudioStreamController: frag loading failed, retry in "+b+" ms"),this.retryDate=ao.now()+b,this.state=te.FRAG_LOADING_WAITING_RETRY}else h.logger.error("AudioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=te.ERROR}break;case 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!==te.ERROR&&(this.state=t.fatal?te.ERROR:te.IDLE,h.logger.warn("AudioStreamController: "+t.details+" while loading frag, now switching to "+this.state+" state ..."));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if(t.parent==="audio"&&(this.state===te.PARSING||this.state===te.PARSED)){var I=this.mediaBuffer,N=this.media.currentTime,j=I&&L.isBuffered(I,N)&&L.isBuffered(I,N+.5);if(j){var q=this.config;q.maxMaxBufferLength>=q.maxBufferLength&&(q.maxMaxBufferLength/=2,h.logger.warn("AudioStreamController: reduce max buffer length to "+q.maxMaxBufferLength+"s")),this.state=te.IDLE}else h.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=te.BUFFER_FLUSHING,this.hls.trigger(d.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}break;default:break}},u.onBufferFlushed=function(){var t=this,a=this.pendingData;a&&a.length?(h.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),a.forEach(function(c){t.hls.trigger(d.default.BUFFER_APPENDING,c)}),this.appended=!0,this.pendingData=[],this.state=te.PARSED):(this.state=te.IDLE,this.fragPrevious=null,this.tick())},Yi(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}(to),Gv=Jv,uf=function(){if(typeof window!="undefined"&&window.VTTCue)return window.VTTCue;var g="auto",v={"":!0,lr:!0,rl:!0},u={start:!0,middle:!0,end:!0,left:!0,right:!0};function o(_){if(typeof _!="string")return!1;var R=v[_.toLowerCase()];return R?_.toLowerCase():!1}function t(_){if(typeof _!="string")return!1;var R=u[_.toLowerCase()];return R?_.toLowerCase():!1}function a(_){for(var R=1;R100)throw new Error("Position must be between 0 and 100.");$r=ht,this.hasBeenReset=!0}})),Object.defineProperty(I,"positionAlign",a({},N,{get:function(){return Dr},set:function(ht){var sr=t(ht);if(!sr)throw new SyntaxError("An invalid or illegal string was specified.");Dr=sr,this.hasBeenReset=!0}})),Object.defineProperty(I,"size",a({},N,{get:function(){return Ma},set:function(ht){if(ht<0||ht>100)throw new Error("Size must be between 0 and 100.");Ma=ht,this.hasBeenReset=!0}})),Object.defineProperty(I,"align",a({},N,{get:function(){return kt},set:function(ht){var sr=t(ht);if(!sr)throw new SyntaxError("An invalid or illegal string was specified.");kt=sr,this.hasBeenReset=!0}})),I.displayState=void 0}return c.prototype.getCueAsHTML=function(){var _=window.WebVTT;return _.convertCueToDOMTree(window,this.text)},c}(),qv=function(){return{decode:function(u){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))}}};function lf(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new qv,this.regionList=[]}function zv(g){function v(o,t,a,c){return(o|0)*3600+(t|0)*60+(a|0)+(c|0)/1e3}var u=g.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return u?u[3]?v(u[1],u[2],u[3].replace(":",""),u[4]):u[1]>59?v(u[1],u[2],0,u[4]):v(0,u[1],u[2],u[4]):null}function cf(){this.values=Object.create(null)}cf.prototype={set:function(v,u){!this.get(v)&&u!==""&&(this.values[v]=u)},get:function(v,u,o){return o?this.has(v)?this.values[v]:u[o]:this.has(v)?this.values[v]:u},has:function(v){return v in this.values},alt:function(v,u,o){for(var t=0;t=0&&u<=100)?(this.set(v,u),!0):!1}};function sf(g,v,u,o){var t=o?g.split(o):[g];for(var a in t)if(typeof t[a]=="string"){var c=t[a].split(u);if(c.length===2){var _=c[0],R=c[1];v(_,R)}}}var Qi=new uf(0,0,0),Sa=Qi.align==="middle"?"middle":"center";function Vv(g,v,u){var o=g;function t(){var _=zv(g);if(_===null)throw new Error("Malformed timestamp: "+o);return g=g.replace(/^[^\sa-zA-Z-]+/,""),_}function a(_,R){var b=new cf;sf(_,function(j,q){switch(j){case"region":for(var ae=u.length-1;ae>=0;ae--)if(u[ae].id===q){b.set(j,u[ae].region);break}break;case"vertical":b.alt(j,q,["rl","lr"]);break;case"line":var de=q.split(","),Te=de[0];b.integer(j,Te),b.percent(j,Te)&&b.set("snapToLines",!1),b.alt(j,Te,["auto"]),de.length===2&&b.alt("lineAlign",de[1],["start",Sa,"end"]);break;case"position":de=q.split(","),b.percent(j,de[0]),de.length===2&&b.alt("positionAlign",de[1],["start",Sa,"end","line-left","line-right","auto"]);break;case"size":b.percent(j,q);break;case"align":b.alt(j,q,["start",Sa,"end","left","right"]);break}},/:/,/\s/),R.region=b.get("region",null),R.vertical=b.get("vertical","");var I=b.get("line","auto");I==="auto"&&Qi.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",Sa);var N=b.get("position","auto");N==="auto"&&Qi.position===50&&(N=R.align==="start"||R.align==="left"?0:R.align==="end"||R.align==="right"?100:50),R.position=N}function c(){g=g.replace(/^\s+/,"")}if(c(),v.startTime=t(),c(),g.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);g=g.substr(3),c(),v.endTime=t(),c(),a(g,v)}function ff(g){return g.replace(//gi,` `)}lf.prototype={parse:function(v){var u=this;v&&(u.buffer+=u.decoder.decode(v,{stream:!0}));function o(){var b=u.buffer,I=0;for(b=ff(b);I")===-1){u.cue.id=a;continue}case"CUE":try{Vv(a,u.cue,u.regionList)}catch{u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":var R=a.indexOf("-->")!==-1;if(!a||R&&(_=!0)){u.oncue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}u.cue.text&&(u.cue.text+=` `),u.cue.text+=a;continue;case"BADCUE":a||(u.state="ID");continue}}}catch{u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var 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(u){throw u}return v.onflush&&v.onflush(),this}};var Kv=lf;function Yv(g,v,u,o){for(var t,a,c,_,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 rc={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},df=function(v){var u=v;return rc.hasOwnProperty(v)&&(u=rc[v]),String.fromCharCode(u)},Br=15,oo=100,Qv={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Xv={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Zv={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},em={25:2,26:4,29:6,30:8,31:10,27:13,28:15},tm=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],pf;(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"})(pf||(pf={}));var Ft={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,u){var o=this.verboseFilter[v];this.verboseLevel>=o}},Ko=function(v){for(var u=[],o=0;ooo&&(Ft.log("ERROR","Too large cursor position "+this.pos),this.pos=oo)},v.moveCursor=function(o){var t=this.pos+o;if(o>1)for(var a=this.pos+1;a=144&&this.backSpace();var t=df(o);if(this.pos>=oo){Ft.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}(),Wu=function(){function g(u,o){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.lastCueEndTime=void 0,this.chNr=u,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new Ct,this.nonDisplayedMemory=new Ct,this.lastOutputScreen=new Ct,this.currRollUpRow=this.displayedMemory.rows[Br-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[Br-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,Ft.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,c=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=c[a]}Ft.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},v.outputDataUpdate=function(o){o===void 0&&(o=!1);var t=Ft.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}(),Hu=function(){function g(u,o,t){this.field=void 0,this.outputs=void 0,this.channels=void 0,this.currChNr=void 0,this.lastCmdA=void 0,this.lastCmdB=void 0,this.lastTime=void 0,this.dataCounters=void 0,this.field=u||1,this.outputs=[o,t],this.channels=[new Wu(1,o),new Wu(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,c,_,R=!1;this.lastTime=o,Ft.setTime(o);for(var b=0;b ("+Ko([c,_])+")");if(a=this.parseCmd(c,_),a||(a=this.parseMidrow(c,_)),a||(a=this.parsePAC(c,_)),a||(a=this.parseBackgroundAttributes(c,_)),!a&&(R=this.parseChars(c,_),R))if(this.currChNr&&this.currChNr>=0){var I=this.channels[this.currChNr-1];I.insertChars(R)}else Ft.log("WARNING","No channel found yet. TEXT-MODE?");a?this.dataCounters.cmd+=2:R?this.dataCounters.char+=2:(this.dataCounters.other+=2,Ft.log("WARNING","Couldn't parse cleaned data "+Ko([c,_])+" orig: "+Ko([t[b],t[b+1]])))}},v.parseCmd=function(o,t){var a=null,c=(o===20||o===28)&&t>=32&&t<=47,_=(o===23||o===31)&&t>=33&&t<=35;if(!(c||_))return!1;if(o===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,Ft.log("DEBUG","Repeated command ("+Ko([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 Ft.log("ERROR","Mismatch channel in midrow parsing"),!1;var c=this.channels[a-1];return c.ccMIDROW(t),Ft.log("DEBUG","MIDROW ("+Ko([o,t])+")"),!0}return!1},v.parsePAC=function(o,t){var a=null,c=null,_=(o>=17&&o<=23||o>=25&&o<=31)&&t>=64&&t<=127,R=(o===16||o===24)&&t>=64&&t<=95;if(!(_||R))return!1;if(o===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;a=o<=23?1:2,t>=64&&t<=95?c=a===1?Qv[o]:Zv[o]:c=a===1?Xv[o]:em[o];var b=this.interpretPAC(c,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,c={color:null,italics:!1,indent:null,underline:!1,row:o};return t>95?a=t-96:a=t-64,c.underline=(a&1)==1,a<=13?c.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(a/2)]:a<=15?(c.italics=!0,c.color="white"):c.indent=Math.floor((a-16)/2)*4,c},v.parseChars=function(o,t){var a=null,c=null,_=null;if(o>=25?(a=2,_=o-8):(a=1,_=o),_>=17&&_<=19){var R=t;_===17?R=t+80:_===18?R=t+112:R=t+144,Ft.log("INFO","Special char '"+df(R)+"' in channel "+a),c=[R]}else o>=32&&o<=127&&(c=t===0?[o]:[o,t]);if(c){var b=Ko(c);Ft.log("DEBUG","Char codes = "+b.join(",")),this.lastCmdA=null,this.lastCmdB=null}return c},v.parseBackgroundAttributes=function(o,t){var a,c,_,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?(c=Math.floor((t-32)/2),a.background=tm[c],t%2==1&&(a.background=a.background+"_semi")):t===45?a.background="transparent":(a.foreground="black",t===47&&(a.underline=!0)),_=o<24?1:2,R=this.channels[_-1],R.setBkgData(a),this.lastCmdA=null,this.lastCmdB=null,!0):!1},v.reset=function(){for(var o=0;oo)&&(this.startTime=o),this.endTime=t,this.screen=a,this.timelineController.createCaptionsTrack(this.trackName)},g}(),oc=function(v,u,o){return v.substr(o||0,u.length)===u},om=function(v){var u=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(T.isFiniteNumber)(u)||!Object(T.isFiniteNumber)(o)||!Object(T.isFiniteNumber)(t)||!Object(T.isFiniteNumber)(a))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+v);return u+=1e3*o,u+=60*1e3*t,u+=60*60*1e3*a,u},Bu=function(v){for(var u=5381,o=v.length;o;)u=u*33^v.charCodeAt(--o);return(u>>>0).toString()},im=function(v,u,o){var t=v[u],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},um={parse:function(v,u,o,t,a,c){var _=/\r\n|\n\r|\n|\r/g,R=Object(Uu.utf8ArrayToStr)(new Uint8Array(v)).trim().replace(_,` `).split(` `),b="00:00.000",I=0,N=0,j=0,q=[],ae,de=!0,Te=!1,Ye=new Kv;Ye.oncue=function(Je){var ze=o[t],at=o.ccOffset;ze&&ze.new&&(N!==void 0?at=o.ccOffset=ze.start:im(o,t,j)),j&&(at=j-o.presentationOffset),Te&&(Je.startTime+=at-N,Je.endTime+=at-N),Je.id=Bu(Je.startTime.toString())+Bu(Je.endTime.toString())+Bu(Je.text),Je.text=decodeURIComponent(encodeURIComponent(Je.text)),Je.endTime>0&&q.push(Je)},Ye.onparsingerror=function(Je){ae=Je},Ye.onflush=function(){if(ae&&c){c(ae);return}a(q)},R.forEach(function(Je){if(de)if(oc(Je,"X-TIMESTAMP-MAP=")){de=!1,Te=!0,Je.substr(16).split(",").forEach(function(ze){oc(ze,"LOCAL:")?b=ze.substr(6):oc(ze,"MPEGTS:")&&(I=parseInt(ze.substr(7)))});try{u+(o[t].start*9e4||0)<0&&(u+=8589934592),I-=u,N=om(b)/1e3,j=I/9e4}catch(ze){Te=!1,ae=ze}return}else Je===""&&(de=!1);Ye.parse(Je+` `)}),Ye.flush()}},lm=um;function mf(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function cm(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var sm=function(g){cm(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 vf(mf(t),"textTrack1"),c=new vf(mf(t),"textTrack2");t.cea608Parser=new am(0,a,c)}return t}var u=v.prototype;return u.addCues=function(t,a,c,_){for(var R=this.cueRanges,b=!1,I=R.length;I--;){var N=R[I],j=fm(N[0],N[1],a,c);if(j>=0&&(N[0]=Math.min(N[0],a),N[1]=Math.max(N[1],c),b=!0,j/(c-a)>.5))return}b||R.push([a,c]),this.Cues.newCue(this.captionsTracks[t],a,c,_)},u.onInitPtsFound=function(t){var a=this,c=t.frag,_=t.id,R=t.initPTS,b=this.unparsedVttFrags;_==="main"&&(this.initPTS[c.cc]=R),b.length&&(this.unparsedVttFrags=[],b.forEach(function(I){a.onFragLoaded(I)}))},u.getExistingTrack=function(t){var a=this.media;if(a)for(var c=0;c=b.length||c!==R||!I||this.stopped){this._clearReloadTimer();return}if(h.logger.log("subtitle track "+c+" loaded"),_.live){var N=rn(I.details,_,t.stats.trequest);h.logger.log("Reloading live subtitle playlist in "+N+"ms"),this.timer=setTimeout(function(){a._loadCurrentTrack()},N)}else this._clearReloadTimer()},u.startLoad=function(){this.stopped=!1,this._loadCurrentTrack()},u.stopLoad=function(){this.stopped=!0,this._clearReloadTimer()},u._clearReloadTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},u._loadCurrentTrack=function(){var t=this.trackId,a=this.tracks,c=this.hls,_=a[t];t<0||!_||_.details&&!_.details.live||(h.logger.log("Loading subtitle track "+t),c.trigger(d.default.SUBTITLE_TRACK_LOADING,{url:_.url,id:t}))},u._toggleTrackModes=function(t){var a=this.media,c=this.subtitleDisplay,_=this.trackId;if(!!a){var R=s(a.textTracks);if(t===-1)[].slice.call(R).forEach(function(N){N.mode="disabled"});else{var b=R[_];b&&(b.mode="disabled")}var I=R[t];I&&(I.mode=c?"showing":"hidden")}},u._setSubtitleTrackInternal=function(t){var a=this.hls,c=this.tracks;!Object(T.isFiniteNumber)(t)||t<-1||t>=c.length||(this.trackId=t,h.logger.log("Switching to subtitle track "+t),a.trigger(d.default.SUBTITLE_TRACK_SWITCH,{id:t}),this._loadCurrentTrack())},u._onTextTracksChanged=function(){if(!!this.media){for(var t=-1,a=s(this.media.textTracks),c=0;c=_[I].start&&b<=_[I].end){R=_[I];break}var N=a.start+a.duration;R?R.end=N:(R={start:b,end:N},_.push(R))}}},u.onMediaAttached=function(t){var a=t.media;this.media=a,a.addEventListener("seeking",this._onMediaSeeking),this.state=te.IDLE},u.onMediaDetaching=function(){var t=this;!this.media||(this.media.removeEventListener("seeking",this._onMediaSeeking),this.fragmentTracker.removeAllFragments(),this.currentTrackId=-1,this.tracks.forEach(function(a){t.tracksBuffered[a.id]=[]}),this.media=null,this.state=te.STOPPED)},u.onError=function(t){var a=t.frag;!a||a.type!=="subtitle"||(this.state=te.IDLE)},u.onSubtitleTracksUpdated=function(t){var a=this;h.logger.log("subtitle tracks updated"),this.tracksBuffered=[],this.tracks=t.subtitleTracks,this.tracks.forEach(function(c){a.tracksBuffered[c.id]=[]})},u.onSubtitleTrackSwitch=function(t){if(this.currentTrackId=t.id,!this.tracks||!this.tracks.length||this.currentTrackId===-1){this.clearInterval();return}var a=this.tracks[this.currentTrackId];a&&a.details&&this.setInterval(Xe)},u.onSubtitleTrackLoaded=function(t){var a=t.id,c=t.details,_=this.currentTrackId,R=this.tracks,b=R[_];a>=R.length||a!==_||!b||(c.live&&We(b.details,c,this.lastAVStart),b.details=c,this.setInterval(Xe))},u.onKeyLoaded=function(){this.state===te.KEY_LOADING&&(this.state=te.IDLE)},u.onFragLoaded=function(t){var a=this.fragCurrent,c=t.frag.decryptdata,_=t.frag,R=this.hls;if(this.state===te.FRAG_LOADING&&a&&t.frag.type==="subtitle"&&a.sn===t.frag.sn&&t.payload.byteLength>0&&c&&c.key&&c.method==="AES-128"){var b=Ee.now();this.decrypter.decrypt(t.payload,c.key.buffer,c.iv.buffer,function(I){var N=Ee.now();R.trigger(d.default.FRAG_DECRYPTED,{frag:_,payload:I,stats:{tstart:b,tdecrypt:N}})})}},u.onLevelUpdated=function(t){var a=t.details,c=a.fragments;this.lastAVStart=c.length?c[0].start:0},u.doTick=function(){if(!this.media){this.state=te.IDLE;return}switch(this.state){case te.IDLE:{var t=this.config,a=this.currentTrackId,c=this.fragmentTracker,_=this.media,R=this.tracks;if(!R||!R[a]||!R[a].details)break;var b=t.maxBufferHole,I=t.maxFragLookUpTolerance,N=Math.min(t.maxBufferLength,t.maxMaxBufferLength),j=L.bufferedInfo(this._getBuffered(),_.currentTime,b),q=j.end,ae=j.len,de=R[a].details,Te=de.fragments,Ye=Te.length,Je=Te[Ye-1].start+Te[Ye-1].duration;if(ae>N)return;var ze,at=this.fragPrevious;qgf){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=gf-this._requestLicenseFailureCount+1;h.logger.warn("Retrying license request, "+R+" attempts left"),this._requestLicense(c,_)}break}},u._generateLicenseRequestChallenge=function(t,a){switch(t.mediaKeySystemDomain){case fn.WIDEVINE:return a}throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},u._requestLicense=function(t,a){h.logger.log("Requesting content license for key-system");var c=this._mediaKeysList[0];if(!c){h.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(d.default.ERROR,{type:p.ErrorTypes.KEY_SYSTEM_ERROR,details:p.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var _=this.getLicenseServerUrl(c.mediaKeySystemDomain),R=this._createLicenseXhr(_,t,a);h.logger.log("Sending license request to URL: "+_);var b=this._generateLicenseRequestChallenge(c,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})}},u.onMediaAttached=function(t){if(!!this._emeEnabled){var a=t.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)}},u.onMediaDetached=function(){this._media&&(this._media.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null)},u.onManifestParsed=function(t){if(!!this._emeEnabled){var a=t.levels.map(function(_){return _.audioCodec}),c=t.levels.map(function(_){return _.videoCodec});this._attemptKeySystemAccess(fn.WIDEVINE,a,c)}},vm(v,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),v}(E),_m=yf;function hm(g){for(var v=1;va)return _}return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,a=this.autoLevelCapping,c;return a===-1&&t&&t.length?c=t.length-1:c=a,c}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var a=this.audioTrackController;a&&(a.audioTrack=t)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var a=this.subtitleTrackController;a&&(a.subtitleTrack=t)}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return t?t.subtitleDisplay:!1},set:function(t){var a=this.subtitleTrackController;a&&(a.subtitleDisplay=t)}}]),v}(K);Cf.defaultConfig=void 0},"./src/polyfills/number-isFinite.js":function(e,n,r){"use strict";r.r(n),r.d(n,"isFiniteNumber",function(){return i});var i=Number.isFinite||function(l){return typeof l=="number"&&isFinite(l)}},"./src/utils/get-self-scope.js":function(e,n,r){"use strict";r.r(n),r.d(n,"getSelfScope",function(){return i});function i(){return typeof window=="undefined"?self:window}},"./src/utils/logger.js":function(e,n,r){"use strict";r.r(n),r.d(n,"enableLogs",function(){return E}),r.d(n,"logger",function(){return M});var i=r("./src/utils/get-self-scope.js");function l(){}var p={trace:l,debug:l,log:l,warn:l,info:l,error:l},T=p;function d(C,S){return S="["+C+"] > "+S,S}var h=Object(i.getSelfScope)();function P(C){var S=h.console[C];return S?function(){for(var O=arguments.length,B=new Array(O),Q=0;Q1?S-1:0),B=1;B{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.Direction=void 0;var e6;(function(e){e.Right="to right",e.Left="to left",e.Down="to bottom",e.Up="to top"})(e6=Hs.Direction||(Hs.Direction={}))});var bg=io(st=>{"use strict";var Bs=st&&st.__spreadArray||function(e,n,r){if(r||arguments.length===2)for(var i=0,l=n.length,p;ie)return h;if(P&&Pi)return i;if(e=r)throw new RangeError("min (".concat(n,") is equal/bigger than max (").concat(r,")"));if(er)throw new RangeError("value (".concat(e,") is bigger than max (").concat(r,")"))}st.checkBoundaries=i6;function u6(e,n,r){return er?r:e}st.checkValuesAgainstBoundaries=u6;function l6(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}"))}st.checkInitialOverlap=l6;function c6(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)}}st.getMargin=c6;function s6(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)}}st.getPaddingAndBorder=s6;function f6(e,n,r){var i=r?-1:1;e.forEach(function(l,p){return NF(l,i*n[p].x,n[p].y)})}st.translateThumbs=f6;function d6(e,n,r,i){for(var l=0,p=OF(e[0],n,r,i),T=1;TT?h:T},e.getBoundingClientRect().width));return p},g6=function(e,n,r,i,l,p,T){T===void 0&&(T=function(P){return P});var d=[],h=function(P){var y=PF(r[P],i[P],l,p,T),E=n[P].x;n.forEach(function(M,C){var S=M.x,O=PF(r[C],i[C],l,p,T);P!==C&&(E>=S&&E<=S+O||E+y>=S&&E+y<=S+O)&&(d.includes(C)||(d.push(P),d.push(C),d=Bs(Bs([],d,!0),[P,C],!1),h(C)))})};return h(e),Array.from(new Set(d.sort()))},D6=function(e,n,r,i,l,p){i===void 0&&(i=.1),l===void 0&&(l=" - "),p===void 0&&(p=function(C){return C});var T=(0,st.getStepDecimals)(i),d=(0,Rg.useState)({}),h=d[0],P=d[1],y=(0,Rg.useState)(p(n[r].toFixed(T))),E=y[0],M=y[1];return(0,Rg.useEffect)(function(){if(e){var C=e.getThumbs();if(C.length<1)return;var S={},O=e.getOffsets(),B=g6(r,O,C,n,l,T,p),Q=p(n[r].toFixed(T));if(B.length){var z=B.reduce(function(ve,$e,qe,Ke){return ve.length?Bs(Bs([],ve,!0),[O[Ke[qe]].x],!1):[O[Ke[qe]].x]},[]);if(Math.min.apply(Math,z)===O[r].x){var Z=[];B.forEach(function(ve){Z.push(n[ve].toFixed(T))}),Q=Array.from(new Set(Z.sort(function(ve,$e){return parseFloat(ve)-parseFloat($e)}))).map(p).join(l);var ne=Math.min.apply(Math,z),ee=Math.max.apply(Math,z),pe=C[B[z.indexOf(ee)]].getBoundingClientRect().width;S.left="".concat(Math.abs(ne-(ee+pe))/2,"px"),S.transform="translate(-50%, 0)"}else S.visibility="hidden"}M(Q),P(S)}},[e,n]),[E,h]};st.useThumbOverlap=D6;function OF(e,n,r,i){var l=e.getBoundingClientRect(),p=l.left,T=l.top,d=l.width,h=l.height;return jF(i)?Math.abs(r-(T+h/2)):Math.abs(n-(p+d/2))}});var kF=io(Ta=>{"use strict";var y6=Ta&&Ta.__extends||function(){var e=function(n,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,l){i.__proto__=l}||function(i,l){for(var p in l)Object.prototype.hasOwnProperty.call(l,p)&&(i[p]=l[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 i(){this.constructor=n}n.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),R6=Ta&&Ta.__createBinding||(Object.create?function(e,n,r,i){i===void 0&&(i=r);var l=Object.getOwnPropertyDescriptor(n,r);(!l||("get"in l?!n.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(e,i,l)}:function(e,n,r,i){i===void 0&&(i=r),e[i]=n[r]}),b6=Ta&&Ta.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),T6=Ta&&Ta.__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)&&R6(n,e,r);return b6(n,e),n},UF=Ta&&Ta.__spreadArray||function(e,n,r){if(r||arguments.length===2)for(var i=0,l=n.length,p;i1&&i.props.draggableTrack){if(i.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.contains(l.target)}))return;i.setState({draggedTrackPos:[l.clientX,l.clientY]},function(){return i.onMove(l.clientX,l.clientY)})}else{var T=(0,Kt.getClosestThumbIndex)(i.thumbRefs.map(function(d){return d.current}),l.clientX,l.clientY,i.props.direction);(p=i.thumbRefs[T].current)===null||p===void 0||p.focus(),i.setState({draggedThumbIndex:T},function(){return i.onMove(l.clientX,l.clientY)})}},i.onResize=function(){(0,Kt.translateThumbs)(i.getThumbs(),i.getOffsets(),i.props.rtl),i.calculateMarkOffsets()},i.onTouchStartTrack=function(l){var p;if(l.persist(),i.addTouchEvents(l.nativeEvent),i.props.values.length>1&&i.props.draggableTrack){if(i.thumbRefs.some(function(d){var h;return(h=d.current)===null||h===void 0?void 0:h.contains(l.target)}))return;i.setState({draggedTrackPos:[l.touches[0].clientX,l.touches[0].clientY]},function(){return i.onMove(l.touches[0].clientX,l.touches[0].clientY)})}else{var T=(0,Kt.getClosestThumbIndex)(i.thumbRefs.map(function(d){return d.current}),l.touches[0].clientX,l.touches[0].clientY,i.props.direction);(p=i.thumbRefs[T].current)===null||p===void 0||p.focus(),i.setState({draggedThumbIndex:T},function(){return i.onMove(l.touches[0].clientX,l.touches[0].clientY)})}},i.onMouseOrTouchStart=function(l){if(!i.props.disabled){var p=(0,Kt.isTouchEvent)(l);if(!(!p&&l.button!==0)){var T=i.getTargetIndex(l);T!==-1&&(p?i.addTouchEvents(l):i.addMouseEvents(l),i.setState({draggedThumbIndex:T,thumbZIndexes:i.state.thumbZIndexes.map(function(d,h){return h===T?Math.max.apply(Math,i.state.thumbZIndexes):d<=i.state.thumbZIndexes[T]?d:d-1})}))}}},i.onMouseMove=function(l){l.preventDefault(),i.onMove(l.clientX,l.clientY)},i.onTouchMove=function(l){l.preventDefault(),i.onMove(l.touches[0].clientX,l.touches[0].clientY)},i.onKeyDown=function(l){var p=i.props,T=p.values,d=p.onChange,h=p.step,P=p.rtl,y=p.direction,E=i.state.isChanged,M=i.getTargetIndex(l.nativeEvent),C=P||y===Yn.Direction.Left||y===Yn.Direction.Down?-1:1;M!==-1&&(E6.includes(l.key)?(l.preventDefault(),i.setState({draggedThumbIndex:M,isChanged:!0}),d((0,Kt.replaceAt)(T,M,i.normalizeValue(T[M]+C*(l.key==="PageUp"?h*10:h),M)))):F6.includes(l.key)?(l.preventDefault(),i.setState({draggedThumbIndex:M,isChanged:!0}),d((0,Kt.replaceAt)(T,M,i.normalizeValue(T[M]-C*(l.key==="PageDown"?h*10:h),M)))):l.key==="Tab"?i.setState({draggedThumbIndex:-1},function(){E&&i.fireOnFinalChange()}):E&&i.fireOnFinalChange())},i.onKeyUp=function(l){var p=i.state.isChanged;i.setState({draggedThumbIndex:-1},function(){p&&i.fireOnFinalChange()})},i.onMove=function(l,p){var T=i.state,d=T.draggedThumbIndex,h=T.draggedTrackPos,P=i.props,y=P.direction,E=P.min,M=P.max,C=P.onChange,S=P.values,O=P.step,B=P.rtl;if(d===-1&&h[0]===-1&&h[1]===-1)return null;var Q=i.trackRef.current;if(!Q)return null;var z=Q.getBoundingClientRect(),Z=(0,Kt.isVertical)(y)?z.height:z.width;if(h[0]!==-1&&h[1]!==-1){var ne=l-h[0],ee=p-h[1],pe=0;switch(y){case Yn.Direction.Right:case Yn.Direction.Left:pe=ne/Z*(M-E);break;case Yn.Direction.Down:case Yn.Direction.Up:pe=ee/Z*(M-E);break;default:(0,Kt.assertUnreachable)(y)}if(B&&(pe*=-1),Math.abs(pe)>=O/2){for(var ve=0;veM?pe=M-S[ve]:$e=O/2&&C((0,Kt.replaceAt)(S,d,i.normalizeValue(Ke,d)))}},i.normalizeValue=function(l,p){var T=i.props,d=T.min,h=T.max,P=T.step,y=T.allowOverlap,E=T.values;return(0,Kt.normalizeValue)(l,p,d,h,P,y,E)},i.onEnd=function(l){if(l.preventDefault(),document.removeEventListener("mousemove",i.schdOnMouseMove),document.removeEventListener("touchmove",i.schdOnTouchMove),document.removeEventListener("mouseup",i.schdOnEnd),document.removeEventListener("touchend",i.schdOnEnd),document.removeEventListener("touchcancel",i.schdOnEnd),i.state.draggedThumbIndex===-1&&i.state.draggedTrackPos[0]===-1&&i.state.draggedTrackPos[1]===-1)return null;i.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){i.fireOnFinalChange()})},i.fireOnFinalChange=function(){i.setState({isChanged:!1});var l=i.props,p=l.onFinalChange,T=l.values;p&&p(T)},i.updateMarkRefs=function(l){if(!l.renderMark){i.numOfMarks=void 0,i.markRefs=void 0;return}i.numOfMarks=(l.max-l.min)/i.props.step,i.markRefs=[];for(var p=0;p-1?"grabbing":this.props.draggableTrack?(0,Kt.isVertical)(this.props.direction)?"ns-resize":"ew-resize":h.length===1&&!M?"pointer":"inherit"},onMouseDown:M?Kt.voidFn:this.onMouseDownTrack,onTouchStart:M?Kt.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:M,children:UF(UF([],B.map(function(Q,z,Z){return d({props:{style:r.props.direction===Yn.Direction.Left||r.props.direction===Yn.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 Z=r.state.draggedThumbIndex===z;return p({index:z,value:Q,isDragged:Z,props:{style:{position:"absolute",zIndex:O[z],cursor:M?"inherit":Z?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:z,tabIndex:M?void 0:0,"aria-valuemax":E?y:h[z+1]||y,"aria-valuemin":E?P:h[z-1]||P,"aria-valuenow":Q,draggable:!1,ref:r.thumbRefs[z],role:"slider",onKeyDown:M?Kt.voidFn:r.onKeyDown,onKeyUp:M?Kt.voidFn:r.onKeyUp}})}),!0)})},n.defaultProps={step:1,direction:Yn.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},n}(cv.Component);Ta.default=C6});var WF=io(wr=>{"use strict";var w6=wr&&wr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wr,"__esModule",{value:!0});wr.checkValuesAgainstBoundaries=wr.relativeValue=wr.useThumbOverlap=wr.Direction=wr.getTrackBackground=wr.Range=void 0;var x6=w6(kF());wr.Range=x6.default;var sv=bg();Object.defineProperty(wr,"getTrackBackground",{enumerable:!0,get:function(){return sv.getTrackBackground}});Object.defineProperty(wr,"useThumbOverlap",{enumerable:!0,get:function(){return sv.useThumbOverlap}});Object.defineProperty(wr,"relativeValue",{enumerable:!0,get:function(){return sv.relativeValue}});Object.defineProperty(wr,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return sv.checkValuesAgainstBoundaries}});var S6=lv();Object.defineProperty(wr,"Direction",{enumerable:!0,get:function(){return S6.Direction}})});var uO={};Gg(uO,{boot:()=>iO});var fc={compose:function(e){return function(n){return function(r){return e(n(r))}}}};var Me=function(e){return e.identity},je={identity:function(e){return e},Semigroupoid0:function(){return fc}};var Ve=!0;var pc=function(e){return function(n){return function(r){return function(i){return e(n(r))(n(i))}}}},At=function(e){return function(n){return function(r){return e(r)(n)}}},He=function(e){return function(n){return e}};var qg=function(e){return function(n){for(var r=n.length,i=new Array(r),l=0;l>1),d-p>1&&e(n,r,l,i,p,d),T-d>1&&e(n,r,l,i,d,T),h=p,P=d,y=p;h0?(i[y++]=M,++P):(i[y++]=E,++h);for(;h="0"&&e[l]<="9"?"\\&":"";return"\\"+r.charCodeAt(0).toString(10)+p})+'"'};var In={show:_1};var Zt={show:m1};var he=function(e){return e.show};var vt=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Ze=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var qt=function(){function e(){}return e.value=new e,e}(),gc=function(e){return e};var Vu=function(e){return e.to};var Dc=function(e){return e.from};var Cw=Me(je),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 Rt=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])}}},Aa=Rt(!0)(He(!1)),Zo=Rt(!1)(He(!0));var Se={map:function(e){return function(n){return n instanceof H?new H(e(n.value0)):G.value}}},ww=V(Se);var zt=function(e){return Rt(e)(Cw)},Tn=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 uo=function(e){var n=Le(e);return{eq:function(r){return function(i){return r instanceof G&&i instanceof G?!0:r instanceof H&&i instanceof H?n(r.value0)(i.value0):!1}}}};var Gr={apply:function(e){return function(n){if(e instanceof H)return ww(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 Se}};var jt={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 Gr}};var fr=function(){return{pure:H.create,Apply0:function(){return Gr}}}();var Nf={alt:function(e){return function(n){return e instanceof G?n:e}},Functor0:function(){return Se}},xw=function(){return{empty:G.value,Alt0:function(){return Nf}}}(),xm={Applicative0:function(){return fr},Plus1:function(){return xw}};var ye=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),be=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var Co=function(e){return Rt(new ye(e))(be.create)};var Un={map:function(e){return function(n){if(n instanceof ye)return new ye(n.value0);if(n instanceof be)return new be(e(n.value0));throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): "+[n.constructor.name])}}},Mw=V(Un);var gn=function(e){return function(n){return function(r){if(r instanceof ye)return e(r.value0);if(r instanceof be)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])}}},Ku=function(){return gn(He(G.value))(H.create)}();var Pf={apply:function(e){return function(n){if(e instanceof ye)return new ye(e.value0);if(e instanceof be)return Mw(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 Un}};var ia={bind:gn(function(e){return function(n){return new ye(e)}})(function(e){return function(n){return n(e)}}),Apply0:function(){return Pf}};var lo=function(e){return e};var ei={map:function(e){return function(n){return e(n)}}};var h1={apply:function(e){return function(n){return e(n)}},Functor0:function(){return ei}},Iw={bind:function(e){return function(n){return n(e)}},Apply0:function(){return h1}},Of={pure:lo,Apply0:function(){return h1}},kn={Applicative0:function(){return Of},Bind1:function(){return Iw}};var xo={mempty:"",Semigroup0:function(){return Rm}};var St=function(e){return e.mempty};var D1=function(e){return function(){return e}},y1=function(e){return function(n){return function(){return n(e())()}}};var Mm=function(e){return function(n){return function(){for(var r=0,i=e.length;r>1),d-p>1&&e(n,r,l,i,p,d),T-d>1&&e(n,r,l,i,d,T),h=p,P=d,y=p;h0?(i[y++]=M,++P):(i[y++]=E,++h);for(;h=0;p--)i=e(r[p])(i);return i}}},U1=function(e){return function(n){return function(r){for(var i=n,l=r.length,p=0;p=0&&e<100&&d.setUTCFullYear(e),d.getTime()};function oD(e){return function(n){return function(r){return function(i){var l=rS(i.year,i.month-1,i.day,i.hour,i.minute,i.second,i.millisecond),p=new Date(l+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 aS=function(e,n,r){var i=new Date(Date.UTC(e,n,r));return e>=0&&e<100&&i.setUTCFullYear(e),i};function iD(e,n,r,i){var l=aS(n,r-1,i);return e(l.getUTCFullYear())(l.getUTCMonth()+1)(l.getUTCDate())}function Ti(e){return e.charCodeAt(0)}function uD(e){return String.fromCharCode(e)}var ed=function(e){var n=oe(e.Applicative0()),r=br(e.Plus1());return function(i){if(i)return n(Re);if(!i)return r;throw new Error("Failed pattern match at Control.Alternative (line 48, column 1 - line 48, column 54): "+[i.constructor.name])}};var cD=Gt(zu),sD=cn(zu);var ct=function(e){return e.toEnum};var bt=function(e){return e.fromEnum};var Ic=function(e){return function(n){return function(r){return e(n(r)+1|0)}}},Ac=function(e){return function(n){return function(r){return e(n(r)-1|0)}}};var Jm=function(e){return e>=Ti(cD)&&e<=Ti(sD)?new H(uD(e)):G.value},oS={succ:Ic(Jm)(Ti),pred:Ac(Jm)(Ti),Ord0:function(){return Af}};var Lc=function(){return{cardinality:Ti(sD)-Ti(cD)|0,toEnum:Jm,fromEnum:Ti,Bounded0:function(){return zu},Enum1:function(){return oS}}}();var Gm=function(e,n,r){var i=0,l;return function(p){if(i===2)return l;if(i===1)throw new ReferenceError(e+" was needed before it finished initializing (module "+n+", line "+p+")",n,p);return i=1,l=r(),i=2,l}};var qr=function(){function e(){}return e.value=new e,e}(),ca=function(){function e(){}return e.value=new e,e}(),sa=function(){function e(){}return e.value=new e,e}(),fa=function(){function e(){}return e.value=new e,e}(),da=function(){function e(){}return e.value=new e,e}(),pa=function(){function e(){}return e.value=new e,e}(),va=function(){function e(){}return e.value=new e,e}(),ma=function(){function e(){}return e.value=new e,e}(),_a=function(){function e(){}return e.value=new e,e}(),ha=function(){function e(){}return e.value=new e,e}(),ga=function(){function e(){}return e.value=new e,e}(),Pa=function(){function e(){}return e.value=new e,e}();var td=Jt,nd=Jt,fD=yr;var qm={eq:function(e){return function(n){return e instanceof qr&&n instanceof qr||e instanceof ca&&n instanceof ca||e instanceof sa&&n instanceof sa||e instanceof fa&&n instanceof fa||e instanceof da&&n instanceof da||e instanceof pa&&n instanceof pa||e instanceof va&&n instanceof va||e instanceof ma&&n instanceof ma||e instanceof _a&&n instanceof _a||e instanceof ha&&n instanceof ha||e instanceof ga&&n instanceof ga||e instanceof Pa&&n instanceof Pa}}},rd={compare:function(e){return function(n){if(e instanceof qr&&n instanceof qr)return nt.value;if(e instanceof qr)return we.value;if(n instanceof qr)return Ce.value;if(e instanceof ca&&n instanceof ca)return nt.value;if(e instanceof ca)return we.value;if(n instanceof ca)return Ce.value;if(e instanceof sa&&n instanceof sa)return nt.value;if(e instanceof sa)return we.value;if(n instanceof sa)return Ce.value;if(e instanceof fa&&n instanceof fa)return nt.value;if(e instanceof fa)return we.value;if(n instanceof fa)return Ce.value;if(e instanceof da&&n instanceof da)return nt.value;if(e instanceof da)return we.value;if(n instanceof da)return Ce.value;if(e instanceof pa&&n instanceof pa)return nt.value;if(e instanceof pa)return we.value;if(n instanceof pa)return Ce.value;if(e instanceof va&&n instanceof va)return nt.value;if(e instanceof va)return we.value;if(n instanceof va)return Ce.value;if(e instanceof ma&&n instanceof ma)return nt.value;if(e instanceof ma)return we.value;if(n instanceof ma)return Ce.value;if(e instanceof _a&&n instanceof _a)return nt.value;if(e instanceof _a)return we.value;if(n instanceof _a)return Ce.value;if(e instanceof ha&&n instanceof ha)return nt.value;if(e instanceof ha)return we.value;if(n instanceof ha)return Ce.value;if(e instanceof ga&&n instanceof ga)return nt.value;if(e instanceof ga)return we.value;if(n instanceof ga)return Ce.value;if(e instanceof Pa&&n instanceof Pa)return nt.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 qm}},dD=yr,ad=function(){return{bottom:-271820|0,top:275759,Ord0:function(){return td}}}();var od=function(){return{bottom:qr.value,top:Pa.value,Ord0:function(){return rd}}}(),zr={cardinality:547580,toEnum:function(e){if(e>=(-271820|0)&&e<=275759)return new H(e);if(Ve)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 ad},Enum1:function(){return iS(0)}},iS=Gm("enumYear","Data.Date.Component",function(){return{succ:function(){var e=ct(zr),n=bt(zr);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=ct(zr),n=bt(zr);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return td}}});var ar={cardinality:12,toEnum:function(e){return e===1?new H(qr.value):e===2?new H(ca.value):e===3?new H(sa.value):e===4?new H(fa.value):e===5?new H(da.value):e===6?new H(pa.value):e===7?new H(va.value):e===8?new H(ma.value):e===9?new H(_a.value):e===10?new H(ha.value):e===11?new H(ga.value):e===12?new H(Pa.value):G.value},fromEnum:function(e){if(e instanceof qr)return 1;if(e instanceof ca)return 2;if(e instanceof sa)return 3;if(e instanceof fa)return 4;if(e instanceof da)return 5;if(e instanceof pa)return 6;if(e instanceof va)return 7;if(e instanceof ma)return 8;if(e instanceof _a)return 9;if(e instanceof ha)return 10;if(e instanceof ga)return 11;if(e instanceof Pa)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 od},Enum1:function(){return uS(0)}},uS=Gm("enumMonth","Data.Date.Component",function(){return{succ:function(){var e=ct(ar),n=bt(ar);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=ct(ar),n=bt(ar);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return rd}}});var jc={bottom:1,top:31,Ord0:function(){return nd}},Da={cardinality:31,toEnum:function(e){if(e>=1&&e<=31)return new H(e);if(Ve)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 jc},Enum1:function(){return lS(0)}},lS=Gm("enumDay","Data.Date.Component",function(){return{succ:function(){var e=ct(Da),n=bt(Da);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=ct(Da),n=bt(Da);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return nd}}});var pD=function(e){return function(n){return function(r){return(r|0)===r?e(r):n}}};var Ei=function(){return pD(H.create)(G.value)}();var DD=Me(je);var id=function(e){return e.fromDuration};var ud={fromDuration:DD,toDuration:DD};var yS=bt(ar),RS=Tn();var bS=Le(fD),TS=Le(qm),ES=Le(dD),FS=xe(td),CS=xe(rd),wS=xe(nd);var xS=ct(ar);var cd=function(){function e(n,r,i){this.value0=n,this.value1=r,this.value2=i}return e.create=function(n){return function(r){return function(i){return new e(n,r,i)}}},e}(),Fi=function(e){return e.value0};var Ci=function(e){return e.value1};var sd={eq:function(e){return function(n){return bS(e.value0)(n.value0)&&TS(e.value1)(n.value1)&&ES(e.value2)(n.value2)}}},SS=Le(sd),Km={compare:function(e){return function(n){var r=FS(e.value0)(n.value0);if(r instanceof we)return we.value;if(r instanceof Ce)return Ce.value;var i=CS(e.value1)(n.value1);return i instanceof we?we.value:i instanceof Ce?Ce.value:wS(e.value2)(n.value2)}},Eq0:function(){return sd}};var pu=function(e){return e.value2},wi=function(e){return function(n){return function(r){var i=function(l){return function(p){return function(T){return new cd(l,RS(xS(p)),T)}}};return iD(i,e,yS(n),r)}}},Ym=function(e){return function(n){return function(r){var i=new cd(e,n,r),l=SS(wi(e)(n)(r))(i);return l?new H(i):G.value}}},Qm=function(){return{bottom:new cd(Gt(ad),Gt(od),Gt(jc)),top:new cd(cn(ad),cn(od),cn(jc)),Ord0:function(){return Km}}}();var fd=function(e,n,r){var i=0,l;return function(p){if(i===2)return l;if(i===1)throw new ReferenceError(e+" was needed before it finished initializing (module "+n+", line "+p+")",n,p);return i=1,l=r(),i=2,l}};var dd=Jt,pd=Jt,vd=Jt,md=Jt,xD=yr,SD=yr,MD=yr,ID=yr,Nc={bottom:0,top:59,Ord0:function(){return dd}},Pc={bottom:0,top:59,Ord0:function(){return pd}},Oc={bottom:0,top:999,Ord0:function(){return vd}},Uc={bottom:0,top:23,Ord0:function(){return md}},Oa={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new H(e);if(Ve)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 Nc},Enum1:function(){return MS(0)}},MS=fd("enumSecond","Data.Time.Component",function(){return{succ:function(){var e=ct(Oa),n=bt(Oa);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=ct(Oa),n=bt(Oa);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return dd}}});var Ua={cardinality:60,toEnum:function(e){if(e>=0&&e<=59)return new H(e);if(Ve)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 Pc},Enum1:function(){return IS(0)}},IS=fd("enumMinute","Data.Time.Component",function(){return{succ:function(){var e=ct(Ua),n=bt(Ua);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=ct(Ua),n=bt(Ua);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return pd}}});var ka={cardinality:1e3,toEnum:function(e){if(e>=0&&e<=999)return new H(e);if(Ve)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 Oc},Enum1:function(){return AS(0)}},AS=fd("enumMillisecond","Data.Time.Component",function(){return{succ:function(){var e=ct(ka),n=bt(ka);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=ct(ka),n=bt(ka);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return vd}}});var Wa={cardinality:24,toEnum:function(e){if(e>=0&&e<=23)return new H(e);if(Ve)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 Uc},Enum1:function(){return LS(0)}},LS=fd("enumHour","Data.Time.Component",function(){return{succ:function(){var e=ct(Wa),n=bt(Wa);return function(r){return e(function(i){return i+1|0}(n(r)))}}(),pred:function(){var e=ct(Wa),n=bt(Wa);return function(r){return e(function(i){return i-1|0}(n(r)))}}(),Ord0:function(){return md}}});var OS=Le(ID),US=Le(SD),kS=Le(xD),WS=Le(MD),HS=xe(md),BS=xe(pd),$S=xe(dd),JS=xe(vd);var Ao=function(){function e(n,r,i,l){this.value0=n,this.value1=r,this.value2=i,this.value3=l}return e.create=function(n){return function(r){return function(i){return function(l){return new e(n,r,i,l)}}}},e}();var ul=function(e){return e.value2},ll=function(e){return e.value1},cl=function(e){return e.value3};var sl=function(e){return e.value0};var Xm={eq:function(e){return function(n){return OS(e.value0)(n.value0)&&US(e.value1)(n.value1)&&kS(e.value2)(n.value2)&&WS(e.value3)(n.value3)}}},Zm={compare:function(e){return function(n){var r=HS(e.value0)(n.value0);if(r instanceof we)return we.value;if(r instanceof Ce)return Ce.value;var i=BS(e.value1)(n.value1);if(i instanceof we)return we.value;if(i instanceof Ce)return Ce.value;var l=$S(e.value2)(n.value2);return l instanceof we?we.value:l instanceof Ce?Ce.value:JS(e.value3)(n.value3)}},Eq0:function(){return Xm}};var kc=function(){return{bottom:new Ao(Gt(Uc),Gt(Pc),Gt(Nc),Gt(Oc)),top:new Ao(cn(Uc),cn(Pc),cn(Nc),cn(Oc)),Ord0:function(){return Zm}}}();var qS=bt(zr),zS=bt(ar),VS=bt(Da),KS=bt(Wa),YS=bt(Ua),QS=bt(Oa),XS=bt(ka);var ZS=Le(sd),e2=Le(Xm),t2=xe(Km),n2=xe(Zm),r2=se(jt),fl=tt(Gr),e_=V(Se),a2=gi(jt),o2=ct(zr),i2=ct(ar),u2=ct(Da),l2=ct(Wa),c2=ct(Ua),s2=ct(Oa),f2=ct(ka),vo=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}(),d2=function(e){return{year:qS(Fi(e.value0)),month:zS(Ci(e.value0)),day:VS(pu(e.value0)),hour:KS(sl(e.value1)),minute:YS(ll(e.value1)),second:QS(ul(e.value1)),millisecond:XS(cl(e.value1))}};var p2={eq:function(e){return function(n){return ZS(e.value0)(n.value0)&&e2(e.value1)(n.value1)}}},Wc={compare:function(e){return function(n){var r=t2(e.value0)(n.value0);return r instanceof we?we.value:r instanceof Ce?Ce.value:n2(e.value1)(n.value1)}},Eq0:function(){return p2}};var _d=function(){return{bottom:new vo(Gt(Qm),Gt(kc)),top:new vo(cn(Qm),cn(kc)),Ord0:function(){return Wc}}}(),AD=function(e){var n=id(e);return function(r){return function(i){return r2(oD(H.create)(G.value)(n(r))(d2(i)))(function(l){return fl(e_(vo.create)(a2(fl(fl(e_(Ym)(o2(l.year)))(i2(l.month)))(u2(l.day)))))(fl(fl(fl(e_(Ao.create)(l2(l.hour)))(c2(l.minute)))(s2(l.second)))(f2(l.millisecond)))})}}};var Fr=function(){var e={},n="Pure",r="Throw",i="Catch",l="Sync",p="Async",T="Bind",d="Bracket",h="Fork",P="Sequential",y="Map",E="Apply",M="Alt",C="Cons",S="Resume",O="Release",B="Finalizer",Q="Finalized",z="Forked",Z="Fiber",ne="Thunk";function ee(me,dt,Pt,Ue){this.tag=me,this._1=dt,this._2=Pt,this._3=Ue}function pe(me){var dt=function(Pt,Ue,Ae){return new ee(me,Pt,Ue,Ae)};return dt.tag=me,dt}function ve(me){return new ee(n,void 0)}function $e(me){try{me()}catch(dt){setTimeout(function(){throw dt},0)}}function qe(me,dt,Pt){try{return dt(Pt())}catch(Ue){return me(Ue)}}function Ke(me,dt,Pt){try{return dt(Pt)()}catch(Ue){return Pt(me(Ue))(),ve}}var an=function(){var me=1024,dt=0,Pt=0,Ue=new Array(me),Ae=!1;function _e(){var ot;for(Ae=!0;dt!==0;)dt--,ot=Ue[Pt],Ue[Pt]=void 0,Pt=(Pt+1)%me,ot();Ae=!1}return{isDraining:function(){return Ae},enqueue:function(ot){var et,wt;dt===me&&(wt=Ae,_e(),Ae=wt),Ue[(Pt+dt)%me]=ot,dt++,Ae||_e()}}}();function ln(me){var dt={},Pt=0,Ue=0;return{register:function(Ae){var _e=Pt++;Ae.onComplete({rethrow:!0,handler:function(ot){return function(){Ue--,delete dt[_e]}}})(),dt[_e]=Ae,Ue++},isEmpty:function(){return Ue===0},killAll:function(Ae,_e){return function(){if(Ue===0)return _e();var ot=0,et={};function wt(Ge){et[Ge]=dt[Ge].kill(Ae,function(pt){return function(){delete et[Ge],ot--,me.isLeft(pt)&&me.fromLeft(pt)&&setTimeout(function(){throw me.fromLeft(pt)},0),ot===0&&_e()}})()}for(var on in dt)dt.hasOwnProperty(on)&&(ot++,wt(on));return dt={},Pt=0,Ue=0,function(Ge){return new ee(l,function(){for(var pt in et)et.hasOwnProperty(pt)&&et[pt]()})}}}}}var lt=0,yt=1,Ut=2,nn=3,Ht=4,xt=5,Qt=6;function Nt(me,dt,Pt){var Ue=0,Ae=lt,_e=Pt,ot=null,et=null,wt=null,on=null,Ge=null,pt=0,$n=0,Tt=null,Zr=!0;function U(x){for(var A,k,W;;)switch(A=null,k=null,W=null,Ae){case Ut:Ae=yt;try{_e=wt(_e),on===null?wt=null:(wt=on._1,on=on._2)}catch(K){Ae=xt,ot=me.left(K),_e=null}break;case nn:me.isLeft(_e)?(Ae=xt,ot=_e,_e=null):wt===null?Ae=xt:(Ae=Ut,_e=me.fromRight(_e));break;case yt:switch(_e.tag){case T:wt&&(on=new ee(C,wt,on)),wt=_e._2,Ae=yt,_e=_e._1;break;case n:wt===null?(Ae=xt,_e=me.right(_e._1)):(Ae=Ut,_e=_e._1);break;case l:Ae=nn,_e=qe(me.left,me.right,_e._1);break;case p:Ae=Ht,_e=Ke(me.left,_e._1,function(K){return function(){Ue===x&&(Ue++,an.enqueue(function(){Ue===x+1&&(Ae=nn,_e=K,U(Ue))}))}});return;case r:Ae=xt,ot=me.left(_e._1),_e=null;break;case i:wt===null?Ge=new ee(C,_e,Ge,et):Ge=new ee(C,_e,new ee(C,new ee(S,wt,on),Ge,et),et),wt=null,on=null,Ae=yt,_e=_e._1;break;case d:pt++,wt===null?Ge=new ee(C,_e,Ge,et):Ge=new ee(C,_e,new ee(C,new ee(S,wt,on),Ge,et),et),wt=null,on=null,Ae=yt,_e=_e._1;break;case h:Ae=nn,A=Nt(me,dt,_e._2),dt&&dt.register(A),_e._1&&A.run(),_e=me.right(A);break;case P:Ae=yt,_e=Bn(me,dt,_e._1);break}break;case xt:if(wt=null,on=null,Ge===null)Ae=Qt,_e=et||ot||_e;else switch(A=Ge._3,W=Ge._1,Ge=Ge._2,W.tag){case i:et&&et!==A&&pt===0?Ae=xt:ot&&(Ae=yt,_e=W._2(me.fromLeft(ot)),ot=null);break;case S:et&&et!==A&&pt===0||ot?Ae=xt:(wt=W._1,on=W._2,Ae=Ut,_e=me.fromRight(_e));break;case d:pt--,ot===null&&(k=me.fromRight(_e),Ge=new ee(C,new ee(O,W._2,k),Ge,A),(et===A||pt>0)&&(Ae=yt,_e=W._3(k)));break;case O:Ge=new ee(C,new ee(Q,_e,ot),Ge,et),Ae=yt,et&&et!==A&&pt===0?_e=W._1.killed(me.fromLeft(et))(W._2):ot?_e=W._1.failed(me.fromLeft(ot))(W._2):_e=W._1.completed(me.fromRight(_e))(W._2),ot=null,pt++;break;case B:pt++,Ge=new ee(C,new ee(Q,_e,ot),Ge,et),Ae=yt,_e=W._1;break;case Q:pt--,Ae=xt,_e=W._1,ot=W._2;break}break;case Qt:for(var X in Tt)Tt.hasOwnProperty(X)&&(Zr=Zr&&Tt[X].rethrow,$e(Tt[X].handler(_e)));Tt=null,et&&ot?setTimeout(function(){throw me.fromLeft(ot)},0):me.isLeft(_e)&&Zr&&setTimeout(function(){if(Zr)throw me.fromLeft(_e)},0);return;case lt:Ae=yt;break;case Ht:return}}function J(x){return function(){if(Ae===Qt)return Zr=Zr&&x.rethrow,x.handler(_e)(),function(){};var A=$n++;return Tt=Tt||{},Tt[A]=x,function(){Tt!==null&&delete Tt[A]}}}function L(x,A){return function(){if(Ae===Qt)return A(me.right(void 0))(),function(){};var k=J({rethrow:!1,handler:function(){return A(me.right(void 0))}})();switch(Ae){case lt:et=me.left(x),Ae=Qt,_e=et,U(Ue);break;case Ht:et===null&&(et=me.left(x)),pt===0&&(Ae===Ht&&(Ge=new ee(C,new ee(B,_e(x)),Ge,et)),Ae=xt,_e=null,ot=null,U(++Ue));break;default:et===null&&(et=me.left(x)),pt===0&&(Ae=xt,_e=null,ot=null)}return k}}function D(x){return function(){var A=J({rethrow:!1,handler:x})();return Ae===lt&&U(Ue),A}}return{kill:L,join:D,onComplete:J,isSuspended:function(){return Ae===lt},run:function(){Ae===lt&&(an.isDraining()?U(Ue):an.enqueue(function(){U(Ue)}))}}}function ft(me,dt,Pt,Ue){var Ae=0,_e={},ot=0,et={},wt=new Error("[ParAff] Early exit"),on=null,Ge=e;function pt(J,L,D){var x=L,A=null,k=null,W=0,X={},K,re;e:for(;;)switch(K=null,x.tag){case z:if(x._3===e&&(K=_e[x._1],X[W++]=K.kill(J,function(ue){return function(){W--,W===0&&D(ue)()}})),A===null)break e;x=A._2,k===null?A=null:(A=k._1,k=k._2);break;case y:x=x._2;break;case E:case M:A&&(k=new ee(C,A,k)),A=x,x=x._1;break}if(W===0)D(me.right(void 0))();else for(re=0,K=W;re()=>e.props.def;function c0(e){class n extends Hn.Component{constructor(i){super(i);i.init&&i.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 Sd=typeof module=="undefined"?void 0:module.require,aoe=function(){try{return Sd===void 0?void 0:Sd("util")}catch{return}}();var ooe=function(){var e;if(typeof performance!="undefined")e=performance;else if(Sd)try{e=Sd("perf_hooks").performance}catch{}return function(){return(e||Date).now()}}();function s0(e){return typeof e=="string"}function c_(e){return typeof e=="number"}function f0(e){return typeof e=="boolean"}function d0(e){return e instanceof Object}function p0(e){return e instanceof Function}function zc(e){return e===null?"":e===void 0?"":e instanceof Date?e.toString():typeof Blob!="undefined"&&e instanceof Blob?"file["+e.name+"]":JSON.stringify(e)}var fM=sn(mt),v0=bi(Cc),dM=pn(mt);var Rl=function(e){return e.foldrWithIndex};var Vc=function(e){return e.foldlWithIndex};var pM=function(e){var n=Rl(e);return function(r){var i=Ne(r.Semigroup0()),l=St(r);return function(p){return n(function(T){return function(d){return function(h){return i(p(T)(d))(h)}}})(l)}}},Kc={foldrWithIndex:function(e){return function(n){var r=fM(function(l){return function(p){return e(l.value0)(l.value1)(p)}})(n),i=v0(Be.create);return function(l){return r(i(l))}}},foldlWithIndex:function(e){return function(n){var r=dM(function(l){return function(p){return e(p.value0)(l)(p.value1)}})(n),i=v0(Be.create);return function(l){return r(i(l))}}},foldMapWithIndex:function(e){return pM(Kc)(e)},Foldable0:function(){return mt}};var m0=function(e){var n=Vc(e);return function(r){var i=function(l){return function(p){return function(T){return p instanceof G?r(l)(T):p}}};return n(i)(G.value)}};function Md(e){return Object.prototype.toString.call(e).slice(8,-1)}function Id(e){return e===null}function Yc(e){return e===void 0}var Ad=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};var ho=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 jd=function(e){var n=br(e);return function(r){return new ho(r,n)}};var zn=function(){function e(){}return e.value=new e,e}(),Wt=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}(),Nd=function(e){return e},EM=function(e){return new Wt(e.value0,e.value1)};var FM=function(e){var n=function(r){return function(i){var l=r,p=!1,T;function d(h,P){if(P instanceof Wt&&P.value1 instanceof Wt&&P.value1.value1 instanceof Wt){l=new Wt(P,h),i=P.value1.value1.value1;return}var y=function(M){return M instanceof Wt&&M.value1 instanceof Wt&&M.value1.value1 instanceof zn?new Wt(e(M.value0),new Wt(e(M.value1.value0),zn.value)):M instanceof Wt&&M.value1 instanceof zn?new Wt(e(M.value0),zn.value):zn.value},E=function(M){return function(C){var S=M,O=!1,B;function Q(z,Z){if(z instanceof Wt&&z.value0 instanceof Wt&&z.value0.value1 instanceof Wt&&z.value0.value1.value1 instanceof Wt){S=z.value1,C=new Wt(e(z.value0.value0),new Wt(e(z.value0.value1.value0),new Wt(e(z.value0.value1.value1.value0),Z)));return}return O=!0,Z}for(;!O;)B=Q(S,C);return B}};return p=!0,E(h)(y(P))}for(;!p;)T=d(l,i);return T}};return n(zn.value)},D0={map:FM};var Yr={foldr:function(e){return function(n){var r=function(){var l=function(p){return function(T){var d=p,h=!1,P;function y(E,M){if(M instanceof zn)return h=!0,E;if(M instanceof Wt){d=new Wt(M.value0,E),T=M.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 107, column 7 - line 107, column 23): "+[E.constructor.name,M.constructor.name])}for(;!h;)P=y(d,T);return P}};return l(zn.value)}(),i=pn(Yr)(At(e))(n);return function(l){return i(r(l))}}},foldl:function(e){var n=function(r){return function(i){var l=r,p=!1,T;function d(h,P){if(P instanceof zn)return p=!0,h;if(P instanceof Wt){l=e(h)(P.value0),i=P.value1;return}throw new Error("Failed pattern match at Data.List.Types (line 111, column 12 - line 113, column 30): "+[P.constructor.name])}for(;!p;)T=d(l,i);return T}};return n},foldMap:function(e){var n=Ne(e.Semigroup0()),r=St(e);return function(i){return pn(Yr)(function(l){var p=n(l);return function(T){return p(i(T))}})(r)}}};var CM=sn(Yr);var Pd={append:function(e){return function(n){return CM(Wt.create)(n)(e)}}},y0=Ne(Pd);var Od={append:function(e){return function(n){return new ho(e.value0,y0(e.value1)(EM(n)))}}};var R0={alt:y0,Functor0:function(){return D0}},s_=function(){return{empty:zn.value,Alt0:function(){return R0}}}();var f_=function(){var e=jd(s_);return function(n){return Nd(e(n))}}();var F0=function(e){return e.value0};var Ii=function(e){return e.length};var C0=function(e){return function(n){return function(r){return function(i){var l=i.indexOf(r);return l===-1?n:e(l)}}}};var bl=function(e){return function(n){return n.substr(0,e)}},Ai=function(e){return function(n){return n.substring(e)}};var ii=function(e){return function(n){if(e>=0&&en[e],k0=(e,n,r)=>r[e]=n;var Fl=function(n){return function(r){return n(r)()}};var hu=function(n){return function(r){return function(i){return function(){return n(r,i)}}}},gu=function(n){return function(r){return function(i){return function(l){return function(){return n(r,i,l)}}}}};var f3=gt(ut),is=function(){function e(){}return e.value=new e,e}(),B0=function(){return function(e){var n=hn(e);return function(r){return gu(k0)(n(en.value))}}},y_=function(e){var n=os(e);return function(r){var i=hn(r);return function(l){return function(p){return f3(function(){return U0(i(en.value),p)})(n)}}}};var us=null;function $0(e,n,r){return e==null?n:r(e)}function R_(e){return e}var Po=Rt(us)(R_),Pe=function(e){return $0(e,G.value,H.create)};oi();var qd=window.ReactDOM,{createPortal:Kfe,findDOMNode:Yfe,flushSync:Qfe,unstable_batchedUpdates:Xfe}=window.ReactDOM;var $_=xf(jy());function Ny(e,n,r){return e.setState({s:n},r)}var Py=qd.render,Oy=qd.hydrate,J_=$_.default&&$_.default.renderToString||(e=>""),B3=qd.unmountComponentAtNode,Uy=Hn.Fragment;function ky(e,n,r){return Hn.createElement.apply(null,[e,$3(e,n)].concat(r))}function $3(e,n){if(typeof e!="string"||n._data==null)return n;var r={_data:void 0};for(var i in n._data){var l=n._data[i];r["data-"+i]=l}return Object.assign({},n,r)}var Do={asReactChildren:function(e){return[e]}},Uo={asReactChildren:function(e){return[e]}},si={asReactChildren:Me(je)};var bu=ge,Hy=gu(Ny),By=hu(Py),$y=hu(Oy);var hr=!1;var J3=function(e){return e.asReactChildren},Sl=function(){return function(e){var n=J3(e);return function(r){return function(i){return function(l){return ky(r,i,n(l))}}}}},Jy=Sl()(si),Tu=function(){return function(e){return function(n){return Jy(e)(n)([])}}},vs=Jy(Uy)({});var Gy=V(ut),G3=oe(An);var qy=function(){var e=function(n){return function(r){return{initialize:function(i){return ru(new H(r.initialState))(n)},getState:function(i){return Gy(zt(r.initialState))(Qu(n))},setState:function(i){return function(l){return function(p){return function(){return ru(new H(l))(n)(),Hy(i)(l)(G3(Re))(),p()}}}}}}};return Gy(e)(yc(G.value))}();var Vy=gt(Lt),Ky=Ne(tr);var q3=oe(An),Yy=B0(),Qy={reflectSymbol:function(){return"__unmounted"}},z3=Yy(Qy),Xy={reflectSymbol:function(){return"__subscriptions"}},V3=Yy(Xy),tp=gt(ut),K3=y_(Kn)(Qy),Zy=V(ut),Y3=y_(Or(P0))(Xy),Q3=_n(Fn),X3=bn(ua),Z3=Jf(An)(mt),e4=Q3(or),eR=Mt(vl),t4=If(Di),n4=Ne(bm(Am(Mf)));var Oi=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}(),r4={map:function(e){return function(n){return new Oi(e(n.value0),n.value1)}}},np=function(e){return{bimap:function(n){return function(r){return function(i){return new Oi(r(i.value0),Vy(i.value1)(function(l){return function(p){return l({dispatch:function(T){return p.dispatch(n(T))},onStop:p.onStop})}}))}}}}},tR={apply:function(e){return function(n){return new Oi(e.value0(n.value0),Ky(e.value1)(n.value1))}},Functor0:function(){return r4}},fi={bind:function(e){return function(n){var r=n(e.value0);return new Oi(r.value0,Ky(e.value1)(r.value1))}},Apply0:function(){return tR}},Ra={pure:function(e){return new Oi(e,[])},Apply0:function(){return tR}};var nR=function(e){var n=se(e);return function(r){var i=Mt(r);return function(l){return function(p){return new Oi(l,Vy(p)(function(T){return function(d){return n(T)(function(h){return i(d.dispatch(h))})}}))}}}};var Ml=function(e){return new Oi(Re,[e])},ko=function(e){return Ml(He(e))},Ui=function(e){var n=se(e.Monad0().Bind1()),r=Mt(e);return function(i){return Ml(function(l){return n(i)(function(p){return r(Rt(q3(Re))(l.dispatch)(p))})})}},ki=function(e){var n=nR(e.Monad0().Bind1())(e);return function(r){return n(Re)([r])}},a4=function(e){return function(n){var r=z3(is.value),i=V3(is.value),l=function(C){return function(S){return function(O){return function(){var Q=tp(qc(C))(function(z){return z.init})();return n({initialState:Q.value0}).setState(C)(S)(O)()}}}},p=function(){var C=Zy(zt(!1)),S=K3(is.value);return function(O){return C(S(O))}}(),T=function(){var C=Zy(zt([])),S=Y3(is.value);return function(O){return C(S(O))}}(),d=function(C){return function(){return X3(Z3)(T(C))(),i([])(C)()}},h=function(C){return function(){var O=tp(qc(C))(function(B){return B.init})();return n({initialState:O.value0}).getState(C)()}},P=function(C){return function(S){return function(){var B=T(C)();return i(Na(Fd(S))(B))(C)()}}},y=function(C){return function(S){var O=function(B){return Fd(e4(No(0))(function(){return B({dispatch:function(){var Q=E(S);return function(z){return eR(Q(z))}}(),onStop:P(S)})}))};return Mm(C)(O)}},E=function(C){return function(S){return t4(p(C))(function(){var B=h(C)(),Q=tp(qc(C))(function(Z){return Z.update})(),z=Q(B)(S);return l(C)(z.value0)(y(z.value1)(C))()})}},M=function(C){return function(){var O=h(C)(),B=tp(qc(C))(function(Q){return Q.view})();return B(O)(E(C))}};return function(C){return l0(e,{def:C,init:n({initialState:C.init.value0}).initialize,render:M,componentDidMount:y(C.init.value1),componentWillUnmount:n4(r(!0))(d)})}}},G_=function(e){return function(){var r=eR(qy)();return u0(function(i){return a4(i)(r)(e)})}};var rp={handle:function(e){return function(n){return function(r){return e(n(r))()}}}},rR={handleEffect:function(e){return Fl(e)}},aR={handleEffect:function(e){return Fl(He(e))}},Il={handle:function(e){return function(n){return function(r){return e(n)()}}}};var ap=function(e){return e.handleEffect},di=function(e){return e.handle};function op(e,n){var r={};for(var i in n)({}).hasOwnProperty.call(n,i)&&(r[i]=n[i]);for(var l in e)({}).hasOwnProperty.call(e,l)&&(r[l]=e[l]);return r}var ip=function(){return function(){return function(e){return function(n){return op(e,n)}}}};var q_=Sl(),o4=ip()();var z_=ge;var V_=function(e){var n=q_(e);return function(r){return function(i){return n(z_(r))(i)}}},K_=function(e){var n=q_(e);return function(r){return function(i){return function(l){return n(z_(r))(o4(l)({className:i}))}}}};var up=function(e){return function(n){var r=q_(n);return function(i){return function(l){return r(z_(e))({className:i})(l)}}}};var pi=ge;var lp=function(e){var n=K_(e);return function(){return function(){return n("video")}}};var ms=function(e){return up("span")(e)};var cp=function(e){return up("i")(e)};var Wo=function(e){var n=K_(e);return function(){return function(){return n("div")}}},yo=function(e){return up("div")(e)};var oR=$c(Td);var iR={map:function(e){return function(n){return oR(oR(e))(n)}}},i4=gt(iR),u4=function(e){var n=se(e.Monad0().Bind1()),r=Mt(e);return function(i){return Ml(function(l){return n(i(l.dispatch))(function(p){return r(l.onStop(p))})})}},_s=function(e){var n=u4(e);return function(r){return function(i){return n(i4(i)(r))}}};var $a=function(){return{"genericTop'":qt.value}}();var Y_=function(e){return e["genericTop'"]},Ja=function(e){return{"genericTop'":Y_(e)}};var Ga=function(){return{"genericBottom'":qt.value}}();var hs=function(e){return e["genericBottom'"]},qa=function(e){return{"genericBottom'":hs(e)}};var za=function(e){return{"genericBottom'":new vt(hs(e))}},uR=function(e){var n=Vu(e);return function(r){return n(hs(r))}};var Wi=V(Se),sp=Dn();var Q_=function(e){return e["genericToEnum'"]};var fp=function(e){return e["genericSucc'"]},cR=function(e){var n=Vu(e),r=Dc(e);return function(i){var l=Wi(n),p=fp(i);return function(T){return l(p(r(T)))}}},X_=function(e){return e["genericPred'"]};var Z_=function(e){return e["genericFromEnum'"]};var Va=function(e){var n=X_(e),r=fp(e);return function(i){var l=Y_(i);return function(p){var T=X_(p),d=fp(p);return function(h){var P=hs(h);return{"genericPred'":function(y){if(y instanceof vt)return Wi(vt.create)(n(y.value0));if(y instanceof Ze){var E=T(y.value0);if(E instanceof G)return new H(new vt(l));if(E instanceof H)return new H(new Ze(E.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 30, column 14 - line 32, column 31): "+[E.constructor.name])}throw new Error("Failed pattern match at Data.Enum.Generic (line 28, column 18 - line 32, column 31): "+[y.constructor.name])},"genericSucc'":function(y){if(y instanceof vt){var E=r(y.value0);if(E instanceof G)return new H(new Ze(P));if(E instanceof H)return new H(new vt(E.value0));throw new Error("Failed pattern match at Data.Enum.Generic (line 34, column 14 - line 36, column 31): "+[E.constructor.name])}if(y instanceof Ze)return Wi(Ze.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 Ka={"genericPred'":function(e){return G.value},"genericSucc'":function(e){return G.value}},Ya=function(e){var n=X_(e),r=fp(e);return{"genericPred'":function(i){return Wi(gc)(n(i))},"genericSucc'":function(i){return Wi(gc)(r(i))}}};var eh=function(e){return e["genericCardinality'"]};var Qa=function(e){var n=eh(e),r=Q_(e),i=Z_(e);return function(l){var p=Q_(l),T=Z_(l);return{"genericCardinality'":sp(n)+sp(eh(l))|0,"genericToEnum'":function(d){var h=function(P){if(d>=0&&d1;if(r){var i=ys(ii(1)(e)),l=IR(i);return l?MR(n)(i):n}return n},cI=FR(lI),Rs=CR(uI)(cI),vi=function(e){return Jr(Rs(e))};var hp=function(e){return function(n){return SR(function(r){return vi(bl(r)(n))})(p_(e)(n))}};var kR=Oe;var yI=Jd(mt),RI=gt(Lt),bI=fu(th),kr=function(e){return function(n){var r=yI(RI(n)(function(i){return new Be(e(i),i)}));return function(i){return _u(i)(r)}}},WR=function(e){var n=cR(e),r=uR(e);return function(i){var l=n(i);return function(p){return function(T){return bI(function(d){return new Be(d,l(d))})(r(T))}}}},ba=function(e){var n=WR(e);return function(r){var i=n(r);return function(l){var p=i(l);return function(T){return Hi(p(T))}}}};var TI={info:"info",warning:"warn",error:"error"},Es=e=>n=>r=>i=>{let l=TI[e];if(typeof console!="undefined"&&console[l]&&console[l](n,r),typeof window!="undefined"){let p=new Error(n);typeof window.Sentry!="undefined"&&window.Sentry.captureException(p,{extra:r})}return i()},HR=(e,n)=>(n.__sentryFingerprint=e,n);var BR=function(e){return Io(HR)(e)};var Rp="error";var bp={parseOrPanic:function(e){return function(n){var r=e.parse(n);if(r instanceof be)return r.value0;if(r instanceof ye)return Es(Rp)("Failed to parse "+e.diagnosticName)({error:r.value0,value:n})(function(i){return e.default});throw new Error("Failed pattern match at Utils.Parse (line 49, column 5 - line 57, column 24): "+[r.constructor.name])}}},ir=function(e){return e.parseOrPanic},EI=ir(bp),Bi=function(e){var n=ir(e);return function(r){var i=V(r);return function(l){return n({parse:function(p){return i(H.create)(l.parse(p))},default:G.value,diagnosticName:l.diagnosticName})}}},FI=Bi(bp)(Un),$i=function(e){var n=ji(e);return function(r){return FI({parse:n,diagnosticName:r})}},ur={parseOrPanic:function(e){return EI({default:e.default,diagnosticName:e.diagnosticName,parse:function(){var n=Rt(new ye(""))(be.create);return function(r){return n(e.parse(r))}}()})}};var GR=Ya(Ka),qR=qa(Ga),zR=Za(Xa),Ll=function(){function e(){}return e.value=new e,e}(),Fs=function(){function e(){}return e.value=new e,e}(),CI={to:function(e){if(e instanceof vt)return Ll.value;if(e instanceof Ze)return Fs.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 Ll)return new vt(qt.value);if(e instanceof Fs)return new Ze(qt.value);throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 16, column 1 - line 16, column 32): "+[e.constructor.name])}};var wI=function(e){if(e instanceof Ll)return"school";if(e instanceof Fs)return"vine";throw new Error("Failed pattern match at Sem.Connections.Types.Actor (line 28, column 1 - line 28, column 29): "+[e.constructor.name])},VR=function(){return ir(ur)({parse:kr(wI)(ba(CI)(Va(GR)(Ja($a))(GR)(qR))(Qa(zR)(zR))(za(qR))),default:Ll.value,diagnosticName:"Sem.Connections.Types.Actor"})}();var KR=Ya(Ka),YR=Va(KR)(Ja($a)),QR=qa(Ga),XR=za(QR),ZR=Za(Xa),eb=Qa(ZR),xI=tn(Nf),jl=function(){function e(){}return e.value=new e,e}(),Cs=function(){function e(){}return e.value=new e,e}(),Nl=function(){function e(){}return e.value=new e,e}(),SI={to:function(e){if(e instanceof vt)return jl.value;if(e instanceof Ze&&e.value0 instanceof vt)return Cs.value;if(e instanceof Ze&&e.value0 instanceof Ze)return Nl.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 jl)return new vt(qt.value);if(e instanceof Cs)return new Ze(new vt(qt.value));if(e instanceof Nl)return new Ze(new Ze(qt.value));throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 18, column 1 - line 18, column 33): "+[e.constructor.name])}};var MI=function(e){if(e instanceof jl)return"pending";if(e instanceof Cs)return"connected";if(e instanceof Nl)return"ignored";throw new Error("Failed pattern match at Sem.Connections.Types.Status (line 34, column 1 - line 34, column 30): "+[e.constructor.name])},tb=function(){var e=kr(MI)(ba(SI)(YR(YR(KR)(QR))(XR))(eb(eb(ZR)))(XR)),n=function(r){return r==="cold"?new H(Nl.value):G.value};return ir(ur)({parse:function(r){return xI(e(r))(n(r))},default:jl.value,diagnosticName:"Sem.Connections.Types.Status"})}();var nb=function(e){return{initiator:VR(e.initiator),status:tb(e.status),introMessage:zt("")(Pe(e.introMessage))}};var Fp=function(){function e(){}return e.value=new e,e}(),rb=function(){function e(){}return e.value=new e,e}();var ab=function(){var e=ir(ur)({parse:function(n){return n instanceof H&&n.value0==="paid"?new H(rb.value):n instanceof H&&n.value0==="free"?new H(Fp.value):n instanceof H&&n.value0==="churned"?new H(Fp.value):n instanceof G?new H(Fp.value):G.value},default:Fp.value,diagnosticName:"Sem.Types.PartnerStatus"});return function(n){return e(Pe(n))}}();var ob=function(e){return{allowedToContact:e.allowedToContact,id:e.id,name:e.name,imageUrl:Pe(e.imageUrl),partnerStatus:ab(e.partnerStatus)}};var AI=se(jt),fh=ui(),ws=jn(Oe),ib=Y({reflectSymbol:function(){return"id"}}),LI=_n(Fn)(jt),jI=ed(xm),NI=V(Se);var PI=Oe,OI=$i(fh(Y({reflectSymbol:function(){return"avatarUrl"}})(ws)(Y({reflectSymbol:function(){return"bio"}})(ws)(Y({reflectSymbol:function(){return"connection"}})(jn(fh(Y({reflectSymbol:function(){return"initiator"}})(Oe)(Y({reflectSymbol:function(){return"introMessage"}})(ws)(Y({reflectSymbol:function(){return"status"}})(Oe)(Ot))))))(Y({reflectSymbol:function(){return"firstName"}})(Oe)(ib(PI)(Y({reflectSymbol:function(){return"lastName"}})(Oe)(Y({reflectSymbol:function(){return"school"}})(fh(Y({reflectSymbol:function(){return"allowedToContact"}})(Kn)(ib(kR)(Y({reflectSymbol:function(){return"imageUrl"}})(ws)(Y({reflectSymbol:function(){return"name"}})(Oe)(Y({reflectSymbol:function(){return"partnerStatus"}})(ws)(Ot)))))))(Y({reflectSymbol:function(){return"title"}})(Oe)(Y({reflectSymbol:function(){return"type"}})(Oe)(Y({reflectSymbol:function(){return"unreadMessageCountFromSemUser"}})(rt)(Ot))))))))))));var ub=function(e){return AI(OI("SemUser")(e))(function(n){return LI(jI(n.type==="Sem::User"))(function(){return new H({school:ob(n.school),firstName:n.firstName,lastName:n.lastName,avatarUrl:Pe(n.avatarUrl),title:n.title,bio:Pe(n.bio),connection:NI(nb)(Pe(n.connection)),unreadMessageCountFromSemUser:n.unreadMessageCountFromSemUser,id:n.id})})})};var mb=function(){function e(){}return e.value=new e,e}(),_b=function(){function e(){}return e.value=new e,e}(),hb=function(){function e(){}return e.value=new e,e}();var n8=function(e){if(e instanceof mb)return"disabled";if(e instanceof _b)return"free-consultation";if(e instanceof hb)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 r8=function(){return[mb.value,_b.value,hb.value]}(),gb=Bi(ur)(Se)({parse:kr(n8)(r8),diagnosticName:"InquiryMode"});var x3e=new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short",maximumFractionDigits:2});var Mb=function(e){var n=V_(e);return function(){return function(){return n("button")}}};var Ib=function(e){var n=V_(e);return function(){return function(){return n("a")}}};function Ab(e){return function(n){return function(){return n.getElementById(e)}}}var K8=V(ut),wp=function(e){var n=K8(Pe),r=Ab(e);return function(i){return n(r(i))}};var xp=function(e){return function(n){return function(){return n[e]}}},Y8=xp("children"),Q8=xp("firstElementChild"),X8=xp("lastElementChild"),Z8=xp("childElementCount");var bo=function(){return window};function Lb(e,n,r,i){if(typeof window!="undefined"){var l=window[r];if(l!=null&&i instanceof l)return n(i)}for(var p=i;p!=null;){var T=Object.getPrototypeOf(p),d=T.constructor.name;if(d===r)return n(i);if(d==="Object")return e;p=T}return e}var ke=function(e){return function(n){return Lb(G.value,H.create,e,n)}};var Sp=ge;function jb(e,n,r){var i=Object.prototype.toString.call(r);return i.indexOf("[object HTML")===0&&i.indexOf("Element]")===i.length-8?n(r):e}var Nb=function(e){return jb(G.value,H.create,e)};function Mp(e){return function(){return e.currentTime}}function Th(e){return function(){return e.volume}}function Eh(e){return function(n){return function(){n.volume=e}}}function Fh(e){return function(){return e.muted}}function wu(e){return function(n){return function(){n.muted=e}}}var Pb=ke("HTMLMediaElement");var Ob=ke("HTMLMediaElement");function Ch(e){return function(n){return function(){n.href=e}}}function wh(e){return function(){return e.platform}}function js(e){return function(){return e.document}}function xh(e){return function(){return e.navigator}}function Sh(e){return function(){return e.location}}function Ip(e){return function(){return e.localStorage}}var nA=xc(An)(Yf),Wb=se(ua),Hb=gt(ut),rA=se(jt);var Mh=At(Rt(hr));var Bb=function(e){return function(n){if(e)return n(Re);if(Ve)return hr;throw new Error("Failed pattern match at Utils.HTML (line 98, column 1 - line 98, column 61): "+[e.constructor.name,n.constructor.name])}},Ji=function(e){return function(n){return Bb(e)(He(n))}};var Lp=function(e){return nA(Ob(e.target))(Mp)};var aA=function(e){return Wb(Hb(Wb(bo)(js))(Sp))(wp(e))},$b=function(e){return Hb(aA(e))(function(n){return rA(n)(Nb)})};var Ns=rt;var Jb=({just:e,nothing:n})=>r=>{try{let i=new Date(r);return isNaN(i.getTime())?n:e(i)}catch{return n}},Gb=e=>({year:e.getFullYear(),month:e.getMonth(),day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),millisecond:e.getMilliseconds()});var iA=(()=>{let e=new Date;return typeof window!="undefined"?()=>e:()=>{let n=new Date;return n-e>1e3&&(e=n),e}})();var uA=(()=>{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 zb={liftAff:Me(je),MonadEffect0:function(){return yn}};var NXe=function(){function e(){this.head=null,this.last=null,this.size=0}function n(y,E){this.queue=y,this.value=E,this.next=null,this.prev=null}function r(y){this.draining=!1,this.error=null,this.value=y,this.takes=new e,this.reads=new e,this.puts=new e}var i={};function l(y){try{y()}catch(E){setTimeout(function(){throw E},0)}}function p(y,E){var M=new n(y,E);switch(y.size){case 0:y.head=M;break;case 1:M.prev=y.head,y.head.next=M,y.last=M;break;default:M.prev=y.last,y.last.next=M,y.last=M}return y.size++,M}function T(y){var E;switch(y.size){case 0:return null;case 1:E=y.head,y.head=null;break;case 2:E=y.last,y.head.next=null,y.last=null;break;default:E=y.last,y.last=E.prev,y.last.next=null}return E.prev=null,E.queue=null,y.size--,E.value}function d(y){var E;switch(y.size){case 0:return null;case 1:E=y.head,y.head=null;break;case 2:E=y.head,y.last.prev=null,y.head=y.last,y.last=null;break;default:E=y.head,y.head=E.next,y.head.prev=null}return E.next=null,E.queue=null,y.size--,E.value}function h(y){if(y.queue!==null){if(y.queue.last===y){T(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 P(y,E){if(!E.draining){var M=E.puts,C=E.takes,S=E.reads,O,B,Q,z,Z;for(E.draining=!0;;){if(O=null,B=null,Q=null,z=E.value,Z=S.size,E.error!==null){for(z=y.left(E.error);O=d(M);)l(O.cb(z));for(;B=d(S);)l(B(z));for(;Q=d(C);)l(Q(z));break}if(z===i&&(O=d(M))&&(E.value=z=O.value),z!==i){for(Q=d(C);Z--&&(B=d(S));)l(B(y.right(z)));Q!==null&&(E.value=i,l(Q(y.right(z))))}if(O!==null&&l(O.cb(y.right(void 0))),E.value===i&&M.size===0||E.value!==i&&C.size===0)break}E.draining=!1}}return r.EMPTY=i,r.putLast=p,r.takeLast=T,r.takeHead=d,r.deleteCell=h,r.drainVar=P,r}();var Gi=se(jt),gA=ct(zr),DA=ct(ar),yA=ct(Da),RA=ct(Wa),bA=ct(Ua),TA=ct(Oa),EA=ct(ka),FA=oe(fr);var CA=gt(Se);var wA=function(e){return Gi(gA(e.year))(function(n){return Gi(DA(e.month+1|0))(function(r){return Gi(yA(e.day))(function(i){return Gi(RA(e.hour))(function(l){return Gi(bA(e.minute))(function(p){return Gi(TA(e.second))(function(T){return Gi(EA(e.millisecond))(function(d){return FA(new vo(wi(n)(r)(i),new Ao(l,p,T,d)))})})})})})})})};var mi=function(e){return Gi(CA(Jb({just:H.create,nothing:G.value})(e))(Gb))(wA)};var Ih=oe(fr),xA=V(Se),Kb=se(jt);var Yb=Ya(Ka),Qb=Va(Yb)(Ja($a)),Xb=qa(Ga),Zb=za(Xb),eT=Za(Xa),tT=Qa(eT);var Ah=function(){function e(){}return e.value=new e,e}(),Lh=function(){function e(){}return e.value=new e,e}(),jh=function(){function e(){}return e.value=new e,e}();var SA={to:function(e){if(e instanceof vt)return Ah.value;if(e instanceof Ze&&e.value0 instanceof vt)return Lh.value;if(e instanceof Ze&&e.value0 instanceof Ze)return jh.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 Ah)return new vt(qt.value);if(e instanceof Lh)return new Ze(new vt(qt.value));if(e instanceof jh)return new Ze(new Ze(qt.value));throw new Error("Failed pattern match at ServiceProviders.Retail.Advising.Types (line 174, column 1 - line 174, column 41): "+[e.constructor.name])}};var MA=function(e){if(e instanceof Ah)return"stuffed";if(e instanceof Lh)return"satisfied";if(e instanceof jh)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 IA=Bi(ur)(Se)({parse:kr(MA)(ba(SA)(Qb(Qb(Yb)(Xb))(Zb))(tT(tT(eT)))(Zb)),diagnosticName:"ClientAppetite"}),nT=function(e){return Kb(Rt(Ih(G.value))(function(){var n=xA(Ih);return function(r){return n(IA(r))}}())(Pe(e.clientAppetite)))(function(n){return Kb(gb(e.inquiryMode))(function(r){return Ih({packages:e.packages,pricePerHourCents:e.pricePerHourCents,singleSessionDurationMinutes:e.singleSessionDurationMinutes,singleSessionRefundPeriodLengthDays:e.singleSessionRefundPeriodLengthDays,themes:e.themes,freeConsultationDurationMinutes:Pe(e.freeConsultationDurationMinutes),canSubmitConsultInquiry:Pe(e.canSubmitConsultInquiry),clientAppetite:n,inquiryMode:r})})})};var rT=se(jt),Ol=ui(),Nh=jn(Oe),aT=Y({reflectSymbol:function(){return"description"}})(Oe),jp=Y({reflectSymbol:function(){return"id"}})(rt),Ph=Y({reflectSymbol:function(){return"name"}})(Oe),oT=Ol(jp(Ph(Y({reflectSymbol:function(){return"slug"}})(Oe)(Ot)))),iT=Or(oT),AA=$i(Ol(Y({reflectSymbol:function(){return"advisingConfig"}})(jn(Ol(Y({reflectSymbol:function(){return"canSubmitConsultInquiry"}})(jn(Kn))(Y({reflectSymbol:function(){return"clientAppetite"}})(Nh)(Y({reflectSymbol:function(){return"freeConsultationDurationMinutes"}})(jn(rt))(Y({reflectSymbol:function(){return"inquiryMode"}})(Oe)(Y({reflectSymbol:function(){return"packages"}})(Or(Ol(Y({reflectSymbol:function(){return"activeForSale"}})(Kn)(aT(jp(Ph(Y({reflectSymbol:function(){return"numMinutes"}})(rt)(Y({reflectSymbol:function(){return"packageCategories"}})(iT)(Y({reflectSymbol:function(){return"refundPeriodLengthDays"}})(rt)(Y({reflectSymbol:function(){return"totalPriceCents"}})(Ns)(Ot)))))))))))(Y({reflectSymbol:function(){return"pricePerHourCents"}})(Ns)(Y({reflectSymbol:function(){return"singleSessionDurationMinutes"}})(rt)(Y({reflectSymbol:function(){return"singleSessionRefundPeriodLengthDays"}})(rt)(Y({reflectSymbol:function(){return"themes"}})(Or(Ol(Y({reflectSymbol:function(){return"active"}})(Kn)(Y({reflectSymbol:function(){return"category"}})(oT)(aT(Y({reflectSymbol:function(){return"durationMinutes"}})(rt)(jp(Y({reflectSymbol:function(){return"priceCents"}})(Ns)(Y({reflectSymbol:function(){return"title"}})(Oe)(Ot))))))))))(Ot))))))))))))(Y({reflectSymbol:function(){return"entity"}})(Ol(Y({reflectSymbol:function(){return"bio"}})(Oe)(jp(Y({reflectSymbol:function(){return"imageUrl"}})(Nh)(Ph(Y({reflectSymbol:function(){return"organizationId"}})(rt)(Y({reflectSymbol:function(){return"organizationName"}})(Oe)(Y({reflectSymbol:function(){return"shortEducation"}})(Nh)(Y({reflectSymbol:function(){return"tags"}})(iT)(Ot))))))))))(Ot)))),Oh=oe(fr),Uh=V(Se),LA=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),jA=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),NA=function(e){return rT(AA("ServiceProviderPresenter")(e))(function(n){return rT(Rt(Oh(G.value))(function(){var r=Uh(Oh);return function(i){return r(nT(i))}}())(Pe(n.advisingConfig)))(function(r){return Oh({entity:n.entity,advisingConfig:r})})})},uT=Bi(ur)(Se)({parse:function(e){return e.type==="Sem::User"?Uh(LA.create)(ub(e.presenter)):e.type==="ServiceProviders::Individual"?Uh(jA.create)(NA(e.presenter)):G.value},diagnosticName:"Livestream Guest Presenter"});var lT=Ya(Ka),cT=Va(lT)(Ja($a)),sT=qa(Ga),fT=za(sT),dT=Za(Xa),pT=Qa(dT),Ps=function(){function e(){}return e.value=new e,e}(),Np=function(){function e(){}return e.value=new e,e}(),Pp=function(){function e(){}return e.value=new e,e}(),PA={to:function(e){if(e instanceof vt)return Ps.value;if(e instanceof Ze&&e.value0 instanceof vt)return Np.value;if(e instanceof Ze&&e.value0 instanceof Ze)return Pp.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 Ps)return new vt(qt.value);if(e instanceof Np)return new Ze(new vt(qt.value));if(e instanceof Pp)return new Ze(new Ze(qt.value));throw new Error("Failed pattern match at Livestream.Types.Poll (line 36, column 1 - line 36, column 37): "+[e.constructor.name])}};var kh=function(e){if(e instanceof Ps)return"ready";if(e instanceof Np)return"live";if(e instanceof Pp)return"closed";throw new Error("Failed pattern match at Livestream.Types.Poll (line 59, column 23 - line 62, column 21): "+[e.constructor.name])};var Op=function(){return ir(ur)({parse:kr(kh)(ba(PA)(cT(cT(lT)(sT))(fT))(pT(pT(dT)))(fT)),default:Ps.value,diagnosticName:"livestream poll status"})}(),Wh=function(e){return{id:e.id,question:e.question,multiSelect:e.multiSelect,options:e.options,autoDisplayMinutesFromStart:Pe(e.autoDisplayMinutesFromStart)}};var vT=function(e){return{fullName:e.fullName,firstName:e.firstName,totalStreams:e.totalStreams,undergrad:{college:Pe(e.undergrad.college),major:Pe(e.undergrad.major),year:Pe(e.undergrad.year)},gradCollege:Pe(e.gradCollege),workExperience:Pe(e.workExperience),admissionsStory:Pe(e.admissionsStory),pictureUrl:Pe(e.pictureUrl),allStreamsUrl:Pe(e.allStreamsUrl)}};var OA=gt(Se),mT=Ya(Ka),_T=Va(mT)(Ja($a)),hT=qa(Ga),gT=za(hT),DT=Za(Xa),yT=Qa(DT),RT=ir(ur),bT=nl(),TT=bn(jt),UA=gt(Lt),kA=V(Se),WA=se(jt),xu=function(){function e(){}return e.value=new e,e}(),Ul=function(){function e(){}return e.value=new e,e}(),kl=function(){function e(){}return e.value=new e,e}();var ET=Zt;var HA={to:function(e){if(e instanceof vt)return xu.value;if(e instanceof Ze&&e.value0 instanceof vt)return Ul.value;if(e instanceof Ze&&e.value0 instanceof Ze)return kl.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 xu)return new vt(qt.value);if(e instanceof Ul)return new Ze(new vt(qt.value));if(e instanceof kl)return new Ze(new Ze(qt.value));throw new Error("Failed pattern match at Livestream.Types.Conference (line 167, column 1 - line 167, column 39): "+[e.constructor.name])}};var FT=function(){var e=function(n){if(n instanceof xu)return"waiting_room";if(n instanceof Ul)return"on_air";if(n instanceof kl)return"complete";throw new Error("Failed pattern match at Livestream.Types.Conference (line 180, column 17 - line 183, column 35): "+[n.constructor.name])};return kr(e)(ba(HA)(_T(_T(mT)(hT))(gT))(yT(yT(DT)))(gT))}(),CT=function(){return RT({parse:FT,default:xu.value,diagnosticName:"livestream status"})}(),BA=RT({parse:mi,default:Gt(_d),diagnosticName:"livestream scheduled start time"}),Up=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:OA(Pe(e.school))(function(n){return{cityState:n.cityState,name:n.name,id:bT(n.id),slug:bT(n.slug)}}),scheduledStartTime:BA(e.scheduledStartTime),onAirTime:TT(mi)(Pe(e.onAirTime)),streamStatus:CT(e.streamStatus),watchUrl:Pe(e.watchUrl),streamingStartTime:TT(mi)(Pe(e.streamingStartTime)),polls:UA(e.polls)(function(n){return{poll:Wh(n.poll),status:Op(n.status)}}),presenter:kA(vT)(Pe(e.presenter)),partnerType:Pe(e.partnerType),guestPresenter:WA(Pe(e.guestPresenter))(uT),zoomJoinUrl:Pe(e.zoomJoinUrl),zoomStartUrl:Pe(e.zoomStartUrl)}};var $A=typeof CV!="undefined"&&CV.pathInfo||typeof global!="undefined"&&global.CV&&global.CV.pathInfo||(e=>null);function wT(e,n){let r=typeof CV!="undefined"&&CV.apiEndpoint||typeof global!="undefined"&&global.CV&&global.CV.apiEndpoint;return r||console.error("Missing `CV.apiEndpoint` function"),r&&r(e,n)}function xT(e,n,r,i,l){return function(p,T){var d=e.newXHR(),h=e.fixupUrl(l.url,d);if(d.open(l.method||"GET",h,!0,l.username,l.password),l.headers)try{for(var P=0,y;(y=l.headers[P])!=null;P++)d.setRequestHeader(y.field,y.value)}catch(M){p(M)}var E=function(M){return function(){p(new Error(M))}};return d.onerror=E(r),d.ontimeout=E(n),d.onload=function(){T({status:d.status,statusText:d.statusText,headers:d.getAllResponseHeaders().split(`\r `).filter(function(M){return M.length>0}).map(function(M){var C=M.indexOf(":");return i(M.substring(0,C))(M.substring(C+2))}),body:d.response})},d.responseType=l.responseType,d.withCredentials=l.withCredentials,d.timeout=l.timeout,d.send(l.content),function(M,C,S){try{d.abort()}catch(O){return C(O)}return S()}}}var kp="application/json",ST="application/x-www-form-urlencoded";var MT=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),IT=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),AT=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),LT=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),jT=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Hh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Wp=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),NT=function(e){return e instanceof Hh?new H(ST):e instanceof Wp?new H(kp):G.value};var PT=function(){return Wp.create}();var OT=Dn();var Hp=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Bp=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Wl=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}(),UT=function(e){if(e instanceof Hp||e instanceof Bp)return OT(e.value0);if(e instanceof Wl)return e.value1;throw new Error("Failed pattern match at Affjax.RequestHeader (line 26, column 1 - line 26, column 33): "+[e.constructor.name])};var Bh=function(e){if(e instanceof Hp)return"Accept";if(e instanceof Bp)return"Content-Type";if(e instanceof Wl)return e.value0;throw new Error("Failed pattern match at Affjax.RequestHeader (line 21, column 1 - line 21, column 32): "+[e.constructor.name])};var kT=Me(je),$h=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Jh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Gh=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),$p=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Jp=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Gp=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),WT=function(e){if(e instanceof $h)return"arraybuffer";if(e instanceof Jh)return"blob";if(e instanceof Gh)return"document";if(e instanceof $p||e instanceof Jp)return"text";if(e instanceof Gp)return"";throw new Error("Failed pattern match at Affjax.ResponseFormat (line 44, column 3 - line 50, column 19): "+[e.constructor.name])},HT=function(e){return e instanceof $p?new H(kp):G.value},BT=function(){return new Jp(kT)}();var $T=function(){return new Gp(kT)}();var JT=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 GA=Dn();var Os=function(e){return GA(Dd(e))};function GT(e,n,r){try{return n(JSON.parse(r))}catch(i){return e(i.message)}}var qp=function(e){return GT(ye.create,be.create,e)};function qA(e){return e.replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16)})}function qT(e,n,r){try{return n(qA(encodeURIComponent(r)).replace(/%20/g,"+"))}catch(i){return e(i)}}var zp=function(){return Gf(qT)(He(G.value))(H.create)}();var VA=tt(Gr),zT=V(Se),KA=Er(ri)(fr);var YA=function(e){return e};var VT=function(){var e=function(i){if(i.value1 instanceof G)return zp(i.value0);if(i.value1 instanceof H)return VA(zT(function(l){return function(p){return l+("="+p)}})(zp(i.value0)))(zp(i.value1.value0));throw new Error("Failed pattern match at Data.FormURLEncoded (line 37, column 16 - line 39, column 114): "+[i.constructor.name])},n=zT(Ro("&")),r=KA(e);return function(i){return n(r(YA(i)))}}();var zh=function(){function e(){}return e.value=new e,e}(),Su=function(){function e(){}return e.value=new e,e}(),Vh=function(){function e(){}return e.value=new e,e}(),Hl=function(){function e(){}return e.value=new e,e}(),Vp=function(){function e(){}return e.value=new e,e}(),Us=function(){function e(){}return e.value=new e,e}(),Kh=function(){function e(){}return e.value=new e,e}(),Yh=function(){function e(){}return e.value=new e,e}(),Qh=function(){function e(){}return e.value=new e,e}(),Xh=function(){function e(){}return e.value=new e,e}(),Zh=function(){function e(){}return e.value=new e,e}(),eg=function(){function e(){}return e.value=new e,e}(),tg=function(){function e(){}return e.value=new e,e}(),ng=function(){function e(){}return e.value=new e,e}(),rg=function(){function e(){}return e.value=new e,e}(),Kp=function(){function e(){}return e.value=new e,e}();var QA=function(e){return e},XA={show:function(e){if(e instanceof zh)return"OPTIONS";if(e instanceof Su)return"GET";if(e instanceof Vh)return"HEAD";if(e instanceof Hl)return"POST";if(e instanceof Vp)return"PUT";if(e instanceof Us)return"DELETE";if(e instanceof Kh)return"TRACE";if(e instanceof Yh)return"CONNECT";if(e instanceof Qh)return"PROPFIND";if(e instanceof Xh)return"PROPPATCH";if(e instanceof Zh)return"MKCOL";if(e instanceof eg)return"COPY";if(e instanceof tg)return"MOVE";if(e instanceof ng)return"LOCK";if(e instanceof rg)return"UNLOCK";if(e instanceof Kp)return"PATCH";throw new Error("Failed pattern match at Data.HTTP.Method (line 43, column 1 - line 59, column 23): "+[e.constructor.name])}};var KT=gn(he(XA))(QA);var YT={eq:function(e){return function(n){return e instanceof zh&&n instanceof zh||e instanceof Su&&n instanceof Su||e instanceof Vh&&n instanceof Vh||e instanceof Hl&&n instanceof Hl||e instanceof Vp&&n instanceof Vp||e instanceof Us&&n instanceof Us||e instanceof Kh&&n instanceof Kh||e instanceof Yh&&n instanceof Yh||e instanceof Qh&&n instanceof Qh||e instanceof Xh&&n instanceof Xh||e instanceof Zh&&n instanceof Zh||e instanceof eg&&n instanceof eg||e instanceof tg&&n instanceof tg||e instanceof ng&&n instanceof ng||e instanceof rg&&n instanceof rg||e instanceof Kp&&n instanceof Kp}}};var QT=function(e){return xi(function(n){return function(){var i=e(function(l){return n(ye.create(l))()},function(l){return n(be.create(l))()});return function(l){return xi(function(p){return function(){return i(l,function(d){return p(ye.create(d))()},function(d){return p(be.create(d))()}),o_}})}}})};var ag=oe(Lo(kn)),ZA=ts(kn),Mu=Tl(kn),XT=tn(bd(Od)(kn)),e7=hi(hl(kn)),Yp=V(Se),t7=la(mt)(nr),n7=Le(Ir),r7=bn(jt),a7=V(Lt),o7=gt(_o),i7=pl(Jc),u7=oe(Kr);var Qp=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Xp=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}(),Zp=function(){function e(){}return e.value=new e,e}(),ev=function(){function e(){}return e.value=new e,e}(),tv=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),ZT=function(e){return function(n){var r=function(y){return y===""?ag(sR):gn(function(E){return ZA(Zc.create(E))})(ag)(qp(y))},i=function(){if(n.responseFormat instanceof $h)return Mu("ArrayBuffer");if(n.responseFormat instanceof Jh)return Mu("Blob");if(n.responseFormat instanceof Gh)return function(y){return XT(Mu("Document")(y))(XT(Mu("XMLDocument")(y))(Mu("HTMLDocument")(y)))};if(n.responseFormat instanceof $p)return e7(function(y){return n.responseFormat.value0(r(y))})(Mu("String"));if(n.responseFormat instanceof Jp)return Mu("String");if(n.responseFormat instanceof Gp)return He(n.responseFormat.value0(ag(Re)));throw new Error("Failed pattern match at Affjax (line 274, column 18 - line 283, column 57): "+[n.responseFormat.constructor.name])}(),l=function(y){if(y instanceof MT)return new be(y.value0(Pr));if(y instanceof IT)return new be(Pr(y.value0));if(y instanceof AT)return new be(Pr(y.value0));if(y instanceof LT)return new be(Pr(y.value0));if(y instanceof jT)return new be(Pr(y.value0));if(y instanceof Hh)return Co("Body contains values that cannot be encoded as application/x-www-form-urlencoded")(Yp(Pr)(VT(y.value0)));if(y instanceof Wp)return new be(Pr(dp(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(E){return y instanceof H&&!t7(pc(n7)(Bh)(y.value0))(E)?Sc(E)(y.value0):E}},T=function(y){return p(Yp(Bp.create)(r7(NT)(y)))(p(Yp(Hp.create)(HT(n.responseFormat)))(n.headers))},d=function(y){return{method:KT(n.method),url:n.url,headers:a7(function(E){return{field:Bh(E),value:UT(E)}})(T(n.content)),content:y,responseType:WT(n.responseFormat),username:Po(n.username),password:Po(n.password),withCredentials:n.withCredentials,timeout:zt(0)(Yp(function(E){return E})(n.timeout))}},h=function(y){return o7(i7(QT(xT(e,"AffjaxTimeoutErrorMessageIdent","AffjaxRequestFailedMessageIdent",JT.create,d(y)))))(function(E){if(E instanceof be){var M=Os(i(E.value0.body));if(M instanceof ye)return new ye(new Xp(F0(M.value0),E.value0));if(M instanceof be)return new be({headers:E.value0.headers,status:E.value0.status,statusText:E.value0.statusText,body:M.value0});throw new Error("Failed pattern match at Affjax (line 209, column 9 - line 211, column 52): "+[M.constructor.name])}if(E instanceof ye)return new ye(function(){var C=dl(E.value0),S=C==="AffjaxTimeoutErrorMessageIdent";if(S)return Zp.value;var O=C==="AffjaxRequestFailedMessageIdent";return O?ev.value:new tv(E.value0)}());throw new Error("Failed pattern match at Affjax (line 207, column 144 - line 219, column 28): "+[E.constructor.name])})};if(n.content instanceof G)return h(Po(G.value));if(n.content instanceof H){var P=l(n.content.value0);if(P instanceof be)return h(Po(new H(P.value0)));if(P instanceof ye)return u7(new ye(new Qp(P.value0)));throw new Error("Failed pattern match at Affjax (line 199, column 7 - line 203, column 48): "+[P.constructor.name])}throw new Error("Failed pattern match at Affjax (line 195, column 3 - line 203, column 48): "+[n.content.constructor.name])}};var Bl=function(){return{method:new ye(Su.value),url:"/",headers:[],content:G.value,username:G.value,password:G.value,withCredentials:!1,responseFormat:$T,timeout:G.value}}();var eE={eq:function(e){return function(n){return e===n}}};var og={newXHR:function(){return new XMLHttpRequest},fixupUrl:function(e){return e||"/"}};var tE=ZT(og);function bE(e){return Buffer.from(e).toString("base64")}function TE(e,n,r){let i;try{i=n(btoa(r))}catch(l){i=e(l)}return i}var cg=typeof btoa=="function";function EE(e){let n=32768,r=[];for(let i=0;i{let e=null,n=0,r=()=>{if(!Ho||!Ho.key)return Ho||console.error("Pusher config is missing in global context"),new V7;let i={auth:{headers:{"X-CSRF-Token":Ho.authToken}},authEndpoint:Ho.authPath,cluster:Ho.cluster};return Ho.dev&&Object.assign(i,{wsHost:Ho.dev.wsHost,wsPort:Ho.dev.wsPort,enabledTransports:["ws"],forceTLS:!1,disableStats:!0}),new $E.default(Ho.key,i)};return{acquireConnection:()=>(e||(e=r(),n=0),n++,e),releaseConnection:()=>{--n<=0&&(e&&e.disconnect(),e=null)}}})(),JE=e=>{let n=q7().subscribe(e.channel);return n.bind(e.event,e.handler),()=>{n.unbind(e.event,e.handler),z7()}};function V7(){typeof document!="undefined"&&(document.mockPusher=this),this.localObject={},this.channels=[],this.disconnect=function(){document.mockPusher=null},this.subscribe=function(e){let n=this.channels.find(i=>i.name===e);if(n)return n;let r=new K7(e);return this.channels.push(r),r},this.channelNames=function(){return this.channels.map(e=>e.name)}}function K7(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 av=function(e){return function(){console.error(e)}};var ZE=function(e){var n=Mt(e);return function(r){return n(av(r))}};var cL=oe(An),eF=se(ua),sL=V(ut),fL=ZE(vl),fg=function(e){var n=function(i){var l=e(i);return J_(l.view(l.init.value0)(He(cL(Re))))},r=function(i){return function(l){return function(p){return function(){var d=eF(eF(bo)(function(){var P=sL(Sp);return function(y){return P(js(y))}}()))(wp(l))();if(d instanceof G)return fL("Element #"+(l+" not found"))();if(d instanceof H){var h=G_(e(p))();return i(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(By),renderToString:n,hydrate:r($y)}};oi();var _L=class extends Hn.Component{componentDidUpdate(n){this.props.componentDidUpdate(n.deps)}render(){return this.props.children}};var pg=typeof CV!="undefined"&&CV.assetsRoot||typeof global!="undefined"&&global.CV&&global.CV.assetsRoot||"/";var lF=oe(Ra),bL=ir(bp),TL=se(ia);var EL={init:lF(Re),update:function(e){return function(n){return lF(Re)}},view:function(e){return function(n){return hr}}},vg=function(e){var n=ji(e);return function(r){return fg(bL({parse:function(i){return TL(n(i))(function(l){return Rt(new ye("Component construction failed"))(be.create)(r.def(l))})},diagnosticName:"Props for "+r.diagnosticName,default:EL}))}};var Sn=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),En=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}();var jL=Mo(mt)(xo),NL=yi(An)(uu);var PL={show:function(e){return e}},OL=he(PL);var Dg=Oe;var UL=function(e){var n=$i(e);return function(r){return function(i){return function(l){var p=jL(["Pusher event ",i," over channel ",OL(r)]),T=function(d){return NL(n(p)(d))(l)()};return function(){return JE({channel:r,event:i,handler:T})}}}}},CF=function(e){var n=UL(e);return function(r){var i=r.Monad0(),l=se(i.Bind1()),p=Mt(r),T=oe(i.Applicative0());return function(d){return function(h){return function(P){return l(p(n(d)(h)(P)))(function(y){return T(p(y))})}}}}};var kL=kE(NE),WL=HE(kL),HL=se(or);var BL=gt(Se),To=ui();var $L=Y({reflectSymbol:function(){return"status"}})(Oe)(Ot);var wF=Y({reflectSymbol:function(){return"id"}}),xF=wF(rt);var JL=gt(_o),GL=Y({reflectSymbol:function(){return"description"}}),SF=Y({reflectSymbol:function(){return"presenter"}}),Qr=jn(Oe),qL=Y({reflectSymbol:function(){return"autoDisplayMinutesFromStart"}})(jn(rt)),zL=To(qL(xF(Y({reflectSymbol:function(){return"multiSelect"}})(Kn)(Y({reflectSymbol:function(){return"options"}})(Or(Oe))(Y({reflectSymbol:function(){return"question"}})(Oe)(Ot)))))),VL=Y({reflectSymbol:function(){return"name"}})(Oe),KL=Y({reflectSymbol:function(){return"title"}})(Oe),YL=Y({reflectSymbol:function(){return"url"}})(Oe),QL=PE(jn(To(Y({reflectSymbol:function(){return"pusher"}})(To(Y({reflectSymbol:function(){return"dataChannel"}})(Dg)(Y({reflectSymbol:function(){return"presenceChannel"}})(Dg)(Ot))))(Y({reflectSymbol:function(){return"stream"}})(To(Y({reflectSymbol:function(){return"collegeFair"}})(Kn)(GL(Oe)(Y({reflectSymbol:function(){return"duration"}})(rt)(Y({reflectSymbol:function(){return"guestPresenter"}})(jn(To(SF(ns)(Y({reflectSymbol:function(){return"type"}})(Oe)(Ot)))))(xF(Y({reflectSymbol:function(){return"imageUrl"}})(Oe)(Y({reflectSymbol:function(){return"isPrivate"}})(Kn)(Y({reflectSymbol:function(){return"legacyRecording"}})(Kn)(Y({reflectSymbol:function(){return"onAirTime"}})(Qr)(Y({reflectSymbol:function(){return"partnerType"}})(Qr)(Y({reflectSymbol:function(){return"polls"}})(Or(To(Y({reflectSymbol:function(){return"poll"}})(zL)($L))))(SF(jn(To(Y({reflectSymbol:function(){return"admissionsStory"}})(Qr)(Y({reflectSymbol:function(){return"allStreamsUrl"}})(Qr)(Y({reflectSymbol:function(){return"firstName"}})(Oe)(Y({reflectSymbol:function(){return"fullName"}})(Oe)(Y({reflectSymbol:function(){return"gradCollege"}})(Qr)(Y({reflectSymbol:function(){return"pictureUrl"}})(Qr)(Y({reflectSymbol:function(){return"totalStreams"}})(rt)(Y({reflectSymbol:function(){return"undergrad"}})(To(Y({reflectSymbol:function(){return"college"}})(Qr)(Y({reflectSymbol:function(){return"major"}})(Qr)(Y({reflectSymbol:function(){return"year"}})(Qr)(Ot)))))(Y({reflectSymbol:function(){return"workExperience"}})(Qr)(Ot))))))))))))(Y({reflectSymbol:function(){return"scheduledStartTime"}})(Oe)(Y({reflectSymbol:function(){return"school"}})(jn(To(Y({reflectSymbol:function(){return"cityState"}})(Oe)(wF(Oe)(VL(Y({reflectSymbol:function(){return"slug"}})(Oe)(Ot)))))))(Y({reflectSymbol:function(){return"stats"}})(To(Y({reflectSymbol:function(){return"parentAttendances"}})(rt)(Y({reflectSymbol:function(){return"parentRecordingWatchers"}})(rt)(Y({reflectSymbol:function(){return"parentRegistrations"}})(rt)(Y({reflectSymbol:function(){return"registrationsBySource"}})(Or(To(Y({reflectSymbol:function(){return"parentCount"}})(rt)(Y({reflectSymbol:function(){return"source"}})(Oe)(Y({reflectSymbol:function(){return"studentCount"}})(rt)(Ot))))))(Y({reflectSymbol:function(){return"studentAttendances"}})(rt)(Y({reflectSymbol:function(){return"studentRecordingWatchers"}})(rt)(Y({reflectSymbol:function(){return"studentRegistrations"}})(rt)(Y({reflectSymbol:function(){return"totalAttendances"}})(rt)(Y({reflectSymbol:function(){return"totalRecordingWatchers"}})(rt)(Y({reflectSymbol:function(){return"totalRegistrations"}})(rt)(Ot))))))))))))(Y({reflectSymbol:function(){return"streamStatus"}})(Oe)(Y({reflectSymbol:function(){return"streamingStartTime"}})(Qr)(Y({reflectSymbol:function(){return"tailTime"}})(rt)(KL(Y({reflectSymbol:function(){return"uid"}})(Oe)(YL(Y({reflectSymbol:function(){return"watchUrl"}})(Qr)(Y({reflectSymbol:function(){return"zoomJoinUrl"}})(Qr)(Y({reflectSymbol:function(){return"zoomStartUrl"}})(Qr)(Ot))))))))))))))))))))))))))(Ot)))));var MF=WL("livestreams_live_promo_stream_path")(function(e){return function(n){return HL(e({}))(OE(function(r){return JL(QL("Livestream Mini-Promo")(r))(function(i){return BL(Pe(i))(function(l){return{pusher:l.pusher,stream:Up(l.stream)}})})}))}});var uv=e=>e.play();var qi=xf(IF());oi();var AF=e=>{let[n,r]=Hn.useState(),[i,l]=Hn.useState(),p=Hn.useRef();return p.current=e,u_(()=>{if(!i)return qi.default.isSupported()?r(XL(e.videoStreamUrl,e.videoElementId,p)):e.onNotSupported(),l(!0),()=>{n&&n.destroy()}}),null},XL=(e,n,r)=>{let i=document.getElementById(n);return i?(hls=new qi.default,r.current.onInstanceCreated&&r.current.onInstanceCreated(hls),hls.on(qi.default.Events.ERROR,function(l,p){if(r.current.onError&&r.current.onError("HLS error: "+p.type,p),p.fatal)switch(p.type){case qi.default.ErrorTypes.MEDIA_ERROR:hls.recoverMediaError();break;default:hls.destroy(),r.current.onCriticalFail&&r.current.onCriticalFail(p.type);break}}),hls.on(qi.default.Events.MEDIA_ATTACHED,()=>hls.loadSource(e)),hls.on(qi.default.Events.MANIFEST_PARSED,()=>r.current.onReady&&r.current.onReady()),hls.on(qi.default.Events.INIT_PTS_FOUND,(l,p)=>r.current.onInitialPts&&r.current.onInitialPts({initPTS:p.initPTS})),hls.attachMedia(i),hls):(r.current.onCriticalFail&&r.current.onCriticalFail("Couldn't find element #"+n),null)};var ZL=Tu();var LF=function(){return function(){return ZL(AF)}};oi();var Eo={PRIMARY:"#008CFD",SECONDARY:"#6E84A3",WHITE:"#FFF",GRAY_300:"#E3EBF6"};var $s=xf(WF()),HF=4,M6=({trackColor:e,background:n})=>({props:r,children:i})=>Hn.createElement("div",Object.assign({},r,{style:Object.assign({},r.style,{height:`${HF}px`,borderRadius:`${HF*2}px`,background:n||e})}),...i),I6=({horizontal:e})=>({props:n,isDragged:r})=>Hn.createElement("svg",Object.assign({},n,{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18"}),Hn.createElement("circle",{cx:"9",cy:"9",r:"8.5",fill:r?Eo.SECONDARY:Eo.WHITE,stroke:Eo.SECONDARY}),Hn.createElement("path",{stroke:r?Eo.WHITE:Eo.SECONDARY,d:e?"M7.5 6L7.5 12":"M6 7.5L12 7.5"}),Hn.createElement("path",{stroke:r?Eo.WHITE:Eo.SECONDARY,d:e?"M10.5 6L10.5 12":"M6 10.5L12 10.5"})),BF=e=>Hn.createElement("div",{"aria-label":e.ariaLabel},Hn.createElement($s.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:M6({trackColor:e.trackColor||Eo.GRAY_300,background:e.fillBefore?(0,$s.getTrackBackground)({values:[e.value],colors:[Eo.PRIMARY,Eo.GRAY_300],min:e.min,max:e.max,"aria-valuemax":e.max,"aria-valuemin":e.min,"aria-valuenow":e.value}):void 0}),renderThumb:I6({horizontal:!0})}));var A6=Tu(),$F={CanPassToJavaScript0:function(){},CanReceiveFromJavaScript1:function(){return D_}};var JF=function(e){return function(){return function(){return A6(BF)}}};var GF=ip()(),JN=function(e){return e},fv=Pr(us),dv=function(e){var n=Mb(e)()();return function(){return function(){return function(r){return function(i){return function(l){return function(p){return n(GF(l)({className:r,"aria-label":i}))(p)}}}}}}};var qF=function(e){return JN(Pr(e))},zF=function(e){var n=Ib(e)()();return function(){return function(){return function(r){return function(i){return function(l){return function(p){return n(GF(l)({className:r,"aria-label":i}))(p)}}}}}}};var GN=Wo(Uo)()(),qN=JF($F)()(),zN=di(rp),VN=dv(Uo)()(),KN=di(Il),VF=yo(si),YN=ms(Do),pv=ki(yn),Tg=oe(Kr),KF=_n(Fn),QN=Gt(_d),Bo=oe(Ra),XN=Ui(yn),Eg=Mt(yn),ZN=V(Se),eP=AD(ud),tP=KF(or),zi=KF(fi),nP=na(Ra),rP=se(or),aP=Lf(Wc),oP=na(An),Fg=function(){function e(){}return e.value=new e,e}(),Cg=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),wg=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),YF=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),xg=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),QF=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),XF=function(){function e(){}return e.value=new e,e}(),iP=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),ZF=function(e){return function(n){if(e.videoState instanceof G)return hr;if(e.videoState instanceof H){var r=GN("")({style:pi({minWidth:"6rem",width:"6rem"})})(qN({value:function(){return e.videoState.value0.muted?0:e.videoState.value0.volume}(),min:0,max:1,step:.05,onChange:zN(n)(function(T){return Sn.create(Cg.create(T))}),ariaLabel:"Volume slider"})),i=function(){if(e.videoState.value0.muted)return"fe-volume-x";if(Ve)return"fe-volume-2";throw new Error("Failed pattern match at Livestream.VideoPlayer.CustomControls (line 119, column 5 - line 121, column 34): "+[])}(),l=VN("btn large px-3 py-1 mr-3 text-white fe "+i)(qF("Mute the video"))({onClick:KN(n)(new Sn(Fg.value))})(hr),p=VF("d-flex align-items-center text-white px-3")([bu("LIVE"),YN("text-danger x-large ml-2 mt-n1")("\u25CF")]);return VF("mb-2 w-100 d-flex align-items-center bg-semi-transparent-black "+function(){return e.visible?"":"hidden"}())([Ji(e.config.liveIndicator)(p),Ji(e.config.mute)(l),Ji(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])}},eC=function(e){return Sn.create(wg.create(e))},tC=function(e){return pv(Tg(new En(new iP(function(n){return function(){return e(n)(),new Sn(new wg(n))}}))))},vv=function(){return new Sn(new xg(!0))}(),nC=function(e){return{config:e,videoState:G.value,visible:!1,visibilityExpiration:QN}},rC=2e3,aC=function(e){return function(n){if(n instanceof En)return Bo(e);if(n instanceof Sn){var r=XN(Eg(function(){var T=Gc();return ZN(function(d){return Sn.create(QF.create(d))})(eP(rC)(T))})),i=tP(No(rC))(function(){return Tg(new Sn(XF.value))}),l=function(p){if(n.value0 instanceof Fg)return Bo(e);var T=function(d){if(n.value0 instanceof Cg)return Bo(e);if(n.value0 instanceof wg)return zi(pv(Eg(function(){var P=Fh(n.value0.value0)(),y=Th(n.value0.value0)();return new Sn(new YF({muted:P,volume:y}))})))(function(){return Bo(e)});if(n.value0 instanceof YF)return Bo({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new H(n.value0.value0)});if(n.value0 instanceof xg)return zi(nP(n.value0.value0)(r))(function(){return zi(pv(i))(function(){return Bo({config:e.config,videoState:e.videoState,visibilityExpiration:e.visibilityExpiration,visible:n.value0.value0})})});if(n.value0 instanceof QF)return Bo({config:e.config,videoState:e.videoState,visible:e.visible,visibilityExpiration:n.value0.value0});if(n.value0 instanceof XF)return zi(pv(rP(Eg(Gc))(function(h){var P=aP(h)(e.visibilityExpiration);return P?Tg(new Sn(new xg(!1))):i})))(function(){return Bo(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 Cg&&e.videoState instanceof H?zi(r)(function(){return zi(tC(function(d){return function(){return oP(n.value0.value0>0)(wu(!1)(d))(),Eh(n.value0.value0)(d)()}}))(function(){return Bo({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new H({muted:e.videoState.value0.muted,volume:n.value0.value0})})})}):T(!0)};return n.value0 instanceof Fg&&e.videoState instanceof H?zi(r)(function(){return zi(tC(wu(!e.videoState.value0.muted)))(function(){return Bo({config:e.config,visibilityExpiration:e.visibilityExpiration,visible:e.visible,videoState:new H({volume:e.videoState.value0.volume,muted:!e.videoState.value0.muted})})})}):l(!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])}},oC=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 iC=e=>n=>r=>()=>e.then(r,n),uC=e=>e instanceof Error,lC=e=>e===null?"null":typeof e=="undefined"?"undefined":e.toString();var uP=oe(Lo(kn)),lP=ts(kn),cP=Me(je),cC=tn(bd(Od)(kn)),sP=Tl(kn),fP=V(Bc(ei)),dP=I0(kn),pP=Sf(ut),vP=St(o0);var mP=function(e){var n=function(r){if(uC(r))return uP(r);if(Ve)return lP(new Zc(""));throw new Error("Failed pattern match at Utils.Promise (line 49, column 5 - line 51, column 43): "+[r.constructor.name])};return gn(function(r){return Vr("Promise failed: "+lC(e))})(cP)(Os(cC(n(e))(cC(sP("Error")(e))(fP(Vr)(dP(e))))))},mv=function(e){return xi(function(n){return pP(vP)(iC(e)(function(r){return n(ye.create(mP(r)))()})(function(r){return n(be.create(r))()}))})};function sC(e,n){typeof CV!="undefined"&&CV.tracking&&CV.tracking.event(e,n)}var _P=$d();var hP=function(e){var n=Mt(e);return function(r){return function(i){return n(function(){return sC(r,i)})}}},fC=function(e){var n=hP(e);return function(){return function(r){return function(i){return n(r)(_P(i))}}}};var gP=se(jt),DP=yo(Uo),Sg=ap(rR),Js=se(ua),Mg=ni(An)(uu),Lu=di(Il),dC=lp(Do)()(),yP=LF()();var pC=di(rp),vC=Wo(Uo)()(),RP=dv(si)()(),bP=cp(Do),TP=yo(si),mC=_n(Fn),EP=fC(yn)(),FP=la(mt)(nr),CP=Le(uo(yr)),Gl=mC(or),wP=Qo(Kr),xP=Ln(yl),Qn=oe(Kr),_C=Mt(yn),hC=Cr(Jc),gC=vc(or),Vn=oe(Ra),Xn=mC(fi),Wr=ki(yn),DC=V(_o),yC=Ui(yn),SP=V(ut),MP=Nr(np(_o)),IP=V(Se);var RC=function(){function e(){}return e.value=new e,e}(),bC=function(){function e(){}return e.value=new e,e}(),Gs=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),TC=function(){function e(){}return e.value=new e,e}(),ql=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),EC=function(){function e(){}return e.value=new e,e}(),FC=function(){function e(){}return e.value=new e,e}(),CC=function(){function e(){}return e.value=new e,e}(),Ig=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),Ag=function(){function e(){}return e.value=new e,e}(),_v=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),hv=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),gv=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),wC=function(){function e(){}return e.value=new e,e}(),Lg=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),jg=function(){function e(){}return e.value=new e,e}(),xC=function(){function e(){}return e.value=new e,e}(),SC=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),ju=function(){function e(){}return e.value=new e,e}(),$o=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),MC=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}(),zl=function(){function e(n){this.value0=n}return e.create=function(n){return new e(n)},e}(),IC=function(e){var n=e.Monad0(),r=se(n.Bind1()),i=Mt(e),l=oe(n.Applicative0());return function(p){return function(T){return function(d){return r(i($b(p.videoId)))(function(h){return Rt(l(T.whenNotFound))(d)(gP(h)(Pb))})}}}};var Ng=IC(yn),AC=function(e){var n=IC(e);return function(r){return n(r)({whenNotFound:Re})}},LP=AC(vl),jP=AC(yn),LC=function(e){return function(n){return function(r){var i=function(){var S=DP("position-absolute-fullsize py-6 d-flex align-items-center justify-content-around");if(n.stage instanceof TC)return S(e.errorScreen("It appears that video playback is not supported in your browser."));if(n.stage instanceof EC)return S(e.errorScreen("The video didn't load correctly, try refreshing the page."));if(n.stage instanceof Gs)return S(e.introScreen);if(n.stage instanceof ql)return hr;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 243, column 20 - line 254, column 16): "+[n.stage.constructor.name])}(),l=function(){return n.stage instanceof Gs?n.stage.value0.reset:!1}(),p=Sg(function(S){return Js(Lp(S))(Mg(function(O){return r(new Sn(new AP({time:O})))}))}),T=Sg(function(S){return Js(Lp(S))(Mg(function(O){return r(new Sn(new MC({playing:!0,time:O})))}))}),d=function(S){return r(En.create(S))},h=Sg(function(S){return Js(Lp(S))(Mg(function(O){return d(new Lg(O))}))}),P=Lu(d)(wC.value),y=vs([dC("w-100 t--real-video")({id:n.videoId,controls:Aa(n.customControls),onVolumeChange:P,onTimeUpdate:p,onPlay:T,onPause:h})(""),Ji(!l)(yP({videoStreamUrl:e.watchUrl,videoElementId:n.videoId,onNotSupported:d(FC.value),onError:function(S,O){return Re},onCriticalFail:pC(d)(function(S){var O=S==="networkError";return O?Ag.value:new _v("HLS player crashed")}),onReady:d(new hv({autoPlay:e.autoPlay})),onInitialPts:pC(d)(function(S){return new SC(S.initPTS)})}))]),E=function(){return n.stage instanceof ql&&n.stage.value0.unmuteOverlay?vC("position-absolute-fullsize d-flex align-items-center justify-content-center t--unmute-overlay")({style:pi({pointerEvents:"none"})})(RP("btn btn-sm btn-light border-dark px-4 d-flex align-items-center")(fv)({onClick:Lu(d)(xC.value),style:pi({pointerEvents:"all"})})([bu("click for sound"),bP("fe fe-volume-2 ml-2")("")])):hr}(),M=function(S){return vC("position-absolute-fullsize d-flex align-items-end t--controls-overlay")({onMouseMove:Lu(d)(new $o(vv)),onMouseDown:Lu(d)(new $o(vv)),onTouchStart:Lu(d)(new $o(vv))})(ZF(S)(function(O){return d($o.create(O))}))},C=dC("w-100 t--real-video")({id:n.videoId,controls:Aa(n.customControls),playsInline:!0,onVolumeChange:P,onTimeUpdate:p,onPlay:T,onPause:h,onLoadedMetadata:Lu(d)(new hv({autoPlay:e.autoPlay})),onError:Lu(d)(Ag.value),src:function(){return l?"":e.watchUrl}()})("");return TP("position-relative w-100")([function(){if(n.support instanceof RC)return y;if(n.support instanceof bC)return C;throw new Error("Failed pattern match at Livestream.VideoPlayer (line 164, column 7 - line 166, column 40): "+[n.support.constructor.name])}(),Mh(n.customControls)(M),Ji(n.allowSound)(E),i])}}},NP=function(e){var n=Mt(e.MonadEffect0());return function(r){return n(function(){return LP(r)(wu(!1))(),jg.value})}},PP=NP(zb),Pg=function(e){return EP("Livestream: Error")({livestream_error_message:e})};var OP=function(e){return Mt(e)(function(){var r=Js(Js(bo)(xh))(wh)();return FP(function(i){return CP(hp(i)(r))(new H(0))})(["iPad","iPod","iPhone"])})},jC=OP(yn),UP=function(e){var n=function(i){return Gl(wP(e.allowSound)(xP(Vr("Skipping attempt to play unmuted because sound was programmatically disallowed"))))(function(){return Gl(mv(uv(i)))(function(){return Qn(new gv({unmuteOverlay:!1}))})})},r=function(i){return Gl(_C(wu(!0)(i)))(function(){return Gl(mv(uv(i)))(function(){return Qn(new gv({unmuteOverlay:!0}))})})};return Ng(e)({whenNotFound:new _v("