You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
962 KiB
53 lines
962 KiB
!(function(){var qo=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[1257],{65352:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return ge}});var A=L(89490),ye=L(11036),ve=L(39224),Z=L(43403),x=L(92310),m=L.n(x),Xe=L(29301),ae=L(76846),Ze=L(96452),V=L(6089),ne=L(80402),M=L(34280),N=L(49658),de=L(59301),hn=L(71409),Pt=L(77900),bt=L(8654);function Et(X){var J=X.prefixCls,D=X.align,Ne=X.arrow,Fe=X.arrowPos,ze=Ne||{},Je=ze.className,z=ze.content,q=Fe.x,ie=q===void 0?0:q,O=Fe.y,Pe=O===void 0?0:O,Ye=de.useRef();if(!D||!D.points)return null;var Oe={position:"absolute"};if(D.autoArrow!==!1){var pt=D.points[0],Qt=D.points[1],It=pt[0],ft=pt[1],ee=Qt[0],se=Qt[1];It===ee||!["t","b"].includes(It)?Oe.top=Pe:It==="t"?Oe.top=0:Oe.bottom=0,ft===se||!["l","r"].includes(ft)?Oe.left=ie:ft==="l"?Oe.left=0:Oe.right=0}return de.createElement("div",{ref:Ye,className:m()("".concat(J,"-arrow"),Je),style:Oe},z)}function oe(X){var J=X.prefixCls,D=X.open,Ne=X.zIndex,Fe=X.mask,ze=X.motion;return Fe?de.createElement(Pt.default,(0,hn.Z)({},ze,{motionAppear:!0,visible:D,removeOnLeave:!0}),function(Je){var z=Je.className;return de.createElement("div",{style:{zIndex:Ne},className:m()("".concat(J,"-mask"),z)})}):null}var K=de.memo(function(X){var J=X.children;return J},function(X,J){return J.cache}),W=K,Se=de.forwardRef(function(X,J){var D=X.popup,Ne=X.className,Fe=X.prefixCls,ze=X.style,Je=X.target,z=X.onVisibleChanged,q=X.open,ie=X.keepDom,O=X.fresh,Pe=X.onClick,Ye=X.mask,Oe=X.arrow,pt=X.arrowPos,Qt=X.align,It=X.motion,ft=X.maskMotion,ee=X.forceRender,se=X.getPopupContainer,Ae=X.autoDestroy,Y=X.portal,Ue=X.zIndex,Tt=X.onMouseEnter,wt=X.onMouseLeave,Ke=X.onPointerEnter,Nt=X.onPointerDownCapture,tn=X.ready,un=X.offsetX,zt=X.offsetY,Tn=X.offsetR,En=X.offsetB,mt=X.onAlign,at=X.onPrepare,Yt=X.stretch,gt=X.targetWidth,ct=X.targetHeight,Ln=typeof D=="function"?D():D,nn=q||ie,dn=(se==null?void 0:se.length)>0,St=de.useState(!se||!dn),Wt=(0,ye.Z)(St,2),zn=Wt[0],De=Wt[1];if((0,M.Z)(function(){!zn&&dn&&Je&&De(!0)},[zn,dn,Je]),!zn)return null;var c="auto",h={left:"-1000vw",top:"-1000vh",right:c,bottom:c};if(tn||!q){var g,E=Qt.points,S=Qt.dynamicInset||((g=Qt._experimental)===null||g===void 0?void 0:g.dynamicInset),k=S&&E[0][1]==="r",j=S&&E[0][0]==="b";k?(h.right=Tn,h.left=c):(h.left=un,h.right=c),j?(h.bottom=En,h.top=c):(h.top=zt,h.bottom=c)}var ht={};return Yt&&(Yt.includes("height")&&ct?ht.height=ct:Yt.includes("minHeight")&&ct&&(ht.minHeight=ct),Yt.includes("width")&>?ht.width=gt:Yt.includes("minWidth")&>&&(ht.minWidth=gt)),q||(ht.pointerEvents="none"),de.createElement(Y,{open:ee||nn,getContainer:se&&function(){return se(Je)},autoDestroy:Ae},de.createElement(oe,{prefixCls:Fe,open:q,zIndex:Ue,mask:Ye,motion:ft}),de.createElement(Xe.Z,{onResize:mt,disabled:!q},function(ut){return de.createElement(Pt.default,(0,hn.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:ee,leavedClassName:"".concat(Fe,"-hidden")},It,{onAppearPrepare:at,onEnterPrepare:at,visible:q,onVisibleChanged:function(ln){var _;It==null||(_=It.onVisibleChanged)===null||_===void 0||_.call(It,ln),z(ln)}}),function(_t,ln){var _=_t.className,R=_t.style,re=m()(Fe,_,Ne);return de.createElement("div",{ref:(0,bt.sQ)(ut,J,ln),className:re,style:(0,A.Z)((0,A.Z)((0,A.Z)((0,A.Z)({"--arrow-x":"".concat(pt.x||0,"px"),"--arrow-y":"".concat(pt.y||0,"px")},h),ht),R),{},{boxSizing:"border-box",zIndex:Ue},ze),onMouseEnter:Tt,onMouseLeave:wt,onPointerEnter:Ke,onClick:Pe,onPointerDownCapture:Nt},Oe&&de.createElement(Et,{prefixCls:Fe,arrow:Oe,arrowPos:pt,align:Qt}),de.createElement(W,{cache:!q&&!O},Ln))})}))}),He=Se,Ie=de.forwardRef(function(X,J){var D=X.children,Ne=X.getTriggerDOMNode,Fe=(0,bt.Yr)(D),ze=de.useCallback(function(z){(0,bt.mH)(J,Ne?Ne(z):z)},[Ne]),Je=(0,bt.x1)(ze,(0,bt.C4)(D));return Fe?de.cloneElement(D,{ref:Je}):D}),fe=Ie,Be=de.createContext(null),Vt=Be;function dt(X){return X?Array.isArray(X)?X:[X]:[]}function Zt(X,J,D,Ne){return de.useMemo(function(){var Fe=dt(D!=null?D:J),ze=dt(Ne!=null?Ne:J),Je=new Set(Fe),z=new Set(ze);return X&&(Je.has("hover")&&(Je.delete("hover"),Je.add("click")),z.has("hover")&&(z.delete("hover"),z.add("click"))),[Je,z]},[X,J,D,Ne])}var Ce=L(29194);function F(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],D=arguments.length>2?arguments[2]:void 0;return D?X[0]===J[0]:X[0]===J[0]&&X[1]===J[1]}function ce(X,J,D,Ne){for(var Fe=D.points,ze=Object.keys(X),Je=0;Je<ze.length;Je+=1){var z,q=ze[Je];if(F((z=X[q])===null||z===void 0?void 0:z.points,Fe,Ne))return"".concat(J,"-placement-").concat(q)}return""}function G(X,J,D,Ne){return J||(D?{motionName:"".concat(X,"-").concat(D)}:Ne?{motionName:Ne}:null)}function lt(X){return X.ownerDocument.defaultView}function Rt(X){for(var J=[],D=X==null?void 0:X.parentElement,Ne=["hidden","scroll","clip","auto"];D;){var Fe=lt(D).getComputedStyle(D),ze=Fe.overflowX,Je=Fe.overflowY,z=Fe.overflow;[ze,Je,z].some(function(q){return Ne.includes(q)})&&J.push(D),D=D.parentElement}return J}function C(X){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(X)?J:X}function $(X){return C(parseFloat(X),0)}function ke(X,J){var D=(0,A.Z)({},X);return(J||[]).forEach(function(Ne){if(!(Ne instanceof HTMLBodyElement||Ne instanceof HTMLHtmlElement)){var Fe=lt(Ne).getComputedStyle(Ne),ze=Fe.overflow,Je=Fe.overflowClipMargin,z=Fe.borderTopWidth,q=Fe.borderBottomWidth,ie=Fe.borderLeftWidth,O=Fe.borderRightWidth,Pe=Ne.getBoundingClientRect(),Ye=Ne.offsetHeight,Oe=Ne.clientHeight,pt=Ne.offsetWidth,Qt=Ne.clientWidth,It=$(z),ft=$(q),ee=$(ie),se=$(O),Ae=C(Math.round(Pe.width/pt*1e3)/1e3),Y=C(Math.round(Pe.height/Ye*1e3)/1e3),Ue=(pt-Qt-ee-se)*Ae,Tt=(Ye-Oe-It-ft)*Y,wt=It*Y,Ke=ft*Y,Nt=ee*Ae,tn=se*Ae,un=0,zt=0;if(ze==="clip"){var Tn=$(Je);un=Tn*Ae,zt=Tn*Y}var En=Pe.x+Nt-un,mt=Pe.y+wt-zt,at=En+Pe.width+2*un-Nt-tn-Ue,Yt=mt+Pe.height+2*zt-wt-Ke-Tt;D.left=Math.max(D.left,En),D.top=Math.max(D.top,mt),D.right=Math.min(D.right,at),D.bottom=Math.min(D.bottom,Yt)}}),D}function Le(X){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D="".concat(J),Ne=D.match(/^(.*)\%$/);return Ne?X*(parseFloat(Ne[1])/100):parseFloat(D)}function pe(X,J){var D=J||[],Ne=(0,ye.Z)(D,2),Fe=Ne[0],ze=Ne[1];return[Le(X.width,Fe),Le(X.height,ze)]}function _e(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[X[0],X[1]]}function et(X,J){var D=J[0],Ne=J[1],Fe,ze;return D==="t"?ze=X.y:D==="b"?ze=X.y+X.height:ze=X.y+X.height/2,Ne==="l"?Fe=X.x:Ne==="r"?Fe=X.x+X.width:Fe=X.x+X.width/2,{x:Fe,y:ze}}function Xt(X,J){var D={t:"b",b:"t",l:"r",r:"l"};return X.map(function(Ne,Fe){return Fe===J?D[Ne]||"c":Ne}).join("")}function Sn(X,J,D,Ne,Fe,ze,Je){var z=de.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Fe[Ne]||{}}),q=(0,ye.Z)(z,2),ie=q[0],O=q[1],Pe=de.useRef(0),Ye=de.useMemo(function(){return J?Rt(J):[]},[J]),Oe=de.useRef({}),pt=function(){Oe.current={}};X||pt();var Qt=(0,V.Z)(function(){if(J&&D&&X){let Mi=function(Ri,Ei){var Mt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ee,xn=St.x+Ri,Dn=St.y+Ei,kn=xn+k,ai=Dn+S,hi=Math.max(xn,Mt.left),sn=Math.max(Dn,Mt.top),In=Math.min(kn,Mt.right),oi=Math.min(ai,Mt.bottom);return Math.max(0,(In-hi)*(oi-sn))},yi=function(){Yn=St.y+Kt,ti=Yn+S,qn=St.x+jt,$n=qn+k};var ee,se,Ae,Y,Ue=J,Tt=Ue.ownerDocument,wt=lt(Ue),Ke=wt.getComputedStyle(Ue),Nt=Ke.width,tn=Ke.height,un=Ke.position,zt=Ue.style.left,Tn=Ue.style.top,En=Ue.style.right,mt=Ue.style.bottom,at=Ue.style.overflow,Yt=(0,A.Z)((0,A.Z)({},Fe[Ne]),ze),gt=Tt.createElement("div");(ee=Ue.parentElement)===null||ee===void 0||ee.appendChild(gt),gt.style.left="".concat(Ue.offsetLeft,"px"),gt.style.top="".concat(Ue.offsetTop,"px"),gt.style.position=un,gt.style.height="".concat(Ue.offsetHeight,"px"),gt.style.width="".concat(Ue.offsetWidth,"px"),Ue.style.left="0",Ue.style.top="0",Ue.style.right="auto",Ue.style.bottom="auto",Ue.style.overflow="hidden";var ct;if(Array.isArray(D))ct={x:D[0],y:D[1],width:0,height:0};else{var Ln,nn,dn=D.getBoundingClientRect();dn.x=(Ln=dn.x)!==null&&Ln!==void 0?Ln:dn.left,dn.y=(nn=dn.y)!==null&&nn!==void 0?nn:dn.top,ct={x:dn.x,y:dn.y,width:dn.width,height:dn.height}}var St=Ue.getBoundingClientRect();St.x=(se=St.x)!==null&&se!==void 0?se:St.left,St.y=(Ae=St.y)!==null&&Ae!==void 0?Ae:St.top;var Wt=Tt.documentElement,zn=Wt.clientWidth,De=Wt.clientHeight,c=Wt.scrollWidth,h=Wt.scrollHeight,g=Wt.scrollTop,E=Wt.scrollLeft,S=St.height,k=St.width,j=ct.height,ht=ct.width,ut={left:0,top:0,right:zn,bottom:De},_t={left:-E,top:-g,right:c-E,bottom:h-g},ln=Yt.htmlRegion,_="visible",R="visibleFirst";ln!=="scroll"&&ln!==R&&(ln=_);var re=ln===R,Q=ke(_t,Ye),U=ke(ut,Ye),Ee=ln===_?U:Q,Re=re?U:Ee;Ue.style.left="auto",Ue.style.top="auto",Ue.style.right="0",Ue.style.bottom="0";var be=Ue.getBoundingClientRect();Ue.style.left=zt,Ue.style.top=Tn,Ue.style.right=En,Ue.style.bottom=mt,Ue.style.overflow=at,(Y=Ue.parentElement)===null||Y===void 0||Y.removeChild(gt);var We=C(Math.round(k/parseFloat(Nt)*1e3)/1e3),qe=C(Math.round(S/parseFloat(tn)*1e3)/1e3);if(We===0||qe===0||(0,ae.Sh)(D)&&!(0,Ce.Z)(D))return;var Lt=Yt.offset,Qe=Yt.targetOffset,st=pe(St,Lt),we=(0,ye.Z)(st,2),w=we[0],H=we[1],te=pe(ct,Qe),le=(0,ye.Z)(te,2),Ge=le[0],Ve=le[1];ct.x-=Ge,ct.y-=Ve;var $e=Yt.points||[],vt=(0,ye.Z)($e,2),Ct=vt[0],At=vt[1],qt=_e(At),xt=_e(Ct),Jt=et(ct,qt),$t=et(St,xt),rn=(0,A.Z)({},Yt),jt=Jt.x-$t.x+w,Kt=Jt.y-$t.y+H,yn=Mi(jt,Kt),yt=Mi(jt,Kt,U),Dt=et(ct,["t","l"]),kt=et(St,["t","l"]),mn=et(ct,["b","r"]),en=et(St,["b","r"]),fn=Yt.overflow||{},Cn=fn.adjustX,On=fn.adjustY,si=fn.shiftX,Fn=fn.shiftY,Bn=function(Ei){return typeof Ei=="boolean"?Ei:Ei>=0},Yn,ti,qn,$n;yi();var cn=Bn(On),ot=xt[0]===qt[0];if(cn&&xt[0]==="t"&&(ti>Re.bottom||Oe.current.bt)){var nt=Kt;ot?nt-=S-j:nt=Dt.y-en.y-H;var Ft=Mi(jt,nt),Bt=Mi(jt,nt,U);Ft>yn||Ft===yn&&(!re||Bt>=yt)?(Oe.current.bt=!0,Kt=nt,H=-H,rn.points=[Xt(xt,0),Xt(qt,0)]):Oe.current.bt=!1}if(cn&&xt[0]==="b"&&(Yn<Re.top||Oe.current.tb)){var gn=Kt;ot?gn+=S-j:gn=mn.y-kt.y-H;var Zn=Mi(jt,gn),jn=Mi(jt,gn,U);Zn>yn||Zn===yn&&(!re||jn>=yt)?(Oe.current.tb=!0,Kt=gn,H=-H,rn.points=[Xt(xt,0),Xt(qt,0)]):Oe.current.tb=!1}var Mn=Bn(Cn),ni=xt[1]===qt[1];if(Mn&&xt[1]==="l"&&($n>Re.right||Oe.current.rl)){var vi=jt;ni?vi-=k-ht:vi=Dt.x-en.x-w;var Ti=Mi(vi,Kt),Ii=Mi(vi,Kt,U);Ti>yn||Ti===yn&&(!re||Ii>=yt)?(Oe.current.rl=!0,jt=vi,w=-w,rn.points=[Xt(xt,1),Xt(qt,1)]):Oe.current.rl=!1}if(Mn&&xt[1]==="r"&&(qn<Re.left||Oe.current.lr)){var wn=jt;ni?wn+=k-ht:wn=mn.x-kt.x-w;var _i=Mi(wn,Kt),wi=Mi(wn,Kt,U);_i>yn||_i===yn&&(!re||wi>=yt)?(Oe.current.lr=!0,jt=wn,w=-w,rn.points=[Xt(xt,1),Xt(qt,1)]):Oe.current.lr=!1}yi();var pi=si===!0?0:si;typeof pi=="number"&&(qn<U.left&&(jt-=qn-U.left-w,ct.x+ht<U.left+pi&&(jt+=ct.x-U.left+ht-pi)),$n>U.right&&(jt-=$n-U.right-w,ct.x>U.right-pi&&(jt+=ct.x-U.right+pi)));var ii=Fn===!0?0:Fn;typeof ii=="number"&&(Yn<U.top&&(Kt-=Yn-U.top-H,ct.y+j<U.top+ii&&(Kt+=ct.y-U.top+j-ii)),ti>U.bottom&&(Kt-=ti-U.bottom-H,ct.y>U.bottom-ii&&(Kt+=ct.y-U.bottom+ii)));var vn=St.x+jt,mi=vn+k,Ci=St.y+Kt,zi=Ci+S,Hn=ct.x,bn=Hn+ht,Kn=ct.y,ui=Kn+j,Vn=Math.max(vn,Hn),Di=Math.min(mi,bn),fi=(Vn+Di)/2,Oi=fi-vn,Hi=Math.max(Ci,Kn),Ui=Math.min(zi,ui),Qi=(Hi+Ui)/2,Gi=Qi-Ci;Je==null||Je(J,rn);var Vi=be.right-St.x-(jt+St.width),Ai=be.bottom-St.y-(Kt+St.height);We===1&&(jt=Math.round(jt),Vi=Math.round(Vi)),qe===1&&(Kt=Math.round(Kt),Ai=Math.round(Ai));var Zi={ready:!0,offsetX:jt/We,offsetY:Kt/qe,offsetR:Vi/We,offsetB:Ai/qe,arrowX:Oi/We,arrowY:Gi/qe,scaleX:We,scaleY:qe,align:rn};O(Zi)}}),It=function(){Pe.current+=1;var se=Pe.current;Promise.resolve().then(function(){Pe.current===se&&Qt()})},ft=function(){O(function(se){return(0,A.Z)((0,A.Z)({},se),{},{ready:!1})})};return(0,M.Z)(ft,[Ne]),(0,M.Z)(function(){X||ft()},[X]),[ie.ready,ie.offsetX,ie.offsetY,ie.offsetR,ie.offsetB,ie.arrowX,ie.arrowY,ie.scaleX,ie.scaleY,ie.align,It]}var Rn=L(62730);function Pn(X,J,D,Ne,Fe){(0,M.Z)(function(){if(X&&J&&D){let Pe=function(){Ne(),Fe()};var ze=J,Je=D,z=Rt(ze),q=Rt(Je),ie=lt(Je),O=new Set([ie].concat((0,Rn.Z)(z),(0,Rn.Z)(q)));return O.forEach(function(Ye){Ye.addEventListener("scroll",Pe,{passive:!0})}),ie.addEventListener("resize",Pe,{passive:!0}),Ne(),function(){O.forEach(function(Ye){Ye.removeEventListener("scroll",Pe),ie.removeEventListener("resize",Pe)})}}},[X,J,D])}var Ot=L(48736);function on(X,J,D,Ne,Fe,ze,Je,z){var q=de.useRef(X);q.current=X;var ie=de.useRef(!1);de.useEffect(function(){if(J&&Ne&&(!Fe||ze)){var Pe=function(){ie.current=!1},Ye=function(Ae){var Y;q.current&&!Je(((Y=Ae.composedPath)===null||Y===void 0||(Y=Y.call(Ae))===null||Y===void 0?void 0:Y[0])||Ae.target)&&!ie.current&&z(!1)},Oe=lt(Ne);Oe.addEventListener("pointerdown",Pe,!0),Oe.addEventListener("mousedown",Ye,!0),Oe.addEventListener("contextmenu",Ye,!0);var pt=(0,Ze.A)(D);if(pt&&(pt.addEventListener("mousedown",Ye,!0),pt.addEventListener("contextmenu",Ye,!0)),0)var Qt,It,ft,ee;return function(){Oe.removeEventListener("pointerdown",Pe,!0),Oe.removeEventListener("mousedown",Ye,!0),Oe.removeEventListener("contextmenu",Ye,!0),pt&&(pt.removeEventListener("mousedown",Ye,!0),pt.removeEventListener("contextmenu",Ye,!0))}}},[J,D,Ne,Fe,ze]);function O(){ie.current=!0}return O}var rt=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function Nn(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z.Z,J=de.forwardRef(function(D,Ne){var Fe=D.prefixCls,ze=Fe===void 0?"rc-trigger-popup":Fe,Je=D.children,z=D.action,q=z===void 0?"hover":z,ie=D.showAction,O=D.hideAction,Pe=D.popupVisible,Ye=D.defaultPopupVisible,Oe=D.onPopupVisibleChange,pt=D.afterPopupVisibleChange,Qt=D.mouseEnterDelay,It=D.mouseLeaveDelay,ft=It===void 0?.1:It,ee=D.focusDelay,se=D.blurDelay,Ae=D.mask,Y=D.maskClosable,Ue=Y===void 0?!0:Y,Tt=D.getPopupContainer,wt=D.forceRender,Ke=D.autoDestroy,Nt=D.destroyPopupOnHide,tn=D.popup,un=D.popupClassName,zt=D.popupStyle,Tn=D.popupPlacement,En=D.builtinPlacements,mt=En===void 0?{}:En,at=D.popupAlign,Yt=D.zIndex,gt=D.stretch,ct=D.getPopupClassNameFromAlign,Ln=D.fresh,nn=D.alignPoint,dn=D.onPopupClick,St=D.onPopupAlign,Wt=D.arrow,zn=D.popupMotion,De=D.maskMotion,c=D.popupTransitionName,h=D.popupAnimation,g=D.maskTransitionName,E=D.maskAnimation,S=D.className,k=D.getTriggerDOMNode,j=(0,ve.Z)(D,rt),ht=Ke||Nt||!1,ut=de.useState(!1),_t=(0,ye.Z)(ut,2),ln=_t[0],_=_t[1];(0,M.Z)(function(){_((0,N.Z)())},[]);var R=de.useRef({}),re=de.useContext(Vt),Q=de.useMemo(function(){return{registerSubPopup:function(In,oi){R.current[In]=oi,re==null||re.registerSubPopup(In,oi)}}},[re]),U=(0,ne.Z)(),Ee=de.useState(null),Re=(0,ye.Z)(Ee,2),be=Re[0],We=Re[1],qe=de.useRef(null),Lt=(0,V.Z)(function(sn){qe.current=sn,(0,ae.Sh)(sn)&&be!==sn&&We(sn),re==null||re.registerSubPopup(U,sn)}),Qe=de.useState(null),st=(0,ye.Z)(Qe,2),we=st[0],w=st[1],H=de.useRef(null),te=(0,V.Z)(function(sn){(0,ae.Sh)(sn)&&we!==sn&&(w(sn),H.current=sn)}),le=de.Children.only(Je),Ge=(le==null?void 0:le.props)||{},Ve={},$e=(0,V.Z)(function(sn){var In,oi,ri=we;return(ri==null?void 0:ri.contains(sn))||((In=(0,Ze.A)(ri))===null||In===void 0?void 0:In.host)===sn||sn===ri||(be==null?void 0:be.contains(sn))||((oi=(0,Ze.A)(be))===null||oi===void 0?void 0:oi.host)===sn||sn===be||Object.values(R.current).some(function(gi){return(gi==null?void 0:gi.contains(sn))||sn===gi})}),vt=G(ze,zn,h,c),Ct=G(ze,De,E,g),At=de.useState(Ye||!1),qt=(0,ye.Z)(At,2),xt=qt[0],Jt=qt[1],$t=Pe!=null?Pe:xt,rn=(0,V.Z)(function(sn){Pe===void 0&&Jt(sn)});(0,M.Z)(function(){Jt(Pe||!1)},[Pe]);var jt=de.useRef($t);jt.current=$t;var Kt=de.useRef([]);Kt.current=[];var yn=(0,V.Z)(function(sn){var In;rn(sn),((In=Kt.current[Kt.current.length-1])!==null&&In!==void 0?In:$t)!==sn&&(Kt.current.push(sn),Oe==null||Oe(sn))}),yt=de.useRef(),Dt=function(){clearTimeout(yt.current)},kt=function(In){var oi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Dt(),oi===0?yn(In):yt.current=setTimeout(function(){yn(In)},oi*1e3)};de.useEffect(function(){return Dt},[]);var mn=de.useState(!1),en=(0,ye.Z)(mn,2),fn=en[0],Cn=en[1];(0,M.Z)(function(sn){(!sn||$t)&&Cn(!0)},[$t]);var On=de.useState(null),si=(0,ye.Z)(On,2),Fn=si[0],Bn=si[1],Yn=de.useState(null),ti=(0,ye.Z)(Yn,2),qn=ti[0],$n=ti[1],cn=function(In){$n([In.clientX,In.clientY])},ot=Sn($t,be,nn&&qn!==null?qn:we,Tn,mt,at,St),nt=(0,ye.Z)(ot,11),Ft=nt[0],Bt=nt[1],gn=nt[2],Zn=nt[3],jn=nt[4],Mn=nt[5],ni=nt[6],vi=nt[7],Ti=nt[8],Ii=nt[9],wn=nt[10],_i=Zt(ln,q,ie,O),wi=(0,ye.Z)(_i,2),pi=wi[0],ii=wi[1],vn=pi.has("click"),mi=ii.has("click")||ii.has("contextMenu"),Ci=(0,V.Z)(function(){fn||wn()}),zi=function(){jt.current&&nn&&mi&&kt(!1)};Pn($t,we,be,Ci,zi),(0,M.Z)(function(){Ci()},[qn,Tn]),(0,M.Z)(function(){$t&&!(mt!=null&&mt[Tn])&&Ci()},[JSON.stringify(at)]);var Hn=de.useMemo(function(){var sn=ce(mt,ze,Ii,nn);return m()(sn,ct==null?void 0:ct(Ii))},[Ii,ct,mt,ze,nn]);de.useImperativeHandle(Ne,function(){return{nativeElement:H.current,popupElement:qe.current,forceAlign:Ci}});var bn=de.useState(0),Kn=(0,ye.Z)(bn,2),ui=Kn[0],Vn=Kn[1],Di=de.useState(0),fi=(0,ye.Z)(Di,2),Oi=fi[0],Hi=fi[1],Ui=function(){if(gt&&we){var In=we.getBoundingClientRect();Vn(In.width),Hi(In.height)}},Qi=function(){Ui(),Ci()},Gi=function(In){Cn(!1),wn(),pt==null||pt(In)},Vi=function(){return new Promise(function(In){Ui(),Bn(function(){return In})})};(0,M.Z)(function(){Fn&&(wn(),Fn(),Bn(null))},[Fn]);function Ai(sn,In,oi,ri){Ve[sn]=function(gi){var Xi;ri==null||ri(gi),kt(In,oi);for(var $i=arguments.length,Ki=new Array($i>1?$i-1:0),rr=1;rr<$i;rr++)Ki[rr-1]=arguments[rr];(Xi=Ge[sn])===null||Xi===void 0||Xi.call.apply(Xi,[Ge,gi].concat(Ki))}}(vn||mi)&&(Ve.onClick=function(sn){var In;jt.current&&mi?kt(!1):!jt.current&&vn&&(cn(sn),kt(!0));for(var oi=arguments.length,ri=new Array(oi>1?oi-1:0),gi=1;gi<oi;gi++)ri[gi-1]=arguments[gi];(In=Ge.onClick)===null||In===void 0||In.call.apply(In,[Ge,sn].concat(ri))});var Zi=on($t,mi,we,be,Ae,Ue,$e,kt),Mi=pi.has("hover"),yi=ii.has("hover"),Ri,Ei;Mi&&(Ai("onMouseEnter",!0,Qt,function(sn){cn(sn)}),Ai("onPointerEnter",!0,Qt,function(sn){cn(sn)}),Ri=function(In){($t||fn)&&be!==null&&be!==void 0&&be.contains(In.target)&&kt(!0,Qt)},nn&&(Ve.onMouseMove=function(sn){var In;(In=Ge.onMouseMove)===null||In===void 0||In.call(Ge,sn)})),yi&&(Ai("onMouseLeave",!1,ft),Ai("onPointerLeave",!1,ft),Ei=function(){kt(!1,ft)}),pi.has("focus")&&Ai("onFocus",!0,ee),ii.has("focus")&&Ai("onBlur",!1,se),pi.has("contextMenu")&&(Ve.onContextMenu=function(sn){var In;jt.current&&ii.has("contextMenu")?kt(!1):(cn(sn),kt(!0)),sn.preventDefault();for(var oi=arguments.length,ri=new Array(oi>1?oi-1:0),gi=1;gi<oi;gi++)ri[gi-1]=arguments[gi];(In=Ge.onContextMenu)===null||In===void 0||In.call.apply(In,[Ge,sn].concat(ri))}),S&&(Ve.className=m()(Ge.className,S));var Mt=(0,A.Z)((0,A.Z)({},Ge),Ve),xn={},Dn=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Dn.forEach(function(sn){j[sn]&&(xn[sn]=function(){for(var In,oi=arguments.length,ri=new Array(oi),gi=0;gi<oi;gi++)ri[gi]=arguments[gi];(In=Mt[sn])===null||In===void 0||In.call.apply(In,[Mt].concat(ri)),j[sn].apply(j,ri)})});var kn=de.cloneElement(le,(0,A.Z)((0,A.Z)({},Mt),xn)),ai={x:Mn,y:ni},hi=Wt?(0,A.Z)({},Wt!==!0?Wt:{}):null;return de.createElement(de.Fragment,null,de.createElement(Xe.Z,{disabled:!$t,ref:te,onResize:Qi},de.createElement(fe,{getTriggerDOMNode:k},kn)),de.createElement(Vt.Provider,{value:Q},de.createElement(He,{portal:X,ref:Lt,prefixCls:ze,popup:tn,className:m()(un,Hn),style:zt,target:we,onMouseEnter:Ri,onMouseLeave:Ei,onPointerEnter:Ri,zIndex:Yt,open:$t,keepDom:fn,fresh:Ln,onClick:dn,onPointerDownCapture:Zi,mask:Ae,motion:vt,maskMotion:Ct,onVisibleChanged:Gi,onPrepare:Vi,forceRender:wt,autoDestroy:ht,getPopupContainer:Tt,align:Ii,arrow:hi,arrowPos:ai,ready:Ft,offsetX:Bt,offsetY:gn,offsetR:Zn,offsetB:jn,onAlign:Ci,stretch:gt,targetWidth:ui/vi,targetHeight:Oi/Ti})))});return J}var ge=Nn(Z.Z)},28426:function(Qn,pn,L){"use strict";var A=L(59301),ye=L(93314),ve=L(99571),Z=Object.defineProperty,x=Object.defineProperties,m=Object.getOwnPropertyDescriptors,Xe=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable,V=(de,hn,Pt)=>hn in de?Z(de,hn,{enumerable:!0,configurable:!0,writable:!0,value:Pt}):de[hn]=Pt,ne=(de,hn)=>{for(var Pt in hn||(hn={}))ae.call(hn,Pt)&&V(de,Pt,hn[Pt]);if(Xe)for(var Pt of Xe(hn))Ze.call(hn,Pt)&&V(de,Pt,hn[Pt]);return de},M=(de,hn)=>x(de,m(hn));const N=({img:de,buttonProps:hn={},styles:Pt={},customText:bt,ButtonText:Et,ButtonClick:oe,Buttonclass:K,ButtonTwo:W,imgStyles:Se,loading:He=!1,className:Ie=""})=>A.createElement("section",{className:`tc animated fadeIn ${Ie}`,style:ne({color:"#999",margin:"100px auto",visibility:He?"hidden":"visible"},Pt)},A.createElement("img",{src:de||ye,style:M(ne({},Se),{pointerEvents:"none",userSelect:"none"})}),A.createElement("p",{className:"mt20 font14"},bt||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),Et&&A.createElement(ve.ZP,ne({className:K,onClick:oe},hn),Et),W&&W);pn.Z=N},32333:function(Qn,pn,L){"use strict";L.d(pn,{K:function(){return m}});var A=L(59301),ye=L(62957),ve=L(3736),Z={modal:"modal___LGwws",closeIcon:"closeIcon___vsUXI",wrap:"wrap___tDzbl",input:"input___aikQk"},x=L(24334);const m=({visible:Xe,width:ae,videoId:Ze,file_url:V,course_id:ne,copyUrl:M,toLog:N=!0,logWatchHistory:de=()=>{},allow_skip:hn,onClose:Pt=()=>{},autoPlay:bt=!1,onPlayEnded:Et=()=>{}})=>A.createElement(ye.default,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,open:Xe,title:null,footer:null,width:ae,className:Z.modal},A.createElement("i",{className:`${Z.closeIcon} iconfont icon-guanbi10`,onClick:Pt}),Xe&&A.createElement(ve.Z,{onPlayEnded:Et,autoPlay:bt,allow_skip:hn,courseId:ne,src:V!=null&&V.startsWith("http")?V:x.Base64.decode(V),videoId:Ze,toLog:N,logWatchHistory:de}))},3736:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return hn}});var A=L(59301),ye=L(6767),ve=L(75727),Z=L(30647),x=L(79710),m=L(48790),Xe=L(56102),ae=L(84989),Ze={watermark:"watermark___hNYlv",videovideo:"videovideo___ovOkV",animate__loop:"animate__loop___mvL6s",upDown:"upDown___SlgHv",container:"container___g1WYG","video-container":"video-container___XPkWR","video-controls":"video-controls___to0Zq",hide:"hide___NA3DV","video-progress":"video-progress___gqHsd",seek:"seek___iZHBm","seek-tooltip":"seek-tooltip___uWyXx","bottom-controls":"bottom-controls___uoIBm","left-controls":"left-controls___mBEx4","right-controls":"right-controls___e9L6r",rateOverlay:"rateOverlay___HHBWe",controlText:"controlText___M_BWR","volume-controls":"volume-controls___fa3mE","fullscreen-button":"fullscreen-button___ur0es","fullscreen-button1":"fullscreen-button1___rfaXm","pip-button":"pip-button___GFO8W","playback-animation":"playback-animation___ndURq",volume:"volume___OTmpP",hidden:"hidden___o7GkT"},V=(Pt,bt,Et)=>new Promise((oe,K)=>{var W=Ie=>{try{He(Et.next(Ie))}catch(fe){K(fe)}},Se=Ie=>{try{He(Et.throw(Ie))}catch(fe){K(fe)}},He=Ie=>Ie.done?oe(Ie.value):Promise.resolve(Ie.value).then(W,Se);He((Et=Et.apply(Pt,bt)).next())});function ne(Pt){if(isNaN(Pt))return{minutes:"00",seconds:"00"};const bt=new Date(Pt*1e3).toISOString().substr(11,8);return{hour:bt.substr(0,2),minutes:bt.substr(3,2),seconds:bt.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function M(Pt,bt){return Pt-bt}function N(Pt){Pt.sort(M);let bt=0;for(let Et=0;Et<Pt.length-1;Et++){let oe=Math.abs(Pt[Et+1]-Pt[Et]);oe<21&&(bt+=oe)}return bt}const de=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;var hn=(0,A.forwardRef)(({allow_skip:Pt,src:bt,toLog:Et,videoId:oe,logWatchHistory:K,courseId:W=null,startTime:Se,handlePause:He=()=>{},handlePlay:Ie=()=>{},handlePlayEnded:fe=()=>{},autoPlay:Be=!1,onPlayEnded:Vt=()=>{},isShowWaterMark:dt=!0},Zt)=>{var Ce;bt=bt==null?void 0:bt.replace("http://","https://");const ce=((Ce=bt==null?void 0:bt.split("."))==null?void 0:Ce.pop())==="flv",G=(0,A.useRef)(),lt=(0,A.useRef)(),Rt=(0,A.useRef)(),C=(0,A.useRef)(),$=(0,A.useRef)(),ke=(0,A.useRef)(),Le=(0,A.useRef)(),pe=(0,A.useRef)(),_e=(0,A.useRef)(),et=(0,A.useRef)(),Xt=(0,A.useRef)(),Sn=(0,A.useRef)(),Rn=(0,A.useRef)(),Pn=(0,A.useRef)(),Ot=navigator.userAgent.toLowerCase().match(de),on=Ot?Ot[0]:"pc",rt=(0,A.useRef)(!1),Nn=(0,m.eY)();let ge=0,X=0,J=0,D=null,Ne=!1,Fe=20,ze=1,Je=!1,z=!1,q=[];(0,A.useImperativeHandle)(Zt,()=>({getLastUpdatedTime:()=>G.current.currentTime,getDuration:()=>G.current.duration})),ye.ZP.config({maxCount:1,getContainer:()=>Rt.current});const ie=(0,A.useCallback)((It,ft=!1)=>{let ee={point:G.current.currentTime};D?(ee.log_id=D,ee.watch_duration=N(q),ee.total_duration=X):(W?(ee.video_id=parseInt(oe,10),ee.course_id=W):ee.video_id=oe,ee.duration=ge,ee.device=on),ft&&(ee.ed="1");function se(){return V(this,null,function*(){Je=!0,D=yield K==null?void 0:K(ee),Je=!1,It&&It()})}se()},[oe,W]);(0,A.useEffect)(()=>{G.current&&(C.current.style.display="none",$.current.style.display="block"),ye.ZP.destroy();let It=null;return Z.Z.isSupported&&ce&&bt&&(bt==null?void 0:bt.indexOf(".m3u8"))<0?(It=Z.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:bt,muted:!1}),G.current&&(It.attachMediaElement(G.current),It.load())):G.current.setAttribute("src",bt),Pe(),()=>{It&&(It.unload(),It.pause(),It.destroy(),It=null)}},[G,ce,bt]);function O(){G.current.paused?(C.current.style.display="none",$.current.style.display="block"):(C.current.style.display="block",$.current.style.display="none")}function Pe(){Xt.current.style.display="none",Rn.current.style.display="none",Sn.current.style.display="none",G.current.muted||G.current.volume===0?Xt.current.style.display="block":G.current.volume>0&&G.current.volume<=.5?Rn.current.style.display="block":Sn.current.style.display="block"}(0,A.useEffect)(()=>{const It=document.getElementById("play"),ft=document.querySelectorAll(".playback-icons use");function ee(){Ie(),Se&&!rt.current&&(G.current.currentTime=Se),rt.current=!0,q.push(G.current.currentTime),Ne||(Ne=!0,Et&&ie())}function se(){return V(this,null,function*(){O(),q.push(G.current.currentTime),Et&&ie(()=>{D=null,J=0,Ne=!1,Je=!1,z=!1,q=[],X=0,ze=1},!0),Vt()})}function Ae(){ke.current.value=Math.round(G.current.currentTime),Le.current.value=Math.round(G.current.currentTime)}function Y(){const mt=ne(Math.round(G.current.currentTime));_e.current.innerText=`${mt.hour>0?mt.hour+":":""}${mt.minutes}:${mt.seconds}`,_e.current.setAttribute("datetime",`${mt.hour>0?" "+mt.hour+" ":""}${mt.minutes}m ${mt.seconds}s`)}function Ue(){var mt,at,Yt,gt,ct,Ln,nn;const dn=Math.round((mt=G.current)==null?void 0:mt.duration);(Yt=(at=ke.current)==null?void 0:at.setAttribute)==null||Yt.call(at,"max",dn),(ct=(gt=Le.current)==null?void 0:gt.setAttribute)==null||ct.call(gt,"max",dn);const St=ne(dn);pe.current&&(pe.current.innerText=`${St.hour>0?St.hour+":":""}${St.minutes}:${St.seconds}`,(nn=(Ln=pe.current).setAttribute)==null||nn.call(Ln,"datetime",`${St.hour>0?" "+St.hour+" ":""}${St.minutes}m ${St.seconds}s`))}function Tt(){try{const mt=Math.round(G.current.duration);ke.current.setAttribute("max",mt),Le.current.setAttribute("max",mt);const at=ne(mt);pe.current.innerText=`${at.hour>0?at.hour+":":""}${at.minutes}:${at.seconds}`,pe.current.setAttribute("datetime",`${at.hour>0?" "+at.hour+" ":""}${at.minutes}m ${at.seconds}s`),Ae(),Y();const{width:Yt,height:gt,x:ct,y:Ln}=lt.current.getBoundingClientRect();if(ct<0||Ln<0,!z){let nn=G.current.currentTime,dn=nn-J;Math.abs(dn)<10?(X+=Math.abs(dn),J=nn,Je||X-ze*Fe>=0&&(ze++,q.push(J),Et&&ie())):(J=nn,Et&&ie())}}catch(mt){console.log("videoplaying:",mt)}}function wt(){z=!0}function Ke(){G.current.playing&&q.push(G.current.currentTime,J),J=G.current.currentTime,z=!1}function Nt(){ge=G.current.duration,ge<=20&&(Fe=ge/3),G.current.addEventListener("play",ee)}function tn(mt){mt.preventDefault(),(0,ae.vp)()?(G.current.style.width="100%",G.current.style.height="100%"):G.current.style.cssText=""}function un(){He()}function zt(mt){if(!Pt){ye.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");return}const at=mt.target.dataset.seek?mt.target.dataset.seek:mt.target.value;G.current.currentTime=at,Le.current.value=at,ke.current.value=at}function Tn(mt){const at=Math.round(mt.offsetX/mt.target.clientWidth*parseInt(mt.target.getAttribute("max"),10));ke.current.setAttribute("data-seek",at);const Yt=ne(at);et.current.textContent=`${Yt.hour>0?Yt.hour+":":""}${Yt.minutes}:${Yt.seconds}`;const gt=G.current.getBoundingClientRect();et.current.style.left=`${mt.pageX-gt.left}px`}function En(mt){switch(mt.code){case"Space":mt.preventDefault(),pt();break;case"ArrowRight":if(mt.preventDefault(),!Pt){ye.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(G.current.currentTime>=G.current.duration)break;G.current.currentTime=parseInt(G.current.currentTime)+5,Ae();break;case"ArrowLeft":if(mt.preventDefault(),!Pt){ye.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(G.current.currentTime===0)break;G.current.currentTime=parseInt(G.current.currentTime)-5,Ae();break;case"ArrowUp":mt.preventDefault(),G.current.volume<1&&(G.current.volume=(parseInt(G.current.volume*10)+1)/10);break;case"ArrowDown":mt.preventDefault(),G.current.volume>0&&(G.current.volume=(parseInt(G.current.volume*10)-1)/10);break}}return Rt.current.addEventListener((0,ae.gH)(),tn),G.current.addEventListener("canplay",Nt),G.current.addEventListener("ended",se),G.current.addEventListener("seeking",wt),G.current.addEventListener("seeked",Ke),G.current.addEventListener("loadedmetadata",Ue),ke.current.addEventListener("mousemove",Tn),ke.current.addEventListener("input",zt),G.current.addEventListener("timeupdate",Tt),G.current.addEventListener("pause",un),G.current.addEventListener("volumechange",Pe),document.addEventListener("keydown",En),()=>{var mt,at,Yt,gt,ct,Ln,nn,dn,St,Wt,zn,De;(mt=G.current)==null||mt.removeEventListener("canplay",Nt),(at=G.current)==null||at.removeEventListener("play",ee),(Yt=G.current)==null||Yt.removeEventListener("ended",se),(gt=G.current)==null||gt.removeEventListener("seeking",wt),(ct=G.current)==null||ct.removeEventListener("seeked",Ke),(Ln=ke.current)==null||Ln.removeEventListener("mousemove",Tn),(nn=ke.current)==null||nn.removeEventListener("input",zt),(dn=G.current)==null||dn.removeEventListener("timeupdate",Tt),(St=G.current)==null||St.removeEventListener("pause",un),(Wt=G.current)==null||Wt.removeEventListener("loadedmetadata",Ue),(zn=G.current)==null||zn.removeEventListener("volumechange",Pe),document.removeEventListener("keydown",En),(De=G.current)!=null&&De.playing&&(q.push(J,G.current.currentTime),Et&&ie())}},[G,bt]),(0,A.useEffect)(()=>{if(G.current.onended=()=>{fe(G)},G.current.oncontextmenu=()=>!1,(bt==null?void 0:bt.indexOf(".m3u8"))>-1){if(G.current.canPlayType("application/vnd.apple.mpegurl"))G.current.src=bt;else if(x.ZP.isSupported()){var It=new x.ZP;It.loadSource(bt),It.attachMedia(G.current)}}},[bt]);const[Ye,Oe]=(0,A.useState)(1),pt=()=>{G.current.paused||G.current.ended?G.current.play():G.current.pause(),O()};function Qt(){G.current.muted=!G.current.muted,G.current.muted?(Pn.current.setAttribute("data-volume",volume.value),Pn.current.value=0):Pn.current.value=Pn.current.dataset.volume}return A.createElement("div",{style:{position:"relative"},ref:Rt},A.createElement("div",{ref:lt,className:`${Ze.watermark} animated_alternate animate__animated_10s animate__infinite animate__stepstart ${Ze.animate__loop}`},dt&&Nn?Nn.login:" "),A.createElement("div",{className:Ze.container},A.createElement("div",{className:Ze["video-container"],id:"video-container"},A.createElement("div",{className:Ze["playback-animation"],id:"playback-animation"},A.createElement("svg",{className:Ze["playback-icons"]},A.createElement("use",{className:"hidden",href:"#play-icon"}),A.createElement("use",{href:"#pause"}))),A.createElement("video",{className:Ze.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:G,autoPlay:Be}),A.createElement("div",{className:`${Ze["video-controls"]} `,id:"video-controls"},A.createElement("div",{className:Ze["bottom-controls"]},A.createElement("div",{className:Ze["left-controls"]},A.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:pt},A.createElement("svg",{className:Ze["playback-icons"]},A.createElement("use",{ref:$,href:"#play-icon"}),A.createElement("use",{ref:C,style:{display:"none"},href:"#pause"}))),A.createElement("div",{className:Ze.time},A.createElement("time",{id:"time-elapsed",ref:_e},"00:00"),A.createElement("span",null," / "),A.createElement("time",{id:"duration",ref:pe},"00:00"))),A.createElement("div",{className:Ze["right-controls"]},Pt&&A.createElement(ve.Z,{placement:"top",overlayClassName:Ze.rateOverlay,getPopupContainer:It=>It.parentNode,menu:{items:[{key:"1",label:A.createElement("span",{onClick:()=>{Oe(1),G.current.playbackRate=1}},"1.0x")},{key:"2",label:A.createElement("span",{onClick:()=>{Oe(1.5),G.current.playbackRate=1.5}},"1.5x")},{key:"3",label:A.createElement("span",{onClick:()=>{Oe(2),G.current.playbackRate=2}},"2.0x")}]}},A.createElement("div",{className:`${Ze.controlText} mr5`},"\u500D\u901F")),A.createElement(Xe.CopyToClipboard,{text:bt,onCopy:()=>ye.ZP.success("\u590D\u5236\u6210\u529F")},A.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},A.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),A.createElement("div",{className:Ze["volume-controls"]},A.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:Ze["volume-button"],id:"volume-button",onClick:Qt},A.createElement("i",{ref:Xt,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),A.createElement("i",{ref:Rn,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),A.createElement("i",{ref:Sn,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),A.createElement("input",{className:Ze.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Pn,style:{display:"none"},onClick:Pe})),A.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:Ze["fullscreen-button"],onClick:()=>{(0,ae.vp)()?(0,ae.BU)():(0,ae.Dj)(Rt.current)}},A.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),A.createElement("div",{className:Ze["video-progress"]},A.createElement("progress",{ref:Le,value:"0",min:"0"}),A.createElement("input",{className:Ze.seek,ref:ke,value:"0",min:"0",type:"range",step:"1"}),A.createElement("div",{className:Ze["seek-tooltip"],ref:et,id:"seek-tooltip"},"00:00"))))),A.createElement("svg",{style:{display:"none"}},A.createElement("defs",null,A.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},A.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),A.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},A.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),A.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},A.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),A.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},A.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),A.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},A.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),A.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},A.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),A.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},A.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),A.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},A.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},25251:function(Qn,pn,L){"use strict";L.r(pn),L.d(pn,{default:function(){return Le}});var A=L(59301),ye=L(25690),ve=L(6767),Z=L(58018),x=L(29787),m=L(13747),Xe=L(38986),ae=L(48790),Ze=L(28426),V=L(11497),ne=L(55988),M=L(36193),N={flex_box_center:"flex_box_center___riBIL",flex_space_between:"flex_space_between___QnIxq",flex_box_vertical_center:"flex_box_vertical_center___lDoLU",flex_box_center_end:"flex_box_center_end___cJ2F_",flex_box_column:"flex_box_column___PSzC7",wrap:"wrap___Mlk1H",mask:"mask___MVQfB",playIconWrap:"playIconWrap___QcDy0",playIcon:"playIcon___MXK2W",linkWrap:"linkWrap___rXjTB",link:"link___uEr60",imgWrap:"imgWrap___nCe4C",cardBottom:"cardBottom___CqJQC",bottomTitle:"bottomTitle___oTGoY",timeWrap:"timeWrap___ioirP",time:"time___hl75k",bottomActionWrap:"bottomActionWrap___RhhZY",peopleWrap:"peopleWrap___TwLjM",actionIcon:"actionIcon___BfAaN"},de=L(32333),hn=L(346),Pt=L(24334),bt=Object.defineProperty,Et=Object.defineProperties,oe=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,He=(pe,_e,et)=>_e in pe?bt(pe,_e,{enumerable:!0,configurable:!0,writable:!0,value:et}):pe[_e]=et,Ie=(pe,_e)=>{for(var et in _e||(_e={}))W.call(_e,et)&&He(pe,et,_e[et]);if(K)for(var et of K(_e))Se.call(_e,et)&&He(pe,et,_e[et]);return pe},fe=(pe,_e)=>Et(pe,oe(_e));const Be=({data:pe,params:_e,onSend:et})=>{const[Xt,Sn]=(0,A.useState)(),[Rn,Pn]=(0,A.useState)({}),Ot="90%",on="55%",rt=ge=>{ge.link||(Sn(!0),Pn({videoId:ge.id,course_id:_e.coursesId,file_url:ge.play_url||ge.file_url,copyUrl:Nn(ge.play_url||ge.file_url,ge.cover_url),logWatchHistory:()=>{}}))},Nn=(ge,X)=>{let J=Pt.Base64.decode(ge);if(ge)return`<video src="${J}" controls="true" controlslist="nodownload" width="${Ot}" height="${on}" poster="${X}">\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u6807\u7B7E\u3002</video>`};return A.createElement(A.Fragment,null,pe==null?void 0:pe.map((ge,X)=>{var J;const D=ge!=null&&ge.cover_url?(J=ge==null?void 0:ge.cover_url)!=null&&J.includes("https")?ge.cover_url:hn.Z.API_SERVER+ge.cover_url:ne;return A.createElement("a",{className:N.wrap,key:ge.id},A.createElement(V.Z,{className:`animated fadeIn ${N.cardWrap}`},A.createElement(x.Z,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!ge.transcoded&&!ge.link},A.createElement("span",{className:N.imgWrap,onClick:()=>{rt(ge)}},A.createElement("img",{src:D}),ge.link&&A.createElement("a",{className:N.linkWrap,href:ge.link,target:"_blank",title:ge.title},A.createElement("span",{className:N.link},"\u5916\u94FE")),A.createElement(A.Fragment,null,A.createElement("div",{className:N.mask}),A.createElement("div",{className:N.playIconWrap},!ge.link&&A.createElement("img",{className:N.playIcon,src:M}))))),A.createElement("div",{className:N.cardBottom},A.createElement("div",{title:ge.title,className:N.bottomTitle},ge.title),A.createElement("div",{className:N.bottomActionWrap},A.createElement("div",null,"\u8BFE\u7A0B\uFF1A",A.createElement("span",{title:ge.subject},ge.subject)),A.createElement("b",{onClick:()=>et(ge)},"\u4F7F\u7528\u89C6\u9891")))))}),A.createElement(de.K,fe(Ie({},Rn),{visible:Xt,width:800,onClose:()=>{Sn(!1),Pn({})}})))};var Vt=(0,ye.connect)(({classroomList:pe})=>({classroomList:pe}))(Be),dt={flex_box_center:"flex_box_center___p5F4p",flex_space_between:"flex_space_between___XpX93",flex_box_vertical_center:"flex_box_vertical_center___CZqxk",flex_box_center_end:"flex_box_center_end___CinPQ",flex_box_column:"flex_box_column___RMknq",wrap:"wrap___fNq3s",listWrap:"listWrap____pT8s",list:"list___xQ3gD",top:"top___KkWz1",bottom:"bottom___MTHH1",tag:"tag___Sj7ii",rate:"rate___RKAhp",videoWrap:"videoWrap___Kv7Tg"},Zt=L(46373),Ce=Object.defineProperty,F=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,lt=(pe,_e,et)=>_e in pe?Ce(pe,_e,{enumerable:!0,configurable:!0,writable:!0,value:et}):pe[_e]=et,Rt=(pe,_e)=>{for(var et in _e||(_e={}))ce.call(_e,et)&<(pe,et,_e[et]);if(F)for(var et of F(_e))G.call(_e,et)&<(pe,et,_e[et]);return pe},C=(pe,_e)=>{var et={};for(var Xt in pe)ce.call(pe,Xt)&&_e.indexOf(Xt)<0&&(et[Xt]=pe[Xt]);if(pe!=null&&F)for(var Xt of F(pe))_e.indexOf(Xt)<0&&G.call(pe,Xt)&&(et[Xt]=pe[Xt]);return et},$=(pe,_e,et)=>new Promise((Xt,Sn)=>{var Rn=on=>{try{Ot(et.next(on))}catch(rt){Sn(rt)}},Pn=on=>{try{Ot(et.throw(on))}catch(rt){Sn(rt)}},Ot=on=>on.done?Xt(on.value):Promise.resolve(on.value).then(Rn,Pn);Ot((et=et.apply(pe,_e)).next())});const ke=pe=>{var _e=pe,{classroomList:et,globalSetting:Xt,user:Sn,dispatch:Rn}=_e,Pn=C(_e,["classroomList","globalSetting","user","dispatch"]);const Ot=(0,ye.useParams)(),{detailTopBanner:on,detailLeftMenus:rt,shareStatus:Nn}=et,[ge,X]=(0,A.useState)("1"),[J,D]=(0,A.useState)(0),[Ne,Fe]=(0,A.useState)(!0),[ze,Je]=(0,A.useState)([]),[z,q]=(0,A.useState)({page:1,limit:9,order:"random"});(0,A.useEffect)(()=>{z.page=1,Pe(z)},[ge]);const ie=Ae=>$(void 0,null,function*(){Fe(!0);let Y=yield(0,Xe.ZP)(`/api/courses/${Ot==null?void 0:Ot.coursesId}/ilearning_resource.json`,{method:"get",params:Rt({type:1},Ae)});Y!=null&&Y.shixuns&&(Je((Y==null?void 0:Y.shixuns)||[]),D(Y==null?void 0:Y.total_count)),Fe(!1)}),O=Ae=>$(void 0,null,function*(){Fe(!0);let Y=yield(0,Xe.ZP)(`/api/courses/${Ot==null?void 0:Ot.coursesId}/ilearning_resource.json`,{method:"get",params:Rt({type:2},Ae)});Y!=null&&Y.videos&&(Je((Y==null?void 0:Y.videos)||[]),D(Y==null?void 0:Y.total_count)),Fe(!1)}),Pe=Ae=>{ge==="1"?ie(Ae):O(Ae)},Ye=Ae=>{X(Ae.key)},Oe=[{name:"\u5B9E\u8BAD\u8D44\u6E90\u63A8\u8350",id:"1"},{name:"\u89C6\u9891\u8D44\u6E90\u63A8\u8350",id:"2"}],pt=Ae=>{z.page=Ae,q(Rt({},z)),ge==="1"?ie(z):O(z)},Qt=Ae=>$(void 0,null,function*(){const Y=yield(0,Xe.ZP)(`/api/shixuns/${Ae.identifier}/send_to_course.json`,{method:"post",body:{id:Ae.identifier,identifier:Ae.identifier,courses:[{course_id:Ot==null?void 0:Ot.coursesId,id:Ae.identifier,identifier:Ae.identifier,type:"normal",is_use:1,is_copy:0}]}});(Y==null?void 0:Y.status)===1&&(Rn({type:"classroomList/getClassroomLeftMenus",payload:{id:Ot.coursesId}}),ve.ZP.success("\u4F7F\u7528\u6210\u529F"))}),It=Ae=>$(void 0,null,function*(){const Y="jpl5vs26";console.log(Ae);const Ue=yield(0,Xe.ZP)(`/api/paths/${Ae==null?void 0:Ae.subject_identifier}/send_to_course.json`,{method:"post",body:{course_id:on==null?void 0:on.course_id,id:Ae==null?void 0:Ae.subject_identifier,stage_shixuns:[{stage_shixun_id:Ae.stage_shixun_id,is_copy:0,is_use:1}],type:"video",sync_catelog:0}});(Ue==null?void 0:Ue.status)===1&&(Rn({type:"classroomList/getClassroomLeftMenus",payload:{id:Ot==null?void 0:Ot.coursesId}}),ve.ZP.success("\u4F7F\u7528\u6210\u529F"))}),ft=()=>A.createElement("div",{className:dt.listWrap},ze==null?void 0:ze.map((Ae,Y)=>A.createElement("div",{key:Ae.id,className:dt.list},A.createElement("div",{className:dt.top},A.createElement("aside",{title:Ae.name},Ae.name),A.createElement("div",{onClick:()=>Qt(Ae)},"\u4F7F\u7528\u5B9E\u8BAD")),A.createElement("div",{className:dt.bottom},A.createElement("div",{className:dt.tag},Ae==null?void 0:Ae.author_name),A.createElement("div",{className:dt.tag},Ae==null?void 0:Ae.author_school_name),A.createElement("div",{className:dt.tag},A.createElement("span",null,"\u5173\u5361"),Ae==null?void 0:Ae.challenges_count),A.createElement("div",{className:dt.tag},A.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),Ae==null?void 0:Ae.myshixuns_count),A.createElement("div",{className:dt.rate},A.createElement(Z.Z,{allowHalf:!0,disabled:!0,defaultValue:Ae.score_info}),A.createElement("span",{className:"font14"},"\xA0",Ae.score_info?`${Ae.score_info}\u5206`:"5\u5206")))))),ee=()=>A.createElement("div",{className:dt.videoWrap},A.createElement(Vt,{params:Ot,dispatch:Rn,data:ze,onSend:It})),se=!!(on!=null&&on.sub_discipline_id);return console.log("detailTopBanner"),console.log(!!(on!=null&&on.sub_discipline_id)),A.createElement("section",{className:dt.wrap},A.createElement(Zt.Z,{isLoading:!1,tabDataSource:Oe,isAdmin:(0,ae.GJ)(),onTabMenuClick:Ye,defaultSelectedKeys:[ge],extraNode:(0,ae.GJ)()&&se&&A.createElement("span",{className:"c-blue font14 ml20 current",onClick:Ae=>{Ae.preventDefault(),Pe(z)}},A.createElement("i",{className:"iconfont icon-huanyipi font14 mr5"}),"\u6362\u4E00\u6279")}),A.createElement(x.Z,{spinning:Ne},J===0?A.createElement(Ze.Z,null):ge==="1"?ft():ee()),A.createElement(m.Z,{hideOnSinglePage:!0,onChange:Ae=>pt(Ae),current:z.page,pageSize:z.limit,total:J,showQuickJumper:!0,showSizeChanger:!1,showTotal:Ae=>A.createElement("span",{className:"mr10"},"\u5171",A.createElement("span",{className:"c-orange"},Ae),"\u6761\u6570\u636E"),className:"tr pb20"}))};var Le=(0,ye.connect)(({classroomList:pe,user:_e,globalSetting:et})=>({user:_e,classroomList:pe,globalSetting:et}))(ke)},46373:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return M}});var A=L(59301),ye=L(77019),ve=L(5269),Z=L(93041),x=L(75727),m=L(6767),Xe=L(25399),ae={tabMenuContainer:"tabMenuContainer___uf5IP",control:"control___GheLs",iconH:"iconH___Wzw_r",selectBtn:"selectBtn___mfEnI",selectBtn1:"selectBtn1___rJF8S"},Ze=L(25690),V=L(48790),M=({isLoading:N,addText:de,tabDataSource:hn,isAdmin:Pt,dispatch:bt,classroomList:Et,type:oe,isExercise:K,defaultSelectedKeys:W,onTabMenuClick:Se,getDropdownMenu:He,showControlButton:Ie,buttonText:fe,buttonIcon:Be="icon-tianjiadaohang",extraNode:Vt,user:dt,onButtonClick:Zt,isModelUser:Ce,menuItemWidth:F=125})=>{var ce,G,lt,Rt,C;const $=(0,Ze.useParams)();return A.createElement("div",{className:ae.tabMenuContainer},A.createElement(ye.Z,null,A.createElement(ve.Z,{flex:"1"},A.createElement(Z.default,{onSelect:ke=>N?{}:Se(ke),mode:"horizontal",selectedKeys:W},hn.map(ke=>A.createElement(Z.default.Item,{style:{width:F},key:typeof ke.index=="number"?ke.index:ke.id},A.createElement("span",{className:"c-grey-666"},ke.name),ke.total!==void 0&&Pt&&A.createElement("span",{className:"c-grey-999 ml20"},ke.total||0))))),Pt&&K&&A.createElement("i",{className:"iconfont icon-shezhi8",style:{display:"flex",alignItems:"center",cursor:"pointer"},onClick:()=>{bt({type:"classroomList/setActionTabs",payload:{key:"\u5728\u7EBF\u8003\u8BD5\u8BBE\u7F6E"}})}}),Pt&&A.createElement(ve.Z,{className:"mr20 gutter-row",style:{display:"flex",alignItems:"center",color:"#0152d9",paddingBottom:3}},K&&A.createElement(x.Z,{className:"mr15",placement:"bottom",arrow:!0,dropdownRender:()=>A.createElement(Z.default,null,A.createElement(Z.default.Item,{key:1,onClick:()=>{var ke;if((0,V.Rm)()&&!((ke=Et.AssistantObject.exercise)!=null&&ke.can_download)){m.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}bt({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u6210\u7EE9",type:oe,exportType:"exercise",category_id:$.categoryId}})}},"\u5B66\u751F\u6210\u7EE9"),A.createElement(Z.default.Item,{key:3,onClick:()=>{var ke;if((0,V.Rm)()&&!((ke=Et.AssistantObject.exercise)!=null&&ke.can_download)){m.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}Ze.history.push(`/classrooms/${$==null?void 0:$.coursesId}/exportlist/exercise_score,export_exercise_users`)}},"\u5386\u53F2\u5BFC\u51FA"))},A.createElement("div",{className:"c-blue font16 ml20 current",style:{marginTop:2}},A.createElement("span",{style:{color:"#666666",cursor:"pointer"}},A.createElement("i",{className:"iconfont icon-xiazai6"})))),A.createElement("div",{className:ae.control},A.createElement("div",{className:ae.extra},Vt),Ie&&(fe=="\u6DFB\u52A0\u76F4\u64AD"?A.createElement(x.Z,{menu:{items:(G=(ce=[{label:A.createElement("div",{onClick:()=>{Zt("\u5916\u94FE")}},"\u5916\u94FE\u76F4\u64AD"),key:"1",show:!0},Ce&&{label:A.createElement("div",{onClick:()=>{Zt("\u5934\u6B4C")}},"\u5934\u6B4C\u76F4\u64AD"),key:"2",show:!0}])==null?void 0:ce.filter(ke=>ke==null?void 0:ke.show))==null?void 0:G.map(ke=>({label:ke==null?void 0:ke.label,key:ke==null?void 0:ke.key}))}},A.createElement("span",{className:ae.selectBtn},A.createElement("span",null,A.createElement("i",{className:`iconfont ${Be}`})),A.createElement("span",null,fe))):A.createElement("span",{onClick:Zt,style:{cursor:"pointer"},className:ae.selectBtn},A.createElement("span",null,A.createElement("i",{className:`iconfont ${Be}`})),A.createElement("span",null,fe))),!!He&&A.createElement(x.Z,{disabled:((lt=dt==null?void 0:dt.userInfo)==null?void 0:lt.user_status)===2,className:"ml10",dropdownRender:He},A.createElement("span",{className:((Rt=dt==null?void 0:dt.userInfo)==null?void 0:Rt.user_status)===2?ae.selectBtn1:ae.selectBtn},A.createElement("span",null,A.createElement("i",{className:"iconfont icon-tianjiadaohang"})),A.createElement(Xe.Z,{title:((C=dt==null?void 0:dt.userInfo)==null?void 0:C.user_status)===2&&"\u6559\u5B66\u8BFE\u5802\u8BD5\u7528\u671F\u5DF2\u7ED3\u675F\uFF0C\u5E73\u53F0\u5DF2\u6682\u505C\u63D0\u4F9B\u5728\u7EBF\u8003\u8BD5\u521B\u5EFA\u529F\u80FD"},A.createElement("span",null,de||"\u521B\u5EFA\u8BD5\u5377"))))))))}},84989:function(Qn,pn,L){"use strict";L.d(pn,{BU:function(){return ye},Dj:function(){return A},gH:function(){return ve},vp:function(){return Z}});function A(x){try{x.mozRequestFullScreen?x.mozRequestFullScreen():x.webkitRequestFullScreen&&x.webkitRequestFullScreen()}catch(m){console.log(m,":e")}}function ye(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}const ve=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function Z(){var x=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,m=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",x),window.isFullScreen?window.isFullScreen:x!=null}},30647:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return zn}});class A{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(c,h){return c.__proto__=h,c},Object.assign=Object.assign||function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");let h=Object(c);for(let g=1;g<arguments.length;g++){let E=arguments[g];if(E!=null)for(let S in E)E.hasOwnProperty(S)&&(h[S]=E[S])}return h},typeof self.Promise!="function"&&L(3867).polyfill()}}A.install();var ye=A,ve=L(86204),Z=L.n(ve);class x{static e(c,h){(!c||x.FORCE_GLOBAL_TAG)&&(c=x.GLOBAL_TAG);let g=`[${c}] > ${h}`;x.ENABLE_CALLBACK&&x.emitter.emit("log","error",g),x.ENABLE_ERROR&&(console.error?console.error(g):console.warn?console.warn(g):console.log(g))}static i(c,h){(!c||x.FORCE_GLOBAL_TAG)&&(c=x.GLOBAL_TAG);let g=`[${c}] > ${h}`;x.ENABLE_CALLBACK&&x.emitter.emit("log","info",g),x.ENABLE_INFO&&(console.info?console.info(g):console.log(g))}static w(c,h){(!c||x.FORCE_GLOBAL_TAG)&&(c=x.GLOBAL_TAG);let g=`[${c}] > ${h}`;x.ENABLE_CALLBACK&&x.emitter.emit("log","warn",g),x.ENABLE_WARN&&(console.warn?console.warn(g):console.log(g))}static d(c,h){(!c||x.FORCE_GLOBAL_TAG)&&(c=x.GLOBAL_TAG);let g=`[${c}] > ${h}`;x.ENABLE_CALLBACK&&x.emitter.emit("log","debug",g),x.ENABLE_DEBUG&&(console.debug?console.debug(g):console.log(g))}static v(c,h){(!c||x.FORCE_GLOBAL_TAG)&&(c=x.GLOBAL_TAG);let g=`[${c}] > ${h}`;x.ENABLE_CALLBACK&&x.emitter.emit("log","verbose",g),x.ENABLE_VERBOSE&&console.log(g)}}x.GLOBAL_TAG="flv.js",x.FORCE_GLOBAL_TAG=!1,x.ENABLE_ERROR=!0,x.ENABLE_INFO=!0,x.ENABLE_WARN=!0,x.ENABLE_DEBUG=!0,x.ENABLE_VERBOSE=!0,x.ENABLE_CALLBACK=!1,x.emitter=new(Z());var m=x;class Xe{constructor(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}reset(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}addBytes(c){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=c,this._totalBytes+=c):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=c,this._totalBytes+=c):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=c,this._totalBytes+=c,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let c=(this._now()-this._lastCheckpoint)/1e3;return c==0&&(c=1),this._intervalBytes/c/1024}get lastSecondKBps(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let c=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/c/1024}}var ae=Xe;class Ze{constructor(c){this._message=c}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class V extends Ze{constructor(c){super(c)}get name(){return"IllegalStateException"}}class ne extends Ze{constructor(c){super(c)}get name(){return"InvalidArgumentException"}}class M extends Ze{constructor(c){super(c)}get name(){return"NotImplementedException"}}const N={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},de={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class hn{constructor(c){this._type=c||"undefined",this._status=N.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=N.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===N.kConnecting||this._status===N.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(c){this._onContentLengthKnown=c}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(c){this._onURLRedirect=c}get onDataArrival(){return this._onDataArrival}set onDataArrival(c){this._onDataArrival=c}get onError(){return this._onError}set onError(c){this._onError=c}get onComplete(){return this._onComplete}set onComplete(c){this._onComplete=c}open(c,h){throw new M("Unimplemented abstract function!")}abort(){throw new M("Unimplemented abstract function!")}}let Pt={};function bt(){let De=self.navigator.userAgent.toLowerCase(),c=/(edge)\/([\w.]+)/.exec(De)||/(opr)[\/]([\w.]+)/.exec(De)||/(chrome)[ \/]([\w.]+)/.exec(De)||/(iemobile)[\/]([\w.]+)/.exec(De)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(De)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(De)||/(webkit)[ \/]([\w.]+)/.exec(De)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(De)||/(msie) ([\w.]+)/.exec(De)||De.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(De)||De.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(De)||[],h=/(ipad)/.exec(De)||/(ipod)/.exec(De)||/(windows phone)/.exec(De)||/(iphone)/.exec(De)||/(kindle)/.exec(De)||/(android)/.exec(De)||/(windows)/.exec(De)||/(mac)/.exec(De)||/(linux)/.exec(De)||/(cros)/.exec(De)||[],g={browser:c[5]||c[3]||c[1]||"",version:c[2]||c[4]||"0",majorVersion:c[4]||c[2]||"0",platform:h[0]||""},E={};if(g.browser){E[g.browser]=!0;let S=g.majorVersion.split(".");E.version={major:parseInt(g.majorVersion,10),string:g.version},S.length>1&&(E.version.minor=parseInt(S[1],10)),S.length>2&&(E.version.build=parseInt(S[2],10))}if(g.platform&&(E[g.platform]=!0),(E.chrome||E.opr||E.safari)&&(E.webkit=!0),E.rv||E.iemobile){E.rv&&delete E.rv;let S="msie";g.browser=S,E[S]=!0}if(E.edge){delete E.edge;let S="msedge";g.browser=S,E[S]=!0}if(E.opr){let S="opera";g.browser=S,E[S]=!0}if(E.safari&&E.android){let S="android";g.browser=S,E[S]=!0}E.name=g.browser,E.platform=g.platform;for(let S in Pt)Pt.hasOwnProperty(S)&&delete Pt[S];Object.assign(Pt,E)}bt();var Et=Pt;class oe extends hn{static isSupported(){try{let c=Et.msedge&&Et.version.minor>=15048,h=Et.msedge?c:!0;return self.fetch&&self.ReadableStream&&h}catch(c){return!1}}constructor(c,h){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=c,this._config=h,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(c,h){this._dataSource=c,this._range=h;let g=c.url;this._config.reuseRedirectedURL&&c.redirectedURL!=null&&(g=c.redirectedURL);let E=this._seekHandler.getConfig(g,h),S=new self.Headers;if(typeof E.headers=="object"){let j=E.headers;for(let ht in j)j.hasOwnProperty(ht)&&S.append(ht,j[ht])}let k={method:"GET",headers:S,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(let j in this._config.headers)S.append(j,this._config.headers[j]);c.cors===!1&&(k.mode="same-origin"),c.withCredentials&&(k.credentials="include"),c.referrerPolicy&&(k.referrerPolicy=c.referrerPolicy),this._status=N.kConnecting,self.fetch(E.url,k).then(j=>{if(this._requestAbort){this._requestAbort=!1,this._status=N.kIdle;return}if(j.ok&&j.status>=200&&j.status<=299){if(j.url!==E.url&&this._onURLRedirect){let ut=this._seekHandler.removeURLParameters(j.url);this._onURLRedirect(ut)}let ht=j.headers.get("Content-Length");return ht!=null&&(this._contentLength=parseInt(ht),this._contentLength!==0&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,j.body.getReader())}else if(this._status=N.kError,this._onError)this._onError(de.HTTP_STATUS_CODE_INVALID,{code:j.status,msg:j.statusText});else throw new Ze("FetchStreamLoader: Http code invalid, "+j.status+" "+j.statusText)}).catch(j=>{if(this._status=N.kError,this._onError)this._onError(de.EXCEPTION,{code:-1,msg:j.message});else throw j})}abort(){this._requestAbort=!0}_pump(c){return c.read().then(h=>{if(h.done)if(this._contentLength!==null&&this._receivedLength<this._contentLength){this._status=N.kError;let g=de.EARLY_EOF,E={code:-1,msg:"Fetch stream meet Early-EOF"};if(this._onError)this._onError(g,E);else throw new Ze(E.msg)}else this._status=N.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1);else{if(this._requestAbort===!0)return this._requestAbort=!1,this._status=N.kComplete,c.cancel();this._status=N.kBuffering;let g=h.value.buffer,E=this._range.from+this._receivedLength;this._receivedLength+=g.byteLength,this._onDataArrival&&this._onDataArrival(g,E,this._receivedLength),this._pump(c)}}).catch(h=>{if(h.code===11&&Et.msedge)return;this._status=N.kError;let g=0,E=null;if((h.code===19||h.message==="network error")&&(this._contentLength===null||this._contentLength!==null&&this._receivedLength<this._contentLength)?(g=de.EARLY_EOF,E={code:h.code,msg:"Fetch stream meet Early-EOF"}):(g=de.EXCEPTION,E={code:h.code,msg:h.message}),this._onError)this._onError(g,E);else throw new Ze(E.msg)})}}var K=oe;class W extends hn{static isSupported(){try{let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="moz-chunked-arraybuffer",c.responseType==="moz-chunked-arraybuffer"}catch(c){return m.w("MozChunkedLoader",c.message),!1}}constructor(c,h){super("xhr-moz-chunked-loader"),this.TAG="MozChunkedLoader",this._seekHandler=c,this._config=h,this._needStash=!0,this._xhr=null,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}open(c,h){this._dataSource=c,this._range=h;let g=c.url;this._config.reuseRedirectedURL&&c.redirectedURL!=null&&(g=c.redirectedURL);let E=this._seekHandler.getConfig(g,h);this._requestURL=E.url;let S=this._xhr=new XMLHttpRequest;if(S.open("GET",E.url,!0),S.responseType="moz-chunked-arraybuffer",S.onreadystatechange=this._onReadyStateChange.bind(this),S.onprogress=this._onProgress.bind(this),S.onloadend=this._onLoadEnd.bind(this),S.onerror=this._onXhrError.bind(this),c.withCredentials&&(S.withCredentials=!0),typeof E.headers=="object"){let k=E.headers;for(let j in k)k.hasOwnProperty(j)&&S.setRequestHeader(j,k[j])}if(typeof this._config.headers=="object"){let k=this._config.headers;for(let j in k)k.hasOwnProperty(j)&&S.setRequestHeader(j,k[j])}this._status=N.kConnecting,S.send()}abort(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=N.kComplete}_onReadyStateChange(c){let h=c.target;if(h.readyState===2){if(h.responseURL!=null&&h.responseURL!==this._requestURL&&this._onURLRedirect){let g=this._seekHandler.removeURLParameters(h.responseURL);this._onURLRedirect(g)}if(h.status!==0&&(h.status<200||h.status>299))if(this._status=N.kError,this._onError)this._onError(de.HTTP_STATUS_CODE_INVALID,{code:h.status,msg:h.statusText});else throw new Ze("MozChunkedLoader: Http code invalid, "+h.status+" "+h.statusText);else this._status=N.kBuffering}}_onProgress(c){if(this._status===N.kError)return;this._contentLength===null&&c.total!==null&&c.total!==0&&(this._contentLength=c.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let h=c.target.response,g=this._range.from+this._receivedLength;this._receivedLength+=h.byteLength,this._onDataArrival&&this._onDataArrival(h,g,this._receivedLength)}_onLoadEnd(c){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===N.kError)return;this._status=N.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}_onXhrError(c){this._status=N.kError;let h=0,g=null;if(this._contentLength&&c.loaded<this._contentLength?(h=de.EARLY_EOF,g={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(h=de.EXCEPTION,g={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(h,g);else throw new Ze(g.msg)}}var Se=W;class He extends null{static isSupported(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="ms-stream",c.responseType==="ms-stream"}catch(c){return Log.w("MSStreamLoader",c.message),!1}}constructor(c,h){super("xhr-msstream-loader"),this.TAG="MSStreamLoader",this._seekHandler=c,this._config=h,this._needStash=!0,this._xhr=null,this._reader=null,this._totalRange=null,this._currentRange=null,this._currentRequestURL=null,this._currentRedirectedURL=null,this._contentLength=null,this._receivedLength=0,this._bufferLimit=16*1024*1024,this._lastTimeBufferSize=0,this._isReconnecting=!1}destroy(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),super.destroy()}open(c,h){this._internalOpen(c,h,!1)}_internalOpen(c,h,g){this._dataSource=c,g?this._currentRange=h:this._totalRange=h;let E=c.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?E=this._currentRedirectedURL:c.redirectedURL!=null&&(E=c.redirectedURL));let S=this._seekHandler.getConfig(E,h);this._currentRequestURL=S.url;let k=this._reader=new self.MSStreamReader;k.onprogress=this._msrOnProgress.bind(this),k.onload=this._msrOnLoad.bind(this),k.onerror=this._msrOnError.bind(this);let j=this._xhr=new XMLHttpRequest;if(j.open("GET",S.url,!0),j.responseType="ms-stream",j.onreadystatechange=this._xhrOnReadyStateChange.bind(this),j.onerror=this._xhrOnError.bind(this),c.withCredentials&&(j.withCredentials=!0),typeof S.headers=="object"){let ht=S.headers;for(let ut in ht)ht.hasOwnProperty(ut)&&j.setRequestHeader(ut,ht[ut])}if(typeof this._config.headers=="object"){let ht=this._config.headers;for(let ut in ht)ht.hasOwnProperty(ut)&&j.setRequestHeader(ut,ht[ut])}this._isReconnecting?this._isReconnecting=!1:this._status=LoaderStatus.kConnecting,j.send()}abort(){this._internalAbort(),this._status=LoaderStatus.kComplete}_internalAbort(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}_xhrOnReadyStateChange(c){let h=c.target;if(h.readyState===2)if(h.status>=200&&h.status<=299){if(this._status=LoaderStatus.kBuffering,h.responseURL!=null){let E=this._seekHandler.removeURLParameters(h.responseURL);h.responseURL!==this._currentRequestURL&&E!==this._currentRedirectedURL&&(this._currentRedirectedURL=E,this._onURLRedirect&&this._onURLRedirect(E))}let g=h.getResponseHeader("Content-Length");if(g!=null&&this._contentLength==null){let E=parseInt(g);E>0&&(this._contentLength=E,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=LoaderStatus.kError,this._onError)this._onError(LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:h.status,msg:h.statusText});else throw new RuntimeException("MSStreamLoader: Http code invalid, "+h.status+" "+h.statusText);else if(h.readyState===3&&h.status>=200&&h.status<=299){this._status=LoaderStatus.kBuffering;let g=h.response;this._reader.readAsArrayBuffer(g)}}_xhrOnError(c){this._status=LoaderStatus.kError;let h=LoaderErrors.EXCEPTION,g={code:-1,msg:c.constructor.name+" "+c.type};if(this._onError)this._onError(h,g);else throw new RuntimeException(g.msg)}_msrOnProgress(c){let g=c.target.result;if(g==null){this._doReconnectIfNeeded();return}let E=g.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=g.byteLength;let S=this._totalRange.from+this._receivedLength;this._receivedLength+=E.byteLength,this._onDataArrival&&this._onDataArrival(E,S,this._receivedLength),g.byteLength>=this._bufferLimit&&(Log.v(this.TAG,`MSStream buffer exceeded max size near ${S+E.byteLength}, reconnecting...`),this._doReconnectIfNeeded())}_doReconnectIfNeeded(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();let c={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,c,!0)}}_msrOnLoad(c){this._status=LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}_msrOnError(c){this._status=LoaderStatus.kError;let h=0,g=null;if(this._contentLength&&this._receivedLength<this._contentLength?(h=LoaderErrors.EARLY_EOF,g={code:-1,msg:"MSStream meet Early-Eof"}):(h=LoaderErrors.EARLY_EOF,g={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(h,g);else throw new RuntimeException(g.msg)}}var Ie=null;class fe extends hn{static isSupported(){try{let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="arraybuffer",c.responseType==="arraybuffer"}catch(c){return m.w("RangeLoader",c.message),!1}}constructor(c,h){super("xhr-range-loader"),this.TAG="RangeLoader",this._seekHandler=c,this._config=h,this._needStash=!1,this._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],this._currentChunkSizeKB=384,this._currentSpeedNormalized=0,this._zeroSpeedChunkCount=0,this._xhr=null,this._speedSampler=new ae,this._requestAbort=!1,this._waitForTotalLength=!1,this._totalLengthReceived=!1,this._currentRequestURL=null,this._currentRedirectedURL=null,this._currentRequestRange=null,this._totalLength=null,this._contentLength=null,this._receivedLength=0,this._lastTimeLoaded=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}get currentSpeed(){return this._speedSampler.lastSecondKBps}open(c,h){this._dataSource=c,this._range=h,this._status=N.kConnecting;let g=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(g=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!g?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}_openSubRange(){let c=this._currentChunkSizeKB*1024,h=this._range.from+this._receivedLength,g=h+c;this._contentLength!=null&&g-this._range.from>=this._contentLength&&(g=this._range.from+this._contentLength-1),this._currentRequestRange={from:h,to:g},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(c,h){this._lastTimeLoaded=0;let g=c.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?g=this._currentRedirectedURL:c.redirectedURL!=null&&(g=c.redirectedURL));let E=this._seekHandler.getConfig(g,h);this._currentRequestURL=E.url;let S=this._xhr=new XMLHttpRequest;if(S.open("GET",E.url,!0),S.responseType="arraybuffer",S.onreadystatechange=this._onReadyStateChange.bind(this),S.onprogress=this._onProgress.bind(this),S.onload=this._onLoad.bind(this),S.onerror=this._onXhrError.bind(this),c.withCredentials&&(S.withCredentials=!0),typeof E.headers=="object"){let k=E.headers;for(let j in k)k.hasOwnProperty(j)&&S.setRequestHeader(j,k[j])}if(typeof this._config.headers=="object"){let k=this._config.headers;for(let j in k)k.hasOwnProperty(j)&&S.setRequestHeader(j,k[j])}S.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=N.kComplete}_internalAbort(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}_onReadyStateChange(c){let h=c.target;if(h.readyState===2){if(h.responseURL!=null){let g=this._seekHandler.removeURLParameters(h.responseURL);h.responseURL!==this._currentRequestURL&&g!==this._currentRedirectedURL&&(this._currentRedirectedURL=g,this._onURLRedirect&&this._onURLRedirect(g))}if(h.status>=200&&h.status<=299){if(this._waitForTotalLength)return;this._status=N.kBuffering}else if(this._status=N.kError,this._onError)this._onError(de.HTTP_STATUS_CODE_INVALID,{code:h.status,msg:h.statusText});else throw new Ze("RangeLoader: Http code invalid, "+h.status+" "+h.statusText)}}_onProgress(c){if(this._status===N.kError)return;if(this._contentLength===null){let g=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,g=!0;let E=c.total;this._internalAbort(),E!=null&E!==0&&(this._totalLength=E)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,g){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let h=c.loaded-this._lastTimeLoaded;this._lastTimeLoaded=c.loaded,this._speedSampler.addBytes(h)}_normalizeSpeed(c){let h=this._chunkSizeKBList,g=h.length-1,E=0,S=0,k=g;if(c<h[0])return h[0];for(;S<=k;){if(E=S+Math.floor((k-S)/2),E===g||c>=h[E]&&c<h[E+1])return h[E];h[E]<c?S=E+1:k=E-1}}_onLoad(c){if(this._status===N.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;let h=this._speedSampler.lastSecondKBps;if(h===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(h=this._speedSampler.currentKBps)),h!==0){let k=this._normalizeSpeed(h);this._currentSpeedNormalized!==k&&(this._currentSpeedNormalized=k,this._currentChunkSizeKB=k)}let g=c.target.response,E=this._range.from+this._receivedLength;this._receivedLength+=g.byteLength;let S=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():S=!0,this._onDataArrival&&this._onDataArrival(g,E,this._receivedLength),S&&(this._status=N.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(c){this._status=N.kError;let h=0,g=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(h=de.EARLY_EOF,g={code:-1,msg:"RangeLoader meet Early-Eof"}):(h=de.EXCEPTION,g={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(h,g);else throw new Ze(g.msg)}}var Be=fe;class Vt extends hn{static isSupported(){try{return typeof self.WebSocket!="undefined"}catch(c){return!1}}constructor(){super("websocket-loader"),this.TAG="WebSocketLoader",this._needStash=!0,this._ws=null,this._requestAbort=!1,this._receivedLength=0}destroy(){this._ws&&this.abort(),super.destroy()}open(c){try{let h=this._ws=new self.WebSocket(c.url);h.binaryType="arraybuffer",h.onopen=this._onWebSocketOpen.bind(this),h.onclose=this._onWebSocketClose.bind(this),h.onmessage=this._onWebSocketMessage.bind(this),h.onerror=this._onWebSocketError.bind(this),this._status=N.kConnecting}catch(h){this._status=N.kError;let g={code:h.code,msg:h.message};if(this._onError)this._onError(de.EXCEPTION,g);else throw new Ze(g.msg)}}abort(){let c=this._ws;c&&(c.readyState===0||c.readyState===1)&&(this._requestAbort=!0,c.close()),this._ws=null,this._status=N.kComplete}_onWebSocketOpen(c){this._status=N.kBuffering}_onWebSocketClose(c){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=N.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}_onWebSocketMessage(c){if(c.data instanceof ArrayBuffer)this._dispatchArrayBuffer(c.data);else if(c.data instanceof Blob){let h=new FileReader;h.onload=()=>{this._dispatchArrayBuffer(h.result)},h.readAsArrayBuffer(c.data)}else{this._status=N.kError;let h={code:-1,msg:"Unsupported WebSocket message type: "+c.data.constructor.name};if(this._onError)this._onError(de.EXCEPTION,h);else throw new Ze(h.msg)}}_dispatchArrayBuffer(c){let h=c,g=this._receivedLength;this._receivedLength+=h.byteLength,this._onDataArrival&&this._onDataArrival(h,g,this._receivedLength)}_onWebSocketError(c){this._status=N.kError;let h={code:c.code,msg:c.message};if(this._onError)this._onError(de.EXCEPTION,h);else throw new Ze(h.msg)}}var dt=Vt;class Zt{constructor(c){this._zeroStart=c||!1}getConfig(c,h){let g={};if(h.from!==0||h.to!==-1){let E;h.to!==-1?E=`bytes=${h.from.toString()}-${h.to.toString()}`:E=`bytes=${h.from.toString()}-`,g.Range=E}else this._zeroStart&&(g.Range="bytes=0-");return{url:c,headers:g}}removeURLParameters(c){return c}}var Ce=Zt;class F{constructor(c,h){this._startName=c,this._endName=h}getConfig(c,h){let g=c;if(h.from!==0||h.to!==-1){let E=!0;g.indexOf("?")===-1&&(g+="?",E=!1),E&&(g+="&"),g+=`${this._startName}=${h.from.toString()}`,h.to!==-1&&(g+=`&${this._endName}=${h.to.toString()}`)}return{url:g,headers:{}}}removeURLParameters(c){let h=c.split("?")[0],g,E=c.indexOf("?");E!==-1&&(g=c.substring(E+1));let S="";if(g!=null&&g.length>0){let k=g.split("&");for(let j=0;j<k.length;j++){let ht=k[j].split("="),ut=j>0;ht[0]!==this._startName&&ht[0]!==this._endName&&(ut&&(S+="&"),S+=k[j])}}return S.length===0?h:h+"?"+S}}var ce=F;class G{constructor(c,h,g){this.TAG="IOController",this._config=h,this._extraData=g,this._stashInitialSize=1024*384,h.stashInitialSize!=null&&h.stashInitialSize>0&&(this._stashInitialSize=h.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,h.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=c,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(c.url),this._refTotalLength=c.filesize?c.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new ae,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}destroy(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}isWorking(){return this._loader&&this._loader.isWorking()&&!this._paused}isPaused(){return this._paused}get status(){return this._loader.status}get extraData(){return this._extraData}set extraData(c){this._extraData=c}get onDataArrival(){return this._onDataArrival}set onDataArrival(c){this._onDataArrival=c}get onSeeked(){return this._onSeeked}set onSeeked(c){this._onSeeked=c}get onError(){return this._onError}set onError(c){this._onError=c}get onComplete(){return this._onComplete}set onComplete(c){this._onComplete=c}get onRedirect(){return this._onRedirect}set onRedirect(c){this._onRedirect=c}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(c){this._onRecoveredEarlyEof=c}get currentURL(){return this._dataSource.url}get hasRedirect(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}get currentRedirectedURL(){return this._redirectedURL||this._dataSource.redirectedURL}get currentSpeed(){return this._loaderClass===Be?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let c=this._config;if(c.seekType==="range")this._seekHandler=new Ce(this._config.rangeLoadZeroStart);else if(c.seekType==="param"){let h=c.seekParamStart||"bstart",g=c.seekParamEnd||"bend";this._seekHandler=new ce(h,g)}else if(c.seekType==="custom"){if(typeof c.customSeekHandler!="function")throw new ne("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new c.customSeekHandler}else throw new ne(`Invalid seekType in config: ${c.seekType}`)}_selectLoader(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=dt;else if(K.isSupported())this._loaderClass=K;else if(Se.isSupported())this._loaderClass=Se;else if(Be.isSupported())this._loaderClass=Be;else throw new Ze("Your browser doesn't support xhr with arraybuffer responseType!")}_createLoader(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}open(c){this._currentRange={from:0,to:-1},c&&(this._currentRange.from=c),this._speedSampler.reset(),c||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}abort(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}pause(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}resume(){if(this._paused){this._paused=!1;let c=this._resumeFrom;this._resumeFrom=0,this._internalSeek(c,!0)}}seek(c){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(c,!0)}_internalSeek(c,h){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(h),this._loader.destroy(),this._loader=null;let g={from:c,to:-1};this._currentRange={from:g.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,g),this._onSeeked&&this._onSeeked()}updateUrl(c){if(!c||typeof c!="string"||c.length===0)throw new ne("Url must be a non-empty string!");this._dataSource.url=c}_expandBuffer(c){let h=this._stashSize;for(;h+1024*1024*1<c;)h*=2;if(h+=1024*1024*1,h===this._bufferSize)return;let g=new ArrayBuffer(h);if(this._stashUsed>0){let E=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(g,0,h).set(E,0)}this._stashBuffer=g,this._bufferSize=h}_normalizeSpeed(c){let h=this._speedNormalizeList,g=h.length-1,E=0,S=0,k=g;if(c<h[0])return h[0];for(;S<=k;){if(E=S+Math.floor((k-S)/2),E===g||c>=h[E]&&c<h[E+1])return h[E];h[E]<c?S=E+1:k=E-1}}_adjustStashSize(c){let h=0;this._config.isLive||c<512?h=c:c>=512&&c<=1024?h=Math.floor(c*1.5):h=c*2,h>8192&&(h=8192);let g=h*1024+1024*1024*1;this._bufferSize<g&&this._expandBuffer(g),this._stashSize=h*1024}_dispatchChunks(c,h){return this._currentRange.to=h+c.byteLength-1,this._onDataArrival(c,h)}_onURLRedirect(c){this._redirectedURL=c,this._onRedirect&&this._onRedirect(c)}_onContentLengthKnown(c){c&&this._fullRequestFlag&&(this._totalLength=c,this._fullRequestFlag=!1)}_onLoaderChunkArrival(c,h,g){if(!this._onDataArrival)throw new V("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(c.byteLength);let E=this._speedSampler.lastSecondKBps;if(E!==0){let S=this._normalizeSpeed(E);this._speedNormalized!==S&&(this._speedNormalized=S,this._adjustStashSize(S))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=h),this._stashUsed+c.byteLength<=this._stashSize)new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength;else{let S=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){let k=this._stashBuffer.slice(0,this._stashUsed),j=this._dispatchChunks(k,this._stashByteStart);if(j<k.byteLength){if(j>0){let ht=new Uint8Array(k,j);S.set(ht,0),this._stashUsed=ht.byteLength,this._stashByteStart+=j}}else this._stashUsed=0,this._stashByteStart+=j;this._stashUsed+c.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+c.byteLength),S=new Uint8Array(this._stashBuffer,0,this._bufferSize)),S.set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength}else{let k=this._dispatchChunks(c,h);if(k<c.byteLength){let j=c.byteLength-k;j>this._bufferSize&&(this._expandBuffer(j),S=new Uint8Array(this._stashBuffer,0,this._bufferSize)),S.set(new Uint8Array(c,k),0),this._stashUsed+=j,this._stashByteStart=h+k}}}else if(this._stashUsed===0){let S=this._dispatchChunks(c,h);if(S<c.byteLength){let k=c.byteLength-S;k>this._bufferSize&&this._expandBuffer(k),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(c,S),0),this._stashUsed+=k,this._stashByteStart=h+S}}else{this._stashUsed+c.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+c.byteLength);let S=new Uint8Array(this._stashBuffer,0,this._bufferSize);S.set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength;let k=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(k<this._stashUsed&&k>0){let j=new Uint8Array(this._stashBuffer,k);S.set(j,0)}this._stashUsed-=k,this._stashByteStart+=k}}_flushStashBuffer(c){if(this._stashUsed>0){let h=this._stashBuffer.slice(0,this._stashUsed),g=this._dispatchChunks(h,this._stashByteStart),E=h.byteLength-g;if(g<h.byteLength)if(c)m.w(this.TAG,`${E} bytes unconsumed data remain when flush buffer, dropped`);else{if(g>0){let S=new Uint8Array(this._stashBuffer,0,this._bufferSize),k=new Uint8Array(h,g);S.set(k,0),this._stashUsed=k.byteLength,this._stashByteStart+=g}return 0}return this._stashUsed=0,this._stashByteStart=0,E}return 0}_onLoaderComplete(c,h){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(c,h){switch(m.e(this.TAG,`Loader error, code = ${h.code}, msg = ${h.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,c=de.UNRECOVERABLE_EARLY_EOF),c){case de.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){let g=this._currentRange.to+1;g<this._totalLength&&(m.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(g,!1));return}c=de.UNRECOVERABLE_EARLY_EOF;break}case de.UNRECOVERABLE_EARLY_EOF:case de.CONNECTING_TIMEOUT:case de.HTTP_STATUS_CODE_INVALID:case de.EXCEPTION:break}if(this._onError)this._onError(c,h);else throw new Ze("IOException: "+h.msg)}}var lt=G;const Rt={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function C(){return Object.assign({},Rt)}class ${static supportMSEH264Playback(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}static supportNetworkStreamIO(){let c=new lt({},C()),h=c.loaderType;return c.destroy(),h=="fetch-stream-loader"||h=="xhr-moz-chunked-loader"}static getNetworkLoaderTypeName(){let c=new lt({},C()),h=c.loaderType;return c.destroy(),h}static supportNativeMediaPlayback(c){$.videoElement==null&&($.videoElement=window.document.createElement("video"));let h=$.videoElement.canPlayType(c);return h==="probably"||h=="maybe"}static getFeatureList(){let c={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return c.mseFlvPlayback=$.supportMSEH264Playback(),c.networkStreamIO=$.supportNetworkStreamIO(),c.networkLoaderName=$.getNetworkLoaderTypeName(),c.mseLiveFlvPlayback=c.mseFlvPlayback&&c.networkStreamIO,c.nativeMP4H264Playback=$.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),c.nativeWebmVP8Playback=$.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),c.nativeWebmVP9Playback=$.supportNativeMediaPlayback('video/webm; codecs="vp9"'),c}}var ke=$,pe={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};class _e{static get forceGlobalTag(){return m.FORCE_GLOBAL_TAG}static set forceGlobalTag(c){m.FORCE_GLOBAL_TAG=c,_e._notifyChange()}static get globalTag(){return m.GLOBAL_TAG}static set globalTag(c){m.GLOBAL_TAG=c,_e._notifyChange()}static get enableAll(){return m.ENABLE_VERBOSE&&m.ENABLE_DEBUG&&m.ENABLE_INFO&&m.ENABLE_WARN&&m.ENABLE_ERROR}static set enableAll(c){m.ENABLE_VERBOSE=c,m.ENABLE_DEBUG=c,m.ENABLE_INFO=c,m.ENABLE_WARN=c,m.ENABLE_ERROR=c,_e._notifyChange()}static get enableDebug(){return m.ENABLE_DEBUG}static set enableDebug(c){m.ENABLE_DEBUG=c,_e._notifyChange()}static get enableVerbose(){return m.ENABLE_VERBOSE}static set enableVerbose(c){m.ENABLE_VERBOSE=c,_e._notifyChange()}static get enableInfo(){return m.ENABLE_INFO}static set enableInfo(c){m.ENABLE_INFO=c,_e._notifyChange()}static get enableWarn(){return m.ENABLE_WARN}static set enableWarn(c){m.ENABLE_WARN=c,_e._notifyChange()}static get enableError(){return m.ENABLE_ERROR}static set enableError(c){m.ENABLE_ERROR=c,_e._notifyChange()}static getConfig(){return{globalTag:m.GLOBAL_TAG,forceGlobalTag:m.FORCE_GLOBAL_TAG,enableVerbose:m.ENABLE_VERBOSE,enableDebug:m.ENABLE_DEBUG,enableInfo:m.ENABLE_INFO,enableWarn:m.ENABLE_WARN,enableError:m.ENABLE_ERROR,enableCallback:m.ENABLE_CALLBACK}}static applyConfig(c){m.GLOBAL_TAG=c.globalTag,m.FORCE_GLOBAL_TAG=c.forceGlobalTag,m.ENABLE_VERBOSE=c.enableVerbose,m.ENABLE_DEBUG=c.enableDebug,m.ENABLE_INFO=c.enableInfo,m.ENABLE_WARN=c.enableWarn,m.ENABLE_ERROR=c.enableError,m.ENABLE_CALLBACK=c.enableCallback}static _notifyChange(){let c=_e.emitter;if(c.listenerCount("change")>0){let h=_e.getConfig();c.emit("change",h)}}static registerListener(c){_e.emitter.addListener("change",c)}static removeListener(c){_e.emitter.removeListener("change",c)}static addLogListener(c){m.emitter.addListener("log",c),m.emitter.listenerCount("log")>0&&(m.ENABLE_CALLBACK=!0,_e._notifyChange())}static removeLogListener(c){m.emitter.removeListener("log",c),m.emitter.listenerCount("log")===0&&(m.ENABLE_CALLBACK=!1,_e._notifyChange())}}_e.emitter=new(Z());var et=_e;class Xt{constructor(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}isComplete(){let c=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,h=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&c&&h}isSeekable(){return this.hasKeyframesIndex===!0}getNearestKeyframe(c){if(this.keyframesIndex==null)return null;let h=this.keyframesIndex,g=this._search(h.times,c);return{index:g,milliseconds:h.times[g],fileposition:h.filepositions[g]}}_search(c,h){let g=0,E=c.length-1,S=0,k=0,j=E;for(h<c[0]&&(g=0,k=j+1);k<=j;)if(S=k+Math.floor((j-k)/2),S===E||h>=c[S]&&h<c[S+1]){g=S;break}else c[S]<h?k=S+1:j=S-1;return g}}var Sn=Xt;function Rn(De,c,h){let g=De;if(c+h<g.length){for(;h--;)if((g[++c]&192)!==128)return!1;return!0}else return!1}function Pn(De){let c=[],h=De,g=0,E=De.length;for(;g<E;){if(h[g]<128){c.push(String.fromCharCode(h[g])),++g;continue}else if(!(h[g]<192)){if(h[g]<224){if(Rn(h,g,1)){let S=(h[g]&31)<<6|h[g+1]&63;if(S>=128){c.push(String.fromCharCode(S&65535)),g+=2;continue}}}else if(h[g]<240){if(Rn(h,g,2)){let S=(h[g]&15)<<12|(h[g+1]&63)<<6|h[g+2]&63;if(S>=2048&&(S&63488)!==55296){c.push(String.fromCharCode(S&65535)),g+=3;continue}}}else if(h[g]<248&&Rn(h,g,3)){let S=(h[g]&7)<<18|(h[g+1]&63)<<12|(h[g+2]&63)<<6|h[g+3]&63;if(S>65536&&S<1114112){S-=65536,c.push(String.fromCharCode(S>>>10|55296)),c.push(String.fromCharCode(S&1023|56320)),g+=4;continue}}}c.push("\uFFFD"),++g}return c.join("")}var Ot=Pn;let on=function(){let De=new ArrayBuffer(2);return new DataView(De).setInt16(0,256,!0),new Int16Array(De)[0]===256}();class rt{static parseScriptData(c,h,g){let E={};try{let S=rt.parseValue(c,h,g),k=rt.parseValue(c,h+S.size,g-S.size);E[S.data]=k.data}catch(S){m.e("AMF",S.toString())}return E}static parseObject(c,h,g){if(g<3)throw new V("Data not enough when parse ScriptDataObject");let E=rt.parseString(c,h,g),S=rt.parseValue(c,h+E.size,g-E.size),k=S.objectEnd;return{data:{name:E.data,value:S.data},size:E.size+S.size,objectEnd:k}}static parseVariable(c,h,g){return rt.parseObject(c,h,g)}static parseString(c,h,g){if(g<2)throw new V("Data not enough when parse String");let S=new DataView(c,h,g).getUint16(0,!on),k;return S>0?k=Ot(new Uint8Array(c,h+2,S)):k="",{data:k,size:2+S}}static parseLongString(c,h,g){if(g<4)throw new V("Data not enough when parse LongString");let S=new DataView(c,h,g).getUint32(0,!on),k;return S>0?k=Ot(new Uint8Array(c,h+4,S)):k="",{data:k,size:4+S}}static parseDate(c,h,g){if(g<10)throw new V("Data size invalid when parse Date");let E=new DataView(c,h,g),S=E.getFloat64(0,!on),k=E.getInt16(8,!on);return S+=k*60*1e3,{data:new Date(S),size:10}}static parseValue(c,h,g){if(g<1)throw new V("Data not enough when parse Value");let E=new DataView(c,h,g),S=1,k=E.getUint8(0),j,ht=!1;try{switch(k){case 0:j=E.getFloat64(1,!on),S+=8;break;case 1:{j=!!E.getUint8(1),S+=1;break}case 2:{let ut=rt.parseString(c,h+1,g-1);j=ut.data,S+=ut.size;break}case 3:{j={};let ut=0;for((E.getUint32(g-4,!on)&16777215)===9&&(ut=3);S<g-4;){let _t=rt.parseObject(c,h+S,g-S-ut);if(_t.objectEnd)break;j[_t.data.name]=_t.data.value,S+=_t.size}S<=g-3&&(E.getUint32(S-1,!on)&16777215)===9&&(S+=3);break}case 8:{j={},S+=4;let ut=0;for((E.getUint32(g-4,!on)&16777215)===9&&(ut=3);S<g-8;){let _t=rt.parseVariable(c,h+S,g-S-ut);if(_t.objectEnd)break;j[_t.data.name]=_t.data.value,S+=_t.size}S<=g-3&&(E.getUint32(S-1,!on)&16777215)===9&&(S+=3);break}case 9:j=void 0,S=1,ht=!0;break;case 10:{j=[];let ut=E.getUint32(1,!on);S+=4;for(let _t=0;_t<ut;_t++){let ln=rt.parseValue(c,h+S,g-S);j.push(ln.data),S+=ln.size}break}case 11:{let ut=rt.parseDate(c,h+1,g-1);j=ut.data,S+=ut.size;break}case 12:{let ut=rt.parseString(c,h+1,g-1);j=ut.data,S+=ut.size;break}default:S=g,m.w("AMF","Unsupported AMF value type "+k)}}catch(ut){m.e("AMF",ut.toString())}return{data:j,size:S,objectEnd:ht}}}var Nn=rt;class ge{constructor(c){this.TAG="ExpGolomb",this._buffer=c,this._buffer_index=0,this._total_bytes=c.byteLength,this._total_bits=c.byteLength*8,this._current_word=0,this._current_word_bits_left=0}destroy(){this._buffer=null}_fillCurrentWord(){let c=this._total_bytes-this._buffer_index;if(c<=0)throw new V("ExpGolomb: _fillCurrentWord() but no bytes available");let h=Math.min(4,c),g=new Uint8Array(4);g.set(this._buffer.subarray(this._buffer_index,this._buffer_index+h)),this._current_word=new DataView(g.buffer).getUint32(0,!1),this._buffer_index+=h,this._current_word_bits_left=h*8}readBits(c){if(c>32)throw new ne("ExpGolomb: readBits() bits exceeded max 32bits!");if(c<=this._current_word_bits_left){let k=this._current_word>>>32-c;return this._current_word<<=c,this._current_word_bits_left-=c,k}let h=this._current_word_bits_left?this._current_word:0;h=h>>>32-this._current_word_bits_left;let g=c-this._current_word_bits_left;this._fillCurrentWord();let E=Math.min(g,this._current_word_bits_left),S=this._current_word>>>32-E;return this._current_word<<=E,this._current_word_bits_left-=E,h=h<<E|S,h}readBool(){return this.readBits(1)===1}readByte(){return this.readBits(8)}_skipLeadingZero(){let c;for(c=0;c<this._current_word_bits_left;c++)if(this._current_word&2147483648>>>c)return this._current_word<<=c,this._current_word_bits_left-=c,c;return this._fillCurrentWord(),c+this._skipLeadingZero()}readUEG(){let c=this._skipLeadingZero();return this.readBits(c+1)-1}readSEG(){let c=this.readUEG();return c&1?c+1>>>1:-1*(c>>>1)}}var X=ge;class J{static _ebsp2rbsp(c){let h=c,g=h.byteLength,E=new Uint8Array(g),S=0;for(let k=0;k<g;k++)k>=2&&h[k]===3&&h[k-1]===0&&h[k-2]===0||(E[S]=h[k],S++);return new Uint8Array(E.buffer,0,S)}static parseSPS(c){let h=J._ebsp2rbsp(c),g=new X(h);g.readByte();let E=g.readByte();g.readByte();let S=g.readByte();g.readUEG();let k=J.getProfileString(E),j=J.getLevelString(S),ht=1,ut=420,_t=[0,420,422,444],ln=8;if((E===100||E===110||E===122||E===244||E===44||E===83||E===86||E===118||E===128||E===138||E===144)&&(ht=g.readUEG(),ht===3&&g.readBits(1),ht<=3&&(ut=_t[ht]),ln=g.readUEG()+8,g.readUEG(),g.readBits(1),g.readBool())){let At=ht!==3?8:12;for(let qt=0;qt<At;qt++)g.readBool()&&(qt<6?J._skipScalingList(g,16):J._skipScalingList(g,64))}g.readUEG();let _=g.readUEG();if(_===0)g.readUEG();else if(_===1){g.readBits(1),g.readSEG(),g.readSEG();let At=g.readUEG();for(let qt=0;qt<At;qt++)g.readSEG()}let R=g.readUEG();g.readBits(1);let re=g.readUEG(),Q=g.readUEG(),U=g.readBits(1);U===0&&g.readBits(1),g.readBits(1);let Ee=0,Re=0,be=0,We=0;g.readBool()&&(Ee=g.readUEG(),Re=g.readUEG(),be=g.readUEG(),We=g.readUEG());let Lt=1,Qe=1,st=0,we=!0,w=0,H=0;if(g.readBool()){if(g.readBool()){let At=g.readByte(),qt=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],xt=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];At>0&&At<16?(Lt=qt[At-1],Qe=xt[At-1]):At===255&&(Lt=g.readByte()<<8|g.readByte(),Qe=g.readByte()<<8|g.readByte())}if(g.readBool()&&g.readBool(),g.readBool()&&(g.readBits(4),g.readBool()&&g.readBits(24)),g.readBool()&&(g.readUEG(),g.readUEG()),g.readBool()){let At=g.readBits(32),qt=g.readBits(32);we=g.readBool(),w=qt,H=At*2,st=w/H}}let le=1;(Lt!==1||Qe!==1)&&(le=Lt/Qe);let Ge=0,Ve=0;if(ht===0)Ge=1,Ve=2-U;else{let At=ht===3?1:2,qt=ht===1?2:1;Ge=At,Ve=qt*(2-U)}let $e=(re+1)*16,vt=(2-U)*((Q+1)*16);$e-=(Ee+Re)*Ge,vt-=(be+We)*Ve;let Ct=Math.ceil($e*le);return g.destroy(),g=null,{profile_string:k,level_string:j,bit_depth:ln,ref_frames:R,chroma_format:ut,chroma_format_string:J.getChromaFormatString(ut),frame_rate:{fixed:we,fps:st,fps_den:H,fps_num:w},sar_ratio:{width:Lt,height:Qe},codec_size:{width:$e,height:vt},present_size:{width:Ct,height:vt}}}static _skipScalingList(c,h){let g=8,E=8,S=0;for(let k=0;k<h;k++)E!==0&&(S=c.readSEG(),E=(g+S+256)%256),g=E===0?g:E}static getProfileString(c){switch(c){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}static getLevelString(c){return(c/10).toFixed(1)}static getChromaFormatString(c){switch(c){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}var D=J,Fe={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};function ze(De){return De>>>8&255|(De&255)<<8}function Je(De){return(De&4278190080)>>>24|(De&16711680)>>>8|(De&65280)<<8|(De&255)<<24}function z(De,c){return De[c]<<24|De[c+1]<<16|De[c+2]<<8|De[c+3]}class q{constructor(c,h){this.TAG="FLVDemuxer",this._config=h,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=c.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=c.hasAudioTrack,this._hasVideo=c.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new Sn,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){let g=new ArrayBuffer(2);return new DataView(g).setInt16(0,256,!0),new Int16Array(g)[0]===256}()}destroy(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}static probe(c){let h=new Uint8Array(c),g={match:!1};if(h[0]!==70||h[1]!==76||h[2]!==86||h[3]!==1)return g;let E=(h[4]&4)>>>2!==0,S=(h[4]&1)!==0,k=z(h,5);return k<9?g:{match:!0,consumed:k,dataOffset:k,hasAudioTrack:E,hasVideoTrack:S}}bindDataSource(c){return c.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(c){this._onTrackMetadata=c}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(c){this._onMediaInfo=c}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(c){this._onMetaDataArrived=c}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(c){this._onScriptDataArrived=c}get onError(){return this._onError}set onError(c){this._onError=c}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(c){this._onDataAvailable=c}get timestampBase(){return this._timestampBase}set timestampBase(c){this._timestampBase=c}get overridedDuration(){return this._duration}set overridedDuration(c){this._durationOverrided=!0,this._duration=c,this._mediaInfo.duration=c}set overridedHasAudio(c){this._hasAudioFlagOverrided=!0,this._hasAudio=c,this._mediaInfo.hasAudio=c}set overridedHasVideo(c){this._hasVideoFlagOverrided=!0,this._hasVideo=c,this._mediaInfo.hasVideo=c}resetMediaInfo(){this._mediaInfo=new Sn}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}parseChunks(c,h){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new V("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let g=0,E=this._littleEndian;if(h===0)if(c.byteLength>13)g=q.probe(c).dataOffset;else return 0;for(this._firstParse&&(this._firstParse=!1,h+g!==this._dataOffset&&m.w(this.TAG,"First time parsing but chunk byteStart invalid!"),new DataView(c,g).getUint32(0,!E)!==0&&m.w(this.TAG,"PrevTagSize0 !== 0 !!!"),g+=4);g<c.byteLength;){this._dispatch=!0;let S=new DataView(c,g);if(g+11+4>c.byteLength)break;let k=S.getUint8(0),j=S.getUint32(0,!E)&16777215;if(g+11+j+4>c.byteLength)break;if(k!==8&&k!==9&&k!==18){m.w(this.TAG,`Unsupported tag type ${k}, skipped`),g+=11+j+4;continue}let ht=S.getUint8(4),ut=S.getUint8(5),_t=S.getUint8(6),ln=S.getUint8(7),_=_t|ut<<8|ht<<16|ln<<24;(S.getUint32(7,!E)&16777215)!==0&&m.w(this.TAG,"Meet tag which has StreamID != 0!");let re=g+11;switch(k){case 8:this._parseAudioData(c,re,j,_);break;case 9:this._parseVideoData(c,re,j,_,h+g);break;case 18:this._parseScriptData(c,re,j);break}let Q=S.getUint32(11+j,!E);Q!==11+j&&m.w(this.TAG,`Invalid PrevTagSize ${Q}`),g+=11+j+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),g}_parseScriptData(c,h,g){let E=Nn.parseScriptData(c,h,g);if(E.hasOwnProperty("onMetaData")){if(E.onMetaData==null||typeof E.onMetaData!="object"){m.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&m.w(this.TAG,"Found another onMetaData tag!"),this._metadata=E;let S=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},S)),typeof S.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=S.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof S.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=S.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof S.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=S.audiodatarate),typeof S.videodatarate=="number"&&(this._mediaInfo.videoDataRate=S.videodatarate),typeof S.width=="number"&&(this._mediaInfo.width=S.width),typeof S.height=="number"&&(this._mediaInfo.height=S.height),typeof S.duration=="number"){if(!this._durationOverrided){let k=Math.floor(S.duration*this._timescale);this._duration=k,this._mediaInfo.duration=k}}else this._mediaInfo.duration=0;if(typeof S.framerate=="number"){let k=Math.floor(S.framerate*1e3);if(k>0){let j=k/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=j,this._referenceFrameRate.fps_num=k,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=j}}if(typeof S.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;let k=S.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(k),S.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=S,m.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(E).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},E))}_parseKeyframesIndex(c){let h=[],g=[];for(let E=1;E<c.times.length;E++){let S=this._timestampBase+Math.floor(c.times[E]*1e3);h.push(S),g.push(c.filepositions[E])}return{times:h,filepositions:g}}_parseAudioData(c,h,g,E){if(g<=1){m.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;let S=this._littleEndian,j=new DataView(c,h,g).getUint8(0),ht=j>>>4;if(ht!==2&&ht!==10){this._onError(Fe.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+ht);return}let ut=0,_t=(j&12)>>>2;if(_t>=0&&_t<=4)ut=this._flvSoundRateTable[_t];else{this._onError(Fe.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+_t);return}let ln=(j&2)>>>1,_=j&1,R=this._audioMetadata,re=this._audioTrack;if(R||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),R=this._audioMetadata={},R.type="audio",R.id=re.id,R.timescale=this._timescale,R.duration=this._duration,R.audioSampleRate=ut,R.channelCount=_===0?1:2),ht===10){let Q=this._parseAACAudioData(c,h+1,g-1);if(Q==null)return;if(Q.packetType===0){R.config&&m.w(this.TAG,"Found another AudioSpecificConfig!");let U=Q.data;R.audioSampleRate=U.samplingRate,R.channelCount=U.channelCount,R.codec=U.codec,R.originalCodec=U.originalCodec,R.config=U.config,R.refSampleDuration=1024/R.audioSampleRate*R.timescale,m.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",R);let Ee=this._mediaInfo;Ee.audioCodec=R.originalCodec,Ee.audioSampleRate=R.audioSampleRate,Ee.audioChannelCount=R.channelCount,Ee.hasVideo?Ee.videoCodec!=null&&(Ee.mimeType='video/x-flv; codecs="'+Ee.videoCodec+","+Ee.audioCodec+'"'):Ee.mimeType='video/x-flv; codecs="'+Ee.audioCodec+'"',Ee.isComplete()&&this._onMediaInfo(Ee)}else if(Q.packetType===1){let U=this._timestampBase+E,Ee={unit:Q.data,length:Q.data.byteLength,dts:U,pts:U};re.samples.push(Ee),re.length+=Q.data.length}else m.e(this.TAG,`Flv: Unsupported AAC data type ${Q.packetType}`)}else if(ht===2){if(!R.codec){let Re=this._parseMP3AudioData(c,h+1,g-1,!0);if(Re==null)return;R.audioSampleRate=Re.samplingRate,R.channelCount=Re.channelCount,R.codec=Re.codec,R.originalCodec=Re.originalCodec,R.refSampleDuration=1152/R.audioSampleRate*R.timescale,m.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",R);let be=this._mediaInfo;be.audioCodec=R.codec,be.audioSampleRate=R.audioSampleRate,be.audioChannelCount=R.channelCount,be.audioDataRate=Re.bitRate,be.hasVideo?be.videoCodec!=null&&(be.mimeType='video/x-flv; codecs="'+be.videoCodec+","+be.audioCodec+'"'):be.mimeType='video/x-flv; codecs="'+be.audioCodec+'"',be.isComplete()&&this._onMediaInfo(be)}let Q=this._parseMP3AudioData(c,h+1,g-1,!1);if(Q==null)return;let U=this._timestampBase+E,Ee={unit:Q,length:Q.byteLength,dts:U,pts:U};re.samples.push(Ee),re.length+=Q.length}}_parseAACAudioData(c,h,g){if(g<=1){m.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}let E={},S=new Uint8Array(c,h,g);return E.packetType=S[0],S[0]===0?E.data=this._parseAACAudioSpecificConfig(c,h+1,g-1):E.data=S.subarray(1),E}_parseAACAudioSpecificConfig(c,h,g){let E=new Uint8Array(c,h,g),S=null,k=0,j=0,ht=null,ut=0,_t=null;if(k=j=E[0]>>>3,ut=(E[0]&7)<<1|E[1]>>>7,ut<0||ut>=this._mpegSamplingRates.length){this._onError(Fe.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}let ln=this._mpegSamplingRates[ut],_=(E[1]&120)>>>3;if(_<0||_>=8){this._onError(Fe.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}k===5&&(_t=(E[1]&7)<<1|E[2]>>>7,ht=(E[2]&124)>>>2);let R=self.navigator.userAgent.toLowerCase();return R.indexOf("firefox")!==-1?ut>=6?(k=5,S=new Array(4),_t=ut-3):(k=2,S=new Array(2),_t=ut):R.indexOf("android")!==-1?(k=2,S=new Array(2),_t=ut):(k=5,_t=ut,S=new Array(4),ut>=6?_t=ut-3:_===1&&(k=2,S=new Array(2),_t=ut)),S[0]=k<<3,S[0]|=(ut&15)>>>1,S[1]=(ut&15)<<7,S[1]|=(_&15)<<3,k===5&&(S[1]|=(_t&15)>>>1,S[2]=(_t&1)<<7,S[2]|=8,S[3]=0),{config:S,samplingRate:ln,channelCount:_,codec:"mp4a.40."+k,originalCodec:"mp4a.40."+j}}_parseMP3AudioData(c,h,g,E){if(g<4){m.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}let S=this._littleEndian,k=new Uint8Array(c,h,g),j=null;if(E){if(k[0]!==255)return;let ht=k[1]>>>3&3,ut=(k[1]&6)>>1,_t=(k[2]&240)>>>4,ln=(k[2]&12)>>>2,R=(k[3]>>>6&3)!==3?2:1,re=0,Q=0,U=34,Ee="mp3";switch(ht){case 0:re=this._mpegAudioV25SampleRateTable[ln];break;case 2:re=this._mpegAudioV20SampleRateTable[ln];break;case 3:re=this._mpegAudioV10SampleRateTable[ln];break}switch(ut){case 1:U=34,_t<this._mpegAudioL3BitRateTable.length&&(Q=this._mpegAudioL3BitRateTable[_t]);break;case 2:U=33,_t<this._mpegAudioL2BitRateTable.length&&(Q=this._mpegAudioL2BitRateTable[_t]);break;case 3:U=32,_t<this._mpegAudioL1BitRateTable.length&&(Q=this._mpegAudioL1BitRateTable[_t]);break}j={bitRate:Q,samplingRate:re,channelCount:R,codec:Ee,originalCodec:Ee}}else j=k;return j}_parseVideoData(c,h,g,E,S){if(g<=1){m.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;let k=new Uint8Array(c,h,g)[0],j=(k&240)>>>4,ht=k&15;if(ht!==7){this._onError(Fe.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${ht}`);return}this._parseAVCVideoPacket(c,h+1,g-1,E,S,j)}_parseAVCVideoPacket(c,h,g,E,S,k){if(g<4){m.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}let j=this._littleEndian,ht=new DataView(c,h,g),ut=ht.getUint8(0),ln=(ht.getUint32(0,!j)&16777215)<<8>>8;if(ut===0)this._parseAVCDecoderConfigurationRecord(c,h+4,g-4);else if(ut===1)this._parseAVCVideoData(c,h+4,g-4,E,S,k,ln);else if(ut!==2){this._onError(Fe.FORMAT_ERROR,`Flv: Invalid video packet type ${ut}`);return}}_parseAVCDecoderConfigurationRecord(c,h,g){if(g<7){m.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}let E=this._videoMetadata,S=this._videoTrack,k=this._littleEndian,j=new DataView(c,h,g);E?typeof E.avcc!="undefined"&&m.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),E=this._videoMetadata={},E.type="video",E.id=S.id,E.timescale=this._timescale,E.duration=this._duration);let ht=j.getUint8(0),ut=j.getUint8(1),_t=j.getUint8(2),ln=j.getUint8(3);if(ht!==1||ut===0){this._onError(Fe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(j.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Fe.FORMAT_ERROR,`Flv: Strange NaluLengthSizeMinusOne: ${this._naluLengthSize-1}`);return}let _=j.getUint8(5)&31;if(_===0){this._onError(Fe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else _>1&&m.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${_}`);let R=6;for(let Q=0;Q<_;Q++){let U=j.getUint16(R,!k);if(R+=2,U===0)continue;let Ee=new Uint8Array(c,h+R,U);R+=U;let Re=D.parseSPS(Ee);if(Q!==0)continue;E.codecWidth=Re.codec_size.width,E.codecHeight=Re.codec_size.height,E.presentWidth=Re.present_size.width,E.presentHeight=Re.present_size.height,E.profile=Re.profile_string,E.level=Re.level_string,E.bitDepth=Re.bit_depth,E.chromaFormat=Re.chroma_format,E.sarRatio=Re.sar_ratio,E.frameRate=Re.frame_rate,(Re.frame_rate.fixed===!1||Re.frame_rate.fps_num===0||Re.frame_rate.fps_den===0)&&(E.frameRate=this._referenceFrameRate);let be=E.frameRate.fps_den,We=E.frameRate.fps_num;E.refSampleDuration=E.timescale*(be/We);let qe=Ee.subarray(1,4),Lt="avc1.";for(let st=0;st<3;st++){let we=qe[st].toString(16);we.length<2&&(we="0"+we),Lt+=we}E.codec=Lt;let Qe=this._mediaInfo;Qe.width=E.codecWidth,Qe.height=E.codecHeight,Qe.fps=E.frameRate.fps,Qe.profile=E.profile,Qe.level=E.level,Qe.refFrames=Re.ref_frames,Qe.chromaFormat=Re.chroma_format_string,Qe.sarNum=E.sarRatio.width,Qe.sarDen=E.sarRatio.height,Qe.videoCodec=Lt,Qe.hasAudio?Qe.audioCodec!=null&&(Qe.mimeType='video/x-flv; codecs="'+Qe.videoCodec+","+Qe.audioCodec+'"'):Qe.mimeType='video/x-flv; codecs="'+Qe.videoCodec+'"',Qe.isComplete()&&this._onMediaInfo(Qe)}let re=j.getUint8(R);if(re===0){this._onError(Fe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else re>1&&m.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${re}`);R++;for(let Q=0;Q<re;Q++){let U=j.getUint16(R,!k);R+=2,U!==0&&(R+=U)}E.avcc=new Uint8Array(g),E.avcc.set(new Uint8Array(c,h,g),0),m.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",E)}_parseAVCVideoData(c,h,g,E,S,k,j){let ht=this._littleEndian,ut=new DataView(c,h,g),_t=[],ln=0,_=0;const R=this._naluLengthSize;let re=this._timestampBase+E,Q=k===1;for(;_<g;){if(_+4>=g){m.w(this.TAG,`Malformed Nalu near timestamp ${re}, offset = ${_}, dataSize = ${g}`);break}let U=ut.getUint32(_,!ht);if(R===3&&(U>>>=8),U>g-R){m.w(this.TAG,`Malformed Nalus near timestamp ${re}, NaluSize > DataSize!`);return}let Ee=ut.getUint8(_+R)&31;Ee===5&&(Q=!0);let Re=new Uint8Array(c,h+_,R+U),be={type:Ee,data:Re};_t.push(be),ln+=Re.byteLength,_+=R+U}if(_t.length){let U=this._videoTrack,Ee={units:_t,length:ln,isKeyframe:Q,dts:re,cts:j,pts:re+j};Q&&(Ee.fileposition=S),U.samples.push(Ee),U.length+=ln}}}var ie=q;class O{static init(){O.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(let h in O.types)O.types.hasOwnProperty(h)&&(O.types[h]=[h.charCodeAt(0),h.charCodeAt(1),h.charCodeAt(2),h.charCodeAt(3)]);let c=O.constants={};c.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),c.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),c.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),c.STSC=c.STCO=c.STTS,c.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),c.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),c.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),c.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),c.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),c.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(c){let h=8,g=null,E=Array.prototype.slice.call(arguments,1),S=E.length;for(let j=0;j<S;j++)h+=E[j].byteLength;g=new Uint8Array(h),g[0]=h>>>24&255,g[1]=h>>>16&255,g[2]=h>>>8&255,g[3]=h&255,g.set(c,4);let k=8;for(let j=0;j<S;j++)g.set(E[j],k),k+=E[j].byteLength;return g}static generateInitSegment(c){let h=O.box(O.types.ftyp,O.constants.FTYP),g=O.moov(c),E=new Uint8Array(h.byteLength+g.byteLength);return E.set(h,0),E.set(g,h.byteLength),E}static moov(c){let h=O.mvhd(c.timescale,c.duration),g=O.trak(c),E=O.mvex(c);return O.box(O.types.moov,h,g,E)}static mvhd(c,h){return O.box(O.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,c>>>24&255,c>>>16&255,c>>>8&255,c&255,h>>>24&255,h>>>16&255,h>>>8&255,h&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]))}static trak(c){return O.box(O.types.trak,O.tkhd(c),O.mdia(c))}static tkhd(c){let h=c.id,g=c.duration,E=c.presentWidth,S=c.presentHeight;return O.box(O.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,0,0,0,0,g>>>24&255,g>>>16&255,g>>>8&255,g&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,E>>>8&255,E&255,0,0,S>>>8&255,S&255,0,0]))}static mdia(c){return O.box(O.types.mdia,O.mdhd(c),O.hdlr(c),O.minf(c))}static mdhd(c){let h=c.timescale,g=c.duration;return O.box(O.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,g>>>24&255,g>>>16&255,g>>>8&255,g&255,85,196,0,0]))}static hdlr(c){let h=null;return c.type==="audio"?h=O.constants.HDLR_AUDIO:h=O.constants.HDLR_VIDEO,O.box(O.types.hdlr,h)}static minf(c){let h=null;return c.type==="audio"?h=O.box(O.types.smhd,O.constants.SMHD):h=O.box(O.types.vmhd,O.constants.VMHD),O.box(O.types.minf,h,O.dinf(),O.stbl(c))}static dinf(){return O.box(O.types.dinf,O.box(O.types.dref,O.constants.DREF))}static stbl(c){return O.box(O.types.stbl,O.stsd(c),O.box(O.types.stts,O.constants.STTS),O.box(O.types.stsc,O.constants.STSC),O.box(O.types.stsz,O.constants.STSZ),O.box(O.types.stco,O.constants.STCO))}static stsd(c){return c.type==="audio"?c.codec==="mp3"?O.box(O.types.stsd,O.constants.STSD_PREFIX,O.mp3(c)):O.box(O.types.stsd,O.constants.STSD_PREFIX,O.mp4a(c)):O.box(O.types.stsd,O.constants.STSD_PREFIX,O.avc1(c))}static mp3(c){let h=c.channelCount,g=c.audioSampleRate,E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,h,0,16,0,0,0,0,g>>>8&255,g&255,0,0]);return O.box(O.types[".mp3"],E)}static mp4a(c){let h=c.channelCount,g=c.audioSampleRate,E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,h,0,16,0,0,0,0,g>>>8&255,g&255,0,0]);return O.box(O.types.mp4a,E,O.esds(c))}static esds(c){let h=c.config||[],g=h.length,E=new Uint8Array([0,0,0,0,3,23+g,0,1,0,4,15+g,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([g]).concat(h).concat([6,1,2]));return O.box(O.types.esds,E)}static avc1(c){let h=c.avcc,g=c.codecWidth,E=c.codecHeight,S=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,g>>>8&255,g&255,E>>>8&255,E&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return O.box(O.types.avc1,S,O.box(O.types.avcC,h))}static mvex(c){return O.box(O.types.mvex,O.trex(c))}static trex(c){let h=c.id,g=new Uint8Array([0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return O.box(O.types.trex,g)}static moof(c,h){return O.box(O.types.moof,O.mfhd(c.sequenceNumber),O.traf(c,h))}static mfhd(c){let h=new Uint8Array([0,0,0,0,c>>>24&255,c>>>16&255,c>>>8&255,c&255]);return O.box(O.types.mfhd,h)}static traf(c,h){let g=c.id,E=O.box(O.types.tfhd,new Uint8Array([0,0,0,0,g>>>24&255,g>>>16&255,g>>>8&255,g&255])),S=O.box(O.types.tfdt,new Uint8Array([0,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255])),k=O.sdtp(c),j=O.trun(c,k.byteLength+16+16+8+16+8+8);return O.box(O.types.traf,E,S,j,k)}static sdtp(c){let h=c.samples||[],g=h.length,E=new Uint8Array(4+g);for(let S=0;S<g;S++){let k=h[S].flags;E[S+4]=k.isLeading<<6|k.dependsOn<<4|k.isDependedOn<<2|k.hasRedundancy}return O.box(O.types.sdtp,E)}static trun(c,h){let g=c.samples||[],E=g.length,S=12+16*E,k=new Uint8Array(S);h+=8+S,k.set([0,0,15,1,E>>>24&255,E>>>16&255,E>>>8&255,E&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255],0);for(let j=0;j<E;j++){let ht=g[j].duration,ut=g[j].size,_t=g[j].flags,ln=g[j].cts;k.set([ht>>>24&255,ht>>>16&255,ht>>>8&255,ht&255,ut>>>24&255,ut>>>16&255,ut>>>8&255,ut&255,_t.isLeading<<2|_t.dependsOn,_t.isDependedOn<<6|_t.hasRedundancy<<4|_t.isNonSync,0,0,ln>>>24&255,ln>>>16&255,ln>>>8&255,ln&255],12+16*j)}return O.box(O.types.trun,k)}static mdat(c){return O.box(O.types.mdat,c)}}O.init();var Pe=O;class Ye{static getSilentFrame(c,h){if(c==="mp4a.40.2"){if(h===1)return new Uint8Array([0,200,0,128,35,128]);if(h===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(h===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(h===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(h===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(h===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(h===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(h===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(h===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}var Oe=Ye;class pt{constructor(c,h,g,E,S){this.dts=c,this.pts=h,this.duration=g,this.originalDts=E,this.isSyncPoint=S,this.fileposition=null}}class Qt{constructor(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}appendSyncPoint(c){c.isSyncPoint=!0,this.syncPoints.push(c)}}class It{constructor(){this._list=[]}clear(){this._list=[]}appendArray(c){let h=this._list;c.length!==0&&(h.length>0&&c[0].originalDts<h[h.length-1].originalDts&&this.clear(),Array.prototype.push.apply(h,c))}getLastSyncPointBeforeDts(c){if(this._list.length==0)return null;let h=this._list,g=0,E=h.length-1,S=0,k=0,j=E;for(c<h[0].dts&&(g=0,k=j+1);k<=j;)if(S=k+Math.floor((j-k)/2),S===E||c>=h[S].dts&&c<h[S+1].dts){g=S;break}else h[S].dts<c?k=S+1:j=S-1;return this._list[g]}}class ft{constructor(c){this._type=c,this._list=[],this._lastAppendLocation=-1}get type(){return this._type}get length(){return this._list.length}isEmpty(){return this._list.length===0}clear(){this._list=[],this._lastAppendLocation=-1}_searchNearestSegmentBefore(c){let h=this._list;if(h.length===0)return-2;let g=h.length-1,E=0,S=0,k=g,j=0;if(c<h[0].originalBeginDts)return j=-1,j;for(;S<=k;)if(E=S+Math.floor((k-S)/2),E===g||c>h[E].lastSample.originalDts&&c<h[E+1].originalBeginDts){j=E;break}else h[E].originalBeginDts<c?S=E+1:k=E-1;return j}_searchNearestSegmentAfter(c){return this._searchNearestSegmentBefore(c)+1}append(c){let h=this._list,g=c,E=this._lastAppendLocation,S=0;E!==-1&&E<h.length&&g.originalBeginDts>=h[E].lastSample.originalDts&&(E===h.length-1||E<h.length-1&&g.originalBeginDts<h[E+1].originalBeginDts)?S=E+1:h.length>0&&(S=this._searchNearestSegmentBefore(g.originalBeginDts)+1),this._lastAppendLocation=S,this._list.splice(S,0,g)}getLastSegmentBefore(c){let h=this._searchNearestSegmentBefore(c);return h>=0?this._list[h]:null}getLastSampleBefore(c){let h=this.getLastSegmentBefore(c);return h!=null?h.lastSample:null}getLastSyncPointBefore(c){let h=this._searchNearestSegmentBefore(c),g=this._list[h].syncPoints;for(;g.length===0&&h>0;)h--,g=this._list[h].syncPoints;return g.length>0?g[g.length-1]:null}}class ee{constructor(c){this.TAG="MP4Remuxer",this._config=c,this._isLive=c.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new ft("audio"),this._videoSegmentInfoList=new ft("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(Et.chrome&&(Et.version.major<50||Et.version.major===50&&Et.version.build<2661)),this._fillSilentAfterSeek=Et.msedge||Et.msie,this._mp3UseMpegAudio=!Et.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}destroy(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}bindDataSource(c){return c.onDataAvailable=this.remux.bind(this),c.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(c){this._onInitSegment=c}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(c){this._onMediaSegment=c}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(c){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(c,h){if(!this._onMediaSegment)throw new V("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(c,h),this._remuxVideo(h),this._remuxAudio(c)}_onTrackMetadataReceived(c,h){let g=null,E="mp4",S=h.codec;if(c==="audio")this._audioMeta=h,h.codec==="mp3"&&this._mp3UseMpegAudio?(E="mpeg",S="",g=new Uint8Array):g=Pe.generateInitSegment(h);else if(c==="video")this._videoMeta=h,g=Pe.generateInitSegment(h);else return;if(!this._onInitSegment)throw new V("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(c,{type:c,data:g.buffer,codec:S,container:`${c}/${E}`,mediaDuration:h.duration})}_calculateDtsBase(c,h){this._dtsBaseInited||(c.samples&&c.samples.length&&(this._audioDtsBase=c.samples[0].dts),h.samples&&h.samples.length&&(this._videoDtsBase=h.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let c=this._videoStashedLastSample,h=this._audioStashedLastSample,g={type:"video",id:1,sequenceNumber:0,samples:[],length:0};c!=null&&(g.samples.push(c),g.length=c.length);let E={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};h!=null&&(E.samples.push(h),E.length=h.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(g,!0),this._remuxAudio(E,!0)}_remuxAudio(c,h){if(this._audioMeta==null)return;let g=c,E=g.samples,S,k=-1,j=-1,ht=-1,ut=this._audioMeta.refSampleDuration,_t=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,ln=this._dtsBaseInited&&this._audioNextDts===void 0,_=!1;if(!E||E.length===0||E.length===1&&!h)return;let R=0,re=null,Q=0;_t?(R=0,Q=g.length):(R=8,Q=8+g.length);let U=null;if(E.length>1&&(U=E.pop(),Q-=U.length),this._audioStashedLastSample!=null){let Qe=this._audioStashedLastSample;this._audioStashedLastSample=null,E.unshift(Qe),Q+=Qe.length}U!=null&&(this._audioStashedLastSample=U);let Ee=E[0].dts-this._dtsBase;if(this._audioNextDts)S=Ee-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())S=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(_=!0);else{let Qe=this._audioSegmentInfoList.getLastSampleBefore(Ee);if(Qe!=null){let st=Ee-(Qe.originalDts+Qe.duration);st<=3&&(st=0);let we=Qe.dts+Qe.duration+st;S=Ee-we}else S=0}if(_){let Qe=Ee-S,st=this._videoSegmentInfoList.getLastSegmentBefore(Ee);if(st!=null&&st.beginDts<Qe){let we=Oe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(we){let w=st.beginDts,H=Qe-st.beginDts;m.v(this.TAG,`InsertPrefixSilentAudio: dts: ${w}, duration: ${H}`),E.unshift({unit:we,dts:w,pts:w}),Q+=we.byteLength}}else _=!1}let Re=[];for(let Qe=0;Qe<E.length;Qe++){let st=E[Qe],we=st.unit,w=st.dts-this._dtsBase,H=w-S;k===-1&&(k=H);let te=0;Qe!==E.length-1?te=E[Qe+1].dts-this._dtsBase-S-H:U!=null?te=U.dts-this._dtsBase-S-H:Re.length>=1?te=Re[Re.length-1].duration:te=Math.floor(ut);let le=!1,Ge=null;if(te>ut*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!Et.safari){le=!0;let Ve=Math.abs(te-ut),$e=Math.ceil(Ve/ut),vt=H+ut;m.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
|
|
dts: ${H+te} ms, expected: ${H+Math.round(ut)} ms, delta: ${Math.round(Ve)} ms, generate: ${$e} frames`);let Ct=Oe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Ct==null&&(m.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),Ct=we),Ge=[];for(let qt=0;qt<$e;qt++){let xt=Math.round(vt);if(Ge.length>0){let $t=Ge[Ge.length-1];$t.duration=xt-$t.dts}let Jt={dts:xt,pts:xt,cts:0,unit:Ct,size:Ct.byteLength,duration:0,originalDts:w,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Ge.push(Jt),Q+=Jt.size,vt+=ut}let At=Ge[Ge.length-1];At.duration=H+te-At.dts,te=Math.round(ut)}Re.push({dts:H,pts:H,cts:0,unit:st.unit,size:st.unit.byteLength,duration:te,originalDts:w,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),le&&Re.push.apply(Re,Ge)}_t?re=new Uint8Array(Q):(re=new Uint8Array(Q),re[0]=Q>>>24&255,re[1]=Q>>>16&255,re[2]=Q>>>8&255,re[3]=Q&255,re.set(Pe.types.mdat,4));for(let Qe=0;Qe<Re.length;Qe++){let st=Re[Qe].unit;re.set(st,R),R+=st.byteLength}let be=Re[Re.length-1];j=be.dts+be.duration,this._audioNextDts=j;let We=new Qt;We.beginDts=k,We.endDts=j,We.beginPts=k,We.endPts=j,We.originalBeginDts=Re[0].originalDts,We.originalEndDts=be.originalDts+be.duration,We.firstSample=new pt(Re[0].dts,Re[0].pts,Re[0].duration,Re[0].originalDts,!1),We.lastSample=new pt(be.dts,be.pts,be.duration,be.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(We),g.samples=Re,g.sequenceNumber++;let qe=null;_t?qe=new Uint8Array:qe=Pe.moof(g,k),g.samples=[],g.length=0;let Lt={type:"audio",data:this._mergeBoxes(qe,re).buffer,sampleCount:Re.length,info:We};_t&&ln&&(Lt.timestampOffset=k),this._onMediaSegment("audio",Lt)}_remuxVideo(c,h){if(this._videoMeta==null)return;let g=c,E=g.samples,S,k=-1,j=-1,ht=-1,ut=-1;if(!E||E.length===0||E.length===1&&!h)return;let _t=8,ln=null,_=8+c.length,R=null;if(E.length>1&&(R=E.pop(),_-=R.length),this._videoStashedLastSample!=null){let be=this._videoStashedLastSample;this._videoStashedLastSample=null,E.unshift(be),_+=be.length}R!=null&&(this._videoStashedLastSample=R);let re=E[0].dts-this._dtsBase;if(this._videoNextDts)S=re-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())S=0;else{let be=this._videoSegmentInfoList.getLastSampleBefore(re);if(be!=null){let We=re-(be.originalDts+be.duration);We<=3&&(We=0);let qe=be.dts+be.duration+We;S=re-qe}else S=0}let Q=new Qt,U=[];for(let be=0;be<E.length;be++){let We=E[be],qe=We.dts-this._dtsBase,Lt=We.isKeyframe,Qe=qe-S,st=We.cts,we=Qe+st;k===-1&&(k=Qe,ht=we);let w=0;if(be!==E.length-1?w=E[be+1].dts-this._dtsBase-S-Qe:R!=null?w=R.dts-this._dtsBase-S-Qe:U.length>=1?w=U[U.length-1].duration:w=Math.floor(this._videoMeta.refSampleDuration),Lt){let H=new pt(Qe,we,w,We.dts,!0);H.fileposition=We.fileposition,Q.appendSyncPoint(H)}U.push({dts:Qe,pts:we,cts:st,units:We.units,size:We.length,isKeyframe:Lt,duration:w,originalDts:qe,flags:{isLeading:0,dependsOn:Lt?2:1,isDependedOn:Lt?1:0,hasRedundancy:0,isNonSync:Lt?0:1}})}ln=new Uint8Array(_),ln[0]=_>>>24&255,ln[1]=_>>>16&255,ln[2]=_>>>8&255,ln[3]=_&255,ln.set(Pe.types.mdat,4);for(let be=0;be<U.length;be++){let We=U[be].units;for(;We.length;){let Lt=We.shift().data;ln.set(Lt,_t),_t+=Lt.byteLength}}let Ee=U[U.length-1];if(j=Ee.dts+Ee.duration,ut=Ee.pts+Ee.duration,this._videoNextDts=j,Q.beginDts=k,Q.endDts=j,Q.beginPts=ht,Q.endPts=ut,Q.originalBeginDts=U[0].originalDts,Q.originalEndDts=Ee.originalDts+Ee.duration,Q.firstSample=new pt(U[0].dts,U[0].pts,U[0].duration,U[0].originalDts,U[0].isKeyframe),Q.lastSample=new pt(Ee.dts,Ee.pts,Ee.duration,Ee.originalDts,Ee.isKeyframe),this._isLive||this._videoSegmentInfoList.append(Q),g.samples=U,g.sequenceNumber++,this._forceFirstIDR){let be=U[0].flags;be.dependsOn=2,be.isNonSync=0}let Re=Pe.moof(g,k);g.samples=[],g.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Re,ln).buffer,sampleCount:U.length,info:Q})}_mergeBoxes(c,h){let g=new Uint8Array(c.byteLength+h.byteLength);return g.set(c,0),g.set(h,c.byteLength),g}}var se=ee,Y={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};class Ue{constructor(c,h){this.TAG="TransmuxingController",this._emitter=new(Z()),this._config=h,c.segments||(c.segments=[{duration:c.duration,filesize:c.filesize,url:c.url}]),typeof c.cors!="boolean"&&(c.cors=!0),typeof c.withCredentials!="boolean"&&(c.withCredentials=!1),this._mediaDataSource=c,this._currentSegmentIndex=0;let g=0;this._mediaDataSource.segments.forEach(E=>{E.timestampBase=g,g+=E.duration,E.cors=c.cors,E.withCredentials=c.withCredentials,h.referrerPolicy&&(E.referrerPolicy=h.referrerPolicy)}),!isNaN(g)&&this._mediaDataSource.duration!==g&&(this._mediaDataSource.duration=g),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}destroy(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}on(c,h){this._emitter.addListener(c,h)}off(c,h){this._emitter.removeListener(c,h)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(c,h){this._currentSegmentIndex=c;let g=this._mediaDataSource.segments[c],E=this._ioctl=new lt(g,this._config,c);E.onError=this._onIOException.bind(this),E.onSeeked=this._onIOSeeked.bind(this),E.onComplete=this._onIOComplete.bind(this),E.onRedirect=this._onIORedirect.bind(this),E.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),h?this._demuxer.bindDataSource(this._ioctl):E.onDataArrival=this._onInitChunkArrival.bind(this),E.open(h)}stop(){this._internalAbort(),this._disableStatisticsReporter()}_internalAbort(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}pause(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}resume(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}seek(c){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;let h=this._searchSegmentIndexContains(c);if(h===this._currentSegmentIndex){let g=this._mediaInfo.segments[h];if(g==null)this._pendingSeekTime=c;else{let E=g.getNearestKeyframe(c);this._remuxer.seek(E.milliseconds),this._ioctl.seek(E.fileposition),this._pendingResolveSeekPoint=E.milliseconds}}else{let g=this._mediaInfo.segments[h];if(g==null)this._pendingSeekTime=c,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(h);else{let E=g.getNearestKeyframe(c);this._internalAbort(),this._remuxer.seek(c),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[h].timestampBase,this._loadSegment(h,E.fileposition),this._pendingResolveSeekPoint=E.milliseconds,this._reportSegmentMediaInfo(h)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(c){let h=this._mediaDataSource.segments,g=h.length-1;for(let E=0;E<h.length;E++)if(c<h[E].timestampBase){g=E-1;break}return g}_onInitChunkArrival(c,h){let g=null,E=0;if(h>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,E=this._demuxer.parseChunks(c,h);else if((g=ie.probe(c)).match){this._demuxer=new ie(g,this._config),this._remuxer||(this._remuxer=new se(this._config));let S=this._mediaDataSource;S.duration!=null&&!isNaN(S.duration)&&(this._demuxer.overridedDuration=S.duration),typeof S.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=S.hasAudio),typeof S.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=S.hasVideo),this._demuxer.timestampBase=S.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),E=this._demuxer.parseChunks(c,h)}else g=null,m.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(Y.DEMUX_ERROR,Fe.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),E=0;return E}_onMediaInfo(c){this._mediaInfo==null&&(this._mediaInfo=Object.assign({},c),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,Sn.prototype));let h=Object.assign({},c);Object.setPrototypeOf(h,Sn.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=h,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(()=>{let g=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(g)})}_onMetaDataArrived(c){this._emitter.emit(Y.METADATA_ARRIVED,c)}_onScriptDataArrived(c){this._emitter.emit(Y.SCRIPTDATA_ARRIVED,c)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(c){let g=c+1;g<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(g)):(this._remuxer.flushStashedSamples(),this._emitter.emit(Y.LOADING_COMPLETE),this._disableStatisticsReporter())}_onIORedirect(c){let h=this._ioctl.extraData;this._mediaDataSource.segments[h].redirectedURL=c}_onIORecoveredEarlyEof(){this._emitter.emit(Y.RECOVERED_EARLY_EOF)}_onIOException(c,h){m.e(this.TAG,`IOException: type = ${c}, code = ${h.code}, msg = ${h.msg}`),this._emitter.emit(Y.IO_ERROR,c,h),this._disableStatisticsReporter()}_onDemuxException(c,h){m.e(this.TAG,`DemuxException: type = ${c}, info = ${h}`),this._emitter.emit(Y.DEMUX_ERROR,c,h)}_onRemuxerInitSegmentArrival(c,h){this._emitter.emit(Y.INIT_SEGMENT,c,h)}_onRemuxerMediaSegmentArrival(c,h){if(this._pendingSeekTime==null&&(this._emitter.emit(Y.MEDIA_SEGMENT,c,h),this._pendingResolveSeekPoint!=null&&c==="video")){let g=h.info.syncPoints,E=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,Et.safari&&g.length>0&&g[0].originalDts===E&&(E=g[0].pts),this._emitter.emit(Y.RECOMMEND_SEEKPOINT,E)}}_enableStatisticsReporter(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}_disableStatisticsReporter(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}_reportSegmentMediaInfo(c){let h=this._mediaInfo.segments[c],g=Object.assign({},h);g.duration=this._mediaInfo.duration,g.segmentCount=this._mediaInfo.segmentCount,delete g.segments,delete g.keyframesIndex,this._emitter.emit(Y.MEDIA_INFO,g)}_reportStatisticsInfo(){let c={};c.url=this._ioctl.currentURL,c.hasRedirect=this._ioctl.hasRedirect,c.hasRedirect&&(c.redirectedURL=this._ioctl.currentRedirectedURL),c.speed=this._ioctl.currentSpeed,c.loaderType=this._ioctl.loaderType,c.currentSegmentIndex=this._currentSegmentIndex,c.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Y.STATISTICS_INFO,c)}}var Tt=Ue,Ke=function(De){let c="TransmuxingWorker",h=null,g=Q.bind(this);ye.install(),De.addEventListener("message",function(U){switch(U.data.cmd){case"init":h=new Tt(U.data.param[0],U.data.param[1]),h.on(Y.IO_ERROR,_.bind(this)),h.on(Y.DEMUX_ERROR,R.bind(this)),h.on(Y.INIT_SEGMENT,E.bind(this)),h.on(Y.MEDIA_SEGMENT,S.bind(this)),h.on(Y.LOADING_COMPLETE,k.bind(this)),h.on(Y.RECOVERED_EARLY_EOF,j.bind(this)),h.on(Y.MEDIA_INFO,ht.bind(this)),h.on(Y.METADATA_ARRIVED,ut.bind(this)),h.on(Y.SCRIPTDATA_ARRIVED,_t.bind(this)),h.on(Y.STATISTICS_INFO,ln.bind(this)),h.on(Y.RECOMMEND_SEEKPOINT,re.bind(this));break;case"destroy":h&&(h.destroy(),h=null),De.postMessage({msg:"destroyed"});break;case"start":h.start();break;case"stop":h.stop();break;case"seek":h.seek(U.data.param);break;case"pause":h.pause();break;case"resume":h.resume();break;case"logging_config":{let Ee=U.data.param;et.applyConfig(Ee),Ee.enableCallback===!0?et.addLogListener(g):et.removeLogListener(g);break}}});function E(U,Ee){let Re={msg:Y.INIT_SEGMENT,data:{type:U,data:Ee}};De.postMessage(Re,[Ee.data])}function S(U,Ee){let Re={msg:Y.MEDIA_SEGMENT,data:{type:U,data:Ee}};De.postMessage(Re,[Ee.data])}function k(){let U={msg:Y.LOADING_COMPLETE};De.postMessage(U)}function j(){let U={msg:Y.RECOVERED_EARLY_EOF};De.postMessage(U)}function ht(U){let Ee={msg:Y.MEDIA_INFO,data:U};De.postMessage(Ee)}function ut(U){let Ee={msg:Y.METADATA_ARRIVED,data:U};De.postMessage(Ee)}function _t(U){let Ee={msg:Y.SCRIPTDATA_ARRIVED,data:U};De.postMessage(Ee)}function ln(U){let Ee={msg:Y.STATISTICS_INFO,data:U};De.postMessage(Ee)}function _(U,Ee){De.postMessage({msg:Y.IO_ERROR,data:{type:U,info:Ee}})}function R(U,Ee){De.postMessage({msg:Y.DEMUX_ERROR,data:{type:U,info:Ee}})}function re(U){De.postMessage({msg:Y.RECOMMEND_SEEKPOINT,data:U})}function Q(U,Ee){De.postMessage({msg:"logcat_callback",data:{type:U,logcat:Ee}})}};class Nt{constructor(c,h){if(this.TAG="Transmuxer",this._emitter=new(Z()),h.enableWorker&&typeof Worker!="undefined")try{let g=L(82059);this._worker=g(Ke),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[c,h]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},et.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:et.getConfig()})}catch(g){m.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Tt(c,h)}else this._controller=new Tt(c,h);if(this._controller){let g=this._controller;g.on(Y.IO_ERROR,this._onIOError.bind(this)),g.on(Y.DEMUX_ERROR,this._onDemuxError.bind(this)),g.on(Y.INIT_SEGMENT,this._onInitSegment.bind(this)),g.on(Y.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),g.on(Y.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),g.on(Y.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),g.on(Y.MEDIA_INFO,this._onMediaInfo.bind(this)),g.on(Y.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),g.on(Y.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),g.on(Y.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),g.on(Y.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),et.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(c,h){this._emitter.addListener(c,h)}off(c,h){this._emitter.removeListener(c,h)}hasWorker(){return this._worker!=null}open(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}close(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}seek(c){this._worker?this._worker.postMessage({cmd:"seek",param:c}):this._controller.seek(c)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(c,h){Promise.resolve().then(()=>{this._emitter.emit(Y.INIT_SEGMENT,c,h)})}_onMediaSegment(c,h){Promise.resolve().then(()=>{this._emitter.emit(Y.MEDIA_SEGMENT,c,h)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(Y.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(Y.RECOVERED_EARLY_EOF)})}_onMediaInfo(c){Promise.resolve().then(()=>{this._emitter.emit(Y.MEDIA_INFO,c)})}_onMetaDataArrived(c){Promise.resolve().then(()=>{this._emitter.emit(Y.METADATA_ARRIVED,c)})}_onScriptDataArrived(c){Promise.resolve().then(()=>{this._emitter.emit(Y.SCRIPTDATA_ARRIVED,c)})}_onStatisticsInfo(c){Promise.resolve().then(()=>{this._emitter.emit(Y.STATISTICS_INFO,c)})}_onIOError(c,h){Promise.resolve().then(()=>{this._emitter.emit(Y.IO_ERROR,c,h)})}_onDemuxError(c,h){Promise.resolve().then(()=>{this._emitter.emit(Y.DEMUX_ERROR,c,h)})}_onRecommendSeekpoint(c){Promise.resolve().then(()=>{this._emitter.emit(Y.RECOMMEND_SEEKPOINT,c)})}_onLoggingConfigChanged(c){this._worker&&this._worker.postMessage({cmd:"logging_config",param:c})}_onWorkerMessage(c){let h=c.data,g=h.data;if(h.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(h.msg){case Y.INIT_SEGMENT:case Y.MEDIA_SEGMENT:this._emitter.emit(h.msg,g.type,g.data);break;case Y.LOADING_COMPLETE:case Y.RECOVERED_EARLY_EOF:this._emitter.emit(h.msg);break;case Y.MEDIA_INFO:Object.setPrototypeOf(g,Sn.prototype),this._emitter.emit(h.msg,g);break;case Y.METADATA_ARRIVED:case Y.SCRIPTDATA_ARRIVED:case Y.STATISTICS_INFO:this._emitter.emit(h.msg,g);break;case Y.IO_ERROR:case Y.DEMUX_ERROR:this._emitter.emit(h.msg,g.type,g.info);break;case Y.RECOMMEND_SEEKPOINT:this._emitter.emit(h.msg,g);break;case"logcat_callback":m.emitter.emit("log",g.type,g.logcat);break;default:break}}}var tn=Nt,zt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};class Tn{constructor(c){this.TAG="MSEController",this._config=c,this._emitter=new(Z()),this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new It}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,h){this._emitter.addListener(c,h)}off(c,h){this._emitter.removeListener(c,h)}attachMediaElement(c){if(this._mediaSource)throw new V("MediaSource has been attached to an HTMLMediaElement!");let h=this._mediaSource=new window.MediaSource;h.addEventListener("sourceopen",this.e.onSourceOpen),h.addEventListener("sourceended",this.e.onSourceEnded),h.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=c,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),c.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let c=this._mediaSource;for(let h in this._sourceBuffers){let g=this._pendingSegments[h];g.splice(0,g.length),this._pendingSegments[h]=null,this._pendingRemoveRanges[h]=null,this._lastInitSegments[h]=null;let E=this._sourceBuffers[h];if(E){if(c.readyState!=="closed"){try{c.removeSourceBuffer(E)}catch(S){m.e(this.TAG,S.message)}E.removeEventListener("error",this.e.onSourceBufferError),E.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[h]=null,this._sourceBuffers[h]=null}}if(c.readyState==="open")try{c.endOfStream()}catch(h){m.e(this.TAG,h.message)}c.removeEventListener("sourceopen",this.e.onSourceOpen),c.removeEventListener("sourceended",this.e.onSourceEnded),c.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}appendInitSegment(c,h){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(c),this._pendingSegments[c.type].push(c);return}let g=c,E=`${g.container}`;g.codec&&g.codec.length>0&&(E+=`;codecs=${g.codec}`);let S=!1;if(m.v(this.TAG,"Received Initialization Segment, mimeType: "+E),this._lastInitSegments[g.type]=g,E!==this._mimeTypes[g.type]){if(this._mimeTypes[g.type])m.v(this.TAG,`Notice: ${g.type} mimeType changed, origin: ${this._mimeTypes[g.type]}, target: ${E}`);else{S=!0;try{let k=this._sourceBuffers[g.type]=this._mediaSource.addSourceBuffer(E);k.addEventListener("error",this.e.onSourceBufferError),k.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(k){m.e(this.TAG,k.message),this._emitter.emit(zt.ERROR,{code:k.code,msg:k.message});return}}this._mimeTypes[g.type]=E}h||this._pendingSegments[g.type].push(g),S||this._sourceBuffers[g.type]&&!this._sourceBuffers[g.type].updating&&this._doAppendSegments(),Et.safari&&g.container==="audio/mpeg"&&g.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=g.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(c){let h=c;this._pendingSegments[h.type].push(h),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let g=this._sourceBuffers[h.type];g&&!g.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}seek(c){for(let h in this._sourceBuffers){if(!this._sourceBuffers[h])continue;let g=this._sourceBuffers[h];if(this._mediaSource.readyState==="open")try{g.abort()}catch(S){m.e(this.TAG,S.message)}this._idrList.clear();let E=this._pendingSegments[h];if(E.splice(0,E.length),this._mediaSource.readyState!=="closed"){for(let S=0;S<g.buffered.length;S++){let k=g.buffered.start(S),j=g.buffered.end(S);this._pendingRemoveRanges[h].push({start:k,end:j})}if(g.updating||this._doRemoveRanges(),Et.safari){let S=this._lastInitSegments[h];S&&(this._pendingSegments[h].push(S),g.updating||this._doAppendSegments())}}}}endOfStream(){let c=this._mediaSource,h=this._sourceBuffers;if(!c||c.readyState!=="open"){c&&c.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}h.video&&h.video.updating||h.audio&&h.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,c.endOfStream())}getNearestKeyframe(c){return this._idrList.getLastSyncPointBeforeDts(c)}_needCleanupSourceBuffer(){if(!this._config.autoCleanupSourceBuffer)return!1;let c=this._mediaElement.currentTime;for(let h in this._sourceBuffers){let g=this._sourceBuffers[h];if(g){let E=g.buffered;if(E.length>=1&&c-E.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let c=this._mediaElement.currentTime;for(let h in this._sourceBuffers){let g=this._sourceBuffers[h];if(g){let E=g.buffered,S=!1;for(let k=0;k<E.length;k++){let j=E.start(k),ht=E.end(k);if(j<=c&&c<ht+3){if(c-j>=this._config.autoCleanupMaxBackwardDuration){S=!0;let ut=c-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[h].push({start:j,end:ut})}}else ht<c&&(S=!0,this._pendingRemoveRanges[h].push({start:j,end:ht}))}S&&!g.updating&&this._doRemoveRanges()}}}_updateMediaSourceDuration(){let c=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open"||c.video&&c.video.updating||c.audio&&c.audio.updating)return;let h=this._mediaSource.duration,g=this._pendingMediaDuration;g>0&&(isNaN(h)||g>h)&&(m.v(this.TAG,`Update MediaSource duration from ${h} to ${g}`),this._mediaSource.duration=g),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let c in this._pendingRemoveRanges){if(!this._sourceBuffers[c]||this._sourceBuffers[c].updating)continue;let h=this._sourceBuffers[c],g=this._pendingRemoveRanges[c];for(;g.length&&!h.updating;){let E=g.shift();h.remove(E.start,E.end)}}}_doAppendSegments(){let c=this._pendingSegments;for(let h in c)if(!(!this._sourceBuffers[h]||this._sourceBuffers[h].updating)&&c[h].length>0){let g=c[h].shift();if(g.timestampOffset){let E=this._sourceBuffers[h].timestampOffset,S=g.timestampOffset/1e3;Math.abs(E-S)>.1&&(m.v(this.TAG,`Update MPEG audio timestampOffset from ${E} to ${S}`),this._sourceBuffers[h].timestampOffset=S),delete g.timestampOffset}if(!g.data||g.data.byteLength===0)continue;try{this._sourceBuffers[h].appendBuffer(g.data),this._isBufferFull=!1,h==="video"&&g.hasOwnProperty("info")&&this._idrList.appendArray(g.info.syncPoints)}catch(E){this._pendingSegments[h].unshift(g),E.code===22?(this._isBufferFull||this._emitter.emit(zt.BUFFER_FULL),this._isBufferFull=!0):(m.e(this.TAG,E.message),this._emitter.emit(zt.ERROR,{code:E.code,msg:E.message}))}}}_onSourceOpen(){if(m.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let c=this._pendingSourceBufferInit;for(;c.length;){let h=c.shift();this.appendInitSegment(h,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(zt.SOURCE_OPEN)}_onSourceEnded(){m.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){m.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}_hasPendingSegments(){let c=this._pendingSegments;return c.video.length>0||c.audio.length>0}_hasPendingRemoveRanges(){let c=this._pendingRemoveRanges;return c.video.length>0||c.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(zt.UPDATE_END)}_onSourceBufferError(c){m.e(this.TAG,`SourceBuffer Error: ${c}`)}}var En=Tn;const mt={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},at={NETWORK_EXCEPTION:de.EXCEPTION,NETWORK_STATUS_CODE_INVALID:de.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:de.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:de.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Fe.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Fe.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Fe.CODEC_UNSUPPORTED};class Yt{constructor(c,h){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(Z()),this._config=C(),typeof h=="object"&&Object.assign(this._config,h),c.type.toLowerCase()!=="flv")throw new ne("FlvPlayer requires an flv MediaDataSource input!");c.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=c,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;let g=Et.chrome&&(Et.version.major<50||Et.version.major===50&&Et.version.build<2661);this._alwaysSeekKeyframe=!!(g||Et.msedge||Et.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}destroy(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,h){c===pe.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(pe.MEDIA_INFO,this.mediaInfo)}):c===pe.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(pe.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(c,h)}off(c,h){this._emitter.removeListener(c,h)}attachMediaElement(c){if(this._mediaElement=c,c.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),c.addEventListener("seeking",this.e.onvSeeking),c.addEventListener("canplay",this.e.onvCanPlay),c.addEventListener("stalled",this.e.onvStalled),c.addEventListener("progress",this.e.onvProgress),this._msectl=new En(this._config),this._msectl.on(zt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(zt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(zt.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(zt.ERROR,h=>{this._emitter.emit(pe.ERROR,mt.MEDIA_ERROR,at.MEDIA_MSE_ERROR,h)}),this._msectl.attachMediaElement(c),this._pendingSeekTime!=null)try{c.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(h){}}detachMediaElement(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}load(){if(!this._mediaElement)throw new V("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new V("FlvPlayer.load() has been called, please call unload() first!");if(!this._hasPendingLoad){if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new tn(this._mediaDataSource,this._config),this._transmuxer.on(Y.INIT_SEGMENT,(c,h)=>{this._msectl.appendInitSegment(h)}),this._transmuxer.on(Y.MEDIA_SEGMENT,(c,h)=>{if(this._msectl.appendMediaSegment(h),this._config.lazyLoad&&!this._config.isLive){let g=this._mediaElement.currentTime;h.info.endDts>=(g+this._config.lazyLoadMaxDuration)*1e3&&this._progressChecker==null&&(m.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(Y.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit(pe.LOADING_COMPLETE)}),this._transmuxer.on(Y.RECOVERED_EARLY_EOF,()=>{this._emitter.emit(pe.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Y.IO_ERROR,(c,h)=>{this._emitter.emit(pe.ERROR,mt.NETWORK_ERROR,c,h)}),this._transmuxer.on(Y.DEMUX_ERROR,(c,h)=>{this._emitter.emit(pe.ERROR,mt.MEDIA_ERROR,c,{code:-1,msg:h})}),this._transmuxer.on(Y.MEDIA_INFO,c=>{this._mediaInfo=c,this._emitter.emit(pe.MEDIA_INFO,Object.assign({},c))}),this._transmuxer.on(Y.METADATA_ARRIVED,c=>{this._emitter.emit(pe.METADATA_ARRIVED,c)}),this._transmuxer.on(Y.SCRIPTDATA_ARRIVED,c=>{this._emitter.emit(pe.SCRIPTDATA_ARRIVED,c)}),this._transmuxer.on(Y.STATISTICS_INFO,c=>{this._statisticsInfo=this._fillStatisticsInfo(c),this._emitter.emit(pe.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(Y.RECOMMEND_SEEKPOINT,c=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c/1e3)}),this._transmuxer.open()}}unload(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(c){this._mediaElement.volume=c}get muted(){return this._mediaElement.muted}set muted(c){this._mediaElement.muted=c}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(c){this._mediaElement?this._internalSeek(c):this._pendingSeekTime=c}get mediaInfo(){return Object.assign({},this._mediaInfo)}get statisticsInfo(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}_fillStatisticsInfo(c){if(c.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return c;let h=!0,g=0,E=0;if(this._mediaElement.getVideoPlaybackQuality){let S=this._mediaElement.getVideoPlaybackQuality();g=S.totalVideoFrames,E=S.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(g=this._mediaElement.webkitDecodedFrameCount,E=this._mediaElement.webkitDroppedFrameCount):h=!1;return h&&(c.decodedFrames=g,c.droppedFrames=E),c}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let c=this._mediaElement.buffered,h=this._mediaElement.currentTime,g=0,E=0;for(let S=0;S<c.length;S++){let k=c.start(S),j=c.end(S);if(k<=h&&h<j){g=k,E=j;break}}E>=h+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(m.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){m.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}_suspendTransmuxer(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}_checkProgressAndResume(){let c=this._mediaElement.currentTime,h=this._mediaElement.buffered,g=!1;for(let E=0;E<h.length;E++){let S=h.start(E),k=h.end(E);if(c>=S&&c<k){c>=k-this._config.lazyLoadRecoverDuration&&(g=!0);break}}g&&(window.clearInterval(this._progressChecker),this._progressChecker=null,g&&(m.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(c){let h=this._mediaElement.buffered;for(let g=0;g<h.length;g++){let E=h.start(g),S=h.end(g);if(c>=E&&c<S)return!0}return!1}_internalSeek(c){let h=this._isTimepointBuffered(c),g=!1,E=0;if(c<1&&this._mediaElement.buffered.length>0){let S=this._mediaElement.buffered.start(0);(S<1&&c<S||Et.safari)&&(g=!0,E=Et.safari?.1:S)}if(g)this._requestSetTime=!0,this._mediaElement.currentTime=E;else if(h){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=c;else{let S=this._msectl.getNearestKeyframe(Math.floor(c*1e3));this._requestSetTime=!0,S!=null?this._mediaElement.currentTime=S.dts/1e3:this._mediaElement.currentTime=c}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(c),this._transmuxer.seek(Math.floor(c*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c)}_checkAndApplyUnbufferedSeekpoint(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){let c=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(c)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(c),this._transmuxer.seek(Math.floor(c*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_checkAndResumeStuckPlayback(c){let h=this._mediaElement;if(c||!this._receivedCanPlay||h.readyState<2){let g=h.buffered;g.length>0&&h.currentTime<g.start(0)&&(m.w(this.TAG,`Playback seems stuck at ${h.currentTime}, seek to ${g.start(0)}`),this._requestSetTime=!0,this._mediaElement.currentTime=g.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}_onvLoadedMetadata(c){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}_onvSeeking(c){let h=this._mediaElement.currentTime,g=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(h<1&&g.length>0){let E=g.start(0);if(E<1&&h<E||Et.safari){this._requestSetTime=!0,this._mediaElement.currentTime=Et.safari?.1:E;return}}if(this._isTimepointBuffered(h)){if(this._alwaysSeekKeyframe){let E=this._msectl.getNearestKeyframe(Math.floor(h*1e3));E!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=E.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:h,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_onvCanPlay(c){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}_onvStalled(c){this._checkAndResumeStuckPlayback(!0)}_onvProgress(c){this._checkAndResumeStuckPlayback()}}var gt=Yt;class ct{constructor(c,h){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(Z()),this._config=C(),typeof h=="object"&&Object.assign(this._config,h),c.type.toLowerCase()==="flv")throw new ne("NativePlayer does't support flv MediaDataSource input!");if(c.hasOwnProperty("segments"))throw new ne(`NativePlayer(${c.type}) doesn't support multipart playback!`);this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=c,this._mediaElement=null}destroy(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,h){c===pe.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(pe.MEDIA_INFO,this.mediaInfo)}):c===pe.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(pe.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(c,h)}off(c,h){this._emitter.removeListener(c,h)}attachMediaElement(c){if(this._mediaElement=c,c.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{c.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(h){}}detachMediaElement(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}load(){if(!this._mediaElement)throw new V("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}unload(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(c){this._mediaElement.volume=c}get muted(){return this._mediaElement.muted}set muted(c){this._mediaElement.muted=c}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(c){this._mediaElement?this._mediaElement.currentTime=c:this._pendingSeekTime=c}get mediaInfo(){let h={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(h.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(h.width=this._mediaElement.videoWidth,h.height=this._mediaElement.videoHeight)),h}get statisticsInfo(){let c={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return c;let h=!0,g=0,E=0;if(this._mediaElement.getVideoPlaybackQuality){let S=this._mediaElement.getVideoPlaybackQuality();g=S.totalVideoFrames,E=S.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(g=this._mediaElement.webkitDecodedFrameCount,E=this._mediaElement.webkitDroppedFrameCount):h=!1;return h&&(c.decodedFrames=g,c.droppedFrames=E),c}_onvLoadedMetadata(c){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(pe.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(pe.STATISTICS_INFO,this.statisticsInfo)}}var Ln=ct;ye.install();function nn(De,c){let h=De;if(h==null||typeof h!="object")throw new ne("MediaDataSource must be an javascript object!");if(!h.hasOwnProperty("type"))throw new ne("MediaDataSource must has type field to indicate video file type!");switch(h.type){case"flv":return new gt(h,c);default:return new Ln(h,c)}}function dn(){return ke.supportMSEH264Playback()}function St(){return ke.getFeatureList()}let Wt={};Wt.createPlayer=nn,Wt.isSupported=dn,Wt.getFeatureList=St,Wt.BaseLoader=hn,Wt.LoaderStatus=N,Wt.LoaderErrors=de,Wt.Events=pe,Wt.ErrorTypes=mt,Wt.ErrorDetails=at,Wt.FlvPlayer=gt,Wt.NativePlayer=Ln,Wt.LoggingControl=et,Object.defineProperty(Wt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var zn=Wt},11497:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return Rt}});var A=L(59301),ye=L(92310),ve=L.n(ye),Z=L(2738),x=L(48755),m=L(31756),Xe=L(458),ae=L(20554),Ze=function(C,$){var ke={};for(var Le in C)Object.prototype.hasOwnProperty.call(C,Le)&&$.indexOf(Le)<0&&(ke[Le]=C[Le]);if(C!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,Le=Object.getOwnPropertySymbols(C);pe<Le.length;pe++)$.indexOf(Le[pe])<0&&Object.prototype.propertyIsEnumerable.call(C,Le[pe])&&(ke[Le[pe]]=C[Le[pe]]);return ke},ne=C=>{var{prefixCls:$,className:ke,hoverable:Le=!0}=C,pe=Ze(C,["prefixCls","className","hoverable"]);const{getPrefixCls:_e}=A.useContext(x.E_),et=_e("card",$),Xt=ve()(`${et}-grid`,ke,{[`${et}-grid-hoverable`]:Le});return A.createElement("div",Object.assign({},pe,{className:Xt}))},M=L(93083),N=L(63356),de=L(16931),hn=L(51636);const Pt=C=>{const{antCls:$,componentCls:ke,headerHeight:Le,headerPadding:pe,tabsMarginBottom:_e}=C;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:Le,marginBottom:-1,padding:`0 ${(0,M.unit)(pe)}`,color:C.colorTextHeading,fontWeight:C.fontWeightStrong,fontSize:C.headerFontSize,background:C.headerBg,borderBottom:`${(0,M.unit)(C.lineWidth)} ${C.lineType} ${C.colorBorderSecondary}`,borderRadius:`${(0,M.unit)(C.borderRadiusLG)} ${(0,M.unit)(C.borderRadiusLG)} 0 0`},(0,N.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},N.vS),{[`
|
|
> ${ke}-typography,
|
|
> ${ke}-typography-edit-content
|
|
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${$}-tabs-top`]:{clear:"both",marginBottom:_e,color:C.colorText,fontWeight:"normal",fontSize:C.fontSize,"&-bar":{borderBottom:`${(0,M.unit)(C.lineWidth)} ${C.lineType} ${C.colorBorderSecondary}`}}})},bt=C=>{const{cardPaddingBase:$,colorBorderSecondary:ke,cardShadow:Le,lineWidth:pe}=C;return{width:"33.33%",padding:$,border:0,borderRadius:0,boxShadow:`
|
|
${(0,M.unit)(pe)} 0 0 0 ${ke},
|
|
0 ${(0,M.unit)(pe)} 0 0 ${ke},
|
|
${(0,M.unit)(pe)} ${(0,M.unit)(pe)} 0 0 ${ke},
|
|
${(0,M.unit)(pe)} 0 0 0 ${ke} inset,
|
|
0 ${(0,M.unit)(pe)} 0 0 ${ke} inset;
|
|
`,transition:`all ${C.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:Le}}},Et=C=>{const{componentCls:$,iconCls:ke,actionsLiMargin:Le,cardActionsIconSize:pe,colorBorderSecondary:_e,actionsBg:et}=C;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:et,borderTop:`${(0,M.unit)(C.lineWidth)} ${C.lineType} ${_e}`,display:"flex",borderRadius:`0 0 ${(0,M.unit)(C.borderRadiusLG)} ${(0,M.unit)(C.borderRadiusLG)}`},(0,N.dF)()),{"& > li":{margin:Le,color:C.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:C.calc(C.cardActionsIconSize).mul(2).equal(),fontSize:C.fontSize,lineHeight:C.lineHeight,cursor:"pointer","&:hover":{color:C.colorPrimary,transition:`color ${C.motionDurationMid}`},[`a:not(${$}-btn), > ${ke}`]:{display:"inline-block",width:"100%",color:C.colorTextDescription,lineHeight:(0,M.unit)(C.fontHeight),transition:`color ${C.motionDurationMid}`,"&:hover":{color:C.colorPrimary}},[`> ${ke}`]:{fontSize:pe,lineHeight:(0,M.unit)(C.calc(pe).mul(C.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${(0,M.unit)(C.lineWidth)} ${C.lineType} ${_e}`}}})},oe=C=>Object.assign(Object.assign({margin:`${(0,M.unit)(C.calc(C.marginXXS).mul(-1).equal())} 0`,display:"flex"},(0,N.dF)()),{"&-avatar":{paddingInlineEnd:C.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:C.marginXS}},"&-title":Object.assign({color:C.colorTextHeading,fontWeight:C.fontWeightStrong,fontSize:C.fontSizeLG},N.vS),"&-description":{color:C.colorTextDescription}}),K=C=>{const{componentCls:$,colorFillAlter:ke,headerPadding:Le,bodyPadding:pe}=C;return{[`${$}-head`]:{padding:`0 ${(0,M.unit)(Le)}`,background:ke,"&-title":{fontSize:C.fontSize}},[`${$}-body`]:{padding:`${(0,M.unit)(C.padding)} ${(0,M.unit)(pe)}`}}},W=C=>{const{componentCls:$}=C;return{overflow:"hidden",[`${$}-body`]:{userSelect:"none"}}},Se=C=>{const{componentCls:$,cardShadow:ke,cardHeadPadding:Le,colorBorderSecondary:pe,boxShadowTertiary:_e,bodyPadding:et,extraColor:Xt}=C;return{[$]:Object.assign(Object.assign({},(0,N.Wf)(C)),{position:"relative",background:C.colorBgContainer,borderRadius:C.borderRadiusLG,[`&:not(${$}-bordered)`]:{boxShadow:_e},[`${$}-head`]:Pt(C),[`${$}-extra`]:{marginInlineStart:"auto",color:Xt,fontWeight:"normal",fontSize:C.fontSize},[`${$}-body`]:Object.assign({padding:et,borderRadius:`0 0 ${(0,M.unit)(C.borderRadiusLG)} ${(0,M.unit)(C.borderRadiusLG)}`},(0,N.dF)()),[`${$}-grid`]:bt(C),[`${$}-cover`]:{"> *":{display:"block",width:"100%",borderRadius:`${(0,M.unit)(C.borderRadiusLG)} ${(0,M.unit)(C.borderRadiusLG)} 0 0`}},[`${$}-actions`]:Et(C),[`${$}-meta`]:oe(C)}),[`${$}-bordered`]:{border:`${(0,M.unit)(C.lineWidth)} ${C.lineType} ${pe}`,[`${$}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${$}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${C.motionDurationMid}, border-color ${C.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:ke}},[`${$}-contain-grid`]:{borderRadius:`${(0,M.unit)(C.borderRadiusLG)} ${(0,M.unit)(C.borderRadiusLG)} 0 0 `,[`${$}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${$}-loading) ${$}-body`]:{marginBlockStart:C.calc(C.lineWidth).mul(-1).equal(),marginInlineStart:C.calc(C.lineWidth).mul(-1).equal(),padding:0}},[`${$}-contain-tabs`]:{[`> div${$}-head`]:{minHeight:0,[`${$}-head-title, ${$}-extra`]:{paddingTop:Le}}},[`${$}-type-inner`]:K(C),[`${$}-loading`]:W(C),[`${$}-rtl`]:{direction:"rtl"}}},He=C=>{const{componentCls:$,bodyPaddingSM:ke,headerPaddingSM:Le,headerHeightSM:pe,headerFontSizeSM:_e}=C;return{[`${$}-small`]:{[`> ${$}-head`]:{minHeight:pe,padding:`0 ${(0,M.unit)(Le)}`,fontSize:_e,[`> ${$}-head-wrapper`]:{[`> ${$}-extra`]:{fontSize:C.fontSize}}},[`> ${$}-body`]:{padding:ke}},[`${$}-small${$}-contain-tabs`]:{[`> ${$}-head`]:{[`${$}-head-title, ${$}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}},Ie=C=>{var $,ke;return{headerBg:"transparent",headerFontSize:C.fontSizeLG,headerFontSizeSM:C.fontSize,headerHeight:C.fontSizeLG*C.lineHeightLG+C.padding*2,headerHeightSM:C.fontSize*C.lineHeight+C.paddingXS*2,actionsBg:C.colorBgContainer,actionsLiMargin:`${C.paddingSM}px 0`,tabsMarginBottom:-C.padding-C.lineWidth,extraColor:C.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:($=C.bodyPadding)!==null&&$!==void 0?$:C.paddingLG,headerPadding:(ke=C.headerPadding)!==null&&ke!==void 0?ke:C.paddingLG}};var fe=(0,de.I$)("Card",C=>{const $=(0,hn.mergeToken)(C,{cardShadow:C.boxShadowCard,cardHeadPadding:C.padding,cardPaddingBase:C.paddingLG,cardActionsIconSize:C.fontSize});return[Se($),He($)]},Ie),Be=L(24971),Vt=function(C,$){var ke={};for(var Le in C)Object.prototype.hasOwnProperty.call(C,Le)&&$.indexOf(Le)<0&&(ke[Le]=C[Le]);if(C!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,Le=Object.getOwnPropertySymbols(C);pe<Le.length;pe++)$.indexOf(Le[pe])<0&&Object.prototype.propertyIsEnumerable.call(C,Le[pe])&&(ke[Le[pe]]=C[Le[pe]]);return ke};const dt=C=>{const{actionClasses:$,actions:ke=[],actionStyle:Le}=C;return A.createElement("ul",{className:$,style:Le},ke.map((pe,_e)=>{const et=`action-${_e}`;return A.createElement("li",{style:{width:`${100/ke.length}%`},key:et},A.createElement("span",null,pe))}))};var Ce=A.forwardRef((C,$)=>{const{prefixCls:ke,className:Le,rootClassName:pe,style:_e,extra:et,headStyle:Xt={},bodyStyle:Sn={},title:Rn,loading:Pn,bordered:Ot,variant:on,size:rt,type:Nn,cover:ge,actions:X,tabList:J,children:D,activeTabKey:Ne,defaultActiveTabKey:Fe,tabBarExtraContent:ze,hoverable:Je,tabProps:z={},classNames:q,styles:ie}=C,O=Vt(C,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","variant","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps","classNames","styles"]),{getPrefixCls:Pe,direction:Ye,card:Oe}=A.useContext(x.E_),[pt]=(0,Be.Z)("card",on,Ot),Qt=St=>{var Wt;(Wt=C.onTabChange)===null||Wt===void 0||Wt.call(C,St)},It=St=>{var Wt;return ve()((Wt=Oe==null?void 0:Oe.classNames)===null||Wt===void 0?void 0:Wt[St],q==null?void 0:q[St])},ft=St=>{var Wt;return Object.assign(Object.assign({},(Wt=Oe==null?void 0:Oe.styles)===null||Wt===void 0?void 0:Wt[St]),ie==null?void 0:ie[St])},ee=A.useMemo(()=>{let St=!1;return A.Children.forEach(D,Wt=>{(Wt==null?void 0:Wt.type)===ne&&(St=!0)}),St},[D]),se=Pe("card",ke),[Ae,Y,Ue]=fe(se),Tt=A.createElement(Xe.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},D),wt=Ne!==void 0,Ke=Object.assign(Object.assign({},z),{[wt?"activeKey":"defaultActiveKey"]:wt?Ne:Fe,tabBarExtraContent:ze});let Nt;const tn=(0,m.Z)(rt),un=!tn||tn==="default"?"large":tn,zt=J?A.createElement(ae.default,Object.assign({size:un},Ke,{className:`${se}-head-tabs`,onChange:Qt,items:J.map(St=>{var{tab:Wt}=St,zn=Vt(St,["tab"]);return Object.assign({label:Wt},zn)})})):null;if(Rn||et||zt){const St=ve()(`${se}-head`,It("header")),Wt=ve()(`${se}-head-title`,It("title")),zn=ve()(`${se}-extra`,It("extra")),De=Object.assign(Object.assign({},Xt),ft("header"));Nt=A.createElement("div",{className:St,style:De},A.createElement("div",{className:`${se}-head-wrapper`},Rn&&A.createElement("div",{className:Wt,style:ft("title")},Rn),et&&A.createElement("div",{className:zn,style:ft("extra")},et)),zt)}const Tn=ve()(`${se}-cover`,It("cover")),En=ge?A.createElement("div",{className:Tn,style:ft("cover")},ge):null,mt=ve()(`${se}-body`,It("body")),at=Object.assign(Object.assign({},Sn),ft("body")),Yt=A.createElement("div",{className:mt,style:at},Pn?Tt:D),gt=ve()(`${se}-actions`,It("actions")),ct=X!=null&&X.length?A.createElement(dt,{actionClasses:gt,actionStyle:ft("actions"),actions:X}):null,Ln=(0,Z.Z)(O,["onTabChange"]),nn=ve()(se,Oe==null?void 0:Oe.className,{[`${se}-loading`]:Pn,[`${se}-bordered`]:pt!=="borderless",[`${se}-hoverable`]:Je,[`${se}-contain-grid`]:ee,[`${se}-contain-tabs`]:J==null?void 0:J.length,[`${se}-${tn}`]:tn,[`${se}-type-${Nn}`]:!!Nn,[`${se}-rtl`]:Ye==="rtl"},Le,pe,Y,Ue),dn=Object.assign(Object.assign({},Oe==null?void 0:Oe.style),_e);return Ae(A.createElement("div",Object.assign({ref:$},Ln,{className:nn,style:dn}),Nt,En,Yt,ct))}),F=function(C,$){var ke={};for(var Le in C)Object.prototype.hasOwnProperty.call(C,Le)&&$.indexOf(Le)<0&&(ke[Le]=C[Le]);if(C!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,Le=Object.getOwnPropertySymbols(C);pe<Le.length;pe++)$.indexOf(Le[pe])<0&&Object.prototype.propertyIsEnumerable.call(C,Le[pe])&&(ke[Le[pe]]=C[Le[pe]]);return ke},G=C=>{const{prefixCls:$,className:ke,avatar:Le,title:pe,description:_e}=C,et=F(C,["prefixCls","className","avatar","title","description"]),{getPrefixCls:Xt}=A.useContext(x.E_),Sn=Xt("card",$),Rn=ve()(`${Sn}-meta`,ke),Pn=Le?A.createElement("div",{className:`${Sn}-meta-avatar`},Le):null,Ot=pe?A.createElement("div",{className:`${Sn}-meta-title`},pe):null,on=_e?A.createElement("div",{className:`${Sn}-meta-description`},_e):null,rt=Ot||on?A.createElement("div",{className:`${Sn}-meta-detail`},Ot,on):null;return A.createElement("div",Object.assign({},et,{className:Rn}),Pn,rt)};const lt=Ce;lt.Grid=ne,lt.Meta=G;var Rt=lt},25769:function(Qn,pn,L){"use strict";var A=L(98040),ye={"text/plain":"Text","text/html":"Url",default:"Text"},ve="Copy to clipboard: #{key}, Enter";function Z(m){var Xe=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return m.replace(/#{\s*key\s*}/g,Xe)}function x(m,Xe){var ae,Ze,V,ne,M,N,de=!1;Xe||(Xe={}),ae=Xe.debug||!1;try{V=A(),ne=document.createRange(),M=document.getSelection(),N=document.createElement("span"),N.textContent=m,N.ariaHidden="true",N.style.all="unset",N.style.position="fixed",N.style.top=0,N.style.clip="rect(0, 0, 0, 0)",N.style.whiteSpace="pre",N.style.webkitUserSelect="text",N.style.MozUserSelect="text",N.style.msUserSelect="text",N.style.userSelect="text",N.addEventListener("copy",function(Pt){if(Pt.stopPropagation(),Xe.format)if(Pt.preventDefault(),typeof Pt.clipboardData=="undefined"){ae&&console.warn("unable to use e.clipboardData"),ae&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var bt=ye[Xe.format]||ye.default;window.clipboardData.setData(bt,m)}else Pt.clipboardData.clearData(),Pt.clipboardData.setData(Xe.format,m);Xe.onCopy&&(Pt.preventDefault(),Xe.onCopy(Pt.clipboardData))}),document.body.appendChild(N),ne.selectNodeContents(N),M.addRange(ne);var hn=document.execCommand("copy");if(!hn)throw new Error("copy command was unsuccessful");de=!0}catch(Pt){ae&&console.error("unable to copy using execCommand: ",Pt),ae&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(Xe.format||"text",m),Xe.onCopy&&Xe.onCopy(window.clipboardData),de=!0}catch(bt){ae&&console.error("unable to copy using clipboardData: ",bt),ae&&console.error("falling back to prompt"),Ze=Z("message"in Xe?Xe.message:ve),window.prompt(Ze,m)}}finally{M&&(typeof M.removeRange=="function"?M.removeRange(ne):M.removeAllRanges()),N&&document.body.removeChild(N),V()}return de}Qn.exports=x},3867:function(Qn,pn,L){var A=L(97671);(function(ye,ve){Qn.exports=ve()})(this,function(){"use strict";function ye(z){var q=typeof z;return z!==null&&(q==="object"||q==="function")}function ve(z){return typeof z=="function"}var Z=void 0;Array.isArray?Z=Array.isArray:Z=function(z){return Object.prototype.toString.call(z)==="[object Array]"};var x=Z,m=0,Xe=void 0,ae=void 0,Ze=function(q,ie){Se[m]=q,Se[m+1]=ie,m+=2,m===2&&(ae?ae(He):fe())};function V(z){ae=z}function ne(z){Ze=z}var M=typeof window!="undefined"?window:void 0,N=M||{},de=N.MutationObserver||N.WebKitMutationObserver,hn=typeof self=="undefined"&&typeof A!="undefined"&&{}.toString.call(A)==="[object process]",Pt=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function bt(){return function(){return A.nextTick(He)}}function Et(){return typeof Xe!="undefined"?function(){Xe(He)}:W()}function oe(){var z=0,q=new de(He),ie=document.createTextNode("");return q.observe(ie,{characterData:!0}),function(){ie.data=z=++z%2}}function K(){var z=new MessageChannel;return z.port1.onmessage=He,function(){return z.port2.postMessage(0)}}function W(){var z=setTimeout;return function(){return z(He,1)}}var Se=new Array(1e3);function He(){for(var z=0;z<m;z+=2){var q=Se[z],ie=Se[z+1];q(ie),Se[z]=void 0,Se[z+1]=void 0}m=0}function Ie(){try{var z=Function("return this")().require("vertx");return Xe=z.runOnLoop||z.runOnContext,Et()}catch(q){return W()}}var fe=void 0;hn?fe=bt():de?fe=oe():Pt?fe=K():M===void 0?fe=Ie():fe=W();function Be(z,q){var ie=this,O=new this.constructor(Zt);O[dt]===void 0&&rt(O);var Pe=ie._state;if(Pe){var Ye=arguments[Pe-1];Ze(function(){return Rn(Pe,O,Ye,ie._result)})}else Xt(ie,O,z,q);return O}function Vt(z){var q=this;if(z&&typeof z=="object"&&z.constructor===q)return z;var ie=new q(Zt);return Le(ie,z),ie}var dt=Math.random().toString(36).substring(2);function Zt(){}var Ce=void 0,F=1,ce=2;function G(){return new TypeError("You cannot resolve a promise with itself")}function lt(){return new TypeError("A promises callback cannot return that same promise.")}function Rt(z,q,ie,O){try{z.call(q,ie,O)}catch(Pe){return Pe}}function C(z,q,ie){Ze(function(O){var Pe=!1,Ye=Rt(ie,q,function(Oe){Pe||(Pe=!0,q!==Oe?Le(O,Oe):_e(O,Oe))},function(Oe){Pe||(Pe=!0,et(O,Oe))},"Settle: "+(O._label||" unknown promise"));!Pe&&Ye&&(Pe=!0,et(O,Ye))},z)}function $(z,q){q._state===F?_e(z,q._result):q._state===ce?et(z,q._result):Xt(q,void 0,function(ie){return Le(z,ie)},function(ie){return et(z,ie)})}function ke(z,q,ie){q.constructor===z.constructor&&ie===Be&&q.constructor.resolve===Vt?$(z,q):ie===void 0?_e(z,q):ve(ie)?C(z,q,ie):_e(z,q)}function Le(z,q){if(z===q)et(z,G());else if(ye(q)){var ie=void 0;try{ie=q.then}catch(O){et(z,O);return}ke(z,q,ie)}else _e(z,q)}function pe(z){z._onerror&&z._onerror(z._result),Sn(z)}function _e(z,q){z._state===Ce&&(z._result=q,z._state=F,z._subscribers.length!==0&&Ze(Sn,z))}function et(z,q){z._state===Ce&&(z._state=ce,z._result=q,Ze(pe,z))}function Xt(z,q,ie,O){var Pe=z._subscribers,Ye=Pe.length;z._onerror=null,Pe[Ye]=q,Pe[Ye+F]=ie,Pe[Ye+ce]=O,Ye===0&&z._state&&Ze(Sn,z)}function Sn(z){var q=z._subscribers,ie=z._state;if(q.length!==0){for(var O=void 0,Pe=void 0,Ye=z._result,Oe=0;Oe<q.length;Oe+=3)O=q[Oe],Pe=q[Oe+ie],O?Rn(ie,O,Pe,Ye):Pe(Ye);z._subscribers.length=0}}function Rn(z,q,ie,O){var Pe=ve(ie),Ye=void 0,Oe=void 0,pt=!0;if(Pe){try{Ye=ie(O)}catch(Qt){pt=!1,Oe=Qt}if(q===Ye){et(q,lt());return}}else Ye=O;q._state!==Ce||(Pe&&pt?Le(q,Ye):pt===!1?et(q,Oe):z===F?_e(q,Ye):z===ce&&et(q,Ye))}function Pn(z,q){try{q(function(O){Le(z,O)},function(O){et(z,O)})}catch(ie){et(z,ie)}}var Ot=0;function on(){return Ot++}function rt(z){z[dt]=Ot++,z._state=void 0,z._result=void 0,z._subscribers=[]}function Nn(){return new Error("Array Methods must be provided an Array")}var ge=function(){function z(q,ie){this._instanceConstructor=q,this.promise=new q(Zt),this.promise[dt]||rt(this.promise),x(ie)?(this.length=ie.length,this._remaining=ie.length,this._result=new Array(this.length),this.length===0?_e(this.promise,this._result):(this.length=this.length||0,this._enumerate(ie),this._remaining===0&&_e(this.promise,this._result))):et(this.promise,Nn())}return z.prototype._enumerate=function(ie){for(var O=0;this._state===Ce&&O<ie.length;O++)this._eachEntry(ie[O],O)},z.prototype._eachEntry=function(ie,O){var Pe=this._instanceConstructor,Ye=Pe.resolve;if(Ye===Vt){var Oe=void 0,pt=void 0,Qt=!1;try{Oe=ie.then}catch(ft){Qt=!0,pt=ft}if(Oe===Be&&ie._state!==Ce)this._settledAt(ie._state,O,ie._result);else if(typeof Oe!="function")this._remaining--,this._result[O]=ie;else if(Pe===ze){var It=new Pe(Zt);Qt?et(It,pt):ke(It,ie,Oe),this._willSettleAt(It,O)}else this._willSettleAt(new Pe(function(ft){return ft(ie)}),O)}else this._willSettleAt(Ye(ie),O)},z.prototype._settledAt=function(ie,O,Pe){var Ye=this.promise;Ye._state===Ce&&(this._remaining--,ie===ce?et(Ye,Pe):this._result[O]=Pe),this._remaining===0&&_e(Ye,this._result)},z.prototype._willSettleAt=function(ie,O){var Pe=this;Xt(ie,void 0,function(Ye){return Pe._settledAt(F,O,Ye)},function(Ye){return Pe._settledAt(ce,O,Ye)})},z}();function X(z){return new ge(this,z).promise}function J(z){var q=this;return x(z)?new q(function(ie,O){for(var Pe=z.length,Ye=0;Ye<Pe;Ye++)q.resolve(z[Ye]).then(ie,O)}):new q(function(ie,O){return O(new TypeError("You must pass an array to race."))})}function D(z){var q=this,ie=new q(Zt);return et(ie,z),ie}function Ne(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Fe(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var ze=function(){function z(q){this[dt]=on(),this._result=this._state=void 0,this._subscribers=[],Zt!==q&&(typeof q!="function"&&Ne(),this instanceof z?Pn(this,q):Fe())}return z.prototype.catch=function(ie){return this.then(null,ie)},z.prototype.finally=function(ie){var O=this,Pe=O.constructor;return ve(ie)?O.then(function(Ye){return Pe.resolve(ie()).then(function(){return Ye})},function(Ye){return Pe.resolve(ie()).then(function(){throw Ye})}):O.then(ie,ie)},z}();ze.prototype.then=Be,ze.all=X,ze.race=J,ze.resolve=Vt,ze.reject=D,ze._setScheduler=V,ze._setAsap=ne,ze._asap=Ze;function Je(){var z=void 0;if(typeof L.g!="undefined")z=L.g;else if(typeof self!="undefined")z=self;else try{z=Function("return this")()}catch(O){throw new Error("polyfill failed because global object is unavailable in this environment")}var q=z.Promise;if(q){var ie=null;try{ie=Object.prototype.toString.call(q.resolve())}catch(O){}if(ie==="[object Promise]"&&!q.cast)return}z.Promise=ze}return ze.polyfill=Je,ze.Promise=ze,ze})},86204:function(Qn){"use strict";var pn=typeof Reflect=="object"?Reflect:null,L=pn&&typeof pn.apply=="function"?pn.apply:function(K,W,Se){return Function.prototype.apply.call(K,W,Se)},A;pn&&typeof pn.ownKeys=="function"?A=pn.ownKeys:Object.getOwnPropertySymbols?A=function(K){return Object.getOwnPropertyNames(K).concat(Object.getOwnPropertySymbols(K))}:A=function(K){return Object.getOwnPropertyNames(K)};function ye(oe){console&&console.warn&&console.warn(oe)}var ve=Number.isNaN||function(K){return K!==K};function Z(){Z.init.call(this)}Qn.exports=Z,Qn.exports.once=Pt,Z.EventEmitter=Z,Z.prototype._events=void 0,Z.prototype._eventsCount=0,Z.prototype._maxListeners=void 0;var x=10;function m(oe){if(typeof oe!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof oe)}Object.defineProperty(Z,"defaultMaxListeners",{enumerable:!0,get:function(){return x},set:function(oe){if(typeof oe!="number"||oe<0||ve(oe))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+oe+".");x=oe}}),Z.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Z.prototype.setMaxListeners=function(K){if(typeof K!="number"||K<0||ve(K))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+K+".");return this._maxListeners=K,this};function Xe(oe){return oe._maxListeners===void 0?Z.defaultMaxListeners:oe._maxListeners}Z.prototype.getMaxListeners=function(){return Xe(this)},Z.prototype.emit=function(K){for(var W=[],Se=1;Se<arguments.length;Se++)W.push(arguments[Se]);var He=K==="error",Ie=this._events;if(Ie!==void 0)He=He&&Ie.error===void 0;else if(!He)return!1;if(He){var fe;if(W.length>0&&(fe=W[0]),fe instanceof Error)throw fe;var Be=new Error("Unhandled error."+(fe?" ("+fe.message+")":""));throw Be.context=fe,Be}var Vt=Ie[K];if(Vt===void 0)return!1;if(typeof Vt=="function")L(Vt,this,W);else for(var dt=Vt.length,Zt=N(Vt,dt),Se=0;Se<dt;++Se)L(Zt[Se],this,W);return!0};function ae(oe,K,W,Se){var He,Ie,fe;if(m(W),Ie=oe._events,Ie===void 0?(Ie=oe._events=Object.create(null),oe._eventsCount=0):(Ie.newListener!==void 0&&(oe.emit("newListener",K,W.listener?W.listener:W),Ie=oe._events),fe=Ie[K]),fe===void 0)fe=Ie[K]=W,++oe._eventsCount;else if(typeof fe=="function"?fe=Ie[K]=Se?[W,fe]:[fe,W]:Se?fe.unshift(W):fe.push(W),He=Xe(oe),He>0&&fe.length>He&&!fe.warned){fe.warned=!0;var Be=new Error("Possible EventEmitter memory leak detected. "+fe.length+" "+String(K)+" listeners added. Use emitter.setMaxListeners() to increase limit");Be.name="MaxListenersExceededWarning",Be.emitter=oe,Be.type=K,Be.count=fe.length,ye(Be)}return oe}Z.prototype.addListener=function(K,W){return ae(this,K,W,!1)},Z.prototype.on=Z.prototype.addListener,Z.prototype.prependListener=function(K,W){return ae(this,K,W,!0)};function Ze(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function V(oe,K,W){var Se={fired:!1,wrapFn:void 0,target:oe,type:K,listener:W},He=Ze.bind(Se);return He.listener=W,Se.wrapFn=He,He}Z.prototype.once=function(K,W){return m(W),this.on(K,V(this,K,W)),this},Z.prototype.prependOnceListener=function(K,W){return m(W),this.prependListener(K,V(this,K,W)),this},Z.prototype.removeListener=function(K,W){var Se,He,Ie,fe,Be;if(m(W),He=this._events,He===void 0)return this;if(Se=He[K],Se===void 0)return this;if(Se===W||Se.listener===W)--this._eventsCount===0?this._events=Object.create(null):(delete He[K],He.removeListener&&this.emit("removeListener",K,Se.listener||W));else if(typeof Se!="function"){for(Ie=-1,fe=Se.length-1;fe>=0;fe--)if(Se[fe]===W||Se[fe].listener===W){Be=Se[fe].listener,Ie=fe;break}if(Ie<0)return this;Ie===0?Se.shift():de(Se,Ie),Se.length===1&&(He[K]=Se[0]),He.removeListener!==void 0&&this.emit("removeListener",K,Be||W)}return this},Z.prototype.off=Z.prototype.removeListener,Z.prototype.removeAllListeners=function(K){var W,Se,He;if(Se=this._events,Se===void 0)return this;if(Se.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Se[K]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete Se[K]),this;if(arguments.length===0){var Ie=Object.keys(Se),fe;for(He=0;He<Ie.length;++He)fe=Ie[He],fe!=="removeListener"&&this.removeAllListeners(fe);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(W=Se[K],typeof W=="function")this.removeListener(K,W);else if(W!==void 0)for(He=W.length-1;He>=0;He--)this.removeListener(K,W[He]);return this};function ne(oe,K,W){var Se=oe._events;if(Se===void 0)return[];var He=Se[K];return He===void 0?[]:typeof He=="function"?W?[He.listener||He]:[He]:W?hn(He):N(He,He.length)}Z.prototype.listeners=function(K){return ne(this,K,!0)},Z.prototype.rawListeners=function(K){return ne(this,K,!1)},Z.listenerCount=function(oe,K){return typeof oe.listenerCount=="function"?oe.listenerCount(K):M.call(oe,K)},Z.prototype.listenerCount=M;function M(oe){var K=this._events;if(K!==void 0){var W=K[oe];if(typeof W=="function")return 1;if(W!==void 0)return W.length}return 0}Z.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function N(oe,K){for(var W=new Array(K),Se=0;Se<K;++Se)W[Se]=oe[Se];return W}function de(oe,K){for(;K+1<oe.length;K++)oe[K]=oe[K+1];oe.pop()}function hn(oe){for(var K=new Array(oe.length),W=0;W<K.length;++W)K[W]=oe[W].listener||oe[W];return K}function Pt(oe,K){return new Promise(function(W,Se){function He(fe){oe.removeListener(K,Ie),Se(fe)}function Ie(){typeof oe.removeListener=="function"&&oe.removeListener("error",He),W([].slice.call(arguments))}Et(oe,K,Ie,{once:!0}),K!=="error"&&bt(oe,He,{once:!0})})}function bt(oe,K,W){typeof oe.on=="function"&&Et(oe,"error",K,W)}function Et(oe,K,W,Se){if(typeof oe.on=="function")Se.once?oe.once(K,W):oe.on(K,W);else if(typeof oe.addEventListener=="function")oe.addEventListener(K,function He(Ie){Se.once&&oe.removeEventListener(K,He),W(Ie)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof oe)}},24334:function(Qn,pn,L){var A,ye;(function(ve,Z){Qn.exports=Z(ve)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof L.g!="undefined"?L.g:this,function(ve){"use strict";ve=ve||{};var Z=ve.Base64,x="2.6.4",m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xe=function(F){for(var ce={},G=0,lt=F.length;G<lt;G++)ce[F.charAt(G)]=G;return ce}(m),ae=String.fromCharCode,Ze=function(F){if(F.length<2){var ce=F.charCodeAt(0);return ce<128?F:ce<2048?ae(192|ce>>>6)+ae(128|ce&63):ae(224|ce>>>12&15)+ae(128|ce>>>6&63)+ae(128|ce&63)}else{var ce=65536+(F.charCodeAt(0)-55296)*1024+(F.charCodeAt(1)-56320);return ae(240|ce>>>18&7)+ae(128|ce>>>12&63)+ae(128|ce>>>6&63)+ae(128|ce&63)}},V=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,ne=function(F){return F.replace(V,Ze)},M=function(F){var ce=[0,2,1][F.length%3],G=F.charCodeAt(0)<<16|(F.length>1?F.charCodeAt(1):0)<<8|(F.length>2?F.charCodeAt(2):0),lt=[m.charAt(G>>>18),m.charAt(G>>>12&63),ce>=2?"=":m.charAt(G>>>6&63),ce>=1?"=":m.charAt(G&63)];return lt.join("")},N=ve.btoa&&typeof ve.btoa=="function"?function(F){return ve.btoa(F)}:function(F){if(F.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return F.replace(/[\s\S]{1,3}/g,M)},de=function(F){return N(ne(String(F)))},hn=function(F){return F.replace(/[+\/]/g,function(ce){return ce=="+"?"-":"_"}).replace(/=/g,"")},Pt=function(F,ce){return ce?hn(de(F)):de(F)},bt=function(F){return Pt(F,!0)},Et;ve.Uint8Array&&(Et=function(F,ce){for(var G="",lt=0,Rt=F.length;lt<Rt;lt+=3){var C=F[lt],$=F[lt+1],ke=F[lt+2],Le=C<<16|$<<8|ke;G+=m.charAt(Le>>>18)+m.charAt(Le>>>12&63)+(typeof $!="undefined"?m.charAt(Le>>>6&63):"=")+(typeof ke!="undefined"?m.charAt(Le&63):"=")}return ce?hn(G):G});var oe=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,K=function(F){switch(F.length){case 4:var ce=(7&F.charCodeAt(0))<<18|(63&F.charCodeAt(1))<<12|(63&F.charCodeAt(2))<<6|63&F.charCodeAt(3),G=ce-65536;return ae((G>>>10)+55296)+ae((G&1023)+56320);case 3:return ae((15&F.charCodeAt(0))<<12|(63&F.charCodeAt(1))<<6|63&F.charCodeAt(2));default:return ae((31&F.charCodeAt(0))<<6|63&F.charCodeAt(1))}},W=function(F){return F.replace(oe,K)},Se=function(F){var ce=F.length,G=ce%4,lt=(ce>0?Xe[F.charAt(0)]<<18:0)|(ce>1?Xe[F.charAt(1)]<<12:0)|(ce>2?Xe[F.charAt(2)]<<6:0)|(ce>3?Xe[F.charAt(3)]:0),Rt=[ae(lt>>>16),ae(lt>>>8&255),ae(lt&255)];return Rt.length-=[0,0,2,1][G],Rt.join("")},He=ve.atob&&typeof ve.atob=="function"?function(F){return ve.atob(F)}:function(F){return F.replace(/\S{1,4}/g,Se)},Ie=function(F){return He(String(F).replace(/[^A-Za-z0-9\+\/]/g,""))},fe=function(F){return W(He(F))},Be=function(F){return String(F).replace(/[-_]/g,function(ce){return ce=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Vt=function(F){return fe(Be(F))},dt;ve.Uint8Array&&(dt=function(F){return Uint8Array.from(Ie(Be(F)),function(ce){return ce.charCodeAt(0)})});var Zt=function(){var F=ve.Base64;return ve.Base64=Z,F};if(ve.Base64={VERSION:x,atob:Ie,btoa:N,fromBase64:Vt,toBase64:Pt,utob:ne,encode:Pt,encodeURI:bt,btou:W,decode:Vt,noConflict:Zt,fromUint8Array:Et,toUint8Array:dt},typeof Object.defineProperty=="function"){var Ce=function(F){return{value:F,enumerable:!1,writable:!0,configurable:!0}};ve.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",Ce(function(){return Vt(this)})),Object.defineProperty(String.prototype,"toBase64",Ce(function(F){return Pt(this,F)})),Object.defineProperty(String.prototype,"toBase64URI",Ce(function(){return Pt(this,!0)}))}}return ve.Meteor&&(Base64=ve.Base64),Qn.exports?Qn.exports.Base64=ve.Base64:(A=[],ye=function(){return ve.Base64}.apply(pn,A),ye!==void 0&&(Qn.exports=ye)),{Base64:ve.Base64}})},96478:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return Ie}});var A=L(71409),ye=L(87075),ve=L(11036),Z=L(39224),x=L(65352),m=L(92310),Xe=L.n(m),ae=L(8654),Ze=L(59301),V=L(10228),ne=L(16089),M=V.Z.ESC,N=V.Z.TAB;function de(fe){var Be=fe.visible,Vt=fe.triggerRef,dt=fe.onVisibleChange,Zt=fe.autoFocus,Ce=fe.overlayRef,F=Ze.useRef(!1),ce=function(){if(Be){var C,$;(C=Vt.current)===null||C===void 0||($=C.focus)===null||$===void 0||$.call(C),dt==null||dt(!1)}},G=function(){var C;return(C=Ce.current)!==null&&C!==void 0&&C.focus?(Ce.current.focus(),F.current=!0,!0):!1},lt=function(C){switch(C.keyCode){case M:ce();break;case N:{var $=!1;F.current||($=G()),$?C.preventDefault():ce();break}}};Ze.useEffect(function(){return Be?(window.addEventListener("keydown",lt),Zt&&(0,ne.Z)(G,3),function(){window.removeEventListener("keydown",lt),F.current=!1}):function(){F.current=!1}},[Be])}var hn=(0,Ze.forwardRef)(function(fe,Be){var Vt=fe.overlay,dt=fe.arrow,Zt=fe.prefixCls,Ce=(0,Ze.useMemo)(function(){var ce;return typeof Vt=="function"?ce=Vt():ce=Vt,ce},[Vt]),F=(0,ae.sQ)(Be,(0,ae.C4)(Ce));return Ze.createElement(Ze.Fragment,null,dt&&Ze.createElement("div",{className:"".concat(Zt,"-arrow")}),Ze.cloneElement(Ce,{ref:(0,ae.Yr)(Ce)?F:void 0}))}),Pt=hn,bt={adjustX:1,adjustY:1},Et=[0,0],oe={topLeft:{points:["bl","tl"],overflow:bt,offset:[0,-4],targetOffset:Et},top:{points:["bc","tc"],overflow:bt,offset:[0,-4],targetOffset:Et},topRight:{points:["br","tr"],overflow:bt,offset:[0,-4],targetOffset:Et},bottomLeft:{points:["tl","bl"],overflow:bt,offset:[0,4],targetOffset:Et},bottom:{points:["tc","bc"],overflow:bt,offset:[0,4],targetOffset:Et},bottomRight:{points:["tr","br"],overflow:bt,offset:[0,4],targetOffset:Et}},K=oe,W=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function Se(fe,Be){var Vt,dt=fe.arrow,Zt=dt===void 0?!1:dt,Ce=fe.prefixCls,F=Ce===void 0?"rc-dropdown":Ce,ce=fe.transitionName,G=fe.animation,lt=fe.align,Rt=fe.placement,C=Rt===void 0?"bottomLeft":Rt,$=fe.placements,ke=$===void 0?K:$,Le=fe.getPopupContainer,pe=fe.showAction,_e=fe.hideAction,et=fe.overlayClassName,Xt=fe.overlayStyle,Sn=fe.visible,Rn=fe.trigger,Pn=Rn===void 0?["hover"]:Rn,Ot=fe.autoFocus,on=fe.overlay,rt=fe.children,Nn=fe.onVisibleChange,ge=(0,Z.Z)(fe,W),X=Ze.useState(),J=(0,ve.Z)(X,2),D=J[0],Ne=J[1],Fe="visible"in fe?Sn:D,ze=Ze.useRef(null),Je=Ze.useRef(null),z=Ze.useRef(null);Ze.useImperativeHandle(Be,function(){return ze.current});var q=function(ft){Ne(ft),Nn==null||Nn(ft)};de({visible:Fe,triggerRef:z,onVisibleChange:q,autoFocus:Ot,overlayRef:Je});var ie=function(ft){var ee=fe.onOverlayClick;Ne(!1),ee&&ee(ft)},O=function(){return Ze.createElement(Pt,{ref:Je,overlay:on,prefixCls:F,arrow:Zt})},Pe=function(){return typeof on=="function"?O:O()},Ye=function(){var ft=fe.minOverlayWidthMatchTrigger,ee=fe.alignPoint;return"minOverlayWidthMatchTrigger"in fe?ft:!ee},Oe=function(){var ft=fe.openClassName;return ft!==void 0?ft:"".concat(F,"-open")},pt=Ze.cloneElement(rt,{className:Xe()((Vt=rt.props)===null||Vt===void 0?void 0:Vt.className,Fe&&Oe()),ref:(0,ae.Yr)(rt)?(0,ae.sQ)(z,(0,ae.C4)(rt)):void 0}),Qt=_e;return!Qt&&Pn.indexOf("contextMenu")!==-1&&(Qt=["click"]),Ze.createElement(x.Z,(0,A.Z)({builtinPlacements:ke},ge,{prefixCls:F,ref:ze,popupClassName:Xe()(et,(0,ye.Z)({},"".concat(F,"-show-arrow"),Zt)),popupStyle:Xt,action:Pn,showAction:pe,hideAction:Qt,popupPlacement:C,popupAlign:lt,popupTransitionName:ce,popupAnimation:G,popupVisible:Fe,stretch:Ye()?"minWidth":"",popup:Pe(),onPopupVisibleChange:q,onPopupClick:ie,getPopupContainer:Le}),pt)}var He=Ze.forwardRef(Se),Ie=He},28321:function(Qn,pn,L){"use strict";L.d(pn,{iz:function(){return _},ck:function(){return mt},BW:function(){return U},sN:function(){return mt},Wd:function(){return _t},ZP:function(){return we},Xl:function(){return Vt}});var A=L(71409),ye=L(87075),ve=L(89490),Z=L(62730),x=L(11036),m=L(39224),Xe=L(92310),ae=L.n(Xe),Ze=L(11780),V=L(18929),ne=L(13697),M=L(48736),N=L(59301),de=L(4676),hn=N.createContext(null);function Pt(w,H){return w===void 0?null:"".concat(w,"-").concat(H)}function bt(w){var H=N.useContext(hn);return Pt(H,w)}var Et=L(80547),oe=["children","locked"],K=N.createContext(null);function W(w,H){var te=(0,ve.Z)({},w);return Object.keys(H).forEach(function(le){var Ge=H[le];Ge!==void 0&&(te[le]=Ge)}),te}function Se(w){var H=w.children,te=w.locked,le=(0,m.Z)(w,oe),Ge=N.useContext(K),Ve=(0,Et.Z)(function(){return W(Ge,le)},[Ge,le],function($e,vt){return!te&&($e[0]!==vt[0]||!(0,ne.Z)($e[1],vt[1],!0))});return N.createElement(K.Provider,{value:Ve},H)}var He=[],Ie=N.createContext(null);function fe(){return N.useContext(Ie)}var Be=N.createContext(He);function Vt(w){var H=N.useContext(Be);return N.useMemo(function(){return w!==void 0?[].concat((0,Z.Z)(H),[w]):H},[H,w])}var dt=N.createContext(null),Zt=N.createContext({}),Ce=Zt,F=L(29194);function ce(w){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,F.Z)(w)){var te=w.nodeName.toLowerCase(),le=["input","select","textarea","button"].includes(te)||w.isContentEditable||te==="a"&&!!w.getAttribute("href"),Ge=w.getAttribute("tabindex"),Ve=Number(Ge),$e=null;return Ge&&!Number.isNaN(Ve)?$e=Ve:le&&$e===null&&($e=0),le&&w.disabled&&($e=null),$e!==null&&($e>=0||H&&$e<0)}return!1}function G(w){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,te=(0,Z.Z)(w.querySelectorAll("*")).filter(function(le){return ce(le,H)});return ce(w,H)&&te.unshift(w),te}var lt=null;function Rt(){lt=document.activeElement}function C(){lt=null}function $(){if(lt)try{lt.focus()}catch(w){}}function ke(w,H){if(H.keyCode===9){var te=G(w),le=te[H.shiftKey?0:te.length-1],Ge=le===document.activeElement||w===document.activeElement;if(Ge){var Ve=te[H.shiftKey?te.length-1:0];Ve.focus(),H.preventDefault()}}}var Le=L(10228),pe=L(16089),_e=Le.Z.LEFT,et=Le.Z.RIGHT,Xt=Le.Z.UP,Sn=Le.Z.DOWN,Rn=Le.Z.ENTER,Pn=Le.Z.ESC,Ot=Le.Z.HOME,on=Le.Z.END,rt=[Xt,Sn,_e,et];function Nn(w,H,te,le){var Ge,Ve="prev",$e="next",vt="children",Ct="parent";if(w==="inline"&&le===Rn)return{inlineTrigger:!0};var At=(0,ye.Z)((0,ye.Z)({},Xt,Ve),Sn,$e),qt=(0,ye.Z)((0,ye.Z)((0,ye.Z)((0,ye.Z)({},_e,te?$e:Ve),et,te?Ve:$e),Sn,vt),Rn,vt),xt=(0,ye.Z)((0,ye.Z)((0,ye.Z)((0,ye.Z)((0,ye.Z)((0,ye.Z)({},Xt,Ve),Sn,$e),Rn,vt),Pn,Ct),_e,te?vt:Ct),et,te?Ct:vt),Jt={inline:At,horizontal:qt,vertical:xt,inlineSub:At,horizontalSub:xt,verticalSub:xt},$t=(Ge=Jt["".concat(w).concat(H?"":"Sub")])===null||Ge===void 0?void 0:Ge[le];switch($t){case Ve:return{offset:-1,sibling:!0};case $e:return{offset:1,sibling:!0};case Ct:return{offset:-1,sibling:!1};case vt:return{offset:1,sibling:!1};default:return null}}function ge(w){for(var H=w;H;){if(H.getAttribute("data-menu-list"))return H;H=H.parentElement}return null}function X(w,H){for(var te=w||document.activeElement;te;){if(H.has(te))return te;te=te.parentElement}return null}function J(w,H){var te=G(w,!0);return te.filter(function(le){return H.has(le)})}function D(w,H,te){var le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!w)return null;var Ge=J(w,H),Ve=Ge.length,$e=Ge.findIndex(function(vt){return te===vt});return le<0?$e===-1?$e=Ve-1:$e-=1:le>0&&($e+=1),$e=($e+Ve)%Ve,Ge[$e]}var Ne=function(H,te){var le=new Set,Ge=new Map,Ve=new Map;return H.forEach(function($e){var vt=document.querySelector("[data-menu-id='".concat(Pt(te,$e),"']"));vt&&(le.add(vt),Ve.set(vt,$e),Ge.set($e,vt))}),{elements:le,key2element:Ge,element2key:Ve}};function Fe(w,H,te,le,Ge,Ve,$e,vt,Ct,At){var qt=N.useRef(),xt=N.useRef();xt.current=H;var Jt=function(){pe.Z.cancel(qt.current)};return N.useEffect(function(){return function(){Jt()}},[]),function($t){var rn=$t.which;if([].concat(rt,[Rn,Pn,Ot,on]).includes(rn)){var jt=Ve(),Kt=Ne(jt,le),yn=Kt,yt=yn.elements,Dt=yn.key2element,kt=yn.element2key,mn=Dt.get(H),en=X(mn,yt),fn=kt.get(en),Cn=Nn(w,$e(fn,!0).length===1,te,rn);if(!Cn&&rn!==Ot&&rn!==on)return;(rt.includes(rn)||[Ot,on].includes(rn))&&$t.preventDefault();var On=function(cn){if(cn){var ot=cn,nt=cn.querySelector("a");nt!=null&&nt.getAttribute("href")&&(ot=nt);var Ft=kt.get(cn);vt(Ft),Jt(),qt.current=(0,pe.Z)(function(){xt.current===Ft&&ot.focus()})}};if([Ot,on].includes(rn)||Cn.sibling||!en){var si;!en||w==="inline"?si=Ge.current:si=ge(en);var Fn,Bn=J(si,yt);rn===Ot?Fn=Bn[0]:rn===on?Fn=Bn[Bn.length-1]:Fn=D(si,yt,en,Cn.offset),On(Fn)}else if(Cn.inlineTrigger)Ct(fn);else if(Cn.offset>0)Ct(fn,!0),Jt(),qt.current=(0,pe.Z)(function(){Kt=Ne(jt,le);var $n=en.getAttribute("aria-controls"),cn=document.getElementById($n),ot=D(cn,Kt.elements);On(ot)},5);else if(Cn.offset<0){var Yn=$e(fn,!0),ti=Yn[Yn.length-2],qn=Dt.get(ti);Ct(ti,!1),On(qn)}}At==null||At($t)}}function ze(w){Promise.resolve().then(w)}var Je="__RC_UTIL_PATH_SPLIT__",z=function(H){return H.join(Je)},q=function(H){return H.split(Je)},ie="rc-menu-more";function O(){var w=N.useState({}),H=(0,x.Z)(w,2),te=H[1],le=(0,N.useRef)(new Map),Ge=(0,N.useRef)(new Map),Ve=N.useState([]),$e=(0,x.Z)(Ve,2),vt=$e[0],Ct=$e[1],At=(0,N.useRef)(0),qt=(0,N.useRef)(!1),xt=function(){qt.current||te({})},Jt=(0,N.useCallback)(function(Dt,kt){var mn=z(kt);Ge.current.set(mn,Dt),le.current.set(Dt,mn),At.current+=1;var en=At.current;ze(function(){en===At.current&&xt()})},[]),$t=(0,N.useCallback)(function(Dt,kt){var mn=z(kt);Ge.current.delete(mn),le.current.delete(Dt)},[]),rn=(0,N.useCallback)(function(Dt){Ct(Dt)},[]),jt=(0,N.useCallback)(function(Dt,kt){var mn=le.current.get(Dt)||"",en=q(mn);return kt&&vt.includes(en[0])&&en.unshift(ie),en},[vt]),Kt=(0,N.useCallback)(function(Dt,kt){return Dt.filter(function(mn){return mn!==void 0}).some(function(mn){var en=jt(mn,!0);return en.includes(kt)})},[jt]),yn=function(){var kt=(0,Z.Z)(le.current.keys());return vt.length&&kt.push(ie),kt},yt=(0,N.useCallback)(function(Dt){var kt="".concat(le.current.get(Dt)).concat(Je),mn=new Set;return(0,Z.Z)(Ge.current.keys()).forEach(function(en){en.startsWith(kt)&&mn.add(Ge.current.get(en))}),mn},[]);return N.useEffect(function(){return function(){qt.current=!0}},[]),{registerPath:Jt,unregisterPath:$t,refreshOverflowKeys:rn,isSubPathKey:Kt,getKeyPath:jt,getKeys:yn,getSubPathKeys:yt}}function Pe(w){var H=N.useRef(w);H.current=w;var te=N.useCallback(function(){for(var le,Ge=arguments.length,Ve=new Array(Ge),$e=0;$e<Ge;$e++)Ve[$e]=arguments[$e];return(le=H.current)===null||le===void 0?void 0:le.call.apply(le,[H].concat(Ve))},[]);return w?te:void 0}var Ye=Math.random().toFixed(5).toString().slice(2),Oe=0;function pt(w){var H=(0,V.Z)(w,{value:w}),te=(0,x.Z)(H,2),le=te[0],Ge=te[1];return N.useEffect(function(){Oe+=1;var Ve="".concat(Ye,"-").concat(Oe);Ge("rc-menu-uuid-".concat(Ve))},[]),le}var Qt=L(16552),It=L(19210),ft=L(46654),ee=L(37205),se=L(2738),Ae=L(8654);function Y(w,H,te,le){var Ge=N.useContext(K),Ve=Ge.activeKey,$e=Ge.onActive,vt=Ge.onInactive,Ct={active:Ve===w};return H||(Ct.onMouseEnter=function(At){te==null||te({key:w,domEvent:At}),$e(w)},Ct.onMouseLeave=function(At){le==null||le({key:w,domEvent:At}),vt(w)}),Ct}function Ue(w){var H=N.useContext(K),te=H.mode,le=H.rtl,Ge=H.inlineIndent;if(te!=="inline")return null;var Ve=w;return le?{paddingRight:Ve*Ge}:{paddingLeft:Ve*Ge}}function Tt(w){var H=w.icon,te=w.props,le=w.children,Ge;return H===null||H===!1?null:(typeof H=="function"?Ge=N.createElement(H,(0,ve.Z)({},te)):typeof H!="boolean"&&(Ge=H),Ge||le||null)}var wt=["item"];function Ke(w){var H=w.item,te=(0,m.Z)(w,wt);return Object.defineProperty(te,"item",{get:function(){return(0,M.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),H}}),te}var Nt=["title","attribute","elementRef"],tn=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],un=["active"],zt=function(w){(0,ft.Z)(te,w);var H=(0,ee.Z)(te);function te(){return(0,Qt.Z)(this,te),H.apply(this,arguments)}return(0,It.Z)(te,[{key:"render",value:function(){var Ge=this.props,Ve=Ge.title,$e=Ge.attribute,vt=Ge.elementRef,Ct=(0,m.Z)(Ge,Nt),At=(0,se.Z)(Ct,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,M.ZP)(!$e,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),N.createElement(Ze.Z.Item,(0,A.Z)({},$e,{title:typeof Ve=="string"?Ve:void 0},At,{ref:vt}))}}]),te}(N.Component),Tn=N.forwardRef(function(w,H){var te=w.style,le=w.className,Ge=w.eventKey,Ve=w.warnKey,$e=w.disabled,vt=w.itemIcon,Ct=w.children,At=w.role,qt=w.onMouseEnter,xt=w.onMouseLeave,Jt=w.onClick,$t=w.onKeyDown,rn=w.onFocus,jt=(0,m.Z)(w,tn),Kt=bt(Ge),yn=N.useContext(K),yt=yn.prefixCls,Dt=yn.onItemClick,kt=yn.disabled,mn=yn.overflowDisabled,en=yn.itemIcon,fn=yn.selectedKeys,Cn=yn.onActive,On=N.useContext(Ce),si=On._internalRenderMenuItem,Fn="".concat(yt,"-item"),Bn=N.useRef(),Yn=N.useRef(),ti=kt||$e,qn=(0,Ae.x1)(H,Yn),$n=Vt(Ge),cn=function(wn){return{key:Ge,keyPath:(0,Z.Z)($n).reverse(),item:Bn.current,domEvent:wn}},ot=vt||en,nt=Y(Ge,ti,qt,xt),Ft=nt.active,Bt=(0,m.Z)(nt,un),gn=fn.includes(Ge),Zn=Ue($n.length),jn=function(wn){if(!ti){var _i=cn(wn);Jt==null||Jt(Ke(_i)),Dt(_i)}},Mn=function(wn){if($t==null||$t(wn),wn.which===Le.Z.ENTER){var _i=cn(wn);Jt==null||Jt(Ke(_i)),Dt(_i)}},ni=function(wn){Cn(Ge),rn==null||rn(wn)},vi={};w.role==="option"&&(vi["aria-selected"]=gn);var Ti=N.createElement(zt,(0,A.Z)({ref:Bn,elementRef:qn,role:At===null?"none":At||"menuitem",tabIndex:$e?null:-1,"data-menu-id":mn&&Kt?null:Kt},(0,se.Z)(jt,["extra"]),Bt,vi,{component:"li","aria-disabled":$e,style:(0,ve.Z)((0,ve.Z)({},Zn),te),className:ae()(Fn,(0,ye.Z)((0,ye.Z)((0,ye.Z)({},"".concat(Fn,"-active"),Ft),"".concat(Fn,"-selected"),gn),"".concat(Fn,"-disabled"),ti),le),onClick:jn,onKeyDown:Mn,onFocus:ni}),Ct,N.createElement(Tt,{props:(0,ve.Z)((0,ve.Z)({},w),{},{isSelected:gn}),icon:ot}));return si&&(Ti=si(Ti,w,{selected:gn})),Ti});function En(w,H){var te=w.eventKey,le=fe(),Ge=Vt(te);return N.useEffect(function(){if(le)return le.registerPath(te,Ge),function(){le.unregisterPath(te,Ge)}},[Ge]),le?null:N.createElement(Tn,(0,A.Z)({},w,{ref:H}))}var mt=N.forwardRef(En),at=["className","children"],Yt=function(H,te){var le=H.className,Ge=H.children,Ve=(0,m.Z)(H,at),$e=N.useContext(K),vt=$e.prefixCls,Ct=$e.mode,At=$e.rtl;return N.createElement("ul",(0,A.Z)({className:ae()(vt,At&&"".concat(vt,"-rtl"),"".concat(vt,"-sub"),"".concat(vt,"-").concat(Ct==="inline"?"inline":"vertical"),le),role:"menu"},Ve,{"data-menu-list":!0,ref:te}),Ge)},gt=N.forwardRef(Yt);gt.displayName="SubMenuList";var ct=gt,Ln=L(11592);function nn(w,H){return(0,Ln.Z)(w).map(function(te,le){if(N.isValidElement(te)){var Ge,Ve,$e=te.key,vt=(Ge=(Ve=te.props)===null||Ve===void 0?void 0:Ve.eventKey)!==null&&Ge!==void 0?Ge:$e,Ct=vt==null;Ct&&(vt="tmp_key-".concat([].concat((0,Z.Z)(H),[le]).join("-")));var At={key:vt,eventKey:vt};return N.cloneElement(te,At)}return te})}var dn=L(65352),St={adjustX:1,adjustY:1},Wt={topLeft:{points:["bl","tl"],overflow:St},topRight:{points:["br","tr"],overflow:St},bottomLeft:{points:["tl","bl"],overflow:St},bottomRight:{points:["tr","br"],overflow:St},leftTop:{points:["tr","tl"],overflow:St},leftBottom:{points:["br","bl"],overflow:St},rightTop:{points:["tl","tr"],overflow:St},rightBottom:{points:["bl","br"],overflow:St}},zn={topLeft:{points:["bl","tl"],overflow:St},topRight:{points:["br","tr"],overflow:St},bottomLeft:{points:["tl","bl"],overflow:St},bottomRight:{points:["tr","br"],overflow:St},rightTop:{points:["tr","tl"],overflow:St},rightBottom:{points:["br","bl"],overflow:St},leftTop:{points:["tl","tr"],overflow:St},leftBottom:{points:["bl","br"],overflow:St}},De=null;function c(w,H,te){if(H)return H;if(te)return te[w]||te.other}var h={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function g(w){var H=w.prefixCls,te=w.visible,le=w.children,Ge=w.popup,Ve=w.popupStyle,$e=w.popupClassName,vt=w.popupOffset,Ct=w.disabled,At=w.mode,qt=w.onVisibleChange,xt=N.useContext(K),Jt=xt.getPopupContainer,$t=xt.rtl,rn=xt.subMenuOpenDelay,jt=xt.subMenuCloseDelay,Kt=xt.builtinPlacements,yn=xt.triggerSubMenuAction,yt=xt.forceSubMenuRender,Dt=xt.rootClassName,kt=xt.motion,mn=xt.defaultMotions,en=N.useState(!1),fn=(0,x.Z)(en,2),Cn=fn[0],On=fn[1],si=$t?(0,ve.Z)((0,ve.Z)({},zn),Kt):(0,ve.Z)((0,ve.Z)({},Wt),Kt),Fn=h[At],Bn=c(At,kt,mn),Yn=N.useRef(Bn);At!=="inline"&&(Yn.current=Bn);var ti=(0,ve.Z)((0,ve.Z)({},Yn.current),{},{leavedClassName:"".concat(H,"-hidden"),removeOnLeave:!1,motionAppear:!0}),qn=N.useRef();return N.useEffect(function(){return qn.current=(0,pe.Z)(function(){On(te)}),function(){pe.Z.cancel(qn.current)}},[te]),N.createElement(dn.Z,{prefixCls:H,popupClassName:ae()("".concat(H,"-popup"),(0,ye.Z)({},"".concat(H,"-rtl"),$t),$e,Dt),stretch:At==="horizontal"?"minWidth":null,getPopupContainer:Jt,builtinPlacements:si,popupPlacement:Fn,popupVisible:Cn,popup:Ge,popupStyle:Ve,popupAlign:vt&&{offset:vt},action:Ct?[]:[yn],mouseEnterDelay:rn,mouseLeaveDelay:jt,onPopupVisibleChange:qt,forceRender:yt,popupMotion:ti,fresh:!0},le)}var E=L(77900);function S(w){var H=w.id,te=w.open,le=w.keyPath,Ge=w.children,Ve="inline",$e=N.useContext(K),vt=$e.prefixCls,Ct=$e.forceSubMenuRender,At=$e.motion,qt=$e.defaultMotions,xt=$e.mode,Jt=N.useRef(!1);Jt.current=xt===Ve;var $t=N.useState(!Jt.current),rn=(0,x.Z)($t,2),jt=rn[0],Kt=rn[1],yn=Jt.current?te:!1;N.useEffect(function(){Jt.current&&Kt(!1)},[xt]);var yt=(0,ve.Z)({},c(Ve,At,qt));le.length>1&&(yt.motionAppear=!1);var Dt=yt.onVisibleChanged;return yt.onVisibleChanged=function(kt){return!Jt.current&&!kt&&Kt(!0),Dt==null?void 0:Dt(kt)},jt?null:N.createElement(Se,{mode:Ve,locked:!Jt.current},N.createElement(E.default,(0,A.Z)({visible:yn},yt,{forceRender:Ct,removeOnLeave:!1,leavedClassName:"".concat(vt,"-hidden")}),function(kt){var mn=kt.className,en=kt.style;return N.createElement(ct,{id:H,className:mn,style:en},Ge)}))}var k=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],j=["active"],ht=N.forwardRef(function(w,H){var te=w.style,le=w.className,Ge=w.title,Ve=w.eventKey,$e=w.warnKey,vt=w.disabled,Ct=w.internalPopupClose,At=w.children,qt=w.itemIcon,xt=w.expandIcon,Jt=w.popupClassName,$t=w.popupOffset,rn=w.popupStyle,jt=w.onClick,Kt=w.onMouseEnter,yn=w.onMouseLeave,yt=w.onTitleClick,Dt=w.onTitleMouseEnter,kt=w.onTitleMouseLeave,mn=(0,m.Z)(w,k),en=bt(Ve),fn=N.useContext(K),Cn=fn.prefixCls,On=fn.mode,si=fn.openKeys,Fn=fn.disabled,Bn=fn.overflowDisabled,Yn=fn.activeKey,ti=fn.selectedKeys,qn=fn.itemIcon,$n=fn.expandIcon,cn=fn.onItemClick,ot=fn.onOpenChange,nt=fn.onActive,Ft=N.useContext(Ce),Bt=Ft._internalRenderSubMenuItem,gn=N.useContext(dt),Zn=gn.isSubPathKey,jn=Vt(),Mn="".concat(Cn,"-submenu"),ni=Fn||vt,vi=N.useRef(),Ti=N.useRef(),Ii=qt!=null?qt:qn,wn=xt!=null?xt:$n,_i=si.includes(Ve),wi=!Bn&&_i,pi=Zn(ti,Ve),ii=Y(Ve,ni,Dt,kt),vn=ii.active,mi=(0,m.Z)(ii,j),Ci=N.useState(!1),zi=(0,x.Z)(Ci,2),Hn=zi[0],bn=zi[1],Kn=function(Ei){ni||bn(Ei)},ui=function(Ei){Kn(!0),Kt==null||Kt({key:Ve,domEvent:Ei})},Vn=function(Ei){Kn(!1),yn==null||yn({key:Ve,domEvent:Ei})},Di=N.useMemo(function(){return vn||(On!=="inline"?Hn||Zn([Yn],Ve):!1)},[On,vn,Yn,Hn,Ve,Zn]),fi=Ue(jn.length),Oi=function(Ei){ni||(yt==null||yt({key:Ve,domEvent:Ei}),On==="inline"&&ot(Ve,!_i))},Hi=Pe(function(Ri){jt==null||jt(Ke(Ri)),cn(Ri)}),Ui=function(Ei){On!=="inline"&&ot(Ve,Ei)},Qi=function(){nt(Ve)},Gi=en&&"".concat(en,"-popup"),Vi=N.useMemo(function(){return N.createElement(Tt,{icon:On!=="horizontal"?wn:void 0,props:(0,ve.Z)((0,ve.Z)({},w),{},{isOpen:wi,isSubMenu:!0})},N.createElement("i",{className:"".concat(Mn,"-arrow")}))},[On,wn,w,wi,Mn]),Ai=N.createElement("div",(0,A.Z)({role:"menuitem",style:fi,className:"".concat(Mn,"-title"),tabIndex:ni?null:-1,ref:vi,title:typeof Ge=="string"?Ge:null,"data-menu-id":Bn&&en?null:en,"aria-expanded":wi,"aria-haspopup":!0,"aria-controls":Gi,"aria-disabled":ni,onClick:Oi,onFocus:Qi},mi),Ge,Vi),Zi=N.useRef(On);if(On!=="inline"&&jn.length>1?Zi.current="vertical":Zi.current=On,!Bn){var Mi=Zi.current;Ai=N.createElement(g,{mode:Mi,prefixCls:Mn,visible:!Ct&&wi&&On!=="inline",popupClassName:Jt,popupOffset:$t,popupStyle:rn,popup:N.createElement(Se,{mode:Mi==="horizontal"?"vertical":Mi},N.createElement(ct,{id:Gi,ref:Ti},At)),disabled:ni,onVisibleChange:Ui},Ai)}var yi=N.createElement(Ze.Z.Item,(0,A.Z)({ref:H,role:"none"},mn,{component:"li",style:te,className:ae()(Mn,"".concat(Mn,"-").concat(On),le,(0,ye.Z)((0,ye.Z)((0,ye.Z)((0,ye.Z)({},"".concat(Mn,"-open"),wi),"".concat(Mn,"-active"),Di),"".concat(Mn,"-selected"),pi),"".concat(Mn,"-disabled"),ni)),onMouseEnter:ui,onMouseLeave:Vn}),Ai,!Bn&&N.createElement(S,{id:Gi,open:wi,keyPath:jn},At));return Bt&&(yi=Bt(yi,w,{selected:pi,active:Di,open:wi,disabled:ni})),N.createElement(Se,{onItemClick:Hi,mode:On==="horizontal"?"vertical":On,itemIcon:Ii,expandIcon:wn},yi)}),ut=N.forwardRef(function(w,H){var te=w.eventKey,le=w.children,Ge=Vt(te),Ve=nn(le,Ge),$e=fe();N.useEffect(function(){if($e)return $e.registerPath(te,Ge),function(){$e.unregisterPath(te,Ge)}},[Ge]);var vt;return $e?vt=Ve:vt=N.createElement(ht,(0,A.Z)({ref:H},w),Ve),N.createElement(Be.Provider,{value:Ge},vt)}),_t=ut,ln=L(28788);function _(w){var H=w.className,te=w.style,le=N.useContext(K),Ge=le.prefixCls,Ve=fe();return Ve?null:N.createElement("li",{role:"separator",className:ae()("".concat(Ge,"-item-divider"),H),style:te})}var R=["className","title","eventKey","children"],re=N.forwardRef(function(w,H){var te=w.className,le=w.title,Ge=w.eventKey,Ve=w.children,$e=(0,m.Z)(w,R),vt=N.useContext(K),Ct=vt.prefixCls,At="".concat(Ct,"-item-group");return N.createElement("li",(0,A.Z)({ref:H,role:"presentation"},$e,{onClick:function(xt){return xt.stopPropagation()},className:ae()(At,te)}),N.createElement("div",{role:"presentation",className:"".concat(At,"-title"),title:typeof le=="string"?le:void 0},le),N.createElement("ul",{role:"group",className:"".concat(At,"-list")},Ve))}),Q=N.forwardRef(function(w,H){var te=w.eventKey,le=w.children,Ge=Vt(te),Ve=nn(le,Ge),$e=fe();return $e?Ve:N.createElement(re,(0,A.Z)({ref:H},(0,se.Z)(w,["warnKey"])),Ve)}),U=Q,Ee=["label","children","key","type","extra"];function Re(w,H,te){var le=H.item,Ge=H.group,Ve=H.submenu,$e=H.divider;return(w||[]).map(function(vt,Ct){if(vt&&(0,ln.Z)(vt)==="object"){var At=vt,qt=At.label,xt=At.children,Jt=At.key,$t=At.type,rn=At.extra,jt=(0,m.Z)(At,Ee),Kt=Jt!=null?Jt:"tmp-".concat(Ct);return xt||$t==="group"?$t==="group"?N.createElement(Ge,(0,A.Z)({key:Kt},jt,{title:qt}),Re(xt,H,te)):N.createElement(Ve,(0,A.Z)({key:Kt},jt,{title:qt}),Re(xt,H,te)):$t==="divider"?N.createElement($e,(0,A.Z)({key:Kt},jt)):N.createElement(le,(0,A.Z)({key:Kt},jt,{extra:rn}),qt,(!!rn||rn===0)&&N.createElement("span",{className:"".concat(te,"-item-extra")},rn))}return null}).filter(function(vt){return vt})}function be(w,H,te,le,Ge){var Ve=w,$e=(0,ve.Z)({divider:_,item:mt,group:U,submenu:_t},le);return H&&(Ve=Re(H,$e,Ge)),nn(Ve,te)}var We=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],qe=[],Lt=N.forwardRef(function(w,H){var te,le=w,Ge=le.prefixCls,Ve=Ge===void 0?"rc-menu":Ge,$e=le.rootClassName,vt=le.style,Ct=le.className,At=le.tabIndex,qt=At===void 0?0:At,xt=le.items,Jt=le.children,$t=le.direction,rn=le.id,jt=le.mode,Kt=jt===void 0?"vertical":jt,yn=le.inlineCollapsed,yt=le.disabled,Dt=le.disabledOverflow,kt=le.subMenuOpenDelay,mn=kt===void 0?.1:kt,en=le.subMenuCloseDelay,fn=en===void 0?.1:en,Cn=le.forceSubMenuRender,On=le.defaultOpenKeys,si=le.openKeys,Fn=le.activeKey,Bn=le.defaultActiveFirst,Yn=le.selectable,ti=Yn===void 0?!0:Yn,qn=le.multiple,$n=qn===void 0?!1:qn,cn=le.defaultSelectedKeys,ot=le.selectedKeys,nt=le.onSelect,Ft=le.onDeselect,Bt=le.inlineIndent,gn=Bt===void 0?24:Bt,Zn=le.motion,jn=le.defaultMotions,Mn=le.triggerSubMenuAction,ni=Mn===void 0?"hover":Mn,vi=le.builtinPlacements,Ti=le.itemIcon,Ii=le.expandIcon,wn=le.overflowedIndicator,_i=wn===void 0?"...":wn,wi=le.overflowedIndicatorPopupClassName,pi=le.getPopupContainer,ii=le.onClick,vn=le.onOpenChange,mi=le.onKeyDown,Ci=le.openAnimation,zi=le.openTransitionName,Hn=le._internalRenderMenuItem,bn=le._internalRenderSubMenuItem,Kn=le._internalComponents,ui=(0,m.Z)(le,We),Vn=N.useMemo(function(){return[be(Jt,xt,qe,Kn,Ve),be(Jt,xt,qe,{},Ve)]},[Jt,xt,Kn]),Di=(0,x.Z)(Vn,2),fi=Di[0],Oi=Di[1],Hi=N.useState(!1),Ui=(0,x.Z)(Hi,2),Qi=Ui[0],Gi=Ui[1],Vi=N.useRef(),Ai=pt(rn),Zi=$t==="rtl",Mi=(0,V.Z)(On,{value:si,postState:function(Si){return Si||qe}}),yi=(0,x.Z)(Mi,2),Ri=yi[0],Ei=yi[1],Mt=function(Si){var Ni=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function tt(){Ei(Si),vn==null||vn(Si)}Ni?(0,de.flushSync)(tt):tt()},xn=N.useState(Ri),Dn=(0,x.Z)(xn,2),kn=Dn[0],ai=Dn[1],hi=N.useRef(!1),sn=N.useMemo(function(){return(Kt==="inline"||Kt==="vertical")&&yn?["vertical",yn]:[Kt,!1]},[Kt,yn]),In=(0,x.Z)(sn,2),oi=In[0],ri=In[1],gi=oi==="inline",Xi=N.useState(oi),$i=(0,x.Z)(Xi,2),Ki=$i[0],rr=$i[1],sr=N.useState(ri),xr=(0,x.Z)(sr,2),us=xr[0],Gr=xr[1];N.useEffect(function(){rr(oi),Gr(ri),hi.current&&(gi?Ei(kn):Mt(qe))},[oi,ri]);var Sr=N.useState(0),er=(0,x.Z)(Sr,2),Rr=er[0],cs=er[1],_r=Rr>=fi.length-1||Ki!=="horizontal"||Dt;N.useEffect(function(){gi&&ai(Ri)},[Ri]),N.useEffect(function(){return hi.current=!0,function(){hi.current=!1}},[]);var dr=O(),Pr=dr.registerPath,Vr=dr.unregisterPath,Xr=dr.refreshOverflowKeys,Lr=dr.isSubPathKey,qr=dr.getKeyPath,Or=dr.getKeys,ur=dr.getSubPathKeys,Qr=N.useMemo(function(){return{registerPath:Pr,unregisterPath:Vr}},[Pr,Vr]),zr=N.useMemo(function(){return{isSubPathKey:Lr}},[Lr]);N.useEffect(function(){Xr(_r?qe:fi.slice(Rr+1).map(function(Fi){return Fi.key}))},[Rr,_r]);var Jr=(0,V.Z)(Fn||Bn&&((te=fi[0])===null||te===void 0?void 0:te.key),{value:Fn}),Zr=(0,x.Z)(Jr,2),pr=Zr[0],li=Zr[1],ei=Pe(function(Fi){li(Fi)}),Wi=Pe(function(){li(void 0)});(0,N.useImperativeHandle)(H,function(){return{list:Vi.current,focus:function(Si){var Ni,tt=Or(),qi=Ne(tt,Ai),Kr=qi.elements,$r=qi.key2element,zs=qi.element2key,es=J(Vi.current,Kr),ds=pr!=null?pr:es[0]?zs.get(es[0]):(Ni=fi.find(function(hs){return!hs.props.disabled}))===null||Ni===void 0?void 0:Ni.key,Hr=$r.get(ds);if(ds&&Hr){var fs;Hr==null||(fs=Hr.focus)===null||fs===void 0||fs.call(Hr,Si)}}}});var ji=(0,V.Z)(cn||[],{value:ot,postState:function(Si){return Array.isArray(Si)?Si:Si==null?qe:[Si]}}),ki=(0,x.Z)(ji,2),Bi=ki[0],ar=ki[1],tr=function(Si){if(ti){var Ni=Si.key,tt=Bi.includes(Ni),qi;$n?tt?qi=Bi.filter(function($r){return $r!==Ni}):qi=[].concat((0,Z.Z)(Bi),[Ni]):qi=[Ni],ar(qi);var Kr=(0,ve.Z)((0,ve.Z)({},Si),{},{selectedKeys:qi});tt?Ft==null||Ft(Kr):nt==null||nt(Kr)}!$n&&Ri.length&&Ki!=="inline"&&Mt(qe)},fr=Pe(function(Fi){ii==null||ii(Ke(Fi)),tr(Fi)}),hr=Pe(function(Fi,Si){var Ni=Ri.filter(function(qi){return qi!==Fi});if(Si)Ni.push(Fi);else if(Ki!=="inline"){var tt=ur(Fi);Ni=Ni.filter(function(qi){return!tt.has(qi)})}(0,ne.Z)(Ri,Ni,!0)||Mt(Ni,!0)}),nr=function(Si,Ni){var tt=Ni!=null?Ni:!Ri.includes(Si);hr(Si,tt)},Mr=Fe(Ki,pr,Zi,Ai,Vi,Or,qr,li,nr,mi);N.useEffect(function(){Gi(!0)},[]);var Ir=N.useMemo(function(){return{_internalRenderMenuItem:Hn,_internalRenderSubMenuItem:bn}},[Hn,bn]),xs=Ki!=="horizontal"||Dt?fi:fi.map(function(Fi,Si){return N.createElement(Se,{key:Fi.key,overflowDisabled:Si>Rr},Fi)}),Vs=N.createElement(Ze.Z,(0,A.Z)({id:rn,ref:Vi,prefixCls:"".concat(Ve,"-overflow"),component:"ul",itemComponent:mt,className:ae()(Ve,"".concat(Ve,"-root"),"".concat(Ve,"-").concat(Ki),Ct,(0,ye.Z)((0,ye.Z)({},"".concat(Ve,"-inline-collapsed"),us),"".concat(Ve,"-rtl"),Zi),$e),dir:$t,style:vt,role:"menu",tabIndex:qt,data:xs,renderRawItem:function(Si){return Si},renderRawRest:function(Si){var Ni=Si.length,tt=Ni?fi.slice(-Ni):null;return N.createElement(_t,{eventKey:ie,title:_i,disabled:_r,internalPopupClose:Ni===0,popupClassName:wi},tt)},maxCount:Ki!=="horizontal"||Dt?Ze.Z.INVALIDATE:Ze.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Si){cs(Si)},onKeyDown:Mr},ui));return N.createElement(Ce.Provider,{value:Ir},N.createElement(hn.Provider,{value:Ai},N.createElement(Se,{prefixCls:Ve,rootClassName:$e,mode:Ki,openKeys:Ri,rtl:Zi,disabled:yt,motion:Qi?Zn:null,defaultMotions:Qi?jn:null,activeKey:pr,onActive:ei,onInactive:Wi,selectedKeys:Bi,inlineIndent:gn,subMenuOpenDelay:mn,subMenuCloseDelay:fn,forceSubMenuRender:Cn,builtinPlacements:vi,triggerSubMenuAction:ni,getPopupContainer:pi,itemIcon:Ti,expandIcon:Ii,onItemClick:fr,onOpenChange:hr},N.createElement(dt.Provider,{value:zr},Vs),N.createElement("div",{style:{display:"none"},"aria-hidden":!0},N.createElement(Ie.Provider,{value:Qr},Oi)))))}),Qe=Lt,st=Qe;st.Item=mt,st.SubMenu=_t,st.ItemGroup=U,st.Divider=_;var we=st},11780:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return Rt}});var A=L(71409),ye=L(89490),ve=L(11036),Z=L(39224),x=L(59301),m=L(92310),Xe=L.n(m),ae=L(29301),Ze=L(34280),V=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],ne=void 0;function M(C,$){var ke=C.prefixCls,Le=C.invalidate,pe=C.item,_e=C.renderItem,et=C.responsive,Xt=C.responsiveDisabled,Sn=C.registerSize,Rn=C.itemKey,Pn=C.className,Ot=C.style,on=C.children,rt=C.display,Nn=C.order,ge=C.component,X=ge===void 0?"div":ge,J=(0,Z.Z)(C,V),D=et&&!rt;function Ne(q){Sn(Rn,q)}x.useEffect(function(){return function(){Ne(null)}},[]);var Fe=_e&&pe!==ne?_e(pe,{index:Nn}):on,ze;Le||(ze={opacity:D?0:1,height:D?0:ne,overflowY:D?"hidden":ne,order:et?Nn:ne,pointerEvents:D?"none":ne,position:D?"absolute":ne});var Je={};D&&(Je["aria-hidden"]=!0);var z=x.createElement(X,(0,A.Z)({className:Xe()(!Le&&ke,Pn),style:(0,ye.Z)((0,ye.Z)({},ze),Ot)},Je,J,{ref:$}),Fe);return et&&(z=x.createElement(ae.Z,{onResize:function(ie){var O=ie.offsetWidth;Ne(O)},disabled:Xt},z)),z}var N=x.forwardRef(M);N.displayName="Item";var de=N,hn=L(6089),Pt=L(4676),bt=L(16089);function Et(C){if(typeof MessageChannel=="undefined")(0,bt.Z)(C);else{var $=new MessageChannel;$.port1.onmessage=function(){return C()},$.port2.postMessage(void 0)}}function oe(){var C=x.useRef(null),$=function(Le){C.current||(C.current=[],Et(function(){(0,Pt.unstable_batchedUpdates)(function(){C.current.forEach(function(pe){pe()}),C.current=null})})),C.current.push(Le)};return $}function K(C,$){var ke=x.useState($),Le=(0,ve.Z)(ke,2),pe=Le[0],_e=Le[1],et=(0,hn.Z)(function(Xt){C(function(){_e(Xt)})});return[pe,et]}var W=x.createContext(null),Se=["component"],He=["className"],Ie=["className"],fe=function($,ke){var Le=x.useContext(W);if(!Le){var pe=$.component,_e=pe===void 0?"div":pe,et=(0,Z.Z)($,Se);return x.createElement(_e,(0,A.Z)({},et,{ref:ke}))}var Xt=Le.className,Sn=(0,Z.Z)(Le,He),Rn=$.className,Pn=(0,Z.Z)($,Ie);return x.createElement(W.Provider,{value:null},x.createElement(de,(0,A.Z)({ref:ke,className:Xe()(Xt,Rn)},Sn,Pn)))},Be=x.forwardRef(fe);Be.displayName="RawItem";var Vt=Be,dt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Zt="responsive",Ce="invalidate";function F(C){return"+ ".concat(C.length," ...")}function ce(C,$){var ke=C.prefixCls,Le=ke===void 0?"rc-overflow":ke,pe=C.data,_e=pe===void 0?[]:pe,et=C.renderItem,Xt=C.renderRawItem,Sn=C.itemKey,Rn=C.itemWidth,Pn=Rn===void 0?10:Rn,Ot=C.ssr,on=C.style,rt=C.className,Nn=C.maxCount,ge=C.renderRest,X=C.renderRawRest,J=C.suffix,D=C.component,Ne=D===void 0?"div":D,Fe=C.itemComponent,ze=C.onVisibleChange,Je=(0,Z.Z)(C,dt),z=Ot==="full",q=oe(),ie=K(q,null),O=(0,ve.Z)(ie,2),Pe=O[0],Ye=O[1],Oe=Pe||0,pt=K(q,new Map),Qt=(0,ve.Z)(pt,2),It=Qt[0],ft=Qt[1],ee=K(q,0),se=(0,ve.Z)(ee,2),Ae=se[0],Y=se[1],Ue=K(q,0),Tt=(0,ve.Z)(Ue,2),wt=Tt[0],Ke=Tt[1],Nt=K(q,0),tn=(0,ve.Z)(Nt,2),un=tn[0],zt=tn[1],Tn=(0,x.useState)(null),En=(0,ve.Z)(Tn,2),mt=En[0],at=En[1],Yt=(0,x.useState)(null),gt=(0,ve.Z)(Yt,2),ct=gt[0],Ln=gt[1],nn=x.useMemo(function(){return ct===null&&z?Number.MAX_SAFE_INTEGER:ct||0},[ct,Pe]),dn=(0,x.useState)(!1),St=(0,ve.Z)(dn,2),Wt=St[0],zn=St[1],De="".concat(Le,"-item"),c=Math.max(Ae,wt),h=Nn===Zt,g=_e.length&&h,E=Nn===Ce,S=g||typeof Nn=="number"&&_e.length>Nn,k=(0,x.useMemo)(function(){var st=_e;return g?Pe===null&&z?st=_e:st=_e.slice(0,Math.min(_e.length,Oe/Pn)):typeof Nn=="number"&&(st=_e.slice(0,Nn)),st},[_e,Pn,Pe,Nn,g]),j=(0,x.useMemo)(function(){return g?_e.slice(nn+1):_e.slice(k.length)},[_e,k,g,nn]),ht=(0,x.useCallback)(function(st,we){var w;return typeof Sn=="function"?Sn(st):(w=Sn&&(st==null?void 0:st[Sn]))!==null&&w!==void 0?w:we},[Sn]),ut=(0,x.useCallback)(et||function(st){return st},[et]);function _t(st,we,w){ct===st&&(we===void 0||we===mt)||(Ln(st),w||(zn(st<_e.length-1),ze==null||ze(st)),we!==void 0&&at(we))}function ln(st,we){Ye(we.clientWidth)}function _(st,we){ft(function(w){var H=new Map(w);return we===null?H.delete(st):H.set(st,we),H})}function R(st,we){Ke(we),Y(wt)}function re(st,we){zt(we)}function Q(st){return It.get(ht(k[st],st))}(0,Ze.Z)(function(){if(Oe&&typeof c=="number"&&k){var st=un,we=k.length,w=we-1;if(!we){_t(0,null);return}for(var H=0;H<we;H+=1){var te=Q(H);if(z&&(te=te||0),te===void 0){_t(H-1,void 0,!0);break}if(st+=te,w===0&&st<=Oe||H===w-1&&st+Q(w)<=Oe){_t(w,null);break}else if(st+c>Oe){_t(H-1,st-te-un+wt);break}}J&&Q(0)+un>Oe&&at(null)}},[Oe,It,wt,un,ht,k]);var U=Wt&&!!j.length,Ee={};mt!==null&&g&&(Ee={position:"absolute",left:mt,top:0});var Re={prefixCls:De,responsive:g,component:Fe,invalidate:E},be=Xt?function(st,we){var w=ht(st,we);return x.createElement(W.Provider,{key:w,value:(0,ye.Z)((0,ye.Z)({},Re),{},{order:we,item:st,itemKey:w,registerSize:_,display:we<=nn})},Xt(st,we))}:function(st,we){var w=ht(st,we);return x.createElement(de,(0,A.Z)({},Re,{order:we,key:w,item:st,renderItem:ut,itemKey:w,registerSize:_,display:we<=nn}))},We={order:U?nn:Number.MAX_SAFE_INTEGER,className:"".concat(De,"-rest"),registerSize:R,display:U},qe=ge||F,Lt=X?x.createElement(W.Provider,{value:(0,ye.Z)((0,ye.Z)({},Re),We)},X(j)):x.createElement(de,(0,A.Z)({},Re,We),typeof qe=="function"?qe(j):qe),Qe=x.createElement(Ne,(0,A.Z)({className:Xe()(!E&&Le,rt),style:on,ref:$},Je),k.map(be),S?Lt:null,J&&x.createElement(de,(0,A.Z)({},Re,{responsive:h,responsiveDisabled:!g,order:nn,className:"".concat(De,"-suffix"),registerSize:re,display:!0,style:Ee}),J));return h?x.createElement(ae.Z,{onResize:ln,disabled:!g},Qe):Qe}var G=x.forwardRef(ce);G.displayName="Overflow",G.Item=Vt,G.RESPONSIVE=Zt,G.INVALIDATE=Ce;var lt=G,Rt=lt},23425:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return Ie}});var A=L(87075),ye=L(71409),ve=L(28788),Z=L(89490),x=L(11036),m=L(92310),Xe=L.n(m),ae=L(18929),Ze=L(10228),V=L(26112),ne=L(48736),M=L(59301),N=L(17119),de=[10,20,50,100],hn=function(Be){var Vt=Be.pageSizeOptions,dt=Vt===void 0?de:Vt,Zt=Be.locale,Ce=Be.changeSize,F=Be.pageSize,ce=Be.goButton,G=Be.quickGo,lt=Be.rootPrefixCls,Rt=Be.disabled,C=Be.buildOptionText,$=Be.showSizeChanger,ke=Be.sizeChangerRender,Le=M.useState(""),pe=(0,x.Z)(Le,2),_e=pe[0],et=pe[1],Xt=function(){return!_e||Number.isNaN(_e)?void 0:Number(_e)},Sn=typeof C=="function"?C:function(J){return"".concat(J," ").concat(Zt.items_per_page)},Rn=function(D){et(D.target.value)},Pn=function(D){ce||_e===""||(et(""),!(D.relatedTarget&&(D.relatedTarget.className.indexOf("".concat(lt,"-item-link"))>=0||D.relatedTarget.className.indexOf("".concat(lt,"-item"))>=0))&&(G==null||G(Xt())))},Ot=function(D){_e!==""&&(D.keyCode===Ze.Z.ENTER||D.type==="click")&&(et(""),G==null||G(Xt()))},on=function(){return dt.some(function(D){return D.toString()===F.toString()})?dt:dt.concat([F]).sort(function(D,Ne){var Fe=Number.isNaN(Number(D))?0:Number(D),ze=Number.isNaN(Number(Ne))?0:Number(Ne);return Fe-ze})},rt="".concat(lt,"-options");if(!$&&!G)return null;var Nn=null,ge=null,X=null;return $&&ke&&(Nn=ke({disabled:Rt,size:F,onSizeChange:function(D){Ce==null||Ce(Number(D))},"aria-label":Zt.page_size,className:"".concat(rt,"-size-changer"),options:on().map(function(J){return{label:Sn(J),value:J}})})),G&&(ce&&(X=typeof ce=="boolean"?M.createElement("button",{type:"button",onClick:Ot,onKeyUp:Ot,disabled:Rt,className:"".concat(rt,"-quick-jumper-button")},Zt.jump_to_confirm):M.createElement("span",{onClick:Ot,onKeyUp:Ot},ce)),ge=M.createElement("div",{className:"".concat(rt,"-quick-jumper")},Zt.jump_to,M.createElement("input",{disabled:Rt,type:"text",value:_e,onChange:Rn,onKeyUp:Ot,onBlur:Pn,"aria-label":Zt.page}),Zt.page,X)),M.createElement("li",{className:rt},Nn,ge)},Pt=hn,bt=function(Be){var Vt=Be.rootPrefixCls,dt=Be.page,Zt=Be.active,Ce=Be.className,F=Be.showTitle,ce=Be.onClick,G=Be.onKeyPress,lt=Be.itemRender,Rt="".concat(Vt,"-item"),C=Xe()(Rt,"".concat(Rt,"-").concat(dt),(0,A.Z)((0,A.Z)({},"".concat(Rt,"-active"),Zt),"".concat(Rt,"-disabled"),!dt),Ce),$=function(){ce(dt)},ke=function(_e){G(_e,ce,dt)},Le=lt(dt,"page",M.createElement("a",{rel:"nofollow"},dt));return Le?M.createElement("li",{title:F?String(dt):null,className:C,onClick:$,onKeyDown:ke,tabIndex:0},Le):null},Et=bt,oe=function(Be,Vt,dt){return dt};function K(){}function W(fe){var Be=Number(fe);return typeof Be=="number"&&!Number.isNaN(Be)&&isFinite(Be)&&Math.floor(Be)===Be}function Se(fe,Be,Vt){var dt=typeof fe=="undefined"?Be:fe;return Math.floor((Vt-1)/dt)+1}var He=function(Be){var Vt=Be.prefixCls,dt=Vt===void 0?"rc-pagination":Vt,Zt=Be.selectPrefixCls,Ce=Zt===void 0?"rc-select":Zt,F=Be.className,ce=Be.current,G=Be.defaultCurrent,lt=G===void 0?1:G,Rt=Be.total,C=Rt===void 0?0:Rt,$=Be.pageSize,ke=Be.defaultPageSize,Le=ke===void 0?10:ke,pe=Be.onChange,_e=pe===void 0?K:pe,et=Be.hideOnSinglePage,Xt=Be.align,Sn=Be.showPrevNextJumpers,Rn=Sn===void 0?!0:Sn,Pn=Be.showQuickJumper,Ot=Be.showLessItems,on=Be.showTitle,rt=on===void 0?!0:on,Nn=Be.onShowSizeChange,ge=Nn===void 0?K:Nn,X=Be.locale,J=X===void 0?N.Z:X,D=Be.style,Ne=Be.totalBoundaryShowSizeChanger,Fe=Ne===void 0?50:Ne,ze=Be.disabled,Je=Be.simple,z=Be.showTotal,q=Be.showSizeChanger,ie=q===void 0?C>Fe:q,O=Be.sizeChangerRender,Pe=Be.pageSizeOptions,Ye=Be.itemRender,Oe=Ye===void 0?oe:Ye,pt=Be.jumpPrevIcon,Qt=Be.jumpNextIcon,It=Be.prevIcon,ft=Be.nextIcon,ee=M.useRef(null),se=(0,ae.Z)(10,{value:$,defaultValue:Le}),Ae=(0,x.Z)(se,2),Y=Ae[0],Ue=Ae[1],Tt=(0,ae.Z)(1,{value:ce,defaultValue:lt,postState:function(Dt){return Math.max(1,Math.min(Dt,Se(void 0,Y,C)))}}),wt=(0,x.Z)(Tt,2),Ke=wt[0],Nt=wt[1],tn=M.useState(Ke),un=(0,x.Z)(tn,2),zt=un[0],Tn=un[1];(0,M.useEffect)(function(){Tn(Ke)},[Ke]);var En=_e!==K,mt="current"in Be,at=Math.max(1,Ke-(Ot?3:5)),Yt=Math.min(Se(void 0,Y,C),Ke+(Ot?3:5));function gt(yt,Dt){var kt=yt||M.createElement("button",{type:"button","aria-label":Dt,className:"".concat(dt,"-item-link")});return typeof yt=="function"&&(kt=M.createElement(yt,(0,Z.Z)({},Be))),kt}function ct(yt){var Dt=yt.target.value,kt=Se(void 0,Y,C),mn;return Dt===""?mn=Dt:Number.isNaN(Number(Dt))?mn=zt:Dt>=kt?mn=kt:mn=Number(Dt),mn}function Ln(yt){return W(yt)&&yt!==Ke&&W(C)&&C>0}var nn=C>Y?Pn:!1;function dn(yt){(yt.keyCode===Ze.Z.UP||yt.keyCode===Ze.Z.DOWN)&&yt.preventDefault()}function St(yt){var Dt=ct(yt);switch(Dt!==zt&&Tn(Dt),yt.keyCode){case Ze.Z.ENTER:De(Dt);break;case Ze.Z.UP:De(Dt-1);break;case Ze.Z.DOWN:De(Dt+1);break;default:break}}function Wt(yt){De(ct(yt))}function zn(yt){var Dt=Se(yt,Y,C),kt=Ke>Dt&&Dt!==0?Dt:Ke;Ue(yt),Tn(kt),ge==null||ge(Ke,yt),Nt(kt),_e==null||_e(kt,yt)}function De(yt){if(Ln(yt)&&!ze){var Dt=Se(void 0,Y,C),kt=yt;return yt>Dt?kt=Dt:yt<1&&(kt=1),kt!==zt&&Tn(kt),Nt(kt),_e==null||_e(kt,Y),kt}return Ke}var c=Ke>1,h=Ke<Se(void 0,Y,C);function g(){c&&De(Ke-1)}function E(){h&&De(Ke+1)}function S(){De(at)}function k(){De(Yt)}function j(yt,Dt){if(yt.key==="Enter"||yt.charCode===Ze.Z.ENTER||yt.keyCode===Ze.Z.ENTER){for(var kt=arguments.length,mn=new Array(kt>2?kt-2:0),en=2;en<kt;en++)mn[en-2]=arguments[en];Dt.apply(void 0,mn)}}function ht(yt){j(yt,g)}function ut(yt){j(yt,E)}function _t(yt){j(yt,S)}function ln(yt){j(yt,k)}function _(yt){var Dt=Oe(yt,"prev",gt(It,"prev page"));return M.isValidElement(Dt)?M.cloneElement(Dt,{disabled:!c}):Dt}function R(yt){var Dt=Oe(yt,"next",gt(ft,"next page"));return M.isValidElement(Dt)?M.cloneElement(Dt,{disabled:!h}):Dt}function re(yt){(yt.type==="click"||yt.keyCode===Ze.Z.ENTER)&&De(zt)}var Q=null,U=(0,V.Z)(Be,{aria:!0,data:!0}),Ee=z&&M.createElement("li",{className:"".concat(dt,"-total-text")},z(C,[C===0?0:(Ke-1)*Y+1,Ke*Y>C?C:Ke*Y])),Re=null,be=Se(void 0,Y,C);if(et&&C<=Y)return null;var We=[],qe={rootPrefixCls:dt,onClick:De,onKeyPress:j,showTitle:rt,itemRender:Oe,page:-1},Lt=Ke-1>0?Ke-1:0,Qe=Ke+1<be?Ke+1:be,st=Pn&&Pn.goButton,we=(0,ve.Z)(Je)==="object"?Je.readOnly:!Je,w=st,H=null;Je&&(st&&(typeof st=="boolean"?w=M.createElement("button",{type:"button",onClick:re,onKeyUp:re},J.jump_to_confirm):w=M.createElement("span",{onClick:re,onKeyUp:re},st),w=M.createElement("li",{title:rt?"".concat(J.jump_to).concat(Ke,"/").concat(be):null,className:"".concat(dt,"-simple-pager")},w)),H=M.createElement("li",{title:rt?"".concat(Ke,"/").concat(be):null,className:"".concat(dt,"-simple-pager")},we?zt:M.createElement("input",{type:"text","aria-label":J.jump_to,value:zt,disabled:ze,onKeyDown:dn,onKeyUp:St,onChange:St,onBlur:Wt,size:3}),M.createElement("span",{className:"".concat(dt,"-slash")},"/"),be));var te=Ot?1:2;if(be<=3+te*2){be||We.push(M.createElement(Et,(0,ye.Z)({},qe,{key:"noPager",page:1,className:"".concat(dt,"-item-disabled")})));for(var le=1;le<=be;le+=1)We.push(M.createElement(Et,(0,ye.Z)({},qe,{key:le,page:le,active:Ke===le})))}else{var Ge=Ot?J.prev_3:J.prev_5,Ve=Ot?J.next_3:J.next_5,$e=Oe(at,"jump-prev",gt(pt,"prev page")),vt=Oe(Yt,"jump-next",gt(Qt,"next page"));Rn&&(Q=$e?M.createElement("li",{title:rt?Ge:null,key:"prev",onClick:S,tabIndex:0,onKeyDown:_t,className:Xe()("".concat(dt,"-jump-prev"),(0,A.Z)({},"".concat(dt,"-jump-prev-custom-icon"),!!pt))},$e):null,Re=vt?M.createElement("li",{title:rt?Ve:null,key:"next",onClick:k,tabIndex:0,onKeyDown:ln,className:Xe()("".concat(dt,"-jump-next"),(0,A.Z)({},"".concat(dt,"-jump-next-custom-icon"),!!Qt))},vt):null);var Ct=Math.max(1,Ke-te),At=Math.min(Ke+te,be);Ke-1<=te&&(At=1+te*2),be-Ke<=te&&(Ct=be-te*2);for(var qt=Ct;qt<=At;qt+=1)We.push(M.createElement(Et,(0,ye.Z)({},qe,{key:qt,page:qt,active:Ke===qt})));if(Ke-1>=te*2&&Ke!==3&&(We[0]=M.cloneElement(We[0],{className:Xe()("".concat(dt,"-item-after-jump-prev"),We[0].props.className)}),We.unshift(Q)),be-Ke>=te*2&&Ke!==be-2){var xt=We[We.length-1];We[We.length-1]=M.cloneElement(xt,{className:Xe()("".concat(dt,"-item-before-jump-next"),xt.props.className)}),We.push(Re)}Ct!==1&&We.unshift(M.createElement(Et,(0,ye.Z)({},qe,{key:1,page:1}))),At!==be&&We.push(M.createElement(Et,(0,ye.Z)({},qe,{key:be,page:be})))}var Jt=_(Lt);if(Jt){var $t=!c||!be;Jt=M.createElement("li",{title:rt?J.prev_page:null,onClick:g,tabIndex:$t?null:0,onKeyDown:ht,className:Xe()("".concat(dt,"-prev"),(0,A.Z)({},"".concat(dt,"-disabled"),$t)),"aria-disabled":$t},Jt)}var rn=R(Qe);if(rn){var jt,Kt;Je?(jt=!h,Kt=c?0:null):(jt=!h||!be,Kt=jt?null:0),rn=M.createElement("li",{title:rt?J.next_page:null,onClick:E,tabIndex:Kt,onKeyDown:ut,className:Xe()("".concat(dt,"-next"),(0,A.Z)({},"".concat(dt,"-disabled"),jt)),"aria-disabled":jt},rn)}var yn=Xe()(dt,F,(0,A.Z)((0,A.Z)((0,A.Z)((0,A.Z)((0,A.Z)({},"".concat(dt,"-start"),Xt==="start"),"".concat(dt,"-center"),Xt==="center"),"".concat(dt,"-end"),Xt==="end"),"".concat(dt,"-simple"),Je),"".concat(dt,"-disabled"),ze));return M.createElement("ul",(0,ye.Z)({className:yn,style:D,ref:ee},U),Ee,Jt,Je?H:We,rn,M.createElement(Pt,{locale:J,rootPrefixCls:dt,disabled:ze,selectPrefixCls:Ce,changeSize:zn,pageSize:Y,pageSizeOptions:Pe,quickGo:nn?De:null,goButton:w,showSizeChanger:ie,sizeChangerRender:O}))},Ie=He},738:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return K}});var A=L(71409),ye=L(87075),ve=L(11036),Z=L(39224),x=L(92310),m=L.n(x),Xe=L(18929),ae=L(10228),Ze=L(26112),V=L(59301);function ne(W,Se){var He=W.disabled,Ie=W.prefixCls,fe=W.character,Be=W.characterRender,Vt=W.index,dt=W.count,Zt=W.value,Ce=W.allowHalf,F=W.focused,ce=W.onHover,G=W.onClick,lt=function(et){ce(et,Vt)},Rt=function(et){G(et,Vt)},C=function(et){et.keyCode===ae.Z.ENTER&&G(et,Vt)},$=Vt+1,ke=new Set([Ie]);Zt===0&&Vt===0&&F?ke.add("".concat(Ie,"-focused")):Ce&&Zt+.5>=$&&Zt<$?(ke.add("".concat(Ie,"-half")),ke.add("".concat(Ie,"-active")),F&&ke.add("".concat(Ie,"-focused"))):($<=Zt?ke.add("".concat(Ie,"-full")):ke.add("".concat(Ie,"-zero")),$===Zt&&F&&ke.add("".concat(Ie,"-focused")));var Le=typeof fe=="function"?fe(W):fe,pe=V.createElement("li",{className:m()(Array.from(ke)),ref:Se},V.createElement("div",{onClick:He?null:Rt,onKeyDown:He?null:C,onMouseMove:He?null:lt,role:"radio","aria-checked":Zt>Vt?"true":"false","aria-posinset":Vt+1,"aria-setsize":dt,tabIndex:He?-1:0},V.createElement("div",{className:"".concat(Ie,"-first")},Le),V.createElement("div",{className:"".concat(Ie,"-second")},Le)));return Be&&(pe=Be(pe,W)),pe}var M=V.forwardRef(ne);function N(){var W=V.useRef({});function Se(Ie){return W.current[Ie]}function He(Ie){return function(fe){W.current[Ie]=fe}}return[Se,He]}function de(W){var Se=W.pageXOffset,He="scrollLeft";if(typeof Se!="number"){var Ie=W.document;Se=Ie.documentElement[He],typeof Se!="number"&&(Se=Ie.body[He])}return Se}function hn(W){var Se,He,Ie=W.ownerDocument,fe=Ie.body,Be=Ie&&Ie.documentElement,Vt=W.getBoundingClientRect();return Se=Vt.left,He=Vt.top,Se-=Be.clientLeft||fe.clientLeft||0,He-=Be.clientTop||fe.clientTop||0,{left:Se,top:He}}function Pt(W){var Se=hn(W),He=W.ownerDocument,Ie=He.defaultView||He.parentWindow;return Se.left+=de(Ie),Se.left}var bt=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function Et(W,Se){var He=W.prefixCls,Ie=He===void 0?"rc-rate":He,fe=W.className,Be=W.defaultValue,Vt=W.value,dt=W.count,Zt=dt===void 0?5:dt,Ce=W.allowHalf,F=Ce===void 0?!1:Ce,ce=W.allowClear,G=ce===void 0?!0:ce,lt=W.keyboard,Rt=lt===void 0?!0:lt,C=W.character,$=C===void 0?"\u2605":C,ke=W.characterRender,Le=W.disabled,pe=W.direction,_e=pe===void 0?"ltr":pe,et=W.tabIndex,Xt=et===void 0?0:et,Sn=W.autoFocus,Rn=W.onHoverChange,Pn=W.onChange,Ot=W.onFocus,on=W.onBlur,rt=W.onKeyDown,Nn=W.onMouseLeave,ge=(0,Z.Z)(W,bt),X=N(),J=(0,ve.Z)(X,2),D=J[0],Ne=J[1],Fe=V.useRef(null),ze=function(){if(!Le){var at;(at=Fe.current)===null||at===void 0||at.focus()}};V.useImperativeHandle(Se,function(){return{focus:ze,blur:function(){if(!Le){var at;(at=Fe.current)===null||at===void 0||at.blur()}}}});var Je=(0,Xe.Z)(Be||0,{value:Vt}),z=(0,ve.Z)(Je,2),q=z[0],ie=z[1],O=(0,Xe.Z)(null),Pe=(0,ve.Z)(O,2),Ye=Pe[0],Oe=Pe[1],pt=function(at,Yt){var gt=_e==="rtl",ct=at+1;if(F){var Ln=D(at),nn=Pt(Ln),dn=Ln.clientWidth;(gt&&Yt-nn>dn/2||!gt&&Yt-nn<dn/2)&&(ct-=.5)}return ct},Qt=function(at){ie(at),Pn==null||Pn(at)},It=V.useState(!1),ft=(0,ve.Z)(It,2),ee=ft[0],se=ft[1],Ae=function(){se(!0),Ot==null||Ot()},Y=function(){se(!1),on==null||on()},Ue=V.useState(null),Tt=(0,ve.Z)(Ue,2),wt=Tt[0],Ke=Tt[1],Nt=function(at,Yt){var gt=pt(Yt,at.pageX);gt!==Ye&&(Ke(gt),Oe(null)),Rn==null||Rn(gt)},tn=function(at){Le||(Ke(null),Oe(null),Rn==null||Rn(void 0)),at&&(Nn==null||Nn(at))},un=function(at,Yt){var gt=pt(Yt,at.pageX),ct=!1;G&&(ct=gt===q),tn(),Qt(ct?0:gt),Oe(ct?gt:null)},zt=function(at){var Yt=at.keyCode,gt=_e==="rtl",ct=F?.5:1;Rt&&(Yt===ae.Z.RIGHT&&q<Zt&&!gt?(Qt(q+ct),at.preventDefault()):Yt===ae.Z.LEFT&&q>0&&!gt||Yt===ae.Z.RIGHT&&q>0&>?(Qt(q-ct),at.preventDefault()):Yt===ae.Z.LEFT&&q<Zt&>&&(Qt(q+ct),at.preventDefault())),rt==null||rt(at)};V.useEffect(function(){Sn&&!Le&&ze()},[]);var Tn=new Array(Zt).fill(0).map(function(mt,at){return V.createElement(M,{ref:Ne(at),index:at,count:Zt,disabled:Le,prefixCls:"".concat(Ie,"-star"),allowHalf:F,value:wt===null?q:wt,onClick:un,onHover:Nt,key:mt||at,character:$,characterRender:ke,focused:ee})}),En=m()(Ie,fe,(0,ye.Z)((0,ye.Z)({},"".concat(Ie,"-disabled"),Le),"".concat(Ie,"-rtl"),_e==="rtl"));return V.createElement("ul",(0,A.Z)({className:En,onMouseLeave:tn,tabIndex:Le?-1:Xt,onFocus:Le?null:Ae,onBlur:Le?null:Y,onKeyDown:Le?null:zt,ref:Fe},(0,Ze.Z)(ge,{aria:!0,data:!0,attr:!0})),Tn)}var oe=V.forwardRef(Et),K=oe},29301:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return Ce}});var A=L(71409),ye=L(59301),ve=L(11592),Z=L(48736),x=L(89490),m=L(28788),Xe=L(76846),ae=L(8654),Ze=ye.createContext(null);function V(F){var ce=F.children,G=F.onBatchResize,lt=ye.useRef(0),Rt=ye.useRef([]),C=ye.useContext(Ze),$=ye.useCallback(function(ke,Le,pe){lt.current+=1;var _e=lt.current;Rt.current.push({size:ke,element:Le,data:pe}),Promise.resolve().then(function(){_e===lt.current&&(G==null||G(Rt.current),Rt.current=[])}),C==null||C(ke,Le,pe)},[G,C]);return ye.createElement(Ze.Provider,{value:$},ce)}var ne=L(76374),M=new Map;function N(F){F.forEach(function(ce){var G,lt=ce.target;(G=M.get(lt))===null||G===void 0||G.forEach(function(Rt){return Rt(lt)})})}var de=new ne.Z(N),hn=null,Pt=null;function bt(F,ce){M.has(F)||(M.set(F,new Set),de.observe(F)),M.get(F).add(ce)}function Et(F,ce){M.has(F)&&(M.get(F).delete(ce),M.get(F).size||(de.unobserve(F),M.delete(F)))}var oe=L(16552),K=L(19210),W=L(46654),Se=L(37205),He=function(F){(0,W.Z)(G,F);var ce=(0,Se.Z)(G);function G(){return(0,oe.Z)(this,G),ce.apply(this,arguments)}return(0,K.Z)(G,[{key:"render",value:function(){return this.props.children}}]),G}(ye.Component);function Ie(F,ce){var G=F.children,lt=F.disabled,Rt=ye.useRef(null),C=ye.useRef(null),$=ye.useContext(Ze),ke=typeof G=="function",Le=ke?G(Rt):G,pe=ye.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),_e=!ke&&ye.isValidElement(Le)&&(0,ae.Yr)(Le),et=_e?(0,ae.C4)(Le):null,Xt=(0,ae.x1)(et,Rt),Sn=function(){var on;return(0,Xe.ZP)(Rt.current)||(Rt.current&&(0,m.Z)(Rt.current)==="object"?(0,Xe.ZP)((on=Rt.current)===null||on===void 0?void 0:on.nativeElement):null)||(0,Xe.ZP)(C.current)};ye.useImperativeHandle(ce,function(){return Sn()});var Rn=ye.useRef(F);Rn.current=F;var Pn=ye.useCallback(function(Ot){var on=Rn.current,rt=on.onResize,Nn=on.data,ge=Ot.getBoundingClientRect(),X=ge.width,J=ge.height,D=Ot.offsetWidth,Ne=Ot.offsetHeight,Fe=Math.floor(X),ze=Math.floor(J);if(pe.current.width!==Fe||pe.current.height!==ze||pe.current.offsetWidth!==D||pe.current.offsetHeight!==Ne){var Je={width:Fe,height:ze,offsetWidth:D,offsetHeight:Ne};pe.current=Je;var z=D===Math.round(X)?X:D,q=Ne===Math.round(J)?J:Ne,ie=(0,x.Z)((0,x.Z)({},Je),{},{offsetWidth:z,offsetHeight:q});$==null||$(ie,Ot,Nn),rt&&Promise.resolve().then(function(){rt(ie,Ot)})}},[]);return ye.useEffect(function(){var Ot=Sn();return Ot&&!lt&&bt(Ot,Pn),function(){return Et(Ot,Pn)}},[Rt.current,lt]),ye.createElement(He,{ref:C},_e?ye.cloneElement(Le,{ref:Xt}):Le)}var fe=ye.forwardRef(Ie),Be=fe,Vt="rc-observer-key";function dt(F,ce){var G=F.children,lt=typeof G=="function"?[G]:(0,ve.Z)(G);return lt.map(function(Rt,C){var $=(Rt==null?void 0:Rt.key)||"".concat(Vt,"-").concat(C);return ye.createElement(Be,(0,A.Z)({},F,{key:$,ref:C===0?ce:void 0}),Rt)})}var Zt=ye.forwardRef(dt);Zt.Collection=V;var Ce=Zt},6551:function(Qn,pn,L){"use strict";L.d(pn,{ZP:function(){return Xe}});var A=L(11036),ye=L(59301),ve=L(47273),Z=0,x=(0,ve.Z)();function m(){var ae;return x?(ae=Z,Z+=1):ae="TEST_OR_SSR",ae}function Xe(ae){var Ze=ye.useState(),V=(0,A.Z)(Ze,2),ne=V[0],M=V[1];return ye.useEffect(function(){M("rc_select_".concat(m()))},[]),ae||ne}},37463:function(Qn,pn,L){"use strict";L.d(pn,{Ac:function(){return se},Xo:function(){return Y},Wx:function(){return Tt},ZP:function(){return ln},lk:function(){return K}});var A=L(71409),ye=L(62730),ve=L(87075),Z=L(89490),x=L(11036),m=L(39224),Xe=L(28788),ae=L(18929),Ze=L(48736),V=L(59301),ne=L(92310),M=L.n(ne),N=L(34280),de=L(49658),hn=L(8654),Pt=function(R){var re=R.className,Q=R.customizeIcon,U=R.customizeIconProps,Ee=R.children,Re=R.onMouseDown,be=R.onClick,We=typeof Q=="function"?Q(U):Q;return V.createElement("span",{className:re,onMouseDown:function(Lt){Lt.preventDefault(),Re==null||Re(Lt)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:be,"aria-hidden":!0},We!==void 0?We:V.createElement("span",{className:M()(re.split(/\s+/).map(function(qe){return"".concat(qe,"-icon")}))},Ee))},bt=Pt,Et=function(R,re,Q,U,Ee){var Re=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,be=arguments.length>6?arguments[6]:void 0,We=arguments.length>7?arguments[7]:void 0,qe=V.useMemo(function(){if((0,Xe.Z)(U)==="object")return U.clearIcon;if(Ee)return Ee},[U,Ee]),Lt=V.useMemo(function(){return!!(!Re&&U&&(Q.length||be)&&!(We==="combobox"&&be===""))},[U,Re,Q.length,be,We]);return{allowClear:Lt,clearIcon:V.createElement(bt,{className:"".concat(R,"-clear"),onMouseDown:re,customizeIcon:qe},"\xD7")}},oe=V.createContext(null);function K(){return V.useContext(oe)}function W(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,R=V.useState(!1),re=(0,x.Z)(R,2),Q=re[0],U=re[1],Ee=V.useRef(null),Re=function(){window.clearTimeout(Ee.current)};V.useEffect(function(){return Re},[]);var be=function(qe,Lt){Re(),Ee.current=window.setTimeout(function(){U(qe),Lt&&Lt()},_)};return[Q,be,Re]}function Se(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,R=V.useRef(null),re=V.useRef(null);V.useEffect(function(){return function(){window.clearTimeout(re.current)}},[]);function Q(U){(U||R.current===null)&&(R.current=U),window.clearTimeout(re.current),re.current=window.setTimeout(function(){R.current=null},_)}return[function(){return R.current},Q]}function He(_,R,re,Q){var U=V.useRef(null);U.current={open:R,triggerOpen:re,customizedTrigger:Q},V.useEffect(function(){function Ee(Re){var be;if(!((be=U.current)!==null&&be!==void 0&&be.customizedTrigger)){var We=Re.target;We.shadowRoot&&Re.composed&&(We=Re.composedPath()[0]||We),U.current.open&&_().filter(function(qe){return qe}).every(function(qe){return!qe.contains(We)&&qe!==We})&&U.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Ee),function(){return window.removeEventListener("mousedown",Ee)}},[])}var Ie=L(10228);function fe(_){return _&&![Ie.Z.ESC,Ie.Z.SHIFT,Ie.Z.BACKSPACE,Ie.Z.TAB,Ie.Z.WIN_KEY,Ie.Z.ALT,Ie.Z.META,Ie.Z.WIN_KEY_RIGHT,Ie.Z.CTRL,Ie.Z.SEMICOLON,Ie.Z.EQUALS,Ie.Z.CAPS_LOCK,Ie.Z.CONTEXT_MENU,Ie.Z.F1,Ie.Z.F2,Ie.Z.F3,Ie.Z.F4,Ie.Z.F5,Ie.Z.F6,Ie.Z.F7,Ie.Z.F8,Ie.Z.F9,Ie.Z.F10,Ie.Z.F11,Ie.Z.F12].includes(_)}var Be=L(26112),Vt=L(11780);function dt(_,R,re){var Q=(0,Z.Z)((0,Z.Z)({},_),re?R:{});return Object.keys(R).forEach(function(U){var Ee=R[U];typeof Ee=="function"&&(Q[U]=function(){for(var Re,be=arguments.length,We=new Array(be),qe=0;qe<be;qe++)We[qe]=arguments[qe];return Ee.apply(void 0,We),(Re=_[U])===null||Re===void 0?void 0:Re.call.apply(Re,[_].concat(We))})}),Q}var Zt=dt,Ce=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],F=function(R,re){var Q=R.prefixCls,U=R.id,Ee=R.inputElement,Re=R.autoFocus,be=R.autoComplete,We=R.editable,qe=R.activeDescendantId,Lt=R.value,Qe=R.open,st=R.attrs,we=(0,m.Z)(R,Ce),w=Ee||V.createElement("input",null),H=w,te=H.ref,le=H.props;return(0,Ze.Kp)(!("maxLength"in w.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),w=V.cloneElement(w,(0,Z.Z)((0,Z.Z)((0,Z.Z)({type:"search"},Zt(we,le,!0)),{},{id:U,ref:(0,hn.sQ)(re,te),autoComplete:be||"off",autoFocus:Re,className:M()("".concat(Q,"-selection-search-input"),le==null?void 0:le.className),role:"combobox","aria-expanded":Qe||!1,"aria-haspopup":"listbox","aria-owns":"".concat(U,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(U,"_list"),"aria-activedescendant":Qe?qe:void 0},st),{},{value:We?Lt:"",readOnly:!We,unselectable:We?null:"on",style:(0,Z.Z)((0,Z.Z)({},le.style),{},{opacity:We?null:0})})),w},ce=V.forwardRef(F),G=ce;function lt(_){return Array.isArray(_)?_:_!==void 0?[_]:[]}var Rt=typeof window!="undefined"&&window.document&&window.document.documentElement,C=Rt;function $(_){return _!=null}function ke(_){return!_&&_!==0}function Le(_){return["string","number"].includes((0,Xe.Z)(_))}function pe(_){var R=void 0;return _&&(Le(_.title)?R=_.title.toString():Le(_.label)&&(R=_.label.toString())),R}function _e(_,R){C?V.useLayoutEffect(_,R):V.useEffect(_,R)}function et(_){var R;return(R=_.key)!==null&&R!==void 0?R:_.value}var Xt=function(R){R.preventDefault(),R.stopPropagation()},Sn=function(R){var re=R.id,Q=R.prefixCls,U=R.values,Ee=R.open,Re=R.searchValue,be=R.autoClearSearchValue,We=R.inputRef,qe=R.placeholder,Lt=R.disabled,Qe=R.mode,st=R.showSearch,we=R.autoFocus,w=R.autoComplete,H=R.activeDescendantId,te=R.tabIndex,le=R.removeIcon,Ge=R.maxTagCount,Ve=R.maxTagTextLength,$e=R.maxTagPlaceholder,vt=$e===void 0?function(Ft){return"+ ".concat(Ft.length," ...")}:$e,Ct=R.tagRender,At=R.onToggleOpen,qt=R.onRemove,xt=R.onInputChange,Jt=R.onInputPaste,$t=R.onInputKeyDown,rn=R.onInputMouseDown,jt=R.onInputCompositionStart,Kt=R.onInputCompositionEnd,yn=R.onInputBlur,yt=V.useRef(null),Dt=(0,V.useState)(0),kt=(0,x.Z)(Dt,2),mn=kt[0],en=kt[1],fn=(0,V.useState)(!1),Cn=(0,x.Z)(fn,2),On=Cn[0],si=Cn[1],Fn="".concat(Q,"-selection"),Bn=Ee||Qe==="multiple"&&be===!1||Qe==="tags"?Re:"",Yn=Qe==="tags"||Qe==="multiple"&&be===!1||st&&(Ee||On);_e(function(){en(yt.current.scrollWidth)},[Bn]);var ti=function(Bt,gn,Zn,jn,Mn){return V.createElement("span",{title:pe(Bt),className:M()("".concat(Fn,"-item"),(0,ve.Z)({},"".concat(Fn,"-item-disabled"),Zn))},V.createElement("span",{className:"".concat(Fn,"-item-content")},gn),jn&&V.createElement(bt,{className:"".concat(Fn,"-item-remove"),onMouseDown:Xt,onClick:Mn,customizeIcon:le},"\xD7"))},qn=function(Bt,gn,Zn,jn,Mn,ni){var vi=function(Ii){Xt(Ii),At(!Ee)};return V.createElement("span",{onMouseDown:vi},Ct({label:gn,value:Bt,disabled:Zn,closable:jn,onClose:Mn,isMaxTag:!!ni}))},$n=function(Bt){var gn=Bt.disabled,Zn=Bt.label,jn=Bt.value,Mn=!Lt&&!gn,ni=Zn;if(typeof Ve=="number"&&(typeof Zn=="string"||typeof Zn=="number")){var vi=String(ni);vi.length>Ve&&(ni="".concat(vi.slice(0,Ve),"..."))}var Ti=function(wn){wn&&wn.stopPropagation(),qt(Bt)};return typeof Ct=="function"?qn(jn,ni,gn,Mn,Ti):ti(Bt,ni,gn,Mn,Ti)},cn=function(Bt){if(!U.length)return null;var gn=typeof vt=="function"?vt(Bt):vt;return typeof Ct=="function"?qn(void 0,gn,!1,!1,void 0,!0):ti({title:gn},gn,!1)},ot=V.createElement("div",{className:"".concat(Fn,"-search"),style:{width:mn},onFocus:function(){si(!0)},onBlur:function(){si(!1)}},V.createElement(G,{ref:We,open:Ee,prefixCls:Q,id:re,inputElement:null,disabled:Lt,autoFocus:we,autoComplete:w,editable:Yn,activeDescendantId:H,value:Bn,onKeyDown:$t,onMouseDown:rn,onChange:xt,onPaste:Jt,onCompositionStart:jt,onCompositionEnd:Kt,onBlur:yn,tabIndex:te,attrs:(0,Be.Z)(R,!0)}),V.createElement("span",{ref:yt,className:"".concat(Fn,"-search-mirror"),"aria-hidden":!0},Bn,"\xA0")),nt=V.createElement(Vt.Z,{prefixCls:"".concat(Fn,"-overflow"),data:U,renderItem:$n,renderRest:cn,suffix:ot,itemKey:et,maxCount:Ge});return V.createElement("span",{className:"".concat(Fn,"-wrap")},nt,!U.length&&!Bn&&V.createElement("span",{className:"".concat(Fn,"-placeholder")},qe))},Rn=Sn,Pn=function(R){var re=R.inputElement,Q=R.prefixCls,U=R.id,Ee=R.inputRef,Re=R.disabled,be=R.autoFocus,We=R.autoComplete,qe=R.activeDescendantId,Lt=R.mode,Qe=R.open,st=R.values,we=R.placeholder,w=R.tabIndex,H=R.showSearch,te=R.searchValue,le=R.activeValue,Ge=R.maxLength,Ve=R.onInputKeyDown,$e=R.onInputMouseDown,vt=R.onInputChange,Ct=R.onInputPaste,At=R.onInputCompositionStart,qt=R.onInputCompositionEnd,xt=R.onInputBlur,Jt=R.title,$t=V.useState(!1),rn=(0,x.Z)($t,2),jt=rn[0],Kt=rn[1],yn=Lt==="combobox",yt=yn||H,Dt=st[0],kt=te||"";yn&&le&&!jt&&(kt=le),V.useEffect(function(){yn&&Kt(!1)},[yn,le]);var mn=Lt!=="combobox"&&!Qe&&!H?!1:!!kt,en=Jt===void 0?pe(Dt):Jt,fn=V.useMemo(function(){return Dt?null:V.createElement("span",{className:"".concat(Q,"-selection-placeholder"),style:mn?{visibility:"hidden"}:void 0},we)},[Dt,mn,we,Q]);return V.createElement("span",{className:"".concat(Q,"-selection-wrap")},V.createElement("span",{className:"".concat(Q,"-selection-search")},V.createElement(G,{ref:Ee,prefixCls:Q,id:U,open:Qe,inputElement:re,disabled:Re,autoFocus:be,autoComplete:We,editable:yt,activeDescendantId:qe,value:kt,onKeyDown:Ve,onMouseDown:$e,onChange:function(On){Kt(!0),vt(On)},onPaste:Ct,onCompositionStart:At,onCompositionEnd:qt,onBlur:xt,tabIndex:w,attrs:(0,Be.Z)(R,!0),maxLength:yn?Ge:void 0})),!yn&&Dt?V.createElement("span",{className:"".concat(Q,"-selection-item"),title:en,style:mn?{visibility:"hidden"}:void 0},Dt.label):null,fn)},Ot=Pn,on=function(R,re){var Q=(0,V.useRef)(null),U=(0,V.useRef)(!1),Ee=R.prefixCls,Re=R.open,be=R.mode,We=R.showSearch,qe=R.tokenWithEnter,Lt=R.disabled,Qe=R.prefix,st=R.autoClearSearchValue,we=R.onSearch,w=R.onSearchSubmit,H=R.onToggleOpen,te=R.onInputKeyDown,le=R.onInputBlur,Ge=R.domRef;V.useImperativeHandle(re,function(){return{focus:function(en){Q.current.focus(en)},blur:function(){Q.current.blur()}}});var Ve=Se(0),$e=(0,x.Z)(Ve,2),vt=$e[0],Ct=$e[1],At=function(en){var fn=en.which,Cn=Q.current instanceof HTMLTextAreaElement;!Cn&&Re&&(fn===Ie.Z.UP||fn===Ie.Z.DOWN)&&en.preventDefault(),te&&te(en),fn===Ie.Z.ENTER&&be==="tags"&&!U.current&&!Re&&(w==null||w(en.target.value)),!(Cn&&!Re&&~[Ie.Z.UP,Ie.Z.DOWN,Ie.Z.LEFT,Ie.Z.RIGHT].indexOf(fn))&&fe(fn)&&H(!0)},qt=function(){Ct(!0)},xt=(0,V.useRef)(null),Jt=function(en){we(en,!0,U.current)!==!1&&H(!0)},$t=function(){U.current=!0},rn=function(en){U.current=!1,be!=="combobox"&&Jt(en.target.value)},jt=function(en){var fn=en.target.value;if(qe&&xt.current&&/[\r\n]/.test(xt.current)){var Cn=xt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");fn=fn.replace(Cn,xt.current)}xt.current=null,Jt(fn)},Kt=function(en){var fn=en.clipboardData,Cn=fn==null?void 0:fn.getData("text");xt.current=Cn||""},yn=function(en){var fn=en.target;if(fn!==Q.current){var Cn=document.body.style.msTouchAction!==void 0;Cn?setTimeout(function(){Q.current.focus()}):Q.current.focus()}},yt=function(en){var fn=vt();en.target!==Q.current&&!fn&&!(be==="combobox"&&Lt)&&en.preventDefault(),(be!=="combobox"&&(!We||!fn)||!Re)&&(Re&&st!==!1&&we("",!0,!1),H())},Dt={inputRef:Q,onInputKeyDown:At,onInputMouseDown:qt,onInputChange:jt,onInputPaste:Kt,onInputCompositionStart:$t,onInputCompositionEnd:rn,onInputBlur:le},kt=be==="multiple"||be==="tags"?V.createElement(Rn,(0,A.Z)({},R,Dt)):V.createElement(Ot,(0,A.Z)({},R,Dt));return V.createElement("div",{ref:Ge,className:"".concat(Ee,"-selector"),onClick:yn,onMouseDown:yt},Qe&&V.createElement("div",{className:"".concat(Ee,"-prefix")},Qe),kt)},rt=V.forwardRef(on),Nn=rt,ge=L(65352),X=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],J=function(R){var re=R===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:re,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:re,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:re,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:re,adjustY:1},htmlRegion:"scroll"}}},D=function(R,re){var Q=R.prefixCls,U=R.disabled,Ee=R.visible,Re=R.children,be=R.popupElement,We=R.animation,qe=R.transitionName,Lt=R.dropdownStyle,Qe=R.dropdownClassName,st=R.direction,we=st===void 0?"ltr":st,w=R.placement,H=R.builtinPlacements,te=R.dropdownMatchSelectWidth,le=R.dropdownRender,Ge=R.dropdownAlign,Ve=R.getPopupContainer,$e=R.empty,vt=R.getTriggerDOMNode,Ct=R.onPopupVisibleChange,At=R.onPopupMouseEnter,qt=(0,m.Z)(R,X),xt="".concat(Q,"-dropdown"),Jt=be;le&&(Jt=le(be));var $t=V.useMemo(function(){return H||J(te)},[H,te]),rn=We?"".concat(xt,"-").concat(We):qe,jt=typeof te=="number",Kt=V.useMemo(function(){return jt?null:te===!1?"minWidth":"width"},[te,jt]),yn=Lt;jt&&(yn=(0,Z.Z)((0,Z.Z)({},yn),{},{width:te}));var yt=V.useRef(null);return V.useImperativeHandle(re,function(){return{getPopupElement:function(){var kt;return(kt=yt.current)===null||kt===void 0?void 0:kt.popupElement}}}),V.createElement(ge.Z,(0,A.Z)({},qt,{showAction:Ct?["click"]:[],hideAction:Ct?["click"]:[],popupPlacement:w||(we==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:$t,prefixCls:xt,popupTransitionName:rn,popup:V.createElement("div",{onMouseEnter:At},Jt),ref:yt,stretch:Kt,popupAlign:Ge,popupVisible:Ee,getPopupContainer:Ve,popupClassName:M()(Qe,(0,ve.Z)({},"".concat(xt,"-empty"),$e)),popupStyle:yn,getTriggerDOMNode:vt,onPopupVisibleChange:Ct}),Re)},Ne=V.forwardRef(D),Fe=Ne,ze=L(67900);function Je(_,R){var re=_.key,Q;return"value"in _&&(Q=_.value),re!=null?re:Q!==void 0?Q:"rc-index-key-".concat(R)}function z(_){return typeof _!="undefined"&&!Number.isNaN(_)}function q(_,R){var re=_||{},Q=re.label,U=re.value,Ee=re.options,Re=re.groupLabel,be=Q||(R?"children":"label");return{label:be,value:U||"value",options:Ee||"options",groupLabel:Re||be}}function ie(_){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},re=R.fieldNames,Q=R.childrenAsData,U=[],Ee=q(re,!1),Re=Ee.label,be=Ee.value,We=Ee.options,qe=Ee.groupLabel;function Lt(Qe,st){Array.isArray(Qe)&&Qe.forEach(function(we){if(st||!(We in we)){var w=we[be];U.push({key:Je(we,U.length),groupOption:st,data:we,label:we[Re],value:w})}else{var H=we[qe];H===void 0&&Q&&(H=we.label),U.push({key:Je(we,U.length),group:!0,data:we,label:H}),Lt(we[We],!0)}})}return Lt(_,!1),U}function O(_){var R=(0,Z.Z)({},_);return"props"in R||Object.defineProperty(R,"props",{get:function(){return(0,Ze.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),R}}),R}var Pe=function(R,re,Q){if(!re||!re.length)return null;var U=!1,Ee=function be(We,qe){var Lt=(0,ze.Z)(qe),Qe=Lt[0],st=Lt.slice(1);if(!Qe)return[We];var we=We.split(Qe);return U=U||we.length>1,we.reduce(function(w,H){return[].concat((0,ye.Z)(w),(0,ye.Z)(be(H,st)))},[]).filter(Boolean)},Re=Ee(R,re);return U?typeof Q!="undefined"?Re.slice(0,Q):Re:null},Ye=V.createContext(null),Oe=Ye;function pt(_){var R=_.visible,re=_.values;if(!R)return null;var Q=50;return V.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(re.slice(0,Q).map(function(U){var Ee=U.label,Re=U.value;return["number","string"].includes((0,Xe.Z)(Ee))?Ee:Re}).join(", ")),re.length>Q?", ...":null)}var Qt=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],It=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],ft=function(R){return R==="tags"||R==="multiple"},ee=V.forwardRef(function(_,R){var re,Q=_.id,U=_.prefixCls,Ee=_.className,Re=_.showSearch,be=_.tagRender,We=_.direction,qe=_.omitDomProps,Lt=_.displayValues,Qe=_.onDisplayValuesChange,st=_.emptyOptions,we=_.notFoundContent,w=we===void 0?"Not Found":we,H=_.onClear,te=_.mode,le=_.disabled,Ge=_.loading,Ve=_.getInputElement,$e=_.getRawInputElement,vt=_.open,Ct=_.defaultOpen,At=_.onDropdownVisibleChange,qt=_.activeValue,xt=_.onActiveValueChange,Jt=_.activeDescendantId,$t=_.searchValue,rn=_.autoClearSearchValue,jt=_.onSearch,Kt=_.onSearchSplit,yn=_.tokenSeparators,yt=_.allowClear,Dt=_.prefix,kt=_.suffixIcon,mn=_.clearIcon,en=_.OptionList,fn=_.animation,Cn=_.transitionName,On=_.dropdownStyle,si=_.dropdownClassName,Fn=_.dropdownMatchSelectWidth,Bn=_.dropdownRender,Yn=_.dropdownAlign,ti=_.placement,qn=_.builtinPlacements,$n=_.getPopupContainer,cn=_.showAction,ot=cn===void 0?[]:cn,nt=_.onFocus,Ft=_.onBlur,Bt=_.onKeyUp,gn=_.onKeyDown,Zn=_.onMouseDown,jn=(0,m.Z)(_,Qt),Mn=ft(te),ni=(Re!==void 0?Re:Mn)||te==="combobox",vi=(0,Z.Z)({},jn);It.forEach(function(li){delete vi[li]}),qe==null||qe.forEach(function(li){delete vi[li]});var Ti=V.useState(!1),Ii=(0,x.Z)(Ti,2),wn=Ii[0],_i=Ii[1];V.useEffect(function(){_i((0,de.Z)())},[]);var wi=V.useRef(null),pi=V.useRef(null),ii=V.useRef(null),vn=V.useRef(null),mi=V.useRef(null),Ci=V.useRef(!1),zi=W(),Hn=(0,x.Z)(zi,3),bn=Hn[0],Kn=Hn[1],ui=Hn[2];V.useImperativeHandle(R,function(){var li,ei;return{focus:(li=vn.current)===null||li===void 0?void 0:li.focus,blur:(ei=vn.current)===null||ei===void 0?void 0:ei.blur,scrollTo:function(ji){var ki;return(ki=mi.current)===null||ki===void 0?void 0:ki.scrollTo(ji)},nativeElement:wi.current||pi.current}});var Vn=V.useMemo(function(){var li;if(te!=="combobox")return $t;var ei=(li=Lt[0])===null||li===void 0?void 0:li.value;return typeof ei=="string"||typeof ei=="number"?String(ei):""},[$t,te,Lt]),Di=te==="combobox"&&typeof Ve=="function"&&Ve()||null,fi=typeof $e=="function"&&$e(),Oi=(0,hn.x1)(pi,fi==null||(re=fi.props)===null||re===void 0?void 0:re.ref),Hi=V.useState(!1),Ui=(0,x.Z)(Hi,2),Qi=Ui[0],Gi=Ui[1];(0,N.Z)(function(){Gi(!0)},[]);var Vi=(0,ae.Z)(!1,{defaultValue:Ct,value:vt}),Ai=(0,x.Z)(Vi,2),Zi=Ai[0],Mi=Ai[1],yi=Qi?Zi:!1,Ri=!w&&st;(le||Ri&&yi&&te==="combobox")&&(yi=!1);var Ei=Ri?!1:yi,Mt=V.useCallback(function(li){var ei=li!==void 0?li:!yi;le||(Mi(ei),yi!==ei&&(At==null||At(ei)))},[le,yi,Mi,At]),xn=V.useMemo(function(){return(yn||[]).some(function(li){return[`
|
|
`,`\r
|
|
`].includes(li)})},[yn]),Dn=V.useContext(Oe)||{},kn=Dn.maxCount,ai=Dn.rawValues,hi=function(ei,Wi,ji){if(!(Mn&&z(kn)&&(ai==null?void 0:ai.size)>=kn)){var ki=!0,Bi=ei;xt==null||xt(null);var ar=Pe(ei,yn,z(kn)?kn-ai.size:void 0),tr=ji?null:ar;return te!=="combobox"&&tr&&(Bi="",Kt==null||Kt(tr),Mt(!1),ki=!1),jt&&Vn!==Bi&&jt(Bi,{source:Wi?"typing":"effect"}),ki}},sn=function(ei){!ei||!ei.trim()||jt(ei,{source:"submit"})};V.useEffect(function(){!yi&&!Mn&&te!=="combobox"&&hi("",!1,!1)},[yi]),V.useEffect(function(){Zi&&le&&Mi(!1),le&&!Ci.current&&Kn(!1)},[le]);var In=Se(),oi=(0,x.Z)(In,2),ri=oi[0],gi=oi[1],Xi=V.useRef(!1),$i=function(ei){var Wi=ri(),ji=ei.key,ki=ji==="Enter";if(ki&&(te!=="combobox"&&ei.preventDefault(),yi||Mt(!0)),gi(!!Vn),ji==="Backspace"&&!Wi&&Mn&&!Vn&&Lt.length){for(var Bi=(0,ye.Z)(Lt),ar=null,tr=Bi.length-1;tr>=0;tr-=1){var fr=Bi[tr];if(!fr.disabled){Bi.splice(tr,1),ar=fr;break}}ar&&Qe(Bi,{type:"remove",values:[ar]})}for(var hr=arguments.length,nr=new Array(hr>1?hr-1:0),Mr=1;Mr<hr;Mr++)nr[Mr-1]=arguments[Mr];if(yi&&(!ki||!Xi.current)){var Ir;ki&&(Xi.current=!0),(Ir=mi.current)===null||Ir===void 0||Ir.onKeyDown.apply(Ir,[ei].concat(nr))}gn==null||gn.apply(void 0,[ei].concat(nr))},Ki=function(ei){for(var Wi=arguments.length,ji=new Array(Wi>1?Wi-1:0),ki=1;ki<Wi;ki++)ji[ki-1]=arguments[ki];if(yi){var Bi;(Bi=mi.current)===null||Bi===void 0||Bi.onKeyUp.apply(Bi,[ei].concat(ji))}ei.key==="Enter"&&(Xi.current=!1),Bt==null||Bt.apply(void 0,[ei].concat(ji))},rr=function(ei){var Wi=Lt.filter(function(ji){return ji!==ei});Qe(Wi,{type:"remove",values:[ei]})},sr=function(){Xi.current=!1},xr=V.useRef(!1),us=function(){Kn(!0),le||(nt&&!xr.current&&nt.apply(void 0,arguments),ot.includes("focus")&&Mt(!0)),xr.current=!0},Gr=function(){Ci.current=!0,Kn(!1,function(){xr.current=!1,Ci.current=!1,Mt(!1)}),!le&&(Vn&&(te==="tags"?jt(Vn,{source:"submit"}):te==="multiple"&&jt("",{source:"blur"})),Ft&&Ft.apply(void 0,arguments))},Sr=[];V.useEffect(function(){return function(){Sr.forEach(function(li){return clearTimeout(li)}),Sr.splice(0,Sr.length)}},[]);var er=function(ei){var Wi,ji=ei.target,ki=(Wi=ii.current)===null||Wi===void 0?void 0:Wi.getPopupElement();if(ki&&ki.contains(ji)){var Bi=setTimeout(function(){var hr=Sr.indexOf(Bi);if(hr!==-1&&Sr.splice(hr,1),ui(),!wn&&!ki.contains(document.activeElement)){var nr;(nr=vn.current)===null||nr===void 0||nr.focus()}});Sr.push(Bi)}for(var ar=arguments.length,tr=new Array(ar>1?ar-1:0),fr=1;fr<ar;fr++)tr[fr-1]=arguments[fr];Zn==null||Zn.apply(void 0,[ei].concat(tr))},Rr=V.useState({}),cs=(0,x.Z)(Rr,2),_r=cs[1];function dr(){_r({})}var Pr;fi&&(Pr=function(ei){Mt(ei)}),He(function(){var li;return[wi.current,(li=ii.current)===null||li===void 0?void 0:li.getPopupElement()]},Ei,Mt,!!fi);var Vr=V.useMemo(function(){return(0,Z.Z)((0,Z.Z)({},_),{},{notFoundContent:w,open:yi,triggerOpen:Ei,id:Q,showSearch:ni,multiple:Mn,toggleOpen:Mt})},[_,w,Ei,yi,Q,ni,Mn,Mt]),Xr=!!kt||Ge,Lr;Xr&&(Lr=V.createElement(bt,{className:M()("".concat(U,"-arrow"),(0,ve.Z)({},"".concat(U,"-arrow-loading"),Ge)),customizeIcon:kt,customizeIconProps:{loading:Ge,searchValue:Vn,open:yi,focused:bn,showSearch:ni}}));var qr=function(){var ei;H==null||H(),(ei=vn.current)===null||ei===void 0||ei.focus(),Qe([],{type:"clear",values:Lt}),hi("",!1,!1)},Or=Et(U,qr,Lt,yt,mn,le,Vn,te),ur=Or.allowClear,Qr=Or.clearIcon,zr=V.createElement(en,{ref:mi}),Jr=M()(U,Ee,(0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)({},"".concat(U,"-focused"),bn),"".concat(U,"-multiple"),Mn),"".concat(U,"-single"),!Mn),"".concat(U,"-allow-clear"),yt),"".concat(U,"-show-arrow"),Xr),"".concat(U,"-disabled"),le),"".concat(U,"-loading"),Ge),"".concat(U,"-open"),yi),"".concat(U,"-customize-input"),Di),"".concat(U,"-show-search"),ni)),Zr=V.createElement(Fe,{ref:ii,disabled:le,prefixCls:U,visible:Ei,popupElement:zr,animation:fn,transitionName:Cn,dropdownStyle:On,dropdownClassName:si,direction:We,dropdownMatchSelectWidth:Fn,dropdownRender:Bn,dropdownAlign:Yn,placement:ti,builtinPlacements:qn,getPopupContainer:$n,empty:st,getTriggerDOMNode:function(ei){return pi.current||ei},onPopupVisibleChange:Pr,onPopupMouseEnter:dr},fi?V.cloneElement(fi,{ref:Oi}):V.createElement(Nn,(0,A.Z)({},_,{domRef:pi,prefixCls:U,inputElement:Di,ref:vn,id:Q,prefix:Dt,showSearch:ni,autoClearSearchValue:rn,mode:te,activeDescendantId:Jt,tagRender:be,values:Lt,open:yi,onToggleOpen:Mt,activeValue:qt,searchValue:Vn,onSearch:hi,onSearchSubmit:sn,onRemove:rr,tokenWithEnter:xn,onInputBlur:sr}))),pr;return fi?pr=Zr:pr=V.createElement("div",(0,A.Z)({className:Jr},vi,{ref:wi,onMouseDown:er,onKeyDown:$i,onKeyUp:Ki,onFocus:us,onBlur:Gr}),V.createElement(pt,{visible:bn&&!yi,values:Lt}),Zr,Lr,ur&&Qr),V.createElement(oe.Provider,{value:Vr},pr)}),se=ee,Ae=function(){return null};Ae.isSelectOptGroup=!0;var Y=Ae,Ue=function(){return null};Ue.isSelectOption=!0;var Tt=Ue,wt=L(80547),Ke=L(2738),Nt=L(65283);function tn(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var un=["disabled","title","children","style","className"];function zt(_){return typeof _=="string"||typeof _=="number"}var Tn=function(R,re){var Q=K(),U=Q.prefixCls,Ee=Q.id,Re=Q.open,be=Q.multiple,We=Q.mode,qe=Q.searchValue,Lt=Q.toggleOpen,Qe=Q.notFoundContent,st=Q.onPopupScroll,we=V.useContext(Oe),w=we.maxCount,H=we.flattenOptions,te=we.onActiveValue,le=we.defaultActiveFirstOption,Ge=we.onSelect,Ve=we.menuItemSelectedIcon,$e=we.rawValues,vt=we.fieldNames,Ct=we.virtual,At=we.direction,qt=we.listHeight,xt=we.listItemHeight,Jt=we.optionRender,$t="".concat(U,"-item"),rn=(0,wt.Z)(function(){return H},[Re,H],function(cn,ot){return ot[0]&&cn[1]!==ot[1]}),jt=V.useRef(null),Kt=V.useMemo(function(){return be&&z(w)&&($e==null?void 0:$e.size)>=w},[be,w,$e==null?void 0:$e.size]),yn=function(ot){ot.preventDefault()},yt=function(ot){var nt;(nt=jt.current)===null||nt===void 0||nt.scrollTo(typeof ot=="number"?{index:ot}:ot)},Dt=V.useCallback(function(cn){return We==="combobox"?!1:$e.has(cn)},[We,(0,ye.Z)($e).toString(),$e.size]),kt=function(ot){for(var nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ft=rn.length,Bt=0;Bt<Ft;Bt+=1){var gn=(ot+Bt*nt+Ft)%Ft,Zn=rn[gn]||{},jn=Zn.group,Mn=Zn.data;if(!jn&&!(Mn!=null&&Mn.disabled)&&(Dt(Mn.value)||!Kt))return gn}return-1},mn=V.useState(function(){return kt(0)}),en=(0,x.Z)(mn,2),fn=en[0],Cn=en[1],On=function(ot){var nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Cn(ot);var Ft={source:nt?"keyboard":"mouse"},Bt=rn[ot];if(!Bt){te(null,-1,Ft);return}te(Bt.value,ot,Ft)};(0,V.useEffect)(function(){On(le!==!1?kt(0):-1)},[rn.length,qe]);var si=V.useCallback(function(cn){return We==="combobox"?String(cn).toLowerCase()===qe.toLowerCase():$e.has(cn)},[We,qe,(0,ye.Z)($e).toString(),$e.size]);(0,V.useEffect)(function(){var cn=setTimeout(function(){if(!be&&Re&&$e.size===1){var nt=Array.from($e)[0],Ft=rn.findIndex(function(Bt){var gn=Bt.data;return qe?String(gn.value).startsWith(qe):gn.value===nt});Ft!==-1&&(On(Ft),yt(Ft))}});if(Re){var ot;(ot=jt.current)===null||ot===void 0||ot.scrollTo(void 0)}return function(){return clearTimeout(cn)}},[Re,qe]);var Fn=function(ot){ot!==void 0&&Ge(ot,{selected:!$e.has(ot)}),be||Lt(!1)};if(V.useImperativeHandle(re,function(){return{onKeyDown:function(ot){var nt=ot.which,Ft=ot.ctrlKey;switch(nt){case Ie.Z.N:case Ie.Z.P:case Ie.Z.UP:case Ie.Z.DOWN:{var Bt=0;if(nt===Ie.Z.UP?Bt=-1:nt===Ie.Z.DOWN?Bt=1:tn()&&Ft&&(nt===Ie.Z.N?Bt=1:nt===Ie.Z.P&&(Bt=-1)),Bt!==0){var gn=kt(fn+Bt,Bt);yt(gn),On(gn,!0)}break}case Ie.Z.TAB:case Ie.Z.ENTER:{var Zn,jn=rn[fn];jn&&!(jn!=null&&(Zn=jn.data)!==null&&Zn!==void 0&&Zn.disabled)&&!Kt?Fn(jn.value):Fn(void 0),Re&&ot.preventDefault();break}case Ie.Z.ESC:Lt(!1),Re&&ot.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ot){yt(ot)}}}),rn.length===0)return V.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),className:"".concat($t,"-empty"),onMouseDown:yn},Qe);var Bn=Object.keys(vt).map(function(cn){return vt[cn]}),Yn=function(ot){return ot.label};function ti(cn,ot){var nt=cn.group;return{role:nt?"presentation":"option",id:"".concat(Ee,"_list_").concat(ot)}}var qn=function(ot){var nt=rn[ot];if(!nt)return null;var Ft=nt.data||{},Bt=Ft.value,gn=nt.group,Zn=(0,Be.Z)(Ft,!0),jn=Yn(nt);return nt?V.createElement("div",(0,A.Z)({"aria-label":typeof jn=="string"&&!gn?jn:null},Zn,{key:ot},ti(nt,ot),{"aria-selected":si(Bt)}),Bt):null},$n={role:"listbox",id:"".concat(Ee,"_list")};return V.createElement(V.Fragment,null,Ct&&V.createElement("div",(0,A.Z)({},$n,{style:{height:0,width:0,overflow:"hidden"}}),qn(fn-1),qn(fn),qn(fn+1)),V.createElement(Nt.Z,{itemKey:"key",ref:jt,data:rn,height:qt,itemHeight:xt,fullHeight:!1,onMouseDown:yn,onScroll:st,virtual:Ct,direction:At,innerProps:Ct?null:$n},function(cn,ot){var nt=cn.group,Ft=cn.groupOption,Bt=cn.data,gn=cn.label,Zn=cn.value,jn=Bt.key;if(nt){var Mn,ni=(Mn=Bt.title)!==null&&Mn!==void 0?Mn:zt(gn)?gn.toString():void 0;return V.createElement("div",{className:M()($t,"".concat($t,"-group"),Bt.className),title:ni},gn!==void 0?gn:jn)}var vi=Bt.disabled,Ti=Bt.title,Ii=Bt.children,wn=Bt.style,_i=Bt.className,wi=(0,m.Z)(Bt,un),pi=(0,Ke.Z)(wi,Bn),ii=Dt(Zn),vn=vi||!ii&&Kt,mi="".concat($t,"-option"),Ci=M()($t,mi,_i,(0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)({},"".concat(mi,"-grouped"),Ft),"".concat(mi,"-active"),fn===ot&&!vn),"".concat(mi,"-disabled"),vn),"".concat(mi,"-selected"),ii)),zi=Yn(cn),Hn=!Ve||typeof Ve=="function"||ii,bn=typeof zi=="number"?zi:zi||Zn,Kn=zt(bn)?bn.toString():void 0;return Ti!==void 0&&(Kn=Ti),V.createElement("div",(0,A.Z)({},(0,Be.Z)(pi),Ct?{}:ti(cn,ot),{"aria-selected":si(Zn),className:Ci,title:Kn,onMouseMove:function(){fn===ot||vn||On(ot)},onClick:function(){vn||Fn(Zn)},style:wn}),V.createElement("div",{className:"".concat(mi,"-content")},typeof Jt=="function"?Jt(cn,{index:ot}):bn),V.isValidElement(Ve)||ii,Hn&&V.createElement(bt,{className:"".concat($t,"-option-state"),customizeIcon:Ve,customizeIconProps:{value:Zn,disabled:vn,isSelected:ii}},ii?"\u2713":null))}))},En=V.forwardRef(Tn),mt=En,at=function(_,R){var re=V.useRef({values:new Map,options:new Map}),Q=V.useMemo(function(){var Ee=re.current,Re=Ee.values,be=Ee.options,We=_.map(function(Qe){if(Qe.label===void 0){var st;return(0,Z.Z)((0,Z.Z)({},Qe),{},{label:(st=Re.get(Qe.value))===null||st===void 0?void 0:st.label})}return Qe}),qe=new Map,Lt=new Map;return We.forEach(function(Qe){qe.set(Qe.value,Qe),Lt.set(Qe.value,R.get(Qe.value)||be.get(Qe.value))}),re.current.values=qe,re.current.options=Lt,We},[_,R]),U=V.useCallback(function(Ee){return R.get(Ee)||re.current.options.get(Ee)},[R]);return[Q,U]};function Yt(_,R){return lt(_).join("").toUpperCase().includes(R)}var gt=function(_,R,re,Q,U){return V.useMemo(function(){if(!re||Q===!1)return _;var Ee=R.options,Re=R.label,be=R.value,We=[],qe=typeof Q=="function",Lt=re.toUpperCase(),Qe=qe?Q:function(we,w){return U?Yt(w[U],Lt):w[Ee]?Yt(w[Re!=="children"?Re:"label"],Lt):Yt(w[be],Lt)},st=qe?function(we){return O(we)}:function(we){return we};return _.forEach(function(we){if(we[Ee]){var w=Qe(re,st(we));if(w)We.push(we);else{var H=we[Ee].filter(function(te){return Qe(re,st(te))});H.length&&We.push((0,Z.Z)((0,Z.Z)({},we),{},(0,ve.Z)({},Ee,H)))}return}Qe(re,st(we))&&We.push(we)}),We},[_,Q,U,re,R])},ct=L(6551),Ln=L(11592),nn=["children","value"],dn=["children"];function St(_){var R=_,re=R.key,Q=R.props,U=Q.children,Ee=Q.value,Re=(0,m.Z)(Q,nn);return(0,Z.Z)({key:re,value:Ee!==void 0?Ee:re,children:U},Re)}function Wt(_){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,Ln.Z)(_).map(function(re,Q){if(!V.isValidElement(re)||!re.type)return null;var U=re,Ee=U.type.isSelectOptGroup,Re=U.key,be=U.props,We=be.children,qe=(0,m.Z)(be,dn);return R||!Ee?St(re):(0,Z.Z)((0,Z.Z)({key:"__RC_SELECT_GRP__".concat(Re===null?Q:Re,"__"),label:Re},qe),{},{options:Wt(We)})}).filter(function(re){return re})}var zn=function(R,re,Q,U,Ee){return V.useMemo(function(){var Re=R,be=!R;be&&(Re=Wt(re));var We=new Map,qe=new Map,Lt=function(we,w,H){H&&typeof H=="string"&&we.set(w[H],w)},Qe=function st(we){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,H=0;H<we.length;H+=1){var te=we[H];!te[Q.options]||w?(We.set(te[Q.value],te),Lt(qe,te,Q.label),Lt(qe,te,U),Lt(qe,te,Ee)):st(te[Q.options],!0)}};return Qe(Re),{options:Re,valueOptions:We,labelOptions:qe}},[R,re,Q,U,Ee])},De=zn;function c(_){var R=V.useRef();R.current=_;var re=V.useCallback(function(){return R.current.apply(R,arguments)},[]);return re}function h(_){var R=_.mode,re=_.options,Q=_.children,U=_.backfill,Ee=_.allowClear,Re=_.placeholder,be=_.getInputElement,We=_.showSearch,qe=_.onSearch,Lt=_.defaultOpen,Qe=_.autoFocus,st=_.labelInValue,we=_.value,w=_.inputValue,H=_.optionLabelProp,te=isMultiple(R),le=We!==void 0?We:te||R==="combobox",Ge=re||convertChildrenToData(Q);if(warning(R!=="tags"||Ge.every(function(Ct){return!Ct.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),R==="tags"||R==="combobox"){var Ve=Ge.some(function(Ct){return Ct.options?Ct.options.some(function(At){return typeof("value"in At?At.value:At.key)=="number"}):typeof("value"in Ct?Ct.value:Ct.key)=="number"});warning(!Ve,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(R!=="combobox"||!H,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(R==="combobox"||!U,"`backfill` only works with `combobox` mode."),warning(R==="combobox"||!be,"`getInputElement` only work with `combobox` mode."),noteOnce(R!=="combobox"||!be||!Ee||!Re,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),qe&&!le&&R!=="combobox"&&R!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Lt||Qe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),we!=null){var $e=toArray(we);warning(!st||$e.every(function(Ct){return _typeof(Ct)==="object"&&("key"in Ct||"value"in Ct)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!te||Array.isArray(we),"`value` should be array when `mode` is `multiple` or `tags`")}if(Q){var vt=null;toNodeArray(Q).some(function(Ct){if(!React.isValidElement(Ct)||!Ct.type)return!1;var At=Ct,qt=At.type;if(qt.isSelectOption)return!1;if(qt.isSelectOptGroup){var xt=toNodeArray(Ct.props.children).every(function(Jt){return!React.isValidElement(Jt)||!Ct.type||Jt.type.isSelectOption?!0:(vt=Jt.type,!1)});return!xt}return vt=qt,!0}),vt&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(vt.displayName||vt.name||vt,"`.")),warning(w===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function g(_,R){if(_){var re=function Q(U){for(var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Re=0;Re<U.length;Re++){var be=U[Re];if(be[R==null?void 0:R.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Ee&&Array.isArray(be[R==null?void 0:R.options])&&Q(be[R==null?void 0:R.options],!0))break}};re(_)}}var E=null,S=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],k=["inputValue"];function j(_){return!_||(0,Xe.Z)(_)!=="object"}var ht=V.forwardRef(function(_,R){var re=_.id,Q=_.mode,U=_.prefixCls,Ee=U===void 0?"rc-select":U,Re=_.backfill,be=_.fieldNames,We=_.inputValue,qe=_.searchValue,Lt=_.onSearch,Qe=_.autoClearSearchValue,st=Qe===void 0?!0:Qe,we=_.onSelect,w=_.onDeselect,H=_.dropdownMatchSelectWidth,te=H===void 0?!0:H,le=_.filterOption,Ge=_.filterSort,Ve=_.optionFilterProp,$e=_.optionLabelProp,vt=_.options,Ct=_.optionRender,At=_.children,qt=_.defaultActiveFirstOption,xt=_.menuItemSelectedIcon,Jt=_.virtual,$t=_.direction,rn=_.listHeight,jt=rn===void 0?200:rn,Kt=_.listItemHeight,yn=Kt===void 0?20:Kt,yt=_.labelRender,Dt=_.value,kt=_.defaultValue,mn=_.labelInValue,en=_.onChange,fn=_.maxCount,Cn=(0,m.Z)(_,S),On=(0,ct.ZP)(re),si=ft(Q),Fn=!!(!vt&&At),Bn=V.useMemo(function(){return le===void 0&&Q==="combobox"?!1:le},[le,Q]),Yn=V.useMemo(function(){return q(be,Fn)},[JSON.stringify(be),Fn]),ti=(0,ae.Z)("",{value:qe!==void 0?qe:We,postState:function(xn){return xn||""}}),qn=(0,x.Z)(ti,2),$n=qn[0],cn=qn[1],ot=De(vt,At,Yn,Ve,$e),nt=ot.valueOptions,Ft=ot.labelOptions,Bt=ot.options,gn=V.useCallback(function(Mt){var xn=lt(Mt);return xn.map(function(Dn){var kn,ai,hi,sn,In;if(j(Dn))kn=Dn;else{var oi;hi=Dn.key,ai=Dn.label,kn=(oi=Dn.value)!==null&&oi!==void 0?oi:hi}var ri=nt.get(kn);if(ri){var gi;if(ai===void 0&&(ai=ri==null?void 0:ri[$e||Yn.label]),hi===void 0&&(hi=(gi=ri==null?void 0:ri.key)!==null&&gi!==void 0?gi:kn),sn=ri==null?void 0:ri.disabled,In=ri==null?void 0:ri.title,0)var Xi}return{label:ai,value:kn,key:hi,disabled:sn,title:In}})},[Yn,$e,nt]),Zn=(0,ae.Z)(kt,{value:Dt}),jn=(0,x.Z)(Zn,2),Mn=jn[0],ni=jn[1],vi=V.useMemo(function(){var Mt,xn=si&&Mn===null?[]:Mn,Dn=gn(xn);return Q==="combobox"&&ke((Mt=Dn[0])===null||Mt===void 0?void 0:Mt.value)?[]:Dn},[Mn,gn,Q,si]),Ti=at(vi,nt),Ii=(0,x.Z)(Ti,2),wn=Ii[0],_i=Ii[1],wi=V.useMemo(function(){if(!Q&&wn.length===1){var Mt=wn[0];if(Mt.value===null&&(Mt.label===null||Mt.label===void 0))return[]}return wn.map(function(xn){var Dn;return(0,Z.Z)((0,Z.Z)({},xn),{},{label:(Dn=typeof yt=="function"?yt(xn):xn.label)!==null&&Dn!==void 0?Dn:xn.value})})},[Q,wn,yt]),pi=V.useMemo(function(){return new Set(wn.map(function(Mt){return Mt.value}))},[wn]);V.useEffect(function(){if(Q==="combobox"){var Mt,xn=(Mt=wn[0])===null||Mt===void 0?void 0:Mt.value;cn($(xn)?String(xn):"")}},[wn]);var ii=c(function(Mt,xn){var Dn=xn!=null?xn:Mt;return(0,ve.Z)((0,ve.Z)({},Yn.value,Mt),Yn.label,Dn)}),vn=V.useMemo(function(){if(Q!=="tags")return Bt;var Mt=(0,ye.Z)(Bt),xn=function(kn){return nt.has(kn)};return(0,ye.Z)(wn).sort(function(Dn,kn){return Dn.value<kn.value?-1:1}).forEach(function(Dn){var kn=Dn.value;xn(kn)||Mt.push(ii(kn,Dn.label))}),Mt},[ii,Bt,nt,wn,Q]),mi=gt(vn,Yn,$n,Bn,Ve),Ci=V.useMemo(function(){return Q!=="tags"||!$n||mi.some(function(Mt){return Mt[Ve||"value"]===$n})||mi.some(function(Mt){return Mt[Yn.value]===$n})?mi:[ii($n)].concat((0,ye.Z)(mi))},[ii,Ve,Q,mi,$n,Yn]),zi=function Mt(xn){var Dn=(0,ye.Z)(xn).sort(function(kn,ai){return Ge(kn,ai,{searchValue:$n})});return Dn.map(function(kn){return Array.isArray(kn.options)?(0,Z.Z)((0,Z.Z)({},kn),{},{options:kn.options.length>0?Mt(kn.options):kn.options}):kn})},Hn=V.useMemo(function(){return Ge?zi(Ci):Ci},[Ci,Ge,$n]),bn=V.useMemo(function(){return ie(Hn,{fieldNames:Yn,childrenAsData:Fn})},[Hn,Yn,Fn]),Kn=function(xn){var Dn=gn(xn);if(ni(Dn),en&&(Dn.length!==wn.length||Dn.some(function(hi,sn){var In;return((In=wn[sn])===null||In===void 0?void 0:In.value)!==(hi==null?void 0:hi.value)}))){var kn=mn?Dn:Dn.map(function(hi){return hi.value}),ai=Dn.map(function(hi){return O(_i(hi.value))});en(si?kn:kn[0],si?ai:ai[0])}},ui=V.useState(null),Vn=(0,x.Z)(ui,2),Di=Vn[0],fi=Vn[1],Oi=V.useState(0),Hi=(0,x.Z)(Oi,2),Ui=Hi[0],Qi=Hi[1],Gi=qt!==void 0?qt:Q!=="combobox",Vi=V.useCallback(function(Mt,xn){var Dn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},kn=Dn.source,ai=kn===void 0?"keyboard":kn;Qi(xn),Re&&Q==="combobox"&&Mt!==null&&ai==="keyboard"&&fi(String(Mt))},[Re,Q]),Ai=function(xn,Dn,kn){var ai=function(){var rr,sr=_i(xn);return[mn?{label:sr==null?void 0:sr[Yn.label],value:xn,key:(rr=sr==null?void 0:sr.key)!==null&&rr!==void 0?rr:xn}:xn,O(sr)]};if(Dn&&we){var hi=ai(),sn=(0,x.Z)(hi,2),In=sn[0],oi=sn[1];we(In,oi)}else if(!Dn&&w&&kn!=="clear"){var ri=ai(),gi=(0,x.Z)(ri,2),Xi=gi[0],$i=gi[1];w(Xi,$i)}},Zi=c(function(Mt,xn){var Dn,kn=si?xn.selected:!0;kn?Dn=si?[].concat((0,ye.Z)(wn),[Mt]):[Mt]:Dn=wn.filter(function(ai){return ai.value!==Mt}),Kn(Dn),Ai(Mt,kn),Q==="combobox"?fi(""):(!ft||st)&&(cn(""),fi(""))}),Mi=function(xn,Dn){Kn(xn);var kn=Dn.type,ai=Dn.values;(kn==="remove"||kn==="clear")&&ai.forEach(function(hi){Ai(hi.value,!1,kn)})},yi=function(xn,Dn){if(cn(xn),fi(null),Dn.source==="submit"){var kn=(xn||"").trim();if(kn){var ai=Array.from(new Set([].concat((0,ye.Z)(pi),[kn])));Kn(ai),Ai(kn,!0),cn("")}return}Dn.source!=="blur"&&(Q==="combobox"&&Kn(xn),Lt==null||Lt(xn))},Ri=function(xn){var Dn=xn;Q!=="tags"&&(Dn=xn.map(function(ai){var hi=Ft.get(ai);return hi==null?void 0:hi.value}).filter(function(ai){return ai!==void 0}));var kn=Array.from(new Set([].concat((0,ye.Z)(pi),(0,ye.Z)(Dn))));Kn(kn),kn.forEach(function(ai){Ai(ai,!0)})},Ei=V.useMemo(function(){var Mt=Jt!==!1&&te!==!1;return(0,Z.Z)((0,Z.Z)({},ot),{},{flattenOptions:bn,onActiveValue:Vi,defaultActiveFirstOption:Gi,onSelect:Zi,menuItemSelectedIcon:xt,rawValues:pi,fieldNames:Yn,virtual:Mt,direction:$t,listHeight:jt,listItemHeight:yn,childrenAsData:Fn,maxCount:fn,optionRender:Ct})},[fn,ot,bn,Vi,Gi,Zi,xt,pi,Yn,Jt,te,$t,jt,yn,Fn,Ct]);return V.createElement(Oe.Provider,{value:Ei},V.createElement(se,(0,A.Z)({},Cn,{id:On,prefixCls:Ee,ref:R,omitDomProps:k,mode:Q,displayValues:wi,onDisplayValuesChange:Mi,direction:$t,searchValue:$n,onSearch:yi,autoClearSearchValue:st,onSearchSplit:Ri,dropdownMatchSelectWidth:te,OptionList:mt,emptyOptions:!bn.length,activeValue:Di,activeDescendantId:"".concat(On,"_list_").concat(Ui)})))}),ut=ht;ut.Option=Tt,ut.OptGroup=Y;var _t=ut,ln=_t},29443:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return ft}});var A=L(71409),ye=L(87075),ve=L(89490),Z=L(11036),x=L(28788),m=L(39224),Xe=L(92310),ae=L.n(Xe),Ze=L(18929),V=L(49658),ne=L(59301),M=(0,ne.createContext)(null),N=L(62730),de=L(29301),hn=L(6089),Pt=L(8654),bt=L(16089),Et=function(se){var Ae=se.activeTabOffset,Y=se.horizontal,Ue=se.rtl,Tt=se.indicator,wt=Tt===void 0?{}:Tt,Ke=wt.size,Nt=wt.align,tn=Nt===void 0?"center":Nt,un=(0,ne.useState)(),zt=(0,Z.Z)(un,2),Tn=zt[0],En=zt[1],mt=(0,ne.useRef)(),at=ne.useCallback(function(gt){return typeof Ke=="function"?Ke(gt):typeof Ke=="number"?Ke:gt},[Ke]);function Yt(){bt.Z.cancel(mt.current)}return(0,ne.useEffect)(function(){var gt={};if(Ae)if(Y){gt.width=at(Ae.width);var ct=Ue?"right":"left";tn==="start"&&(gt[ct]=Ae[ct]),tn==="center"&&(gt[ct]=Ae[ct]+Ae.width/2,gt.transform=Ue?"translateX(50%)":"translateX(-50%)"),tn==="end"&&(gt[ct]=Ae[ct]+Ae.width,gt.transform="translateX(-100%)")}else gt.height=at(Ae.height),tn==="start"&&(gt.top=Ae.top),tn==="center"&&(gt.top=Ae.top+Ae.height/2,gt.transform="translateY(-50%)"),tn==="end"&&(gt.top=Ae.top+Ae.height,gt.transform="translateY(-100%)");return Yt(),mt.current=(0,bt.Z)(function(){En(gt)}),Yt},[Ae,Y,Ue,tn,at]),{style:Tn}},oe=Et,K={width:0,height:0,left:0,top:0};function W(ee,se,Ae){return(0,ne.useMemo)(function(){for(var Y,Ue=new Map,Tt=se.get((Y=ee[0])===null||Y===void 0?void 0:Y.key)||K,wt=Tt.left+Tt.width,Ke=0;Ke<ee.length;Ke+=1){var Nt=ee[Ke].key,tn=se.get(Nt);if(!tn){var un;tn=se.get((un=ee[Ke-1])===null||un===void 0?void 0:un.key)||K}var zt=Ue.get(Nt)||(0,ve.Z)({},tn);zt.right=wt-zt.left-zt.width,Ue.set(Nt,zt)}return Ue},[ee.map(function(Y){return Y.key}).join("_"),se,Ae])}function Se(ee,se){var Ae=ne.useRef(ee),Y=ne.useState({}),Ue=(0,Z.Z)(Y,2),Tt=Ue[1];function wt(Ke){var Nt=typeof Ke=="function"?Ke(Ae.current):Ke;Nt!==Ae.current&&se(Nt,Ae.current),Ae.current=Nt,Tt({})}return[Ae.current,wt]}var He=.1,Ie=.01,fe=20,Be=Math.pow(.995,fe);function Vt(ee,se){var Ae=(0,ne.useState)(),Y=(0,Z.Z)(Ae,2),Ue=Y[0],Tt=Y[1],wt=(0,ne.useState)(0),Ke=(0,Z.Z)(wt,2),Nt=Ke[0],tn=Ke[1],un=(0,ne.useState)(0),zt=(0,Z.Z)(un,2),Tn=zt[0],En=zt[1],mt=(0,ne.useState)(),at=(0,Z.Z)(mt,2),Yt=at[0],gt=at[1],ct=(0,ne.useRef)();function Ln(De){var c=De.touches[0],h=c.screenX,g=c.screenY;Tt({x:h,y:g}),window.clearInterval(ct.current)}function nn(De){if(Ue){var c=De.touches[0],h=c.screenX,g=c.screenY;Tt({x:h,y:g});var E=h-Ue.x,S=g-Ue.y;se(E,S);var k=Date.now();tn(k),En(k-Nt),gt({x:E,y:S})}}function dn(){if(Ue&&(Tt(null),gt(null),Yt)){var De=Yt.x/Tn,c=Yt.y/Tn,h=Math.abs(De),g=Math.abs(c);if(Math.max(h,g)<He)return;var E=De,S=c;ct.current=window.setInterval(function(){if(Math.abs(E)<Ie&&Math.abs(S)<Ie){window.clearInterval(ct.current);return}E*=Be,S*=Be,se(E*fe,S*fe)},fe)}}var St=(0,ne.useRef)();function Wt(De){var c=De.deltaX,h=De.deltaY,g=0,E=Math.abs(c),S=Math.abs(h);E===S?g=St.current==="x"?c:h:E>S?(g=c,St.current="x"):(g=h,St.current="y"),se(-g,-g)&&De.preventDefault()}var zn=(0,ne.useRef)(null);zn.current={onTouchStart:Ln,onTouchMove:nn,onTouchEnd:dn,onWheel:Wt},ne.useEffect(function(){function De(E){zn.current.onTouchStart(E)}function c(E){zn.current.onTouchMove(E)}function h(E){zn.current.onTouchEnd(E)}function g(E){zn.current.onWheel(E)}return document.addEventListener("touchmove",c,{passive:!1}),document.addEventListener("touchend",h,{passive:!0}),ee.current.addEventListener("touchstart",De,{passive:!0}),ee.current.addEventListener("wheel",g,{passive:!1}),function(){document.removeEventListener("touchmove",c),document.removeEventListener("touchend",h)}},[])}var dt=L(34280);function Zt(ee){var se=(0,ne.useState)(0),Ae=(0,Z.Z)(se,2),Y=Ae[0],Ue=Ae[1],Tt=(0,ne.useRef)(0),wt=(0,ne.useRef)();return wt.current=ee,(0,dt.o)(function(){var Ke;(Ke=wt.current)===null||Ke===void 0||Ke.call(wt)},[Y]),function(){Tt.current===Y&&(Tt.current+=1,Ue(Tt.current))}}function Ce(ee){var se=(0,ne.useRef)([]),Ae=(0,ne.useState)({}),Y=(0,Z.Z)(Ae,2),Ue=Y[1],Tt=(0,ne.useRef)(typeof ee=="function"?ee():ee),wt=Zt(function(){var Nt=Tt.current;se.current.forEach(function(tn){Nt=tn(Nt)}),se.current=[],Tt.current=Nt,Ue({})});function Ke(Nt){se.current.push(Nt),wt()}return[Tt.current,Ke]}var F={width:0,height:0,left:0,top:0,right:0};function ce(ee,se,Ae,Y,Ue,Tt,wt){var Ke=wt.tabs,Nt=wt.tabPosition,tn=wt.rtl,un,zt,Tn;return["top","bottom"].includes(Nt)?(un="width",zt=tn?"right":"left",Tn=Math.abs(Ae)):(un="height",zt="top",Tn=-Ae),(0,ne.useMemo)(function(){if(!Ke.length)return[0,0];for(var En=Ke.length,mt=En,at=0;at<En;at+=1){var Yt=ee.get(Ke[at].key)||F;if(Math.floor(Yt[zt]+Yt[un])>Math.floor(Tn+se)){mt=at-1;break}}for(var gt=0,ct=En-1;ct>=0;ct-=1){var Ln=ee.get(Ke[ct].key)||F;if(Ln[zt]<Tn){gt=ct+1;break}}return gt>=mt?[0,0]:[gt,mt]},[ee,se,Y,Ue,Tt,Tn,Nt,Ke.map(function(En){return En.key}).join("_"),tn])}function G(ee){var se;return ee instanceof Map?(se={},ee.forEach(function(Ae,Y){se[Y]=Ae})):se=ee,JSON.stringify(se)}var lt="TABS_DQ";function Rt(ee){return String(ee).replace(/"/g,lt)}function C(ee,se,Ae,Y){return!(!Ae||Y||ee===!1||ee===void 0&&(se===!1||se===null))}var $=ne.forwardRef(function(ee,se){var Ae=ee.prefixCls,Y=ee.editable,Ue=ee.locale,Tt=ee.style;return!Y||Y.showAdd===!1?null:ne.createElement("button",{ref:se,type:"button",className:"".concat(Ae,"-nav-add"),style:Tt,"aria-label":(Ue==null?void 0:Ue.addAriaLabel)||"Add tab",onClick:function(Ke){Y.onEdit("add",{event:Ke})}},Y.addIcon||"+")}),ke=$,Le=ne.forwardRef(function(ee,se){var Ae=ee.position,Y=ee.prefixCls,Ue=ee.extra;if(!Ue)return null;var Tt,wt={};return(0,x.Z)(Ue)==="object"&&!ne.isValidElement(Ue)?wt=Ue:wt.right=Ue,Ae==="right"&&(Tt=wt.right),Ae==="left"&&(Tt=wt.left),Tt?ne.createElement("div",{className:"".concat(Y,"-extra-content"),ref:se},Tt):null}),pe=Le,_e=L(96478),et=L(28321),Xt=L(10228),Sn=ne.forwardRef(function(ee,se){var Ae=ee.prefixCls,Y=ee.id,Ue=ee.tabs,Tt=ee.locale,wt=ee.mobile,Ke=ee.more,Nt=Ke===void 0?{}:Ke,tn=ee.style,un=ee.className,zt=ee.editable,Tn=ee.tabBarGutter,En=ee.rtl,mt=ee.removeAriaLabel,at=ee.onTabClick,Yt=ee.getPopupContainer,gt=ee.popupClassName,ct=(0,ne.useState)(!1),Ln=(0,Z.Z)(ct,2),nn=Ln[0],dn=Ln[1],St=(0,ne.useState)(null),Wt=(0,Z.Z)(St,2),zn=Wt[0],De=Wt[1],c=Nt.icon,h=c===void 0?"More":c,g="".concat(Y,"-more-popup"),E="".concat(Ae,"-dropdown"),S=zn!==null?"".concat(g,"-").concat(zn):null,k=Tt==null?void 0:Tt.dropdownAriaLabel;function j(re,Q){re.preventDefault(),re.stopPropagation(),zt.onEdit("remove",{key:Q,event:re})}var ht=ne.createElement(et.ZP,{onClick:function(Q){var U=Q.key,Ee=Q.domEvent;at(U,Ee),dn(!1)},prefixCls:"".concat(E,"-menu"),id:g,tabIndex:-1,role:"listbox","aria-activedescendant":S,selectedKeys:[zn],"aria-label":k!==void 0?k:"expanded dropdown"},Ue.map(function(re){var Q=re.closable,U=re.disabled,Ee=re.closeIcon,Re=re.key,be=re.label,We=C(Q,Ee,zt,U);return ne.createElement(et.sN,{key:Re,id:"".concat(g,"-").concat(Re),role:"option","aria-controls":Y&&"".concat(Y,"-panel-").concat(Re),disabled:U},ne.createElement("span",null,be),We&&ne.createElement("button",{type:"button","aria-label":mt||"remove",tabIndex:0,className:"".concat(E,"-menu-item-remove"),onClick:function(Lt){Lt.stopPropagation(),j(Lt,Re)}},Ee||zt.removeIcon||"\xD7"))}));function ut(re){for(var Q=Ue.filter(function(We){return!We.disabled}),U=Q.findIndex(function(We){return We.key===zn})||0,Ee=Q.length,Re=0;Re<Ee;Re+=1){U=(U+re+Ee)%Ee;var be=Q[U];if(!be.disabled){De(be.key);return}}}function _t(re){var Q=re.which;if(!nn){[Xt.Z.DOWN,Xt.Z.SPACE,Xt.Z.ENTER].includes(Q)&&(dn(!0),re.preventDefault());return}switch(Q){case Xt.Z.UP:ut(-1),re.preventDefault();break;case Xt.Z.DOWN:ut(1),re.preventDefault();break;case Xt.Z.ESC:dn(!1);break;case Xt.Z.SPACE:case Xt.Z.ENTER:zn!==null&&at(zn,re);break}}(0,ne.useEffect)(function(){var re=document.getElementById(S);re&&re.scrollIntoView&&re.scrollIntoView(!1)},[zn]),(0,ne.useEffect)(function(){nn||De(null)},[nn]);var ln=(0,ye.Z)({},En?"marginRight":"marginLeft",Tn);Ue.length||(ln.visibility="hidden",ln.order=1);var _=ae()((0,ye.Z)({},"".concat(E,"-rtl"),En)),R=wt?null:ne.createElement(_e.Z,(0,A.Z)({prefixCls:E,overlay:ht,visible:Ue.length?nn:!1,onVisibleChange:dn,overlayClassName:ae()(_,gt),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Yt},Nt),ne.createElement("button",{type:"button",className:"".concat(Ae,"-nav-more"),style:ln,"aria-haspopup":"listbox","aria-controls":g,id:"".concat(Y,"-more"),"aria-expanded":nn,onKeyDown:_t},h));return ne.createElement("div",{className:ae()("".concat(Ae,"-nav-operations"),un),style:tn,ref:se},R,ne.createElement(ke,{prefixCls:Ae,locale:Tt,editable:zt}))}),Rn=ne.memo(Sn,function(ee,se){return se.tabMoving}),Pn=function(se){var Ae=se.prefixCls,Y=se.id,Ue=se.active,Tt=se.focus,wt=se.tab,Ke=wt.key,Nt=wt.label,tn=wt.disabled,un=wt.closeIcon,zt=wt.icon,Tn=se.closable,En=se.renderWrapper,mt=se.removeAriaLabel,at=se.editable,Yt=se.onClick,gt=se.onFocus,ct=se.onBlur,Ln=se.onKeyDown,nn=se.onMouseDown,dn=se.onMouseUp,St=se.style,Wt=se.tabCount,zn=se.currentPosition,De="".concat(Ae,"-tab"),c=C(Tn,un,at,tn);function h(j){tn||Yt(j)}function g(j){j.preventDefault(),j.stopPropagation(),at.onEdit("remove",{key:Ke,event:j})}var E=ne.useMemo(function(){return zt&&typeof Nt=="string"?ne.createElement("span",null,Nt):Nt},[Nt,zt]),S=ne.useRef(null);ne.useEffect(function(){Tt&&S.current&&S.current.focus()},[Tt]);var k=ne.createElement("div",{key:Ke,"data-node-key":Rt(Ke),className:ae()(De,(0,ye.Z)((0,ye.Z)((0,ye.Z)((0,ye.Z)({},"".concat(De,"-with-remove"),c),"".concat(De,"-active"),Ue),"".concat(De,"-disabled"),tn),"".concat(De,"-focus"),Tt)),style:St,onClick:h},ne.createElement("div",{ref:S,role:"tab","aria-selected":Ue,id:Y&&"".concat(Y,"-tab-").concat(Ke),className:"".concat(De,"-btn"),"aria-controls":Y&&"".concat(Y,"-panel-").concat(Ke),"aria-disabled":tn,tabIndex:tn?null:Ue?0:-1,onClick:function(ht){ht.stopPropagation(),h(ht)},onKeyDown:Ln,onMouseDown:nn,onMouseUp:dn,onFocus:gt,onBlur:ct},Tt&&ne.createElement("div",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"Tab ".concat(zn," of ").concat(Wt)),zt&&ne.createElement("span",{className:"".concat(De,"-icon")},zt),Nt&&E),c&&ne.createElement("button",{type:"button",role:"tab","aria-label":mt||"remove",tabIndex:Ue?0:-1,className:"".concat(De,"-remove"),onClick:function(ht){ht.stopPropagation(),g(ht)}},un||at.removeIcon||"\xD7"));return En?En(k):k},Ot=Pn,on=function(se,Ae){var Y=se.offsetWidth,Ue=se.offsetHeight,Tt=se.offsetTop,wt=se.offsetLeft,Ke=se.getBoundingClientRect(),Nt=Ke.width,tn=Ke.height,un=Ke.left,zt=Ke.top;return Math.abs(Nt-Y)<1?[Nt,tn,un-Ae.left,zt-Ae.top]:[Y,Ue,wt,Tt]},rt=function(se){var Ae=se.current||{},Y=Ae.offsetWidth,Ue=Y===void 0?0:Y,Tt=Ae.offsetHeight,wt=Tt===void 0?0:Tt;if(se.current){var Ke=se.current.getBoundingClientRect(),Nt=Ke.width,tn=Ke.height;if(Math.abs(Nt-Ue)<1)return[Nt,tn]}return[Ue,wt]},Nn=function(se,Ae){return se[Ae?0:1]},ge=ne.forwardRef(function(ee,se){var Ae=ee.className,Y=ee.style,Ue=ee.id,Tt=ee.animated,wt=ee.activeKey,Ke=ee.rtl,Nt=ee.extra,tn=ee.editable,un=ee.locale,zt=ee.tabPosition,Tn=ee.tabBarGutter,En=ee.children,mt=ee.onTabClick,at=ee.onTabScroll,Yt=ee.indicator,gt=ne.useContext(M),ct=gt.prefixCls,Ln=gt.tabs,nn=(0,ne.useRef)(null),dn=(0,ne.useRef)(null),St=(0,ne.useRef)(null),Wt=(0,ne.useRef)(null),zn=(0,ne.useRef)(null),De=(0,ne.useRef)(null),c=(0,ne.useRef)(null),h=zt==="top"||zt==="bottom",g=Se(0,function(Hn,bn){h&&at&&at({direction:Hn>bn?"left":"right"})}),E=(0,Z.Z)(g,2),S=E[0],k=E[1],j=Se(0,function(Hn,bn){!h&&at&&at({direction:Hn>bn?"top":"bottom"})}),ht=(0,Z.Z)(j,2),ut=ht[0],_t=ht[1],ln=(0,ne.useState)([0,0]),_=(0,Z.Z)(ln,2),R=_[0],re=_[1],Q=(0,ne.useState)([0,0]),U=(0,Z.Z)(Q,2),Ee=U[0],Re=U[1],be=(0,ne.useState)([0,0]),We=(0,Z.Z)(be,2),qe=We[0],Lt=We[1],Qe=(0,ne.useState)([0,0]),st=(0,Z.Z)(Qe,2),we=st[0],w=st[1],H=Ce(new Map),te=(0,Z.Z)(H,2),le=te[0],Ge=te[1],Ve=W(Ln,le,Ee[0]),$e=Nn(R,h),vt=Nn(Ee,h),Ct=Nn(qe,h),At=Nn(we,h),qt=Math.floor($e)<Math.floor(vt+Ct),xt=qt?$e-At:$e-Ct,Jt="".concat(ct,"-nav-operations-hidden"),$t=0,rn=0;h&&Ke?($t=0,rn=Math.max(0,vt-xt)):($t=Math.min(0,xt-vt),rn=0);function jt(Hn){return Hn<$t?$t:Hn>rn?rn:Hn}var Kt=(0,ne.useRef)(null),yn=(0,ne.useState)(),yt=(0,Z.Z)(yn,2),Dt=yt[0],kt=yt[1];function mn(){kt(Date.now())}function en(){Kt.current&&clearTimeout(Kt.current)}Vt(Wt,function(Hn,bn){function Kn(ui,Vn){ui(function(Di){var fi=jt(Di+Vn);return fi})}return qt?(h?Kn(k,Hn):Kn(_t,bn),en(),mn(),!0):!1}),(0,ne.useEffect)(function(){return en(),Dt&&(Kt.current=setTimeout(function(){kt(0)},100)),en},[Dt]);var fn=ce(Ve,xt,h?S:ut,vt,Ct,At,(0,ve.Z)((0,ve.Z)({},ee),{},{tabs:Ln})),Cn=(0,Z.Z)(fn,2),On=Cn[0],si=Cn[1],Fn=(0,hn.Z)(function(){var Hn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wt,bn=Ve.get(Hn)||{width:0,height:0,left:0,right:0,top:0};if(h){var Kn=S;Ke?bn.right<S?Kn=bn.right:bn.right+bn.width>S+xt&&(Kn=bn.right+bn.width-xt):bn.left<-S?Kn=-bn.left:bn.left+bn.width>-S+xt&&(Kn=-(bn.left+bn.width-xt)),_t(0),k(jt(Kn))}else{var ui=ut;bn.top<-ut?ui=-bn.top:bn.top+bn.height>-ut+xt&&(ui=-(bn.top+bn.height-xt)),k(0),_t(jt(ui))}}),Bn=(0,ne.useState)(),Yn=(0,Z.Z)(Bn,2),ti=Yn[0],qn=Yn[1],$n=(0,ne.useState)(!1),cn=(0,Z.Z)($n,2),ot=cn[0],nt=cn[1],Ft=Ln.filter(function(Hn){return!Hn.disabled}).map(function(Hn){return Hn.key}),Bt=function(bn){var Kn=Ft.indexOf(ti||wt),ui=Ft.length,Vn=(Kn+bn+ui)%ui,Di=Ft[Vn];qn(Di)},gn=function(bn){var Kn=bn.code,ui=Ke&&h,Vn=Ft[0],Di=Ft[Ft.length-1];switch(Kn){case"ArrowLeft":{h&&Bt(ui?1:-1);break}case"ArrowRight":{h&&Bt(ui?-1:1);break}case"ArrowUp":{bn.preventDefault(),h||Bt(-1);break}case"ArrowDown":{bn.preventDefault(),h||Bt(1);break}case"Home":{bn.preventDefault(),qn(Vn);break}case"End":{bn.preventDefault(),qn(Di);break}case"Enter":case"Space":{bn.preventDefault(),mt(wt,bn);break}case"Backspace":case"Delete":{var fi=Ft.indexOf(ti),Oi=Ln.find(function(Ui){return Ui.key===ti}),Hi=C(Oi==null?void 0:Oi.closable,Oi==null?void 0:Oi.closeIcon,tn,Oi==null?void 0:Oi.disabled);Hi&&(bn.preventDefault(),bn.stopPropagation(),tn.onEdit("remove",{key:ti,event:bn}),fi===Ft.length-1?Bt(-1):Bt(1));break}}},Zn={};h?Zn[Ke?"marginRight":"marginLeft"]=Tn:Zn.marginTop=Tn;var jn=Ln.map(function(Hn,bn){var Kn=Hn.key;return ne.createElement(Ot,{id:Ue,prefixCls:ct,key:Kn,tab:Hn,style:bn===0?void 0:Zn,closable:Hn.closable,editable:tn,active:Kn===wt,focus:Kn===ti,renderWrapper:En,removeAriaLabel:un==null?void 0:un.removeAriaLabel,tabCount:Ft.length,currentPosition:bn+1,onClick:function(Vn){mt(Kn,Vn)},onKeyDown:gn,onFocus:function(){ot||qn(Kn),Fn(Kn),mn(),Wt.current&&(Ke||(Wt.current.scrollLeft=0),Wt.current.scrollTop=0)},onBlur:function(){qn(void 0)},onMouseDown:function(){nt(!0)},onMouseUp:function(){nt(!1)}})}),Mn=function(){return Ge(function(){var bn,Kn=new Map,ui=(bn=zn.current)===null||bn===void 0?void 0:bn.getBoundingClientRect();return Ln.forEach(function(Vn){var Di,fi=Vn.key,Oi=(Di=zn.current)===null||Di===void 0?void 0:Di.querySelector('[data-node-key="'.concat(Rt(fi),'"]'));if(Oi){var Hi=on(Oi,ui),Ui=(0,Z.Z)(Hi,4),Qi=Ui[0],Gi=Ui[1],Vi=Ui[2],Ai=Ui[3];Kn.set(fi,{width:Qi,height:Gi,left:Vi,top:Ai})}}),Kn})};(0,ne.useEffect)(function(){Mn()},[Ln.map(function(Hn){return Hn.key}).join("_")]);var ni=Zt(function(){var Hn=rt(nn),bn=rt(dn),Kn=rt(St);re([Hn[0]-bn[0]-Kn[0],Hn[1]-bn[1]-Kn[1]]);var ui=rt(c);Lt(ui);var Vn=rt(De);w(Vn);var Di=rt(zn);Re([Di[0]-ui[0],Di[1]-ui[1]]),Mn()}),vi=Ln.slice(0,On),Ti=Ln.slice(si+1),Ii=[].concat((0,N.Z)(vi),(0,N.Z)(Ti)),wn=Ve.get(wt),_i=oe({activeTabOffset:wn,horizontal:h,indicator:Yt,rtl:Ke}),wi=_i.style;(0,ne.useEffect)(function(){Fn()},[wt,$t,rn,G(wn),G(Ve),h]),(0,ne.useEffect)(function(){ni()},[Ke]);var pi=!!Ii.length,ii="".concat(ct,"-nav-wrap"),vn,mi,Ci,zi;return h?Ke?(mi=S>0,vn=S!==rn):(vn=S<0,mi=S!==$t):(Ci=ut<0,zi=ut!==$t),ne.createElement(de.Z,{onResize:ni},ne.createElement("div",{ref:(0,Pt.x1)(se,nn),role:"tablist","aria-orientation":h?"horizontal":"vertical",className:ae()("".concat(ct,"-nav"),Ae),style:Y,onKeyDown:function(){mn()}},ne.createElement(pe,{ref:dn,position:"left",extra:Nt,prefixCls:ct}),ne.createElement(de.Z,{onResize:ni},ne.createElement("div",{className:ae()(ii,(0,ye.Z)((0,ye.Z)((0,ye.Z)((0,ye.Z)({},"".concat(ii,"-ping-left"),vn),"".concat(ii,"-ping-right"),mi),"".concat(ii,"-ping-top"),Ci),"".concat(ii,"-ping-bottom"),zi)),ref:Wt},ne.createElement(de.Z,{onResize:ni},ne.createElement("div",{ref:zn,className:"".concat(ct,"-nav-list"),style:{transform:"translate(".concat(S,"px, ").concat(ut,"px)"),transition:Dt?"none":void 0}},jn,ne.createElement(ke,{ref:c,prefixCls:ct,locale:un,editable:tn,style:(0,ve.Z)((0,ve.Z)({},jn.length===0?void 0:Zn),{},{visibility:pi?"hidden":null})}),ne.createElement("div",{className:ae()("".concat(ct,"-ink-bar"),(0,ye.Z)({},"".concat(ct,"-ink-bar-animated"),Tt.inkBar)),style:wi}))))),ne.createElement(Rn,(0,A.Z)({},ee,{removeAriaLabel:un==null?void 0:un.removeAriaLabel,ref:De,prefixCls:ct,tabs:Ii,className:!pi&&Jt,tabMoving:!!Dt})),ne.createElement(pe,{ref:St,position:"right",extra:Nt,prefixCls:ct})))}),X=ge,J=ne.forwardRef(function(ee,se){var Ae=ee.prefixCls,Y=ee.className,Ue=ee.style,Tt=ee.id,wt=ee.active,Ke=ee.tabKey,Nt=ee.children;return ne.createElement("div",{id:Tt&&"".concat(Tt,"-panel-").concat(Ke),role:"tabpanel",tabIndex:wt?0:-1,"aria-labelledby":Tt&&"".concat(Tt,"-tab-").concat(Ke),"aria-hidden":!wt,style:Ue,className:ae()(Ae,wt&&"".concat(Ae,"-active"),Y),ref:se},Nt)}),D=J,Ne=["renderTabBar"],Fe=["label","key"],ze=function(se){var Ae=se.renderTabBar,Y=(0,m.Z)(se,Ne),Ue=ne.useContext(M),Tt=Ue.tabs;if(Ae){var wt=(0,ve.Z)((0,ve.Z)({},Y),{},{panes:Tt.map(function(Ke){var Nt=Ke.label,tn=Ke.key,un=(0,m.Z)(Ke,Fe);return ne.createElement(D,(0,A.Z)({tab:Nt,key:tn,tabKey:tn},un))})});return Ae(wt,X)}return ne.createElement(X,Y)},Je=ze,z=L(77900),q=["key","forceRender","style","className","destroyInactiveTabPane"],ie=function(se){var Ae=se.id,Y=se.activeKey,Ue=se.animated,Tt=se.tabPosition,wt=se.destroyInactiveTabPane,Ke=ne.useContext(M),Nt=Ke.prefixCls,tn=Ke.tabs,un=Ue.tabPane,zt="".concat(Nt,"-tabpane");return ne.createElement("div",{className:ae()("".concat(Nt,"-content-holder"))},ne.createElement("div",{className:ae()("".concat(Nt,"-content"),"".concat(Nt,"-content-").concat(Tt),(0,ye.Z)({},"".concat(Nt,"-content-animated"),un))},tn.map(function(Tn){var En=Tn.key,mt=Tn.forceRender,at=Tn.style,Yt=Tn.className,gt=Tn.destroyInactiveTabPane,ct=(0,m.Z)(Tn,q),Ln=En===Y;return ne.createElement(z.default,(0,A.Z)({key:En,visible:Ln,forceRender:mt,removeOnLeave:!!(wt||gt),leavedClassName:"".concat(zt,"-hidden")},Ue.tabPaneMotion),function(nn,dn){var St=nn.style,Wt=nn.className;return ne.createElement(D,(0,A.Z)({},ct,{prefixCls:zt,id:Ae,tabKey:En,animated:un,active:Ln,style:(0,ve.Z)((0,ve.Z)({},at),St),className:ae()(Yt,Wt),ref:dn}))})})))},O=ie,Pe=L(48736);function Ye(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},se;return ee===!1?se={inkBar:!1,tabPane:!1}:ee===!0?se={inkBar:!0,tabPane:!1}:se=(0,ve.Z)({inkBar:!0},(0,x.Z)(ee)==="object"?ee:{}),se.tabPaneMotion&&se.tabPane===void 0&&(se.tabPane=!0),!se.tabPaneMotion&&se.tabPane&&(se.tabPane=!1),se}var Oe=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],pt=0,Qt=ne.forwardRef(function(ee,se){var Ae=ee.id,Y=ee.prefixCls,Ue=Y===void 0?"rc-tabs":Y,Tt=ee.className,wt=ee.items,Ke=ee.direction,Nt=ee.activeKey,tn=ee.defaultActiveKey,un=ee.editable,zt=ee.animated,Tn=ee.tabPosition,En=Tn===void 0?"top":Tn,mt=ee.tabBarGutter,at=ee.tabBarStyle,Yt=ee.tabBarExtraContent,gt=ee.locale,ct=ee.more,Ln=ee.destroyInactiveTabPane,nn=ee.renderTabBar,dn=ee.onChange,St=ee.onTabClick,Wt=ee.onTabScroll,zn=ee.getPopupContainer,De=ee.popupClassName,c=ee.indicator,h=(0,m.Z)(ee,Oe),g=ne.useMemo(function(){return(wt||[]).filter(function(we){return we&&(0,x.Z)(we)==="object"&&"key"in we})},[wt]),E=Ke==="rtl",S=Ye(zt),k=(0,ne.useState)(!1),j=(0,Z.Z)(k,2),ht=j[0],ut=j[1];(0,ne.useEffect)(function(){ut((0,V.Z)())},[]);var _t=(0,Ze.Z)(function(){var we;return(we=g[0])===null||we===void 0?void 0:we.key},{value:Nt,defaultValue:tn}),ln=(0,Z.Z)(_t,2),_=ln[0],R=ln[1],re=(0,ne.useState)(function(){return g.findIndex(function(we){return we.key===_})}),Q=(0,Z.Z)(re,2),U=Q[0],Ee=Q[1];(0,ne.useEffect)(function(){var we=g.findIndex(function(H){return H.key===_});if(we===-1){var w;we=Math.max(0,Math.min(U,g.length-1)),R((w=g[we])===null||w===void 0?void 0:w.key)}Ee(we)},[g.map(function(we){return we.key}).join("_"),_,U]);var Re=(0,Ze.Z)(null,{value:Ae}),be=(0,Z.Z)(Re,2),We=be[0],qe=be[1];(0,ne.useEffect)(function(){Ae||(qe("rc-tabs-".concat(pt)),pt+=1)},[]);function Lt(we,w){St==null||St(we,w);var H=we!==_;R(we),H&&(dn==null||dn(we))}var Qe={id:We,activeKey:_,animated:S,tabPosition:En,rtl:E,mobile:ht},st=(0,ve.Z)((0,ve.Z)({},Qe),{},{editable:un,locale:gt,more:ct,tabBarGutter:mt,onTabClick:Lt,onTabScroll:Wt,extra:Yt,style:at,panes:null,getPopupContainer:zn,popupClassName:De,indicator:c});return ne.createElement(M.Provider,{value:{tabs:g,prefixCls:Ue}},ne.createElement("div",(0,A.Z)({ref:se,id:Ae,className:ae()(Ue,"".concat(Ue,"-").concat(En),(0,ye.Z)((0,ye.Z)((0,ye.Z)({},"".concat(Ue,"-mobile"),ht),"".concat(Ue,"-editable"),un),"".concat(Ue,"-rtl"),E),Tt)},h),ne.createElement(Je,(0,A.Z)({},st,{renderTabBar:nn})),ne.createElement(O,(0,A.Z)({destroyInactiveTabPane:Ln},Qe,{animated:S}))))}),It=Qt,ft=It},29125:function(Qn,pn,L){"use strict";L.d(pn,{G:function(){return Z},Z:function(){return Et}});var A=L(92310),ye=L.n(A),ve=L(59301);function Z(oe){var K=oe.children,W=oe.prefixCls,Se=oe.id,He=oe.overlayInnerStyle,Ie=oe.bodyClassName,fe=oe.className,Be=oe.style;return ve.createElement("div",{className:ye()("".concat(W,"-content"),fe),style:Be},ve.createElement("div",{className:ye()("".concat(W,"-inner"),Ie),id:Se,role:"tooltip",style:He},typeof K=="function"?K():K))}var x=L(71409),m=L(89490),Xe=L(39224),ae=L(65352),Ze={shiftX:64,adjustY:1},V={adjustX:1,shiftY:!0},ne=[0,0],M={left:{points:["cr","cl"],overflow:V,offset:[-4,0],targetOffset:ne},right:{points:["cl","cr"],overflow:V,offset:[4,0],targetOffset:ne},top:{points:["bc","tc"],overflow:Ze,offset:[0,-4],targetOffset:ne},bottom:{points:["tc","bc"],overflow:Ze,offset:[0,4],targetOffset:ne},topLeft:{points:["bl","tl"],overflow:Ze,offset:[0,-4],targetOffset:ne},leftTop:{points:["tr","tl"],overflow:V,offset:[-4,0],targetOffset:ne},topRight:{points:["br","tr"],overflow:Ze,offset:[0,-4],targetOffset:ne},rightTop:{points:["tl","tr"],overflow:V,offset:[4,0],targetOffset:ne},bottomRight:{points:["tr","br"],overflow:Ze,offset:[0,4],targetOffset:ne},rightBottom:{points:["bl","br"],overflow:V,offset:[4,0],targetOffset:ne},bottomLeft:{points:["tl","bl"],overflow:Ze,offset:[0,4],targetOffset:ne},leftBottom:{points:["br","bl"],overflow:V,offset:[-4,0],targetOffset:ne}},N=null,de=L(80402),hn=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],Pt=function(K,W){var Se=K.overlayClassName,He=K.trigger,Ie=He===void 0?["hover"]:He,fe=K.mouseEnterDelay,Be=fe===void 0?0:fe,Vt=K.mouseLeaveDelay,dt=Vt===void 0?.1:Vt,Zt=K.overlayStyle,Ce=K.prefixCls,F=Ce===void 0?"rc-tooltip":Ce,ce=K.children,G=K.onVisibleChange,lt=K.afterVisibleChange,Rt=K.transitionName,C=K.animation,$=K.motion,ke=K.placement,Le=ke===void 0?"right":ke,pe=K.align,_e=pe===void 0?{}:pe,et=K.destroyTooltipOnHide,Xt=et===void 0?!1:et,Sn=K.defaultVisible,Rn=K.getTooltipContainer,Pn=K.overlayInnerStyle,Ot=K.arrowContent,on=K.overlay,rt=K.id,Nn=K.showArrow,ge=Nn===void 0?!0:Nn,X=K.classNames,J=K.styles,D=(0,Xe.Z)(K,hn),Ne=(0,de.Z)(rt),Fe=(0,ve.useRef)(null);(0,ve.useImperativeHandle)(W,function(){return Fe.current});var ze=(0,m.Z)({},D);"visible"in K&&(ze.popupVisible=K.visible);var Je=function(){return ve.createElement(Z,{key:"content",prefixCls:F,id:Ne,bodyClassName:X==null?void 0:X.body,overlayInnerStyle:(0,m.Z)((0,m.Z)({},Pn),J==null?void 0:J.body)},on)},z=function(){var ie=ve.Children.only(ce),O=(ie==null?void 0:ie.props)||{},Pe=(0,m.Z)((0,m.Z)({},O),{},{"aria-describedby":on?Ne:null});return ve.cloneElement(ce,Pe)};return ve.createElement(ae.Z,(0,x.Z)({popupClassName:ye()(Se,X==null?void 0:X.root),prefixCls:F,popup:Je,action:Ie,builtinPlacements:M,popupPlacement:Le,ref:Fe,popupAlign:_e,getPopupContainer:Rn,onPopupVisibleChange:G,afterPopupVisibleChange:lt,popupTransitionName:Rt,popupAnimation:C,popupMotion:$,defaultPopupVisible:Sn,autoDestroy:Xt,mouseLeaveDelay:dt,popupStyle:(0,m.Z)((0,m.Z)({},Zt),J==null?void 0:J.root),mouseEnterDelay:Be,arrow:ge},ze),z())},bt=(0,ve.forwardRef)(Pt),Et=bt},49658:function(Qn,pn){"use strict";pn.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var L=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(L)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(L==null?void 0:L.substr(0,4))}},65283:function(Qn,pn,L){"use strict";L.d(pn,{Z:function(){return Nn}});var A=L(71409),ye=L(28788),ve=L(89490),Z=L(87075),x=L(11036),m=L(39224),Xe=L(92310),ae=L.n(Xe),Ze=L(29301),V=L(70425),ne=L(34280),M=L(59301),N=L(4676),de=M.forwardRef(function(ge,X){var J=ge.height,D=ge.offsetY,Ne=ge.offsetX,Fe=ge.children,ze=ge.prefixCls,Je=ge.onInnerResize,z=ge.innerProps,q=ge.rtl,ie=ge.extra,O={},Pe={display:"flex",flexDirection:"column"};return D!==void 0&&(O={height:J,position:"relative",overflow:"hidden"},Pe=(0,ve.Z)((0,ve.Z)({},Pe),{},(0,Z.Z)((0,Z.Z)((0,Z.Z)((0,Z.Z)((0,Z.Z)({transform:"translateY(".concat(D,"px)")},q?"marginRight":"marginLeft",-Ne),"position","absolute"),"left",0),"right",0),"top",0))),M.createElement("div",{style:O},M.createElement(Ze.Z,{onResize:function(Oe){var pt=Oe.offsetHeight;pt&&Je&&Je()}},M.createElement("div",(0,A.Z)({style:Pe,className:ae()((0,Z.Z)({},"".concat(ze,"-holder-inner"),ze)),ref:X},z),Fe,ie)))});de.displayName="Filler";var hn=de;function Pt(ge){var X=ge.children,J=ge.setRef,D=M.useCallback(function(Ne){J(Ne)},[]);return M.cloneElement(X,{ref:D})}function bt(ge,X,J,D,Ne,Fe,ze,Je){var z=Je.getKey;return ge.slice(X,J+1).map(function(q,ie){var O=X+ie,Pe=ze(q,O,{style:{width:D},offsetX:Ne}),Ye=z(q);return M.createElement(Pt,{key:Ye,setRef:function(pt){return Fe(q,pt)}},Pe)})}function Et(ge,X,J,D){var Ne=J-ge,Fe=X-J,ze=Math.min(Ne,Fe)*2;if(D<=ze){var Je=Math.floor(D/2);return D%2?J+Je+1:J-Je}return Ne>Fe?J-(D-Fe):J+(D-Ne)}function oe(ge,X,J){var D=ge.length,Ne=X.length,Fe,ze;if(D===0&&Ne===0)return null;D<Ne?(Fe=ge,ze=X):(Fe=X,ze=ge);var Je={__EMPTY_ITEM__:!0};function z(Oe){return Oe!==void 0?J(Oe):Je}for(var q=null,ie=Math.abs(D-Ne)!==1,O=0;O<ze.length;O+=1){var Pe=z(Fe[O]),Ye=z(ze[O]);if(Pe!==Ye){q=O,ie=ie||Pe!==z(ze[O+1]);break}}return q===null?null:{index:q,multiple:ie}}function K(ge,X,J){var D=M.useState(ge),Ne=(0,x.Z)(D,2),Fe=Ne[0],ze=Ne[1],Je=M.useState(null),z=(0,x.Z)(Je,2),q=z[0],ie=z[1];return M.useEffect(function(){var O=oe(Fe||[],ge||[],X);(O==null?void 0:O.index)!==void 0&&(J==null||J(O.index),ie(ge[O.index])),ze(ge)},[ge]),[q]}var W=L(16089),Se=(typeof navigator=="undefined"?"undefined":(0,ye.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),He=Se,Ie=function(ge,X,J,D){var Ne=(0,M.useRef)(!1),Fe=(0,M.useRef)(null);function ze(){clearTimeout(Fe.current),Ne.current=!0,Fe.current=setTimeout(function(){Ne.current=!1},50)}var Je=(0,M.useRef)({top:ge,bottom:X,left:J,right:D});return Je.current.top=ge,Je.current.bottom=X,Je.current.left=J,Je.current.right=D,function(z,q){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,O=z?q<0&&Je.current.left||q>0&&Je.current.right:q<0&&Je.current.top||q>0&&Je.current.bottom;return ie&&O?(clearTimeout(Fe.current),Ne.current=!1):(!O||Ne.current)&&ze(),!Ne.current&&O}};function fe(ge,X,J,D,Ne,Fe,ze){var Je=(0,M.useRef)(0),z=(0,M.useRef)(null),q=(0,M.useRef)(null),ie=(0,M.useRef)(!1),O=Ie(X,J,D,Ne);function Pe(ft,ee){if(W.Z.cancel(z.current),!O(!1,ee)){var se=ft;if(!se._virtualHandled)se._virtualHandled=!0;else return;Je.current+=ee,q.current=ee,He||se.preventDefault(),z.current=(0,W.Z)(function(){var Ae=ie.current?10:1;ze(Je.current*Ae,!1),Je.current=0})}}function Ye(ft,ee){ze(ee,!0),He||ft.preventDefault()}var Oe=(0,M.useRef)(null),pt=(0,M.useRef)(null);function Qt(ft){if(ge){W.Z.cancel(pt.current),pt.current=(0,W.Z)(function(){Oe.current=null},2);var ee=ft.deltaX,se=ft.deltaY,Ae=ft.shiftKey,Y=ee,Ue=se;(Oe.current==="sx"||!Oe.current&&Ae&&se&&!ee)&&(Y=se,Ue=0,Oe.current="sx");var Tt=Math.abs(Y),wt=Math.abs(Ue);Oe.current===null&&(Oe.current=Fe&&Tt>wt?"x":"y"),Oe.current==="y"?Pe(ft,Ue):Ye(ft,Y)}}function It(ft){ge&&(ie.current=ft.detail===q.current)}return[Qt,It]}function Be(ge,X,J,D){var Ne=M.useMemo(function(){return[new Map,[]]},[ge,J.id,D]),Fe=(0,x.Z)(Ne,2),ze=Fe[0],Je=Fe[1],z=function(ie){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ie,Pe=ze.get(ie),Ye=ze.get(O);if(Pe===void 0||Ye===void 0)for(var Oe=ge.length,pt=Je.length;pt<Oe;pt+=1){var Qt,It=ge[pt],ft=X(It);ze.set(ft,pt);var ee=(Qt=J.get(ft))!==null&&Qt!==void 0?Qt:D;if(Je[pt]=(Je[pt-1]||0)+ee,ft===ie&&(Pe=pt),ft===O&&(Ye=pt),Pe!==void 0&&Ye!==void 0)break}return{top:Je[Pe-1]||0,bottom:Je[Ye]}};return z}var Vt=L(16552),dt=L(19210),Zt=function(){function ge(){(0,Vt.Z)(this,ge),(0,Z.Z)(this,"maps",void 0),(0,Z.Z)(this,"id",0),(0,Z.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,dt.Z)(ge,[{key:"set",value:function(J,D){this.diffRecords.set(J,this.maps[J]),this.maps[J]=D,this.id+=1}},{key:"get",value:function(J){return this.maps[J]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),ge}(),Ce=Zt;function F(ge){var X=parseFloat(ge);return isNaN(X)?0:X}function ce(ge,X,J){var D=M.useState(0),Ne=(0,x.Z)(D,2),Fe=Ne[0],ze=Ne[1],Je=(0,M.useRef)(new Map),z=(0,M.useRef)(new Ce),q=(0,M.useRef)(0);function ie(){q.current+=1}function O(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ie();var Oe=function(){var It=!1;Je.current.forEach(function(ft,ee){if(ft&&ft.offsetParent){var se=ft.offsetHeight,Ae=getComputedStyle(ft),Y=Ae.marginTop,Ue=Ae.marginBottom,Tt=F(Y),wt=F(Ue),Ke=se+Tt+wt;z.current.get(ee)!==Ke&&(z.current.set(ee,Ke),It=!0)}}),It&&ze(function(ft){return ft+1})};if(Ye)Oe();else{q.current+=1;var pt=q.current;Promise.resolve().then(function(){pt===q.current&&Oe()})}}function Pe(Ye,Oe){var pt=ge(Ye),Qt=Je.current.get(pt);Oe?(Je.current.set(pt,Oe),O()):Je.current.delete(pt),!Qt!=!Oe&&(Oe?X==null||X(Ye):J==null||J(Ye))}return(0,M.useEffect)(function(){return ie},[]),[Pe,O,z.current,Fe]}var G=14/15;function lt(ge,X,J){var D=(0,M.useRef)(!1),Ne=(0,M.useRef)(0),Fe=(0,M.useRef)(0),ze=(0,M.useRef)(null),Je=(0,M.useRef)(null),z,q=function(Ye){if(D.current){var Oe=Math.ceil(Ye.touches[0].pageX),pt=Math.ceil(Ye.touches[0].pageY),Qt=Ne.current-Oe,It=Fe.current-pt,ft=Math.abs(Qt)>Math.abs(It);ft?Ne.current=Oe:Fe.current=pt;var ee=J(ft,ft?Qt:It,!1,Ye);ee&&Ye.preventDefault(),clearInterval(Je.current),ee&&(Je.current=setInterval(function(){ft?Qt*=G:It*=G;var se=Math.floor(ft?Qt:It);(!J(ft,se,!0)||Math.abs(se)<=.1)&&clearInterval(Je.current)},16))}},ie=function(){D.current=!1,z()},O=function(Ye){z(),Ye.touches.length===1&&!D.current&&(D.current=!0,Ne.current=Math.ceil(Ye.touches[0].pageX),Fe.current=Math.ceil(Ye.touches[0].pageY),ze.current=Ye.target,ze.current.addEventListener("touchmove",q,{passive:!1}),ze.current.addEventListener("touchend",ie,{passive:!0}))};z=function(){ze.current&&(ze.current.removeEventListener("touchmove",q),ze.current.removeEventListener("touchend",ie))},(0,ne.Z)(function(){return ge&&X.current.addEventListener("touchstart",O,{passive:!0}),function(){var Pe;(Pe=X.current)===null||Pe===void 0||Pe.removeEventListener("touchstart",O),z(),clearInterval(Je.current)}},[ge])}function Rt(ge){return Math.floor(Math.pow(ge,.5))}function C(ge,X){var J="touches"in ge?ge.touches[0]:ge;return J[X?"pageX":"pageY"]-window[X?"scrollX":"scrollY"]}function $(ge,X,J){M.useEffect(function(){var D=X.current;if(ge&&D){var Ne=!1,Fe,ze,Je=function(){W.Z.cancel(Fe)},z=function Pe(){Je(),Fe=(0,W.Z)(function(){J(ze),Pe()})},q=function(Ye){if(!(Ye.target.draggable||Ye.button!==0)){var Oe=Ye;Oe._virtualHandled||(Oe._virtualHandled=!0,Ne=!0)}},ie=function(){Ne=!1,Je()},O=function(Ye){if(Ne){var Oe=C(Ye,!1),pt=D.getBoundingClientRect(),Qt=pt.top,It=pt.bottom;if(Oe<=Qt){var ft=Qt-Oe;ze=-Rt(ft),z()}else if(Oe>=It){var ee=Oe-It;ze=Rt(ee),z()}else Je()}};return D.addEventListener("mousedown",q),D.ownerDocument.addEventListener("mouseup",ie),D.ownerDocument.addEventListener("mousemove",O),function(){D.removeEventListener("mousedown",q),D.ownerDocument.removeEventListener("mouseup",ie),D.ownerDocument.removeEventListener("mousemove",O),Je()}}},[ge])}var ke=10;function Le(ge,X,J,D,Ne,Fe,ze,Je){var z=M.useRef(),q=M.useState(null),ie=(0,x.Z)(q,2),O=ie[0],Pe=ie[1];return(0,ne.Z)(function(){if(O&&O.times<ke){if(!ge.current){Pe(function(Yt){return(0,ve.Z)({},Yt)});return}Fe();var Ye=O.targetAlign,Oe=O.originAlign,pt=O.index,Qt=O.offset,It=ge.current.clientHeight,ft=!1,ee=Ye,se=null;if(It){for(var Ae=Ye||Oe,Y=0,Ue=0,Tt=0,wt=Math.min(X.length-1,pt),Ke=0;Ke<=wt;Ke+=1){var Nt=Ne(X[Ke]);Ue=Y;var tn=J.get(Nt);Tt=Ue+(tn===void 0?D:tn),Y=Tt}for(var un=Ae==="top"?Qt:It-Qt,zt=wt;zt>=0;zt-=1){var Tn=Ne(X[zt]),En=J.get(Tn);if(En===void 0){ft=!0;break}if(un-=En,un<=0)break}switch(Ae){case"top":se=Ue-Qt;break;case"bottom":se=Tt-It+Qt;break;default:{var mt=ge.current.scrollTop,at=mt+It;Ue<mt?ee="top":Tt>at&&(ee="bottom")}}se!==null&&ze(se),se!==O.lastTop&&(ft=!0)}ft&&Pe((0,ve.Z)((0,ve.Z)({},O),{},{times:O.times+1,targetAlign:ee,lastTop:se}))}},[O,ge.current]),function(Ye){if(Ye==null){Je();return}if(W.Z.cancel(z.current),typeof Ye=="number")ze(Ye);else if(Ye&&(0,ye.Z)(Ye)==="object"){var Oe,pt=Ye.align;"index"in Ye?Oe=Ye.index:Oe=X.findIndex(function(ft){return Ne(ft)===Ye.key});var Qt=Ye.offset,It=Qt===void 0?0:Qt;Pe({times:0,index:Oe,offset:It,originAlign:pt})}}}var pe=M.forwardRef(function(ge,X){var J=ge.prefixCls,D=ge.rtl,Ne=ge.scrollOffset,Fe=ge.scrollRange,ze=ge.onStartMove,Je=ge.onStopMove,z=ge.onScroll,q=ge.horizontal,ie=ge.spinSize,O=ge.containerSize,Pe=ge.style,Ye=ge.thumbStyle,Oe=ge.showScrollBar,pt=M.useState(!1),Qt=(0,x.Z)(pt,2),It=Qt[0],ft=Qt[1],ee=M.useState(null),se=(0,x.Z)(ee,2),Ae=se[0],Y=se[1],Ue=M.useState(null),Tt=(0,x.Z)(Ue,2),wt=Tt[0],Ke=Tt[1],Nt=!D,tn=M.useRef(),un=M.useRef(),zt=M.useState(Oe),Tn=(0,x.Z)(zt,2),En=Tn[0],mt=Tn[1],at=M.useRef(),Yt=function(){Oe===!0||Oe===!1||(clearTimeout(at.current),mt(!0),at.current=setTimeout(function(){mt(!1)},3e3))},gt=Fe-O||0,ct=O-ie||0,Ln=M.useMemo(function(){if(Ne===0||gt===0)return 0;var g=Ne/gt;return g*ct},[Ne,gt,ct]),nn=function(E){E.stopPropagation(),E.preventDefault()},dn=M.useRef({top:Ln,dragging:It,pageY:Ae,startTop:wt});dn.current={top:Ln,dragging:It,pageY:Ae,startTop:wt};var St=function(E){ft(!0),Y(C(E,q)),Ke(dn.current.top),ze(),E.stopPropagation(),E.preventDefault()};M.useEffect(function(){var g=function(j){j.preventDefault()},E=tn.current,S=un.current;return E.addEventListener("touchstart",g,{passive:!1}),S.addEventListener("touchstart",St,{passive:!1}),function(){E.removeEventListener("touchstart",g),S.removeEventListener("touchstart",St)}},[]);var Wt=M.useRef();Wt.current=gt;var zn=M.useRef();zn.current=ct,M.useEffect(function(){if(It){var g,E=function(j){var ht=dn.current,ut=ht.dragging,_t=ht.pageY,ln=ht.startTop;W.Z.cancel(g);var _=tn.current.getBoundingClientRect(),R=O/(q?_.width:_.height);if(ut){var re=(C(j,q)-_t)*R,Q=ln;!Nt&&q?Q-=re:Q+=re;var U=Wt.current,Ee=zn.current,Re=Ee?Q/Ee:0,be=Math.ceil(Re*U);be=Math.max(be,0),be=Math.min(be,U),g=(0,W.Z)(function(){z(be,q)})}},S=function(){ft(!1),Je()};return window.addEventListener("mousemove",E,{passive:!0}),window.addEventListener("touchmove",E,{passive:!0}),window.addEventListener("mouseup",S,{passive:!0}),window.addEventListener("touchend",S,{passive:!0}),function(){window.removeEventListener("mousemove",E),window.removeEventListener("touchmove",E),window.removeEventListener("mouseup",S),window.removeEventListener("touchend",S),W.Z.cancel(g)}}},[It]),M.useEffect(function(){return Yt(),function(){clearTimeout(at.current)}},[Ne]),M.useImperativeHandle(X,function(){return{delayHidden:Yt}});var De="".concat(J,"-scrollbar"),c={position:"absolute",visibility:En?null:"hidden"},h={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return q?(c.height=8,c.left=0,c.right=0,c.bottom=0,h.height="100%",h.width=ie,Nt?h.left=Ln:h.right=Ln):(c.width=8,c.top=0,c.bottom=0,Nt?c.right=0:c.left=0,h.width="100%",h.height=ie,h.top=Ln),M.createElement("div",{ref:tn,className:ae()(De,(0,Z.Z)((0,Z.Z)((0,Z.Z)({},"".concat(De,"-horizontal"),q),"".concat(De,"-vertical"),!q),"".concat(De,"-visible"),En)),style:(0,ve.Z)((0,ve.Z)({},c),Pe),onMouseDown:nn,onMouseMove:Yt},M.createElement("div",{ref:un,className:ae()("".concat(De,"-thumb"),(0,Z.Z)({},"".concat(De,"-thumb-moving"),It)),style:(0,ve.Z)((0,ve.Z)({},h),Ye),onMouseDown:St}))}),_e=pe,et=20;function Xt(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,J=ge/X*ge;return isNaN(J)&&(J=0),J=Math.max(J,et),Math.floor(J)}var Sn=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Rn=[],Pn={overflowY:"auto",overflowAnchor:"none"};function Ot(ge,X){var J=ge.prefixCls,D=J===void 0?"rc-virtual-list":J,Ne=ge.className,Fe=ge.height,ze=ge.itemHeight,Je=ge.fullHeight,z=Je===void 0?!0:Je,q=ge.style,ie=ge.data,O=ge.children,Pe=ge.itemKey,Ye=ge.virtual,Oe=ge.direction,pt=ge.scrollWidth,Qt=ge.component,It=Qt===void 0?"div":Qt,ft=ge.onScroll,ee=ge.onVirtualScroll,se=ge.onVisibleChange,Ae=ge.innerProps,Y=ge.extraRender,Ue=ge.styles,Tt=ge.showScrollBar,wt=Tt===void 0?"optional":Tt,Ke=(0,m.Z)(ge,Sn),Nt=M.useCallback(function(ot){return typeof Pe=="function"?Pe(ot):ot==null?void 0:ot[Pe]},[Pe]),tn=ce(Nt,null,null),un=(0,x.Z)(tn,4),zt=un[0],Tn=un[1],En=un[2],mt=un[3],at=!!(Ye!==!1&&Fe&&ze),Yt=M.useMemo(function(){return Object.values(En.maps).reduce(function(ot,nt){return ot+nt},0)},[En.id,En.maps]),gt=at&&ie&&(Math.max(ze*ie.length,Yt)>Fe||!!pt),ct=Oe==="rtl",Ln=ae()(D,(0,Z.Z)({},"".concat(D,"-rtl"),ct),Ne),nn=ie||Rn,dn=(0,M.useRef)(),St=(0,M.useRef)(),Wt=(0,M.useRef)(),zn=(0,M.useState)(0),De=(0,x.Z)(zn,2),c=De[0],h=De[1],g=(0,M.useState)(0),E=(0,x.Z)(g,2),S=E[0],k=E[1],j=(0,M.useState)(!1),ht=(0,x.Z)(j,2),ut=ht[0],_t=ht[1],ln=function(){_t(!0)},_=function(){_t(!1)},R={getKey:Nt};function re(ot){h(function(nt){var Ft;typeof ot=="function"?Ft=ot(nt):Ft=ot;var Bt=qt(Ft);return dn.current.scrollTop=Bt,Bt})}var Q=(0,M.useRef)({start:0,end:nn.length}),U=(0,M.useRef)(),Ee=K(nn,Nt),Re=(0,x.Z)(Ee,1),be=Re[0];U.current=be;var We=M.useMemo(function(){if(!at)return{scrollHeight:void 0,start:0,end:nn.length-1,offset:void 0};if(!gt){var ot;return{scrollHeight:((ot=St.current)===null||ot===void 0?void 0:ot.offsetHeight)||0,start:0,end:nn.length-1,offset:void 0}}for(var nt=0,Ft,Bt,gn,Zn=nn.length,jn=0;jn<Zn;jn+=1){var Mn=nn[jn],ni=Nt(Mn),vi=En.get(ni),Ti=nt+(vi===void 0?ze:vi);Ti>=c&&Ft===void 0&&(Ft=jn,Bt=nt),Ti>c+Fe&&gn===void 0&&(gn=jn),nt=Ti}return Ft===void 0&&(Ft=0,Bt=0,gn=Math.ceil(Fe/ze)),gn===void 0&&(gn=nn.length-1),gn=Math.min(gn+1,nn.length-1),{scrollHeight:nt,start:Ft,end:gn,offset:Bt}},[gt,at,c,nn,mt,Fe]),qe=We.scrollHeight,Lt=We.start,Qe=We.end,st=We.offset;Q.current.start=Lt,Q.current.end=Qe,M.useLayoutEffect(function(){var ot=En.getRecord();if(ot.size===1){var nt=Array.from(ot.keys())[0],Ft=ot.get(nt),Bt=nn[Lt];if(Bt&&Ft===void 0){var gn=Nt(Bt);if(gn===nt){var Zn=En.get(nt),jn=Zn-ze;re(function(Mn){return Mn+jn})}}}En.resetRecord()},[qe]);var we=M.useState({width:0,height:Fe}),w=(0,x.Z)(we,2),H=w[0],te=w[1],le=function(nt){te({width:nt.offsetWidth,height:nt.offsetHeight})},Ge=(0,M.useRef)(),Ve=(0,M.useRef)(),$e=M.useMemo(function(){return Xt(H.width,pt)},[H.width,pt]),vt=M.useMemo(function(){return Xt(H.height,qe)},[H.height,qe]),Ct=qe-Fe,At=(0,M.useRef)(Ct);At.current=Ct;function qt(ot){var nt=ot;return Number.isNaN(At.current)||(nt=Math.min(nt,At.current)),nt=Math.max(nt,0),nt}var xt=c<=0,Jt=c>=Ct,$t=S<=0,rn=S>=pt,jt=Ie(xt,Jt,$t,rn),Kt=function(){return{x:ct?-S:S,y:c}},yn=(0,M.useRef)(Kt()),yt=(0,V.zX)(function(ot){if(ee){var nt=(0,ve.Z)((0,ve.Z)({},Kt()),ot);(yn.current.x!==nt.x||yn.current.y!==nt.y)&&(ee(nt),yn.current=nt)}});function Dt(ot,nt){var Ft=ot;nt?((0,N.flushSync)(function(){k(Ft)}),yt()):re(Ft)}function kt(ot){var nt=ot.currentTarget.scrollTop;nt!==c&&re(nt),ft==null||ft(ot),yt()}var mn=function(nt){var Ft=nt,Bt=pt?pt-H.width:0;return Ft=Math.max(Ft,0),Ft=Math.min(Ft,Bt),Ft},en=(0,V.zX)(function(ot,nt){nt?((0,N.flushSync)(function(){k(function(Ft){var Bt=Ft+(ct?-ot:ot);return mn(Bt)})}),yt()):re(function(Ft){var Bt=Ft+ot;return Bt})}),fn=fe(at,xt,Jt,$t,rn,!!pt,en),Cn=(0,x.Z)(fn,2),On=Cn[0],si=Cn[1];lt(at,dn,function(ot,nt,Ft,Bt){var gn=Bt;return jt(ot,nt,Ft)?!1:!gn||!gn._virtualHandled?(gn&&(gn._virtualHandled=!0),On({preventDefault:function(){},deltaX:ot?nt:0,deltaY:ot?0:nt}),!0):!1}),$(gt,dn,function(ot){re(function(nt){return nt+ot})}),(0,ne.Z)(function(){function ot(Ft){var Bt=xt&&Ft.detail<0,gn=Jt&&Ft.detail>0;at&&!Bt&&!gn&&Ft.preventDefault()}var nt=dn.current;return nt.addEventListener("wheel",On,{passive:!1}),nt.addEventListener("DOMMouseScroll",si,{passive:!0}),nt.addEventListener("MozMousePixelScroll",ot,{passive:!1}),function(){nt.removeEventListener("wheel",On),nt.removeEventListener("DOMMouseScroll",si),nt.removeEventListener("MozMousePixelScroll",ot)}},[at,xt,Jt]),(0,ne.Z)(function(){if(pt){var ot=mn(S);k(ot),yt({x:ot})}},[H.width,pt]);var Fn=function(){var nt,Ft;(nt=Ge.current)===null||nt===void 0||nt.delayHidden(),(Ft=Ve.current)===null||Ft===void 0||Ft.delayHidden()},Bn=Le(dn,nn,En,ze,Nt,function(){return Tn(!0)},re,Fn);M.useImperativeHandle(X,function(){return{nativeElement:Wt.current,getScrollInfo:Kt,scrollTo:function(nt){function Ft(Bt){return Bt&&(0,ye.Z)(Bt)==="object"&&("left"in Bt||"top"in Bt)}Ft(nt)?(nt.left!==void 0&&k(mn(nt.left)),Bn(nt.top)):Bn(nt)}}}),(0,ne.Z)(function(){if(se){var ot=nn.slice(Lt,Qe+1);se(ot,nn)}},[Lt,Qe,nn]);var Yn=Be(nn,Nt,En,ze),ti=Y==null?void 0:Y({start:Lt,end:Qe,virtual:gt,offsetX:S,offsetY:st,rtl:ct,getSize:Yn}),qn=bt(nn,Lt,Qe,pt,S,zt,O,R),$n=null;Fe&&($n=(0,ve.Z)((0,Z.Z)({},z?"height":"maxHeight",Fe),Pn),at&&($n.overflowY="hidden",pt&&($n.overflowX="hidden"),ut&&($n.pointerEvents="none")));var cn={};return ct&&(cn.dir="rtl"),M.createElement("div",(0,A.Z)({ref:Wt,style:(0,ve.Z)((0,ve.Z)({},q),{},{position:"relative"}),className:Ln},cn,Ke),M.createElement(Ze.Z,{onResize:le},M.createElement(It,{className:"".concat(D,"-holder"),style:$n,ref:dn,onScroll:kt,onMouseEnter:Fn},M.createElement(hn,{prefixCls:D,height:qe,offsetX:S,offsetY:st,scrollWidth:pt,onInnerResize:Tn,ref:St,innerProps:Ae,rtl:ct,extra:ti},qn))),gt&&qe>Fe&&M.createElement(_e,{ref:Ge,prefixCls:D,scrollOffset:c,scrollRange:qe,rtl:ct,onScroll:Dt,onStartMove:ln,onStopMove:_,spinSize:vt,containerSize:H.height,style:Ue==null?void 0:Ue.verticalScrollBar,thumbStyle:Ue==null?void 0:Ue.verticalScrollBarThumb,showScrollBar:wt}),gt&&pt>H.width&&M.createElement(_e,{ref:Ve,prefixCls:D,scrollOffset:S,scrollRange:pt,rtl:ct,onScroll:Dt,onStartMove:ln,onStopMove:_,spinSize:$e,containerSize:H.width,horizontal:!0,style:Ue==null?void 0:Ue.horizontalScrollBar,thumbStyle:Ue==null?void 0:Ue.horizontalScrollBarThumb,showScrollBar:wt}))}var on=M.forwardRef(Ot);on.displayName="List";var rt=on,Nn=rt},83145:function(Qn,pn,L){"use strict";Object.defineProperty(pn,"__esModule",{value:!0}),pn.CopyToClipboard=void 0;var A=ve(L(59301)),ye=ve(L(25769));function ve(oe){return oe&&oe.__esModule?oe:{default:oe}}function Z(oe){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Z=function(W){return typeof W}:Z=function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},Z(oe)}function x(oe,K){var W=Object.keys(oe);if(Object.getOwnPropertySymbols){var Se=Object.getOwnPropertySymbols(oe);K&&(Se=Se.filter(function(He){return Object.getOwnPropertyDescriptor(oe,He).enumerable})),W.push.apply(W,Se)}return W}function m(oe){for(var K=1;K<arguments.length;K++){var W=arguments[K]!=null?arguments[K]:{};K%2?x(W,!0).forEach(function(Se){bt(oe,Se,W[Se])}):Object.getOwnPropertyDescriptors?Object.defineProperties(oe,Object.getOwnPropertyDescriptors(W)):x(W).forEach(function(Se){Object.defineProperty(oe,Se,Object.getOwnPropertyDescriptor(W,Se))})}return oe}function Xe(oe,K){if(oe==null)return{};var W=ae(oe,K),Se,He;if(Object.getOwnPropertySymbols){var Ie=Object.getOwnPropertySymbols(oe);for(He=0;He<Ie.length;He++)Se=Ie[He],!(K.indexOf(Se)>=0)&&Object.prototype.propertyIsEnumerable.call(oe,Se)&&(W[Se]=oe[Se])}return W}function ae(oe,K){if(oe==null)return{};var W={},Se=Object.keys(oe),He,Ie;for(Ie=0;Ie<Se.length;Ie++)He=Se[Ie],!(K.indexOf(He)>=0)&&(W[He]=oe[He]);return W}function Ze(oe,K){if(!(oe instanceof K))throw new TypeError("Cannot call a class as a function")}function V(oe,K){for(var W=0;W<K.length;W++){var Se=K[W];Se.enumerable=Se.enumerable||!1,Se.configurable=!0,"value"in Se&&(Se.writable=!0),Object.defineProperty(oe,Se.key,Se)}}function ne(oe,K,W){return K&&V(oe.prototype,K),W&&V(oe,W),oe}function M(oe,K){return K&&(Z(K)==="object"||typeof K=="function")?K:de(oe)}function N(oe){return N=Object.setPrototypeOf?Object.getPrototypeOf:function(W){return W.__proto__||Object.getPrototypeOf(W)},N(oe)}function de(oe){if(oe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return oe}function hn(oe,K){if(typeof K!="function"&&K!==null)throw new TypeError("Super expression must either be null or a function");oe.prototype=Object.create(K&&K.prototype,{constructor:{value:oe,writable:!0,configurable:!0}}),K&&Pt(oe,K)}function Pt(oe,K){return Pt=Object.setPrototypeOf||function(Se,He){return Se.__proto__=He,Se},Pt(oe,K)}function bt(oe,K,W){return K in oe?Object.defineProperty(oe,K,{value:W,enumerable:!0,configurable:!0,writable:!0}):oe[K]=W,oe}var Et=function(oe){hn(K,oe);function K(){var W,Se;Ze(this,K);for(var He=arguments.length,Ie=new Array(He),fe=0;fe<He;fe++)Ie[fe]=arguments[fe];return Se=M(this,(W=N(K)).call.apply(W,[this].concat(Ie))),bt(de(Se),"onClick",function(Be){var Vt=Se.props,dt=Vt.text,Zt=Vt.onCopy,Ce=Vt.children,F=Vt.options,ce=A.default.Children.only(Ce),G=(0,ye.default)(dt,F);Zt&&Zt(dt,G),ce&&ce.props&&typeof ce.props.onClick=="function"&&ce.props.onClick(Be)}),Se}return ne(K,[{key:"render",value:function(){var Se=this.props,He=Se.text,Ie=Se.onCopy,fe=Se.options,Be=Se.children,Vt=Xe(Se,["text","onCopy","options","children"]),dt=A.default.Children.only(Be);return A.default.cloneElement(dt,m({},Vt,{onClick:this.onClick}))}}]),K}(A.default.PureComponent);pn.CopyToClipboard=Et,bt(Et,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(Qn,pn,L){"use strict";var A=L(83145),ye=A.CopyToClipboard;ye.CopyToClipboard=ye,Qn.exports=ye},76374:function(Qn,pn,L){"use strict";var A=function(){if(typeof Map!="undefined")return Map;function Ce(F,ce){var G=-1;return F.some(function(lt,Rt){return lt[0]===ce?(G=Rt,!0):!1}),G}return function(){function F(){this.__entries__=[]}return Object.defineProperty(F.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),F.prototype.get=function(ce){var G=Ce(this.__entries__,ce),lt=this.__entries__[G];return lt&<[1]},F.prototype.set=function(ce,G){var lt=Ce(this.__entries__,ce);~lt?this.__entries__[lt][1]=G:this.__entries__.push([ce,G])},F.prototype.delete=function(ce){var G=this.__entries__,lt=Ce(G,ce);~lt&&G.splice(lt,1)},F.prototype.has=function(ce){return!!~Ce(this.__entries__,ce)},F.prototype.clear=function(){this.__entries__.splice(0)},F.prototype.forEach=function(ce,G){G===void 0&&(G=null);for(var lt=0,Rt=this.__entries__;lt<Rt.length;lt++){var C=Rt[lt];ce.call(G,C[1],C[0])}},F}()}(),ye=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,ve=function(){return typeof L.g!="undefined"&&L.g.Math===Math?L.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),Z=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ve):function(Ce){return setTimeout(function(){return Ce(Date.now())},1e3/60)}}(),x=2;function m(Ce,F){var ce=!1,G=!1,lt=0;function Rt(){ce&&(ce=!1,Ce()),G&&$()}function C(){Z(Rt)}function $(){var ke=Date.now();if(ce){if(ke-lt<x)return;G=!0}else ce=!0,G=!1,setTimeout(C,F);lt=ke}return $}var Xe=20,ae=["top","right","bottom","left","width","height","size","weight"],Ze=typeof MutationObserver!="undefined",V=function(){function Ce(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=m(this.refresh.bind(this),Xe)}return Ce.prototype.addObserver=function(F){~this.observers_.indexOf(F)||this.observers_.push(F),this.connected_||this.connect_()},Ce.prototype.removeObserver=function(F){var ce=this.observers_,G=ce.indexOf(F);~G&&ce.splice(G,1),!ce.length&&this.connected_&&this.disconnect_()},Ce.prototype.refresh=function(){var F=this.updateObservers_();F&&this.refresh()},Ce.prototype.updateObservers_=function(){var F=this.observers_.filter(function(ce){return ce.gatherActive(),ce.hasActive()});return F.forEach(function(ce){return ce.broadcastActive()}),F.length>0},Ce.prototype.connect_=function(){!ye||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ze?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},Ce.prototype.disconnect_=function(){!ye||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},Ce.prototype.onTransitionEnd_=function(F){var ce=F.propertyName,G=ce===void 0?"":ce,lt=ae.some(function(Rt){return!!~G.indexOf(Rt)});lt&&this.refresh()},Ce.getInstance=function(){return this.instance_||(this.instance_=new Ce),this.instance_},Ce.instance_=null,Ce}(),ne=function(Ce,F){for(var ce=0,G=Object.keys(F);ce<G.length;ce++){var lt=G[ce];Object.defineProperty(Ce,lt,{value:F[lt],enumerable:!1,writable:!1,configurable:!0})}return Ce},M=function(Ce){var F=Ce&&Ce.ownerDocument&&Ce.ownerDocument.defaultView;return F||ve},N=He(0,0,0,0);function de(Ce){return parseFloat(Ce)||0}function hn(Ce){for(var F=[],ce=1;ce<arguments.length;ce++)F[ce-1]=arguments[ce];return F.reduce(function(G,lt){var Rt=Ce["border-"+lt+"-width"];return G+de(Rt)},0)}function Pt(Ce){for(var F=["top","right","bottom","left"],ce={},G=0,lt=F;G<lt.length;G++){var Rt=lt[G],C=Ce["padding-"+Rt];ce[Rt]=de(C)}return ce}function bt(Ce){var F=Ce.getBBox();return He(0,0,F.width,F.height)}function Et(Ce){var F=Ce.clientWidth,ce=Ce.clientHeight;if(!F&&!ce)return N;var G=M(Ce).getComputedStyle(Ce),lt=Pt(G),Rt=lt.left+lt.right,C=lt.top+lt.bottom,$=de(G.width),ke=de(G.height);if(G.boxSizing==="border-box"&&(Math.round($+Rt)!==F&&($-=hn(G,"left","right")+Rt),Math.round(ke+C)!==ce&&(ke-=hn(G,"top","bottom")+C)),!K(Ce)){var Le=Math.round($+Rt)-F,pe=Math.round(ke+C)-ce;Math.abs(Le)!==1&&($-=Le),Math.abs(pe)!==1&&(ke-=pe)}return He(lt.left,lt.top,$,ke)}var oe=function(){return typeof SVGGraphicsElement!="undefined"?function(Ce){return Ce instanceof M(Ce).SVGGraphicsElement}:function(Ce){return Ce instanceof M(Ce).SVGElement&&typeof Ce.getBBox=="function"}}();function K(Ce){return Ce===M(Ce).document.documentElement}function W(Ce){return ye?oe(Ce)?bt(Ce):Et(Ce):N}function Se(Ce){var F=Ce.x,ce=Ce.y,G=Ce.width,lt=Ce.height,Rt=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,C=Object.create(Rt.prototype);return ne(C,{x:F,y:ce,width:G,height:lt,top:ce,right:F+G,bottom:lt+ce,left:F}),C}function He(Ce,F,ce,G){return{x:Ce,y:F,width:ce,height:G}}var Ie=function(){function Ce(F){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=He(0,0,0,0),this.target=F}return Ce.prototype.isActive=function(){var F=W(this.target);return this.contentRect_=F,F.width!==this.broadcastWidth||F.height!==this.broadcastHeight},Ce.prototype.broadcastRect=function(){var F=this.contentRect_;return this.broadcastWidth=F.width,this.broadcastHeight=F.height,F},Ce}(),fe=function(){function Ce(F,ce){var G=Se(ce);ne(this,{target:F,contentRect:G})}return Ce}(),Be=function(){function Ce(F,ce,G){if(this.activeObservations_=[],this.observations_=new A,typeof F!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=F,this.controller_=ce,this.callbackCtx_=G}return Ce.prototype.observe=function(F){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(F instanceof M(F).Element))throw new TypeError('parameter 1 is not of type "Element".');var ce=this.observations_;ce.has(F)||(ce.set(F,new Ie(F)),this.controller_.addObserver(this),this.controller_.refresh())}},Ce.prototype.unobserve=function(F){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(F instanceof M(F).Element))throw new TypeError('parameter 1 is not of type "Element".');var ce=this.observations_;ce.has(F)&&(ce.delete(F),ce.size||this.controller_.removeObserver(this))}},Ce.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Ce.prototype.gatherActive=function(){var F=this;this.clearActive(),this.observations_.forEach(function(ce){ce.isActive()&&F.activeObservations_.push(ce)})},Ce.prototype.broadcastActive=function(){if(this.hasActive()){var F=this.callbackCtx_,ce=this.activeObservations_.map(function(G){return new fe(G.target,G.broadcastRect())});this.callback_.call(F,ce,F),this.clearActive()}},Ce.prototype.clearActive=function(){this.activeObservations_.splice(0)},Ce.prototype.hasActive=function(){return this.activeObservations_.length>0},Ce}(),Vt=typeof WeakMap!="undefined"?new WeakMap:new A,dt=function(){function Ce(F){if(!(this instanceof Ce))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var ce=V.getInstance(),G=new Be(F,ce,this);Vt.set(this,G)}return Ce}();["observe","unobserve","disconnect"].forEach(function(Ce){dt.prototype[Ce]=function(){var F;return(F=Vt.get(this))[Ce].apply(F,arguments)}});var Zt=function(){return typeof ve.ResizeObserver!="undefined"?ve.ResizeObserver:dt}();pn.Z=Zt},98040:function(Qn){Qn.exports=function(){var pn=document.getSelection();if(!pn.rangeCount)return function(){};for(var L=document.activeElement,A=[],ye=0;ye<pn.rangeCount;ye++)A.push(pn.getRangeAt(ye));switch(L.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":L.blur();break;default:L=null;break}return pn.removeAllRanges(),function(){pn.type==="Caret"&&pn.removeAllRanges(),pn.rangeCount||A.forEach(function(ve){pn.addRange(ve)}),L&&L.focus()}}},82059:function(Qn){var pn=arguments[3],L=arguments[4],A=arguments[5],ye=JSON.stringify;Qn.exports=function(ve,Z){for(var x,m=Object.keys(A),Xe=0,ae=m.length;Xe<ae;Xe++){var Ze=m[Xe],V=A[Ze].exports;if(V===ve||V&&V.default===ve){x=Ze;break}}if(!x){x=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var ne={},Xe=0,ae=m.length;Xe<ae;Xe++){var Ze=m[Xe];ne[Ze]=Ze}L[x]=["function(require,module,exports){"+ve+"(self); }",ne]}var M=Math.floor(Math.pow(16,8)*Math.random()).toString(16),N={};N[x]=x,L[M]=["function(require,module,exports){var f = require("+ye(x)+");(f.default ? f.default : f)(self);}",N];var de={};hn(M);function hn(W){de[W]=!0;for(var Se in L[W][1]){var He=L[W][1][Se];de[He]||hn(He)}}var Pt="("+pn+")({"+Object.keys(de).map(function(W){return ye(W)+":["+L[W][0]+","+ye(L[W][1])+"]"}).join(",")+"},{},["+ye(M)+"])",bt=window.URL||window.webkitURL||window.mozURL||window.msURL,Et=new Blob([Pt],{type:"text/javascript"});if(Z&&Z.bare)return Et;var oe=bt.createObjectURL(Et),K=new Worker(oe);return K.objectURL=oe,K}},93314:function(Qn){"use strict";Qn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXN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Pe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},55988:function(Qn){"use strict";Qn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR0AAACgCAYAAAAxSbhkAAAgAElEQVR4Xuy9B5hsVZk2+lYOnfv0yTknzgEEVAxIUMEEAqYB559RzDPoJOeZ3zA6zqhXMTCDIsJcAyrgjERBQbIgqKDkeHLu031O5+7KVfd5v7XfqtX7VHczhvv73OfWec5T1bt27b32Wt96v/cL61sRTPM655xzFtXytbNq5cobiuXy5lqt2hOJRFORCBCNRBGNxRCLRVGtVlGr1oBIBMlkEolEAsl0GtFoFJFIxP7rVf+7FrVD+s4/j5+rwU/87/3zeW3/mv534c/he/vtCbdB5+r6tVqtfp+pPoevxx+k0lkcHjyEn993BwYG+hBPRBGLJlCt8pljSCRiyOfziMViaGtrw9jYGIrFIiYmJjBr1ix0d/dg9uzZWLp0KZYtW4bly5fb57lz5yKbzaJcqVi72KZKpYJyuWzv/Jvticdidr158+bh6aefxvnnn49Dhw7Z73O5HGKxiJ3LseNLY6Vn5LXC48dzeZzv/FmpVLL/fKXTaXR2dqKrqwstLS3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lvPfOxufsnF7o7b6Tl//pCcbC62UgbJQc9wpCQ9EoBtzrFLfPsSsL/2sXfocyr2brddhtvHYLa/15P8Vk5Oui9+172oOSDJUlcvDb99ETy850DumAH5r1CTtBTJXgpQwFf0AgZpnouSVgBwbwArLfBZ6N/N5K+W+vx6gX+zOr8m+Yd5Pvj/z1sBBz3v8XHvXIEkCjjoSWR0I65A3go46HmPj3vnCiRRwEFPIqMbcQXyVsBBz3t83DtXIIkCDnoSGd2IK5C3Ag563uPj3rkCSRRw0JPI6EZcgbwVcNDzHh/3zhVIooCDnkRGN+IK5K3A/wKcox5kctBougAAAABJRU5ErkJggg=="},79710:function(Qn,pn,L){"use strict";L.d(pn,{ZP:function(){return Br}});const A=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},ye=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=ve},ve=Number.MAX_SAFE_INTEGER||9007199254740991;let Z=function(a){return a.NETWORK_ERROR="networkError",a.MEDIA_ERROR="mediaError",a.KEY_SYSTEM_ERROR="keySystemError",a.MUX_ERROR="muxError",a.OTHER_ERROR="otherError",a}({}),x=function(a){return a.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",a.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",a.KEY_SYSTEM_NO_SESSION="keySystemNoSession",a.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",a.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",a.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",a.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",a.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",a.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",a.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",a.MANIFEST_LOAD_ERROR="manifestLoadError",a.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",a.MANIFEST_PARSING_ERROR="manifestParsingError",a.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",a.LEVEL_EMPTY_ERROR="levelEmptyError",a.LEVEL_LOAD_ERROR="levelLoadError",a.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",a.LEVEL_PARSING_ERROR="levelParsingError",a.LEVEL_SWITCH_ERROR="levelSwitchError",a.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",a.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",a.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",a.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",a.FRAG_LOAD_ERROR="fragLoadError",a.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",a.FRAG_DECRYPT_ERROR="fragDecryptError",a.FRAG_PARSING_ERROR="fragParsingError",a.FRAG_GAP="fragGap",a.REMUX_ALLOC_ERROR="remuxAllocError",a.KEY_LOAD_ERROR="keyLoadError",a.KEY_LOAD_TIMEOUT="keyLoadTimeOut",a.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",a.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",a.BUFFER_APPEND_ERROR="bufferAppendError",a.BUFFER_APPENDING_ERROR="bufferAppendingError",a.BUFFER_STALLED_ERROR="bufferStalledError",a.BUFFER_FULL_ERROR="bufferFullError",a.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",a.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",a.ASSET_LIST_LOAD_ERROR="assetListLoadError",a.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",a.ASSET_LIST_PARSING_ERROR="assetListParsingError",a.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",a.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.ATTACH_MEDIA_ERROR="attachMediaError",a.UNKNOWN="unknown",a}({}),m=function(a){return a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",a.MEDIA_ENDED="hlsMediaEnded",a.STALL_RESOLVED="hlsStallResolved",a.BUFFER_RESET="hlsBufferReset",a.BUFFER_CODECS="hlsBufferCodecs",a.BUFFER_CREATED="hlsBufferCreated",a.BUFFER_APPENDING="hlsBufferAppending",a.BUFFER_APPENDED="hlsBufferAppended",a.BUFFER_EOS="hlsBufferEos",a.BUFFERED_TO_END="hlsBufferedToEnd",a.BUFFER_FLUSHING="hlsBufferFlushing",a.BUFFER_FLUSHED="hlsBufferFlushed",a.MANIFEST_LOADING="hlsManifestLoading",a.MANIFEST_LOADED="hlsManifestLoaded",a.MANIFEST_PARSED="hlsManifestParsed",a.LEVEL_SWITCHING="hlsLevelSwitching",a.LEVEL_SWITCHED="hlsLevelSwitched",a.LEVEL_LOADING="hlsLevelLoading",a.LEVEL_LOADED="hlsLevelLoaded",a.LEVEL_UPDATED="hlsLevelUpdated",a.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",a.LEVELS_UPDATED="hlsLevelsUpdated",a.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",a.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",a.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",a.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",a.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",a.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",a.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",a.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",a.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",a.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",a.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",a.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",a.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",a.CUES_PARSED="hlsCuesParsed",a.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",a.INIT_PTS_FOUND="hlsInitPtsFound",a.FRAG_LOADING="hlsFragLoading",a.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",a.FRAG_LOADED="hlsFragLoaded",a.FRAG_DECRYPTED="hlsFragDecrypted",a.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",a.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",a.FRAG_PARSING_METADATA="hlsFragParsingMetadata",a.FRAG_PARSED="hlsFragParsed",a.FRAG_BUFFERED="hlsFragBuffered",a.FRAG_CHANGED="hlsFragChanged",a.FPS_DROP="hlsFpsDrop",a.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",a.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",a.ERROR="hlsError",a.DESTROYING="hlsDestroying",a.KEY_LOADING="hlsKeyLoading",a.KEY_LOADED="hlsKeyLoaded",a.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",a.BACK_BUFFER_REACHED="hlsBackBufferReached",a.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",a.ASSET_LIST_LOADING="hlsAssetListLoading",a.ASSET_LIST_LOADED="hlsAssetListLoaded",a.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",a.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",a.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",a.INTERSTITIAL_STARTED="hlsInterstitialStarted",a.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",a.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",a.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",a.INTERSTITIAL_ENDED="hlsInterstitialEnded",a.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",a.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",a.EVENT_CUE_ENTER="hlsEventCueEnter",a}({});var Xe={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},ae={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class Ze{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class V{constructor(e,t,n,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Ze(e),this.fast_=new Ze(t),this.defaultTTFB_=i,this.ttfb_=new Ze(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new Ze(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Ze(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new Ze(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,i=e/1e3,r=n/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function ne(a,e,t){return(e=Pt(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function M(){return M=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},M.apply(null,arguments)}function N(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,n)}return t}function de(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?N(Object(t),!0).forEach(function(n){ne(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):N(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function hn(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function Pt(a){var e=hn(a,"string");return typeof e=="symbol"?e:e+""}class bt{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=Et,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}}const Et=function(){},oe={trace:Et,debug:Et,log:Et,warn:Et,info:Et,error:Et};function K(){return M({},oe)}function W(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):Et}function Se(a,e,t){return e[a]?e[a].bind(e):W(a,t)}const He=K();function Ie(a,e,t){const n=K();if(typeof console=="object"&&a===!0||typeof a=="object"){const i=["debug","log","info","warn","error"];i.forEach(r=>{n[r]=Se(r,a,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.2`)}catch(r){return K()}i.forEach(r=>{He[r]=Se(r,a)})}else M(He,n);return n}const fe=He;function Be(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Vt(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function dt(a,e){const t=Object.keys(a),n=Object.keys(e),i=t.length,r=n.length;return!i||!r||i===r&&!t.some(s=>n.indexOf(s)===-1)}function Zt(a,e=!1){if(typeof TextDecoder!="undefined"){const l=new TextDecoder("utf-8").decode(a);if(e){const d=l.indexOf("\0");return d!==-1?l.substring(0,d):l}return l.replace(/\0/g,"")}const t=a.length;let n,i,r,s="",o=0;for(;o<t;){if(n=a[o++],n===0&&e)return s;if(n===0||n===3)continue;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(n);break;case 12:case 13:i=a[o++],s+=String.fromCharCode((n&31)<<6|i&63);break;case 14:i=a[o++],r=a[o++],s+=String.fromCharCode((n&15)<<12|(i&63)<<6|(r&63)<<0);break}}return s}const Ce={hexDump:function(a){let e="";for(let t=0;t<a.length;t++){let n=a[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}};function F(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var ce={exports:{}},G;function lt(){return G||(G=1,function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(u,l,d){if(d=d||{},u=u.trim(),l=l.trim(),!l){if(!d.alwaysNormalize)return u;var f=o.parseURL(u);if(!f)throw new Error("Error trying to parse base URL.");return f.path=o.normalizePath(f.path),o.buildURLFromParts(f)}var v=o.parseURL(l);if(!v)throw new Error("Error trying to parse relative URL.");if(v.scheme)return d.alwaysNormalize?(v.path=o.normalizePath(v.path),o.buildURLFromParts(v)):l;var p=o.parseURL(u);if(!p)throw new Error("Error trying to parse base URL.");if(!p.netLoc&&p.path&&p.path[0]!=="/"){var y=i.exec(p.path);p.netLoc=y[1],p.path=y[2]}p.netLoc&&!p.path&&(p.path="/");var T={scheme:p.scheme,netLoc:v.netLoc,path:null,params:v.params,query:v.query,fragment:v.fragment};if(!v.netLoc&&(T.netLoc=p.netLoc,v.path[0]!=="/"))if(!v.path)T.path=p.path,v.params||(T.params=p.params,v.query||(T.query=p.query));else{var b=p.path,I=b.substring(0,b.lastIndexOf("/")+1)+v.path;T.path=o.normalizePath(I)}return T.path===null&&(T.path=d.alwaysNormalize?o.normalizePath(v.path):v.path),o.buildURLFromParts(T)},parseURL:function(u){var l=n.exec(u);return l?{scheme:l[1]||"",netLoc:l[2]||"",path:l[3]||"",params:l[4]||"",query:l[5]||"",fragment:l[6]||""}:null},normalizePath:function(u){for(u=u.split("").reverse().join("").replace(r,"");u.length!==(u=u.replace(s,"")).length;);return u.split("").reverse().join("")},buildURLFromParts:function(u){return u.scheme+u.netLoc+u.path+u.params+u.query+u.fragment}};a.exports=o})()}(ce)),ce.exports}var Rt=lt();class C{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var $={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class ke{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,Xt(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let i;n.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+i]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[$.AUDIO]:null,[$.VIDEO]:null,[$.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new C),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Rt.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[$.AUDIO]=null,e[$.VIDEO]=null,e[$.AUDIOVIDEO]=null}}function Le(a){return a.sn!=="initSegment"}class pe extends ke{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange){const e=this.byteRange[0],t=this.byteRange[1];if(A(e)&&A(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const n=Object.keys(this.levelkeys);if(n.length===1)return this._decryptdata=this.levelkeys[n[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=A(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),n=t.length;if(n>1||n===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!A(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return Le(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,i,r,s=!1){const{elementaryStreams:o}=this,u=o[e];if(!u){o[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:s};return}u.startPTS=Math.min(u.startPTS,t),u.endPTS=Math.max(u.endPTS,n),u.startDTS=Math.min(u.startDTS,i),u.endDTS=Math.max(u.endDTS,r)}}class _e extends ke{constructor(e,t,n,i,r){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function et(a,e){const t=Object.getPrototypeOf(a);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||et(t,e)}}function Xt(a,e){const t=et(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const Sn=Math.pow(2,32)-1,Rn=[].push,Pn={video:1,audio:2,id3:3,text:4};function Ot(a){return String.fromCharCode.apply(null,a)}function on(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function rt(a,e){const t=ge(a,e);return t<0?4294967296+t:t}function Nn(a,e){let t=rt(a,e);return t*=Math.pow(2,32),t+=rt(a,e+4),t}function ge(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function X(a,e,t){a[e]=t>>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function J(a){const e=a.byteLength;for(let t=0;t<e;){const n=rt(a,t);if(n>8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=n>1?t+n:e}return!1}function D(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let i=0;i<n;){const r=rt(a,i),s=Ot(a.subarray(i+4,i+8)),o=r>1?i+r:n;if(s===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const u=D(a.subarray(i+8,o),e.slice(1));u.length&&Rn.apply(t,u)}i=o}return t}function Ne(a){const e=[],t=a[0];let n=8;const i=rt(a,n);n+=4;let r=0,s=0;t===0?(r=rt(a,n),s=rt(a,n+4),n+=8):(r=Nn(a,n),s=Nn(a,n+8),n+=16),n+=2;let o=a.length+s;const u=on(a,n);n+=2;for(let l=0;l<u;l++){let d=n;const f=rt(a,d);d+=4;const v=f&2147483647;if((f&2147483648)>>>31===1)return fe.warn("SIDX has hierarchical references (not supported)"),null;const y=rt(a,d);d+=4,e.push({referenceSize:v,subsegmentDuration:y,info:{duration:y/i,start:o,end:o+v-1}}),o+=v,d+=4,n=d}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:u,references:e}}function Fe(a){const e=[],t=D(a,["moov","trak"]);for(let i=0;i<t.length;i++){const r=t[i],s=D(r,["tkhd"])[0];if(s){let o=s[0];const u=rt(s,o===0?12:20),l=D(r,["mdia","mdhd"])[0];if(l){o=l[0];const d=rt(l,o===0?12:20),f=D(r,["mdia","hdlr"])[0];if(f){const v=Ot(f.subarray(8,12)),p={soun:$.AUDIO,vide:$.VIDEO}[v],y=D(r,["mdia","minf","stbl","stsd"])[0],T=ze(y);p?(e[u]={timescale:d,type:p,stsd:T},e[p]=de({timescale:d,id:u},T)):e[u]={timescale:d,type:v,stsd:T}}}}}return D(a,["moov","mvex","trex"]).forEach(i=>{const r=rt(i,4),s=e[r];s&&(s.default={duration:rt(i,12),flags:rt(i,20)})}),e}function ze(a){const e=a.subarray(8),t=e.subarray(86),n=Ot(e.subarray(4,8));let i=n,r;const s=n==="enca"||n==="encv";if(s){const l=D(e,[n])[0].subarray(n==="enca"?28:78);D(l,["sinf"]).forEach(f=>{const v=D(f,["schm"])[0];if(v){const p=Ot(v.subarray(4,8));if(p==="cbcs"||p==="cenc"){const y=D(f,["frma"])[0];y&&(i=Ot(y))}}})}const o=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const u=D(t,["avcC"])[0];u&&u.length>3&&(i+="."+q(u[1])+q(u[2])+q(u[3]),r=Je(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const u=D(e,[n])[0],l=D(u.subarray(28),["esds"])[0];if(l&&l.length>7){let d=4;if(l[d++]!==3)break;d=z(l,d),d+=2;const f=l[d++];if(f&128&&(d+=2),f&64&&(d+=l[d++]),l[d++]!==4)break;d=z(l,d);const v=l[d++];if(v===64)i+="."+q(v);else break;if(d+=12,l[d++]!==5)break;d=z(l,d);const p=l[d++];let y=(p&248)>>3;y===31&&(y+=1+((p&7)<<3)+((l[d]&224)>>5)),i+="."+y}break}case"hvc1":case"hev1":{const u=D(t,["hvcC"])[0];if(u&&u.length>12){const l=u[1],d=["","A","B","C"][l>>6],f=l&31,v=rt(u,2),p=(l&32)>>5?"H":"L",y=u[12],T=u.subarray(6,12);i+="."+d+f,i+="."+v.toString(16).toUpperCase(),i+="."+p+y;let b="";for(let I=T.length;I--;){const B=T[I];(B||b)&&(b="."+B.toString(16).toUpperCase()+b)}i+=b}r=Je(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=Je(i,t)||i;break}case"vp09":{const u=D(t,["vpcC"])[0];if(u&&u.length>6){const l=u[4],d=u[5],f=u[6]>>4&15;i+="."+ie(l)+"."+ie(d)+"."+ie(f)}break}case"av01":{const u=D(t,["av1C"])[0];if(u&&u.length>2){const l=u[1]>>>5,d=u[1]&31,f=u[2]>>>7?"H":"M",v=(u[2]&64)>>6,p=(u[2]&32)>>5,y=l===2&&v?p?12:10:v?10:8,T=(u[2]&16)>>4,b=(u[2]&8)>>3,I=(u[2]&4)>>2,B=u[2]&3;i+="."+l+"."+ie(d)+f+"."+ie(y)+"."+T+"."+b+I+B+"."+ie(1)+"."+ie(1)+"."+ie(1)+"."+0,r=Je("dav1",t)}break}}return{codec:i,encrypted:s,supplemental:r}}function Je(a,e){const t=D(e,["dvvC"]),n=t.length?t[0]:D(e,["dvcC"])[0];if(n){const i=n[2]>>1&127,r=n[2]<<5&32|n[3]>>3&31;return a+"."+ie(i)+"."+ie(r)}}function z(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function q(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function ie(a){return(a<10?"0":"")+a}function O(a,e){if(!a||!e)return a;const t=e.keyId;return t&&e.isCommonEncryption&&D(a,["moov","trak"]).forEach(i=>{const s=D(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=D(s,["enca"]);const u=o.length>0;u||(o=D(s,["encv"])),o.forEach(l=>{const d=u?l.subarray(28):l.subarray(78);D(d,["sinf"]).forEach(v=>{const p=Pe(v);if(p){const y=p.subarray(8,24);y.some(T=>T!==0)||(fe.log(`[eme] Patching keyId in 'enc${u?"a":"v"}>sinf>>tenc' box: ${Ce.hexDump(y)} -> ${Ce.hexDump(t)}`),p.set(t,8))}})})}),a}function Pe(a){const e=D(a,["schm"])[0];if(e){const t=Ot(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return D(a,["schi","tenc"])[0]}return null}function Ye(a,e){return D(e,["moof","traf"]).reduce((t,n)=>{const i=D(n,["tfdt"])[0],r=i[0],s=D(n,["tfhd"]).reduce((o,u)=>{const l=rt(u,4),d=a[l];if(d){let f=rt(i,4);if(r===1){if(f===Sn)return fe.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;f*=Sn+1,f+=rt(i,8)}const v=d.timescale||9e4,p=f/v;if(A(p)&&(o===null||p<o))return p}return o},null);return s!==null&&A(s)&&(t===null||s<t)?s:t},null)}function Oe(a,e){let t=0,n=0,i=0;const r=D(a,["moof","traf"]);for(let s=0;s<r.length;s++){const o=r[s],u=D(o,["tfhd"])[0],l=rt(u,4),d=e[l];if(!d)continue;const f=d.default,v=rt(u,0)|(f==null?void 0:f.flags);let p=f==null?void 0:f.duration;v&8&&(v&2?p=rt(u,12):p=rt(u,8));const y=d.timescale||9e4,T=D(o,["trun"]);for(let b=0;b<T.length;b++){if(t=pt(T[b]),!t&&p){const I=rt(T[b],4);t=p*I}d.type===$.VIDEO?n+=t/y:d.type===$.AUDIO&&(i+=t/y)}}if(n===0&&i===0){let s=1/0,o=0,u=0;const l=D(a,["sidx"]);for(let d=0;d<l.length;d++){const f=Ne(l[d]);if(f!=null&&f.references){s=Math.min(s,f.earliestPresentationTime/f.timescale);const v=f.references.reduce((p,y)=>p+y.info.duration||0,0);o=Math.max(o,v+f.earliestPresentationTime/f.timescale),u=o-s}}if(u&&A(u))return u}return n||i}function pt(a){const e=rt(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const i=rt(a,4);for(let r=0;r<i;r++){if(e&256){const s=rt(a,t);n+=s,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return n}function Qt(a,e,t){D(e,["moof","traf"]).forEach(n=>{D(n,["tfhd"]).forEach(i=>{const r=rt(i,4),s=a[r];if(!s)return;const o=s.timescale||9e4;D(n,["tfdt"]).forEach(u=>{const l=u[0],d=t*o;if(d){let f=rt(u,4);if(l===0)f-=d,f=Math.max(f,0),X(u,4,f);else{f*=Math.pow(2,32),f+=rt(u,8),f-=d,f=Math.max(f,0);const v=Math.floor(f/(Sn+1)),p=Math.floor(f%(Sn+1));X(u,4,v),X(u,8,p)}}})})})}function It(a){const e={valid:null,remainder:null},t=D(a,["moof"]);if(t.length<2)return e.remainder=a,e;const n=t[t.length-1];return e.valid=a.slice(0,n.byteOffset-8),e.remainder=a.slice(n.byteOffset-8),e}function ft(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function ee(a,e){const t=[],n=e.samples,i=e.timescale,r=e.id;let s=!1;return D(n,["moof"]).map(u=>{const l=u.byteOffset-8;D(u,["traf"]).map(f=>{const v=D(f,["tfdt"]).map(p=>{const y=p[0];let T=rt(p,4);return y===1&&(T*=Math.pow(2,32),T+=rt(p,8)),T/i})[0];return v!==void 0&&(a=v),D(f,["tfhd"]).map(p=>{const y=rt(p,4),T=rt(p,0)&16777215,b=(T&1)!==0,I=(T&2)!==0,B=(T&8)!==0;let P=0;const ue=(T&16)!==0;let he=0;const je=(T&32)!==0;let me=8;y===r&&(b&&(me+=8),I&&(me+=4),B&&(P=rt(p,me),me+=4),ue&&(he=rt(p,me),me+=4),je&&(me+=4),e.type==="video"&&(s=se(e.codec)),D(f,["trun"]).map(Me=>{const it=Me[0],Te=rt(Me,0)&16777215,Ut=(Te&1)!==0;let an=0;const di=(Te&4)!==0,Wn=(Te&256)!==0;let Un=0;const An=(Te&512)!==0;let Gn=0;const _n=(Te&1024)!==0,Gt=(Te&2048)!==0;let Ht=0;const Jn=rt(Me,4);let Xn=8;Ut&&(an=rt(Me,Xn),Xn+=4),di&&(Xn+=4);let ci=an+l;for(let bi=0;bi<Jn;bi++){if(Wn?(Un=rt(Me,Xn),Xn+=4):Un=P,An?(Gn=rt(Me,Xn),Xn+=4):Gn=he,_n&&(Xn+=4),Gt&&(it===0?Ht=rt(Me,Xn):Ht=ge(Me,Xn),Xn+=4),e.type===$.VIDEO){let Li=0;for(;Li<Gn;){const Pi=rt(n,ci);if(ci+=4,Ae(s,n[ci])){const ir=n.subarray(ci,ci+Pi);Y(ir,s?2:1,a+Ht/i,t)}ci+=Pi,Li+=Pi+4}}a+=Un/i}}))})})}),t}function se(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function Ae(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Y(a,e,t,n){const i=Ue(a);let r=0;r+=e;let s=0,o=0,u=0;for(;r<i.length;){s=0;do{if(r>=i.length)break;u=i[r++],s+=u}while(u===255);o=0;do{if(r>=i.length)break;u=i[r++],o+=u}while(u===255);const l=i.length-r;let d=r;if(o<l)r+=o;else if(o>l){fe.error(`Malformed SEI payload. ${o} is too small, only ${l} bytes left to parse.`);break}if(s===4){if(i[d++]===181){const v=on(i,d);if(d+=2,v===49){const p=rt(i,d);if(d+=4,p===1195456820){const y=i[d++];if(y===3){const T=i[d++],b=31&T,I=64&T,B=I?2+b*3:0,P=new Uint8Array(B);if(I){P[0]=T;for(let ue=1;ue<B;ue++)P[ue]=i[d++]}n.push({type:y,payloadType:s,pts:t,bytes:P})}}}}}else if(s===5&&o>16){const f=[];for(let y=0;y<16;y++){const T=i[d++].toString(16);f.push(T.length==1?"0"+T:T),(y===3||y===5||y===7||y===9)&&f.push("-")}const v=o-16,p=new Uint8Array(v);for(let y=0;y<v;y++)p[y]=i[d++];n.push({payloadType:s,pts:t,uuid:f.join(""),userData:Zt(p),userDataBytes:p})}}}function Ue(a){const e=a.byteLength,t=[];let n=1;for(;n<e-2;)a[n]===0&&a[n+1]===0&&a[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return a;const i=e-t.length,r=new Uint8Array(i);let s=0;for(n=0;n<i;s++,n++)s===t[0]&&(s++,t.shift()),r[n]=a[s];return r}function Tt(a){const e=a[0];let t="",n="",i=0,r=0,s=0,o=0,u=0,l=0;if(e===0){for(;Ot(a.subarray(l,l+1))!=="\0";)t+=Ot(a.subarray(l,l+1)),l+=1;for(t+=Ot(a.subarray(l,l+1)),l+=1;Ot(a.subarray(l,l+1))!=="\0";)n+=Ot(a.subarray(l,l+1)),l+=1;n+=Ot(a.subarray(l,l+1)),l+=1,i=rt(a,12),r=rt(a,16),o=rt(a,20),u=rt(a,24),l=28}else if(e===1){l+=4,i=rt(a,l),l+=4;const f=rt(a,l);l+=4;const v=rt(a,l);for(l+=4,s=qo(2,32)*f+v,ye(s)||(s=Number.MAX_SAFE_INTEGER,fe.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=rt(a,l),l+=4,u=rt(a,l),l+=4;Ot(a.subarray(l,l+1))!=="\0";)t+=Ot(a.subarray(l,l+1)),l+=1;for(t+=Ot(a.subarray(l,l+1)),l+=1;Ot(a.subarray(l,l+1))!=="\0";)n+=Ot(a.subarray(l,l+1)),l+=1;n+=Ot(a.subarray(l,l+1)),l+=1}const d=a.subarray(l,a.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:s,presentationTimeDelta:r,eventDuration:o,id:u,payload:d}}function wt(a,...e){const t=e.length;let n=8,i=t;for(;i--;)n+=e[i].byteLength;const r=new Uint8Array(n);for(r[0]=n>>24&255,r[1]=n>>16&255,r[2]=n>>8&255,r[3]=n&255,r.set(a,4),i=0,n=8;i<t;i++)r.set(e[i],n),n+=e[i].byteLength;return r}function Ke(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let n,i;n=0,i=new Uint8Array;let r;n>0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const s=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),wt([112,115,115,104],new Uint8Array([n,0,0,0]),a,r,i,s,t||new Uint8Array)}function Nt(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let n=0;for(;n+32<t;){const i=new DataView(a,n),r=tn(i);e.push(r),n+=r.size}}return e}function tn(a){const e=a.getUint32(0),t=a.byteOffset,n=a.byteLength;if(n<e)return{offset:t,size:n};if(a.getUint32(4)!==1886614376)return{offset:t,size:e};const r=a.getUint32(8)>>>24;if(r!==0&&r!==1)return{offset:t,size:e};const s=a.buffer,o=Ce.hexDump(new Uint8Array(s,t+12,16)),u=a.getUint32(28);let l=null,d=null;if(r===0){if(e-32<u||u<22)return{offset:t,size:e};d=new Uint8Array(s,t+32,u)}else if(r===1){if(!u||n<t+32+u*16+16)return{offset:t,size:e};l=[];for(let f=0;f<u;f++)l.push(new Uint8Array(s,t+32+f*16,16))}return{version:r,systemId:o,kids:l,data:d,offset:t,size:e}}const un=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),zt={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Tn(a,e){const t=zt[e];return!!t&&!!t[a.slice(0,4)]}function En(a,e,t=!0){return!a.split(",").some(n=>!mt(n,e,t))}function mt(a,e,t=!0){var n;const i=Be(t);return(n=i==null?void 0:i.isTypeSupported(at(a,e)))!=null?n:!1}function at(a,e){return`${e}/mp4;codecs=${a}`}function Yt(a){if(a){const e=a.substring(0,4);return zt.video[e]}return 2}function gt(a){const e=un();return a.split(",").reduce((t,n)=>{const r=e&&se(n)?9:zt.video[n];return r?(r*2+t)/(t?3:2):(zt.audio[n]+t)/(t?2:1)},0)}const ct={};function Ln(a,e=!0){if(ct[a])return ct[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let i=0;i<t.length;i++){var n;if(mt(t[i],"audio",e))return ct[a]=t[i],t[i];if(t[i]==="mp3"&&(n=Be(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return a}const nn=/flac|opus|mp4a\.40\.34/i;function dn(a,e=!0){return a.replace(nn,t=>Ln(t.toLowerCase(),e))}function St(a,e){const t=[];if(a){const n=a.split(",");for(let i=0;i<n.length;i++)Tn(n[i],"video")||t.push(n[i])}return e&&t.push(e),t.join(",")}function Wt(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let n=t.length;n--;)if(t[n].substring(0,4)===a.substring(0,4))return t[n]}return t[0]}}return e||a}function zn(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");if(n.length>2){let i=n.shift()+".";i+=parseInt(n.shift()).toString(16),i+=("000"+parseInt(n.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}function De(a){if(a.startsWith("av01.")){const e=a.split("."),t=["0","111","01","01","01","0"];for(let n=e.length;n>4&&n<10;n++)e[n]=t[n-4];return e.join(".")}return a}function c(a){const e=Be(a)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function h(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const g={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function E(a,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:a}}const S={};function k(a,e,t,n,i,r){const s=a.audioCodec?a.audioGroups:null,o=r==null?void 0:r.audioCodec,u=r==null?void 0:r.channels,l=u?parseInt(u):o?1/0:2;let d=null;if(s!=null&&s.length)try{s.length===1&&s[0]?d=e.groups[s[0]].channels:d=s.reduce((f,v)=>{if(v){const p=e.groups[v];if(!p)throw new Error(`Audio track group ${v} not found`);Object.keys(p.channels).forEach(y=>{f[y]=(f[y]||0)+p.channels[y]})}return f},{2:0})}catch(f){return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(n,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!d&&A(l)&&Object.keys(d).some(f=>parseInt(f)>l)}function j(a,e,t){const n=a.videoCodec,i=a.audioCodec;if(!n&&!i||!t)return Promise.resolve(g);const r=[];if(n){const s={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},o=a.videoRange;o!=="SDR"&&(s.transferFunction=o.toLowerCase());const u=n.split(","),l=navigator.userAgent;if(u.some(d=>se(d))&&un())return Promise.resolve(E(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${l})`),r));r.push.apply(r,u.map(d=>({type:"media-source",video:de(de({},s),{},{contentType:at(De(d),"video")})})))}return i&&a.audioGroups&&a.audioGroups.forEach(s=>{var o;s&&((o=e.groups[s])==null||o.tracks.forEach(u=>{if(u.groupId===s){const l=u.channels||"",d=parseFloat(l);A(d)&&d>2&&r.push.apply(r,i.split(",").map(f=>({type:"media-source",audio:{contentType:at(f,"audio"),channels:""+d}})))}}))}),Promise.all(r.map(s=>{const o=ht(s);return S[o]||(S[o]=t.decodingInfo(s))})).then(s=>({supported:!s.some(o=>!o.supported),configurations:r,decodingInfoResults:s})).catch(s=>({supported:!1,configurations:r,decodingInfoResults:[],error:s}))}function ht(a){const{audio:e,video:t}=a,n=t||e;if(n){const i=h(n.contentType);if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}const ut=["NONE","TYPE-0","TYPE-1",null];function _t(a){return ut.indexOf(a)>-1}const ln=["SDR","PQ","HLG"];function _(a){return!!a&&ln.indexOf(a)>-1}var R={No:"",Yes:"YES",v2:"v2"};function re(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,i=n<e/2;return e&&i?t?R.v2:R.Yes:R.No}class Q{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class U{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(n=>!!n).map(n=>n.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const n=(t=e.supplemental)==null?void 0:t.videoCodec;n&&n!==e.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Ee(this._audioGroups,e)}hasSubtitleGroup(e){return Ee(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let n=this._audioGroups;n||(n=this._audioGroups=[]),n.indexOf(t)===-1&&n.push(t)}else if(e==="text"){let n=this._subtitleGroups;n||(n=this._subtitleGroups=[]),n.indexOf(t)===-1&&n.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function Ee(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function Re(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function be(a,e){let t=!1,n=[];if(a&&(t=a!=="SDR",n=[a]),e){n=e.allowedVideoRanges||ln.slice(0);const i=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&Re(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const We=a=>{const e=new WeakSet;return(t,n)=>{if(a&&(n=a(t,n)),typeof n=="object"&&n!==null){if(e.has(n))return;e.add(n)}return n}},qe=(a,e)=>JSON.stringify(a,We(e));function Lt(a,e,t,n,i){const r=Object.keys(a),s=n==null?void 0:n.channels,o=n==null?void 0:n.audioCodec,u=i==null?void 0:i.videoCodec,l=s&&parseInt(s)===2;let d=!1,f=!1,v=1/0,p=1/0,y=1/0,T=1/0,b=0,I=[];const{preferHDR:B,allowedVideoRanges:P}=be(e,i);for(let Me=r.length;Me--;){const it=a[r[Me]];d||(d=it.channels[2]>0),v=Math.min(v,it.minHeight),p=Math.min(p,it.minFramerate),y=Math.min(y,it.minBitrate),P.filter(Ut=>it.videoRanges[Ut]>0).length>0&&(f=!0)}v=A(v)?v:0,p=A(p)?p:0;const ue=Math.max(1080,v),he=Math.max(30,p);y=A(y)?y:t,t=Math.max(y,t),f||(e=void 0);const je=r.length>1;return{codecSet:r.reduce((Me,it)=>{const Te=a[it];if(it===Me)return Me;if(I=f?P.filter(Ut=>Te.videoRanges[Ut]>0):[],je){if(Te.minBitrate>t)return Qe(it,`min bitrate of ${Te.minBitrate} > current estimate of ${t}`),Me;if(!Te.hasDefaultAudio)return Qe(it,"no renditions with default or auto-select sound found"),Me;if(o&&it.indexOf(o.substring(0,4))%5!==0)return Qe(it,`audio codec preference "${o}" not found`),Me;if(s&&!l){if(!Te.channels[s])return Qe(it,`no renditions with ${s} channel sound found (channels options: ${Object.keys(Te.channels)})`),Me}else if((!o||l)&&d&&Te.channels[2]===0)return Qe(it,"no renditions with stereo sound found"),Me;if(Te.minHeight>ue)return Qe(it,`min resolution of ${Te.minHeight} > maximum of ${ue}`),Me;if(Te.minFramerate>he)return Qe(it,`min framerate of ${Te.minFramerate} > maximum of ${he}`),Me;if(!I.some(Ut=>Te.videoRanges[Ut]>0))return Qe(it,`no variants with VIDEO-RANGE of ${qe(I)} found`),Me;if(u&&it.indexOf(u.substring(0,4))%5!==0)return Qe(it,`video codec preference "${u}" not found`),Me;if(Te.maxScore<b)return Qe(it,`max score of ${Te.maxScore} < selected max of ${b}`),Me}return Me&&(gt(it)>=gt(Me)||Te.fragmentError>a[Me].fragmentError)?Me:(T=Te.minIndex,b=Te.maxScore,it)},void 0),videoRanges:I,preferHDR:B,minFramerate:p,minBitrate:y,minIndex:T}}function Qe(a,e){fe.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function st(a){return a.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const i=t.channels||"2";return n.channels[i]=(n.channels[i]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function we(a,e,t,n){return a.slice(t,n+1).reduce((i,r,s)=>{if(!r.codecSet)return i;const o=r.audioGroups;let u=i[r.codecSet];u||(i[r.codecSet]=u={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),u.minBitrate=Math.min(u.minBitrate,r.bitrate);const l=Math.min(r.height,r.width);return u.minHeight=Math.min(u.minHeight,l),u.minFramerate=Math.min(u.minFramerate,r.frameRate),u.minIndex=Math.min(u.minIndex,s),u.maxScore=Math.max(u.maxScore,r.score),u.fragmentError+=r.fragmentError,u.videoRanges[r.videoRange]=(u.videoRanges[r.videoRange]||0)+1,o&&o.forEach(d=>{if(!d)return;const f=e.groups[d];f&&(u.hasDefaultAudio=u.hasDefaultAudio||e.hasDefaultAudio?f.hasDefault:f.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(f.channels).forEach(v=>{u.channels[v]=(u.channels[v]||0)+f.channels[v]}))}),i},{})}function w(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:n,channels:i,audioCodec:r}=a;return{lang:e,assocLang:t,characteristics:n,channels:i,audioCodec:r}}function H(a,e,t){if("attrs"in a){const n=e.indexOf(a);if(n!==-1)return n}for(let n=0;n<e.length;n++){const i=e[n];if(te(a,i,t))return n}return-1}function te(a,e,t){const{groupId:n,name:i,lang:r,assocLang:s,default:o}=a,u=a.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(r===void 0||le(r,e.lang))&&(r===void 0||e.assocLang===s)&&(o===void 0||e.default===o)&&(u===void 0||e.forced===u)&&(!("characteristics"in a)||Ge(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function le(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function Ge(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.indexOf(i)===-1)}function Ve(a,e){const{audioCodec:t,channels:n}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(n===void 0||n===(e.channels||"2"))}function $e(a,e,t,n,i){const r=e[n],o=e.reduce((v,p,y)=>{const T=p.uri;return(v[T]||(v[T]=[])).push(y),v},{})[r.uri];o.length>1&&(n=Math.max.apply(Math,o));const u=r.videoRange,l=r.frameRate,d=r.codecSet.substring(0,4),f=vt(e,n,v=>{if(v.videoRange!==u||v.frameRate!==l||v.codecSet.substring(0,4)!==d)return!1;const p=v.audioGroups,y=t.filter(T=>!p||p.indexOf(T.groupId)!==-1);return H(a,y,i)>-1});return f>-1?f:vt(e,n,v=>{const p=v.audioGroups,y=t.filter(T=>!p||p.indexOf(T.groupId)!==-1);return H(a,y,i)>-1})}function vt(a,e,t){for(let n=e;n>-1;n--)if(t(a[n]))return n;for(let n=e+1;n<a.length;n++)if(t(a[n]))return n;return-1}function Ct(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class At extends bt{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:i,partCurrent:r,hls:s}=this,{autoLevelEnabled:o,media:u}=s;if(!i||!u)return;const l=performance.now(),d=r?r.stats:i.stats,f=r?r.duration:i.duration,v=l-d.loading.start,p=s.minAutoLevel,y=i.level,T=this._nextAutoLevel;if(d.aborted||d.loaded&&d.loaded===d.total||y<=p){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const b=T>-1&&T!==y,I=!!t||b;if(!I&&(u.paused||!u.playbackRate||!u.readyState))return;const B=s.mainForwardBufferInfo;if(!I&&B===null)return;const P=this.bwEstimator.getEstimateTTFB(),ue=Math.abs(u.playbackRate);if(v<=Math.max(P,1e3*(f/(ue*2))))return;const he=B?B.len/ue:0,je=d.loading.first?d.loading.first-d.loading.start:-1,me=d.loaded&&je>-1,Me=this.getBwEstimate(),it=s.levels,Te=it[y],Ut=Math.max(d.loaded,Math.round(f*(i.bitrate||Te.averageBitrate)/8));let an=me?v-je:v;an<1&&me&&(an=Math.min(v,d.loaded*8/Me));const di=me?d.loaded*1e3/an:0,Wn=P/1e3,Un=di?(Ut-d.loaded)/di:Ut*8/Me+Wn;if(Un<=he)return;const An=di?di*8:Me,Gn=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,_n=this.hls.config.abrBandWidthUpFactor;let Gt=Number.POSITIVE_INFINITY,Ht;for(Ht=y-1;Ht>p;Ht--){const bi=it[Ht].maxBitrate,Li=!it[Ht].details||Gn;if(Gt=this.getTimeToLoadFrag(Wn,An,f*bi,Li),Gt<Math.min(he,f+Wn))break}if(Gt>=Un||Gt>f*10)return;me?this.bwEstimator.sample(v-Math.min(P,je),d.loaded):this.bwEstimator.sampleTTFB(v);const Jn=it[Ht].maxBitrate;this.getBwEstimate()*_n>Jn&&this.resetEstimator(Jn);const Xn=this.findBestLevel(Jn,p,Ht,0,he,1,1);Xn>-1&&(Ht=Xn),this.warn(`Fragment ${i.sn}${r?" part "+r.index:""} of level ${y} is loading too slowly;
|
|
Fragment duration: ${i.duration.toFixed(3)}
|
|
Time to underbuffer: ${he.toFixed(3)} s
|
|
Estimated load time for current fragment: ${Un.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${Gt.toFixed(3)} s
|
|
TTFB estimate: ${je|0} ms
|
|
Current BW estimate: ${A(Me)?Me|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${Ht} @ ${Jn|0} bps`),s.nextLoadLevel=s.nextAutoLevel=Ht,this.clearTimer();const ci=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===Ht&&Ht>0){const bi=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${Ht>0?"and switching down":""}
|
|
Fragment duration: ${i.duration.toFixed(3)} s
|
|
Time to underbuffer: ${bi.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,Ht>p){let Li=this.findBestLevel(this.hls.levels[p].bitrate,p,Ht,0,bi,1,1);Li===-1&&(Li=p),this.hls.nextLoadLevel=this.hls.nextAutoLevel=Li,this.resetEstimator(this.hls.levels[Li].bitrate)}}};b||Un>Gt*2?ci():this.timer=self.setInterval(ci,Gt*1e3),s.trigger(m.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:d})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new V(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.FRAG_LOADING,this.onFragLoading,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.FRAG_LOADING,this.onFragLoading,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(m.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var i;this.fragCurrent=n,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case x.BUFFER_ADD_CODEC_ERROR:case x.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case x.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:i,partCurrent:r}=this;if(n&&i&&n.sn===i.sn&&n.level===i.level){const s=performance.now(),o=r?r.stats:n.stats,u=s-o.loading.start,l=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&l>-1){const f=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(u-Math.min(f,l),o.loaded)}else this.bwEstimator.sampleTTFB(u)}break}}}getTimeToLoadFrag(e,t,n,i){const r=e+n/t,s=i?e+this.lastLevelLoadSec:0;return r+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:i}=t.stats,r=i.end-i.first;A(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===ae.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=n?n.duration:t.duration,s=this.hls.levels[t.level],o=(s.loaded?s.loaded.bytes:0)+i.loaded,u=(s.loaded?s.loaded.duration:0)+r;s.loaded={bytes:o,duration:u},s.realBitrate=Math.round(8*o/u)}if(t.bitrateTest){const r={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(m.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:i}=t,r=i!=null&&i.stats.loaded?i.stats:n.stats;if(r.aborted||this.ignoreFragment(n))return;const s=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,r.loaded),r.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==ae.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(n,t,e,0,i,1,1);if(r>-1)return r;const s=this.hls.firstLevel,o=Math.min(Math.max(s,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=n&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,r)&&s[e].loadError<=s[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:i,config:r,minAutoLevel:s}=n,o=t?t.duration:e?e.duration:0,u=this.getBwEstimate(),l=this.getStarvationDelay();let d=r.abrBandWidthFactor,f=r.abrBandWidthUpFactor;if(l){const b=this.findBestLevel(u,s,i,l,0,d,f);if(b>=0)return this.rebufferNotice=-1,b}let v=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!l){const b=this.bitrateTestDelay;b&&(v=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-b,this.info(`bitrate test took ${Math.round(1e3*b)}ms, set first fragment max fetchDuration to ${Math.round(1e3*v)} ms`),d=f=1)}const p=this.findBestLevel(u,s,i,l,v,d,f);if(this.rebufferNotice!==p&&(this.rebufferNotice=p,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${p}`)),p>-1)return p;const y=n.levels[s],T=n.loadLevelObj;return T&&(y==null?void 0:y.bitrate)<T.bitrate?s:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,i,r,s,o){var u;const l=i+r,d=this.lastLoadedFragLevel,f=d===-1?this.hls.firstLevel:d,{fragCurrent:v,partCurrent:p}=this,{levels:y,allAudioTracks:T,loadLevel:b,config:I}=this.hls;if(y.length===1)return 0;const B=y[f],P=!!((u=this.hls.latestLevelDetails)!=null&&u.live),ue=b===-1||d===-1;let he,je="SDR",me=(B==null?void 0:B.frameRate)||0;const{audioPreference:Me,videoPreference:it}=I,Te=this.audioTracksByGroup||(this.audioTracksByGroup=st(T));let Ut=-1;if(ue){if(this.firstSelection!==-1)return this.firstSelection;const An=this.codecTiers||(this.codecTiers=we(y,Te,t,n)),Gn=Lt(An,je,e,Me,it),{codecSet:_n,videoRanges:Gt,minFramerate:Ht,minBitrate:Jn,minIndex:Xn,preferHDR:ci}=Gn;Ut=Xn,he=_n,je=ci?Gt[Gt.length-1]:Gt[0],me=Ht,e=Math.max(e,Jn),this.log(`picked start tier ${qe(Gn)}`)}else he=B==null?void 0:B.codecSet,je=B==null?void 0:B.videoRange;const an=p?p.duration:v?v.duration:0,di=this.bwEstimator.getEstimateTTFB()/1e3,Wn=[];for(let An=n;An>=t;An--){var Un;const Gn=y[An],_n=An>f;if(!Gn)continue;if(I.useMediaCapabilities&&!Gn.supportedResult&&!Gn.supportedPromise){const Li=navigator.mediaCapabilities;typeof(Li==null?void 0:Li.decodingInfo)=="function"&&(k(Gn,Te,je,me,e,Me)||se(Gn.videoCodec))?(Gn.supportedPromise=j(Gn,Te,Li),Gn.supportedPromise.then(Pi=>{if(!this.hls)return;Gn.supportedResult=Pi;const ir=this.hls.levels,lr=ir.indexOf(Gn);Pi.error?this.warn(`MediaCapabilities decodingInfo error: "${Pi.error}" for level ${lr} ${qe(Pi)}`):Pi.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${lr} ${qe(Pi)}`),lr>-1&&ir.length>1&&(this.log(`Removing unsupported level ${lr}`),this.hls.removeLevel(lr),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):Gn.supportedResult=g}if((he&&Gn.codecSet!==he||je&&Gn.videoRange!==je||_n&&me>Gn.frameRate||!_n&&me>0&&me<Gn.frameRate||Gn.supportedResult&&!((Un=Gn.supportedResult.decodingInfoResults)!=null&&Un[0].smooth))&&(!ue||An!==Ut)){Wn.push(An);continue}const Gt=Gn.details,Ht=(p?Gt==null?void 0:Gt.partTarget:Gt==null?void 0:Gt.averagetargetduration)||an;let Jn;_n?Jn=o*e:Jn=s*e;const Xn=an&&i>=an*2&&r===0?Gn.averageBitrate:Gn.maxBitrate,ci=this.getTimeToLoadFrag(di,Jn,Xn*Ht,Gt===void 0);if(Jn>=Xn&&(An===d||Gn.loadError===0&&Gn.fragmentError===0)&&(ci<=di||!A(ci)||P&&!this.bitrateTestDelay||ci<l)){const Li=this.forcedAutoLevel;return An!==b&&(Li===-1||Li!==b)&&(Wn.length&&this.trace(`Skipped level(s) ${Wn.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${y[Wn[0]].codecs}" ${y[Wn[0]].videoRange}; not compatible with "${he}" ${je}`),this.info(`switch candidate:${f}->${An} adjustedbw(${Math.round(Jn)})-bitrate=${Math.round(Jn-Xn)} ttfb:${di.toFixed(1)} avgDuration:${Ht.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${ci.toFixed(1)} firstSelection:${ue} codecSet:${Gn.codecSet} videoRange:${Gn.videoRange} hls.loadLevel:${b}`)),ue&&(this.firstSelection=An),An}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}}const qt={search:function(a,e){let t=0,n=a.length-1,i=null,r=null;for(;t<=n;){i=(t+n)/2|0,r=a[i];const s=e(r);if(s>0)t=i+1;else if(s<0)n=i-1;else return r}return null}};function xt(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!A(e))return null;const n=a[0].programDateTime;if(e<(n||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let r=0;r<a.length;++r){const s=a[r];if(jt(e,t,s))return s}return null}function Jt(a,e,t=0,n=0,i=.005){let r=null;if(a){r=e[1+a.sn-e[0].sn]||null;const o=a.endDTS-t;o>0&&o<15e-7&&(t+=15e-7),r&&a.level!==r.level&&r.end<=a.end&&(r=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&rn(t,n,r)===0||$t(r,a,Math.min(i,n))))return r;const s=qt.search(e,rn.bind(null,t,n));return s&&(s!==a||!r)?s:r}function $t(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=n}return!1}function rn(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-n<=a?1:t.start-n>a&&t.start?-1:0}function jt(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function Kt(a,e){return qt.search(a,t=>t.cc<e?1:t.cc>e?-1:0)}function yn(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){const n=t.start,i=t.end;let r=a.fragments;if(!t.relurl){const{fragmentHint:s}=a;s&&(r=r.concat(s))}return qt.search(r,s=>s.cc<e||s.end<=n?1:s.cc>e||s.start>=i?-1:0)}return null}function yt(a){switch(a.details){case x.FRAG_LOAD_TIMEOUT:case x.KEY_LOAD_TIMEOUT:case x.LEVEL_LOAD_TIMEOUT:case x.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Dt(a,e){const t=yt(e);return a.default[`${t?"timeout":"error"}Retry`]}function kt(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function mn(a){return de(de({},a),{errorRetry:null,timeoutRetry:null})}function en(a,e,t,n){if(!a)return!1;const i=n==null?void 0:n.code,r=e<a.maxNumRetry&&(fn(i)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,r):r}function fn(a){return a===0&&navigator.onLine===!1||!!a&&(a<400||a>499)}var Cn={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},On={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class si extends bt{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(m.ERROR,this.onError,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(m.ERROR,this.onError,this),e.off(m.ERROR,this.onErrorOut,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===ae.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const i=this.hls,r=t.context;switch(t.details){case x.FRAG_LOAD_ERROR:case x.FRAG_LOAD_TIMEOUT:case x.KEY_LOAD_ERROR:case x.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case x.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=Fn();return}case x.FRAG_GAP:case x.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Cn.SendAlternateToPenaltyBox;return}case x.LEVEL_EMPTY_ERROR:case x.LEVEL_PARSING_ERROR:{var s,o;const l=t.parent===ae.MAIN?t.level:i.loadLevel;t.details===x.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(o=s.levelDetails)!=null&&o.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,l):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,l))}return;case x.LEVEL_LOAD_ERROR:case x.LEVEL_LOAD_TIMEOUT:typeof(r==null?void 0:r.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case x.AUDIO_TRACK_LOAD_ERROR:case x.AUDIO_TRACK_LOAD_TIMEOUT:case x.SUBTITLE_LOAD_ERROR:case x.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const l=i.loadLevelObj;if(l&&(r.type===Xe.AUDIO_TRACK&&l.hasAudioGroup(r.groupId)||r.type===Xe.SUBTITLE_TRACK&&l.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=Cn.SendAlternateToPenaltyBox,t.errorAction.flags=On.MoveAllAlternatesMatchingHost;return}}return;case x.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const l=i.loadLevelObj,d=l==null?void 0:l.attrs["HDCP-LEVEL"];d?t.errorAction={action:Cn.SendAlternateToPenaltyBox,flags:On.MoveAllAlternatesMatchingHDCP,hdcpLevel:d}:this.keySystemError(t)}return;case x.BUFFER_ADD_CODEC_ERROR:case x.REMUX_ALLOC_ERROR:case x.BUFFER_APPEND_ERROR:if(!t.errorAction){var u;t.errorAction=this.getLevelSwitchAction(t,(u=t.level)!=null?u:i.loadLevel)}return;case x.INTERNAL_EXCEPTION:case x.BUFFER_APPENDING_ERROR:case x.BUFFER_FULL_ERROR:case x.LEVEL_SWITCH_ERROR:case x.BUFFER_STALLED_ERROR:case x.BUFFER_SEEK_OVER_HOLE:case x.BUFFER_NUDGE_ON_STALL:t.errorAction=Fn();return}t.type===Z.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,i=Dt(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(en(i,r,yt(e),e.response))return{action:Cn.RetryRequest,flags:On.None,retryConfig:i,retryCount:r};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=r),o}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:s}=t.config,o=Dt(e.details.startsWith("key")?s:r,e),u=t.levels.reduce((d,f)=>d+f.fragmentError,0);if(i&&(e.details!==x.FRAG_GAP&&i.fragmentError++,en(o,u,yt(e),e.response)))return{action:Cn.RetryRequest,flags:On.None,retryConfig:o,retryCount:u};const l=this.getLevelSwitchAction(e,n);return o&&(l.retryConfig=o,l.retryCount=u),l}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,s;const l=e.details;i.loadError++,l===x.BUFFER_APPEND_ERROR&&i.fragmentError++;let d=-1;const{levels:f,loadLevel:v,minAutoLevel:p,maxAutoLevel:y}=n;n.autoLevelEnabled||(n.loadLevel=-1);const T=(r=e.frag)==null?void 0:r.type,I=(T===ae.AUDIO&&l===x.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(l===x.BUFFER_ADD_CODEC_ERROR||l===x.BUFFER_APPEND_ERROR))&&f.some(({audioCodec:je})=>i.audioCodec!==je),P=e.sourceBufferName==="video"&&(l===x.BUFFER_ADD_CODEC_ERROR||l===x.BUFFER_APPEND_ERROR)&&f.some(({codecSet:je,audioCodec:me})=>i.codecSet!==je&&i.audioCodec===me),{type:ue,groupId:he}=(s=e.context)!=null?s:{};for(let je=f.length;je--;){const me=(je+v)%f.length;if(me!==v&&me>=p&&me<=y&&f[me].loadError===0){var o,u;const Me=f[me];if(l===x.FRAG_GAP&&T===ae.MAIN&&e.frag){const it=f[me].details;if(it){const Te=Jt(e.frag,it.fragments,e.frag.start);if(Te!=null&&Te.gap)continue}}else{if(ue===Xe.AUDIO_TRACK&&Me.hasAudioGroup(he)||ue===Xe.SUBTITLE_TRACK&&Me.hasSubtitleGroup(he))continue;if(T===ae.AUDIO&&(o=i.audioGroups)!=null&&o.some(it=>Me.hasAudioGroup(it))||T===ae.SUBTITLE&&(u=i.subtitleGroups)!=null&&u.some(it=>Me.hasSubtitleGroup(it))||I&&i.audioCodec===Me.audioCodec||!I&&i.audioCodec!==Me.audioCodec||P&&i.codecSet===Me.codecSet)continue}d=me;break}}if(d>-1&&n.loadLevel!==d)return e.levelRetry=!0,this.playlistError=0,{action:Cn.SendAlternateToPenaltyBox,flags:On.None,nextAutoLevel:d}}return{action:Cn.SendAlternateToPenaltyBox,flags:On.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case Cn.DoNothing:break;case Cn.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==x.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break;case Cn.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i,hdcpLevel:r,nextAutoLevel:s}=n;switch(i){case On.None:this.switchLevel(e,s);break;case On.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=ut[ut.indexOf(r)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,s)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===x.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=h(e.mimeType),i=this.hls.levels;for(let r=i.length;r--;)i[r][`${e.sourceBufferName}Codec`]===n&&this.hls.removeLevel(r)}}}function Fn(a){const e={action:Cn.DoNothing,flags:On.None};return a&&(e.resolved=!0),e}var Bn={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class Yn{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.BUFFER_APPENDED,this.onBufferAppended,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.BUFFER_APPENDED,this.onBufferAppended,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let i=n.length;i--;){const r=n[i];if(!r)break;const s=r.end;if(r.start<=e&&s!==null&&e<=s)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:i}=this,r=Object.keys(i);for(let s=r.length;s--;){const o=i[r[s]];if((o==null?void 0:o.body.type)===t&&(!n||o.buffered)){const u=o.body;if(u.start<=e&&e<=u.end)return u}}return null}detectEvictedFragments(e,t,n,i,r){this.timeRanges&&(this.timeRanges[e]=t);const s=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const u=this.fragments[o];if(!u||s>=u.body.sn)return;if(!u.buffered&&(!u.loaded||r)){u.body.type===n&&this.removeFragment(u.body);return}const l=u.range[e];if(l){if(l.time.length===0){this.removeFragment(u.body);return}l.time.some(d=>{const f=!this.isTimeBuffered(d.startPTS,d.endPTS,t);return f&&this.removeFragment(u.body),f})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,i=qn(n),r=this.fragments[i];if(!r||r.buffered&&n.gap)return;const s=!n.relurl;Object.keys(t).forEach(o=>{const u=n.elementaryStreams[o];if(!u)return;const l=t[o],d=s||u.partial===!0;r.range[o]=this.getBufferedTimes(n,e.part,d,l)}),r.loaded=null,Object.keys(r.range).length?(r.buffered=!0,(r.body.endList=n.endList||r.body.endList)&&(this.endListFragments[r.body.type]=r),ti(r)||this.removeParts(n.sn-1,n.type)):this.removeFragment(r.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=$n(n,i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=qn(e);let i=this.fragments[n];!i&&t&&(i=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,n,i){const r={time:[],partial:n},s=e.start,o=e.end,u=e.minEndPTS||o,l=e.maxStartPTS||s;for(let d=0;d<i.length;d++){const f=i.start(d)-this.bufferPadding,v=i.end(d)+this.bufferPadding;if(l>=f&&u<=v){r.time.push({startPTS:Math.max(s,i.start(d)),endPTS:Math.min(o,i.end(d))});break}else if(s<v&&o>f){const p=Math.max(s,i.start(d)),y=Math.min(o,i.end(d));y>p&&(r.partial=!0,r.time.push({startPTS:p,endPTS:y}))}else if(o<=f)break}return r}getPartialFragment(e){let t=null,n,i,r,s=0;const{bufferPadding:o,fragments:u}=this;return Object.keys(u).forEach(l=>{const d=u[l];d&&ti(d)&&(i=d.body.start-o,r=d.body.end+o,e>=i&&e<=r&&(n=Math.min(e-i,r-e),s<=n&&(t=d.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||ti(t))}getState(e){const t=qn(e),n=this.fragments[t];return n?n.buffered?ti(n)?Bn.PARTIAL:Bn.OK:Bn.APPENDING:Bn.NOT_LOADED}isTimeBuffered(e,t,n){let i,r;for(let s=0;s<n.length;s++){if(i=n.start(s)-this.bufferPadding,r=n.end(s)+this.bufferPadding,e>=i&&t<=r)return!0;if(t<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const n=t.frag,i=t.part?null:t,r=qn(n);this.fragments[r]={body:n,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:r,type:s}=t;if(n.sn==="initSegment")return;const o=n.type;if(i){let l=this.activePartLists[o];l||(this.activePartLists[o]=l=[]),l.push(i)}this.timeRanges=r;const u=r[s];this.detectEvictedFragments(s,u,o,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=qn(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let i=n.length;i--;){const r=t[n[i]];if((r==null?void 0:r.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const o=this.fragments[s];if(!o)return;const u=o.body;u.type!==n||i&&!u.gap||u.start<t&&u.end>e&&(o.buffered||r)&&this.removeFragment(u)})}removeFragment(e){const t=qn(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=$n(n,r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e,t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const n=(e=this.hls)==null||(t=e.latestLevelDetails)==null?void 0:t.partList;n&&n.forEach(i=>i.clearElementaryStreamInfo())}}function ti(a){var e,t,n;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((n=a.range.audiovideo)==null?void 0:n.partial))}function qn(a){return`${a.type}_${a.level}_${a.sn}`}function $n(a,e){return a.filter(t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n})}var cn={cbc:0,ctr:1};class ot{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case cn.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case cn.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function nt(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class Ft{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let i=0;i<4;i++)n[i]=t.getUint32(i*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,i=n[0],r=n[1],s=n[2],o=n[3],u=this.invSubMix,l=u[0],d=u[1],f=u[2],v=u[3],p=new Uint32Array(256);let y=0,T=0,b=0;for(b=0;b<256;b++)b<128?p[b]=b<<1:p[b]=b<<1^283;for(b=0;b<256;b++){let I=T^T<<1^T<<2^T<<3^T<<4;I=I>>>8^I&255^99,e[y]=I,t[I]=y;const B=p[y],P=p[B],ue=p[P];let he=p[I]*257^I*16843008;i[y]=he<<24|he>>>8,r[y]=he<<16|he>>>16,s[y]=he<<8|he>>>24,o[y]=he,he=ue*16843009^P*65537^B*257^y*16843008,l[I]=he<<24|he>>>8,d[I]=he<<16|he>>>16,f[I]=he<<8|he>>>24,v[I]=he,y?(y=B^p[p[p[ue^B]]],T^=p[p[T]]):y=T=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;i<t.length&&n;)n=t[i]===this.key[i],i++;if(n)return;this.key=t;const r=this.keySize=t.length;if(r!==4&&r!==6&&r!==8)throw new Error("Invalid aes key size="+r);const s=this.ksRows=(r+6+1)*4;let o,u;const l=this.keySchedule=new Uint32Array(s),d=this.invKeySchedule=new Uint32Array(s),f=this.sBox,v=this.rcon,p=this.invSubMix,y=p[0],T=p[1],b=p[2],I=p[3];let B,P;for(o=0;o<s;o++){if(o<r){B=l[o]=t[o];continue}P=B,o%r===0?(P=P<<8|P>>>24,P=f[P>>>24]<<24|f[P>>>16&255]<<16|f[P>>>8&255]<<8|f[P&255],P^=v[o/r|0]<<24):r>6&&o%r===4&&(P=f[P>>>24]<<24|f[P>>>16&255]<<16|f[P>>>8&255]<<8|f[P&255]),l[o]=B=(l[o-r]^P)>>>0}for(u=0;u<s;u++)o=s-u,u&3?P=l[o]:P=l[o-4],u<4||o<=4?d[u]=P:d[u]=y[f[P>>>24]]^T[f[P>>>16&255]]^b[f[P>>>8&255]]^I[f[P&255]],d[u]=d[u]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const i=this.keySize+6,r=this.invKeySchedule,s=this.invSBox,o=this.invSubMix,u=o[0],l=o[1],d=o[2],f=o[3],v=this.uint8ArrayToUint32Array_(n);let p=v[0],y=v[1],T=v[2],b=v[3];const I=new Int32Array(e),B=new Int32Array(I.length);let P,ue,he,je,me,Me,it,Te,Ut,an,di,Wn,Un,An;const Gn=this.networkToHostOrderSwap;for(;t<I.length;){for(Ut=Gn(I[t]),an=Gn(I[t+1]),di=Gn(I[t+2]),Wn=Gn(I[t+3]),me=Ut^r[0],Me=Wn^r[1],it=di^r[2],Te=an^r[3],Un=4,An=1;An<i;An++)P=u[me>>>24]^l[Me>>16&255]^d[it>>8&255]^f[Te&255]^r[Un],ue=u[Me>>>24]^l[it>>16&255]^d[Te>>8&255]^f[me&255]^r[Un+1],he=u[it>>>24]^l[Te>>16&255]^d[me>>8&255]^f[Me&255]^r[Un+2],je=u[Te>>>24]^l[me>>16&255]^d[Me>>8&255]^f[it&255]^r[Un+3],me=P,Me=ue,it=he,Te=je,Un=Un+4;P=s[me>>>24]<<24^s[Me>>16&255]<<16^s[it>>8&255]<<8^s[Te&255]^r[Un],ue=s[Me>>>24]<<24^s[it>>16&255]<<16^s[Te>>8&255]<<8^s[me&255]^r[Un+1],he=s[it>>>24]<<24^s[Te>>16&255]<<16^s[me>>8&255]<<8^s[Me&255]^r[Un+2],je=s[Te>>>24]<<24^s[me>>16&255]<<16^s[Me>>8&255]<<8^s[it&255]^r[Un+3],B[t]=Gn(P^p),B[t+1]=Gn(je^y),B[t+2]=Gn(he^T),B[t+3]=Gn(ue^b),p=Ut,y=an,T=di,b=Wn,t=t+4}return B.buffer}}class Bt{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){const e=gn(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function gn(a){switch(a){case cn.cbc:return"AES-CBC";case cn.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const Zn=16;class jn{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(n){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?nt(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,i){return this.useSoftware?new Promise((r,s)=>{const o=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(o,t,n,i);const u=this.flush();u?r(u.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n,i)}softwareDecrypt(e,t,n,i){const{currentIV:r,currentResult:s,remainderData:o}=this;if(i!==cn.cbc||t.byteLength!==16)return fe.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=ft(o,e),this.remainderData=null);const u=this.getValidChunk(e);if(!u.length)return null;r&&(n=r);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new Ft),l.expandKey(t);const d=s;return this.currentResult=l.decrypt(u.buffer,0,n),this.currentIV=u.slice(-16).buffer,d||null}webCryptoDecrypt(e,t,n,i){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,i));this.key=t,this.fastAesKey=new Bt(this.subtle,t,i)}return this.fastAesKey.expandKey().then(r=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new ot(this.subtle,new Uint8Array(n),i).decrypt(e.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(fe.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,n,i)))}onWebCryptoError(e,t,n,i){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,i);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%Zn;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(fe.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Mn=Math.pow(2,17);class ni{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const n=e.url;if(!n)return Promise.reject(new wn({type:Z.NETWORK_ERROR,details:x.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((o,u)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(y=>y[0]==="GAP")){u(Ti(e));return}else e.gap=!1;const l=this.loader=r?new r(i):new s(i),d=vi(e);e.loader=l;const f=mn(i.fragLoadPolicy.default),v={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Mn};e.stats=l.stats;const p={onSuccess:(y,T,b,I)=>{this.resetLoader(e,l);let B=y.data;b.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(B.slice(0,16)),B=B.slice(16)),o({frag:e,part:null,payload:B,networkDetails:I})},onError:(y,T,b,I)=>{this.resetLoader(e,l),u(new wn({type:Z.NETWORK_ERROR,details:x.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:de({url:n,data:void 0},y),error:new Error(`HTTP Error ${y.code} ${y.text}`),networkDetails:b,stats:I}))},onAbort:(y,T,b)=>{this.resetLoader(e,l),u(new wn({type:Z.NETWORK_ERROR,details:x.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:b,stats:y}))},onTimeout:(y,T,b)=>{this.resetLoader(e,l),u(new wn({type:Z.NETWORK_ERROR,details:x.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:b,stats:y}))}};t&&(p.onProgress=(y,T,b,I)=>t({frag:e,part:null,payload:b,networkDetails:I})),l.load(d,v,p)})}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((o,u)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){u(Ti(e,t));return}const l=this.loader=r?new r(i):new s(i),d=vi(e,t);e.loader=l;const f=mn(i.fragLoadPolicy.default),v={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Mn};t.stats=l.stats,l.load(d,v,{onSuccess:(p,y,T,b)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const I={frag:e,part:t,payload:p.data,networkDetails:b};n(I),o(I)},onError:(p,y,T,b)=>{this.resetLoader(e,l),u(new wn({type:Z.NETWORK_ERROR,details:x.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:de({url:d.url,data:void 0},p),error:new Error(`HTTP Error ${p.code} ${p.text}`),networkDetails:T,stats:b}))},onAbort:(p,y,T)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),u(new wn({type:Z.NETWORK_ERROR,details:x.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:T,stats:p}))},onTimeout:(p,y,T)=>{this.resetLoader(e,l),u(new wn({type:Z.NETWORK_ERROR,details:x.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:T,stats:p}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const u=Math.round(e.duration/t.duration),l=Math.min(Math.round(n.loaded/r),u),f=(u-l)*Math.round(n.loaded/l);n.total=n.loaded+f}else n.total=Math.max(n.loaded,n.total);const s=n.loading,o=i.loading;s.start?s.first+=o.first-o.start:(s.start=o.start,s.first=o.first),s.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function vi(a,e=null){const t=e||a,n={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(A(i)&&A(r)){var s;let o=i,u=r;if(a.sn==="initSegment"&&Ii((s=a.decryptdata)==null?void 0:s.method)){const l=r-i;l%16&&(u=r+(16-l%16)),i!==0&&(n.resetIV=!0,o=i-16)}n.rangeStart=o,n.rangeEnd=u}return n}function Ti(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:Z.MEDIA_ERROR,details:x.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new wn(n)}function Ii(a){return a==="AES-128"||a==="AES-256"}class wn extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class _i extends bt{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class wi{constructor(e,t,n,i=0,r=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=pi(),this.buffering={audio:pi(),video:pi(),audiovideo:pi()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=s}}function pi(){return{start:0,executeStart:0,executeEnd:0,end:0}}const ii={length:0,start:()=>0,end:()=>0};class vn{static isBuffered(e,t){if(e){const n=vn.getBuffered(e);for(let i=n.length;i--;)if(t>=n.start(i)&&t<=n.end(i))return!0}return!1}static bufferedRanges(e){if(e){const t=vn.getBuffered(e);return vn.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const i=vn.bufferedRanges(e);if(i.length)return vn.bufferedInfo(i,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort((d,f)=>d.start-f.start||f.end-d.end);let i=-1,r=[];if(n)for(let d=0;d<e.length;d++){t>=e[d].start&&t<=e[d].end&&(i=d);const f=r.length;if(f){const v=r[f-1].end;e[d].start-v<n?e[d].end>v&&(r[f-1].end=e[d].end):r.push(e[d])}else r.push(e[d])}else r=e;let s=0,o,u=t,l=t;for(let d=0;d<r.length;d++){const f=r[d].start,v=r[d].end;if(i===-1&&t>=f&&t<=v&&(i=d),t+n>=f&&t<v)u=f,l=v,s=l-t;else if(t+n<f){o=f;break}}return{len:s,start:u||0,end:l||0,nextStart:o,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||ii}catch(t){return fe.log("failed to get media.buffered",t),ii}}}const mi=/\{\$([a-zA-Z0-9-_]+)\}/g;function Ci(a){return mi.test(a)}function zi(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(mi,n=>{const i=n.substring(2,n.length-1),r=t==null?void 0:t[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),n):r})}return e}function Hn(a,e,t){let n=a.variableList;n||(a.variableList=n={});let i,r;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(i))r=s.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else i=e.NAME,r=e.VALUE;i in n?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=r||""}function bn(a,e,t){const n=e.IMPORT;if(t&&n in t){let i=a.variableList;i||(a.variableList=i={}),i[n]=t[n]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const Kn=/^(\d+)x(\d+)$/,ui=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Vn{constructor(e,t){typeof e=="string"&&(e=Vn.parseAttrList(e,t)),M(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)n[i]=parseInt(t.slice(i*2,i*2+2),16);return n}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce((i,r)=>(i[r.toLowerCase()]=!0,i),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Kn.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const i={},r='"';for(ui.lastIndex=0;(n=ui.exec(e))!==null;){const s=n[1].trim();let o=n[2];const u=o.indexOf(r)===0&&o.lastIndexOf(r)===o.length-1;let l=!1;if(u)o=o.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":l=!0}if(t&&(u||l))o=zi(t,o);else if(!l&&!u)switch(s){case"CLOSED-CAPTIONS":if(o==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":fe.warn(`${e}: attribute ${s} is missing quotes`)}i[s]=o}return i}}const Di="com.apple.hls.interstitial";function fi(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function Oi(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class Hi{constructor(e,t,n=0){var i;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(i=t==null?void 0:t.tagOrder)!=null?i:n,t){const r=t.attr;for(const s in r)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==r[s]){fe.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=M(new Vn({}),r,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const r=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);A(r.getTime())&&(this._endDate=r)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(fe.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(A(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===Di}get isValid(){return!!this.id&&!this._badValueForSameId&&A(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const Ui=10;class Qi{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?A(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Ui}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function Gi(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function Vi(a){switch(a){case"AES-128":case"AES-256":return cn.cbc;case"AES-256-CTR":return cn.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function Ai(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function Zi(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Mi(a){const e=Zi(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function yi(a){const e=function(n,i,r){const s=n[i];n[i]=n[r],n[r]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function Ri(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),i=n[n.length-1].split(",");if(i.length===2){const r=i[0]==="base64",s=i[1];r?(n.splice(-1,1),t=Ai(s)):t=Mi(s)}}return t}const Ei=typeof self!="undefined"?self:void 0;var Mt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},xn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Dn(a){switch(a){case xn.FAIRPLAY:return Mt.FAIRPLAY;case xn.PLAYREADY:return Mt.PLAYREADY;case xn.WIDEVINE:return Mt.WIDEVINE;case xn.CLEARKEY:return Mt.CLEARKEY}}var kn={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function ai(a){if(a===kn.WIDEVINE)return Mt.WIDEVINE;if(a===kn.PLAYREADY)return Mt.PLAYREADY;if(a===kn.CENC||a===kn.CLEARKEY)return Mt.CLEARKEY}function hi(a){switch(a){case Mt.FAIRPLAY:return xn.FAIRPLAY;case Mt.PLAYREADY:return xn.PLAYREADY;case Mt.WIDEVINE:return xn.WIDEVINE;case Mt.CLEARKEY:return xn.CLEARKEY}}function sn(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[Mt.FAIRPLAY,Mt.WIDEVINE,Mt.PLAYREADY,Mt.CLEARKEY].filter(i=>!!e[i]):[];return!n[Mt.WIDEVINE]&&t&&n.push(Mt.WIDEVINE),n}const In=function(a){return Ei!=null&&(a=Ei.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function oi(a,e,t,n){let i;switch(a){case Mt.FAIRPLAY:i=["cenc","sinf"];break;case Mt.WIDEVINE:case Mt.PLAYREADY:i=["cenc"];break;case Mt.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return ri(i,e,t,n)}function ri(a,e,t,n){return[{initDataTypes:a,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs=${r}`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs=${r}`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function gi(a){var e;return a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function Xi(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(s){const o=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(o){const u=Ai(o).subarray(0,16);return yi(u),u}}return null}let $i={};class Ki{static clearKeyUriToKeyIdMap(){$i={}}constructor(e,t,n,i=[1],r=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Gi(e)}isSupported(){if(this.method){if(Gi(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case xn.FAIRPLAY:case xn.WIDEVINE:case xn.PLAYREADY:case xn.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(Gi(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(fe.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=rr(e);return new Ki(this.method,this.uri,"identity",this.keyFormatVersions,n)}const t=Ri(this.uri);if(t)switch(this.keyFormat){case xn.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case xn.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Ke(n,null,t),this.keyId=Xi(t);break}default:{let n=t.subarray(0,16);if(n.length!==16){const i=new Uint8Array(16);i.set(n,16-n.length),n=i}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=$i[this.uri];if(!n){const i=Object.keys($i).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),$i[this.uri]=n}this.keyId=n}return this}}function rr(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const sr=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,xr=/#EXT-X-MEDIA:(.*)/g,us=/^#EXT(?:INF|-X-TARGETDURATION):/m,Gr=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Sr=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class er{static findGroup(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.id===t)return i}}static resolve(e,t){return Rt.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return us.test(e)}static parseMasterPlaylist(e,t){const n=Ci(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},r=[];sr.lastIndex=0;let s;for(;(s=sr.exec(e))!=null;)if(s[1]){var o;const l=new Vn(s[1],i),d=zi(i,s[2]),f={attrs:l,bitrate:l.decimalInteger("BANDWIDTH")||l.decimalInteger("AVERAGE-BANDWIDTH"),name:l.NAME,url:er.resolve(d,t)},v=l.decimalResolution("RESOLUTION");v&&(f.width=v.width,f.height=v.height),Pr(l.CODECS,f);const p=l["SUPPLEMENTAL-CODECS"];p&&(f.supplemental={},Pr(p,f.supplemental)),(o=f.unknownCodecs)!=null&&o.length||r.push(f),i.levels.push(f)}else if(s[3]){const l=s[3],d=s[4];switch(l){case"SESSION-DATA":{const f=new Vn(d,i),v=f["DATA-ID"];v&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[v]=f);break}case"SESSION-KEY":{const f=_r(d,t,i);f.encrypted&&f.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(f)):fe.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${d}"`);break}case"DEFINE":{{const f=new Vn(d,i);Hn(i,f,t)}break}case"CONTENT-STEERING":{const f=new Vn(d,i);i.contentSteering={uri:er.resolve(f["SERVER-URI"],t),pathwayId:f["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=dr(d);break}}}const u=r.length>0&&r.length<i.levels.length;return i.levels=u?r:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,n){let i;const r={},s=n.levels,o={AUDIO:s.map(l=>({id:l.attrs.AUDIO,audioCodec:l.audioCodec})),SUBTITLES:s.map(l=>({id:l.attrs.SUBTITLES,textCodec:l.textCodec})),"CLOSED-CAPTIONS":[]};let u=0;for(xr.lastIndex=0;(i=xr.exec(e))!==null;){const l=new Vn(i[1],n),d=l.TYPE;if(d){const f=o[d],v=r[d]||[];r[d]=v;const p=l.LANGUAGE,y=l["ASSOC-LANGUAGE"],T=l.CHANNELS,b=l.CHARACTERISTICS,I=l["INSTREAM-ID"],B={attrs:l,bitrate:0,id:u++,groupId:l["GROUP-ID"]||"",name:l.NAME||p||"",type:d,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:p,url:l.URI?er.resolve(l.URI,t):""};if(y&&(B.assocLang=y),T&&(B.channels=T),b&&(B.characteristics=b),I&&(B.instreamId=I),f!=null&&f.length){const P=er.findGroup(f,B.groupId)||f[0];Vr(B,P,"audioCodec"),Vr(B,P,"textCodec")}v.push(B)}}return r}static parseLevelPlaylist(e,t,n,i,r,s){var o;const u={url:t},l=new Qi(t),d=l.fragments,f=[];let v=null,p=0,y=0,T=0,b=0,I=0,B=null,P=new pe(i,u),ue,he,je,me=-1,Me=!1,it=null,Te;if(Gr.lastIndex=0,l.m3u8=e,l.hasVariableRefs=Ci(e),((o=Gr.exec(e))==null?void 0:o[0])!=="#EXTM3U")return l.playlistParsingError=new Error("Missing format identifier #EXTM3U"),l;for(;(ue=Gr.exec(e))!==null;){Me&&(Me=!1,P=new pe(i,u),P.playlistOffset=T,P.start=T,P.sn=p,P.cc=b,I&&(P.bitrate=I),P.level=n,v&&(P.initSegment=v,v.rawProgramDateTime&&(P.rawProgramDateTime=v.rawProgramDateTime,v.rawProgramDateTime=null),it&&(P.setByteRange(it),it=null)));const Wn=ue[1];if(Wn){P.duration=parseFloat(Wn);const Un=(" "+ue[2]).slice(1);P.title=Un||null,P.tagList.push(Un?["INF",Wn,Un]:["INF",Wn])}else if(ue[3]){if(A(P.duration)){P.playlistOffset=T,P.start=T,je&&Or(P,je,l),P.sn=p,P.level=n,P.cc=b,d.push(P);const Un=(" "+ue[3]).slice(1);P.relurl=zi(l,Un),Lr(P,B,f),B=P,T+=P.duration,p++,y=0,Me=!0}}else{if(ue=ue[0].match(Sr),!ue){fe.warn("No matches on slow regex match for level playlist!");continue}for(he=1;he<ue.length&&ue[he]===void 0;he++);const Un=(" "+ue[he]).slice(1),An=(" "+ue[he+1]).slice(1),Gn=ue[he+2]?(" "+ue[he+2]).slice(1):null;switch(Un){case"BYTERANGE":B?P.setByteRange(An,B):P.setByteRange(An);break;case"PROGRAM-DATE-TIME":P.rawProgramDateTime=An,P.tagList.push(["PROGRAM-DATE-TIME",An]),me===-1&&(me=d.length);break;case"PLAYLIST-TYPE":l.type&&ur(l,Un,ue),l.type=An.toUpperCase();break;case"MEDIA-SEQUENCE":l.startSN!==0?ur(l,Un,ue):d.length>0&&Qr(l,Un,ue),p=l.startSN=parseInt(An);break;case"SKIP":{l.skippedSegments&&ur(l,Un,ue);const _n=new Vn(An,l),Gt=_n.decimalInteger("SKIPPED-SEGMENTS");if(A(Gt)){l.skippedSegments+=Gt;for(let Jn=Gt;Jn--;)d.push(null);p+=Gt}const Ht=_n.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ht&&(l.recentlyRemovedDateranges=(l.recentlyRemovedDateranges||[]).concat(Ht.split(" ")));break}case"TARGETDURATION":l.targetduration!==0&&ur(l,Un,ue),l.targetduration=Math.max(parseInt(An),1);break;case"VERSION":l.version!==null&&ur(l,Un,ue),l.version=parseInt(An);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":l.live||ur(l,Un,ue),l.live=!1;break;case"#":(An||Gn)&&P.tagList.push(Gn?[An,Gn]:[An]);break;case"DISCONTINUITY":b++,P.tagList.push(["DIS"]);break;case"GAP":P.gap=!0,P.tagList.push([Un]);break;case"BITRATE":P.tagList.push([Un,An]),I=parseInt(An)*1e3,A(I)?P.bitrate=I:I=0;break;case"DATERANGE":{const _n=new Vn(An,l),Gt=new Hi(_n,l.dateRanges[_n.ID],l.dateRangeTagCount);l.dateRangeTagCount++,Gt.isValid||l.skippedSegments?l.dateRanges[Gt.id]=Gt:fe.warn(`Ignoring invalid DATERANGE tag: "${An}"`),P.tagList.push(["EXT-X-DATERANGE",An]);break}case"DEFINE":{{const _n=new Vn(An,l);"IMPORT"in _n?bn(l,_n,s):Hn(l,_n,t)}break}case"DISCONTINUITY-SEQUENCE":l.startCC!==0?ur(l,Un,ue):d.length>0&&Qr(l,Un,ue),l.startCC=b=parseInt(An);break;case"KEY":{const _n=_r(An,t,l);if(_n.isSupported()){if(_n.method==="NONE"){je=void 0;break}je||(je={}),je[_n.keyFormat]&&(je=M({},je)),je[_n.keyFormat]=_n}else fe.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${An}"`);break}case"START":l.startTimeOffset=dr(An);break;case"MAP":{const _n=new Vn(An,l);if(P.duration){const Gt=new pe(i,u);qr(Gt,_n,n,je),v=Gt,P.initSegment=v,v.rawProgramDateTime&&!P.rawProgramDateTime&&(P.rawProgramDateTime=v.rawProgramDateTime)}else{const Gt=P.byteRangeEndOffset;if(Gt){const Ht=P.byteRangeStartOffset;it=`${Gt-Ht}@${Ht}`}else it=null;qr(P,_n,n,je),v=P,Me=!0}v.cc=b;break}case"SERVER-CONTROL":{Te&&ur(l,Un,ue),Te=new Vn(An),l.canBlockReload=Te.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=Te.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&Te.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=Te.optionalFloat("PART-HOLD-BACK",0),l.holdBack=Te.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{l.partTarget&&ur(l,Un,ue);const _n=new Vn(An);l.partTarget=_n.decimalFloatingPoint("PART-TARGET");break}case"PART":{let _n=l.partList;_n||(_n=l.partList=[]);const Gt=y>0?_n[_n.length-1]:void 0,Ht=y++,Jn=new Vn(An,l),Xn=new _e(Jn,P,u,Ht,Gt);_n.push(Xn),P.duration+=Xn.duration;break}case"PRELOAD-HINT":{const _n=new Vn(An,l);l.preloadHint=_n;break}case"RENDITION-REPORT":{const _n=new Vn(An,l);l.renditionReports=l.renditionReports||[],l.renditionReports.push(_n);break}default:fe.warn(`line parsed but not handled: ${ue}`);break}}}B&&!B.relurl?(d.pop(),T-=B.duration,l.partList&&(l.fragmentHint=B)):l.partList&&(Lr(P,B,f),P.cc=b,l.fragmentHint=P,je&&Or(P,je,l)),l.targetduration||(l.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const Ut=d.length,an=d[0],di=d[Ut-1];if(T+=l.skippedSegments*l.targetduration,T>0&&Ut&&di){l.averagetargetduration=T/Ut;const Wn=di.sn;l.endSN=Wn!=="initSegment"?Wn:0,l.live||(di.endList=!0),an&&l.startCC===void 0&&(l.startCC=an.cc),me>0&&(Xr(d,me),an&&f.unshift(an))}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(T+=l.fragmentHint.duration),l.totalduration=T,f.length&&l.dateRangeTagCount&&an&&Rr(f,l),l.endCC=b,l}}function Rr(a,e){const t=a.length,n=a[t-1],i=e.live?1/0:e.totalduration,r=Object.keys(e.dateRanges);for(let s=r.length;s--;){const o=e.dateRanges[r[s]],u=o.startDate.getTime();o.tagAnchor=n.ref;for(let l=t;l--;){const d=cs(e,u,a,l,i);if(d!==-1){o.tagAnchor=e.fragments[d].ref;break}}}}function cs(a,e,t,n,i){const r=t[n];if(r){const o=r.programDateTime;if(e>=o||n===0){var s;const u=(((s=t[n+1])==null?void 0:s.start)||i)-r.start;if(e<=o+u*1e3){const l=t[n].sn-a.startSN,d=a.fragments;if(d.length>t.length){const v=(t[n+1]||d[d.length-1]).sn-a.startSN;for(let p=v;p>l;p--){const y=d[p].programDateTime;if(e>=y&&e<y+d[p].duration*1e3)return p}}return l}}}return-1}function _r(a,e,t){var n,i;const r=new Vn(a,t),s=(n=r.METHOD)!=null?n:"",o=r.URI,u=r.hexadecimalInteger("IV"),l=r.KEYFORMATVERSIONS,d=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!u&&fe.error(`Invalid IV: ${r.IV}`);const f=o?er.resolve(o,e):"",v=(l||"1").split("/").map(Number).filter(Number.isFinite);return new Ki(s,f,d,v,u)}function dr(a){const t=new Vn(a).decimalFloatingPoint("TIME-OFFSET");return A(t)?t:null}function Pr(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(r=>Tn(r,n));i.length&&(e[`${n}Codec`]=i.map(r=>r.split("/")[0]).join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function Vr(a,e,t){const n=e[t];n&&(a[t]=n)}function Xr(a,e){let t=a[e];for(let n=e;n--;){const i=a[n];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Lr(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function qr(a,e,t,n){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",n&&(a.levelkeys=n),a.initSegment=null}function Or(a,e,t){a.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&n.push(a)}function ur(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function Qr(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function zr(a,e){const t=e.startPTS;if(A(t)){let n=0,i;e.sn>a.sn?(n=t-a.start,i=a):(n=a.start-t,i=e),i.duration!==n&&i.setDuration(n)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.setStart(a.start+(a.minEndPTS-a.start)):e.setStart(a.start+a.duration):e.setStart(Math.max(a.start-e.duration,0))}function Jr(a,e,t,n,i,r){n-t<=0&&(fe.warn("Fragment should have a positive duration",e),n=t+e.duration,r=i+e.duration);let o=t,u=n;const l=e.startPTS,d=e.endPTS;if(A(l)){const b=Math.abs(l-t);A(e.deltaPTS)?e.deltaPTS=Math.max(b,e.deltaPTS):e.deltaPTS=b,o=Math.max(t,l),t=Math.min(t,l),i=Math.min(i,e.startDTS),u=Math.min(n,d),n=Math.max(n,d),r=Math.max(r,e.endDTS)}const f=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(n-e.start),e.startPTS=t,e.maxStartPTS=o,e.startDTS=i,e.endPTS=n,e.minEndPTS=u,e.endDTS=r;const v=e.sn;if(!a||v<a.startSN||v>a.endSN)return 0;let p;const y=v-a.startSN,T=a.fragments;for(T[y]=e,p=y;p>0;p--)zr(T[p],T[p-1]);for(p=y;p<T.length-1;p++)zr(T[p],T[p+1]);return a.fragmentHint&&zr(T[T.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,f}function Zr(a,e){if(a===e)return;let t=null;const n=a.fragments;for(let u=n.length-1;u>=0;u--){const l=n[u].initSegment;if(l){t=l;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i;ei(a,e,(u,l,d,f)=>{if(!e.startCC&&l.cc!==u.cc){var v,p;const y=u.cc-l.cc;for(let T=d;T<f.length;T++)f[T].cc+=y;e.startCC=(v=(p=ar(a,e.startSN-1))==null?void 0:p.cc)!=null?v:f[0].cc,e.endCC=f[f.length-1].cc}A(u.startPTS)&&A(u.endPTS)&&(l.setStart(l.startPTS=u.startPTS),l.startDTS=u.startDTS,l.maxStartPTS=u.maxStartPTS,l.endPTS=u.endPTS,l.endDTS=u.endDTS,l.minEndPTS=u.minEndPTS,l.setDuration(u.endPTS-u.startPTS),l.duration&&(i=l),e.PTSKnown=e.alignedSliding=!0),u.hasStreams&&(l.elementaryStreams=u.elementaryStreams),l.loader=u.loader,u.hasStats&&(l.stats=u.stats),u.initSegment&&(l.initSegment=u.initSegment,t=u.initSegment)});const r=e.fragments,s=e.fragmentHint?r.concat(e.fragmentHint):r;if(t&&s.forEach(u=>{var l;u&&(!u.initSegment||u.initSegment.relurl===((l=t)==null?void 0:l.relurl))&&(u.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=r.some(u=>!u),e.deltaUpdateFailed){fe.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let u=e.skippedSegments;u--;)r.shift();e.startSN=r[0].sn}else{e.endCC=r[r.length-1].cc,e.canSkipDateRanges&&(e.dateRanges=pr(a.dateRanges,e));const u=a.fragments.filter(l=>l.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let l=1;l<s.length;l++)s[l].programDateTime===null&&Lr(s[l],s[l-1],u);Rr(u,e)}li(a.partList,e.partList,(u,l)=>{l.elementaryStreams=u.elementaryStreams,l.stats=u.stats}),i?Jr(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):ji(a,e),r.length&&(e.totalduration=e.edge-r[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const o=e.advancedDateTime;if(e.advanced&&o){const u=e.edge;e.driftStart||(e.driftStartTime=o,e.driftStart=u),e.driftEndTime=o,e.driftEnd=u}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function pr(a,e){const{dateRanges:t,recentlyRemovedDateranges:n}=e,i=M({},a);n&&n.forEach(o=>{delete i[o]});const s=Object.keys(i).length;return s&&Object.keys(t).forEach(o=>{const u=i[o],l=new Hi(t[o].attr,u);l.isValid?(i[o]=l,u||(l.tagOrder+=s)):fe.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${qe(t[o].attr)}"`)}),i}function li(a,e,t){if(a&&e){let n=0;for(let i=0,r=a.length;i<=r;i++){const s=a[i],o=e[i+n];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?t(s,o):n--}}}function ei(a,e,t){const n=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(n?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,u=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let l=i;l<=r;l++){const d=u[s+l];let f=o[l];if(n&&!f&&d&&(f=e.fragments[l]=d),d&&f){if(t(d,f,l,o),d.url&&d.url!==f.url){e.playlistParsingError=Wi(`media sequence mismatch ${f.sn}:`,a,e,d,f);return}else if(d.cc!==f.cc){e.playlistParsingError=Wi(`discontinuity sequence mismatch (${d.cc}!=${f.cc})`,a,e,d,f);return}}}}function Wi(a,e,t,n,i){return new Error(`${a} ${i.url}
|
|
Playlist starting @${e.startSN}
|
|
${e.m3u8}
|
|
|
|
Playlist starting @${t.startSN}
|
|
${t.m3u8}`)}function ji(a,e,t=!0){const n=e.startSN+e.skippedSegments-a.startSN,i=a.fragments,r=n>=0;let s=0;if(r&&n<i.length)s=i[n].start;else if(r&&e.startSN===a.endSN+1)s=a.fragmentEnd;else if(r&&t)s=a.fragmentStart+n*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)s=a.fragmentStart;else return;ki(e,s)}function ki(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;n<t.length;n++)t[n].addStart(e);a.fragmentHint&&a.fragmentHint.addStart(e)}}function Bi(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const n=a.fragments;if(n.length&&t*4>e){const r=n[n.length-1].duration*1e3;r<t&&(t=r)}}else t/=2;return Math.round(t)}function ar(a,e,t){if(!a)return null;let n=a.fragments[e-a.startSN];return n||(n=a.fragmentHint,n&&n.sn===e)?n:e<a.startSN&&t&&t.sn===e?t:null}function tr(a,e,t){return a?fr(a.partList,e,t):null}function fr(a,e,t){if(a)for(let n=a.length;n--;){const i=a[n];if(i.index===t&&i.fragment.sn===e)return i}return null}function hr(a){a.forEach((e,t)=>{var n;(n=e.details)==null||n.fragments.forEach(i=>{i.level=t,i.initSegment&&(i.initSegment.level=t)})})}function nr(a,e){for(let n=0,i=a.length;n<i;n++){var t;if(((t=a[n])==null?void 0:t.cc)===e)return a[n]}return null}function Mr(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function Ir(a,e){if(a){const t=a.start+e;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function xs(a,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)Ir(t[n],a);e.fragmentHint&&Ir(e.fragmentHint,a),e.alignedSliding=!0}function Vs(a,e){a&&(Fi(e,a),!e.alignedSliding&&a&&Si(e,a),!e.alignedSliding&&a&&!e.skippedSegments&&ji(a,e,!1))}function Fi(a,e){if(!Mr(e,a))return;const t=Math.min(e.endCC,a.endCC),n=nr(e.fragments,t),i=nr(a.fragments,t);if(!n||!i)return;fe.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const r=n.start-i.start;xs(r,a)}function Si(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,n=e.fragments;if(!t.length||!n.length)return;let i,r;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(i=nr(n,s),r=nr(t,s)),(!i||!r)&&(i=n[Math.floor(n.length/2)],r=nr(t,i.cc)||t[Math.floor(t.length/2)]);const o=i.programDateTime,u=r.programDateTime;if(!o||!u)return;const l=(u-o)/1e3-(r.start-i.start);xs(l,a)}const Ni={toString:function(a){let e="";const t=a.length;for(let n=0;n<t;n++)e+=`[${a.start(n).toFixed(3)}-${a.end(n).toFixed(3)}]`;return e}},tt={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class qi extends _i{constructor(e,t,n,i,r){super(i,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=tt.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:s,fragCurrent:o,media:u,mediaBuffer:l,state:d}=this,f=u?u.currentTime:0,v=vn.bufferInfo(l||u,f,s.maxBufferHole);if(this.log(`media seeking to ${A(f)?f.toFixed(3):f}, state: ${d}`),this.state===tt.ENDED)this.resetLoadingState();else if(o){const p=s.maxFragLookUpTolerance,y=o.start-p,T=o.start+o.duration+p;if(!v.len||T<v.start||y>v.end){const b=f>T;(f<y||b)&&(b&&o.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),o.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(u){this.fragmentTracker.removeFragmentsInRange(f,1/0,this.playlistType,!0);const p=this.lastCurrentTime;if(f>p&&(this.lastCurrentTime=f),!this.loadingParts){const y=Math.max(v.end,f),T=this.shouldLoadParts(this.getLevelDetails(),y);T&&(this.log(`LL-Part loading ON after seeking to ${f.toFixed(2)} with buffer @${y.toFixed(2)}`),this.loadingParts=T)}}!this.hls.hasEnoughToStart&&!v.len&&(this.log(`setting startPosition to ${f} because of seek before start`),this.nextLoadPosition=this.startPosition=f),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=r,this.hls=e,this.fragmentLoader=new ni(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new jn(e.config)}registerListeners(){const{hls:e}=this;e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===tt.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=tt.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const n=e.end||0,i=this.config.timelineOffset||0;if(n<=i)return!1;const r=e.nextStart;if(r&&r>i&&r<t.edge||this.media.currentTime<e.start)return!1;const o=t.partList;if(o!=null&&o.length){const l=o[o.length-1];return vn.isBuffered(this.media,l.start+l.duration/2)}const u=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(u)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;n.removeEventListener("seeking",this.onMediaSeeking),n.removeEventListener("ended",this.onMediaEnded),n.addEventListener("seeking",this.onMediaSeeking),n.addEventListener("ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===tt.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(i!==null){if(i.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),i.removeEventListener("seeking",this.onMediaSeeking),i.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=tt.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const i=r=>{const s=r.frag;if(this.fragContextChanged(s)){this.warn(`${s.type} sn: ${s.sn}${r.part?" part: "+r.part.index:""} of ${this.fragInfo(s,!1,r.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(s);return}s.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,n,i).then(r=>{if(!r)return;const s=this.state,o=r.frag;if(this.fragContextChanged(o)){(s===tt.FRAG_LOADING||!this.fragCurrent&&s===tt.PARSING)&&(this.fragmentTracker.removeFragment(o),this.state=tt.IDLE);return}"payload"in r&&(this.log(`Loaded ${o.type} sn: ${o.sn} of ${this.playlistLabel()} ${o.level}`),this.hls.trigger(m.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===tt.STOPPED||this.state===tt.ERROR||(this.warn(`Frag error: ${(r==null?void 0:r.message)||r}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===Bn.APPENDING){const r=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(e.duration,s?s.len:this.config.maxBufferLength),u=this.backtrackFragment;((u?e.sn-u.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===Bn.PARTIAL&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(t==null?void 0:t.live)&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(m.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{const i=n==null?void 0:n.frag;if(!i||this.fragContextChanged(i)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{frag:r,payload:s}=n,o=r.decryptdata;if(s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&Gi(o.method)){const u=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,Vi(o.method)).catch(l=>{throw i.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:r}),l}).then(l=>{const d=self.performance.now();return i.trigger(m.FRAG_DECRYPTED,{frag:r,payload:l,stats:{tstart:u,tdecrypt:d}}),n.payload=l,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===tt.STOPPED||this.state===tt.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state!==tt.STOPPED&&(this.state=tt.IDLE),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${n?Ni.toString(vn.getBuffered(n)):"(detached)"})`),Le(e)){var i;if(e.type!==ae.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(o=>!!s[o])){this.state=tt.IDLE;return}}const r=(i=this.levels)==null?void 0:i[e.level];r!=null&&r.fragmentError&&(this.log(`Resetting level fragment error count of ${r.fragmentError} on frag buffered`),r.fragmentError=0)}this.state=tt.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:r}=e,s=!r||r.length===0||r.some(u=>!u),o=new wi(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!s);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var r;this.fragCurrent=e;const s=t==null?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=tt.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(f=>{if(!this.fragContextChanged(f.frag))return this.hls.trigger(m.KEY_LOADED,f),this.state===tt.KEY_LOADING&&(this.state=tt.IDLE),f}),this.hls.trigger(m.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments);const u=this.fragPrevious;if(Le(e)&&(!u||e.sn!==u.sn)){const f=this.shouldLoadParts(t.details,e.end);f!==this.loadingParts&&(this.log(`LL-Part loading ${f?"ON":"OFF"} loading sn ${u==null?void 0:u.sn}->${e.sn}`),this.loadingParts=f)}if(n=Math.max(e.start,n||0),this.loadingParts&&Le(e)){const f=s.partList;if(f&&i){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const v=this.getNextPart(f,e,n);if(v>-1){const p=f[v];e=this.fragCurrent=p.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${p.index} (${v}/${f.length-1}) of ${this.fragInfo(e,!1,p)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=p.start+p.duration,this.state=tt.FRAG_LOADING;let y;return o?y=o.then(T=>!T||this.fragContextChanged(T.frag)?null:this.doFragPartsLoad(e,p,t,i)).catch(T=>this.handleFragLoadError(T)):y=this.doFragPartsLoad(e,p,t,i).catch(T=>this.handleFragLoadError(T)),this.hls.trigger(m.FRAG_LOADING,{frag:e,part:p,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):y}else if(!e.url||this.loadedEndOfParts(f,n))return Promise.resolve(null)}}if(Le(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${s?"["+s.startSN+"-"+s.endSN+"]":""}, target: ${parseFloat(n.toFixed(3))}`),A(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=tt.FRAG_LOADING;const l=this.config.progressive;let d;return l&&o?d=o.then(f=>!f||this.fragContextChanged(f==null?void 0:f.frag)?null:this.fragmentLoader.load(e,i)).catch(f=>this.handleFragLoadError(f)):d=Promise.all([this.fragmentLoader.load(e,l?i:void 0),o]).then(([f])=>(!l&&f&&i&&i(f),f)).catch(f=>this.handleFragLoadError(f)),this.hls.trigger(m.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):d}doFragPartsLoad(e,t,n,i){return new Promise((r,s)=>{var o;const u=[],l=(o=n.details)==null?void 0:o.partList,d=f=>{this.fragmentLoader.loadPart(e,f,i).then(v=>{u[f.index]=v;const p=v.part;this.hls.trigger(m.FRAG_LOADED,v);const y=tr(n.details,e.sn,f.index+1)||fr(l,e.sn,f.index+1);if(y)d(y);else return r({frag:e,part:p,partsLoaded:u})}).catch(s)};d(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===x.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(m.ERROR,t)}else this.hls.trigger(m.ERROR,{type:Z.OTHER_ERROR,details:x.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==tt.PARSING){!this.fragCurrent&&this.state!==tt.STOPPED&&this.state!==tt.ERROR&&(this.state=tt.IDLE);return}const{frag:n,part:i,level:r}=t,s=self.performance.now();n.stats.parsing.end=s,i&&(i.stats.parsing.end=s);const o=this.getLevelDetails(),l=o&&n.sn>o.endSN||this.shouldLoadParts(o,n.end);l!==this.loadingParts&&(this.log(`LL-Part loading ${l?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=l),this.updateLevelTiming(n,i,r,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var n;const r=e.partList[0],s=r.end+(((n=e.fragmentHint)==null?void 0:n.duration)||0);if(t>=s){var i;if((this.hls.hasEnoughToStart?((i=this.media)==null?void 0:i.currentTime)||this.lastCurrentTime:this.getLoadPosition())>r.start-r.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:i,sn:r,part:s}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${r} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const o=t[i],u=o.details,l=s>-1?tr(u,r,s):null,d=l?l.fragment:ar(u,r,n);return d?(n&&n!==d&&(d.stats=n.stats),{frag:d,part:l,level:o}):null}bufferFragmentData(e,t,n,i,r){var s;if(!e||this.state!==tt.PARSING)return;const{data1:o,data2:u}=e;let l=o;if(o&&u&&(l=ft(o,u)),!((s=l)!=null&&s.length))return;const d={type:e.type,frag:t,part:n,chunkMeta:i,parent:t.type,data:l};if(this.hls.trigger(m.BUFFER_APPENDING,d),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!vn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=vn.bufferInfo(t,n,0),r=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(e.start-s,i.end-s),n+s);e.start-o>s&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){var n;const i=this.getLoadPosition();if(!A(i))return null;const s=this.lastCurrentTime>i||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,i,t,s)}getFwdBufferInfoAtPos(e,t,n,i){const r=vn.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&(r.nextStart<=s.end||s.gap)){const o=Math.max(Math.min(r.nextStart,s.end)-t,i);return vn.bufferInfo(e,t,o)}}return r}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,i=Math.max(Math.min(e-t,n.maxBufferLength),t),r=Math.max(e-t*3,n.maxMaxBufferLength/2,i);return r>=i?(n.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=ae.MAIN){var n;const i=(n=this.fragmentTracker)==null?void 0:n.getAppendedFrag(e,t);return i&&"fragment"in i?i.fragment:i}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:r}=this,s=n[0].start,o=r.lowLatencyMode&&!!t.partList;let u=null;if(t.live){const f=r.initialLiveManifestSize;if(i<f)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${f})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var l;o&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),u=this.getInitialLiveFragment(t,n);const v=this.hls.startPosition,p=this.hls.liveSyncPosition,y=u?(v!==-1&&v>=s?v:p)||u.start:e;this.log(`Setting startPosition to ${y} to match start frag at live edge. mainStart: ${v} liveSyncPosition: ${p} frag.start: ${(l=u)==null?void 0:l.start}`),this.startPosition=this.nextLoadPosition=y}}else e<=s&&(u=n[0]);if(!u){const f=this.loadingParts?t.partEnd:t.fragmentEnd;u=this.getFragmentAtPosition(e,f,t)}let d=this.filterReplacedPrimary(u,t);if(!d&&u){const f=u.sn-t.startSN;d=this.filterReplacedPrimary(n[f+1]||null,t)}return this.mapToInitFragWhenRequired(d)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===Bn.OK||n===Bn.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,i,r){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&n.nextStart)){const o=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i,0);if(o!==null&&n.len+o.len>=r){const u=s.sn;return this.loopSn!==u&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${u}`),this.loopSn=u),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(Kr(this.hls.config)){var e,t;if((e=this.hls.interstitialsManager)==null||(t=e.playingItem)==null?void 0:t.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(Kr(this.hls.config)&&e.type!==ae.SUBTITLE){const n=this.hls.interstitialsManager,i=n==null?void 0:n.bufferingItem;if(i){const s=i.event;if(s){if(s.appendInPlace||Math.abs(e.start-i.start)>1||i.start===0)return null}else if(e.end<=i.start&&(t==null?void 0:t.live)===!1||e.start>i.end&&i.nextEvent&&(i.nextEvent.appendInPlace||e.start-i.end>1))return null}const r=n==null?void 0:n.playerQueue;if(r)for(let s=r.length;s--;){const o=r[s].interstitial;if(o.appendInPlace&&e.start>=o.startTime&&e.end<=o.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let i=-1,r=!1,s=!0;for(let o=0,u=e.length;o<u;o++){const l=e[o];if(s=s&&!l.independent,i>-1&&n<l.start)break;const d=l.loaded;d?i=-1:(r||l.independent||s)&&l.fragment===t&&(i=o),r=d}return i}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e,t){const n=this.fragPrevious;let i=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),i=xt(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=n.sn+1;if(r>=e.startSN&&r<=e.endSN){const s=t[r-e.startSN];n.cc===s.cc&&(i=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=Kt(t,n.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,n){const{config:i}=this;let{fragPrevious:r}=this,{fragments:s,endSN:o}=n;const{fragmentHint:u}=n,{maxFragLookUpTolerance:l}=i,d=n.partList,f=!!(this.loadingParts&&d!=null&&d.length&&u);f&&u&&!this.bitrateTest&&d[d.length-1].fragment.sn===u.sn&&(s=s.concat(u),o=u.sn);let v;if(e<t){var p;const T=e<this.lastCurrentTime||e>t-l||(p=this.media)!=null&&p.paused||!this.startFragRequested?0:l;v=Jt(r,s,e,T)}else v=s[s.length-1];if(v){const y=v.sn-n.startSN,T=this.fragmentTracker.getState(v);if((T===Bn.OK||T===Bn.PARTIAL&&v.gap)&&(r=v),r&&v.sn===r.sn&&(!f||d[0].fragment.sn>v.sn||!n.live&&!f)&&r&&v.level===r.level){const I=s[y+1];v.sn<o&&this.fragmentTracker.getState(I)!==Bn.OK?v=I:v=null}}return v}alignPlaylists(e,t,n){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const r=e.fragmentStart,s=!t,o=e.alignedSliding&&A(r);if(s||!o&&!r){Vs(n,e);const u=e.fragmentStart;return this.log(`Live playlist sliding: ${u.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${i}`),u}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const i=this.timelineOffset;if(n===-1){const r=this.startTimeOffset!==null,s=r?this.startTimeOffset:e.startTimeOffset;s!==null&&A(s)?(n=t+s,s<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${s} found in ${r?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+i}this.nextLoadPosition=n+i}getLoadPosition(){var e;const{media:t}=this;let n=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&Le(e)&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==tt.FRAG_LOADING_WAITING_RETRY)&&(this.state=tt.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const y=this.getCurrentContext(t.chunkMeta);y&&(t.frag=y.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var i;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===x.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:o,flags:u,retryCount:l=0,retryConfig:d}=s||{},f=!!s&&!!d,v=f&&o===Cn.RetryRequest,p=f&&!s.resolved&&u===On.MoveAllAlternatesMatchingHost;if(!v&&p&&Le(n)&&!n.endList)this.resetFragmentErrors(e),this.treatAsGap(n),s.resolved=!0;else if((v||p)&&l<d.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const y=kt(d,l);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${l+1}/${d.maxNumRetry} in ${y}ms`),s.resolved=!0,this.retryDate=self.performance.now()+y,this.state=tt.FRAG_LOADING_WAITING_RETRY}else if(d&&s)if(this.resetFragmentErrors(e),l<d.maxNumRetry)!r&&o!==Cn.RemoveAlternatePermanently&&(s.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${l})`);return}else o===Cn.SendAlternateToPenaltyBox?this.state=tt.WAITING_LEVEL:this.state=tt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===tt.PARSING||this.state===tt.PARSED){const t=e.frag,n=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,n),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const s=!r;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===ae.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==tt.STOPPED&&(this.state=tt.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=vn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===tt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==tt.STOPPED&&(this.state=tt.IDLE)}resetStartWhenNotLoaded(e){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of ${this.playlistLabel()} ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){const r=n.details;if(!r){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((u,l)=>{const d=e.elementaryStreams[l];if(d){const f=d.endPTS-d.startPTS;if(f<=0)return this.warn(`Could not parse fragment ${e.sn} ${l} duration reliably (${f})`),u||!1;const v=i?0:Jr(r,e,d.startPTS,d.endPTS,d.startDTS,d.endDTS);return this.hls.trigger(m.LEVEL_PTS_UPDATED,{details:r,level:n,drift:v,type:l,frag:e,start:d.startPTS,end:d.endPTS}),!0}return u},!1)){var o;if(n.fragmentError===0&&this.treatAsGap(e,n),((o=this.transmuxer)==null?void 0:o.error)===null){const u=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(u.message),this.hls.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.FRAG_PARSING_ERROR,fatal:!1,error:u,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=tt.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(m.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===ae.MAIN?"level":"track"}fragInfo(e,t=!0,n){var i,r;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${((i=t&&!n?e.startPTS:(n||e).start)!=null?i:NaN).toFixed(3)}-${((r=t&&!n?e.endPTS:(n||e).end)!=null?r:NaN).toFixed(3)}]${n&&e.type==="main"?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Kr(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class $r{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;if(e.length)e.length===1?n=e[0]:n=zs(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function zs(a,e){const t=new Uint8Array(e);let n=0;for(let i=0;i<a.length;i++){const r=a[i];t.set(r,n),n+=r.length}return t}var es={exports:{}},ds;function Hr(){return ds||(ds=1,function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(u,l,d){this.fn=u,this.context=l,this.once=d||!1}function r(u,l,d,f,v){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new i(d,f||u,v),y=t?t+l:l;return u._events[y]?u._events[y].fn?u._events[y]=[u._events[y],p]:u._events[y].push(p):(u._events[y]=p,u._eventsCount++),u}function s(u,l){--u._eventsCount===0?u._events=new n:delete u._events[l]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],d,f;if(this._eventsCount===0)return l;for(f in d=this._events)e.call(d,f)&&l.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},o.prototype.listeners=function(l){var d=t?t+l:l,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var v=0,p=f.length,y=new Array(p);v<p;v++)y[v]=f[v].fn;return y},o.prototype.listenerCount=function(l){var d=t?t+l:l,f=this._events[d];return f?f.fn?1:f.length:0},o.prototype.emit=function(l,d,f,v,p,y){var T=t?t+l:l;if(!this._events[T])return!1;var b=this._events[T],I=arguments.length,B,P;if(b.fn){switch(b.once&&this.removeListener(l,b.fn,void 0,!0),I){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,d),!0;case 3:return b.fn.call(b.context,d,f),!0;case 4:return b.fn.call(b.context,d,f,v),!0;case 5:return b.fn.call(b.context,d,f,v,p),!0;case 6:return b.fn.call(b.context,d,f,v,p,y),!0}for(P=1,B=new Array(I-1);P<I;P++)B[P-1]=arguments[P];b.fn.apply(b.context,B)}else{var ue=b.length,he;for(P=0;P<ue;P++)switch(b[P].once&&this.removeListener(l,b[P].fn,void 0,!0),I){case 1:b[P].fn.call(b[P].context);break;case 2:b[P].fn.call(b[P].context,d);break;case 3:b[P].fn.call(b[P].context,d,f);break;case 4:b[P].fn.call(b[P].context,d,f,v);break;default:if(!B)for(he=1,B=new Array(I-1);he<I;he++)B[he-1]=arguments[he];b[P].fn.apply(b[P].context,B)}}return!0},o.prototype.on=function(l,d,f){return r(this,l,d,f,!1)},o.prototype.once=function(l,d,f){return r(this,l,d,f,!0)},o.prototype.removeListener=function(l,d,f,v){var p=t?t+l:l;if(!this._events[p])return this;if(!d)return s(this,p),this;var y=this._events[p];if(y.fn)y.fn===d&&(!v||y.once)&&(!f||y.context===f)&&s(this,p);else{for(var T=0,b=[],I=y.length;T<I;T++)(y[T].fn!==d||v&&!y[T].once||f&&y[T].context!==f)&&b.push(y[T]);b.length?this._events[p]=b.length===1?b[0]:b:s(this,p)}return this},o.prototype.removeAllListeners=function(l){var d;return l?(d=t?t+l:l,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,a.exports=o}(es)),es.exports}var fs=Hr(),hs=F(fs);const ms="1.6.2",ts={};function Qo(){return typeof __HLS_WORKER_BUNDLE__=="function"}function Jo(){const a=ts[ms];if(a)return a.clientCount++,a;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),i={worker:new self.Worker(t),objectURL:t,clientCount:1};return ts[ms]=i,i}function $o(a){const e=ts[a];if(e)return e.clientCount++,e;const t=new self.URL(a,self.location.href).href,i={worker:new self.Worker(t),scriptURL:t,clientCount:1};return ts[a]=i,i}function el(a){const e=ts[a||ms];if(e&&e.clientCount--===1){const{worker:n,objectURL:i}=e;delete ts[a||ms],i&&self.URL.revokeObjectURL(i),n.terminate()}}function Ra(a,e){return e+10<=a.length&&a[e]===51&&a[e+1]===68&&a[e+2]===73&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function Zs(a,e){return e+10<=a.length&&a[e]===73&&a[e+1]===68&&a[e+2]===51&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function Rs(a,e){let t=0;return t=(a[e]&127)<<21,t|=(a[e+1]&127)<<14,t|=(a[e+2]&127)<<7,t|=a[e+3]&127,t}function gs(a,e){const t=e;let n=0;for(;Zs(a,e);){n+=10;const i=Rs(a,e+6);n+=i,Ra(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)}function tl(a,e,t,n){const i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],r=e[t+2],s=r>>2&15;if(s>12){const p=new Error(`invalid ADTS sampling index:${s}`);a.emit(m.ERROR,m.ERROR,{type:Z.MEDIA_ERROR,details:x.FRAG_PARSING_ERROR,fatal:!0,error:p,reason:p.message});return}const o=(r>>6&3)+1,u=e[t+3]>>6&3|(r&1)<<2,l="mp4a.40."+o,d=i[s];let f=s;(o===5||o===29)&&(f-=3);const v=[o<<3|(f&14)>>1,(f&1)<<7|u<<3];return fe.log(`manifest codec:${n}, parsed codec:${l}, channels:${u}, rate:${d} (ADTS object type:${o} sampling index:${s})`),{config:v,samplerate:d,channelCount:u,codec:l,parsedCodec:l,manifestCodec:n}}function La(a,e){return a[e]===255&&(a[e+1]&246)===240}function Ia(a,e){return a[e+1]&1?7:9}function Ks(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function nl(a,e){return e+5<a.length}function Ls(a,e){return e+1<a.length&&La(a,e)}function il(a,e){return nl(a,e)&&La(a,e)&&Ks(a,e)<=a.length-e}function rl(a,e){if(Ls(a,e)){const t=Ia(a,e);if(e+t>=a.length)return!1;const n=Ks(a,e);if(n<=t)return!1;const i=e+n;return i===a.length||Ls(a,i)}return!1}function Ca(a,e,t,n,i){if(!a.samplerate){const r=tl(e,t,n,i);if(!r)return;M(a,r)}}function Da(a){return 1024*9e4/a}function sl(a,e){const t=Ia(a,e);if(e+t<=a.length){const n=Ks(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function wa(a,e,t,n,i){const r=Da(a.samplerate),s=n+i*r,o=sl(e,t);let u;if(o){const{frameLength:f,headerLength:v}=o,p=v+f,y=Math.max(0,t+p-e.length);y?(u=new Uint8Array(p-v),u.set(e.subarray(t+v,e.length),0)):u=e.subarray(t+v,t+p);const T={unit:u,pts:s};return y||a.samples.push(T),{sample:T,length:p,missing:y}}const l=e.length-t;return u=new Uint8Array(l),u.set(e.subarray(t,e.length),0),{sample:{unit:u,pts:s},length:l,missing:-1}}function al(a,e){return Zs(a,e)&&Rs(a,e+6)+10<=a.length-e}function ol(a){if(a.size<2)return;const e=Zt(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function ll(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=Zt(a.data.subarray(t),!0);t+=n.length+1;const i=Zt(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Zt(a.data.subarray(1));return{key:a.type,info:"",data:e}}function ul(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=Zt(a.data.subarray(t),!0);t+=n.length+1;const i=Zt(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Zt(a.data);return{key:a.type,info:"",data:e}}function cl(a){return btoa(String.fromCharCode(...a))}function _a(a,e){if(a<0)return-_a(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const i=Math.floor(a*t);return(i%2===0?i:i+1)/t}else return Math.round(a*t)/t}function dl(a,e){const t=new URL(a),n=new URL(e);if(t.origin!==n.origin)return a;const i=t.pathname.split("/").slice(1),r=n.pathname.split("/").slice(1,-1);for(;i[0]===r[0];)i.shift(),r.shift();for(;r.length;)r.shift(),i.unshift("..");return i.join("/")}function fl(){try{return crypto.randomUUID()}catch(a){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?r:r&3|8).toString(16)})}}}function hl(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function Hs(a,e=0,t=1/0){return ml(a,e,t,Uint8Array)}function ml(a,e,t,n){const i=gl(a);let r=1;"BYTES_PER_ELEMENT"in n&&(r=n.BYTES_PER_ELEMENT);const s=vl(a)?a.byteOffset:0,o=(s+a.byteLength)/r,u=(s+e)/r,l=Math.floor(Math.max(0,Math.min(u,o))),d=Math.floor(Math.min(l+Math.max(t,0),o));return new n(i,l,d-l)}function gl(a){return a instanceof ArrayBuffer?a:a.buffer}function vl(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function pl(a){const e={key:a.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(a.size<2)return;if(a.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const n=a.data.subarray(1).indexOf(0);if(n===-1)return;const i=Zt(Hs(a.data,1,n)),r=a.data[2+n],s=a.data.subarray(3+n).indexOf(0);if(s===-1)return;const o=Zt(Hs(a.data,3+n,s));let u;return i==="-->"?u=Zt(Hs(a.data,4+n+s)):u=hl(a.data.subarray(4+n+s)),e.mimeType=i,e.pictureType=r,e.description=o,e.data=u,e}function yl(a){return a.type==="PRIV"?ol(a):a.type[0]==="W"?ul(a):a.type==="APIC"?pl(a):ll(a)}function El(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=Rs(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}}const Is=10,Sl=10;function Pa(a){let e=0;const t=[];for(;Zs(a,e);){const n=Rs(a,e+6);a[e+5]>>6&1&&(e+=Is),e+=Is;const i=e+n;for(;e+Sl<i;){const r=El(a.subarray(e)),s=yl(r);s&&t.push(s),e+=r.size+Is}Ra(a,e)&&(e+=Is)}return t}function Oa(a){return a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp"}function bl(a){if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,t&&(n+=4772185884e-2),Math.round(n)}}function Ws(a){const e=Pa(a);for(let t=0;t<e.length;t++){const n=e[t];if(Oa(n))return bl(n)}}let cr=function(a){return a.audioId3="org.id3",a.dateRange="com.apple.quicktime.HLS",a.emsg="https://aomedia.org/emsg/ID3",a.misbklv="urn:misb:KLV:bin:1910.1",a}({});function br(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class js{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=ft(this.cachedData,e),this.cachedData=null);let n=gs(e,0),i=n?n.length:0,r;const s=this._audioTrack,o=this._id3Track,u=n?Ws(n):void 0,l=e.length;for((this.basePTS===null||this.frameIndex===0&&A(u))&&(this.basePTS=Tl(u,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:cr.audioId3,duration:Number.POSITIVE_INFINITY});i<l;){if(this.canParse(e,i)){const d=this.appendFrame(s,e,i);d?(this.frameIndex++,this.lastPTS=d.sample.pts,i+=d.length,r=i):i=l}else al(e,i)?(n=gs(e,i),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:cr.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===l&&r!==l){const d=e.slice(r);this.cachedData?this.cachedData=ft(this.cachedData,d):this.cachedData=d}}return{audioTrack:s,videoTrack:br(),id3Track:o,textTrack:br()}}demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:br(),id3Track:this._id3Track,textTrack:br()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Tl=(a,e,t)=>{if(A(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let Cs=null;const Al=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],xl=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Rl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Ll=[0,1,1,4];function Ma(a,e,t,n,i){if(t+24>e.length)return;const r=ka(e,t);if(r&&t+r.frameLength<=e.length){const s=r.samplesPerFrame*9e4/r.sampleRate,o=n+i*s,u={unit:e.subarray(t,t+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(u),{sample:u,length:r.frameLength,missing:0}}}function ka(a,e){const t=a[e+1]>>3&3,n=a[e+1]>>1&3,i=a[e+2]>>4&15,r=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&r!==3){const s=a[e+2]>>1&1,o=a[e+3]>>6,u=t===3?3-n:n===3?3:4,l=Al[u*14+i-1]*1e3,f=xl[(t===3?0:t===2?1:2)*3+r],v=o===3?1:2,p=Rl[t][n],y=Ll[n],T=p*8*y,b=Math.floor(p*l/f+s)*y;if(Cs===null){const P=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Cs=P?parseInt(P[1]):0}return!!Cs&&Cs<=87&&n===2&&l>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:f,channelCount:v,frameLength:b,samplesPerFrame:T}}}function Ys(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Na(a,e){return e+1<a.length&&Ys(a,e)}function Il(a,e){return Ys(a,e)&&4<=a.length-e}function Fa(a,e){if(e+1<a.length&&Ys(a,e)){const n=ka(a,e);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const r=e+i;return r===a.length||Na(a,r)}return!1}class Cl extends js{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=gs(e,0);let i=(n==null?void 0:n.length)||0;if(Fa(e,i))return!1;for(let r=e.length;i<r;i++)if(rl(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return il(e,t)}appendFrame(e,t,n){Ca(e,this.observer,t,n,e.manifestCodec);const i=wa(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const Ba=(a,e)=>{let t=0,n=5;e+=n;const i=new Uint32Array(1),r=new Uint32Array(1),s=new Uint8Array(1);for(;n>0;){s[0]=a[e];const o=Math.min(n,8),u=8-o;r[0]=4278190080>>>24+u<<u,i[0]=(s[0]&r[0])>>u,t=t?t<<o|i[0]:i[0],e+=1,n-=o}return t};class Dl extends js{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const i=Ua(e,t,n,this.basePTS,this.frameIndex);if(i!==-1)return{sample:e.samples[e.samples.length-1],length:i,missing:0}}static probe(e){if(!e)return!1;const t=gs(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&Ws(t)!==void 0&&Ba(e,n)<16}}function Ua(a,e,t,n,i){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const o=[48e3,44100,32e3][r],u=e[t+4]&63,d=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][u*3+r]*2;if(t+d>e.length)return-1;const f=e[t+6]>>5;let v=0;f===2?v+=2:(f&1&&f!==1&&(v+=2),f&4&&(v+=2));const p=(e[t+6]<<8|e[t+7])>>12-v&1,T=[2,1,2,3,3,4,4,5][f]+p,b=e[t+5]>>3,I=e[t+5]&7,B=new Uint8Array([r<<6|b<<1|I>>2,(I&3)<<6|f<<3|p<<2|u>>4,u<<4&224]),P=1536/o*9e4,ue=n+i*P,he=e.subarray(t,t+d);return a.config=B,a.channelCount=T,a.samplerate=o,a.samples.push({unit:he,pts:ue}),d}class wl extends js{resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=gs(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&Ws(t)!==void 0&&Ba(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(Fa(e,n))return fe.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Il(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Ma(e,t,n,this.basePTS,this.frameIndex)}}const _l=/\/emsg[-/]ID3/i;class Pl{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,i){const r=this.videoTrack=br("video",1),s=this.audioTrack=br("audio",1),o=this.txtTrack=br("text",1);if(this.id3Track=br("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const u=Fe(e);if(u.video){const{id:l,timescale:d,codec:f,supplemental:v}=u.video;r.id=l,r.timescale=o.timescale=d,r.codec=f,r.supplemental=v}if(u.audio){const{id:l,timescale:d,codec:f}=u.audio;s.id=l,s.timescale=d,s.codec=f}o.id=Pn.text,r.sampleDuration=0,r.duration=s.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return J(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=ft(this.remainderData,e));const o=It(n);this.remainderData=o.remainder,i.samples=o.valid||new Uint8Array}else i.samples=n;const s=this.extractID3Track(i,t);return r.samples=ee(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return n.samples=ee(e,t),{videoTrack:t,audioTrack:br(),id3Track:i,textTrack:br()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=D(e.samples,["emsg"]);i&&i.forEach(r=>{const s=Tt(r);if(_l.test(s.schemeIdUri)){const o=Ga(s,t);let u=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;u<=.001&&(u=Number.POSITIVE_INFINITY);const l=s.payload;n.samples.push({data:l,len:l.byteLength,dts:o,pts:o,type:cr.emsg,duration:u})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const o=Ga(s,t);n.samples.push({data:s.payload,len:s.payload.byteLength,dts:o,pts:o,type:cr.misbklv,duration:Number.POSITIVE_INFINITY})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function Ga(a,e){return A(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class Ol{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new jn(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,cn.cbc)}decryptAacSample(e,t,n){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),s=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(s).then(o=>{const u=new Uint8Array(o);i.set(u,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)n.set(e.subarray(r,r+16),i);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)e.set(n.subarray(i,i+16),r);return e}decryptAvcSample(e,t,n,i,r){const s=Ue(r.data),o=this.getAvcEncryptedData(s);this.decryptBuffer(o.buffer).then(u=>{r.data=this.getAvcDecryptedUnit(s,u),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)})}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(n>=r.length);n++){const s=r[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,n,i,s),!this.decrypter.isSync()))return}}}}class Va{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,i;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const r=n.units;i=r[r.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,i=n.length;if(i){const r=n[i-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,n){const i=t.byteLength;let r=e.naluState||0;const s=r,o=[];let u=0,l,d,f,v=-1,p=0;for(r===-1&&(v=0,p=this.getNALuType(t,0),r=0,u=1);u<i;){if(l=t[u++],!r){r=l?0:1;continue}if(r===1){r=l?0:2;continue}if(!l)r=3;else if(l===1){if(d=u-r-1,v>=0){const y={data:t.subarray(v,d),type:p};o.push(y)}else{const y=this.getLastNalUnit(e.samples);y&&(s&&u<=4-s&&y.state&&(y.data=y.data.subarray(0,y.data.byteLength-s)),d>0&&(y.data=ft(y.data,t.subarray(0,d)),y.state=0))}u<i?(f=this.getNALuType(t,u),v=u,p=f,r=0):r=-1}else r=0}if(v>=0&&r>=0){const y={data:t.subarray(v,i),type:p,state:r};o.push(y)}if(o.length===0){const y=this.getLastNalUnit(e.samples);y&&(y.data=ft(y.data,t))}return e.naluState=r,o}}class vs{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(r===0)throw new Error("no bytes available");i.set(e.subarray(n,n+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&fe.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class za extends Va{parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,o,u=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(l=>{var d,f;switch(l.type){case 1:{let T=!1;o=!0;const b=l.data;if(u&&b.length>4){const I=this.readSliceType(b);(I===2||I===4||I===7||I===9)&&(T=!0)}if(T){var v;(v=s)!=null&&v.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.frame=!0,s.key=T;break}case 5:o=!0,(d=s)!=null&&d.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 6:{o=!0,Y(l.data,1,n.pts,t.samples);break}case 7:{var p,y;o=!0,u=!0;const T=l.data,b=this.readSPS(T);if(!e.sps||e.width!==b.width||e.height!==b.height||((p=e.pixelRatio)==null?void 0:p[0])!==b.pixelRatio[0]||((y=e.pixelRatio)==null?void 0:y[1])!==b.pixelRatio[1]){e.width=b.width,e.height=b.height,e.pixelRatio=b.pixelRatio,e.sps=[T];const I=T.subarray(1,4);let B="avc1.";for(let P=0;P<3;P++){let ue=I[P].toString(16);ue.length<2&&(ue="0"+ue),B+=ue}e.codec=B}break}case 8:o=!0,e.pps=[l.data];break;case 9:o=!0,e.audFound=!0,(f=s)!=null&&f.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:o=!0;break;default:o=!1;break}s&&o&&s.units.push(l)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new vs(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n=8,i=8,r;for(let s=0;s<e;s++)i!==0&&(r=t.readEG(),i=(n+r+256)%256),n=i===0?n:i}readSPS(e){const t=new vs(e);let n=0,i=0,r=0,s=0,o,u,l;const d=t.readUByte.bind(t),f=t.readBits.bind(t),v=t.readUEG.bind(t),p=t.readBoolean.bind(t),y=t.skipBits.bind(t),T=t.skipEG.bind(t),b=t.skipUEG.bind(t),I=this.skipScalingList.bind(this);d();const B=d();if(f(5),y(3),d(),b(),B===100||B===110||B===122||B===244||B===44||B===83||B===86||B===118||B===128){const Me=v();if(Me===3&&y(1),b(),b(),y(1),p())for(u=Me!==3?8:12,l=0;l<u;l++)p()&&(l<6?I(16,t):I(64,t))}b();const P=v();if(P===0)v();else if(P===1)for(y(1),T(),T(),o=v(),l=0;l<o;l++)T();b(),y(1);const ue=v(),he=v(),je=f(1);je===0&&y(1),y(1),p()&&(n=v(),i=v(),r=v(),s=v());let me=[1,1];if(p()&&p())switch(d()){case 1:me=[1,1];break;case 2:me=[12,11];break;case 3:me=[10,11];break;case 4:me=[16,11];break;case 5:me=[40,33];break;case 6:me=[24,11];break;case 7:me=[20,11];break;case 8:me=[32,11];break;case 9:me=[80,33];break;case 10:me=[18,11];break;case 11:me=[15,11];break;case 12:me=[64,33];break;case 13:me=[160,99];break;case 14:me=[4,3];break;case 15:me=[3,2];break;case 16:me=[2,1];break;case 255:{me=[d()<<8|d(),d()<<8|d()];break}}return{width:Math.ceil((ue+1)*16-n*2-i*2),height:(2-je)*(he+1)*16-(je?2:4)*(r+s),pixelRatio:me}}}class Za extends Va{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,o,u=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(l=>{var d,f;switch(l.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.frame=!0,o=!0;break;case 16:case 17:case 18:case 21:if(o=!0,u){var v;(v=s)!=null&&v.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:o=!0,(d=s)!=null&&d.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 39:o=!0,Y(l.data,2,n.pts,t.samples);break;case 32:o=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=M(e.params,this.readVPS(l.data)),this.initVPS=l.data),e.vps=[l.data];break;case 33:if(o=!0,u=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],l.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const p=this.readSPS(l.data);e.width=p.width,e.height=p.height,e.pixelRatio=p.pixelRatio,e.codec=p.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const y in p.params)e.params[y]=p.params[y]}this.pushParameterSet(e.sps,l.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0;break;case 34:if(o=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const p=this.readPPS(l.data);for(const y in p)e.params[y]=p[y]}this.pushParameterSet(e.pps,l.data,e.vps)}break;case 35:o=!0,e.audFound=!0,(f=s)!=null&&f.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:o=!1;break}s&&o&&s.units.push(l)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let i=0;i<e.byteLength;i++)i>=2&&e[i]===3&&e[i-1]===0&&e[i-2]===0||(t[n]=e[i],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new vs(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const n=t.readBits(3),i=t.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:i}}readSPS(e){const t=new vs(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const i=t.readBits(2),r=t.readBoolean(),s=t.readBits(5),o=t.readUByte(),u=t.readUByte(),l=t.readUByte(),d=t.readUByte(),f=t.readUByte(),v=t.readUByte(),p=t.readUByte(),y=t.readUByte(),T=t.readUByte(),b=t.readUByte(),I=t.readUByte(),B=[],P=[];for(let xi=0;xi<n;xi++)B.push(t.readBoolean()),P.push(t.readBoolean());if(n>0)for(let xi=n;xi<8;xi++)t.readBits(2);for(let xi=0;xi<n;xi++)B[xi]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),P[xi]&&t.readUByte();t.readUEG();const ue=t.readUEG();ue==3&&t.skipBits(1);const he=t.readUEG(),je=t.readUEG(),me=t.readBoolean();let Me=0,it=0,Te=0,Ut=0;me&&(Me+=t.readUEG(),it+=t.readUEG(),Te+=t.readUEG(),Ut+=t.readUEG());const an=t.readUEG(),di=t.readUEG(),Wn=t.readUEG(),Un=t.readBoolean();for(let xi=Un?0:n;xi<=n;xi++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.readBoolean()&&t.readBoolean())for(let Ji=0;Ji<4;Ji++)for(let vr=0;vr<(Ji===3?2:6);vr++)if(!t.readBoolean())t.readUEG();else{const Er=Math.min(64,1<<4+(Ji<<1));Ji>1&&t.readEG();for(let ls=0;ls<Er;ls++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const _n=t.readUEG();let Gt=0;for(let xi=0;xi<_n;xi++){let Ji=!1;if(xi!==0&&(Ji=t.readBoolean()),Ji){xi===_n&&t.readUEG(),t.readBoolean(),t.readUEG();let vr=0;for(let jr=0;jr<=Gt;jr++){const Er=t.readBoolean();let ls=!1;Er||(ls=t.readBoolean()),(Er||ls)&&vr++}Gt=vr}else{const vr=t.readUEG(),jr=t.readUEG();Gt=vr+jr;for(let Er=0;Er<vr;Er++)t.readUEG(),t.readBoolean();for(let Er=0;Er<jr;Er++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const xi=t.readUEG();for(let Ji=0;Ji<xi;Ji++){for(let vr=0;vr<Wn+4;vr++)t.readBits(1);t.readBits(1)}}let Jn=0,Xn=1,ci=1,bi=!0,Li=1,Pi=0;t.readBoolean(),t.readBoolean();let ir=!1;if(t.readBoolean()){if(t.readBoolean()){const Yr=t.readUByte(),Ho=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Gs=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Yr>0&&Yr<16?(Xn=Ho[Yr-1],ci=Gs[Yr-1]):Yr===255&&(Xn=t.readBits(16),ci=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),ir=t.readBoolean(),ir&&(Me+=t.readUEG(),it+=t.readUEG(),Te+=t.readUEG(),Ut+=t.readUEG()),t.readBoolean()&&(Li=t.readBits(32),Pi=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const Gs=t.readBoolean(),Wo=t.readBoolean();let Ts=!1;(Gs||Wo)&&(Ts=t.readBoolean(),Ts&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),Ts&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let jo=0;jo<=n;jo++){bi=t.readBoolean();const ed=bi||t.readBoolean();let Yo=!1;ed?t.readEG():Yo=t.readBoolean();const Xo=Yo?1:t.readUEG()+1;if(Gs)for(let As=0;As<Xo;As++)t.readUEG(),t.readUEG(),Ts&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(Wo)for(let As=0;As<Xo;As++)t.readUEG(),t.readUEG(),Ts&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),Jn=t.readUEG())}let Ur=he,Ko=je;if(me||ir){let xi=1,Ji=1;ue===1?xi=Ji=2:ue==2&&(xi=2),Ur=he-xi*it-xi*Me,Ko=je-Ji*Ut-Ji*Te}const Jc=i?["A","B","C"][i]:"",$c=o<<24|u<<16|l<<8|d;let Aa=0;for(let xi=0;xi<32;xi++)Aa=(Aa|($c>>xi&1)<<31-xi)>>>0;let xa=Aa.toString(16);return s===1&&xa==="2"&&(xa="6"),{codecString:`hvc1.${Jc}${s}.${xa}.${r?"H":"L"}${I}.B0`,params:{general_tier_flag:r,general_profile_idc:s,general_profile_space:i,general_profile_compatibility_flags:[o,u,l,d],general_constraint_indicator_flags:[f,v,p,y,T,b],general_level_idc:I,bit_depth:an+8,bit_depth_luma_minus8:an,bit_depth_chroma_minus8:di,min_spatial_segmentation_idc:Jn,chroma_format_idc:ue,frame_rate:{fixed:bi,fps:Pi/Li}},width:Ur,height:Ko,pixelRatio:[Xn,ci]}}readPPS(e){const t=new vs(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const i=t.readBoolean(),r=t.readBoolean();let s=1;return r&&i?s=0:r?s=3:i&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Yi=188;class kr{constructor(e,t,n,i){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=i,this.videoParser=null}static probe(e,t){const n=kr.syncOffset(e);return n>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),n!==-1}static syncOffset(e){const t=e.length;let n=Math.min(Yi*5,t-Yi)+1,i=0;for(;i<n;){let r=!1,s=-1,o=0;for(let u=i;u<t;u+=Yi)if(e[u]===71&&(t-u===Yi||e[u+Yi]===71)){if(o++,s===-1&&(s=u,s!==0&&(n=Math.min(s+Yi*99,e.length-Yi)+1)),r||(r=Xs(e,u)===0),r&&o>1&&(s===0&&o>2||u+Yi>n))return s}else{if(o)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Pn[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=kr.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=kr.createTrack("audio",i),this._id3Track=kr.createTrack("id3"),this._txtTrack=kr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,i=!1){n||(this.sampleAes=null);let r;const s=this._videoTrack,o=this._audioTrack,u=this._id3Track,l=this._txtTrack;let d=s.pid,f=s.pesData,v=o.pid,p=u.pid,y=o.pesData,T=u.pesData,b=null,I=this.pmtParsed,B=this._pmtId,P=e.length;if(this.remainderData&&(e=ft(this.remainderData,e),P=e.length,this.remainderData=null),P<Yi&&!i)return this.remainderData=e,{audioTrack:o,videoTrack:s,id3Track:u,textTrack:l};const ue=Math.max(0,kr.syncOffset(e));P-=(P-ue)%Yi,P<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,P,e.buffer.byteLength-P));let he=0;for(let me=ue;me<P;me+=Yi)if(e[me]===71){const Me=!!(e[me+1]&64),it=Xs(e,me),Te=(e[me+3]&48)>>4;let Ut;if(Te>1){if(Ut=me+5+e[me+4],Ut===me+Yi)continue}else Ut=me+4;switch(it){case d:if(Me){if(f&&(r=ns(f,this.logger))){if(this.videoParser===null)switch(s.segmentCodec){case"avc":this.videoParser=new za;break;case"hevc":this.videoParser=new Za;break}this.videoParser!==null&&this.videoParser.parsePES(s,l,r,!1)}f={data:[],size:0}}f&&(f.data.push(e.subarray(Ut,me+Yi)),f.size+=me+Yi-Ut);break;case v:if(Me){if(y&&(r=ns(y,this.logger)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break;case"ac3":this.parseAC3PES(o,r);break}y={data:[],size:0}}y&&(y.data.push(e.subarray(Ut,me+Yi)),y.size+=me+Yi-Ut);break;case p:Me&&(T&&(r=ns(T,this.logger))&&this.parseID3PES(u,r),T={data:[],size:0}),T&&(T.data.push(e.subarray(Ut,me+Yi)),T.size+=me+Yi-Ut);break;case 0:Me&&(Ut+=e[Ut]+1),B=this._pmtId=Ml(e,Ut);break;case B:{Me&&(Ut+=e[Ut]+1);const an=kl(e,Ut,this.typeSupported,n,this.observer,this.logger);d=an.videoPid,d>0&&(s.pid=d,s.segmentCodec=an.segmentVideoCodec),v=an.audioPid,v>0&&(o.pid=v,o.segmentCodec=an.segmentAudioCodec),p=an.id3Pid,p>0&&(u.pid=p),b!==null&&!I&&(this.logger.warn(`MPEG-TS PMT found at ${me} after unknown PID '${b}'. Backtracking to sync byte @${ue} to parse all TS packets.`),b=null,me=ue-188),I=this.pmtParsed=!0;break}case 17:case 8191:break;default:b=it;break}}else he++;he>0&&qs(this.observer,new Error(`Found ${he} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=f,o.pesData=y,u.pesData=T;const je={audioTrack:o,videoTrack:s,id3Track:u,textTrack:l};return i&&this.extractRemainingSamples(je),je}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:i,textTrack:r}=e,s=n.pesData,o=t.pesData,u=i.pesData;let l;if(s&&(l=ns(s,this.logger))){if(this.videoParser===null)switch(n.segmentCodec){case"avc":this.videoParser=new za;break;case"hevc":this.videoParser=new Za;break}this.videoParser!==null&&(this.videoParser.parsePES(n,r,l,!0),n.pesData=null)}else n.pesData=s;if(o&&(l=ns(o,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l);break}t.pesData=null}else o!=null&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;u&&(l=ns(u,this.logger))?(this.parseID3PES(i,l),i.pesData=null):i.pesData=u}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new Ol(this.observer,this.config,t);return this.decrypt(i,r)}decrypt(e,t){return new Promise(n=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{n(e)}):n(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{n(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const f=i.missing,v=i.sample.unit.byteLength;if(f===-1)r=ft(i.sample.unit,r);else{const p=v-f;i.sample.unit.set(r.subarray(0,f),p),e.samples.push(i.sample),n=i.missing}}let s,o;for(s=n,o=r.length;s<o-1&&!Ls(r,s);s++);if(s!==n){let f;const v=s<o-1;if(v?f=`AAC PES did not start with ADTS header,offset:${s}`:f="No ADTS header found in AAC PES",qs(this.observer,new Error(f),v,this.logger),!v)return}Ca(e,this.observer,r,s,this.audioCodec);let u;if(t.pts!==void 0)u=t.pts;else if(i){const f=Da(e.samplerate);u=i.sample.pts+f}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let l=0,d;for(;s<o;)if(d=wa(e,r,s,u,l),s+=d.length,d.missing){this.aacOverFlow=d;break}else for(l++;s<o-1&&!Ls(r,s);s++);}parseMPEGPES(e,t){const n=t.data,i=n.length;let r=0,s=0;const o=t.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<i;)if(Na(n,s)){const u=Ma(e,n,s,o,r);if(u)s+=u.length,r++;else break}else s++}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(i===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const r=n.length;let s=0,o=0,u;for(;o<r&&(u=Ua(e,n,o,i,s++))>0;)o+=u}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=M({},t,{type:this._videoTrack?cr.emsg:cr.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Xs(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Ml(a,e){return(a[e+10]&31)<<8|a[e+11]}function kl(a,e,t,n,i,r){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(a[e+1]&15)<<8|a[e+2],u=e+3+o-4,l=(a[e+10]&15)<<8|a[e+11];for(e+=12+l;e<u;){const d=Xs(a,e),f=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){Qs("ADTS AAC",r);break}case 15:s.audioPid===-1&&(s.audioPid=d);break;case 21:s.id3Pid===-1&&(s.id3Pid=d);break;case 219:if(!n){Qs("H.264",r);break}case 27:s.videoPid===-1&&(s.videoPid=d);break;case 3:case 4:!t.mpeg&&!t.mp3?r.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=d,s.segmentAudioCodec="mp3");break;case 193:if(!n){Qs("AC-3",r);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=d,s.segmentAudioCodec="ac3"):r.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&f>0){let v=e+5,p=f;for(;p>2;){switch(a[v]){case 106:t.ac3!==!0?r.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=d,s.segmentAudioCodec="ac3");break}const T=a[v+1]+2;v+=T,p-=T}}break;case 194:case 135:return qs(i,new Error("Unsupported EC-3 in M2TS found"),void 0,r),s;case 36:s.videoPid===-1&&(s.videoPid=d,s.segmentVideoCodec="hevc",r.log("HEVC in M2TS found"));break}e+=f+5}return s}function qs(a,e,t,n){n.warn(`parsing error: ${e.message}`),a.emit(m.ERROR,m.ERROR,{type:Z.MEDIA_ERROR,details:x.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Qs(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function ns(a,e){let t=0,n,i,r,s,o;const u=a.data;if(!a||a.size===0)return null;for(;u[0].length<19&&u.length>1;)u[0]=ft(u[0],u[1]),u.splice(1,1);if(n=u[0],(n[0]<<16)+(n[1]<<8)+n[2]===1){if(i=(n[4]<<8)+n[5],i&&i>a.size-6)return null;const d=n[7];d&192&&(s=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,d&64?(o=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,s-o>60*9e4&&(e.warn(`${Math.round((s-o)/9e4)}s delta between PTS and DTS, align them`),s=o)):o=s),r=n[8];let f=r+9;if(a.size<=f)return null;a.size-=f;const v=new Uint8Array(a.size);for(let p=0,y=u.length;p<y;p++){n=u[p];let T=n.byteLength;if(f)if(f>T){f-=T;continue}else n=n.subarray(f),T-=f,f=0;v.set(n,t),t+=T}return i&&(i-=r+3),{data:v,pts:s,dts:o,len:i}}return null}class Nl{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const Nr=Math.pow(2,32)-1;class xe{static init(){xe.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in xe.types)xe.types.hasOwnProperty(e)&&(xe.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);xe.HDLR_TYPES={video:t,audio:n};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);xe.STTS=xe.STSC=xe.STCO=r,xe.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),xe.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),xe.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),xe.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),u=new Uint8Array([0,0,0,1]);xe.FTYP=xe.box(xe.types.ftyp,s,u,s,o),xe.DINF=xe.box(xe.types.dinf,xe.box(xe.types.dref,i))}static box(e,...t){let n=8,i=t.length;const r=i;for(;i--;)n+=t[i].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(e,4),i=0,n=8;i<r;i++)s.set(t[i],n),n+=t[i].byteLength;return s}static hdlr(e){return xe.box(xe.types.hdlr,xe.HDLR_TYPES[e])}static mdat(e){return xe.box(xe.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(Nr+1)),i=Math.floor(t%(Nr+1));return xe.box(xe.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return xe.box(xe.types.mdia,xe.mdhd(e.timescale||0,e.duration||0),xe.hdlr(e.type),xe.minf(e))}static mfhd(e){return xe.box(xe.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?xe.box(xe.types.minf,xe.box(xe.types.smhd,xe.SMHD),xe.DINF,xe.stbl(e)):xe.box(xe.types.minf,xe.box(xe.types.vmhd,xe.VMHD),xe.DINF,xe.stbl(e))}static moof(e,t,n){return xe.box(xe.types.moof,xe.mfhd(e),xe.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=xe.trak(e[t]);return xe.box.apply(null,[xe.types.moov,xe.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(xe.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=xe.trex(e[t]);return xe.box.apply(null,[xe.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Nr+1)),i=Math.floor(t%(Nr+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&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 xe.box(xe.types.mvhd,r)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,r;for(i=0;i<t.length;i++)r=t[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return xe.box(xe.types.sdtp,n)}static stbl(e){return xe.box(xe.types.stbl,xe.stsd(e),xe.box(xe.types.stts,xe.STTS),xe.box(xe.types.stsc,xe.STSC),xe.box(xe.types.stsz,xe.STSZ),xe.box(xe.types.stco,xe.STCO))}static avc1(e){let t=[],n=[],i,r,s;for(i=0;i<e.sps.length;i++)r=e.sps[i],s=r.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i<e.pps.length;i++)r=e.pps[i],s=r.byteLength,n.push(s>>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(r));const o=xe.box(xe.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),u=e.width,l=e.height,d=e.pixelRatio[0],f=e.pixelRatio[1];return xe.box(xe.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,u>>8&255,u&255,l>>8&255,l&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]),o,xe.box(xe.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),xe.box(xe.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,d&255,f>>24,f>>16&255,f>>8&255,f&255])))}static esds(e){const t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return xe.box(xe.types.mp4a,xe.audioStsd(e),xe.box(xe.types.esds,xe.esds(e)))}static mp3(e){return xe.box(xe.types[".mp3"],xe.audioStsd(e))}static ac3(e){return xe.box(xe.types["ac-3"],xe.audioStsd(e),xe.box(xe.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return xe.box(xe.types.stsd,xe.STSD,xe.mp4a(e));if(t==="ac3"&&e.config)return xe.box(xe.types.stsd,xe.STSD,xe.ac3(e));if(t==="mp3"&&e.codec==="mp3")return xe.box(xe.types.stsd,xe.STSD,xe.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return xe.box(xe.types.stsd,xe.STSD,xe.avc1(e));if(t==="hevc"&&e.vps)return xe.box(xe.types.stsd,xe.STSD,xe.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,n=(e.duration||0)*(e.timescale||0),i=e.width||0,r=e.height||0,s=Math.floor(n/(Nr+1)),o=Math.floor(n%(Nr+1));return xe.box(xe.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&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,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const n=xe.sdtp(e),i=e.id,r=Math.floor(t/(Nr+1)),s=Math.floor(t%(Nr+1));return xe.box(xe.types.traf,xe.box(xe.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),xe.box(xe.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,s>>24,s>>16&255,s>>8&255,s&255])),xe.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,xe.box(xe.types.trak,xe.tkhd(e),xe.mdia(e))}static trex(e){const t=e.id;return xe.box(xe.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],i=n.length,r=12+16*i,s=new Uint8Array(r);let o,u,l,d,f,v;for(t+=8+r,s.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o<i;o++)u=n[o],l=u.duration,d=u.size,f=u.flags,v=u.cts,s.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,f.isLeading<<2|f.dependsOn,f.isDependedOn<<6|f.hasRedundancy<<4|f.paddingValue<<1|f.isNonSync,f.degradPrio&61440,f.degradPrio&15,v>>>24&255,v>>>16&255,v>>>8&255,v&255],12+16*o);return xe.box(xe.types.trun,s)}static initSegment(e){xe.types||xe.init();const t=xe.moov(e);return ft(xe.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],i=4,r=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),i-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let s=r.length;for(let y=0;y<n.length;y+=1){s+=3;for(let T=0;T<n[y].length;T+=1)s+=2+n[y][T].length}const o=new Uint8Array(s);o.set(r,0),s=r.length;const u=n.length-1;for(let y=0;y<n.length;y+=1){o.set(new Uint8Array([32+y|(y===u?128:0),0,n[y].length]),s),s+=3;for(let T=0;T<n[y].length;T+=1)o.set(new Uint8Array([n[y][T].length>>8,n[y][T].length&255]),s),s+=2,o.set(n[y][T],s),s+=n[y][T].length}const l=xe.box(xe.types.hvcC,o),d=e.width,f=e.height,v=e.pixelRatio[0],p=e.pixelRatio[1];return xe.box(xe.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,d>>8&255,d&255,f>>8&255,f&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]),l,xe.box(xe.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),xe.box(xe.types.pasp,new Uint8Array([v>>24,v>>16&255,v>>8&255,v&255,p>>24,p>>16&255,p>>8&255,p&255])))}}xe.types=void 0,xe.HDLR_TYPES=void 0,xe.STTS=void 0,xe.STSC=void 0,xe.STCO=void 0,xe.STSZ=void 0,xe.VMHD=void 0,xe.SMHD=void 0,xe.STSD=void 0,xe.FTYP=void 0,xe.DINF=void 0;const Ka=9e4;function Js(a,e,t=1,n=!1){const i=a*e*t;return n?Math.round(i):i}function Fl(a,e,t=1,n=!1){return Js(a,e,1/t,n)}function ps(a,e=!1){return Js(a,1e3,1/Ka,e)}function Bl(a,e=1){return Js(a,Ka,1/e)}const Ul=10*1e3,Gl=1024,Vl=1152,zl=1536;let is=null,$s=null;function Ha(a,e,t,n){return{duration:e,size:t,cts:n,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:a?2:1,isNonSync:a?0:1}}}class Ds{constructor(e,t,n,i){if(this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=i,this.ISGenerated=!1,is===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);is=s?parseInt(s[1]):0}if($s===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);$s=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,i=e.reduce((r,s)=>{let o=s.pts,u=o-r;return u<-4294967296&&(t=!0,o=mr(o,n),u=o-r),u>0?r:o},n);return t&&this.logger.debug("PTS rollover detected"),i}remux(e,t,n,i,r,s,o,u){let l,d,f,v,p,y,T=r,b=r;const I=e.pid>-1,B=t.pid>-1,P=t.samples.length,ue=e.samples.length>0,he=o&&P>0||P>1;if((!I||ue)&&(!B||he)||this.ISGenerated||o){if(this.ISGenerated){var me,Me,it,Te;const Wn=this.videoTrackConfig;(Wn&&(t.width!==Wn.width||t.height!==Wn.height||((me=t.pixelRatio)==null?void 0:me[0])!==((Me=Wn.pixelRatio)==null?void 0:Me[0])||((it=t.pixelRatio)==null?void 0:it[1])!==((Te=Wn.pixelRatio)==null?void 0:Te[1]))||!Wn&&he||this.nextAudioPts===null&&ue)&&this.resetInitSegment()}this.ISGenerated||(f=this.generateIS(e,t,r,s));const Ut=this.isVideoContiguous;let an=-1,di;if(he&&(an=Zl(t.samples),!Ut&&this.config.forceKeyFrameOnDiscontinuity))if(y=!0,an>0){this.logger.warn(`[mp4-remuxer]: Dropped ${an} out of ${P} video samples due to a missing keyframe`);const Wn=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(an),t.dropped+=an,b+=(t.samples[0].pts-Wn)/t.inputTimeScale,di=b}else an===-1&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${P} video samples`),y=!1);if(this.ISGenerated){if(ue&&he){const Wn=this.getVideoStartPts(t.samples),An=(mr(e.samples[0].pts,Wn)-Wn)/t.inputTimeScale;T+=Math.max(0,An),b+=Math.max(0,-An)}if(ue){if(e.samplerate||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),f=this.generateIS(e,t,r,s)),d=this.remuxAudio(e,T,this.isAudioContiguous,s,B||he||u===ae.AUDIO?b:void 0),he){const Wn=d?d.endPTS-d.startPTS:0;t.inputTimeScale||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),f=this.generateIS(e,t,r,s)),l=this.remuxVideo(t,b,Ut,Wn)}}else he&&(l=this.remuxVideo(t,b,Ut,0));l&&(l.firstKeyFrame=an,l.independent=an!==-1,l.firstKeyFramePTS=di)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(p=Wa(n,r,this._initPTS,this._initDTS)),i.samples.length&&(v=ja(i,r,this._initPTS))),{audio:d,video:l,initSegment:f,independent:y,text:v,id3:p}}generateIS(e,t,n,i){const r=e.samples,s=t.samples,o=this.typeSupported,u={},l=this._initPTS;let d=!l||i,f="audio/mp4",v,p,y;if(d&&(v=p=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(f="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}u.audio={id:"audio",container:f,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):xe.initSegment([e]),metadata:{channelCount:e.channelCount}},d&&(y=e.inputTimeScale,!l||y!==l.timescale?v=p=r[0].pts-Math.round(y*n):d=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,u.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:xe.initSegment([t]),metadata:{width:t.width,height:t.height}},d)if(y=t.inputTimeScale,!l||y!==l.timescale){const T=this.getVideoStartPts(s),b=Math.round(y*n);p=Math.min(p,mr(s[0].dts,T)-b),v=Math.min(v,T-b)}else d=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(u).length)return this.ISGenerated=!0,d?(this._initPTS={baseTime:v,timescale:y},this._initDTS={baseTime:p,timescale:y}):v=y=void 0,{tracks:u,initPTS:v,timescale:y}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,s=e.samples,o=[],u=s.length,l=this._initPTS;let d=this.nextAvcDts,f=8,v=this.videoSampleDuration,p,y,T=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,I=!1;if(!n||d===null){const Gt=t*r,Ht=s[0].pts-mr(s[0].dts,s[0].pts);is&&d!==null&&Math.abs(Gt-Ht-d)<15e3?n=!0:d=Gt-Ht}const B=l.baseTime*r/l.timescale;for(let Gt=0;Gt<u;Gt++){const Ht=s[Gt];Ht.pts=mr(Ht.pts-B,d),Ht.dts=mr(Ht.dts-B,d),Ht.dts<s[Gt>0?Gt-1:Gt].dts&&(I=!0)}I&&s.sort(function(Gt,Ht){const Jn=Gt.dts-Ht.dts,Xn=Gt.pts-Ht.pts;return Jn||Xn}),p=s[0].dts,y=s[s.length-1].dts;const P=y-p,ue=P?Math.round(P/(u-1)):v||e.inputTimeScale/30;if(n){const Gt=p-d,Ht=Gt>ue,Jn=Gt<-1;if((Ht||Jn)&&(Ht?this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${ps(Gt,!0)} ms (${Gt}dts) hole between fragments detected at ${t.toFixed(3)}`):this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${ps(-Gt,!0)} ms (${Gt}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!Jn||d>=s[0].pts||is)){p=d;const Xn=s[0].pts-Gt;if(Ht)s[0].dts=p,s[0].pts=Xn;else{let ci=!0;for(let bi=0;bi<s.length&&!(s[bi].dts>Xn&&ci);bi++){const Li=s[bi].pts;if(s[bi].dts-=Gt,s[bi].pts-=Gt,bi<s.length-1){const Pi=s[bi+1].pts,ir=s[bi].pts,lr=Pi<=ir,Ur=Pi<=Li;ci=lr==Ur}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${ps(Xn,!0)}/${ps(p,!0)}, delta: ${ps(Gt,!0)} ms`)}}p=Math.max(0,p);let he=0,je=0,me=p;for(let Gt=0;Gt<u;Gt++){const Ht=s[Gt],Jn=Ht.units,Xn=Jn.length;let ci=0;for(let bi=0;bi<Xn;bi++)ci+=Jn[bi].data.length;je+=ci,he+=Xn,Ht.length=ci,Ht.dts<me?(Ht.dts=me,me+=ue/4|0||1):me=Ht.dts,T=Math.min(Ht.pts,T),b=Math.max(Ht.pts,b)}y=s[u-1].dts;const Me=je+4*he+8;let it;try{it=new Uint8Array(Me)}catch(Gt){this.observer.emit(m.ERROR,m.ERROR,{type:Z.MUX_ERROR,details:x.REMUX_ALLOC_ERROR,fatal:!1,error:Gt,bytes:Me,reason:`fail allocating video mdat ${Me}`});return}const Te=new DataView(it.buffer);Te.setUint32(0,Me),it.set(xe.types.mdat,4);let Ut=!1,an=Number.POSITIVE_INFINITY,di=Number.POSITIVE_INFINITY,Wn=Number.NEGATIVE_INFINITY,Un=Number.NEGATIVE_INFINITY;for(let Gt=0;Gt<u;Gt++){const Ht=s[Gt],Jn=Ht.units;let Xn=0;for(let Li=0,Pi=Jn.length;Li<Pi;Li++){const ir=Jn[Li],lr=ir.data,Ur=ir.data.byteLength;Te.setUint32(f,Ur),f+=4,it.set(lr,f),f+=Ur,Xn+=4+Ur}let ci;if(Gt<u-1)v=s[Gt+1].dts-Ht.dts,ci=s[Gt+1].pts-Ht.pts;else{const Li=this.config,Pi=Gt>0?Ht.dts-s[Gt-1].dts:ue;if(ci=Gt>0?Ht.pts-s[Gt-1].pts:ue,Li.stretchShortVideoTrack&&this.nextAudioPts!==null){const ir=Math.floor(Li.maxBufferHole*r),lr=(i?T+i*r:this.nextAudioPts)-Ht.pts;lr>ir?(v=lr-Pi,v<0?v=Pi:Ut=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${lr/90} ms to the next segment; using duration ${v/90} ms for the last video frame.`)):v=Pi}else v=Pi}const bi=Math.round(Ht.pts-Ht.dts);an=Math.min(an,v),Wn=Math.max(Wn,v),di=Math.min(di,ci),Un=Math.max(Un,ci),o.push(Ha(Ht.key,v,Xn,bi))}if(o.length){if(is){if(is<70){const Gt=o[0].flags;Gt.dependsOn=2,Gt.isNonSync=0}}else if($s&&Un-di<Wn-an&&ue/Wn<.025&&o[0].cts===0){this.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let Gt=p;for(let Ht=0,Jn=o.length;Ht<Jn;Ht++){const Xn=Gt+o[Ht].duration,ci=Gt+o[Ht].cts;if(Ht<Jn-1){const bi=Xn+o[Ht+1].cts;o[Ht].duration=bi-ci}else o[Ht].duration=Ht?o[Ht-1].duration:ue;o[Ht].cts=0,Gt=Xn}}}v=Ut||!v?ue:v,this.nextAvcDts=d=y+v,this.videoSampleDuration=v,this.isVideoContiguous=!0;const _n={data1:xe.moof(e.sequenceNumber++,p,M(e,{samples:o})),data2:it,startPTS:T/r,endPTS:(b+v)/r,startDTS:p/r,endDTS:d/r,type:"video",hasAudio:!1,hasVideo:!0,nb:o.length,dropped:e.dropped};return e.samples=[],e.dropped=0,_n}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return Vl;case"ac3":return zl;default:return Gl}}remuxAudio(e,t,n,i,r){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,u=s/o,l=this.getSamplesPerFrame(e),d=l*u,f=this._initPTS,v=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,p=[],y=r!==void 0;let T=e.samples,b=v?0:8,I=this.nextAudioPts||-1;const B=t*s,P=f.baseTime*s/f.timescale;if(this.isAudioContiguous=n=n||T.length&&I>0&&(i&&Math.abs(B-I)<9e3||Math.abs(mr(T[0].pts-P,B)-I)<20*d),T.forEach(function(An){An.pts=mr(An.pts-P,B)}),!n||I<0){if(T=T.filter(An=>An.pts>=0),!T.length)return;r===0?I=0:i&&!y?I=Math.max(0,B):I=T[0].pts}if(e.segmentCodec==="aac"){const An=this.config.maxAudioFramesDrift;for(let Gn=0,_n=I;Gn<T.length;Gn++){const Gt=T[Gn],Ht=Gt.pts,Jn=Ht-_n,Xn=Math.abs(1e3*Jn/s);if(Jn<=-An*d&&y)Gn===0&&(this.logger.warn(`Audio frame @ ${(Ht/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*Jn/s)} ms.`),this.nextAudioPts=I=_n=Ht);else if(Jn>=An*d&&Xn<Ul&&y){let ci=Math.round(Jn/d);_n=Ht-ci*d,_n<0&&(ci--,_n+=d),Gn===0&&(this.nextAudioPts=I=_n),this.logger.warn(`[mp4-remuxer]: Injecting ${ci} audio frame @ ${(_n/s).toFixed(3)}s due to ${Math.round(1e3*Jn/s)} ms gap.`);for(let bi=0;bi<ci;bi++){const Li=Math.max(_n,0);let Pi=Nl.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Pi||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Pi=Gt.unit.subarray()),T.splice(Gn,0,{unit:Pi,pts:Li}),_n+=d,Gn++}}Gt.pts=_n,_n+=d}}let ue=null,he=null,je,me=0,Me=T.length;for(;Me--;)me+=T[Me].unit.byteLength;for(let An=0,Gn=T.length;An<Gn;An++){const _n=T[An],Gt=_n.unit;let Ht=_n.pts;if(he!==null){const Xn=p[An-1];Xn.duration=Math.round((Ht-he)/u)}else if(n&&e.segmentCodec==="aac"&&(Ht=I),ue=Ht,me>0){me+=b;try{je=new Uint8Array(me)}catch(Xn){this.observer.emit(m.ERROR,m.ERROR,{type:Z.MUX_ERROR,details:x.REMUX_ALLOC_ERROR,fatal:!1,error:Xn,bytes:me,reason:`fail allocating audio mdat ${me}`});return}v||(new DataView(je.buffer).setUint32(0,me),je.set(xe.types.mdat,4))}else return;je.set(Gt,b);const Jn=Gt.byteLength;b+=Jn,p.push(Ha(!0,l,Jn,0)),he=Ht}const it=p.length;if(!it)return;const Te=p[p.length-1];this.nextAudioPts=I=he+u*Te.duration;const Ut=v?new Uint8Array(0):xe.moof(e.sequenceNumber++,ue/u,M({},e,{samples:p}));e.samples=[];const an=ue/s,di=I/s,Un={data1:Ut,data2:je,startPTS:an,endPTS:di,startDTS:an,endDTS:di,type:"audio",hasAudio:!0,hasVideo:!1,nb:it};return this.isAudioContiguous=!0,Un}}function mr(a,e){let t;if(e===null)return a;for(e<a?t=-8589934592:t=8589934592;Math.abs(a-e)>4294967296;)a+=t;return a}function Zl(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function Wa(a,e,t,n){const i=a.samples.length;if(!i)return;const r=a.inputTimeScale;for(let o=0;o<i;o++){const u=a.samples[o];u.pts=mr(u.pts-t.baseTime*r/t.timescale,e*r)/r,u.dts=mr(u.dts-n.baseTime*r/n.timescale,e*r)/r}const s=a.samples;return a.samples=[],{samples:s}}function ja(a,e,t){const n=a.samples.length;if(!n)return;const i=a.inputTimeScale;for(let s=0;s<n;s++){const o=a.samples[s];o.pts=mr(o.pts-t.baseTime*i/t.timescale,e*i)/i}a.samples.sort((s,o)=>s.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class Kl{constructor(e,t,n,i){this.logger=void 0,this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.logger=i}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(O(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=Fe(e);i.audio&&(t=Ya(i.audio,$.AUDIO)),i.video&&(n=Ya(i.video,$.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:t+","+n,supplemental:i.video.supplemental,initSegment:e,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?r.video={container:"video/mp4",codec:n,supplemental:i.video.supplemental,initSegment:e,id:"main"}:this.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,n,i,r,s){var o,u;let{initPTS:l,lastEndTime:d}=this;const f={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};A(d)||(d=this.lastEndTime=r||0);const v=t.samples;if(!(v!=null&&v.length))return f;const p={initPTS:void 0,timescale:1};let y=this.initData;if((o=y)!=null&&o.length||(this.generateInitSegment(v),y=this.initData),!((u=y)!=null&&u.length))return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),f;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1);const T=Oe(v,y),b=Ye(y,v),I=b===null?r:b;(s||!l)&&(Hl(l,I,r,T)||p.timescale!==l.timescale)&&(p.initPTS=I-r,l&&l.timescale===1&&this.logger.warn(`Adjusting initPTS @${r} from ${l.baseTime/l.timescale} to ${p.initPTS}`),this.initPTS=l={baseTime:p.initPTS,timescale:1});const B=e?I-l.baseTime/l.timescale:d,P=B+T;Qt(y,v,l.baseTime/l.timescale),T>0?this.lastEndTime=P:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const ue=!!y.audio,he=!!y.video;let je="";ue&&(je+="audio"),he&&(je+="video");const me={data1:v,startPTS:B,startDTS:B,endPTS:P,endDTS:P,type:je,hasAudio:ue,hasVideo:he,nb:1,dropped:0};return f.audio=me.type==="audio"?me:void 0,f.video=me.type!=="audio"?me:void 0,f.initSegment=p,f.id3=Wa(n,r,l,l),i.samples.length&&(f.text=ja(i,r,l)),f}}function Hl(a,e,t,n){if(a===null)return!0;const i=Math.max(n,1),r=e-a.baseTime/a.timescale;return Math.abs(r-t)>i}function Ya(a,e){const t=a==null?void 0:a.codec;return t&&t.length>4?t:e===$.AUDIO?t==="ec-3"||t==="ac-3"||t==="alac"?t:t==="fLaC"||t==="Opus"?dn(t,!1):(fe.warn(`Unhandled audio codec "${t}" in mp4 MAP`),t||"mp4a"):(fe.warn(`Unhandled video codec "${t}" in mp4 MAP`),t||"avc1")}let Cr;try{Cr=self.performance.now.bind(self.performance)}catch(a){Cr=Date.now}const ws=[{demux:Pl,remux:Kl},{demux:kr,remux:Ds},{demux:Cl,remux:Ds},{demux:wl,remux:Ds}];ws.splice(2,0,{demux:Dl,remux:Ds});class Xa{constructor(e,t,n,i,r,s){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=r,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const r=n.transmuxing;r.executeStart=Cr();let s=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:u}=this;i&&(this.currentTransmuxState=i);const{contiguous:l,discontinuity:d,trackSwitch:f,accurateTimeOffset:v,timeOffset:p,initSegmentChange:y}=i||o,{audioCodec:T,videoCodec:b,defaultInitPts:I,duration:B,initSegmentData:P}=u,ue=Wl(s,t);if(ue&&Gi(ue.method)){const Me=this.getDecrypter(),it=Vi(ue.method);if(Me.isSync()){let Te=Me.softwareDecrypt(s,ue.key.buffer,ue.iv.buffer,it);if(n.part>-1){const an=Me.flush();Te=an&&an.buffer}if(!Te)return r.executeEnd=Cr(),ea(n);s=new Uint8Array(Te)}else return this.asyncResult=!0,this.decryptionPromise=Me.webCryptoDecrypt(s,ue.key.buffer,ue.iv.buffer,it).then(Te=>{const Ut=this.push(Te,null,n);return this.decryptionPromise=null,Ut}),this.decryptionPromise}const he=this.needsProbing(d,f);if(he){const Me=this.configureTransmuxer(s);if(Me)return this.logger.warn(`[transmuxer] ${Me.message}`),this.observer.emit(m.ERROR,m.ERROR,{type:Z.MEDIA_ERROR,details:x.FRAG_PARSING_ERROR,fatal:!1,error:Me,reason:Me.message}),r.executeEnd=Cr(),ea(n)}(d||f||y||he)&&this.resetInitSegment(P,T,b,B,t),(d||y||he)&&this.resetInitialTimestamp(I),l||this.resetContiguity();const je=this.transmux(s,ue,p,v,n);this.asyncResult=ys(je);const me=this.currentTransmuxState;return me.contiguous=!0,me.discontinuity=!1,me.trackSwitch=!1,r.executeEnd=Cr(),je}flush(e){const t=e.transmuxing;t.executeStart=Cr();const{decrypter:n,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then(()=>this.flush(e));const s=[],{timeOffset:o}=i;if(n){const f=n.flush();f&&s.push(this.push(f.buffer,null,e))}const{demuxer:u,remuxer:l}=this;if(!u||!l){t.executeEnd=Cr();const f=[ea(e)];return this.asyncResult?Promise.resolve(f):f}const d=u.flush(o);return ys(d)?(this.asyncResult=!0,d.then(f=>(this.flushRemux(s,f,e),s))):(this.flushRemux(s,d,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:s,textTrack:o}=t,{accurateTimeOffset:u,timeOffset:l}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===ae.MAIN?"level":"track"} ${n.level}`);const d=this.remuxer.remux(i,r,s,o,l,u,!0,this.id);e.push({remuxResult:d,chunkMeta:n}),n.transmuxing.executeEnd=Cr()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,i,r){const{demuxer:s,remuxer:o}=this;!s||!o||(s.resetInitSegment(e,t,n,i),o.resetInitSegment(e,t,n,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,i,r){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,n,i,r):s=this.transmuxUnencrypted(e,n,i,r),s}transmuxUnencrypted(e,t,n,i){const{audioTrack:r,videoTrack:s,id3Track:o,textTrack:u}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,o,u,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,r){return this.demuxer.demuxSampleAes(e,t,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i}=this;let r;for(let f=0,v=ws.length;f<v;f++){var s;if((s=ws[f].demux)!=null&&s.probe(e,this.logger)){r=ws[f];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const o=this.demuxer,u=this.remuxer,l=r.remux,d=r.demux;(!u||!(u instanceof l))&&(this.remuxer=new l(n,t,i,this.logger)),(!o||!(o instanceof d))&&(this.demuxer=new d(n,t,i,this.logger),this.probe=d.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new jn(this.config)),e}}function Wl(a,e){let t=null;return a.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const ea=a=>({remuxResult:{},chunkMeta:a});function ys(a){return"then"in a&&a.then instanceof Function}class jl{constructor(e,t,n,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=i,this.defaultInitPts=r||null}}class Yl{constructor(e,t,n,i,r,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=s}}let qa=0;class Qa{constructor(e,t,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=qa++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=u=>{const l=u.data,d=this.hls;if(!(!d||!(l!=null&&l.event)||l.instanceNo!==this.instanceNo))switch(l.event){case"init":{var f;const v=(f=this.workerContext)==null?void 0:f.objectURL;v&&self.URL.revokeObjectURL(v);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}case"workerLog":{d.logger[l.data.logType]&&d.logger[l.data.logType](l.data.message);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.part=this.part,l.data.id=this.id,d.trigger(l.event,l.data);break}}},this.onWorkerError=u=>{if(!this.hls)return;const l=new Error(`${u.message} (${u.filename}:${u.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(m.ERROR,{type:Z.OTHER_ERROR,details:x.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:l})};const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const s=(u,l)=>{l=l||{},l.frag=this.frag||void 0,u===m.ERROR&&(l=l,l.parent=this.id,l.part=this.part,this.error=l.error),this.hls.trigger(u,l)};this.observer=new hs,this.observer.on(m.FRAG_DECRYPTED,s),this.observer.on(m.ERROR,s);const o=c(r.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const u=this.hls.logger;if(r.workerPath||Qo()){try{r.workerPath?(u.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=$o(r.workerPath)):(u.log(`injecting Web Worker for "${t}"`),this.workerContext=Jo());const{worker:d}=this.workerContext;d.addEventListener("message",this.onWorkerMessage),d.addEventListener("error",this.onWorkerError),d.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:o,id:t,config:qe(r)})}catch(d){u.warn(`Error setting up "${t}" Web Worker, fallback to inline`,d),this.terminateWorker(),this.error=null,this.transmuxer=new Xa(this.observer,o,r,"",t,e.logger)}return}}this.transmuxer=new Xa(this.observer,o,r,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=qa++;const t=this.hls.config,n=c(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:qe(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),el(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,i,r,s,o,u,l,d){var f,v;l.transmuxing.start=self.performance.now();const{instanceNo:p,transmuxer:y}=this,T=s?s.start:r.start,b=r.decryptdata,I=this.frag,B=!(I&&r.cc===I.cc),P=!(I&&l.level===I.level),ue=I?l.sn-I.sn:-1,he=this.part?l.part-this.part.index:-1,je=ue===0&&l.id>1&&l.id===(I==null?void 0:I.stats.chunkCount),me=!P&&(ue===1||ue===0&&(he===1||je&&he<=0)),Me=self.performance.now();(P||ue||r.stats.parsing.start===0)&&(r.stats.parsing.start=Me),s&&(he||!me)&&(s.stats.parsing.start=Me);const it=!(I&&((f=r.initSegment)==null?void 0:f.url)===((v=I.initSegment)==null?void 0:v.url)),Te=new Yl(B,me,u,P,T,it);if(!me||B||it){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id===ae.MAIN?"level":"track"}: ${l.level} id: ${l.id}
|
|
discontinuity: ${B}
|
|
trackSwitch: ${P}
|
|
contiguous: ${me}
|
|
accurateTimeOffset: ${u}
|
|
timeOffset: ${T}
|
|
initSegmentChange: ${it}`);const Ut=new jl(n,i,t,o,d);this.configureTransmuxer(Ut)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:p,cmd:"demux",data:e,decryptdata:b,chunkMeta:l,state:Te},e instanceof ArrayBuffer?[e]:[]);else if(y){const Ut=y.push(e,b,l,Te);ys(Ut)?Ut.then(an=>{this.handleTransmuxComplete(an)}).catch(an=>{this.transmuxerError(an,l,"transmuxer-interface push error")}):this.handleTransmuxComplete(Ut)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const i=n.flush(e);ys(i)?i.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")}):this.handleFlushResult(i,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const Ja=100;class Xl extends qi{constructor(e,t,n){super(e,t,n,"audio-stream-controller",ae.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(m.BUFFER_RESET,this.onBufferReset,this),e.on(m.BUFFER_CREATED,this.onBufferCreated,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(m.FRAG_LOADING,this.onFragLoading,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(m.BUFFER_RESET,this.onBufferReset,this),e.off(m.BUFFER_CREATED,this.onBufferCreated,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(m.FRAG_LOADING,this.onFragLoading,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){if(n===ae.MAIN){const s=t.cc,o=this.fragCurrent;if(this.initPTS[s]={baseTime:i,timescale:r},this.log(`InitPTS for cc: ${s} found from main: ${i}/${r}`),this.mainAnchor=t,this.state===tt.WAITING_INIT_PTS){const u=this.waitingData;(!u&&!this.loadingParts||u&&u.frag.cc!==s)&&(this.nextLoadPosition=this.findSyncFrag(t).start),this.tick()}else!this.hls.hasEnoughToStart&&o&&o.cc!==s?(this.startFragRequested=!1,this.nextLoadPosition=this.findSyncFrag(t).start,o.abortRequests(),this.resetLoadingState()):this.state===tt.IDLE&&this.tick()}}findSyncFrag(e){const t=this.getLevelDetails(),n=e.cc;return yn(t,n,e)||t&&Kt(t.fragments,n)||e}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=tt.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(Ja),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=tt.IDLE):this.state=tt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case tt.IDLE:this.doTickIdle();break;case tt.WAITING_TRACK:{const{levels:t,trackId:n}=this,i=t==null?void 0:t[n],r=i==null?void 0:i.details;if(r&&!this.waitForLive(i)){if(this.waitForCdnTuneIn(r))break;this.state=tt.WAITING_INIT_PTS}break}case tt.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,trackId:r}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((i==null?void 0:i[r])||null),this.state=tt.IDLE}break}case tt.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:n,part:i,cache:r,complete:s}=t,o=this.mainAnchor;if(this.initPTS[n.cc]!==void 0){this.waitingData=null,this.state=tt.FRAG_LOADING;const u=r.flush().buffer,l={frag:n,part:i,payload:u,networkDetails:null};this._handleFragmentLoadProgress(l),s&&super._handleFragmentLoadComplete(l)}else o&&o.cc!==t.frag.cc&&(this.log(`Waiting fragment cc (${n.cc}) cancelled because video is at cc ${o.cc}`),this.nextLoadPosition=this.findSyncFrag(o).start,this.clearWaitingFragment())}else this.state=tt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.state!==tt.STOPPED&&(this.state=tt.IDLE))}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:i,trackId:r}=this,s=t.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||!(n!=null&&n[r]))return;const o=n[r],u=o.details;if(!u||this.waitForLive(o)||this.waitForCdnTuneIn(u)){this.state=tt.WAITING_TRACK,this.startFragRequested=!1;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,$.AUDIO,ae.AUDIO));const d=this.getFwdBufferInfo(l,ae.AUDIO);if(d===null)return;if(!this.switchingTrack&&this._streamEnded(d,u)){t.trigger(m.BUFFER_EOS,{type:"audio"}),this.state=tt.ENDED;return}const f=d.len,v=t.maxBufferLength,p=u.fragments,y=p[0].start,T=this.getLoadPosition(),b=this.flushing?T:d.end;if(this.switchingTrack&&i){const P=T;u.PTSKnown&&P<y&&(d.end>y||d.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=y+.05)}if(f>=v&&!this.switchingTrack&&b<p[p.length-1].start)return;let I=this.getNextFragment(b,u);if(I&&this.isLoopLoading(I,b)&&(I=this.getNextFragmentLoopLoading(I,u,d,ae.MAIN,v)),!I){this.bufferFlushed=!0;return}let B=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&B&&Le(I)&&!I.endList&&(!u.live||!this.loadingParts&&b<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(B)===Bn.OK&&(this.mainFragLoading=B=null),B&&Le(B))){if(I.start>B.end){const ue=this.fragmentTracker.getFragAtPos(b,ae.MAIN);ue&&ue.end>B.end&&(B=ue,this.mainFragLoading={frag:ue,targetBufferTime:null})}if(I.start>B.end)return}this.loadFragment(I,o,b)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new U(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==tt.STOPPED&&(this.setInterval(Ja),this.state=tt.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(m.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:i}=this,{details:r,id:s,groupId:o,track:u}=t;if(!i){this.warn(`Audio tracks reset while loading track ${s} "${u.name}" of "${o}"`);return}const l=this.mainDetails;if(!l||r.endCC>l.endCC||l.expired){this.cachedTrackLoadedData=t,this.state!==tt.STOPPED&&(this.state=tt.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${u.name}" of "${o}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const d=i[s];let f=0;if(r.live||(n=d.details)!=null&&n.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;if(d.details){var v;f=this.alignPlaylists(r,d.details,(v=this.levelLastLoaded)==null?void 0:v.details)}r.alignedSliding||(Fi(r,l),r.alignedSliding||Si(r,l),f=r.fragmentStart)}d.details=r,this.levelLastLoaded=d,this.startFragRequested||this.setStartPosition(l,f),this.hls.trigger(m.AUDIO_TRACK_UPDATED,{details:r,id:s,groupId:t.groupId}),this.state===tt.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=tt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{config:s,trackId:o,levels:u}=this;if(!u){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const l=u[o];if(!l){this.warn("Audio track is undefined on fragment load progress");return}const d=l.details;if(!d){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const f=s.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let v=this.transmuxer;v||(v=this.transmuxer=new Qa(this.hls,ae.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const p=this.initPTS[n.cc],y=(t=n.initSegment)==null?void 0:t.data;if(p!==void 0){const b=i?i.index:-1,I=b!==-1,B=new wi(n.level,n.sn,n.stats.chunkCount,r.byteLength,b,I);v.push(r,y,f,"",n,i,d.totalduration,!1,B,p)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${d.startSN} ,${d.endSN}],track ${o}`);const{cache:T}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new $r,complete:!1};T.push(new Uint8Array(r)),this.state!==tt.STOPPED&&(this.state=tt.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===ae.MAIN&&Le(t.frag)&&(this.mainFragLoading=t,this.state===tt.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==ae.AUDIO){!this.audioOnly&&n.type===ae.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(Le(n)){this.fragPrevious=n;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(m.AUDIO_TRACK_SWITCHED,de({},r)))}this.fragBufferedComplete(n,i),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=tt.ERROR;return}switch(t.details){case x.FRAG_GAP:case x.FRAG_PARSING_ERROR:case x.FRAG_DECRYPT_ERROR:case x.FRAG_LOAD_ERROR:case x.FRAG_LOAD_TIMEOUT:case x.KEY_LOAD_ERROR:case x.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ae.AUDIO,t);break;case x.AUDIO_TRACK_LOAD_ERROR:case x.AUDIO_TRACK_LOAD_TIMEOUT:case x.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===tt.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===Xe.AUDIO_TRACK&&(this.state=tt.IDLE);break;case x.BUFFER_ADD_CODEC_ERROR:case x.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.resetLoadingState();break;case x.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case x.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==$.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==$.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===tt.ENDED&&(this.state=tt.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,ae.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:u,part:l,level:d}=o,{details:f}=d,{audio:v,text:p,id3:y,initSegment:T}=r;if(this.fragContextChanged(u)||!f){this.fragmentTracker.removeFragment(u);return}if(this.state=tt.PARSING,this.switchingTrack&&v&&this.completeAudioSwitch(this.switchingTrack),T!=null&&T.tracks){const b=u.initSegment||u;this._bufferInitSegment(d,T.tracks,b,s),i.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:b,id:n,tracks:T.tracks})}if(v){const{startPTS:b,endPTS:I,startDTS:B,endDTS:P}=v;l&&(l.elementaryStreams[$.AUDIO]={startPTS:b,endPTS:I,startDTS:B,endDTS:P}),u.setElementaryStreamInfo($.AUDIO,b,I,B,P),this.bufferFragmentData(v,u,l,s)}if(y!=null&&(t=y.samples)!=null&&t.length){const b=M({id:n,frag:u,details:f},y);i.trigger(m.FRAG_PARSING_METADATA,b)}if(p){const b=M({id:n,frag:u,details:f},p);i.trigger(m.FRAG_PARSING_USERDATA,b)}}_bufferInitSegment(e,t,n,i){if(this.state!==tt.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const r=t.audio;r.id=ae.AUDIO;const s=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${s}/${r.codec}]`),s&&s.split(",").length===1&&(r.levelCodec=s),this.hls.trigger(m.BUFFER_CODECS,t);const o=r.initSegment;if(o!=null&&o.byteLength){const u={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:o};this.hls.trigger(m.BUFFER_APPENDING,u)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.switchingTrack||i===Bn.NOT_LOADED||i===Bn.PARTIAL){var r;if(!Le(e))this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=tt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&Si(t.details,s)}else super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:o}=this.bufferedTrack;te({name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:o},e,Ve)||(Ct(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(m.AUDIO_TRACK_SWITCHED,de({},e))}}class ta extends bt{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const i=t==null?void 0:t.renditionReports;if(i){let r=-1;for(let s=0;s<i.length;s++){const o=i[s];let u;try{u=new self.URL(o.URI,t.url).href}catch(l){this.warn(`Could not construct new URL for Rendition Report: ${l}`),u=o.URI||""}if(u===e){r=s;break}else u===e.substring(0,u.length)&&(r=s)}if(r!==-1){const s=i[r],o=parseInt(s["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let u=parseInt(s["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const d=Math.min(t.age-t.partTarget,t.targetduration);u>=0&&d>t.partTarget&&(u+=1)}const l=n&&re(n);return new Q(o,u>=0?u:void 0,l)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}return e}playlistLoaded(e,t,n){const{details:i,stats:r}=t,s=self.performance.now(),o=r.loading.first?Math.max(0,s-r.loading.first):0;i.advancedDateTime=Date.now()-o;const u=this.hls.config.timelineOffset;if(u!==i.appliedTimelineOffset){const d=Math.max(u||0,0);i.appliedTimelineOffset=d,i.fragments.forEach(f=>{f.start=f.playlistOffset+d})}if(i.live||n!=null&&n.live){const d="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(n),n&&i.fragments.length>0){Zr(n,i);const B=i.playlistParsingError;if(B){this.warn(B);const P=this.hls;if(!P.config.ignorePlaylistParsingErrors){var l;const{networkDetails:ue}=t;P.trigger(m.ERROR,{type:Z.NETWORK_ERROR,details:x.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:B,reason:B.message,level:t.level||void 0,parent:(l=i.fragments[0])==null?void 0:l.type,networkDetails:ue,stats:r});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=r.loading.start);const f=this.hls.mainForwardBufferInfo,v=f?f.end-f.len:0,p=(i.edge-v)*1e3,y=Bi(i,p);if(i.requestScheduled+y<s?i.requestScheduled=s:i.requestScheduled+=y,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let T,b,I;if(i.canBlockReload&&i.endSN&&i.advanced){const B=this.hls.config.lowLatencyMode,P=i.lastPartSn,ue=i.endSN,he=i.lastPartIndex,je=he!==-1,me=P===ue;je?me?(b=ue+1,I=B?0:he):(b=P,I=B?he+1:i.maxPartIndex):b=ue+1;const Me=i.age,it=Me+i.ageHeader;let Te=Math.min(it-i.partTarget,i.targetduration*1.5);if(Te>0){if(it>i.targetduration*3)this.log(`Playlist last advanced ${Me.toFixed(2)}s ago. Omitting segment and part directives.`),b=void 0,I=void 0;else if(n!=null&&n.tuneInGoal&&it-i.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${Te} with playlist age: ${i.age}`),Te=0;else{const Ut=Math.floor(Te/i.targetduration);if(b+=Ut,I!==void 0){const an=Math.round(Te%i.targetduration/i.partTarget);I+=an}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${Me.toFixed(2)}s goal: ${Te} skip sn ${Ut} to part ${I}`)}i.tuneInGoal=Te}if(T=this.getDeliveryDirectives(i,t.deliveryDirectives,b,I),B||!me){i.requestScheduled=s,this.loadingPlaylist(d,T);return}}else(i.canBlockReload||i.canSkipUntil)&&(T=this.getDeliveryDirectives(i,t.deliveryDirectives,b,I));T&&b!==void 0&&i.canBlockReload&&(i.requestScheduled=r.loading.first+Math.max(y-o*2,y/2)),this.scheduleLoading(d,T,i)}else this.clearTimer()}scheduleLoading(e,t,n){const i=n||e.details;if(!i){this.loadingPlaylist(e,t);return}const r=self.performance.now(),s=i.requestScheduled;if(r>=s){this.loadingPlaylist(e,t);return}const o=s-r;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(o)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),o)}getDeliveryDirectives(e,t,n,i){let r=re(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=R.No),new Q(n,i,r)}checkRetry(e){const t=e.details,n=yt(e),i=e.errorAction,{action:r,retryCount:s=0,retryConfig:o}=i||{},u=!!i&&!!o&&(r===Cn.RetryRequest||!i.resolved&&r===Cn.SendAlternateToPenaltyBox);if(u){var l;if(s>=o.maxNumRetry)return!1;if(n&&(l=e.context)!=null&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const d=kt(o,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),d),this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" in ${d}ms`)}e.levelRetry=!0,i.resolved=!0}return u}}function $a(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!Es(a[t].attrs,e[t].attrs))return!1;return!0}function Es(a,e,t){const n=a["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>a[i]!==e[i])}function na(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class ql extends ta{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(m.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Audio track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Audio track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(v=>!n||n.indexOf(v.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(v=>v.default)&&(this.selectDefaultTrack=!1),o.forEach((v,p)=>{v.id=p});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const u=this.hls.config.audioPreference;if(!r&&u){const v=H(u,o,Ve);if(v>-1)r=o[v];else{const p=H(u,this.tracks);r=this.tracks[p]}}let l=this.findTrackId(r);l===-1&&r&&(l=this.findTrackId(null));const d={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(m.AUDIO_TRACKS_UPDATED,d);const f=this.trackId;if(l!==-1&&f===-1)this.setAudioTrack(l);else if(o.length&&f===-1){var s;const v=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${o.length}`);this.warn(v.message),this.hls.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:v})}}}onError(e,t){t.fatal||!t.context||t.context.type===Xe.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&te(e,i,Ve))return i;const r=H(e,this.tracksInGroup,Ve);if(r>-1){const s=this.tracksInGroup[r];return this.setAudioTrack(r),s}else if(i){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const o=$e(e,t.levels,n,s,Ve);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const s=H(e,n);if(s>-1)return n[s]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===n&&r||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(m.AUDIO_TRACK_SWITCHING,de({},i)),r))return;const s=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(!(this.selectDefaultTrack&&!i.default)&&(!e||te(e,i,Ve)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:u}=e;for(let l=0;l<t.length;l++){const d=t[l];if(te({name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:u},d,Ve))return l}for(let l=0;l<t.length;l++){const d=t[l];if(Es(e.attrs,d.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return l}for(let l=0;l<t.length;l++){const d=t[l];if(Es(e.attrs,d.attrs,["LANGUAGE"]))return l}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Ct(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(m.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}}class Ql{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(this.queues===null||this.tracks===null)return;const i=this.queues[t];i.push(e),i.length===1&&!n&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const n=(t=e[0])==null?void 0:t.label;(n==="async-blocker"||n==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const i=t[0];try{i.execute()}catch(r){var n;if(i.onError(r),this.queues===null||this.tracks===null)return;const s=(n=this.tracks[e])==null?void 0:n.buffer;s!=null&&s.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"<destroyed>":`
|
|
${this.list("video")}
|
|
${this.list("audio")}
|
|
${this.list("audiovideo")}}`}list(e){var t,n;return(t=this.queues)!=null&&t[e]||(n=this.tracks)!=null&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=(t=this.tracks)==null?void 0:t[e],i=n==null?void 0:n.buffer;return i?`SourceBuffer${i.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(n=>n.label).join(", "))||""}}const eo=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,to="HlsJsTrackRemovedError";class Jl extends Error{constructor(e){super(e),this.name=to}}class $l extends bt{constructor(e,t){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=n=>{var i;this.hls&&((i=this.mediaSource)==null?void 0:i.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=n=>{const{media:i,mediaSource:r}=this;n&&this.log("Media source opened"),!(!i||!r)&&(r.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(m.MEDIA_ATTACHED,{media:i,mediaSource:r}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:i}=this;n!==i&&this.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=Vt(Be(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.BUFFER_RESET,this.onBufferReset,this),e.on(m.BUFFER_APPENDING,this.onBufferAppending,this),e.on(m.BUFFER_CODECS,this.onBufferCodecs,this),e.on(m.BUFFER_EOS,this.onBufferEos,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(m.FRAG_PARSED,this.onFragParsed,this),e.on(m.FRAG_CHANGED,this.onFragChanged,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.BUFFER_RESET,this.onBufferReset,this),e.off(m.BUFFER_APPENDING,this.onBufferAppending,this),e.off(m.BUFFER_CODECS,this.onBufferCodecs,this),e.off(m.BUFFER_EOS,this.onBufferEos,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(m.FRAG_PARSED,this.onFragParsed,this),e.off(m.FRAG_CHANGED,this.onFragChanged,this),e.off(m.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const r=this.isUpdating();r||this.operationQueue.removeBlockers();const s=this.isQueued();(r||s)&&this.warn(`Transfering MediaSource with${s?" operations in queue":""}${r?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===t?M(n,i.tracks):this.sourceBuffers.forEach(r=>{const[s]=r;s&&(n[s]=M({},this.tracks[s]),this.removeBuffer(s)),r[0]=r[1]=null}),{media:e,mediaSource:t,tracks:n}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsTotal=i,this.log(`${i} bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&i&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media,i=Be(this.appendSource);if(this.transferData=this.overrides=void 0,n&&i){const r=!!t.mediaSource;(r||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new i;if(this.assignMediaSource(s),r)this._objectUrl=n.src,this.attachTransferred();else{const o=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const u=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||u&&s instanceof u,no(n),eu(n,o),n.load()}catch(u){n.src=o}else n.src=o}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(n=e.constructor)==null?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,i=t.tracks,r=i?Object.keys(i):null,s=r?r.length:0,o=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(i&&r&&s){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
|
|
required tracks: ${qe(n,(u,l)=>u==="initSegment"?void 0:l)};
|
|
transfer tracks: ${qe(i,(u,l)=>u==="initSegment"?void 0:l)}}`),!dt(i,n)){t.mediaSource=null,t.tracks=void 0;const u=e.currentTime,l=this.details,d=Math.max(u,(l==null?void 0:l.fragments[0].start)||0);if(d-u>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${u} -> ${d}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(n)}") start time: ${d} currentTime: ${u}`),this.onMediaDetaching(m.MEDIA_DETACHING,{}),this.onMediaAttaching(m.MEDIA_ATTACHING,t),e.currentTime=d;return}this.transferData=void 0,r.forEach(u=>{const l=u,d=i[l];if(d){const f=d.buffer;if(f){const v=this.fragmentTracker,p=d.id;if(v.hasFragments(p)||v.hasParts(p)){const b=vn.getBuffered(f);v.detectEvictedFragments(l,b,p,null,!0)}const y=ia(l),T=[l,f];this.sourceBuffers[y]=T,f.updating&&this.operationQueue&&this.operationQueue.prependBlocker(l),this.trackSourceBuffer(l,d)}}}),o(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),o()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:i,mediaSource:r,_objectUrl:s}=this;if(r){if(this.log(`media source ${n?"transferring":"detaching"}`),n)this.sourceBuffers.forEach(([o])=>{o&&this.removeBuffer(o)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const o=r.readyState==="open";try{const u=r.sourceBuffers;for(let l=u.length;l--;)o&&u[l].abort(),r.removeSourceBuffer(u[l]);o&&r.endOfStream()}catch(u){this.warn(`onMediaDetaching: ${u.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(r.removeEventListener("startstreaming",this._onStartStreaming),r.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}i&&(i.removeEventListener("emptied",this._onMediaEmptied),n||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(i.removeAttribute("src"),this.appendSource&&no(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(m.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const n=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),n)try{var i;(i=this.mediaSource)!=null&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(r){this.warn(`onBufferReset ${e}`,r)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[ia(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Ql(this.tracks)}onBufferCodecs(e,t){const n=this.tracks,i=Object.keys(t);this.log(`BUFFER_CODECS: "${i}" (current SB count ${this.sourceBufferCount})`);const r="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),s=!r&&this.sourceBufferCount&&this.media&&i.some(o=>!n[o]);if(r||s){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${i}" SourceBuffers`);return}i.forEach(o=>{var u,l,d;const f=t[o],{id:v,codec:p,levelCodec:y,container:T,metadata:b,supplemental:I}=f;let B=n[o];const P=(u=this.transferData)==null||(l=u.tracks)==null?void 0:l[o],ue=P!=null&&P.buffer?P:B,he=(ue==null?void 0:ue.pendingCodec)||(ue==null?void 0:ue.codec),je=ue==null?void 0:ue.levelCodec;B||(B=n[o]={buffer:void 0,listeners:[],codec:p,supplemental:I,container:T,levelCodec:y,metadata:b,id:v});const me=Wt(he,je),Me=me==null?void 0:me.replace(eo,"$1");let it=Wt(p,y);const Te=(d=it)==null?void 0:d.replace(eo,"$1");it&&me&&Me!==Te&&(o.slice(0,5)==="audio"&&(it=dn(it,this.appendSource)),this.log(`switching codec ${he} to ${it}`),it!==(B.pendingCodec||B.codec)&&(B.pendingCodec=it),B.container=T,this.appendChangeType(o,T,it))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&this.mediaSourceOpenOrEnded&&this.checkPendingTracks()}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e},{})}appendChangeType(e,t,n){const i=`${t};codecs=${n}`,r={label:`change-type=${i}`,execute:()=>{const s=this.tracks[e];if(s){const o=s.buffer;o!=null&&o.changeType&&(this.log(`changing ${e} sourceBuffer type to ${i}`),o.changeType(i),s.codec=n,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};this.append(r,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,i=n+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(n,ae.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var o;const u=this.tracks.video;(this.lastVideoAppendEnd>i||u!=null&&u.buffer&&vn.isBuffered(u.buffer,i)||((o=this.fragmentTracker.getAppendedFrag(i,ae.MAIN))==null?void 0:o.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn("Error executing block-audio operation",o)}};this.blockedAudioAppend={op:s,frag:e},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:i,type:r,parent:s,frag:o,part:u,chunkMeta:l}=t,d=l.buffering[r],f=o.sn,v=self.performance.now();d.start=v;const p=o.stats.buffering,y=u?u.stats.buffering:null;p.start===0&&(p.start=v),y&&y.start===0&&(y.start=v);const T=n.audio;let b=!1;r==="audio"&&(T==null?void 0:T.container)==="audio/mpeg"&&(b=!this.lastMpegAudioChunk||l.id===1||this.lastMpegAudioChunk.sn!==l.sn,this.lastMpegAudioChunk=l);const I=this.tracks.video,B=I==null?void 0:I.buffer;if(B&&f!=="initSegment"){const he=u||o,je=this.blockedAudioAppend;if(r==="audio"&&s!=="main"&&!this.blockedAudioAppend){const Me=he.start+he.duration*.05,it=B.buffered,Te=this.currentOp("video");!it.length&&!Te?this.blockAudio(he):!Te&&!vn.isBuffered(B,Me)&&this.lastVideoAppendEnd<Me&&this.blockAudio(he)}else if(r==="video"){const me=he.end;if(je){const Me=je.frag.start;(me>Me||me<this.lastVideoAppendEnd||vn.isBuffered(B,Me))&&this.unblockAudio()}this.lastVideoAppendEnd=me}}const P=(u||o).start,ue={label:`append-${r}`,execute:()=>{if(d.executeStart=self.performance.now(),b){const he=this.tracks[r];if(he){const je=he.buffer;if(je){const me=P-je.timestampOffset;Math.abs(me)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${P} (delta: ${me}) sn: ${f})`),je.timestampOffset=P)}}}this.appendExecutor(i,r)},onStart:()=>{},onComplete:()=>{const he=self.performance.now();d.executeEnd=d.end=he,p.first===0&&(p.first=he),y&&y.first===0&&(y.first=he);const je={};this.sourceBuffers.forEach(([me,Me])=>{me&&(je[me]=vn.getBuffered(Me))}),this.appendErrors[r]=0,r==="audio"||r==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(m.BUFFER_APPENDED,{type:r,frag:o,part:u,chunkMeta:l,parent:o.type,timeRanges:je})},onError:he=>{var je;const me={type:Z.MEDIA_ERROR,parent:o.type,details:x.BUFFER_APPEND_ERROR,sourceBufferName:r,frag:o,part:u,chunkMeta:l,error:he,err:he,fatal:!1},Me=(je=this.media)==null?void 0:je.error;if(he.code===DOMException.QUOTA_EXCEEDED_ERR)me.details=x.BUFFER_FULL_ERROR;else if(he.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!Me)me.errorAction=Fn(!0);else if(he.name===to&&this.sourceBufferCount===0)me.errorAction=Fn(!0);else{const it=++this.appendErrors[r];this.warn(`Failed ${it}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${Me||"no media error"})`),(it>=this.hls.config.appendErrorMaxRetry||Me)&&(me.fatal=!0)}this.hls.trigger(m.ERROR,me)}};this.append(ue,r,this.isPending(this.tracks[r]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(m.BUFFER_FLUSHED,{type:e})},onError:i=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,i)}}}onBufferFlushing(e,t){const{type:n,startOffset:i,endOffset:r}=t;n?this.append(this.getFlushOp(n,i,r),n):this.sourceBuffers.forEach(([s])=>{s&&this.append(this.getFlushOp(s,i,r),s)})}onFragParsed(e,t){const{frag:n,part:i}=t,r=[],s=i?i.elementaryStreams:n.elementaryStreams;s[$.AUDIOVIDEO]?r.push("audiovideo"):(s[$.AUDIO]&&r.push("audio"),s[$.VIDEO]&&r.push("video"));const o=()=>{const u=self.performance.now();n.stats.buffering.end=u,i&&(i.stats.buffering.end=u);const l=i?i.stats:n.stats;this.hls.trigger(m.FRAG_BUFFERED,{frag:n,part:i,stats:l,id:n.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(o,r).catch(u=>{this.warn(`Fragment buffered callback ${u}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t,n;return e&&(!((t=this.tracks[e])!=null&&t.ended)||((n=this.tracks[e])==null?void 0:n.ending))})}onBufferEos(e,t){var n;this.sourceBuffers.forEach(([s])=>{if(s){const o=this.tracks[s];(!t.type||t.type===s)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${s} buffer reached EOS`)))}});const i=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var o;return s&&!((o=this.tracks[s])!=null&&o.ended)})&&(i?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:s}=this;if(!s||s.readyState!=="open"){s&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${s.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),s.endOfStream(),this.hls.trigger(m.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(m.BUFFERED_TO_END,void 0)))}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){const e=this.getDurationAndRange();e&&this.blockUntilOpen(()=>this.updateMediaSource(e))}onError(e,t){if(t.details===x.BUFFER_APPEND_ERROR&&t.frag){var n;const i=(n=t.errorAction)==null?void 0:n.nextAutoLevel;A(i)&&i!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.sourceBufferCount)return;const i=e.config,r=n.currentTime,s=t.levelTargetDuration,o=t.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(A(o)&&o>=0){const u=Math.max(o,s),l=Math.floor(r/s)*s-u;this.flushBackBuffer(r,s,l)}if(A(i.frontBufferFlushThreshold)&&i.frontBufferFlushThreshold>0){const u=Math.max(i.maxBufferLength,i.frontBufferFlushThreshold),l=Math.max(u,s),d=Math.floor(r/s)*s+l;this.flushFrontBuffer(r,s,d)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const o=vn.getBuffered(r);if(o.length>0&&n>o.start(0)){var s;this.hls.trigger(m.BACK_BUFFER_REACHED,{bufferEnd:n});const u=this.tracks[i];if((s=this.details)!=null&&s.live)this.hls.trigger(m.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(u!=null&&u.ended){this.log(`Cannot flush ${i} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(m.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:i})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const s=vn.getBuffered(r),o=s.length;if(o<2)return;const u=s.start(o-1),l=s.end(o-1);if(n>u||e>=u&&e<=l)return;this.hls.trigger(m.BUFFER_FLUSHING,{startOffset:u,endOffset:1/0,type:i})}})}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||(n==null?void 0:n.readyState)!=="open")return null;const i=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&n.setLiveSeekableRange){const l=Math.max(0,t.fragmentStart),d=Math.max(l,i);return{duration:1/0,start:l,end:d}}return{duration:1/0}}const r=(e=this.overrides)==null?void 0:e.duration;if(r)return A(r)?{duration:r}:null;const s=this.media.duration,o=A(n.duration)?n.duration:0;return i>o&&i>s||!A(s)?{duration:i}:null}updateMediaSource({duration:e,start:t,end:n}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==e&&(A(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),i.duration=e),t!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${i.duration}. Setting seekable range to ${t}-${n}.`),i.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${qe(n)}`),this.tracksReady){var i;const r=(i=this.transferData)==null?void 0:i.tracks;r&&Object.keys(r).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,n])=>{if(t){const i=this.tracks[t];e[t]={buffer:n,container:i.container,codec:i.codec,supplemental:i.supplemental,levelCodec:i.levelCodec,id:i.id,metadata:i.metadata}}}),this.hls.trigger(m.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const r in e){const s=r,o=e[s];if(this.isPending(o)){const u=this.getTrackCodec(o,s),l=`${o.container};codecs=${u}`;o.codec=u,this.log(`creating sourceBuffer(${l})${this.currentOp(s)?" Queued":""} ${qe(o)}`);try{const d=n.addSourceBuffer(l),f=ia(s),v=[s,d];t[f]=v,o.buffer=d}catch(d){var i;this.error(`error while trying to add sourceBuffer: ${d.message}`),this.shiftAndExecuteNext(s),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[s],this.hls.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:d,sourceBufferName:s,mimeType:l,parent:o.id});return}this.trackSourceBuffer(s,o)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let i=e.codec;n&&(t==="video"||t==="audiovideo")&&En(n,"video")&&(i=St(i,n));const r=Wt(i,e.levelCodec);return r?t.slice(0,5)==="audio"?dn(r,this.appendSource):r:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const i=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:i,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(r,s)=>{const o=s.removedRanges;o!=null&&o.length&&this.hls.trigger(m.BUFFER_FLUSHED,{type:r})})}get mediaSrc(){var e,t;const n=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return n==null?void 0:n.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${i}`,t),this.hls.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.currentOp(e);r&&r.onError(i)}removeExecutor(e,t,n){const{media:i,mediaSource:r}=this,s=this.tracks[e],o=s==null?void 0:s.buffer;if(!i||!r||!o){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const u=A(i.duration)?i.duration:1/0,l=A(r.duration)?r.duration:1/0,d=Math.max(0,t),f=Math.min(n,u,l);f>d&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${d},${f}] from the ${e} SourceBuffer`),o.remove(d,f)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],i=n==null?void 0:n.buffer;if(!i)throw new Jl(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,i.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,i=t.map(s=>this.appendBlocker(s));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then(s=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var n;const i=(n=this.tracks[t])==null?void 0:n.buffer;!i||i.updating||this.shiftAndExecuteNext(t)})}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,n){const i=this.tracks[e];if(!i)return;const r=i.buffer;if(!r)return;const s=n.bind(this,e);i.listeners.push({event:t,listener:s}),r.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach(i=>{n.removeEventListener(i.event,i.listener)}),t.listeners.length=0)}}function no(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function eu(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function ia(a){return a==="audio"?1:0}class ra{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(m.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.BUFFER_CODECS,this.onBufferCodecs,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(m.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.BUFFER_CODECS,this.onBufferCodecs,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&A(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,ra.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;const i=(o,u)=>u?o.width!==u.width||o.height!==u.height:!0;let r=e.length-1;const s=Math.max(t,n);for(let o=0;o<e.length;o+=1){const u=e[o];if((u.width>=s||u.height>=s)&&i(u,e[o+1])){r=o;break}}return r}}const or={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},tu={HLS:"h"},Ss={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},nu={[Ss.OBJECT]:["br","d","ot","tb"],[Ss.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Ss.SESSION]:["cid","pr","sf","sid","st","v"],[Ss.STATUS]:["bs","rtp"]};class rs{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof rs?n:new rs(n))),this.value=e,this.params=t}}const iu="Dict";function ru(a){return Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a=="object"?JSON.stringify(a):String(a)}function su(a,e,t,n){return new Error(`failed to ${a} "${ru(e)}" as ${t}`,{cause:n})}function Tr(a,e,t){return su("serialize",a,e,t)}class io{constructor(e){this.description=e}}const ro="Bare Item",au="Boolean";function ou(a){if(typeof a!="boolean")throw Tr(a,au);return a?"?1":"?0"}const lu="Byte Sequence";function uu(a){if(ArrayBuffer.isView(a)===!1)throw Tr(a,lu);return`:${cl(a)}:`}const cu="Integer";function du(a){return a<-999999999999999||999999999999999<a}function so(a){if(du(a))throw Tr(a,cu);return a.toString()}function fu(a){return`@${so(a.getTime()/1e3)}`}const hu="Decimal";function mu(a){const e=_a(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Tr(a,hu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const gu="String",vu=/[\x00-\x1f\x7f]+/;function pu(a){if(vu.test(a))throw Tr(a,gu);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function yu(a){return a.description||a.toString().slice(7,-1)}const Eu="Token";function ao(a){const e=yu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Tr(e,Eu);return e}function sa(a){switch(typeof a){case"number":if(!A(a))throw Tr(a,ro);return Number.isInteger(a)?so(a):mu(a);case"string":return pu(a);case"symbol":return ao(a);case"boolean":return ou(a);case"object":if(a instanceof Date)return fu(a);if(a instanceof Uint8Array)return uu(a);if(a instanceof io)return ao(a);default:throw Tr(a,ro)}}const Su="Key";function aa(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Tr(a,Su);return a}function oa(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${aa(e)}`:`;${aa(e)}=${sa(t)}`).join("")}function oo(a){return a instanceof rs?`${sa(a.value)}${oa(a.params)}`:sa(a)}function bu(a){return`(${a.value.map(oo).join(" ")})${oa(a.params)}`}function Tu(a,e={whitespace:!0}){if(typeof a!="object")throw Tr(a,iu);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof rs||(r=new rs(r));let s=aa(i);return r.value===!0?s+=oa(r.params):(s+="=",Array.isArray(r.value)?s+=bu(r):s+=oo(r)),s}).join(`,${n}`)}function Au(a,e){return Tu(a,e)}function xu(a){return a==="ot"||a==="sf"||a==="st"}function Ru(a){return typeof a=="number"?A(a):a!=null&&a!==""&&a!==!1}const _s=a=>Math.round(a),Lu=(a,e)=>(e!=null&&e.baseUrl&&(a=dl(a,e.baseUrl)),encodeURIComponent(a)),Ps=a=>_s(a/100)*100,Iu={br:_s,d:_s,bl:Ps,dl:Ps,mtp:Ps,nor:Lu,rtp:Ps,tb:_s};function Cu(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),i=M({},Iu,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return n.forEach(s=>{if(r!=null&&r(s))return;let o=a[s];const u=i[s];u&&(o=u(o,e)),!(s==="v"&&o===1)&&(s=="pr"&&o===1||Ru(o)&&(xu(s)&&typeof o=="string"&&(o=new io(o)),t[s]=o))}),t}function lo(a,e={}){return a?Au(Cu(a,e),M({whitespace:!1},e)):""}function Du(a,e={}){const t={};if(!a)return t;const n=Object.entries(a),i=Object.entries(nu).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),r=n.reduce((s,o)=>{var u,l;const[d,f]=o,v=((u=i.find(p=>p[1].includes(d)))===null||u===void 0?void 0:u[0])||Ss.REQUEST;return(l=s[v])!==null&&l!==void 0||(s[v]={}),s[v][d]=f,s},{});return Object.entries(r).reduce((s,[o,u])=>(s[o]=lo(u,e),s),t)}function wu(a,e,t){return M(a,Du(e,t))}const _u="CMCD";function Pu(a,e={}){if(!a)return"";const t=lo(a,e);return`${_u}=${encodeURIComponent(t)}`}const uo=/CMCD=[^&#]+/;function Ou(a,e,t){const n=Pu(e,t);if(!n)return a;if(uo.test(a))return a.replace(uo,n);const i=a.includes("?")?"&":"?";return`${a}${i}${n}`}class Mu{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:or.MANIFEST,su:!this.initialized})}catch(r){this.hls.logger.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const{frag:r,part:s}=i,o=this.hls.levels[r.level],u=this.getObjectType(r),l={d:(s||r).duration*1e3,ot:u};(u===or.VIDEO||u===or.AUDIO||u==or.MUXED)&&(l.br=o.bitrate/1e3,l.tb=this.getTopBandwidth(u)/1e3,l.bl=this.getBufferLength(u));const d=s?this.getNextPart(s):this.getNextFrag(r);d!=null&&d.url&&d.url!==r.url&&(l.nor=d.url),this.apply(i,l)}catch(r){this.hls.logger.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHED,this.onMediaDetached,this),e.on(m.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHED,this.onMediaDetached,this),e.off(m.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,i;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:tu.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){M(t,this.createData());const n=t.ot===or.INIT||t.ot===or.VIDEO||t.ot===or.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((s,o)=>(i.includes(o)&&(s[o]=t[o]),s),{}));const r={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),wu(e.headers,t,r)):e.url=Ou(e.url,t,r)}getNextFrag(e){var t;const n=(t=this.hls.levels[e.level])==null?void 0:t.details;if(n){const i=e.sn-n.startSN;return n.fragments[i+1]}}getNextPart(e){var t,n;const{index:i,fragment:r}=e,s=(t=this.hls.levels[r.level])==null||(n=t.details)==null?void 0:n.partList;if(s){const{sn:o}=r;for(let u=s.length-1;u>=0;u--){const l=s[u];if(l.index===i&&l.fragment.sn===o)return s[u+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return or.TIMED_TEXT;if(e.sn==="initSegment")return or.INIT;if(t==="audio")return or.AUDIO;if(t==="main")return this.hls.audioTracks.length?or.VIDEO:or.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===or.AUDIO)n=i.audioTracks;else{const r=i.maxAutoLevel,s=r>-1?r+1:i.levels.length;n=i.levels.slice(0,s)}for(const r of n)r.bitrate>t&&(t=r.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===or.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:vn.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,o){t(r),this.loader.load(r,s,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,o){t(r),this.loader.load(r,s,o)}}}}const ku=3e5;class Nu extends bt{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(n=>n!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===Cn.SendAlternateToPenaltyBox&&n.flags===On.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:o,pathwayId:u,type:l}=t.context;o&&i?s=this.getPathwayForGroupId(o,l,s):u&&(s=u)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!r&&i&&(r=this.pathways()),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==s),n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${i&&i.length} priorities: ${qe(r)} penalized: ${qe(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t;const n=this.penalizedPathways,i=performance.now();Object.keys(n).forEach(r=>{i-n[r]>ku&&delete n[r]});for(let r=0;r<e.length;r++){const s=e[r];if(s in n)continue;if(s===this.pathwayId)return;const o=this.hls.nextLoadLevel,u=this.hls.levels[o];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,hr(t),this.hls.trigger(m.LEVELS_UPDATED,{levels:t});const l=this.hls.levels[o];u&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==u.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==u.bitrate&&this.log(`Unstable Pathways change from bitrate ${u.bitrate} to ${l.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let r=0;r<i.length;r++)if(t===Xe.AUDIO_TRACK&&i[r].hasAudioGroup(e)||t===Xe.SUBTITLE_TRACK&&i[r].hasSubtitleGroup(e))return i[r].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},i={};e.forEach(r=>{const{ID:s,"BASE-ID":o,"URI-REPLACEMENT":u}=r;if(t.some(d=>d.pathwayId===s))return;const l=this.getLevelsForPathway(o).map(d=>{const f=new Vn(d.attrs);f["PATHWAY-ID"]=s;const v=f.AUDIO&&`${f.AUDIO}_clone_${s}`,p=f.SUBTITLES&&`${f.SUBTITLES}_clone_${s}`;v&&(n[f.AUDIO]=v,f.AUDIO=v),p&&(i[f.SUBTITLES]=p,f.SUBTITLES=p);const y=fo(d.uri,f["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",u),T=new U({attrs:f,audioCodec:d.audioCodec,bitrate:d.bitrate,height:d.height,name:d.name,url:y,videoCodec:d.videoCodec,width:d.width});if(d.audioGroups)for(let b=1;b<d.audioGroups.length;b++)T.addGroupId("audio",`${d.audioGroups[b]}_clone_${s}`);if(d.subtitleGroups)for(let b=1;b<d.subtitleGroups.length;b++)T.addGroupId("text",`${d.subtitleGroups[b]}_clone_${s}`);return T});t.push(...l),co(this.audioTracks,n,u,s),co(this.subtitleTracks,i,u,s)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let i;try{i=new self.URL(e)}catch(d){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const d=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+d)}const r={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,o=s.errorRetry||s.timeoutRetry||{},u={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},l={onSuccess:(d,f,v,p)=>{this.log(`Loaded steering manifest: "${i}"`);const y=d.data;if((y==null?void 0:y.VERSION)!==1){this.log(`Steering VERSION ${y.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=y.TTL;const{"RELOAD-URI":T,"PATHWAY-CLONES":b,"PATHWAY-PRIORITY":I}=y;if(T)try{this.uri=new self.URL(T,i).href}catch(P){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${T}`);return}this.scheduleRefresh(this.uri||v.url),b&&this.clonePathways(b);const B={steeringManifest:y,url:i.toString()};this.hls.trigger(m.STEERING_MANIFEST_LOADED,B),I&&this.updatePathwayPriority(I)},onError:(d,f,v,p)=>{if(this.log(`Error loading steering manifest: ${d.code} ${d.text} (${f.url})`),this.stopLoad(),d.code===410){this.enabled=!1,this.log(`Steering manifest ${f.url} no longer available`);return}let y=this.timeToLoad*1e3;if(d.code===429){const T=this.loader;if(typeof(T==null?void 0:T.getResponseHeader)=="function"){const b=T.getResponseHeader("Retry-After");b&&(y=parseFloat(b)*1e3)}this.log(`Steering manifest ${f.url} rate limited`);return}this.scheduleRefresh(this.uri||f.url,y)},onTimeout:(d,f,v)=>{this.log(`Timeout loading steering manifest (${f.url})`),this.scheduleRefresh(this.uri||f.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,u,l)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const i=(n=this.hls)==null?void 0:n.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function co(a,e,t,n){a&&Object.keys(e).forEach(i=>{const r=a.filter(s=>s.groupId===i).map(s=>{const o=M({},s);return o.details=void 0,o.attrs=new Vn(o.attrs),o.url=o.attrs.URI=fo(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=n,o});a.push(...r)})}function fo(a,e,t,n){const{HOST:i,PARAMS:r,[t]:s}=n;let o;e&&(o=s==null?void 0:s[e],o&&(a=o));const u=new self.URL(a);return i&&!o&&(u.host=i),r&&Object.keys(r).sort().forEach(l=>{l&&u.searchParams.set(l,r[l])}),u.href}class ss extends bt{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=ss.CDMCleanupPromise?[ss.CDMCleanupPromise]:[],this.onMediaEncrypted=t=>{const{initDataType:n,initData:i}=t,r=`"${t.type}" event: init data type: "${n}"`;if(this.debug(r),i!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=sn(this.config));const o=s.map(hi).filter(u=>!!u);this.keyFormatPromise=this.getKeyFormatPromise(o)}this.keyFormatPromise.then(s=>{const o=Dn(s);let u,l;if(n==="sinf"){if(o!==Mt.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${o}`);return}const y=Ot(new Uint8Array(i));try{const T=Ai(JSON.parse(y).sinf),b=Pe(T);if(!b)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");u=new Uint8Array(b.subarray(8,24)),l=Mt.FAIRPLAY}catch(T){this.warn(`${r} Failed to parse sinf: ${T}`);return}}else{if(o!==Mt.WIDEVINE&&o!==Mt.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${o}`);return}const y=Nt(i),T=y.filter(I=>!!I.systemId&&ai(I.systemId)===o);T.length>1&&this.warn(`${r} Using first of ${T.length} pssh found for selected key-system ${o}`);const b=T[0];if(!b){y.length===0||y.some(I=>!I.systemId)?this.warn(`${r} contains incomplete or invalid pssh data`):this.log(`ignoring ${r} for ${y.map(I=>ai(I.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(l=ai(b.systemId),b.version===0&&b.data)if(l===Mt.WIDEVINE){const I=b.data.length-22;u=new Uint8Array(b.data.subarray(I,I+16))}else l===Mt.PLAYREADY&&(u=Xi(b.data))}if(!l||!u)return;const d=Ce.hexDump(u),{keyIdToKeySessionPromise:f,mediaKeySessions:v}=this;let p=f[d];for(let y=0;y<v.length;y++){const T=v[y],b=T.decryptdata;if(!b.keyId)continue;const I=Ce.hexDump(b.keyId);if(d===I||b.uri.replace(/-/g,"").indexOf(d)!==-1){if(p=f[I],b.pssh)break;delete f[I],b.pssh=new Uint8Array(i),b.keyId=u,p=f[d]=p.then(()=>this.generateRequestWithPreferredKeySession(T,n,i,"encrypted-event-key-match")),p.catch(B=>this.handleError(B));break}}if(!p){if(l!==o){this.log(`Ignoring "${t.type}" event with ${l} init data for selected key-system ${o}`);return}p=f[d]=this.getKeySystemSelectionPromise([l]).then(({keySystem:y,mediaKeys:T})=>{var b;this.throwIfDestroyed();const I=new Ki("ISO-23001-7",d,(b=hi(y))!=null?b:"");return I.pssh=new Uint8Array(i),I.keyId=u,this.attemptSetMediaKeys(y,T).then(()=>{this.throwIfDestroyed();const B=this.createMediaKeySessionContext({decryptdata:I,keySystem:y,mediaKeys:T});return this.generateRequestWithPreferredKeySession(B,n,i,"encrypted-event-no-match")})}),p.catch(y=>this.handleError(y))}})}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){const e=this.media;this.unregisterListeners(),this.onMediaDetached(),this._clear(e);const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(m.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(m.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Mt.WIDEVINE&&n)return n}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(s,o,u)=>!!s&&u.indexOf(s)===o,i=t.map(s=>s.audioCodec).filter(n),r=t.map(s=>s.videoCodec).filter(n);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((s,o)=>{const u=l=>{const d=l.shift();this.getMediaKeysPromise(d,i,r).then(f=>s({keySystem:d,mediaKeys:f})).catch(f=>{l.length?u(l):f instanceof gr?o(f):o(new gr({type:Z.KEY_SYSTEM_ERROR,details:x.KEY_SYSTEM_NO_ACCESS,error:f,fatal:!0},f.message))})};u(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return In===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return n(e,t)}getMediaKeysPromise(e,t,n){const i=oi(e,t,n,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let s=r==null?void 0:r.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${qe(i)}`),s=this.requestMediaKeySystemAccess(e,i);const o=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(u=>{this.log(`Failed to obtain access to key-system "${e}": ${u}`)}),s.then(u=>{this.log(`Access for key-system "${u.keySystem}" obtained`);const l=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=u.createMediaKeys().then(d=>(this.log(`Media-keys created for "${e}"`),l.then(f=>f?this.setMediaKeysServerCertificate(d,e,f):d))),o.mediaKeys.catch(d=>{this.error(`Failed to create media-keys for "${e}"}: ${d}`)}),o.mediaKeys})}return s.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${Ce.hexDump(e.keyId||[])}`);const i=n.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,r,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Ce.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${Ce.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
|
|
} (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,n)=>{const i=sn(this.config),r=e.map(Dn).filter(s=>!!s&&i.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:s})=>{const o=hi(s);o?t(o):n(new Error(`Unable to find format for key-system "${s}"`))}).catch(n)})}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),i=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let r=this.keyIdToKeySessionPromise[n];return r||(r=this.getKeySystemForKeyPromise(t).then(({keySystem:o,mediaKeys:u})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(o,u).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:o,mediaKeys:u,decryptdata:t}))))),(this.keyIdToKeySessionPromise[n]=r.then(o=>{const u="cenc",l=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(o,u,l,"playlist-key")})).catch(o=>this.handleError(o))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof gr?this.hls.trigger(m.ERROR,e.data):this.hls.trigger(m.ERROR,{type:Z.KEY_SYSTEM_ERROR,details:x.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=Dn(e.keyFormat),r=i?[i]:sn(this.config);return this.attemptKeySystemAccess(r)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=sn(this.config)),e.length===0)throw new gr({type:Z.KEY_SYSTEM_ERROR,details:x.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${qe({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>n.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,n,i){var r,s;const o=(r=this.config.drmSystems)==null||(s=r[e.keySystem])==null?void 0:s.generateRequest;if(o)try{const y=o.call(this.hls,t,n,e);if(!y)throw new Error("Invalid response from configured generateRequest filter");t=y.initDataType,n=y.initData?y.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(y){var u;if(this.warn(y.message),(u=this.hls)!=null&&u.config.debug)throw y}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${l} (init data type: ${t} length: ${n?n.byteLength:null})`);const d=new hs,f=e._onmessage=y=>{const T=e.mediaKeysSession;if(!T){d.emit("error",new Error("invalid state"));return}const{messageType:b,message:I}=y;this.log(`"${b}" message event for session "${T.sessionId}" message size: ${I.byteLength}`),b==="license-request"||b==="license-renewal"?this.renewLicense(e,I).catch(B=>{d.eventNames().length?d.emit("error",B):this.handleError(B)}):b==="license-release"?e.keySystem===Mt.FAIRPLAY&&(this.updateKeySession(e,Zi("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${b}"`)},v=e._onkeystatuseschange=y=>{if(!e.mediaKeysSession){d.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const b=e.keyStatus;d.emit("keyStatus",b),b==="expired"&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",f),e.mediaKeysSession.addEventListener("keystatuseschange",v);const p=new Promise((y,T)=>{d.on("error",T),d.on("keyStatus",b=>{b.startsWith("usable")?y():b==="output-restricted"?T(new gr({type:Z.KEY_SYSTEM_ERROR,details:x.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):b==="internal-error"?T(new gr({type:Z.KEY_SYSTEM_ERROR,details:x.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${b}"`)):b==="expired"?T(new Error("key expired while generating request")):this.warn(`unhandled key status change "${b}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var y;this.log(`Request generated for key-session "${(y=e.mediaKeysSession)==null?void 0:y.sessionId}" keyId: ${l}`)}).catch(y=>{throw new gr({type:Z.KEY_SYSTEM_ERROR,details:x.KEY_SYSTEM_NO_SESSION,error:y,fatal:!1},`Error generating key-session request: ${y}`)}).then(()=>p).catch(y=>{throw d.removeAllListeners(),this.removeSession(e),y}).then(()=>(d.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{if(typeof n=="string"&&typeof t=="object"){const i=n;n=t,t=i}this.log(`key status change "${t}" for keyStatuses keyId: ${Ce.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${Ce.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,i=new n(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,o)=>{const u={responseType:"arraybuffer",url:r},l=t.certLoadPolicy.default,d={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(v,p,y,T)=>{s(v.data)},onError:(v,p,y,T)=>{o(new gr({type:Z.KEY_SYSTEM_ERROR,details:x.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:y,response:de({url:u.url,data:void 0},v)},`"${e}" certificate request failed (${r}). Status: ${v.code} (${v.text})`))},onTimeout:(v,p,y)=>{o(new gr({type:Z.KEY_SYSTEM_ERROR,details:x.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:y,response:{url:u.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(v,p,y)=>{o(new Error("aborted"))}};i.load(u,d,f)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((i,r)=>{e.setServerCertificate(n).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),i(e)}).catch(s=>{r(new gr({type:Z.KEY_SYSTEM_ERROR,details:x.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(i=>{throw new gr({type:Z.KEY_SYSTEM_ERROR,details:x.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(n,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let d;for(let f=0,v=r.length;f<v;f++){var s,o;d=r[f];const p=(s=d.querySelector("name"))==null?void 0:s.textContent,y=(o=d.querySelector("value"))==null?void 0:o.textContent;p&&y&&e.setRequestHeader(p,y)}}const u=i.querySelector("Challenge"),l=u==null?void 0:u.textContent;if(!l)throw new Error("Cannot find <Challenge> in key message");return Zi(atob(l))}setupLicenseXHR(e,t,n,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,n,i)}).catch(s=>{if(!n.decryptdata)throw s;return e.open("POST",t,!0),r.call(this.hls,e,t,n,i)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let u=o.response;this.log(`License received ${u instanceof ArrayBuffer?u.byteLength:u}`);const l=this.config.licenseResponseCallback;if(l)try{u=l.call(this.hls,o,s,e)}catch(d){this.error(d)}i(u)}else{const u=n.errorRetry,l=u?u.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||o.status>=400&&o.status<500)r(new gr({type:Z.KEY_SYSTEM_ERROR,details:x.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${s}). Status: ${o.status} (${o.statusText})`));else{const d=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${d} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,s,e,t).then(({xhr:u,licenseChallenge:l})=>{e.keySystem==Mt.PLAYREADY&&(l=this.unpackPlayReadyKeyMessage(u,l)),u.send(l)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,n.removeEventListener("encrypted",this.onMediaEncrypted),n.removeEventListener("waitingforkey",this.onWaitingForKey),n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null)}_clear(e){var t;const n=this.mediaKeySessions;this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Ki.clearKeyUriToKeyIdMap();const i=n.length;ss.CDMCleanupPromise=Promise.all(n.map(r=>this.removeSession(r)).concat(e==null||(t=e.setMediaKeys(null))==null?void 0:t.catch(r=>{var s;this.log(`Could not clear media keys: ${r}`),(s=this.hls)==null||s.trigger(m.ERROR,{type:Z.OTHER_ERROR,details:x.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${r}`)})}))).then(()=>{i&&(this.log("finished closing key sessions and clearing media keys"),n.length=0)}).catch(r=>{var s;this.log(`Could not close sessions and clear media keys: ${r}`),(s=this.hls)==null||s.trigger(m.ERROR,{type:Z.OTHER_ERROR,details:x.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${r}`)})})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);i>-1&&this.mediaKeySessions.splice(i,1);const{drmSystemOptions:r}=this.config;return(gi(r)?new Promise((o,u)=>{self.setTimeout(()=>u(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(o)}):Promise.resolve()).catch(o=>{var u;this.log(`Could not remove session: ${o}`),(u=this.hls)==null||u.trigger(m.ERROR,{type:Z.OTHER_ERROR,details:x.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${o}`)})}).then(()=>t.close()).catch(o=>{var u;this.log(`Could not close session: ${o}`),(u=this.hls)==null||u.trigger(m.ERROR,{type:Z.OTHER_ERROR,details:x.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${o}`)})})}}}ss.CDMCleanupPromise=void 0;class gr extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}class Fu{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(m.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(m.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,s=n-this.lastDroppedFrames,o=t-this.lastDecodedFrames,u=1e3*s/r,l=this.hls;if(l.trigger(m.FPS_DROP,{currentDropped:s,currentDecoded:o,totalDroppedFrames:n}),u>0&&s>l.config.fpsDroppedMonitoringThreshold*o){let d=l.currentLevel;l.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=d)&&(d=d-1,l.trigger(m.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:l.currentLevel}),l.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function ho(a,e){let t;try{t=new Event("addtrack")}catch(n){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function mo(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(e.id))try{if(a.addCue(e),!a.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(n){fe.debug(`[texttrack-utils]: ${n}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,a.addCue(i)}catch(i){fe.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function as(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let n=a.cues.length;n--;)e&&a.cues[n].removeEventListener("enter",e),a.removeCue(a.cues[n]);t==="disabled"&&(a.mode=t)}function la(a,e,t,n){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=Uu(a.cues,e,t);for(let s=0;s<r.length;s++)(!n||n(r[s]))&&a.removeCue(r[s])}i==="disabled"&&(a.mode=i)}function Bu(a,e){if(e<=a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let n=0,i=t,r;for(;n<=i;)if(r=Math.floor((i+n)/2),e<a[r].startTime)i=r-1;else if(e>a[r].startTime&&n<t)n=r+1;else return r;return a[n].startTime-e<e-a[i].startTime?n:i}function Uu(a,e,t){const n=[],i=Bu(a,e);if(i>-1)for(let r=i,s=a.length;r<s;r++){const o=a[r];if(o.startTime>=e&&o.endTime<=t)n.push(o);else if(o.startTime>t)return n}return n}function Os(a){const e=[];for(let t=0;t<a.length;t++){const n=a[t];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&e.push(a[t])}return e}class Gu extends ta{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=Os(this.media.textTracks);for(let r=0;r<n.length;r++)if(n[r].mode==="hidden")t=n[r];else if(n[r].mode==="showing"){t=n[r];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(m.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const n=this.media;if(!n)return;const i=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,i)return;Os(n.textTracks).forEach(s=>{as(s)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Subtitle track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(s=>(i==null?void 0:i.indexOf(s))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(d=>!n||n.indexOf(d.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(d=>d.default)&&(this.selectDefaultTrack=!1),s.forEach((d,f)=>{d.id=f});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const o=this.hls.config.subtitlePreference;if(!r&&o){this.selectDefaultTrack=!1;const d=H(o,s);if(d>-1)r=s[d];else{const f=H(o,this.tracks);r=this.tracks[f]}}let u=this.findTrackId(r);u===-1&&r&&(u=this.findTrackId(null));const l={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(m.SUBTITLE_TRACKS_UPDATED,l),u!==-1&&this.trackId===-1&&this.setSubtitleTrack(u)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const r=t[i];if(!(n&&!r.default||!n&&!e)&&(!e||te(r,e)))return i}if(e){for(let i=0;i<t.length;i++){const r=t[i];if(Es(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const r=t[i];if(Es(e.attrs,r.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(na(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===Xe.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(e.id===-1)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&te(e,n))return n;const i=H(e,this.tracksInGroup);if(i>-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(n)return null;{const r=H(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(m.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Os(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(r=>na(n,r))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(r=>{r.mode!=="disabled"&&r!==i&&(r.mode="disabled")}),i){const r=this.subtitleDisplay?"showing":"hidden";i.mode!==r&&(i.mode=r)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!A(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!i.details&&!i.details.live;if(e===this.trackId&&i===n&&r)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:s,groupId:o="",name:u,type:l,url:d}=i;this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:u,type:l,url:d});const f=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(f)}}function bs(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const os=.025;let Ms=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function Vu(a,e,t){return`${a.identifier}-${t+1}-${bs(e)}`}class zu{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){if(e>=this.assetList.length)return!0;const t=this.playoutLimit;return e<=0||isNaN(t)?!1:this.assetList[e].startOffset>t}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return ua(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime,n=ua(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=A(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return ua(e,t)}return e}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<os))}set appendInPlace(e){if(this.appendInPlaceStarted){this.resetOnResume=!e;return}this.appendInPlaceDisabled=!e}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return this._duration!==null?t=this._duration:this.dateRange.duration?t=this.dateRange.duration:t=this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?Ms.Range:Ms.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return Zu(this)}}function ua(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<os)?e.start:e.start+e.duration}function go(a,e,t){const n=new self.URL(a,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function Zu(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function ca(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Ku{constructor(e,t,n,i){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{const l=this.interstitial.playoutLimit,d=this.currentTime;this.startOffset+d>=l&&this.hls.trigger(m.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new e(t);this.interstitial=n,this.assetItem=i;let s=i.uri;try{s=go(s,r.sessionId).href}catch(u){}r.loadSource(s);const o=()=>{this.hasDetails=!0};r.once(m.LEVEL_LOADED,o),r.once(m.AUDIO_TRACK_LOADED,o),r.once(m.SUBTITLE_TRACK_LOADED,o),r.on(m.MEDIA_ATTACHING,(u,{media:l})=>{this.removeMediaListeners(),this.mediaAttached=l,this.interstitial.playoutLimit&&l.addEventListener("timeupdate",this.checkPlayout)})}bufferedInPlaceToEnd(e){var t;if(!this.interstitial.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e||!this._bufferedEosTime)return!1;const n=this.timelineOffset,i=vn.bufferInfo(e,n,0);return this.getAssetTime(i.end)>=this._bufferedEosTime-.02}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=vn.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;return e||0}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){this.hls.attachMedia(e)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}on(e,t,n){this.hls.on(e,t)}once(e,t,n){this.hls.once(e,t)}off(e,t,n){this.hls.off(e,t)}toString(){var e,t;return`HlsAssetPlayer: ${ca(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${(t=this.interstitial)!=null&&t.appendInPlace?"append-in-place":""}`}}const vo=.033;class Hu extends bt{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((n,i)=>e<=i.startOffset&&t>i.startOffset?(delete i.error,n+1):n,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const i=this.items;if(i)for(i[n]||(t===void 0&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&(r=i[n])!=null&&r.event;){var r;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let i=0;i<n.length;i++){let r=n[i];if(t&&t!=="primary"&&(r=r[t]),e===r.start||e>r.start&&e<r.end)return i}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let i=e;i<=t&&n[i];i++){const r=n[i].event;if(r!=null&&r.restrictions.jump&&!r.appendInPlace)return i}return-1}findEventIndex(e){const t=this.items;if(t)for(let i=t.length;i--;){var n;if(((n=t[i].event)==null?void 0:n.identifier)===e)return i}return-1}findAssetIndex(e,t){const n=e.assetList,i=n.length;if(i>1)for(let r=0;r<i;r++){const s=n[r];if(!s.error){const o=s.timelineStart;if(t===o||t>o&&t<o+(s.duration||0))return r}}return 0}get assetIdAtEnd(){var e,t;const n=(e=this.items)==null||(t=e[this.length-1])==null?void 0:t.event;if(n){const i=n.assetList,r=i[i.length-1];if(r)return r.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:i}=n,r=this.events,s=this.parseDateRanges(i,{url:n.url},t),o=Object.keys(i),u=r?r.filter(l=>!o.includes(l.identifier)):[];s.length&&s.sort((l,d)=>{const f=l.cue.pre,v=l.cue.post,p=d.cue.pre,y=d.cue.post;if(f&&!p)return-1;if(p&&!f||v&&!y)return 1;if(y&&!v)return-1;if(!f&&!p&&!v&&!y){const T=l.startTime,b=d.startTime;if(T!==b)return T-b}return l.dateRange.tagOrder-d.dateRange.tagOrder}),this.events=s,u.forEach(l=>{this.removeEvent(l)}),this.updateSchedule(e,u)}updateSchedule(e,t=[]){const n=this.events||[];if(n.length||t.length||this.length<2){const i=this.items,r=this.parseSchedule(n,e);(t.length||(i==null?void 0:i.length)!==r.length||r.some((o,u)=>Math.abs(o.playout.start-i[u].playout.start)>.005||Math.abs(o.playout.end-i[u].playout.end)>.005))&&(this.items=r,this.onScheduleUpdate(t,i))}}parseDateRanges(e,t,n){const i=[],r=Object.keys(e);for(let s=0;s<r.length;s++){const o=r[s],u=e[o];if(u.isInterstitial){let l=this.eventMap[o];l?l.setDateRange(u):(l=new zu(u,t),this.eventMap[o]=l,n===!1&&(l.appendInPlace=n)),i.push(l)}}return i}parseSchedule(e,t){const n=[],i=t.main.details,r=i.live?1/0:i.edge;let s=0;if(e=e.filter(u=>!u.error&&!(u.cue.once&&u.hasPlayed)),e.length){this.resolveOffsets(e,t);let u=0,l=0;if(e.forEach((d,f)=>{const v=d.cue.pre,p=d.cue.post,y=e[f-1]||null,T=d.appendInPlace,b=p?r:d.startOffset,I=d.duration,B=d.timelineOccupancy===Ms.Range?I:0,P=d.resumptionOffset,ue=(y==null?void 0:y.startTime)===b,he=b+d.cumulativeDuration;let je=T?he+I:b+P;if(v||!p&&b<=0){const Me=l;l+=B,d.timelineStart=he;const it=s;s+=I,n.push({event:d,start:he,end:je,playout:{start:it,end:s},integrated:{start:Me,end:l}})}else if(b<=r){if(!ue){const Te=b-u;if(Te>vo){const Ut=u,an=l;l+=Te;const di=s;s+=Te;const Wn={previousEvent:e[f-1]||null,nextEvent:d,start:Ut,end:Ut+Te,playout:{start:di,end:s},integrated:{start:an,end:l}};n.push(Wn)}else Te>0&&y&&(y.cumulativeDuration+=Te,n[n.length-1].end=b)}p&&(je=he),d.timelineStart=he;const Me=l;l+=B;const it=s;s+=I,n.push({event:d,start:he,end:je,playout:{start:it,end:s},integrated:{start:Me,end:l}})}else return;const me=d.resumeTime;p||me>r?u=r:u=me}),u<r){var o;const d=u,f=l,v=r-u;l+=v;const p=s;s+=v,n.push({previousEvent:((o=n[n.length-1])==null?void 0:o.event)||null,nextEvent:null,start:u,end:d+v,playout:{start:p,end:s},integrated:{start:f,end:l}})}this.setDurations(r,s,l)}else n.push({previousEvent:null,nextEvent:null,start:0,end:r,playout:{start:0,end:r},integrated:{start:0,end:r}}),this.setDurations(r,r,r);return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,i=n.live?1/0:n.edge;let r=0,s=-1;e.forEach((o,u)=>{const l=o.cue.pre,d=o.cue.post,f=l?0:d?i:o.startTime;this.updateAssetDurations(o),s===f?o.cumulativeDuration=r:(r=0,s=f),!d&&o.snapOptions.in&&(o.resumeAnchor=Jt(null,n.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)),!o.appendInPlace&&u+1<e.length&&e[u+1].startTime-e[u].resumeTime<vo&&(e[u+1].appendInPlace=!1,e[u+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`));const p=A(o.resumeOffset)?o.resumeOffset:o.duration;r+=p})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,i=e.startTime+e.resumptionOffset;return Math.abs(n-i)>os?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${i}`),!1):t?!Object.keys(t).some(s=>{const o=t[s].details,u=o.edge;if(n>=u)return this.log(`"${e.identifier}" resumption ${n} past ${s} playlist end ${u}`),!1;const l=Jt(null,o.fragments,n);if(!l)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${s} playlist (${o.fragStart}-${o.fragmentEnd})`),!0;const d=s==="audio"?.175:0;return Math.abs(l.start-n)<os+d||Math.abs(l.end-n)<os+d?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${s} fragment bounds (${l.start}-${l.end} sn: ${l.sn} cc: ${l.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${n} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,i=!1,r=!1;e.assetList.forEach((s,o)=>{const u=t+n;s.startOffset=n,s.timelineStart=u,i||(i=s.duration===null),r||(r=!!s.error);const l=s.error?0:s.duration||0;n+=l}),i&&!r?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Fr(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class Wu{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let i;try{i=go(n,this.hls.sessionId,e.baseUrl)}catch(v){const p=this.assignAssetListError(e,x.ASSET_LIST_LOAD_ERROR,v,n);this.hls.trigger(m.ERROR,p);return}t&&i.protocol!=="data:"&&i.searchParams.set("_HLS_start_offset",""+t);const r=this.hls.config,s=r.loader,o=new s(r),u={responseType:"json",url:i.href},l=r.interstitialAssetListLoadPolicy.default,d={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(v,p,y,T)=>{const b=v.data,I=b==null?void 0:b.ASSETS;if(!Array.isArray(I)){const B=this.assignAssetListError(e,x.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),y.url,p,T);this.hls.trigger(m.ERROR,B);return}e.assetListResponse=b,this.hls.trigger(m.ASSET_LIST_LOADED,{event:e,assetListResponse:b,networkDetails:T})},onError:(v,p,y,T)=>{const b=this.assignAssetListError(e,x.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${v.code} ${v.text} (${p.url})`),p.url,T,y);this.hls.trigger(m.ERROR,b)},onTimeout:(v,p,y)=>{const T=this.assignAssetListError(e,x.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${p.url})`),p.url,v,y);this.hls.trigger(m.ERROR,T)}};return o.load(u,d,f),this.hls.trigger(m.ASSET_LIST_LOADING,{event:e}),o}assignAssetListError(e,t,n,i,r,s){return e.error=n,{type:Z.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:n,networkDetails:s,stats:r}}}function Dr(a,e,t){Ar(a,e,t),a.addEventListener(e,t)}function Ar(a,e,t){a.removeEventListener(e,t)}function po(a){a==null||a.play().catch(()=>{})}class ju extends bt{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;const i=n-this.timelinePos;if(Math.abs(i)<1/7056e5)return;const s=i<=-.01;this.timelinePos=n,this.bufferedPos=n;const o=this.playingItem;if(!o){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(n,n-i)&&this.updateSchedule(),this.checkBuffer(),s&&n<o.start||n>=o.end){var u;const v=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(o)&&(u=this.media)!=null&&u.paused&&(this.shouldPlay=!1),!s){const p=this.findItemIndex(o);if(v>p){const y=this.schedule.findJumpRestrictedIndex(p+1,v);if(y>p){this.setSchedulePosition(y);return}}}this.setSchedulePosition(v);return}const l=this.playingAsset;if(!l){if(this.playingLastItem&&this.isInterstitial(o)){const v=o.event.assetList[0];v&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,v))}return}const d=l.timelineStart,f=l.duration||0;(s&&n<d||n>=d+f)&&this.setScheduleToAssetAtTime(n,l)},this.onTimeupdate=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;if(n>this.timelinePos)this.timelinePos=n,n>this.bufferedPos&&this.checkBuffer();else return;const i=this.playingItem;if(!i||this.playingLastItem)return;if(n>=i.end){this.timelinePos=i.end;const o=this.findItemIndex(i);this.setSchedulePosition(o+1)}const r=this.playingAsset;if(!r)return;const s=r.timelineStart+(r.duration||0);n>=s&&this.setScheduleToAssetAtTime(n,r)},this.onScheduleUpdate=(n,i)=>{const r=this.schedule,s=this.playingItem,o=r.events||[],u=r.items||[],l=r.durations,d=n.map(p=>p.identifier),f=!!(o.length||d.length);if(f&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
|
|
Schedule: ${u.map(p=>Fr(p))}`),d.length&&this.log(`Removed events ${d}`),this.playerQueue.forEach(p=>{if(p.interstitial.appendInPlace){const y=p.assetItem.timelineStart,T=p.timelineOffset-y;if(T)try{p.timelineOffset=y}catch(b){Math.abs(T)>os&&this.warn(`${b} ("${p.assetId}" ${p.timelineOffset}->${y})`)}}}),s){const p=this.updateItem(s,this.timelinePos);this.itemsMatch(s,p)&&(this.playingItem=p,this.waitingItem=this.endedItem=null)}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const v=this.bufferingItem;if(v){const p=this.updateItem(v,this.bufferedPos);this.itemsMatch(v,p)?this.bufferingItem=p:v.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(v.event,null))}if(n.forEach(p=>{p.assetList.forEach(y=>{this.clearAssetPlayer(y.identifier,null)})}),f||i){if(this.hls.trigger(m.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:u.slice(0),durations:l,removedIds:d}),this.isInterstitial(s)&&d.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Wu(e),this.schedule=new Hu(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(m.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(m.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(m.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(m.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(m.BUFFER_APPENDED,this.onBufferAppended,this),e.on(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(m.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(m.MEDIA_ENDED,this.onMediaEnded,this),e.on(m.ERROR,this.onError,this),e.on(m.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(m.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(m.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(m.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(m.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(m.BUFFER_CODECS,this.onBufferCodecs,this),e.off(m.BUFFER_APPENDED,this.onBufferAppended,this),e.off(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(m.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(m.MEDIA_ENDED,this.onMediaEnded,this),e.off(m.ERROR,this.onError,this),e.off(m.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.manager=null,this.hls=this.HlsPlayerClass=this.schedule=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){Ar(e,"play",this.onPlay),Ar(e,"pause",this.onPause),Ar(e,"seeking",this.onSeeking),Ar(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;Dr(n,"seeking",this.onSeeking),Dr(n,"timeupdate",this.onTimeupdate),Dr(n,"play",this.onPlay),Dr(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,i=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!i){this.clearScheduleState();const r=this.findItemIndex(n);this.setSchedulePosition(r)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(this.media=null,!n&&(i&&this.removeMediaListeners(i),this.detachedData)){const r=this.getBufferingPlayer();r&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,r.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=f=>f&&e.getAssetPlayer(f.identifier),i=(f,v,p,y,T)=>{if(f){let b=f[v].start;const I=f.event;if(I){if(v==="playout"||I.timelineOccupancy!==Ms.Point){const B=n(p);(B==null?void 0:B.interstitial)===I&&(b+=B.assetItem.startOffset+B[T])}}else{const B=y==="bufferedPos"?s():e[y];b+=B-f.start}return b}return 0},r=(f,v)=>{if(f!==0&&v!=="primary"&&e.schedule.length){var p;const y=e.schedule.findItemIndexAtTime(f),T=(p=e.schedule.items)==null?void 0:p[y];if(T){const b=T[v].start-T.start;return f+b}}return f},s=()=>{const f=e.bufferedPos;return f===Number.MAX_VALUE?o("primary"):Math.max(f,0)},o=f=>{var v;return(v=e.primaryDetails)!=null&&v.live?e.primaryDetails.edge:e.schedule.durations[f]},u=(f,v)=>{var p,y;const T=e.effectivePlayingItem;if(T!=null&&(p=T.event)!=null&&p.restrictions.skip)return;e.log(`seek to ${f} "${v}"`);const b=e.effectivePlayingItem,I=e.schedule.findItemIndexAtTime(f,v),B=(y=e.schedule.items)==null?void 0:y[I],P=e.getBufferingPlayer(),ue=P==null?void 0:P.interstitial,he=ue==null?void 0:ue.appendInPlace,je=b&&e.itemsMatch(b,B);if(b&&(he||je)){const Me=n(e.playingAsset),it=(Me==null?void 0:Me.media)||e.primaryMedia;if(it){const Te=v==="primary"?it.currentTime:i(b,v,e.playingAsset,"timelinePos","currentTime"),Ut=f-Te,an=(he?Te:it.currentTime)+Ut;if(an>=0&&(!Me||he||an<=Me.duration)){it.currentTime=an;return}}}if(B){let Me=f;if(v!=="primary"){const Te=B[v].start,Ut=f-Te;Me=B.start+Ut}const it=!e.isInterstitial(B);if((!e.isInterstitial(b)||b.event.appendInPlace)&&(it||B.event.appendInPlace)){const Te=e.media||(he?P==null?void 0:P.media:null);Te&&(Te.currentTime=Me)}else if(b){const Te=e.findItemIndex(b);if(I>Te){const an=e.schedule.findJumpRestrictedIndex(Te+1,I);if(an>Te){e.setSchedulePosition(an);return}}let Ut=0;if(it)e.timelinePos=Me,e.checkBuffer();else{var me;const an=B==null||(me=B.event)==null?void 0:me.assetList;if(an){const di=f-(B[v]||B).start;for(let Wn=an.length;Wn--;){const Un=an[Wn];if(Un.duration&&di>=Un.startOffset&&di<Un.startOffset+Un.duration){Ut=Wn;break}}}}e.setSchedulePosition(I,Ut)}}},l=()=>{const f=e.effectivePlayingItem;if(e.isInterstitial(f))return f;const v=t();return e.isInterstitial(v)?v:null},d={get currentTime(){const f=l(),v=e.effectivePlayingItem;return v&&v===f?i(v,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-v.playout.start:0},set currentTime(f){const v=l(),p=e.effectivePlayingItem;p&&p===v&&u(f+p.playout.start,"playout")},get duration(){const f=l();return f?f.playout.end-f.playout.start:0},get assetPlayers(){var f;const v=(f=l())==null?void 0:f.event.assetList;return v?v.map(p=>e.getAssetPlayer(p.identifier)):[]},get playingIndex(){var f;const v=(f=l())==null?void 0:f.event;return v&&e.effectivePlayingAsset?v.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return l()}};this.manager={get events(){var f,v;return((f=e.schedule)==null||(v=f.events)==null?void 0:v.slice(0))||[]},get schedule(){var f,v;return((f=e.schedule)==null||(v=f.items)==null?void 0:v.slice(0))||[]},get interstitialPlayer(){return l()?d:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const f=t();return e.findItemIndex(f)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const f=e.effectivePlayingItem;return e.findItemIndex(f)},primary:{get bufferedEnd(){return s()},get currentTime(){const f=e.timelinePos;return f>0?f:0},set currentTime(f){u(f,"primary")},get duration(){return o("primary")},get seekableStart(){var f;return((f=e.primaryDetails)==null?void 0:f.fragmentStart)||0}},integrated:{get bufferedEnd(){return i(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return i(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(f){u(f,"integrated")},get duration(){return o("integrated")},get seekableStart(){var f;return r(((f=e.primaryDetails)==null?void 0:f.fragmentStart)||0,"integrated")}},skip:()=>{const f=e.effectivePlayingItem,v=f==null?void 0:f.event;if(v&&!v.restrictions.skip){const p=e.findItemIndex(f);if(v.appendInPlace){const y=f.playout.start+f.event.duration;u(y+.001,"playout")}else e.advanceAfterAssetEnded(v,p,1/0)}}}}return this.manager}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!n?!1:this.findItemIndex(t)===n.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t,n;if(this.mediaSelection===null)return;const i=this.waitingItem||this.playingItem;if(this.isInterstitial(i)&&!i.event.appendInPlace)return;let r=this.media;!r&&(e=this.bufferingItem)!=null&&(t=e.event)!=null&&t.appendInPlace&&(r=this.primaryMedia);const s=(n=r)==null?void 0:n.currentTime;if(!(s===void 0||!A(s)))return s}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,i=e.media;if(n&&i===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&i){this.detachedData={media:i};return}const r=e.transferMedia();this.log(`transfer MediaSource from ${e} ${qe(r)}`),this.detachedData=r}else t&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(e,t){var n,i;if(e.media===t)return;let r=null;const s=this.hls,o=e!==s,u=o&&e.interstitial.appendInPlace,l=(n=this.detachedData)==null?void 0:n.mediaSource;let d;if(s.media)u&&(r=s.transferMedia(),this.detachedData=r),d="Primary";else if(l){const p=this.getBufferingPlayer();p?(r=p.transferMedia(),d=`${p}`):d="detached MediaSource"}else d="detached media";if(!r){if(l)r=this.detachedData,this.log(`using detachedData: MediaSource ${qe(r)}`);else if(!this.detachedData||s.media===t){const p=this.playerQueue;p.length>1&&p.forEach(y=>{if(o&&y.interstitial.appendInPlace!==u){const T=y.interstitial;this.clearInterstitial(y.interstitial,null),T.appendInPlace=!1,T.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${T}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const f=r&&"mediaSource"in r&&((i=r.mediaSource)==null?void 0:i.readyState)!=="closed",v=f&&r?r:t;if(this.log(`${f?"transfering MediaSource":"attaching media"} to ${o?e:"Primary"} from ${d}`),v===r){const p=o&&e.assetId===this.schedule.assetIdAtEnd;v.overrides={duration:this.schedule.duration,endOfStream:!o||p,cueRemoval:!o}}e.attachMedia(v)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,i=this.effectivePlayingItem;if(n===-1){const r=this.hls.startPosition;if(this.timelinePos=r,t.length&&t[0].cue.pre){const s=e.findEventIndex(t[0].identifier);this.setSchedulePosition(s)}else if(r>=0||!this.primaryLive){const s=this.timelinePos=r>0?r:0,o=e.findItemIndexAtTime(s);this.setSchedulePosition(o)}}else if(i&&!this.playingItem){const r=e.findItemIndex(i);this.setSchedulePosition(r)}}advanceAfterAssetEnded(e,t,n){const i=n+1;if(!e.isAssetPastPlayoutLimit(i)&&!e.assetList[i].error)this.setSchedulePosition(t,i);else{const r=this.schedule.items;if(r){const s=t+1,o=r.length;if(s>=o){this.setSchedulePosition(-1);return}const u=e.resumeTime;this.timelinePos<u&&(this.timelinePos=u,this.checkBuffer()),this.setSchedulePosition(s)}}}setScheduleToAssetAtTime(e,t){const n=this.schedule,i=t.parentIdentifier,r=n.getEvent(i);if(r){const s=n.findEventIndex(i),o=n.findAssetIndex(r,e);this.setSchedulePosition(s,o)}}setSchedulePosition(e,t){const n=this.schedule.items;if(!n||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const i=e>=0?n[e]:null,r=this.playingItem,s=this.playingLastItem;if(this.isInterstitial(r)){var o;const l=r.event,d=this.playingAsset,f=d==null?void 0:d.identifier,v=f?this.getAssetPlayer(f):null;if(v&&f&&(!this.eventItemsMatch(r,i)||t!==void 0&&f!==((o=l.assetList)==null?void 0:o[t].identifier))){var u;const p=l.findAssetIndex(d);this.log(`INTERSTITIAL_ASSET_ENDED ${p+1}/${l.assetList.length} ${ca(d)}`),this.endedAsset=d,this.playingAsset=null,this.hls.trigger(m.INTERSTITIAL_ASSET_ENDED,{asset:d,assetListIndex:p,event:l,schedule:n.slice(0),scheduleIndex:e,player:v}),this.retreiveMediaSource(f,i),v.media&&!((u=this.detachedData)!=null&&u.mediaSource)&&v.detachMedia()}if(!this.eventItemsMatch(r,i)&&(this.endedItem=r,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${l} ${Fr(r)}`),l.hasPlayed=!0,this.hls.trigger(m.INTERSTITIAL_ENDED,{event:l,schedule:n.slice(0),scheduleIndex:e}),l.cue.once)){this.updateSchedule();const p=this.schedule.items;if(i&&p){const y=this.schedule.findItemIndex(i);this.advanceSchedule(y,p,t,r,s)}return}}this.advanceSchedule(e,n,t,r,s)}advanceSchedule(e,t,n,i,r){const s=e>=0?t[e]:null,o=this.primaryMedia,u=this.playerQueue;if(u.length&&u.forEach(l=>{const d=l.interstitial,f=this.schedule.findEventIndex(d.identifier);(f<e||f>e+1)&&this.clearInterstitial(d,s)}),this.isInterstitial(s)){this.timelinePos=Math.min(Math.max(this.timelinePos,s.start),s.end);const l=s.event;n===void 0&&(n=this.schedule.findAssetIndex(l,this.timelinePos));const d=this.waitingItem;this.assetsBuffered(s,o)||this.setBufferingItem(s);let f=this.preloadAssets(l,n);if(this.eventItemsMatch(s,d||i)||(this.waitingItem=s,this.log(`INTERSTITIAL_STARTED ${Fr(s)} ${l.appendInPlace?"append in place":""}`),this.hls.trigger(m.INTERSTITIAL_STARTED,{event:l,schedule:t.slice(0),scheduleIndex:e})),!l.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${l}`);return}if(l.assetListLoader&&(l.assetListLoader.destroy(),l.assetListLoader=void 0),!o){this.log(`Waiting for attachMedia to start Interstitial ${l}`);return}this.waitingItem=this.endedItem=null,this.playingItem=s;const v=l.assetList[n];if(!v){const p=t[e+1],y=this.media;p&&y&&!this.isInterstitial(p)&&y.currentTime<p.start&&(y.currentTime=this.timelinePos=p.start),this.advanceAfterAssetEnded(l,e,n||0);return}if(f||(f=this.getAssetPlayer(v.identifier)),f===null||f.destroyed){const p=l.assetList.length;this.warn(`asset ${n+1}/${p} player destroyed ${l}`),f=this.createAssetPlayer(l,v,n)}if(!this.eventItemsMatch(s,this.bufferingItem)&&l.appendInPlace&&this.isAssetBuffered(v))return;this.startAssetPlayer(f,n,t,e,o),this.shouldPlay&&po(f.media)}else s!==null?(this.resumePrimary(s,e,i),this.shouldPlay&&po(this.hls.media)):r&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e,t;return(e=this.mediaSelection)==null||(t=e.main)==null?void 0:t.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var i;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Fr(e)}`),!((i=this.detachedData)!=null&&i.mediaSource)){let s=this.timelinePos;(s<e.start||s>=e.end)&&(s=this.getPrimaryResumption(e,t),this.timelinePos=s),this.attachPrimary(s,e)}if(!n)return;const r=this.schedule.items;r&&(this.log(`resumed ${Fr(e)}`),this.hls.trigger(m.INTERSTITIALS_PRIMARY_RESUMED,{schedule:r.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const i=this.primaryDetails;if(t===0)return this.hls.startPosition;if(i&&(n<i.fragmentStart||n>i.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:vn.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const i=this.primaryMedia;if(!i)return;const r=this.hls;r.media?this.checkBuffer():(this.transferMediaTo(r,i),n&&this.startLoadingPrimaryAt(e,n)),n||(this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const i=this.hls;!i.loadingEnabled||!i.media||Math.abs((((n=i.mainForwardBufferInfo)==null?void 0:n.start)||i.media.currentTime)-e)>.5?i.startLoad(e,t):i.bufferingEnabled||i.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(m.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(m.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1)return;const n=this.hls.levels[t.level],i=de(de({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=i,this.schedule.parseInterstitialDateRanges(i,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=de(de({},this.altSelection),{},{audio:n});return}const r=de(de({},i),{},{audio:n});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=de(de({},this.altSelection),{},{subtitles:n});return}const r=de(de({},i),{},{subtitles:n});this.mediaSelection=r}onAudioTrackSwitching(e,t){const n=w(t);this.playerQueue.forEach(i=>i.hls.setAudioOption(t)||i.hls.setAudioOption(n))}onSubtitleTrackSwitch(e,t){const n=w(t);this.playerQueue.forEach(i=>i.hls.setSubtitleOption(t)||t.id!==-1&&i.hls.setSubtitleOption(n))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const i=this.timelinePos;this.bufferedPos=i,this.checkBuffer()}}onBufferedToEnd(e){const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let i=0;i<t.length;i++){const r=t[i];if(r.cue.post){var n;const s=this.schedule.findEventIndex(r.identifier),o=(n=this.schedule.items)==null?void 0:n[s];this.isInterstitial(o)&&this.eventItemsMatch(o,this.bufferingItem)&&this.bufferedToItem(o,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const n=this.findItemIndex(t);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(e,t){const n=this.schedule.items;if(e&&n){const i=this.findItemIndex(e,t);return n[i]||null}return null}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var n;return!!t&&(e===t||e.event.identifier===((n=t.event)==null?void 0:n.identifier))}findItemIndex(e,t){return e?this.schedule.findItemIndex(e,t):-1}updateSchedule(){const e=this.mediaSelection;e&&this.schedule.updateSchedule(e,[])}checkBuffer(e){const t=this.schedule.items;if(!t)return;const n=vn.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=n.len<1),this.updateBufferedPos(n.end,t,e)}updateBufferedPos(e,t,n){const i=this.schedule,r=this.bufferingItem;if(this.bufferedPos>e)return;if(t.length===1&&this.itemsMatch(t[0],r)){this.bufferedPos=e;return}const s=this.playingItem,o=this.findItemIndex(s);let u=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var l,d;const f=this.findItemIndex(r),v=Math.min(f+1,t.length-1),p=t[v];if((u===-1&&r&&e>=r.end||(l=p.event)!=null&&l.appendInPlace&&e+.01>=p.start)&&(u=v),v-o>1&&(r==null||(d=r.event)==null?void 0:d.appendInPlace)===!1)return;if(this.bufferedPos=e,u>f&&u>o)this.bufferedToItem(p);else{const y=this.primaryDetails;this.primaryLive&&y&&e>y.edge-y.targetduration&&p.start<y.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(p)&&this.preloadAssets(p.event,0)}}else n&&s&&!this.itemsMatch(s,r)&&(u===o?this.bufferedToItem(s):u===o+1&&this.bufferedToItem(t[u]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(i=>{const r=this.getAssetPlayer(i.identifier);return!(r!=null&&r.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:i,events:r}=n;if(!i||!r)return t;const s=this.isInterstitial(e),o=this.getBufferingPlayer();if(this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos)),!this.playbackDisabled){const u=o?o.remaining:t?t.end-this.timelinePos:0;this.log(`buffered to boundary ${Fr(e)}`+(t?` (${u.toFixed(2)} remaining)`:"")),s?e.event.assetList.forEach(l=>{const d=this.getAssetPlayer(l.identifier);d&&d.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(l=>l.pauseBuffering()))}this.hls.trigger(m.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:r.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(n!==null){this.bufferingAsset=null;const i=this.detachedData;i?i.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,i=n.assetList.length===0&&!n.assetListLoader,r=n.cue.once;if(i||!r){const s=this.preloadAssets(n,t);if(s!=null&&s.interstitial.appendInPlace){const o=n.assetList[t],u=this.primaryMedia;o&&u&&this.bufferAssetPlayer(s,u)}}}preloadAssets(e,t){const n=e.assetUrl,i=e.assetList.length,r=i===0&&!e.assetListLoader,s=e.cue.once;if(r){const u=e.timelineStart;if(e.appendInPlace){var o;const v=this.playingItem;!this.isInterstitial(v)&&(v==null||(o=v.nextEvent)==null?void 0:o.identifier)===e.identifier&&this.flushFrontBuffer(u+.25)}let l,d=0;if(!this.playingItem&&this.primaryLive&&(d=this.hls.startPosition,d===-1&&(d=this.hls.liveSyncPosition||0)),d&&!(e.cue.pre||e.cue.post)){const v=d-u;v>0&&(l=Math.round(v*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:i} ${e}${l?` live-start: ${d} start-offset: ${l}`:""}`),n)return this.createAsset(e,0,0,u,e.duration,n);const f=this.assetListLoader.loadAssetList(e,l);f&&(e.assetListLoader=f)}else if(!s&&i){for(let u=t;u<i;u++){const l=e.assetList[u],d=this.getAssetPlayerQueueIndex(l.identifier);(d===-1||this.playerQueue[d].destroyed)&&!l.error&&this.createAssetPlayer(e,l,u)}return this.getAssetPlayer(e.assetList[t].identifier)}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(i=>{this.hls.trigger(m.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:i})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t){for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n]}return null}createAsset(e,t,n,i,r,s){const o={parentIdentifier:e.identifier,identifier:Vu(e,s,t),duration:r,startOffset:n,timelineStart:i,uri:s};return this.createAssetPlayer(e,o,t)}createAssetPlayer(e,t,n){this.log(`create HLSAssetPlayer for ${ca(t)}`);const i=this.hls,r=i.userConfig;let s=r.videoPreference;const o=i.loadLevelObj||i.levels[i.currentLevel];(s||o)&&(s=M({},s),o.videoCodec&&(s.videoCodec=o.videoCodec),o.videoRange&&(s.allowedVideoRanges=[o.videoRange]));const u=i.audioTracks[i.audioTrack],l=i.subtitleTracks[i.subtitleTrack];let d=0;if(this.primaryLive||e.appendInPlace){const P=this.timelinePos-t.timelineStart;if(P>1){const ue=t.duration;ue&&P<ue&&(d=P)}}const f=t.identifier,v=de(de({},r),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:f,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:d,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:u||r.audioPreference,subtitlePreference:l||r.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(v.timelineOffset=t.timelineStart));const p=v.cmcd;p!=null&&p.sessionId&&p.contentId&&(v.cmcd=M({},p,{contentId:bs(t.uri)})),this.getAssetPlayer(f)&&this.warn(`Duplicate date range identifier ${e} and asset ${f}`);const y=new Ku(this.HlsPlayerClass,v,e,t);this.playerQueue.push(y),e.assetList[n]=t;const T=P=>{if(P.live){const je=new Error(`Interstitials MUST be VOD assets ${e}`),me={fatal:!0,type:Z.OTHER_ERROR,details:x.INTERSTITIAL_ASSET_ITEM_ERROR,error:je};this.handleAssetItemError(me,e,this.schedule.findEventIndex(e.identifier),n,je.message);return}const ue=P.edge-P.fragmentStart,he=t.duration;(he===null||ue>he)&&(this.log(`Interstitial asset "${f}" duration change ${he} > ${ue}`),t.duration=ue,this.updateSchedule())};y.on(m.LEVEL_UPDATED,(P,{details:ue})=>T(ue)),y.on(m.LEVEL_PTS_UPDATED,(P,{details:ue})=>T(ue));const b=(P,ue)=>{const he=this.getAssetPlayer(f);if(he&&ue.tracks){he.off(m.BUFFER_CODECS,b),he.tracks=ue.tracks;const je=this.primaryMedia;this.bufferingAsset===he.assetItem&&je&&!he.media&&this.bufferAssetPlayer(he,je)}};y.on(m.BUFFER_CODECS,b);const I=()=>{var P;const ue=this.getAssetPlayer(f);if(this.log(`buffered to end of asset ${ue}`),!ue)return;const he=this.schedule.findEventIndex(e.identifier),je=e.findAssetIndex(t),me=je+1,Me=(P=this.schedule.items)==null?void 0:P[he];if(this.isInterstitial(Me))if(je!==-1&&!e.isAssetPastPlayoutLimit(me)&&!e.assetList[me].error)this.bufferedToItem(Me,me);else{var it;const Te=(it=this.schedule.items)==null?void 0:it[he+1];Te&&this.bufferedToItem(Te)}};y.on(m.BUFFERED_TO_END,I);const B=P=>()=>{if(!this.getAssetPlayer(f))return;this.shouldPlay=!0;const he=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,he,P)};return y.once(m.MEDIA_ENDED,B(n)),y.once(m.PLAYOUT_LIMIT_REACHED,B(1/0)),y.on(m.ERROR,(P,ue)=>{const he=this.getAssetPlayer(f);if(ue.details===x.BUFFER_STALLED_ERROR){if(he!=null&&he.media){const je=he.currentTime,me=he.duration-je;je&&e.appendInPlace&&me/he.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${f} ${e} at ${he.media.currentTime}`),I()):(this.warn(`Stalled at ${je} of ${je+me} in asset ${f} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError(ue,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${ue.error} ${e}`)}),y.on(m.DESTROYING,()=>{if(!this.getAssetPlayer(f))return;const ue=new Error(`Asset player destroyed unexpectedly ${f}`),he={fatal:!0,type:Z.OTHER_ERROR,details:x.INTERSTITIAL_ASSET_ITEM_ERROR,error:ue};this.handleAssetItemError(he,e,this.schedule.findEventIndex(e.identifier),n,ue.message)}),this.hls.trigger(m.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:y}),y}clearInterstitial(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)}),e.reset()}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(n!==-1){this.log(`clearAssetPlayer "${e}" toSegment: ${t&&Fr(t)}`);const i=this.playerQueue[n];this.transferMediaFromPlayer(i,t),this.playerQueue.splice(n,1),i.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,i,r){const{interstitial:s,assetItem:o,assetId:u}=e,l=s.assetList.length,d=this.playingAsset;this.endedAsset=null,this.playingAsset=o,(!d||d.identifier!==u)&&(d&&(this.clearAssetPlayer(d.identifier,n[i]),delete d.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${l} ${e}`),this.hls.trigger(m.INTERSTITIAL_ASSET_STARTED,{asset:o,assetListIndex:t,event:s,schedule:n.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,r)}bufferAssetPlayer(e,t){var n,i;const{interstitial:r,assetItem:s,assetId:o}=e,u=this.schedule.findEventIndex(r.identifier),l=(n=this.schedule.items)==null?void 0:n[u];if(!l)return;this.setBufferingItem(l),this.bufferingAsset=s;const d=this.getBufferingPlayer();if(d===e)return;const f=r.appendInPlace;if(f&&(d==null?void 0:d.interstitial.appendInPlace)===!1)return;const v=(d==null?void 0:d.tracks)||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(f&&s!==this.playingAsset){if(!e.tracks)return;if(v&&!dt(v,e.tracks)){const p=new Error(`Asset "${o}" SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(v)}')`),y={fatal:!0,type:Z.OTHER_ERROR,details:x.INTERSTITIAL_ASSET_ITEM_ERROR,error:p},T=r.findAssetIndex(s);this.handleAssetItemError(y,r,u,T,p.message);return}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,n,i,r){if(e.details===x.BUFFER_STALLED_ERROR)return;const s=t.assetList[i]||null;let o=null;if(s){const f=this.getAssetPlayerQueueIndex(s.identifier);o=this.playerQueue[f]||null}const u=this.schedule.items,l=M({},e,{fatal:!1,errorAction:Fn(!0),asset:s,assetListIndex:i,event:t,schedule:u,scheduleIndex:n,player:o});if(this.warn(`Asset item error: ${e.error}`),this.hls.trigger(m.INTERSTITIAL_ASSET_ERROR,l),!e.fatal)return;const d=new Error(r);s&&(this.playingAsset!==s&&this.clearAssetPlayer(s.identifier,null),s.error=d),t.assetList.some(f=>!f.error)?t.appendInPlace&&(t.error=d):t.error=d,this.primaryFallback(t)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(this.updateSchedule(),n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${n?Fr(n):"<none>"} error: ${e.error}`),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));let i=this.timelinePos;i===-1&&(i=this.hls.startPosition);const r=this.updateItem(n,i);if(this.itemsMatch(n,r))this.clearInterstitial(e,null);else{const s=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(s)}}else this.checkStart()}onAssetListLoaded(e,t){var n;const i=t.event,r=i.identifier,s=t.assetListResponse.ASSETS;if(!this.schedule.hasEvent(r))return;const o=i.timelineStart,u=i.duration;let l=0;s.forEach((y,T)=>{const b=parseFloat(y.DURATION);this.createAsset(i,T,l,o+l,b,y.URI),l+=b}),i.duration=l,this.log(`Loaded asset-list with duration: ${l} (was: ${u}) ${i}`);const d=this.waitingItem,f=(d==null?void 0:d.event.identifier)===r;this.updateSchedule();const v=(n=this.bufferingItem)==null?void 0:n.event;if(f){var p;const y=this.schedule.findEventIndex(r),T=(p=this.schedule.items)==null?void 0:p[y];if(T){if(!this.playingItem&&this.timelinePos>T.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==y){i.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${i}`),this.primaryFallback(i);return}this.setBufferingItem(T)}this.setSchedulePosition(y)}else if((v==null?void 0:v.identifier)===r&&v.appendInPlace){const y=i.assetList[0],T=this.getAssetPlayer(y.identifier),b=this.primaryMedia;y&&T&&b&&this.bufferAssetPlayer(T,b)}}onError(e,t){switch(t.details){case x.ASSET_LIST_PARSING_ERROR:case x.ASSET_LIST_LOAD_ERROR:case x.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&this.primaryFallback(n);break}case x.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const yo=500;class Yu extends qi{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",ae.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(m.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(m.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=tt.IDLE,this.setInterval(yo),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:i}=t;if(Le(n)&&(this.fragPrevious=n),this.state=tt.IDLE,!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let s;const o=n.start;for(let l=0;l<r.length;l++)if(o>=r[l].start&&o<=r[l].end){s=r[l];break}const u=n.start+n.duration;s?s.end=u:(s={start:o,end:u},r.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:i}=t;if(n===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(s=>{for(let o=0;o<s.length;){if(s[o].end<=r){s.shift();continue}else if(s[o].start<r)s[o].start=r;else break;o++}}),this.fragmentTracker.removeFragmentsInRange(n,r,ae.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===ae.SUBTITLE&&(t.details===x.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==tt.STOPPED&&(this.state=tt.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&$a(this.levels,t)){this.levels=t.map(n=>new U(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new U(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,ae.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.state!==tt.STOPPED&&this.setInterval(yo)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:r}=this,{details:s,id:o}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const u=r[o];if(o>=r.length||!u)return;this.log(`Subtitle track ${o} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(s.live||(n=u.details)!=null&&n.live){const f=this.mainDetails;if(s.deltaUpdateFailed||!f)return;const v=f.fragments[0];if(!u.details)s.hasProgramDateTime&&f.hasProgramDateTime?(Si(s,f),l=s.fragmentStart):v&&(l=v.start,ki(s,l));else{var d;l=this.alignPlaylists(s,u.details,(d=this.levelLastLoaded)==null?void 0:d.details),l===0&&v&&(l=v.start,ki(s,l))}}u.details=s,this.levelLastLoaded=u,o===i&&(this.hls.trigger(m.SUBTITLE_TRACK_UPDATED,{details:s,id:o,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===tt.IDLE&&(Jt(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),u.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&i!=null&&i.key&&i.iv&&Gi(i.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer,Vi(i.method)).catch(o=>{throw r.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const u=performance.now();r.trigger(m.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:s,tdecrypt:u}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=tt.IDLE})}}doTick(){if(!this.media){this.state=tt.IDLE;return}if(this.state===tt.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details||this.waitForLive(n))return;const{config:i}=this,r=this.getLoadPosition(),s=vn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:u}=s,l=n.details,d=this.hls.maxBufferLength+l.levelTargetDuration;if(u>d)return;const f=l.fragments,v=f.length,p=l.edge;let y=null;const T=this.fragPrevious;if(o<p){const B=i.maxFragLookUpTolerance,P=o>p-B?0:B;y=Jt(T,f,Math.max(f[0].start,o),P),!y&&T&&T.start<f[0].start&&(y=f[0])}else y=f[v-1];if(y=this.filterReplacedPrimary(y,n.details),!y)return;const b=y.sn-l.startSN,I=f[b-1];if(I&&I.cc===y.cc&&this.fragmentTracker.getState(I)===Bn.NOT_LOADED&&(y=I),this.fragmentTracker.getState(y)===Bn.NOT_LOADED){const B=this.mapToInitFragWhenRequired(y);B&&this.loadFragment(B,n,o)}}}loadFragment(e,t,n){Le(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Xu(this.tracksBuffered[this.currentTrackId]||[])}}class Xu{constructor(e){this.buffered=void 0;const t=(n,i,r)=>{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}const qu={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},Eo=a=>String.fromCharCode(qu[a]||a),yr=15,wr=100,Qu={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ju={17:2,18:4,21:6,22:8,23:10,19:13,20:15},$u={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},ec={25:2,26:4,29:6,30:8,31:10,27:13,28:15},tc=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class nc{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;fe.log(`${this.time} [${e}] ${n}`)}}}const Wr=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class So{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const i=t[n];e.hasOwnProperty(i)&&(this[i]=e[i])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class ic{constructor(){this.uchar=" ",this.penState=new So}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class rc{constructor(e){this.chars=[],this.pos=0,this.currPenState=new So,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<wr;t++)this.chars.push(new ic);this.logger=e}equals(e){for(let t=0;t<wr;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<wr;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<wr;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>wr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=wr)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=Eo(e);if(this.pos>=wr){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<wr;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<wr;n++){const i=this.chars[n].uchar;i!==" "&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class da{constructor(e){this.rows=[],this.currRow=yr-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<yr;t++)this.rows.push(new rc(e));this.logger=e}reset(){for(let e=0;e<yr;e++)this.rows[e].clear();this.currRow=yr-1}equals(e){let t=!0;for(let n=0;n<yr;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<yr;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<yr;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+qe(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let o=0;o<yr;o++)this.rows[o].clear();const r=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const o=s.rows[r].cueStartTime,u=this.logger.time;if(o!==null&&u!==null&&o<u)for(let l=0;l<this.nrRollUpRows;l++)this.rows[t-this.nrRollUpRows+l+1].copy(s.rows[r+l])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const r=e.indent,s=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[s].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+qe(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",i=-1;for(let r=0;r<yr;r++){const s=this.rows[r].getTextString();s&&(i=r+1,e?t.push("Row "+i+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
|
|
`)),n}getTextAndFormat(){return this.rows}}class bo{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new da(n),this.nonDisplayedMemory=new da(n),this.lastOutputScreen=new da(n),this.currRollUpRow=this.displayedMemory.rows[yr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[yr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),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=e)}insertChars(e){for(let n=0;n<e.length;n++)this.writeScreen.insertChar(e[n]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[n]}this.logger.log(2,"MIDROW: "+qe(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.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),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class To{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=ac(),this.logger=void 0;const i=this.logger=new nc;this.channels=[null,new bo(e,t,i),new bo(e+1,n,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const i=t[n]&127,r=t[n+1]&127;let s=!1,o=null;if(i===0&&r===0)continue;this.logger.log(3,()=>"["+Wr([t[n],t[n+1]])+"] -> ("+Wr([i,r])+")");const u=this.cmdHistory;if(i>=16&&i<=31){if(sc(i,r,u)){ks(null,null,u),this.logger.log(3,()=>"Repeated command ("+Wr([i,r])+") is dropped");continue}ks(i,r,this.cmdHistory),s=this.parseCmd(i,r),s||(s=this.parseMidrow(i,r)),s||(s=this.parsePAC(i,r)),s||(s=this.parseBackgroundAttributes(i,r))}else ks(null,null,u);if(!s&&(o=this.parseChars(i,r),o)){const d=this.currentChannel;d&&d>0?this.channels[d].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Wr([i,r])+" orig: "+Wr([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(n||i))return!1;const r=e===20||e===21||e===23?1:2,s=this.channels[r];return e===20||e===21||e===28||e===29?t===32?s.ccRCL():t===33?s.ccBS():t===34?s.ccAOF():t===35?s.ccAON():t===36?s.ccDER():t===37?s.ccRU(2):t===38?s.ccRU(3):t===39?s.ccRU(4):t===40?s.ccFON():t===41?s.ccRDC():t===42?s.ccTR():t===43?s.ccRTD():t===44?s.ccEDM():t===45?s.ccCR():t===46?s.ccENM():t===47&&s.ccEOC():s.ccTO(t-32),this.currentChannel=r,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[n];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Wr([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,r=(e===16||e===24)&&t>=64&&t<=95;if(!(i||r))return!1;const s=e<=23?1:2;t>=64&&t<=95?n=s===1?Qu[e]:$u[e]:n=s===1?Ju[e]:ec[e];const o=this.channels[s];return o?(o.setPAC(this.interpretPAC(n,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,i.underline=(n&1)===1,n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((n-16)/2)*4,i}parseChars(e,t){let n,i=null,r=null;if(e>=25?(n=2,r=e-8):(n=1,r=e),r>=17&&r<=19){let s;r===17?s=t+80:r===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+Eo(s)+"' in channel "+n),i=[s]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+Wr(i).join(",")),i}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(n||i))return!1;let r;const s={};e===16||e===24?(r=Math.floor((t-32)/2),s.background=tc[r],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}ks(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function ks(a,e,t){t.a=a,t.b=e}function sc(a,e,t){return t.a===a&&t.b===e}function ac(){return{a:null,b:null}}var fa=function(){if(Ei!=null&&Ei.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,u){if(typeof u!="string"||!Array.isArray(o))return!1;const l=u.toLowerCase();return~o.indexOf(l)?l:!1}function n(o){return t(a,o)}function i(o){return t(e,o)}function r(o,...u){let l=1;for(;l<arguments.length;l++){const d=arguments[l];for(const f in d)o[f]=d[f]}return o}function s(o,u,l){const d=this,f={enumerable:!0};d.hasBeenReset=!1;let v="",p=!1,y=o,T=u,b=l,I=null,B="",P=!0,ue="auto",he="start",je=50,me="middle",Me=50,it="middle";Object.defineProperty(d,"id",r({},f,{get:function(){return v},set:function(Te){v=""+Te}})),Object.defineProperty(d,"pauseOnExit",r({},f,{get:function(){return p},set:function(Te){p=!!Te}})),Object.defineProperty(d,"startTime",r({},f,{get:function(){return y},set:function(Te){if(typeof Te!="number")throw new TypeError("Start time must be set to a number.");y=Te,this.hasBeenReset=!0}})),Object.defineProperty(d,"endTime",r({},f,{get:function(){return T},set:function(Te){if(typeof Te!="number")throw new TypeError("End time must be set to a number.");T=Te,this.hasBeenReset=!0}})),Object.defineProperty(d,"text",r({},f,{get:function(){return b},set:function(Te){b=""+Te,this.hasBeenReset=!0}})),Object.defineProperty(d,"region",r({},f,{get:function(){return I},set:function(Te){I=Te,this.hasBeenReset=!0}})),Object.defineProperty(d,"vertical",r({},f,{get:function(){return B},set:function(Te){const Ut=n(Te);if(Ut===!1)throw new SyntaxError("An invalid or illegal string was specified.");B=Ut,this.hasBeenReset=!0}})),Object.defineProperty(d,"snapToLines",r({},f,{get:function(){return P},set:function(Te){P=!!Te,this.hasBeenReset=!0}})),Object.defineProperty(d,"line",r({},f,{get:function(){return ue},set:function(Te){if(typeof Te!="number"&&Te!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");ue=Te,this.hasBeenReset=!0}})),Object.defineProperty(d,"lineAlign",r({},f,{get:function(){return he},set:function(Te){const Ut=i(Te);if(!Ut)throw new SyntaxError("An invalid or illegal string was specified.");he=Ut,this.hasBeenReset=!0}})),Object.defineProperty(d,"position",r({},f,{get:function(){return je},set:function(Te){if(Te<0||Te>100)throw new Error("Position must be between 0 and 100.");je=Te,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",r({},f,{get:function(){return me},set:function(Te){const Ut=i(Te);if(!Ut)throw new SyntaxError("An invalid or illegal string was specified.");me=Ut,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",r({},f,{get:function(){return Me},set:function(Te){if(Te<0||Te>100)throw new Error("Size must be between 0 and 100.");Me=Te,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",r({},f,{get:function(){return it},set:function(Te){const Ut=i(Te);if(!Ut)throw new SyntaxError("An invalid or illegal string was specified.");it=Ut,this.hasBeenReset=!0}})),d.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class oc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Ao(a){function e(n,i,r,s){return(n|0)*3600+(i|0)*60+(r|0)+parseFloat(s||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class lc{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let i=0;i<n.length;++i)if(t===n[i]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function xo(a,e,t,n){const i=n?a.split(n):[a];for(const r in i){if(typeof i[r]!="string")continue;const s=i[r].split(t);if(s.length!==2)continue;const o=s[0],u=s[1];e(o,u)}}const ha=new fa(0,0,""),Ns=ha.align==="middle"?"middle":"center";function uc(a,e,t){const n=a;function i(){const o=Ao(a);if(o===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,u){const l=new lc;xo(o,function(v,p){let y;switch(v){case"region":for(let T=t.length-1;T>=0;T--)if(t[T].id===p){l.set(v,t[T].region);break}break;case"vertical":l.alt(v,p,["rl","lr"]);break;case"line":y=p.split(","),l.integer(v,y[0]),l.percent(v,y[0])&&l.set("snapToLines",!1),l.alt(v,y[0],["auto"]),y.length===2&&l.alt("lineAlign",y[1],["start",Ns,"end"]);break;case"position":y=p.split(","),l.percent(v,y[0]),y.length===2&&l.alt("positionAlign",y[1],["start",Ns,"end","line-left","line-right","auto"]);break;case"size":l.percent(v,p);break;case"align":l.alt(v,p,["start",Ns,"end","left","right"]);break}},/:/,/\s/),u.region=l.get("region",null),u.vertical=l.get("vertical","");let d=l.get("line","auto");d==="auto"&&ha.line===-1&&(d=-1),u.line=d,u.lineAlign=l.get("lineAlign","start"),u.snapToLines=l.get("snapToLines",!0),u.size=l.get("size",100),u.align=l.get("align",Ns);let f=l.get("position","auto");f==="auto"&&ha.position===50&&(f=u.align==="start"||u.align==="left"?0:u.align==="end"||u.align==="right"?100:50),u.position=f}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=i(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);a=a.slice(3),s(),e.endTime=i(),s(),r(a,e)}function Ro(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}class cc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new oc,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){let r=t.buffer,s=0;for(r=Ro(r);s<r.length&&r[s]!=="\r"&&r[s]!==`
|
|
`;)++s;const o=r.slice(0,s);return r[s]==="\r"&&++s,r[s]===`
|
|
`&&++s,t.buffer=r.slice(s),o}function i(r){xo(r,function(s,o){},/:/)}try{let r="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;r=n();const o=r.match(/^()?WEBVTT([ \t].*)?$/);if(!(o!=null&&o[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:r=n(),t.state){case"HEADER":/:/.test(r)?i(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;if(t.cue=new fa(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{uc(r,t.cue,t.regionList)}catch(o){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
`),t.cue.text+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch(r){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
|
|
|
|
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const dc=/\r\n|\n\r|\n|\r/g,ma=function(e,t,n=0){return e.slice(n,n+t.length)===t},fc=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!A(t)||!A(n)||!A(i)||!A(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*r,t};function ga(a,e,t){return bs(a.toString())+bs(e.toString())+bs(t)}const hc=function(e,t,n){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(s=r)!=null&&s.new;){var s;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=n};function mc(a,e,t,n,i,r,s){const o=new cc,u=Zt(new Uint8Array(a)).trim().replace(dc,`
|
|
`).split(`
|
|
`),l=[],d=e?Bl(e.baseTime,e.timescale):0;let f="00:00.000",v=0,p=0,y,T=!0;o.oncue=function(b){const I=t[n];let B=t.ccOffset;const P=(v-d)/9e4;if(I!=null&&I.new&&(p!==void 0?B=t.ccOffset=I.start:hc(t,n,P)),P){if(!e){y=new Error("Missing initPTS for VTT MPEGTS");return}B=P-t.presentationOffset}const ue=b.endTime-b.startTime,he=mr((b.startTime+B-p)*9e4,i*9e4)/9e4;b.startTime=Math.max(he,0),b.endTime=Math.max(he+ue,0);const je=b.text.trim();b.text=decodeURIComponent(encodeURIComponent(je)),b.id||(b.id=ga(b.startTime,b.endTime,je)),b.endTime>0&&l.push(b)},o.onparsingerror=function(b){y=b},o.onflush=function(){if(y){s(y);return}r(l)},u.forEach(b=>{if(T)if(ma(b,"X-TIMESTAMP-MAP=")){T=!1,b.slice(16).split(",").forEach(I=>{ma(I,"LOCAL:")?f=I.slice(6):ma(I,"MPEGTS:")&&(v=parseInt(I.slice(7)))});try{p=fc(f)/1e3}catch(I){y=I}return}else b===""&&(T=!1);o.parse(b+`
|
|
`)}),o.flush()}const va="stpp.ttml.im1t",Lo=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Io=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,gc={left:"start",center:"center",right:"end",start:"start",end:"end"};function Co(a,e,t,n){const i=D(new Uint8Array(a),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>Zt(o)),s=Fl(e.baseTime,1,e.timescale);try{r.forEach(o=>t(vc(o,s)))}catch(o){n(o)}}function vc(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(r).reduce((f,v)=>(f[v]=i.getAttribute(`ttp:${v}`)||r[v],f),{}),o=i.getAttribute("xml:space")!=="preserve",u=Do(pa(i,"styling","style")),l=Do(pa(i,"layout","region")),d=pa(i,"body","[begin]");return[].map.call(d,f=>{const v=wo(f,o);if(!v||!f.hasAttribute("begin"))return null;const p=Ea(f.getAttribute("begin"),s),y=Ea(f.getAttribute("dur"),s);let T=Ea(f.getAttribute("end"),s);if(p===null)throw _o(f);if(T===null){if(y===null)throw _o(f);T=p+y}const b=new fa(p-e,T-e,v);b.id=ga(b.startTime,b.endTime,b.text);const I=l[f.getAttribute("region")],B=u[f.getAttribute("style")],P=pc(I,B,u),{textAlign:ue}=P;if(ue){const he=gc[ue];he&&(b.lineAlign=he),b.align=ue}return M(b,P),b}).filter(f=>f!==null)}function pa(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Do(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function wo(a,e){return[].slice.call(a.childNodes).reduce((t,n,i)=>{var r;return n.nodeName==="br"&&i?t+`
|
|
`:(r=n.childNodes)!=null&&r.length?wo(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function pc(a,e,t){const n="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(i=t[s]),r.reduce((o,u)=>{const l=ya(e,n,u)||ya(a,n,u)||ya(i,n,u);return l&&(o[u]=l),o},{})}function ya(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function _o(a){return new Error(`Could not parse ttml timestamp ${a}`)}function Ea(a,e){if(!a)return null;let t=Ao(a);return t===null&&(Lo.test(a)?t=yc(a,e):Io.test(a)&&(t=Ec(a,e))),t}function yc(a,e){const t=Lo.exec(a),n=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+n/e.frameRate}function Ec(a,e){const t=Io.exec(a),n=Number(t[1]);switch(t[2]){case"h":return n*3600;case"m":return n*60;case"ms":return n*1e3;case"f":return n/e.frameRate;case"t":return n/e.tickRate}return n}class Fs{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class Sc{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Mo(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(m.FRAG_LOADING,this.onFragLoading,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this),e.on(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(m.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(m.FRAG_LOADING,this.onFragLoading,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this),e.off(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(m.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Fs(this,"textTrack1"),t=new Fs(this,"textTrack2"),n=new Fs(this,"textTrack3"),i=new Fs(this,"textTrack4");this.cea608Parser1=new To(1,e,t),this.cea608Parser2=new To(3,n,i)}addCues(e,t,n,i,r){let s=!1;for(let o=r.length;o--;){const u=r[o],l=bc(u[0],u[1],t,n);if(l>=0&&(u[0]=Math.min(u[0],t),u[1]=Math.max(u[1],n),s=!0,l/(n-t)>.5))return}if(s||r.push([t,n]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,n,i)}else{const o=this.Cues.newCue(null,t,n,i);this.hls.trigger(m.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){const{unparsedVttFrags:s}=this;n===ae.MAIN&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),s.length&&(this.unparsedVttFrags=[],s.forEach(o=>{this.onFragLoaded(m.FRAG_LOADED,o)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const r=n.textTracks[i];if(Oo(r,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:i}=this,{label:r,languageCode:s}=t[e],o=this.getExistingTrack(r,s);if(o)n[e]=o,as(n[e]),ho(n[e],i);else{const u=this.createTextTrack("captions",r,s);u&&(u[e]=!0,n[e]=u)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,i={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(m.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,n){const i=this.media;if(i)return i.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:i}=this;Object.keys(i).forEach(r=>{as(i[r]),delete i[r]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Mo(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let n=0;n<t.length;n++)as(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some(r=>r.textCodec===va);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if($a(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,o=s?Os(s.textTracks):null;if(this.tracks.forEach((u,l)=>{let d;if(o){let f=null;for(let v=0;v<o.length;v++)if(o[v]&&Oo(o[v],u)){f=o[v],o[v]=null;break}f&&(d=f)}if(d)as(d);else{const f=Po(u);d=this.createTextTrack(f,u.name,u.lang),d&&(d.mode="disabled")}d&&this.textTracks.push(d)}),o!=null&&o.length){const u=o.filter(l=>l!==null).map(l=>l.label);u.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${u.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(m.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const i=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!i)return;const r=`textTrack${i[1]}`,s=this.captionsProperties[r];s&&(s.label=n.name,n.lang&&(s.languageCode=n.lang),s.media=n)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===ae.MAIN){var n,i;const{cea608Parser1:r,cea608Parser2:s,lastSn:o}=this,{cc:u,sn:l}=t.frag,d=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;r&&s&&(l!==o+1||l===o&&d!==this.lastPartIndex+1||u!==this.lastCc)&&(r.reset(),s.reset()),this.lastCc=u,this.lastSn=l,this.lastPartIndex=d}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===ae.SUBTITLE)if(i.byteLength){const r=n.decryptdata,s="stats"in t;if(r==null||!r.encrypted||s){const o=this.tracks[n.level],u=this.vttCCs;u[n.cc]||(u[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),o&&o.textCodec===va?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Co(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{n.logger.log(`Failed to parse IMSC1: ${i}`),n.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:r,unparsedVttFrags:s}=this,o=r.length-1;if(!r[n.cc]&&o===-1){s.push(e);return}const u=this.hls,l=(t=n.initSegment)!=null&&t.data?ft(n.initSegment.data,new Uint8Array(i)).buffer:i;mc(l,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,d=>{this._appendCues(d,n.level),u.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},d=>{const f=d.message==="Missing initPTS for VTT MPEGTS";f?s.push(e):this._fallbackToIMSC1(n,i),u.logger.log(`Failed to parse VTT cue: ${d}`),!(f&&o>n.cc)&&u.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:d})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Co(t,this.initPTS[e.cc],()=>{n.textCodec=va,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(r=>mo(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;n.trigger(m.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===ae.SUBTITLE&&this.onFragLoaded(m.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:i}=t;if(!(n.type===ae.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let r=0;r<i.length;r++){const s=i[r].bytes;if(s){this.cea608Parser1||this.initCea608Parsers();const o=this.extractCea608Data(s);this.cea608Parser1.addData(i[r].pts,o[0]),this.cea608Parser2.addData(i[r].pts,o[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:i,type:r}){const{media:s}=this;if(!(!s||s.currentTime<n)){if(!r||r==="video"){const{captionsTracks:o}=this;Object.keys(o).forEach(u=>la(o[u],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(u=>la(o[u],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let r=0;r<n;r++){const s=e[i++],o=127&e[i++],u=127&e[i++];if(o===0&&u===0)continue;if((4&s)!==0){const d=3&s;(d===0||d===1)&&(t[d].push(o),t[d].push(u))}}return t}}function Po(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Oo(a,e){return!!a&&a.kind===Po(e)&&na(e,a)}function bc(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function Mo(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const Tc=/\s/,Ac={newCue(a,e,t,n){const i=[];let r,s,o,u,l;const d=self.VTTCue||self.TextTrackCue;for(let v=0;v<n.rows.length;v++)if(r=n.rows[v],o=!0,u=0,l="",!r.isEmpty()){var f;for(let T=0;T<r.chars.length;T++)Tc.test(r.chars[T].uchar)&&o?u++:(l+=r.chars[T].uchar,o=!1);r.cueStartTime=e,e===t&&(t+=1e-4),u>=16?u--:u++;const p=Ro(l.trim()),y=ga(e,t,p);a!=null&&(f=a.cues)!=null&&f.getCueById(y)||(s=new d(e,t,p),s.id=y,s.line=v+1,s.align="left",s.position=10+Math.min(80,Math.floor(u*8/32)*10),i.push(s))}return a&&i.length&&(i.sort((v,p)=>v.line==="auto"||p.line==="auto"?0:v.line>8&&p.line>8?p.line-v.line:v.line-p.line),i.forEach(v=>mo(a,v))),i}};function xc(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const Rc=/(\d+)-(\d+)\/(\d+)/;class ko{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||Dc,this.controller=new self.AbortController,this.stats=new C}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=Lc(e,this.controller.signal),s=e.responseType==="arraybuffer",o=s?"byteLength":"length",{maxTimeToFirstByteMs:u,maxLoadTimeMs:l}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=u&&A(u)?u:l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},t.timeout),(ys(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(f=>{var v;this.response=this.loader=f;const p=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},l-(p-i.loading.start)),!f.ok){const{status:T,statusText:b}=f;throw new wc(b||"fetch, bad network response",T,f)}i.loading.first=p,i.total=Cc(f.headers)||i.total;const y=(v=this.callbacks)==null?void 0:v.onProgress;return y&&A(t.highWaterMark)?this.loadProgressively(f,i,e,t.highWaterMark,y):s?f.arrayBuffer():e.responseType==="json"?f.json():f.text()}).then(f=>{var v,p;const y=this.response;if(!y)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const T=f[o];T&&(i.loaded=i.total=T);const b={url:y.url,data:f,code:y.status},I=(v=this.callbacks)==null?void 0:v.onProgress;I&&!A(t.highWaterMark)&&I(i,e,f,y),(p=this.callbacks)==null||p.onSuccess(b,i,e,y)}).catch(f=>{var v;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const p=f&&f.code||0,y=f?f.message:null;(v=this.callbacks)==null||v.onError({code:p,text:y},e,f?f.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,i=0,r){const s=new $r,o=e.body.getReader(),u=()=>o.read().then(l=>{if(l.done)return s.dataLength&&r(t,n,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const d=l.value,f=d.length;return t.loaded+=f,f<i||s.dataLength?(s.push(d),s.dataLength>=i&&r(t,n,s.flush().buffer,e)):r(t,n,d.buffer,e),u()}).catch(()=>Promise.reject());return u()}}function Lc(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(M({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function Ic(a){const e=Rc.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function Cc(a){const e=a.get("Content-Range");if(e){const n=Ic(e);if(A(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function Dc(a,e){return new self.Request(a.url,e)}class wc extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const _c=/^age:\s*[\d.]+\s*$/im;class No{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new C,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return r(n,t.url)}).catch(s=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),r(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(s=>{var o;(o=this.callbacks)==null||o.onError({code:n.status,text:s.message},t,n,i)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:s}=n.loadPolicy;if(i)for(const o in i)e.setRequestHeader(o,i[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=r&&A(r)?r:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!n.aborted&&i>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const l=t.status,d=t.responseType==="text"?t.responseText:null;if(l>=200&&l<300){const y=d!=null?d:t.response;if(y!=null){var s,o;n.loading.end=Math.max(self.performance.now(),n.loading.first);const T=t.responseType==="arraybuffer"?y.byteLength:y.length;n.loaded=n.total=T,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const b=(s=this.callbacks)==null?void 0:s.onProgress;b&&b(n,e,y,t);const I={url:t.responseURL,data:y,code:l};(o=this.callbacks)==null||o.onSuccess(I,n,e,t);return}}const f=r.loadPolicy.errorRetry,v=n.retry,p={url:e.url,data:void 0,code:l};if(en(f,v,!1,p))this.retry(f);else{var u;fe.error(`${l} while loading ${e.url}`),(u=this.callbacks)==null||u.onError({code:l,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(en(e,t,!0))this.retry(e);else{var n;fe.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=kt(e,n.retry),n.retry++,fe.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&_c.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const Pc={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Oc=de(de({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:No,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:At,bufferController:$l,capLevelController:ra,errorController:si,fpsController:Fu,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:In,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,certLoadPolicy:{default:Pc},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Mc()),{},{subtitleStreamController:Yu,subtitleTrackController:Gu,timelineController:Sc,audioStreamController:Xl,audioTrackController:ql,emeController:ss,cmcdController:Mu,contentSteeringController:Nu,interstitialsController:ju});function Mc(){return{cueHandler:Ac,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function kc(a,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const n=Sa(a),i=["manifest","level","frag"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,u=e[o]===void 0,l=[];r.forEach(d=>{const f=`${s}Loading${d}`,v=e[f];if(v!==void 0&&u){l.push(f);const p=n[o].default;switch(e[o]={default:p},d){case"TimeOut":p.maxLoadTimeMs=v,p.maxTimeToFirstByteMs=v;break;case"MaxRetry":p.errorRetry.maxNumRetry=v,p.timeoutRetry.maxNumRetry=v;break;case"RetryDelay":p.errorRetry.retryDelayMs=v,p.timeoutRetry.retryDelayMs=v;break;case"MaxRetryTimeout":p.errorRetry.maxRetryDelayMs=v,p.timeoutRetry.maxRetryDelayMs=v;break}}}),l.length&&t.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${o}": ${qe(e[o])}`)}),de(de({},n),e)}function Sa(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(Sa):Object.keys(a).reduce((e,t)=>(e[t]=Sa(a[t]),e),{}):a}function Nc(a,e){const t=a.loader;t!==ko&&t!==No?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):xc()&&(a.loader=ko,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Bs=2,Fc=.1,Bc=.05,Uc=100;class Gc extends _i{constructor(e,t){super("gap-controller",e.logger),this.hls=null,this.fragmentTracker=null,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var n;(n=this.media)!=null&&n.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var n;this.ended=((n=this.media)==null?void 0:n.currentTime)||1,this.hls.trigger(m.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(Uc),this.mediaSource=t.mediaSource;const n=this.media=t.media;Dr(n,"playing",this.onMediaPlaying),Dr(n,"waiting",this.onMediaWaiting),Dr(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(Ar(n,"playing",this.onMediaPlaying),Ar(n,"waiting",this.onMediaWaiting),Ar(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var n,i;const r=(n=this.hls)==null?void 0:n.config;if(!r)return;const{media:s,stalled:o}=this;if(!s)return;const{seeking:u}=s,l=this.seeking&&!u,d=!this.seeking&&u,f=s.paused&&!u||s.ended||s.playbackRate===0;if(this.seeking=u,e!==t){t&&(this.ended=0),this.moved=!0,u||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!f&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(d||l){l&&this.stallResolved(e);return}if(f){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&s.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(m.MEDIA_ENDED,{stalled:!1}));return}if(!vn.getBuffered(s).length){this.nudgeRetry=0;return}const v=vn.bufferInfo(s,e,0),p=v.nextStart||0,y=this.fragmentTracker;if(u&&y&&this.hls){const je=Fo(this.hls.inFlightFragments,e),me=v.len>Bs,Me=!p||je||p-e>Bs&&!y.getPartialFragment(e);if(me||Me)return;this.moved=!1}const T=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&y){if(!(v.len>0)&&!p)return;const me=Math.max(p,v.start||0)-e,it=!!(T!=null&&T.live)?T.targetduration*2:Bs,Te=y.getPartialFragment(e);if(me>0&&(me<=it||Te)){s.paused||this._trySkipBufferHole(Te);return}}const b=r.detectStallWithCurrentTimeMs,I=self.performance.now(),B=this.waiting;if(o===null){B>0&&I-B<b?this.stalled=B:this.stalled=I;return}const P=I-o;if(!u&&(P>=b||B)&&this.hls){var ue;if(((ue=this.mediaSource)==null?void 0:ue.readyState)==="ended"&&!(T!=null&&T.live)&&Math.abs(e-((T==null?void 0:T.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(m.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(v),!this.media||!this.hls)return}const he=vn.bufferInfo(s,e,r.maxBufferHole);this._tryFixBufferStall(he,P)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(m.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const i=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&i&&i.length>1&&e>i.end(0)){const r=vn.bufferedInfo(vn.timeRangesToArray(this.buffered.audio),e,0);if(r.len>1&&t>=r.start){const s=vn.timeRangesToArray(i),o=vn.bufferedInfo(s,t,0).bufferedIndex;if(o>-1&&o<s.length-1){const u=vn.bufferedInfo(s,e,0).bufferedIndex,l=s[o].end,d=s[o+1].start;if((u===-1||u>o)&&d-l<1&&e-l<2){const f=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${l} -> ${d} buffered index: ${u}`);this.warn(f.message),this.media.currentTime+=1e-6;const v=this.fragmentTracker.getPartialFragment(e)||void 0,p=vn.bufferInfo(this.media,e,0);this.hls.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:f,reason:f.message,frag:v,buffer:p.len,bufferInfo:p})}}}}}_tryFixBufferStall(e,t){var n,i;const{fragmentTracker:r,media:s}=this,o=(n=this.hls)==null?void 0:n.config;if(!s||!r||!o)return;const u=s.currentTime,l=(i=this.hls)==null?void 0:i.latestLevelDetails,d=r.getPartialFragment(u);if((d||l!=null&&l.live&&u<l.fragmentStart)&&(this._trySkipBufferHole(d)||!this.media))return;const f=e.buffered;(f&&f.length>1&&e.len>o.maxBufferHole||e.nextStart&&e.nextStart-u<o.maxBufferHole)&&(t>o.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}_reportStall(e){const{hls:t,media:n,stallReported:i,stalled:r}=this;if(!i&&r!==null&&n&&t){this.stallReported=!0;const s=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${qe(e)})`);this.warn(s.message),t.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len,bufferInfo:e,stalled:{start:r}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:i}=this,r=(t=this.hls)==null?void 0:t.config;if(!i||!n||!r)return 0;const s=i.currentTime,o=vn.bufferInfo(i,s,0),u=s<o.start?o.start:o.nextStart;if(u&&this.hls){const d=o.len<=r.maxBufferHole,f=o.len>0&&o.len<1&&i.readyState<3,v=u-s;if(v>0&&(d||f)){if(v>r.maxBufferHole){let y=!1;if(s===0){const T=n.getAppendedFrag(0,ae.MAIN);T&&u<T.end&&(y=!0)}if(!y){const T=e||n.getAppendedFrag(s,ae.MAIN);if(T){var l;if(!((l=this.hls.loadLevelObj)!=null&&l.details)||Fo(this.hls.inFlightFragments,u))return 0;let I=!1,B=T.end;for(;B<u;){const P=n.getPartialFragment(B);if(P)B+=P.duration;else{I=!0;break}}if(I)return 0}}}const p=Math.max(u+Bc,s+Fc);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${p}`),this.moved=!0,i.currentTime=p,!(e!=null&&e.gap)){const y=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${p}`);this.hls.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:y,reason:y.message,frag:e||void 0,buffer:o.len,bufferInfo:o})}return p}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:i}=this,r=t==null?void 0:t.config;if(!n||!r)return 0;const s=n.currentTime;if(this.nudgeRetry++,i<r.nudgeMaxRetry){const o=s+(i+1)*r.nudgeOffset,u=new Error(`Nudging 'currentTime' from ${s} to ${o}`);this.warn(u.message),n.currentTime=o,t.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.BUFFER_NUDGE_ON_STALL,error:u,fatal:!1,buffer:e.len,bufferInfo:e})}else{const o=new Error(`Playhead still not moving while enough data buffered @${s} after ${r.nudgeMaxRetry} nudges`);this.error(o.message),t.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function Fo(a,e){const t=Bo(a.main);if(t&&t.start<=e)return t;const n=Bo(a.audio);return n&&n.start<=e?n:null}function Bo(a){if(!a)return null;switch(a.state){case tt.IDLE:case tt.STOPPED:case tt.ENDED:case tt.ERROR:return null}return a.frag}const Vc=.25;function ba(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Uo(a,e,t,n,i){let r=new a(e,t,"");try{r.value=n,i&&(r.type=i)}catch(s){r=new a(e,t,qe(i?de({type:i},n):n))}return r}const Us=(()=>{const a=ba();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function zc(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Zc{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(m.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(m.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(m.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(e,t){var n;this.media=t.media,((n=t.overrides)==null?void 0:n.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){const e=this.hls.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&as(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if(n.kind==="metadata"&&n.label==="id3")return ho(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:i}}}=this;if(!n&&!i)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=ba();if(s)for(let o=0;o<r.length;o++){const u=r[o].type;if(u===cr.emsg&&!n||!i)continue;const l=Pa(r[o].data);if(l){const d=r[o].pts;let f=d+r[o].duration;f>Us&&(f=Us),f-d<=0&&(f=d+Vc);for(let p=0;p<l.length;p++){const y=l[p];if(!Oa(y)){this.updateId3CueEnds(d,u);const T=Uo(s,d,f,y,u);T&&this.id3Track.addCue(T)}}}}}updateId3CueEnds(e,t){var n;const i=(n=this.id3Track)==null?void 0:n.cues;if(i)for(let r=i.length;r--;){const s=i[r];s.type===t&&s.startTime<e&&s.endTime===Us&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:r,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:u}}=s;if(r&&(o||u)){let l;i==="audio"?l=d=>d.type===cr.audioId3&&u:i==="video"?l=d=>d.type===cr.emsg&&o:l=d=>d.type===cr.audioId3&&u||d.type===cr.emsg&&o,la(r,t,n,l)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{id3Track:n}=this,{dateRanges:i}=e,r=Object.keys(i);let s=this.dateRangeCuesAppended;if(n&&t){var o;if((o=n.cues)!=null&&o.length){const d=Object.keys(s).filter(f=>!r.includes(f));for(let f=d.length;f--;){const v=d[f],p=s[v].cues;delete s[v],Object.keys(p).forEach(y=>{try{const T=p[y];T.removeEventListener("enter",this.onEventCueEnter),n.removeCue(T)}catch(T){}})}}else s=this.dateRangeCuesAppended={}}const u=e.fragments[e.fragments.length-1];if(r.length===0||!A(u==null?void 0:u.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=ba();for(let d=0;d<r.length;d++){const f=r[d],v=i[f],p=v.startTime,y=s[f],T=(y==null?void 0:y.cues)||{};let b=(y==null?void 0:y.durationKnown)||!1,I=Us;const{duration:B,endDate:P}=v;if(P&&B!==null)I=p+B,b=!0;else if(v.endOnNext&&!b){const he=r.reduce((je,me)=>{if(me!==v.id){const Me=i[me];if(Me.class===v.class&&Me.startDate>v.startDate&&(!je||v.startDate<je.startDate))return Me}return je},null);he&&(I=he.startTime,b=!0)}const ue=Object.keys(v.attr);for(let he=0;he<ue.length;he++){const je=ue[he];if(!fi(je))continue;const me=T[je];if(me)b&&!y.durationKnown?me.endTime=I:Math.abs(me.startTime-p)>.01&&(me.startTime=p,me.endTime=I);else if(l){let Me=v.attr[je];Oi(je)&&(Me=zc(Me));const Te=Uo(l,p,I,{key:je,data:Me},cr.dateRange);Te&&(Te.id=f,this.id3Track.addCue(Te),T[je]=Te,this.hls.config.interstitialsController&&(je==="X-ASSET-LIST"||je==="X-ASSET-URL")&&Te.addEventListener("enter",this.onEventCueEnter))}}s[f]={cues:T,dateRange:v,durationKnown:b}}}}class Kc{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,n=this.levelDetails;if(!t||!n)return;this.currentTime=t.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:s}=this.config;if(!r||s===1||!n.live)return;const o=this.targetLatency;if(o===null)return;const u=i-o,l=Math.min(this.maxLatency,o+n.targetduration);if(u<l&&u>.05&&this.forwardBufferLength>1){const f=Math.min(2,Math.max(1,s)),v=Math.round(2/(1+Math.exp(-.75*u-this.edgeStalled))*20)/20,p=Math.min(f,Math.max(1,v));this.changeMediaPlaybackRate(t,p)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:s,lowLatencyMode:o}=this.config,u=this.hls.userConfig;let l=o&&n||t;(this._targetLatencyUpdated||u.liveSyncDuration||u.liveSyncDurationCount||l===0)&&(l=r!==void 0?r:s*i);const d=i;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,d)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const n=this.levelDetails;if(n===null)return null;const i=n.edge,r=e-t-this.edgeStalled,s=i-n.totalduration,o=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,r),o)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(m.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(m.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var n;t.details===x.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,i;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(i=this.targetLatency)==null?void 0:i.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class Hc extends ta{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this),e.on(m.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this),e.off(m.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,i=[],r={},s={};let o=!1,u=!1,l=!1;t.levels.forEach(d=>{var f;const v=d.attrs;let{audioCodec:p,videoCodec:y}=d;p&&(d.audioCodec=p=dn(p,n)||void 0),((f=y)==null?void 0:f.indexOf("avc1"))===0&&(y=d.videoCodec=zn(y));const{width:T,height:b,unknownCodecs:I}=d;let B=I?I.length:0;if(I)for(let Ut=B;Ut--;){const an=I[Ut];this.isAudioSupported(an)?(d.audioCodec=p=p?`${p},${an}`:an,B--,zt.audio[p.substring(0,4)]=2):this.isVideoSupported(an)&&(d.videoCodec=y=y?`${y},${an}`:an,B--,zt.video[y.substring(0,4)]=2)}if(o||(o=!!(T&&b)),u||(u=!!y),l||(l=!!p),B||p&&!this.isAudioSupported(p)||y&&!this.isVideoSupported(y)){this.log(`Some or all CODECS not supported "${v.CODECS}"`);return}const{CODECS:P,"FRAME-RATE":ue,"HDCP-LEVEL":he,"PATHWAY-ID":je,RESOLUTION:me,"VIDEO-RANGE":Me}=v,Te=`${`${je||"."}-`}${d.bitrate}-${me}-${ue}-${P}-${Me}-${he}`;if(r[Te])if(r[Te].uri!==d.url&&!d.attrs["PATHWAY-ID"]){const Ut=s[Te]+=1;d.attrs["PATHWAY-ID"]=new Array(Ut+1).join(".");const an=this.createLevel(d);r[Te]=an,i.push(an)}else r[Te].addGroupId("audio",v.AUDIO),r[Te].addGroupId("text",v.SUBTITLES);else{const Ut=this.createLevel(d);r[Te]=Ut,s[Te]=1,i.push(Ut)}}),this.filterAndSortMediaOptions(i,t,o,u,l)}createLevel(e){const t=new U(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const i=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(i.message),t.supportedResult=E(i,[])}return t}isAudioSupported(e){return En(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return En(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,i,r){let s=[],o=[],u=e;if((n||i)&&r&&(u=u.filter(({videoCodec:b,videoRange:I,width:B,height:P})=>(!!b||!!(B&&P))&&_(I))),u.length===0){Promise.resolve().then(()=>{if(this.hls){let b="no level with compatible codecs found in manifest",I=b;t.levels.length&&(I=`one or more CODECS in variant not supported: ${qe(t.levels.map(P=>P.attrs.CODECS).filter((P,ue,he)=>he.indexOf(P)===ue))}`,this.warn(I),b+=` (${I})`);const B=new Error(b);this.hls.trigger(m.ERROR,{type:Z.MEDIA_ERROR,details:x.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:B,reason:I})}});return}t.audioTracks&&(s=t.audioTracks.filter(b=>!b.audioCodec||this.isAudioSupported(b.audioCodec)),Go(s)),t.subtitles&&(o=t.subtitles,Go(o));const l=u.slice(0);u.sort((b,I)=>{if(b.attrs["HDCP-LEVEL"]!==I.attrs["HDCP-LEVEL"])return(b.attrs["HDCP-LEVEL"]||"")>(I.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&b.height!==I.height)return b.height-I.height;if(b.frameRate!==I.frameRate)return b.frameRate-I.frameRate;if(b.videoRange!==I.videoRange)return ln.indexOf(b.videoRange)-ln.indexOf(I.videoRange);if(b.videoCodec!==I.videoCodec){const B=Yt(b.videoCodec),P=Yt(I.videoCodec);if(B!==P)return P-B}if(b.uri===I.uri&&b.codecSet!==I.codecSet){const B=gt(b.codecSet),P=gt(I.codecSet);if(B!==P)return P-B}return b.averageBitrate!==I.averageBitrate?b.averageBitrate-I.averageBitrate:0});let d=l[0];if(this.steering&&(u=this.steering.filterParsedLevels(u),u.length!==l.length)){for(let b=0;b<l.length;b++)if(l[b].pathwayId===u[0].pathwayId){d=l[b];break}}this._levels=u;for(let b=0;b<u.length;b++)if(u[b]===d){var f;this._firstLevel=b;const I=d.bitrate,B=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${u.length} level(s) found, first bitrate: ${I}`),((f=this.hls.userConfig)==null?void 0:f.abrEwmaDefaultEstimate)===void 0){const P=Math.min(I,this.hls.config.abrEwmaDefaultEstimateMax);P>B&&B===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=P)}break}const v=r&&!i,p=this.hls.config,y=!!(p.audioStreamController&&p.audioTrackController),T={levels:u,audioTracks:s,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:y&&!v&&s.some(b=>!!b.url)};this.hls.trigger(m.MANIFEST_PARSED,T)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const d=new Error("invalid level idx"),f=e<0;if(this.hls.trigger(m.ERROR,{type:Z.OTHER_ERROR,details:x.LEVEL_SWITCH_ERROR,level:e,fatal:f,error:d,reason:d.message}),f)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,s=t[e],o=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&i&&r===o)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${o?" with Pathway "+o:""} from level ${n}${r?" with Pathway "+r:""}`);const u={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(m.LEVEL_SWITCHING,u);const l=s.details;if(!l||l.live){const d=this.switchParams(s.uri,i==null?void 0:i.details,l);this.loadPlaylist(d)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),n=e.filter(i=>t.indexOf(i)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){t.fatal||!t.context||t.context.type===Xe.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===ae.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(r=>!!n[r]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var n;const{level:i,details:r}=t,s=t.levelInfo;if(!s){var o;this.warn(`Invalid level index ${i}`),(o=t.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}if(s===this.currentLevel||t.withoutMultiVariant){s.fragmentError===0&&(s.loadError=0);let u=s.details;u===t.details&&u.advanced&&(u=void 0),this.playlistLoaded(i,t,u)}else(n=t.deliveryDirectives)!=null&&n.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),i=this.currentLevelIndex,r=e.attrs["PATHWAY-ID"],s=e.details,o=s==null?void 0:s.age;this.log(`Loading level index ${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${r?" Pathway "+r:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(m.LEVEL_LOADING,{url:n,level:i,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const n=this._levels.filter((r,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(r),r===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,r.details&&r.details.fragments.forEach(o=>o.level=-1)),!1));hr(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const i=n.length-1;this._firstLevel=Math.min(this._firstLevel,i),this._startLevel&&(this._startLevel=Math.min(this._startLevel,i)),this.hls.trigger(m.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(m.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function Go(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function Vo(){return self.SourceBuffer||self.WebKitSourceBuffer}function zo(){if(!Be())return!1;const e=Vo();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Wc(){if(!zo())return!1;const a=Be();return typeof(a==null?void 0:a.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>a.isTypeSupported(at(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(at(e,"audio"))))}function jc(){var a;const e=Vo();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Yc=100;class Xc extends qi{constructor(e,t,n){super(e,t,n,"stream-controller",ae.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const i=this.media,r=i?i.currentTime:null;if(r===null||!A(r)||(this.log(`Media seeked to ${r.toFixed(3)}`),!this.getBufferedFrag(r)))return;const s=this.getFwdBufferInfoAtPos(i,r,ae.MAIN,0);if(s===null||s.len===0){this.warn(`Main forward buffer length at ${r} on "seeked" event ${s?s.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(m.BUFFER_CREATED,this.onBufferCreated,this),e.on(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(m.BUFFER_CREATED,this.onBufferCreated,this),e.off(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:i}=this;if(this.stopLoad(),this.setInterval(Yc),this.level=-1,!this.startFragRequested){let r=i.startLevel;r===-1&&(i.config.testBandwidth&&this.levels.length>1?(r=0,this.bitrateTest=!0):r=i.firstAutoLevel),i.nextLoadLevel=r,this.level=i.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=tt.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=tt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case tt.WAITING_LEVEL:{const{levels:t,level:n}=this,i=t==null?void 0:t[n],r=i==null?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i&&!this.waitForLive(i))){if(this.waitForCdnTuneIn(r))break;this.state=tt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=tt.IDLE;break}break}case tt.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,level:r}=this,s=i==null?void 0:i[r];this.resetStartWhenNotLoaded(s||null),this.state=tt.IDLE}}break}this.state===tt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(t===null||!i&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[r]))return;const s=n[r],o=this.getMainFwdBufferInfo();if(o===null)return;const u=this.getLevelDetails();if(u&&this._streamEnded(o,u)){const T={};this.altAudio===2&&(T.type="video"),this.hls.trigger(m.BUFFER_EOS,T),this.state=tt.ENDED;return}if(!this.buffering)return;e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const l=s.details;if(!l||this.state===tt.WAITING_LEVEL||this.waitForLive(s)){this.level=r,this.state=tt.WAITING_LEVEL,this.startFragRequested=!1;return}const d=o.len,f=this.getMaxBufferLength(s.maxBitrate);if(d>=f)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const v=this.backtrackFragment?this.backtrackFragment.start:o.end;let p=this.getNextFragment(v,l);if(this.couldBacktrack&&!this.fragPrevious&&p&&Le(p)&&this.fragmentTracker.getState(p)!==Bn.OK){var y;const b=((y=this.backtrackFragment)!=null?y:p).sn-l.startSN,I=l.fragments[b-1];I&&p.cc===I.cc&&(p=I,this.fragmentTracker.removeFragment(I))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,v)){if(!p.gap){const b=this.audioOnly&&!this.altAudio?$.AUDIO:$.VIDEO,I=(b===$.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;I&&this.afterBufferFlushed(I,b,ae.MAIN)}p=this.getNextFragmentLoopLoading(p,l,o,ae.MAIN,f)}p&&(p.initSegment&&!p.initSegment.data&&!this.bitrateTest&&(p=p.initSegment),this.loadFragment(p,s,v))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);i===Bn.NOT_LOADED||i===Bn.PARTIAL?Le(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,ae.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let n;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const o=this.getMainFwdBufferInfo();if(!o||o.len<r.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,u=e[o],l=this.fragLastKbps;l&&this.fragCurrent?n=this.fragCurrent.duration*u.maxBitrate/(1e3*l)+1:n=0}else n=0;const s=this.getBufferedFrag(t.currentTime+n);if(s){const o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();const u=o.maxStartPTS?o.maxStartPTS:o.start,l=o.duration,d=Math.max(s.end,u+Math.min(Math.max(l-this.config.maxFragLookUpTolerance,l*(this.couldBacktrack?.5:.125)),l*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(d,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case tt.KEY_LOADING:case tt.FRAG_LOADING:case tt.FRAG_LOADING_WAITING_RETRY:case tt.PARSING:case tt.PARSED:this.state=tt.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;Dr(n,"playing",this.onMediaPlaying),Dr(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(Ar(n,"playing",this.onMediaPlaying),Ar(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(m.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,i=!1;t.levels.forEach(r=>{const s=r.audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,i=i||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&i&&!jc(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==tt.IDLE)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=tt.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i,startFragRequested:r}=this,s=t.level,o=t.details,u=o.totalduration;if(!i){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${u}`);const l=t.levelInfo,d=this.fragCurrent;d&&(this.state===tt.FRAG_LOADING||this.state===tt.FRAG_LOADING_WAITING_RETRY)&&d.level!==t.level&&d.loader&&this.abortCurrentFrag();let f=0;if(o.live||(n=l.details)!=null&&n.live){var v;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;f=this.alignPlaylists(o,l.details,(v=this.levelLastLoaded)==null?void 0:v.details)}if(l.details=o,this.levelLastLoaded=l,r||this.setStartPosition(o,f),this.hls.trigger(m.LEVEL_UPDATED,{details:o,level:s}),this.state===tt.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=tt.IDLE}r&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,r=this.getLoadPosition(),s=e.fragmentStart,o=e.edge,u=r>=s-t.maxFragLookUpTolerance&&r<=o;if(i!==null&&n.duration>i&&(r<i||!u)){const l=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!u&&n.readyState<4||r<o-l)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),n.readyState&&(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${i.toFixed(3)}`),n.currentTime=i))}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const o=s[n.level];if(!o){this.warn(`Level ${n.level} not found on progress`);return}const u=o.details;if(!u){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const l=o.videoCodec,d=u.PTSKnown||!u.live,f=(t=n.initSegment)==null?void 0:t.data,v=this._getAudioCodec(o),p=this.transmuxer=this.transmuxer||new Qa(this.hls,ae.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),y=i?i.index:-1,T=y!==-1,b=new wi(n.level,n.sn,n.stats.chunkCount,r.byteLength,y,T),I=this.initPTS[n.cc];p.push(r,f,v,l,n,i,u.totalduration,d,b,I)}onAudioTrackSwitching(e,t){const n=this.hls,i=this.altAudio===2;if(Ct(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const s=this.fragCurrent;s&&(this.log("Switching to main audio track, cancel main fragment load"),s.abortRequests(),this.fragmentTracker.removeFragment(s)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(i){this.fragmentTracker.removeAllFragments(),n.once(m.BUFFER_FLUSHED,()=>{var s;(s=this.hls)==null||s.trigger(m.AUDIO_TRACK_SWITCHED,t)}),n.trigger(m.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(m.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=Ct(t.url,this.hls);if(n){const i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,r,s=!1;for(const o in n){const u=n[o];if(u.id==="main"){if(r=o,i=u,o==="video"){const l=n[o];l&&(this.videoBuffer=l.buffer)}}else s=!0}s&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:i}=t,r=n.type===ae.MAIN;if(r){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===tt.PARSED&&(this.state=tt.IDLE);return}const o=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),Le(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}const s=this.media;s&&(!this._hasEnoughToStart&&vn.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),r&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal){this.state=tt.ERROR;return}switch(t.details){case x.FRAG_GAP:case x.FRAG_PARSING_ERROR:case x.FRAG_DECRYPT_ERROR:case x.FRAG_LOAD_ERROR:case x.FRAG_LOAD_TIMEOUT:case x.KEY_LOAD_ERROR:case x.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ae.MAIN,t);break;case x.LEVEL_LOAD_ERROR:case x.LEVEL_LOAD_TIMEOUT:case x.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===tt.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===Xe.LEVEL&&(this.state=tt.IDLE);break;case x.BUFFER_ADD_CODEC_ERROR:case x.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.resetLoadingState();break;case x.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case x.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=tt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==$.AUDIO||!this.altAudio){const n=(t===$.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,ae.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const i=this.timelineOffset;i&&n&&(n+=i);const r=this.getLevelDetails(),s=vn.getBuffered(e),o=s.length?s.start(0):0,u=o-n,l=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);u>0&&(u<l||this.loadingParts&&u<2*((r==null?void 0:r.partTarget)||0))&&(this.log(`adjusting start position by ${u} to match buffer start`),n+=u,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${o}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:i}=this,r=n==null?void 0:n.frag;if(!r||this.fragContextChanged(r))return;t.fragmentError=0,this.state=tt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=r.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(m.FRAG_LOADED,n),r.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n=this.playlistType,{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:u,part:l,level:d}=o,{video:f,text:v,id3:p,initSegment:y}=r,{details:T}=d,b=this.altAudio?void 0:r.audio;if(this.fragContextChanged(u)){this.fragmentTracker.removeFragment(u);return}if(this.state=tt.PARSING,y){if(y!=null&&y.tracks){const P=u.initSegment||u;this._bufferInitSegment(d,y.tracks,P,s),i.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:P,id:n,tracks:y.tracks})}const I=y.initPTS,B=y.timescale;A(I)&&(this.initPTS[u.cc]={baseTime:I,timescale:B},i.trigger(m.INIT_PTS_FOUND,{frag:u,id:n,initPTS:I,timescale:B}))}if(f&&T){b&&f.type==="audiovideo"&&this.logMuxedErr(u);const I=T.fragments[u.sn-1-T.startSN],B=u.sn===T.startSN,P=!I||u.cc>I.cc;if(r.independent!==!1){const{startPTS:ue,endPTS:he,startDTS:je,endDTS:me}=f;if(l)l.elementaryStreams[f.type]={startPTS:ue,endPTS:he,startDTS:je,endDTS:me};else if(f.firstKeyFrame&&f.independent&&s.id===1&&!P&&(this.couldBacktrack=!0),f.dropped&&f.independent){const Me=this.getMainFwdBufferInfo(),it=(Me?Me.end:this.getLoadPosition())+this.config.maxBufferHole,Te=f.firstKeyFramePTS?f.firstKeyFramePTS:ue;if(!B&&it<Te-this.config.maxBufferHole&&!P){this.backtrack(u);return}else P&&(u.gap=!0);u.setElementaryStreamInfo(f.type,u.start,he,u.start,me,!0)}else B&&ue-(T.appliedTimelineOffset||0)>Bs&&(u.gap=!0);u.setElementaryStreamInfo(f.type,ue,he,je,me),this.backtrackFragment&&(this.backtrackFragment=u),this.bufferFragmentData(f,u,l,s,B||P)}else if(B||P)u.gap=!0;else{this.backtrack(u);return}}if(b){const{startPTS:I,endPTS:B,startDTS:P,endDTS:ue}=b;l&&(l.elementaryStreams[$.AUDIO]={startPTS:I,endPTS:B,startDTS:P,endDTS:ue}),u.setElementaryStreamInfo($.AUDIO,I,B,P,ue),this.bufferFragmentData(b,u,l,s)}if(T&&p!=null&&(t=p.samples)!=null&&t.length){const I={id:n,frag:u,details:T,samples:p.samples};i.trigger(m.FRAG_PARSING_METADATA,I)}if(T&&v){const I={id:n,frag:u,details:T,samples:v.samples};i.trigger(m.FRAG_PARSING_USERDATA,I)}}logMuxedErr(e){this.warn(`${Le(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,i){if(this.state!==tt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:r,video:s,audiovideo:o}=t;if(r){let l=Wt(r.codec,e.audioCodec);l==="mp4a"&&(l="mp4a.40.5");const d=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){l&&(l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5");const f=r.metadata;f&&"channelCount"in f&&(f.channelCount||1)!==1&&d.indexOf("firefox")===-1&&(l="mp4a.40.5")}l&&l.indexOf("mp4a.40.5")!==-1&&d.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(l="mp4a.40.2",this.log(`Android: force audio codec to ${l}`)),e.audioCodec&&e.audioCodec!==l&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${l}"`),r.levelCodec=l,r.id=ae.MAIN,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${l||""}/${e.audioCodec||""}/${r.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=ae.MAIN;const l=s.codec;if((l==null?void 0:l.length)===4)switch(l){case"hvc1":case"hev1":s.codec="hvc1.1.6.L120.90";break;case"av01":s.codec="av01.0.04M.08";break;case"avc1":s.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${l}]${s.codec!==l?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);const u=Object.keys(t);if(u.length){if(this.hls.trigger(m.BUFFER_CODECS,t),!this.hls)return;u.forEach(l=>{const f=t[l].initSegment;f!=null&&f.byteLength&&this.hls.trigger(m.BUFFER_APPENDING,{type:l,data:f,frag:n,part:null,chunkMeta:i,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,ae.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,n=e==null?void 0:e[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=tt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(vn.isBuffered(e,n)?t=this.getAppendedFrag(n):vn.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,r=t.level;(!i||t.sn!==i.sn||i.level!==r)&&(this.fragPlaying=t,this.hls.trigger(m.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(m.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return A(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(A(t)){const n=this.getLevelDetails(),i=this.currentFrag||(n?Jt(null,n.fragments,t):null);if(i){const r=i.programDateTime;if(r!==null){const s=r+(t-i.start)*1e3;return new Date(s)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class qc{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[n].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=x.KEY_LOAD_ERROR,n,i,r){return new wn({type:Z.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:i}=e;for(let r=0;r<t.length;r++){const s=t[r];if(i<=s.cc&&(n==="initSegment"||s.sn==="initSegment"||n<s.sn)){this.emeController.selectKeySystemFormat(s).then(o=>{s.setKeyFormat(o)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const l=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,x.KEY_LOAD_ERROR,l))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,x.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let o=this.keyUriToKeyInfo[s];if((n=o)!=null&&n.decryptdata.key)return r.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if((i=o)!=null&&i.keyLoadPromise){var u;switch((u=o.mediaKeySessionContext)==null?void 0:u.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(l=>(r.key=l.keyInfo.decryptdata.key,{frag:e,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[s]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,x.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(n);if(i)return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,n))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=n.loader,r=new i(n);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((s,o)=>{const u={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=n.keyLoadPolicy.default,d={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(v,p,y,T)=>{const{frag:b,keyInfo:I,url:B}=y;if(!b.decryptdata||I!==this.keyUriToKeyInfo[B])return o(this.createKeyLoadError(b,x.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),T));I.decryptdata.key=b.decryptdata.key=new Uint8Array(v.data),b.keyLoader=null,I.loader=null,s({frag:b,keyInfo:I})},onError:(v,p,y,T)=>{this.resetLoader(p),o(this.createKeyLoadError(t,x.KEY_LOAD_ERROR,new Error(`HTTP Error ${v.code} loading key ${v.text}`),y,de({url:u.url,data:void 0},v)))},onTimeout:(v,p,y)=>{this.resetLoader(p),o(this.createKeyLoadError(t,x.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),y))},onAbort:(v,p,y)=>{this.resetLoader(p),o(this.createKeyLoadError(t,x.INTERNAL_ABORTED,new Error("key loading aborted"),y))}};r.load(u,d,f)})}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,r=n.loader;t.keyLoader===r&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}function Zo(a){const{type:e}=a;switch(e){case Xe.AUDIO_TRACK:return ae.AUDIO;case Xe.SUBTITLE_TRACK:return ae.SUBTITLE;default:return ae.MAIN}}function Ta(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Qc{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,i=t.loader,r=n||i,s=new r(t);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Xe.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:s,deliveryDirectives:o,levelInfo:u}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:Xe.LEVEL,url:s,deliveryDirectives:o,levelOrTrack:u})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:Xe.AUDIO_TRACK,url:r,deliveryDirectives:s,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:Xe.SUBTITLE_TRACK,url:r,deliveryDirectives:s,levelOrTrack:o})}onLevelsUpdated(e,t){const n=this.loaders[Xe.LEVEL];if(n){const i=n.context;i&&!t.levels.some(r=>r===i.levelOrTrack)&&(n.abort(),delete this.loaders[Xe.LEVEL])}}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const l=this.hls.logger,d=i.context;if(d&&d.levelOrTrack===e.levelOrTrack&&(d.url===e.url||d.deliveryDirectives&&!e.deliveryDirectives)){d.url===e.url?l.log(`[playlist-loader]: ignore ${e.url} ongoing request`):l.log(`[playlist-loader]: ignore ${e.url} in favor of ${d.url}`);return}l.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===Xe.MANIFEST?r=n.manifestLoadPolicy.default:r=M({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),A((t=e.deliveryDirectives)==null?void 0:t.part)){let l;if(e.type===Xe.LEVEL&&e.level!==null?l=this.hls.levels[e.level].details:e.type===Xe.AUDIO_TRACK&&e.id!==null?l=this.hls.audioTracks[e.id].details:e.type===Xe.SUBTITLE_TRACK&&e.id!==null&&(l=this.hls.subtitleTracks[e.id].details),l){const d=l.partTarget,f=l.targetduration;if(d&&f){const v=Math.max(d*3,f*.8)*1e3;r=M({},r,{maxTimeToFirstByteMs:Math.min(v,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(v,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},u={onSuccess:(l,d,f,v)=>{const p=this.getInternalLoader(f);this.resetInternalLoader(f.type);const y=l.data;if(y.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,f,new Error("no EXTM3U delimiter"),v||null,d);return}d.parsing.start=performance.now(),er.isMediaPlaylist(y)||f.type!==Xe.MANIFEST?this.handleTrackOrLevelPlaylist(l,d,f,v||null,p):this.handleMasterPlaylist(l,d,f,v)},onError:(l,d,f,v)=>{this.handleNetworkError(d,f,!1,l,v)},onTimeout:(l,d,f)=>{this.handleNetworkError(d,f,!0,void 0,l)}};i.load(e,o,u)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,i){const r=this.hls,s=e.data,o=Ta(e,n),u=er.parseMasterPlaylist(s,o);if(u.playlistParsingError){this.handleManifestParsingError(e,n,u.playlistParsingError,i,t);return}const{contentSteering:l,levels:d,sessionData:f,sessionKeys:v,startTimeOffset:p,variableList:y}=u;this.variableList=y;const{AUDIO:T=[],SUBTITLES:b,"CLOSED-CAPTIONS":I}=er.parseMasterPlaylistMedia(s,o,u);T.length&&!T.some(P=>!P.url)&&d[0].audioCodec&&!d[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),T.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Vn({}),bitrate:0,url:""})),r.trigger(m.MANIFEST_LOADED,{levels:d,audioTracks:T,subtitles:b,captions:I,contentSteering:l,url:o,stats:t,networkDetails:i,sessionData:f,sessionKeys:v,startTimeOffset:p,variableList:y})}handleTrackOrLevelPlaylist(e,t,n,i,r){const s=this.hls,{id:o,level:u,type:l}=n,d=Ta(e,n),f=A(u)?u:A(o)?o:0,v=Zo(n),p=er.parseLevelPlaylist(e.data,d,f,v,0,this.variableList);if(l===Xe.MANIFEST){const y={attrs:new Vn({}),bitrate:0,details:p,name:"",url:d};p.requestScheduled=t.loading.start+Bi(p,0),s.trigger(m.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:d,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=p,this.handlePlaylistLoaded(p,e,t,n,i,r)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(m.ERROR,{type:Z.NETWORK_ERROR,details:x.MANIFEST_PARSING_ERROR,fatal:t.type===Xe.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,n=!1,i,r){let s=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===Xe.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===Xe.AUDIO_TRACK||e.type===Xe.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let u=x.UNKNOWN,l=!1;const d=this.getInternalLoader(e);switch(e.type){case Xe.MANIFEST:u=n?x.MANIFEST_LOAD_TIMEOUT:x.MANIFEST_LOAD_ERROR,l=!0;break;case Xe.LEVEL:u=n?x.LEVEL_LOAD_TIMEOUT:x.LEVEL_LOAD_ERROR,l=!1;break;case Xe.AUDIO_TRACK:u=n?x.AUDIO_TRACK_LOAD_TIMEOUT:x.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case Xe.SUBTITLE_TRACK:u=n?x.SUBTITLE_TRACK_LOAD_TIMEOUT:x.SUBTITLE_LOAD_ERROR,l=!1;break}d&&this.resetInternalLoader(e.type);const f={type:Z.NETWORK_ERROR,details:u,fatal:l,url:e.url,loader:d,context:e,error:o,networkDetails:t,stats:r};if(i){const v=(t==null?void 0:t.url)||e.url;f.response=de({url:v,data:void 0},i)}this.hls.trigger(m.ERROR,f)}handlePlaylistLoaded(e,t,n,i,r,s){const o=this.hls,{type:u,level:l,id:d,groupId:f,deliveryDirectives:v}=i,p=Ta(t,i),y=Zo(i),T=typeof i.level=="number"&&y===ae.MAIN?l:void 0;if(!e.fragments.length){const I=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(m.ERROR,{type:Z.NETWORK_ERROR,details:x.LEVEL_EMPTY_ERROR,fatal:!1,url:p,error:I,reason:I.message,response:t,context:i,level:T,parent:y,networkDetails:r,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const b=e.playlistParsingError;if(b){if(this.hls.logger.warn(b),!o.config.ignorePlaylistParsingErrors){o.trigger(m.ERROR,{type:Z.NETWORK_ERROR,details:x.LEVEL_PARSING_ERROR,fatal:!1,url:p,error:b,reason:b.message,response:t,context:i,level:T,parent:y,networkDetails:r,stats:n});return}e.playlistParsingError=null}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),u){case Xe.MANIFEST:case Xe.LEVEL:o.trigger(m.LEVEL_LOADED,{details:e,levelInfo:i.levelOrTrack||o.levels[0],level:T||0,id:d||0,stats:n,networkDetails:r,deliveryDirectives:v,withoutMultiVariant:u===Xe.MANIFEST});break;case Xe.AUDIO_TRACK:o.trigger(m.AUDIO_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:d||0,groupId:f||"",stats:n,networkDetails:r,deliveryDirectives:v});break;case Xe.SUBTITLE_TRACK:o.trigger(m.SUBTITLE_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:d||0,groupId:f||"",stats:n,networkDetails:r,deliveryDirectives:v});break}}}class Br{static get version(){return ms}static isMSESupported(){return zo()}static isSupported(){return Wc()}static getMediaSource(){return Be()}static get Events(){return m}static get MetadataSchema(){return cr}static get ErrorTypes(){return Z}static get ErrorDetails(){return x}static get DefaultConfig(){return Br.defaultConfig?Br.defaultConfig:Oc}static set DefaultConfig(e){Br.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new hs,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=Ie(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=kc(Br.DefaultConfig,e,t);this.userConfig=e,n.progressive&&Nc(n,t);const{abrController:i,bufferController:r,capLevelController:s,errorController:o,fpsController:u}=n,l=new o(this),d=this.abrController=new i(this),f=new Yn(this),v=n.interstitialsController,p=v?this.interstitialsController=new v(this,Br):null,y=this.bufferController=new r(this,f),T=this.capLevelController=new s(this),b=new u(this),I=new Qc(this),B=n.contentSteeringController,P=B?new B(this):null,ue=this.levelController=new Hc(this,P),he=new Zc(this),je=new qc(this.config),me=this.streamController=new Xc(this,f,je),Me=this.gapController=new Gc(this,f);T.setStreamController(me),b.setStreamController(me);const it=[I,ue,me];p&&it.splice(1,0,p),P&&it.splice(1,0,P),this.networkControllers=it;const Te=[d,y,Me,T,b,he,f];this.audioTrackController=this.createController(n.audioTrackController,it);const Ut=n.audioStreamController;Ut&&it.push(this.audioStreamController=new Ut(this,f,je)),this.subtitleTrackController=this.createController(n.subtitleTrackController,it);const an=n.subtitleStreamController;an&&it.push(this.subtititleStreamController=new an(this,f,je)),this.createController(n.timelineController,Te),je.emeController=this.emeController=this.createController(n.emeController,Te),this.cmcdController=this.createController(n.cmcdController,Te),this.latencyController=this.createController(Kc,Te),this.coreComponents=Te,it.push(l);const di=l.onErrorOut;typeof di=="function"&&this.on(m.ERROR,di,l),this.on(m.MANIFEST_LOADED,I.onManifestLoaded,I)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,i){this._emitter.off(e,t,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const i=e===m.ERROR;this.trigger(m.ERROR,{type:Z.OTHER_ERROR,details:x.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(m.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const r=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(m.ERROR,{type:Z.OTHER_ERROR,details:x.ATTACH_MEDIA_ERROR,fatal:!0,error:r});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,i=t?e:{media:n};this._media=n,this.trigger(m.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(m.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(m.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,i=this._url=Rt.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(m.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),!(!this.started||!this.networkControllers));n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[ae.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[ae.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[ae.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e==null?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=fl()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){_t(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let i=0;i<n;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,n)for(let r=i;r--;){const s=e[r].attrs["HDCP-LEVEL"];if(s&&s<=n)return r}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const n=st(t);return j(e,n,navigator.mediaCapabilities)}}Br.defaultConfig=void 0}}]);
|
|
}()); |