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.
1034 lines
1.1 MiB
1034 lines
1.1 MiB
!(function(){var Qo=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[5402],{65030:function(Ut,ft,R){"use strict";R.d(ft,{Z:function(){return Tt}});var E=R(98506),le=R(16886),xe=R(33346),ee=R(43403),W=R(92310),p=R.n(W),ue=R(29301),Y=R(76846),l=R(96452),G=R(6089),A=R(80402),m=R(34280),_=R(49658),y=R(59301),b=R(67711),F=R(77900),K=R(8654);function H(ye){var be=ye.prefixCls,q=ye.align,Le=ye.arrow,Ne=ye.arrowPos,Qe=Le||{},V=Qe.className,se=Qe.content,Ee=Ne.x,Fe=Ee===void 0?0:Ee,de=Ne.y,ze=de===void 0?0:de,rt=y.useRef();if(!q||!q.points)return null;var We={position:"absolute"};if(q.autoArrow!==!1){var ut=q.points[0],Ve=q.points[1],At=ut[0],vt=ut[1],ge=Ve[0],Ae=Ve[1];At===ge||!["t","b"].includes(At)?We.top=ze:At==="t"?We.top=0:We.bottom=0,vt===Ae||!["l","r"].includes(vt)?We.left=Fe:vt==="l"?We.left=0:We.right=0}return y.createElement("div",{ref:rt,className:p()("".concat(be,"-arrow"),V),style:We},se)}function L(ye){var be=ye.prefixCls,q=ye.open,Le=ye.zIndex,Ne=ye.mask,Qe=ye.motion;return Ne?y.createElement(F.default,(0,b.Z)({},Qe,{motionAppear:!0,visible:q,removeOnLeave:!0}),function(V){var se=V.className;return y.createElement("div",{style:{zIndex:Le},className:p()("".concat(be,"-mask"),se)})}):null}var O=y.memo(function(ye){var be=ye.children;return be},function(ye,be){return be.cache}),k=O,z=y.forwardRef(function(ye,be){var q=ye.popup,Le=ye.className,Ne=ye.prefixCls,Qe=ye.style,V=ye.target,se=ye.onVisibleChanged,Ee=ye.open,Fe=ye.keepDom,de=ye.fresh,ze=ye.onClick,rt=ye.mask,We=ye.arrow,ut=ye.arrowPos,Ve=ye.align,At=ye.motion,vt=ye.maskMotion,ge=ye.forceRender,Ae=ye.getPopupContainer,Ze=ye.autoDestroy,tt=ye.portal,Ke=ye.zIndex,pt=ye.onMouseEnter,gt=ye.onMouseLeave,He=ye.onPointerEnter,bt=ye.onPointerDownCapture,Ct=ye.ready,it=ye.offsetX,wt=ye.offsetY,_e=ye.offsetR,me=ye.offsetB,pe=ye.onAlign,C=ye.onPrepare,j=ye.stretch,X=ye.targetWidth,te=ye.targetHeight,fe=typeof q=="function"?q():q,ve=Ee||Fe,Te=(Ae==null?void 0:Ae.length)>0,Ie=y.useState(!Ae||!Te),je=(0,le.Z)(Ie,2),_t=je[0],Dt=je[1];if((0,m.Z)(function(){!_t&&Te&&V&&Dt(!0)},[_t,Te,V]),!_t)return null;var dt="auto",at={left:"-1000vw",top:"-1000vh",right:dt,bottom:dt};if(Ct||!Ee){var Rt,Gt=Ve.points,kt=Ve.dynamicInset||((Rt=Ve._experimental)===null||Rt===void 0?void 0:Rt.dynamicInset),Ot=kt&&Gt[0][1]==="r",ot=kt&&Gt[0][0]==="b";Ot?(at.right=_e,at.left=dt):(at.left=it,at.right=dt),ot?(at.bottom=me,at.top=dt):(at.top=wt,at.bottom=dt)}var Ye={};return j&&(j.includes("height")&&te?Ye.height=te:j.includes("minHeight")&&te&&(Ye.minHeight=te),j.includes("width")&&X?Ye.width=X:j.includes("minWidth")&&X&&(Ye.minWidth=X)),Ee||(Ye.pointerEvents="none"),y.createElement(tt,{open:ge||ve,getContainer:Ae&&function(){return Ae(V)},autoDestroy:Ze},y.createElement(L,{prefixCls:Ne,open:Ee,zIndex:Ke,mask:rt,motion:vt}),y.createElement(ue.Z,{onResize:pe,disabled:!Ee},function(yt){return y.createElement(F.default,(0,b.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:ge,leavedClassName:"".concat(Ne,"-hidden")},At,{onAppearPrepare:C,onEnterPrepare:C,visible:Ee,onVisibleChanged:function(Ht){var un;At==null||(un=At.onVisibleChanged)===null||un===void 0||un.call(At,Ht),se(Ht)}}),function(Pt,Ht){var un=Pt.className,Bn=Pt.style,fn=p()(Ne,un,Le);return y.createElement("div",{ref:(0,K.sQ)(yt,be,Ht),className:fn,style:(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)({"--arrow-x":"".concat(ut.x||0,"px"),"--arrow-y":"".concat(ut.y||0,"px")},at),Ye),Bn),{},{boxSizing:"border-box",zIndex:Ke},Qe),onMouseEnter:pt,onMouseLeave:gt,onPointerEnter:He,onClick:ze,onPointerDownCapture:bt},We&&y.createElement(H,{prefixCls:Ne,arrow:We,arrowPos:ut,align:Ve}),y.createElement(k,{cache:!Ee&&!de},fe))})}))}),J=z,ne=y.forwardRef(function(ye,be){var q=ye.children,Le=ye.getTriggerDOMNode,Ne=(0,K.Yr)(q),Qe=y.useCallback(function(se){(0,K.mH)(be,Le?Le(se):se)},[Le]),V=(0,K.x1)(Qe,(0,K.C4)(q));return Ne?y.cloneElement(q,{ref:V}):q}),Z=ne,ae=y.createContext(null),oe=ae;function re(ye){return ye?Array.isArray(ye)?ye:[ye]:[]}function Re(ye,be,q,Le){return y.useMemo(function(){var Ne=re(q!=null?q:be),Qe=re(Le!=null?Le:be),V=new Set(Ne),se=new Set(Qe);return ye&&(V.has("hover")&&(V.delete("hover"),V.add("click")),se.has("hover")&&(se.delete("hover"),se.add("click"))),[V,se]},[ye,be,q,Le])}var M=R(29194);function w(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],q=arguments.length>2?arguments[2]:void 0;return q?ye[0]===be[0]:ye[0]===be[0]&&ye[1]===be[1]}function T(ye,be,q,Le){for(var Ne=q.points,Qe=Object.keys(ye),V=0;V<Qe.length;V+=1){var se,Ee=Qe[V];if(w((se=ye[Ee])===null||se===void 0?void 0:se.points,Ne,Le))return"".concat(be,"-placement-").concat(Ee)}return""}function I(ye,be,q,Le){return be||(q?{motionName:"".concat(ye,"-").concat(q)}:Le?{motionName:Le}:null)}function N(ye){return ye.ownerDocument.defaultView}function U(ye){for(var be=[],q=ye==null?void 0:ye.parentElement,Le=["hidden","scroll","clip","auto"];q;){var Ne=N(q).getComputedStyle(q),Qe=Ne.overflowX,V=Ne.overflowY,se=Ne.overflow;[Qe,V,se].some(function(Ee){return Le.includes(Ee)})&&be.push(q),q=q.parentElement}return be}function g(ye){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(ye)?be:ye}function d(ye){return g(parseFloat(ye),0)}function D(ye,be){var q=(0,E.Z)({},ye);return(be||[]).forEach(function(Le){if(!(Le instanceof HTMLBodyElement||Le instanceof HTMLHtmlElement)){var Ne=N(Le).getComputedStyle(Le),Qe=Ne.overflow,V=Ne.overflowClipMargin,se=Ne.borderTopWidth,Ee=Ne.borderBottomWidth,Fe=Ne.borderLeftWidth,de=Ne.borderRightWidth,ze=Le.getBoundingClientRect(),rt=Le.offsetHeight,We=Le.clientHeight,ut=Le.offsetWidth,Ve=Le.clientWidth,At=d(se),vt=d(Ee),ge=d(Fe),Ae=d(de),Ze=g(Math.round(ze.width/ut*1e3)/1e3),tt=g(Math.round(ze.height/rt*1e3)/1e3),Ke=(ut-Ve-ge-Ae)*Ze,pt=(rt-We-At-vt)*tt,gt=At*tt,He=vt*tt,bt=ge*Ze,Ct=Ae*Ze,it=0,wt=0;if(Qe==="clip"){var _e=d(V);it=_e*Ze,wt=_e*tt}var me=ze.x+bt-it,pe=ze.y+gt-wt,C=me+ze.width+2*it-bt-Ct-Ke,j=pe+ze.height+2*wt-gt-He-pt;q.left=Math.max(q.left,me),q.top=Math.max(q.top,pe),q.right=Math.min(q.right,C),q.bottom=Math.min(q.bottom,j)}}),q}function $(ye){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q="".concat(be),Le=q.match(/^(.*)\%$/);return Le?ye*(parseFloat(Le[1])/100):parseFloat(q)}function he(ye,be){var q=be||[],Le=(0,le.Z)(q,2),Ne=Le[0],Qe=Le[1];return[$(ye.width,Ne),$(ye.height,Qe)]}function Se(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[ye[0],ye[1]]}function qe(ye,be){var q=be[0],Le=be[1],Ne,Qe;return q==="t"?Qe=ye.y:q==="b"?Qe=ye.y+ye.height:Qe=ye.y+ye.height/2,Le==="l"?Ne=ye.x:Le==="r"?Ne=ye.x+ye.width:Ne=ye.x+ye.width/2,{x:Ne,y:Qe}}function Ue(ye,be){var q={t:"b",b:"t",l:"r",r:"l"};return ye.map(function(Le,Ne){return Ne===be?q[Le]||"c":Le}).join("")}function nt(ye,be,q,Le,Ne,Qe,V){var se=y.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Ne[Le]||{}}),Ee=(0,le.Z)(se,2),Fe=Ee[0],de=Ee[1],ze=y.useRef(0),rt=y.useMemo(function(){return be?U(be):[]},[be]),We=y.useRef({}),ut=function(){We.current={}};ye||ut();var Ve=(0,G.Z)(function(){if(be&&q&&ye){let bi=function(Rn,qn){var Gi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:On,er=ve.x+Rn,tr=ve.y+qn,gr=er+ot,fr=tr+Ot,xr=Math.max(er,Gi.left),Zt=Math.max(tr,Gi.top),on=Math.min(gr,Gi.right),Kn=Math.min(fr,Gi.bottom);return Math.max(0,(on-xr)*(Kn-Zt))},Yn=function(){Nn=ve.y+rn,$n=Nn+Ot,Zn=ve.x+Jt,Xn=Zn+ot};var ge,Ae,Ze,tt,Ke=be,pt=Ke.ownerDocument,gt=N(Ke),He=gt.getComputedStyle(Ke),bt=He.position,Ct=Ke.style.left,it=Ke.style.top,wt=Ke.style.right,_e=Ke.style.bottom,me=Ke.style.overflow,pe=(0,E.Z)((0,E.Z)({},Ne[Le]),Qe),C=pt.createElement("div");(ge=Ke.parentElement)===null||ge===void 0||ge.appendChild(C),C.style.left="".concat(Ke.offsetLeft,"px"),C.style.top="".concat(Ke.offsetTop,"px"),C.style.position=bt,C.style.height="".concat(Ke.offsetHeight,"px"),C.style.width="".concat(Ke.offsetWidth,"px"),Ke.style.left="0",Ke.style.top="0",Ke.style.right="auto",Ke.style.bottom="auto",Ke.style.overflow="hidden";var j;if(Array.isArray(q))j={x:q[0],y:q[1],width:0,height:0};else{var X,te,fe=q.getBoundingClientRect();fe.x=(X=fe.x)!==null&&X!==void 0?X:fe.left,fe.y=(te=fe.y)!==null&&te!==void 0?te:fe.top,j={x:fe.x,y:fe.y,width:fe.width,height:fe.height}}var ve=Ke.getBoundingClientRect(),Te=gt.getComputedStyle(Ke),Ie=Te.height,je=Te.width;ve.x=(Ae=ve.x)!==null&&Ae!==void 0?Ae:ve.left,ve.y=(Ze=ve.y)!==null&&Ze!==void 0?Ze:ve.top;var _t=pt.documentElement,Dt=_t.clientWidth,dt=_t.clientHeight,at=_t.scrollWidth,Rt=_t.scrollHeight,Gt=_t.scrollTop,kt=_t.scrollLeft,Ot=ve.height,ot=ve.width,Ye=j.height,yt=j.width,Pt={left:0,top:0,right:Dt,bottom:dt},Ht={left:-kt,top:-Gt,right:at-kt,bottom:Rt-Gt},un=pe.htmlRegion,Bn="visible",fn="visibleFirst";un!=="scroll"&&un!==fn&&(un=Bn);var pn=un===fn,Sn=D(Ht,rt),tn=D(Pt,rt),On=un===Bn?tn:Sn,Tn=pn?tn:On;Ke.style.left="auto",Ke.style.top="auto",Ke.style.right="0",Ke.style.bottom="0";var ai=Ke.getBoundingClientRect();Ke.style.left=Ct,Ke.style.top=it,Ke.style.right=wt,Ke.style.bottom=_e,Ke.style.overflow=me,(tt=Ke.parentElement)===null||tt===void 0||tt.removeChild(C);var Kt=g(Math.round(ot/parseFloat(je)*1e3)/1e3),_n=g(Math.round(Ot/parseFloat(Ie)*1e3)/1e3);if(Kt===0||_n===0||(0,Y.Sh)(q)&&!(0,M.Z)(q))return;var vn=pe.offset,jt=pe.targetOffset,Mt=he(ve,vn),we=(0,le.Z)(Mt,2),Je=we[0],ht=we[1],lt=he(j,jt),Et=(0,le.Z)(lt,2),xt=Et[0],It=Et[1];j.x-=xt,j.y-=It;var Wt=pe.points||[],yn=(0,le.Z)(Wt,2),nn=yn[0],Fn=yn[1],Qt=Se(Fn),en=Se(nn),ln=qe(j,Qt),En=qe(ve,en),An=(0,E.Z)({},pe),Jt=ln.x-En.x+Je,rn=ln.y-En.y+ht,kn=bi(Jt,rn),gn=bi(Jt,rn,tn),mn=qe(j,["t","l"]),Ln=qe(ve,["t","l"]),wn=qe(j,["b","r"]),cn=qe(ve,["b","r"]),Pn=pe.overflow||{},Hn=Pn.adjustX,ni=Pn.adjustY,xn=Pn.shiftX,ii=Pn.shiftY,ri=function(qn){return typeof qn=="boolean"?qn:qn>=0},Nn,$n,Zn,Xn;Yn();var Ei=ri(ni),Un=en[0]===Qt[0];if(Ei&&en[0]==="t"&&($n>Tn.bottom||We.current.bt)){var Vn=rn;Un?Vn-=Ot-Ye:Vn=mn.y-cn.y-ht;var vi=bi(Jt,Vn),Ci=bi(Jt,Vn,tn);vi>kn||vi===kn&&(!pn||Ci>=gn)?(We.current.bt=!0,rn=Vn,ht=-ht,An.points=[Ue(en,0),Ue(Qt,0)]):We.current.bt=!1}if(Ei&&en[0]==="b"&&(Nn<Tn.top||We.current.tb)){var li=rn;Un?li+=Ot-Ye:li=wn.y-Ln.y-ht;var Ai=bi(Jt,li),ui=bi(Jt,li,tn);Ai>kn||Ai===kn&&(!pn||ui>=gn)?(We.current.tb=!0,rn=li,ht=-ht,An.points=[Ue(en,0),Ue(Qt,0)]):We.current.tb=!1}var oi=ri(Hn),Ii=en[1]===Qt[1];if(oi&&en[1]==="l"&&(Xn>Tn.right||We.current.rl)){var xi=Jt;Ii?xi-=ot-yt:xi=mn.x-cn.x-Je;var Qn=bi(xi,rn),Jn=bi(xi,rn,tn);Qn>kn||Qn===kn&&(!pn||Jn>=gn)?(We.current.rl=!0,Jt=xi,Je=-Je,An.points=[Ue(en,1),Ue(Qt,1)]):We.current.rl=!1}if(oi&&en[1]==="r"&&(Zn<Tn.left||We.current.lr)){var ci=Jt;Ii?ci+=ot-yt:ci=wn.x-Ln.x-Je;var _i=bi(ci,rn),Ri=bi(ci,rn,tn);_i>kn||_i===kn&&(!pn||Ri>=gn)?(We.current.lr=!0,Jt=ci,Je=-Je,An.points=[Ue(en,1),Ue(Qt,1)]):We.current.lr=!1}Yn();var $t=xn===!0?0:xn;typeof $t=="number"&&(Zn<tn.left&&(Jt-=Zn-tn.left-Je,j.x+yt<tn.left+$t&&(Jt+=j.x-tn.left+yt-$t)),Xn>tn.right&&(Jt-=Xn-tn.right-Je,j.x>tn.right-$t&&(Jt+=j.x-tn.right+$t)));var di=ii===!0?0:ii;typeof di=="number"&&(Nn<tn.top&&(rn-=Nn-tn.top-ht,j.y+Ye<tn.top+di&&(rn+=j.y-tn.top+Ye-di)),$n>tn.bottom&&(rn-=$n-tn.bottom-ht,j.y>tn.bottom-di&&(rn+=j.y-tn.bottom+di)));var Si=ve.x+Jt,wi=Si+ot,Fi=ve.y+rn,Dn=Fi+Ot,qt=j.x,Cn=qt+yt,an=j.y,yi=an+Ye,fi=Math.max(Si,qt),pi=Math.min(wi,Cn),gi=(fi+pi)/2,Wi=gi-Si,Ti=Math.max(Fi,an),Li=Math.min(Dn,yi),Mi=(Ti+Li)/2,Ni=Mi-Fi;V==null||V(be,An);var hi=ai.right-ve.x-(Jt+ve.width),Bi=ai.bottom-ve.y-(rn+ve.height);Kt===1&&(Jt=Math.round(Jt),hi=Math.round(hi)),_n===1&&(rn=Math.round(rn),Bi=Math.round(Bi));var qi={ready:!0,offsetX:Jt/Kt,offsetY:rn/_n,offsetR:hi/Kt,offsetB:Bi/_n,arrowX:Wi/Kt,arrowY:Ni/_n,scaleX:Kt,scaleY:_n,align:An};de(qi)}}),At=function(){ze.current+=1;var Ae=ze.current;Promise.resolve().then(function(){ze.current===Ae&&Ve()})},vt=function(){de(function(Ae){return(0,E.Z)((0,E.Z)({},Ae),{},{ready:!1})})};return(0,m.Z)(vt,[Le]),(0,m.Z)(function(){ye||vt()},[ye]),[Fe.ready,Fe.offsetX,Fe.offsetY,Fe.offsetR,Fe.offsetB,Fe.arrowX,Fe.arrowY,Fe.scaleX,Fe.scaleY,Fe.align,At]}var et=R(15142);function Pe(ye,be,q,Le,Ne){(0,m.Z)(function(){if(ye&&be&&q){let ze=function(){Le(),Ne()};var Qe=be,V=q,se=U(Qe),Ee=U(V),Fe=N(V),de=new Set([Fe].concat((0,et.Z)(se),(0,et.Z)(Ee)));return de.forEach(function(rt){rt.addEventListener("scroll",ze,{passive:!0})}),Fe.addEventListener("resize",ze,{passive:!0}),Le(),function(){de.forEach(function(rt){rt.removeEventListener("scroll",ze),Fe.removeEventListener("resize",ze)})}}},[ye,be,q])}var Lt=R(48736);function Me(ye,be,q,Le,Ne,Qe,V,se){var Ee=y.useRef(ye);Ee.current=ye;var Fe=y.useRef(!1);y.useEffect(function(){if(be&&Le&&(!Ne||Qe)){var ze=function(){Fe.current=!1},rt=function(Ze){var tt;Ee.current&&!V(((tt=Ze.composedPath)===null||tt===void 0||(tt=tt.call(Ze))===null||tt===void 0?void 0:tt[0])||Ze.target)&&!Fe.current&&se(!1)},We=N(Le);We.addEventListener("pointerdown",ze,!0),We.addEventListener("mousedown",rt,!0),We.addEventListener("contextmenu",rt,!0);var ut=(0,l.A)(q);if(ut&&(ut.addEventListener("mousedown",rt,!0),ut.addEventListener("contextmenu",rt,!0)),0)var Ve,At,vt,ge;return function(){We.removeEventListener("pointerdown",ze,!0),We.removeEventListener("mousedown",rt,!0),We.removeEventListener("contextmenu",rt,!0),ut&&(ut.removeEventListener("mousedown",rt,!0),ut.removeEventListener("contextmenu",rt,!0))}}},[be,q,Le,Ne,Qe]);function de(){Fe.current=!0}return de}var mt=["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 ke(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ee.Z,be=y.forwardRef(function(q,Le){var Ne=q.prefixCls,Qe=Ne===void 0?"rc-trigger-popup":Ne,V=q.children,se=q.action,Ee=se===void 0?"hover":se,Fe=q.showAction,de=q.hideAction,ze=q.popupVisible,rt=q.defaultPopupVisible,We=q.onPopupVisibleChange,ut=q.afterPopupVisibleChange,Ve=q.mouseEnterDelay,At=q.mouseLeaveDelay,vt=At===void 0?.1:At,ge=q.focusDelay,Ae=q.blurDelay,Ze=q.mask,tt=q.maskClosable,Ke=tt===void 0?!0:tt,pt=q.getPopupContainer,gt=q.forceRender,He=q.autoDestroy,bt=q.destroyPopupOnHide,Ct=q.popup,it=q.popupClassName,wt=q.popupStyle,_e=q.popupPlacement,me=q.builtinPlacements,pe=me===void 0?{}:me,C=q.popupAlign,j=q.zIndex,X=q.stretch,te=q.getPopupClassNameFromAlign,fe=q.fresh,ve=q.alignPoint,Te=q.onPopupClick,Ie=q.onPopupAlign,je=q.arrow,_t=q.popupMotion,Dt=q.maskMotion,dt=q.popupTransitionName,at=q.popupAnimation,Rt=q.maskTransitionName,Gt=q.maskAnimation,kt=q.className,Ot=q.getTriggerDOMNode,ot=(0,xe.Z)(q,mt),Ye=He||bt||!1,yt=y.useState(!1),Pt=(0,le.Z)(yt,2),Ht=Pt[0],un=Pt[1];(0,m.Z)(function(){un((0,_.Z)())},[]);var Bn=y.useRef({}),fn=y.useContext(oe),pn=y.useMemo(function(){return{registerSubPopup:function(on,Kn){Bn.current[on]=Kn,fn==null||fn.registerSubPopup(on,Kn)}}},[fn]),Sn=(0,A.Z)(),tn=y.useState(null),On=(0,le.Z)(tn,2),Tn=On[0],ai=On[1],Kt=y.useRef(null),_n=(0,G.Z)(function(Zt){Kt.current=Zt,(0,Y.Sh)(Zt)&&Tn!==Zt&&ai(Zt),fn==null||fn.registerSubPopup(Sn,Zt)}),vn=y.useState(null),jt=(0,le.Z)(vn,2),Mt=jt[0],we=jt[1],Je=y.useRef(null),ht=(0,G.Z)(function(Zt){(0,Y.Sh)(Zt)&&Mt!==Zt&&(we(Zt),Je.current=Zt)}),lt=y.Children.only(V),Et=(lt==null?void 0:lt.props)||{},xt={},It=(0,G.Z)(function(Zt){var on,Kn,ei=Mt;return(ei==null?void 0:ei.contains(Zt))||((on=(0,l.A)(ei))===null||on===void 0?void 0:on.host)===Zt||Zt===ei||(Tn==null?void 0:Tn.contains(Zt))||((Kn=(0,l.A)(Tn))===null||Kn===void 0?void 0:Kn.host)===Zt||Zt===Tn||Object.values(Bn.current).some(function(si){return(si==null?void 0:si.contains(Zt))||Zt===si})}),Wt=I(Qe,_t,at,dt),yn=I(Qe,Dt,Gt,Rt),nn=y.useState(rt||!1),Fn=(0,le.Z)(nn,2),Qt=Fn[0],en=Fn[1],ln=ze!=null?ze:Qt,En=(0,G.Z)(function(Zt){ze===void 0&&en(Zt)});(0,m.Z)(function(){en(ze||!1)},[ze]);var An=y.useRef(ln);An.current=ln;var Jt=y.useRef([]);Jt.current=[];var rn=(0,G.Z)(function(Zt){var on;En(Zt),((on=Jt.current[Jt.current.length-1])!==null&&on!==void 0?on:ln)!==Zt&&(Jt.current.push(Zt),We==null||We(Zt))}),kn=y.useRef(),gn=function(){clearTimeout(kn.current)},mn=function(on){var Kn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;gn(),Kn===0?rn(on):kn.current=setTimeout(function(){rn(on)},Kn*1e3)};y.useEffect(function(){return gn},[]);var Ln=y.useState(!1),wn=(0,le.Z)(Ln,2),cn=wn[0],Pn=wn[1];(0,m.Z)(function(Zt){(!Zt||ln)&&Pn(!0)},[ln]);var Hn=y.useState(null),ni=(0,le.Z)(Hn,2),xn=ni[0],ii=ni[1],ri=y.useState(null),Nn=(0,le.Z)(ri,2),$n=Nn[0],Zn=Nn[1],Xn=function(on){Zn([on.clientX,on.clientY])},Ei=nt(ln,Tn,ve&&$n!==null?$n:Mt,_e,pe,C,Ie),Un=(0,le.Z)(Ei,11),Vn=Un[0],vi=Un[1],Ci=Un[2],li=Un[3],Ai=Un[4],ui=Un[5],oi=Un[6],Ii=Un[7],xi=Un[8],Qn=Un[9],Jn=Un[10],ci=Re(Ht,Ee,Fe,de),_i=(0,le.Z)(ci,2),Ri=_i[0],$t=_i[1],di=Ri.has("click"),Si=$t.has("click")||$t.has("contextMenu"),wi=(0,G.Z)(function(){cn||Jn()}),Fi=function(){An.current&&ve&&Si&&mn(!1)};Pe(ln,Mt,Tn,wi,Fi),(0,m.Z)(function(){wi()},[$n,_e]),(0,m.Z)(function(){ln&&!(pe!=null&&pe[_e])&&wi()},[JSON.stringify(C)]);var Dn=y.useMemo(function(){var Zt=T(pe,Qe,Qn,ve);return p()(Zt,te==null?void 0:te(Qn))},[Qn,te,pe,Qe,ve]);y.useImperativeHandle(Le,function(){return{nativeElement:Je.current,popupElement:Kt.current,forceAlign:wi}});var qt=y.useState(0),Cn=(0,le.Z)(qt,2),an=Cn[0],yi=Cn[1],fi=y.useState(0),pi=(0,le.Z)(fi,2),gi=pi[0],Wi=pi[1],Ti=function(){if(X&&Mt){var on=Mt.getBoundingClientRect();yi(on.width),Wi(on.height)}},Li=function(){Ti(),wi()},Mi=function(on){Pn(!1),Jn(),ut==null||ut(on)},Ni=function(){return new Promise(function(on){Ti(),ii(function(){return on})})};(0,m.Z)(function(){xn&&(Jn(),xn(),ii(null))},[xn]);function hi(Zt,on,Kn,ei){xt[Zt]=function(si){var ar;ei==null||ei(si),mn(on,Kn);for(var Ui=arguments.length,Cr=new Array(Ui>1?Ui-1:0),or=1;or<Ui;or++)Cr[or-1]=arguments[or];(ar=Et[Zt])===null||ar===void 0||ar.call.apply(ar,[Et,si].concat(Cr))}}(di||Si)&&(xt.onClick=function(Zt){var on;An.current&&Si?mn(!1):!An.current&&di&&(Xn(Zt),mn(!0));for(var Kn=arguments.length,ei=new Array(Kn>1?Kn-1:0),si=1;si<Kn;si++)ei[si-1]=arguments[si];(on=Et.onClick)===null||on===void 0||on.call.apply(on,[Et,Zt].concat(ei))});var Bi=Me(ln,Si,Mt,Tn,Ze,Ke,It,mn),qi=Ri.has("hover"),bi=$t.has("hover"),Yn,Rn;qi&&(hi("onMouseEnter",!0,Ve,function(Zt){Xn(Zt)}),hi("onPointerEnter",!0,Ve,function(Zt){Xn(Zt)}),Yn=function(on){(ln||cn)&&Tn!==null&&Tn!==void 0&&Tn.contains(on.target)&&mn(!0,Ve)},ve&&(xt.onMouseMove=function(Zt){var on;(on=Et.onMouseMove)===null||on===void 0||on.call(Et,Zt)})),bi&&(hi("onMouseLeave",!1,vt),hi("onPointerLeave",!1,vt),Rn=function(){mn(!1,vt)}),Ri.has("focus")&&hi("onFocus",!0,ge),$t.has("focus")&&hi("onBlur",!1,Ae),Ri.has("contextMenu")&&(xt.onContextMenu=function(Zt){var on;An.current&&$t.has("contextMenu")?mn(!1):(Xn(Zt),mn(!0)),Zt.preventDefault();for(var Kn=arguments.length,ei=new Array(Kn>1?Kn-1:0),si=1;si<Kn;si++)ei[si-1]=arguments[si];(on=Et.onContextMenu)===null||on===void 0||on.call.apply(on,[Et,Zt].concat(ei))}),kt&&(xt.className=p()(Et.className,kt));var qn=y.useRef(!1);qn.current||(qn.current=gt||ln||cn);var Gi=(0,E.Z)((0,E.Z)({},Et),xt),er={},tr=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];tr.forEach(function(Zt){ot[Zt]&&(er[Zt]=function(){for(var on,Kn=arguments.length,ei=new Array(Kn),si=0;si<Kn;si++)ei[si]=arguments[si];(on=Gi[Zt])===null||on===void 0||on.call.apply(on,[Gi].concat(ei)),ot[Zt].apply(ot,ei)})});var gr=y.cloneElement(lt,(0,E.Z)((0,E.Z)({},Gi),er)),fr={x:ui,y:oi},xr=je?(0,E.Z)({},je!==!0?je:{}):null;return y.createElement(y.Fragment,null,y.createElement(ue.Z,{disabled:!ln,ref:ht,onResize:Li},y.createElement(Z,{getTriggerDOMNode:Ot},gr)),qn.current&&y.createElement(oe.Provider,{value:pn},y.createElement(J,{portal:ye,ref:_n,prefixCls:Qe,popup:Ct,className:p()(it,Dn),style:wt,target:Mt,onMouseEnter:Yn,onMouseLeave:Rn,onPointerEnter:Yn,zIndex:j,open:ln,keepDom:cn,fresh:fe,onClick:Te,onPointerDownCapture:Bi,mask:Ze,motion:Wt,maskMotion:yn,onVisibleChanged:Mi,onPrepare:Ni,forceRender:gt,autoDestroy:Ye,getPopupContainer:pt,align:Qn,arrow:xr,arrowPos:fr,ready:Vn,offsetX:vi,offsetY:Ci,offsetR:li,offsetB:Ai,onAlign:wi,stretch:X,targetWidth:an/Ii,targetHeight:gi/xi})))});return be}var Tt=ke(ee.Z)},3878:function(Ut,ft){"use strict";ft.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}},28426:function(Ut,ft,R){"use strict";var E=R(59301),le=R(93314),xe=R(99571),ee=Object.defineProperty,W=Object.defineProperties,p=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,G=(y,b,F)=>b in y?ee(y,b,{enumerable:!0,configurable:!0,writable:!0,value:F}):y[b]=F,A=(y,b)=>{for(var F in b||(b={}))Y.call(b,F)&&G(y,F,b[F]);if(ue)for(var F of ue(b))l.call(b,F)&&G(y,F,b[F]);return y},m=(y,b)=>W(y,p(b));const _=({img:y,buttonProps:b={},styles:F={},customText:K,ButtonText:H,ButtonClick:L,Buttonclass:O,ButtonTwo:k,imgStyles:z,loading:J=!1,className:ne=""})=>E.createElement("section",{className:`tc animated fadeIn ${ne}`,style:A({color:"#999",margin:"100px auto",visibility:J?"hidden":"visible"},F)},E.createElement("img",{src:y||le,style:m(A({},z),{pointerEvents:"none",userSelect:"none"})}),E.createElement("p",{className:"mt20 font14"},K||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),H&&E.createElement(xe.ZP,A({className:O,onClick:L},b),H),k&&k);ft.Z=_},45677:function(Ut,ft,R){"use strict";R.d(ft,{Z:function(){return O}});var E=R(59301),le={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},xe=R(99571),ee=R(70557),W=R(75975),p=R(25399),ue=R(51257),Y=R(81722),l=R(28426),G=R(346),A=R(44203),m=R(59301),_=Object.defineProperty,y=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,K=(k,z,J)=>z in k?_(k,z,{enumerable:!0,configurable:!0,writable:!0,value:J}):k[z]=J,H=(k,z)=>{for(var J in z||(z={}))b.call(z,J)&&K(k,J,z[J]);if(y)for(var J of y(z))F.call(z,J)&&K(k,J,z[J]);return k},L=(k,z,J)=>new Promise((ne,Z)=>{var ae=Re=>{try{re(J.next(Re))}catch(M){Z(M)}},oe=Re=>{try{re(J.throw(Re))}catch(M){Z(M)}},re=Re=>Re.done?ne(Re.value):Promise.resolve(Re.value).then(ae,oe);re((J=J.apply(k,z)).next())}),O=({editOffice:k="view",data:z,issaver:J,onSaver:ne,theme:Z,type:ae,filename:oe,monacoEditor:re,className:Re,style:M,close:w,onClose:T,hasMask:I,disabledDownload:N,onImgDimensions:U,showNodata:g,recordInfo:d})=>{const[D,$]=(0,E.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[he,Se]=(0,E.useState)(""),[qe,Ue]=(0,E.useState)(),nt=window.ENV==="build"?"/react/build":"",et=location.host.startsWith("localhost")?G.Z.PROXY_SERVER:G.Z.API_SERVER,Lt=10*(1024*1024),Me=(0,E.useRef)();z!=null&&z.startsWith("/api")&&ae!=="txt"&&(z=G.Z.API_SERVER+z);const mt=q=>q.substring(q.lastIndexOf("/")+1).split(".").pop();oe&&re&&(re.filename=oe),(0,E.useEffect)(()=>{var q,Le;const Ne=(Le=(q=document.cookie)==null?void 0:q.replace(/\s/g,""))==null?void 0:Le.split(";");Ne==null||Ne.map(Qe=>{let V=Qe.split("=");V[0]==="_educoder_session"&&Se(V[1])})},[]),(0,E.useEffect)(()=>{ae==="office"&&(z.indexOf("bigfilescdn.")>-1||z.indexOf("bigfiles1")>-1?Ue({url:z,fileType:mt(z),model:z.indexOf("model=edit")?"edit":"view"}):Tt())},[ae,z]);function ke(q){return L(this,null,function*(){q.data.type==="pdfdata"&&(ne(q.data.data),window.removeEventListener("message",ke,!1)),console.log("mess---:",q.data)})}const Tt=()=>L(void 0,null,function*(){console.log("data:",z);let q=z;z.startsWith("http")||(q=location.origin+q);let Le=new URL(q).pathname.split("/").pop();const Ne=yield(0,Y.gJ)({attachment_id:Le});Ne.url=et+Ne.url,Ue(Ne)}),ye=()=>{if(z.startsWith("http")||z.startsWith("blob:")){be();return}(0,ue.Sv)(oe||"educoder",z,oe)},be=()=>{d&&(0,A.fc)({id:d==null?void 0:d.id,watch_type:1,course_id:d==null?void 0:d.course_id}),(0,ue.Nd)(oe||"educoder",decodeURIComponent(z))};return m.createElement("div",{style:H({},M||{}),className:`${I&&le.bgBlack} ${ae?le.wrp:"hide"}`},w&&m.createElement("div",{className:le.close,ref:Me},!!U&&m.createElement(p.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Me.current},m.createElement("span",{onClick:()=>{T(),U()}},m.createElement("i",{className:"icon-yulanpizhu"}))),!N&&m.createElement(p.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Me.current},m.createElement("span",{onClick:be},m.createElement("i",{className:"icon-quxiaozhiding"}))),J&&m.createElement(p.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>Me.current},m.createElement("span",{className:"",onClick:()=>{const q=document.getElementById("pdfiframe");window.addEventListener("message",ke,!1),setTimeout(()=>{q.contentWindow.postMessage("getData","*")},300)}},m.createElement("i",{className:"icon-baocun"}))),m.createElement(p.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Me.current},m.createElement("span",{className:"",onClick:()=>{T()}},m.createElement("i",{className:"icon-guanbi1"})))),m.createElement("div",{className:`${le[Re]} ${Re} ${le.monaco} ${ae==="txt"?"show":"hide"}`},ae==="txt"&&m.createElement(m.Fragment,null,m.createElement(W.ZP,H({},re)))),ae==="audio"&&m.createElement("audio",{src:`${(z==null?void 0:z.indexOf("http://"))>-1||(z==null?void 0:z.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${z}`,autoPlay:!0}),ae==="video"&&m.createElement(m.Fragment,null,(z==null?void 0:z.indexOf("http"))>-1?m.createElement("video",{controls:!0,src:`${z}`,autoPlay:!0}):m.createElement("video",{controls:!0,src:`data:video/mp4;base64,${z}`,autoPlay:!0})),ae==="office"&&qe&&m.createElement("iframe",{src:`${nt}/office.html?key=${qe.key}&url=${btoa(qe.url)}&callbackUrl=${et+(qe.callbackUrl||"")}&fileType=${qe.fileType}&title=${qe.title||""}&model=${k}&officeServer=${G.Z.ONLYOFFICE}&disabledDownload=${!!N}`}),ae==="html"&&m.createElement("iframe",{src:z+"&disposition=inline"}),ae==="pdf"&&m.createElement("iframe",{id:"pdfiframe",src:`${nt}/js/pdfview/index.html?filename=${oe||"educoder.pdf"}&url=${encodeURIComponent(z)}&disabledDownload=${!!N}&model=${k}`}),ae==="image"&&m.createElement("img",{src:`${(z==null?void 0:z.indexOf("http://"))>-1||(z==null?void 0:z.indexOf("https://"))>-1?"":"data:image/png;base64,"}${z}`}),(ae==="other"||ae==="download")&&m.createElement(m.Fragment,null,g?m.createElement(l.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:m.createElement(xe.ZP,{icon:m.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:ye,disabled:N},"\u4E0B\u8F7D")}):m.createElement(xe.ZP,{type:"primary",size:"middle",onClick:ye,disabled:N},m.createElement(ee.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},76902:function(Ut,ft,R){"use strict";R.d(ft,{z:function(){return Z},Z:function(){return ae}});var E=R(59301),le=R(8944),xe=R(81428),ee=R(64018),W=R(81168),p=R(346),ue=R(51257),Y=R(15342),l=R(1012),G=R(45677),A=R(59301),_=({html:oe})=>{const re=(0,E.useRef)(null),Re=(0,E.useRef)(null),M=`.markdown-body p {
|
|
margin: 0 0 16px 0 !important;
|
|
line-height: 28px;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
li {
|
|
list-style-type: none
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
dl {
|
|
margin-bottom: 0px;
|
|
}
|
|
|
|
.markdown-body {
|
|
-ms-text-size-adjust: 100%;
|
|
-webkit-text-size-adjust: 100%;
|
|
color: #333;
|
|
overflow: hidden;
|
|
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
|
|
word-break: break-word;
|
|
font-size: 16px;
|
|
line-height: 1.6;
|
|
white-space: normal;
|
|
word-wrap: break-word;
|
|
position: relative;
|
|
}
|
|
|
|
.markdown-body ul>li {
|
|
list-style-type: disc;
|
|
}
|
|
|
|
.markdown-body ol>li {
|
|
list-style-type: decimal;
|
|
}
|
|
|
|
.markdown-body a {
|
|
background: transparent;
|
|
}
|
|
|
|
.markdown-body a:active,
|
|
.markdown-body a:hover {
|
|
outline: 0;
|
|
}
|
|
|
|
.markdown-body strong {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 2em;
|
|
margin: 0.67em 0;
|
|
}
|
|
|
|
.markdown-body img {
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
-moz-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
height: 0;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
overflow: auto;
|
|
}
|
|
|
|
.markdown-body code,
|
|
.markdown-body kbd,
|
|
.markdown-body pre {
|
|
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body input {
|
|
color: inherit;
|
|
font: inherit;
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body html input[disabled] {
|
|
cursor: default;
|
|
}
|
|
|
|
.markdown-body input {
|
|
line-height: normal;
|
|
}
|
|
|
|
.markdown-body input[type="checkbox"] {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
border-collapse: collapse;
|
|
border-spacing: 0;
|
|
}
|
|
|
|
.markdown-body td,
|
|
.markdown-body th {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body * {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body input {
|
|
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
|
}
|
|
|
|
.markdown-body a {
|
|
color: #4183c4;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body a:hover,
|
|
.markdown-body a:active {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
height: 0;
|
|
margin: 15px 0;
|
|
overflow: hidden;
|
|
background: transparent;
|
|
border: 0;
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body hr:before {
|
|
display: table;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body hr:after {
|
|
display: table;
|
|
clear: both;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
margin-top: 15px;
|
|
margin-bottom: 15px;
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 30px;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
font-size: 21px;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 16px;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 14px;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 11px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding: 0;
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
ul.linenums,
|
|
ol.linenums {
|
|
padding: 16px 0 0 56px !important;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding-left: 2em;
|
|
}
|
|
|
|
|
|
.markdown-body ol ol,
|
|
.markdown-body ul ol {
|
|
list-style-type: lower-roman;
|
|
}
|
|
|
|
.markdown-body ul ul ol,
|
|
.markdown-body ul ol ol,
|
|
.markdown-body ol ul ol,
|
|
.markdown-body ol ol ol {
|
|
list-style-type: lower-alpha;
|
|
}
|
|
|
|
.markdown-body dd {
|
|
margin-left: 0;
|
|
}
|
|
|
|
.markdown-body code {
|
|
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
}
|
|
|
|
.markdown-body .octicon {
|
|
font: normal normal 16px octicons-anchor;
|
|
line-height: 1;
|
|
display: inline-block;
|
|
text-decoration: none;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.markdown-body .octicon-link:before {
|
|
content: '\f05c';
|
|
}
|
|
|
|
.markdown-body>*:first-child {
|
|
margin-top: 0 !important;
|
|
}
|
|
|
|
.markdown-body>*:last-child {
|
|
margin-bottom: 0 !important;
|
|
}
|
|
|
|
.markdown-body .anchor {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
display: block;
|
|
padding-right: 6px;
|
|
padding-left: 30px;
|
|
margin-left: -30px;
|
|
}
|
|
|
|
.markdown-body .anchor:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
position: relative;
|
|
margin-top: 1em;
|
|
margin-bottom: 16px;
|
|
font-weight: bold;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.markdown-body h1 .octicon-link,
|
|
.markdown-body h2 .octicon-link,
|
|
.markdown-body h3 .octicon-link,
|
|
.markdown-body h4 .octicon-link,
|
|
.markdown-body h5 .octicon-link,
|
|
.markdown-body h6 .octicon-link {
|
|
display: none;
|
|
color: #000;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor,
|
|
.markdown-body h2:hover .anchor,
|
|
.markdown-body h3:hover .anchor,
|
|
.markdown-body h4:hover .anchor,
|
|
.markdown-body h5:hover .anchor,
|
|
.markdown-body h6:hover .anchor {
|
|
padding-left: 8px;
|
|
margin-left: -30px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor .octicon-link,
|
|
.markdown-body h2:hover .anchor .octicon-link,
|
|
.markdown-body h3:hover .anchor .octicon-link,
|
|
.markdown-body h4:hover .anchor .octicon-link,
|
|
.markdown-body h5:hover .anchor .octicon-link,
|
|
.markdown-body h6:hover .anchor .octicon-link {
|
|
display: inline-block;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 2.25em;
|
|
line-height: 1.2;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h1 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 1.75em;
|
|
line-height: 1.225;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h2 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 1.5em;
|
|
line-height: 1.43;
|
|
}
|
|
|
|
.markdown-body h3 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 1.25em;
|
|
}
|
|
|
|
.markdown-body h4 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body h5 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 1em;
|
|
color: #777;
|
|
}
|
|
|
|
.markdown-body h6 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body ul ul,
|
|
.markdown-body ul ol,
|
|
.markdown-body ol ol,
|
|
.markdown-body ol ul {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body li>p {
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.markdown-body dl {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body dl dt {
|
|
padding: 0;
|
|
margin-top: 16px;
|
|
font-size: 1em;
|
|
font-style: italic;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body dl dd {
|
|
padding: 0 16px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
padding: 0 15px;
|
|
color: #777;
|
|
border-left: 4px solid #ddd;
|
|
}
|
|
|
|
.markdown-body blockquote> :first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.markdown-body blockquote> :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
display: block;
|
|
width: 100%;
|
|
overflow: auto;
|
|
word-break: normal;
|
|
word-break: keep-all;
|
|
}
|
|
|
|
.markdown-body table th {
|
|
font-weight: bold;
|
|
text-align: revert;
|
|
}
|
|
|
|
.markdown-body table th,
|
|
.markdown-body table td {
|
|
padding: 6px 13px;
|
|
border: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body table tr {
|
|
background-color: #fff;
|
|
border-top: 1px solid #ccc;
|
|
}
|
|
|
|
.markdown-body table tr:nth-child(2n) {
|
|
background-color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body img {
|
|
max-width: 100%;
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body code {
|
|
padding: 0;
|
|
padding-top: 0.2em;
|
|
padding-bottom: 0.2em;
|
|
margin: 0;
|
|
font-size: 85%;
|
|
background-color: rgba(0, 0, 0, 0.04);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body code:has(.katex) {
|
|
background-color: transparent;
|
|
}
|
|
|
|
.markdown-body code:before,
|
|
.markdown-body code:after {
|
|
letter-spacing: -0.2em;
|
|
content: "\\00a0";
|
|
}
|
|
|
|
.markdown-body pre>code {
|
|
padding: 0;
|
|
margin: 0;
|
|
font-size: 100%;
|
|
word-break: normal;
|
|
white-space: pre;
|
|
background: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body .highlight {
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body .highlight pre,
|
|
.markdown-body pre {
|
|
padding: 16px;
|
|
overflow: auto;
|
|
font-size: 85%;
|
|
line-height: 1.45;
|
|
background-color: #f7f7f7;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body .highlight pre {
|
|
margin-bottom: 0;
|
|
word-break: normal;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
word-wrap: normal;
|
|
}
|
|
|
|
.markdown-body pre code {
|
|
display: inline;
|
|
max-width: initial;
|
|
padding: 0;
|
|
margin: 0;
|
|
overflow: initial;
|
|
line-height: inherit;
|
|
word-wrap: normal;
|
|
background-color: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body pre code:before,
|
|
.markdown-body pre code:after {
|
|
content: normal;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font-size: 11px;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .pl-c {
|
|
color: #969896;
|
|
}
|
|
|
|
.markdown-body .pl-c1,
|
|
.markdown-body .pl-mdh,
|
|
.markdown-body .pl-mm,
|
|
.markdown-body .pl-mp,
|
|
.markdown-body .pl-mr,
|
|
.markdown-body .pl-s1 .pl-v,
|
|
.markdown-body .pl-s3,
|
|
.markdown-body .pl-sc,
|
|
.markdown-body .pl-sv {
|
|
color: #0086b3;
|
|
}
|
|
|
|
.markdown-body .pl-e,
|
|
.markdown-body .pl-en {
|
|
color: #795da3;
|
|
}
|
|
|
|
.markdown-body .pl-s1 .pl-s2,
|
|
.markdown-body .pl-smi,
|
|
.markdown-body .pl-smp,
|
|
.markdown-body .pl-stj,
|
|
.markdown-body .pl-vo,
|
|
.markdown-body .pl-vpf {
|
|
color: #333;
|
|
}
|
|
|
|
.markdown-body .pl-ent {
|
|
color: #63a35c;
|
|
}
|
|
|
|
.markdown-body .pl-k,
|
|
.markdown-body .pl-s,
|
|
.markdown-body .pl-st {
|
|
color: #a71d5d;
|
|
}
|
|
|
|
.markdown-body .pl-pds,
|
|
.markdown-body .pl-s1,
|
|
.markdown-body .pl-s1 .pl-pse .pl-s2,
|
|
.markdown-body .pl-sr,
|
|
.markdown-body .pl-sr .pl-cce,
|
|
.markdown-body .pl-sr .pl-sra,
|
|
.markdown-body .pl-sr .pl-sre,
|
|
.markdown-body .pl-src {
|
|
color: #df5000;
|
|
}
|
|
|
|
.markdown-body .pl-mo,
|
|
.markdown-body .pl-v {
|
|
color: #1d3e81;
|
|
}
|
|
|
|
.markdown-body .pl-id {
|
|
color: #b52a1d;
|
|
}
|
|
|
|
.markdown-body .pl-ii {
|
|
background-color: #b52a1d;
|
|
color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body .pl-sr .pl-cce {
|
|
color: #63a35c;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-ml {
|
|
color: #693a17;
|
|
}
|
|
|
|
.markdown-body .pl-mh,
|
|
.markdown-body .pl-mh .pl-en,
|
|
.markdown-body .pl-ms {
|
|
color: #1d3e81;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-mq {
|
|
color: #008080;
|
|
}
|
|
|
|
.markdown-body .pl-mi {
|
|
color: #333;
|
|
font-style: italic;
|
|
}
|
|
|
|
.markdown-body .pl-mb {
|
|
color: #333;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-md,
|
|
.markdown-body .pl-mdhf {
|
|
background-color: #ffecec;
|
|
color: #bd2c00;
|
|
}
|
|
|
|
.markdown-body .pl-mdht,
|
|
.markdown-body .pl-mi1 {
|
|
background-color: #eaffea;
|
|
color: #55a532;
|
|
}
|
|
|
|
.markdown-body .pl-mdr {
|
|
color: #795da3;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .task-list-item {
|
|
list-style-type: none;
|
|
}
|
|
|
|
.markdown-body .task-list-item+.task-list-item {
|
|
margin-top: 3px;
|
|
}
|
|
|
|
.markdown-body .task-list-item input {
|
|
float: left;
|
|
margin: 0.3em 0 0.25em -1.6em;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body :checked+.radio-label {
|
|
z-index: 1;
|
|
position: relative;
|
|
border-color: #4183c4;
|
|
}
|
|
|
|
|
|
/*! Pretty printing styles. Used with prettify.js. */
|
|
/* SPAN elements with the classes below are added by prettyprint. */
|
|
.pln {
|
|
color: #000
|
|
}
|
|
|
|
/* plain text */
|
|
|
|
@media screen {
|
|
.str {
|
|
color: #080
|
|
}
|
|
|
|
/* string content */
|
|
.kwd {
|
|
color: #008
|
|
}
|
|
|
|
/* a keyword */
|
|
.com {
|
|
color: #800
|
|
}
|
|
|
|
/* a comment */
|
|
.typ {
|
|
color: #606
|
|
}
|
|
|
|
/* a type name */
|
|
.lit {
|
|
color: #066
|
|
}
|
|
|
|
/* a literal value */
|
|
/* punctuation, lisp open bracket, lisp close bracket */
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #660
|
|
}
|
|
|
|
.tag {
|
|
color: #008
|
|
}
|
|
|
|
/* a markup tag name */
|
|
.atn {
|
|
color: #606
|
|
}
|
|
|
|
/* a markup attribute name */
|
|
.atv {
|
|
color: #080
|
|
}
|
|
|
|
/* a markup attribute value */
|
|
.dec,
|
|
.var {
|
|
color: #606
|
|
}
|
|
|
|
/* a declaration; a variable name */
|
|
.fun {
|
|
color: red
|
|
}
|
|
|
|
/* a function name */
|
|
}
|
|
|
|
/* Use higher contrast and text-weight for printable form. */
|
|
@media print,
|
|
projection {
|
|
.str {
|
|
color: #060
|
|
}
|
|
|
|
.kwd {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.com {
|
|
color: #600;
|
|
font-style: italic
|
|
}
|
|
|
|
.typ {
|
|
color: #404;
|
|
font-weight: bold
|
|
}
|
|
|
|
.lit {
|
|
color: #044
|
|
}
|
|
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #440
|
|
}
|
|
|
|
.tag {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.atn {
|
|
color: #404
|
|
}
|
|
|
|
.atv {
|
|
color: #060
|
|
}
|
|
}
|
|
|
|
/* Put a border around prettyprinted code snippets. */
|
|
pre.prettyprint {
|
|
padding: 2px;
|
|
/* border: 1px solid #888 */
|
|
}
|
|
|
|
/* Specify class=linenums on a pre to get line numbering */
|
|
ol.linenums {
|
|
margin-top: 0;
|
|
margin-bottom: 0
|
|
}
|
|
|
|
/* IE indents via margin-left */
|
|
li.L0,
|
|
li.L1,
|
|
li.L2,
|
|
li.L3,
|
|
li.L5,
|
|
li.L6,
|
|
li.L7,
|
|
li.L8 {
|
|
list-style-type: none
|
|
}
|
|
|
|
/* Alternate shading for lines */
|
|
li.L1,
|
|
li.L3,
|
|
li.L5,
|
|
li.L7,
|
|
li.L9 {
|
|
background: #eee
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}`;return(0,E.useEffect)(()=>{const w=re.current.attachShadow({mode:"open"});Re.current=document.createElement("div"),Re.current.className="markdown-body",Re.current.innerHTML=oe,w.appendChild(Re.current);const T=document.createElement("style");return T.textContent=M,w.appendChild(T),()=>{w.innerHTML=""}},[]),(0,E.useEffect)(()=>{Re.current&&(Re.current.innerHTML=oe)},[oe]),A.createElement("div",{ref:re})};function y(oe){const re=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],Re=new RegExp(`\\b(${re.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return oe.replace(Re,"").trim()}var b=Object.defineProperty,F=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,L=(oe,re,Re)=>re in oe?b(oe,re,{enumerable:!0,configurable:!0,writable:!0,value:Re}):oe[re]=Re,O=(oe,re)=>{for(var Re in re||(re={}))K.call(re,Re)&&L(oe,Re,re[Re]);if(F)for(var Re of F(re))H.call(re,Re)&&L(oe,Re,re[Re]);return oe};const k="@\u2581\u2581@",z="@\u2581@",J=/<pre[^>]*>/g;function ne(oe){let re=document.createElement("div");return re.innerHTML=oe,re.childNodes.length===0?"":re.childNodes[0].nodeValue}const Z=(oe,re)=>{oe=oe||"";const Re=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,M=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,w=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,T=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return re?oe.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(Re,(I,N,U,g,d,D,$)=>{const he=N||g||D,Se=U||d||$||"?";return p.Z.API_SERVER+"/api/attachments/"+he+Se+"&t="+(0,ue.Jn)(he,Date.now())+(I.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(oe=oe.replace(T,(I,N,U,g,d,D,$)=>{const he=N||g||D,Se=U||d||$||"?";return p.Z.API_SERVER+"/attachments/download/"+he+Se+"&t="+(0,ue.Jn)(he,Date.now())+(I.indexOf(")")>-1?")":"&")}).replace(Re,(I,N,U,g,d,D,$)=>{const he=N||g||D,Se=U||d||$||"?";return p.Z.API_SERVER+"/api/attachments/"+he+Se+"&t="+(0,ue.Jn)(he,Date.now())+(I.indexOf(")")>-1?")":"&")}).replace(M,(I,N,U,g,d)=>{const D=N||g,$=U||d||"";return'"'+p.Z.API_SERVER+"/api/attachments/"+D+$+D+$+"&t="+(0,ue.Jn)(D,Date.now())}).replace(w,(I,N,U,g,d)=>{const D=N||g,$=U||d||"";return"("+p.Z.API_SERVER+"/files/uploads/"+D+$+D+$+"&t="+(0,ue.Jn)(D,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`),oe)};var ae=({value:oe="",className:re,showTextOnly:Re,showLines:M,style:w={},stylesPrev:T={},highlightKeywords:I,showProgramFill:N,isProgramFill:U,disabledFill:g=!1,programFillValue:d,onFillChange:D=Se=>{},onFillBlur:$=()=>{},onFillFocus:he=()=>{}})=>{let Se=y(String(oe||""));const[qe,Ue]=(0,E.useState)(""),[nt,et]=(0,E.useState)("office"),[Pe,Lt]=(0,E.useState)([]),Me=(0,E.useRef)("a"+(0,l.Z)()),mt={},ke=de=>/<style[\s\S]*?>/i.test(de||""),Tt=(de,ze,rt)=>{const We=document.createElement(de===z?"input":"textarea");We.style.width="100%",We.style.height=de===z?"40px":"151px",We.rows=5,We.spellcheck=!1,We.name="edu-program-fill",We.placeholder="\u8BF7\u8F93\u5165",We.dataset.id=ze;const ut=Object.keys(mt).length;return mt[ut]=We,`<span class="edu-program-fill-wrap ${de===z?"":"show"}" style="width:${de===z?"600px":"100%"}" title=${rt||""}><span>${We.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function ye(de){return de=de.replace(/!\[.*?\]\(.*?\)/g,""),de=de.replace(/\[.*?\]\(.*?\)/g,""),de=de.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),de=de.replace(/<embed.*?>/g,""),de=de.replace(/<img.*?>/g,""),de=de.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),de=de.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),de=de.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),de=de.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),de}const be=de=>!Re&&ke(Se)?de:de.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(ze,rt){let We=rt.replace(/(\n|\r)/g,"").split("}"),ut=[];return We.map(Ve=>{Ve!=""&&ut.push(`.${Me.current} ${Ve}`)}),`<style>${ut.join("}")}</style>`}),q=(0,E.useMemo)(()=>{try{const We=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,ut=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ve=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,At=/\(\/attachments\/download\//g;Se=Se.replace(At,"("+p.Z.API_SERVER+"/attachments/download/").replace(We,"("+p.Z.API_SERVER+"/api/attachments/").replace(ut,'"'+p.Z.API_SERVER+"/api/attachments/").replace(Ve,'"'+p.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(We){}if(N){let We=-1;return Se=Se.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(ut,Ve,At){var vt;return++We,Tt(ut,We,(vt=d==null?void 0:d[We])==null?void 0:vt.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${be(Se||"")}</pre>`}let de=be(Se);de=(0,xe.ZP)(de);const ze=(0,xe.ez)();Se.match(/\[TOC\]/)&&(de=de.replace("<p>[TOC]</p>",(0,xe.Qv)()),(0,xe.Iy)()),de=de.replace(/(__special_katext_id_\d+__)/g,(We,ut)=>{const{type:Ve,expression:At}=ze[ut];return(0,Y.renderToString)(ne(At)||"",{displayMode:Ve==="block",throwOnError:!1,output:"html"})}),de=de.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,xe.AL)();const rt=document.createElement("div");if(rt.innerHTML=de,Re)return rt.innerText;if(I){const We=I.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return V(rt,We),rt.innerHTML}return setTimeout(()=>Fe(),500),rt.innerHTML},[Se,I]);(0,E.useEffect)(()=>{se.current&&se.current.querySelectorAll(["input","textarea"]).forEach(ze=>{ze.oninput=Le,ze.onblur=Ne,ze.onfocus=Qe})},[Pe]),(0,E.useEffect)(()=>{var de,ze,rt,We,ut;if(d!=null&&d.length)try{const Ve=se.current.querySelectorAll(".edu-program-fill-score"),At=se.current.querySelectorAll('[name="edu-program-fill"]');for(const[vt,ge]of At.entries())ge.value=((de=d==null?void 0:d[vt])==null?void 0:de.value)||"",((ze=d==null?void 0:d[vt])==null?void 0:ze.type)==="warning"?ge.className="program-fill-warning":((rt=d==null?void 0:d[vt])==null?void 0:rt.type)==="success"?ge.className="program-fill-success":ge.className="";for(const[vt,ge]of Ve.entries())ge.innerHTML=(We=d==null?void 0:d[vt])!=null&&We.score?`${(ut=d==null?void 0:d[vt])==null?void 0:ut.score}\u5206`:"";Lt(d)}catch(Ve){console.log(Ve,"error")}},[d]);const Le=de=>{Pe[de.target.dataset.id]=Pe[de.target.dataset.id]||{},Pe[de.target.dataset.id].value=de.target.value,Lt([...Pe]),D(Pe,de.target.dataset.id)},Ne=de=>{Pe[de.target.dataset.id]=Pe[de.target.dataset.id]||{},Pe[de.target.dataset.id].value=de.target.value,Lt([...Pe]),$(Pe,de.target.dataset.id)},Qe=de=>{Pe[de.target.dataset.id]=Pe[de.target.dataset.id]||{},Pe[de.target.dataset.id].value=de.target.value,Lt([...Pe]),he(Pe,de.target.dataset.id)};function V(de,ze){return de.childNodes.forEach(rt=>{var We;if(rt.childNodes.length>0)V(rt,ze);else if(rt.nodeName!=="IMG")if(rt.innerHTML)rt.innerHTML=(We=rt.innerHTML)==null?void 0:We.replace(new RegExp(ze,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const ut=document.createElement("span");ut.innerHTML=rt.textContent.replace(new RegExp(ze,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),rt.replaceWith(ut)}})}const se=(0,E.useRef)();xe.jb.WebkitLineClamp=M,M&&(w=O(O({},w),xe.jb));function Ee(de){let ze=de.target;if(ze.tagName.toUpperCase()==="A"){let rt=ze.getAttribute("href");if(rt.indexOf("office")>-1)de.preventDefault(),Ue(rt),et("office");else if(rt.indexOf("application/pdf")>-1)de.preventDefault(),Ue(rt),et("pdf");else if(rt.indexOf("text/html")>-1)de.preventDefault(),Ue(rt),et("html");else if(rt.startsWith("#")){de.preventDefault();let We=document.getElementById(rt.replace("#",""));We&&We.scrollIntoView(!0)}}}const Fe=()=>{var de;const ze=(de=se.current)==null?void 0:de.querySelectorAll("video");ze==null||ze.forEach(rt=>{if(rt.oncontextmenu=()=>!1,rt.src.indexOf(".m3u8")>-1&&!rt.canPlayType("application/vnd.apple.mpegurl")){if(W.ZP.isSupported()){var We=new W.ZP;We.loadSource(rt.src),We.attachMedia(rt)}}})};return(0,E.useEffect)(()=>{if(se.current&&q&&q.match(J)&&window.PR.prettyPrint(),se.current)return se.current.addEventListener("click",Ee),()=>{var de;(de=se.current)==null||de.removeEventListener("click",Ee),(0,xe.AL)(),(0,xe.Iy)()}},[q,se.current,Ee]),(0,E.useEffect)(()=>{var de;const ze=rt=>{rt.preventDefault(),rt.clipboardData.setData("text",window.getSelection().toString())};return(de=se.current)==null||de.addEventListener("copy",ze),()=>{var rt;(rt=se.current)==null||rt.removeEventListener("copy",ze)}},[se.current]),E.createElement(E.Fragment,null,Re&&E.createElement("div",{ref:se},q),!Re&&!ke(q)&&E.createElement("div",{ref:se,style:O({},w),className:`${re||""} ${g?"disabled-fill":""} markdown-body ${Me.current}`,dangerouslySetInnerHTML:{__html:q}}),!Re&&ke(q)&&E.createElement(_,{html:q}),E.createElement(G.Z,{close:!0,data:qe,type:qe!=null&&qe.length?nt:"",style:O({},T),onClose:()=>Ue("")}))}},75975:function(Ut,ft,R){"use strict";R.d(ft,{SV:function(){return Lt},ZP:function(){return Pe}});var E=R(59301),le=R(76374);const xe={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},ee={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},W={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},p={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},ue={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
|
|
`)}]};var Y=R(53184),l=R.n(Y),G=(Me,mt,ke)=>new Promise((Tt,ye)=>{var be=Ne=>{try{Le(ke.next(Ne))}catch(Qe){ye(Qe)}},q=Ne=>{try{Le(ke.throw(Ne))}catch(Qe){ye(Qe)}},Le=Ne=>Ne.done?Tt(Ne.value):Promise.resolve(Ne.value).then(be,q);Le((ke=ke.apply(Me,mt)).next())});const A={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},m=(Me,mt,ke,Tt)=>{const ye=mt.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:ke.lineNumber,endColumn:ke.column});return Array.from(new Set(ye.match(/\b\w{2,}\b/g)||[])).map(q=>({label:q,kind:Me.languages.CompletionItemKind.Text,insertText:q,range:Tt}))},_=(Me,mt,ke,Tt)=>{Me.languages.registerCompletionItemProvider(mt,{provideCompletionItems(ye,be){const q=ye.getWordUntilPosition(be),Le={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:q.startColumn,endColumn:q.endColumn},Ne=ye.getLineContent(be.lineNumber).substring(q.startColumn-2,q.endColumn);return{suggestions:[...m(Me,ye,be,Le),...ke.map(V=>({label:V,kind:Me.languages.CompletionItemKind.Keyword,documentation:V,insertText:V,insertTextRules:Me.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le})),...Tt.map(V=>({label:V.label,kind:Me.languages.CompletionItemKind.Snippet,documentation:V.content,insertText:Ne.startsWith("#")?V.content.replace(/#/,""):V.content,insertTextRules:Me.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}))]}}})};var y=Me=>{A.languages.forEach(mt=>{Me.languages.registerDocumentFormattingEditProvider(mt,{provideDocumentFormattingEdits(ke){return G(this,null,function*(){const Tt=l()(ke.getValue(),{indent_size:2,indent_char:" ",max_preserve_newlines:2,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:0,indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:ke.getFullModelRange(),text:Tt}]})}})}),_(Me,"java",ee.keywords,ee.quickKey),_(Me,"cpp",W.keywords,W.quickKey),_(Me,"c",xe.keywords,[]),_(Me,"python",p.keywords,p.quickKey),_(Me,"scala",ue.keywords,ue.quickKey)};const b="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var F=Object.defineProperty,K=(Me,mt,ke)=>mt in Me?F(Me,mt,{enumerable:!0,configurable:!0,writable:!0,value:ke}):Me[mt]=ke,H=(Me,mt,ke)=>K(Me,typeof mt!="symbol"?mt+"":mt,ke);const L=class Jo{constructor(mt,ke,Tt){this.placeholder=mt,this.editor=ke,this.monaco=Tt,ke.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Jo.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};H(L,"ID","editor.widget.placeholderHint");var k=L,z=R(96236),J=R(6767),ne=R(25399),Z=R(89392),ae=R(49535),oe=R(56102),re=Object.defineProperty,Re=Object.defineProperties,M=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,N=(Me,mt,ke)=>mt in Me?re(Me,mt,{enumerable:!0,configurable:!0,writable:!0,value:ke}):Me[mt]=ke,U=(Me,mt)=>{for(var ke in mt||(mt={}))T.call(mt,ke)&&N(Me,ke,mt[ke]);if(w)for(var ke of w(mt))I.call(mt,ke)&&N(Me,ke,mt[ke]);return Me},g=(Me,mt)=>Re(Me,M(mt)),d=(Me,mt)=>{var ke={};for(var Tt in Me)T.call(Me,Tt)&&mt.indexOf(Tt)<0&&(ke[Tt]=Me[Tt]);if(Me!=null&&w)for(var Tt of w(Me))mt.indexOf(Tt)<0&&I.call(Me,Tt)&&(ke[Tt]=Me[Tt]);return ke},D=(Me,mt,ke)=>new Promise((Tt,ye)=>{var be=Ne=>{try{Le(ke.next(Ne))}catch(Qe){ye(Qe)}},q=Ne=>{try{Le(ke.throw(Ne))}catch(Qe){ye(Qe)}},Le=Ne=>Ne.done?Tt(Ne.value):Promise.resolve(Ne.value).then(be,q);Le((ke=ke.apply(Me,mt)).next())});function $(Me){return/^\d+$/.test(Me)?`${Me}px`:Me}function he(){}let Se=!1;const qe={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function Ue(Me=[]){let mt=Me;if(Array.isArray(Me)){for(let ke=0;ke<Me.length;ke++){let Tt=qe[Me[ke]];if(Tt)return Tt}return mt[0]}return qe[mt]||mt}let nt=null;const et=()=>D(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(Me){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",Me)}});var Pe=Me=>{var mt=Me,{width:ke="100%",height:Tt="100%",value:ye,language:be="javascript",style:q={},options:Le={},overrideServices:Ne={},theme:Qe="vs-dark",onEditBlur:V,isCopy:se=!1,onSave:Ee,autoHeight:Fe=!1,forbidCopy:de=!1,onChange:ze=he,editorDidMount:rt=he,onFocus:We=he,onBreakPoint:ut=he,breakPointValue:Ve=[],filename:At="educoder.txt",errorLine:vt,errorContent:ge="",highlightLine:Ae,openBreakPoint:Ze=!1,placeholder:tt="",showMiniMap:Ke=!0}=mt,pt=d(mt,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const gt=(0,E.useRef)(),He=(0,E.useRef)({}),bt=(0,E.useRef)(),Ct=(0,E.useRef)(),it=(0,E.useRef)([]),wt=(0,E.useRef)(!1),_e=(0,E.useRef)(),me=(0,E.useRef)(),pe=(0,E.useRef)(!1),[C,j]=(0,E.useState)(!1);function X(){let ot;return gt.current&&(ot=new le.Z(Ye=>{for(let yt of Ye)(yt.target.offsetHeight>0||yt.target.offsetWidth>0)&&He.current.instance.layout()}),ot.observe(gt.current)),ot}function te(){J.ZP.warning({content:decodeURIComponent(b),key:"monaco-editor-tip"})}const fe=()=>{let ot=He.current.instance;if(ye!=null&&ot&&C){const Ye=ot.getModel();Ye&&ye!==Ye.getValue()&&(Se=!0,Ye.setValue(ye),ot.layout(),Se=!1)}};(0,E.useEffect)(()=>{const ot=ae.Z.subscribe("formatDocument",Ye=>{var yt;let Pt=He.current.instance;(yt=Pt==null?void 0:Pt.getAction)==null||yt.call(Pt,"editor.action.formatDocument").run()});return window.updateMonacoValue=Ye=>{ze(Ye)},ot},[]),(0,E.useEffect)(()=>{var ot;let Ye=He.current.instance;Ct.current&&clearTimeout(Ct.current),Ct.current=setTimeout(()=>{fe()},500),ye&&(ye!=null&&ye.length)&&((ot=Ye==null?void 0:Ye.updateOptions)==null||ot.call(Ye,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(ye.split(/\r\n|\r|\n/g).length))+3,5)}))},[ye,C,He.current]),(0,E.useEffect)(()=>{if(vt&&He.current&&He.current.instance){let Ye=He.current.instance;Ye.changeViewZones(function(yt){var Pt=document.createElement("div");Pt.style.padding="10px 20px",Pt.style.width="calc(100% - 20px)",Pt.className="my-error-line-wrp",Pt.innerHTML=ge,yt.addZone({afterLineNumber:vt||11,heightInLines:3,domNode:Pt})});var ot={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Ye.addOverlayWidget(ot),Ye.revealPositionInCenter({lineNumber:20,column:1})}},[vt,He.current,C]);const ve=(ot="",Ye)=>{if(!ot||ot.trim()==="")return!0;const Pt=He.current.instance.getModel().getLineTokens(Ye);let Ht=!1;for(let un=0;un<2;un++)Pt.getStandardTokenType(un)===1&&(Ht=!0);return Ht};(0,E.useEffect)(()=>{var ot;const Ye=(ot=He.current)==null?void 0:ot.instance;if(Ye&&C&&de){const yt=Ye.onDidBlurEditorWidget(()=>{pe.current=!1}),Pt=Ye.onDidFocusEditorText(()=>{pe.current=!0});return()=>{yt.dispose(),Pt.dispose()}}},[He.current,C,de]),(0,E.useEffect)(()=>{var ot;if((ot=He.current)!=null&&ot.instance&&C&&Ze){let Ye=He.current.instance,yt=Ye.getModel();if(!yt)return;(()=>{var Kt;let _n=[],vn=[];const jt=yt.getAllDecorations();for(let we of jt)we.options.className==="highlighted-line"&&(_n.push((Kt=we==null?void 0:we.range)==null?void 0:Kt.startLineNumber),vn.push(we==null?void 0:we.id));if(Ae===_n[0])return;yt.deltaDecorations(vn,[]);const Mt=yt.getLineCount();Ae&&Ae<=Mt&&(Ye.deltaDecorations([],[{range:new nt.Range(Ae,1,Ae,yt.getLineMaxColumn(Ae)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ye.revealLineInCenter(Ae))})();const Ht=(Kt=!1)=>{var _n;let vn=[],jt=[];const Mt=yt.getAllDecorations();for(let we of Mt)we.options.linesDecorationsClassName==="breakpoints-select"&&(vn.push((_n=we==null?void 0:we.range)==null?void 0:_n.startLineNumber),jt.push(we==null?void 0:we.id));if(Kt)return{lines:vn,ids:jt};ut(vn)},un=Kt=>D(void 0,null,function*(){let _n={range:new nt.Range(Kt,1,Kt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield yt.deltaDecorations([],[_n]),Ht()}),Bn=Kt=>D(void 0,null,function*(){let _n=[];const vn=Ye.getLineDecorations(Kt);for(let jt of vn)jt.options.linesDecorationsClassName==="breakpoints-select"&&_n.push(jt.id);yield yt.deltaDecorations(_n,[]),Ht()}),fn=Kt=>{let _n=Ye.getLineDecorations(Kt);for(let vn of _n)if(vn.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,Z.isEqual)(Ve,Ht(!0).lines)){yt.deltaDecorations(Ht(!0).ids,[]);const Kt=Ve.map(_n=>({range:new nt.Range(_n,1,_n,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));yt.deltaDecorations([],Kt)}const pn=Ye.onDidChangeModelContent(Kt=>{let _n=Ye.getPosition();if(_n){let vn=_n.lineNumber;clearTimeout(me.current),me.current=setTimeout(()=>{ve(yt.getLineContent(vn),vn)?Bn(vn):fn(vn)?(Bn(vn),un(vn)):Ht()},100)}}),Sn=Ye.onMouseDown(Kt=>{var _n,vn,jt;if(Kt.target.detail&&((jt=(vn=(_n=Kt.target)==null?void 0:_n.element)==null?void 0:vn.className)!=null&&jt.includes("line-numbers"))){let Mt=Kt.target.position.lineNumber;if(ve(yt.getLineContent(Mt),Mt))return;fn(Mt)?Bn(Mt):un(Mt)}}),tn=Kt=>{let _n={range:new nt.Range(Kt,1,Kt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};it.current=Ye.deltaDecorations(it.current,[_n])},On=()=>{it.current=Ye.deltaDecorations(it.current,[])},Tn=Ye.onMouseMove(Kt=>{var _n,vn,jt;if(On(),Kt.target.detail&&((jt=(vn=(_n=Kt.target)==null?void 0:_n.element)==null?void 0:vn.className)!=null&&jt.includes("line-numbers"))){let Mt=Kt.target.position.lineNumber;if(ve(yt.getLineContent(Mt),Mt))return;tn(Mt)}}),ai=Ye.onMouseLeave(()=>{On()});return()=>{pn.dispose(),Sn.dispose(),Tn.dispose(),ai.dispose()}}},[He.current,C,Ve,Ae,Ze,be]),(0,E.useEffect)(()=>{var ot;(ot=He.current)!=null&&ot.instance&&Ze&&He.current.instance.setPosition({lineNumber:0,column:0})},[Ae]);function Te(){let ot=He.current.instance;if(ot){const Ye=ot.getSelection(),yt=He.current.pastePos||{},Pt=new nt.Range(yt.startLineNumber||Ye.endLineNumber,yt.startColumn||Ye.endColumn,yt.endLineNumber||Ye.endLineNumber,yt.endColumn||Ye.endColumn);setTimeout(()=>{ot.executeEdits("",[{range:Pt,text:""}])},300)}}function Ie(ot){(window.navigator.platform.match("Mac")?ot.metaKey:ot.ctrlKey)&&ot.keyCode==83&&(ot.preventDefault(),Ee())}const je=()=>{if(Fe&&He.current.instance){const ot=He.current.instance.getContentHeight();kt(ot<Tt?Tt:ot)}else kt(Tt)};function _t(ot){var Ye=document.createEvent("MouseEvents");Ye.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),ot.dispatchEvent(Ye)}const Dt=ot=>{if(!pe.current)return;const{keyCode:Ye,ctrlKey:yt,metaKey:Pt,target:Ht,type:un}=ot;return(un==="paste"||(Ye===67||Ye===86)&&(Pt||yt))&&Ht.nodeName==="TEXTAREA"&&(te(),ot.preventDefault()),!1};function dt(ot,Ye){var yt=window.URL||window.webkitURL||window,Pt=new Blob([Ye]),Ht=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ht.href=yt.createObjectURL(Pt),Ht.download=ot,_t(Ht)}(0,E.useEffect)(()=>{je()},[je]),(0,E.useEffect)(()=>{gt.current&&!C&&Promise.all([R.e(8909),R.e(6656)]).then(R.bind(R,71448)).then(ot=>{try{nt=ot,He.current.instance=nt.editor.create(gt.current,{value:ye,language:Ue(be),theme:Qe,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:Ke||!1}},Ne);const Ye=He.current.instance;let Ht=[...z.BH._menuItems].find(pn=>pn[0]._debugName=="EditorContext")[1],un=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Bn=(pn,Sn)=>{var tn,On;let Tn=pn._first;do Sn.includes((On=(tn=Tn.element)==null?void 0:tn.command)==null?void 0:On.id)&&pn._remove(Tn);while(Tn=Tn.next)};if(rt(Ye,nt),setTimeout(()=>{je(),He.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{dt(At||"educoder.txt",Ye.getValue())}})},500),He.current.subscription=Ye.onDidChangeModelContent(pn=>{wt.current?clearTimeout(_e.current):(je(),ze(Ye.getValue(),pn)),_e.current=setTimeout(()=>{wt.current=!1},500)}),window.Monaco||y(nt,Ue(be)),de&&(Bn(Ht,un),gt.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Dt),window.removeEventListener("paste",Dt),window.addEventListener("keydown",Dt),window.addEventListener("paste",Dt)),window.Monaco=nt,V&&Ye.onDidBlurEditorWidget(()=>{V(Ye.getValue())}),We&&Ye.onDidFocusEditorText(()=>{de&&et(),We(Ye.getValue())}),de){et();try{Ye.onDidPaste(pn=>{const Sn=Ye.getSelection(),tn=He.current.pastePos||{},On=new nt.Range(tn.startLineNumber||Sn.endLineNumber,tn.startColumn||Sn.endColumn,tn.endLineNumber||Sn.endLineNumber,tn.endColumn||Sn.endColumn);Ye.executeEdits("",[{range:pn.range,text:""}])})}catch(pn){}}let fn=X();return tt&&typeof tt=="string"&&new k(tt,Ye,nt),j(!0),()=>{const pn=He.current.instance;pn.dispose();const Sn=pn.getModel();Sn&&Sn.dispose(),He.current.subscription&&He.current.subscription.dispose(),fn.unobserve(gt.current)}}catch(Ye){}})},[]),(0,E.useEffect)(()=>{if(He.current.instance&&C)return document.addEventListener("keydown",Ie,!1),()=>{document.removeEventListener("keydown",Ie)}},[Ee,C]),(0,E.useEffect)(()=>{let ot=He.current.instance;if(ot&&C){let Ye=Ue(be);nt.editor.setModelLanguage(ot.getModel(),Ye)}},[be,C]),(0,E.useEffect)(()=>{He.current.instance&&C&&nt.editor.setTheme(Qe)},[Qe,C]),(0,E.useEffect)(()=>{let ot=He.current.instance;bt.current=Le,ot&&C&&(ot.updateOptions(U({},Le)),setTimeout(()=>{ot.getModel().updateOptions(U({},Le))},200))},[JSON.stringify(Le),C]),(0,E.useEffect)(()=>{let ot=He.current.instance;ot&&C&&ot.layout()},[ke,Tt,C]);const[at,Rt]=(0,E.useState)($(ke)),[Gt,kt]=(0,E.useState)($(Tt)),Ot=g(U({},q),{width:at,height:Gt,position:"relative"});return E.createElement("div",{className:"my-monaco-editor",ref:gt,style:Ot},se&&E.createElement(oe.CopyToClipboard,{text:ye,onCopy:()=>J.ZP.success("\u590D\u5236\u6210\u529F")},E.createElement(ne.Z,{title:"\u590D\u5236\u4EE3\u7801"},E.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},E.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function Lt({width:Me="100%",height:mt="100%",original:ke,modified:Tt,language:ye,options:be={}}){const q=(0,E.useRef)(),[Le,Ne]=(0,E.useState)(null);function Qe(Fe){let de;return q.current&&(de=new le.Z(ze=>{for(let rt of ze)(rt.target.offsetHeight>0||rt.target.offsetWidth>0)&&Fe.layout()}),de.observe(q.current)),de}(0,E.useEffect)(()=>(q.current&&Promise.all([R.e(8909),R.e(9404)]).then(R.bind(R,2550)).then(Fe=>{nt=Fe;const de=nt.editor.createDiffEditor(q.current,g(U({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},be),{wordWrap:!0}));Ne(de);let ze=Qe(de);return()=>{de.dispose();const rt=de.getModel();rt&&rt.dispose(),ze.unobserve(q.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,E.useEffect)(()=>{Le&&Le.setModel({original:nt.editor.createModel(ke,ye),modified:nt.editor.createModel(Tt,ye)})},[ke,Tt,ye,Le]);const V=$(Me),se=$(mt),Ee={width:V,height:se};return E.createElement("div",{className:"my-diff-editor",ref:q,style:Ee})}},10661:function(Ut,ft,R){"use strict";R.d(ft,{Z:function(){return m}});var E={flex_box_center:"flex_box_center___AQ53o",flex_space_between:"flex_space_between___i2aIa",flex_box_vertical_center:"flex_box_vertical_center___sPEKB",flex_box_center_end:"flex_box_center_end___GhSSH",flex_box_column:"flex_box_column___R9_Hb",list:"list___jb2Ay",wrap:"wrap___VsQDr",lockWrap:"lockWrap___g1k1T",li:"li___IxCLC",cover:"cover___Mu8wr",img:"img___IpFLA",movebq:"movebq___mF7wt",bq:"bq___Bil0T",sign:"sign___DXJ4d",name:"name___l7FoJ",e:"e___pXQUG",unit:"unit___wCIFR",tags:"tags___w_Mil",tag1:"tag1___dxm7r",tag2:"tag2___llZkf",wrapisCurrent:"wrapisCurrent___qIfQT"},le=R(29787),xe=R(25399),ee=R(60242),W=R(92310),p=R.n(W),ue=R(51257),Y=R(28426),l=R(48790),G=R(59301),m=({className:_,dataSource:y=[],col:b=4,right:F,bottom:K=23,precision:H=0,wrapWidth:L=1200,trackEventItems:O,loading:k,onRemove:z=()=>{},isCurrent:J=!0,showProgress:ne=!1,showAlias:Z=!1})=>{const ae=Math.floor((L-(b-1)*F)/b),oe=[{name:"\u63A8\u8350\u81EA\u5B66",ptimg:"/images/tjzx.png",swimg:"/images/sw_tjzx.png"},{name:"101\u8BA1\u5212",ptimg:"/images/jh.png",swimg:"/images/sw_jh.png"},{name:"\u56FD\u5BB6\u4E00\u6D41",ptimg:"/images/gjyl.png",swimg:"/images/sw_gjyl.png"},{name:"\u7701\u7EA7\u4E00\u6D41",ptimg:"/images/sjyl.png",swimg:"/images/sw_sjyl.png"},{name:"\u7CBE\u54C1\u8BFE\u7A0B",ptimg:"/images/jpkc.png",swimg:"/images/sw_jpkc.png"},{name:"\u519B\u961F\u4E00\u6D41",ptimg:"/images/jdyl.png",swimg:"/images/sw_jdyl.png"},{name:"\u65B0\u578B\u6559\u6750",ptimg:"/images/xxjc.png",swimg:"/images/sw_xxjc.png"}];return G.createElement(le.Z,{spinning:k},G.createElement("div",{className:p()(E.list,_)},!!(y!=null&&y.length)&&(y==null?void 0:y.map((re,Re)=>{var M,w,T,I,N,U;const{name:g,id:d,identifier:D,featured:$,school_name:he,image_url:Se,excellent:qe,is_plan:Ue}=re;return G.createElement("div",{key:d,className:J&&ne?E.wrapisCurrent:E.wrap,style:{width:ae,marginRight:(1+Re)%b===0?0:F+H,marginBottom:K}},G.createElement("a",{className:E.li,onClick:nt=>{nt.preventDefault(),nt.stopPropagation(),O&&(0,ue.L9)([O]),(0,ue.xg)(`/paths/${D}`)}},G.createElement("div",{className:E.img},G.createElement("img",{className:E.cover,src:`${Se}`}),J&&(0,l.bg)()&&(re==null?void 0:re.studying)&&G.createElement("div",{className:`${E.movebq} user-path-items`,onClick:nt=>{nt.stopPropagation(),z(re)}},G.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),G.createElement("span",{className:"c-red"},"\u79FB\u9664")),(M=re==null?void 0:re.subject_tags)==null?void 0:M.map((nt,et)=>{var Pe,Lt;if(et===0){const mt=(Pe=oe.find(ke=>ke.name==nt))==null?void 0:Pe.swimg;return G.createElement("img",{className:E.sign,src:mt,style:{left:"-4px"}})}const Me=(Lt=oe.find(mt=>mt.name==nt))==null?void 0:Lt.ptimg;return G.createElement("img",{className:E.sign,src:Me,style:{left:`${48+52*(et-1)+2*et}px`}})}),G.createElement("div",{style:{position:"absolute",top:"150px",left:"4px"}},(re==null?void 0:re.excellent)&&G.createElement("div",{className:E.bq},"\u5F00\u653E\u8BFE\u7A0B"))),G.createElement("div",{className:E.name},G.createElement(xe.Z,{title:Z&&(re!=null&&re.excellent_alias_name)?G.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${g}`,G.createElement("br",null),G.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${re==null?void 0:re.excellent_alias_name}`)):g},G.createElement("span",{className:E.e},Z&&(re==null?void 0:re.excellent_alias_name)||g))),J&&ne&&((w=re==null?void 0:re.progress)==null?void 0:w.all_score)!=0&&G.createElement("div",{style:{padding:"0px 10px",color:"#333",marginTop:10}},G.createElement(ee.Z,{strokeColor:"#44d7b6",gap:"small",percent:(((T=re==null?void 0:re.progress)==null?void 0:T.my_score)/((I=re==null?void 0:re.progress)==null?void 0:I.all_score)*100).toFixed(),showInfo:!1}),"\u5DF2\u5B8C\u6210 ",(N=re==null?void 0:re.progress)==null?void 0:N.my_score,"/",(U=re==null?void 0:re.progress)==null?void 0:U.all_score),(!J||!ne)&&G.createElement(xe.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${he}`},G.createElement("div",{className:E.unit},G.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),he)),(!J||!ne)&&G.createElement("div",{className:E.tags},G.createElement("div",null,G.createElement(xe.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},G.createElement("span",null,G.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),G.createElement("span",null,re.stages_count))),G.createElement(xe.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},G.createElement("span",null,G.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),G.createElement("span",null,re.members_count)))))))})),!y.length&&G.createElement(Y.Z,null)))}},9148:function(Ut,ft,R){"use strict";R.d(ft,{jL:function(){return W},w9:function(){return $},QD:function(){return vt},cQ:function(){return N.Z},op:function(){return ze},O5:function(){return fe},_b:function(){return pt},t7:function(){return H},Gi:function(){return et},YG:function(){return Ue},qp:function(){return A},vr:function(){return Ze},qE:function(){return ut},Je:function(){return k},wb:function(){return I},cq:function(){return Tt},tp:function(){return y}});var E=R(59301),le={flex_box_center:"flex_box_center___NeSU8",flex_space_between:"flex_space_between___ImTGl",flex_box_vertical_center:"flex_box_vertical_center___BtRd9",flex_box_center_end:"flex_box_center_end___qcLe3",flex_box_column:"flex_box_column___Ze_3q",banner:"banner___PoUBO",content:"content___XoDjy",btns:"btns___Pb35j"},xe="data:image/png;base64,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",W=({dataSource:ve=[],img:Te,imgWidth:Ie=346,title:je,sunTitle:_t,bannerExtraContent:Dt})=>E.createElement("div",{className:le.banner},E.createElement("div",{className:le.content},E.createElement("aside",null,E.createElement("p",null,E.createElement("b",null,je),E.createElement("span",null,_t)),ve.length>0&&E.createElement("div",{className:le.btns},ve.map((dt,at)=>E.createElement("div",{key:at,onClick:dt.click},dt.name,dt.sign?E.createElement("img",{src:xe,width:39}):null))),Dt),Te&&E.createElement("img",{style:{marginTop:33,marginRight:38},src:Te,width:Ie}))),p={flex_box_center:"flex_box_center___hG6RI",flex_space_between:"flex_space_between___ss3Fh",flex_box_vertical_center:"flex_box_vertical_center___K80p9",flex_box_center_end:"flex_box_center_end___qmXX3",flex_box_column:"flex_box_column___GFV8F",row:"row___aXJjm",title:"title___HUKL0",tagsWrap:"tagsWrap___XB2W3",action:"action___VdHb1",bar:"bar___t1kKC",tag:"tag___V7Eft",name:"name___Hk1Ip",num:"num___xQpcH",active:"active___XryTX",tagsBorderWrap:"tagsBorderWrap___OMxjs"},ue=R(92310),Y=R.n(ue),l=R(89392),A=({dataSource:ve=[],value:Te,onChange:Ie,onTitleChange:je,className:_t,title:Dt,titleWidth:dt=41,style:at={},fontColor:Rt="#6A7283",showCount:Gt})=>{const[kt,Ot]=(0,E.useState)(0),[ot,Ye]=(0,E.useState)(!1),yt=(0,E.useRef)(null),Pt=(0,E.useRef)(null);return(0,E.useEffect)(()=>{var Ht;ve.length!==0&&(((Ht=yt==null?void 0:yt.current)==null?void 0:Ht.clientHeight)>97?Ot(1):Ot(0)),ve.length===0&&Ot(0),Ye(!1)},[ve]),E.createElement("div",{className:Y()(p.row,_t),style:at},E.createElement("div",{onClick:(0,l.throttle)(()=>je==null?void 0:je(),2e3),style:{width:dt,marginTop:ot?12:4},className:`${p.title} ${je?"current":""}`},Dt),E.createElement("div",{className:ot?`${p.tagsWrap} ${p.tagsBorderWrap}`:p.tagsWrap},E.createElement("div",{className:p.bar,ref:Pt,style:kt>0?{height:kt===1?97:"auto",overflow:kt===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},E.createElement("div",{className:p.tag,ref:yt},ve==null?void 0:ve.map(Ht=>E.createElement("span",{onClick:()=>Ie(Ht.id),key:Ht.id,style:{color:Rt},className:Te===Ht.id?p.active:""},E.createElement("span",{title:Ht.name,className:p.name},Ht.name),!!Gt&&E.createElement("span",{className:p.num},Ht.count))))),!!kt&&E.createElement(E.Fragment,null,kt===1?E.createElement("div",{onClick:()=>{var Ht;Ot(2),((Ht=yt==null?void 0:yt.current)==null?void 0:Ht.clientHeight)>245?Ye(!0):Ye(!1)},className:p.action},"\u5C55\u5F00",E.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):E.createElement("div",{onClick:()=>{Pt.current.scrollTop=0,Ot(1),Ye(!1)},className:p.action},"\u6536\u8D77",E.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},m={flex_box_center:"flex_box_center___aK2n3",flex_space_between:"flex_space_between___HX0Oh",flex_box_vertical_center:"flex_box_vertical_center___LJOJr",flex_box_center_end:"flex_box_center_end___SCakF",flex_box_column:"flex_box_column___AYv4m",tabs:"tabs___GTqPV",active:"active___F26E8"},y=({dataSource:ve=[],value:Te,onChange:Ie,className:je,style:_t={}})=>E.createElement("div",{style:_t,className:Y()(m.tabs,je)},ve.map(Dt=>E.createElement("span",{onClick:()=>Ie(Dt.id),className:Te===Dt.id?m.active:"",key:Dt.id},Dt.name))),b={flex_box_center:"flex_box_center___yX6Oa",flex_space_between:"flex_space_between___t7oqF",flex_box_vertical_center:"flex_box_vertical_center___dEIHy",flex_box_center_end:"flex_box_center_end___taQDF",flex_box_column:"flex_box_column___xY_Lr",input:"input___PW2zI",dropdown:"dropdown___vSy8B",menu:"menu___NiyBu",text:"text___Grueu",b1:"b1___ZKryM",b2:"b2___aKyGa"},F=R(37568),H=({dataSource:ve=[],value:Te="",onChange:Ie,onInputChange:je=()=>{},className:_t,style:Dt={},placeholder:dt,allowClear:at=!1})=>{var Rt;const[Gt,kt]=(0,E.useState)(""),[Ot,ot]=(0,E.useState)("");(0,E.useEffect)(()=>{var Pt;let Ht=Te;(Pt=JSON.stringify(Te))!=null&&Pt.includes("{")&&(kt(Te.id),Ht=Te.value||"");try{ot(decodeURIComponent(Ht||""))}catch(un){ot(decodeURIComponent(Ht||""))}},[Te]);const Ye=()=>{Ie(encodeURIComponent(Ot),Gt||null)},yt=Pt=>{Pt!==Gt&&(kt(Pt),Ie(encodeURIComponent(Ot),Pt))};return E.createElement("div",{className:Y()(b.input,_t),style:Dt},!!ve.length&&E.createElement("div",{className:b.dropdown},E.createElement("div",{className:b.text},(Rt=ve.find(Pt=>Pt.id===Gt))==null?void 0:Rt.name,E.createElement("i",{className:"iconfont icon-zhankai4"}),E.createElement("b",{className:b.b1}),E.createElement("b",{className:b.b2})),E.createElement("div",{className:b.menu},ve.map((Pt,Ht)=>E.createElement("div",{key:Ht,onClick:()=>yt(Pt.id)},Pt.name)))),E.createElement(F.default,{onPressEnter:Ye,value:Ot,onChange:Pt=>{ot(Pt.target.value),je(encodeURIComponent(Pt.target.value),Gt||null)},bordered:!1,placeholder:dt}),E.createElement("i",{onClick:Ye,className:"iconfont icon-sousuo9 font14 pl10 current"}))},L={flex_box_center:"flex_box_center___tol8o",flex_space_between:"flex_space_between___Z235C",flex_box_vertical_center:"flex_box_vertical_center___Wq1sZ",flex_box_center_end:"flex_box_center_end___LLxom",flex_box_column:"flex_box_column___DbMSN",quickPager:"quickPager___GM30J",disabled:"disabled___Ozc8I"},k=({value:ve,onChange:Te,className:Ie,total:je,pageSize:_t,style:Dt={}})=>{const dt=ve<2,at=ve>=Math.ceil(je/_t);return je<=_t?E.createElement(E.Fragment,null):E.createElement("div",{className:Y()(L.quickPager,Ie),style:Dt},E.createElement("div",{onClick:()=>{dt||Te(ve-1,"prev")},className:dt?L.disabled:""},"\u4E0A\u4E00\u9875"),E.createElement("div",{onClick:()=>{at||Te(ve+1,"next")},className:at?L.disabled:""},"\u4E0B\u4E00\u9875"))},z={flex_box_center:"flex_box_center___FO7TP",flex_space_between:"flex_space_between___LotYx",flex_box_vertical_center:"flex_box_vertical_center___bWdaw",flex_box_center_end:"flex_box_center_end___mVJ1o",flex_box_column:"flex_box_column___M83Mm",list:"list___oOsiS",wrap:"wrap___G6T7F",lockWrap:"lockWrap___Rl79E",li:"li___oZZ7l",cover:"cover___b2bYW",img:"img___IQX7w",sign:"sign___HkT6C",name:"name___SsJx8",e:"e___TMqq0",tags:"tags___bcjyo",rate:"rate___YACg7"},J=R(29787),ne=R(25399),Z=R(58018),ae=R(346),oe=R(51257),re=R(96908),Re=R(57177),M=R(81378),w=R(28426),I=({className:ve,dataSource:Te=[],col:Ie=4,right:je,bottom:_t=23,precision:Dt=0,wrapWidth:dt=1200,trackEventItems:at,loading:Rt})=>{const Gt=Math.floor((dt-(Ie-1)*je)/Ie);return E.createElement(J.Z,{spinning:Rt},E.createElement("div",{className:Y()(z.list,ve)},!!Te.length&&Te.map((kt,Ot)=>{const{name:ot,id:Ye,identifier:yt,power:Pt,cover_image_id:Ht,pic:un}=kt;return E.createElement("div",{className:z.wrap,key:Ye,style:{width:Gt,marginRight:(1+Ot)%Ie===0?0:je+Dt,marginBottom:_t}},E.createElement("a",{target:"_blank",href:`/shixuns/${yt}/challenges`,className:z.li,onClick:Bn=>{Bn.preventDefault(),at&&(0,oe.L9)([at]),Pt&&(0,oe.xg)(`/shixuns/${yt}/challenges`)}},E.createElement("div",{className:z.img},E.createElement("img",{className:z.cover,src:`${un}`}),kt.is_jupyter&&E.createElement("img",{className:z.sign,src:re}),kt.is_jupyter_lab&&E.createElement("img",{className:z.sign,src:Re}),kt.is_unity_3d&&E.createElement("img",{className:z.sign,src:M})),E.createElement("div",{className:z.name},E.createElement(ne.Z,{title:ot||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},E.createElement("span",{className:z.e},ot||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),E.createElement("div",{className:z.tags},E.createElement(ne.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},E.createElement("span",null,E.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),E.createElement("span",null,kt.challenges_count))),!!kt.myshixuns_count&&E.createElement(ne.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},E.createElement("span",null,E.createElement("i",{className:"iconfont icon-chengyuan font14 mr2"}),E.createElement("span",null,kt.myshixuns_count))),E.createElement(ne.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},E.createElement("span",null,E.createElement("span",null,kt.level))),E.createElement("div",{className:z.rate},E.createElement(Z.Z,{allowHalf:!0,disabled:!0,defaultValue:kt.score_info}),E.createElement("span",null,"\xA0",kt.score_info?`${kt.score_info}\u5206`:"5\u5206")))),!Pt&&E.createElement("div",{className:z.lockWrap},E.createElement("img",{src:`${ae.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),E.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!Te.length&&E.createElement(w.Z,null)))},N=R(10661),U={flex_box_center:"flex_box_center___eMcr7",flex_space_between:"flex_space_between___HcNca",flex_box_vertical_center:"flex_box_vertical_center___ZnvVN",flex_box_center_end:"flex_box_center_end___fdgDf",flex_box_column:"flex_box_column___SEKvd",list:"list___L1hmU",wrap:"wrap___pKgcW",lockWrap:"lockWrap___SMhkK",top:"top___udHSB",sign:"sign___uwRpq",name:"name___Fpf90",img:"img___AMLhL",text:"text___KiTb7",btns:"btns___i6IuZ",bottom:"bottom____k2sh"},g="data:image/png;base64,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",d=R(59301),$=({className:ve,dataSource:Te=[],col:Ie=4,right:je,bottom:_t=23,precision:Dt=0,wrapWidth:dt=1200,trackEventItems:at,loading:Rt,handleVery:Gt=()=>!0})=>{const kt=Math.floor((dt-(Ie-1)*je)/Ie);return d.createElement(J.Z,{spinning:Rt},d.createElement("div",{className:Y()(U.list,ve)},!!Te.length&&Te.map((Ot,ot)=>{const{subject_identifier:Ye,id:yt,identifier:Pt,power:Ht}=Ot,un=Ot.is_public!=0&&Ot.is_public;return d.createElement("div",{className:U.wrap,key:yt,style:{width:kt,marginRight:(1+ot)%Ie===0?0:je+Dt,marginBottom:_t}},d.createElement("a",{className:U.li,onClick:Bn=>{Bn.preventDefault(),Gt(Ot==null?void 0:Ot.first_category_url)&&(at&&(0,oe.L9)([at]),(0,oe.xg)(Ot.first_category_url))}},d.createElement("div",{className:U.top},d.createElement(ne.Z,{title:Ot.name},d.createElement("div",{className:U.name},Ot.name)),d.createElement("img",{className:U.img,src:ae.Z.IMG_SERVER+"/images/"+Ot.avatar_url}),d.createElement("div",{className:U.text,title:Ot.creator},Ot.creator),Ye&&d.createElement("div",{className:U.btns},d.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),d.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),un&&d.createElement("div",{className:U.sign},"\u516C\u5F00")),d.createElement("div",{className:U.bottom},Ot.visits>0&&d.createElement(ne.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},d.createElement("span",null,d.createElement("i",{className:"iconfont icon-liulanyan"}),d.createElement("span",null,Ot.visits))),Ot.course_members_count>0&&d.createElement(ne.Z,{title:"\u6210\u5458",placement:"bottom"},d.createElement("span",null,d.createElement("i",{className:"iconfont icon-chengyuan"}),Ot.course_members_count)),Ot.tasks_count>0&&d.createElement(ne.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},d.createElement("span",null,d.createElement("i",{className:"iconfont icon-zuoye"}),Ot.tasks_count)),Ot.is_end?d.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):d.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!Ot.is_accessible&&d.createElement("div",{className:U.lockWrap},d.createElement("img",{src:`${ae.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),d.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!Te.length&&d.createElement(w.Z,null)))},he={flex_box_center:"flex_box_center___d27mZ",flex_space_between:"flex_space_between___qfRU9",flex_box_vertical_center:"flex_box_vertical_center___fCRld",flex_box_center_end:"flex_box_center_end___ORMV8",flex_box_column:"flex_box_column___PNKtZ",tabs:"tabs___alpa7",tabsWrap:"tabsWrap___aCQjw",tab:"tab___MKLr4",active:"active___nl_4v"},Se=R(25690),Ue=({dataSource:ve=[],value:Te,onChange:Ie,className:je,style:_t={},tabBarExtraContent:Dt})=>E.createElement("div",{className:Y()(he.tabs,je),style:_t},E.createElement("div",{className:he.tabsWrap},ve.map((dt,at)=>!(dt!=null&&dt.hide)&&E.createElement("aside",{className:he.tab,onClick:()=>{Ie(dt.id),dt.link&&Se.history.push(dt.link)},key:at},E.createElement("div",{className:Te===dt.id?he.active:""},dt.name),(dt==null?void 0:dt.resetCount)==null&&(dt==null?void 0:dt.total)!==void 0&&E.createElement("span",null,"\uFF08",dt==null?void 0:dt.total,"\uFF09"),(dt==null?void 0:dt.resetCount)!==void 0&&(dt==null?void 0:dt.total)!==void 0&&E.createElement(ne.Z,{title:(dt==null?void 0:dt.tip)!=null?dt==null?void 0:dt.tip:""},E.createElement("span",{style:{color:"#9096A3"}},"\uFF08",E.createElement("span",{style:{color:"#000"}},dt==null?void 0:dt.resetCount),"/",E.createElement("span",null,dt==null?void 0:dt.total),"\uFF09"))))),E.createElement("div",{className:he.tabBar},Dt)),et=({className:ve,style:Te={},children:Ie})=>E.createElement("div",{className:Y()(ve),style:Te},Ie),Pe={flex_box_center:"flex_box_center___e6HxQ",flex_space_between:"flex_space_between___RnXYe",flex_box_vertical_center:"flex_box_vertical_center___lVxPk",flex_box_center_end:"flex_box_center_end___bu8yv",flex_box_column:"flex_box_column___JczGj",orderWrap:"orderWrap___ZfyGX",orderIconWrap:"orderIconWrap___XTB_O",orderAsc:"orderAsc___KWHmA",orderDesc:"orderDesc___rHdbB",active:"active___a7eSP",cursorPointer:"cursorPointer___gs9kL",orderTextWrap:"orderTextWrap___teAKn"},Lt=R(75727),Me=R(93041);const mt=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}];var Tt=({sortValue:ve,dropValue:Te,className:Ie,onSort:je,onDrop:_t,dataSource:Dt=mt})=>{var dt;return E.createElement("div",{className:Y()(Pe.orderWrap,Ie)},E.createElement(Lt.Z,{dropdownRender:()=>E.createElement(Me.default,null,Dt.map((at,Rt)=>E.createElement(Me.default.Item,{key:Rt,onClick:()=>_t(at.id)},at.name)))},E.createElement("span",{className:Pe.orderTextWrap},(dt=Dt.find(at=>Te===at.id))==null?void 0:dt.name)),E.createElement("span",{className:Pe.orderIconWrap},E.createElement("span",{className:Pe.orderAsc},E.createElement("i",{className:ve==="asc"?`iconfont icon-sanjiaoxing-up font12 ${Pe.cursorPointer} ${Pe.active}`:`iconfont icon-sanjiaoxing-up font12 ${Pe.cursorPointer}`,onClick:()=>je(ve==="asc"?"desc":"asc")})),E.createElement("span",{className:Pe.orderDesc},E.createElement("i",{className:ve==="desc"?`iconfont icon-sanjiaoxing-down font12 ${Pe.cursorPointer} ${Pe.active}`:`iconfont icon-sanjiaoxing-down font12 ${Pe.cursorPointer}`,onClick:()=>je(ve==="asc"?"desc":"asc")}))))},ye={flex_box_center:"flex_box_center___LCi0B",flex_space_between:"flex_space_between___hzONe",flex_box_vertical_center:"flex_box_vertical_center___ZyQRE",flex_box_center_end:"flex_box_center_end___XKM74",flex_box_column:"flex_box_column___p8LCU",btn:"btn___In02G","mediacy-round":"mediacy-round___uveEv","mediacy-default":"mediacy-default___dDxsd",default:"default___K791v"},be=R(99571),q=Object.defineProperty,Le=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,V=(ve,Te,Ie)=>Te in ve?q(ve,Te,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):ve[Te]=Ie,se=(ve,Te)=>{for(var Ie in Te||(Te={}))Ne.call(Te,Ie)&&V(ve,Ie,Te[Ie]);if(Le)for(var Ie of Le(Te))Qe.call(Te,Ie)&&V(ve,Ie,Te[Ie]);return ve},Ee=(ve,Te)=>{var Ie={};for(var je in ve)Ne.call(ve,je)&&Te.indexOf(je)<0&&(Ie[je]=ve[je]);if(ve!=null&&Le)for(var je of Le(ve))Te.indexOf(je)<0&&Qe.call(ve,je)&&(Ie[je]=ve[je]);return Ie},Fe=(ve,Te,Ie)=>new Promise((je,_t)=>{var Dt=Rt=>{try{at(Ie.next(Rt))}catch(Gt){_t(Gt)}},dt=Rt=>{try{at(Ie.throw(Rt))}catch(Gt){_t(Gt)}},at=Rt=>Rt.done?je(Rt.value):Promise.resolve(Rt.value).then(Dt,dt);at((Ie=Ie.apply(ve,Te)).next())}),ze=ve=>{var Te=ve,{className:Ie,style:je,children:_t,loading:Dt=!1,openLoading:dt,onClick:at=()=>{},size:Rt="middle",shape:Gt="round"}=Te,kt=Ee(Te,["className","style","children","loading","openLoading","onClick","size","shape"]);const[Ot,ot]=(0,E.useState)(!1);return E.createElement(be.ZP,se({onClick:(0,l.throttle)(Ye=>Fe(void 0,null,function*(){dt&&ot(!0);try{yield at(Ye)}catch(yt){console.log("error",yt)}dt&&ot(!1)}),2e3,{leading:!0,trailing:!1}),className:Y()(ye.btn,ye[`${Rt}-${Gt}`],Ie),style:je,size:Rt,shape:Gt,loading:Ot||Dt},kt),_t)},rt={flex_box_center:"flex_box_center___TB7bQ",flex_space_between:"flex_space_between___oBlTb",flex_box_vertical_center:"flex_box_vertical_center___b5XbB",flex_box_center_end:"flex_box_center_end___CNhe7",flex_box_column:"flex_box_column___yHXKW",head:"head___ghH72",node:"node___mjPEy"},ut=({className:ve,style:Te,children:Ie=null,onClick:je,title:_t})=>E.createElement("div",{className:Y()(rt.head,ve),style:Te},E.createElement("span",{className:"primary-hover",onClick:je},E.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),E.createElement("b",{title:_t},_t),E.createElement("div",{className:rt.node},Ie)),Ve={flex_box_center:"flex_box_center___AlHuF",flex_space_between:"flex_space_between___vN2LW",flex_box_vertical_center:"flex_box_vertical_center___Ac7D2",flex_box_center_end:"flex_box_center_end___y38I7",flex_box_column:"flex_box_column___iQE6P",btns:"btns___sNgTb",confirm:"confirm___Ozirl",cancel:"cancel___aiq1I"},vt=({confirmShow:ve=!0,confirmTitle:Te,confirmClick:Ie,cancelShow:je=!0,cancelTitle:_t,cancelClick:Dt,className:dt,style:at,confirmLoading:Rt=!1})=>E.createElement("div",{className:Y()(Ve.btns,dt),style:at},ve&&E.createElement(be.ZP,{loading:Rt,onClick:Ie,type:"primary",className:Ve.confirm},Te),je&&E.createElement(be.ZP,{onClick:Dt,className:Ve.cancel},_t)),ge={flex_box_center:"flex_box_center___jkpdr",flex_space_between:"flex_space_between___OtsL8",flex_box_vertical_center:"flex_box_vertical_center___rbcb_",flex_box_center_end:"flex_box_center_end___zBR21",flex_box_column:"flex_box_column___nS_eP",fixedBottom:"fixedBottom___oJl7m",wrap:"wrap___A3Oq1",center:"center____VL1y"},Ze=({className:ve,style:Te={},LeftContent:Ie,children:je,RightContent:_t})=>E.createElement("div",{className:Y()(ge.fixedBottom,ve),style:Te},E.createElement("div",{className:ge.wrap},E.createElement("div",{className:ge.left},Ie),E.createElement("div",{className:ge.center},je),E.createElement("div",{className:ge.right},_t))),tt={flex_box_center:"flex_box_center___tY8Yn",flex_space_between:"flex_space_between___vHdYA",flex_box_vertical_center:"flex_box_vertical_center___pa61F",flex_box_center_end:"flex_box_center_end___HyDXt",flex_box_column:"flex_box_column___UjZek",crumbs:"crumbs___V41Oe",hover:"hover___bEIVd"},pt=({className:ve,style:Te={},dataSource:Ie=[]})=>E.createElement("div",{className:Y()(tt.crumbs,ve),style:Te},Ie.map((je,_t)=>_t<Ie.length-1?E.createElement(E.Fragment,{key:_t},je.path||je.onClick?E.createElement("span",{className:tt.hover,onClick:je!=null&&je.onClick?je.onClick:()=>Se.history.push(je.path)},je.name):E.createElement("span",null,je.name),E.createElement("span",null,"\xA0",">","\xA0")):E.createElement("span",{key:_t,style:{color:"#5F6368"}},je.name))),gt=R(11938),He=Object.defineProperty,bt=Object.defineProperties,Ct=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,wt=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable,me=(ve,Te,Ie)=>Te in ve?He(ve,Te,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):ve[Te]=Ie,pe=(ve,Te)=>{for(var Ie in Te||(Te={}))wt.call(Te,Ie)&&me(ve,Ie,Te[Ie]);if(it)for(var Ie of it(Te))_e.call(Te,Ie)&&me(ve,Ie,Te[Ie]);return ve},C=(ve,Te)=>bt(ve,Ct(Te)),j=(ve,Te)=>{var Ie={};for(var je in ve)wt.call(ve,je)&&Te.indexOf(je)<0&&(Ie[je]=ve[je]);if(ve!=null&&it)for(var je of it(ve))Te.indexOf(je)<0&&_e.call(ve,je)&&(Ie[je]=ve[je]);return Ie};const{Countdown:X}=gt.default;var fe=ve=>{var Te=ve,{onChange:Ie}=Te,je=j(Te,["onChange"]);const[_t,Dt]=(0,E.useState)(null);(0,E.useEffect)(()=>{typeof _t=="number"&&_t>=0&&Ie(_t)},[_t]);const dt=at=>{const Rt=Math.floor(at/1e3);Dt(Rt)};return E.createElement(X,C(pe({},je),{onChange:dt}))}},50650:function(Ut,ft,R){"use strict";R.r(ft),R.d(ft,{default:function(){return Re}});var E=R(59301),le=R(25690),xe=R(91882),ee=R(62957),W=R(20554),p=R(51257),ue=R(86245),Y=R(346),l=R(76902),G=R(61186),A=R.n(G),m={flex_box_center:"flex_box_center___dn0xX",flex_space_between:"flex_space_between___JlcX8",flex_box_vertical_center:"flex_box_vertical_center___PGWCu",flex_box_center_end:"flex_box_center_end___sRxxV",flex_box_column:"flex_box_column___WPwan",top:"top___arr9I",desc:"desc___tW8Wt",liked:"liked___Bq9NY",likedActive:"likedActive___XzpPk",reply:"reply___12llT",replyList:"replyList___NJsYv",comment:"comment___RWWH5",headpic:"headpic___v_77H"};A().locale("ZH-cn");const _=({userDetail:M,dispatch:w})=>{var T;const I=(0,le.useParams)(),N=(0,le.useLocation)();(0,E.useEffect)(()=>{var g,d;I.type=(d=(g=N.pathname)==null?void 0:g.split("/"))==null?void 0:d[6]},[N.pathname]);const{homeworkBanksDetail:U}=M;return E.createElement("section",{className:m.bg},E.createElement("section",{className:""},E.createElement("aside",{className:[m.desc,"c-black","font14","bg-white"].join(" ")},M.actionTabs.key!=="\u7F16\u8F91\u4F5C\u4E1A"&&E.createElement(l.Z,{value:(U==null?void 0:U.description)||"\u6682\u65E0\uFF5E"}),(T=U==null?void 0:U.attachments)==null?void 0:T.map((g,d)=>E.createElement("div",null,E.createElement("a",{href:`${Y.Z.API_SERVER}${g.url}`},E.createElement("span",{className:"iconfont icon-fujian c-green font14"}),E.createElement("span",{className:"ml10 c-black"},g.title),E.createElement("span",{className:"c-light-black ml20 font12"},g.filesize)))),I.type==="group"&&E.createElement(E.Fragment,null,(U.min_num||U.max_num)&&E.createElement("div",{className:"mt10"},E.createElement("span",{className:"c-grey-666"},"\u5206\u7EC4\u8981\u6C42\uFF1A"),E.createElement("span",{className:"c-black-051"},U.min_num,"~ ",U.max_num," \u4EBA\uFF08\u5B66\u751F\u63D0\u4EA4\u4F5C\u54C1\u65F6\u9700\u8981\u5173\u8054\u540C\u7EC4\u6210\u5458\uFF0C\u7EC4\u5185\u6210\u5458\u4F5C\u54C1\u5171\u4EAB\uFF09")),U.base_on_project?E.createElement("p",null,E.createElement("span",{className:"c-grey-666"},"\u57FA\u4E8E\u9879\u76EE\u5B9E\u65BD"),E.createElement("span",{className:"c-black-051"},"\uFF08\u5B66\u751F\u5FC5\u987B\u5728\u672C\u5E73\u53F0\u521B\u5EFA\u9879\u76EE\uFF0C\u9879\u76EE\u7BA1\u7406\u5458\u53EF\u4EE5\u63D0\u4EA4\u4F5C\u54C1\uFF09")):E.createElement("p",null,E.createElement("span",{className:"c-grey-666"},"\u4E0D\u57FA\u4E8E\u9879\u76EE"),E.createElement("span",{className:"c-black-051"},"\uFF08\u65E0\u9700\u5728\u5E73\u53F0\u521B\u5EFA\u9879\u76EE\uFF0C\u4EFB\u610F\u5C0F\u7EC4\u6210\u5458\u5747\u53EF\u4EE5\u63D0\u4EA4\u4F5C\u54C1\uFF09"))))))};var y=(0,le.connect)(({userDetail:M})=>({userDetail:M}))(_),b=R(28426),F={flex_box_center:"flex_box_center___ukees",flex_space_between:"flex_space_between___PHPo4",flex_box_vertical_center:"flex_box_vertical_center___MgEzw",flex_box_center_end:"flex_box_center_end___owDkz",flex_box_column:"flex_box_column____I7hO",top:"top___DHLWM",desc:"desc___JJR8P",liked:"liked___knpCw",likedActive:"likedActive___KPZCk",reply:"reply___n7kXe",replyList:"replyList___MVu52",comment:"comment___Leq7e",headpic:"headpic___HL9zI"};A().locale("ZH-cn");const K=({userDetail:M,dispatch:w})=>{var T,I;const{homeworkBanksDetail:N}=M;return E.createElement("section",{className:F.bg},E.createElement("section",{className:""},E.createElement("aside",{className:[F.desc,"c-black","font14","bg-white"].join(" ")},N!=null&&N.reference_answer||(T=N==null?void 0:N.reference_attachments)!=null&&T.length?E.createElement(E.Fragment,null,E.createElement(l.Z,{value:(N==null?void 0:N.reference_answer)||""}),(I=N==null?void 0:N.reference_attachments)==null?void 0:I.map((U,g)=>E.createElement("div",null,E.createElement("a",{href:`${Y.Z.API_SERVER}${U.url}`},E.createElement("span",{className:"iconfont icon-fujian c-green font14"}),E.createElement("span",{className:"ml10 c-black"},U.title),E.createElement("span",{className:"c-light-black ml20 font12"},U.filesize))))):E.createElement(b.Z,null))))};var H=(0,le.connect)(({userDetail:M})=>({userDetail:M}))(K),L={flex_box_center:"flex_box_center___vHDeL",flex_space_between:"flex_space_between___rLrGx",flex_box_vertical_center:"flex_box_vertical_center___iGSf0",flex_box_center_end:"flex_box_center_end___mqG_2",flex_box_column:"flex_box_column___x9EJv",title:"title___LcvG_",export:"export___M5wlK",bg:"bg___XfKxA",tabs:"tabs___esytV"},O=R(33705),k=Object.defineProperty,z=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,Z=(M,w,T)=>w in M?k(M,w,{enumerable:!0,configurable:!0,writable:!0,value:T}):M[w]=T,ae=(M,w)=>{for(var T in w||(w={}))J.call(w,T)&&Z(M,T,w[T]);if(z)for(var T of z(w))ne.call(w,T)&&Z(M,T,w[T]);return M},oe=(M,w,T)=>new Promise((I,N)=>{var U=D=>{try{d(T.next(D))}catch($){N($)}},g=D=>{try{d(T.throw(D))}catch($){N($)}},d=D=>D.done?I(D.value):Promise.resolve(D.value).then(U,g);d((T=T.apply(M,w)).next())});const re=({userDetail:M,dispatch:w,history:T})=>{const[I]=(0,le.useSearchParams)(),N=(0,le.useParams)(),U=(0,le.useLocation)(),[g,d]=(0,E.useState)(I.get("tabs")||0),{homeworkBanksDetail:D}=M;(0,E.useEffect)(()=>{var Se,qe;N.type=(qe=(Se=U.pathname)==null?void 0:Se.split("/"))==null?void 0:qe[6],w({type:"userDetail/getHomeworkBanksDetail",payload:ae({},N)})},[N.topicId,U.pathname]);const $=()=>{w({type:"userDetail/setActionTabs",payload:{key:"UserDetail-SendToClass",params:{object_id:[N.topicId],object_type:N.type}}})},he=[{name:"\u5185\u5BB9\u8BE6\u60C5",id:0,compontent:E.createElement("div",{className:"minH500"},E.createElement(y,null))},{name:"\u53C2\u8003\u7B54\u6848",id:1,compontent:E.createElement(H,null)}];return E.createElement("section",{className:L.bg},E.createElement("div",{className:"edu-container"},E.createElement("section",{className:"animated fadeIn"},E.createElement("aside",{className:"mt10"},E.createElement(xe.Z,{separator:">"},E.createElement(xe.Z.Item,null,E.createElement(le.Link,{to:`/users/${N.username}/${N.topictype==="personal"?"topics":"topicbank"}/${N.topictype}`},N.topictype==="personal"?"\u6211\u7684\u8BFE\u5802\u8D44\u6E90":"\u516C\u5171\u9898\u5E93")),E.createElement(xe.Z.Item,null,"\u8BE6\u60C5"))),E.createElement("aside",{className:[L.title,"mt20"].join(" ")},E.createElement("strong",{className:"font20 ml5"},D.name),D.is_public&&E.createElement(p.VV,{status:["\u516C\u5F00"]}))),E.createElement("aside",{className:"mt30 relative bg-white mb20"},E.createElement("div",{className:L.export},(D==null?void 0:D.authorize)&&E.createElement(E.Fragment,null,E.createElement("a",{onClick:Se=>{Se.preventDefault(),ee.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:()=>oe(void 0,null,function*(){(yield(0,ue.Tv)({object_type:"normal",object_id:[N.topicId]})).status===0&&T.push(`/users/${N.username}/topics/personal`)})})}},"\u5220\u9664"),E.createElement(le.Link,{to:`/users/${N.username}/topics/${N.topicId}/${N.topictype}/${N.type}/edit`},"\u7F16\u8F91")),E.createElement("a",{onClick:Se=>{Se.preventDefault(),$()}},"\u53D1\u9001")),E.createElement(W.default,{defaultActiveKey:g,className:L.tabs},he.map((Se,qe)=>E.createElement(W.default.TabPane,{tab:Se.name,key:Se.id},Se.compontent))))),E.createElement(O.Z,null))};var Re=(0,le.connect)(({userDetail:M,loading:w})=>({userDetail:M,loading:w.effects}))(re)},33705:function(Ut,ft,R){"use strict";R.d(ft,{Z:function(){return M}});var E=R(59301),le=R(25690),xe=R(6767),ee=R(62957),W=R(20554),p=R(458),ue=R(47889),Y={title:"title___XAxiE",radioWrap:"radioWrap___k0pOB",radio:"radio___x9kMt",colorFF0000:"colorFF0000___IMgd0",pagination:"pagination___ou2ht",checkboxWrapper:"checkboxWrapper___kF7xI"},l=R(51257),G=R(9148),A=R(29787),m=R(62673),_=R(86245),y=R(26724),b=R.n(y),F=(w,T,I)=>new Promise((N,U)=>{var g=$=>{try{D(I.next($))}catch(he){U(he)}},d=$=>{try{D(I.throw($))}catch(he){U(he)}},D=$=>$.done?N($.value):Promise.resolve($.value).then(g,d);D((I=I.apply(w,T)).next())}),H=({username:w,setStages:T,stages:I,hasError:N,setHasError:U})=>{const[g,d]=(0,E.useState)(""),[D,$]=(0,E.useState)(1),[he,Se]=(0,E.useState)([]),[qe,Ue]=(0,E.useState)(!1),[nt,et]=(0,E.useState)(0);(0,E.useEffect)(()=>{Pe({page:1,search:""},!0)},[]);const Pe=(Me,mt)=>F(void 0,null,function*(){Ue(!0);const ke=yield(0,_.w3)({username:w,category:"manage",page:Me.page,search:Me.search});Ue(!1),Se(Tt=>mt?ke==null?void 0:ke.subjects:[...Tt,...ke==null?void 0:ke.subjects]),et(ke==null?void 0:ke.count)}),Lt=(0,E.useRef)();return E.createElement("div",{className:Y.wrap},E.createElement("div",{className:"mb10"},E.createElement(G.t7,{placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:g,style:{width:500},onChange:Me=>{d(Me),$(1),Lt.current.scrollTo({behavior:"smooth",top:0}),Pe({page:1,search:Me},!0)}})),E.createElement(A.Z,{spinning:qe},E.createElement("div",{className:Y.radioWrap,ref:Lt},E.createElement(b(),{initialLoad:!1,pageStart:1,threshold:6,loadMore:()=>{$(D+1),Pe({page:D+1,search:g},!1)},hasMore:he.length<nt,useWindow:!1},E.createElement(ue.ZP.Group,{value:I.subjectId,onChange:Me=>{T({subjectId:Me.target.value,stage_ids:[]}),U(!1)}},he.map(Me=>{const mt=Me.stages.map(ke=>({label:ke.name,value:ke.id}));return E.createElement("div",{key:Me.id},E.createElement(ue.ZP,{className:Y.radio,value:Me.id},Me.name),Me.id===I.subjectId&&E.createElement("div",{className:Y.checkboxWrapper},mt.length>0&&E.createElement(m.default,{indeterminate:I.stage_ids.length>0&&I.stage_ids.length<mt.length,onChange:ke=>{T({subjectId:Me.id,stage_ids:ke.target.checked?mt.map(Tt=>Tt.value):[]})},checked:I.stage_ids.length===mt.length},"\u5168\u9009"),E.createElement(m.default.Group,{options:mt,value:I.stage_ids,onChange:ke=>T({subjectId:Me.id,stage_ids:ke})})))}))))),N&&E.createElement("div",{className:Y.colorFF0000},"\u8BF7\u5148\u9009\u62E9\u5B9E\u8DF5\u8BFE\u7A0B\u53CA\u7AE0\u8282"))},L=R(3878),O=R(98750),k=Object.defineProperty,z=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,Z=(w,T,I)=>T in w?k(w,T,{enumerable:!0,configurable:!0,writable:!0,value:I}):w[T]=I,ae=(w,T)=>{for(var I in T||(T={}))J.call(T,I)&&Z(w,I,T[I]);if(z)for(var I of z(T))ne.call(T,I)&&Z(w,I,T[I]);return w},oe=(w,T)=>{var I={};for(var N in w)J.call(w,N)&&T.indexOf(N)<0&&(I[N]=w[N]);if(w!=null&&z)for(var N of z(w))T.indexOf(N)<0&&ne.call(w,N)&&(I[N]=w[N]);return I},re=(w,T,I)=>new Promise((N,U)=>{var g=$=>{try{D(I.next($))}catch(he){U(he)}},d=$=>{try{D(I.throw($))}catch(he){U(he)}},D=$=>$.done?N($.value):Promise.resolve($.value).then(g,d);D((I=I.apply(w,T)).next())});const Re=w=>{var T=w,{userDetail:I,globalSetting:N,loading:U,user:g,dispatch:d}=T,D=oe(T,["userDetail","globalSetting","loading","user","dispatch"]),$,he,Se,qe,Ue;const[nt,et]=(0,E.useState)("course"),[Pe,Lt]=(0,E.useState)(""),[Me,mt]=(0,E.useState)([]),[ke,Tt]=(0,E.useState)(),[ye,be]=(0,E.useState)(!1),[q,Le]=(0,E.useState)(!1);(0,E.useEffect)(()=>{I.actionTabs.key==="UserDetail-SendToClass"&&Ne(Pe)},[I.actionTabs.key]);const Ne=Ee=>re(void 0,null,function*(){be(!0);const Fe=yield d({type:"userDetail/topicGetCourseList",payload:{search:Ee}});Fe&&mt((Fe==null?void 0:Fe.courses)||[]),be(!1)}),[Qe,V]=(0,E.useState)({subjectId:"",stage_ids:[]}),se=()=>re(void 0,null,function*(){var Ee,Fe,de,ze,rt,We;if(nt==="course"){if(!ke){Le(!0);return}const ut=yield d({type:"userDetail/topicSendToClass",payload:ae({course_id:ke},(Ee=I.actionTabs)==null?void 0:Ee.params)});if(d({type:"userDetail/setActionTabs",payload:{}}),ut&&ut.status===0){const Ve={normal:"common_homework",group:"group_homework",exercise:"exercise",poll:"poll",videos:"video"};(0,l.xg)(`/classrooms/${ke}/${Ve[(de=(Fe=I.actionTabs)==null?void 0:Fe.params)==null?void 0:de.object_type]}`)}}else{if(!Qe.subjectId||!Qe.stage_ids.length){Le(!0);return}(yield(0,O.nI)({id:(rt=(ze=I.actionTabs)==null?void 0:ze.params)==null?void 0:rt.object_id,login:(We=g.userInfo)==null?void 0:We.login},{stage_ids:Qe.stage_ids})).status===0&&(xe.ZP.success("\u53D1\u9001\u6210\u529F"),d({type:"userDetail/setActionTabs",payload:{}}),(0,l.xg)(`/paths/${Qe.subjectId}`))}});return E.createElement(ee.default,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,open:I.actionTabs.key==="UserDetail-SendToClass",title:"\u53D1\u9001",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:U["userDetail/sendToClass"],width:600,afterClose:()=>{Le(!1),mt([]),V({subjectId:"",stage_ids:[]}),Lt("")},onOk:se,wrapClassName:L.Z.CustomCss,onCancel:()=>{d({type:"userDetail/setActionTabs",payload:{}})}},E.createElement(W.default,{activeKey:nt,onChange:Ee=>{Le(!1),et(Ee)},items:[{label:"\u8BFE\u5802",key:"course",children:E.createElement("div",{className:Y.wrap},E.createElement("div",{className:"mb10"},E.createElement(G.t7,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u5802\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:Pe,style:{width:500},onChange:Ee=>{Lt(Ee),Ne(Ee)}})),E.createElement(p.Z,{active:!0,loading:ye},E.createElement("div",{className:Y.radioWrap},E.createElement(ue.ZP.Group,{value:ke,onChange:Ee=>{Tt(Ee.target.value),Le(!1)}},Me.map((Ee,Fe)=>E.createElement(ue.ZP,{className:Y.radio,value:Ee.course_id,key:Ee.course_id},Ee.course_name))))),((he=($=I.actionTabs)==null?void 0:$.params)==null?void 0:he.object_type)!=="videos"&&E.createElement("div",{className:Y.title},"\u6E29\u99A8\u63D0\u793A\uFF1A\u9009\u62E9\u7684\u9898\u5C06\u4F1A\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802"),q&&E.createElement("div",{className:Y.colorFF0000},"\u8BF7\u5148\u9009\u62E9\u8BFE\u5802")),show:!0},{label:"\u5B9E\u8DF5\u8BFE\u7A0B",key:"subject",children:E.createElement(H,{username:(Se=g.userInfo)==null?void 0:Se.login,stages:Qe,setStages:V,hasError:q,setHasError:Le}),show:((Ue=(qe=I.actionTabs)==null?void 0:qe.params)==null?void 0:Ue.object_type)==="videos"}].filter(Ee=>Ee.show)}))};var M=(0,le.connect)(({userDetail:w,loading:T,globalSetting:I,user:N})=>({userDetail:w,globalSetting:I,loading:T.effects,user:N}))(Re)},81428:function(Ut,ft,R){"use strict";R.d(ft,{AL:function(){return k},Iy:function(){return A},Qv:function(){return y},ez:function(){return O},jb:function(){return m}});var E=R(32834),le=R.n(E),xe=R(11690),ee=R.n(xe);let W=1;function p(ae,oe){const re=ae.match(/^(\s+)(?:```)/);if(re===null)return oe;const Re=re[1];return oe.split(`
|
|
`).map(M=>{const w=M.match(/^\s+/);if(w===null)return M;const[T]=w;return T.length>=Re.length?M.slice(Re.length):M}).join(`
|
|
`)}let ue=[],Y=["<ul>"];const l=new(le()).Renderer,G=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){ue.length=0,Y=["<ul>"]}const m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function _(ae,oe,re,Re){if(oe>=ae.length||ae[oe].level<=re)return oe;var M=ae[oe];Re.push("<li><a href='#"+W+M.anchor+"'>"+M.text+"</a>"),oe++;var w=[];return oe=_(ae,oe,M.level,w),w.length>0&&(Re.push("<ul>"),w.forEach(function(T){Re.push(T)}),Re.push("</ul>")),Re.push("</li>"),oe=_(ae,oe,re,Re),oe}function y(){return _(ue,0,0,Y),Y.push("</ul>"),Y.join("")}const b={heading(ae){const oe=G.exec(ae);if(W+=1,oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},fences(ae){const oe=this.rules.block.fences.exec(ae);if(oe){const re=oe[0];let Re=p(re,oe[3]||"");const M=oe[2]?oe[2].trim():oe[2];if(["latex","katex","math"].indexOf(M)>=0){const w=H(),T=Re;Re=w,L[w]={type:"block",expression:T}}return{type:"code",raw:re,lang:M,text:Re}}}},F=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let K=0;const H=()=>`__special_katext_id_${K++}__`;let L={};function O(){return L}function k(){K=0,L={}}function z(ae){return ae=ae.replace(F,(oe,re)=>{const Re=H();return L[Re]={type:"inline",expression:re},Re}),ae}const J=l.listitem;l.listitem=function(ae){return J(z(ae))};const ne=l.paragraph;l.paragraph=function(ae){return ne(z(ae))};const Z=l.tablecell;l.tablecell=function(ae,oe){return Z(z(ae),oe)},l.code=function(ae,oe,re){const Re=(oe||"").match(/\S*/)[0];return Re?["latex","katex","math"].indexOf(Re)>=0?`<p class='editormd-tex'>${ae}</p>`:`<pre class="prettyprint linenums"><code class="language-${oe}">${re?ae:(0,xe.escape)(ae,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(re?ae:(0,xe.escape)(ae,!0))+"</code></pre>"},l.heading=function(ae,oe,re){let Re=this.options.headerPrefix+re.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return ue.push({anchor:Re,level:oe,text:ae}),"<h"+oe+' id="'+W+Re+'">'+ae+"</h"+oe+">"},le().setOptions({silent:!0,gfm:!0,pedantic:!1}),le().use({tokenizer:b,renderer:l}),ft.ZP=le()},64018:function(){var Ut,ft,R,E=!1,le,xe;window.PR_SHOULD_USE_CONTINUATION=!0;var ee,W;(function(){var p=window,ue=["break,continue,do,else,for,if,return,while"],Y=[ue,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],l=[Y,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],G=[l,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],A=[l,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],m=[l,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],_="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[l,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],b="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",F=[ue,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],K=[ue,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],H=[ue,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],L=[G,m,A,y,b,F,K,H],O=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,k="str",z="kwd",J="com",ne="typ",Z="lit",ae="pun",oe="pln",re="tag",Re="dec",M="src",w="atn",T="atv",I="nocode",N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(be){for(var q=0,Le=!1,Ne=!1,Qe=0,V=be.length;Qe<V;++Qe){var se=be[Qe];if(se.ignoreCase)Ne=!0;else if(/[a-z]/i.test(se.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Le=!0,Ne=!1;break}}var Ee={b:8,t:9,n:10,v:11,f:12,r:13};function Fe(ut){var Ve=ut.charCodeAt(0);if(Ve!==92)return Ve;var At=ut.charAt(1);return Ve=Ee[At],Ve||("0"<=At&&At<="7"?parseInt(ut.substring(1),8):At==="u"||At==="x"?parseInt(ut.substring(2),16):ut.charCodeAt(1))}function de(ut){if(ut<32)return(ut<16?"\\x0":"\\x")+ut.toString(16);var Ve=String.fromCharCode(ut);return Ve==="\\"||Ve==="-"||Ve==="]"||Ve==="^"?"\\"+Ve:Ve}function ze(ut){var Ve=ut.substring(1,ut.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),At=[],vt=Ve[0]==="^",ge=["["];vt&&ge.push("^");for(var Ae=vt?1:0,Ze=Ve.length;Ae<Ze;++Ae){var tt=Ve[Ae];if(/\\[bdsw]/i.test(tt))ge.push(tt);else{var Ke=Fe(tt),pt;Ae+2<Ze&&Ve[Ae+1]==="-"?(pt=Fe(Ve[Ae+2]),Ae+=2):pt=Ke,At.push([Ke,pt]),pt<65||Ke>122||(pt<65||Ke>90||At.push([Math.max(65,Ke)|32,Math.min(pt,90)|32]),pt<97||Ke>122||At.push([Math.max(97,Ke)&-33,Math.min(pt,122)&-33]))}}At.sort(function(Ct,it){return Ct[0]-it[0]||it[1]-Ct[1]});for(var gt=[],He=[],Ae=0;Ae<At.length;++Ae){var bt=At[Ae];bt[0]<=He[1]+1?He[1]=Math.max(He[1],bt[1]):gt.push(He=bt)}for(var Ae=0;Ae<gt.length;++Ae){var bt=gt[Ae];ge.push(de(bt[0])),bt[1]>bt[0]&&(bt[1]+1>bt[0]&&ge.push("-"),ge.push(de(bt[1])))}return ge.push("]"),ge.join("")}function rt(ut){for(var Ve=ut.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),At=Ve.length,vt=[],ge=0,Ae=0;ge<At;++ge){var Ze=Ve[ge];if(Ze==="(")++Ae;else if(Ze.charAt(0)==="\\"){var tt=+Ze.substring(1);tt&&(tt<=Ae?vt[tt]=-1:Ve[ge]=de(tt))}}for(var ge=1;ge<vt.length;++ge)vt[ge]===-1&&(vt[ge]=++q);for(var ge=0,Ae=0;ge<At;++ge){var Ze=Ve[ge];if(Ze==="(")++Ae,vt[Ae]||(Ve[ge]="(?:");else if(Ze.charAt(0)==="\\"){var tt=+Ze.substring(1);tt&&tt<=Ae&&(Ve[ge]="\\"+vt[tt])}}for(var ge=0;ge<At;++ge)Ve[ge]==="^"&&Ve[ge+1]!=="^"&&(Ve[ge]="");if(ut.ignoreCase&&Le)for(var ge=0;ge<At;++ge){var Ze=Ve[ge],Ke=Ze.charAt(0);Ze.length>=2&&Ke==="["?Ve[ge]=ze(Ze):Ke!=="\\"&&(Ve[ge]=Ze.replace(/[a-zA-Z]/g,function(He){var bt=He.charCodeAt(0);return"["+String.fromCharCode(bt&-33,bt|32)+"]"}))}return Ve.join("")}for(var We=[],Qe=0,V=be.length;Qe<V;++Qe){var se=be[Qe];if(se.global||se.multiline)throw new Error(""+se);We.push("(?:"+rt(se)+")")}return new RegExp(We.join("|"),Ne?"gi":"g")}function g(be,q){var Le=/(?:^|\s)nocode(?:\s|$)/,Ne=[],Qe=0,V=[],se=0;function Ee(Fe){var de=Fe.nodeType;if(de==1){if(Le.test(Fe.className))return;for(var ze=Fe.firstChild;ze;ze=ze.nextSibling)Ee(ze);var rt=Fe.nodeName.toLowerCase();(rt==="br"||rt==="li")&&(Ne[se]=`
|
|
`,V[se<<1]=Qe++,V[se++<<1|1]=Fe)}else if(de==3||de==4){var We=Fe.nodeValue;We.length&&(q?We=We.replace(/\r\n?/g,`
|
|
`):We=We.replace(/[ \t\r\n]+/g," "),Ne[se]=We,V[se<<1]=Qe,Qe+=We.length,V[se++<<1|1]=Fe)}}return Ee(be),{sourceCode:Ne.join("").replace(/\n$/,""),spans:V}}function d(be,q,Le,Ne,Qe){if(Le){var V={sourceNode:be,pre:1,langExtension:null,numberLines:null,sourceCode:Le,spans:null,basePos:q,decorations:null};Ne(V),Qe.push.apply(Qe,V.decorations)}}var D=/\S/;function $(be){for(var q=void 0,Le=be.firstChild;Le;Le=Le.nextSibling){var Ne=Le.nodeType;q=Ne===1?q?be:Le:Ne===3&&D.test(Le.nodeValue)?be:q}return q===be?void 0:q}function he(be,q){var Le={},Ne;(function(){for(var se=be.concat(q),Ee=[],Fe={},de=0,ze=se.length;de<ze;++de){var rt=se[de],We=rt[3];if(We)for(var ut=We.length;--ut>=0;)Le[We.charAt(ut)]=rt;var Ve=rt[1],At=""+Ve;Fe.hasOwnProperty(At)||(Ee.push(Ve),Fe[At]=null)}Ee.push(/[\0-\uffff]/),Ne=U(Ee)})();var Qe=q.length,V=function(se){for(var Ee=se.sourceCode,Fe=se.basePos,de=se.sourceNode,ze=[Fe,oe],rt=0,We=Ee.match(Ne)||[],ut={},Ve=0,At=We.length;Ve<At;++Ve){var vt=We[Ve],ge=ut[vt],Ae=void 0,Ze;if(typeof ge=="string")Ze=!1;else{var tt=Le[vt.charAt(0)];if(tt)Ae=vt.match(tt[1]),ge=tt[0];else{for(var Ke=0;Ke<Qe;++Ke)if(tt=q[Ke],Ae=vt.match(tt[1]),Ae){ge=tt[0];break}Ae||(ge=oe)}Ze=ge.length>=5&&ge.substring(0,5)==="lang-",Ze&&!(Ae&&typeof Ae[1]=="string")&&(Ze=!1,ge=M),Ze||(ut[vt]=ge)}var pt=rt;if(rt+=vt.length,!Ze)ze.push(Fe+pt,ge);else{var gt=Ae[1],He=vt.indexOf(gt),bt=He+gt.length;Ae[2]&&(bt=vt.length-Ae[2].length,He=bt-gt.length);var Ct=ge.substring(5);d(de,Fe+pt,vt.substring(0,He),V,ze),d(de,Fe+pt+He,gt,Lt(Ct,gt),ze),d(de,Fe+pt+bt,vt.substring(bt),V,ze)}}se.decorations=ze};return V}function Se(be){var q=[],Le=[];be.tripleQuotedStrings?q.push([k,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):be.multiLineStrings?q.push([k,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):q.push([k,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),be.verbatimStrings&&Le.push([k,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ne=be.hashComments;Ne&&(be.cStyleComments?(Ne>1?q.push([J,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):q.push([J,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Le.push([k,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):q.push([J,/^#[^\r\n]*/,null,"#"])),be.cStyleComments&&(Le.push([J,/^\/\/[^\r\n]*/,null]),Le.push([J,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Qe=be.regexLiterals;if(Qe){var V=Qe>1?"":`
|
|
\r`,se=V?".":"[\\S\\s]",Ee="/(?=[^/*"+V+"])(?:[^/\\x5B\\x5C"+V+"]|\\x5C"+se+"|\\x5B(?:[^\\x5C\\x5D"+V+"]|\\x5C"+se+")*(?:\\x5D|$))+/";Le.push(["lang-regex",RegExp("^"+N+"("+Ee+")")])}var Fe=be.types;Fe&&Le.push([ne,Fe]);var de=(""+be.keywords).replace(/^ | $/g,"");de.length&&Le.push([z,new RegExp("^(?:"+de.replace(/[\s,]+/g,"|")+")\\b"),null]),q.push([oe,/^\s+/,null,` \r
|
|
\xA0`]);var ze="^.[^\\s\\w.$@'\"`/\\\\]*";return be.regexLiterals&&(ze+="(?!s*/)"),Le.push([Z,/^@[a-z_$][a-z_$@0-9]*/i,null],[ne,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[oe,/^[a-z_$][a-z_$@0-9]*/i,null],[Z,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[oe,/^\\[\s\S]?/,null],[ae,new RegExp(ze),null]),he(q,Le)}var qe=Se({keywords:L,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ue(be,q,Le){for(var Ne=/(?:^|\s)nocode(?:\s|$)/,Qe=/\r\n?|\n/,V=be.ownerDocument,se=V.createElement("li");be.firstChild;)se.appendChild(be.firstChild);var Ee=[se];function Fe(Ve){var At=Ve.nodeType;if(At==1&&!Ne.test(Ve.className))if(Ve.nodeName==="br")de(Ve),Ve.parentNode&&Ve.parentNode.removeChild(Ve);else for(var vt=Ve.firstChild;vt;vt=vt.nextSibling)Fe(vt);else if((At==3||At==4)&&Le){var ge=Ve.nodeValue,Ae=ge.match(Qe);if(Ae){var Ze=ge.substring(0,Ae.index);Ve.nodeValue=Ze;var tt=ge.substring(Ae.index+Ae[0].length);if(tt){var Ke=Ve.parentNode;Ke.insertBefore(V.createTextNode(tt),Ve.nextSibling)}de(Ve),Ze||Ve.parentNode.removeChild(Ve)}}}function de(Ve){for(;!Ve.nextSibling;)if(Ve=Ve.parentNode,!Ve)return;function At(Ae,Ze){var tt=Ze?Ae.cloneNode(!1):Ae,Ke=Ae.parentNode;if(Ke){var pt=At(Ke,1),gt=Ae.nextSibling;pt.appendChild(tt);for(var He=gt;He;He=gt)gt=He.nextSibling,pt.appendChild(He)}return tt}for(var vt=At(Ve.nextSibling,0),ge;(ge=vt.parentNode)&&ge.nodeType===1;)vt=ge;Ee.push(vt)}for(var ze=0;ze<Ee.length;++ze)Fe(Ee[ze]);q===(q|0)&&Ee[0].setAttribute("value",q);var rt=V.createElement("ol");rt.className="linenums";for(var We=Math.max(0,q-1|0)||0,ze=0,ut=Ee.length;ze<ut;++ze)se=Ee[ze],se.className="L"+(ze+We)%10,se.firstChild||se.appendChild(V.createTextNode("\xA0")),rt.appendChild(se);be.appendChild(rt)}function nt(be){var q=/\bMSIE\s(\d+)/.exec(navigator.userAgent);q=q&&+q[1]<=8;var Le=/\n/g,Ne=be.sourceCode,Qe=Ne.length,V=0,se=be.spans,Ee=se.length,Fe=0,de=be.decorations,ze=de.length,rt=0;de[ze]=Qe;var We,ut;for(ut=We=0;ut<ze;)de[ut]!==de[ut+2]?(de[We++]=de[ut++],de[We++]=de[ut++]):ut+=2;for(ze=We,ut=We=0;ut<ze;){for(var Ve=de[ut],At=de[ut+1],vt=ut+2;vt+2<=ze&&de[vt+1]===At;)vt+=2;de[We++]=Ve,de[We++]=At,ut=vt}ze=de.length=We;var ge=be.sourceNode,Ae="";ge&&(Ae=ge.style.display,ge.style.display="none");try{for(var Ze=null;Fe<Ee;){var tt=se[Fe],Ke=se[Fe+2]||Qe,pt=de[rt+2]||Qe,vt=Math.min(Ke,pt),gt=se[Fe+1],He;if(gt.nodeType!==1&&(He=Ne.substring(V,vt))){q&&(He=He.replace(Le,"\r")),gt.nodeValue=He;var bt=gt.ownerDocument,Ct=bt.createElement("span");Ct.className=de[rt+1];var it=gt.parentNode;it.replaceChild(Ct,gt),Ct.appendChild(gt),V<Ke&&(se[Fe+1]=gt=bt.createTextNode(Ne.substring(vt,Ke)),it.insertBefore(gt,Ct.nextSibling))}V=vt,V>=Ke&&(Fe+=2),V>=pt&&(rt+=2)}}finally{ge&&(ge.style.display=Ae)}}var et={};function Pe(be,q){for(var Le=q.length;--Le>=0;){var Ne=q[Le];et.hasOwnProperty(Ne)?p.console&&console.warn("cannot override language handler %s",Ne):et[Ne]=be}}function Lt(be,q){return be&&et.hasOwnProperty(be)||(be=/^\s*</.test(q)?"default-markup":"default-code"),et[be]}Pe(qe,["default-code"]),Pe(he([],[[oe,/^[^<?]+/],[Re,/^<!\w[^>]*(?:>|$)/],[J,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[ae,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Pe(he([[oe,/^[\s]+/,null,` \r
|
|
`],[T,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[re,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[w,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[ae,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Pe(he([],[[T,/^[\s\S]+/]]),["uq.val"]),Pe(Se({keywords:G,hashComments:!0,cStyleComments:!0,types:O}),["c","cc","cpp","cxx","cyc","m"]),Pe(Se({keywords:"null,true,false"}),["json"]),Pe(Se({keywords:m,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:O}),["cs"]),Pe(Se({keywords:A,cStyleComments:!0}),["java"]),Pe(Se({keywords:H,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Pe(Se({keywords:F,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Pe(Se({keywords:b,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Pe(Se({keywords:K,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Pe(Se({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Pe(Se({keywords:_,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Pe(he([],[[k,/^[\s\S]+/]]),["regex"]);function Me(be){var q=be.langExtension;try{var Le=g(be.sourceNode,be.pre),Ne=Le.sourceCode;be.sourceCode=Ne,be.spans=Le.spans,be.basePos=0,Lt(q,Ne)(be),nt(be)}catch(Qe){p.console&&console.log(Qe&&Qe.stack||Qe)}}function mt(be,q,Le){var Ne=Le||!1,Qe=q||null,V=document.createElement("div");V.innerHTML="<pre>"+be+"</pre>",V=V.firstChild,Ne&&Ue(V,Ne,!0);var se={langExtension:Qe,numberLines:Ne,sourceNode:V,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Me(se),V.innerHTML}function ke(be,q){var Le=q||document.body,Ne=Le.ownerDocument||document;function Qe(tt){return Le.getElementsByTagName(tt)}for(var V=[Qe("pre"),Qe("code"),Qe("xmp")],se=[],Ee=0;Ee<V.length;++Ee)for(var Fe=0,de=V[Ee].length;Fe<de;++Fe)se.push(V[Ee][Fe]);V=null;var ze=Date;ze.now||(ze={now:function(){return+new Date}});var rt=0,We=/\blang(?:uage)?-([\w.]+)(?!\S)/,ut=/\bprettyprint\b/,Ve=/\bprettyprinted\b/,At=/pre|xmp/i,vt=/^code$/i,ge=/^(?:pre|code|xmp)$/i,Ae={};function Ze(){for(var tt=p.PR_SHOULD_USE_CONTINUATION?ze.now()+250:1/0;rt<se.length&&ze.now()<tt;rt++){for(var Ke=se[rt],pt=Ae,gt=Ke;gt=gt.previousSibling;){var He=gt.nodeType,bt=(He===7||He===8)&>.nodeValue;if(bt?!/^\??prettify\b/.test(bt):He!==3||/\S/.test(gt.nodeValue))break;if(bt){pt={},bt.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Te,Ie,je){pt[Ie]=je});break}}var Ct=Ke.className;if((pt!==Ae||ut.test(Ct))&&!Ve.test(Ct)){for(var it=!1,wt=Ke.parentNode;wt;wt=wt.parentNode){var _e=wt.tagName;if(ge.test(_e)&&wt.className&&ut.test(wt.className)){it=!0;break}}if(!it){Ke.className+=" prettyprinted";var me=pt.lang;if(!me){me=Ct.match(We);var pe;!me&&(pe=$(Ke))&&vt.test(pe.tagName)&&(me=pe.className.match(We)),me&&(me=me[1])}var C;if(At.test(Ke.tagName))C=1;else{var j=Ke.currentStyle,X=Ne.defaultView,te=j?j.whiteSpace:X&&X.getComputedStyle?X.getComputedStyle(Ke,null).getPropertyValue("white-space"):0;C=te&&te.substring(0,3)==="pre"}var fe=pt.linenums;(fe=fe==="true"||+fe)||(fe=Ct.match(/\blinenums\b(?::(\d+))?/),fe=fe?fe[1]&&fe[1].length?+fe[1]:!0:!1),fe&&Ue(Ke,fe,C);var ve={langExtension:me,sourceNode:Ke,numberLines:fe,pre:C,sourceCode:null,basePos:null,spans:null,decorations:null};Me(ve)}}}rt<se.length?p.setTimeout(Ze,250):typeof be=="function"&&be()}Ze()}var Tt=p.PR={createSimpleLexer:he,registerLangHandler:Pe,sourceDecorator:Se,PR_ATTRIB_NAME:w,PR_ATTRIB_VALUE:T,PR_COMMENT:J,PR_DECLARATION:Re,PR_KEYWORD:z,PR_LITERAL:Z,PR_NOCODE:I,PR_PLAIN:oe,PR_PUNCTUATION:ae,PR_SOURCE:M,PR_STRING:k,PR_TAG:re,PR_TYPE:ne,prettyPrintOne:E?p.prettyPrintOne=mt:ee=mt,prettyPrint:W=E?p.prettyPrint=ke:W=ke},ye=p.define;typeof ye=="function"&&ye.amd&&ye("google-code-prettify",[],function(){return Tt})})()},25769:function(Ut,ft,R){"use strict";var E=R(98040),le={"text/plain":"Text","text/html":"Url",default:"Text"},xe="Copy to clipboard: #{key}, Enter";function ee(p){var ue=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return p.replace(/#{\s*key\s*}/g,ue)}function W(p,ue){var Y,l,G,A,m,_,y=!1;ue||(ue={}),Y=ue.debug||!1;try{G=E(),A=document.createRange(),m=document.getSelection(),_=document.createElement("span"),_.textContent=p,_.ariaHidden="true",_.style.all="unset",_.style.position="fixed",_.style.top=0,_.style.clip="rect(0, 0, 0, 0)",_.style.whiteSpace="pre",_.style.webkitUserSelect="text",_.style.MozUserSelect="text",_.style.msUserSelect="text",_.style.userSelect="text",_.addEventListener("copy",function(F){if(F.stopPropagation(),ue.format)if(F.preventDefault(),typeof F.clipboardData=="undefined"){Y&&console.warn("unable to use e.clipboardData"),Y&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var K=le[ue.format]||le.default;window.clipboardData.setData(K,p)}else F.clipboardData.clearData(),F.clipboardData.setData(ue.format,p);ue.onCopy&&(F.preventDefault(),ue.onCopy(F.clipboardData))}),document.body.appendChild(_),A.selectNodeContents(_),m.addRange(A);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");y=!0}catch(F){Y&&console.error("unable to copy using execCommand: ",F),Y&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(ue.format||"text",p),ue.onCopy&&ue.onCopy(window.clipboardData),y=!0}catch(K){Y&&console.error("unable to copy using clipboardData: ",K),Y&&console.error("falling back to prompt"),l=ee("message"in ue?ue.message:xe),window.prompt(l,p)}}finally{m&&(typeof m.removeRange=="function"?m.removeRange(A):m.removeAllRanges()),_&&document.body.removeChild(_),G()}return y}Ut.exports=W},53184:function(Ut,ft,R){"use strict";var E,le;function xe(ee,W,p){var ue=function(Y,l){return ee.js_beautify(Y,l)};return ue.js=ee.js_beautify,ue.css=W.css_beautify,ue.html=p.html_beautify,ue.js_beautify=ee.js_beautify,ue.css_beautify=W.css_beautify,ue.html_beautify=p.html_beautify,ue}E=[R(58553),R(87804),R(40998)],le=function(ee,W,p){return xe(ee,W,p)}.apply(ft,E),le!==void 0&&(Ut.exports=le)},87804:function(Ut,ft){var R,E;(function(){var le;(function(){"use strict";var ee=[,,function(Y){function l(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}l.prototype.clone_empty=function(){var m=new l(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},l.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},l.prototype.has_match=function(m){for(var _=this.__items.length-1;_>=0;_--)if(this.__items[_].match(m))return!0;return!1},l.prototype.set_indent=function(m,_){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=_||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},l.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},l.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},l.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},l.prototype.is_empty=function(){return this.__items.length===0},l.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},l.prototype.push=function(m){this.__items.push(m);var _=m.lastIndexOf(`
|
|
`);_!==-1?this.__character_count=m.length-_:this.__character_count+=m.length},l.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},l.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},l.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},l.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},l.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function G(m,_){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),_=_||"",m.indent_level>0&&(_=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=_,this.__base_string_length=_.length}G.prototype.get_indent_size=function(m,_){var y=this.__base_string_length;return _=_||0,m<0&&(y=0),y+=m*this.__indent_size,y+=_,y},G.prototype.get_indent_string=function(m,_){var y=this.__base_string;return _=_||0,m<0&&(m=0,y=""),_+=m*this.__indent_size,this.__ensure_cache(_),y+=this.__cache[_],y},G.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},G.prototype.__add_column=function(){var m=this.__cache.length,_=0,y="";this.__indent_size&&m>=this.__indent_size&&(_=Math.floor(m/this.__indent_size),m-=_*this.__indent_size,y=new Array(_+1).join(this.__indent_string)),m&&(y+=new Array(m+1).join(" ")),this.__cache.push(y)};function A(m,_){this.__indent_cache=new G(m,_),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new l(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}A.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},A.prototype.get_line_number=function(){return this.__lines.length},A.prototype.get_indent_string=function(m,_){return this.__indent_cache.get_indent_string(m,_)},A.prototype.get_indent_size=function(m,_){return this.__indent_cache.get_indent_size(m,_)},A.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},A.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},A.prototype.get_code=function(m){this.trim(!0);var _=this.current_line.pop();_&&(_[_.length-1]===`
|
|
`&&(_=_.replace(/\n+$/g,"")),this.current_line.push(_)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(y=y.replace(/[\n]/g,m)),y},A.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},A.prototype.set_indent=function(m,_){return m=m||0,_=_||0,this.next_line.set_indent(m,_),this.__lines.length>1?(this.current_line.set_indent(m,_),!0):(this.current_line.set_indent(),!1)},A.prototype.add_raw_token=function(m){for(var _=0;_<m.newlines;_++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},A.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},A.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},A.prototype.remove_indent=function(m){for(var _=this.__lines.length;m<_;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},A.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},A.prototype.just_added_newline=function(){return this.current_line.is_empty()},A.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},A.prototype.ensure_empty_line_above=function(m,_){for(var y=this.__lines.length-2;y>=0;){var b=this.__lines[y];if(b.is_empty())break;if(b.item(0).indexOf(m)!==0&&b.item(-1)!==_){this.__lines.splice(y+1,0,new l(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},Y.exports.Output=A},,,,function(Y){function l(m,_){this.raw_options=G(m,_),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}l.prototype._get_array=function(m,_){var y=this.raw_options[m],b=_||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(b=y.concat()):typeof y=="string"&&(b=y.split(/[^a-zA-Z0-9_\/\-]+/)),b},l.prototype._get_boolean=function(m,_){var y=this.raw_options[m],b=y===void 0?!!_:!!y;return b},l.prototype._get_characters=function(m,_){var y=this.raw_options[m],b=_||"";return typeof y=="string"&&(b=y.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),b},l.prototype._get_number=function(m,_){var y=this.raw_options[m];_=parseInt(_,10),isNaN(_)&&(_=0);var b=parseInt(y,10);return isNaN(b)&&(b=_),b},l.prototype._get_selection=function(m,_,y){var b=this._get_selection_list(m,_,y);if(b.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+_+`
|
|
You passed in: '`+this.raw_options[m]+"'");return b[0]},l.prototype._get_selection_list=function(m,_,y){if(!_||_.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[_[0]],!this._is_valid_selection(y,_))throw new Error("Invalid Default Value!");var b=this._get_array(m,y);if(!this._is_valid_selection(b,_))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+_+`
|
|
You passed in: '`+this.raw_options[m]+"'");return b},l.prototype._is_valid_selection=function(m,_){return m.length&&_.length&&!m.some(function(y){return _.indexOf(y)===-1})};function G(m,_){var y={};m=A(m);var b;for(b in m)b!==_&&(y[b]=m[b]);if(_&&m[_])for(b in m[_])y[b]=m[_][b];return y}function A(m){var _={},y;for(y in m){var b=y.replace(/-/g,"_");_[b]=m[y]}return _}Y.exports.Options=l,Y.exports.normalizeOpts=A,Y.exports.mergeOpts=G},,function(Y){var l=RegExp.prototype.hasOwnProperty("sticky");function G(A){this.__input=A||"",this.__input_length=this.__input.length,this.__position=0}G.prototype.restart=function(){this.__position=0},G.prototype.back=function(){this.__position>0&&(this.__position-=1)},G.prototype.hasNext=function(){return this.__position<this.__input_length},G.prototype.next=function(){var A=null;return this.hasNext()&&(A=this.__input.charAt(this.__position),this.__position+=1),A},G.prototype.peek=function(A){var m=null;return A=A||0,A+=this.__position,A>=0&&A<this.__input_length&&(m=this.__input.charAt(A)),m},G.prototype.__match=function(A,m){A.lastIndex=m;var _=A.exec(this.__input);return _&&!(l&&A.sticky)&&_.index!==m&&(_=null),_},G.prototype.test=function(A,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(A,m):!1},G.prototype.testChar=function(A,m){var _=this.peek(m);return A.lastIndex=0,_!==null&&A.test(_)},G.prototype.match=function(A){var m=this.__match(A,this.__position);return m?this.__position+=m[0].length:m=null,m},G.prototype.read=function(A,m,_){var y="",b;return A&&(b=this.match(A),b&&(y+=b[0])),m&&(b||!A)&&(y+=this.readUntil(m,_)),y},G.prototype.readUntil=function(A,m){var _="",y=this.__position;A.lastIndex=this.__position;var b=A.exec(this.__input);return b?(y=b.index,m&&(y+=b[0].length)):y=this.__input_length,_=this.__input.substring(this.__position,y),this.__position=y,_},G.prototype.readUntilAfter=function(A){return this.readUntil(A,!0)},G.prototype.get_regexp=function(A,m){var _=null,y="g";return m&&l&&(y="y"),typeof A=="string"&&A!==""?_=new RegExp(A,y):A&&(_=new RegExp(A.source,y)),_},G.prototype.get_literal_regexp=function(A){return RegExp(A.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},G.prototype.peekUntilAfter=function(A){var m=this.__position,_=this.readUntilAfter(A);return this.__position=m,_},G.prototype.lookBack=function(A){var m=this.__position-1;return m>=A.length&&this.__input.substring(m-A.length,m).toLowerCase()===A},Y.exports.InputScanner=G},,,,,function(Y){function l(G,A){G=typeof G=="string"?G:G.source,A=typeof A=="string"?A:A.source,this.__directives_block_pattern=new RegExp(G+/ beautify( \w+[:]\w+)+ /.source+A,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(G+/\sbeautify\signore:end\s/.source+A,"g")}l.prototype.get_directives=function(G){if(!G.match(this.__directives_block_pattern))return null;var A={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(G);m;)A[m[1]]=m[2],m=this.__directive_pattern.exec(G);return A},l.prototype.readIgnored=function(G){return G.readUntilAfter(this.__directives_end_ignore_pattern)},Y.exports.Directives=l},,function(Y,l,G){var A=G(16).Beautifier,m=G(17).Options;function _(y,b){var F=new A(y,b);return F.beautify()}Y.exports=_,Y.exports.defaultOptions=function(){return new m}},function(Y,l,G){var A=G(17).Options,m=G(2).Output,_=G(8).InputScanner,y=G(13).Directives,b=new y(/\/\*/,/\*\//),F=/\r\n|[\r\n]/,K=/\r\n|[\r\n]/g,H=/\s/,L=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,k=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function z(J,ne){this._source_text=J||"",this._options=new A(ne),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}z.prototype.eatString=function(J){var ne="";for(this._ch=this._input.next();this._ch;){if(ne+=this._ch,this._ch==="\\")ne+=this._input.next();else if(J.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return ne},z.prototype.eatWhitespace=function(J){for(var ne=H.test(this._input.peek()),Z=0;H.test(this._input.peek());)this._ch=this._input.next(),J&&this._ch===`
|
|
`&&(Z===0||Z<this._options.max_preserve_newlines)&&(Z++,this._output.add_new_line(!0));return ne},z.prototype.foundNestedPseudoClass=function(){for(var J=0,ne=1,Z=this._input.peek(ne);Z;){if(Z==="{")return!0;if(Z==="(")J+=1;else if(Z===")"){if(J===0)return!1;J-=1}else if(Z===";"||Z==="}")return!1;ne++,Z=this._input.peek(ne)}return!1},z.prototype.print_string=function(J){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(J)},z.prototype.preserveSingleSpace=function(J){J&&(this._output.space_before_token=!0)},z.prototype.indent=function(){this._indentLevel++},z.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},z.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var J=this._source_text,ne=this._options.eol;ne==="auto"&&(ne=`
|
|
`,J&&F.test(J||"")&&(ne=J.match(F)[0])),J=J.replace(K,`
|
|
`);var Z=J.match(/^[\t ]*/)[0];this._output=new m(this._options,Z),this._input=new _(J),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var ae=0,oe=!1,re=!1,Re=!1,M=!1,w=!1,T=this._ch,I=!1,N,U,g;N=this._input.read(L),U=N!=="",g=T,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),T=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var d=this._input.read(O),D=b.get_directives(d);D&&D.ignore==="start"&&(d+=b.readIgnored(this._input)),this.print_string(d),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(k)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(U),this.print_string(this._ch);var $=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);$.match(/[ :]$/)&&($=this.eatString(": ").replace(/\s+$/,""),this.print_string($),this._output.space_before_token=!0),ae===0&&$.indexOf(":")!==-1&&(re=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var he=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);he.match(/[ :]$/)&&(he=this.eatString(": ").replace(/\s+$/,""),this.print_string(he),this._output.space_before_token=!0),ae===0&&he.indexOf(":")!==-1?(re=!0,this.indent()):he in this.NESTED_AT_RULE?(this._nestedLevel+=1,he in this.CONDITIONAL_GROUP_RULE&&(Re=!0)):ae===0&&!re&&(M=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")re&&(re=!1,this.outdent()),M=!1,Re?(Re=!1,oe=this._indentLevel>=this._nestedLevel):oe=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&oe&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(g==="("?this._output.space_before_token=!1:g!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),g==="{"&&this._output.trim(!0),re&&(this.outdent(),re=!1),this.print_string(this._ch),oe=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var Se=0;Se<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Se++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Se])){I=!0;break}(oe||Re)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!M&&ae===0?(this.print_string(":"),re||(re=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var qe=g==='"'||g==="'";this.preserveSingleSpace(qe||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")I=!1,ae===0?(re&&(this.outdent(),re=!1),M=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),ae++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),ae&&(ae--,this.outdent()));else{var Ue=!1;this._input.lookBack("with")&&(Ue=!0),this.preserveSingleSpace(U||Ue),this.print_string(this._ch),re&&g==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),w=!0):(this.eatWhitespace(),ae++,this.indent())}else if(this._ch===")")ae&&(ae--,this.outdent()),w&&this._input.peek()===";"&&this._options.selector_separator_newline&&(w=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!re||w)&&ae===0&&!M?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!re&&ae===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&H.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),H.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var nt=g==='"'||g==="'";this.preserveSingleSpace(nt||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&I&&this._output.add_new_line()}var et=this._output.get_code(ne);return et},Y.exports.Beautifier=z},function(Y,l,G){var A=G(6).Options;function m(_){A.call(this,_,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var y=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||y;var b=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var F=0;F<b.length;F++)b[F]!=="expand"?this.brace_style="collapse":this.brace_style=b[F]}m.prototype=new A,Y.exports.Options=m}],W={};function p(Y){var l=W[Y];if(l!==void 0)return l.exports;var G=W[Y]={exports:{}};return ee[Y](G,G.exports,p),G.exports}var ue=p(15);le=ue})();var xe=le;R=[],E=function(){return{css_beautify:xe}}.apply(ft,R),E!==void 0&&(Ut.exports=E)})()},40998:function(Ut,ft,R){var E,le;(function(){var xe;(function(){"use strict";var ue=[,,function(A){function m(b){this.__parent=b,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var b=new m(this.__parent);return b.set_indent(this.__indent_count,this.__alignment_count),b},m.prototype.item=function(b){return b<0?this.__items[this.__items.length+b]:this.__items[b]},m.prototype.has_match=function(b){for(var F=this.__items.length-1;F>=0;F--)if(this.__items[F].match(b))return!0;return!1},m.prototype.set_indent=function(b,F){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=F||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(b){this.__items.push(b);var F=b.lastIndexOf(`
|
|
`);F!==-1?this.__character_count=b.length-F:this.__character_count+=b.length},m.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function _(b,F){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),F=F||"",b.indent_level>0&&(F=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=F,this.__base_string_length=F.length}_.prototype.get_indent_size=function(b,F){var K=this.__base_string_length;return F=F||0,b<0&&(K=0),K+=b*this.__indent_size,K+=F,K},_.prototype.get_indent_string=function(b,F){var K=this.__base_string;return F=F||0,b<0&&(b=0,K=""),F+=b*this.__indent_size,this.__ensure_cache(F),K+=this.__cache[F],K},_.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var b=this.__cache.length,F=0,K="";this.__indent_size&&b>=this.__indent_size&&(F=Math.floor(b/this.__indent_size),b-=F*this.__indent_size,K=new Array(F+1).join(this.__indent_string)),b&&(K+=new Array(b+1).join(" ")),this.__cache.push(K)};function y(b,F){this.__indent_cache=new _(b,F),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}y.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},y.prototype.get_line_number=function(){return this.__lines.length},y.prototype.get_indent_string=function(b,F){return this.__indent_cache.get_indent_string(b,F)},y.prototype.get_indent_size=function(b,F){return this.__indent_cache.get_indent_size(b,F)},y.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},y.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},y.prototype.get_code=function(b){this.trim(!0);var F=this.current_line.pop();F&&(F[F.length-1]===`
|
|
`&&(F=F.replace(/\n+$/g,"")),this.current_line.push(F)),this._end_with_newline&&this.__add_outputline();var K=this.__lines.join(`
|
|
`);return b!==`
|
|
`&&(K=K.replace(/[\n]/g,b)),K},y.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},y.prototype.set_indent=function(b,F){return b=b||0,F=F||0,this.next_line.set_indent(b,F),this.__lines.length>1?(this.current_line.set_indent(b,F),!0):(this.current_line.set_indent(),!1)},y.prototype.add_raw_token=function(b){for(var F=0;F<b.newlines;F++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(b.whitespace_before),this.current_line.push(b.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},y.prototype.add_token=function(b){this.__add_space_before_token(),this.current_line.push(b),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},y.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},y.prototype.remove_indent=function(b){for(var F=this.__lines.length;b<F;)this.__lines[b]._remove_indent(),b++;this.current_line._remove_wrap_indent()},y.prototype.trim=function(b){for(b=b===void 0?!1:b,this.current_line.trim();b&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},y.prototype.just_added_newline=function(){return this.current_line.is_empty()},y.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},y.prototype.ensure_empty_line_above=function(b,F){for(var K=this.__lines.length-2;K>=0;){var H=this.__lines[K];if(H.is_empty())break;if(H.item(0).indexOf(b)!==0&&H.item(-1)!==F){this.__lines.splice(K+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}K--}},A.exports.Output=y},function(A){function m(_,y,b,F){this.type=_,this.text=y,this.comments_before=null,this.newlines=b||0,this.whitespace_before=F||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}A.exports.Token=m},,,function(A){function m(b,F){this.raw_options=_(b,F),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(b,F){var K=this.raw_options[b],H=F||[];return typeof K=="object"?K!==null&&typeof K.concat=="function"&&(H=K.concat()):typeof K=="string"&&(H=K.split(/[^a-zA-Z0-9_\/\-]+/)),H},m.prototype._get_boolean=function(b,F){var K=this.raw_options[b],H=K===void 0?!!F:!!K;return H},m.prototype._get_characters=function(b,F){var K=this.raw_options[b],H=F||"";return typeof K=="string"&&(H=K.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),H},m.prototype._get_number=function(b,F){var K=this.raw_options[b];F=parseInt(F,10),isNaN(F)&&(F=0);var H=parseInt(K,10);return isNaN(H)&&(H=F),H},m.prototype._get_selection=function(b,F,K){var H=this._get_selection_list(b,F,K);if(H.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values:
|
|
`+F+`
|
|
You passed in: '`+this.raw_options[b]+"'");return H[0]},m.prototype._get_selection_list=function(b,F,K){if(!F||F.length===0)throw new Error("Selection list cannot be empty.");if(K=K||[F[0]],!this._is_valid_selection(K,F))throw new Error("Invalid Default Value!");var H=this._get_array(b,K);if(!this._is_valid_selection(H,F))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values:
|
|
`+F+`
|
|
You passed in: '`+this.raw_options[b]+"'");return H},m.prototype._is_valid_selection=function(b,F){return b.length&&F.length&&!b.some(function(K){return F.indexOf(K)===-1})};function _(b,F){var K={};b=y(b);var H;for(H in b)H!==F&&(K[H]=b[H]);if(F&&b[F])for(H in b[F])K[H]=b[F][H];return K}function y(b){var F={},K;for(K in b){var H=K.replace(/-/g,"_");F[H]=b[K]}return F}A.exports.Options=m,A.exports.normalizeOpts=y,A.exports.mergeOpts=_},,function(A){var m=RegExp.prototype.hasOwnProperty("sticky");function _(y){this.__input=y||"",this.__input_length=this.__input.length,this.__position=0}_.prototype.restart=function(){this.__position=0},_.prototype.back=function(){this.__position>0&&(this.__position-=1)},_.prototype.hasNext=function(){return this.__position<this.__input_length},_.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__input.charAt(this.__position),this.__position+=1),y},_.prototype.peek=function(y){var b=null;return y=y||0,y+=this.__position,y>=0&&y<this.__input_length&&(b=this.__input.charAt(y)),b},_.prototype.__match=function(y,b){y.lastIndex=b;var F=y.exec(this.__input);return F&&!(m&&y.sticky)&&F.index!==b&&(F=null),F},_.prototype.test=function(y,b){return b=b||0,b+=this.__position,b>=0&&b<this.__input_length?!!this.__match(y,b):!1},_.prototype.testChar=function(y,b){var F=this.peek(b);return y.lastIndex=0,F!==null&&y.test(F)},_.prototype.match=function(y){var b=this.__match(y,this.__position);return b?this.__position+=b[0].length:b=null,b},_.prototype.read=function(y,b,F){var K="",H;return y&&(H=this.match(y),H&&(K+=H[0])),b&&(H||!y)&&(K+=this.readUntil(b,F)),K},_.prototype.readUntil=function(y,b){var F="",K=this.__position;y.lastIndex=this.__position;var H=y.exec(this.__input);return H?(K=H.index,b&&(K+=H[0].length)):K=this.__input_length,F=this.__input.substring(this.__position,K),this.__position=K,F},_.prototype.readUntilAfter=function(y){return this.readUntil(y,!0)},_.prototype.get_regexp=function(y,b){var F=null,K="g";return b&&m&&(K="y"),typeof y=="string"&&y!==""?F=new RegExp(y,K):y&&(F=new RegExp(y.source,K)),F},_.prototype.get_literal_regexp=function(y){return RegExp(y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(y){var b=this.__position,F=this.readUntilAfter(y);return this.__position=b,F},_.prototype.lookBack=function(y){var b=this.__position-1;return b>=y.length&&this.__input.substring(b-y.length,b).toLowerCase()===y},A.exports.InputScanner=_},function(A,m,_){var y=_(8).InputScanner,b=_(3).Token,F=_(10).TokenStream,K=_(11).WhitespacePattern,H={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},L=function(O,k){this._input=new y(O),this._options=k||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new K(this._input)};L.prototype.tokenize=function(){this._input.restart(),this.__tokens=new F,this._reset();for(var O,k=new b(H.START,""),z=null,J=[],ne=new F;k.type!==H.EOF;){for(O=this._get_next_token(k,z);this._is_comment(O);)ne.add(O),O=this._get_next_token(k,z);ne.isEmpty()||(O.comments_before=ne,ne=new F),O.parent=z,this._is_opening(O)?(J.push(z),z=O):z&&this._is_closing(O,z)&&(O.opened=z,z.closed=O,z=J.pop(),O.parent=z),O.previous=k,k.next=O,this.__tokens.add(O),k=O}return this.__tokens},L.prototype._is_first_token=function(){return this.__tokens.isEmpty()},L.prototype._reset=function(){},L.prototype._get_next_token=function(O,k){this._readWhitespace();var z=this._input.read(/.+/g);return z?this._create_token(H.RAW,z):this._create_token(H.EOF,"")},L.prototype._is_comment=function(O){return!1},L.prototype._is_opening=function(O){return!1},L.prototype._is_closing=function(O,k){return!1},L.prototype._create_token=function(O,k){var z=new b(O,k,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return z},L.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},A.exports.Tokenizer=L,A.exports.TOKEN=H},function(A){function m(_){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=_}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var _=null;return this.hasNext()&&(_=this.__tokens[this.__position],this.__position+=1),_},m.prototype.peek=function(_){var y=null;return _=_||0,_+=this.__position,_>=0&&_<this.__tokens_length&&(y=this.__tokens[_]),y},m.prototype.add=function(_){this.__parent_token&&(_.parent=this.__parent_token),this.__tokens.push(_),this.__tokens_length+=1},A.exports.TokenStream=m},function(A,m,_){var y=_(12).Pattern;function b(F,K){y.call(this,F,K),K?this._line_regexp=this._input.get_regexp(K._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}b.prototype=new y,b.prototype.__set_whitespace_patterns=function(F,K){F+="\\t ",K+="\\n\\r",this._match_pattern=this._input.get_regexp("["+F+K+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+K+"]")},b.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var F=this._input.read(this._match_pattern);if(F===" ")this.whitespace_before_token=" ";else if(F){var K=this.__split(this._newline_regexp,F);this.newline_count=K.length-1,this.whitespace_before_token=K[this.newline_count]}return F},b.prototype.matching=function(F,K){var H=this._create();return H.__set_whitespace_patterns(F,K),H._update(),H},b.prototype._create=function(){return new b(this._input,this)},b.prototype.__split=function(F,K){F.lastIndex=0;for(var H=0,L=[],O=F.exec(K);O;)L.push(K.substring(H,O.index)),H=O.index+O[0].length,O=F.exec(K);return H<K.length?L.push(K.substring(H,K.length)):L.push(""),L},A.exports.WhitespacePattern=b},function(A){function m(_,y){this._input=_,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,y&&(this._starting_pattern=this._input.get_regexp(y._starting_pattern,!0),this._match_pattern=this._input.get_regexp(y._match_pattern,!0),this._until_pattern=this._input.get_regexp(y._until_pattern),this._until_after=y._until_after)}m.prototype.read=function(){var _=this._input.read(this._starting_pattern);return(!this._starting_pattern||_)&&(_+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),_},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(_){var y=this._create();return y._until_after=!0,y._until_pattern=this._input.get_regexp(_),y._update(),y},m.prototype.until=function(_){var y=this._create();return y._until_after=!1,y._until_pattern=this._input.get_regexp(_),y._update(),y},m.prototype.starting_with=function(_){var y=this._create();return y._starting_pattern=this._input.get_regexp(_,!0),y._update(),y},m.prototype.matching=function(_){var y=this._create();return y._match_pattern=this._input.get_regexp(_,!0),y._update(),y},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},A.exports.Pattern=m},function(A){function m(_,y){_=typeof _=="string"?_:_.source,y=typeof y=="string"?y:y.source,this.__directives_block_pattern=new RegExp(_+/ beautify( \w+[:]\w+)+ /.source+y,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(_+/\sbeautify\signore:end\s/.source+y,"g")}m.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var y={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(_);b;)y[b[1]]=b[2],b=this.__directive_pattern.exec(_);return y},m.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},A.exports.Directives=m},function(A,m,_){var y=_(12).Pattern,b={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function F(K,H){y.call(this,K,H),this.__template_pattern=null,this._disabled=Object.assign({},b),this._excluded=Object.assign({},b),H&&(this.__template_pattern=this._input.get_regexp(H.__template_pattern),this._excluded=Object.assign(this._excluded,H._excluded),this._disabled=Object.assign(this._disabled,H._disabled));var L=new y(K);this.__patterns={handlebars_comment:L.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:L.starting_with(/{{{/).until_after(/}}}/),handlebars:L.starting_with(/{{/).until_after(/}}/),php:L.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:L.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:L.starting_with(/{%/).until_after(/%}/),django_value:L.starting_with(/{{/).until_after(/}}/),django_comment:L.starting_with(/{#/).until_after(/#}/),smarty:L.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:L.starting_with(/{\*/).until_after(/\*}/),smarty_literal:L.starting_with(/{literal}/).until_after(/{\/literal}/)}}F.prototype=new y,F.prototype._create=function(){return new F(this._input,this)},F.prototype._update=function(){this.__set_templated_pattern()},F.prototype.disable=function(K){var H=this._create();return H._disabled[K]=!0,H._update(),H},F.prototype.read_options=function(K){var H=this._create();for(var L in b)H._disabled[L]=K.templating.indexOf(L)===-1;return H._update(),H},F.prototype.exclude=function(K){var H=this._create();return H._excluded[K]=!0,H._update(),H},F.prototype.read=function(){var K="";this._match_pattern?K=this._input.read(this._starting_pattern):K=this._input.read(this._starting_pattern,this.__template_pattern);for(var H=this._read_template();H;)this._match_pattern?H+=this._input.read(this._match_pattern):H+=this._input.readUntil(this.__template_pattern),K+=H,H=this._read_template();return this._until_after&&(K+=this._input.readUntilAfter(this._until_pattern)),K},F.prototype.__set_templated_pattern=function(){var K=[];this._disabled.php||K.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||K.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||K.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||K.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(K.push(this.__patterns.django._starting_pattern.source),K.push(this.__patterns.django_value._starting_pattern.source),K.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||K.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&K.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+K.join("|")+")")},F.prototype._read_template=function(){var K="",H=this._input.peek();if(H==="<"){var L=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&L==="?"&&(K=K||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&L==="%"&&(K=K||this.__patterns.erb.read())}else H==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(K=K||this.__patterns.handlebars_comment.read(),K=K||this.__patterns.handlebars_unescaped.read(),K=K||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(K=K||this.__patterns.django_value.read()),this._excluded.django||(K=K||this.__patterns.django_comment.read(),K=K||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(K=K||this.__patterns.smarty_comment.read(),K=K||this.__patterns.smarty_literal.read(),K=K||this.__patterns.smarty.read()));return K},A.exports.TemplatablePattern=F},,,,function(A,m,_){var y=_(19).Beautifier,b=_(20).Options;function F(K,H,L,O){var k=new y(K,H,L,O);return k.beautify()}A.exports=F,A.exports.defaultOptions=function(){return new b}},function(A,m,_){var y=_(20).Options,b=_(2).Output,F=_(21).Tokenizer,K=_(21).TOKEN,H=/\r\n|[\r\n]/,L=/\r\n|[\r\n]/g,O=function(M,w){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=M.max_preserve_newlines,this.preserve_newlines=M.preserve_newlines,this._output=new b(M,w)};O.prototype.current_line_has_match=function(M){return this._output.current_line.has_match(M)},O.prototype.set_space_before_token=function(M,w){this._output.space_before_token=M,this._output.non_breaking_space=w},O.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},O.prototype.add_raw_token=function(M){this._output.add_raw_token(M)},O.prototype.print_preserved_newlines=function(M){var w=0;M.type!==K.TEXT&&M.previous.type!==K.TEXT&&(w=M.newlines?1:0),this.preserve_newlines&&(w=M.newlines<this.max_preserve_newlines+1?M.newlines:this.max_preserve_newlines+1);for(var T=0;T<w;T++)this.print_newline(T>0);return w!==0},O.prototype.traverse_whitespace=function(M){return M.whitespace_before||M.newlines?(this.print_preserved_newlines(M)||(this._output.space_before_token=!0),!0):!1},O.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},O.prototype.print_newline=function(M){this._output.add_new_line(M)},O.prototype.print_token=function(M){M.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(M.text))},O.prototype.indent=function(){this.indent_level++},O.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},O.prototype.get_full_indent=function(M){return M=this.indent_level+(M||0),M<1?"":this._output.get_indent_string(M)};var k=function(M){for(var w=null,T=M.next;T.type!==K.EOF&&M.closed!==T;){if(T.type===K.ATTRIBUTE&&T.text==="type"){T.next&&T.next.type===K.EQUALS&&T.next.next&&T.next.next.type===K.VALUE&&(w=T.next.next.text);break}T=T.next}return w},z=function(M,w){var T=null,I=null;return w.closed?(M==="script"?T="text/javascript":M==="style"&&(T="text/css"),T=k(w)||T,T.search("text/css")>-1?I="css":T.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?I="javascript":T.search(/(text|application|dojo)\/(x-)?(html)/)>-1?I="html":T.search(/test\/null/)>-1&&(I="null"),I):null};function J(M,w){return w.indexOf(M)!==-1}function ne(M,w,T){this.parent=M||null,this.tag=w?w.tag_name:"",this.indent_level=T||0,this.parser_token=w||null}function Z(M){this._printer=M,this._current_frame=null}Z.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},Z.prototype.record_tag=function(M){var w=new ne(this._current_frame,M,this._printer.indent_level);this._current_frame=w},Z.prototype._try_pop_frame=function(M){var w=null;return M&&(w=M.parser_token,this._printer.indent_level=M.indent_level,this._current_frame=M.parent),w},Z.prototype._get_frame=function(M,w){for(var T=this._current_frame;T&&M.indexOf(T.tag)===-1;){if(w&&w.indexOf(T.tag)!==-1){T=null;break}T=T.parent}return T},Z.prototype.try_pop=function(M,w){var T=this._get_frame([M],w);return this._try_pop_frame(T)},Z.prototype.indent_to_tag=function(M){var w=this._get_frame(M);w&&(this._printer.indent_level=w.indent_level)};function ae(M,w,T,I){this._source_text=M||"",w=w||{},this._js_beautify=T,this._css_beautify=I,this._tag_stack=null;var N=new y(w,"html");this._options=N,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}ae.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var M=this._source_text,w=this._options.eol;this._options.eol==="auto"&&(w=`
|
|
`,M&&H.test(M)&&(w=M.match(H)[0])),M=M.replace(L,`
|
|
`);var T=M.match(/^[\t ]*/)[0],I={text:"",type:""},N=new oe(this._options),U=new O(this._options,T),g=new F(M,this._options).tokenize();this._tag_stack=new Z(U);for(var d=null,D=g.next();D.type!==K.EOF;)D.type===K.TAG_OPEN||D.type===K.COMMENT?(d=this._handle_tag_open(U,D,N,I,g),N=d):D.type===K.ATTRIBUTE||D.type===K.EQUALS||D.type===K.VALUE||D.type===K.TEXT&&!N.tag_complete?d=this._handle_inside_tag(U,D,N,I):D.type===K.TAG_CLOSE?d=this._handle_tag_close(U,D,N):D.type===K.TEXT?d=this._handle_text(U,D,N):D.type===K.CONTROL_FLOW_OPEN?d=this._handle_control_flow_open(U,D):D.type===K.CONTROL_FLOW_CLOSE?d=this._handle_control_flow_close(U,D):U.add_raw_token(D),I=d,D=g.next();var $=U._output.get_code(w);return $},ae.prototype._handle_control_flow_open=function(M,w){var T={text:w.text,type:w.type};return M.set_space_before_token(w.newlines||w.whitespace_before!=="",!0),w.newlines?M.print_preserved_newlines(w):M.set_space_before_token(w.newlines||w.whitespace_before!=="",!0),M.print_token(w),M.indent(),T},ae.prototype._handle_control_flow_close=function(M,w){var T={text:w.text,type:w.type};return M.deindent(),w.newlines?M.print_preserved_newlines(w):M.set_space_before_token(w.newlines||w.whitespace_before!=="",!0),M.print_token(w),T},ae.prototype._handle_tag_close=function(M,w,T){var I={text:w.text,type:w.type};return M.alignment_size=0,T.tag_complete=!0,M.set_space_before_token(w.newlines||w.whitespace_before!=="",!0),T.is_unformatted?M.add_raw_token(w):(T.tag_start_char==="<"&&(M.set_space_before_token(w.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&T.has_wrapped_attrs&&M.print_newline(!1)),M.print_token(w)),T.indent_content&&!(T.is_unformatted||T.is_content_unformatted)&&(M.indent(),T.indent_content=!1),!T.is_inline_element&&!(T.is_unformatted||T.is_content_unformatted)&&M.set_wrap_point(),I},ae.prototype._handle_inside_tag=function(M,w,T,I){var N=T.has_wrapped_attrs,U={text:w.text,type:w.type};return M.set_space_before_token(w.newlines||w.whitespace_before!=="",!0),T.is_unformatted?M.add_raw_token(w):T.tag_start_char==="{"&&w.type===K.TEXT?M.print_preserved_newlines(w)?(w.newlines=0,M.add_raw_token(w)):M.print_token(w):(w.type===K.ATTRIBUTE?M.set_space_before_token(!0):(w.type===K.EQUALS||w.type===K.VALUE&&w.previous.type===K.EQUALS)&&M.set_space_before_token(!1),w.type===K.ATTRIBUTE&&T.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(M.traverse_whitespace(w),N=N||w.newlines!==0),this._is_wrap_attributes_force&&T.attr_count>=this._options.wrap_attributes_min_attrs&&(I.type!==K.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(M.print_newline(!1),N=!0)),M.print_token(w),N=N||M.previous_token_wrapped(),T.has_wrapped_attrs=N),U},ae.prototype._handle_text=function(M,w,T){var I={text:w.text,type:"TK_CONTENT"};return T.custom_beautifier_name?this._print_custom_beatifier_text(M,w,T):T.is_unformatted||T.is_content_unformatted?M.add_raw_token(w):(M.traverse_whitespace(w),M.print_token(w)),I},ae.prototype._print_custom_beatifier_text=function(M,w,T){var I=this;if(w.text!==""){var N=w.text,U,g=1,d="",D="";T.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?U=this._js_beautify:T.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?U=this._css_beautify:T.custom_beautifier_name==="html"&&(U=function(nt,et){var Pe=new ae(nt,et,I._js_beautify,I._css_beautify);return Pe.beautify()}),this._options.indent_scripts==="keep"?g=0:this._options.indent_scripts==="separate"&&(g=-M.indent_level);var $=M.get_full_indent(g);if(N=N.replace(/\n[ \t]*$/,""),T.custom_beautifier_name!=="html"&&N[0]==="<"&&N.match(/^(<!--|<!\[CDATA\[)/)){var he=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(N);if(!he){M.add_raw_token(w);return}d=$+he[1]+`
|
|
`,N=he[4],he[5]&&(D=$+he[5]),N=N.replace(/\n[ \t]*$/,""),(he[2]||he[3].indexOf(`
|
|
`)!==-1)&&(he=he[3].match(/[ \t]+$/),he&&(w.whitespace_before=he[0]))}if(N)if(U){var Se=function(){this.eol=`
|
|
`};Se.prototype=this._options.raw_options;var qe=new Se;N=U($+N,qe)}else{var Ue=w.whitespace_before;Ue&&(N=N.replace(new RegExp(`
|
|
(`+Ue+")?","g"),`
|
|
`)),N=$+N.replace(/\n/g,`
|
|
`+$)}d&&(N?N=d+N+`
|
|
`+D:N=d+D),M.print_newline(!1),N&&(w.text=N,w.whitespace_before="",w.newlines=0,M.add_raw_token(w),M.print_newline(!0))}},ae.prototype._handle_tag_open=function(M,w,T,I,N){var U=this._get_tag_open_token(w);if((T.is_unformatted||T.is_content_unformatted)&&!T.is_empty_element&&w.type===K.TAG_OPEN&&!U.is_start_tag?(M.add_raw_token(w),U.start_tag_token=this._tag_stack.try_pop(U.tag_name)):(M.traverse_whitespace(w),this._set_tag_position(M,w,U,T,I),U.is_inline_element||M.set_wrap_point(),M.print_token(w)),U.is_start_tag&&this._is_wrap_attributes_force){var g=0,d;do d=N.peek(g),d.type===K.ATTRIBUTE&&(U.attr_count+=1),g+=1;while(d.type!==K.EOF&&d.type!==K.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(U.alignment_size=w.text.length+1),!U.tag_complete&&!U.is_unformatted&&(M.alignment_size=U.alignment_size),U};var oe=function(M,w,T){if(this.parent=w||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!T)this.tag_complete=!0;else{var I;this.tag_start_char=T.text[0],this.text=T.text,this.tag_start_char==="<"?(I=T.text.match(/^<([^\s>]*)/),this.tag_check=I?I[1]:""):(I=T.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=I?I[1]:"",(T.text.startsWith("{{#>")||T.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&T.next!==null?this.tag_check=T.next.text.split(" ")[0]:this.tag_check=T.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),T.type===K.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||T.closed&&T.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(N=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!M.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};ae.prototype._get_tag_open_token=function(M){var w=new oe(this._options,this._tag_stack.get_parser_token(),M);return w.alignment_size=this._options.wrap_attributes_indent_size,w.is_end_tag=w.is_end_tag||J(w.tag_check,this._options.void_elements),w.is_empty_element=w.tag_complete||w.is_start_tag&&w.is_end_tag,w.is_unformatted=!w.tag_complete&&J(w.tag_check,this._options.unformatted),w.is_content_unformatted=!w.is_empty_element&&J(w.tag_check,this._options.content_unformatted),w.is_inline_element=J(w.tag_name,this._options.inline)||this._options.inline_custom_elements&&w.tag_name.includes("-")||w.tag_start_char==="{",w},ae.prototype._set_tag_position=function(M,w,T,I,N){if(T.is_empty_element||(T.is_end_tag?T.start_tag_token=this._tag_stack.try_pop(T.tag_name):(this._do_optional_end_element(T)&&(T.is_inline_element||M.print_newline(!1)),this._tag_stack.record_tag(T),(T.tag_name==="script"||T.tag_name==="style")&&!(T.is_unformatted||T.is_content_unformatted)&&(T.custom_beautifier_name=z(T.tag_check,w)))),J(T.tag_check,this._options.extra_liners)&&(M.print_newline(!1),M._output.just_added_blankline()||M.print_newline(!0)),T.is_empty_element){if(T.tag_start_char==="{"&&T.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),T.indent_content=!0;var U=M.current_line_has_match(/{{#if/);U||M.print_newline(!1)}T.tag_name==="!--"&&N.type===K.TAG_CLOSE&&I.is_end_tag&&T.text.indexOf(`
|
|
`)===-1||(T.is_inline_element||T.is_unformatted||M.print_newline(!1),this._calcluate_parent_multiline(M,T))}else if(T.is_end_tag){var g=!1;g=T.start_tag_token&&T.start_tag_token.multiline_content,g=g||!T.is_inline_element&&!(I.is_inline_element||I.is_unformatted)&&!(N.type===K.TAG_CLOSE&&T.start_tag_token===I)&&N.type!=="TK_CONTENT",(T.is_content_unformatted||T.is_unformatted)&&(g=!1),g&&M.print_newline(!1)}else T.indent_content=!T.custom_beautifier_name,T.tag_start_char==="<"&&(T.tag_name==="html"?T.indent_content=this._options.indent_inner_html:T.tag_name==="head"?T.indent_content=this._options.indent_head_inner_html:T.tag_name==="body"&&(T.indent_content=this._options.indent_body_inner_html)),!(T.is_inline_element||T.is_unformatted)&&(N.type!=="TK_CONTENT"||T.is_content_unformatted)&&M.print_newline(!1),this._calcluate_parent_multiline(M,T)},ae.prototype._calcluate_parent_multiline=function(M,w){w.parent&&M._output.just_added_newline()&&!((w.is_inline_element||w.is_unformatted)&&w.parent.is_inline_element)&&(w.parent.multiline_content=!0)};var re=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],Re=["a","audio","del","ins","map","noscript","video"];ae.prototype._do_optional_end_element=function(M){var w=null;if(!(M.is_empty_element||!M.is_start_tag||!M.parent)){if(M.tag_name==="body")w=w||this._tag_stack.try_pop("head");else if(M.tag_name==="li")w=w||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(M.tag_name==="dd"||M.tag_name==="dt")w=w||this._tag_stack.try_pop("dt",["dl"]),w=w||this._tag_stack.try_pop("dd",["dl"]);else if(M.parent.tag_name==="p"&&re.indexOf(M.tag_name)!==-1){var T=M.parent.parent;(!T||Re.indexOf(T.tag_name)===-1)&&(w=w||this._tag_stack.try_pop("p"))}else M.tag_name==="rp"||M.tag_name==="rt"?(w=w||this._tag_stack.try_pop("rt",["ruby","rtc"]),w=w||this._tag_stack.try_pop("rp",["ruby","rtc"])):M.tag_name==="optgroup"?w=w||this._tag_stack.try_pop("optgroup",["select"]):M.tag_name==="option"?w=w||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):M.tag_name==="colgroup"?w=w||this._tag_stack.try_pop("caption",["table"]):M.tag_name==="thead"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"])):M.tag_name==="tbody"||M.tag_name==="tfoot"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"]),w=w||this._tag_stack.try_pop("thead",["table"]),w=w||this._tag_stack.try_pop("tbody",["table"])):M.tag_name==="tr"?(w=w||this._tag_stack.try_pop("caption",["table"]),w=w||this._tag_stack.try_pop("colgroup",["table"]),w=w||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(M.tag_name==="th"||M.tag_name==="td")&&(w=w||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),w=w||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return M.parent=this._tag_stack.get_parser_token(),w}},A.exports.Beautifier=ae},function(A,m,_){var y=_(6).Options;function b(F){y.call(this,F,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}b.prototype=new y,A.exports.Options=b},function(A,m,_){var y=_(9).Tokenizer,b=_(9).TOKEN,F=_(13).Directives,K=_(14).TemplatablePattern,H=_(12).Pattern,L={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:b.START,RAW:b.RAW,EOF:b.EOF},O=new F(/<\!--/,/-->/),k=function(z,J){y.call(this,z,J),this._current_tag_name="";var ne=new K(this._input).read_options(this._options),Z=new H(this._input);if(this.__patterns={word:ne.until(/[\n\r\t <]/),word_control_flow_close_excluded:ne.until(/[\n\r\t <}]/),single_quote:ne.until_after(/'/),double_quote:ne.until_after(/"/),attribute:ne.until(/[\n\r\t =>]|\/>/),element_name:ne.until(/[\n\r\t >\/]/),angular_control_flow_start:Z.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:Z.starting_with(/{{!--/).until_after(/--}}/),handlebars:Z.starting_with(/{{/).until_after(/}}/),handlebars_open:Z.until(/[\n\r\t }]/),handlebars_raw_close:Z.until(/}}/),comment:Z.starting_with(/<!--/).until_after(/-->/),cdata:Z.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:Z.starting_with(/<!\[/).until_after(/]>/),processing:Z.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var ae=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=Z.matching(ae).until_after(ae)}};k.prototype=new y,k.prototype._is_comment=function(z){return!1},k.prototype._is_opening=function(z){return z.type===L.TAG_OPEN||z.type===L.CONTROL_FLOW_OPEN},k.prototype._is_closing=function(z,J){return z.type===L.TAG_CLOSE&&J&&((z.text===">"||z.text==="/>")&&J.text[0]==="<"||z.text==="}}"&&J.text[0]==="{"&&J.text[1]==="{")||z.type===L.CONTROL_FLOW_CLOSE&&z.text==="}"&&J.text.endsWith("{")},k.prototype._reset=function(){this._current_tag_name=""},k.prototype._get_next_token=function(z,J){var ne=null;this._readWhitespace();var Z=this._input.peek();return Z===null?this._create_token(L.EOF,""):(ne=ne||this._read_open_handlebars(Z,J),ne=ne||this._read_attribute(Z,z,J),ne=ne||this._read_close(Z,J),ne=ne||this._read_script_and_style(Z,z),ne=ne||this._read_control_flows(Z,J),ne=ne||this._read_raw_content(Z,z,J),ne=ne||this._read_content_word(Z,J),ne=ne||this._read_comment_or_cdata(Z),ne=ne||this._read_processing(Z),ne=ne||this._read_open(Z,J),ne=ne||this._create_token(L.UNKNOWN,this._input.next()),ne)},k.prototype._read_comment_or_cdata=function(z){var J=null,ne=null,Z=null;if(z==="<"){var ae=this._input.peek(1);ae==="!"&&(ne=this.__patterns.comment.read(),ne?(Z=O.get_directives(ne),Z&&Z.ignore==="start"&&(ne+=O.readIgnored(this._input))):ne=this.__patterns.cdata.read()),ne&&(J=this._create_token(L.COMMENT,ne),J.directives=Z)}return J},k.prototype._read_processing=function(z){var J=null,ne=null,Z=null;if(z==="<"){var ae=this._input.peek(1);(ae==="!"||ae==="?")&&(ne=this.__patterns.conditional_comment.read(),ne=ne||this.__patterns.processing.read()),ne&&(J=this._create_token(L.COMMENT,ne),J.directives=Z)}return J},k.prototype._read_open=function(z,J){var ne=null,Z=null;return(!J||J.type===L.CONTROL_FLOW_OPEN)&&z==="<"&&(ne=this._input.next(),this._input.peek()==="/"&&(ne+=this._input.next()),ne+=this.__patterns.element_name.read(),Z=this._create_token(L.TAG_OPEN,ne)),Z},k.prototype._read_open_handlebars=function(z,J){var ne=null,Z=null;return(!J||J.type===L.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&z==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(ne=this.__patterns.handlebars_comment.read(),ne=ne||this.__patterns.handlebars.read(),Z=this._create_token(L.COMMENT,ne)):(ne=this.__patterns.handlebars_open.read(),Z=this._create_token(L.TAG_OPEN,ne))),Z},k.prototype._read_control_flows=function(z,J){var ne="",Z=null;if(!this._options.templating.includes("angular"))return Z;if(z==="@"){if(ne=this.__patterns.angular_control_flow_start.read(),ne==="")return Z;for(var ae=ne.endsWith("(")?1:0,oe=0;!(ne.endsWith("{")&&ae===oe);){var re=this._input.next();if(re===null)break;re==="("?ae++:re===")"&&oe++,ne+=re}Z=this._create_token(L.CONTROL_FLOW_OPEN,ne)}else z==="}"&&J&&J.type===L.CONTROL_FLOW_OPEN&&(ne=this._input.next(),Z=this._create_token(L.CONTROL_FLOW_CLOSE,ne));return Z},k.prototype._read_close=function(z,J){var ne=null,Z=null;return J&&J.type===L.TAG_OPEN&&(J.text[0]==="<"&&(z===">"||z==="/"&&this._input.peek(1)===">")?(ne=this._input.next(),z==="/"&&(ne+=this._input.next()),Z=this._create_token(L.TAG_CLOSE,ne)):J.text[0]==="{"&&z==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),Z=this._create_token(L.TAG_CLOSE,"}}"))),Z},k.prototype._read_attribute=function(z,J,ne){var Z=null,ae="";if(ne&&ne.text[0]==="<")if(z==="=")Z=this._create_token(L.EQUALS,this._input.next());else if(z==='"'||z==="'"){var oe=this._input.next();z==='"'?oe+=this.__patterns.double_quote.read():oe+=this.__patterns.single_quote.read(),Z=this._create_token(L.VALUE,oe)}else ae=this.__patterns.attribute.read(),ae&&(J.type===L.EQUALS?Z=this._create_token(L.VALUE,ae):Z=this._create_token(L.ATTRIBUTE,ae));return Z},k.prototype._is_content_unformatted=function(z){return this._options.void_elements.indexOf(z)===-1&&(this._options.content_unformatted.indexOf(z)!==-1||this._options.unformatted.indexOf(z)!==-1)},k.prototype._read_raw_content=function(z,J,ne){var Z="";if(ne&&ne.text[0]==="{")Z=this.__patterns.handlebars_raw_close.read();else if(J.type===L.TAG_CLOSE&&J.opened.text[0]==="<"&&J.text[0]!=="/"){var ae=J.opened.text.substr(1).toLowerCase();this._is_content_unformatted(ae)&&(Z=this._input.readUntil(new RegExp("</"+ae+"[\\n\\r\\t ]*?>","ig")))}return Z?this._create_token(L.TEXT,Z):null},k.prototype._read_script_and_style=function(z,J){if(J.type===L.TAG_CLOSE&&J.opened.text[0]==="<"&&J.text[0]!=="/"){var ne=J.opened.text.substr(1).toLowerCase();if(ne==="script"||ne==="style"){var Z=this._read_comment_or_cdata(z);if(Z)return Z.type=L.TEXT,Z;var ae=this._input.readUntil(new RegExp("</"+ne+"[\\n\\r\\t ]*?>","ig"));if(ae)return this._create_token(L.TEXT,ae)}}return null},k.prototype._read_content_word=function(z,J){var ne="";return this._options.unformatted_content_delimiter&&z===this._options.unformatted_content_delimiter[0]&&(ne=this.__patterns.unformatted_content_delimiter.read()),ne||(ne=J&&J.type===L.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),ne?this._create_token(L.TEXT,ne):null},A.exports.Tokenizer=k,A.exports.TOKEN=L}],Y={};function l(A){var m=Y[A];if(m!==void 0)return m.exports;var _=Y[A]={exports:{}};return ue[A](_,_.exports,l),_.exports}var G=l(18);xe=G})();var ee=xe;if(1)E=[R,R(58553),R(87804)],le=function(ue){var Y=R(58553),l=R(87804);return{html_beautify:function(G,A){return ee(G,A,Y.js_beautify,l.css_beautify)}}}.apply(ft,E),le!==void 0&&(Ut.exports=le);else var W,p})()},58553:function(Ut,ft){var R,E;(function(){var le;(function(){"use strict";var ee=[function(Y,l,G){var A=G(1).Beautifier,m=G(5).Options;function _(y,b){var F=new A(y,b);return F.beautify()}Y.exports=_,Y.exports.defaultOptions=function(){return new m}},function(Y,l,G){var A=G(2).Output,m=G(3).Token,_=G(4),y=G(5).Options,b=G(7).Tokenizer,F=G(7).line_starters,K=G(7).positionable_operators,H=G(7).TOKEN;function L(d,D){return D.indexOf(d)!==-1}function O(d){return d.replace(/^\s+/g,"")}function k(d){for(var D={},$=0;$<d.length;$++)D[d[$].replace(/-/g,"_")]=d[$];return D}function z(d,D){return d&&d.type===H.RESERVED&&d.text===D}function J(d,D){return d&&d.type===H.RESERVED&&L(d.text,D)}var ne=["case","return","do","if","throw","else","await","break","continue","async"],Z=["before-newline","after-newline","preserve-newline"],ae=k(Z),oe=[ae.before_newline,ae.preserve_newline],re={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function Re(d,D){D.multiline_frame||D.mode===re.ForInitializer||D.mode===re.Conditional||d.remove_indent(D.start_line_index)}function M(d){d=d.replace(_.allLineBreaks,`
|
|
`);for(var D=[],$=d.indexOf(`
|
|
`);$!==-1;)D.push(d.substring(0,$)),d=d.substring($+1),$=d.indexOf(`
|
|
`);return d.length&&D.push(d),D}function w(d){return d===re.ArrayLiteral}function T(d){return L(d,[re.Expression,re.ForInitializer,re.Conditional])}function I(d,D){for(var $=0;$<d.length;$++){var he=d[$].trim();if(he.charAt(0)!==D)return!1}return!0}function N(d,D){for(var $=0,he=d.length,Se;$<he;$++)if(Se=d[$],Se&&Se.indexOf(D)!==0)return!1;return!0}function U(d,D){D=D||{},this._source_text=d||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new y(D)}U.prototype.create_flags=function(d,D){var $=0;d&&($=d.indentation_level,!this._output.just_added_newline()&&d.line_indent_level>$&&($=d.line_indent_level));var he={mode:D,parent:d,last_token:d?d.last_token:new m(H.START_BLOCK,""),last_word:d?d.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:d?d.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return he},U.prototype._reset=function(d){var D=d.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new A(this._options,D),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(re.BlockStatement);var $=new b(d,this._options);return this._tokens=$.tokenize(),d},U.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var d,D=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
|
|
`,D&&_.lineBreak.test(D||"")&&($=D.match(_.lineBreak)[0]));for(var he=this._tokens.next();he;)this.handle_token(he),this._last_last_text=this._flags.last_token.text,this._flags.last_token=he,he=this._tokens.next();return d=this._output.get_code($),d},U.prototype.handle_token=function(d,D){d.type===H.START_EXPR?this.handle_start_expr(d):d.type===H.END_EXPR?this.handle_end_expr(d):d.type===H.START_BLOCK?this.handle_start_block(d):d.type===H.END_BLOCK?this.handle_end_block(d):d.type===H.WORD?this.handle_word(d):d.type===H.RESERVED?this.handle_word(d):d.type===H.SEMICOLON?this.handle_semicolon(d):d.type===H.STRING?this.handle_string(d):d.type===H.EQUALS?this.handle_equals(d):d.type===H.OPERATOR?this.handle_operator(d):d.type===H.COMMA?this.handle_comma(d):d.type===H.BLOCK_COMMENT?this.handle_block_comment(d,D):d.type===H.COMMENT?this.handle_comment(d,D):d.type===H.DOT?this.handle_dot(d):d.type===H.EOF?this.handle_eof(d):d.type===H.UNKNOWN?this.handle_unknown(d,D):this.handle_unknown(d,D)},U.prototype.handle_whitespace_and_comments=function(d,D){var $=d.newlines,he=this._options.keep_array_indentation&&w(this._flags.mode);if(d.comments_before)for(var Se=d.comments_before.next();Se;)this.handle_whitespace_and_comments(Se,D),this.handle_token(Se,D),Se=d.comments_before.next();if(he)for(var qe=0;qe<$;qe+=1)this.print_newline(qe>0,D);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,D);for(var Ue=1;Ue<$;Ue+=1)this.print_newline(!0,D)}};var g=["async","break","continue","return","throw","yield"];U.prototype.allow_wrap_or_preserved_newline=function(d,D){if(D=D===void 0?!1:D,!this._output.just_added_newline()){var $=this._options.preserve_newlines&&d.newlines||D,he=L(this._flags.last_token.text,K)||L(d.text,K);if(he){var Se=L(this._flags.last_token.text,K)&&L(this._options.operator_position,oe)||L(d.text,K);$=$&&Se}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(J(this._flags.last_token,g))return;this._output.set_wrap_point()}}},U.prototype.print_newline=function(d,D){if(!D&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==H.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var $=this._tokens.peek();this._flags.mode===re.Statement&&!(this._flags.if_block&&z($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(d)&&(this._flags.multiline_frame=!0)},U.prototype.print_token_line_indentation=function(d){this._output.just_added_newline()&&(this._options.keep_array_indentation&&d.newlines&&(d.text==="["||w(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(d.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},U.prototype.print_token=function(d){if(this._output.raw){this._output.add_raw_token(d);return}if(this._options.comma_first&&d.previous&&d.previous.type===H.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var D=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(D),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(d),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(d),this._output.non_breaking_space=!0,this._output.add_token(d.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},U.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},U.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},U.prototype.set_mode=function(d){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,d),this._flags=this.create_flags(this._previous_flags,d),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},U.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===re.Statement&&Re(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},U.prototype.start_of_object_property=function(){return this._flags.parent.mode===re.ObjectLiteral&&this._flags.mode===re.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||J(this._flags.last_token,["get","set"]))},U.prototype.start_of_statement=function(d){var D=!1;return D=D||J(this._flags.last_token,["var","let","const"])&&d.type===H.WORD,D=D||z(this._flags.last_token,"do"),D=D||!(this._flags.parent.mode===re.ObjectLiteral&&this._flags.mode===re.Statement)&&J(this._flags.last_token,g)&&!d.newlines,D=D||z(this._flags.last_token,"else")&&!(z(d,"if")&&!d.comments_before),D=D||this._flags.last_token.type===H.END_EXPR&&(this._previous_flags.mode===re.ForInitializer||this._previous_flags.mode===re.Conditional),D=D||this._flags.last_token.type===H.WORD&&this._flags.mode===re.BlockStatement&&!this._flags.in_case&&!(d.text==="--"||d.text==="++")&&this._last_last_text!=="function"&&d.type!==H.WORD&&d.type!==H.RESERVED,D=D||this._flags.mode===re.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||J(this._flags.last_token,["get","set"])),D?(this.set_mode(re.Statement),this.indent(),this.handle_whitespace_and_comments(d,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(d,J(d,["do","for","if","while"])),!0):!1},U.prototype.handle_start_expr=function(d){this.start_of_statement(d)||this.handle_whitespace_and_comments(d);var D=re.Expression;if(d.text==="["){if(this._flags.last_token.type===H.WORD||this._flags.last_token.text===")"){J(this._flags.last_token,F)&&(this._output.space_before_token=!0),this.print_token(d),this.set_mode(D),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}D=re.ArrayLiteral,w(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),L(this._flags.last_token.type,[H.START_EXPR,H.END_EXPR,H.WORD,H.OPERATOR,H.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===H.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,D=re.ForInitializer):L(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,D=re.Conditional):L(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&d.whitespace_before===""?this._output.space_before_token=!1:(L(this._flags.last_token.text,F)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===H.EQUALS||this._flags.last_token.type===H.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(d);else if(this._flags.last_token.type===H.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var he=this._tokens.peek(-4);J($,["async","function"])||$.text==="*"&&J(he,["async","function"])?this._output.space_before_token=!0:this._flags.mode===re.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(he.text==="{"||he.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(d);(this._flags.last_token.type===H.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(L(this._last_last_text,["function","yield"])||this._flags.mode===re.ObjectLiteral&&L(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===H.START_BLOCK?this.print_newline():(this._flags.last_token.type===H.END_EXPR||this._flags.last_token.type===H.START_EXPR||this._flags.last_token.type===H.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===H.COMMA)&&this.allow_wrap_or_preserved_newline(d,d.newlines),this.print_token(d),this.set_mode(D),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},U.prototype.handle_end_expr=function(d){for(;this._flags.mode===re.Statement;)this.restore_mode();this.handle_whitespace_and_comments(d),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(d,d.text==="]"&&w(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===H.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(d),this.restore_mode(),Re(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===re.Conditional&&(this._previous_flags.mode=re.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},U.prototype.handle_start_block=function(d){this.handle_whitespace_and_comments(d);var D=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===H.END_EXPR?(this.set_mode(re.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(re.BlockStatement):$&&(L($.text,[":",","])&&L(D.type,[H.STRING,H.WORD,H.RESERVED])||L(D.text,["get","set","..."])&&L($.type,[H.WORD,H.RESERVED]))?L(this._last_last_text,["class","interface"])&&!L($.text,[":",","])?this.set_mode(re.BlockStatement):this.set_mode(re.ObjectLiteral):this._flags.last_token.type===H.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(re.BlockStatement):L(this._flags.last_token.type,[H.EQUALS,H.START_EXPR,H.COMMA,H.OPERATOR])||J(this._flags.last_token,["return","throw","import","default"])?this.set_mode(re.ObjectLiteral):this.set_mode(re.BlockStatement),this._flags.last_token&&J(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var he=!D.comments_before&&D.text==="}",Se=he&&this._flags.last_word==="function"&&this._flags.last_token.type===H.END_EXPR;if(this._options.brace_preserve_inline){var qe=0,Ue=null;this._flags.inline_frame=!0;do if(qe+=1,Ue=this._tokens.peek(qe-1),Ue.newlines){this._flags.inline_frame=!1;break}while(Ue.type!==H.EOF&&!(Ue.type===H.END_BLOCK&&Ue.opened===d))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&d.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==H.OPERATOR&&(Se||this._flags.last_token.type===H.EQUALS||J(this._flags.last_token,ne)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(w(this._previous_flags.mode)&&(this._flags.last_token.type===H.START_EXPR||this._flags.last_token.type===H.COMMA)&&((this._flags.last_token.type===H.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===H.COMMA||this._flags.last_token.type===H.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(d),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==H.OPERATOR&&this._flags.last_token.type!==H.START_EXPR&&(L(this._flags.last_token.type,[H.START_BLOCK,H.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(d),this.indent(),!he&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},U.prototype.handle_end_block=function(d){for(this.handle_whitespace_and_comments(d);this._flags.mode===re.Statement;)this.restore_mode();var D=this._flags.last_token.type===H.START_BLOCK;this._flags.inline_frame&&!D?this._output.space_before_token=!0:this._options.brace_style==="expand"?D||this.print_newline():D||(w(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(d)},U.prototype.handle_word=function(d){if(d.type===H.RESERVED){if(L(d.text,["set","get"])&&this._flags.mode!==re.ObjectLiteral)d.type=H.WORD;else if(d.text==="import"&&L(this._tokens.peek().text,["(","."]))d.type=H.WORD;else if(L(d.text,["as","from"])&&!this._flags.import_block)d.type=H.WORD;else if(this._flags.mode===re.ObjectLiteral){var D=this._tokens.peek();D.text===":"&&(d.type=H.WORD)}}if(this.start_of_statement(d)?J(this._flags.last_token,["var","let","const"])&&d.type===H.WORD&&(this._flags.declaration_statement=!0):d.newlines&&!T(this._flags.mode)&&(this._flags.last_token.type!==H.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==H.EQUALS&&(this._options.preserve_newlines||!J(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(d),this.print_newline()):this.handle_whitespace_and_comments(d),this._flags.do_block&&!this._flags.do_while)if(z(d,"while")){this._output.space_before_token=!0,this.print_token(d),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&z(d,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===re.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&J(d,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(d),this._flags.in_case=!0;return}if((this._flags.last_token.type===H.COMMA||this._flags.last_token.type===H.START_EXPR||this._flags.last_token.type===H.EQUALS||this._flags.last_token.type===H.OPERATOR)&&!this.start_of_object_property()&&!(L(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===re.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(d),z(d,"function")){(L(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(L(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===H.OPERATOR))&&!this._output.just_added_blankline()&&!d.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===H.RESERVED||this._flags.last_token.type===H.WORD?J(this._flags.last_token,["get","set","new","export"])||J(this._flags.last_token,g)?this._output.space_before_token=!0:z(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===H.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(T(this._flags.mode)||w(this._flags.mode))||this.print_newline(),this.print_token(d),this._flags.last_word=d.text;return}var $="NONE";if(this._flags.last_token.type===H.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":J(d,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&d.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===H.SEMICOLON&&this._flags.mode===re.BlockStatement?$="NEWLINE":this._flags.last_token.type===H.SEMICOLON&&T(this._flags.mode)?$="SPACE":this._flags.last_token.type===H.STRING?$="NEWLINE":this._flags.last_token.type===H.RESERVED||this._flags.last_token.type===H.WORD||this._flags.last_token.text==="*"&&(L(this._last_last_text,["function","yield"])||this._flags.mode===re.ObjectLiteral&&L(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===H.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===H.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),J(d,F)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),J(d,["else","catch","finally"]))if((!(this._flags.last_token.type===H.END_BLOCK&&this._previous_flags.mode===re.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&d.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var he=this._output.current_line;he.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?J(this._flags.last_token,ne)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&J(d,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==H.END_EXPR?(this._flags.last_token.type!==H.START_EXPR||!J(d,["var","let","const"]))&&this._flags.last_token.text!==":"&&(z(d,"if")&&z(d.previous,"else")?this._output.space_before_token=!0:this.print_newline()):J(d,F)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&w(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);d.previous&&(d.previous.type===H.WORD||d.previous.type===H.RESERVED)&&(this._output.space_before_token=!0),this.print_token(d),this._flags.last_word=d.text,d.type===H.RESERVED&&(d.text==="do"?this._flags.do_block=!0:d.text==="if"?this._flags.if_block=!0:d.text==="import"?this._flags.import_block=!0:this._flags.import_block&&z(d,"from")&&(this._flags.import_block=!1))},U.prototype.handle_semicolon=function(d){this.start_of_statement(d)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(d);for(var D=this._tokens.peek();this._flags.mode===re.Statement&&!(this._flags.if_block&&z(D,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(d)},U.prototype.handle_string=function(d){d.text.startsWith("`")&&d.newlines===0&&d.whitespace_before===""&&(d.previous.text===")"||this._flags.last_token.type===H.WORD)||(this.start_of_statement(d)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(d),this._flags.last_token.type===H.RESERVED||this._flags.last_token.type===H.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===H.COMMA||this._flags.last_token.type===H.START_EXPR||this._flags.last_token.type===H.EQUALS||this._flags.last_token.type===H.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(d):d.text.startsWith("`")&&this._flags.last_token.type===H.END_EXPR&&(d.previous.text==="]"||d.previous.text===")")&&d.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(d)},U.prototype.handle_equals=function(d){this.start_of_statement(d)||this.handle_whitespace_and_comments(d),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(d),this._output.space_before_token=!0},U.prototype.handle_comma=function(d){this.handle_whitespace_and_comments(d,!0),this.print_token(d),this._output.space_before_token=!0,this._flags.declaration_statement?(T(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(d)):this._flags.mode===re.ObjectLiteral||this._flags.mode===re.Statement&&this._flags.parent.mode===re.ObjectLiteral?(this._flags.mode===re.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(d)},U.prototype.handle_operator=function(d){var D=d.text==="*"&&(J(this._flags.last_token,["function","yield"])||L(this._flags.last_token.type,[H.START_BLOCK,H.COMMA,H.END_BLOCK,H.SEMICOLON])),$=L(d.text,["-","+"])&&(L(this._flags.last_token.type,[H.START_BLOCK,H.START_EXPR,H.EQUALS,H.OPERATOR])||L(this._flags.last_token.text,F)||this._flags.last_token.text===",");if(!this.start_of_statement(d)){var he=!D;this.handle_whitespace_and_comments(d,he)}if(d.text==="*"&&this._flags.last_token.type===H.DOT){this.print_token(d);return}if(d.text==="::"){this.print_token(d);return}if(L(d.text,["-","+"])&&this.start_of_object_property()){this.print_token(d);return}if(this._flags.last_token.type===H.OPERATOR&&L(this._options.operator_position,oe)&&this.allow_wrap_or_preserved_newline(d),d.text===":"&&this._flags.in_case){this.print_token(d),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==H.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var Se=!0,qe=!0,Ue=!1;if(d.text===":"?this._flags.ternary_depth===0?Se=!1:(this._flags.ternary_depth-=1,Ue=!0):d.text==="?"&&(this._flags.ternary_depth+=1),!$&&!D&&this._options.preserve_newlines&&L(d.text,K)){var nt=d.text===":",et=nt&&Ue,Pe=nt&&!Ue;switch(this._options.operator_position){case ae.before_newline:this._output.space_before_token=!Pe,this.print_token(d),(!nt||et)&&this.allow_wrap_or_preserved_newline(d),this._output.space_before_token=!0;return;case ae.after_newline:this._output.space_before_token=!0,!nt||et?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(d):this._output.space_before_token=!1,this.print_token(d),this._output.space_before_token=!0;return;case ae.preserve_newline:Pe||this.allow_wrap_or_preserved_newline(d),Se=!(this._output.just_added_newline()||Pe),this._output.space_before_token=Se,this.print_token(d),this._output.space_before_token=!0;return}}if(D){this.allow_wrap_or_preserved_newline(d),Se=!1;var Lt=this._tokens.peek();qe=Lt&&L(Lt.type,[H.WORD,H.RESERVED])}else if(d.text==="...")this.allow_wrap_or_preserved_newline(d),Se=this._flags.last_token.type===H.START_BLOCK,qe=!1;else if(L(d.text,["--","++","!","~"])||$){if((this._flags.last_token.type===H.COMMA||this._flags.last_token.type===H.START_EXPR)&&this.allow_wrap_or_preserved_newline(d),Se=!1,qe=!1,d.newlines&&(d.text==="--"||d.text==="++"||d.text==="~")){var Me=J(this._flags.last_token,ne)&&d.newlines;Me&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Me,!0)}this._flags.last_token.text===";"&&T(this._flags.mode)&&(Se=!0),this._flags.last_token.type===H.RESERVED?Se=!0:this._flags.last_token.type===H.END_EXPR?Se=!(this._flags.last_token.text==="]"&&(d.text==="--"||d.text==="++")):this._flags.last_token.type===H.OPERATOR&&(Se=L(d.text,["--","-","++","+"])&&L(this._flags.last_token.text,["--","-","++","+"]),L(d.text,["+","-"])&&L(this._flags.last_token.text,["--","++"])&&(qe=!0)),(this._flags.mode===re.BlockStatement&&!this._flags.inline_frame||this._flags.mode===re.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Se,this.print_token(d),this._output.space_before_token=qe},U.prototype.handle_block_comment=function(d,D){if(this._output.raw){this._output.add_raw_token(d),d.directives&&d.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(d.directives){this.print_newline(!1,D),this.print_token(d),d.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!_.newline.test(d.text)&&!d.newlines){this._output.space_before_token=!0,this.print_token(d),this._output.space_before_token=!0;return}else this.print_block_commment(d,D)},U.prototype.print_block_commment=function(d,D){var $=M(d.text),he,Se=!1,qe=!1,Ue=d.whitespace_before,nt=Ue.length;if(this.print_newline(!1,D),this.print_token_line_indentation(d),this._output.add_token($[0]),this.print_newline(!1,D),$.length>1){for($=$.slice(1),Se=I($,"*"),qe=N($,Ue),Se&&(this._flags.alignment=1),he=0;he<$.length;he++)Se?(this.print_token_line_indentation(d),this._output.add_token(O($[he]))):qe&&$[he]?(this.print_token_line_indentation(d),this._output.add_token($[he].substring(nt))):(this._output.current_line.set_indent(-1),this._output.add_token($[he])),this.print_newline(!1,D);this._flags.alignment=0}},U.prototype.handle_comment=function(d,D){d.newlines?this.print_newline(!1,D):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(d),this.print_newline(!1,D)},U.prototype.handle_dot=function(d){this.start_of_statement(d)||this.handle_whitespace_and_comments(d,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),J(this._flags.last_token,ne)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(d,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(d)},U.prototype.handle_unknown=function(d,D){this.print_token(d),d.text[d.text.length-1]===`
|
|
`&&this.print_newline(!1,D)},U.prototype.handle_eof=function(d){for(;this._flags.mode===re.Statement;)this.restore_mode();this.handle_whitespace_and_comments(d)},Y.exports.Beautifier=U},function(Y){function l(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}l.prototype.clone_empty=function(){var m=new l(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},l.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},l.prototype.has_match=function(m){for(var _=this.__items.length-1;_>=0;_--)if(this.__items[_].match(m))return!0;return!1},l.prototype.set_indent=function(m,_){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=_||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},l.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},l.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},l.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},l.prototype.is_empty=function(){return this.__items.length===0},l.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},l.prototype.push=function(m){this.__items.push(m);var _=m.lastIndexOf(`
|
|
`);_!==-1?this.__character_count=m.length-_:this.__character_count+=m.length},l.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},l.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},l.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},l.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},l.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function G(m,_){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),_=_||"",m.indent_level>0&&(_=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=_,this.__base_string_length=_.length}G.prototype.get_indent_size=function(m,_){var y=this.__base_string_length;return _=_||0,m<0&&(y=0),y+=m*this.__indent_size,y+=_,y},G.prototype.get_indent_string=function(m,_){var y=this.__base_string;return _=_||0,m<0&&(m=0,y=""),_+=m*this.__indent_size,this.__ensure_cache(_),y+=this.__cache[_],y},G.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},G.prototype.__add_column=function(){var m=this.__cache.length,_=0,y="";this.__indent_size&&m>=this.__indent_size&&(_=Math.floor(m/this.__indent_size),m-=_*this.__indent_size,y=new Array(_+1).join(this.__indent_string)),m&&(y+=new Array(m+1).join(" ")),this.__cache.push(y)};function A(m,_){this.__indent_cache=new G(m,_),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new l(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}A.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},A.prototype.get_line_number=function(){return this.__lines.length},A.prototype.get_indent_string=function(m,_){return this.__indent_cache.get_indent_string(m,_)},A.prototype.get_indent_size=function(m,_){return this.__indent_cache.get_indent_size(m,_)},A.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},A.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},A.prototype.get_code=function(m){this.trim(!0);var _=this.current_line.pop();_&&(_[_.length-1]===`
|
|
`&&(_=_.replace(/\n+$/g,"")),this.current_line.push(_)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(y=y.replace(/[\n]/g,m)),y},A.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},A.prototype.set_indent=function(m,_){return m=m||0,_=_||0,this.next_line.set_indent(m,_),this.__lines.length>1?(this.current_line.set_indent(m,_),!0):(this.current_line.set_indent(),!1)},A.prototype.add_raw_token=function(m){for(var _=0;_<m.newlines;_++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},A.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},A.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},A.prototype.remove_indent=function(m){for(var _=this.__lines.length;m<_;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},A.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},A.prototype.just_added_newline=function(){return this.current_line.is_empty()},A.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},A.prototype.ensure_empty_line_above=function(m,_){for(var y=this.__lines.length-2;y>=0;){var b=this.__lines[y];if(b.is_empty())break;if(b.item(0).indexOf(m)!==0&&b.item(-1)!==_){this.__lines.splice(y+1,0,new l(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},Y.exports.Output=A},function(Y){function l(G,A,m,_){this.type=G,this.text=A,this.comments_before=null,this.newlines=m||0,this.whitespace_before=_||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}Y.exports.Token=l},function(Y,l){var G="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",A="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",_="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",y="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",b="(?:"+y+"|["+G+m+"])",F="(?:"+y+"|["+A+m+_+"])*";l.identifier=new RegExp(b+F,"g"),l.identifierStart=new RegExp(b),l.identifierMatch=new RegExp("(?:"+y+"|["+A+m+_+"])+");var K=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;l.newline=/[\n\r\u2028\u2029]/,l.lineBreak=new RegExp(`\r
|
|
|`+l.newline.source),l.allLineBreaks=new RegExp(l.lineBreak.source,"g")},function(Y,l,G){var A=G(6).Options,m=["before-newline","after-newline","preserve-newline"];function _(y){A.call(this,y,"js");var b=this.raw_options.brace_style||null;b==="expand-strict"?this.raw_options.brace_style="expand":b==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var F=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var K=0;K<F.length;K++)F[K]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=F[K];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}_.prototype=new A,Y.exports.Options=_},function(Y){function l(m,_){this.raw_options=G(m,_),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}l.prototype._get_array=function(m,_){var y=this.raw_options[m],b=_||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(b=y.concat()):typeof y=="string"&&(b=y.split(/[^a-zA-Z0-9_\/\-]+/)),b},l.prototype._get_boolean=function(m,_){var y=this.raw_options[m],b=y===void 0?!!_:!!y;return b},l.prototype._get_characters=function(m,_){var y=this.raw_options[m],b=_||"";return typeof y=="string"&&(b=y.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),b},l.prototype._get_number=function(m,_){var y=this.raw_options[m];_=parseInt(_,10),isNaN(_)&&(_=0);var b=parseInt(y,10);return isNaN(b)&&(b=_),b},l.prototype._get_selection=function(m,_,y){var b=this._get_selection_list(m,_,y);if(b.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+_+`
|
|
You passed in: '`+this.raw_options[m]+"'");return b[0]},l.prototype._get_selection_list=function(m,_,y){if(!_||_.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[_[0]],!this._is_valid_selection(y,_))throw new Error("Invalid Default Value!");var b=this._get_array(m,y);if(!this._is_valid_selection(b,_))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+_+`
|
|
You passed in: '`+this.raw_options[m]+"'");return b},l.prototype._is_valid_selection=function(m,_){return m.length&&_.length&&!m.some(function(y){return _.indexOf(y)===-1})};function G(m,_){var y={};m=A(m);var b;for(b in m)b!==_&&(y[b]=m[b]);if(_&&m[_])for(b in m[_])y[b]=m[_][b];return y}function A(m){var _={},y;for(y in m){var b=y.replace(/-/g,"_");_[b]=m[y]}return _}Y.exports.Options=l,Y.exports.normalizeOpts=A,Y.exports.mergeOpts=G},function(Y,l,G){var A=G(8).InputScanner,m=G(9).Tokenizer,_=G(9).TOKEN,y=G(13).Directives,b=G(4),F=G(12).Pattern,K=G(14).TemplatablePattern;function H(I,N){return N.indexOf(I)!==-1}var L={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:_.START,RAW:_.RAW,EOF:_.EOF},O=new y(/\/\*/,/\*\//),k=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,z=/[0-9]/,J=/[^\d\.]/,ne=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),Z=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";Z=Z.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),Z="\\?\\.(?!\\d) "+Z,Z=Z.replace(/ /g,"|");var ae=new RegExp(Z),oe="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),re=oe.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),Re=new RegExp("^(?:"+re.join("|")+")$"),M,w=function(I,N){m.call(this,I,N),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var U=new F(this._input),g=new K(this._input).read_options(this._options);this.__patterns={template:g,identifier:g.starting_with(b.identifier).matching(b.identifierMatch),number:U.matching(k),punct:U.matching(ae),comment:U.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:U.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:U.matching(/<!--/),html_comment_end:U.matching(/-->/),include:U.starting_with(/#include/).until_after(b.lineBreak),shebang:U.starting_with(/#!/).until_after(b.lineBreak),xml:U.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:g.until(/['\\\n\r\u2028\u2029]/),double_quote:g.until(/["\\\n\r\u2028\u2029]/),template_text:g.until(/[`\\$]/),template_expression:g.until(/[`}\\]/)}};w.prototype=new m,w.prototype._is_comment=function(I){return I.type===L.COMMENT||I.type===L.BLOCK_COMMENT||I.type===L.UNKNOWN},w.prototype._is_opening=function(I){return I.type===L.START_BLOCK||I.type===L.START_EXPR},w.prototype._is_closing=function(I,N){return(I.type===L.END_BLOCK||I.type===L.END_EXPR)&&N&&(I.text==="]"&&N.text==="["||I.text===")"&&N.text==="("||I.text==="}"&&N.text==="{")},w.prototype._reset=function(){M=!1},w.prototype._get_next_token=function(I,N){var U=null;this._readWhitespace();var g=this._input.peek();return g===null?this._create_token(L.EOF,""):(U=U||this._read_non_javascript(g),U=U||this._read_string(g),U=U||this._read_pair(g,this._input.peek(1)),U=U||this._read_word(I),U=U||this._read_singles(g),U=U||this._read_comment(g),U=U||this._read_regexp(g,I),U=U||this._read_xml(g,I),U=U||this._read_punctuation(),U=U||this._create_token(L.UNKNOWN,this._input.next()),U)},w.prototype._read_word=function(I){var N;if(N=this.__patterns.identifier.read(),N!=="")return N=N.replace(b.allLineBreaks,`
|
|
`),!(I.type===L.DOT||I.type===L.RESERVED&&(I.text==="set"||I.text==="get"))&&Re.test(N)?(N==="in"||N==="of")&&(I.type===L.WORD||I.type===L.STRING)?this._create_token(L.OPERATOR,N):this._create_token(L.RESERVED,N):this._create_token(L.WORD,N);if(N=this.__patterns.number.read(),N!=="")return this._create_token(L.WORD,N)},w.prototype._read_singles=function(I){var N=null;return I==="("||I==="["?N=this._create_token(L.START_EXPR,I):I===")"||I==="]"?N=this._create_token(L.END_EXPR,I):I==="{"?N=this._create_token(L.START_BLOCK,I):I==="}"?N=this._create_token(L.END_BLOCK,I):I===";"?N=this._create_token(L.SEMICOLON,I):I==="."&&J.test(this._input.peek(1))?N=this._create_token(L.DOT,I):I===","&&(N=this._create_token(L.COMMA,I)),N&&this._input.next(),N},w.prototype._read_pair=function(I,N){var U=null;return I==="#"&&N==="{"&&(U=this._create_token(L.START_BLOCK,I+N)),U&&(this._input.next(),this._input.next()),U},w.prototype._read_punctuation=function(){var I=this.__patterns.punct.read();if(I!=="")return I==="="?this._create_token(L.EQUALS,I):I==="?."?this._create_token(L.DOT,I):this._create_token(L.OPERATOR,I)},w.prototype._read_non_javascript=function(I){var N="";if(I==="#"){if(this._is_first_token()&&(N=this.__patterns.shebang.read(),N))return this._create_token(L.UNKNOWN,N.trim()+`
|
|
`);if(N=this.__patterns.include.read(),N)return this._create_token(L.UNKNOWN,N.trim()+`
|
|
`);I=this._input.next();var U="#";if(this._input.hasNext()&&this._input.testChar(z)){do I=this._input.next(),U+=I;while(this._input.hasNext()&&I!=="#"&&I!=="=");return I==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(U+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(U+="{}",this._input.next(),this._input.next())),this._create_token(L.WORD,U)}this._input.back()}else if(I==="<"&&this._is_first_token()){if(N=this.__patterns.html_comment_start.read(),N){for(;this._input.hasNext()&&!this._input.testChar(b.newline);)N+=this._input.next();return M=!0,this._create_token(L.COMMENT,N)}}else if(M&&I==="-"&&(N=this.__patterns.html_comment_end.read(),N))return M=!1,this._create_token(L.COMMENT,N);return null},w.prototype._read_comment=function(I){var N=null;if(I==="/"){var U="";if(this._input.peek(1)==="*"){U=this.__patterns.block_comment.read();var g=O.get_directives(U);g&&g.ignore==="start"&&(U+=O.readIgnored(this._input)),U=U.replace(b.allLineBreaks,`
|
|
`),N=this._create_token(L.BLOCK_COMMENT,U),N.directives=g}else this._input.peek(1)==="/"&&(U=this.__patterns.comment.read(),N=this._create_token(L.COMMENT,U))}return N},w.prototype._read_string=function(I){if(I==="`"||I==="'"||I==='"'){var N=this._input.next();return this.has_char_escapes=!1,I==="`"?N+=this._read_string_recursive("`",!0,"${"):N+=this._read_string_recursive(I),this.has_char_escapes&&this._options.unescape_strings&&(N=T(N)),this._input.peek()===I&&(N+=this._input.next()),N=N.replace(b.allLineBreaks,`
|
|
`),this._create_token(L.STRING,N)}return null},w.prototype._allow_regexp_or_xml=function(I){return I.type===L.RESERVED&&H(I.text,["return","case","throw","else","do","typeof","yield"])||I.type===L.END_EXPR&&I.text===")"&&I.opened.previous.type===L.RESERVED&&H(I.opened.previous.text,["if","while","for"])||H(I.type,[L.COMMENT,L.START_EXPR,L.START_BLOCK,L.START,L.END_BLOCK,L.OPERATOR,L.EQUALS,L.EOF,L.SEMICOLON,L.COMMA])},w.prototype._read_regexp=function(I,N){if(I==="/"&&this._allow_regexp_or_xml(N)){for(var U=this._input.next(),g=!1,d=!1;this._input.hasNext()&&(g||d||this._input.peek()!==I)&&!this._input.testChar(b.newline);)U+=this._input.peek(),g?g=!1:(g=this._input.peek()==="\\",this._input.peek()==="["?d=!0:this._input.peek()==="]"&&(d=!1)),this._input.next();return this._input.peek()===I&&(U+=this._input.next(),U+=this._input.read(b.identifier)),this._create_token(L.STRING,U)}return null},w.prototype._read_xml=function(I,N){if(this._options.e4x&&I==="<"&&this._allow_regexp_or_xml(N)){var U="",g=this.__patterns.xml.read_match();if(g){for(var d=g[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),D=d.indexOf("{")===0,$=0;g;){var he=!!g[1],Se=g[2],qe=!!g[g.length-1]||Se.slice(0,8)==="![CDATA[";if(!qe&&(Se===d||D&&Se.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(he?--$:++$),U+=g[0],$<=0)break;g=this.__patterns.xml.read_match()}return g||(U+=this._input.match(/[\s\S]*/g)[0]),U=U.replace(b.allLineBreaks,`
|
|
`),this._create_token(L.STRING,U)}}return null};function T(I){for(var N="",U=0,g=new A(I),d=null;g.hasNext();)if(d=g.match(/([\s]|[^\\]|\\\\)+/g),d&&(N+=d[0]),g.peek()==="\\"){if(g.next(),g.peek()==="x")d=g.match(/x([0-9A-Fa-f]{2})/g);else if(g.peek()==="u")d=g.match(/u([0-9A-Fa-f]{4})/g),d||(d=g.match(/u\{([0-9A-Fa-f]+)\}/g));else{N+="\\",g.hasNext()&&(N+=g.next());continue}if(!d||(U=parseInt(d[1],16),U>126&&U<=255&&d[0].indexOf("x")===0))return I;U>=0&&U<32||U>1114111?N+="\\"+d[0]:U===34||U===39||U===92?N+="\\"+String.fromCharCode(U):N+=String.fromCharCode(U)}return N}w.prototype._read_string_recursive=function(I,N,U){var g,d;I==="'"?d=this.__patterns.single_quote:I==='"'?d=this.__patterns.double_quote:I==="`"?d=this.__patterns.template_text:I==="}"&&(d=this.__patterns.template_expression);for(var D=d.read(),$="";this._input.hasNext();){if($=this._input.next(),$===I||!N&&b.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(g=this._input.peek(),g==="x"||g==="u"?this.has_char_escapes=!0:g==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),$+=this._input.next()):U&&(U==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),U===$&&(I==="`"?$+=this._read_string_recursive("}",N,"`"):$+=this._read_string_recursive("`",N,"${"),this._input.hasNext()&&($+=this._input.next())));$+=d.read(),D+=$}return D},Y.exports.Tokenizer=w,Y.exports.TOKEN=L,Y.exports.positionable_operators=ne.slice(),Y.exports.line_starters=oe.slice()},function(Y){var l=RegExp.prototype.hasOwnProperty("sticky");function G(A){this.__input=A||"",this.__input_length=this.__input.length,this.__position=0}G.prototype.restart=function(){this.__position=0},G.prototype.back=function(){this.__position>0&&(this.__position-=1)},G.prototype.hasNext=function(){return this.__position<this.__input_length},G.prototype.next=function(){var A=null;return this.hasNext()&&(A=this.__input.charAt(this.__position),this.__position+=1),A},G.prototype.peek=function(A){var m=null;return A=A||0,A+=this.__position,A>=0&&A<this.__input_length&&(m=this.__input.charAt(A)),m},G.prototype.__match=function(A,m){A.lastIndex=m;var _=A.exec(this.__input);return _&&!(l&&A.sticky)&&_.index!==m&&(_=null),_},G.prototype.test=function(A,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(A,m):!1},G.prototype.testChar=function(A,m){var _=this.peek(m);return A.lastIndex=0,_!==null&&A.test(_)},G.prototype.match=function(A){var m=this.__match(A,this.__position);return m?this.__position+=m[0].length:m=null,m},G.prototype.read=function(A,m,_){var y="",b;return A&&(b=this.match(A),b&&(y+=b[0])),m&&(b||!A)&&(y+=this.readUntil(m,_)),y},G.prototype.readUntil=function(A,m){var _="",y=this.__position;A.lastIndex=this.__position;var b=A.exec(this.__input);return b?(y=b.index,m&&(y+=b[0].length)):y=this.__input_length,_=this.__input.substring(this.__position,y),this.__position=y,_},G.prototype.readUntilAfter=function(A){return this.readUntil(A,!0)},G.prototype.get_regexp=function(A,m){var _=null,y="g";return m&&l&&(y="y"),typeof A=="string"&&A!==""?_=new RegExp(A,y):A&&(_=new RegExp(A.source,y)),_},G.prototype.get_literal_regexp=function(A){return RegExp(A.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},G.prototype.peekUntilAfter=function(A){var m=this.__position,_=this.readUntilAfter(A);return this.__position=m,_},G.prototype.lookBack=function(A){var m=this.__position-1;return m>=A.length&&this.__input.substring(m-A.length,m).toLowerCase()===A},Y.exports.InputScanner=G},function(Y,l,G){var A=G(8).InputScanner,m=G(3).Token,_=G(10).TokenStream,y=G(11).WhitespacePattern,b={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},F=function(K,H){this._input=new A(K),this._options=H||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new y(this._input)};F.prototype.tokenize=function(){this._input.restart(),this.__tokens=new _,this._reset();for(var K,H=new m(b.START,""),L=null,O=[],k=new _;H.type!==b.EOF;){for(K=this._get_next_token(H,L);this._is_comment(K);)k.add(K),K=this._get_next_token(H,L);k.isEmpty()||(K.comments_before=k,k=new _),K.parent=L,this._is_opening(K)?(O.push(L),L=K):L&&this._is_closing(K,L)&&(K.opened=L,L.closed=K,L=O.pop(),K.parent=L),K.previous=H,H.next=K,this.__tokens.add(K),H=K}return this.__tokens},F.prototype._is_first_token=function(){return this.__tokens.isEmpty()},F.prototype._reset=function(){},F.prototype._get_next_token=function(K,H){this._readWhitespace();var L=this._input.read(/.+/g);return L?this._create_token(b.RAW,L):this._create_token(b.EOF,"")},F.prototype._is_comment=function(K){return!1},F.prototype._is_opening=function(K){return!1},F.prototype._is_closing=function(K,H){return!1},F.prototype._create_token=function(K,H){var L=new m(K,H,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return L},F.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},Y.exports.Tokenizer=F,Y.exports.TOKEN=b},function(Y){function l(G){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=G}l.prototype.restart=function(){this.__position=0},l.prototype.isEmpty=function(){return this.__tokens_length===0},l.prototype.hasNext=function(){return this.__position<this.__tokens_length},l.prototype.next=function(){var G=null;return this.hasNext()&&(G=this.__tokens[this.__position],this.__position+=1),G},l.prototype.peek=function(G){var A=null;return G=G||0,G+=this.__position,G>=0&&G<this.__tokens_length&&(A=this.__tokens[G]),A},l.prototype.add=function(G){this.__parent_token&&(G.parent=this.__parent_token),this.__tokens.push(G),this.__tokens_length+=1},Y.exports.TokenStream=l},function(Y,l,G){var A=G(12).Pattern;function m(_,y){A.call(this,_,y),y?this._line_regexp=this._input.get_regexp(y._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new A,m.prototype.__set_whitespace_patterns=function(_,y){_+="\\t ",y+="\\n\\r",this._match_pattern=this._input.get_regexp("["+_+y+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+y+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var _=this._input.read(this._match_pattern);if(_===" ")this.whitespace_before_token=" ";else if(_){var y=this.__split(this._newline_regexp,_);this.newline_count=y.length-1,this.whitespace_before_token=y[this.newline_count]}return _},m.prototype.matching=function(_,y){var b=this._create();return b.__set_whitespace_patterns(_,y),b._update(),b},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(_,y){_.lastIndex=0;for(var b=0,F=[],K=_.exec(y);K;)F.push(y.substring(b,K.index)),b=K.index+K[0].length,K=_.exec(y);return b<y.length?F.push(y.substring(b,y.length)):F.push(""),F},Y.exports.WhitespacePattern=m},function(Y){function l(G,A){this._input=G,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,A&&(this._starting_pattern=this._input.get_regexp(A._starting_pattern,!0),this._match_pattern=this._input.get_regexp(A._match_pattern,!0),this._until_pattern=this._input.get_regexp(A._until_pattern),this._until_after=A._until_after)}l.prototype.read=function(){var G=this._input.read(this._starting_pattern);return(!this._starting_pattern||G)&&(G+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),G},l.prototype.read_match=function(){return this._input.match(this._match_pattern)},l.prototype.until_after=function(G){var A=this._create();return A._until_after=!0,A._until_pattern=this._input.get_regexp(G),A._update(),A},l.prototype.until=function(G){var A=this._create();return A._until_after=!1,A._until_pattern=this._input.get_regexp(G),A._update(),A},l.prototype.starting_with=function(G){var A=this._create();return A._starting_pattern=this._input.get_regexp(G,!0),A._update(),A},l.prototype.matching=function(G){var A=this._create();return A._match_pattern=this._input.get_regexp(G,!0),A._update(),A},l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){},Y.exports.Pattern=l},function(Y){function l(G,A){G=typeof G=="string"?G:G.source,A=typeof A=="string"?A:A.source,this.__directives_block_pattern=new RegExp(G+/ beautify( \w+[:]\w+)+ /.source+A,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(G+/\sbeautify\signore:end\s/.source+A,"g")}l.prototype.get_directives=function(G){if(!G.match(this.__directives_block_pattern))return null;var A={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(G);m;)A[m[1]]=m[2],m=this.__directive_pattern.exec(G);return A},l.prototype.readIgnored=function(G){return G.readUntilAfter(this.__directives_end_ignore_pattern)},Y.exports.Directives=l},function(Y,l,G){var A=G(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function _(y,b){A.call(this,y,b),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),b&&(this.__template_pattern=this._input.get_regexp(b.__template_pattern),this._excluded=Object.assign(this._excluded,b._excluded),this._disabled=Object.assign(this._disabled,b._disabled));var F=new A(y);this.__patterns={handlebars_comment:F.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:F.starting_with(/{{{/).until_after(/}}}/),handlebars:F.starting_with(/{{/).until_after(/}}/),php:F.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:F.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:F.starting_with(/{%/).until_after(/%}/),django_value:F.starting_with(/{{/).until_after(/}}/),django_comment:F.starting_with(/{#/).until_after(/#}/),smarty:F.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:F.starting_with(/{\*/).until_after(/\*}/),smarty_literal:F.starting_with(/{literal}/).until_after(/{\/literal}/)}}_.prototype=new A,_.prototype._create=function(){return new _(this._input,this)},_.prototype._update=function(){this.__set_templated_pattern()},_.prototype.disable=function(y){var b=this._create();return b._disabled[y]=!0,b._update(),b},_.prototype.read_options=function(y){var b=this._create();for(var F in m)b._disabled[F]=y.templating.indexOf(F)===-1;return b._update(),b},_.prototype.exclude=function(y){var b=this._create();return b._excluded[y]=!0,b._update(),b},_.prototype.read=function(){var y="";this._match_pattern?y=this._input.read(this._starting_pattern):y=this._input.read(this._starting_pattern,this.__template_pattern);for(var b=this._read_template();b;)this._match_pattern?b+=this._input.read(this._match_pattern):b+=this._input.readUntil(this.__template_pattern),y+=b,b=this._read_template();return this._until_after&&(y+=this._input.readUntilAfter(this._until_pattern)),y},_.prototype.__set_templated_pattern=function(){var y=[];this._disabled.php||y.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||y.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(y.push(this.__patterns.django._starting_pattern.source),y.push(this.__patterns.django_value._starting_pattern.source),y.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||y.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&y.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+y.join("|")+")")},_.prototype._read_template=function(){var y="",b=this._input.peek();if(b==="<"){var F=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&F==="?"&&(y=y||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&F==="%"&&(y=y||this.__patterns.erb.read())}else b==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(y=y||this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars_unescaped.read(),y=y||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(y=y||this.__patterns.django_value.read()),this._excluded.django||(y=y||this.__patterns.django_comment.read(),y=y||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(y=y||this.__patterns.smarty_comment.read(),y=y||this.__patterns.smarty_literal.read(),y=y||this.__patterns.smarty.read()));return y},Y.exports.TemplatablePattern=_}],W={};function p(Y){var l=W[Y];if(l!==void 0)return l.exports;var G=W[Y]={exports:{}};return ee[Y](G,G.exports,p),G.exports}var ue=p(0);le=ue})();var xe=le;R=[],E=function(){return{js_beautify:xe}}.apply(ft,R),E!==void 0&&(Ut.exports=E)})()},32834:function(Ut){(function(ft,R){Ut.exports=R()})(this,function(){"use strict";function ft(_e,me){for(var pe=0;pe<me.length;pe++){var C=me[pe];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(_e,C.key,C)}}function R(_e,me,pe){return me&&ft(_e.prototype,me),pe&&ft(_e,pe),_e}function E(_e,me){if(_e){if(typeof _e=="string")return le(_e,me);var pe=Object.prototype.toString.call(_e).slice(8,-1);if(pe==="Object"&&_e.constructor&&(pe=_e.constructor.name),pe==="Map"||pe==="Set")return Array.from(_e);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return le(_e,me)}}function le(_e,me){(me==null||me>_e.length)&&(me=_e.length);for(var pe=0,C=new Array(me);pe<me;pe++)C[pe]=_e[pe];return C}function xe(_e,me){var pe=typeof Symbol!="undefined"&&_e[Symbol.iterator]||_e["@@iterator"];if(pe)return(pe=pe.call(_e)).next.bind(pe);if(Array.isArray(_e)||(pe=E(_e))||me&&_e&&typeof _e.length=="number"){pe&&(_e=pe);var C=0;return function(){return C>=_e.length?{done:!0}:{done:!1,value:_e[C++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ee={exports:{}};function W(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function p(_e){ee.exports.defaults=_e}ee.exports={defaults:W(),getDefaults:W,changeDefaults:p};var ue=/[&<>"']/,Y=/[&<>"']/g,l=/[<>"']|&(?!#?\w+;)/,G=/[<>"']|&(?!#?\w+;)/g,A={"&":"&","<":"<",">":">",'"':""","'":"'"},m=function(me){return A[me]};function _(_e,me){if(me){if(ue.test(_e))return _e.replace(Y,m)}else if(l.test(_e))return _e.replace(G,m);return _e}var y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function b(_e){return _e.replace(y,function(me,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var F=/(^|[^\[])\^/g;function K(_e,me){_e=_e.source||_e,me=me||"";var pe={replace:function(j,X){return X=X.source||X,X=X.replace(F,"$1"),_e=_e.replace(j,X),pe},getRegex:function(){return new RegExp(_e,me)}};return pe}var H=/[^\w:]/g,L=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(_e,me,pe){if(_e){var C;try{C=decodeURIComponent(b(pe)).replace(H,"").toLowerCase()}catch(j){return null}if(C.indexOf("javascript:")===0||C.indexOf("vbscript:")===0||C.indexOf("data:")===0)return null}me&&!L.test(pe)&&(pe=Z(me,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(j){return null}return pe}var k={},z=/^[^:]+:\/*[^/]*$/,J=/^([^:]+:)[\s\S]*$/,ne=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Z(_e,me){k[" "+_e]||(z.test(_e)?k[" "+_e]=_e+"/":k[" "+_e]=Re(_e,"/",!0)),_e=k[" "+_e];var pe=_e.indexOf(":")===-1;return me.substring(0,2)==="//"?pe?me:_e.replace(J,"$1")+me:me.charAt(0)==="/"?pe?me:_e.replace(ne,"$1")+me:_e+me}var ae={exec:function(){}};function oe(_e){for(var me=1,pe,C;me<arguments.length;me++){pe=arguments[me];for(C in pe)Object.prototype.hasOwnProperty.call(pe,C)&&(_e[C]=pe[C])}return _e}function re(_e,me){var pe=_e.replace(/\|/g,function(X,te,fe){for(var ve=!1,Te=te;--Te>=0&&fe[Te]==="\\";)ve=!ve;return ve?"|":" |"}),C=pe.split(/ \|/),j=0;if(C.length>me)C.splice(me);else for(;C.length<me;)C.push("");for(;j<C.length;j++)C[j]=C[j].trim().replace(/\\\|/g,"|");return C}function Re(_e,me,pe){var C=_e.length;if(C===0)return"";for(var j=0;j<C;){var X=_e.charAt(C-j-1);if(X===me&&!pe)j++;else if(X!==me&&pe)j++;else break}return _e.substr(0,C-j)}function M(_e,me){if(_e.indexOf(me[1])===-1)return-1;for(var pe=_e.length,C=0,j=0;j<pe;j++)if(_e[j]==="\\")j++;else if(_e[j]===me[0])C++;else if(_e[j]===me[1]&&(C--,C<0))return j;return-1}function w(_e){_e&&_e.sanitize&&!_e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function T(_e,me){if(me<1)return"";for(var pe="";me>1;)me&1&&(pe+=_e),me>>=1,_e+=_e;return pe+_e}var I={escape:_,unescape:b,edit:K,cleanUrl:O,resolveUrl:Z,noopTest:ae,merge:oe,splitCells:re,rtrim:Re,findClosingBracket:M,checkSanitizeDeprecation:w,repeatString:T},N=ee.exports.defaults,U=I.rtrim,g=I.splitCells,d=I.escape,D=I.findClosingBracket;function $(_e,me,pe){var C=me.href,j=me.title?d(me.title):null,X=_e[1].replace(/\\([\[\]])/g,"$1");return _e[0].charAt(0)!=="!"?{type:"link",raw:pe,href:C,title:j,text:X}:{type:"image",raw:pe,href:C,title:j,text:d(X)}}function he(_e,me){var pe=_e.match(/^(\s+)(?:```)/);if(pe===null)return me;var C=pe[1];return me.split(`
|
|
`).map(function(j){var X=j.match(/^\s+/);if(X===null)return j;var te=X[0];return te.length>=C.length?j.slice(C.length):j}).join(`
|
|
`)}var Se=function(){function _e(pe){this.options=pe||N}var me=_e.prototype;return me.space=function(C){var j=this.rules.block.newline.exec(C);if(j)return j[0].length>1?{type:"space",raw:j[0]}:{raw:`
|
|
`}},me.code=function(C){var j=this.rules.block.code.exec(C);if(j){var X=j[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:j[0],codeBlockStyle:"indented",text:this.options.pedantic?X:U(X,`
|
|
`)}}},me.fences=function(C){var j=this.rules.block.fences.exec(C);if(j){var X=j[0],te=he(X,j[3]||"");return{type:"code",raw:X,lang:j[2]?j[2].trim():j[2],text:te}}},me.heading=function(C){var j=this.rules.block.heading.exec(C);if(j){var X=j[2].trim();if(/#$/.test(X)){var te=U(X,"#");(this.options.pedantic||!te||/ $/.test(te))&&(X=te.trim())}return{type:"heading",raw:j[0],depth:j[1].length,text:X}}},me.nptable=function(C){var j=this.rules.block.nptable.exec(C);if(j){var X={type:"table",header:g(j[1].replace(/^ *| *\| *$/g,"")),align:j[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:j[3]?j[3].replace(/\n$/,"").split(`
|
|
`):[],raw:j[0]};if(X.header.length===X.align.length){var te=X.align.length,fe;for(fe=0;fe<te;fe++)/^ *-+: *$/.test(X.align[fe])?X.align[fe]="right":/^ *:-+: *$/.test(X.align[fe])?X.align[fe]="center":/^ *:-+ *$/.test(X.align[fe])?X.align[fe]="left":X.align[fe]=null;for(te=X.cells.length,fe=0;fe<te;fe++)X.cells[fe]=g(X.cells[fe],X.header.length);return X}}},me.hr=function(C){var j=this.rules.block.hr.exec(C);if(j)return{type:"hr",raw:j[0]}},me.blockquote=function(C){var j=this.rules.block.blockquote.exec(C);if(j){var X=j[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:j[0],text:X}}},me.list=function(C){var j=this.rules.block.list.exec(C);if(j){var X=j[0],te=j[2],fe=te.length>1,ve={type:"list",raw:X,ordered:fe,start:fe?+te.slice(0,-1):"",loose:!1,items:[]},Te=j[0].match(this.rules.block.item),Ie=!1,je,_t,Dt,dt,at,Rt,Gt,kt,Ot,ot=Te.length;Dt=this.rules.block.listItemStart.exec(Te[0]);for(var Ye=0;Ye<ot;Ye++){if(je=Te[Ye],X=je,this.options.pedantic||(Ot=je.match(new RegExp("\\n\\s*\\n {0,"+(Dt[0].length-1)+"}\\S")),Ot&&(at=je.length-Ot.index+Te.slice(Ye+1).join(`
|
|
`).length,ve.raw=ve.raw.substring(0,ve.raw.length-at),je=je.substring(0,Ot.index),X=je,ot=Ye+1)),Ye!==ot-1){if(dt=this.rules.block.listItemStart.exec(Te[Ye+1]),this.options.pedantic?dt[1].length>Dt[1].length:dt[1].length>=Dt[0].length||dt[1].length>3){Te.splice(Ye,2,Te[Ye]+(!this.options.pedantic&&dt[1].length<Dt[0].length&&!Te[Ye].match(/\n$/)?"":`
|
|
`)+Te[Ye+1]),Ye--,ot--;continue}else(!this.options.pedantic||this.options.smartLists?dt[2][dt[2].length-1]!==te[te.length-1]:fe===(dt[2].length===1))&&(at=Te.slice(Ye+1).join(`
|
|
`).length,ve.raw=ve.raw.substring(0,ve.raw.length-at),Ye=ot-1);Dt=dt}_t=je.length,je=je.replace(/^ *([*+-]|\d+[.)]) ?/,""),~je.indexOf(`
|
|
`)&&(_t-=je.length,je=this.options.pedantic?je.replace(/^ {1,4}/gm,""):je.replace(new RegExp("^ {1,"+_t+"}","gm"),"")),je=U(je,`
|
|
`),Ye!==ot-1&&(X=X+`
|
|
`),Rt=Ie||/\n\n(?!\s*$)/.test(X),Ye!==ot-1&&(Ie=X.slice(-2)===`
|
|
|
|
`,Rt||(Rt=Ie)),Rt&&(ve.loose=!0),this.options.gfm&&(Gt=/^\[[ xX]\] /.test(je),kt=void 0,Gt&&(kt=je[1]!==" ",je=je.replace(/^\[[ xX]\] +/,""))),ve.items.push({type:"list_item",raw:X,task:Gt,checked:kt,loose:Rt,text:je})}return ve}},me.html=function(C){var j=this.rules.block.html.exec(C);if(j)return{type:this.options.sanitize?"paragraph":"html",raw:j[0],pre:!this.options.sanitizer&&(j[1]==="pre"||j[1]==="script"||j[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(j[0]):d(j[0]):j[0]}},me.def=function(C){var j=this.rules.block.def.exec(C);if(j){j[3]&&(j[3]=j[3].substring(1,j[3].length-1));var X=j[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:X,raw:j[0],href:j[2],title:j[3]}}},me.table=function(C){var j=this.rules.block.table.exec(C);if(j){var X={type:"table",header:g(j[1].replace(/^ *| *\| *$/g,"")),align:j[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:j[3]?j[3].replace(/\n$/,"").split(`
|
|
`):[]};if(X.header.length===X.align.length){X.raw=j[0];var te=X.align.length,fe;for(fe=0;fe<te;fe++)/^ *-+: *$/.test(X.align[fe])?X.align[fe]="right":/^ *:-+: *$/.test(X.align[fe])?X.align[fe]="center":/^ *:-+ *$/.test(X.align[fe])?X.align[fe]="left":X.align[fe]=null;for(te=X.cells.length,fe=0;fe<te;fe++)X.cells[fe]=g(X.cells[fe].replace(/^ *\| *| *\| *$/g,""),X.header.length);return X}}},me.lheading=function(C){var j=this.rules.block.lheading.exec(C);if(j)return{type:"heading",raw:j[0],depth:j[2].charAt(0)==="="?1:2,text:j[1]}},me.paragraph=function(C){var j=this.rules.block.paragraph.exec(C);if(j)return{type:"paragraph",raw:j[0],text:j[1].charAt(j[1].length-1)===`
|
|
`?j[1].slice(0,-1):j[1]}},me.text=function(C){var j=this.rules.block.text.exec(C);if(j)return{type:"text",raw:j[0],text:j[0]}},me.escape=function(C){var j=this.rules.inline.escape.exec(C);if(j)return{type:"escape",raw:j[0],text:d(j[1])}},me.tag=function(C,j,X){var te=this.rules.inline.tag.exec(C);if(te)return!j&&/^<a /i.test(te[0])?j=!0:j&&/^<\/a>/i.test(te[0])&&(j=!1),!X&&/^<(pre|code|kbd|script)(\s|>)/i.test(te[0])?X=!0:X&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(te[0])&&(X=!1),{type:this.options.sanitize?"text":"html",raw:te[0],inLink:j,inRawBlock:X,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):d(te[0]):te[0]}},me.link=function(C){var j=this.rules.inline.link.exec(C);if(j){var X=j[2].trim();if(!this.options.pedantic&&/^</.test(X)){if(!/>$/.test(X))return;var te=U(X.slice(0,-1),"\\");if((X.length-te.length)%2===0)return}else{var fe=D(j[2],"()");if(fe>-1){var ve=j[0].indexOf("!")===0?5:4,Te=ve+j[1].length+fe;j[2]=j[2].substring(0,fe),j[0]=j[0].substring(0,Te).trim(),j[3]=""}}var Ie=j[2],je="";if(this.options.pedantic){var _t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ie);_t&&(Ie=_t[1],je=_t[3])}else je=j[3]?j[3].slice(1,-1):"";return Ie=Ie.trim(),/^</.test(Ie)&&(this.options.pedantic&&!/>$/.test(X)?Ie=Ie.slice(1):Ie=Ie.slice(1,-1)),$(j,{href:Ie&&Ie.replace(this.rules.inline._escapes,"$1"),title:je&&je.replace(this.rules.inline._escapes,"$1")},j[0])}},me.reflink=function(C,j){var X;if((X=this.rules.inline.reflink.exec(C))||(X=this.rules.inline.nolink.exec(C))){var te=(X[2]||X[1]).replace(/\s+/g," ");if(te=j[te.toLowerCase()],!te||!te.href){var fe=X[0].charAt(0);return{type:"text",raw:fe,text:fe}}return $(X,te,X[0])}},me.emStrong=function(C,j,X){X===void 0&&(X="");var te=this.rules.inline.emStrong.lDelim.exec(C);if(te&&!(te[3]&&X.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var fe=te[1]||te[2]||"";if(!fe||fe&&(X===""||this.rules.inline.punctuation.exec(X))){var ve=te[0].length-1,Te,Ie,je=ve,_t=0,Dt=te[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Dt.lastIndex=0,j=j.slice(-1*C.length+ve);(te=Dt.exec(j))!=null;)if(Te=te[1]||te[2]||te[3]||te[4]||te[5]||te[6],!!Te){if(Ie=Te.length,te[3]||te[4]){je+=Ie;continue}else if((te[5]||te[6])&&ve%3&&!((ve+Ie)%3)){_t+=Ie;continue}if(je-=Ie,!(je>0))return Ie=Math.min(Ie,Ie+je+_t),Math.min(ve,Ie)%2?{type:"em",raw:C.slice(0,ve+te.index+Ie+1),text:C.slice(1,ve+te.index+Ie)}:{type:"strong",raw:C.slice(0,ve+te.index+Ie+1),text:C.slice(2,ve+te.index+Ie-1)}}}}},me.codespan=function(C){var j=this.rules.inline.code.exec(C);if(j){var X=j[2].replace(/\n/g," "),te=/[^ ]/.test(X),fe=/^ /.test(X)&&/ $/.test(X);return te&&fe&&(X=X.substring(1,X.length-1)),X=d(X,!0),{type:"codespan",raw:j[0],text:X}}},me.br=function(C){var j=this.rules.inline.br.exec(C);if(j)return{type:"br",raw:j[0]}},me.del=function(C){var j=this.rules.inline.del.exec(C);if(j)return{type:"del",raw:j[0],text:j[2]}},me.autolink=function(C,j){var X=this.rules.inline.autolink.exec(C);if(X){var te,fe;return X[2]==="@"?(te=d(this.options.mangle?j(X[1]):X[1]),fe="mailto:"+te):(te=d(X[1]),fe=te),{type:"link",raw:X[0],text:te,href:fe,tokens:[{type:"text",raw:te,text:te}]}}},me.url=function(C,j){var X;if(X=this.rules.inline.url.exec(C)){var te,fe;if(X[2]==="@")te=d(this.options.mangle?j(X[0]):X[0]),fe="mailto:"+te;else{var ve;do ve=X[0],X[0]=this.rules.inline._backpedal.exec(X[0])[0];while(ve!==X[0]);te=d(X[0]),X[1]==="www."?fe="http://"+te:fe=te}return{type:"link",raw:X[0],text:te,href:fe,tokens:[{type:"text",raw:te,text:te}]}}},me.inlineText=function(C,j,X){var te=this.rules.inline.text.exec(C);if(te){var fe;return j?fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):d(te[0]):te[0]:fe=d(this.options.smartypants?X(te[0]):te[0]),{type:"text",raw:te[0],text:fe}}},_e}(),qe=I.noopTest,Ue=I.edit,nt=I.merge,et={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:qe,table:qe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};et._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,et._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,et.def=Ue(et.def).replace("label",et._label).replace("title",et._title).getRegex(),et.bullet=/(?:[*+-]|\d{1,9}[.)])/,et.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,et.item=Ue(et.item,"gm").replace(/bull/g,et.bullet).getRegex(),et.listItemStart=Ue(/^( *)(bull) */).replace("bull",et.bullet).getRegex(),et.list=Ue(et.list).replace(/bull/g,et.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+et.def.source+")").getRegex(),et._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",et._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,et.html=Ue(et.html,"i").replace("comment",et._comment).replace("tag",et._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),et.paragraph=Ue(et._paragraph).replace("hr",et.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",et._tag).getRegex(),et.blockquote=Ue(et.blockquote).replace("paragraph",et.paragraph).getRegex(),et.normal=nt({},et),et.gfm=nt({},et.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),et.gfm.nptable=Ue(et.gfm.nptable).replace("hr",et.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",et._tag).getRegex(),et.gfm.table=Ue(et.gfm.table).replace("hr",et.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",et._tag).getRegex(),et.pedantic=nt({},et.normal,{html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",et._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qe,paragraph:Ue(et.normal._paragraph).replace("hr",et.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",et.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Pe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:qe,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:qe,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Pe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Pe.punctuation=Ue(Pe.punctuation).replace(/punctuation/g,Pe._punctuation).getRegex(),Pe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Pe.escapedEmSt=/\\\*|\\_/g,Pe._comment=Ue(et._comment).replace("(?:-->|$)","-->").getRegex(),Pe.emStrong.lDelim=Ue(Pe.emStrong.lDelim).replace(/punct/g,Pe._punctuation).getRegex(),Pe.emStrong.rDelimAst=Ue(Pe.emStrong.rDelimAst,"g").replace(/punct/g,Pe._punctuation).getRegex(),Pe.emStrong.rDelimUnd=Ue(Pe.emStrong.rDelimUnd,"g").replace(/punct/g,Pe._punctuation).getRegex(),Pe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Pe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Pe._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Pe.autolink=Ue(Pe.autolink).replace("scheme",Pe._scheme).replace("email",Pe._email).getRegex(),Pe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Pe.tag=Ue(Pe.tag).replace("comment",Pe._comment).replace("attribute",Pe._attribute).getRegex(),Pe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Pe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Pe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Pe.link=Ue(Pe.link).replace("label",Pe._label).replace("href",Pe._href).replace("title",Pe._title).getRegex(),Pe.reflink=Ue(Pe.reflink).replace("label",Pe._label).getRegex(),Pe.reflinkSearch=Ue(Pe.reflinkSearch,"g").replace("reflink",Pe.reflink).replace("nolink",Pe.nolink).getRegex(),Pe.normal=nt({},Pe),Pe.pedantic=nt({},Pe.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ue(/^!?\[(label)\]\((.*?)\)/).replace("label",Pe._label).getRegex(),reflink:Ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Pe._label).getRegex()}),Pe.gfm=nt({},Pe.normal,{escape:Ue(Pe.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Pe.gfm.url=Ue(Pe.gfm.url,"i").replace("email",Pe.gfm._extended_email).getRegex(),Pe.breaks=nt({},Pe.gfm,{br:Ue(Pe.br).replace("{2,}","*").getRegex(),text:Ue(Pe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Lt={block:et,inline:Pe},Me=Se,mt=ee.exports.defaults,ke=Lt.block,Tt=Lt.inline,ye=I.repeatString;function be(_e){return _e.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function q(_e){var me="",pe,C,j=_e.length;for(pe=0;pe<j;pe++)C=_e.charCodeAt(pe),Math.random()>.5&&(C="x"+C.toString(16)),me+="&#"+C+";";return me}var Le=function(){function _e(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||mt,this.options.tokenizer=this.options.tokenizer||new Me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var C={block:ke.normal,inline:Tt.normal};this.options.pedantic?(C.block=ke.pedantic,C.inline=Tt.pedantic):this.options.gfm&&(C.block=ke.gfm,this.options.breaks?C.inline=Tt.breaks:C.inline=Tt.gfm),this.tokenizer.rules=C}_e.lex=function(C,j){var X=new _e(j);return X.lex(C)},_e.lexInline=function(C,j){var X=new _e(j);return X.inlineTokens(C)};var me=_e.prototype;return me.lex=function(C){return C=C.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(C,this.tokens,!0),this.inline(this.tokens),this.tokens},me.blockTokens=function(C,j,X){j===void 0&&(j=[]),X===void 0&&(X=!0),this.options.pedantic&&(C=C.replace(/^ +$/gm,""));for(var te,fe,ve,Te;C;){if(te=this.tokenizer.space(C)){C=C.substring(te.raw.length),te.type&&j.push(te);continue}if(te=this.tokenizer.code(C)){C=C.substring(te.raw.length),Te=j[j.length-1],Te&&Te.type==="paragraph"?(Te.raw+=`
|
|
`+te.raw,Te.text+=`
|
|
`+te.text):j.push(te);continue}if(te=this.tokenizer.fences(C)){C=C.substring(te.raw.length),j.push(te);continue}if(te=this.tokenizer.heading(C)){C=C.substring(te.raw.length),j.push(te);continue}if(te=this.tokenizer.nptable(C)){C=C.substring(te.raw.length),j.push(te);continue}if(te=this.tokenizer.hr(C)){C=C.substring(te.raw.length),j.push(te);continue}if(te=this.tokenizer.blockquote(C)){C=C.substring(te.raw.length),te.tokens=this.blockTokens(te.text,[],X),j.push(te);continue}if(te=this.tokenizer.list(C)){for(C=C.substring(te.raw.length),ve=te.items.length,fe=0;fe<ve;fe++)te.items[fe].tokens=this.blockTokens(te.items[fe].text,[],!1);j.push(te);continue}if(te=this.tokenizer.html(C)){C=C.substring(te.raw.length),j.push(te);continue}if(X&&(te=this.tokenizer.def(C))){C=C.substring(te.raw.length),this.tokens.links[te.tag]||(this.tokens.links[te.tag]={href:te.href,title:te.title});continue}if(te=this.tokenizer.table(C)){C=C.substring(te.raw.length),j.push(te);continue}if(te=this.tokenizer.lheading(C)){C=C.substring(te.raw.length),j.push(te);continue}if(X&&(te=this.tokenizer.paragraph(C))){C=C.substring(te.raw.length),j.push(te);continue}if(te=this.tokenizer.text(C)){C=C.substring(te.raw.length),Te=j[j.length-1],Te&&Te.type==="text"?(Te.raw+=`
|
|
`+te.raw,Te.text+=`
|
|
`+te.text):j.push(te);continue}if(C){var Ie="Infinite loop on byte: "+C.charCodeAt(0);if(this.options.silent){console.error(Ie);break}else throw new Error(Ie)}}return j},me.inline=function(C){var j,X,te,fe,ve,Te,Ie=C.length;for(j=0;j<Ie;j++)switch(Te=C[j],Te.type){case"paragraph":case"text":case"heading":{Te.tokens=[],this.inlineTokens(Te.text,Te.tokens);break}case"table":{for(Te.tokens={header:[],cells:[]},fe=Te.header.length,X=0;X<fe;X++)Te.tokens.header[X]=[],this.inlineTokens(Te.header[X],Te.tokens.header[X]);for(fe=Te.cells.length,X=0;X<fe;X++)for(ve=Te.cells[X],Te.tokens.cells[X]=[],te=0;te<ve.length;te++)Te.tokens.cells[X][te]=[],this.inlineTokens(ve[te],Te.tokens.cells[X][te]);break}case"blockquote":{this.inline(Te.tokens);break}case"list":{for(fe=Te.items.length,X=0;X<fe;X++)this.inline(Te.items[X].tokens);break}}return C},me.inlineTokens=function(C,j,X,te){j===void 0&&(j=[]),X===void 0&&(X=!1),te===void 0&&(te=!1);var fe,ve,Te=C,Ie,je,_t;if(this.tokens.links){var Dt=Object.keys(this.tokens.links);if(Dt.length>0)for(;(Ie=this.tokenizer.rules.inline.reflinkSearch.exec(Te))!=null;)Dt.includes(Ie[0].slice(Ie[0].lastIndexOf("[")+1,-1))&&(Te=Te.slice(0,Ie.index)+"["+ye("a",Ie[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ie=this.tokenizer.rules.inline.blockSkip.exec(Te))!=null;)Te=Te.slice(0,Ie.index)+"["+ye("a",Ie[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Ie=this.tokenizer.rules.inline.escapedEmSt.exec(Te))!=null;)Te=Te.slice(0,Ie.index)+"++"+Te.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;C;){if(je||(_t=""),je=!1,fe=this.tokenizer.escape(C)){C=C.substring(fe.raw.length),j.push(fe);continue}if(fe=this.tokenizer.tag(C,X,te)){C=C.substring(fe.raw.length),X=fe.inLink,te=fe.inRawBlock;var dt=j[j.length-1];dt&&fe.type==="text"&&dt.type==="text"?(dt.raw+=fe.raw,dt.text+=fe.text):j.push(fe);continue}if(fe=this.tokenizer.link(C)){C=C.substring(fe.raw.length),fe.type==="link"&&(fe.tokens=this.inlineTokens(fe.text,[],!0,te)),j.push(fe);continue}if(fe=this.tokenizer.reflink(C,this.tokens.links)){C=C.substring(fe.raw.length);var at=j[j.length-1];fe.type==="link"?(fe.tokens=this.inlineTokens(fe.text,[],!0,te),j.push(fe)):at&&fe.type==="text"&&at.type==="text"?(at.raw+=fe.raw,at.text+=fe.text):j.push(fe);continue}if(fe=this.tokenizer.emStrong(C,Te,_t)){C=C.substring(fe.raw.length),fe.tokens=this.inlineTokens(fe.text,[],X,te),j.push(fe);continue}if(fe=this.tokenizer.codespan(C)){C=C.substring(fe.raw.length),j.push(fe);continue}if(fe=this.tokenizer.br(C)){C=C.substring(fe.raw.length),j.push(fe);continue}if(fe=this.tokenizer.del(C)){C=C.substring(fe.raw.length),fe.tokens=this.inlineTokens(fe.text,[],X,te),j.push(fe);continue}if(fe=this.tokenizer.autolink(C,q)){C=C.substring(fe.raw.length),j.push(fe);continue}if(!X&&(fe=this.tokenizer.url(C,q))){C=C.substring(fe.raw.length),j.push(fe);continue}if(fe=this.tokenizer.inlineText(C,te,be)){C=C.substring(fe.raw.length),fe.raw.slice(-1)!=="_"&&(_t=fe.raw.slice(-1)),je=!0,ve=j[j.length-1],ve&&ve.type==="text"?(ve.raw+=fe.raw,ve.text+=fe.text):j.push(fe);continue}if(C){var Rt="Infinite loop on byte: "+C.charCodeAt(0);if(this.options.silent){console.error(Rt);break}else throw new Error(Rt)}}return j},R(_e,null,[{key:"rules",get:function(){return{block:ke,inline:Tt}}}]),_e}(),Ne=ee.exports.defaults,Qe=I.cleanUrl,V=I.escape,se=function(){function _e(pe){this.options=pe||Ne}var me=_e.prototype;return me.code=function(C,j,X){var te=(j||"").match(/\S*/)[0];if(this.options.highlight){var fe=this.options.highlight(C,te);fe!=null&&fe!==C&&(X=!0,C=fe)}return C=C.replace(/\n$/,"")+`
|
|
`,te?'<pre><code class="'+this.options.langPrefix+V(te,!0)+'">'+(X?C:V(C,!0))+`</code></pre>
|
|
`:"<pre><code>"+(X?C:V(C,!0))+`</code></pre>
|
|
`},me.blockquote=function(C){return`<blockquote>
|
|
`+C+`</blockquote>
|
|
`},me.html=function(C){return C},me.heading=function(C,j,X,te){return this.options.headerIds?"<h"+j+' id="'+this.options.headerPrefix+te.slug(X)+'">'+C+"</h"+j+`>
|
|
`:"<h"+j+">"+C+"</h"+j+`>
|
|
`},me.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},me.list=function(C,j,X){var te=j?"ol":"ul",fe=j&&X!==1?' start="'+X+'"':"";return"<"+te+fe+`>
|
|
`+C+"</"+te+`>
|
|
`},me.listitem=function(C){return"<li>"+C+`</li>
|
|
`},me.checkbox=function(C){return"<input "+(C?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},me.paragraph=function(C){return"<p>"+C+`</p>
|
|
`},me.table=function(C,j){return j&&(j="<tbody>"+j+"</tbody>"),`<table>
|
|
<thead>
|
|
`+C+`</thead>
|
|
`+j+`</table>
|
|
`},me.tablerow=function(C){return`<tr>
|
|
`+C+`</tr>
|
|
`},me.tablecell=function(C,j){var X=j.header?"th":"td",te=j.align?"<"+X+' align="'+j.align+'">':"<"+X+">";return te+C+"</"+X+`>
|
|
`},me.strong=function(C){return"<strong>"+C+"</strong>"},me.em=function(C){return"<em>"+C+"</em>"},me.codespan=function(C){return"<code>"+C+"</code>"},me.br=function(){return this.options.xhtml?"<br/>":"<br>"},me.del=function(C){return"<del>"+C+"</del>"},me.link=function(C,j,X){if(C=Qe(this.options.sanitize,this.options.baseUrl,C),C===null)return X;var te='<a href="'+V(C)+'"';return j&&(te+=' title="'+j+'"'),te+=">"+X+"</a>",te},me.image=function(C,j,X){if(C=Qe(this.options.sanitize,this.options.baseUrl,C),C===null)return X;var te='<img src="'+C+'" alt="'+X+'"';return j&&(te+=' title="'+j+'"'),te+=this.options.xhtml?"/>":">",te},me.text=function(C){return C},_e}(),Ee=function(){function _e(){}var me=_e.prototype;return me.strong=function(C){return C},me.em=function(C){return C},me.codespan=function(C){return C},me.del=function(C){return C},me.html=function(C){return C},me.text=function(C){return C},me.link=function(C,j,X){return""+X},me.image=function(C,j,X){return""+X},me.br=function(){return""},_e}(),Fe=function(){function _e(){this.seen={}}var me=_e.prototype;return me.serialize=function(C){return C.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},me.getNextSafeSlug=function(C,j){var X=C,te=0;if(this.seen.hasOwnProperty(X)){te=this.seen[C];do te++,X=C+"-"+te;while(this.seen.hasOwnProperty(X))}return j||(this.seen[C]=te,this.seen[X]=0),X},me.slug=function(C,j){j===void 0&&(j={});var X=this.serialize(C);return this.getNextSafeSlug(X,j.dryrun)},_e}(),de=se,ze=Ee,rt=Fe,We=ee.exports.defaults,ut=I.unescape,Ve=function(){function _e(pe){this.options=pe||We,this.options.renderer=this.options.renderer||new de,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ze,this.slugger=new rt}_e.parse=function(C,j){var X=new _e(j);return X.parse(C)},_e.parseInline=function(C,j){var X=new _e(j);return X.parseInline(C)};var me=_e.prototype;return me.parse=function(C,j){j===void 0&&(j=!0);var X="",te,fe,ve,Te,Ie,je,_t,Dt,dt,at,Rt,Gt,kt,Ot,ot,Ye,yt,Pt,Ht=C.length;for(te=0;te<Ht;te++)switch(at=C[te],at.type){case"space":continue;case"hr":{X+=this.renderer.hr();continue}case"heading":{X+=this.renderer.heading(this.parseInline(at.tokens),at.depth,ut(this.parseInline(at.tokens,this.textRenderer)),this.slugger);continue}case"code":{X+=this.renderer.code(at.text,at.lang,at.escaped);continue}case"table":{for(Dt="",_t="",Te=at.header.length,fe=0;fe<Te;fe++)_t+=this.renderer.tablecell(this.parseInline(at.tokens.header[fe]),{header:!0,align:at.align[fe]});for(Dt+=this.renderer.tablerow(_t),dt="",Te=at.cells.length,fe=0;fe<Te;fe++){for(je=at.tokens.cells[fe],_t="",Ie=je.length,ve=0;ve<Ie;ve++)_t+=this.renderer.tablecell(this.parseInline(je[ve]),{header:!1,align:at.align[ve]});dt+=this.renderer.tablerow(_t)}X+=this.renderer.table(Dt,dt);continue}case"blockquote":{dt=this.parse(at.tokens),X+=this.renderer.blockquote(dt);continue}case"list":{for(Rt=at.ordered,Gt=at.start,kt=at.loose,Te=at.items.length,dt="",fe=0;fe<Te;fe++)ot=at.items[fe],Ye=ot.checked,yt=ot.task,Ot="",ot.task&&(Pt=this.renderer.checkbox(Ye),kt?ot.tokens.length>0&&ot.tokens[0].type==="text"?(ot.tokens[0].text=Pt+" "+ot.tokens[0].text,ot.tokens[0].tokens&&ot.tokens[0].tokens.length>0&&ot.tokens[0].tokens[0].type==="text"&&(ot.tokens[0].tokens[0].text=Pt+" "+ot.tokens[0].tokens[0].text)):ot.tokens.unshift({type:"text",text:Pt}):Ot+=Pt),Ot+=this.parse(ot.tokens,kt),dt+=this.renderer.listitem(Ot,yt,Ye);X+=this.renderer.list(dt,Rt,Gt);continue}case"html":{X+=this.renderer.html(at.text);continue}case"paragraph":{X+=this.renderer.paragraph(this.parseInline(at.tokens));continue}case"text":{for(dt=at.tokens?this.parseInline(at.tokens):at.text;te+1<Ht&&C[te+1].type==="text";)at=C[++te],dt+=`
|
|
`+(at.tokens?this.parseInline(at.tokens):at.text);X+=j?this.renderer.paragraph(dt):dt;continue}default:{var un='Token with "'+at.type+'" type was not found.';if(this.options.silent){console.error(un);return}else throw new Error(un)}}return X},me.parseInline=function(C,j){j=j||this.renderer;var X="",te,fe,ve=C.length;for(te=0;te<ve;te++)switch(fe=C[te],fe.type){case"escape":{X+=j.text(fe.text);break}case"html":{X+=j.html(fe.text);break}case"link":{X+=j.link(fe.href,fe.title,this.parseInline(fe.tokens,j));break}case"image":{X+=j.image(fe.href,fe.title,fe.text);break}case"strong":{X+=j.strong(this.parseInline(fe.tokens,j));break}case"em":{X+=j.em(this.parseInline(fe.tokens,j));break}case"codespan":{X+=j.codespan(fe.text);break}case"br":{X+=j.br();break}case"del":{X+=j.del(this.parseInline(fe.tokens,j));break}case"text":{X+=j.text(fe.text);break}default:{var Te='Token with "'+fe.type+'" type was not found.';if(this.options.silent){console.error(Te);return}else throw new Error(Te)}}return X},_e}(),At=Le,vt=Ve,ge=Se,Ae=se,Ze=Ee,tt=Fe,Ke=I.merge,pt=I.checkSanitizeDeprecation,gt=I.escape,He=ee.exports.getDefaults,bt=ee.exports.changeDefaults,Ct=ee.exports.defaults;function it(_e,me,pe){if(typeof _e=="undefined"||_e===null)throw new Error("marked(): input parameter is undefined or null");if(typeof _e!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(_e)+", string expected");if(typeof me=="function"&&(pe=me,me=null),me=Ke({},it.defaults,me||{}),pt(me),pe){var C=me.highlight,j;try{j=At.lex(_e,me)}catch(ve){return pe(ve)}var X=function(Te){var Ie;if(!Te)try{me.walkTokens&&it.walkTokens(j,me.walkTokens),Ie=vt.parse(j,me)}catch(je){Te=je}return me.highlight=C,Te?pe(Te):pe(null,Ie)};if(!C||C.length<3||(delete me.highlight,!j.length))return X();var te=0;it.walkTokens(j,function(ve){ve.type==="code"&&(te++,setTimeout(function(){C(ve.text,ve.lang,function(Te,Ie){if(Te)return X(Te);Ie!=null&&Ie!==ve.text&&(ve.text=Ie,ve.escaped=!0),te--,te===0&&X()})},0))}),te===0&&X();return}try{var fe=At.lex(_e,me);return me.walkTokens&&it.walkTokens(fe,me.walkTokens),vt.parse(fe,me)}catch(ve){if(ve.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,me.silent)return"<p>An error occurred:</p><pre>"+gt(ve.message+"",!0)+"</pre>";throw ve}}it.options=it.setOptions=function(_e){return Ke(it.defaults,_e),bt(it.defaults),it},it.getDefaults=He,it.defaults=Ct,it.use=function(_e){var me=Ke({},_e);if(_e.renderer&&function(){var C=it.defaults.renderer||new Ae,j=function(fe){var ve=C[fe];C[fe]=function(){for(var Te=arguments.length,Ie=new Array(Te),je=0;je<Te;je++)Ie[je]=arguments[je];var _t=_e.renderer[fe].apply(C,Ie);return _t===!1&&(_t=ve.apply(C,Ie)),_t}};for(var X in _e.renderer)j(X);me.renderer=C}(),_e.tokenizer&&function(){var C=it.defaults.tokenizer||new ge,j=function(fe){var ve=C[fe];C[fe]=function(){for(var Te=arguments.length,Ie=new Array(Te),je=0;je<Te;je++)Ie[je]=arguments[je];var _t=_e.tokenizer[fe].apply(C,Ie);return _t===!1&&(_t=ve.apply(C,Ie)),_t}};for(var X in _e.tokenizer)j(X);me.tokenizer=C}(),_e.walkTokens){var pe=it.defaults.walkTokens;me.walkTokens=function(C){_e.walkTokens(C),pe&&pe(C)}}it.setOptions(me)},it.walkTokens=function(_e,me){for(var pe=xe(_e),C;!(C=pe()).done;){var j=C.value;switch(me(j),j.type){case"table":{for(var X=xe(j.tokens.header),te;!(te=X()).done;){var fe=te.value;it.walkTokens(fe,me)}for(var ve=xe(j.tokens.cells),Te;!(Te=ve()).done;)for(var Ie=Te.value,je=xe(Ie),_t;!(_t=je()).done;){var Dt=_t.value;it.walkTokens(Dt,me)}break}case"list":{it.walkTokens(j.items,me);break}default:j.tokens&&it.walkTokens(j.tokens,me)}}},it.parseInline=function(_e,me){if(typeof _e=="undefined"||_e===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof _e!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(_e)+", string expected");me=Ke({},it.defaults,me||{}),pt(me);try{var pe=At.lexInline(_e,me);return me.walkTokens&&it.walkTokens(pe,me.walkTokens),vt.parseInline(pe,me)}catch(C){if(C.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,me.silent)return"<p>An error occurred:</p><pre>"+gt(C.message+"",!0)+"</pre>";throw C}},it.Parser=vt,it.parser=vt.parse,it.Renderer=Ae,it.TextRenderer=Ze,it.Lexer=At,it.lexer=At.lex,it.Tokenizer=ge,it.Slugger=tt,it.parse=it;var wt=it;return wt})},11690:function(Ut){const ft=/[&<>"']/,R=/[&<>"']/g,E=/[<>"']|&(?!#?\w+;)/,le=/[<>"']|&(?!#?\w+;)/g,xe={"&":"&","<":"<",">":">",'"':""","'":"'"},ee=Z=>xe[Z];function W(Z,ae){if(ae){if(ft.test(Z))return Z.replace(R,ee)}else if(E.test(Z))return Z.replace(le,ee);return Z}const p=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ue(Z){return Z.replace(p,(ae,oe)=>(oe=oe.toLowerCase(),oe==="colon"?":":oe.charAt(0)==="#"?oe.charAt(1)==="x"?String.fromCharCode(parseInt(oe.substring(2),16)):String.fromCharCode(+oe.substring(1)):""))}const Y=/(^|[^\[])\^/g;function l(Z,ae){Z=Z.source||Z,ae=ae||"";const oe={replace:(re,Re)=>(Re=Re.source||Re,Re=Re.replace(Y,"$1"),Z=Z.replace(re,Re),oe),getRegex:()=>new RegExp(Z,ae)};return oe}const G=/[^\w:]/g,A=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(Z,ae,oe){if(Z){let re;try{re=decodeURIComponent(ue(oe)).replace(G,"").toLowerCase()}catch(Re){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}ae&&!A.test(oe)&&(oe=K(ae,oe));try{oe=encodeURI(oe).replace(/%25/g,"%")}catch(re){return null}return oe}const _={},y=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,F=/^([^:]+:\/*[^/]*)[\s\S]*$/;function K(Z,ae){_[" "+Z]||(y.test(Z)?_[" "+Z]=Z+"/":_[" "+Z]=k(Z,"/",!0)),Z=_[" "+Z];const oe=Z.indexOf(":")===-1;return ae.substring(0,2)==="//"?oe?ae:Z.replace(b,"$1")+ae:ae.charAt(0)==="/"?oe?ae:Z.replace(F,"$1")+ae:Z+ae}const H={exec:function(){}};function L(Z){let ae=1,oe,re;for(;ae<arguments.length;ae++){oe=arguments[ae];for(re in oe)Object.prototype.hasOwnProperty.call(oe,re)&&(Z[re]=oe[re])}return Z}function O(Z,ae){const oe=Z.replace(/\|/g,(M,w,T)=>{let I=!1,N=w;for(;--N>=0&&T[N]==="\\";)I=!I;return I?"|":" |"}),re=oe.split(/ \|/);let Re=0;if(re.length>ae)re.splice(ae);else for(;re.length<ae;)re.push("");for(;Re<re.length;Re++)re[Re]=re[Re].trim().replace(/\\\|/g,"|");return re}function k(Z,ae,oe){const re=Z.length;if(re===0)return"";let Re=0;for(;Re<re;){const M=Z.charAt(re-Re-1);if(M===ae&&!oe)Re++;else if(M!==ae&&oe)Re++;else break}return Z.substr(0,re-Re)}function z(Z,ae){if(Z.indexOf(ae[1])===-1)return-1;const oe=Z.length;let re=0,Re=0;for(;Re<oe;Re++)if(Z[Re]==="\\")Re++;else if(Z[Re]===ae[0])re++;else if(Z[Re]===ae[1]&&(re--,re<0))return Re;return-1}function J(Z){Z&&Z.sanitize&&!Z.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function ne(Z,ae){if(ae<1)return"";let oe="";for(;ae>1;)ae&1&&(oe+=Z),ae>>=1,Z+=Z;return oe+Z}Ut.exports={escape:W,unescape:ue,edit:l,cleanUrl:m,resolveUrl:K,noopTest:H,merge:L,splitCells:O,rtrim:k,findClosingBracket:z,checkSanitizeDeprecation:J,repeatString:ne}},75918:function(Ut,ft,R){"use strict";R.d(ft,{Wi:function(){return p},Z0:function(){return ue},aU:function(){return W},eZ:function(){return l},wY:function(){return Y}});var E=R(4348),le=R(69323),xe=R(13268),ee=function(G,A,m,_){function y(b){return b instanceof m?b:new m(function(F){F(b)})}return new(m||(m=Promise))(function(b,F){function K(O){try{L(_.next(O))}catch(k){F(k)}}function H(O){try{L(_.throw(O))}catch(k){F(k)}}function L(O){O.done?b(O.value):y(O.value).then(K,H)}L((_=_.apply(G,A||[])).next())})};class W extends le.JT{constructor(A,m="",_="",y=!0,b){super(),this._onDidChange=this._register(new E.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=A,this._label=m,this._cssClass=_,this._enabled=y,this._actionCallback=b}get id(){return this._id}get label(){return this._label}set label(A){this._setLabel(A)}_setLabel(A){this._label!==A&&(this._label=A,this._onDidChange.fire({label:A}))}get tooltip(){return this._tooltip||""}set tooltip(A){this._setTooltip(A)}_setTooltip(A){this._tooltip!==A&&(this._tooltip=A,this._onDidChange.fire({tooltip:A}))}get class(){return this._cssClass}set class(A){this._setClass(A)}_setClass(A){this._cssClass!==A&&(this._cssClass=A,this._onDidChange.fire({class:A}))}get enabled(){return this._enabled}set enabled(A){this._setEnabled(A)}_setEnabled(A){this._enabled!==A&&(this._enabled=A,this._onDidChange.fire({enabled:A}))}get checked(){return this._checked}set checked(A){this._setChecked(A)}_setChecked(A){this._checked!==A&&(this._checked=A,this._onDidChange.fire({checked:A}))}run(A,m){return ee(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(A))})}}class p extends le.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new E.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new E.Q5),this.onDidRun=this._onDidRun.event}run(A,m){return ee(this,void 0,void 0,function*(){if(!A.enabled)return;this._onBeforeRun.fire({action:A});let _;try{yield this.runAction(A,m)}catch(y){_=y}this._onDidRun.fire({action:A,error:_})})}runAction(A,m){return ee(this,void 0,void 0,function*(){yield A.run(m)})}}class ue extends W{constructor(A){super(ue.ID,A,A?"separator text":"separator"),this.checked=!1,this.enabled=!1}}ue.ID="vs.actions.separator";class Y{constructor(A,m,_,y){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=A,this.label=m,this.class=y,this._actions=_}get actions(){return this._actions}dispose(){}run(){return ee(this,void 0,void 0,function*(){})}}class l extends W{constructor(){super(l.ID,xe.N("submenu.empty","(empty)"),void 0,!1)}}l.ID="vs.actions.empty"},76068:function(Ut,ft,R){"use strict";R.d(ft,{ok:function(){return E}});function E(le,xe){if(!le)throw new Error(xe?`Assertion failed (${xe})`:"Assertion Failed")}},52615:function(Ut,ft,R){"use strict";R.d(ft,{CM:function(){return W},JL:function(){return p},dT:function(){return Y},fK:function(){return ee},lA:function(){return ue}});var E=R(4348);class le{constructor(){this._icons=new Map,this._onDidRegister=new E.Q5}add(G){const A=this._icons.get(G.id);A?G.description?A.description=G.description:console.error(`Duplicate registration of codicon ${G.id}`):(this._icons.set(G.id,G),this._onDidRegister.fire(G))}get(G){return this._icons.get(G)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const xe=new le,ee=xe;function W(l,G){return new ue(l,G)}function p(l){return l?l.replace(/\$\((.*?)\)/g,(G,A)=>` ${A} `).trim():""}class ue{constructor(G,A,m){this.id=G,this.definition=A,this.description=m,xe.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var Y;(function(l){l.iconNameSegment="[A-Za-z0-9]+",l.iconNameExpression="[A-Za-z0-9\\-]+",l.iconModifierExpression="~[A-Za-z]+";const G=new RegExp(`^(${l.iconNameExpression})(${l.iconModifierExpression})?$`);function A(y){if(y instanceof ue)return["codicon","codicon-"+y.id];const b=G.exec(y.id);if(!b)return A(ue.error);let[,F,K]=b;const H=["codicon","codicon-"+F];return K&&H.push("codicon-modifier-"+K.substr(1)),H}l.asClassNameArray=A;function m(y){return A(y).join(" ")}l.asClassName=m;function _(y){return"."+A(y).join(".")}l.asCSSSelector=_})(Y||(Y={})),function(l){l.add=new l("add",{fontCharacter:"\\ea60"}),l.plus=new l("plus",l.add.definition),l.gistNew=new l("gist-new",l.add.definition),l.repoCreate=new l("repo-create",l.add.definition),l.lightbulb=new l("lightbulb",{fontCharacter:"\\ea61"}),l.lightBulb=new l("light-bulb",{fontCharacter:"\\ea61"}),l.repo=new l("repo",{fontCharacter:"\\ea62"}),l.repoDelete=new l("repo-delete",{fontCharacter:"\\ea62"}),l.gistFork=new l("gist-fork",{fontCharacter:"\\ea63"}),l.repoForked=new l("repo-forked",{fontCharacter:"\\ea63"}),l.gitPullRequest=new l("git-pull-request",{fontCharacter:"\\ea64"}),l.gitPullRequestAbandoned=new l("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),l.recordKeys=new l("record-keys",{fontCharacter:"\\ea65"}),l.keyboard=new l("keyboard",{fontCharacter:"\\ea65"}),l.tag=new l("tag",{fontCharacter:"\\ea66"}),l.tagAdd=new l("tag-add",{fontCharacter:"\\ea66"}),l.tagRemove=new l("tag-remove",{fontCharacter:"\\ea66"}),l.person=new l("person",{fontCharacter:"\\ea67"}),l.personFollow=new l("person-follow",{fontCharacter:"\\ea67"}),l.personOutline=new l("person-outline",{fontCharacter:"\\ea67"}),l.personFilled=new l("person-filled",{fontCharacter:"\\ea67"}),l.gitBranch=new l("git-branch",{fontCharacter:"\\ea68"}),l.gitBranchCreate=new l("git-branch-create",{fontCharacter:"\\ea68"}),l.gitBranchDelete=new l("git-branch-delete",{fontCharacter:"\\ea68"}),l.sourceControl=new l("source-control",{fontCharacter:"\\ea68"}),l.mirror=new l("mirror",{fontCharacter:"\\ea69"}),l.mirrorPublic=new l("mirror-public",{fontCharacter:"\\ea69"}),l.star=new l("star",{fontCharacter:"\\ea6a"}),l.starAdd=new l("star-add",{fontCharacter:"\\ea6a"}),l.starDelete=new l("star-delete",{fontCharacter:"\\ea6a"}),l.starEmpty=new l("star-empty",{fontCharacter:"\\ea6a"}),l.comment=new l("comment",{fontCharacter:"\\ea6b"}),l.commentAdd=new l("comment-add",{fontCharacter:"\\ea6b"}),l.alert=new l("alert",{fontCharacter:"\\ea6c"}),l.warning=new l("warning",{fontCharacter:"\\ea6c"}),l.search=new l("search",{fontCharacter:"\\ea6d"}),l.searchSave=new l("search-save",{fontCharacter:"\\ea6d"}),l.logOut=new l("log-out",{fontCharacter:"\\ea6e"}),l.signOut=new l("sign-out",{fontCharacter:"\\ea6e"}),l.logIn=new l("log-in",{fontCharacter:"\\ea6f"}),l.signIn=new l("sign-in",{fontCharacter:"\\ea6f"}),l.eye=new l("eye",{fontCharacter:"\\ea70"}),l.eyeUnwatch=new l("eye-unwatch",{fontCharacter:"\\ea70"}),l.eyeWatch=new l("eye-watch",{fontCharacter:"\\ea70"}),l.circleFilled=new l("circle-filled",{fontCharacter:"\\ea71"}),l.primitiveDot=new l("primitive-dot",{fontCharacter:"\\ea71"}),l.closeDirty=new l("close-dirty",{fontCharacter:"\\ea71"}),l.debugBreakpoint=new l("debug-breakpoint",{fontCharacter:"\\ea71"}),l.debugBreakpointDisabled=new l("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),l.debugHint=new l("debug-hint",{fontCharacter:"\\ea71"}),l.primitiveSquare=new l("primitive-square",{fontCharacter:"\\ea72"}),l.edit=new l("edit",{fontCharacter:"\\ea73"}),l.pencil=new l("pencil",{fontCharacter:"\\ea73"}),l.info=new l("info",{fontCharacter:"\\ea74"}),l.issueOpened=new l("issue-opened",{fontCharacter:"\\ea74"}),l.gistPrivate=new l("gist-private",{fontCharacter:"\\ea75"}),l.gitForkPrivate=new l("git-fork-private",{fontCharacter:"\\ea75"}),l.lock=new l("lock",{fontCharacter:"\\ea75"}),l.mirrorPrivate=new l("mirror-private",{fontCharacter:"\\ea75"}),l.close=new l("close",{fontCharacter:"\\ea76"}),l.removeClose=new l("remove-close",{fontCharacter:"\\ea76"}),l.x=new l("x",{fontCharacter:"\\ea76"}),l.repoSync=new l("repo-sync",{fontCharacter:"\\ea77"}),l.sync=new l("sync",{fontCharacter:"\\ea77"}),l.clone=new l("clone",{fontCharacter:"\\ea78"}),l.desktopDownload=new l("desktop-download",{fontCharacter:"\\ea78"}),l.beaker=new l("beaker",{fontCharacter:"\\ea79"}),l.microscope=new l("microscope",{fontCharacter:"\\ea79"}),l.vm=new l("vm",{fontCharacter:"\\ea7a"}),l.deviceDesktop=new l("device-desktop",{fontCharacter:"\\ea7a"}),l.file=new l("file",{fontCharacter:"\\ea7b"}),l.fileText=new l("file-text",{fontCharacter:"\\ea7b"}),l.more=new l("more",{fontCharacter:"\\ea7c"}),l.ellipsis=new l("ellipsis",{fontCharacter:"\\ea7c"}),l.kebabHorizontal=new l("kebab-horizontal",{fontCharacter:"\\ea7c"}),l.mailReply=new l("mail-reply",{fontCharacter:"\\ea7d"}),l.reply=new l("reply",{fontCharacter:"\\ea7d"}),l.organization=new l("organization",{fontCharacter:"\\ea7e"}),l.organizationFilled=new l("organization-filled",{fontCharacter:"\\ea7e"}),l.organizationOutline=new l("organization-outline",{fontCharacter:"\\ea7e"}),l.newFile=new l("new-file",{fontCharacter:"\\ea7f"}),l.fileAdd=new l("file-add",{fontCharacter:"\\ea7f"}),l.newFolder=new l("new-folder",{fontCharacter:"\\ea80"}),l.fileDirectoryCreate=new l("file-directory-create",{fontCharacter:"\\ea80"}),l.trash=new l("trash",{fontCharacter:"\\ea81"}),l.trashcan=new l("trashcan",{fontCharacter:"\\ea81"}),l.history=new l("history",{fontCharacter:"\\ea82"}),l.clock=new l("clock",{fontCharacter:"\\ea82"}),l.folder=new l("folder",{fontCharacter:"\\ea83"}),l.fileDirectory=new l("file-directory",{fontCharacter:"\\ea83"}),l.symbolFolder=new l("symbol-folder",{fontCharacter:"\\ea83"}),l.logoGithub=new l("logo-github",{fontCharacter:"\\ea84"}),l.markGithub=new l("mark-github",{fontCharacter:"\\ea84"}),l.github=new l("github",{fontCharacter:"\\ea84"}),l.terminal=new l("terminal",{fontCharacter:"\\ea85"}),l.console=new l("console",{fontCharacter:"\\ea85"}),l.repl=new l("repl",{fontCharacter:"\\ea85"}),l.zap=new l("zap",{fontCharacter:"\\ea86"}),l.symbolEvent=new l("symbol-event",{fontCharacter:"\\ea86"}),l.error=new l("error",{fontCharacter:"\\ea87"}),l.stop=new l("stop",{fontCharacter:"\\ea87"}),l.variable=new l("variable",{fontCharacter:"\\ea88"}),l.symbolVariable=new l("symbol-variable",{fontCharacter:"\\ea88"}),l.array=new l("array",{fontCharacter:"\\ea8a"}),l.symbolArray=new l("symbol-array",{fontCharacter:"\\ea8a"}),l.symbolModule=new l("symbol-module",{fontCharacter:"\\ea8b"}),l.symbolPackage=new l("symbol-package",{fontCharacter:"\\ea8b"}),l.symbolNamespace=new l("symbol-namespace",{fontCharacter:"\\ea8b"}),l.symbolObject=new l("symbol-object",{fontCharacter:"\\ea8b"}),l.symbolMethod=new l("symbol-method",{fontCharacter:"\\ea8c"}),l.symbolFunction=new l("symbol-function",{fontCharacter:"\\ea8c"}),l.symbolConstructor=new l("symbol-constructor",{fontCharacter:"\\ea8c"}),l.symbolBoolean=new l("symbol-boolean",{fontCharacter:"\\ea8f"}),l.symbolNull=new l("symbol-null",{fontCharacter:"\\ea8f"}),l.symbolNumeric=new l("symbol-numeric",{fontCharacter:"\\ea90"}),l.symbolNumber=new l("symbol-number",{fontCharacter:"\\ea90"}),l.symbolStructure=new l("symbol-structure",{fontCharacter:"\\ea91"}),l.symbolStruct=new l("symbol-struct",{fontCharacter:"\\ea91"}),l.symbolParameter=new l("symbol-parameter",{fontCharacter:"\\ea92"}),l.symbolTypeParameter=new l("symbol-type-parameter",{fontCharacter:"\\ea92"}),l.symbolKey=new l("symbol-key",{fontCharacter:"\\ea93"}),l.symbolText=new l("symbol-text",{fontCharacter:"\\ea93"}),l.symbolReference=new l("symbol-reference",{fontCharacter:"\\ea94"}),l.goToFile=new l("go-to-file",{fontCharacter:"\\ea94"}),l.symbolEnum=new l("symbol-enum",{fontCharacter:"\\ea95"}),l.symbolValue=new l("symbol-value",{fontCharacter:"\\ea95"}),l.symbolRuler=new l("symbol-ruler",{fontCharacter:"\\ea96"}),l.symbolUnit=new l("symbol-unit",{fontCharacter:"\\ea96"}),l.activateBreakpoints=new l("activate-breakpoints",{fontCharacter:"\\ea97"}),l.archive=new l("archive",{fontCharacter:"\\ea98"}),l.arrowBoth=new l("arrow-both",{fontCharacter:"\\ea99"}),l.arrowDown=new l("arrow-down",{fontCharacter:"\\ea9a"}),l.arrowLeft=new l("arrow-left",{fontCharacter:"\\ea9b"}),l.arrowRight=new l("arrow-right",{fontCharacter:"\\ea9c"}),l.arrowSmallDown=new l("arrow-small-down",{fontCharacter:"\\ea9d"}),l.arrowSmallLeft=new l("arrow-small-left",{fontCharacter:"\\ea9e"}),l.arrowSmallRight=new l("arrow-small-right",{fontCharacter:"\\ea9f"}),l.arrowSmallUp=new l("arrow-small-up",{fontCharacter:"\\eaa0"}),l.arrowUp=new l("arrow-up",{fontCharacter:"\\eaa1"}),l.bell=new l("bell",{fontCharacter:"\\eaa2"}),l.bold=new l("bold",{fontCharacter:"\\eaa3"}),l.book=new l("book",{fontCharacter:"\\eaa4"}),l.bookmark=new l("bookmark",{fontCharacter:"\\eaa5"}),l.debugBreakpointConditionalUnverified=new l("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),l.debugBreakpointConditional=new l("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),l.debugBreakpointConditionalDisabled=new l("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),l.debugBreakpointDataUnverified=new l("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),l.debugBreakpointData=new l("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),l.debugBreakpointDataDisabled=new l("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),l.debugBreakpointLogUnverified=new l("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),l.debugBreakpointLog=new l("debug-breakpoint-log",{fontCharacter:"\\eaab"}),l.debugBreakpointLogDisabled=new l("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),l.briefcase=new l("briefcase",{fontCharacter:"\\eaac"}),l.broadcast=new l("broadcast",{fontCharacter:"\\eaad"}),l.browser=new l("browser",{fontCharacter:"\\eaae"}),l.bug=new l("bug",{fontCharacter:"\\eaaf"}),l.calendar=new l("calendar",{fontCharacter:"\\eab0"}),l.caseSensitive=new l("case-sensitive",{fontCharacter:"\\eab1"}),l.check=new l("check",{fontCharacter:"\\eab2"}),l.checklist=new l("checklist",{fontCharacter:"\\eab3"}),l.chevronDown=new l("chevron-down",{fontCharacter:"\\eab4"}),l.dropDownButton=new l("drop-down-button",l.chevronDown.definition),l.chevronLeft=new l("chevron-left",{fontCharacter:"\\eab5"}),l.chevronRight=new l("chevron-right",{fontCharacter:"\\eab6"}),l.chevronUp=new l("chevron-up",{fontCharacter:"\\eab7"}),l.chromeClose=new l("chrome-close",{fontCharacter:"\\eab8"}),l.chromeMaximize=new l("chrome-maximize",{fontCharacter:"\\eab9"}),l.chromeMinimize=new l("chrome-minimize",{fontCharacter:"\\eaba"}),l.chromeRestore=new l("chrome-restore",{fontCharacter:"\\eabb"}),l.circleOutline=new l("circle-outline",{fontCharacter:"\\eabc"}),l.debugBreakpointUnverified=new l("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),l.circleSlash=new l("circle-slash",{fontCharacter:"\\eabd"}),l.circuitBoard=new l("circuit-board",{fontCharacter:"\\eabe"}),l.clearAll=new l("clear-all",{fontCharacter:"\\eabf"}),l.clippy=new l("clippy",{fontCharacter:"\\eac0"}),l.closeAll=new l("close-all",{fontCharacter:"\\eac1"}),l.cloudDownload=new l("cloud-download",{fontCharacter:"\\eac2"}),l.cloudUpload=new l("cloud-upload",{fontCharacter:"\\eac3"}),l.code=new l("code",{fontCharacter:"\\eac4"}),l.collapseAll=new l("collapse-all",{fontCharacter:"\\eac5"}),l.colorMode=new l("color-mode",{fontCharacter:"\\eac6"}),l.commentDiscussion=new l("comment-discussion",{fontCharacter:"\\eac7"}),l.compareChanges=new l("compare-changes",{fontCharacter:"\\eafd"}),l.creditCard=new l("credit-card",{fontCharacter:"\\eac9"}),l.dash=new l("dash",{fontCharacter:"\\eacc"}),l.dashboard=new l("dashboard",{fontCharacter:"\\eacd"}),l.database=new l("database",{fontCharacter:"\\eace"}),l.debugContinue=new l("debug-continue",{fontCharacter:"\\eacf"}),l.debugDisconnect=new l("debug-disconnect",{fontCharacter:"\\ead0"}),l.debugPause=new l("debug-pause",{fontCharacter:"\\ead1"}),l.debugRestart=new l("debug-restart",{fontCharacter:"\\ead2"}),l.debugStart=new l("debug-start",{fontCharacter:"\\ead3"}),l.debugStepInto=new l("debug-step-into",{fontCharacter:"\\ead4"}),l.debugStepOut=new l("debug-step-out",{fontCharacter:"\\ead5"}),l.debugStepOver=new l("debug-step-over",{fontCharacter:"\\ead6"}),l.debugStop=new l("debug-stop",{fontCharacter:"\\ead7"}),l.debug=new l("debug",{fontCharacter:"\\ead8"}),l.deviceCameraVideo=new l("device-camera-video",{fontCharacter:"\\ead9"}),l.deviceCamera=new l("device-camera",{fontCharacter:"\\eada"}),l.deviceMobile=new l("device-mobile",{fontCharacter:"\\eadb"}),l.diffAdded=new l("diff-added",{fontCharacter:"\\eadc"}),l.diffIgnored=new l("diff-ignored",{fontCharacter:"\\eadd"}),l.diffModified=new l("diff-modified",{fontCharacter:"\\eade"}),l.diffRemoved=new l("diff-removed",{fontCharacter:"\\eadf"}),l.diffRenamed=new l("diff-renamed",{fontCharacter:"\\eae0"}),l.diff=new l("diff",{fontCharacter:"\\eae1"}),l.discard=new l("discard",{fontCharacter:"\\eae2"}),l.editorLayout=new l("editor-layout",{fontCharacter:"\\eae3"}),l.emptyWindow=new l("empty-window",{fontCharacter:"\\eae4"}),l.exclude=new l("exclude",{fontCharacter:"\\eae5"}),l.extensions=new l("extensions",{fontCharacter:"\\eae6"}),l.eyeClosed=new l("eye-closed",{fontCharacter:"\\eae7"}),l.fileBinary=new l("file-binary",{fontCharacter:"\\eae8"}),l.fileCode=new l("file-code",{fontCharacter:"\\eae9"}),l.fileMedia=new l("file-media",{fontCharacter:"\\eaea"}),l.filePdf=new l("file-pdf",{fontCharacter:"\\eaeb"}),l.fileSubmodule=new l("file-submodule",{fontCharacter:"\\eaec"}),l.fileSymlinkDirectory=new l("file-symlink-directory",{fontCharacter:"\\eaed"}),l.fileSymlinkFile=new l("file-symlink-file",{fontCharacter:"\\eaee"}),l.fileZip=new l("file-zip",{fontCharacter:"\\eaef"}),l.files=new l("files",{fontCharacter:"\\eaf0"}),l.filter=new l("filter",{fontCharacter:"\\eaf1"}),l.flame=new l("flame",{fontCharacter:"\\eaf2"}),l.foldDown=new l("fold-down",{fontCharacter:"\\eaf3"}),l.foldUp=new l("fold-up",{fontCharacter:"\\eaf4"}),l.fold=new l("fold",{fontCharacter:"\\eaf5"}),l.folderActive=new l("folder-active",{fontCharacter:"\\eaf6"}),l.folderOpened=new l("folder-opened",{fontCharacter:"\\eaf7"}),l.gear=new l("gear",{fontCharacter:"\\eaf8"}),l.gift=new l("gift",{fontCharacter:"\\eaf9"}),l.gistSecret=new l("gist-secret",{fontCharacter:"\\eafa"}),l.gist=new l("gist",{fontCharacter:"\\eafb"}),l.gitCommit=new l("git-commit",{fontCharacter:"\\eafc"}),l.gitCompare=new l("git-compare",{fontCharacter:"\\eafd"}),l.gitMerge=new l("git-merge",{fontCharacter:"\\eafe"}),l.githubAction=new l("github-action",{fontCharacter:"\\eaff"}),l.githubAlt=new l("github-alt",{fontCharacter:"\\eb00"}),l.globe=new l("globe",{fontCharacter:"\\eb01"}),l.grabber=new l("grabber",{fontCharacter:"\\eb02"}),l.graph=new l("graph",{fontCharacter:"\\eb03"}),l.gripper=new l("gripper",{fontCharacter:"\\eb04"}),l.heart=new l("heart",{fontCharacter:"\\eb05"}),l.home=new l("home",{fontCharacter:"\\eb06"}),l.horizontalRule=new l("horizontal-rule",{fontCharacter:"\\eb07"}),l.hubot=new l("hubot",{fontCharacter:"\\eb08"}),l.inbox=new l("inbox",{fontCharacter:"\\eb09"}),l.issueClosed=new l("issue-closed",{fontCharacter:"\\eba4"}),l.issueReopened=new l("issue-reopened",{fontCharacter:"\\eb0b"}),l.issues=new l("issues",{fontCharacter:"\\eb0c"}),l.italic=new l("italic",{fontCharacter:"\\eb0d"}),l.jersey=new l("jersey",{fontCharacter:"\\eb0e"}),l.json=new l("json",{fontCharacter:"\\eb0f"}),l.kebabVertical=new l("kebab-vertical",{fontCharacter:"\\eb10"}),l.key=new l("key",{fontCharacter:"\\eb11"}),l.law=new l("law",{fontCharacter:"\\eb12"}),l.lightbulbAutofix=new l("lightbulb-autofix",{fontCharacter:"\\eb13"}),l.linkExternal=new l("link-external",{fontCharacter:"\\eb14"}),l.link=new l("link",{fontCharacter:"\\eb15"}),l.listOrdered=new l("list-ordered",{fontCharacter:"\\eb16"}),l.listUnordered=new l("list-unordered",{fontCharacter:"\\eb17"}),l.liveShare=new l("live-share",{fontCharacter:"\\eb18"}),l.loading=new l("loading",{fontCharacter:"\\eb19"}),l.location=new l("location",{fontCharacter:"\\eb1a"}),l.mailRead=new l("mail-read",{fontCharacter:"\\eb1b"}),l.mail=new l("mail",{fontCharacter:"\\eb1c"}),l.markdown=new l("markdown",{fontCharacter:"\\eb1d"}),l.megaphone=new l("megaphone",{fontCharacter:"\\eb1e"}),l.mention=new l("mention",{fontCharacter:"\\eb1f"}),l.milestone=new l("milestone",{fontCharacter:"\\eb20"}),l.mortarBoard=new l("mortar-board",{fontCharacter:"\\eb21"}),l.move=new l("move",{fontCharacter:"\\eb22"}),l.multipleWindows=new l("multiple-windows",{fontCharacter:"\\eb23"}),l.mute=new l("mute",{fontCharacter:"\\eb24"}),l.noNewline=new l("no-newline",{fontCharacter:"\\eb25"}),l.note=new l("note",{fontCharacter:"\\eb26"}),l.octoface=new l("octoface",{fontCharacter:"\\eb27"}),l.openPreview=new l("open-preview",{fontCharacter:"\\eb28"}),l.package_=new l("package",{fontCharacter:"\\eb29"}),l.paintcan=new l("paintcan",{fontCharacter:"\\eb2a"}),l.pin=new l("pin",{fontCharacter:"\\eb2b"}),l.play=new l("play",{fontCharacter:"\\eb2c"}),l.run=new l("run",{fontCharacter:"\\eb2c"}),l.plug=new l("plug",{fontCharacter:"\\eb2d"}),l.preserveCase=new l("preserve-case",{fontCharacter:"\\eb2e"}),l.preview=new l("preview",{fontCharacter:"\\eb2f"}),l.project=new l("project",{fontCharacter:"\\eb30"}),l.pulse=new l("pulse",{fontCharacter:"\\eb31"}),l.question=new l("question",{fontCharacter:"\\eb32"}),l.quote=new l("quote",{fontCharacter:"\\eb33"}),l.radioTower=new l("radio-tower",{fontCharacter:"\\eb34"}),l.reactions=new l("reactions",{fontCharacter:"\\eb35"}),l.references=new l("references",{fontCharacter:"\\eb36"}),l.refresh=new l("refresh",{fontCharacter:"\\eb37"}),l.regex=new l("regex",{fontCharacter:"\\eb38"}),l.remoteExplorer=new l("remote-explorer",{fontCharacter:"\\eb39"}),l.remote=new l("remote",{fontCharacter:"\\eb3a"}),l.remove=new l("remove",{fontCharacter:"\\eb3b"}),l.replaceAll=new l("replace-all",{fontCharacter:"\\eb3c"}),l.replace=new l("replace",{fontCharacter:"\\eb3d"}),l.repoClone=new l("repo-clone",{fontCharacter:"\\eb3e"}),l.repoForcePush=new l("repo-force-push",{fontCharacter:"\\eb3f"}),l.repoPull=new l("repo-pull",{fontCharacter:"\\eb40"}),l.repoPush=new l("repo-push",{fontCharacter:"\\eb41"}),l.report=new l("report",{fontCharacter:"\\eb42"}),l.requestChanges=new l("request-changes",{fontCharacter:"\\eb43"}),l.rocket=new l("rocket",{fontCharacter:"\\eb44"}),l.rootFolderOpened=new l("root-folder-opened",{fontCharacter:"\\eb45"}),l.rootFolder=new l("root-folder",{fontCharacter:"\\eb46"}),l.rss=new l("rss",{fontCharacter:"\\eb47"}),l.ruby=new l("ruby",{fontCharacter:"\\eb48"}),l.saveAll=new l("save-all",{fontCharacter:"\\eb49"}),l.saveAs=new l("save-as",{fontCharacter:"\\eb4a"}),l.save=new l("save",{fontCharacter:"\\eb4b"}),l.screenFull=new l("screen-full",{fontCharacter:"\\eb4c"}),l.screenNormal=new l("screen-normal",{fontCharacter:"\\eb4d"}),l.searchStop=new l("search-stop",{fontCharacter:"\\eb4e"}),l.server=new l("server",{fontCharacter:"\\eb50"}),l.settingsGear=new l("settings-gear",{fontCharacter:"\\eb51"}),l.settings=new l("settings",{fontCharacter:"\\eb52"}),l.shield=new l("shield",{fontCharacter:"\\eb53"}),l.smiley=new l("smiley",{fontCharacter:"\\eb54"}),l.sortPrecedence=new l("sort-precedence",{fontCharacter:"\\eb55"}),l.splitHorizontal=new l("split-horizontal",{fontCharacter:"\\eb56"}),l.splitVertical=new l("split-vertical",{fontCharacter:"\\eb57"}),l.squirrel=new l("squirrel",{fontCharacter:"\\eb58"}),l.starFull=new l("star-full",{fontCharacter:"\\eb59"}),l.starHalf=new l("star-half",{fontCharacter:"\\eb5a"}),l.symbolClass=new l("symbol-class",{fontCharacter:"\\eb5b"}),l.symbolColor=new l("symbol-color",{fontCharacter:"\\eb5c"}),l.symbolConstant=new l("symbol-constant",{fontCharacter:"\\eb5d"}),l.symbolEnumMember=new l("symbol-enum-member",{fontCharacter:"\\eb5e"}),l.symbolField=new l("symbol-field",{fontCharacter:"\\eb5f"}),l.symbolFile=new l("symbol-file",{fontCharacter:"\\eb60"}),l.symbolInterface=new l("symbol-interface",{fontCharacter:"\\eb61"}),l.symbolKeyword=new l("symbol-keyword",{fontCharacter:"\\eb62"}),l.symbolMisc=new l("symbol-misc",{fontCharacter:"\\eb63"}),l.symbolOperator=new l("symbol-operator",{fontCharacter:"\\eb64"}),l.symbolProperty=new l("symbol-property",{fontCharacter:"\\eb65"}),l.wrench=new l("wrench",{fontCharacter:"\\eb65"}),l.wrenchSubaction=new l("wrench-subaction",{fontCharacter:"\\eb65"}),l.symbolSnippet=new l("symbol-snippet",{fontCharacter:"\\eb66"}),l.tasklist=new l("tasklist",{fontCharacter:"\\eb67"}),l.telescope=new l("telescope",{fontCharacter:"\\eb68"}),l.textSize=new l("text-size",{fontCharacter:"\\eb69"}),l.threeBars=new l("three-bars",{fontCharacter:"\\eb6a"}),l.thumbsdown=new l("thumbsdown",{fontCharacter:"\\eb6b"}),l.thumbsup=new l("thumbsup",{fontCharacter:"\\eb6c"}),l.tools=new l("tools",{fontCharacter:"\\eb6d"}),l.triangleDown=new l("triangle-down",{fontCharacter:"\\eb6e"}),l.triangleLeft=new l("triangle-left",{fontCharacter:"\\eb6f"}),l.triangleRight=new l("triangle-right",{fontCharacter:"\\eb70"}),l.triangleUp=new l("triangle-up",{fontCharacter:"\\eb71"}),l.twitter=new l("twitter",{fontCharacter:"\\eb72"}),l.unfold=new l("unfold",{fontCharacter:"\\eb73"}),l.unlock=new l("unlock",{fontCharacter:"\\eb74"}),l.unmute=new l("unmute",{fontCharacter:"\\eb75"}),l.unverified=new l("unverified",{fontCharacter:"\\eb76"}),l.verified=new l("verified",{fontCharacter:"\\eb77"}),l.versions=new l("versions",{fontCharacter:"\\eb78"}),l.vmActive=new l("vm-active",{fontCharacter:"\\eb79"}),l.vmOutline=new l("vm-outline",{fontCharacter:"\\eb7a"}),l.vmRunning=new l("vm-running",{fontCharacter:"\\eb7b"}),l.watch=new l("watch",{fontCharacter:"\\eb7c"}),l.whitespace=new l("whitespace",{fontCharacter:"\\eb7d"}),l.wholeWord=new l("whole-word",{fontCharacter:"\\eb7e"}),l.window=new l("window",{fontCharacter:"\\eb7f"}),l.wordWrap=new l("word-wrap",{fontCharacter:"\\eb80"}),l.zoomIn=new l("zoom-in",{fontCharacter:"\\eb81"}),l.zoomOut=new l("zoom-out",{fontCharacter:"\\eb82"}),l.listFilter=new l("list-filter",{fontCharacter:"\\eb83"}),l.listFlat=new l("list-flat",{fontCharacter:"\\eb84"}),l.listSelection=new l("list-selection",{fontCharacter:"\\eb85"}),l.selection=new l("selection",{fontCharacter:"\\eb85"}),l.listTree=new l("list-tree",{fontCharacter:"\\eb86"}),l.debugBreakpointFunctionUnverified=new l("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),l.debugBreakpointFunction=new l("debug-breakpoint-function",{fontCharacter:"\\eb88"}),l.debugBreakpointFunctionDisabled=new l("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),l.debugStackframeActive=new l("debug-stackframe-active",{fontCharacter:"\\eb89"}),l.debugStackframeDot=new l("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),l.debugStackframe=new l("debug-stackframe",{fontCharacter:"\\eb8b"}),l.debugStackframeFocused=new l("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),l.debugBreakpointUnsupported=new l("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),l.symbolString=new l("symbol-string",{fontCharacter:"\\eb8d"}),l.debugReverseContinue=new l("debug-reverse-continue",{fontCharacter:"\\eb8e"}),l.debugStepBack=new l("debug-step-back",{fontCharacter:"\\eb8f"}),l.debugRestartFrame=new l("debug-restart-frame",{fontCharacter:"\\eb90"}),l.callIncoming=new l("call-incoming",{fontCharacter:"\\eb92"}),l.callOutgoing=new l("call-outgoing",{fontCharacter:"\\eb93"}),l.menu=new l("menu",{fontCharacter:"\\eb94"}),l.expandAll=new l("expand-all",{fontCharacter:"\\eb95"}),l.feedback=new l("feedback",{fontCharacter:"\\eb96"}),l.groupByRefType=new l("group-by-ref-type",{fontCharacter:"\\eb97"}),l.ungroupByRefType=new l("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),l.account=new l("account",{fontCharacter:"\\eb99"}),l.bellDot=new l("bell-dot",{fontCharacter:"\\eb9a"}),l.debugConsole=new l("debug-console",{fontCharacter:"\\eb9b"}),l.library=new l("library",{fontCharacter:"\\eb9c"}),l.output=new l("output",{fontCharacter:"\\eb9d"}),l.runAll=new l("run-all",{fontCharacter:"\\eb9e"}),l.syncIgnored=new l("sync-ignored",{fontCharacter:"\\eb9f"}),l.pinned=new l("pinned",{fontCharacter:"\\eba0"}),l.githubInverted=new l("github-inverted",{fontCharacter:"\\eba1"}),l.debugAlt=new l("debug-alt",{fontCharacter:"\\eb91"}),l.serverProcess=new l("server-process",{fontCharacter:"\\eba2"}),l.serverEnvironment=new l("server-environment",{fontCharacter:"\\eba3"}),l.pass=new l("pass",{fontCharacter:"\\eba4"}),l.stopCircle=new l("stop-circle",{fontCharacter:"\\eba5"}),l.playCircle=new l("play-circle",{fontCharacter:"\\eba6"}),l.record=new l("record",{fontCharacter:"\\eba7"}),l.debugAltSmall=new l("debug-alt-small",{fontCharacter:"\\eba8"}),l.vmConnect=new l("vm-connect",{fontCharacter:"\\eba9"}),l.cloud=new l("cloud",{fontCharacter:"\\ebaa"}),l.merge=new l("merge",{fontCharacter:"\\ebab"}),l.exportIcon=new l("export",{fontCharacter:"\\ebac"}),l.graphLeft=new l("graph-left",{fontCharacter:"\\ebad"}),l.magnet=new l("magnet",{fontCharacter:"\\ebae"}),l.notebook=new l("notebook",{fontCharacter:"\\ebaf"}),l.redo=new l("redo",{fontCharacter:"\\ebb0"}),l.checkAll=new l("check-all",{fontCharacter:"\\ebb1"}),l.pinnedDirty=new l("pinned-dirty",{fontCharacter:"\\ebb2"}),l.passFilled=new l("pass-filled",{fontCharacter:"\\ebb3"}),l.circleLargeFilled=new l("circle-large-filled",{fontCharacter:"\\ebb4"}),l.circleLargeOutline=new l("circle-large-outline",{fontCharacter:"\\ebb5"}),l.combine=new l("combine",{fontCharacter:"\\ebb6"}),l.gather=new l("gather",{fontCharacter:"\\ebb6"}),l.table=new l("table",{fontCharacter:"\\ebb7"}),l.variableGroup=new l("variable-group",{fontCharacter:"\\ebb8"}),l.typeHierarchy=new l("type-hierarchy",{fontCharacter:"\\ebb9"}),l.typeHierarchySub=new l("type-hierarchy-sub",{fontCharacter:"\\ebba"}),l.typeHierarchySuper=new l("type-hierarchy-super",{fontCharacter:"\\ebbb"}),l.gitPullRequestCreate=new l("git-pull-request-create",{fontCharacter:"\\ebbc"}),l.runAbove=new l("run-above",{fontCharacter:"\\ebbd"}),l.runBelow=new l("run-below",{fontCharacter:"\\ebbe"}),l.notebookTemplate=new l("notebook-template",{fontCharacter:"\\ebbf"}),l.debugRerun=new l("debug-rerun",{fontCharacter:"\\ebc0"}),l.workspaceTrusted=new l("workspace-trusted",{fontCharacter:"\\ebc1"}),l.workspaceUntrusted=new l("workspace-untrusted",{fontCharacter:"\\ebc2"}),l.workspaceUnspecified=new l("workspace-unspecified",{fontCharacter:"\\ebc3"}),l.terminalCmd=new l("terminal-cmd",{fontCharacter:"\\ebc4"}),l.terminalDebian=new l("terminal-debian",{fontCharacter:"\\ebc5"}),l.terminalLinux=new l("terminal-linux",{fontCharacter:"\\ebc6"}),l.terminalPowershell=new l("terminal-powershell",{fontCharacter:"\\ebc7"}),l.terminalTmux=new l("terminal-tmux",{fontCharacter:"\\ebc8"}),l.terminalUbuntu=new l("terminal-ubuntu",{fontCharacter:"\\ebc9"}),l.terminalBash=new l("terminal-bash",{fontCharacter:"\\ebca"}),l.arrowSwap=new l("arrow-swap",{fontCharacter:"\\ebcb"}),l.copy=new l("copy",{fontCharacter:"\\ebcc"}),l.personAdd=new l("person-add",{fontCharacter:"\\ebcd"}),l.filterFilled=new l("filter-filled",{fontCharacter:"\\ebce"}),l.wand=new l("wand",{fontCharacter:"\\ebcf"}),l.debugLineByLine=new l("debug-line-by-line",{fontCharacter:"\\ebd0"}),l.inspect=new l("inspect",{fontCharacter:"\\ebd1"}),l.layers=new l("layers",{fontCharacter:"\\ebd2"}),l.layersDot=new l("layers-dot",{fontCharacter:"\\ebd3"}),l.layersActive=new l("layers-active",{fontCharacter:"\\ebd4"}),l.compass=new l("compass",{fontCharacter:"\\ebd5"}),l.compassDot=new l("compass-dot",{fontCharacter:"\\ebd6"}),l.compassActive=new l("compass-active",{fontCharacter:"\\ebd7"}),l.azure=new l("azure",{fontCharacter:"\\ebd8"}),l.issueDraft=new l("issue-draft",{fontCharacter:"\\ebd9"}),l.gitPullRequestClosed=new l("git-pull-request-closed",{fontCharacter:"\\ebda"}),l.gitPullRequestDraft=new l("git-pull-request-draft",{fontCharacter:"\\ebdb"}),l.debugAll=new l("debug-all",{fontCharacter:"\\ebdc"}),l.debugCoverage=new l("debug-coverage",{fontCharacter:"\\ebdd"}),l.runErrors=new l("run-errors",{fontCharacter:"\\ebde"}),l.folderLibrary=new l("folder-library",{fontCharacter:"\\ebdf"}),l.debugContinueSmall=new l("debug-continue-small",{fontCharacter:"\\ebe0"}),l.beakerStop=new l("beaker-stop",{fontCharacter:"\\ebe1"}),l.graphLine=new l("graph-line",{fontCharacter:"\\ebe2"}),l.graphScatter=new l("graph-scatter",{fontCharacter:"\\ebe3"}),l.pieChart=new l("pie-chart",{fontCharacter:"\\ebe4"}),l.bracket=new l("bracket",l.json.definition),l.bracketDot=new l("bracket-dot",{fontCharacter:"\\ebe5"}),l.bracketError=new l("bracket-error",{fontCharacter:"\\ebe6"}),l.lockSmall=new l("lock-small",{fontCharacter:"\\ebe7"}),l.azureDevops=new l("azure-devops",{fontCharacter:"\\ebe8"}),l.verifiedFilled=new l("verified-filled",{fontCharacter:"\\ebe9"})}(ue||(ue={}))},79881:function(Ut,ft,R){"use strict";R.d(ft,{B8:function(){return A},Cp:function(){return ee},F0:function(){return Y},L6:function(){return G},VV:function(){return ue},b1:function(){return l},dL:function(){return xe},ri:function(){return W}});class E{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(_){setTimeout(()=>{throw _.stack?new Error(_.message+`
|
|
|
|
`+_.stack):_},0)}}emit(_){this.listeners.forEach(y=>{y(_)})}onUnexpectedError(_){this.unexpectedErrorHandler(_),this.emit(_)}onUnexpectedExternalError(_){this.unexpectedErrorHandler(_)}}const le=new E;function xe(m){ue(m)||le.onUnexpectedError(m)}function ee(m){ue(m)||le.onUnexpectedExternalError(m)}function W(m){if(m instanceof Error){let{name:_,message:y}=m;const b=m.stacktrace||m.stack;return{$isError:!0,name:_,message:y,stack:b}}return m}const p="Canceled";function ue(m){return m instanceof Error&&m.name===p&&m.message===p}function Y(){const m=new Error(p);return m.name=m.message,m}function l(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function G(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class A extends Error{constructor(_){super("NotSupported"),_&&(this.message=_)}}},4348:function(Ut,ft,R){"use strict";R.d(ft,{D0:function(){return A},E7:function(){return m},K3:function(){return G},Q5:function(){return l},ZD:function(){return _},ju:function(){return W}});var E=R(79881),le=R(69323),xe=R(34502),ee=R(95830),W;(function(y){y.None=()=>le.JT.None;function b(T){return(I,N=null,U)=>{let g=!1,d;return d=T(D=>{if(!g)return d?d.dispose():g=!0,I.call(N,D)},null,U),g&&d.dispose(),d}}y.once=b;function F(T,I){return z((N,U=null,g)=>T(d=>N.call(U,I(d)),null,g))}y.map=F;function K(T,I){return z((N,U=null,g)=>T(d=>{I(d),N.call(U,d)},null,g))}y.forEach=K;function H(T,I){return z((N,U=null,g)=>T(d=>I(d)&&N.call(U,d),null,g))}y.filter=H;function L(T){return T}y.signal=L;function O(...T){return(I,N=null,U)=>(0,le.F8)(...T.map(g=>g(d=>I.call(N,d),null,U)))}y.any=O;function k(T,I,N){let U=N;return F(T,g=>(U=I(U,g),U))}y.reduce=k;function z(T){let I;const N=new l({onFirstListenerAdd(){I=T(N.fire,N)},onLastListenerRemove(){I.dispose()}});return N.event}function J(T,I,N=100,U=!1,g){let d,D,$,he=0;const Se=new l({leakWarningThreshold:g,onFirstListenerAdd(){d=T(qe=>{he++,D=I(D,qe),U&&!$&&(Se.fire(D),D=void 0),clearTimeout($),$=setTimeout(()=>{const Ue=D;D=void 0,$=void 0,(!U||he>1)&&Se.fire(Ue),he=0},N)})},onLastListenerRemove(){d.dispose()}});return Se.event}y.debounce=J;function ne(T,I=(N,U)=>N===U){let N=!0,U;return H(T,g=>{const d=N||!I(g,U);return N=!1,U=g,d})}y.latch=ne;function Z(T,I){return[y.filter(T,I),y.filter(T,N=>!I(N))]}y.split=Z;function ae(T,I=!1,N=[]){let U=N.slice(),g=T($=>{U?U.push($):D.fire($)});const d=()=>{U&&U.forEach($=>D.fire($)),U=null},D=new l({onFirstListenerAdd(){g||(g=T($=>D.fire($)))},onFirstListenerDidAdd(){U&&(I?setTimeout(d):d())},onLastListenerRemove(){g&&g.dispose(),g=null}});return D.event}y.buffer=ae;class oe{constructor(I){this.event=I}map(I){return new oe(F(this.event,I))}forEach(I){return new oe(K(this.event,I))}filter(I){return new oe(H(this.event,I))}reduce(I,N){return new oe(k(this.event,I,N))}latch(){return new oe(ne(this.event))}debounce(I,N=100,U=!1,g){return new oe(J(this.event,I,N,U,g))}on(I,N,U){return this.event(I,N,U)}once(I,N,U){return b(this.event)(I,N,U)}}function re(T){return new oe(T)}y.chain=re;function Re(T,I,N=U=>U){const U=(...$)=>D.fire(N(...$)),g=()=>T.on(I,U),d=()=>T.removeListener(I,U),D=new l({onFirstListenerAdd:g,onLastListenerRemove:d});return D.event}y.fromNodeEventEmitter=Re;function M(T,I,N=U=>U){const U=(...$)=>D.fire(N(...$)),g=()=>T.addEventListener(I,U),d=()=>T.removeEventListener(I,U),D=new l({onFirstListenerAdd:g,onLastListenerRemove:d});return D.event}y.fromDOMEventEmitter=M;function w(T){return new Promise(I=>b(T)(I))}y.toPromise=w})(W||(W={}));class p{constructor(b){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${b}_${p._idPool++}`}start(b){this._stopWatch=new ee.G(!0),this._listenerCount=b}stop(){if(this._stopWatch){const b=this._stopWatch.elapsed();this._elapsedOverall+=b,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${b.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}p._idPool=0;let ue=-1;class Y{constructor(b,F=Math.random().toString(18).slice(2,5)){this.customThreshold=b,this.name=F,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(b){let F=ue;if(typeof this.customThreshold=="number"&&(F=this.customThreshold),F<=0||b<F)return;this._stacks||(this._stacks=new Map);const K=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),H=this._stacks.get(K)||0;if(this._stacks.set(K,H+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=F*.5;let L,O=0;for(const[k,z]of this._stacks)(!L||O<z)&&(L=k,O=z);console.warn(`[${this.name}] potential listener LEAK detected, having ${b} listeners already. MOST frequent listener (${O}):`),console.warn(L)}return()=>{const L=this._stacks.get(K)||0;this._stacks.set(K,L-1)}}}class l{constructor(b){var F;this._disposed=!1,this._options=b,this._leakageMon=ue>0?new Y(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((F=this._options)===null||F===void 0)&&F._profName?new p(this._options._profName):void 0}get event(){return this._event||(this._event=(b,F,K)=>{var H;this._listeners||(this._listeners=new xe.S);const L=this._listeners.isEmpty();L&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const O=this._listeners.push(F?[b,F]:b);L&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,b,F);const k=(H=this._leakageMon)===null||H===void 0?void 0:H.check(this._listeners.size),z=(0,le.OF)(()=>{k&&k(),this._disposed||(O(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return K instanceof le.SL?K.add(z):Array.isArray(K)&&K.push(z),z}),this._event}fire(b){var F,K;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new xe.S);for(let H of this._listeners)this._deliveryQueue.push([H,b]);for((F=this._perfMon)===null||F===void 0||F.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[H,L]=this._deliveryQueue.shift();try{typeof H=="function"?H.call(void 0,L):H[0].call(H[1],L)}catch(O){(0,E.dL)(O)}}(K=this._perfMon)===null||K===void 0||K.stop()}}dispose(){var b,F,K,H,L;this._disposed||(this._disposed=!0,(b=this._listeners)===null||b===void 0||b.clear(),(F=this._deliveryQueue)===null||F===void 0||F.clear(),(H=(K=this._options)===null||K===void 0?void 0:K.onLastListenerRemove)===null||H===void 0||H.call(K),(L=this._leakageMon)===null||L===void 0||L.dispose())}}class G extends l{constructor(b){super(b),this._isPaused=0,this._eventQueue=new xe.S,this._mergeFn=b==null?void 0:b.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const b=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(b))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(b){this._listeners&&(this._isPaused!==0?this._eventQueue.push(b):super.fire(b))}}class A extends G{constructor(b){var F;super(b),this._delay=(F=b.delay)!==null&&F!==void 0?F:100}fire(b){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(b)}}class m{constructor(){this.buffers=[]}wrapEvent(b){return(F,K,H)=>b(L=>{const O=this.buffers[this.buffers.length-1];O?O.push(()=>F.call(K,L)):F.call(K,L)},void 0,H)}bufferEvents(b){const F=[];this.buffers.push(F);const K=b();return this.buffers.pop(),F.forEach(H=>H()),K}}class _{constructor(){this.listening=!1,this.inputEvent=W.None,this.inputEventListener=le.JT.None,this.emitter=new l({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(b){this.inputEvent=b,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=b(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(Ut,ft,R){"use strict";R.d(ft,{I:function(){return E}});function E(le){const xe=this;let ee=!1,W;return function(){return ee||(ee=!0,W=le.apply(xe,arguments)),W}}},88226:function(Ut,ft,R){"use strict";R.d(ft,{$:function(){return E}});var E;(function(le){function xe(O){return O&&typeof O=="object"&&typeof O[Symbol.iterator]=="function"}le.is=xe;const ee=Object.freeze([]);function W(){return ee}le.empty=W;function*p(O){yield O}le.single=p;function ue(O){return O||ee}le.from=ue;function Y(O){return!O||O[Symbol.iterator]().next().done===!0}le.isEmpty=Y;function l(O){return O[Symbol.iterator]().next().value}le.first=l;function G(O,k){for(const z of O)if(k(z))return!0;return!1}le.some=G;function A(O,k){for(const z of O)if(k(z))return z}le.find=A;function*m(O,k){for(const z of O)k(z)&&(yield z)}le.filter=m;function*_(O,k){let z=0;for(const J of O)yield k(J,z++)}le.map=_;function*y(...O){for(const k of O)for(const z of k)yield z}le.concat=y;function*b(O){for(const k of O)for(const z of k)yield z}le.concatNested=b;function F(O,k,z){let J=z;for(const ne of O)J=k(J,ne);return J}le.reduce=F;function*K(O,k,z=O.length){for(k<0&&(k+=O.length),z<0?z+=O.length:z>O.length&&(z=O.length);k<z;k++)yield O[k]}le.slice=K;function H(O,k=Number.POSITIVE_INFINITY){const z=[];if(k===0)return[z,O];const J=O[Symbol.iterator]();for(let ne=0;ne<k;ne++){const Z=J.next();if(Z.done)return[z,le.empty()];z.push(Z.value)}return[z,{[Symbol.iterator](){return J}}]}le.consume=H;function L(O,k,z=(J,ne)=>J===ne){const J=O[Symbol.iterator](),ne=k[Symbol.iterator]();for(;;){const Z=J.next(),ae=ne.next();if(Z.done!==ae.done)return!1;if(Z.done)return!0;if(!z(Z.value,ae.value))return!1}}le.equals=L})(E||(E={}))},69323:function(Ut,ft,R){"use strict";R.d(ft,{B9:function(){return _},F8:function(){return y},JT:function(){return K},Jz:function(){return L},OF:function(){return b},SL:function(){return F},Wf:function(){return m},XK:function(){return H},dk:function(){return G}});var E=R(17845),le=R(88226);const xe=!1;let ee=null;function W(O){ee=O}if(xe){const O="__is_disposable_tracked__";W(new class{trackDisposable(k){const z=new Error("Potentially leaked disposable").stack;setTimeout(()=>{k[O]||console.log(z)},3e3)}setParent(k,z){if(k&&k!==K.None)try{k[O]=!0}catch(J){}}markAsDisposed(k){if(k&&k!==K.None)try{k[O]=!0}catch(z){}}markAsSingleton(k){}})}function p(O){return ee==null||ee.trackDisposable(O),O}function ue(O){ee==null||ee.markAsDisposed(O)}function Y(O,k){ee==null||ee.setParent(O,k)}function l(O,k){if(ee)for(const z of O)ee.setParent(z,k)}function G(O){return ee==null||ee.markAsSingleton(O),O}class A extends Error{constructor(k){super(`Encountered errors while disposing of store. Errors: [${k.join(", ")}]`),this.errors=k}}function m(O){return typeof O.dispose=="function"&&O.dispose.length===0}function _(O){if(le.$.is(O)){let k=[];for(const z of O)if(z)try{z.dispose()}catch(J){k.push(J)}if(k.length===1)throw k[0];if(k.length>1)throw new A(k);return Array.isArray(O)?[]:O}else if(O)return O.dispose(),O}function y(...O){const k=b(()=>_(O));return l(O,k),k}function b(O){const k=p({dispose:(0,E.I)(()=>{ue(k),O()})});return k}class F{constructor(){this._toDispose=new Set,this._isDisposed=!1,p(this)}dispose(){this._isDisposed||(ue(this),this._isDisposed=!0,this.clear())}clear(){try{_(this._toDispose.values())}finally{this._toDispose.clear()}}add(k){if(!k)return k;if(k===this)throw new Error("Cannot register a disposable on itself!");return Y(k,this),this._isDisposed?F.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(k),k}}F.DISABLE_DISPOSED_WARNING=!1;class K{constructor(){this._store=new F,p(this),Y(this._store,this)}dispose(){ue(this),this._store.dispose()}_register(k){if(k===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(k)}}K.None=Object.freeze({dispose(){}});class H{constructor(){this._isDisposed=!1,p(this)}get value(){return this._isDisposed?void 0:this._value}set value(k){var z;this._isDisposed||k===this._value||((z=this._value)===null||z===void 0||z.dispose(),k&&Y(k,this),this._value=k)}clear(){this.value=void 0}dispose(){var k;this._isDisposed=!0,ue(this),(k=this._value)===null||k===void 0||k.dispose(),this._value=void 0}clearAndLeak(){const k=this._value;return this._value=void 0,k&&Y(k,null),k}}class L{constructor(k){this.object=k}dispose(){}}},34502:function(Ut,ft,R){"use strict";R.d(ft,{S:function(){return le}});class E{constructor(ee){this.element=ee,this.next=E.Undefined,this.prev=E.Undefined}}E.Undefined=new E(void 0);class le{constructor(){this._first=E.Undefined,this._last=E.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===E.Undefined}clear(){let ee=this._first;for(;ee!==E.Undefined;){const W=ee.next;ee.prev=E.Undefined,ee.next=E.Undefined,ee=W}this._first=E.Undefined,this._last=E.Undefined,this._size=0}unshift(ee){return this._insert(ee,!1)}push(ee){return this._insert(ee,!0)}_insert(ee,W){const p=new E(ee);if(this._first===E.Undefined)this._first=p,this._last=p;else if(W){const Y=this._last;this._last=p,p.prev=Y,Y.next=p}else{const Y=this._first;this._first=p,p.next=Y,Y.prev=p}this._size+=1;let ue=!1;return()=>{ue||(ue=!0,this._remove(p))}}shift(){if(this._first!==E.Undefined){const ee=this._first.element;return this._remove(this._first),ee}}pop(){if(this._last!==E.Undefined){const ee=this._last.element;return this._remove(this._last),ee}}_remove(ee){if(ee.prev!==E.Undefined&&ee.next!==E.Undefined){const W=ee.prev;W.next=ee.next,ee.next.prev=W}else ee.prev===E.Undefined&&ee.next===E.Undefined?(this._first=E.Undefined,this._last=E.Undefined):ee.next===E.Undefined?(this._last=this._last.prev,this._last.next=E.Undefined):ee.prev===E.Undefined&&(this._first=this._first.next,this._first.prev=E.Undefined);this._size-=1}*[Symbol.iterator](){let ee=this._first;for(;ee!==E.Undefined;)yield ee.element,ee=ee.next}}},23345:function(Ut,ft,R){"use strict";R.d(ft,{$L:function(){return J},ED:function(){return L},IJ:function(){return k},OS:function(){return oe},WE:function(){return Z},dz:function(){return O},gn:function(){return ne},li:function(){return b},r:function(){return M},tY:function(){return z},xS:function(){return ae}});var E=R(97671),le;const xe="en";let ee=!1,W=!1,p=!1,ue=!1,Y=!1,l=!1,G=!1,A,m=null,_=null,y;const b=typeof self=="object"?self:typeof R.g=="object"?R.g:{};let F;typeof b.vscode!="undefined"&&typeof b.vscode.process!="undefined"?F=b.vscode.process:typeof E!="undefined"&&(F=E);const K=typeof((le=F==null?void 0:F.versions)===null||le===void 0?void 0:le.electron)=="string"&&F.type==="renderer";if(typeof navigator=="object"&&!K)y=navigator.userAgent,ee=y.indexOf("Windows")>=0,W=y.indexOf("Macintosh")>=0,G=(y.indexOf("Macintosh")>=0||y.indexOf("iPad")>=0||y.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,p=y.indexOf("Linux")>=0,l=!0,A=navigator.language,m=A;else if(typeof F=="object"){ee=F.platform==="win32",W=F.platform==="darwin",p=F.platform==="linux",ue=p&&!!F.env.SNAP&&!!F.env.SNAP_REVISION,A=xe,m=xe;const w=F.env.VSCODE_NLS_CONFIG;if(w)try{const T=JSON.parse(w),I=T.availableLanguages["*"];A=T.locale,m=I||xe,_=T._translationsConfigFile}catch(T){}Y=!0}else console.error("Unable to resolve platform.");let H=0;W?H=1:ee?H=3:p&&(H=2);const L=ee,O=W,k=p,z=Y,J=l,ne=G,Z=y,ae=function(){if(b.setImmediate)return b.setImmediate.bind(b);if(typeof b.postMessage=="function"&&!b.importScripts){let I=[];b.addEventListener("message",U=>{if(U.data&&U.data.vscodeSetImmediateId)for(let g=0,d=I.length;g<d;g++){const D=I[g];if(D.id===U.data.vscodeSetImmediateId){I.splice(g,1),D.callback();return}}});let N=0;return U=>{const g=++N;I.push({id:g,callback:U}),b.postMessage({vscodeSetImmediateId:g},"*")}}if(typeof(F==null?void 0:F.nextTick)=="function")return F.nextTick.bind(F);const T=Promise.resolve();return I=>T.then(I)}(),oe=W||G?2:ee?1:3;let re=!0,Re=!1;function M(){if(!Re){Re=!0;const w=new Uint8Array(2);w[0]=1,w[1]=2,re=new Uint16Array(w.buffer)[0]===513}return re}},95830:function(Ut,ft,R){"use strict";R.d(ft,{G:function(){return xe}});var E=R(23345);const le=E.li.performance&&typeof E.li.performance.now=="function";class xe{constructor(W){this._highResolution=le&&W,this._startTime=this._now(),this._stopTime=-1}static create(W=!0){return new xe(W)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?E.li.performance.now():Date.now()}}},82983:function(Ut,ft,R){"use strict";R.d(ft,{$i:function(){return he},C8:function(){return et},GF:function(){return A},HO:function(){return N},IO:function(){return m},K7:function(){return nt},Kw:function(){return Me},LC:function(){return b},Mh:function(){return ae},P1:function(){return oe},PJ:function(){return mt},Qe:function(){return Se},R1:function(){return G},RP:function(){return D},S6:function(){return ke},TT:function(){return L},Ut:function(){return g},V8:function(){return F},WU:function(){return xe},YK:function(){return Re},YU:function(){return ee},ZG:function(){return re},ZH:function(){return w},ab:function(){return qe},c1:function(){return Pe},df:function(){return J},ec:function(){return W},fi:function(){return Tt},fy:function(){return p},j3:function(){return ue},j_:function(){return k},m5:function(){return E},mK:function(){return z},mr:function(){return _},oH:function(){return q},oL:function(){return Y},ok:function(){return Z},ow:function(){return K},qq:function(){return ne},qu:function(){return H},rL:function(){return M},uS:function(){return Lt},un:function(){return l},uq:function(){return y},vH:function(){return I},xe:function(){return Ue},zY:function(){return O}});function E(V){return!V||typeof V!="string"?!0:V.trim().length===0}const le=/{(\d+)}/g;function xe(V,...se){return se.length===0?V:V.replace(le,function(Ee,Fe){const de=parseInt(Fe,10);return isNaN(de)||de<0||de>=se.length?Ee:se[de]})}function ee(V){return V.replace(/[<>&]/g,function(se){switch(se){case"<":return"<";case">":return">";case"&":return"&";default:return se}})}function W(V){return V.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function p(V,se=" "){const Ee=ue(V,se);return Y(Ee,se)}function ue(V,se){if(!V||!se)return V;const Ee=se.length;if(Ee===0||V.length===0)return V;let Fe=0;for(;V.indexOf(se,Fe)===Fe;)Fe=Fe+Ee;return V.substring(Fe)}function Y(V,se){if(!V||!se)return V;const Ee=se.length,Fe=V.length;if(Ee===0||Fe===0)return V;let de=Fe,ze=-1;for(;ze=V.lastIndexOf(se,de-1),!(ze===-1||ze+Ee!==de);){if(ze===0)return"";de=ze}return V.substring(0,de)}function l(V){return V.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function G(V){return V.replace(/\*/g,"")}function A(V,se,Ee={}){if(!V)throw new Error("Cannot create regex from empty string");se||(V=W(V)),Ee.wholeWord&&(/\B/.test(V.charAt(0))||(V="\\b"+V),/\B/.test(V.charAt(V.length-1))||(V=V+"\\b"));let Fe="";return Ee.global&&(Fe+="g"),Ee.matchCase||(Fe+="i"),Ee.multiline&&(Fe+="m"),Ee.unicode&&(Fe+="u"),new RegExp(V,Fe)}function m(V){return V.source==="^"||V.source==="^$"||V.source==="$"||V.source==="^\\s*$"?!1:!!(V.exec("")&&V.lastIndex===0)}function _(V){return(V.global?"g":"")+(V.ignoreCase?"i":"")+(V.multiline?"m":"")+(V.unicode?"u":"")}function y(V){return V.split(/\r\n|\r|\n/)}function b(V){for(let se=0,Ee=V.length;se<Ee;se++){const Fe=V.charCodeAt(se);if(Fe!==32&&Fe!==9)return se}return-1}function F(V,se=0,Ee=V.length){for(let Fe=se;Fe<Ee;Fe++){const de=V.charCodeAt(Fe);if(de!==32&&de!==9)return V.substring(se,Fe)}return V.substring(se,Ee)}function K(V,se=V.length-1){for(let Ee=se;Ee>=0;Ee--){const Fe=V.charCodeAt(Ee);if(Fe!==32&&Fe!==9)return Ee}return-1}function H(V,se){return V<se?-1:V>se?1:0}function L(V,se,Ee=0,Fe=V.length,de=0,ze=se.length){for(;Ee<Fe&&de<ze;Ee++,de++){let ut=V.charCodeAt(Ee),Ve=se.charCodeAt(de);if(ut<Ve)return-1;if(ut>Ve)return 1}const rt=Fe-Ee,We=ze-de;return rt<We?-1:rt>We?1:0}function O(V,se){return k(V,se,0,V.length,0,se.length)}function k(V,se,Ee=0,Fe=V.length,de=0,ze=se.length){for(;Ee<Fe&&de<ze;Ee++,de++){let ut=V.charCodeAt(Ee),Ve=se.charCodeAt(de);if(ut===Ve)continue;if(ut>=128||Ve>=128)return L(V.toLowerCase(),se.toLowerCase(),Ee,Fe,de,ze);z(ut)&&(ut-=32),z(Ve)&&(Ve-=32);const At=ut-Ve;if(At!==0)return At}const rt=Fe-Ee,We=ze-de;return rt<We?-1:rt>We?1:0}function z(V){return V>=97&&V<=122}function J(V){return V>=65&&V<=90}function ne(V,se){return V.length===se.length&&k(V,se)===0}function Z(V,se){const Ee=se.length;return se.length>V.length?!1:k(V,se,0,Ee)===0}function ae(V,se){let Ee,Fe=Math.min(V.length,se.length);for(Ee=0;Ee<Fe;Ee++)if(V.charCodeAt(Ee)!==se.charCodeAt(Ee))return Ee;return Fe}function oe(V,se){let Ee,Fe=Math.min(V.length,se.length);const de=V.length-1,ze=se.length-1;for(Ee=0;Ee<Fe;Ee++)if(V.charCodeAt(de-Ee)!==se.charCodeAt(ze-Ee))return Ee;return Fe}function re(V){return 55296<=V&&V<=56319}function Re(V){return 56320<=V&&V<=57343}function M(V,se){return(V-55296<<10)+(se-56320)+65536}function w(V,se,Ee){const Fe=V.charCodeAt(Ee);if(re(Fe)&&Ee+1<se){const de=V.charCodeAt(Ee+1);if(Re(de))return M(Fe,de)}return Fe}function T(V,se){const Ee=V.charCodeAt(se-1);if(Re(Ee)&&se>1){const Fe=V.charCodeAt(se-2);if(re(Fe))return M(Fe,Ee)}return Ee}function I(V,se){const Ee=ye.getInstance(),Fe=se,de=V.length,ze=w(V,de,se);se+=ze>=65536?2:1;let rt=Ee.getGraphemeBreakType(ze);for(;se<de;){const We=w(V,de,se),ut=Ee.getGraphemeBreakType(We);if(Tt(rt,ut))break;se+=We>=65536?2:1,rt=ut}return se-Fe}function N(V,se){const Ee=ye.getInstance(),Fe=se,de=T(V,se);se-=de>=65536?2:1;let ze=Ee.getGraphemeBreakType(de);for(;se>0;){const rt=T(V,se),We=Ee.getGraphemeBreakType(rt);if(Tt(We,ze))break;se-=rt>=65536?2:1,ze=We}return Fe-se}const U=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function g(V){return U.test(V)}const d=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function D(V){return d.test(V)}const $=/^[\t\n\r\x20-\x7E]*$/;function he(V){return $.test(V)}const Se=/[\u2028\u2029]/;function qe(V){return Se.test(V)}function Ue(V){for(let se=0,Ee=V.length;se<Ee;se++)if(nt(V.charCodeAt(se)))return!0;return!1}function nt(V){return V=+V,V>=11904&&V<=55215||V>=63744&&V<=64255||V>=65281&&V<=65374}function et(V){return V>=127462&&V<=127487||V===8986||V===8987||V===9200||V===9203||V>=9728&&V<=10175||V===11088||V===11093||V>=127744&&V<=128591||V>=128640&&V<=128764||V>=128992&&V<=129003||V>=129280&&V<=129535||V>=129648&&V<=129750}const Pe="\uFEFF";function Lt(V){return!!(V&&V.length>0&&V.charCodeAt(0)===65279)}function Me(V,se=!1){return V?(se&&(V=V.replace(/\\./g,"")),V.toLowerCase()!==V):!1}function mt(V){return V=V%(2*26),V<26?String.fromCharCode(97+V):String.fromCharCode(65+V-26)}function ke(V){return ye.getInstance().getGraphemeBreakType(V)}function Tt(V,se){return V===0?se!==5&&se!==7:V===2&&se===3?!1:V===4||V===2||V===3||se===4||se===2||se===3?!0:!(V===8&&(se===8||se===9||se===11||se===12)||(V===11||V===9)&&(se===9||se===10)||(V===12||V===10)&&se===10||se===5||se===13||se===7||V===1||V===13&&se===14||V===6&&se===6)}class ye{constructor(){this._data=be()}static getInstance(){return ye._INSTANCE||(ye._INSTANCE=new ye),ye._INSTANCE}getGraphemeBreakType(se){if(se<32)return se===10?3:se===13?2:4;if(se<127)return 0;const Ee=this._data,Fe=Ee.length/3;let de=1;for(;de<=Fe;)if(se<Ee[3*de])de=2*de;else if(se>Ee[3*de+1])de=2*de+1;else return Ee[3*de+2];return 0}}ye._INSTANCE=null;function be(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function q(V,se){if(V===0)return 0;const Ee=Le(V,se);if(Ee!==void 0)return Ee;const Fe=T(se,V);return V-=Ne(Fe),V}function Le(V,se){let Ee=T(se,V);for(V-=Ne(Ee);Qe(Ee)||Ee===65039||Ee===8419;){if(V===0)return;Ee=T(se,V),V-=Ne(Ee)}if(et(Ee)){if(V>=0){const Fe=T(se,V);Fe===8205&&(V-=Ne(Fe))}return V}}function Ne(V){return V>=65536?2:1}function Qe(V){return 127995<=V&&V<=127999}},72999:function(Ut,ft,R){"use strict";R.d(ft,{$E:function(){return b},$K:function(){return ue},D8:function(){return m},HD:function(){return le},IU:function(){return F},Jp:function(){return Y},Kn:function(){return xe},cW:function(){return G},f6:function(){return K},hj:function(){return ee},jn:function(){return W},kJ:function(){return E},mf:function(){return A},o8:function(){return p},p_:function(){return l},vE:function(){return H}});function E(L){return Array.isArray(L)}function le(L){return typeof L=="string"}function xe(L){return typeof L=="object"&&L!==null&&!Array.isArray(L)&&!(L instanceof RegExp)&&!(L instanceof Date)}function ee(L){return typeof L=="number"&&!isNaN(L)}function W(L){return L===!0||L===!1}function p(L){return typeof L=="undefined"}function ue(L){return!Y(L)}function Y(L){return p(L)||L===null}function l(L,O){if(!L)throw new Error(O?`Unexpected type, expected '${O}'`:"Unexpected type")}function G(L){if(Y(L))throw new Error("Assertion Failed: argument is undefined or null");return L}function A(L){return typeof L=="function"}function m(L,O){const k=Math.min(L.length,O.length);for(let z=0;z<k;z++)_(L[z],O[z])}function _(L,O){if(le(O)){if(typeof L!==O)throw new Error(`argument does not match constraint: typeof ${O}`)}else if(A(O)){try{if(L instanceof O)return}catch(k){}if(!Y(L)&&L.constructor===O||O.length===1&&O.call(void 0,L)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function y(L){let O=[],k=Object.getPrototypeOf(L);for(;Object.prototype!==k;)O=O.concat(Object.getOwnPropertyNames(k)),k=Object.getPrototypeOf(k);return O}function b(L){const O=[];for(const k of y(L))typeof L[k]=="function"&&O.push(k);return O}function F(L,O){const k=J=>function(){const ne=Array.prototype.slice.call(arguments,0);return O(J,ne)};let z={};for(const J of L)z[J]=k(J);return z}function K(L){return L===null?void 0:L}function H(L,O="Unreachable"){throw new Error(O)}},13268:function(Ut,ft,R){"use strict";R.d(ft,{N:function(){return le}});function E(xe,ee){let W;return ee.length===0?W=xe:W=xe.replace(/\{(\d+)\}/g,function(p,ue){const Y=ue[0];return typeof ee[Y]!="undefined"?ee[Y]:p}),W}function le(xe,ee,...W){return E(ee,W)}},96236:function(Ut,ft,R){"use strict";R.d(ft,{BH:function(){return F},NZ:function(){return K},U8:function(){return H},co:function(){return b},eH:function(){return y},vr:function(){return _}});var E=R(75918),le=R(52615),xe=R(4348),ee=R(88226),W=R(69323),p=R(34502),ue=R(35884),Y=R(90689),l=R(16925),G=R(49055),A=function(L,O,k,z){var J=arguments.length,ne=J<3?O:z===null?z=Object.getOwnPropertyDescriptor(O,k):z,Z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(L,O,k,z);else for(var ae=L.length-1;ae>=0;ae--)(Z=L[ae])&&(ne=(J<3?Z(ne):J>3?Z(O,k,ne):Z(O,k))||ne);return J>3&&ne&&Object.defineProperty(O,k,ne),ne},m=function(L,O){return function(k,z){O(k,z,L)}};function _(L){return L.command!==void 0}class y{constructor(O){this.id=y._idPool++,this._debugName=O}}y._idPool=0,y.CommandPalette=new y("CommandPalette"),y.EditorContext=new y("EditorContext"),y.SimpleEditorContext=new y("SimpleEditorContext"),y.EditorContextCopy=new y("EditorContextCopy"),y.EditorContextPeek=new y("EditorContextPeek"),y.MenubarEditMenu=new y("MenubarEditMenu"),y.MenubarCopy=new y("MenubarCopy"),y.MenubarGoMenu=new y("MenubarGoMenu"),y.MenubarSelectionMenu=new y("MenubarSelectionMenu"),y.InlineCompletionsActions=new y("InlineCompletionsActions");const b=(0,l.yh)("menuService"),F=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new xe.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:L=>L===y.CommandPalette}}addCommand(L){return this.addCommands(ee.$.single(L))}addCommands(L){for(const O of L)this._commands.set(O.id,O);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,W.OF)(()=>{let O=!1;for(const k of L)O=this._commands.delete(k.id)||O;O&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(L){return this._commands.get(L)}getCommands(){const L=new Map;return this._commands.forEach((O,k)=>L.set(k,O)),L}appendMenuItem(L,O){return this.appendMenuItems(ee.$.single({id:L,item:O}))}appendMenuItems(L){const O=new Set,k=new p.S;for(const{id:z,item:J}of L){let ne=this._menuItems.get(z);ne||(ne=new p.S,this._menuItems.set(z,ne)),k.push(ne.push(J)),O.add(z)}return this._onDidChangeMenu.fire(O),(0,W.OF)(()=>{if(k.size>0){for(let z of k)z();this._onDidChangeMenu.fire(O),k.clear()}})}getMenuItems(L){let O;return this._menuItems.has(L)?O=[...this._menuItems.get(L)]:O=[],L===y.CommandPalette&&this._appendImplicitItems(O),O}_appendImplicitItems(L){const O=new Set;for(const k of L)_(k)&&(O.add(k.command.id),k.alt&&O.add(k.alt.id));this._commands.forEach((k,z)=>{O.has(z)||L.push({command:k})})}};class K extends E.wY{constructor(O,k,z,J){super(`submenuitem.${O.submenu.id}`,typeof O.title=="string"?O.title:O.title.value,[],"submenu"),this.item=O,this._menuService=k,this._contextKeyService=z,this._options=J}get actions(){const O=[],k=this._menuService.createMenu(this.item.submenu,this._contextKeyService),z=k.getActions(this._options);k.dispose();for(const[,J]of z)J.length>0&&(O.push(...J),O.push(new E.Z0));return O.length&&O.pop(),O}}let H=class qo{constructor(O,k,z,J,ne){var Z,ae;if(this._commandService=ne,this.id=O.id,this.label=z!=null&&z.renderShortTitle&&O.shortTitle?typeof O.shortTitle=="string"?O.shortTitle:O.shortTitle.value:typeof O.title=="string"?O.title:O.title.value,this.tooltip=(ae=typeof O.tooltip=="string"?O.tooltip:(Z=O.tooltip)===null||Z===void 0?void 0:Z.value)!==null&&ae!==void 0?ae:"",this.enabled=!O.precondition||J.contextMatchesRules(O.precondition),this.checked=void 0,O.toggled){const oe=O.toggled.condition?O.toggled:{condition:O.toggled};this.checked=J.contextMatchesRules(oe.condition),this.checked&&oe.tooltip&&(this.tooltip=typeof oe.tooltip=="string"?oe.tooltip:oe.tooltip.value),oe.title&&(this.label=typeof oe.title=="string"?oe.title:oe.title.value)}this.item=O,this.alt=k?new qo(k,void 0,z,J,ne):void 0,this._options=z,G.kS.isThemeIcon(O.icon)&&(this.class=le.dT.asClassName(O.icon))}dispose(){}run(...O){var k,z;let J=[];return!((k=this._options)===null||k===void 0)&&k.arg&&(J=[...J,this._options.arg]),!((z=this._options)===null||z===void 0)&&z.shouldForwardArgs&&(J=[...J,...O]),this._commandService.executeCommand(this.id,...J)}};H=A([m(3,Y.i6),m(4,ue.H)],H)},35884:function(Ut,ft,R){"use strict";R.d(ft,{H:function(){return ue},P:function(){return Y}});var E=R(4348),le=R(88226),xe=R(69323),ee=R(34502),W=R(72999),p=R(16925);const ue=(0,p.yh)("commandService"),Y=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new E.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(l,G){if(!l)throw new Error("invalid command");if(typeof l=="string"){if(!G)throw new Error("invalid command");return this.registerCommand({id:l,handler:G})}if(l.description){const b=[];for(let K of l.description.args)b.push(K.constraint);const F=l.handler;l.handler=function(K,...H){return(0,W.D8)(H,b),F(K,...H)}}const{id:A}=l;let m=this._commands.get(A);m||(m=new ee.S,this._commands.set(A,m));let _=m.unshift(l),y=(0,xe.OF)(()=>{_();const b=this._commands.get(A);b!=null&&b.isEmpty()&&this._commands.delete(A)});return this._onDidRegisterCommand.fire(A),y}registerCommandAlias(l,G){return Y.registerCommand(l,(A,...m)=>A.get(ue).executeCommand(G,...m))}getCommand(l){const G=this._commands.get(l);if(!(!G||G.isEmpty()))return le.$.first(G)}getCommands(){const l=new Map;for(const G of this._commands.keys()){const A=this.getCommand(G);A&&l.set(G,A)}return l}};Y.registerCommand("noop",()=>{})},90689:function(Ut,ft,R){"use strict";R.d(ft,{Ao:function(){return ue},Eq:function(){return M},Fb:function(){return Y},K8:function(){return I},i6:function(){return Re},uy:function(){return re}});var E=R(23345),le=R(82983),xe=R(16925);let ee=E.WE||"";const W=new Map;W.set("false",!1),W.set("true",!0),W.set("isMac",E.dz),W.set("isLinux",E.IJ),W.set("isWindows",E.ED),W.set("isWeb",E.$L),W.set("isMacNative",E.dz&&!E.$L),W.set("isEdge",ee.indexOf("Edg/")>=0),W.set("isFirefox",ee.indexOf("Firefox")>=0),W.set("isChrome",ee.indexOf("Chrome")>=0),W.set("isSafari",ee.indexOf("Safari")>=0);const p=Object.prototype.hasOwnProperty;class ue{static has(g){return m.create(g)}static equals(g,d){return _.create(g,d)}static regex(g,d){return J.create(g,d)}static not(g){return K.create(g)}static and(...g){return ae.create(g,null)}static or(...g){return oe.create(g,null,!0)}static deserialize(g,d=!1){if(g)return this._deserializeOrExpression(g,d)}static _deserializeOrExpression(g,d){let D=g.split("||");return oe.create(D.map($=>this._deserializeAndExpression($,d)),null,!0)}static _deserializeAndExpression(g,d){let D=g.split("&&");return ae.create(D.map($=>this._deserializeOne($,d)),null)}static _deserializeOne(g,d){if(g=g.trim(),g.indexOf("!=")>=0){let D=g.split("!=");return F.create(D[0].trim(),this._deserializeValue(D[1],d))}if(g.indexOf("==")>=0){let D=g.split("==");return _.create(D[0].trim(),this._deserializeValue(D[1],d))}if(g.indexOf("=~")>=0){let D=g.split("=~");return J.create(D[0].trim(),this._deserializeRegexValue(D[1],d))}if(g.indexOf(" in ")>=0){let D=g.split(" in ");return y.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(g)){const D=g.split(">=");return O.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(g)){const D=g.split(">");return L.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(g)){const D=g.split("<=");return z.create(D[0].trim(),D[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(g)){const D=g.split("<");return k.create(D[0].trim(),D[1].trim())}return/^\!\s*/.test(g)?K.create(g.substr(1).trim()):m.create(g)}static _deserializeValue(g,d){if(g=g.trim(),g==="true")return!0;if(g==="false")return!1;let D=/^'([^']*)'$/.exec(g);return D?D[1].trim():g}static _deserializeRegexValue(g,d){if((0,le.m5)(g)){if(d)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let D=g.indexOf("/"),$=g.lastIndexOf("/");if(D===$||D<0){if(d)throw new Error(`bad regexp-value '${g}', missing /-enclosure`);return console.warn(`bad regexp-value '${g}', missing /-enclosure`),null}let he=g.slice(D+1,$),Se=g[$+1]==="i"?"i":"";try{return new RegExp(he,Se)}catch(qe){if(d)throw new Error(`bad regexp-value '${g}', parse error: ${qe}`);return console.warn(`bad regexp-value '${g}', parse error: ${qe}`),null}}}function Y(U,g){const d=U?U.substituteConstants():void 0,D=g?g.substituteConstants():void 0;return!d&&!D?!0:!d||!D?!1:d.equals(D)}function l(U,g){return U.cmp(g)}class G{constructor(){this.type=0}cmp(g){return this.type-g.type}equals(g){return g.type===this.type}substituteConstants(){return this}evaluate(g){return!1}serialize(){return"false"}keys(){return[]}negate(){return A.INSTANCE}}G.INSTANCE=new G;class A{constructor(){this.type=1}cmp(g){return this.type-g.type}equals(g){return g.type===this.type}substituteConstants(){return this}evaluate(g){return!0}serialize(){return"true"}keys(){return[]}negate(){return G.INSTANCE}}A.INSTANCE=new A;class m{constructor(g,d){this.key=g,this.negated=d,this.type=2}static create(g,d=null){const D=W.get(g);return typeof D=="boolean"?D?A.INSTANCE:G.INSTANCE:new m(g,d)}cmp(g){return g.type!==this.type?this.type-g.type:w(this.key,g.key)}equals(g){return g.type===this.type?this.key===g.key:!1}substituteConstants(){const g=W.get(this.key);return typeof g=="boolean"?g?A.INSTANCE:G.INSTANCE:this}evaluate(g){return!!g.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=K.create(this.key,this)),this.negated}}class _{constructor(g,d,D){this.key=g,this.value=d,this.negated=D,this.type=4}static create(g,d,D=null){if(typeof d=="boolean")return d?m.create(g,D):K.create(g,D);const $=W.get(g);return typeof $=="boolean"?d===($?"true":"false")?A.INSTANCE:G.INSTANCE:new _(g,d,D)}cmp(g){return g.type!==this.type?this.type-g.type:T(this.key,this.value,g.key,g.value)}equals(g){return g.type===this.type?this.key===g.key&&this.value===g.value:!1}substituteConstants(){const g=W.get(this.key);if(typeof g=="boolean"){const d=g?"true":"false";return this.value===d?A.INSTANCE:G.INSTANCE}return this}evaluate(g){return g.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=F.create(this.key,this.value,this)),this.negated}}class y{constructor(g,d){this.key=g,this.valueKey=d,this.type=10,this.negated=null}static create(g,d){return new y(g,d)}cmp(g){return g.type!==this.type?this.type-g.type:T(this.key,this.valueKey,g.key,g.valueKey)}equals(g){return g.type===this.type?this.key===g.key&&this.valueKey===g.valueKey:!1}substituteConstants(){return this}evaluate(g){const d=g.getValue(this.valueKey),D=g.getValue(this.key);return Array.isArray(d)?d.indexOf(D)>=0:typeof D=="string"&&typeof d=="object"&&d!==null?p.call(d,D):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=b.create(this)),this.negated}}class b{constructor(g){this._actual=g,this.type=11}static create(g){return new b(g)}cmp(g){return g.type!==this.type?this.type-g.type:this._actual.cmp(g._actual)}equals(g){return g.type===this.type?this._actual.equals(g._actual):!1}substituteConstants(){return this}evaluate(g){return!this._actual.evaluate(g)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class F{constructor(g,d,D){this.key=g,this.value=d,this.negated=D,this.type=5}static create(g,d,D=null){if(typeof d=="boolean")return d?K.create(g,D):m.create(g,D);const $=W.get(g);return typeof $=="boolean"?d===($?"true":"false")?G.INSTANCE:A.INSTANCE:new F(g,d,D)}cmp(g){return g.type!==this.type?this.type-g.type:T(this.key,this.value,g.key,g.value)}equals(g){return g.type===this.type?this.key===g.key&&this.value===g.value:!1}substituteConstants(){const g=W.get(this.key);if(typeof g=="boolean"){const d=g?"true":"false";return this.value===d?G.INSTANCE:A.INSTANCE}return this}evaluate(g){return g.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_.create(this.key,this.value,this)),this.negated}}class K{constructor(g,d){this.key=g,this.negated=d,this.type=3}static create(g,d=null){const D=W.get(g);return typeof D=="boolean"?D?G.INSTANCE:A.INSTANCE:new K(g,d)}cmp(g){return g.type!==this.type?this.type-g.type:w(this.key,g.key)}equals(g){return g.type===this.type?this.key===g.key:!1}substituteConstants(){const g=W.get(this.key);return typeof g=="boolean"?g?G.INSTANCE:A.INSTANCE:this}evaluate(g){return!g.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function H(U,g){if(typeof U=="string"){const d=parseFloat(U);isNaN(d)||(U=d)}return typeof U=="string"||typeof U=="number"?g(U):G.INSTANCE}class L{constructor(g,d,D){this.key=g,this.value=d,this.negated=D,this.type=12}static create(g,d,D=null){return H(d,$=>new L(g,$,D))}cmp(g){return g.type!==this.type?this.type-g.type:T(this.key,this.value,g.key,g.value)}equals(g){return g.type===this.type?this.key===g.key&&this.value===g.value:!1}substituteConstants(){return this}evaluate(g){return typeof this.value=="string"?!1:parseFloat(g.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=z.create(this.key,this.value,this)),this.negated}}class O{constructor(g,d,D){this.key=g,this.value=d,this.negated=D,this.type=13}static create(g,d,D=null){return H(d,$=>new O(g,$,D))}cmp(g){return g.type!==this.type?this.type-g.type:T(this.key,this.value,g.key,g.value)}equals(g){return g.type===this.type?this.key===g.key&&this.value===g.value:!1}substituteConstants(){return this}evaluate(g){return typeof this.value=="string"?!1:parseFloat(g.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=k.create(this.key,this.value,this)),this.negated}}class k{constructor(g,d,D){this.key=g,this.value=d,this.negated=D,this.type=14}static create(g,d,D=null){return H(d,$=>new k(g,$,D))}cmp(g){return g.type!==this.type?this.type-g.type:T(this.key,this.value,g.key,g.value)}equals(g){return g.type===this.type?this.key===g.key&&this.value===g.value:!1}substituteConstants(){return this}evaluate(g){return typeof this.value=="string"?!1:parseFloat(g.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class z{constructor(g,d,D){this.key=g,this.value=d,this.negated=D,this.type=15}static create(g,d,D=null){return H(d,$=>new z(g,$,D))}cmp(g){return g.type!==this.type?this.type-g.type:T(this.key,this.value,g.key,g.value)}equals(g){return g.type===this.type?this.key===g.key&&this.value===g.value:!1}substituteConstants(){return this}evaluate(g){return typeof this.value=="string"?!1:parseFloat(g.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this.key,this.value,this)),this.negated}}class J{constructor(g,d){this.key=g,this.regexp=d,this.type=7,this.negated=null}static create(g,d){return new J(g,d)}cmp(g){if(g.type!==this.type)return this.type-g.type;if(this.key<g.key)return-1;if(this.key>g.key)return 1;const d=this.regexp?this.regexp.source:"",D=g.regexp?g.regexp.source:"";return d<D?-1:d>D?1:0}equals(g){if(g.type===this.type){const d=this.regexp?this.regexp.source:"",D=g.regexp?g.regexp.source:"";return this.key===g.key&&d===D}return!1}substituteConstants(){return this}evaluate(g){let d=g.getValue(this.key);return this.regexp?this.regexp.test(d):!1}serialize(){const g=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${g}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ne.create(this)),this.negated}}class ne{constructor(g){this._actual=g,this.type=8}static create(g){return new ne(g)}cmp(g){return g.type!==this.type?this.type-g.type:this._actual.cmp(g._actual)}equals(g){return g.type===this.type?this._actual.equals(g._actual):!1}substituteConstants(){return this}evaluate(g){return!this._actual.evaluate(g)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function Z(U){let g=null;for(let d=0,D=U.length;d<D;d++){const $=U[d].substituteConstants();if(U[d]!==$&&g===null){g=[];for(let he=0;he<d;he++)g[he]=U[he]}g!==null&&(g[d]=$)}return g===null?U:g}class ae{constructor(g,d){this.expr=g,this.negated=d,this.type=6}static create(g,d){return ae._normalizeArr(g,d)}cmp(g){if(g.type!==this.type)return this.type-g.type;if(this.expr.length<g.expr.length)return-1;if(this.expr.length>g.expr.length)return 1;for(let d=0,D=this.expr.length;d<D;d++){const $=l(this.expr[d],g.expr[d]);if($!==0)return $}return 0}equals(g){if(g.type===this.type){if(this.expr.length!==g.expr.length)return!1;for(let d=0,D=this.expr.length;d<D;d++)if(!this.expr[d].equals(g.expr[d]))return!1;return!0}return!1}substituteConstants(){const g=Z(this.expr);return g===this.expr?this:ae.create(g,this.negated)}evaluate(g){for(let d=0,D=this.expr.length;d<D;d++)if(!this.expr[d].evaluate(g))return!1;return!0}static _normalizeArr(g,d){const D=[];let $=!1;for(const he of g)if(he){if(he.type===1){$=!0;continue}if(he.type===0)return G.INSTANCE;if(he.type===6){D.push(...he.expr);continue}D.push(he)}if(D.length===0&&$)return A.INSTANCE;if(D.length!==0){if(D.length===1)return D[0];D.sort(l);for(let he=1;he<D.length;he++)D[he-1].equals(D[he])&&(D.splice(he,1),he--);if(D.length===1)return D[0];for(;D.length>1;){const he=D[D.length-1];if(he.type!==9)break;D.pop();const Se=D.pop(),qe=D.length===0,Ue=oe.create(he.expr.map(nt=>ae.create([nt,Se],null)),null,qe);Ue&&(D.push(Ue),D.sort(l))}return D.length===1?D[0]:new ae(D,d)}}serialize(){return this.expr.map(g=>g.serialize()).join(" && ")}keys(){const g=[];for(let d of this.expr)g.push(...d.keys());return g}negate(){if(!this.negated){const g=[];for(let d of this.expr)g.push(d.negate());this.negated=oe.create(g,this,!0)}return this.negated}}class oe{constructor(g,d){this.expr=g,this.negated=d,this.type=9}static create(g,d,D){return oe._normalizeArr(g,d,D)}cmp(g){if(g.type!==this.type)return this.type-g.type;if(this.expr.length<g.expr.length)return-1;if(this.expr.length>g.expr.length)return 1;for(let d=0,D=this.expr.length;d<D;d++){const $=l(this.expr[d],g.expr[d]);if($!==0)return $}return 0}equals(g){if(g.type===this.type){if(this.expr.length!==g.expr.length)return!1;for(let d=0,D=this.expr.length;d<D;d++)if(!this.expr[d].equals(g.expr[d]))return!1;return!0}return!1}substituteConstants(){const g=Z(this.expr);return g===this.expr?this:oe.create(g,this.negated,!1)}evaluate(g){for(let d=0,D=this.expr.length;d<D;d++)if(this.expr[d].evaluate(g))return!0;return!1}static _normalizeArr(g,d,D){let $=[],he=!1;if(g){for(let Se=0,qe=g.length;Se<qe;Se++){const Ue=g[Se];if(Ue){if(Ue.type===0){he=!0;continue}if(Ue.type===1)return A.INSTANCE;if(Ue.type===9){$=$.concat(Ue.expr);continue}$.push(Ue)}}if($.length===0&&he)return G.INSTANCE;$.sort(l)}if($.length!==0){if($.length===1)return $[0];for(let Se=1;Se<$.length;Se++)$[Se-1].equals($[Se])&&($.splice(Se,1),Se--);if($.length===1)return $[0];if(D){for(let Se=0;Se<$.length;Se++)for(let qe=Se+1;qe<$.length;qe++)I($[Se],$[qe])&&($.splice(qe,1),qe--);if($.length===1)return $[0]}return new oe($,d)}}serialize(){return this.expr.map(g=>g.serialize()).join(" || ")}keys(){const g=[];for(let d of this.expr)g.push(...d.keys());return g}negate(){if(!this.negated){let g=[];for(let d of this.expr)g.push(d.negate());for(;g.length>1;){const d=g.shift(),D=g.shift(),$=[];for(const Se of N(d))for(const qe of N(D))$.push(ae.create([Se,qe],null));const he=g.length===0;g.unshift(oe.create($,null,he))}this.negated=g[0]}return this.negated}}class re extends m{constructor(g,d,D){super(g,null),this._defaultValue=d,typeof D=="object"?re._info.push(Object.assign(Object.assign({},D),{key:g})):D!==!0&&re._info.push({key:g,description:D,type:d!=null?typeof d:void 0})}static all(){return re._info.values()}bindTo(g){return g.createKey(this.key,this._defaultValue)}getValue(g){return g.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(g){return _.create(this.key,g)}}re._info=[];const Re=(0,xe.yh)("contextKeyService"),M="setContext";function w(U,g){return U<g?-1:U>g?1:0}function T(U,g,d,D){return U<d?-1:U>d?1:g<D?-1:g>D?1:0}function I(U,g){if(g.type===6&&U.type!==9&&U.type!==6){for(const $ of g.expr)if(U.equals($))return!0}const d=U.negate(),D=N(d).concat(N(g));D.sort(l);for(let $=0;$<D.length;$++){const Se=D[$].negate();for(let qe=$+1;qe<D.length;qe++){const Ue=D[qe];if(Se.equals(Ue))return!0}}return!1}function N(U){return U.type===9?U.expr:[U]}},16925:function(Ut,ft,R){"use strict";R.d(ft,{I8:function(){return E},TG:function(){return le},jt:function(){return W},yh:function(){return ee}});var E;(function(p){p.serviceIds=new Map,p.DI_TARGET="$di$target",p.DI_DEPENDENCIES="$di$dependencies";function ue(Y){return Y[p.DI_DEPENDENCIES]||[]}p.getServiceDependencies=ue})(E||(E={}));const le=ee("instantiationService");function xe(p,ue,Y,l){ue[E.DI_TARGET]===ue?ue[E.DI_DEPENDENCIES].push({id:p,index:Y,optional:l}):(ue[E.DI_DEPENDENCIES]=[{id:p,index:Y,optional:l}],ue[E.DI_TARGET]=ue)}function ee(p){if(E.serviceIds.has(p))return E.serviceIds.get(p);const ue=function(Y,l,G){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");xe(ue,Y,G,!1)};return ue.toString=()=>p,E.serviceIds.set(p,ue),ue}function W(p){return function(ue,Y,l){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");xe(p,ue,l,!0)}}},44650:function(Ut,ft,R){"use strict";R.d(ft,{B:function(){return ee}});var E=R(76068),le=R(72999);class xe{constructor(){this.data=new Map}add(p,ue){E.ok(le.HD(p)),E.ok(le.Kn(ue)),E.ok(!this.data.has(p),"There is already an extension with this id"),this.data.set(p,ue)}as(p){return this.data.get(p)||null}}const ee=new xe},66213:function(Ut,ft,R){"use strict";R.d(ft,{e:function(){return E}});var E;(function(le){le.DARK="dark",le.LIGHT="light",le.HIGH_CONTRAST="hc"})(E||(E={}))},49055:function(Ut,ft,R){"use strict";R.d(ft,{EN:function(){return l},IP:function(){return m},Ic:function(){return b},XE:function(){return ue},bB:function(){return F},kS:function(){return G},m6:function(){return A}});var E=R(52615),le=R(4348),xe=R(69323),ee=R(16925),W=R(44650),p=R(66213);const ue=(0,ee.yh)("themeService");var Y;(function(K){function H(L){return L&&typeof L=="object"&&typeof L.id=="string"}K.isThemeColor=H})(Y||(Y={}));function l(K){return{id:K}}var G;(function(K){function H(ne){return ne&&typeof ne=="object"&&typeof ne.id=="string"&&(typeof ne.color=="undefined"||Y.isThemeColor(ne.color))}K.isThemeIcon=H;const L=new RegExp(`^\\$\\((${E.dT.iconNameExpression}(?:${E.dT.iconModifierExpression})?)\\)$`);function O(ne){const Z=L.exec(ne);if(!Z)return;let[,ae]=Z;return{id:ae}}K.fromString=O;function k(ne,Z){let ae=ne.id;const oe=ae.lastIndexOf("~");return oe!==-1&&(ae=ae.substring(0,oe)),Z&&(ae=`${ae}~${Z}`),{id:ae}}K.modify=k;function z(ne,Z){var ae,oe;return ne.id===Z.id&&((ae=ne.color)===null||ae===void 0?void 0:ae.id)===((oe=Z.color)===null||oe===void 0?void 0:oe.id)}K.isEqual=z;function J(ne,Z){return{id:ne.id,color:Z?l(Z):void 0}}K.asThemeIcon=J,K.asClassNameArray=E.dT.asClassNameArray,K.asClassName=E.dT.asClassName,K.asCSSSelector=E.dT.asCSSSelector})(G||(G={}));function A(K){switch(K){case p.e.DARK:return"vs-dark";case p.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class _{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new le.Q5}onColorThemeChange(H){return this.themingParticipants.push(H),this.onThemingParticipantAddedEmitter.fire(H),(0,xe.OF)(()=>{const L=this.themingParticipants.indexOf(H);this.themingParticipants.splice(L,1)})}getThemingParticipants(){return this.themingParticipants}}let y=new _;W.B.add(m.ThemingContribution,y);function b(K){return y.onColorThemeChange(K)}class F extends xe.JT{constructor(H){super(),this.themeService=H,this.theme=H.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(L=>this.onThemeChange(L)))}onThemeChange(H){this.theme=H,this.updateStyles()}updateStyles(){}}},16632:function(Ut,ft,R){"use strict";var E=R(67711),le=R(98506),xe=R(52873),ee=R(16886),W=R(33346),p=R(92310),ue=R.n(p),Y=R(18929),l=R(59301),G=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],A=(0,l.forwardRef)(function(m,_){var y=m.prefixCls,b=y===void 0?"rc-checkbox":y,F=m.className,K=m.style,H=m.checked,L=m.disabled,O=m.defaultChecked,k=O===void 0?!1:O,z=m.type,J=z===void 0?"checkbox":z,ne=m.title,Z=m.onChange,ae=(0,W.Z)(m,G),oe=(0,l.useRef)(null),re=(0,l.useRef)(null),Re=(0,Y.Z)(k,{value:H}),M=(0,ee.Z)(Re,2),w=M[0],T=M[1];(0,l.useImperativeHandle)(_,function(){return{focus:function(g){var d;(d=oe.current)===null||d===void 0||d.focus(g)},blur:function(){var g;(g=oe.current)===null||g===void 0||g.blur()},input:oe.current,nativeElement:re.current}});var I=ue()(b,F,(0,xe.Z)((0,xe.Z)({},"".concat(b,"-checked"),w),"".concat(b,"-disabled"),L)),N=function(g){L||("checked"in m||T(g.target.checked),Z==null||Z({target:(0,le.Z)((0,le.Z)({},m),{},{type:J,checked:g.target.checked}),stopPropagation:function(){g.stopPropagation()},preventDefault:function(){g.preventDefault()},nativeEvent:g.nativeEvent}))};return l.createElement("span",{className:I,title:ne,style:K,ref:re},l.createElement("input",(0,E.Z)({},ae,{className:"".concat(b,"-input"),ref:oe,onChange:N,disabled:L,checked:!!w,type:J})),l.createElement("span",{className:"".concat(b,"-inner")}))});ft.Z=A},96478:function(Ut,ft,R){"use strict";R.d(ft,{Z:function(){return ne}});var E=R(67711),le=R(52873),xe=R(16886),ee=R(33346),W=R(65030),p=R(92310),ue=R.n(p),Y=R(8654),l=R(59301),G=R(10228),A=R(16089),m=G.Z.ESC,_=G.Z.TAB;function y(Z){var ae=Z.visible,oe=Z.triggerRef,re=Z.onVisibleChange,Re=Z.autoFocus,M=Z.overlayRef,w=l.useRef(!1),T=function(){if(ae){var g,d;(g=oe.current)===null||g===void 0||(d=g.focus)===null||d===void 0||d.call(g),re==null||re(!1)}},I=function(){var g;return(g=M.current)!==null&&g!==void 0&&g.focus?(M.current.focus(),w.current=!0,!0):!1},N=function(g){switch(g.keyCode){case m:T();break;case _:{var d=!1;w.current||(d=I()),d?g.preventDefault():T();break}}};l.useEffect(function(){return ae?(window.addEventListener("keydown",N),Re&&(0,A.Z)(I,3),function(){window.removeEventListener("keydown",N),w.current=!1}):function(){w.current=!1}},[ae])}var b=(0,l.forwardRef)(function(Z,ae){var oe=Z.overlay,re=Z.arrow,Re=Z.prefixCls,M=(0,l.useMemo)(function(){var T;return typeof oe=="function"?T=oe():T=oe,T},[oe]),w=(0,Y.sQ)(ae,(0,Y.C4)(M));return l.createElement(l.Fragment,null,re&&l.createElement("div",{className:"".concat(Re,"-arrow")}),l.cloneElement(M,{ref:(0,Y.Yr)(M)?w:void 0}))}),F=b,K={adjustX:1,adjustY:1},H=[0,0],L={topLeft:{points:["bl","tl"],overflow:K,offset:[0,-4],targetOffset:H},top:{points:["bc","tc"],overflow:K,offset:[0,-4],targetOffset:H},topRight:{points:["br","tr"],overflow:K,offset:[0,-4],targetOffset:H},bottomLeft:{points:["tl","bl"],overflow:K,offset:[0,4],targetOffset:H},bottom:{points:["tc","bc"],overflow:K,offset:[0,4],targetOffset:H},bottomRight:{points:["tr","br"],overflow:K,offset:[0,4],targetOffset:H}},O=L,k=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function z(Z,ae){var oe,re=Z.arrow,Re=re===void 0?!1:re,M=Z.prefixCls,w=M===void 0?"rc-dropdown":M,T=Z.transitionName,I=Z.animation,N=Z.align,U=Z.placement,g=U===void 0?"bottomLeft":U,d=Z.placements,D=d===void 0?O:d,$=Z.getPopupContainer,he=Z.showAction,Se=Z.hideAction,qe=Z.overlayClassName,Ue=Z.overlayStyle,nt=Z.visible,et=Z.trigger,Pe=et===void 0?["hover"]:et,Lt=Z.autoFocus,Me=Z.overlay,mt=Z.children,ke=Z.onVisibleChange,Tt=(0,ee.Z)(Z,k),ye=l.useState(),be=(0,xe.Z)(ye,2),q=be[0],Le=be[1],Ne="visible"in Z?nt:q,Qe=l.useRef(null),V=l.useRef(null),se=l.useRef(null);l.useImperativeHandle(ae,function(){return Qe.current});var Ee=function(vt){Le(vt),ke==null||ke(vt)};y({visible:Ne,triggerRef:se,onVisibleChange:Ee,autoFocus:Lt,overlayRef:V});var Fe=function(vt){var ge=Z.onOverlayClick;Le(!1),ge&&ge(vt)},de=function(){return l.createElement(F,{ref:V,overlay:Me,prefixCls:w,arrow:Re})},ze=function(){return typeof Me=="function"?de:de()},rt=function(){var vt=Z.minOverlayWidthMatchTrigger,ge=Z.alignPoint;return"minOverlayWidthMatchTrigger"in Z?vt:!ge},We=function(){var vt=Z.openClassName;return vt!==void 0?vt:"".concat(w,"-open")},ut=l.cloneElement(mt,{className:ue()((oe=mt.props)===null||oe===void 0?void 0:oe.className,Ne&&We()),ref:(0,Y.Yr)(mt)?(0,Y.sQ)(se,(0,Y.C4)(mt)):void 0}),Ve=Se;return!Ve&&Pe.indexOf("contextMenu")!==-1&&(Ve=["click"]),l.createElement(W.Z,(0,E.Z)({builtinPlacements:D},Tt,{prefixCls:w,ref:Qe,popupClassName:ue()(qe,(0,le.Z)({},"".concat(w,"-show-arrow"),Re)),popupStyle:Ue,action:Pe,showAction:he,hideAction:Ve,popupPlacement:g,popupAlign:N,popupTransitionName:T,popupAnimation:I,popupVisible:Ne,stretch:rt()?"minWidth":"",popup:ze(),onPopupVisibleChange:Ee,onPopupClick:Fe,getPopupContainer:$}),ut)}var J=l.forwardRef(z),ne=J},66003:function(Ut,ft,R){"use strict";R.d(ft,{Z:function(){return ue}});var E=R(33346),le=R(98506),xe=R(26420),ee=R(59301),W=["show"];function p(Y,l){if(!l.max)return!0;var G=l.strategy(Y);return G<=l.max}function ue(Y,l){return ee.useMemo(function(){var G={};l&&(G.show=(0,xe.Z)(l)==="object"&&l.formatter?l.formatter:!!l),G=(0,le.Z)((0,le.Z)({},G),Y);var A=G,m=A.show,_=(0,E.Z)(A,W);return(0,le.Z)((0,le.Z)({},_),{},{show:!!m,showFormatter:typeof m=="function"?m:void 0,strategy:_.strategy||function(y){return y.length}})},[Y,l])}},36901:function(Ut,ft,R){"use strict";R.r(ft),R.d(ft,{BaseInput:function(){return G},default:function(){return O}});var E=R(98506),le=R(67711),xe=R(52873),ee=R(26420),W=R(92310),p=R.n(W),ue=R(59301),Y=R(30292),l=ue.forwardRef(function(k,z){var J,ne,Z,ae=k.inputElement,oe=k.children,re=k.prefixCls,Re=k.prefix,M=k.suffix,w=k.addonBefore,T=k.addonAfter,I=k.className,N=k.style,U=k.disabled,g=k.readOnly,d=k.focused,D=k.triggerFocus,$=k.allowClear,he=k.value,Se=k.handleReset,qe=k.hidden,Ue=k.classes,nt=k.classNames,et=k.dataAttrs,Pe=k.styles,Lt=k.components,Me=k.onClear,mt=oe!=null?oe:ae,ke=(Lt==null?void 0:Lt.affixWrapper)||"span",Tt=(Lt==null?void 0:Lt.groupWrapper)||"span",ye=(Lt==null?void 0:Lt.wrapper)||"span",be=(Lt==null?void 0:Lt.groupAddon)||"span",q=(0,ue.useRef)(null),Le=function(Ze){var tt;(tt=q.current)!==null&&tt!==void 0&&tt.contains(Ze.target)&&(D==null||D())},Ne=(0,Y.X3)(k),Qe=(0,ue.cloneElement)(mt,{value:he,className:p()((J=mt.props)===null||J===void 0?void 0:J.className,!Ne&&(nt==null?void 0:nt.variant))||null}),V=(0,ue.useRef)(null);if(ue.useImperativeHandle(z,function(){return{nativeElement:V.current||q.current}}),Ne){var se=null;if($){var Ee=!U&&!g&&he,Fe="".concat(re,"-clear-icon"),de=(0,ee.Z)($)==="object"&&$!==null&&$!==void 0&&$.clearIcon?$.clearIcon:"\u2716";se=ue.createElement("button",{type:"button",tabIndex:-1,onClick:function(Ze){Se==null||Se(Ze),Me==null||Me()},onMouseDown:function(Ze){return Ze.preventDefault()},className:p()(Fe,(0,xe.Z)((0,xe.Z)({},"".concat(Fe,"-hidden"),!Ee),"".concat(Fe,"-has-suffix"),!!M))},de)}var ze="".concat(re,"-affix-wrapper"),rt=p()(ze,(0,xe.Z)((0,xe.Z)((0,xe.Z)((0,xe.Z)((0,xe.Z)({},"".concat(re,"-disabled"),U),"".concat(ze,"-disabled"),U),"".concat(ze,"-focused"),d),"".concat(ze,"-readonly"),g),"".concat(ze,"-input-with-clear-btn"),M&&$&&he),Ue==null?void 0:Ue.affixWrapper,nt==null?void 0:nt.affixWrapper,nt==null?void 0:nt.variant),We=(M||$)&&ue.createElement("span",{className:p()("".concat(re,"-suffix"),nt==null?void 0:nt.suffix),style:Pe==null?void 0:Pe.suffix},se,M);Qe=ue.createElement(ke,(0,le.Z)({className:rt,style:Pe==null?void 0:Pe.affixWrapper,onClick:Le},et==null?void 0:et.affixWrapper,{ref:q}),Re&&ue.createElement("span",{className:p()("".concat(re,"-prefix"),nt==null?void 0:nt.prefix),style:Pe==null?void 0:Pe.prefix},Re),Qe,We)}if((0,Y.He)(k)){var ut="".concat(re,"-group"),Ve="".concat(ut,"-addon"),At="".concat(ut,"-wrapper"),vt=p()("".concat(re,"-wrapper"),ut,Ue==null?void 0:Ue.wrapper,nt==null?void 0:nt.wrapper),ge=p()(At,(0,xe.Z)({},"".concat(At,"-disabled"),U),Ue==null?void 0:Ue.group,nt==null?void 0:nt.groupWrapper);Qe=ue.createElement(Tt,{className:ge,ref:V},ue.createElement(ye,{className:vt},w&&ue.createElement(be,{className:Ve},w),Qe,T&&ue.createElement(be,{className:Ve},T)))}return ue.cloneElement(Qe,{className:p()((ne=Qe.props)===null||ne===void 0?void 0:ne.className,I)||null,style:(0,E.Z)((0,E.Z)({},(Z=Qe.props)===null||Z===void 0?void 0:Z.style),N),hidden:qe})}),G=l,A=R(15142),m=R(16886),_=R(33346),y=R(18929),b=R(2738),F=R(66003),K=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],H=(0,ue.forwardRef)(function(k,z){var J=k.autoComplete,ne=k.onChange,Z=k.onFocus,ae=k.onBlur,oe=k.onPressEnter,re=k.onKeyDown,Re=k.onKeyUp,M=k.prefixCls,w=M===void 0?"rc-input":M,T=k.disabled,I=k.htmlSize,N=k.className,U=k.maxLength,g=k.suffix,d=k.showCount,D=k.count,$=k.type,he=$===void 0?"text":$,Se=k.classes,qe=k.classNames,Ue=k.styles,nt=k.onCompositionStart,et=k.onCompositionEnd,Pe=(0,_.Z)(k,K),Lt=(0,ue.useState)(!1),Me=(0,m.Z)(Lt,2),mt=Me[0],ke=Me[1],Tt=(0,ue.useRef)(!1),ye=(0,ue.useRef)(!1),be=(0,ue.useRef)(null),q=(0,ue.useRef)(null),Le=function(wt){be.current&&(0,Y.nH)(be.current,wt)},Ne=(0,y.Z)(k.defaultValue,{value:k.value}),Qe=(0,m.Z)(Ne,2),V=Qe[0],se=Qe[1],Ee=V==null?"":String(V),Fe=(0,ue.useState)(null),de=(0,m.Z)(Fe,2),ze=de[0],rt=de[1],We=(0,F.Z)(D,d),ut=We.max||U,Ve=We.strategy(Ee),At=!!ut&&Ve>ut;(0,ue.useImperativeHandle)(z,function(){var it;return{focus:Le,blur:function(){var _e;(_e=be.current)===null||_e===void 0||_e.blur()},setSelectionRange:function(_e,me,pe){var C;(C=be.current)===null||C===void 0||C.setSelectionRange(_e,me,pe)},select:function(){var _e;(_e=be.current)===null||_e===void 0||_e.select()},input:be.current,nativeElement:((it=q.current)===null||it===void 0?void 0:it.nativeElement)||be.current}}),(0,ue.useEffect)(function(){ye.current&&(ye.current=!1),ke(function(it){return it&&T?!1:it})},[T]);var vt=function(wt,_e,me){var pe=_e;if(!Tt.current&&We.exceedFormatter&&We.max&&We.strategy(_e)>We.max){if(pe=We.exceedFormatter(_e,{max:We.max}),_e!==pe){var C,j;rt([((C=be.current)===null||C===void 0?void 0:C.selectionStart)||0,((j=be.current)===null||j===void 0?void 0:j.selectionEnd)||0])}}else if(me.source==="compositionEnd")return;se(pe),be.current&&(0,Y.rJ)(be.current,wt,ne,pe)};(0,ue.useEffect)(function(){if(ze){var it;(it=be.current)===null||it===void 0||it.setSelectionRange.apply(it,(0,A.Z)(ze))}},[ze]);var ge=function(wt){vt(wt,wt.target.value,{source:"change"})},Ae=function(wt){Tt.current=!1,vt(wt,wt.currentTarget.value,{source:"compositionEnd"}),et==null||et(wt)},Ze=function(wt){oe&&wt.key==="Enter"&&!ye.current&&(ye.current=!0,oe(wt)),re==null||re(wt)},tt=function(wt){wt.key==="Enter"&&(ye.current=!1),Re==null||Re(wt)},Ke=function(wt){ke(!0),Z==null||Z(wt)},pt=function(wt){ye.current&&(ye.current=!1),ke(!1),ae==null||ae(wt)},gt=function(wt){se(""),Le(),be.current&&(0,Y.rJ)(be.current,wt,ne)},He=At&&"".concat(w,"-out-of-range"),bt=function(){var wt=(0,b.Z)(k,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return ue.createElement("input",(0,le.Z)({autoComplete:J},wt,{onChange:ge,onFocus:Ke,onBlur:pt,onKeyDown:Ze,onKeyUp:tt,className:p()(w,(0,xe.Z)({},"".concat(w,"-disabled"),T),qe==null?void 0:qe.input),style:Ue==null?void 0:Ue.input,ref:be,size:I,type:he,onCompositionStart:function(me){Tt.current=!0,nt==null||nt(me)},onCompositionEnd:Ae}))},Ct=function(){var wt=Number(ut)>0;if(g||We.show){var _e=We.showFormatter?We.showFormatter({value:Ee,count:Ve,maxLength:ut}):"".concat(Ve).concat(wt?" / ".concat(ut):"");return ue.createElement(ue.Fragment,null,We.show&&ue.createElement("span",{className:p()("".concat(w,"-show-count-suffix"),(0,xe.Z)({},"".concat(w,"-show-count-has-suffix"),!!g),qe==null?void 0:qe.count),style:(0,E.Z)({},Ue==null?void 0:Ue.count)},_e),g)}return null};return ue.createElement(G,(0,le.Z)({},Pe,{prefixCls:w,className:p()(N,He),handleReset:gt,value:Ee,focused:mt,triggerFocus:Le,suffix:Ct(),disabled:T,classes:Se,classNames:qe,styles:Ue}),bt())}),L=H,O=L},30292:function(Ut,ft,R){"use strict";R.d(ft,{He:function(){return E},X3:function(){return le},nH:function(){return W},rJ:function(){return ee}});function E(p){return!!(p.addonBefore||p.addonAfter)}function le(p){return!!(p.prefix||p.suffix||p.allowClear)}function xe(p,ue,Y){var l=ue.cloneNode(!0),G=Object.create(p,{target:{value:l},currentTarget:{value:l}});return l.value=Y,typeof ue.selectionStart=="number"&&typeof ue.selectionEnd=="number"&&(l.selectionStart=ue.selectionStart,l.selectionEnd=ue.selectionEnd),l.setSelectionRange=function(){ue.setSelectionRange.apply(ue,arguments)},G}function ee(p,ue,Y,l){if(Y){var G=ue;if(ue.type==="click"){G=xe(ue,p,""),Y(G);return}if(p.type!=="file"&&l!==void 0){G=xe(ue,p,l),Y(G);return}Y(G)}}function W(p,ue){if(p){p.focus(ue);var Y=ue||{},l=Y.cursor;if(l){var G=p.value.length;switch(l){case"start":p.setSelectionRange(0,0);break;case"end":p.setSelectionRange(G,G);break;default:p.setSelectionRange(0,G)}}}}},28321:function(Ut,ft,R){"use strict";R.d(ft,{iz:function(){return un},ck:function(){return pe},BW:function(){return Sn},sN:function(){return pe},Wd:function(){return Pt},ZP:function(){return Mt},Xl:function(){return oe}});var E=R(67711),le=R(52873),xe=R(98506),ee=R(15142),W=R(16886),p=R(33346),ue=R(92310),Y=R.n(ue),l=R(11780),G=R(18929),A=R(13697),m=R(48736),_=R(59301),y=R(4676),b=_.createContext(null);function F(we,Je){return we===void 0?null:"".concat(we,"-").concat(Je)}function K(we){var Je=_.useContext(b);return F(Je,we)}var H=R(80547),L=["children","locked"],O=_.createContext(null);function k(we,Je){var ht=(0,xe.Z)({},we);return Object.keys(Je).forEach(function(lt){var Et=Je[lt];Et!==void 0&&(ht[lt]=Et)}),ht}function z(we){var Je=we.children,ht=we.locked,lt=(0,p.Z)(we,L),Et=_.useContext(O),xt=(0,H.Z)(function(){return k(Et,lt)},[Et,lt],function(It,Wt){return!ht&&(It[0]!==Wt[0]||!(0,A.Z)(It[1],Wt[1],!0))});return _.createElement(O.Provider,{value:xt},Je)}var J=[],ne=_.createContext(null);function Z(){return _.useContext(ne)}var ae=_.createContext(J);function oe(we){var Je=_.useContext(ae);return _.useMemo(function(){return we!==void 0?[].concat((0,ee.Z)(Je),[we]):Je},[Je,we])}var re=_.createContext(null),Re=_.createContext({}),M=Re,w=R(29194);function T(we){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,w.Z)(we)){var ht=we.nodeName.toLowerCase(),lt=["input","select","textarea","button"].includes(ht)||we.isContentEditable||ht==="a"&&!!we.getAttribute("href"),Et=we.getAttribute("tabindex"),xt=Number(Et),It=null;return Et&&!Number.isNaN(xt)?It=xt:lt&&It===null&&(It=0),lt&&we.disabled&&(It=null),It!==null&&(It>=0||Je&&It<0)}return!1}function I(we){var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ht=(0,ee.Z)(we.querySelectorAll("*")).filter(function(lt){return T(lt,Je)});return T(we,Je)&&ht.unshift(we),ht}var N=null;function U(){N=document.activeElement}function g(){N=null}function d(){if(N)try{N.focus()}catch(we){}}function D(we,Je){if(Je.keyCode===9){var ht=I(we),lt=ht[Je.shiftKey?0:ht.length-1],Et=lt===document.activeElement||we===document.activeElement;if(Et){var xt=ht[Je.shiftKey?ht.length-1:0];xt.focus(),Je.preventDefault()}}}var $=R(10228),he=R(16089),Se=$.Z.LEFT,qe=$.Z.RIGHT,Ue=$.Z.UP,nt=$.Z.DOWN,et=$.Z.ENTER,Pe=$.Z.ESC,Lt=$.Z.HOME,Me=$.Z.END,mt=[Ue,nt,Se,qe];function ke(we,Je,ht,lt){var Et,xt="prev",It="next",Wt="children",yn="parent";if(we==="inline"&<===et)return{inlineTrigger:!0};var nn=(0,le.Z)((0,le.Z)({},Ue,xt),nt,It),Fn=(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},Se,ht?It:xt),qe,ht?xt:It),nt,Wt),et,Wt),Qt=(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},Ue,xt),nt,It),et,Wt),Pe,yn),Se,ht?Wt:yn),qe,ht?yn:Wt),en={inline:nn,horizontal:Fn,vertical:Qt,inlineSub:nn,horizontalSub:Qt,verticalSub:Qt},ln=(Et=en["".concat(we).concat(Je?"":"Sub")])===null||Et===void 0?void 0:Et[lt];switch(ln){case xt:return{offset:-1,sibling:!0};case It:return{offset:1,sibling:!0};case yn:return{offset:-1,sibling:!1};case Wt:return{offset:1,sibling:!1};default:return null}}function Tt(we){for(var Je=we;Je;){if(Je.getAttribute("data-menu-list"))return Je;Je=Je.parentElement}return null}function ye(we,Je){for(var ht=we||document.activeElement;ht;){if(Je.has(ht))return ht;ht=ht.parentElement}return null}function be(we,Je){var ht=I(we,!0);return ht.filter(function(lt){return Je.has(lt)})}function q(we,Je,ht){var lt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!we)return null;var Et=be(we,Je),xt=Et.length,It=Et.findIndex(function(Wt){return ht===Wt});return lt<0?It===-1?It=xt-1:It-=1:lt>0&&(It+=1),It=(It+xt)%xt,Et[It]}var Le=function(Je,ht){var lt=new Set,Et=new Map,xt=new Map;return Je.forEach(function(It){var Wt=document.querySelector("[data-menu-id='".concat(F(ht,It),"']"));Wt&&(lt.add(Wt),xt.set(Wt,It),Et.set(It,Wt))}),{elements:lt,key2element:Et,element2key:xt}};function Ne(we,Je,ht,lt,Et,xt,It,Wt,yn,nn){var Fn=_.useRef(),Qt=_.useRef();Qt.current=Je;var en=function(){he.Z.cancel(Fn.current)};return _.useEffect(function(){return function(){en()}},[]),function(ln){var En=ln.which;if([].concat(mt,[et,Pe,Lt,Me]).includes(En)){var An=xt(),Jt=Le(An,lt),rn=Jt,kn=rn.elements,gn=rn.key2element,mn=rn.element2key,Ln=gn.get(Je),wn=ye(Ln,kn),cn=mn.get(wn),Pn=ke(we,It(cn,!0).length===1,ht,En);if(!Pn&&En!==Lt&&En!==Me)return;(mt.includes(En)||[Lt,Me].includes(En))&&ln.preventDefault();var Hn=function(Xn){if(Xn){var Ei=Xn,Un=Xn.querySelector("a");Un!=null&&Un.getAttribute("href")&&(Ei=Un);var Vn=mn.get(Xn);Wt(Vn),en(),Fn.current=(0,he.Z)(function(){Qt.current===Vn&&Ei.focus()})}};if([Lt,Me].includes(En)||Pn.sibling||!wn){var ni;!wn||we==="inline"?ni=Et.current:ni=Tt(wn);var xn,ii=be(ni,kn);En===Lt?xn=ii[0]:En===Me?xn=ii[ii.length-1]:xn=q(ni,kn,wn,Pn.offset),Hn(xn)}else if(Pn.inlineTrigger)yn(cn);else if(Pn.offset>0)yn(cn,!0),en(),Fn.current=(0,he.Z)(function(){Jt=Le(An,lt);var Zn=wn.getAttribute("aria-controls"),Xn=document.getElementById(Zn),Ei=q(Xn,Jt.elements);Hn(Ei)},5);else if(Pn.offset<0){var ri=It(cn,!0),Nn=ri[ri.length-2],$n=gn.get(Nn);yn(Nn,!1),Hn($n)}}nn==null||nn(ln)}}function Qe(we){Promise.resolve().then(we)}var V="__RC_UTIL_PATH_SPLIT__",se=function(Je){return Je.join(V)},Ee=function(Je){return Je.split(V)},Fe="rc-menu-more";function de(){var we=_.useState({}),Je=(0,W.Z)(we,2),ht=Je[1],lt=(0,_.useRef)(new Map),Et=(0,_.useRef)(new Map),xt=_.useState([]),It=(0,W.Z)(xt,2),Wt=It[0],yn=It[1],nn=(0,_.useRef)(0),Fn=(0,_.useRef)(!1),Qt=function(){Fn.current||ht({})},en=(0,_.useCallback)(function(gn,mn){var Ln=se(mn);Et.current.set(Ln,gn),lt.current.set(gn,Ln),nn.current+=1;var wn=nn.current;Qe(function(){wn===nn.current&&Qt()})},[]),ln=(0,_.useCallback)(function(gn,mn){var Ln=se(mn);Et.current.delete(Ln),lt.current.delete(gn)},[]),En=(0,_.useCallback)(function(gn){yn(gn)},[]),An=(0,_.useCallback)(function(gn,mn){var Ln=lt.current.get(gn)||"",wn=Ee(Ln);return mn&&Wt.includes(wn[0])&&wn.unshift(Fe),wn},[Wt]),Jt=(0,_.useCallback)(function(gn,mn){return gn.filter(function(Ln){return Ln!==void 0}).some(function(Ln){var wn=An(Ln,!0);return wn.includes(mn)})},[An]),rn=function(){var mn=(0,ee.Z)(lt.current.keys());return Wt.length&&mn.push(Fe),mn},kn=(0,_.useCallback)(function(gn){var mn="".concat(lt.current.get(gn)).concat(V),Ln=new Set;return(0,ee.Z)(Et.current.keys()).forEach(function(wn){wn.startsWith(mn)&&Ln.add(Et.current.get(wn))}),Ln},[]);return _.useEffect(function(){return function(){Fn.current=!0}},[]),{registerPath:en,unregisterPath:ln,refreshOverflowKeys:En,isSubPathKey:Jt,getKeyPath:An,getKeys:rn,getSubPathKeys:kn}}function ze(we){var Je=_.useRef(we);Je.current=we;var ht=_.useCallback(function(){for(var lt,Et=arguments.length,xt=new Array(Et),It=0;It<Et;It++)xt[It]=arguments[It];return(lt=Je.current)===null||lt===void 0?void 0:lt.call.apply(lt,[Je].concat(xt))},[]);return we?ht:void 0}var rt=Math.random().toFixed(5).toString().slice(2),We=0;function ut(we){var Je=(0,G.Z)(we,{value:we}),ht=(0,W.Z)(Je,2),lt=ht[0],Et=ht[1];return _.useEffect(function(){We+=1;var xt="".concat(rt,"-").concat(We);Et("rc-menu-uuid-".concat(xt))},[]),lt}var Ve=R(42573),At=R(58698),vt=R(74700),ge=R(45080),Ae=R(2738),Ze=R(8654);function tt(we,Je,ht,lt){var Et=_.useContext(O),xt=Et.activeKey,It=Et.onActive,Wt=Et.onInactive,yn={active:xt===we};return Je||(yn.onMouseEnter=function(nn){ht==null||ht({key:we,domEvent:nn}),It(we)},yn.onMouseLeave=function(nn){lt==null||lt({key:we,domEvent:nn}),Wt(we)}),yn}function Ke(we){var Je=_.useContext(O),ht=Je.mode,lt=Je.rtl,Et=Je.inlineIndent;if(ht!=="inline")return null;var xt=we;return lt?{paddingRight:xt*Et}:{paddingLeft:xt*Et}}function pt(we){var Je=we.icon,ht=we.props,lt=we.children,Et;return Je===null||Je===!1?null:(typeof Je=="function"?Et=_.createElement(Je,(0,xe.Z)({},ht)):typeof Je!="boolean"&&(Et=Je),Et||lt||null)}var gt=["item"];function He(we){var Je=we.item,ht=(0,p.Z)(we,gt);return Object.defineProperty(ht,"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."),Je}}),ht}var bt=["title","attribute","elementRef"],Ct=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],it=["active"],wt=function(we){(0,vt.Z)(ht,we);var Je=(0,ge.Z)(ht);function ht(){return(0,Ve.Z)(this,ht),Je.apply(this,arguments)}return(0,At.Z)(ht,[{key:"render",value:function(){var Et=this.props,xt=Et.title,It=Et.attribute,Wt=Et.elementRef,yn=(0,p.Z)(Et,bt),nn=(0,Ae.Z)(yn,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,m.ZP)(!It,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),_.createElement(l.Z.Item,(0,E.Z)({},It,{title:typeof xt=="string"?xt:void 0},nn,{ref:Wt}))}}]),ht}(_.Component),_e=_.forwardRef(function(we,Je){var ht=we.style,lt=we.className,Et=we.eventKey,xt=we.warnKey,It=we.disabled,Wt=we.itemIcon,yn=we.children,nn=we.role,Fn=we.onMouseEnter,Qt=we.onMouseLeave,en=we.onClick,ln=we.onKeyDown,En=we.onFocus,An=(0,p.Z)(we,Ct),Jt=K(Et),rn=_.useContext(O),kn=rn.prefixCls,gn=rn.onItemClick,mn=rn.disabled,Ln=rn.overflowDisabled,wn=rn.itemIcon,cn=rn.selectedKeys,Pn=rn.onActive,Hn=_.useContext(M),ni=Hn._internalRenderMenuItem,xn="".concat(kn,"-item"),ii=_.useRef(),ri=_.useRef(),Nn=mn||It,$n=(0,Ze.x1)(Je,ri),Zn=oe(Et),Xn=function(Jn){return{key:Et,keyPath:(0,ee.Z)(Zn).reverse(),item:ii.current,domEvent:Jn}},Ei=Wt||wn,Un=tt(Et,Nn,Fn,Qt),Vn=Un.active,vi=(0,p.Z)(Un,it),Ci=cn.includes(Et),li=Ke(Zn.length),Ai=function(Jn){if(!Nn){var ci=Xn(Jn);en==null||en(He(ci)),gn(ci)}},ui=function(Jn){if(ln==null||ln(Jn),Jn.which===$.Z.ENTER){var ci=Xn(Jn);en==null||en(He(ci)),gn(ci)}},oi=function(Jn){Pn(Et),En==null||En(Jn)},Ii={};we.role==="option"&&(Ii["aria-selected"]=Ci);var xi=_.createElement(wt,(0,E.Z)({ref:ii,elementRef:$n,role:nn===null?"none":nn||"menuitem",tabIndex:It?null:-1,"data-menu-id":Ln&&Jt?null:Jt},(0,Ae.Z)(An,["extra"]),vi,Ii,{component:"li","aria-disabled":It,style:(0,xe.Z)((0,xe.Z)({},li),ht),className:Y()(xn,(0,le.Z)((0,le.Z)((0,le.Z)({},"".concat(xn,"-active"),Vn),"".concat(xn,"-selected"),Ci),"".concat(xn,"-disabled"),Nn),lt),onClick:Ai,onKeyDown:ui,onFocus:oi}),yn,_.createElement(pt,{props:(0,xe.Z)((0,xe.Z)({},we),{},{isSelected:Ci}),icon:Ei}));return ni&&(xi=ni(xi,we,{selected:Ci})),xi});function me(we,Je){var ht=we.eventKey,lt=Z(),Et=oe(ht);return _.useEffect(function(){if(lt)return lt.registerPath(ht,Et),function(){lt.unregisterPath(ht,Et)}},[Et]),lt?null:_.createElement(_e,(0,E.Z)({},we,{ref:Je}))}var pe=_.forwardRef(me),C=["className","children"],j=function(Je,ht){var lt=Je.className,Et=Je.children,xt=(0,p.Z)(Je,C),It=_.useContext(O),Wt=It.prefixCls,yn=It.mode,nn=It.rtl;return _.createElement("ul",(0,E.Z)({className:Y()(Wt,nn&&"".concat(Wt,"-rtl"),"".concat(Wt,"-sub"),"".concat(Wt,"-").concat(yn==="inline"?"inline":"vertical"),lt),role:"menu"},xt,{"data-menu-list":!0,ref:ht}),Et)},X=_.forwardRef(j);X.displayName="SubMenuList";var te=X,fe=R(11592);function ve(we,Je){return(0,fe.Z)(we).map(function(ht,lt){if(_.isValidElement(ht)){var Et,xt,It=ht.key,Wt=(Et=(xt=ht.props)===null||xt===void 0?void 0:xt.eventKey)!==null&&Et!==void 0?Et:It,yn=Wt==null;yn&&(Wt="tmp_key-".concat([].concat((0,ee.Z)(Je),[lt]).join("-")));var nn={key:Wt,eventKey:Wt};return _.cloneElement(ht,nn)}return ht})}var Te=R(65030),Ie={adjustX:1,adjustY:1},je={topLeft:{points:["bl","tl"],overflow:Ie},topRight:{points:["br","tr"],overflow:Ie},bottomLeft:{points:["tl","bl"],overflow:Ie},bottomRight:{points:["tr","br"],overflow:Ie},leftTop:{points:["tr","tl"],overflow:Ie},leftBottom:{points:["br","bl"],overflow:Ie},rightTop:{points:["tl","tr"],overflow:Ie},rightBottom:{points:["bl","br"],overflow:Ie}},_t={topLeft:{points:["bl","tl"],overflow:Ie},topRight:{points:["br","tr"],overflow:Ie},bottomLeft:{points:["tl","bl"],overflow:Ie},bottomRight:{points:["tr","br"],overflow:Ie},rightTop:{points:["tr","tl"],overflow:Ie},rightBottom:{points:["br","bl"],overflow:Ie},leftTop:{points:["tl","tr"],overflow:Ie},leftBottom:{points:["bl","br"],overflow:Ie}},Dt=null;function dt(we,Je,ht){if(Je)return Je;if(ht)return ht[we]||ht.other}var at={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Rt(we){var Je=we.prefixCls,ht=we.visible,lt=we.children,Et=we.popup,xt=we.popupStyle,It=we.popupClassName,Wt=we.popupOffset,yn=we.disabled,nn=we.mode,Fn=we.onVisibleChange,Qt=_.useContext(O),en=Qt.getPopupContainer,ln=Qt.rtl,En=Qt.subMenuOpenDelay,An=Qt.subMenuCloseDelay,Jt=Qt.builtinPlacements,rn=Qt.triggerSubMenuAction,kn=Qt.forceSubMenuRender,gn=Qt.rootClassName,mn=Qt.motion,Ln=Qt.defaultMotions,wn=_.useState(!1),cn=(0,W.Z)(wn,2),Pn=cn[0],Hn=cn[1],ni=ln?(0,xe.Z)((0,xe.Z)({},_t),Jt):(0,xe.Z)((0,xe.Z)({},je),Jt),xn=at[nn],ii=dt(nn,mn,Ln),ri=_.useRef(ii);nn!=="inline"&&(ri.current=ii);var Nn=(0,xe.Z)((0,xe.Z)({},ri.current),{},{leavedClassName:"".concat(Je,"-hidden"),removeOnLeave:!1,motionAppear:!0}),$n=_.useRef();return _.useEffect(function(){return $n.current=(0,he.Z)(function(){Hn(ht)}),function(){he.Z.cancel($n.current)}},[ht]),_.createElement(Te.Z,{prefixCls:Je,popupClassName:Y()("".concat(Je,"-popup"),(0,le.Z)({},"".concat(Je,"-rtl"),ln),It,gn),stretch:nn==="horizontal"?"minWidth":null,getPopupContainer:en,builtinPlacements:ni,popupPlacement:xn,popupVisible:Pn,popup:Et,popupStyle:xt,popupAlign:Wt&&{offset:Wt},action:yn?[]:[rn],mouseEnterDelay:En,mouseLeaveDelay:An,onPopupVisibleChange:Fn,forceRender:kn,popupMotion:Nn,fresh:!0},lt)}var Gt=R(77900);function kt(we){var Je=we.id,ht=we.open,lt=we.keyPath,Et=we.children,xt="inline",It=_.useContext(O),Wt=It.prefixCls,yn=It.forceSubMenuRender,nn=It.motion,Fn=It.defaultMotions,Qt=It.mode,en=_.useRef(!1);en.current=Qt===xt;var ln=_.useState(!en.current),En=(0,W.Z)(ln,2),An=En[0],Jt=En[1],rn=en.current?ht:!1;_.useEffect(function(){en.current&&Jt(!1)},[Qt]);var kn=(0,xe.Z)({},dt(xt,nn,Fn));lt.length>1&&(kn.motionAppear=!1);var gn=kn.onVisibleChanged;return kn.onVisibleChanged=function(mn){return!en.current&&!mn&&Jt(!0),gn==null?void 0:gn(mn)},An?null:_.createElement(z,{mode:xt,locked:!en.current},_.createElement(Gt.default,(0,E.Z)({visible:rn},kn,{forceRender:yn,removeOnLeave:!1,leavedClassName:"".concat(Wt,"-hidden")}),function(mn){var Ln=mn.className,wn=mn.style;return _.createElement(te,{id:Je,className:Ln,style:wn},Et)}))}var Ot=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],ot=["active"],Ye=_.forwardRef(function(we,Je){var ht=we.style,lt=we.className,Et=we.title,xt=we.eventKey,It=we.warnKey,Wt=we.disabled,yn=we.internalPopupClose,nn=we.children,Fn=we.itemIcon,Qt=we.expandIcon,en=we.popupClassName,ln=we.popupOffset,En=we.popupStyle,An=we.onClick,Jt=we.onMouseEnter,rn=we.onMouseLeave,kn=we.onTitleClick,gn=we.onTitleMouseEnter,mn=we.onTitleMouseLeave,Ln=(0,p.Z)(we,Ot),wn=K(xt),cn=_.useContext(O),Pn=cn.prefixCls,Hn=cn.mode,ni=cn.openKeys,xn=cn.disabled,ii=cn.overflowDisabled,ri=cn.activeKey,Nn=cn.selectedKeys,$n=cn.itemIcon,Zn=cn.expandIcon,Xn=cn.onItemClick,Ei=cn.onOpenChange,Un=cn.onActive,Vn=_.useContext(M),vi=Vn._internalRenderSubMenuItem,Ci=_.useContext(re),li=Ci.isSubPathKey,Ai=oe(),ui="".concat(Pn,"-submenu"),oi=xn||Wt,Ii=_.useRef(),xi=_.useRef(),Qn=Fn!=null?Fn:$n,Jn=Qt!=null?Qt:Zn,ci=ni.includes(xt),_i=!ii&&ci,Ri=li(Nn,xt),$t=tt(xt,oi,gn,mn),di=$t.active,Si=(0,p.Z)($t,ot),wi=_.useState(!1),Fi=(0,W.Z)(wi,2),Dn=Fi[0],qt=Fi[1],Cn=function(Rn){oi||qt(Rn)},an=function(Rn){Cn(!0),Jt==null||Jt({key:xt,domEvent:Rn})},yi=function(Rn){Cn(!1),rn==null||rn({key:xt,domEvent:Rn})},fi=_.useMemo(function(){return di||(Hn!=="inline"?Dn||li([ri],xt):!1)},[Hn,di,ri,Dn,xt,li]),pi=Ke(Ai.length),gi=function(Rn){oi||(kn==null||kn({key:xt,domEvent:Rn}),Hn==="inline"&&Ei(xt,!ci))},Wi=ze(function(Yn){An==null||An(He(Yn)),Xn(Yn)}),Ti=function(Rn){Hn!=="inline"&&Ei(xt,Rn)},Li=function(){Un(xt)},Mi=wn&&"".concat(wn,"-popup"),Ni=_.useMemo(function(){return _.createElement(pt,{icon:Hn!=="horizontal"?Jn:void 0,props:(0,xe.Z)((0,xe.Z)({},we),{},{isOpen:_i,isSubMenu:!0})},_.createElement("i",{className:"".concat(ui,"-arrow")}))},[Hn,Jn,we,_i,ui]),hi=_.createElement("div",(0,E.Z)({role:"menuitem",style:pi,className:"".concat(ui,"-title"),tabIndex:oi?null:-1,ref:Ii,title:typeof Et=="string"?Et:null,"data-menu-id":ii&&wn?null:wn,"aria-expanded":_i,"aria-haspopup":!0,"aria-controls":Mi,"aria-disabled":oi,onClick:gi,onFocus:Li},Si),Et,Ni),Bi=_.useRef(Hn);if(Hn!=="inline"&&Ai.length>1?Bi.current="vertical":Bi.current=Hn,!ii){var qi=Bi.current;hi=_.createElement(Rt,{mode:qi,prefixCls:ui,visible:!yn&&_i&&Hn!=="inline",popupClassName:en,popupOffset:ln,popupStyle:En,popup:_.createElement(z,{mode:qi==="horizontal"?"vertical":qi},_.createElement(te,{id:Mi,ref:xi},nn)),disabled:oi,onVisibleChange:Ti},hi)}var bi=_.createElement(l.Z.Item,(0,E.Z)({ref:Je,role:"none"},Ln,{component:"li",style:ht,className:Y()(ui,"".concat(ui,"-").concat(Hn),lt,(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},"".concat(ui,"-open"),_i),"".concat(ui,"-active"),fi),"".concat(ui,"-selected"),Ri),"".concat(ui,"-disabled"),oi)),onMouseEnter:an,onMouseLeave:yi}),hi,!ii&&_.createElement(kt,{id:Mi,open:_i,keyPath:Ai},nn));return vi&&(bi=vi(bi,we,{selected:Ri,active:fi,open:_i,disabled:oi})),_.createElement(z,{onItemClick:Wi,mode:Hn==="horizontal"?"vertical":Hn,itemIcon:Qn,expandIcon:Jn},bi)}),yt=_.forwardRef(function(we,Je){var ht=we.eventKey,lt=we.children,Et=oe(ht),xt=ve(lt,Et),It=Z();_.useEffect(function(){if(It)return It.registerPath(ht,Et),function(){It.unregisterPath(ht,Et)}},[Et]);var Wt;return It?Wt=xt:Wt=_.createElement(Ye,(0,E.Z)({ref:Je},we),xt),_.createElement(ae.Provider,{value:Et},Wt)}),Pt=yt,Ht=R(26420);function un(we){var Je=we.className,ht=we.style,lt=_.useContext(O),Et=lt.prefixCls,xt=Z();return xt?null:_.createElement("li",{role:"separator",className:Y()("".concat(Et,"-item-divider"),Je),style:ht})}var Bn=["className","title","eventKey","children"],fn=_.forwardRef(function(we,Je){var ht=we.className,lt=we.title,Et=we.eventKey,xt=we.children,It=(0,p.Z)(we,Bn),Wt=_.useContext(O),yn=Wt.prefixCls,nn="".concat(yn,"-item-group");return _.createElement("li",(0,E.Z)({ref:Je,role:"presentation"},It,{onClick:function(Qt){return Qt.stopPropagation()},className:Y()(nn,ht)}),_.createElement("div",{role:"presentation",className:"".concat(nn,"-title"),title:typeof lt=="string"?lt:void 0},lt),_.createElement("ul",{role:"group",className:"".concat(nn,"-list")},xt))}),pn=_.forwardRef(function(we,Je){var ht=we.eventKey,lt=we.children,Et=oe(ht),xt=ve(lt,Et),It=Z();return It?xt:_.createElement(fn,(0,E.Z)({ref:Je},(0,Ae.Z)(we,["warnKey"])),xt)}),Sn=pn,tn=["label","children","key","type","extra"];function On(we,Je,ht){var lt=Je.item,Et=Je.group,xt=Je.submenu,It=Je.divider;return(we||[]).map(function(Wt,yn){if(Wt&&(0,Ht.Z)(Wt)==="object"){var nn=Wt,Fn=nn.label,Qt=nn.children,en=nn.key,ln=nn.type,En=nn.extra,An=(0,p.Z)(nn,tn),Jt=en!=null?en:"tmp-".concat(yn);return Qt||ln==="group"?ln==="group"?_.createElement(Et,(0,E.Z)({key:Jt},An,{title:Fn}),On(Qt,Je,ht)):_.createElement(xt,(0,E.Z)({key:Jt},An,{title:Fn}),On(Qt,Je,ht)):ln==="divider"?_.createElement(It,(0,E.Z)({key:Jt},An)):_.createElement(lt,(0,E.Z)({key:Jt},An,{extra:En}),Fn,(!!En||En===0)&&_.createElement("span",{className:"".concat(ht,"-item-extra")},En))}return null}).filter(function(Wt){return Wt})}function Tn(we,Je,ht,lt,Et){var xt=we,It=(0,xe.Z)({divider:un,item:pe,group:Sn,submenu:Pt},lt);return Je&&(xt=On(Je,It,Et)),ve(xt,ht)}var ai=["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"],Kt=[],_n=_.forwardRef(function(we,Je){var ht,lt=we,Et=lt.prefixCls,xt=Et===void 0?"rc-menu":Et,It=lt.rootClassName,Wt=lt.style,yn=lt.className,nn=lt.tabIndex,Fn=nn===void 0?0:nn,Qt=lt.items,en=lt.children,ln=lt.direction,En=lt.id,An=lt.mode,Jt=An===void 0?"vertical":An,rn=lt.inlineCollapsed,kn=lt.disabled,gn=lt.disabledOverflow,mn=lt.subMenuOpenDelay,Ln=mn===void 0?.1:mn,wn=lt.subMenuCloseDelay,cn=wn===void 0?.1:wn,Pn=lt.forceSubMenuRender,Hn=lt.defaultOpenKeys,ni=lt.openKeys,xn=lt.activeKey,ii=lt.defaultActiveFirst,ri=lt.selectable,Nn=ri===void 0?!0:ri,$n=lt.multiple,Zn=$n===void 0?!1:$n,Xn=lt.defaultSelectedKeys,Ei=lt.selectedKeys,Un=lt.onSelect,Vn=lt.onDeselect,vi=lt.inlineIndent,Ci=vi===void 0?24:vi,li=lt.motion,Ai=lt.defaultMotions,ui=lt.triggerSubMenuAction,oi=ui===void 0?"hover":ui,Ii=lt.builtinPlacements,xi=lt.itemIcon,Qn=lt.expandIcon,Jn=lt.overflowedIndicator,ci=Jn===void 0?"...":Jn,_i=lt.overflowedIndicatorPopupClassName,Ri=lt.getPopupContainer,$t=lt.onClick,di=lt.onOpenChange,Si=lt.onKeyDown,wi=lt.openAnimation,Fi=lt.openTransitionName,Dn=lt._internalRenderMenuItem,qt=lt._internalRenderSubMenuItem,Cn=lt._internalComponents,an=(0,p.Z)(lt,ai),yi=_.useMemo(function(){return[Tn(en,Qt,Kt,Cn,xt),Tn(en,Qt,Kt,{},xt)]},[en,Qt,Cn]),fi=(0,W.Z)(yi,2),pi=fi[0],gi=fi[1],Wi=_.useState(!1),Ti=(0,W.Z)(Wi,2),Li=Ti[0],Mi=Ti[1],Ni=_.useRef(),hi=ut(En),Bi=ln==="rtl",qi=(0,G.Z)(Hn,{value:ni,postState:function(zn){return zn||Kt}}),bi=(0,W.Z)(qi,2),Yn=bi[0],Rn=bi[1],qn=function(zn){var ti=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function ki(){Rn(zn),di==null||di(zn)}ti?(0,y.flushSync)(ki):ki()},Gi=_.useState(Yn),er=(0,W.Z)(Gi,2),tr=er[0],gr=er[1],fr=_.useRef(!1),xr=_.useMemo(function(){return(Jt==="inline"||Jt==="vertical")&&rn?["vertical",rn]:[Jt,!1]},[Jt,rn]),Zt=(0,W.Z)(xr,2),on=Zt[0],Kn=Zt[1],ei=on==="inline",si=_.useState(on),ar=(0,W.Z)(si,2),Ui=ar[0],Cr=ar[1],or=_.useState(Kn),as=(0,W.Z)(or,2),$i=as[0],os=as[1];_.useEffect(function(){Cr(on),os(Kn),fr.current&&(ei?Rn(tr):qn(Kt))},[on,Kn]);var Ms=_.useState(0),Vr=(0,W.Z)(Ms,2),Sr=Vr[0],ls=Vr[1],Ir=Sr>=pi.length-1||Ui!=="horizontal"||gn;_.useEffect(function(){ei&&gr(Yn)},[Yn]),_.useEffect(function(){return fr.current=!0,function(){fr.current=!1}},[]);var hr=de(),kr=hr.registerPath,$r=hr.unregisterPath,us=hr.refreshOverflowKeys,Zi=hr.isSubPathKey,cs=hr.getKeyPath,Pr=hr.getKeys,fs=hr.getSubPathKeys,Ns=_.useMemo(function(){return{registerPath:kr,unregisterPath:$r}},[kr,$r]),Bs=_.useMemo(function(){return{isSubPathKey:Zi}},[Zi]);_.useEffect(function(){us(Ir?Kt:pi.slice(Sr+1).map(function(st){return st.key}))},[Sr,Ir]);var Us=(0,G.Z)(xn||ii&&((ht=pi[0])===null||ht===void 0?void 0:ht.key),{value:xn}),hs=(0,W.Z)(Us,2),mr=hs[0],Or=hs[1],Zr=ze(function(st){Or(st)}),ds=ze(function(){Or(void 0)});(0,_.useImperativeHandle)(Je,function(){return{list:Ni.current,focus:function(zn){var ti,ki=Pr(),Ki=Le(ki,hi),_r=Ki.elements,Mr=Ki.key2element,Ws=Ki.element2key,vs=be(Ni.current,_r),Nr=mr!=null?mr:vs[0]?Ws.get(vs[0]):(ti=pi.find(function(Hs){return!Hs.props.disabled}))===null||ti===void 0?void 0:ti.key,nr=Mr.get(Nr);if(Nr&&nr){var lr;nr==null||(lr=nr.focus)===null||lr===void 0||lr.call(nr,zn)}}}});var ps=(0,G.Z)(Xn||[],{value:Ei,postState:function(zn){return Array.isArray(zn)?zn:zn==null?Kt:[zn]}}),Yr=(0,W.Z)(ps,2),Ar=Yr[0],gs=Yr[1],wr=function(zn){if(Nn){var ti=zn.key,ki=Ar.includes(ti),Ki;Zn?ki?Ki=Ar.filter(function(Mr){return Mr!==ti}):Ki=[].concat((0,ee.Z)(Ar),[ti]):Ki=[ti],gs(Ki);var _r=(0,xe.Z)((0,xe.Z)({},zn),{},{selectedKeys:Ki});ki?Vn==null||Vn(_r):Un==null||Un(_r)}!Zn&&Yn.length&&Ui!=="inline"&&qn(Kt)},Ks=ze(function(st){$t==null||$t(He(st)),wr(st)}),Xr=ze(function(st,zn){var ti=Yn.filter(function(Ki){return Ki!==st});if(zn)ti.push(st);else if(Ui!=="inline"){var ki=fs(st);ti=ti.filter(function(Ki){return!ki.has(Ki)})}(0,A.Z)(Yn,ti,!0)||qn(ti,!0)}),ms=function(zn,ti){var ki=ti!=null?ti:!Yn.includes(zn);Xr(zn,ki)},Gs=Ne(Ui,mr,Bi,hi,Ni,Pr,cs,Or,ms,Si);_.useEffect(function(){Mi(!0)},[]);var _s=_.useMemo(function(){return{_internalRenderMenuItem:Dn,_internalRenderSubMenuItem:qt}},[Dn,qt]),Fr=Ui!=="horizontal"||gn?pi:pi.map(function(st,zn){return _.createElement(z,{key:st.key,overflowDisabled:zn>Sr},st)}),zs=_.createElement(l.Z,(0,E.Z)({id:En,ref:Ni,prefixCls:"".concat(xt,"-overflow"),component:"ul",itemComponent:pe,className:Y()(xt,"".concat(xt,"-root"),"".concat(xt,"-").concat(Ui),yn,(0,le.Z)((0,le.Z)({},"".concat(xt,"-inline-collapsed"),$i),"".concat(xt,"-rtl"),Bi),It),dir:ln,style:Wt,role:"menu",tabIndex:Fn,data:Fr,renderRawItem:function(zn){return zn},renderRawRest:function(zn){var ti=zn.length,ki=ti?pi.slice(-ti):null;return _.createElement(Pt,{eventKey:Fe,title:ci,disabled:Ir,internalPopupClose:ti===0,popupClassName:_i},ki)},maxCount:Ui!=="horizontal"||gn?l.Z.INVALIDATE:l.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(zn){ls(zn)},onKeyDown:Gs},an));return _.createElement(M.Provider,{value:_s},_.createElement(b.Provider,{value:hi},_.createElement(z,{prefixCls:xt,rootClassName:It,mode:Ui,openKeys:Yn,rtl:Bi,disabled:kn,motion:Li?li:null,defaultMotions:Li?Ai:null,activeKey:mr,onActive:Zr,onInactive:ds,selectedKeys:Ar,inlineIndent:Ci,subMenuOpenDelay:Ln,subMenuCloseDelay:cn,forceSubMenuRender:Pn,builtinPlacements:Ii,triggerSubMenuAction:oi,getPopupContainer:Ri,itemIcon:xi,expandIcon:Qn,onItemClick:Ks,onOpenChange:Xr},_.createElement(re.Provider,{value:Bs},zs),_.createElement("div",{style:{display:"none"},"aria-hidden":!0},_.createElement(ne.Provider,{value:Ns},gi)))))}),vn=_n,jt=vn;jt.Item=pe,jt.SubMenu=Pt,jt.ItemGroup=Sn,jt.Divider=un;var Mt=jt},11780:function(Ut,ft,R){"use strict";R.d(ft,{Z:function(){return U}});var E=R(67711),le=R(98506),xe=R(16886),ee=R(33346),W=R(59301),p=R(92310),ue=R.n(p),Y=R(29301),l=R(34280),G=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],A=void 0;function m(g,d){var D=g.prefixCls,$=g.invalidate,he=g.item,Se=g.renderItem,qe=g.responsive,Ue=g.responsiveDisabled,nt=g.registerSize,et=g.itemKey,Pe=g.className,Lt=g.style,Me=g.children,mt=g.display,ke=g.order,Tt=g.component,ye=Tt===void 0?"div":Tt,be=(0,ee.Z)(g,G),q=qe&&!mt;function Le(Ee){nt(et,Ee)}W.useEffect(function(){return function(){Le(null)}},[]);var Ne=Se&&he!==A?Se(he,{index:ke}):Me,Qe;$||(Qe={opacity:q?0:1,height:q?0:A,overflowY:q?"hidden":A,order:qe?ke:A,pointerEvents:q?"none":A,position:q?"absolute":A});var V={};q&&(V["aria-hidden"]=!0);var se=W.createElement(ye,(0,E.Z)({className:ue()(!$&&D,Pe),style:(0,le.Z)((0,le.Z)({},Qe),Lt)},V,be,{ref:d}),Ne);return qe&&(se=W.createElement(Y.Z,{onResize:function(Fe){var de=Fe.offsetWidth;Le(de)},disabled:Ue},se)),se}var _=W.forwardRef(m);_.displayName="Item";var y=_,b=R(6089),F=R(4676),K=R(16089);function H(g){if(typeof MessageChannel=="undefined")(0,K.Z)(g);else{var d=new MessageChannel;d.port1.onmessage=function(){return g()},d.port2.postMessage(void 0)}}function L(){var g=W.useRef(null),d=function($){g.current||(g.current=[],H(function(){(0,F.unstable_batchedUpdates)(function(){g.current.forEach(function(he){he()}),g.current=null})})),g.current.push($)};return d}function O(g,d){var D=W.useState(d),$=(0,xe.Z)(D,2),he=$[0],Se=$[1],qe=(0,b.Z)(function(Ue){g(function(){Se(Ue)})});return[he,qe]}var k=W.createContext(null),z=["component"],J=["className"],ne=["className"],Z=function(d,D){var $=W.useContext(k);if(!$){var he=d.component,Se=he===void 0?"div":he,qe=(0,ee.Z)(d,z);return W.createElement(Se,(0,E.Z)({},qe,{ref:D}))}var Ue=$.className,nt=(0,ee.Z)($,J),et=d.className,Pe=(0,ee.Z)(d,ne);return W.createElement(k.Provider,{value:null},W.createElement(y,(0,E.Z)({ref:D,className:ue()(Ue,et)},nt,Pe)))},ae=W.forwardRef(Z);ae.displayName="RawItem";var oe=ae,re=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Re="responsive",M="invalidate";function w(g){return"+ ".concat(g.length," ...")}function T(g,d){var D=g.prefixCls,$=D===void 0?"rc-overflow":D,he=g.data,Se=he===void 0?[]:he,qe=g.renderItem,Ue=g.renderRawItem,nt=g.itemKey,et=g.itemWidth,Pe=et===void 0?10:et,Lt=g.ssr,Me=g.style,mt=g.className,ke=g.maxCount,Tt=g.renderRest,ye=g.renderRawRest,be=g.suffix,q=g.component,Le=q===void 0?"div":q,Ne=g.itemComponent,Qe=g.onVisibleChange,V=(0,ee.Z)(g,re),se=Lt==="full",Ee=L(),Fe=O(Ee,null),de=(0,xe.Z)(Fe,2),ze=de[0],rt=de[1],We=ze||0,ut=O(Ee,new Map),Ve=(0,xe.Z)(ut,2),At=Ve[0],vt=Ve[1],ge=O(Ee,0),Ae=(0,xe.Z)(ge,2),Ze=Ae[0],tt=Ae[1],Ke=O(Ee,0),pt=(0,xe.Z)(Ke,2),gt=pt[0],He=pt[1],bt=O(Ee,0),Ct=(0,xe.Z)(bt,2),it=Ct[0],wt=Ct[1],_e=(0,W.useState)(null),me=(0,xe.Z)(_e,2),pe=me[0],C=me[1],j=(0,W.useState)(null),X=(0,xe.Z)(j,2),te=X[0],fe=X[1],ve=W.useMemo(function(){return te===null&&se?Number.MAX_SAFE_INTEGER:te||0},[te,ze]),Te=(0,W.useState)(!1),Ie=(0,xe.Z)(Te,2),je=Ie[0],_t=Ie[1],Dt="".concat($,"-item"),dt=Math.max(Ze,gt),at=ke===Re,Rt=Se.length&&at,Gt=ke===M,kt=Rt||typeof ke=="number"&&Se.length>ke,Ot=(0,W.useMemo)(function(){var jt=Se;return Rt?ze===null&&se?jt=Se:jt=Se.slice(0,Math.min(Se.length,We/Pe)):typeof ke=="number"&&(jt=Se.slice(0,ke)),jt},[Se,Pe,ze,ke,Rt]),ot=(0,W.useMemo)(function(){return Rt?Se.slice(ve+1):Se.slice(Ot.length)},[Se,Ot,Rt,ve]),Ye=(0,W.useCallback)(function(jt,Mt){var we;return typeof nt=="function"?nt(jt):(we=nt&&(jt==null?void 0:jt[nt]))!==null&&we!==void 0?we:Mt},[nt]),yt=(0,W.useCallback)(qe||function(jt){return jt},[qe]);function Pt(jt,Mt,we){te===jt&&(Mt===void 0||Mt===pe)||(fe(jt),we||(_t(jt<Se.length-1),Qe==null||Qe(jt)),Mt!==void 0&&C(Mt))}function Ht(jt,Mt){rt(Mt.clientWidth)}function un(jt,Mt){vt(function(we){var Je=new Map(we);return Mt===null?Je.delete(jt):Je.set(jt,Mt),Je})}function Bn(jt,Mt){He(Mt),tt(gt)}function fn(jt,Mt){wt(Mt)}function pn(jt){return At.get(Ye(Ot[jt],jt))}(0,l.Z)(function(){if(We&&typeof dt=="number"&&Ot){var jt=it,Mt=Ot.length,we=Mt-1;if(!Mt){Pt(0,null);return}for(var Je=0;Je<Mt;Je+=1){var ht=pn(Je);if(se&&(ht=ht||0),ht===void 0){Pt(Je-1,void 0,!0);break}if(jt+=ht,we===0&&jt<=We||Je===we-1&&jt+pn(we)<=We){Pt(we,null);break}else if(jt+dt>We){Pt(Je-1,jt-ht-it+gt);break}}be&&pn(0)+it>We&&C(null)}},[We,At,gt,it,Ye,Ot]);var Sn=je&&!!ot.length,tn={};pe!==null&&Rt&&(tn={position:"absolute",left:pe,top:0});var On={prefixCls:Dt,responsive:Rt,component:Ne,invalidate:Gt},Tn=Ue?function(jt,Mt){var we=Ye(jt,Mt);return W.createElement(k.Provider,{key:we,value:(0,le.Z)((0,le.Z)({},On),{},{order:Mt,item:jt,itemKey:we,registerSize:un,display:Mt<=ve})},Ue(jt,Mt))}:function(jt,Mt){var we=Ye(jt,Mt);return W.createElement(y,(0,E.Z)({},On,{order:Mt,key:we,item:jt,renderItem:yt,itemKey:we,registerSize:un,display:Mt<=ve}))},ai={order:Sn?ve:Number.MAX_SAFE_INTEGER,className:"".concat(Dt,"-rest"),registerSize:Bn,display:Sn},Kt=Tt||w,_n=ye?W.createElement(k.Provider,{value:(0,le.Z)((0,le.Z)({},On),ai)},ye(ot)):W.createElement(y,(0,E.Z)({},On,ai),typeof Kt=="function"?Kt(ot):Kt),vn=W.createElement(Le,(0,E.Z)({className:ue()(!Gt&&$,mt),style:Me,ref:d},V),Ot.map(Tn),kt?_n:null,be&&W.createElement(y,(0,E.Z)({},On,{responsive:at,responsiveDisabled:!Rt,order:ve,className:"".concat(Dt,"-suffix"),registerSize:fn,display:!0,style:tn}),be));return at?W.createElement(Y.Z,{onResize:Ht,disabled:!Rt},vn):vn}var I=W.forwardRef(T);I.displayName="Overflow",I.Item=oe,I.RESPONSIVE=Re,I.INVALIDATE=M;var N=I,U=N},25930:function(Ut,ft,R){"use strict";R.d(ft,{Cd:function(){return re}});var E=R(67711),le=R(98506),xe=R(33346),ee=R(59301),W=R(92310),p=R.n(W),ue={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},Y=function(){var w=(0,ee.useRef)([]),T=(0,ee.useRef)(null);return(0,ee.useEffect)(function(){var I=Date.now(),N=!1;w.current.forEach(function(U){if(U){N=!0;var g=U.style;g.transitionDuration=".3s, .3s, .3s, .06s",T.current&&I-T.current<100&&(g.transitionDuration="0s, 0s")}}),N&&(T.current=Date.now())}),w.current},l=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],G=function(w){var T=(0,le.Z)((0,le.Z)({},ue),w),I=T.className,N=T.percent,U=T.prefixCls,g=T.strokeColor,d=T.strokeLinecap,D=T.strokeWidth,$=T.style,he=T.trailColor,Se=T.trailWidth,qe=T.transition,Ue=(0,xe.Z)(T,l);delete Ue.gapPosition;var nt=Array.isArray(N)?N:[N],et=Array.isArray(g)?g:[g],Pe=Y(),Lt=D/2,Me=100-D/2,mt="M ".concat(d==="round"?Lt:0,",").concat(Lt,`
|
|
L `).concat(d==="round"?Me:100,",").concat(Lt),ke="0 0 100 ".concat(D),Tt=0;return ee.createElement("svg",(0,E.Z)({className:p()("".concat(U,"-line"),I),viewBox:ke,preserveAspectRatio:"none",style:$},Ue),ee.createElement("path",{className:"".concat(U,"-line-trail"),d:mt,strokeLinecap:d,stroke:he,strokeWidth:Se||D,fillOpacity:"0"}),nt.map(function(ye,be){var q=1;switch(d){case"round":q=1-D/100;break;case"square":q=1-D/2/100;break;default:q=1;break}var Le={strokeDasharray:"".concat(ye*q,"px, 100px"),strokeDashoffset:"-".concat(Tt,"px"),transition:qe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ne=et[be]||et[et.length-1];return Tt+=ye,ee.createElement("path",{key:be,className:"".concat(U,"-line-path"),d:mt,strokeLinecap:d,stroke:Ne,strokeWidth:D,fillOpacity:"0",ref:function(V){Pe[be]=V},style:Le})}))},A=G,m=R(26420),_=R(16886),y=R(47273),b=0,F=(0,y.Z)();function K(){var M;return F?(M=b,b+=1):M="TEST_OR_SSR",M}var H=function(M){var w=ee.useState(),T=(0,_.Z)(w,2),I=T[0],N=T[1];return ee.useEffect(function(){N("rc_progress_".concat(K()))},[]),M||I},L=function(w){var T=w.bg,I=w.children;return ee.createElement("div",{style:{width:"100%",height:"100%",background:T}},I)};function O(M,w){return Object.keys(M).map(function(T){var I=parseFloat(T),N="".concat(Math.floor(I*w),"%");return"".concat(M[T]," ").concat(N)})}var k=ee.forwardRef(function(M,w){var T=M.prefixCls,I=M.color,N=M.gradientId,U=M.radius,g=M.style,d=M.ptg,D=M.strokeLinecap,$=M.strokeWidth,he=M.size,Se=M.gapDegree,qe=I&&(0,m.Z)(I)==="object",Ue=qe?"#FFF":void 0,nt=he/2,et=ee.createElement("circle",{className:"".concat(T,"-circle-path"),r:U,cx:nt,cy:nt,stroke:Ue,strokeLinecap:D,strokeWidth:$,opacity:d===0?0:1,style:g,ref:w});if(!qe)return et;var Pe="".concat(N,"-conic"),Lt=Se?"".concat(180+Se/2,"deg"):"0deg",Me=O(I,(360-Se)/360),mt=O(I,1),ke="conic-gradient(from ".concat(Lt,", ").concat(Me.join(", "),")"),Tt="linear-gradient(to ".concat(Se?"bottom":"top",", ").concat(mt.join(", "),")");return ee.createElement(ee.Fragment,null,ee.createElement("mask",{id:Pe},et),ee.createElement("foreignObject",{x:0,y:0,width:he,height:he,mask:"url(#".concat(Pe,")")},ee.createElement(L,{bg:Tt},ee.createElement(L,{bg:ke}))))}),z=k,J=100,ne=function(w,T,I,N,U,g,d,D,$,he){var Se=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,qe=I/100*360*((360-g)/360),Ue=g===0?0:{bottom:0,top:180,left:90,right:-90}[d],nt=(100-N)/100*T;$==="round"&&N!==100&&(nt+=he/2,nt>=T&&(nt=T-.01));var et=J/2;return{stroke:typeof D=="string"?D:void 0,strokeDasharray:"".concat(T,"px ").concat(w),strokeDashoffset:nt+Se,transform:"rotate(".concat(U+qe+Ue,"deg)"),transformOrigin:"".concat(et,"px ").concat(et,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},Z=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function ae(M){var w=M!=null?M:[];return Array.isArray(w)?w:[w]}var oe=function(w){var T=(0,le.Z)((0,le.Z)({},ue),w),I=T.id,N=T.prefixCls,U=T.steps,g=T.strokeWidth,d=T.trailWidth,D=T.gapDegree,$=D===void 0?0:D,he=T.gapPosition,Se=T.trailColor,qe=T.strokeLinecap,Ue=T.style,nt=T.className,et=T.strokeColor,Pe=T.percent,Lt=(0,xe.Z)(T,Z),Me=J/2,mt=H(I),ke="".concat(mt,"-gradient"),Tt=Me-g/2,ye=Math.PI*2*Tt,be=$>0?90+$/2:-90,q=ye*((360-$)/360),Le=(0,m.Z)(U)==="object"?U:{count:U,gap:2},Ne=Le.count,Qe=Le.gap,V=ae(Pe),se=ae(et),Ee=se.find(function(Ve){return Ve&&(0,m.Z)(Ve)==="object"}),Fe=Ee&&(0,m.Z)(Ee)==="object",de=Fe?"butt":qe,ze=ne(ye,q,0,100,be,$,he,Se,de,g),rt=Y(),We=function(){var At=0;return V.map(function(vt,ge){var Ae=se[ge]||se[se.length-1],Ze=ne(ye,q,At,vt,be,$,he,Ae,de,g);return At+=vt,ee.createElement(z,{key:ge,color:Ae,ptg:vt,radius:Tt,prefixCls:N,gradientId:ke,style:Ze,strokeLinecap:de,strokeWidth:g,gapDegree:$,ref:function(Ke){rt[ge]=Ke},size:J})}).reverse()},ut=function(){var At=Math.round(Ne*(V[0]/100)),vt=100/Ne,ge=0;return new Array(Ne).fill(null).map(function(Ae,Ze){var tt=Ze<=At-1?se[0]:Se,Ke=tt&&(0,m.Z)(tt)==="object"?"url(#".concat(ke,")"):void 0,pt=ne(ye,q,ge,vt,be,$,he,tt,"butt",g,Qe);return ge+=(q-pt.strokeDashoffset+Qe)*100/q,ee.createElement("circle",{key:Ze,className:"".concat(N,"-circle-path"),r:Tt,cx:Me,cy:Me,stroke:Ke,strokeWidth:g,opacity:1,style:pt,ref:function(He){rt[Ze]=He}})})};return ee.createElement("svg",(0,E.Z)({className:p()("".concat(N,"-circle"),nt),viewBox:"0 0 ".concat(J," ").concat(J),style:Ue,id:I,role:"presentation"},Lt),!Ne&&ee.createElement("circle",{className:"".concat(N,"-circle-trail"),r:Tt,cx:Me,cy:Me,stroke:Se,strokeLinecap:de,strokeWidth:d||g,style:ze}),Ne?ut():We())},re=oe,Re={Line:A,Circle:re}},738:function(Ut,ft,R){"use strict";R.d(ft,{Z:function(){return O}});var E=R(67711),le=R(52873),xe=R(16886),ee=R(33346),W=R(92310),p=R.n(W),ue=R(18929),Y=R(10228),l=R(26112),G=R(59301);function A(k,z){var J=k.disabled,ne=k.prefixCls,Z=k.character,ae=k.characterRender,oe=k.index,re=k.count,Re=k.value,M=k.allowHalf,w=k.focused,T=k.onHover,I=k.onClick,N=function(qe){T(qe,oe)},U=function(qe){I(qe,oe)},g=function(qe){qe.keyCode===Y.Z.ENTER&&I(qe,oe)},d=oe+1,D=new Set([ne]);Re===0&&oe===0&&w?D.add("".concat(ne,"-focused")):M&&Re+.5>=d&&Re<d?(D.add("".concat(ne,"-half")),D.add("".concat(ne,"-active")),w&&D.add("".concat(ne,"-focused"))):(d<=Re?D.add("".concat(ne,"-full")):D.add("".concat(ne,"-zero")),d===Re&&w&&D.add("".concat(ne,"-focused")));var $=typeof Z=="function"?Z(k):Z,he=G.createElement("li",{className:p()(Array.from(D)),ref:z},G.createElement("div",{onClick:J?null:U,onKeyDown:J?null:g,onMouseMove:J?null:N,role:"radio","aria-checked":Re>oe?"true":"false","aria-posinset":oe+1,"aria-setsize":re,tabIndex:J?-1:0},G.createElement("div",{className:"".concat(ne,"-first")},$),G.createElement("div",{className:"".concat(ne,"-second")},$)));return ae&&(he=ae(he,k)),he}var m=G.forwardRef(A);function _(){var k=G.useRef({});function z(ne){return k.current[ne]}function J(ne){return function(Z){k.current[ne]=Z}}return[z,J]}function y(k){var z=k.pageXOffset,J="scrollLeft";if(typeof z!="number"){var ne=k.document;z=ne.documentElement[J],typeof z!="number"&&(z=ne.body[J])}return z}function b(k){var z,J,ne=k.ownerDocument,Z=ne.body,ae=ne&&ne.documentElement,oe=k.getBoundingClientRect();return z=oe.left,J=oe.top,z-=ae.clientLeft||Z.clientLeft||0,J-=ae.clientTop||Z.clientTop||0,{left:z,top:J}}function F(k){var z=b(k),J=k.ownerDocument,ne=J.defaultView||J.parentWindow;return z.left+=y(ne),z.left}var K=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function H(k,z){var J=k.prefixCls,ne=J===void 0?"rc-rate":J,Z=k.className,ae=k.defaultValue,oe=k.value,re=k.count,Re=re===void 0?5:re,M=k.allowHalf,w=M===void 0?!1:M,T=k.allowClear,I=T===void 0?!0:T,N=k.keyboard,U=N===void 0?!0:N,g=k.character,d=g===void 0?"\u2605":g,D=k.characterRender,$=k.disabled,he=k.direction,Se=he===void 0?"ltr":he,qe=k.tabIndex,Ue=qe===void 0?0:qe,nt=k.autoFocus,et=k.onHoverChange,Pe=k.onChange,Lt=k.onFocus,Me=k.onBlur,mt=k.onKeyDown,ke=k.onMouseLeave,Tt=(0,ee.Z)(k,K),ye=_(),be=(0,xe.Z)(ye,2),q=be[0],Le=be[1],Ne=G.useRef(null),Qe=function(){if(!$){var C;(C=Ne.current)===null||C===void 0||C.focus()}};G.useImperativeHandle(z,function(){return{focus:Qe,blur:function(){if(!$){var C;(C=Ne.current)===null||C===void 0||C.blur()}}}});var V=(0,ue.Z)(ae||0,{value:oe}),se=(0,xe.Z)(V,2),Ee=se[0],Fe=se[1],de=(0,ue.Z)(null),ze=(0,xe.Z)(de,2),rt=ze[0],We=ze[1],ut=function(C,j){var X=Se==="rtl",te=C+1;if(w){var fe=q(C),ve=F(fe),Te=fe.clientWidth;(X&&j-ve>Te/2||!X&&j-ve<Te/2)&&(te-=.5)}return te},Ve=function(C){Fe(C),Pe==null||Pe(C)},At=G.useState(!1),vt=(0,xe.Z)(At,2),ge=vt[0],Ae=vt[1],Ze=function(){Ae(!0),Lt==null||Lt()},tt=function(){Ae(!1),Me==null||Me()},Ke=G.useState(null),pt=(0,xe.Z)(Ke,2),gt=pt[0],He=pt[1],bt=function(C,j){var X=ut(j,C.pageX);X!==rt&&(He(X),We(null)),et==null||et(X)},Ct=function(C){$||(He(null),We(null),et==null||et(void 0)),C&&(ke==null||ke(C))},it=function(C,j){var X=ut(j,C.pageX),te=!1;I&&(te=X===Ee),Ct(),Ve(te?0:X),We(te?X:null)},wt=function(C){var j=C.keyCode,X=Se==="rtl",te=w?.5:1;U&&(j===Y.Z.RIGHT&&Ee<Re&&!X?(Ve(Ee+te),C.preventDefault()):j===Y.Z.LEFT&&Ee>0&&!X||j===Y.Z.RIGHT&&Ee>0&&X?(Ve(Ee-te),C.preventDefault()):j===Y.Z.LEFT&&Ee<Re&&X&&(Ve(Ee+te),C.preventDefault())),mt==null||mt(C)};G.useEffect(function(){nt&&!$&&Qe()},[]);var _e=new Array(Re).fill(0).map(function(pe,C){return G.createElement(m,{ref:Le(C),index:C,count:Re,disabled:$,prefixCls:"".concat(ne,"-star"),allowHalf:w,value:gt===null?Ee:gt,onClick:it,onHover:bt,key:pe||C,character:d,characterRender:D,focused:ge})}),me=p()(ne,Z,(0,le.Z)((0,le.Z)({},"".concat(ne,"-disabled"),$),"".concat(ne,"-rtl"),Se==="rtl"));return G.createElement("ul",(0,E.Z)({className:me,onMouseLeave:Ct,tabIndex:$?-1:Ue,onFocus:$?null:Ze,onBlur:$?null:tt,onKeyDown:$?null:wt,ref:Ne},(0,l.Z)(Tt,{aria:!0,data:!0,attr:!0})),_e)}var L=G.forwardRef(H),O=L},29301:function(Ut,ft,R){"use strict";R.d(ft,{Z:function(){return M}});var E=R(67711),le=R(59301),xe=R(11592),ee=R(48736),W=R(98506),p=R(26420),ue=R(76846),Y=R(8654),l=le.createContext(null);function G(w){var T=w.children,I=w.onBatchResize,N=le.useRef(0),U=le.useRef([]),g=le.useContext(l),d=le.useCallback(function(D,$,he){N.current+=1;var Se=N.current;U.current.push({size:D,element:$,data:he}),Promise.resolve().then(function(){Se===N.current&&(I==null||I(U.current),U.current=[])}),g==null||g(D,$,he)},[I,g]);return le.createElement(l.Provider,{value:d},T)}var A=R(76374),m=new Map;function _(w){w.forEach(function(T){var I,N=T.target;(I=m.get(N))===null||I===void 0||I.forEach(function(U){return U(N)})})}var y=new A.Z(_),b=null,F=null;function K(w,T){m.has(w)||(m.set(w,new Set),y.observe(w)),m.get(w).add(T)}function H(w,T){m.has(w)&&(m.get(w).delete(T),m.get(w).size||(y.unobserve(w),m.delete(w)))}var L=R(42573),O=R(58698),k=R(74700),z=R(45080),J=function(w){(0,k.Z)(I,w);var T=(0,z.Z)(I);function I(){return(0,L.Z)(this,I),T.apply(this,arguments)}return(0,O.Z)(I,[{key:"render",value:function(){return this.props.children}}]),I}(le.Component);function ne(w,T){var I=w.children,N=w.disabled,U=le.useRef(null),g=le.useRef(null),d=le.useContext(l),D=typeof I=="function",$=D?I(U):I,he=le.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Se=!D&&le.isValidElement($)&&(0,Y.Yr)($),qe=Se?(0,Y.C4)($):null,Ue=(0,Y.x1)(qe,U),nt=function(){var Me;return(0,ue.ZP)(U.current)||(U.current&&(0,p.Z)(U.current)==="object"?(0,ue.ZP)((Me=U.current)===null||Me===void 0?void 0:Me.nativeElement):null)||(0,ue.ZP)(g.current)};le.useImperativeHandle(T,function(){return nt()});var et=le.useRef(w);et.current=w;var Pe=le.useCallback(function(Lt){var Me=et.current,mt=Me.onResize,ke=Me.data,Tt=Lt.getBoundingClientRect(),ye=Tt.width,be=Tt.height,q=Lt.offsetWidth,Le=Lt.offsetHeight,Ne=Math.floor(ye),Qe=Math.floor(be);if(he.current.width!==Ne||he.current.height!==Qe||he.current.offsetWidth!==q||he.current.offsetHeight!==Le){var V={width:Ne,height:Qe,offsetWidth:q,offsetHeight:Le};he.current=V;var se=q===Math.round(ye)?ye:q,Ee=Le===Math.round(be)?be:Le,Fe=(0,W.Z)((0,W.Z)({},V),{},{offsetWidth:se,offsetHeight:Ee});d==null||d(Fe,Lt,ke),mt&&Promise.resolve().then(function(){mt(Fe,Lt)})}},[]);return le.useEffect(function(){var Lt=nt();return Lt&&!N&&K(Lt,Pe),function(){return H(Lt,Pe)}},[U.current,N]),le.createElement(J,{ref:g},Se?le.cloneElement($,{ref:Ue}):$)}var Z=le.forwardRef(ne),ae=Z,oe="rc-observer-key";function re(w,T){var I=w.children,N=typeof I=="function"?[I]:(0,xe.Z)(I);return N.map(function(U,g){var d=(U==null?void 0:U.key)||"".concat(oe,"-").concat(g);return le.createElement(ae,(0,E.Z)({},w,{key:d,ref:g===0?T:void 0}),U)})}var Re=le.forwardRef(re);Re.Collection=G;var M=Re},29443:function(Ut,ft,R){"use strict";R.d(ft,{Z:function(){return vt}});var E=R(67711),le=R(52873),xe=R(98506),ee=R(16886),W=R(26420),p=R(33346),ue=R(92310),Y=R.n(ue),l=R(18929),G=R(49658),A=R(59301),m=(0,A.createContext)(null),_=R(15142),y=R(29301),b=R(6089),F=R(8654),K=R(16089),H=function(Ae){var Ze=Ae.activeTabOffset,tt=Ae.horizontal,Ke=Ae.rtl,pt=Ae.indicator,gt=pt===void 0?{}:pt,He=gt.size,bt=gt.align,Ct=bt===void 0?"center":bt,it=(0,A.useState)(),wt=(0,ee.Z)(it,2),_e=wt[0],me=wt[1],pe=(0,A.useRef)(),C=A.useCallback(function(X){return typeof He=="function"?He(X):typeof He=="number"?He:X},[He]);function j(){K.Z.cancel(pe.current)}return(0,A.useEffect)(function(){var X={};if(Ze)if(tt){X.width=C(Ze.width);var te=Ke?"right":"left";Ct==="start"&&(X[te]=Ze[te]),Ct==="center"&&(X[te]=Ze[te]+Ze.width/2,X.transform=Ke?"translateX(50%)":"translateX(-50%)"),Ct==="end"&&(X[te]=Ze[te]+Ze.width,X.transform="translateX(-100%)")}else X.height=C(Ze.height),Ct==="start"&&(X.top=Ze.top),Ct==="center"&&(X.top=Ze.top+Ze.height/2,X.transform="translateY(-50%)"),Ct==="end"&&(X.top=Ze.top+Ze.height,X.transform="translateY(-100%)");return j(),pe.current=(0,K.Z)(function(){me(X)}),j},[Ze,tt,Ke,Ct,C]),{style:_e}},L=H,O={width:0,height:0,left:0,top:0};function k(ge,Ae,Ze){return(0,A.useMemo)(function(){for(var tt,Ke=new Map,pt=Ae.get((tt=ge[0])===null||tt===void 0?void 0:tt.key)||O,gt=pt.left+pt.width,He=0;He<ge.length;He+=1){var bt=ge[He].key,Ct=Ae.get(bt);if(!Ct){var it;Ct=Ae.get((it=ge[He-1])===null||it===void 0?void 0:it.key)||O}var wt=Ke.get(bt)||(0,xe.Z)({},Ct);wt.right=gt-wt.left-wt.width,Ke.set(bt,wt)}return Ke},[ge.map(function(tt){return tt.key}).join("_"),Ae,Ze])}function z(ge,Ae){var Ze=A.useRef(ge),tt=A.useState({}),Ke=(0,ee.Z)(tt,2),pt=Ke[1];function gt(He){var bt=typeof He=="function"?He(Ze.current):He;bt!==Ze.current&&Ae(bt,Ze.current),Ze.current=bt,pt({})}return[Ze.current,gt]}var J=.1,ne=.01,Z=20,ae=Math.pow(.995,Z);function oe(ge,Ae){var Ze=(0,A.useState)(),tt=(0,ee.Z)(Ze,2),Ke=tt[0],pt=tt[1],gt=(0,A.useState)(0),He=(0,ee.Z)(gt,2),bt=He[0],Ct=He[1],it=(0,A.useState)(0),wt=(0,ee.Z)(it,2),_e=wt[0],me=wt[1],pe=(0,A.useState)(),C=(0,ee.Z)(pe,2),j=C[0],X=C[1],te=(0,A.useRef)();function fe(Dt){var dt=Dt.touches[0],at=dt.screenX,Rt=dt.screenY;pt({x:at,y:Rt}),window.clearInterval(te.current)}function ve(Dt){if(Ke){var dt=Dt.touches[0],at=dt.screenX,Rt=dt.screenY;pt({x:at,y:Rt});var Gt=at-Ke.x,kt=Rt-Ke.y;Ae(Gt,kt);var Ot=Date.now();Ct(Ot),me(Ot-bt),X({x:Gt,y:kt})}}function Te(){if(Ke&&(pt(null),X(null),j)){var Dt=j.x/_e,dt=j.y/_e,at=Math.abs(Dt),Rt=Math.abs(dt);if(Math.max(at,Rt)<J)return;var Gt=Dt,kt=dt;te.current=window.setInterval(function(){if(Math.abs(Gt)<ne&&Math.abs(kt)<ne){window.clearInterval(te.current);return}Gt*=ae,kt*=ae,Ae(Gt*Z,kt*Z)},Z)}}var Ie=(0,A.useRef)();function je(Dt){var dt=Dt.deltaX,at=Dt.deltaY,Rt=0,Gt=Math.abs(dt),kt=Math.abs(at);Gt===kt?Rt=Ie.current==="x"?dt:at:Gt>kt?(Rt=dt,Ie.current="x"):(Rt=at,Ie.current="y"),Ae(-Rt,-Rt)&&Dt.preventDefault()}var _t=(0,A.useRef)(null);_t.current={onTouchStart:fe,onTouchMove:ve,onTouchEnd:Te,onWheel:je},A.useEffect(function(){function Dt(Gt){_t.current.onTouchStart(Gt)}function dt(Gt){_t.current.onTouchMove(Gt)}function at(Gt){_t.current.onTouchEnd(Gt)}function Rt(Gt){_t.current.onWheel(Gt)}return document.addEventListener("touchmove",dt,{passive:!1}),document.addEventListener("touchend",at,{passive:!0}),ge.current.addEventListener("touchstart",Dt,{passive:!0}),ge.current.addEventListener("wheel",Rt,{passive:!1}),function(){document.removeEventListener("touchmove",dt),document.removeEventListener("touchend",at)}},[])}var re=R(34280);function Re(ge){var Ae=(0,A.useState)(0),Ze=(0,ee.Z)(Ae,2),tt=Ze[0],Ke=Ze[1],pt=(0,A.useRef)(0),gt=(0,A.useRef)();return gt.current=ge,(0,re.o)(function(){var He;(He=gt.current)===null||He===void 0||He.call(gt)},[tt]),function(){pt.current===tt&&(pt.current+=1,Ke(pt.current))}}function M(ge){var Ae=(0,A.useRef)([]),Ze=(0,A.useState)({}),tt=(0,ee.Z)(Ze,2),Ke=tt[1],pt=(0,A.useRef)(typeof ge=="function"?ge():ge),gt=Re(function(){var bt=pt.current;Ae.current.forEach(function(Ct){bt=Ct(bt)}),Ae.current=[],pt.current=bt,Ke({})});function He(bt){Ae.current.push(bt),gt()}return[pt.current,He]}var w={width:0,height:0,left:0,top:0,right:0};function T(ge,Ae,Ze,tt,Ke,pt,gt){var He=gt.tabs,bt=gt.tabPosition,Ct=gt.rtl,it,wt,_e;return["top","bottom"].includes(bt)?(it="width",wt=Ct?"right":"left",_e=Math.abs(Ze)):(it="height",wt="top",_e=-Ze),(0,A.useMemo)(function(){if(!He.length)return[0,0];for(var me=He.length,pe=me,C=0;C<me;C+=1){var j=ge.get(He[C].key)||w;if(Math.floor(j[wt]+j[it])>Math.floor(_e+Ae)){pe=C-1;break}}for(var X=0,te=me-1;te>=0;te-=1){var fe=ge.get(He[te].key)||w;if(fe[wt]<_e){X=te+1;break}}return X>=pe?[0,0]:[X,pe]},[ge,Ae,tt,Ke,pt,_e,bt,He.map(function(me){return me.key}).join("_"),Ct])}function I(ge){var Ae;return ge instanceof Map?(Ae={},ge.forEach(function(Ze,tt){Ae[tt]=Ze})):Ae=ge,JSON.stringify(Ae)}var N="TABS_DQ";function U(ge){return String(ge).replace(/"/g,N)}function g(ge,Ae,Ze,tt){return!(!Ze||tt||ge===!1||ge===void 0&&(Ae===!1||Ae===null))}var d=A.forwardRef(function(ge,Ae){var Ze=ge.prefixCls,tt=ge.editable,Ke=ge.locale,pt=ge.style;return!tt||tt.showAdd===!1?null:A.createElement("button",{ref:Ae,type:"button",className:"".concat(Ze,"-nav-add"),style:pt,"aria-label":(Ke==null?void 0:Ke.addAriaLabel)||"Add tab",onClick:function(He){tt.onEdit("add",{event:He})}},tt.addIcon||"+")}),D=d,$=A.forwardRef(function(ge,Ae){var Ze=ge.position,tt=ge.prefixCls,Ke=ge.extra;if(!Ke)return null;var pt,gt={};return(0,W.Z)(Ke)==="object"&&!A.isValidElement(Ke)?gt=Ke:gt.right=Ke,Ze==="right"&&(pt=gt.right),Ze==="left"&&(pt=gt.left),pt?A.createElement("div",{className:"".concat(tt,"-extra-content"),ref:Ae},pt):null}),he=$,Se=R(96478),qe=R(28321),Ue=R(10228),nt=A.forwardRef(function(ge,Ae){var Ze=ge.prefixCls,tt=ge.id,Ke=ge.tabs,pt=ge.locale,gt=ge.mobile,He=ge.more,bt=He===void 0?{}:He,Ct=ge.style,it=ge.className,wt=ge.editable,_e=ge.tabBarGutter,me=ge.rtl,pe=ge.removeAriaLabel,C=ge.onTabClick,j=ge.getPopupContainer,X=ge.popupClassName,te=(0,A.useState)(!1),fe=(0,ee.Z)(te,2),ve=fe[0],Te=fe[1],Ie=(0,A.useState)(null),je=(0,ee.Z)(Ie,2),_t=je[0],Dt=je[1],dt=bt.icon,at=dt===void 0?"More":dt,Rt="".concat(tt,"-more-popup"),Gt="".concat(Ze,"-dropdown"),kt=_t!==null?"".concat(Rt,"-").concat(_t):null,Ot=pt==null?void 0:pt.dropdownAriaLabel;function ot(fn,pn){fn.preventDefault(),fn.stopPropagation(),wt.onEdit("remove",{key:pn,event:fn})}var Ye=A.createElement(qe.ZP,{onClick:function(pn){var Sn=pn.key,tn=pn.domEvent;C(Sn,tn),Te(!1)},prefixCls:"".concat(Gt,"-menu"),id:Rt,tabIndex:-1,role:"listbox","aria-activedescendant":kt,selectedKeys:[_t],"aria-label":Ot!==void 0?Ot:"expanded dropdown"},Ke.map(function(fn){var pn=fn.closable,Sn=fn.disabled,tn=fn.closeIcon,On=fn.key,Tn=fn.label,ai=g(pn,tn,wt,Sn);return A.createElement(qe.sN,{key:On,id:"".concat(Rt,"-").concat(On),role:"option","aria-controls":tt&&"".concat(tt,"-panel-").concat(On),disabled:Sn},A.createElement("span",null,Tn),ai&&A.createElement("button",{type:"button","aria-label":pe||"remove",tabIndex:0,className:"".concat(Gt,"-menu-item-remove"),onClick:function(_n){_n.stopPropagation(),ot(_n,On)}},tn||wt.removeIcon||"\xD7"))}));function yt(fn){for(var pn=Ke.filter(function(ai){return!ai.disabled}),Sn=pn.findIndex(function(ai){return ai.key===_t})||0,tn=pn.length,On=0;On<tn;On+=1){Sn=(Sn+fn+tn)%tn;var Tn=pn[Sn];if(!Tn.disabled){Dt(Tn.key);return}}}function Pt(fn){var pn=fn.which;if(!ve){[Ue.Z.DOWN,Ue.Z.SPACE,Ue.Z.ENTER].includes(pn)&&(Te(!0),fn.preventDefault());return}switch(pn){case Ue.Z.UP:yt(-1),fn.preventDefault();break;case Ue.Z.DOWN:yt(1),fn.preventDefault();break;case Ue.Z.ESC:Te(!1);break;case Ue.Z.SPACE:case Ue.Z.ENTER:_t!==null&&C(_t,fn);break}}(0,A.useEffect)(function(){var fn=document.getElementById(kt);fn&&fn.scrollIntoView&&fn.scrollIntoView(!1)},[_t]),(0,A.useEffect)(function(){ve||Dt(null)},[ve]);var Ht=(0,le.Z)({},me?"marginRight":"marginLeft",_e);Ke.length||(Ht.visibility="hidden",Ht.order=1);var un=Y()((0,le.Z)({},"".concat(Gt,"-rtl"),me)),Bn=gt?null:A.createElement(Se.Z,(0,E.Z)({prefixCls:Gt,overlay:Ye,visible:Ke.length?ve:!1,onVisibleChange:Te,overlayClassName:Y()(un,X),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:j},bt),A.createElement("button",{type:"button",className:"".concat(Ze,"-nav-more"),style:Ht,"aria-haspopup":"listbox","aria-controls":Rt,id:"".concat(tt,"-more"),"aria-expanded":ve,onKeyDown:Pt},at));return A.createElement("div",{className:Y()("".concat(Ze,"-nav-operations"),it),style:Ct,ref:Ae},Bn,A.createElement(D,{prefixCls:Ze,locale:pt,editable:wt}))}),et=A.memo(nt,function(ge,Ae){return Ae.tabMoving}),Pe=function(Ae){var Ze=Ae.prefixCls,tt=Ae.id,Ke=Ae.active,pt=Ae.focus,gt=Ae.tab,He=gt.key,bt=gt.label,Ct=gt.disabled,it=gt.closeIcon,wt=gt.icon,_e=Ae.closable,me=Ae.renderWrapper,pe=Ae.removeAriaLabel,C=Ae.editable,j=Ae.onClick,X=Ae.onFocus,te=Ae.onBlur,fe=Ae.onKeyDown,ve=Ae.onMouseDown,Te=Ae.onMouseUp,Ie=Ae.style,je=Ae.tabCount,_t=Ae.currentPosition,Dt="".concat(Ze,"-tab"),dt=g(_e,it,C,Ct);function at(ot){Ct||j(ot)}function Rt(ot){ot.preventDefault(),ot.stopPropagation(),C.onEdit("remove",{key:He,event:ot})}var Gt=A.useMemo(function(){return wt&&typeof bt=="string"?A.createElement("span",null,bt):bt},[bt,wt]),kt=A.useRef(null);A.useEffect(function(){pt&&kt.current&&kt.current.focus()},[pt]);var Ot=A.createElement("div",{key:He,"data-node-key":U(He),className:Y()(Dt,(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},"".concat(Dt,"-with-remove"),dt),"".concat(Dt,"-active"),Ke),"".concat(Dt,"-disabled"),Ct),"".concat(Dt,"-focus"),pt)),style:Ie,onClick:at},A.createElement("div",{ref:kt,role:"tab","aria-selected":Ke,id:tt&&"".concat(tt,"-tab-").concat(He),className:"".concat(Dt,"-btn"),"aria-controls":tt&&"".concat(tt,"-panel-").concat(He),"aria-disabled":Ct,tabIndex:Ct?null:Ke?0:-1,onClick:function(Ye){Ye.stopPropagation(),at(Ye)},onKeyDown:fe,onMouseDown:ve,onMouseUp:Te,onFocus:X,onBlur:te},pt&&A.createElement("div",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"Tab ".concat(_t," of ").concat(je)),wt&&A.createElement("span",{className:"".concat(Dt,"-icon")},wt),bt&&Gt),dt&&A.createElement("button",{type:"button",role:"tab","aria-label":pe||"remove",tabIndex:Ke?0:-1,className:"".concat(Dt,"-remove"),onClick:function(Ye){Ye.stopPropagation(),Rt(Ye)}},it||C.removeIcon||"\xD7"));return me?me(Ot):Ot},Lt=Pe,Me=function(Ae,Ze){var tt=Ae.offsetWidth,Ke=Ae.offsetHeight,pt=Ae.offsetTop,gt=Ae.offsetLeft,He=Ae.getBoundingClientRect(),bt=He.width,Ct=He.height,it=He.left,wt=He.top;return Math.abs(bt-tt)<1?[bt,Ct,it-Ze.left,wt-Ze.top]:[tt,Ke,gt,pt]},mt=function(Ae){var Ze=Ae.current||{},tt=Ze.offsetWidth,Ke=tt===void 0?0:tt,pt=Ze.offsetHeight,gt=pt===void 0?0:pt;if(Ae.current){var He=Ae.current.getBoundingClientRect(),bt=He.width,Ct=He.height;if(Math.abs(bt-Ke)<1)return[bt,Ct]}return[Ke,gt]},ke=function(Ae,Ze){return Ae[Ze?0:1]},Tt=A.forwardRef(function(ge,Ae){var Ze=ge.className,tt=ge.style,Ke=ge.id,pt=ge.animated,gt=ge.activeKey,He=ge.rtl,bt=ge.extra,Ct=ge.editable,it=ge.locale,wt=ge.tabPosition,_e=ge.tabBarGutter,me=ge.children,pe=ge.onTabClick,C=ge.onTabScroll,j=ge.indicator,X=A.useContext(m),te=X.prefixCls,fe=X.tabs,ve=(0,A.useRef)(null),Te=(0,A.useRef)(null),Ie=(0,A.useRef)(null),je=(0,A.useRef)(null),_t=(0,A.useRef)(null),Dt=(0,A.useRef)(null),dt=(0,A.useRef)(null),at=wt==="top"||wt==="bottom",Rt=z(0,function(Dn,qt){at&&C&&C({direction:Dn>qt?"left":"right"})}),Gt=(0,ee.Z)(Rt,2),kt=Gt[0],Ot=Gt[1],ot=z(0,function(Dn,qt){!at&&C&&C({direction:Dn>qt?"top":"bottom"})}),Ye=(0,ee.Z)(ot,2),yt=Ye[0],Pt=Ye[1],Ht=(0,A.useState)([0,0]),un=(0,ee.Z)(Ht,2),Bn=un[0],fn=un[1],pn=(0,A.useState)([0,0]),Sn=(0,ee.Z)(pn,2),tn=Sn[0],On=Sn[1],Tn=(0,A.useState)([0,0]),ai=(0,ee.Z)(Tn,2),Kt=ai[0],_n=ai[1],vn=(0,A.useState)([0,0]),jt=(0,ee.Z)(vn,2),Mt=jt[0],we=jt[1],Je=M(new Map),ht=(0,ee.Z)(Je,2),lt=ht[0],Et=ht[1],xt=k(fe,lt,tn[0]),It=ke(Bn,at),Wt=ke(tn,at),yn=ke(Kt,at),nn=ke(Mt,at),Fn=Math.floor(It)<Math.floor(Wt+yn),Qt=Fn?It-nn:It-yn,en="".concat(te,"-nav-operations-hidden"),ln=0,En=0;at&&He?(ln=0,En=Math.max(0,Wt-Qt)):(ln=Math.min(0,Qt-Wt),En=0);function An(Dn){return Dn<ln?ln:Dn>En?En:Dn}var Jt=(0,A.useRef)(null),rn=(0,A.useState)(),kn=(0,ee.Z)(rn,2),gn=kn[0],mn=kn[1];function Ln(){mn(Date.now())}function wn(){Jt.current&&clearTimeout(Jt.current)}oe(je,function(Dn,qt){function Cn(an,yi){an(function(fi){var pi=An(fi+yi);return pi})}return Fn?(at?Cn(Ot,Dn):Cn(Pt,qt),wn(),Ln(),!0):!1}),(0,A.useEffect)(function(){return wn(),gn&&(Jt.current=setTimeout(function(){mn(0)},100)),wn},[gn]);var cn=T(xt,Qt,at?kt:yt,Wt,yn,nn,(0,xe.Z)((0,xe.Z)({},ge),{},{tabs:fe})),Pn=(0,ee.Z)(cn,2),Hn=Pn[0],ni=Pn[1],xn=(0,b.Z)(function(){var Dn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gt,qt=xt.get(Dn)||{width:0,height:0,left:0,right:0,top:0};if(at){var Cn=kt;He?qt.right<kt?Cn=qt.right:qt.right+qt.width>kt+Qt&&(Cn=qt.right+qt.width-Qt):qt.left<-kt?Cn=-qt.left:qt.left+qt.width>-kt+Qt&&(Cn=-(qt.left+qt.width-Qt)),Pt(0),Ot(An(Cn))}else{var an=yt;qt.top<-yt?an=-qt.top:qt.top+qt.height>-yt+Qt&&(an=-(qt.top+qt.height-Qt)),Ot(0),Pt(An(an))}}),ii=(0,A.useState)(),ri=(0,ee.Z)(ii,2),Nn=ri[0],$n=ri[1],Zn=(0,A.useState)(!1),Xn=(0,ee.Z)(Zn,2),Ei=Xn[0],Un=Xn[1],Vn=fe.filter(function(Dn){return!Dn.disabled}).map(function(Dn){return Dn.key}),vi=function(qt){var Cn=Vn.indexOf(Nn||gt),an=Vn.length,yi=(Cn+qt+an)%an,fi=Vn[yi];$n(fi)},Ci=function(qt){var Cn=qt.code,an=He&&at,yi=Vn[0],fi=Vn[Vn.length-1];switch(Cn){case"ArrowLeft":{at&&vi(an?1:-1);break}case"ArrowRight":{at&&vi(an?-1:1);break}case"ArrowUp":{qt.preventDefault(),at||vi(-1);break}case"ArrowDown":{qt.preventDefault(),at||vi(1);break}case"Home":{qt.preventDefault(),$n(yi);break}case"End":{qt.preventDefault(),$n(fi);break}case"Enter":case"Space":{qt.preventDefault(),pe(gt,qt);break}case"Backspace":case"Delete":{var pi=Vn.indexOf(Nn),gi=fe.find(function(Ti){return Ti.key===Nn}),Wi=g(gi==null?void 0:gi.closable,gi==null?void 0:gi.closeIcon,Ct,gi==null?void 0:gi.disabled);Wi&&(qt.preventDefault(),qt.stopPropagation(),Ct.onEdit("remove",{key:Nn,event:qt}),pi===Vn.length-1?vi(-1):vi(1));break}}},li={};at?li[He?"marginRight":"marginLeft"]=_e:li.marginTop=_e;var Ai=fe.map(function(Dn,qt){var Cn=Dn.key;return A.createElement(Lt,{id:Ke,prefixCls:te,key:Cn,tab:Dn,style:qt===0?void 0:li,closable:Dn.closable,editable:Ct,active:Cn===gt,focus:Cn===Nn,renderWrapper:me,removeAriaLabel:it==null?void 0:it.removeAriaLabel,tabCount:Vn.length,currentPosition:qt+1,onClick:function(yi){pe(Cn,yi)},onKeyDown:Ci,onFocus:function(){Ei||$n(Cn),xn(Cn),Ln(),je.current&&(He||(je.current.scrollLeft=0),je.current.scrollTop=0)},onBlur:function(){$n(void 0)},onMouseDown:function(){Un(!0)},onMouseUp:function(){Un(!1)}})}),ui=function(){return Et(function(){var qt,Cn=new Map,an=(qt=_t.current)===null||qt===void 0?void 0:qt.getBoundingClientRect();return fe.forEach(function(yi){var fi,pi=yi.key,gi=(fi=_t.current)===null||fi===void 0?void 0:fi.querySelector('[data-node-key="'.concat(U(pi),'"]'));if(gi){var Wi=Me(gi,an),Ti=(0,ee.Z)(Wi,4),Li=Ti[0],Mi=Ti[1],Ni=Ti[2],hi=Ti[3];Cn.set(pi,{width:Li,height:Mi,left:Ni,top:hi})}}),Cn})};(0,A.useEffect)(function(){ui()},[fe.map(function(Dn){return Dn.key}).join("_")]);var oi=Re(function(){var Dn=mt(ve),qt=mt(Te),Cn=mt(Ie);fn([Dn[0]-qt[0]-Cn[0],Dn[1]-qt[1]-Cn[1]]);var an=mt(dt);_n(an);var yi=mt(Dt);we(yi);var fi=mt(_t);On([fi[0]-an[0],fi[1]-an[1]]),ui()}),Ii=fe.slice(0,Hn),xi=fe.slice(ni+1),Qn=[].concat((0,_.Z)(Ii),(0,_.Z)(xi)),Jn=xt.get(gt),ci=L({activeTabOffset:Jn,horizontal:at,indicator:j,rtl:He}),_i=ci.style;(0,A.useEffect)(function(){xn()},[gt,ln,En,I(Jn),I(xt),at]),(0,A.useEffect)(function(){oi()},[He]);var Ri=!!Qn.length,$t="".concat(te,"-nav-wrap"),di,Si,wi,Fi;return at?He?(Si=kt>0,di=kt!==En):(di=kt<0,Si=kt!==ln):(wi=yt<0,Fi=yt!==ln),A.createElement(y.Z,{onResize:oi},A.createElement("div",{ref:(0,F.x1)(Ae,ve),role:"tablist","aria-orientation":at?"horizontal":"vertical",className:Y()("".concat(te,"-nav"),Ze),style:tt,onKeyDown:function(){Ln()}},A.createElement(he,{ref:Te,position:"left",extra:bt,prefixCls:te}),A.createElement(y.Z,{onResize:oi},A.createElement("div",{className:Y()($t,(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},"".concat($t,"-ping-left"),di),"".concat($t,"-ping-right"),Si),"".concat($t,"-ping-top"),wi),"".concat($t,"-ping-bottom"),Fi)),ref:je},A.createElement(y.Z,{onResize:oi},A.createElement("div",{ref:_t,className:"".concat(te,"-nav-list"),style:{transform:"translate(".concat(kt,"px, ").concat(yt,"px)"),transition:gn?"none":void 0}},Ai,A.createElement(D,{ref:dt,prefixCls:te,locale:it,editable:Ct,style:(0,xe.Z)((0,xe.Z)({},Ai.length===0?void 0:li),{},{visibility:Ri?"hidden":null})}),A.createElement("div",{className:Y()("".concat(te,"-ink-bar"),(0,le.Z)({},"".concat(te,"-ink-bar-animated"),pt.inkBar)),style:_i}))))),A.createElement(et,(0,E.Z)({},ge,{removeAriaLabel:it==null?void 0:it.removeAriaLabel,ref:Dt,prefixCls:te,tabs:Qn,className:!Ri&&en,tabMoving:!!gn})),A.createElement(he,{ref:Ie,position:"right",extra:bt,prefixCls:te})))}),ye=Tt,be=A.forwardRef(function(ge,Ae){var Ze=ge.prefixCls,tt=ge.className,Ke=ge.style,pt=ge.id,gt=ge.active,He=ge.tabKey,bt=ge.children;return A.createElement("div",{id:pt&&"".concat(pt,"-panel-").concat(He),role:"tabpanel",tabIndex:gt?0:-1,"aria-labelledby":pt&&"".concat(pt,"-tab-").concat(He),"aria-hidden":!gt,style:Ke,className:Y()(Ze,gt&&"".concat(Ze,"-active"),tt),ref:Ae},bt)}),q=be,Le=["renderTabBar"],Ne=["label","key"],Qe=function(Ae){var Ze=Ae.renderTabBar,tt=(0,p.Z)(Ae,Le),Ke=A.useContext(m),pt=Ke.tabs;if(Ze){var gt=(0,xe.Z)((0,xe.Z)({},tt),{},{panes:pt.map(function(He){var bt=He.label,Ct=He.key,it=(0,p.Z)(He,Ne);return A.createElement(q,(0,E.Z)({tab:bt,key:Ct,tabKey:Ct},it))})});return Ze(gt,ye)}return A.createElement(ye,tt)},V=Qe,se=R(77900),Ee=["key","forceRender","style","className","destroyInactiveTabPane"],Fe=function(Ae){var Ze=Ae.id,tt=Ae.activeKey,Ke=Ae.animated,pt=Ae.tabPosition,gt=Ae.destroyInactiveTabPane,He=A.useContext(m),bt=He.prefixCls,Ct=He.tabs,it=Ke.tabPane,wt="".concat(bt,"-tabpane");return A.createElement("div",{className:Y()("".concat(bt,"-content-holder"))},A.createElement("div",{className:Y()("".concat(bt,"-content"),"".concat(bt,"-content-").concat(pt),(0,le.Z)({},"".concat(bt,"-content-animated"),it))},Ct.map(function(_e){var me=_e.key,pe=_e.forceRender,C=_e.style,j=_e.className,X=_e.destroyInactiveTabPane,te=(0,p.Z)(_e,Ee),fe=me===tt;return A.createElement(se.default,(0,E.Z)({key:me,visible:fe,forceRender:pe,removeOnLeave:!!(gt||X),leavedClassName:"".concat(wt,"-hidden")},Ke.tabPaneMotion),function(ve,Te){var Ie=ve.style,je=ve.className;return A.createElement(q,(0,E.Z)({},te,{prefixCls:wt,id:Ze,tabKey:me,animated:it,active:fe,style:(0,xe.Z)((0,xe.Z)({},C),Ie),className:Y()(j,je),ref:Te}))})})))},de=Fe,ze=R(48736);function rt(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Ae;return ge===!1?Ae={inkBar:!1,tabPane:!1}:ge===!0?Ae={inkBar:!0,tabPane:!1}:Ae=(0,xe.Z)({inkBar:!0},(0,W.Z)(ge)==="object"?ge:{}),Ae.tabPaneMotion&&Ae.tabPane===void 0&&(Ae.tabPane=!0),!Ae.tabPaneMotion&&Ae.tabPane&&(Ae.tabPane=!1),Ae}var We=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","more","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],ut=0,Ve=A.forwardRef(function(ge,Ae){var Ze=ge.id,tt=ge.prefixCls,Ke=tt===void 0?"rc-tabs":tt,pt=ge.className,gt=ge.items,He=ge.direction,bt=ge.activeKey,Ct=ge.defaultActiveKey,it=ge.editable,wt=ge.animated,_e=ge.tabPosition,me=_e===void 0?"top":_e,pe=ge.tabBarGutter,C=ge.tabBarStyle,j=ge.tabBarExtraContent,X=ge.locale,te=ge.more,fe=ge.destroyInactiveTabPane,ve=ge.renderTabBar,Te=ge.onChange,Ie=ge.onTabClick,je=ge.onTabScroll,_t=ge.getPopupContainer,Dt=ge.popupClassName,dt=ge.indicator,at=(0,p.Z)(ge,We),Rt=A.useMemo(function(){return(gt||[]).filter(function(Mt){return Mt&&(0,W.Z)(Mt)==="object"&&"key"in Mt})},[gt]),Gt=He==="rtl",kt=rt(wt),Ot=(0,A.useState)(!1),ot=(0,ee.Z)(Ot,2),Ye=ot[0],yt=ot[1];(0,A.useEffect)(function(){yt((0,G.Z)())},[]);var Pt=(0,l.Z)(function(){var Mt;return(Mt=Rt[0])===null||Mt===void 0?void 0:Mt.key},{value:bt,defaultValue:Ct}),Ht=(0,ee.Z)(Pt,2),un=Ht[0],Bn=Ht[1],fn=(0,A.useState)(function(){return Rt.findIndex(function(Mt){return Mt.key===un})}),pn=(0,ee.Z)(fn,2),Sn=pn[0],tn=pn[1];(0,A.useEffect)(function(){var Mt=Rt.findIndex(function(Je){return Je.key===un});if(Mt===-1){var we;Mt=Math.max(0,Math.min(Sn,Rt.length-1)),Bn((we=Rt[Mt])===null||we===void 0?void 0:we.key)}tn(Mt)},[Rt.map(function(Mt){return Mt.key}).join("_"),un,Sn]);var On=(0,l.Z)(null,{value:Ze}),Tn=(0,ee.Z)(On,2),ai=Tn[0],Kt=Tn[1];(0,A.useEffect)(function(){Ze||(Kt("rc-tabs-".concat(ut)),ut+=1)},[]);function _n(Mt,we){Ie==null||Ie(Mt,we);var Je=Mt!==un;Bn(Mt),Je&&(Te==null||Te(Mt))}var vn={id:ai,activeKey:un,animated:kt,tabPosition:me,rtl:Gt,mobile:Ye},jt=(0,xe.Z)((0,xe.Z)({},vn),{},{editable:it,locale:X,more:te,tabBarGutter:pe,onTabClick:_n,onTabScroll:je,extra:j,style:C,panes:null,getPopupContainer:_t,popupClassName:Dt,indicator:dt});return A.createElement(m.Provider,{value:{tabs:Rt,prefixCls:Ke}},A.createElement("div",(0,E.Z)({ref:Ae,id:Ze,className:Y()(Ke,"".concat(Ke,"-").concat(me),(0,le.Z)((0,le.Z)((0,le.Z)({},"".concat(Ke,"-mobile"),Ye),"".concat(Ke,"-editable"),it),"".concat(Ke,"-rtl"),Gt),pt)},at),A.createElement(V,(0,E.Z)({},jt,{renderTabBar:ve})),A.createElement(de,(0,E.Z)({destroyInactiveTabPane:fe},vn,{animated:kt}))))}),At=Ve,vt=At},22711:function(Ut,ft,R){"use strict";R.r(ft),R.d(ft,{ResizableTextArea:function(){return Re},default:function(){return I}});var E=R(67711),le=R(52873),xe=R(98506),ee=R(15142),W=R(16886),p=R(33346),ue=R(92310),Y=R.n(ue),l=R(36901),G=R(66003),A=R(30292),m=R(18929),_=R(59301),y=R(26420),b=R(29301),F=R(34280),K=R(16089),H=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important;
|
|
pointer-events: none !important;
|
|
`,L=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],O={},k;function z(N){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=N.getAttribute("id")||N.getAttribute("data-reactid")||N.getAttribute("name");if(U&&O[g])return O[g];var d=window.getComputedStyle(N),D=d.getPropertyValue("box-sizing")||d.getPropertyValue("-moz-box-sizing")||d.getPropertyValue("-webkit-box-sizing"),$=parseFloat(d.getPropertyValue("padding-bottom"))+parseFloat(d.getPropertyValue("padding-top")),he=parseFloat(d.getPropertyValue("border-bottom-width"))+parseFloat(d.getPropertyValue("border-top-width")),Se=L.map(function(Ue){return"".concat(Ue,":").concat(d.getPropertyValue(Ue))}).join(";"),qe={sizingStyle:Se,paddingSize:$,borderSize:he,boxSizing:D};return U&&g&&(O[g]=qe),qe}function J(N){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;k||(k=document.createElement("textarea"),k.setAttribute("tab-index","-1"),k.setAttribute("aria-hidden","true"),k.setAttribute("name","hiddenTextarea"),document.body.appendChild(k)),N.getAttribute("wrap")?k.setAttribute("wrap",N.getAttribute("wrap")):k.removeAttribute("wrap");var D=z(N,U),$=D.paddingSize,he=D.borderSize,Se=D.boxSizing,qe=D.sizingStyle;k.setAttribute("style","".concat(qe,";").concat(H)),k.value=N.value||N.placeholder||"";var Ue=void 0,nt=void 0,et,Pe=k.scrollHeight;if(Se==="border-box"?Pe+=he:Se==="content-box"&&(Pe-=$),g!==null||d!==null){k.value=" ";var Lt=k.scrollHeight-$;g!==null&&(Ue=Lt*g,Se==="border-box"&&(Ue=Ue+$+he),Pe=Math.max(Ue,Pe)),d!==null&&(nt=Lt*d,Se==="border-box"&&(nt=nt+$+he),et=Pe>nt?"":"hidden",Pe=Math.min(nt,Pe))}var Me={height:Pe,overflowY:et,resize:"none"};return Ue&&(Me.minHeight=Ue),nt&&(Me.maxHeight=nt),Me}var ne=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Z=0,ae=1,oe=2,re=_.forwardRef(function(N,U){var g=N,d=g.prefixCls,D=g.defaultValue,$=g.value,he=g.autoSize,Se=g.onResize,qe=g.className,Ue=g.style,nt=g.disabled,et=g.onChange,Pe=g.onInternalAutoSize,Lt=(0,p.Z)(g,ne),Me=(0,m.Z)(D,{value:$,postState:function(pt){return pt!=null?pt:""}}),mt=(0,W.Z)(Me,2),ke=mt[0],Tt=mt[1],ye=function(pt){Tt(pt.target.value),et==null||et(pt)},be=_.useRef();_.useImperativeHandle(U,function(){return{textArea:be.current}});var q=_.useMemo(function(){return he&&(0,y.Z)(he)==="object"?[he.minRows,he.maxRows]:[]},[he]),Le=(0,W.Z)(q,2),Ne=Le[0],Qe=Le[1],V=!!he,se=function(){try{if(document.activeElement===be.current){var pt=be.current,gt=pt.selectionStart,He=pt.selectionEnd,bt=pt.scrollTop;be.current.setSelectionRange(gt,He),be.current.scrollTop=bt}}catch(Ct){}},Ee=_.useState(oe),Fe=(0,W.Z)(Ee,2),de=Fe[0],ze=Fe[1],rt=_.useState(),We=(0,W.Z)(rt,2),ut=We[0],Ve=We[1],At=function(){ze(Z)};(0,F.Z)(function(){V&&At()},[$,Ne,Qe,V]),(0,F.Z)(function(){if(de===Z)ze(ae);else if(de===ae){var Ke=J(be.current,!1,Ne,Qe);ze(oe),Ve(Ke)}else se()},[de]);var vt=_.useRef(),ge=function(){K.Z.cancel(vt.current)},Ae=function(pt){de===oe&&(Se==null||Se(pt),he&&(ge(),vt.current=(0,K.Z)(function(){At()})))};_.useEffect(function(){return ge},[]);var Ze=V?ut:null,tt=(0,xe.Z)((0,xe.Z)({},Ue),Ze);return(de===Z||de===ae)&&(tt.overflowY="hidden",tt.overflowX="hidden"),_.createElement(b.Z,{onResize:Ae,disabled:!(he||Se)},_.createElement("textarea",(0,E.Z)({},Lt,{ref:be,style:tt,className:Y()(d,qe,(0,le.Z)({},"".concat(d,"-disabled"),nt)),disabled:nt,value:ke,onChange:ye})))}),Re=re,M=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],w=_.forwardRef(function(N,U){var g,d=N.defaultValue,D=N.value,$=N.onFocus,he=N.onBlur,Se=N.onChange,qe=N.allowClear,Ue=N.maxLength,nt=N.onCompositionStart,et=N.onCompositionEnd,Pe=N.suffix,Lt=N.prefixCls,Me=Lt===void 0?"rc-textarea":Lt,mt=N.showCount,ke=N.count,Tt=N.className,ye=N.style,be=N.disabled,q=N.hidden,Le=N.classNames,Ne=N.styles,Qe=N.onResize,V=N.onClear,se=N.onPressEnter,Ee=N.readOnly,Fe=N.autoSize,de=N.onKeyDown,ze=(0,p.Z)(N,M),rt=(0,m.Z)(d,{value:D,defaultValue:d}),We=(0,W.Z)(rt,2),ut=We[0],Ve=We[1],At=ut==null?"":String(ut),vt=_.useState(!1),ge=(0,W.Z)(vt,2),Ae=ge[0],Ze=ge[1],tt=_.useRef(!1),Ke=_.useState(null),pt=(0,W.Z)(Ke,2),gt=pt[0],He=pt[1],bt=(0,_.useRef)(null),Ct=(0,_.useRef)(null),it=function(){var yt;return(yt=Ct.current)===null||yt===void 0?void 0:yt.textArea},wt=function(){it().focus()};(0,_.useImperativeHandle)(U,function(){var Ye;return{resizableTextArea:Ct.current,focus:wt,blur:function(){it().blur()},nativeElement:((Ye=bt.current)===null||Ye===void 0?void 0:Ye.nativeElement)||it()}}),(0,_.useEffect)(function(){Ze(function(Ye){return!be&&Ye})},[be]);var _e=_.useState(null),me=(0,W.Z)(_e,2),pe=me[0],C=me[1];_.useEffect(function(){if(pe){var Ye;(Ye=it()).setSelectionRange.apply(Ye,(0,ee.Z)(pe))}},[pe]);var j=(0,G.Z)(ke,mt),X=(g=j.max)!==null&&g!==void 0?g:Ue,te=Number(X)>0,fe=j.strategy(At),ve=!!X&&fe>X,Te=function(yt,Pt){var Ht=Pt;!tt.current&&j.exceedFormatter&&j.max&&j.strategy(Pt)>j.max&&(Ht=j.exceedFormatter(Pt,{max:j.max}),Pt!==Ht&&C([it().selectionStart||0,it().selectionEnd||0])),Ve(Ht),(0,A.rJ)(yt.currentTarget,yt,Se,Ht)},Ie=function(yt){tt.current=!0,nt==null||nt(yt)},je=function(yt){tt.current=!1,Te(yt,yt.currentTarget.value),et==null||et(yt)},_t=function(yt){Te(yt,yt.target.value)},Dt=function(yt){yt.key==="Enter"&&se&&se(yt),de==null||de(yt)},dt=function(yt){Ze(!0),$==null||$(yt)},at=function(yt){Ze(!1),he==null||he(yt)},Rt=function(yt){Ve(""),wt(),(0,A.rJ)(it(),yt,Se)},Gt=Pe,kt;j.show&&(j.showFormatter?kt=j.showFormatter({value:At,count:fe,maxLength:X}):kt="".concat(fe).concat(te?" / ".concat(X):""),Gt=_.createElement(_.Fragment,null,Gt,_.createElement("span",{className:Y()("".concat(Me,"-data-count"),Le==null?void 0:Le.count),style:Ne==null?void 0:Ne.count},kt)));var Ot=function(yt){var Pt;Qe==null||Qe(yt),(Pt=it())!==null&&Pt!==void 0&&Pt.style.height&&He(!0)},ot=!Fe&&!mt&&!qe;return _.createElement(l.BaseInput,{ref:bt,value:At,allowClear:qe,handleReset:Rt,suffix:Gt,prefixCls:Me,classNames:(0,xe.Z)((0,xe.Z)({},Le),{},{affixWrapper:Y()(Le==null?void 0:Le.affixWrapper,(0,le.Z)((0,le.Z)({},"".concat(Me,"-show-count"),mt),"".concat(Me,"-textarea-allow-clear"),qe))}),disabled:be,focused:Ae,className:Y()(Tt,ve&&"".concat(Me,"-out-of-range")),style:(0,xe.Z)((0,xe.Z)({},ye),gt&&!ot?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof kt=="string"?kt:void 0}},hidden:q,readOnly:Ee,onClear:V},_.createElement(Re,(0,E.Z)({},ze,{autoSize:Fe,maxLength:Ue,onKeyDown:Dt,onChange:_t,onFocus:dt,onBlur:at,onCompositionStart:Ie,onCompositionEnd:je,className:Y()(Le==null?void 0:Le.textarea),style:(0,xe.Z)((0,xe.Z)({},Ne==null?void 0:Ne.textarea),{},{resize:ye==null?void 0:ye.resize}),disabled:be,prefixCls:Me,onResize:Ot,ref:Ct,readOnly:Ee})))}),T=w,I=T},29125:function(Ut,ft,R){"use strict";R.d(ft,{G:function(){return ee},Z:function(){return H}});var E=R(92310),le=R.n(E),xe=R(59301);function ee(L){var O=L.children,k=L.prefixCls,z=L.id,J=L.overlayInnerStyle,ne=L.bodyClassName,Z=L.className,ae=L.style;return xe.createElement("div",{className:le()("".concat(k,"-content"),Z),style:ae},xe.createElement("div",{className:le()("".concat(k,"-inner"),ne),id:z,role:"tooltip",style:J},typeof O=="function"?O():O))}var W=R(67711),p=R(98506),ue=R(33346),Y=R(65030),l={shiftX:64,adjustY:1},G={adjustX:1,shiftY:!0},A=[0,0],m={left:{points:["cr","cl"],overflow:G,offset:[-4,0],targetOffset:A},right:{points:["cl","cr"],overflow:G,offset:[4,0],targetOffset:A},top:{points:["bc","tc"],overflow:l,offset:[0,-4],targetOffset:A},bottom:{points:["tc","bc"],overflow:l,offset:[0,4],targetOffset:A},topLeft:{points:["bl","tl"],overflow:l,offset:[0,-4],targetOffset:A},leftTop:{points:["tr","tl"],overflow:G,offset:[-4,0],targetOffset:A},topRight:{points:["br","tr"],overflow:l,offset:[0,-4],targetOffset:A},rightTop:{points:["tl","tr"],overflow:G,offset:[4,0],targetOffset:A},bottomRight:{points:["tr","br"],overflow:l,offset:[0,4],targetOffset:A},rightBottom:{points:["bl","br"],overflow:G,offset:[4,0],targetOffset:A},bottomLeft:{points:["tl","bl"],overflow:l,offset:[0,4],targetOffset:A},leftBottom:{points:["br","bl"],overflow:G,offset:[-4,0],targetOffset:A}},_=null,y=R(80402),b=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],F=function(O,k){var z=O.overlayClassName,J=O.trigger,ne=J===void 0?["hover"]:J,Z=O.mouseEnterDelay,ae=Z===void 0?0:Z,oe=O.mouseLeaveDelay,re=oe===void 0?.1:oe,Re=O.overlayStyle,M=O.prefixCls,w=M===void 0?"rc-tooltip":M,T=O.children,I=O.onVisibleChange,N=O.afterVisibleChange,U=O.transitionName,g=O.animation,d=O.motion,D=O.placement,$=D===void 0?"right":D,he=O.align,Se=he===void 0?{}:he,qe=O.destroyTooltipOnHide,Ue=qe===void 0?!1:qe,nt=O.defaultVisible,et=O.getTooltipContainer,Pe=O.overlayInnerStyle,Lt=O.arrowContent,Me=O.overlay,mt=O.id,ke=O.showArrow,Tt=ke===void 0?!0:ke,ye=O.classNames,be=O.styles,q=(0,ue.Z)(O,b),Le=(0,y.Z)(mt),Ne=(0,xe.useRef)(null);(0,xe.useImperativeHandle)(k,function(){return Ne.current});var Qe=(0,p.Z)({},q);"visible"in O&&(Qe.popupVisible=O.visible);var V=function(){return xe.createElement(ee,{key:"content",prefixCls:w,id:Le,bodyClassName:ye==null?void 0:ye.body,overlayInnerStyle:(0,p.Z)((0,p.Z)({},Pe),be==null?void 0:be.body)},Me)},se=function(){var Fe=xe.Children.only(T),de=(Fe==null?void 0:Fe.props)||{},ze=(0,p.Z)((0,p.Z)({},de),{},{"aria-describedby":Me?Le:null});return xe.cloneElement(T,ze)};return xe.createElement(Y.Z,(0,W.Z)({popupClassName:le()(z,ye==null?void 0:ye.root),prefixCls:w,popup:V,action:ne,builtinPlacements:m,popupPlacement:$,ref:Ne,popupAlign:Se,getPopupContainer:et,onPopupVisibleChange:I,afterPopupVisibleChange:N,popupTransitionName:U,popupAnimation:g,popupMotion:d,defaultPopupVisible:nt,autoDestroy:Ue,mouseLeaveDelay:re,popupStyle:(0,p.Z)((0,p.Z)({},Re),be==null?void 0:be.root),mouseEnterDelay:ae,arrow:Tt},Qe),se())},K=(0,xe.forwardRef)(F),H=K},49658:function(Ut,ft){"use strict";ft.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var R=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(R)||/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(R==null?void 0:R.substr(0,4))}},83145:function(Ut,ft,R){"use strict";Object.defineProperty(ft,"__esModule",{value:!0}),ft.CopyToClipboard=void 0;var E=xe(R(59301)),le=xe(R(25769));function xe(L){return L&&L.__esModule?L:{default:L}}function ee(L){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ee=function(k){return typeof k}:ee=function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},ee(L)}function W(L,O){var k=Object.keys(L);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(L);O&&(z=z.filter(function(J){return Object.getOwnPropertyDescriptor(L,J).enumerable})),k.push.apply(k,z)}return k}function p(L){for(var O=1;O<arguments.length;O++){var k=arguments[O]!=null?arguments[O]:{};O%2?W(k,!0).forEach(function(z){K(L,z,k[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(L,Object.getOwnPropertyDescriptors(k)):W(k).forEach(function(z){Object.defineProperty(L,z,Object.getOwnPropertyDescriptor(k,z))})}return L}function ue(L,O){if(L==null)return{};var k=Y(L,O),z,J;if(Object.getOwnPropertySymbols){var ne=Object.getOwnPropertySymbols(L);for(J=0;J<ne.length;J++)z=ne[J],!(O.indexOf(z)>=0)&&Object.prototype.propertyIsEnumerable.call(L,z)&&(k[z]=L[z])}return k}function Y(L,O){if(L==null)return{};var k={},z=Object.keys(L),J,ne;for(ne=0;ne<z.length;ne++)J=z[ne],!(O.indexOf(J)>=0)&&(k[J]=L[J]);return k}function l(L,O){if(!(L instanceof O))throw new TypeError("Cannot call a class as a function")}function G(L,O){for(var k=0;k<O.length;k++){var z=O[k];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(L,z.key,z)}}function A(L,O,k){return O&&G(L.prototype,O),k&&G(L,k),L}function m(L,O){return O&&(ee(O)==="object"||typeof O=="function")?O:y(L)}function _(L){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(k){return k.__proto__||Object.getPrototypeOf(k)},_(L)}function y(L){if(L===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L}function b(L,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");L.prototype=Object.create(O&&O.prototype,{constructor:{value:L,writable:!0,configurable:!0}}),O&&F(L,O)}function F(L,O){return F=Object.setPrototypeOf||function(z,J){return z.__proto__=J,z},F(L,O)}function K(L,O,k){return O in L?Object.defineProperty(L,O,{value:k,enumerable:!0,configurable:!0,writable:!0}):L[O]=k,L}var H=function(L){b(O,L);function O(){var k,z;l(this,O);for(var J=arguments.length,ne=new Array(J),Z=0;Z<J;Z++)ne[Z]=arguments[Z];return z=m(this,(k=_(O)).call.apply(k,[this].concat(ne))),K(y(z),"onClick",function(ae){var oe=z.props,re=oe.text,Re=oe.onCopy,M=oe.children,w=oe.options,T=E.default.Children.only(M),I=(0,le.default)(re,w);Re&&Re(re,I),T&&T.props&&typeof T.props.onClick=="function"&&T.props.onClick(ae)}),z}return A(O,[{key:"render",value:function(){var z=this.props,J=z.text,ne=z.onCopy,Z=z.options,ae=z.children,oe=ue(z,["text","onCopy","options","children"]),re=E.default.Children.only(ae);return E.default.cloneElement(re,p({},oe,{onClick:this.onClick}))}}]),O}(E.default.PureComponent);ft.CopyToClipboard=H,K(H,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(Ut,ft,R){"use strict";var E=R(83145),le=E.CopyToClipboard;le.CopyToClipboard=le,Ut.exports=le},51581:function(Ut,ft,R){"use strict";Object.defineProperty(ft,"__esModule",{value:!0});var E=function(){function m(_,y){for(var b=0;b<y.length;b++){var F=y[b];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(_,F.key,F)}}return function(_,y,b){return y&&m(_.prototype,y),b&&m(_,b),_}}(),le=R(59301),xe=p(le),ee=R(12708),W=p(ee);function p(m){return m&&m.__esModule?m:{default:m}}function ue(m,_){var y={};for(var b in m)_.indexOf(b)>=0||Object.prototype.hasOwnProperty.call(m,b)&&(y[b]=m[b]);return y}function Y(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")}function l(m,_){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:m}function G(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(m,_):m.__proto__=_)}var A=function(m){G(_,m);function _(y){Y(this,_);var b=l(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,y));return b.scrollListener=b.scrollListener.bind(b),b.eventListenerOptions=b.eventListenerOptions.bind(b),b.mousewheelListener=b.mousewheelListener.bind(b),b}return E(_,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var b=this.getParentElement(this.scrollComponent);b.scrollTop=b.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var b=!1,F={get passive(){b=!0}};try{document.addEventListener("test",null,F),document.removeEventListener("test",null,F)}catch(K){}return b}},{key:"eventListenerOptions",value:function(){var b=this.props.useCapture;return this.isPassiveSupported()&&(b={useCapture:this.props.useCapture,passive:!0}),b}},{key:"setDefaultLoader",value:function(b){this.defaultLoader=b}},{key:"detachMousewheelListener",value:function(){var b=window;this.props.useWindow===!1&&(b=this.scrollComponent.parentNode),b.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var b=window;this.props.useWindow===!1&&(b=this.getParentElement(this.scrollComponent)),b.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),b.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(b){var F=this.props.getScrollParent&&this.props.getScrollParent();return F!=null?F:b&&b.parentNode}},{key:"filterProps",value:function(b){return b}},{key:"attachScrollListener",value:function(){var b=this.getParentElement(this.scrollComponent);if(!(!this.props.hasMore||!b)){var F=window;this.props.useWindow===!1&&(F=b),F.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),F.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),F.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(b){b.deltaY===1&&!this.isPassiveSupported()&&b.preventDefault()}},{key:"scrollListener",value:function(){var b=this.scrollComponent,F=window,K=this.getParentElement(b),H=void 0;if(this.props.useWindow){var L=document.documentElement||document.body.parentNode||document.body,O=F.pageYOffset!==void 0?F.pageYOffset:L.scrollTop;this.props.isReverse?H=O:H=this.calculateOffset(b,O)}else this.props.isReverse?H=K.scrollTop:H=b.scrollHeight-K.scrollTop-K.clientHeight;H<Number(this.props.threshold)&&b&&b.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=K.scrollHeight,this.beforeScrollTop=K.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(b,F){return b?this.calculateTopPosition(b)+(b.offsetHeight-F-window.innerHeight):0}},{key:"calculateTopPosition",value:function(b){return b?b.offsetTop+this.calculateTopPosition(b.offsetParent):0}},{key:"render",value:function(){var b=this,F=this.filterProps(this.props),K=F.children,H=F.element,L=F.hasMore,O=F.initialLoad,k=F.isReverse,z=F.loader,J=F.loadMore,ne=F.pageStart,Z=F.ref,ae=F.threshold,oe=F.useCapture,re=F.useWindow,Re=F.getScrollParent,M=ue(F,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);M.ref=function(T){b.scrollComponent=T,Z&&Z(T)};var w=[K];return L&&(z?k?w.unshift(z):w.push(z):this.defaultLoader&&(k?w.unshift(this.defaultLoader):w.push(this.defaultLoader))),xe.default.createElement(H,M,w)}}]),_}(le.Component);A.propTypes={children:W.default.node.isRequired,element:W.default.node,hasMore:W.default.bool,initialLoad:W.default.bool,isReverse:W.default.bool,loader:W.default.node,loadMore:W.default.func.isRequired,pageStart:W.default.number,ref:W.default.func,getScrollParent:W.default.func,threshold:W.default.number,useCapture:W.default.bool,useWindow:W.default.bool},A.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},ft.default=A,Ut.exports=ft.default},26724:function(Ut,ft,R){Ut.exports=R(51581)},76374:function(Ut,ft,R){"use strict";var E=function(){if(typeof Map!="undefined")return Map;function M(w,T){var I=-1;return w.some(function(N,U){return N[0]===T?(I=U,!0):!1}),I}return function(){function w(){this.__entries__=[]}return Object.defineProperty(w.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),w.prototype.get=function(T){var I=M(this.__entries__,T),N=this.__entries__[I];return N&&N[1]},w.prototype.set=function(T,I){var N=M(this.__entries__,T);~N?this.__entries__[N][1]=I:this.__entries__.push([T,I])},w.prototype.delete=function(T){var I=this.__entries__,N=M(I,T);~N&&I.splice(N,1)},w.prototype.has=function(T){return!!~M(this.__entries__,T)},w.prototype.clear=function(){this.__entries__.splice(0)},w.prototype.forEach=function(T,I){I===void 0&&(I=null);for(var N=0,U=this.__entries__;N<U.length;N++){var g=U[N];T.call(I,g[1],g[0])}},w}()}(),le=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,xe=function(){return typeof R.g!="undefined"&&R.g.Math===Math?R.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),ee=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(xe):function(M){return setTimeout(function(){return M(Date.now())},1e3/60)}}(),W=2;function p(M,w){var T=!1,I=!1,N=0;function U(){T&&(T=!1,M()),I&&d()}function g(){ee(U)}function d(){var D=Date.now();if(T){if(D-N<W)return;I=!0}else T=!0,I=!1,setTimeout(g,w);N=D}return d}var ue=20,Y=["top","right","bottom","left","width","height","size","weight"],l=typeof MutationObserver!="undefined",G=function(){function M(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=p(this.refresh.bind(this),ue)}return M.prototype.addObserver=function(w){~this.observers_.indexOf(w)||this.observers_.push(w),this.connected_||this.connect_()},M.prototype.removeObserver=function(w){var T=this.observers_,I=T.indexOf(w);~I&&T.splice(I,1),!T.length&&this.connected_&&this.disconnect_()},M.prototype.refresh=function(){var w=this.updateObservers_();w&&this.refresh()},M.prototype.updateObservers_=function(){var w=this.observers_.filter(function(T){return T.gatherActive(),T.hasActive()});return w.forEach(function(T){return T.broadcastActive()}),w.length>0},M.prototype.connect_=function(){!le||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),l?(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)},M.prototype.disconnect_=function(){!le||!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)},M.prototype.onTransitionEnd_=function(w){var T=w.propertyName,I=T===void 0?"":T,N=Y.some(function(U){return!!~I.indexOf(U)});N&&this.refresh()},M.getInstance=function(){return this.instance_||(this.instance_=new M),this.instance_},M.instance_=null,M}(),A=function(M,w){for(var T=0,I=Object.keys(w);T<I.length;T++){var N=I[T];Object.defineProperty(M,N,{value:w[N],enumerable:!1,writable:!1,configurable:!0})}return M},m=function(M){var w=M&&M.ownerDocument&&M.ownerDocument.defaultView;return w||xe},_=J(0,0,0,0);function y(M){return parseFloat(M)||0}function b(M){for(var w=[],T=1;T<arguments.length;T++)w[T-1]=arguments[T];return w.reduce(function(I,N){var U=M["border-"+N+"-width"];return I+y(U)},0)}function F(M){for(var w=["top","right","bottom","left"],T={},I=0,N=w;I<N.length;I++){var U=N[I],g=M["padding-"+U];T[U]=y(g)}return T}function K(M){var w=M.getBBox();return J(0,0,w.width,w.height)}function H(M){var w=M.clientWidth,T=M.clientHeight;if(!w&&!T)return _;var I=m(M).getComputedStyle(M),N=F(I),U=N.left+N.right,g=N.top+N.bottom,d=y(I.width),D=y(I.height);if(I.boxSizing==="border-box"&&(Math.round(d+U)!==w&&(d-=b(I,"left","right")+U),Math.round(D+g)!==T&&(D-=b(I,"top","bottom")+g)),!O(M)){var $=Math.round(d+U)-w,he=Math.round(D+g)-T;Math.abs($)!==1&&(d-=$),Math.abs(he)!==1&&(D-=he)}return J(N.left,N.top,d,D)}var L=function(){return typeof SVGGraphicsElement!="undefined"?function(M){return M instanceof m(M).SVGGraphicsElement}:function(M){return M instanceof m(M).SVGElement&&typeof M.getBBox=="function"}}();function O(M){return M===m(M).document.documentElement}function k(M){return le?L(M)?K(M):H(M):_}function z(M){var w=M.x,T=M.y,I=M.width,N=M.height,U=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,g=Object.create(U.prototype);return A(g,{x:w,y:T,width:I,height:N,top:T,right:w+I,bottom:N+T,left:w}),g}function J(M,w,T,I){return{x:M,y:w,width:T,height:I}}var ne=function(){function M(w){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=J(0,0,0,0),this.target=w}return M.prototype.isActive=function(){var w=k(this.target);return this.contentRect_=w,w.width!==this.broadcastWidth||w.height!==this.broadcastHeight},M.prototype.broadcastRect=function(){var w=this.contentRect_;return this.broadcastWidth=w.width,this.broadcastHeight=w.height,w},M}(),Z=function(){function M(w,T){var I=z(T);A(this,{target:w,contentRect:I})}return M}(),ae=function(){function M(w,T,I){if(this.activeObservations_=[],this.observations_=new E,typeof w!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=w,this.controller_=T,this.callbackCtx_=I}return M.prototype.observe=function(w){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(w instanceof m(w).Element))throw new TypeError('parameter 1 is not of type "Element".');var T=this.observations_;T.has(w)||(T.set(w,new ne(w)),this.controller_.addObserver(this),this.controller_.refresh())}},M.prototype.unobserve=function(w){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(w instanceof m(w).Element))throw new TypeError('parameter 1 is not of type "Element".');var T=this.observations_;T.has(w)&&(T.delete(w),T.size||this.controller_.removeObserver(this))}},M.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},M.prototype.gatherActive=function(){var w=this;this.clearActive(),this.observations_.forEach(function(T){T.isActive()&&w.activeObservations_.push(T)})},M.prototype.broadcastActive=function(){if(this.hasActive()){var w=this.callbackCtx_,T=this.activeObservations_.map(function(I){return new Z(I.target,I.broadcastRect())});this.callback_.call(w,T,w),this.clearActive()}},M.prototype.clearActive=function(){this.activeObservations_.splice(0)},M.prototype.hasActive=function(){return this.activeObservations_.length>0},M}(),oe=typeof WeakMap!="undefined"?new WeakMap:new E,re=function(){function M(w){if(!(this instanceof M))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var T=G.getInstance(),I=new ae(w,T,this);oe.set(this,I)}return M}();["observe","unobserve","disconnect"].forEach(function(M){re.prototype[M]=function(){var w;return(w=oe.get(this))[M].apply(w,arguments)}});var Re=function(){return typeof xe.ResizeObserver!="undefined"?xe.ResizeObserver:re}();ft.Z=Re},98040:function(Ut){Ut.exports=function(){var ft=document.getSelection();if(!ft.rangeCount)return function(){};for(var R=document.activeElement,E=[],le=0;le<ft.rangeCount;le++)E.push(ft.getRangeAt(le));switch(R.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":R.blur();break;default:R=null;break}return ft.removeAllRanges(),function(){ft.type==="Caret"&&ft.removeAllRanges(),ft.rangeCount||E.forEach(function(xe){ft.addRange(xe)}),R&&R.focus()}}},93314:function(Ut){"use strict";Ut.exports="data:image/png;base64,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"},96908:function(Ut){"use strict";Ut.exports="data:image/png;base64,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"},57177:function(Ut){"use strict";Ut.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANQAAAA8CAYAAAAeyZT3AAAAAXNSR0IArs4c6QAAEpJJREFUeF7tXQeYFdUV/mcbS1F6UUEsoLC7IGKNJWpERbEgSoxGo7HEQFDRWCAGgdASNBbEhglqsC1rAxVBNGg0qNgLsJRddmFhe3vby3uT7393ZmfeezOv7M57W3LP9/EtM3Pn3DPn3n/uvf85c58CKdID0gOOeUBxTJNUJD0gPQAJKNkJpAcc9EALoNRpCaqt3rh4QIkDvH/jxV/zuZZjrVy8uRzvSzDdrx3HxWnnEnz1eevhOf/79HpNdrAs6wrQr9VvtiMc+/kc0HSan9Nrq8Uzt9hquuZjv8kPev26r8x16X5VPYDHDYT7Vy/L8vo94d7P8u5mcV+w+1U34GEZ7a+5Tg/vV31tbrmu36ff23JcB9VdBo9a5v2rekq14/1wN30GNXGzctPKKgf7eExVKUGBpJsSEkgWYPMHXEuH0sHlB5iW8jrAtE6sd9AW8GidVD9mR/fvxDrAzJ3Yp/ObAGL3srC1XweJnf0awHUQWgGJ52i3P+D9OyOP/QHSAjYT8Lwd3gRGH3Bp5dza34D7LUDsD04vmPzuN9cZGkSAF3xm4JttNoFWdasNlRVNta4SV21l6YHakvyPGurrNivA12kZ2B1TdLSisvAA1QrF8hbpAUsP8EWVkAwkdgMSugHxiUB8EpDcC+g1AOjeG+BciSBWPXA3NaA8Pxel+7LRXF+bCwXpShxeTX0V33ZED0tAdcRW+X+2iaN3j35Ar/7iX/e+XnCpbg9cZfkozctBrauci/9tioIlKSpeUTLg7iguk4DqKC0h7bD2QPJBQP/hUHsNhsIVv+qBq7QI+7O2w93USGDtUoEFaavxoqJ4x7Z2FQmodnW/rDxsD3Ba2PcwqL0PhaLEobmxAXnZmaiuKPOqUBRsSlBx06gM7AlbZxQKSkBFwalSZRQ9kJAEDD4GSD7Yyz6WFu5HQV4uVI+Ho1W1ouCe1NV4OooWBFUtAdVenpf1ts0DfQ6F2mcoOMurq6nCnp2Z8DAMwNEKWJEKTG+PtZUEVNuaVd7dnh5I6gF1wFFQEpJQW+1CTtYueBgeEPLuwGRcNWQVamJpogRULL0t63LeA/GJUAeNhBKXgOpqF3Kzs6Ey3iVGqs29gQnDMlDnfMXWGiWgYuVpWU/0PBCfBHXQ0VCUeLgqK7B3b67I4BDyZloKrlTmQ6AsyiIBFWUHS/Ux8kBCMtT+w70MYGlJMfILCloqVoDH0jIwMxaWSEDFwsuyjth4IKk71D7DGKzCnj05qK0zZnoKMDUtA69F2xAJqGh7WOqPrQeYvtSjL+rr65C1JxeqMfUrTkpAyrGvoCSaBklARdO7UnfsPaAAat/DocTFo7C4FMWlIvBLUYD0tAz8KppGSUBF07tSd/t4ILE71N5DoHrcyMrJQ0NjY4sd8QompazGumgZJgEVLc9Kve3rgZ79gW49UVVdg9wDhWZbMtNSMEaZDxEFdlgkoBx2qFTXQTygxHnz/gAPdu3NR2Njk9mwmWMy8Fg0LJWAioZXpU7DA/0OB479hTguyQZ2/Sdm3lF79IWS2B2llVXILylvqVcBuLAamZbh/euotA+geg0E/ponHqSpDrizj6MP1WGU8WM671eq7fhVweTFwIQ/Cpe8PRfY8NfYuue4y4BbNbb6y1eA534Tu/rjEqEeNAAejxs7cgvg4VfGmijA8rQM3Oa0Me0HqKUHxLM01gEzD3b6udpXX+9DgNNvBs64GVh0PFDj+Isw/Oe7fAlw3t2i/NoHgPVLwr/XiZLtCShGpHr29zJ++aWVKHX5pPU1Iw5jx6RjuxOP2QLUsPaUcLJG6uII1ZUBtTAb6McAI4B7BktAtdcIRf/zM/vkg9HY3IydeQxBGbMFBVifloELnezecoRy0pu6rsU5QJ/DJKDogXYeoWiCp2c/7mWF7MJy1Nb7kBNwmkaXgJKAioYHDJ0dAFBqt55Q4ruhyFWDooqArzkcpdE7HqBOuxE4aKBokE9WALUGO9PSStxc4Px7xWFzI/DhI0YDDjoGOP5ycbxjE5CzBRh/JTDiDGD4CaL83m/E+W9e8yUM+g0HTtIC6f56/bvd8JOAURp75SoAKvYDh58gStG27tq68L3FQGOtOP/TOmD/j76aOP09YSowbBww9DigtgLY9y2w7zvguzeEvf5ifsb8bcAPbwNjLwF+Pg3oPQTgubfnAcW7ASfXUAOOBH52PTB0nKiHn6UXZwFFu4DPVwEFFssRK0BRz7gpwn/0U+7XQM6XwFfpYrsxpyUhEUjqhdqGJmQXVgRoj1NwR+pqLHOi2o4HqD99DQwdK55t7mjRKfyF++4t1xIf66uAu/oZJcwNuGYOMHgkcKoNs7TtfWDltQZoOd9eshfoqel76OdA9mfWfp6+FkjTpt/vLhA79Jw1PXibrLoZ+OwFo8yIM4EbXwT6MF5iIblfASumAuUaI6oX8e+kOz4Crn3GV8HjFwLbP3AOUJfMBybO9m7eYCnuJmDjQ4L4MIu/rR8+Bty2zvCxuezuT4AVVwHVxU70bR8dao8+XsY1c38F3Ca2j4WcpNG7NqA4MiT1AJoagNwtwIFtwJBRwPATvVF0r5TmAItPBOoqxfEVDwLnapn+n/4DeHlaYONyVCHw4hPErqoPjATOvRM4Syvr3RVWE2/jaQvhF38HfP4vcYEd7ZZ0sWsu5cBPYlTiW58j6cCjxfmqYuDRCWLU0cXcSQ9sBQaOEPvcmcVJQF08F7joz4b2sr3iRcOX2eHjxT9dVl4HfPWqta0cnRmX4r58WZ8CRbsD24Mvj8UnOE7kqN16eT/t2FdWjcrawFHfKRq9awOKzVpdAjxxCcC3vS79jwBmvCs2+6CQStbfrJxOzdsqzte5gFmHAU31vp317BnAL7VpJke55ZN8r4ciJQjyedsM4uLl6cCnzxo6uDcdp42XLRDnvlsDrLjSupPqZ7duAD5+EqgqEmBkh2fHb+uUjy+eJXliI0rK6/f6TrF5ji+TK5aK65wCzh1lbyvb48nJQM4XRpkBRwHT3gIOGS3Obfw78OYsX5+29YgvnLgklNc0YH+FNgX31ekIjd71AfXU5cCP7wQ2B9/q7NScwjTUAHNGCPBR7tgIHHu2+D8DkQxImuXezcARJ4kzz14FfPuG7/VQgLpkHnDh/eIerj3+daN1d9GnlQwM862tr7/MI1QoHW0FFNdLE+8ToQ6uFTlFtpJFe4C+Q8WVmb2NdaO/rS/cCHyxyro95m4Ve9ozNsn24MvBKeHW10nd0dTsxo5C663TnaDRuzagOJ2bM9K+SWZ+ABxzlrj+1GTgx3fF/0kS3PSy+H/mv4FlFxg6zCMYG3z28MCFdChAzd4CDDte6Hz0PGDnR9Y2nvxr4IbnxbX3HwTe+pP4v7mT8mVw/5HW5A3LthVQ4XboO94Hjj1HlF403hr8ZfsEULQ9HwJUz1gHpJwnTj89RZAtTgpHW9WD3cU1qG+y/iK+rTR61wbUD+8AT2uMn1XDTH0YOEfLPsn4I7BJI3q43zZBcdAgsUZiJyjfJzSYRxcuwt+cHag5FKAerRRrO8p3bwVOKXWNJEdSzhdHHAU5GvoDas/nwINn2nc7JwHF2NrxUwCydP2PFEQMiRzulcdjfV1Ke2iXv61b14vpt52Y169v3Ad88LCTcBJ2KvEoqmpAUbUFeypqaxON3rUB9Z9ngFdn2DfK+fcAzHWjbFoOZNxplL1sIXDBfeJ47VxgvVbuLztFh6LMSwWKdgbqDwYodkpej1RIpS85ObCTfrUaWPnr6AKKDNlVy4DxUwURE0rsABWqPZhzOEXLNfz4KSD99lA1RXbd+1NCiahrdCOrzH4jpLbQ6M4Daswk4MhTxYNu32idXcxcN7JklPpq4K6+hmOcpM23vAw8f7290yc9AEyaI65v+BuwxsRkkbiYv0PM6fWF9lGnAXd/LMoza/qRc611BwMUR6ZHKgz6mbE2uymQWTsZNaspX6iE07aOUInJwO0bgKNPM9qL8bHCXUBVoRhdmxuAibOMaawdoL54EXjht/btYR791y0E3pkfGWBClSbjH0c21IPM4no0e6yTlttCozsPqEsXCOdSzOyZ+WFJs87SWJ7CncD8VOOqeX2xYByQrzFu5vsZgF2oxaeCxaHIdDGWZCfXPgucdoO4uuoW4DNtvaKX/8M7QKq2fvr7OcDJVwNn/k5cff4GYMtLkQOKd5hz/exGuWCdI5Lsg7YCimzj5EXCmrzvBYXP4LO/zPrcCGzbASrYS4j6rvuHCBxT7MiLUKAJdZ3Teag44GpCWZ39j3a0lkZ3HlCnXAdcv1I81tcZwD+vCXxEc5nMD4FlE40yv38TGHuxOF5+MbBtQ+D91z8HnKKxTcEAxSyDeaMFfewvDA4TlHrO3UNnAdmbfUsx++D3GoPH0S51oghIskPNHma/9gm1hjIvvv0pc7MF4yaLNQuF9Dzf8JRYAop0NmcdlGeuBL5fE+hL/qbT0gJjOmgHKLbHn48CXD5f0Ap9bA/67eDB4njp6SKbxWnRfjmzqr4ZuZVBszJaRaM7DygGTe/TsgsYUF0wBigx/SACpxB3fyJSbSj/Xga8pn2vw+OpjwDnaOseqynbYWOB2V+KqRglGKB4neksVlQvyQiSEhQGVJdoNLi5ARkPWpRtgE6/xnhP+h32TW1eZ5FlJNtoluMuBW59XZxhytL8NKCh2rcMR+H7vzFSmB7+BcBMAkosAWWegvPlyJekv5hBx2t2gOK1/64EXro1UMeEu4ApfxPnmYa0VJti2nu59Vfi4r27y24vaYYnyLdqraHRnQcUH/P29cAobX1RXSpAw8U7O8mp1wGHalM8bu7OEcTc4UZPAG57z3AWsxW+eEnM148+XUw/yL7pEgxQZOgIvG9eF8HC4l3A4FHAib802D3qefJS4CdTneamumgOcLFfOs0ixoR+sG9QMx1P2j3zA5EzSFZQF3MnZMYA10cMPvOzbU4zT77GyJbwZ8daCyjq58sjHPlhrfDJb1aKNqMU7gBemgZk/VdkeHCtfPliY82s6w0GKJYhkULSgdN5Zq4wTKGzrbzOGQtnLtES9gmPB/uqPKhsCL6hbFwcLkpNh03nCDQwOoBirIajlJ4gaueY95cCb2kBTnMZc0zD/16CZO0cY14fDFAEEmX8FdYWsJOvWwAwF89OOCVcmGWkCIXz9uR0lNNSf5mRLH6rlsIg6LQ1Rt6iXf1ct3B0qncZJVoLqEg6qM5sWrUlM0hIruiM386PBdj09aUdoLZtFOSGTq8HtK1bZKywX0RVvL/cBlejir2u4D9+qCjYnjoaY8Pd1CU6gKIz2BGvecpIIDU7qDRX0Nl881oJf7WOMYnTb/K9Wpkv7vtxXXjJsWTASB6Q8uVbVo/9UCunWqRlv18buunIcumZ5czt46gZSs64BTh7OjBwpJFnZwYU7+cCmTlyzB0028ZrXKcR6Jxe+mdgxxJQtOWIU4CrHzdYPP3Z2Y7fvi5GV+b7MXmWYgcopi0xiM2g+aARvh7kfhP0LUf0GAk5vu2l7qDTPpoSCY0ePUDpTunRVwzrnO6xE/NNFm5KCXcBHTJaLFT5yQWdHkrsOhs7L6co+ucCTKMJR9jRF+cCjMUwK2HW0MD1Tjh6gpVh+hPz2Q5NE+ApyBTrznDo9LbWHe79tHFIigACaXJOH/VUrXB1mMuxTbne1j+nqSltjZY235NX5UFFiGlfJDR69AHV5keOUEEkb+9wVHMac/UTouTm5wBmjEvpMh6oblKRUxnGb14reHzMaoSMNEtAheoac74HDkkRpZae4ZslHepeeb3De4DL6O1load9/JQ1nE1dJKCCNTmTPUmQUPi90kItobXDdxNpYCQe2F/tQXl96J+PUoD30jJwUdDZe7vsehTJ00Za1skpH4O6DO5SMu4CNj0eqTWyfCfwQF0zkFUR3qf3oWj0rjdCHZJqxE0YczF/PRpJ4zJyf+l8b3ayV5jrZ7W/RSQ6ZdkO6QGyfTvL3Giyye0zGx2KRu96gOqQTSaN6ugeKKpTUVQTBjkRgkaXgOroLS3ti4kH+L3hjjICKvS22cFodAmomDSXrKQzeGBPpQc1Nl/yBthvQ6NLQHWGlpY2xsQDFQ0q8qrCm/bZ0egSUDFpKllJZ/AAOYnM8GJS3sexotEloDpDS0sbY+aBAzUelNWFjknpBvnT6BJQMWsqWVFn8EC9G9hdHl5MyjtK+WWjS0B1hlaWNsbUA9mVbtQ2hWb7TKPU7anp8Eb9JaBi2lSyss7ggQjJCZ+90SWgOkMLSxtj5gGOS/zHmJQ7jMyJFsM0Gl0CKmZNJSvqTB4oqPGgJAJyQqfRJaA6UytLW2PmgcoGFfvCj0m10Oj/A9jGm+feuyEMAAAAAElFTkSuQmCC"},81378:function(Ut){"use strict";Ut.exports="data:image/png;base64,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"},81168:function(Ut,ft,R){"use strict";R.d(ft,{ZP:function(){return Er}});const E=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},le=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=xe},xe=Number.MAX_SAFE_INTEGER||9007199254740991;let ee=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}({}),W=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}({}),p=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 ue={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Y={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class l{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 G{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 l(e),this.fast_=new l(t),this.defaultTTFB_=i,this.ttfb_=new l(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new l(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new l(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new l(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 A(a,e,t){return(e=F(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 _(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 y(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_(Object(t),!0).forEach(function(n){A(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function b(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 F(a){var e=b(a,"string");return typeof e=="symbol"?e:e+""}class K{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=H,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 H=function(){},L={trace:H,debug:H,log:H,warn:H,info:H,error:H};function O(){return m({},L)}function k(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):H}function z(a,e,t){return e[a]?e[a].bind(e):k(a,t)}const J=O();function ne(a,e,t){const n=O();if(typeof console=="object"&&a===!0||typeof a=="object"){const i=["debug","log","info","warn","error"];i.forEach(r=>{n[r]=z(r,a,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.7`)}catch(r){return O()}i.forEach(r=>{J[r]=z(r,a)})}else m(J,n);return n}const Z=J;function ae(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function oe(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function re(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 Re(a,e=!1){if(typeof TextDecoder!="undefined"){const u=new TextDecoder("utf-8").decode(a);if(e){const f=u.indexOf("\0");return f!==-1?u.substring(0,f):u}return u.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 M={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 w(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function T(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var I={exports:{}},N;function U(){return N||(N=1,function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(c,u,f){if(f=f||{},c=c.trim(),u=u.trim(),!u){if(!f.alwaysNormalize)return c;var h=o.parseURL(c);if(!h)throw new Error("Error trying to parse base URL.");return h.path=o.normalizePath(h.path),o.buildURLFromParts(h)}var v=o.parseURL(u);if(!v)throw new Error("Error trying to parse relative URL.");if(v.scheme)return f.alwaysNormalize?(v.path=o.normalizePath(v.path),o.buildURLFromParts(v)):u;var x=o.parseURL(c);if(!x)throw new Error("Error trying to parse base URL.");if(!x.netLoc&&x.path&&x.path[0]!=="/"){var S=i.exec(x.path);x.netLoc=S[1],x.path=S[2]}x.netLoc&&!x.path&&(x.path="/");var B={scheme:x.scheme,netLoc:v.netLoc,path:null,params:v.params,query:v.query,fragment:v.fragment};if(!v.netLoc&&(B.netLoc=x.netLoc,v.path[0]!=="/"))if(!v.path)B.path=x.path,v.params||(B.params=x.params,v.query||(B.query=x.query));else{var P=x.path,Q=P.substring(0,P.lastIndexOf("/")+1)+v.path;B.path=o.normalizePath(Q)}return B.path===null&&(B.path=f.alwaysNormalize?o.normalizePath(v.path):v.path),o.buildURLFromParts(B)},parseURL:function(c){var u=n.exec(c);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(r,"");c.length!==(c=c.replace(s,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};a.exports=o})()}(I)),I.exports}var g=U();class d{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 D={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class ${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,nt(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={[D.AUDIO]:null,[D.VIDEO]:null,[D.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 d),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=g.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[D.AUDIO]=null,e[D.VIDEO]=null,e[D.AUDIOVIDEO]=null}}function he(a){return a.sn!=="initSegment"}class Se extends ${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(E(e)&&E(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=E(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(!E(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return he(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,c=o[e];if(!c){o[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,i),c.endDTS=Math.max(c.endDTS,r)}}class qe extends ${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 Ue(a,e){const t=Object.getPrototypeOf(a);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||Ue(t,e)}}function nt(a,e){const t=Ue(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const et=Math.pow(2,32)-1,Pe=[].push,Lt={video:1,audio:2,id3:3,text:4};function Me(a){return String.fromCharCode.apply(null,a)}function mt(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function ke(a,e){const t=ye(a,e);return t<0?4294967296+t:t}function Tt(a,e){let t=ke(a,e);return t*=Math.pow(2,32),t+=ke(a,e+4),t}function ye(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function be(a){const e=a.byteLength;for(let t=0;t<e;){const n=ke(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 q(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let i=0;i<n;){const r=ke(a,i),s=Me(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 c=q(a.subarray(i+8,o),e.slice(1));c.length&&Pe.apply(t,c)}i=o}return t}function Le(a){const e=[],t=a[0];let n=8;const i=ke(a,n);n+=4;let r=0,s=0;t===0?(r=ke(a,n),s=ke(a,n+4),n+=8):(r=Tt(a,n),s=Tt(a,n+8),n+=16),n+=2;let o=a.length+s;const c=mt(a,n);n+=2;for(let u=0;u<c;u++){let f=n;const h=ke(a,f);f+=4;const v=h&2147483647;if((h&2147483648)>>>31===1)return Z.warn("SIDX has hierarchical references (not supported)"),null;const S=ke(a,f);f+=4,e.push({referenceSize:v,subsegmentDuration:S,info:{duration:S/i,start:o,end:o+v-1}}),o+=v,f+=4,n=f}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:c,references:e}}function Ne(a){const e=[],t=q(a,["moov","trak"]);for(let i=0;i<t.length;i++){const r=t[i],s=q(r,["tkhd"])[0];if(s){let o=s[0];const c=ke(s,o===0?12:20),u=q(r,["mdia","mdhd"])[0];if(u){o=u[0];const f=ke(u,o===0?12:20),h=q(r,["mdia","hdlr"])[0];if(h){const v=Me(h.subarray(8,12)),x={soun:D.AUDIO,vide:D.VIDEO}[v],S=q(r,["mdia","minf","stbl","stsd"])[0],B=Qe(S);x?(e[c]={timescale:f,type:x,stsd:B},e[x]=y({timescale:f,id:c},B)):e[c]={timescale:f,type:v,stsd:B}}}}}return q(a,["moov","mvex","trex"]).forEach(i=>{const r=ke(i,4),s=e[r];s&&(s.default={duration:ke(i,12),flags:ke(i,20)})}),e}function Qe(a){const e=a.subarray(8),t=e.subarray(86),n=Me(e.subarray(4,8));let i=n,r;const s=n==="enca"||n==="encv";if(s){const u=q(e,[n])[0].subarray(n==="enca"?28:78);q(u,["sinf"]).forEach(h=>{const v=q(h,["schm"])[0];if(v){const x=Me(v.subarray(4,8));if(x==="cbcs"||x==="cenc"){const S=q(h,["frma"])[0];S&&(i=Me(S))}}})}const o=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const c=q(t,["avcC"])[0];c&&c.length>3&&(i+="."+Fe(c[1])+Fe(c[2])+Fe(c[3]),r=V(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=q(e,[n])[0],u=q(c.subarray(28),["esds"])[0];if(u&&u.length>7){let f=4;if(u[f++]!==3)break;f=Ee(u,f),f+=2;const h=u[f++];if(h&128&&(f+=2),h&64&&(f+=u[f++]),u[f++]!==4)break;f=Ee(u,f);const v=u[f++];if(v===64)i+="."+Fe(v);else break;if(f+=12,u[f++]!==5)break;f=Ee(u,f);const x=u[f++];let S=(x&248)>>3;S===31&&(S+=1+((x&7)<<3)+((u[f]&224)>>5)),i+="."+S}break}case"hvc1":case"hev1":{const c=q(t,["hvcC"])[0];if(c&&c.length>12){const u=c[1],f=["","A","B","C"][u>>6],h=u&31,v=ke(c,2),x=(u&32)>>5?"H":"L",S=c[12],B=c.subarray(6,12);i+="."+f+h,i+="."+se(v).toString(16).toUpperCase(),i+="."+x+S;let P="";for(let Q=B.length;Q--;){const ce=B[Q];(ce||P)&&(P="."+ce.toString(16).toUpperCase()+P)}i+=P}r=V(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=V(i,t)||i;break}case"vp09":{const c=q(t,["vpcC"])[0];if(c&&c.length>6){const u=c[4],f=c[5],h=c[6]>>4&15;i+="."+de(u)+"."+de(f)+"."+de(h)}break}case"av01":{const c=q(t,["av1C"])[0];if(c&&c.length>2){const u=c[1]>>>5,f=c[1]&31,h=c[2]>>>7?"H":"M",v=(c[2]&64)>>6,x=(c[2]&32)>>5,S=u===2&&v?x?12:10:v?10:8,B=(c[2]&16)>>4,P=(c[2]&8)>>3,Q=(c[2]&4)>>2,ce=c[2]&3;i+="."+u+"."+de(f)+h+"."+de(S)+"."+B+"."+P+Q+ce+"."+de(1)+"."+de(1)+"."+de(1)+"."+0,r=V("dav1",t)}break}}return{codec:i,encrypted:s,supplemental:r}}function V(a,e){const t=q(e,["dvvC"]),n=t.length?t[0]:q(e,["dvcC"])[0];if(n){const i=n[2]>>1&127,r=n[2]<<5&32|n[3]>>3&31;return a+"."+de(i)+"."+de(r)}}function se(a){let e=0;for(let t=0;t<32;t++)e|=(a>>t&1)<<31-t;return e>>>0}function Ee(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function Fe(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function de(a){return(a<10?"0":"")+a}function ze(a,e){if(!a||!e)return a;const t=e.keyId;return t&&e.isCommonEncryption&&q(a,["moov","trak"]).forEach(i=>{const s=q(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=q(s,["enca"]);const c=o.length>0;c||(o=q(s,["encv"])),o.forEach(u=>{const f=c?u.subarray(28):u.subarray(78);q(f,["sinf"]).forEach(v=>{const x=rt(v);if(x){const S=x.subarray(8,24);S.some(B=>B!==0)||(Z.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${M.hexDump(S)} -> ${M.hexDump(t)}`),x.set(t,8))}})})}),a}function rt(a){const e=q(a,["schm"])[0];if(e){const t=Me(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return q(a,["schi","tenc"])[0]}return null}function We(a,e,t){const n={},i=q(a,["moof","traf"]);for(let r=0;r<i.length;r++){const s=i[r],o=q(s,["tfhd"])[0],c=ke(o,4),u=e[c];if(!u)continue;const f=n[c]||(n[c]={start:NaN,duration:0,sampleCount:0,timescale:u.timescale,type:u.type}),h=q(s,["tfdt"])[0];if(h){const ie=h[0];let De=ke(h,4);ie===1&&(De===et?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(De*=et+1,De+=ke(h,8))),E(De)&&(!E(f.start)||De<f.start)&&(f.start=De)}const v=u.default,x=ke(o,0)|(v==null?void 0:v.flags);let S=(v==null?void 0:v.duration)||0;x&8&&(x&2?S=ke(o,12):S=ke(o,8));const B=q(s,["trun"]);let P=f.start||0,Q=0,ce=S;for(let ie=0;ie<B.length;ie++){const De=B[ie],Be=ke(De,4),ct=f.sampleCount;f.sampleCount+=Be;const Oe=De[3]&1,$e=De[3]&4,Xe=De[2]&1,Ce=De[2]&2,St=De[2]&4,Nt=De[2]&8;let sn=8,Xt=Be;for(Oe&&(sn+=4),$e&&Be&&(!(De[sn+1]&1)&&f.keyFrameIndex===void 0&&(f.keyFrameIndex=ct),sn+=4,Xe?(ce=ke(De,sn),sn+=4):ce=S,Ce&&(sn+=4),Nt&&(sn+=4),P+=ce,Q+=ce,Xt--);Xt--;)Xe?(ce=ke(De,sn),sn+=4):ce=S,Ce&&(sn+=4),St&&(De[sn+1]&1||f.keyFrameIndex===void 0&&(f.keyFrameIndex=f.sampleCount-(Xt+1),f.keyFrameStart=P),sn+=4),Nt&&(sn+=4),P+=ce,Q+=ce;!Q&&S&&(Q+=S*Be)}f.duration+=Q}if(!Object.keys(n).some(r=>n[r].duration)){let r=1/0,s=0;const o=q(a,["sidx"]);for(let c=0;c<o.length;c++){const u=Le(o[c]);if(u!=null&&u.references){r=Math.min(r,u.earliestPresentationTime/u.timescale);const f=u.references.reduce((h,v)=>h+v.info.duration||0,0);s=Math.max(s,f+u.earliestPresentationTime/u.timescale)}}s&&E(s)&&Object.keys(n).forEach(c=>{n[c].duration||(n[c].duration=s*n[c].timescale-n[c].start)})}return n}function ut(a){const e={valid:null,remainder:null},t=q(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 Ve(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function At(a,e){const t=[],n=e.samples,i=e.timescale,r=e.id;let s=!1;return q(n,["moof"]).map(c=>{const u=c.byteOffset-8;q(c,["traf"]).map(h=>{const v=q(h,["tfdt"]).map(x=>{const S=x[0];let B=ke(x,4);return S===1&&(B*=Math.pow(2,32),B+=ke(x,8)),B/i})[0];return v!==void 0&&(a=v),q(h,["tfhd"]).map(x=>{const S=ke(x,4),B=ke(x,0)&16777215,P=(B&1)!==0,Q=(B&2)!==0,ce=(B&8)!==0;let ie=0;const De=(B&16)!==0;let Be=0;const ct=(B&32)!==0;let Oe=8;S===r&&(P&&(Oe+=8),Q&&(Oe+=4),ce&&(ie=ke(x,Oe),Oe+=4),De&&(Be=ke(x,Oe),Oe+=4),ct&&(Oe+=4),e.type==="video"&&(s=vt(e.codec)),q(h,["trun"]).map($e=>{const Xe=$e[0],Ce=ke($e,0)&16777215,St=(Ce&1)!==0;let Nt=0;const sn=(Ce&4)!==0,Xt=(Ce&256)!==0;let Yt=0;const Vt=(Ce&512)!==0;let hn=0;const Bt=(Ce&1024)!==0,bn=(Ce&2048)!==0;let dn=0;const zt=ke($e,4);let Ft=8;St&&(Nt=ke($e,Ft),Ft+=4),sn&&(Ft+=4);let In=Nt+u;for(let Mn=0;Mn<zt;Mn++){if(Xt?(Yt=ke($e,Ft),Ft+=4):Yt=ie,Vt?(hn=ke($e,Ft),Ft+=4):hn=Be,Bt&&(Ft+=4),bn&&(Xe===0?dn=ke($e,Ft):dn=ye($e,Ft),Ft+=4),e.type===D.VIDEO){let jn=0;for(;jn<hn;){const Gn=ke(n,In);if(In+=4,ge(s,n[In])){const mi=n.subarray(In,In+Gn);Ae(mi,s?2:1,a+dn/i,t)}In+=Gn,jn+=Gn+4}}a+=Yt/i}}))})})}),t}function vt(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function ge(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Ae(a,e,t,n){const i=Ze(a);let r=0;r+=e;let s=0,o=0,c=0;for(;r<i.length;){s=0;do{if(r>=i.length)break;c=i[r++],s+=c}while(c===255);o=0;do{if(r>=i.length)break;c=i[r++],o+=c}while(c===255);const u=i.length-r;let f=r;if(o<u)r+=o;else if(o>u){Z.error(`Malformed SEI payload. ${o} is too small, only ${u} bytes left to parse.`);break}if(s===4){if(i[f++]===181){const v=mt(i,f);if(f+=2,v===49){const x=ke(i,f);if(f+=4,x===1195456820){const S=i[f++];if(S===3){const B=i[f++],P=31&B,Q=64&B,ce=Q?2+P*3:0,ie=new Uint8Array(ce);if(Q){ie[0]=B;for(let De=1;De<ce;De++)ie[De]=i[f++]}n.push({type:S,payloadType:s,pts:t,bytes:ie})}}}}}else if(s===5&&o>16){const h=[];for(let S=0;S<16;S++){const B=i[f++].toString(16);h.push(B.length==1?"0"+B:B),(S===3||S===5||S===7||S===9)&&h.push("-")}const v=o-16,x=new Uint8Array(v);for(let S=0;S<v;S++)x[S]=i[f++];n.push({payloadType:s,pts:t,uuid:h.join(""),userData:Re(x),userDataBytes:x})}}}function Ze(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,c=0,u=0;if(e===0){for(;Me(a.subarray(u,u+1))!=="\0";)t+=Me(a.subarray(u,u+1)),u+=1;for(t+=Me(a.subarray(u,u+1)),u+=1;Me(a.subarray(u,u+1))!=="\0";)n+=Me(a.subarray(u,u+1)),u+=1;n+=Me(a.subarray(u,u+1)),u+=1,i=ke(a,12),r=ke(a,16),o=ke(a,20),c=ke(a,24),u=28}else if(e===1){u+=4,i=ke(a,u),u+=4;const h=ke(a,u);u+=4;const v=ke(a,u);for(u+=4,s=Qo(2,32)*h+v,le(s)||(s=Number.MAX_SAFE_INTEGER,Z.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=ke(a,u),u+=4,c=ke(a,u),u+=4;Me(a.subarray(u,u+1))!=="\0";)t+=Me(a.subarray(u,u+1)),u+=1;for(t+=Me(a.subarray(u,u+1)),u+=1;Me(a.subarray(u,u+1))!=="\0";)n+=Me(a.subarray(u,u+1)),u+=1;n+=Me(a.subarray(u,u+1)),u+=1}const f=a.subarray(u,a.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:s,presentationTimeDelta:r,eventDuration:o,id:c,payload:f}}function Ke(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 pt(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),Ke([112,115,115,104],new Uint8Array([n,0,0,0]),a,r,i,s,t||new Uint8Array)}const gt=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),He={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 bt(a,e){const t=He[e];return!!t&&!!t[a.slice(0,4)]}function Ct(a,e,t=!0){return!a.split(",").some(n=>!it(n,e,t))}function it(a,e,t=!0){var n;const i=ae(t);return(n=i==null?void 0:i.isTypeSupported(wt(a,e)))!=null?n:!1}function wt(a,e){return`${e}/mp4;codecs=${a}`}function _e(a){if(a){const e=a.substring(0,4);return He.video[e]}return 2}function me(a){const e=gt();return a.split(",").reduce((t,n)=>{const r=e&&vt(n)?9:He.video[n];return r?(r*2+t)/(t?3:2):(He.audio[n]+t)/(t?2:1)},0)}const pe={};function C(a,e=!0){if(pe[a])return pe[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(it(t[i],"audio",e))return pe[a]=t[i],t[i];if(t[i]==="mp3"&&(n=ae(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return a}const j=/flac|opus|mp4a\.40\.34/i;function X(a,e=!0){return a.replace(j,t=>C(t.toLowerCase(),e))}function te(a,e){const t=[];if(a){const n=a.split(",");for(let i=0;i<n.length;i++)bt(n[i],"video")||t.push(n[i])}return e&&t.push(e),t.join(",")}function fe(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1)&&(ve(a,"audio")||ve(a,"video")))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 ve(a,e){return bt(a,e)&&it(a,e)}function Te(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");n.length>2&&n[0]==="avc1"&&(e[t]=`avc1.${parseInt(n[1]).toString(16)}${("000"+parseInt(n[2]).toString(16)).slice(-4)}`)}return e.join(",")}function Ie(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 je(a){const e=ae(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 _t(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Dt={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function dt(a,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:a}}function at(a,e,t,n,i,r){const s=a.videoCodec,o=a.audioCodec?a.audioGroups:null,c=r==null?void 0:r.audioCodec,u=r==null?void 0:r.channels,f=u?parseInt(u):c?1/0:2;let h=null;if(o!=null&&o.length)try{o.length===1&&o[0]?h=e.groups[o[0]].channels:h=o.reduce((v,x)=>{if(x){const S=e.groups[x];if(!S)throw new Error(`Audio track group ${x} not found`);Object.keys(S.channels).forEach(B=>{v[B]=(v[B]||0)+S.channels[B]})}return v},{2:0})}catch(v){return!0}return s!==void 0&&(s.split(",").some(v=>vt(v))||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))||!!h&&E(f)&&Object.keys(h).some(v=>parseInt(v)>f)}function Rt(a,e,t,n={}){const i=a.videoCodec;if(!i&&!a.audioCodec||!t)return Promise.resolve(Dt);const r=[],s=Gt(a),o=s.length,c=kt(a,e,o>0),u=c.length;for(let f=o||1*u||1;f--;){const h={type:"media-source"};if(o&&(h.video=s[f%o]),u){h.audio=c[f%u];const v=h.audio.bitrate;h.video&&v&&(h.video.bitrate-=v)}r.push(h)}if(i){const f=navigator.userAgent;if(i.split(",").some(h=>vt(h))&>())return Promise.resolve(dt(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${f})`),r))}return Promise.all(r.map(f=>{const h=Ye(f);return n[h]||(n[h]=t.decodingInfo(f))})).then(f=>({supported:!f.some(h=>!h.supported),configurations:r,decodingInfoResults:f})).catch(f=>({supported:!1,configurations:r,decodingInfoResults:[],error:f}))}function Gt(a){var e;const t=(e=a.videoCodec)==null?void 0:e.split(","),n=ot(a),i=a.width||640,r=a.height||480,s=a.frameRate||30,o=a.videoRange.toLowerCase();return t?t.map(c=>{const u={contentType:wt(Ie(c),"video"),width:i,height:r,bitrate:n,framerate:s};return o!=="sdr"&&(u.transferFunction=o),u}):[]}function kt(a,e,t){var n;const i=(n=a.audioCodec)==null?void 0:n.split(","),r=ot(a);return i&&a.audioGroups?a.audioGroups.reduce((s,o)=>{var c;const u=o?(c=e.groups[o])==null?void 0:c.tracks:null;return u?u.reduce((f,h)=>{if(h.groupId===o){const v=parseFloat(h.channels||"");i.forEach(x=>{const S={contentType:wt(x,"audio"),bitrate:t?Ot(x,r):r};v&&(S.channels=""+v),f.push(S)})}return f},s):s},[]):[]}function Ot(a,e){if(e<=1)return 1;let t=128e3;return a==="ec-3"?t=768e3:a==="ac-3"&&(t=64e4),Math.min(e/2,t)}function ot(a){return Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)/1e3)*1e3||1}function Ye(a){let e="";const{audio:t,video:n}=a;if(n){const i=_t(n.contentType);e+=`${i}_r${n.height}x${n.width}f${Math.ceil(n.framerate)}${n.transferFunction||"sd"}_${Math.ceil(n.bitrate/1e5)}`}if(t){const i=_t(t.contentType);e+=`${n?"_":""}${i}_c${t.channels}`}return e}const yt=["NONE","TYPE-0","TYPE-1",null];function Pt(a){return yt.indexOf(a)>-1}const Ht=["SDR","PQ","HLG"];function un(a){return!!a&&Ht.indexOf(a)>-1}var Bn={No:"",Yes:"YES",v2:"v2"};function fn(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,i=n<e/2;return e&&i?t?Bn.v2:Bn.Yes:Bn.No}class pn{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 Sn{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 tn(this._audioGroups,e)}hasSubtitleGroup(e){return tn(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 tn(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function On(){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 Tn(a,e){let t=!1,n=[];if(a&&(t=a!=="SDR",n=[a]),e){n=e.allowedVideoRanges||Ht.slice(0);const i=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&On(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const ai=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}},Kt=(a,e)=>JSON.stringify(a,ai(e));function _n(a,e,t,n,i){const r=Object.keys(a),s=n==null?void 0:n.channels,o=n==null?void 0:n.audioCodec,c=i==null?void 0:i.videoCodec,u=s&&parseInt(s)===2;let f=!1,h=!1,v=1/0,x=1/0,S=1/0,B=1/0,P=0,Q=[];const{preferHDR:ce,allowedVideoRanges:ie}=Tn(e,i);for(let $e=r.length;$e--;){const Xe=a[r[$e]];f||(f=Xe.channels[2]>0),v=Math.min(v,Xe.minHeight),x=Math.min(x,Xe.minFramerate),S=Math.min(S,Xe.minBitrate),ie.filter(St=>Xe.videoRanges[St]>0).length>0&&(h=!0)}v=E(v)?v:0,x=E(x)?x:0;const De=Math.max(1080,v),Be=Math.max(30,x);S=E(S)?S:t,t=Math.max(S,t),h||(e=void 0);const ct=r.length>1;return{codecSet:r.reduce(($e,Xe)=>{const Ce=a[Xe];if(Xe===$e)return $e;if(Q=h?ie.filter(St=>Ce.videoRanges[St]>0):[],ct){if(Ce.minBitrate>t)return vn(Xe,`min bitrate of ${Ce.minBitrate} > current estimate of ${t}`),$e;if(!Ce.hasDefaultAudio)return vn(Xe,"no renditions with default or auto-select sound found"),$e;if(o&&Xe.indexOf(o.substring(0,4))%5!==0)return vn(Xe,`audio codec preference "${o}" not found`),$e;if(s&&!u){if(!Ce.channels[s])return vn(Xe,`no renditions with ${s} channel sound found (channels options: ${Object.keys(Ce.channels)})`),$e}else if((!o||u)&&f&&Ce.channels[2]===0)return vn(Xe,"no renditions with stereo sound found"),$e;if(Ce.minHeight>De)return vn(Xe,`min resolution of ${Ce.minHeight} > maximum of ${De}`),$e;if(Ce.minFramerate>Be)return vn(Xe,`min framerate of ${Ce.minFramerate} > maximum of ${Be}`),$e;if(!Q.some(St=>Ce.videoRanges[St]>0))return vn(Xe,`no variants with VIDEO-RANGE of ${Kt(Q)} found`),$e;if(c&&Xe.indexOf(c.substring(0,4))%5!==0)return vn(Xe,`video codec preference "${c}" not found`),$e;if(Ce.maxScore<P)return vn(Xe,`max score of ${Ce.maxScore} < selected max of ${P}`),$e}return $e&&(me(Xe)>=me($e)||Ce.fragmentError>a[$e].fragmentError)?$e:(B=Ce.minIndex,P=Ce.maxScore,Xe)},void 0),videoRanges:Q,preferHDR:ce,minFramerate:x,minBitrate:S,minIndex:B}}function vn(a,e){Z.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function jt(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 Mt(a,e,t,n){return a.slice(t,n+1).reduce((i,r,s)=>{if(!r.codecSet)return i;const o=r.audioGroups;let c=i[r.codecSet];c||(i[r.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,r.bitrate);const u=Math.min(r.height,r.width);return c.minHeight=Math.min(c.minHeight,u),c.minFramerate=Math.min(c.minFramerate,r.frameRate),c.minIndex=Math.min(c.minIndex,s),c.maxScore=Math.max(c.maxScore,r.score),c.fragmentError+=r.fragmentError,c.videoRanges[r.videoRange]=(c.videoRanges[r.videoRange]||0)+1,o&&o.forEach(f=>{if(!f)return;const h=e.groups[f];h&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?h.hasDefault:h.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(h.channels).forEach(v=>{c.channels[v]=(c.channels[v]||0)+h.channels[v]}))}),i},{})}function we(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 Je(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(ht(a,i,t))return n}return-1}function ht(a,e,t){const{groupId:n,name:i,lang:r,assocLang:s,default:o}=a,c=a.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(r===void 0||lt(r,e.lang))&&(r===void 0||e.assocLang===s)&&(o===void 0||e.default===o)&&(c===void 0||e.forced===c)&&(!("characteristics"in a)||Et(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function lt(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function Et(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.indexOf(i)===-1)}function xt(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 It(a,e,t,n,i){const r=e[n],o=e.reduce((v,x,S)=>{const B=x.uri;return(v[B]||(v[B]=[])).push(S),v},{})[r.uri];o.length>1&&(n=Math.max.apply(Math,o));const c=r.videoRange,u=r.frameRate,f=r.codecSet.substring(0,4),h=Wt(e,n,v=>{if(v.videoRange!==c||v.frameRate!==u||v.codecSet.substring(0,4)!==f)return!1;const x=v.audioGroups,S=t.filter(B=>!x||x.indexOf(B.groupId)!==-1);return Je(a,S,i)>-1});return h>-1?h:Wt(e,n,v=>{const x=v.audioGroups,S=t.filter(B=>!x||x.indexOf(B.groupId)!==-1);return Je(a,S,i)>-1})}function Wt(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 yn(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class nn extends K{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.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:i,partCurrent:r,hls:s}=this,{autoLevelEnabled:o,media:c}=s;if(!i||!c)return;const u=performance.now(),f=r?r.stats:i.stats,h=r?r.duration:i.duration,v=u-f.loading.start,x=s.minAutoLevel,S=i.level,B=this._nextAutoLevel;if(f.aborted||f.loaded&&f.loaded===f.total||S<=x){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const P=B>-1&&B!==S,Q=!!t||P;if(!Q&&(c.paused||!c.playbackRate||!c.readyState))return;const ce=s.mainForwardBufferInfo;if(!Q&&ce===null)return;const ie=this.bwEstimator.getEstimateTTFB(),De=Math.abs(c.playbackRate);if(v<=Math.max(ie,1e3*(h/(De*2))))return;const Be=ce?ce.len/De:0,ct=f.loading.first?f.loading.first-f.loading.start:-1,Oe=f.loaded&&ct>-1,$e=this.getBwEstimate(),Xe=s.levels,Ce=Xe[S],St=Math.max(f.loaded,Math.round(h*(i.bitrate||Ce.averageBitrate)/8));let Nt=Oe?v-ct:v;Nt<1&&Oe&&(Nt=Math.min(v,f.loaded*8/$e));const sn=Oe?f.loaded*1e3/Nt:0,Xt=ie/1e3,Yt=sn?(St-f.loaded)/sn:St*8/$e+Xt;if(Yt<=Be)return;const Vt=sn?sn*8:$e,hn=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,Bt=this.hls.config.abrBandWidthUpFactor;let bn=Number.POSITIVE_INFINITY,dn;for(dn=S-1;dn>x;dn--){const Mn=Xe[dn].maxBitrate,jn=!Xe[dn].details||hn;if(bn=this.getTimeToLoadFrag(Xt,Vt,h*Mn,jn),bn<Math.min(Be,h+Xt))break}if(bn>=Yt||bn>h*10)return;Oe?this.bwEstimator.sample(v-Math.min(ie,ct),f.loaded):this.bwEstimator.sampleTTFB(v);const zt=Xe[dn].maxBitrate;this.getBwEstimate()*Bt>zt&&this.resetEstimator(zt);const Ft=this.findBestLevel(zt,x,dn,0,Be,1,1);Ft>-1&&(dn=Ft),this.warn(`Fragment ${i.sn}${r?" part "+r.index:""} of level ${S} is loading too slowly;
|
|
Fragment duration: ${i.duration.toFixed(3)}
|
|
Time to underbuffer: ${Be.toFixed(3)} s
|
|
Estimated load time for current fragment: ${Yt.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${bn.toFixed(3)} s
|
|
TTFB estimate: ${ct|0} ms
|
|
Current BW estimate: ${E($e)?$e|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${dn} @ ${zt|0} bps`),s.nextLoadLevel=s.nextAutoLevel=dn,this.clearTimer();const In=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===dn&&dn>0){const Mn=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${dn>0?"and switching down":""}
|
|
Fragment duration: ${i.duration.toFixed(3)} s
|
|
Time to underbuffer: ${Mn.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,dn>x){let jn=this.findBestLevel(this.hls.levels[x].bitrate,x,dn,0,Mn,1,1);jn===-1&&(jn=x),this.hls.nextLoadLevel=this.hls.nextAutoLevel=jn,this.resetEstimator(this.hls.levels[jn].bitrate)}}};P||Yt>bn*2?In():this.timer=self.setInterval(In,bn*1e3),s.trigger(p.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:f})},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 G(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(p.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},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 W.BUFFER_ADD_CODEC_ERROR:case W.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case W.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,c=s-o.loading.start,u=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&u>-1){const h=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(h,u),o.loaded)}else this.bwEstimator.sampleTTFB(c)}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;E(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===Y.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,c=(s.loaded?s.loaded.duration:0)+r;s.loaded={bytes:o,duration:c},s.realBitrate=Math.round(8*o/c)}if(t.bitrateTest){const r={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(p.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!==Y.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,c=this.getBwEstimate(),u=this.getStarvationDelay();let f=r.abrBandWidthFactor,h=r.abrBandWidthUpFactor;if(u){const P=this.findBestLevel(c,s,i,u,0,f,h);if(P>=0)return this.rebufferNotice=-1,P}let v=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!u){const P=this.bitrateTestDelay;P&&(v=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-P,this.info(`bitrate test took ${Math.round(1e3*P)}ms, set first fragment max fetchDuration to ${Math.round(1e3*v)} ms`),f=h=1)}const x=this.findBestLevel(c,s,i,u,v,f,h);if(this.rebufferNotice!==x&&(this.rebufferNotice=x,this.info(`${u?"rebuffering expected":"buffer is empty"}, optimal quality level ${x}`)),x>-1)return x;const S=n.levels[s],B=n.loadLevelObj;return B&&(S==null?void 0:S.bitrate)<B.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 c;const u=i+r,f=this.lastLoadedFragLevel,h=f===-1?this.hls.firstLevel:f,{fragCurrent:v,partCurrent:x}=this,{levels:S,allAudioTracks:B,loadLevel:P,config:Q}=this.hls;if(S.length===1)return 0;const ce=S[h],ie=!!((c=this.hls.latestLevelDetails)!=null&&c.live),De=P===-1||f===-1;let Be,ct="SDR",Oe=(ce==null?void 0:ce.frameRate)||0;const{audioPreference:$e,videoPreference:Xe}=Q,Ce=this.audioTracksByGroup||(this.audioTracksByGroup=jt(B));let St=-1;if(De){if(this.firstSelection!==-1)return this.firstSelection;const hn=this.codecTiers||(this.codecTiers=Mt(S,Ce,t,n)),Bt=_n(hn,ct,e,$e,Xe),{codecSet:bn,videoRanges:dn,minFramerate:zt,minBitrate:Ft,minIndex:In,preferHDR:Mn}=Bt;St=In,Be=bn,ct=Mn?dn[dn.length-1]:dn[0],Oe=zt,e=Math.max(e,Ft),this.log(`picked start tier ${Kt(Bt)}`)}else Be=ce==null?void 0:ce.codecSet,ct=ce==null?void 0:ce.videoRange;const Nt=x?x.duration:v?v.duration:0,sn=this.bwEstimator.getEstimateTTFB()/1e3,Xt=[];for(let hn=n;hn>=t;hn--){var Yt,Vt;const Bt=S[hn],bn=hn>h;if(!Bt)continue;if(Q.useMediaCapabilities&&!Bt.supportedResult&&!Bt.supportedPromise){const Gn=navigator.mediaCapabilities;typeof(Gn==null?void 0:Gn.decodingInfo)=="function"&&at(Bt,Ce,ct,Oe,e,$e)?(Bt.supportedPromise=Rt(Bt,Ce,Gn,this.supportedCache),Bt.supportedPromise.then(mi=>{if(!this.hls)return;Bt.supportedResult=mi;const ji=this.hls.levels,Pi=ji.indexOf(Bt);mi.error?this.warn(`MediaCapabilities decodingInfo error: "${mi.error}" for level ${Pi} ${Kt(mi)}`):mi.supported?mi.decodingInfoResults.some(Vi=>Vi.smooth===!1||Vi.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${Pi} not smooth or powerEfficient: ${Kt(mi)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${Pi} ${Kt(mi)}`),Pi>-1&&ji.length>1&&(this.log(`Removing unsupported level ${Pi}`),this.hls.removeLevel(Pi),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):Bt.supportedResult=Dt}if((Be&&Bt.codecSet!==Be||ct&&Bt.videoRange!==ct||bn&&Oe>Bt.frameRate||!bn&&Oe>0&&Oe<Bt.frameRate||(Yt=Bt.supportedResult)!=null&&(Vt=Yt.decodingInfoResults)!=null&&Vt.some(Gn=>Gn.smooth===!1))&&(!De||hn!==St)){Xt.push(hn);continue}const dn=Bt.details,zt=(x?dn==null?void 0:dn.partTarget:dn==null?void 0:dn.averagetargetduration)||Nt;let Ft;bn?Ft=o*e:Ft=s*e;const In=Nt&&i>=Nt*2&&r===0?Bt.averageBitrate:Bt.maxBitrate,Mn=this.getTimeToLoadFrag(sn,Ft,In*zt,dn===void 0);if(Ft>=In&&(hn===f||Bt.loadError===0&&Bt.fragmentError===0)&&(Mn<=sn||!E(Mn)||ie&&!this.bitrateTestDelay||Mn<u)){const Gn=this.forcedAutoLevel;return hn!==P&&(Gn===-1||Gn!==P)&&(Xt.length&&this.trace(`Skipped level(s) ${Xt.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${S[Xt[0]].codecs}" ${S[Xt[0]].videoRange}; not compatible with "${Be}" ${ct}`),this.info(`switch candidate:${h}->${hn} adjustedbw(${Math.round(Ft)})-bitrate=${Math.round(Ft-In)} ttfb:${sn.toFixed(1)} avgDuration:${zt.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${Mn.toFixed(1)} firstSelection:${De} codecSet:${Bt.codecSet} videoRange:${Bt.videoRange} hls.loadLevel:${P}`)),De&&(this.firstSelection=hn),hn}}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 Fn={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 Qt(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!E(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;for(let r=0;r<a.length;++r){const s=a[r];if(An(e,t,s))return s}return null}function en(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)&&En(t,n,r)===0||ln(r,a,Math.min(i,n))))return r;const s=Fn.search(e,En.bind(null,t,n));return s&&(s!==a||!r)?s:r}function ln(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 En(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 An(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function Jt(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){let n=a.fragments;const{fragmentHint:i}=a;i&&(n=n.concat(i));let r;return Fn.search(n,s=>s.cc<e?1:s.cc>e?-1:(r=s,s.end<=t?1:s.start>t?-1:0)),r||null}return null}function rn(a){switch(a.details){case W.FRAG_LOAD_TIMEOUT:case W.KEY_LOAD_TIMEOUT:case W.LEVEL_LOAD_TIMEOUT:case W.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function kn(a,e){const t=rn(e);return a.default[`${t?"timeout":"error"}Retry`]}function gn(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function mn(a){return y(y({},a),{errorRetry:null,timeoutRetry:null})}function Ln(a,e,t,n){if(!a)return!1;const i=n==null?void 0:n.code,r=e<a.maxNumRetry&&(wn(i)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,r):r}function wn(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},Pn={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Hn extends K{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(p.ERROR,this.onError,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.ERROR,this.onError,this),e.off(p.ERROR,this.onErrorOut,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.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)===Y.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 W.FRAG_LOAD_ERROR:case W.FRAG_LOAD_TIMEOUT:case W.KEY_LOAD_ERROR:case W.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case W.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=ni();return}case W.FRAG_GAP:case W.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=cn.SendAlternateToPenaltyBox;return}case W.LEVEL_EMPTY_ERROR:case W.LEVEL_PARSING_ERROR:{var s,o;const u=t.parent===Y.MAIN?t.level:i.loadLevel;t.details===W.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(o=s.levelDetails)!=null&&o.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,u):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,u))}return;case W.LEVEL_LOAD_ERROR:case W.LEVEL_LOAD_TIMEOUT:typeof(r==null?void 0:r.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case W.AUDIO_TRACK_LOAD_ERROR:case W.AUDIO_TRACK_LOAD_TIMEOUT:case W.SUBTITLE_LOAD_ERROR:case W.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const u=i.loadLevelObj;if(u&&(r.type===ue.AUDIO_TRACK&&u.hasAudioGroup(r.groupId)||r.type===ue.SUBTITLE_TRACK&&u.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=cn.SendAlternateToPenaltyBox,t.errorAction.flags=Pn.MoveAllAlternatesMatchingHost;return}}return;case W.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const u=i.loadLevelObj,f=u==null?void 0:u.attrs["HDCP-LEVEL"];f?t.errorAction={action:cn.SendAlternateToPenaltyBox,flags:Pn.MoveAllAlternatesMatchingHDCP,hdcpLevel:f}:this.keySystemError(t)}return;case W.BUFFER_ADD_CODEC_ERROR:case W.REMUX_ALLOC_ERROR:case W.BUFFER_APPEND_ERROR:if(!t.errorAction){var c;t.errorAction=this.getLevelSwitchAction(t,(c=t.level)!=null?c:i.loadLevel)}return;case W.INTERNAL_EXCEPTION:case W.BUFFER_APPENDING_ERROR:case W.BUFFER_FULL_ERROR:case W.LEVEL_SWITCH_ERROR:case W.BUFFER_STALLED_ERROR:case W.BUFFER_SEEK_OVER_HOLE:case W.BUFFER_NUDGE_ON_STALL:t.errorAction=ni();return}t.type===ee.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=kn(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(Ln(i,r,rn(e),e.response))return{action:cn.RetryRequest,flags:Pn.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=kn(e.details.startsWith("key")?s:r,e),c=t.levels.reduce((f,h)=>f+h.fragmentError,0);if(i&&(e.details!==W.FRAG_GAP&&i.fragmentError++,Ln(o,c,rn(e),e.response)))return{action:cn.RetryRequest,flags:Pn.None,retryConfig:o,retryCount:c};const u=this.getLevelSwitchAction(e,n);return o&&(u.retryConfig=o,u.retryCount=c),u}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,s;const u=e.details;i.loadError++,u===W.BUFFER_APPEND_ERROR&&i.fragmentError++;let f=-1;const{levels:h,loadLevel:v,minAutoLevel:x,maxAutoLevel:S}=n;!n.autoLevelEnabled&&!n.config.preserveManualLevelOnError&&(n.loadLevel=-1);const B=(r=e.frag)==null?void 0:r.type,Q=(B===Y.AUDIO&&u===W.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(u===W.BUFFER_ADD_CODEC_ERROR||u===W.BUFFER_APPEND_ERROR))&&h.some(({audioCodec:ct})=>i.audioCodec!==ct),ie=e.sourceBufferName==="video"&&(u===W.BUFFER_ADD_CODEC_ERROR||u===W.BUFFER_APPEND_ERROR)&&h.some(({codecSet:ct,audioCodec:Oe})=>i.codecSet!==ct&&i.audioCodec===Oe),{type:De,groupId:Be}=(s=e.context)!=null?s:{};for(let ct=h.length;ct--;){const Oe=(ct+v)%h.length;if(Oe!==v&&Oe>=x&&Oe<=S&&h[Oe].loadError===0){var o,c;const $e=h[Oe];if(u===W.FRAG_GAP&&B===Y.MAIN&&e.frag){const Xe=h[Oe].details;if(Xe){const Ce=en(e.frag,Xe.fragments,e.frag.start);if(Ce!=null&&Ce.gap)continue}}else{if(De===ue.AUDIO_TRACK&&$e.hasAudioGroup(Be)||De===ue.SUBTITLE_TRACK&&$e.hasSubtitleGroup(Be))continue;if(B===Y.AUDIO&&(o=i.audioGroups)!=null&&o.some(Xe=>$e.hasAudioGroup(Xe))||B===Y.SUBTITLE&&(c=i.subtitleGroups)!=null&&c.some(Xe=>$e.hasSubtitleGroup(Xe))||Q&&i.audioCodec===$e.audioCodec||!Q&&i.audioCodec!==$e.audioCodec||ie&&i.codecSet===$e.codecSet)continue}f=Oe;break}}if(f>-1&&n.loadLevel!==f)return e.levelRetry=!0,this.playlistError=0,{action:cn.SendAlternateToPenaltyBox,flags:Pn.None,nextAutoLevel:f}}return{action:cn.SendAlternateToPenaltyBox,flags:Pn.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!==W.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 Pn.None:this.switchLevel(e,s);break;case Pn.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=yt[yt.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===W.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=_t(e.mimeType),i=this.hls.levels;for(let r=i.length;r--;)i[r][`${e.sourceBufferName}Codec`]===n&&this.hls.removeLevel(r)}}}function ni(a){const e={action:cn.DoNothing,flags:Pn.None};return a&&(e.resolved=!0),e}var xn={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class ii{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(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.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 c=o.body;if(c.start<=e&&e<=c.end)return c}}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 c=this.fragments[o];if(!c||s>=c.body.sn)return;if(!c.buffered&&(!c.loaded||r)){c.body.type===n&&this.removeFragment(c.body);return}const u=c.range[e];if(u){if(u.time.length===0){this.removeFragment(c.body);return}u.time.some(f=>{const h=!this.isTimeBuffered(f.startPTS,f.endPTS,t);return h&&this.removeFragment(c.body),h})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,i=Nn(n),r=this.fragments[i];if(!r||r.buffered&&n.gap)return;const s=!n.relurl;Object.keys(t).forEach(o=>{const c=n.elementaryStreams[o];if(!c)return;const u=t[o],f=s||c.partial===!0;r.range[o]=this.getBufferedTimes(n,e.part,f,u)}),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),ri(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=Nn(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,c=e.minEndPTS||o,u=e.maxStartPTS||s;for(let f=0;f<i.length;f++){const h=i.start(f)-this.bufferPadding,v=i.end(f)+this.bufferPadding;if(u>=h&&c<=v){r.time.push({startPTS:Math.max(s,i.start(f)),endPTS:Math.min(o,i.end(f))});break}else if(s<v&&o>h){const x=Math.max(s,i.start(f)),S=Math.min(o,i.end(f));S>x&&(r.partial=!0,r.time.push({startPTS:x,endPTS:S}))}else if(o<=h)break}return r}getPartialFragment(e){let t=null,n,i,r,s=0;const{bufferPadding:o,fragments:c}=this;return Object.keys(c).forEach(u=>{const f=c[u];f&&ri(f)&&(i=f.body.start-o,r=f.body.end+o,e>=i&&e<=r&&(n=Math.min(e-i,r-e),s<=n&&(t=f.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||ri(t))}getState(e){const t=Nn(e),n=this.fragments[t];return n?n.buffered?ri(n)?xn.PARTIAL:xn.OK:xn.APPENDING:xn.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=Nn(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 u=this.activePartLists[o];u||(this.activePartLists[o]=u=[]),u.push(i)}this.timeRanges=r;const c=r[s];this.detectEvictedFragments(s,c,o,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Nn(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 c=o.body;c.type!==n||i&&!c.gap||c.start<t&&c.end>e&&(o.buffered||r)&&this.removeFragment(c)})}removeFragment(e){const t=Nn(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 ri(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 Nn(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 Zn={cbc:0,ctr:1};class Xn{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 Zn.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Zn.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 Ei(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class Un{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],c=this.invSubMix,u=c[0],f=c[1],h=c[2],v=c[3],x=new Uint32Array(256);let S=0,B=0,P=0;for(P=0;P<256;P++)P<128?x[P]=P<<1:x[P]=P<<1^283;for(P=0;P<256;P++){let Q=B^B<<1^B<<2^B<<3^B<<4;Q=Q>>>8^Q&255^99,e[S]=Q,t[Q]=S;const ce=x[S],ie=x[ce],De=x[ie];let Be=x[Q]*257^Q*16843008;i[S]=Be<<24|Be>>>8,r[S]=Be<<16|Be>>>16,s[S]=Be<<8|Be>>>24,o[S]=Be,Be=De*16843009^ie*65537^ce*257^S*16843008,u[Q]=Be<<24|Be>>>8,f[Q]=Be<<16|Be>>>16,h[Q]=Be<<8|Be>>>24,v[Q]=Be,S?(S=ce^x[x[x[De^ce]]],B^=x[x[B]]):S=B=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,c;const u=this.keySchedule=new Uint32Array(s),f=this.invKeySchedule=new Uint32Array(s),h=this.sBox,v=this.rcon,x=this.invSubMix,S=x[0],B=x[1],P=x[2],Q=x[3];let ce,ie;for(o=0;o<s;o++){if(o<r){ce=u[o]=t[o];continue}ie=ce,o%r===0?(ie=ie<<8|ie>>>24,ie=h[ie>>>24]<<24|h[ie>>>16&255]<<16|h[ie>>>8&255]<<8|h[ie&255],ie^=v[o/r|0]<<24):r>6&&o%r===4&&(ie=h[ie>>>24]<<24|h[ie>>>16&255]<<16|h[ie>>>8&255]<<8|h[ie&255]),u[o]=ce=(u[o-r]^ie)>>>0}for(c=0;c<s;c++)o=s-c,c&3?ie=u[o]:ie=u[o-4],c<4||o<=4?f[c]=ie:f[c]=S[h[ie>>>24]]^B[h[ie>>>16&255]]^P[h[ie>>>8&255]]^Q[h[ie&255]],f[c]=f[c]>>>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,c=o[0],u=o[1],f=o[2],h=o[3],v=this.uint8ArrayToUint32Array_(n);let x=v[0],S=v[1],B=v[2],P=v[3];const Q=new Int32Array(e),ce=new Int32Array(Q.length);let ie,De,Be,ct,Oe,$e,Xe,Ce,St,Nt,sn,Xt,Yt,Vt;const hn=this.networkToHostOrderSwap;for(;t<Q.length;){for(St=hn(Q[t]),Nt=hn(Q[t+1]),sn=hn(Q[t+2]),Xt=hn(Q[t+3]),Oe=St^r[0],$e=Xt^r[1],Xe=sn^r[2],Ce=Nt^r[3],Yt=4,Vt=1;Vt<i;Vt++)ie=c[Oe>>>24]^u[$e>>16&255]^f[Xe>>8&255]^h[Ce&255]^r[Yt],De=c[$e>>>24]^u[Xe>>16&255]^f[Ce>>8&255]^h[Oe&255]^r[Yt+1],Be=c[Xe>>>24]^u[Ce>>16&255]^f[Oe>>8&255]^h[$e&255]^r[Yt+2],ct=c[Ce>>>24]^u[Oe>>16&255]^f[$e>>8&255]^h[Xe&255]^r[Yt+3],Oe=ie,$e=De,Xe=Be,Ce=ct,Yt=Yt+4;ie=s[Oe>>>24]<<24^s[$e>>16&255]<<16^s[Xe>>8&255]<<8^s[Ce&255]^r[Yt],De=s[$e>>>24]<<24^s[Xe>>16&255]<<16^s[Ce>>8&255]<<8^s[Oe&255]^r[Yt+1],Be=s[Xe>>>24]<<24^s[Ce>>16&255]<<16^s[Oe>>8&255]<<8^s[$e&255]^r[Yt+2],ct=s[Ce>>>24]<<24^s[Oe>>16&255]<<16^s[$e>>8&255]<<8^s[Xe&255]^r[Yt+3],ce[t]=hn(ie^x),ce[t+1]=hn(ct^S),ce[t+2]=hn(Be^B),ce[t+3]=hn(De^P),x=St,S=Nt,B=sn,P=Xt,t=t+4}return ce.buffer}}class Vn{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=vi(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function vi(a){switch(a){case Zn.cbc:return"AES-CBC";case Zn.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const Ci=16;class li{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?Ei(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 c=this.flush();c?r(c.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!==Zn.cbc||t.byteLength!==16)return Z.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=Ve(o,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;r&&(n=r);let u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new Un),u.expandKey(t);const f=s;return this.currentResult=u.decrypt(c.buffer,0,n),this.currentIV=c.slice(-16).buffer,f||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 Vn(this.subtle,t,i)}return this.fastAesKey.expandKey().then(r=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Xn(this.subtle,new Uint8Array(n),i).decrypt(e.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(Z.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%Ci;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(Z.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Ai=Math.pow(2,17);class ui{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 Qn({type:ee.NETWORK_ERROR,details:W.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,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(S=>S[0]==="GAP")){c(Ii(e));return}else e.gap=!1;const u=this.loader=r?new r(i):new s(i),f=oi(e);e.loader=u;const h=mn(i.fragLoadPolicy.default),v={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Ai};e.stats=u.stats;const x={onSuccess:(S,B,P,Q)=>{this.resetLoader(e,u);let ce=S.data;P.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(ce.slice(0,16)),ce=ce.slice(16)),o({frag:e,part:null,payload:ce,networkDetails:Q})},onError:(S,B,P,Q)=>{this.resetLoader(e,u),c(new Qn({type:ee.NETWORK_ERROR,details:W.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:y({url:n,data:void 0},S),error:new Error(`HTTP Error ${S.code} ${S.text}`),networkDetails:P,stats:Q}))},onAbort:(S,B,P)=>{this.resetLoader(e,u),c(new Qn({type:ee.NETWORK_ERROR,details:W.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:P,stats:S}))},onTimeout:(S,B,P)=>{this.resetLoader(e,u),c(new Qn({type:ee.NETWORK_ERROR,details:W.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:P,stats:S}))}};t&&(x.onProgress=(S,B,P,Q)=>t({frag:e,part:null,payload:P,networkDetails:Q})),u.load(f,v,x)})}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(Ii(e,t));return}const u=this.loader=r?new r(i):new s(i),f=oi(e,t);e.loader=u;const h=mn(i.fragLoadPolicy.default),v={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Ai};t.stats=u.stats,u.load(f,v,{onSuccess:(x,S,B,P)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const Q={frag:e,part:t,payload:x.data,networkDetails:P};n(Q),o(Q)},onError:(x,S,B,P)=>{this.resetLoader(e,u),c(new Qn({type:ee.NETWORK_ERROR,details:W.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:y({url:f.url,data:void 0},x),error:new Error(`HTTP Error ${x.code} ${x.text}`),networkDetails:B,stats:P}))},onAbort:(x,S,B)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),c(new Qn({type:ee.NETWORK_ERROR,details:W.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:B,stats:x}))},onTimeout:(x,S,B)=>{this.resetLoader(e,u),c(new Qn({type:ee.NETWORK_ERROR,details:W.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:B,stats:x}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const c=Math.round(e.duration/t.duration),u=Math.min(Math.round(n.loaded/r),c),h=(c-u)*Math.round(n.loaded/u);n.total=n.loaded+h}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 oi(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(E(i)&&E(r)){var s;let o=i,c=r;if(a.sn==="initSegment"&&xi((s=a.decryptdata)==null?void 0:s.method)){const u=r-i;u%16&&(c=r+(16-u%16)),i!==0&&(n.resetIV=!0,o=i-16)}n.rangeStart=o,n.rangeEnd=c}return n}function Ii(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:ee.MEDIA_ERROR,details:W.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new Qn(n)}function xi(a){return a==="AES-128"||a==="AES-256"}class Qn extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Jn extends K{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 ci{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=_i(),this.buffering={audio:_i(),video:_i(),audiovideo:_i()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=s}}function _i(){return{start:0,executeStart:0,executeEnd:0,end:0}}const Ri={length:0,start:()=>0,end:()=>0};class $t{static isBuffered(e,t){if(e){const n=$t.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=$t.getBuffered(e);return $t.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=$t.bufferedRanges(e);if(i.length)return $t.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((f,h)=>f.start-h.start||h.end-f.end);let i=-1,r=[];if(n)for(let f=0;f<e.length;f++){t>=e[f].start&&t<=e[f].end&&(i=f);const h=r.length;if(h){const v=r[h-1].end;e[f].start-v<n?e[f].end>v&&(r[h-1].end=e[f].end):r.push(e[f])}else r.push(e[f])}else r=e;let s=0,o,c=t,u=t;for(let f=0;f<r.length;f++){const h=r[f].start,v=r[f].end;if(i===-1&&t>=h&&t<=v&&(i=f),t+n>=h&&t<v)c=h,u=v,s=u-t;else if(t+n<h){o=h;break}}return{len:s,start:c||0,end:u||0,nextStart:o,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||Ri}catch(t){return Z.log("failed to get media.buffered",t),Ri}}}const di=/\{\$([a-zA-Z0-9-_]+)\}/g;function Si(a){return di.test(a)}function wi(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(di,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 Fi(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 Dn(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 qt=/^(\d+)x(\d+)$/,Cn=/(.+?)=(".*?"|.*?)(?:,|$)/g;class an{constructor(e,t){typeof e=="string"&&(e=an.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=qt.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(Cn.lastIndex=0;(n=Cn.exec(e))!==null;){const s=n[1].trim();let o=n[2];const c=o.indexOf(r)===0&&o.lastIndexOf(r)===o.length-1;let u=!1;if(c)o=o.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":u=!0}if(t&&(c||u))o=wi(t,o);else if(!u&&!c)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":Z.warn(`${e}: attribute ${s} is missing quotes`)}i[s]=o}return i}}const yi="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 pi(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class gi{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]){Z.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=m(new an({}),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"]);E(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?(Z.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(E(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===yi}get isValid(){return!!this.id&&!this._badValueForSameId&&E(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 Wi=10;class Ti{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?E(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Wi}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 Li(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function Mi(a){switch(a){case"AES-128":case"AES-256":return Zn.cbc;case"AES-256-CTR":return Zn.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function Ni(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function hi(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Bi(a){const e=hi(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function qi(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 bi(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=Ni(s)):t=Bi(s)}}return t}const Yn=typeof self!="undefined"?self:void 0;var Rn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},qn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Gi(a){switch(a){case qn.FAIRPLAY:return Rn.FAIRPLAY;case qn.PLAYREADY:return Rn.PLAYREADY;case qn.WIDEVINE:return Rn.WIDEVINE;case qn.CLEARKEY:return Rn.CLEARKEY}}function er(a){switch(a){case Rn.FAIRPLAY:return qn.FAIRPLAY;case Rn.PLAYREADY:return qn.PLAYREADY;case Rn.WIDEVINE:return qn.WIDEVINE;case Rn.CLEARKEY:return qn.CLEARKEY}}function tr(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[Rn.FAIRPLAY,Rn.WIDEVINE,Rn.PLAYREADY,Rn.CLEARKEY].filter(i=>!!e[i]):[];return!n[Rn.WIDEVINE]&&t&&n.push(Rn.WIDEVINE),n}const gr=function(a){return Yn!=null&&(a=Yn.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function fr(a,e,t,n){let i;switch(a){case Rn.FAIRPLAY:i=["cenc","sinf"];break;case Rn.WIDEVINE:case Rn.PLAYREADY:i=["cenc"];break;case Rn.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return xr(i,e,t,n)}function xr(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 Zt(a){var e;return a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function on(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 c=Ni(o).subarray(0,16);return qi(c),c}}return null}let Kn={};class ei{static clearKeyUriToKeyIdMap(){Kn={}}constructor(e,t,n,i=[1],r=null,s){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&&!Li(e),s!=null&&s.startsWith("0x")&&(this.keyId=new Uint8Array(w(s)))}matches(e){var t,n;return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&e.keyFormatVersions.join(",")===this.keyFormatVersions.join(",")&&((t=e.iv)==null?void 0:t.join(","))===((n=this.iv)==null?void 0:n.join(","))}isSupported(){if(this.method){if(Li(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case qn.FAIRPLAY:case qn.WIDEVINE:case qn.PLAYREADY:case qn.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(Li(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(Z.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=si(e);return new ei(this.method,this.uri,"identity",this.keyFormatVersions,n)}if(this.pssh&&this.keyId)return this;const t=bi(this.uri);if(t)switch(this.keyFormat){case qn.WIDEVINE:if(this.pssh=t,!this.keyId&&t.length>=22){const n=t.length-22;this.keyId=t.subarray(n,n+16)}break;case qn.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=pt(n,null,t),this.keyId=on(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=Kn[this.uri];if(!n){const i=Object.keys(Kn).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),Kn[this.uri]=n}this.keyId=n}return this}}function si(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const ar=/#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,Ui=/#EXT-X-MEDIA:(.*)/g,Cr=/^#EXT(?:INF|-X-TARGETDURATION):/m,or=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),as=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 $i{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 g.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Cr.test(e)}static parseMasterPlaylist(e,t){const n=Si(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},r=[];ar.lastIndex=0;let s;for(;(s=ar.exec(e))!=null;)if(s[1]){var o;const u=new an(s[1],i),f=wi(i,s[2]),h={attrs:u,bitrate:u.decimalInteger("BANDWIDTH")||u.decimalInteger("AVERAGE-BANDWIDTH"),name:u.NAME,url:$i.resolve(f,t)},v=u.decimalResolution("RESOLUTION");v&&(h.width=v.width,h.height=v.height),ls(u.CODECS,h);const x=u["SUPPLEMENTAL-CODECS"];x&&(h.supplemental={},ls(x,h.supplemental)),(o=h.unknownCodecs)!=null&&o.length||r.push(h),i.levels.push(h)}else if(s[3]){const u=s[3],f=s[4];switch(u){case"SESSION-DATA":{const h=new an(f,i),v=h["DATA-ID"];v&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[v]=h);break}case"SESSION-KEY":{const h=Vr(f,t,i);h.encrypted&&h.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(h)):Z.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${f}"`);break}case"DEFINE":{{const h=new an(f,i);Fi(i,h,t)}break}case"CONTENT-STEERING":{const h=new an(f,i);i.contentSteering={uri:$i.resolve(h["SERVER-URI"],t),pathwayId:h["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=Sr(f);break}}}const c=r.length>0&&r.length<i.levels.length;return i.levels=c?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(u=>({id:u.attrs.AUDIO,audioCodec:u.audioCodec})),SUBTITLES:s.map(u=>({id:u.attrs.SUBTITLES,textCodec:u.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(Ui.lastIndex=0;(i=Ui.exec(e))!==null;){const u=new an(i[1],n),f=u.TYPE;if(f){const h=o[f],v=r[f]||[];r[f]=v;const x=u.LANGUAGE,S=u["ASSOC-LANGUAGE"],B=u.CHANNELS,P=u.CHARACTERISTICS,Q=u["INSTREAM-ID"],ce={attrs:u,bitrate:0,id:c++,groupId:u["GROUP-ID"]||"",name:u.NAME||x||"",type:f,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:x,url:u.URI?$i.resolve(u.URI,t):""};if(S&&(ce.assocLang=S),B&&(ce.channels=B),P&&(ce.characteristics=P),Q&&(ce.instreamId=Q),h!=null&&h.length){const ie=$i.findGroup(h,ce.groupId)||h[0];Ir(ce,ie,"audioCodec"),Ir(ce,ie,"textCodec")}v.push(ce)}}return r}static parseLevelPlaylist(e,t,n,i,r,s){var o;const c={url:t},u=new Ti(t),f=u.fragments,h=[];let v=null,x=0,S=0,B=0,P=0,Q=0,ce=null,ie=new Se(i,c),De,Be,ct,Oe=-1,$e=!1,Xe=null,Ce;if(or.lastIndex=0,u.m3u8=e,u.hasVariableRefs=Si(e),((o=or.exec(e))==null?void 0:o[0])!=="#EXTM3U")return u.playlistParsingError=new Error("Missing format identifier #EXTM3U"),u;for(;(De=or.exec(e))!==null;){$e&&($e=!1,ie=new Se(i,c),ie.playlistOffset=B,ie.start=B,ie.sn=x,ie.cc=P,Q&&(ie.bitrate=Q),ie.level=n,v&&(ie.initSegment=v,v.rawProgramDateTime&&(ie.rawProgramDateTime=v.rawProgramDateTime,v.rawProgramDateTime=null),Xe&&(ie.setByteRange(Xe),Xe=null)));const Xt=De[1];if(Xt){ie.duration=parseFloat(Xt);const Yt=(" "+De[2]).slice(1);ie.title=Yt||null,ie.tagList.push(Yt?["INF",Xt,Yt]:["INF",Xt])}else if(De[3]){if(E(ie.duration)){ie.playlistOffset=B,ie.start=B,ct&&us(ie,ct,u),ie.sn=x,ie.level=n,ie.cc=P,f.push(ie);const Yt=(" "+De[3]).slice(1);ie.relurl=wi(u,Yt),kr(ie,ce,h),ce=ie,B+=ie.duration,x++,S=0,$e=!0}}else{if(De=De[0].match(as),!De){Z.warn("No matches on slow regex match for level playlist!");continue}for(Be=1;Be<De.length&&De[Be]===void 0;Be++);const Yt=(" "+De[Be]).slice(1),Vt=(" "+De[Be+1]).slice(1),hn=De[Be+2]?(" "+De[Be+2]).slice(1):null;switch(Yt){case"BYTERANGE":ce?ie.setByteRange(Vt,ce):ie.setByteRange(Vt);break;case"PROGRAM-DATE-TIME":ie.rawProgramDateTime=Vt,ie.tagList.push(["PROGRAM-DATE-TIME",Vt]),Oe===-1&&(Oe=f.length);break;case"PLAYLIST-TYPE":u.type&&Zi(u,Yt,De),u.type=Vt.toUpperCase();break;case"MEDIA-SEQUENCE":u.startSN!==0?Zi(u,Yt,De):f.length>0&&cs(u,Yt,De),x=u.startSN=parseInt(Vt);break;case"SKIP":{u.skippedSegments&&Zi(u,Yt,De);const Bt=new an(Vt,u),bn=Bt.decimalInteger("SKIPPED-SEGMENTS");if(E(bn)){u.skippedSegments+=bn;for(let zt=bn;zt--;)f.push(null);x+=bn}const dn=Bt.enumeratedString("RECENTLY-REMOVED-DATERANGES");dn&&(u.recentlyRemovedDateranges=(u.recentlyRemovedDateranges||[]).concat(dn.split(" ")));break}case"TARGETDURATION":u.targetduration!==0&&Zi(u,Yt,De),u.targetduration=Math.max(parseInt(Vt),1);break;case"VERSION":u.version!==null&&Zi(u,Yt,De),u.version=parseInt(Vt);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":u.live||Zi(u,Yt,De),u.live=!1;break;case"#":(Vt||hn)&&ie.tagList.push(hn?[Vt,hn]:[Vt]);break;case"DISCONTINUITY":P++,ie.tagList.push(["DIS"]);break;case"GAP":ie.gap=!0,ie.tagList.push([Yt]);break;case"BITRATE":ie.tagList.push([Yt,Vt]),Q=parseInt(Vt)*1e3,E(Q)?ie.bitrate=Q:Q=0;break;case"DATERANGE":{const Bt=new an(Vt,u),bn=new gi(Bt,u.dateRanges[Bt.ID],u.dateRangeTagCount);u.dateRangeTagCount++,bn.isValid||u.skippedSegments?u.dateRanges[bn.id]=bn:Z.warn(`Ignoring invalid DATERANGE tag: "${Vt}"`),ie.tagList.push(["EXT-X-DATERANGE",Vt]);break}case"DEFINE":{{const Bt=new an(Vt,u);"IMPORT"in Bt?Dn(u,Bt,s):Fi(u,Bt,t)}break}case"DISCONTINUITY-SEQUENCE":u.startCC!==0?Zi(u,Yt,De):f.length>0&&cs(u,Yt,De),u.startCC=P=parseInt(Vt);break;case"KEY":{const Bt=Vr(Vt,t,u);if(Bt.isSupported()){if(Bt.method==="NONE"){ct=void 0;break}ct||(ct={});const bn=ct[Bt.keyFormat];bn!=null&&bn.matches(Bt)||(bn&&(ct=m({},ct)),ct[Bt.keyFormat]=Bt)}else Z.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${Vt}"`);break}case"START":u.startTimeOffset=Sr(Vt);break;case"MAP":{const Bt=new an(Vt,u);if(ie.duration){const bn=new Se(i,c);$r(bn,Bt,n,ct),v=bn,ie.initSegment=v,v.rawProgramDateTime&&!ie.rawProgramDateTime&&(ie.rawProgramDateTime=v.rawProgramDateTime)}else{const bn=ie.byteRangeEndOffset;if(bn){const dn=ie.byteRangeStartOffset;Xe=`${bn-dn}@${dn}`}else Xe=null;$r(ie,Bt,n,ct),v=ie,$e=!0}v.cc=P;break}case"SERVER-CONTROL":{Ce&&Zi(u,Yt,De),Ce=new an(Vt),u.canBlockReload=Ce.bool("CAN-BLOCK-RELOAD"),u.canSkipUntil=Ce.optionalFloat("CAN-SKIP-UNTIL",0),u.canSkipDateRanges=u.canSkipUntil>0&&Ce.bool("CAN-SKIP-DATERANGES"),u.partHoldBack=Ce.optionalFloat("PART-HOLD-BACK",0),u.holdBack=Ce.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{u.partTarget&&Zi(u,Yt,De);const Bt=new an(Vt);u.partTarget=Bt.decimalFloatingPoint("PART-TARGET");break}case"PART":{let Bt=u.partList;Bt||(Bt=u.partList=[]);const bn=S>0?Bt[Bt.length-1]:void 0,dn=S++,zt=new an(Vt,u),Ft=new qe(zt,ie,c,dn,bn);Bt.push(Ft),ie.duration+=Ft.duration;break}case"PRELOAD-HINT":{const Bt=new an(Vt,u);u.preloadHint=Bt;break}case"RENDITION-REPORT":{const Bt=new an(Vt,u);u.renditionReports=u.renditionReports||[],u.renditionReports.push(Bt);break}default:Z.warn(`line parsed but not handled: ${De}`);break}}}ce&&!ce.relurl?(f.pop(),B-=ce.duration,u.partList&&(u.fragmentHint=ce)):u.partList&&(kr(ie,ce,h),ie.cc=P,u.fragmentHint=ie,ct&&us(ie,ct,u)),u.targetduration||(u.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const St=f.length,Nt=f[0],sn=f[St-1];if(B+=u.skippedSegments*u.targetduration,B>0&&St&&sn){u.averagetargetduration=B/St;const Xt=sn.sn;u.endSN=Xt!=="initSegment"?Xt:0,u.live||(sn.endList=!0),Nt&&u.startCC===void 0&&(u.startCC=Nt.cc),Oe>0&&(hr(f,Oe),Nt&&h.unshift(Nt))}else u.endSN=0,u.startCC=0;return u.fragmentHint&&(B+=u.fragmentHint.duration),u.totalduration=B,h.length&&u.dateRangeTagCount&&Nt&&os(h,u),u.endCC=P,u}}function os(a,e){const t=a.length;if(!t)return;const 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]],c=o.startDate.getTime();o.tagAnchor=n.ref;for(let u=t;u--;){const f=Ms(e,c,a,u,i);if(f!==-1){o.tagAnchor=e.fragments[f].ref;break}}}}function Ms(a,e,t,n,i){const r=t[n];if(r){const o=r.programDateTime;if(e>=o||n===0){var s;const c=(((s=t[n+1])==null?void 0:s.start)||i)-r.start;if(e<=o+c*1e3){const u=t[n].sn-a.startSN,f=a.fragments;if(f.length>t.length){const v=(t[n+1]||f[f.length-1]).sn-a.startSN;for(let x=v;x>u;x--){const S=f[x].programDateTime;if(e>=S&&e<S+f[x].duration*1e3)return x}}return u}}}return-1}function Vr(a,e,t){var n,i;const r=new an(a,t),s=(n=r.METHOD)!=null?n:"",o=r.URI,c=r.hexadecimalInteger("IV"),u=r.KEYFORMATVERSIONS,f=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!c&&Z.error(`Invalid IV: ${r.IV}`);const h=o?$i.resolve(o,e):"",v=(u||"1").split("/").map(Number).filter(Number.isFinite);return new ei(s,h,f,v,c,r.KEYID)}function Sr(a){const t=new an(a).decimalFloatingPoint("TIME-OFFSET");return E(t)?t:null}function ls(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(r=>bt(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 Ir(a,e,t){const n=e[t];n&&(a[t]=n)}function hr(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 kr(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function $r(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 us(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 Zi(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function cs(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function Pr(a,e){const t=e.startPTS;if(E(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 fs(a,e,t,n,i,r){n-t<=0&&(Z.warn("Fragment should have a positive duration",e),n=t+e.duration,r=i+e.duration);let o=t,c=n;const u=e.startPTS,f=e.endPTS;if(E(u)){const P=Math.abs(u-t);E(e.deltaPTS)?e.deltaPTS=Math.max(P,e.deltaPTS):e.deltaPTS=P,o=Math.max(t,u),t=Math.min(t,u),i=Math.min(i,e.startDTS),c=Math.min(n,f),n=Math.max(n,f),r=Math.max(r,e.endDTS)}const h=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=c,e.endDTS=r;const v=e.sn;if(!a||v<a.startSN||v>a.endSN)return 0;let x;const S=v-a.startSN,B=a.fragments;for(B[S]=e,x=S;x>0;x--)Pr(B[x],B[x-1]);for(x=S;x<B.length-1;x++)Pr(B[x],B[x+1]);return a.fragmentHint&&Pr(B[B.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,h}function Ns(a,e){if(a===e)return;let t=null;const n=a.fragments;for(let u=n.length-1;u>=0;u--){const f=n[u].initSegment;if(f){t=f;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i;hs(a,e,(u,f,h,v)=>{if((!e.startCC||e.skippedSegments)&&f.cc!==u.cc){const x=u.cc-f.cc;for(let S=h;S<v.length;S++)v[S].cc+=x;e.endCC=v[v.length-1].cc}E(u.startPTS)&&E(u.endPTS)&&(f.setStart(f.startPTS=u.startPTS),f.startDTS=u.startDTS,f.maxStartPTS=u.maxStartPTS,f.endPTS=u.endPTS,f.endDTS=u.endDTS,f.minEndPTS=u.minEndPTS,f.setDuration(u.endPTS-u.startPTS),f.duration&&(i=f),e.PTSKnown=e.alignedSliding=!0),u.hasStreams&&(f.elementaryStreams=u.elementaryStreams),f.loader=u.loader,u.hasStats&&(f.stats=u.stats),u.initSegment&&(f.initSegment=u.initSegment,t=u.initSegment)});const r=e.fragments,s=e.fragmentHint?r.concat(e.fragmentHint):r;if(t&&s.forEach(u=>{var f;u&&(!u.initSegment||u.initSegment.relurl===((f=t)==null?void 0:f.relurl))&&(u.initSegment=t)}),e.skippedSegments){if(e.deltaUpdateFailed=r.some(u=>!u),e.deltaUpdateFailed){Z.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.canSkipDateRanges&&(e.dateRanges=Bs(a.dateRanges,e));const u=a.fragments.filter(f=>f.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let f=1;f<s.length;f++)s[f].programDateTime===null&&kr(s[f],s[f-1],u);os(u,e)}e.endCC=r[r.length-1].cc}if(!e.startCC){var o;const u=ps(a,e.startSN-1);e.startCC=(o=u==null?void 0:u.cc)!=null?o:r[0].cc}Us(a.partList,e.partList,(u,f)=>{f.elementaryStreams=u.elementaryStreams,f.stats=u.stats}),i?fs(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):Or(a,e),r.length&&(e.totalduration=e.edge-r[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const c=e.advancedDateTime;if(e.advanced&&c){const u=e.edge;e.driftStart||(e.driftStartTime=c,e.driftStart=u),e.driftEndTime=c,e.driftEnd=u}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function Bs(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 c=i[o],u=new gi(t[o].attr,c);u.isValid?(i[o]=u,c||(u.tagOrder+=s)):Z.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${Kt(t[o].attr)}"`)}),i}function Us(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 hs(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,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let u=i;u<=r;u++){const f=c[s+u];let h=o[u];if(n&&!h&&f&&(h=e.fragments[u]=f),f&&h){if(t(f,h,u,o),f.url&&f.url!==h.url){e.playlistParsingError=mr(`media sequence mismatch ${h.sn}:`,a,e,f,h);return}else if(f.cc!==h.cc){e.playlistParsingError=mr(`discontinuity sequence mismatch (${f.cc}!=${h.cc})`,a,e,f,h);return}}}}function mr(a,e,t,n,i){return new Error(`${a} ${i.url}
|
|
Playlist starting @${e.startSN}
|
|
${e.m3u8}
|
|
|
|
Playlist starting @${t.startSN}
|
|
${t.m3u8}`)}function Or(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;Zr(e,s)}function Zr(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 ds(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 ps(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 Yr(a,e,t){return a?Ar(a.partList,e,t):null}function Ar(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 gs(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 wr(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 Ks(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function Xr(a,e){if(a){const t=a.start+e;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function ms(a,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)Xr(t[n],a);e.fragmentHint&&Xr(e.fragmentHint,a),e.alignedSliding=!0}function Gs(a,e){a&&(_s(e,a),!e.alignedSliding&&a&&Fr(e,a),!e.alignedSliding&&a&&!e.skippedSegments&&Or(a,e,!1))}function _s(a,e){if(!Ks(e,a))return;const t=Math.min(e.endCC,a.endCC),n=wr(e.fragments,t),i=wr(a.fragments,t);if(!n||!i)return;Z.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const r=n.start-i.start;ms(r,a)}function Fr(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=wr(n,s),r=wr(t,s)),(!i||!r)&&(i=n[Math.floor(n.length/2)],r=wr(t,i.cc)||t[Math.floor(t.length/2)]);const o=i.programDateTime,c=r.programDateTime;if(!o||!c)return;const u=(c-o)/1e3-(r.start-i.start);ms(u,a)}const zs={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}},st={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 zn extends Jn{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=st.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:c,mediaBuffer:u,state:f}=this,h=c?c.currentTime:0,v=$t.bufferInfo(u||c,h,s.maxBufferHole),x=!v.len;if(this.log(`Media seeking to ${E(h)?h.toFixed(3):h}, state: ${f}, ${x?"out of":"in"} buffer`),this.state===st.ENDED)this.resetLoadingState();else if(o){const S=s.maxFragLookUpTolerance,B=o.start-S,P=o.start+o.duration+S;if(x||P<v.start||B>v.end){const Q=h>P;(h<B||Q)&&(Q&&o.loader&&(this.log(`Cancelling fragment load for seek (sn: ${o.sn})`),o.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(h,1/0,this.playlistType,!0);const S=this.lastCurrentTime;if(h>S&&(this.lastCurrentTime=h),!this.loadingParts){const B=Math.max(v.end,h),P=this.shouldLoadParts(this.getLevelDetails(),B);P&&(this.log(`LL-Part loading ON after seeking to ${h.toFixed(2)} with buffer @${B.toFixed(2)}`),this.loadingParts=P)}}this.hls.hasEnoughToStart||(this.log(`Setting ${x?"startPosition":"nextLoadPosition"} to ${h} for seek without enough to start`),this.nextLoadPosition=h,x&&(this.startPosition=h)),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 ui(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new li(e.config)}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===st.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=st.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.buffered;this.config.maxBufferHole&&r&&r.length>1&&(e=$t.bufferedInfo(r,e.start,0));const s=e.nextStart;if(s&&s>i&&s<t.edge||this.media.currentTime<e.start)return!1;const c=t.partList;if(c!=null&&c.length){const f=c[c.length-1];return $t.isBuffered(this.media,f.start+f.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===st.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=st.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===st.FRAG_LOADING||!this.fragCurrent&&s===st.PARSING)&&(this.fragmentTracker.removeFragment(o),this.state=st.IDLE);return}"payload"in r&&(this.log(`Loaded ${o.type} sn: ${o.sn} of ${this.playlistLabel()} ${o.level}`),this.hls.trigger(p.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===st.STOPPED||this.state===st.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)===xn.APPENDING){const r=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.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)===xn.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(p.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&&Li(o.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,Mi(o.method)).catch(u=>{throw i.trigger(p.ERROR,{type:ee.MEDIA_ERROR,details:W.FRAG_DECRYPT_ERROR,fatal:!1,error:u,reason:u.message,frag:r}),u}).then(u=>{const f=self.performance.now();return i.trigger(p.FRAG_DECRYPTED,{frag:r,payload:u,stats:{tstart:c,tdecrypt:f}}),n.payload=u,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===st.STOPPED||this.state===st.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!==st.STOPPED&&(this.state=st.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?zs.toString($t.getBuffered(n)):"(detached)"})`),he(e)){var i;if(e.type!==Y.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(o=>!!s[o])){this.state=st.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=st.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(c=>!c),o=new ci(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=st.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(h=>{if(!this.fragContextChanged(h.frag))return this.hls.trigger(p.KEY_LOADED,h),this.state===st.KEY_LOADING&&(this.state=st.IDLE),h}),this.hls.trigger(p.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):e.encrypted||(o=this.keyLoader.loadClear(e,s.encryptedFragments,this.startFragRequested),o&&this.log("[eme] blocking frag load until media-keys acquired"));const c=this.fragPrevious;if(he(e)&&(!c||e.sn!==c.sn)){const h=this.shouldLoadParts(t.details,e.end);h!==this.loadingParts&&(this.log(`LL-Part loading ${h?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=h)}if(n=Math.max(e.start,n||0),this.loadingParts&&he(e)){const h=s.partList;if(h&&i){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const v=this.getNextPart(h,e,n);if(v>-1){const x=h[v];e=this.fragCurrent=x.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${x.index} (${v}/${h.length-1}) of ${this.fragInfo(e,!1,x)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=x.start+x.duration,this.state=st.FRAG_LOADING;let S;return o?S=o.then(B=>!B||this.fragContextChanged(B.frag)?null:this.doFragPartsLoad(e,x,t,i)).catch(B=>this.handleFragLoadError(B)):S=this.doFragPartsLoad(e,x,t,i).catch(B=>this.handleFragLoadError(B)),this.hls.trigger(p.FRAG_LOADING,{frag:e,part:x,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):S}else if(!e.url||this.loadedEndOfParts(h,n))return Promise.resolve(null)}}if(he(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))}`),E(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=st.FRAG_LOADING;const u=this.config.progressive;let f;return u&&o?f=o.then(h=>!h||this.fragContextChanged(h==null?void 0:h.frag)?null:this.fragmentLoader.load(e,i)).catch(h=>this.handleFragLoadError(h)):f=Promise.all([this.fragmentLoader.load(e,u?i:void 0),o]).then(([h])=>(!u&&h&&i&&i(h),h)).catch(h=>this.handleFragLoadError(h)),this.hls.trigger(p.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):f}doFragPartsLoad(e,t,n,i){return new Promise((r,s)=>{var o;const c=[],u=(o=n.details)==null?void 0:o.partList,f=h=>{this.fragmentLoader.loadPart(e,h,i).then(v=>{c[h.index]=v;const x=v.part;this.hls.trigger(p.FRAG_LOADED,v);const S=Yr(n.details,e.sn,h.index+1)||Ar(u,e.sn,h.index+1);if(S)f(S);else return r({frag:e,part:x,partsLoaded:c})}).catch(s)};f(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===W.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(p.ERROR,t)}else this.hls.trigger(p.ERROR,{type:ee.OTHER_ERROR,details:W.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==st.PARSING){!this.fragCurrent&&this.state!==st.STOPPED&&this.state!==st.ERROR&&(this.state=st.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(),u=o&&n.sn>o.endSN||this.shouldLoadParts(o,n.end);u!==this.loadingParts&&(this.log(`LL-Part loading ${u?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=u),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],c=o.details,u=s>-1?Yr(c,r,s):null,f=u?u.fragment:ps(c,r,n);return f?(n&&n!==f&&(f.stats=n.stats),{frag:f,part:u,level:o}):null}bufferFragmentData(e,t,n,i,r){var s;if(!e||this.state!==st.PARSING)return;const{data1:o,data2:c}=e;let u=o;if(o&&c&&(u=Ve(o,c)),!((s=u)!=null&&s.length))return;const f=this.initPTS[t.cc],h=f?-f.baseTime/f.timescale:void 0,v={type:e.type,frag:t,part:n,chunkMeta:i,offset:h,parent:t.type,data:u};if(this.hls.trigger(p.BUFFER_APPENDING,v),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!$t.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=$t.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(!E(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=$t.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 $t.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=Y.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 c=null;if(t.live){const h=r.initialLiveManifestSize;if(i<h)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${h})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var u;o&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t);const v=this.hls.startPosition,x=this.hls.liveSyncPosition,S=c?(v!==-1&&v>=s?v:x)||c.start:e;this.log(`Setting startPosition to ${S} to match start frag at live edge. mainStart: ${v} liveSyncPosition: ${x} frag.start: ${(u=c)==null?void 0:u.start}`),this.startPosition=this.nextLoadPosition=S}}else e<=s&&(c=n[0]);if(!c){const h=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,h,t)}let f=this.filterReplacedPrimary(c,t);if(!f&&c){const h=c.sn-t.startSN;f=this.filterReplacedPrimary(n[h+1]||null,t)}return this.mapToInitFragWhenRequired(f)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===xn.OK||n===xn.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 c=s.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(ti(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(ti(this.hls.config)&&e.type!==Y.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,c=e.length;o<c;o++){const u=e[o];if(s=s&&!u.independent,i>-1&&n<u.start)break;const f=u.loaded;f?i=-1:(r||u.independent||s)&&u.fragment===t&&(i=o),r=f}return i}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e){const t=e.fragments,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=Qt(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=Jt(e,n.cc,n.end),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:c}=n,{maxFragLookUpTolerance:u}=i,f=n.partList,h=!!(this.loadingParts&&f!=null&&f.length&&c);h&&c&&!this.bitrateTest&&f[f.length-1].fragment.sn===c.sn&&(s=s.concat(c),o=c.sn);let v;if(e<t){var x;const B=e<this.lastCurrentTime||e>t-u||(x=this.media)!=null&&x.paused||!this.startFragRequested?0:u;v=en(r,s,e,B)}else v=s[s.length-1];if(v){const S=v.sn-n.startSN,B=this.fragmentTracker.getState(v);if((B===xn.OK||B===xn.PARTIAL&&v.gap)&&(r=v),r&&v.sn===r.sn&&(!h||f[0].fragment.sn>v.sn||!n.live&&!h)&&r&&v.level===r.level){const Q=s[S+1];v.sn<o&&this.fragmentTracker.getState(Q)!==xn.OK?v=Q: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&&E(r);if(s||!o&&!r){Gs(n,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${i}`),c}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&&E(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&&he(e)&&e.stats.aborted&&(this.log(`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!==st.FRAG_LOADING_WAITING_RETRY)&&(this.state=st.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const S=this.getCurrentContext(t.chunkMeta);S&&(t.frag=S.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===W.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:o,flags:c,retryCount:u=0,retryConfig:f}=s||{},h=!!s&&!!f,v=h&&o===cn.RetryRequest,x=h&&!s.resolved&&c===Pn.MoveAllAlternatesMatchingHost;if(!v&&x&&he(n)&&!n.endList)this.resetFragmentErrors(e),this.treatAsGap(n),s.resolved=!0;else if((v||x)&&u<f.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const S=gn(f,u);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${u+1}/${f.maxNumRetry} in ${S}ms`),s.resolved=!0,this.retryDate=self.performance.now()+S,this.state=st.FRAG_LOADING_WAITING_RETRY}else if(f&&s)if(this.resetFragmentErrors(e),u<f.maxNumRetry)!r&&o!==cn.RemoveAlternatePermanently&&(s.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${u})`);return}else o===cn.SendAlternateToPenaltyBox?this.state=st.WAITING_LEVEL:this.state=st.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===st.PARSING||this.state===st.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===Y.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==st.STOPPED&&(this.state=st.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=$t.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===st.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==st.STOPPED&&(this.state=st.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((c,u)=>{const f=e.elementaryStreams[u];if(f){const h=f.endPTS-f.startPTS;if(h<=0)return this.warn(`Could not parse fragment ${e.sn} ${u} duration reliably (${h})`),c||!1;const v=i?0:fs(r,e,f.startPTS,f.endPTS,f.startDTS,f.endDTS);return this.hls.trigger(p.LEVEL_PTS_UPDATED,{details:r,level:n,drift:v,type:u,frag:e,start:f.startPTS,end:f.endPTS}),!0}return c},!1)){var o;if(n.fragmentError===0&&this.treatAsGap(e,n),((o=this.transmuxer)==null?void 0:o.error)===null){const c=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(c.message),this.hls.trigger(p.ERROR,{type:ee.MEDIA_ERROR,details:W.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=st.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(p.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===Y.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 ti(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class ki{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=Ki(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function Ki(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 _r={exports:{}},Mr;function Ws(){return Mr||(Mr=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(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function r(c,u,f,h,v){if(typeof f!="function")throw new TypeError("The listener must be a function");var x=new i(f,h||c,v),S=t?t+u:u;return c._events[S]?c._events[S].fn?c._events[S]=[c._events[S],x]:c._events[S].push(x):(c._events[S]=x,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],f,h;if(this._eventsCount===0)return u;for(h in f=this._events)e.call(f,h)&&u.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},o.prototype.listeners=function(u){var f=t?t+u:u,h=this._events[f];if(!h)return[];if(h.fn)return[h.fn];for(var v=0,x=h.length,S=new Array(x);v<x;v++)S[v]=h[v].fn;return S},o.prototype.listenerCount=function(u){var f=t?t+u:u,h=this._events[f];return h?h.fn?1:h.length:0},o.prototype.emit=function(u,f,h,v,x,S){var B=t?t+u:u;if(!this._events[B])return!1;var P=this._events[B],Q=arguments.length,ce,ie;if(P.fn){switch(P.once&&this.removeListener(u,P.fn,void 0,!0),Q){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,f),!0;case 3:return P.fn.call(P.context,f,h),!0;case 4:return P.fn.call(P.context,f,h,v),!0;case 5:return P.fn.call(P.context,f,h,v,x),!0;case 6:return P.fn.call(P.context,f,h,v,x,S),!0}for(ie=1,ce=new Array(Q-1);ie<Q;ie++)ce[ie-1]=arguments[ie];P.fn.apply(P.context,ce)}else{var De=P.length,Be;for(ie=0;ie<De;ie++)switch(P[ie].once&&this.removeListener(u,P[ie].fn,void 0,!0),Q){case 1:P[ie].fn.call(P[ie].context);break;case 2:P[ie].fn.call(P[ie].context,f);break;case 3:P[ie].fn.call(P[ie].context,f,h);break;case 4:P[ie].fn.call(P[ie].context,f,h,v);break;default:if(!ce)for(Be=1,ce=new Array(Q-1);Be<Q;Be++)ce[Be-1]=arguments[Be];P[ie].fn.apply(P[ie].context,ce)}}return!0},o.prototype.on=function(u,f,h){return r(this,u,f,h,!1)},o.prototype.once=function(u,f,h){return r(this,u,f,h,!0)},o.prototype.removeListener=function(u,f,h,v){var x=t?t+u:u;if(!this._events[x])return this;if(!f)return s(this,x),this;var S=this._events[x];if(S.fn)S.fn===f&&(!v||S.once)&&(!h||S.context===h)&&s(this,x);else{for(var B=0,P=[],Q=S.length;B<Q;B++)(S[B].fn!==f||v&&!S[B].once||h&&S[B].context!==h)&&P.push(S[B]);P.length?this._events[x]=P.length===1?P[0]:P:s(this,x)}return this},o.prototype.removeAllListeners=function(u){var f;return u?(f=t?t+u:u,this._events[f]&&s(this,f)):(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}(_r)),_r.exports}var vs=Ws(),Nr=T(vs);const nr="1.6.7",lr={};function Hs(){return typeof __HLS_WORKER_BUNDLE__=="function"}function el(){const a=lr[nr];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 lr[nr]=i,i}function tl(a){const e=lr[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 lr[a]=i,i}function nl(a){const e=lr[a||nr];if(e&&e.clientCount--===1){const{worker:n,objectURL:i}=e;delete lr[a||nr],i&&self.URL.revokeObjectURL(i),n.terminate()}}function Da(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 js(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 ys(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 Qr(a,e){const t=e;let n=0;for(;js(a,e);){n+=10;const i=ys(a,e+6);n+=i,Da(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)}function il(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 x=new Error(`invalid ADTS sampling index:${s}`);a.emit(p.ERROR,p.ERROR,{type:ee.MEDIA_ERROR,details:W.FRAG_PARSING_ERROR,fatal:!0,error:x,reason:x.message});return}const o=(r>>6&3)+1,c=e[t+3]>>6&3|(r&1)<<2,u="mp4a.40."+o,f=i[s];let h=s;(o===5||o===29)&&(h-=3);const v=[o<<3|(h&14)>>1,(h&1)<<7|c<<3];return Z.log(`manifest codec:${n}, parsed codec:${u}, channels:${c}, rate:${f} (ADTS object type:${o} sampling index:${s})`),{config:v,samplerate:f,channelCount:c,codec:u,parsedCodec:u,manifestCodec:n}}function Ra(a,e){return a[e]===255&&(a[e+1]&246)===240}function La(a,e){return a[e+1]&1?7:9}function Vs(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function rl(a,e){return e+5<a.length}function bs(a,e){return e+1<a.length&&Ra(a,e)}function sl(a,e){return rl(a,e)&&Ra(a,e)&&Vs(a,e)<=a.length-e}function al(a,e){if(bs(a,e)){const t=La(a,e);if(e+t>=a.length)return!1;const n=Vs(a,e);if(n<=t)return!1;const i=e+n;return i===a.length||bs(a,i)}return!1}function Ca(a,e,t,n,i){if(!a.samplerate){const r=il(e,t,n,i);if(!r)return;m(a,r)}}function Ia(a){return 1024*9e4/a}function ol(a,e){const t=La(a,e);if(e+t<=a.length){const n=Vs(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function ka(a,e,t,n,i){const r=Ia(a.samplerate),s=n+i*r,o=ol(e,t);let c;if(o){const{frameLength:h,headerLength:v}=o,x=v+h,S=Math.max(0,t+x-e.length);S?(c=new Uint8Array(x-v),c.set(e.subarray(t+v,e.length),0)):c=e.subarray(t+v,t+x);const B={unit:c,pts:s};return S||a.samples.push(B),{sample:B,length:x,missing:S}}const u=e.length-t;return c=new Uint8Array(u),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:u,missing:-1}}function ll(a,e){return js(a,e)&&ys(a,e+6)+10<=a.length-e}function ul(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function $s(a,e=0,t=1/0){return cl(a,e,t,Uint8Array)}function cl(a,e,t,n){const i=fl(a);let r=1;"BYTES_PER_ELEMENT"in n&&(r=n.BYTES_PER_ELEMENT);const s=hl(a)?a.byteOffset:0,o=(s+a.byteLength)/r,c=(s+e)/r,u=Math.floor(Math.max(0,Math.min(c,o))),f=Math.floor(Math.min(u+Math.max(t,0),o));return new n(i,u,f-u)}function fl(a){return a instanceof ArrayBuffer?a:a.buffer}function hl(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function dl(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=Re($s(a.data,1,n)),r=a.data[2+n],s=a.data.subarray(3+n).indexOf(0);if(s===-1)return;const o=Re($s(a.data,3+n,s));let c;return i==="-->"?c=Re($s(a.data,4+n+s)):c=ul(a.data.subarray(4+n+s)),e.mimeType=i,e.pictureType=r,e.description=o,e.data=c,e}function pl(a){if(a.size<2)return;const e=Re(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function gl(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=Re(a.data.subarray(t),!0);t+=n.length+1;const i=Re(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Re(a.data.subarray(1));return{key:a.type,info:"",data:e}}function ml(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=Re(a.data.subarray(t),!0);t+=n.length+1;const i=Re(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Re(a.data);return{key:a.type,info:"",data:e}}function _l(a){return a.type==="PRIV"?pl(a):a.type[0]==="W"?ml(a):a.type==="APIC"?dl(a):gl(a)}function vl(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=ys(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}}const Es=10,yl=10;function Pa(a){let e=0;const t=[];for(;js(a,e);){const n=ys(a,e+6);a[e+5]>>6&1&&(e+=Es),e+=Es;const i=e+n;for(;e+yl<i;){const r=vl(a.subarray(e)),s=_l(r);s&&t.push(s),e+=r.size+Es}Da(a,e)&&(e+=Es)}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 Zs(a){const e=Pa(a);for(let t=0;t<e.length;t++){const n=e[t];if(Oa(n))return bl(n)}}let Hi=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 ur(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Ys{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=Ve(this.cachedData,e),this.cachedData=null);let n=Qr(e,0),i=n?n.length:0,r;const s=this._audioTrack,o=this._id3Track,c=n?Zs(n):void 0,u=e.length;for((this.basePTS===null||this.frameIndex===0&&E(c))&&(this.basePTS=El(c,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:Hi.audioId3,duration:Number.POSITIVE_INFINITY});i<u;){if(this.canParse(e,i)){const f=this.appendFrame(s,e,i);f?(this.frameIndex++,this.lastPTS=f.sample.pts,i+=f.length,r=i):i=u}else ll(e,i)?(n=Qr(e,i),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Hi.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===u&&r!==u){const f=e.slice(r);this.cachedData?this.cachedData=Ve(this.cachedData,f):this.cachedData=f}}return{audioTrack:s,videoTrack:ur(),id3Track:o,textTrack:ur()}}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:ur(),id3Track:this._id3Track,textTrack:ur()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const El=(a,e,t)=>{if(E(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let xs=null;const xl=[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],Sl=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Al=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],wl=[0,1,1,4];function Fa(a,e,t,n,i){if(t+24>e.length)return;const r=Ma(e,t);if(r&&t+r.frameLength<=e.length){const s=r.samplesPerFrame*9e4/r.sampleRate,o=n+i*s,c={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(c),{sample:c,length:r.frameLength,missing:0}}}function Ma(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,c=t===3?3-n:n===3?3:4,u=xl[c*14+i-1]*1e3,h=Sl[(t===3?0:t===2?1:2)*3+r],v=o===3?1:2,x=Al[t][n],S=wl[n],B=x*8*S,P=Math.floor(x*u/h+s)*S;if(xs===null){const ie=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);xs=ie?parseInt(ie[1]):0}return!!xs&&xs<=87&&n===2&&u>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:h,channelCount:v,frameLength:P,samplesPerFrame:B}}}function Xs(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&&Xs(a,e)}function Tl(a,e){return Xs(a,e)&&4<=a.length-e}function Ba(a,e){if(e+1<a.length&&Xs(a,e)){const n=Ma(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 Dl extends Ys{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=Qr(e,0);let i=(n==null?void 0:n.length)||0;if(Ba(e,i))return!1;for(let r=e.length;i<r;i++)if(al(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return sl(e,t)}appendFrame(e,t,n){Ca(e,this.observer,t,n,e.manifestCodec);const i=ka(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const Ua=(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),c=8-o;r[0]=4278190080>>>24+c<<c,i[0]=(s[0]&r[0])>>c,t=t?t<<o|i[0]:i[0],e+=1,n-=o}return t};class Rl extends Ys{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=Ka(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=Qr(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&Zs(t)!==void 0&&Ua(e,n)<16}}function Ka(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],c=e[t+4]&63,f=[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][c*3+r]*2;if(t+f>e.length)return-1;const h=e[t+6]>>5;let v=0;h===2?v+=2:(h&1&&h!==1&&(v+=2),h&4&&(v+=2));const x=(e[t+6]<<8|e[t+7])>>12-v&1,B=[2,1,2,3,3,4,4,5][h]+x,P=e[t+5]>>3,Q=e[t+5]&7,ce=new Uint8Array([r<<6|P<<1|Q>>2,(Q&3)<<6|h<<3|x<<2|c>>4,c<<4&224]),ie=1536/o*9e4,De=n+i*ie,Be=e.subarray(t,t+f);return a.config=ce,a.channelCount=B,a.samplerate=o,a.samples.push({unit:Be,pts:De}),f}class Ll extends Ys{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=Qr(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&Zs(t)!==void 0&&Ua(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(Ba(e,n))return Z.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Tl(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Fa(e,t,n,this.basePTS,this.frameIndex)}}const Cl=/\/emsg[-/]ID3/i;class Il{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=ur("video",1),s=this.audioTrack=ur("audio",1),o=this.txtTrack=ur("text",1);if(this.id3Track=ur("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=Ne(e);if(c.video){const{id:u,timescale:f,codec:h,supplemental:v}=c.video;r.id=u,r.timescale=o.timescale=f,r.codec=h,r.supplemental=v}if(c.audio){const{id:u,timescale:f,codec:h}=c.audio;s.id=u,s.timescale=f,s.codec=h}o.id=Lt.text,r.sampleDuration=0,r.duration=s.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return be(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Ve(this.remainderData,e));const o=ut(n);this.remainderData=o.remainder,i.samples=o.valid||new Uint8Array}else i.samples=n;const s=this.extractID3Track(i,t);return r.samples=At(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=At(e,t),{videoTrack:t,audioTrack:ur(),id3Track:i,textTrack:ur()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=q(e.samples,["emsg"]);i&&i.forEach(r=>{const s=tt(r);if(Cl.test(s.schemeIdUri)){const o=Ga(s,t);let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const u=s.payload;n.samples.push({data:u,len:u.byteLength,dts:o,pts:o,type:Hi.emsg,duration:c})}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:Hi.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 E(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class kl{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new li(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Zn.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 c=new Uint8Array(o);i.set(c,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=Ze(r.data),o=this.getAvcEncryptedData(s);this.decryptBuffer(o.buffer).then(c=>{r.data=this.getAvcDecryptedUnit(s,c),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 za{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 c=0,u,f,h,v=-1,x=0;for(r===-1&&(v=0,x=this.getNALuType(t,0),r=0,c=1);c<i;){if(u=t[c++],!r){r=u?0:1;continue}if(r===1){r=u?0:2;continue}if(!u)r=3;else if(u===1){if(f=c-r-1,v>=0){const S={data:t.subarray(v,f),type:x};o.push(S)}else{const S=this.getLastNalUnit(e.samples);S&&(s&&c<=4-s&&S.state&&(S.data=S.data.subarray(0,S.data.byteLength-s)),f>0&&(S.data=Ve(S.data,t.subarray(0,f)),S.state=0))}c<i?(h=this.getNALuType(t,c),v=c,x=h,r=0):r=-1}else r=0}if(v>=0&&r>=0){const S={data:t.subarray(v,i),type:x,state:r};o.push(S)}if(o.length===0){const S=this.getLastNalUnit(e.samples);S&&(S.data=Ve(S.data,t))}return e.naluState=r,o}}class Jr{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&&Z.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 Wa extends za{parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,o,c=!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(u=>{var f,h;switch(u.type){case 1:{let B=!1;o=!0;const P=u.data;if(c&&P.length>4){const Q=this.readSliceType(P);(Q===2||Q===4||Q===7||Q===9)&&(B=!0)}if(B){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=B;break}case 5:o=!0,(f=s)!=null&&f.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,Ae(u.data,1,n.pts,t.samples);break}case 7:{var x,S;o=!0,c=!0;const B=u.data,P=this.readSPS(B);if(!e.sps||e.width!==P.width||e.height!==P.height||((x=e.pixelRatio)==null?void 0:x[0])!==P.pixelRatio[0]||((S=e.pixelRatio)==null?void 0:S[1])!==P.pixelRatio[1]){e.width=P.width,e.height=P.height,e.pixelRatio=P.pixelRatio,e.sps=[B];const Q=B.subarray(1,4);let ce="avc1.";for(let ie=0;ie<3;ie++){let De=Q[ie].toString(16);De.length<2&&(De="0"+De),ce+=De}e.codec=ce}break}case 8:o=!0,e.pps=[u.data];break;case 9:o=!0,e.audFound=!0,(h=s)!=null&&h.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(u)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new Jr(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 Jr(e);let n=0,i=0,r=0,s=0,o,c,u;const f=t.readUByte.bind(t),h=t.readBits.bind(t),v=t.readUEG.bind(t),x=t.readBoolean.bind(t),S=t.skipBits.bind(t),B=t.skipEG.bind(t),P=t.skipUEG.bind(t),Q=this.skipScalingList.bind(this);f();const ce=f();if(h(5),S(3),f(),P(),ce===100||ce===110||ce===122||ce===244||ce===44||ce===83||ce===86||ce===118||ce===128){const $e=v();if($e===3&&S(1),P(),P(),S(1),x())for(c=$e!==3?8:12,u=0;u<c;u++)x()&&(u<6?Q(16,t):Q(64,t))}P();const ie=v();if(ie===0)v();else if(ie===1)for(S(1),B(),B(),o=v(),u=0;u<o;u++)B();P(),S(1);const De=v(),Be=v(),ct=h(1);ct===0&&S(1),S(1),x()&&(n=v(),i=v(),r=v(),s=v());let Oe=[1,1];if(x()&&x())switch(f()){case 1:Oe=[1,1];break;case 2:Oe=[12,11];break;case 3:Oe=[10,11];break;case 4:Oe=[16,11];break;case 5:Oe=[40,33];break;case 6:Oe=[24,11];break;case 7:Oe=[20,11];break;case 8:Oe=[32,11];break;case 9:Oe=[80,33];break;case 10:Oe=[18,11];break;case 11:Oe=[15,11];break;case 12:Oe=[64,33];break;case 13:Oe=[160,99];break;case 14:Oe=[4,3];break;case 15:Oe=[3,2];break;case 16:Oe=[2,1];break;case 255:{Oe=[f()<<8|f(),f()<<8|f()];break}}return{width:Math.ceil((De+1)*16-n*2-i*2),height:(2-ct)*(Be+1)*16-(ct?2:4)*(r+s),pixelRatio:Oe}}}class Ha extends za{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,c=!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(u=>{var f,h;switch(u.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,c){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,(f=s)!=null&&f.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,Ae(u.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(u.data)),this.initVPS=u.data),e.vps=[u.data];break;case 33:if(o=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],u.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const x=this.readSPS(u.data);e.width=x.width,e.height=x.height,e.pixelRatio=x.pixelRatio,e.codec=x.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const S in x.params)e.params[S]=x.params[S]}this.pushParameterSet(e.sps,u.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 x=this.readPPS(u.data);for(const S in x)e.params[S]=x[S]}this.pushParameterSet(e.pps,u.data,e.vps)}break;case 35:o=!0,e.audFound=!0,(h=s)!=null&&h.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(u)}),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 Jr(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 Jr(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(),c=t.readUByte(),u=t.readUByte(),f=t.readUByte(),h=t.readUByte(),v=t.readUByte(),x=t.readUByte(),S=t.readUByte(),B=t.readUByte(),P=t.readUByte(),Q=t.readUByte(),ce=[],ie=[];for(let Wn=0;Wn<n;Wn++)ce.push(t.readBoolean()),ie.push(t.readBoolean());if(n>0)for(let Wn=n;Wn<8;Wn++)t.readBits(2);for(let Wn=0;Wn<n;Wn++)ce[Wn]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),ie[Wn]&&t.readUByte();t.readUEG();const De=t.readUEG();De==3&&t.skipBits(1);const Be=t.readUEG(),ct=t.readUEG(),Oe=t.readBoolean();let $e=0,Xe=0,Ce=0,St=0;Oe&&($e+=t.readUEG(),Xe+=t.readUEG(),Ce+=t.readUEG(),St+=t.readUEG());const Nt=t.readUEG(),sn=t.readUEG(),Xt=t.readUEG(),Yt=t.readBoolean();for(let Wn=Yt?0:n;Wn<=n;Wn++)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 Oi=0;Oi<4;Oi++)for(let Ji=0;Ji<(Oi===3?2:6);Ji++)if(!t.readBoolean())t.readUEG();else{const sr=Math.min(64,1<<4+(Oi<<1));Oi>1&&t.readEG();for(let jr=0;jr<sr;jr++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const Bt=t.readUEG();let bn=0;for(let Wn=0;Wn<Bt;Wn++){let Oi=!1;if(Wn!==0&&(Oi=t.readBoolean()),Oi){Wn===Bt&&t.readUEG(),t.readBoolean(),t.readUEG();let Ji=0;for(let Rr=0;Rr<=bn;Rr++){const sr=t.readBoolean();let jr=!1;sr||(jr=t.readBoolean()),(sr||jr)&&Ji++}bn=Ji}else{const Ji=t.readUEG(),Rr=t.readUEG();bn=Ji+Rr;for(let sr=0;sr<Ji;sr++)t.readUEG(),t.readBoolean();for(let sr=0;sr<Rr;sr++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const Wn=t.readUEG();for(let Oi=0;Oi<Wn;Oi++){for(let Ji=0;Ji<Xt+4;Ji++)t.readBits(1);t.readBits(1)}}let zt=0,Ft=1,In=1,Mn=!0,jn=1,Gn=0;t.readBoolean(),t.readBoolean();let mi=!1;if(t.readBoolean()){if(t.readBoolean()){const Lr=t.readUByte(),Vo=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Fs=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Lr>0&&Lr<16?(Ft=Vo[Lr-1],In=Fs[Lr-1]):Lr===255&&(Ft=t.readBits(16),In=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(),mi=t.readBoolean(),mi&&($e+=t.readUEG(),Xe+=t.readUEG(),Ce+=t.readUEG(),St+=t.readUEG()),t.readBoolean()&&(jn=t.readBits(32),Gn=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const Fs=t.readBoolean(),$o=t.readBoolean();let rs=!1;(Fs||$o)&&(rs=t.readBoolean(),rs&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),rs&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Zo=0;Zo<=n;Zo++){Mn=t.readBoolean();const ef=Mn||t.readBoolean();let Yo=!1;ef?t.readEG():Yo=t.readBoolean();const Xo=Yo?1:t.readUEG()+1;if(Fs)for(let ss=0;ss<Xo;ss++)t.readUEG(),t.readUEG(),rs&&(t.readUEG(),t.readUEG()),t.skipBits(1);if($o)for(let ss=0;ss<Xo;ss++)t.readUEG(),t.readUEG(),rs&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),zt=t.readUEG())}let Pi=Be,Vi=ct;if(Oe||mi){let Wn=1,Oi=1;De===1?Wn=Oi=2:De==2&&(Wn=2),Pi=Be-Wn*Xe-Wn*$e,Vi=ct-Oi*St-Oi*Ce}const Dr=i?["A","B","C"][i]:"",qc=o<<24|c<<16|u<<8|f;let wa=0;for(let Wn=0;Wn<32;Wn++)wa=(wa|(qc>>Wn&1)<<31-Wn)>>>0;let Ta=wa.toString(16);return s===1&&Ta==="2"&&(Ta="6"),{codecString:`hvc1.${Dr}${s}.${Ta}.${r?"H":"L"}${Q}.B0`,params:{general_tier_flag:r,general_profile_idc:s,general_profile_space:i,general_profile_compatibility_flags:[o,c,u,f],general_constraint_indicator_flags:[h,v,x,S,B,P],general_level_idc:Q,bit_depth:Nt+8,bit_depth_luma_minus8:Nt,bit_depth_chroma_minus8:sn,min_spatial_segmentation_idc:zt,chroma_format_idc:De,frame_rate:{fixed:Mn,fps:Gn/jn}},width:Pi,height:Vi,pixelRatio:[Ft,In]}}readPPS(e){const t=new Jr(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 Di=188;class vr{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=vr.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(Di*5,t-Di)+1,i=0;for(;i<n;){let r=!1,s=-1,o=0;for(let c=i;c<t;c+=Di)if(e[c]===71&&(t-c===Di||e[c+Di]===71)){if(o++,s===-1&&(s=c,s!==0&&(n=Math.min(s+Di*99,e.length-Di)+1)),r||(r=Qs(e,c)===0),r&&o>1&&(s===0&&o>2||c+Di>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:Lt[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=vr.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=vr.createTrack("audio",i),this._id3Track=vr.createTrack("id3"),this._txtTrack=vr.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,c=this._id3Track,u=this._txtTrack;let f=s.pid,h=s.pesData,v=o.pid,x=c.pid,S=o.pesData,B=c.pesData,P=null,Q=this.pmtParsed,ce=this._pmtId,ie=e.length;if(this.remainderData&&(e=Ve(this.remainderData,e),ie=e.length,this.remainderData=null),ie<Di&&!i)return this.remainderData=e,{audioTrack:o,videoTrack:s,id3Track:c,textTrack:u};const De=Math.max(0,vr.syncOffset(e));ie-=(ie-De)%Di,ie<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,ie,e.buffer.byteLength-ie));let Be=0;for(let Oe=De;Oe<ie;Oe+=Di)if(e[Oe]===71){const $e=!!(e[Oe+1]&64),Xe=Qs(e,Oe),Ce=(e[Oe+3]&48)>>4;let St;if(Ce>1){if(St=Oe+5+e[Oe+4],St===Oe+Di)continue}else St=Oe+4;switch(Xe){case f:if($e){if(h&&(r=Br(h,this.logger))){if(this.videoParser===null)switch(s.segmentCodec){case"avc":this.videoParser=new Wa;break;case"hevc":this.videoParser=new Ha;break}this.videoParser!==null&&this.videoParser.parsePES(s,u,r,!1)}h={data:[],size:0}}h&&(h.data.push(e.subarray(St,Oe+Di)),h.size+=Oe+Di-St);break;case v:if($e){if(S&&(r=Br(S,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}S={data:[],size:0}}S&&(S.data.push(e.subarray(St,Oe+Di)),S.size+=Oe+Di-St);break;case x:$e&&(B&&(r=Br(B,this.logger))&&this.parseID3PES(c,r),B={data:[],size:0}),B&&(B.data.push(e.subarray(St,Oe+Di)),B.size+=Oe+Di-St);break;case 0:$e&&(St+=e[St]+1),ce=this._pmtId=Pl(e,St);break;case ce:{$e&&(St+=e[St]+1);const Nt=Ol(e,St,this.typeSupported,n,this.observer,this.logger);f=Nt.videoPid,f>0&&(s.pid=f,s.segmentCodec=Nt.segmentVideoCodec),v=Nt.audioPid,v>0&&(o.pid=v,o.segmentCodec=Nt.segmentAudioCodec),x=Nt.id3Pid,x>0&&(c.pid=x),P!==null&&!Q&&(this.logger.warn(`MPEG-TS PMT found at ${Oe} after unknown PID '${P}'. Backtracking to sync byte @${De} to parse all TS packets.`),P=null,Oe=De-188),Q=this.pmtParsed=!0;break}case 17:case 8191:break;default:P=Xe;break}}else Be++;Be>0&&Js(this.observer,new Error(`Found ${Be} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=h,o.pesData=S,c.pesData=B;const ct={audioTrack:o,videoTrack:s,id3Track:c,textTrack:u};return i&&this.extractRemainingSamples(ct),ct}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,c=i.pesData;let u;if(s&&(u=Br(s,this.logger))){if(this.videoParser===null)switch(n.segmentCodec){case"avc":this.videoParser=new Wa;break;case"hevc":this.videoParser=new Ha;break}this.videoParser!==null&&(this.videoParser.parsePES(n,r,u,!0),n.pesData=null)}else n.pesData=s;if(o&&(u=Br(o,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,u);break;case"mp3":this.parseMPEGPES(t,u);break;case"ac3":this.parseAC3PES(t,u);break}t.pesData=null}else o!=null&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;c&&(u=Br(c,this.logger))?(this.parseID3PES(i,u),i.pesData=null):i.pesData=c}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new kl(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 h=i.missing,v=i.sample.unit.byteLength;if(h===-1)r=Ve(i.sample.unit,r);else{const x=v-h;i.sample.unit.set(r.subarray(0,h),x),e.samples.push(i.sample),n=i.missing}}let s,o;for(s=n,o=r.length;s<o-1&&!bs(r,s);s++);if(s!==n){let h;const v=s<o-1;if(v?h=`AAC PES did not start with ADTS header,offset:${s}`:h="No ADTS header found in AAC PES",Js(this.observer,new Error(h),v,this.logger),!v)return}Ca(e,this.observer,r,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(i){const h=Ia(e.samplerate);c=i.sample.pts+h}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let u=0,f;for(;s<o;)if(f=ka(e,r,s,c,u),s+=f.length,f.missing){this.aacOverFlow=f;break}else for(u++;s<o-1&&!bs(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 c=Fa(e,n,s,o,r);if(c)s+=c.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,c;for(;o<r&&(c=Ka(e,n,o,i,s++))>0;)o+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=m({},t,{type:this._videoTrack?Hi.emsg:Hi.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Qs(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Pl(a,e){return(a[e+10]&31)<<8|a[e+11]}function Ol(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],c=e+3+o-4,u=(a[e+10]&15)<<8|a[e+11];for(e+=12+u;e<c;){const f=Qs(a,e),h=(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=f);break;case 21:s.id3Pid===-1&&(s.id3Pid=f);break;case 219:if(!n){qs("H.264",r);break}case 27:s.videoPid===-1&&(s.videoPid=f);break;case 3:case 4:!t.mpeg&&!t.mp3?r.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="mp3");break;case 193:if(!n){qs("AC-3",r);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="ac3"):r.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&h>0){let v=e+5,x=h;for(;x>2;){switch(a[v]){case 106:t.ac3!==!0?r.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=f,s.segmentAudioCodec="ac3");break}const B=a[v+1]+2;v+=B,x-=B}}break;case 194:case 135:return Js(i,new Error("Unsupported EC-3 in M2TS found"),void 0,r),s;case 36:s.videoPid===-1&&(s.videoPid=f,s.segmentVideoCodec="hevc",r.log("HEVC in M2TS found"));break}e+=h+5}return s}function Js(a,e,t,n){n.warn(`parsing error: ${e.message}`),a.emit(p.ERROR,p.ERROR,{type:ee.MEDIA_ERROR,details:W.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 Br(a,e){let t=0,n,i,r,s,o;const c=a.data;if(!a||a.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=Ve(c[0],c[1]),c.splice(1,1);if(n=c[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 f=n[7];f&192&&(s=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,f&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 h=r+9;if(a.size<=h)return null;a.size-=h;const v=new Uint8Array(a.size);for(let x=0,S=c.length;x<S;x++){n=c[x];let B=n.byteLength;if(h)if(h>B){h-=B;continue}else n=n.subarray(h),B-=h,h=0;v.set(n,t),t+=B}return i&&(i-=r+3),{data:v,pts:s,dts:o,len:i}}return null}class Fl{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 yr=Math.pow(2,32)-1;class Ge{static init(){Ge.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 Ge.types)Ge.types.hasOwnProperty(e)&&(Ge.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]);Ge.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]);Ge.STTS=Ge.STSC=Ge.STCO=r,Ge.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ge.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Ge.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Ge.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]),c=new Uint8Array([0,0,0,1]);Ge.FTYP=Ge.box(Ge.types.ftyp,s,c,s,o),Ge.DINF=Ge.box(Ge.types.dinf,Ge.box(Ge.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 Ge.box(Ge.types.hdlr,Ge.HDLR_TYPES[e])}static mdat(e){return Ge.box(Ge.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(yr+1)),i=Math.floor(t%(yr+1));return Ge.box(Ge.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 Ge.box(Ge.types.mdia,Ge.mdhd(e.timescale||0,e.duration||0),Ge.hdlr(e.type),Ge.minf(e))}static mfhd(e){return Ge.box(Ge.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"?Ge.box(Ge.types.minf,Ge.box(Ge.types.smhd,Ge.SMHD),Ge.DINF,Ge.stbl(e)):Ge.box(Ge.types.minf,Ge.box(Ge.types.vmhd,Ge.VMHD),Ge.DINF,Ge.stbl(e))}static moof(e,t,n){return Ge.box(Ge.types.moof,Ge.mfhd(e),Ge.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=Ge.trak(e[t]);return Ge.box.apply(null,[Ge.types.moov,Ge.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(Ge.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=Ge.trex(e[t]);return Ge.box.apply(null,[Ge.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(yr+1)),i=Math.floor(t%(yr+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 Ge.box(Ge.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 Ge.box(Ge.types.sdtp,n)}static stbl(e){return Ge.box(Ge.types.stbl,Ge.stsd(e),Ge.box(Ge.types.stts,Ge.STTS),Ge.box(Ge.types.stsc,Ge.STSC),Ge.box(Ge.types.stsz,Ge.STSZ),Ge.box(Ge.types.stco,Ge.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=Ge.box(Ge.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),c=e.width,u=e.height,f=e.pixelRatio[0],h=e.pixelRatio[1];return Ge.box(Ge.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,c>>8&255,c&255,u>>8&255,u&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,Ge.box(Ge.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Ge.box(Ge.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,f&255,h>>24,h>>16&255,h>>8&255,h&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 Ge.box(Ge.types.mp4a,Ge.audioStsd(e),Ge.box(Ge.types.esds,Ge.esds(e)))}static mp3(e){return Ge.box(Ge.types[".mp3"],Ge.audioStsd(e))}static ac3(e){return Ge.box(Ge.types["ac-3"],Ge.audioStsd(e),Ge.box(Ge.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return Ge.box(Ge.types.stsd,Ge.STSD,Ge.mp4a(e));if(t==="ac3"&&e.config)return Ge.box(Ge.types.stsd,Ge.STSD,Ge.ac3(e));if(t==="mp3"&&e.codec==="mp3")return Ge.box(Ge.types.stsd,Ge.STSD,Ge.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return Ge.box(Ge.types.stsd,Ge.STSD,Ge.avc1(e));if(t==="hevc"&&e.vps)return Ge.box(Ge.types.stsd,Ge.STSD,Ge.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/(yr+1)),o=Math.floor(n%(yr+1));return Ge.box(Ge.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=Ge.sdtp(e),i=e.id,r=Math.floor(t/(yr+1)),s=Math.floor(t%(yr+1));return Ge.box(Ge.types.traf,Ge.box(Ge.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),Ge.box(Ge.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])),Ge.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,Ge.box(Ge.types.trak,Ge.tkhd(e),Ge.mdia(e))}static trex(e){const t=e.id;return Ge.box(Ge.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,c,u,f,h,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++)c=n[o],u=c.duration,f=c.size,h=c.flags,v=c.cts,s.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&61440,h.degradPrio&15,v>>>24&255,v>>>16&255,v>>>8&255,v&255],12+16*o);return Ge.box(Ge.types.trun,s)}static initSegment(e){Ge.types||Ge.init();const t=Ge.moov(e);return Ve(Ge.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 S=0;S<n.length;S+=1){s+=3;for(let B=0;B<n[S].length;B+=1)s+=2+n[S][B].length}const o=new Uint8Array(s);o.set(r,0),s=r.length;const c=n.length-1;for(let S=0;S<n.length;S+=1){o.set(new Uint8Array([32+S|(S===c?128:0),0,n[S].length]),s),s+=3;for(let B=0;B<n[S].length;B+=1)o.set(new Uint8Array([n[S][B].length>>8,n[S][B].length&255]),s),s+=2,o.set(n[S][B],s),s+=n[S][B].length}const u=Ge.box(Ge.types.hvcC,o),f=e.width,h=e.height,v=e.pixelRatio[0],x=e.pixelRatio[1];return Ge.box(Ge.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,f>>8&255,f&255,h>>8&255,h&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]),u,Ge.box(Ge.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Ge.box(Ge.types.pasp,new Uint8Array([v>>24,v>>16&255,v>>8&255,v&255,x>>24,x>>16&255,x>>8&255,x&255])))}}Ge.types=void 0,Ge.HDLR_TYPES=void 0,Ge.STTS=void 0,Ge.STSC=void 0,Ge.STCO=void 0,Ge.STSZ=void 0,Ge.VMHD=void 0,Ge.SMHD=void 0,Ge.STSD=void 0,Ge.FTYP=void 0,Ge.DINF=void 0;const ja=9e4;function ea(a,e,t=1,n=!1){const i=a*e*t;return n?Math.round(i):i}function Ml(a,e,t=1,n=!1){return ea(a,e,1/t,n)}function qr(a,e=!1){return ea(a,1e3,1/ja,e)}function Nl(a,e=1){return ea(a,ja,1/e)}const Bl=10*1e3,Ul=1024,Kl=1152,Gl=1536;let Ur=null,ta=null;function Va(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 Ss extends K{constructor(e,t,n,i){if(super("mp4-remuxer",i),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,Ur===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ur=s?parseInt(s[1]):0}if(ta===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);ta=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.log("initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("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,c=o-r;return c<-4294967296&&(t=!0,o=Yi(o,n),c=o-r),c>0?r:o},n);return t&&this.debug("PTS rollover detected"),i}remux(e,t,n,i,r,s,o,c){let u,f,h,v,x,S,B=r,P=r;const Q=e.pid>-1,ce=t.pid>-1,ie=t.samples.length,De=e.samples.length>0,Be=o&&ie>0||ie>1;if((!Q||De)&&(!ce||Be)||this.ISGenerated||o){if(this.ISGenerated){var Oe,$e,Xe,Ce;const Xt=this.videoTrackConfig;(Xt&&(t.width!==Xt.width||t.height!==Xt.height||((Oe=t.pixelRatio)==null?void 0:Oe[0])!==(($e=Xt.pixelRatio)==null?void 0:$e[0])||((Xe=t.pixelRatio)==null?void 0:Xe[1])!==((Ce=Xt.pixelRatio)==null?void 0:Ce[1]))||!Xt&&Be||this.nextAudioTs===null&&De)&&this.resetInitSegment()}this.ISGenerated||(h=this.generateIS(e,t,r,s));const St=this.isVideoContiguous;let Nt=-1,sn;if(Be&&(Nt=zl(t.samples),!St&&this.config.forceKeyFrameOnDiscontinuity))if(S=!0,Nt>0){this.warn(`Dropped ${Nt} out of ${ie} video samples due to a missing keyframe`);const Xt=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Nt),t.dropped+=Nt,P+=(t.samples[0].pts-Xt)/t.inputTimeScale,sn=P}else Nt===-1&&(this.warn(`No keyframe found out of ${ie} video samples`),S=!1);if(this.ISGenerated){if(De&&Be){const Xt=this.getVideoStartPts(t.samples),Vt=(Yi(e.samples[0].pts,Xt)-Xt)/t.inputTimeScale;B+=Math.max(0,Vt),P+=Math.max(0,-Vt)}if(De){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),h=this.generateIS(e,t,r,s)),f=this.remuxAudio(e,B,this.isAudioContiguous,s,ce||Be||c===Y.AUDIO?P:void 0),Be){const Xt=f?f.endPTS-f.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),h=this.generateIS(e,t,r,s)),u=this.remuxVideo(t,P,St,Xt)}}else Be&&(u=this.remuxVideo(t,P,St,0));u&&(u.firstKeyFrame=Nt,u.independent=Nt!==-1,u.firstKeyFramePTS=sn)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(x=$a(n,r,this._initPTS,this._initDTS)),i.samples.length&&(v=Za(i,r,this._initPTS))),{audio:f,video:u,initSegment:h,independent:S,text:v,id3:x}}generateIS(e,t,n,i){const r=e.samples,s=t.samples,o=this.typeSupported,c={},u=this._initPTS;let f=!u||i,h="audio/mp4",v,x,S,B;if(f&&(v=x=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(h="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:h,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):Ge.initSegment([e]),metadata:{channelCount:e.channelCount}},f&&(B=e.id,S=e.inputTimeScale,!u||S!==u.timescale?v=x=r[0].pts-Math.round(S*n):f=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Ge.initSegment([t]),metadata:{width:t.width,height:t.height}},f)if(B=t.id,S=t.inputTimeScale,!u||S!==u.timescale){const P=this.getVideoStartPts(s),Q=Math.round(S*n);x=Math.min(x,Yi(s[0].dts,P)-Q),v=Math.min(v,P-Q)}else f=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,f?(this._initPTS={baseTime:v,timescale:S},this._initDTS={baseTime:x,timescale:S}):v=S=void 0,{tracks:c,initPTS:v,timescale:S,trackId:B}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,s=e.samples,o=[],c=s.length,u=this._initPTS,f=u.baseTime*r/u.timescale;let h=this.nextVideoTs,v=8,x=this.videoSampleDuration,S,B,P=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,ce=!1;if(!n||h===null){const zt=f+t*r,Ft=s[0].pts-Yi(s[0].dts,s[0].pts);Ur&&h!==null&&Math.abs(zt-Ft-(h+f))<15e3?n=!0:h=zt-Ft-f}const ie=h+f;for(let zt=0;zt<c;zt++){const Ft=s[zt];Ft.pts=Yi(Ft.pts,ie),Ft.dts=Yi(Ft.dts,ie),Ft.dts<s[zt>0?zt-1:zt].dts&&(ce=!0)}ce&&s.sort(function(zt,Ft){const In=zt.dts-Ft.dts,Mn=zt.pts-Ft.pts;return In||Mn}),S=s[0].dts,B=s[s.length-1].dts;const De=B-S,Be=De?Math.round(De/(c-1)):x||e.inputTimeScale/30;if(n){const zt=S-ie,Ft=zt>Be,In=zt<-1;if((Ft||In)&&(Ft?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${qr(zt,!0)} ms (${zt}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${qr(-zt,!0)} ms (${zt}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!In||ie>=s[0].pts||Ur)){S=ie;const Mn=s[0].pts-zt;if(Ft)s[0].dts=S,s[0].pts=Mn;else{let jn=!0;for(let Gn=0;Gn<s.length&&!(s[Gn].dts>Mn&&jn);Gn++){const mi=s[Gn].pts;if(s[Gn].dts-=zt,s[Gn].pts-=zt,Gn<s.length-1){const ji=s[Gn+1].pts,Pi=s[Gn].pts,Vi=ji<=Pi,Dr=ji<=mi;jn=Vi==Dr}}}this.log(`Video: Initial PTS/DTS adjusted: ${qr(Mn,!0)}/${qr(S,!0)}, delta: ${qr(zt,!0)} ms`)}}S=Math.max(0,S);let ct=0,Oe=0,$e=S;for(let zt=0;zt<c;zt++){const Ft=s[zt],In=Ft.units,Mn=In.length;let jn=0;for(let Gn=0;Gn<Mn;Gn++)jn+=In[Gn].data.length;Oe+=jn,ct+=Mn,Ft.length=jn,Ft.dts<$e?(Ft.dts=$e,$e+=Be/4|0||1):$e=Ft.dts,P=Math.min(Ft.pts,P),Q=Math.max(Ft.pts,Q)}B=s[c-1].dts;const Xe=Oe+4*ct+8;let Ce;try{Ce=new Uint8Array(Xe)}catch(zt){this.observer.emit(p.ERROR,p.ERROR,{type:ee.MUX_ERROR,details:W.REMUX_ALLOC_ERROR,fatal:!1,error:zt,bytes:Xe,reason:`fail allocating video mdat ${Xe}`});return}const St=new DataView(Ce.buffer);St.setUint32(0,Xe),Ce.set(Ge.types.mdat,4);let Nt=!1,sn=Number.POSITIVE_INFINITY,Xt=Number.POSITIVE_INFINITY,Yt=Number.NEGATIVE_INFINITY,Vt=Number.NEGATIVE_INFINITY;for(let zt=0;zt<c;zt++){const Ft=s[zt],In=Ft.units;let Mn=0;for(let mi=0,ji=In.length;mi<ji;mi++){const Pi=In[mi],Vi=Pi.data,Dr=Pi.data.byteLength;St.setUint32(v,Dr),v+=4,Ce.set(Vi,v),v+=Dr,Mn+=4+Dr}let jn;if(zt<c-1)x=s[zt+1].dts-Ft.dts,jn=s[zt+1].pts-Ft.pts;else{const mi=this.config,ji=zt>0?Ft.dts-s[zt-1].dts:Be;if(jn=zt>0?Ft.pts-s[zt-1].pts:Be,mi.stretchShortVideoTrack&&this.nextAudioTs!==null){const Pi=Math.floor(mi.maxBufferHole*r),Vi=(i?P+i*r:this.nextAudioTs+f)-Ft.pts;Vi>Pi?(x=Vi-ji,x<0?x=ji:Nt=!0,this.log(`It is approximately ${Vi/90} ms to the next segment; using duration ${x/90} ms for the last video frame.`)):x=ji}else x=ji}const Gn=Math.round(Ft.pts-Ft.dts);sn=Math.min(sn,x),Yt=Math.max(Yt,x),Xt=Math.min(Xt,jn),Vt=Math.max(Vt,jn),o.push(Va(Ft.key,x,Mn,Gn))}if(o.length){if(Ur){if(Ur<70){const zt=o[0].flags;zt.dependsOn=2,zt.isNonSync=0}}else if(ta&&Vt-Xt<Yt-sn&&Be/Yt<.025&&o[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let zt=S;for(let Ft=0,In=o.length;Ft<In;Ft++){const Mn=zt+o[Ft].duration,jn=zt+o[Ft].cts;if(Ft<In-1){const Gn=Mn+o[Ft+1].cts;o[Ft].duration=Gn-jn}else o[Ft].duration=Ft?o[Ft-1].duration:Be;o[Ft].cts=0,zt=Mn}}}x=Nt||!x?Be:x;const hn=B+x;this.nextVideoTs=h=hn-f,this.videoSampleDuration=x,this.isVideoContiguous=!0;const dn={data1:Ge.moof(e.sequenceNumber++,S,m(e,{samples:o})),data2:Ce,startPTS:(P-f)/r,endPTS:(Q+x-f)/r,startDTS:(S-f)/r,endDTS:h/r,type:"video",hasAudio:!1,hasVideo:!0,nb:o.length,dropped:e.dropped};return e.samples=[],e.dropped=0,dn}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return Kl;case"ac3":return Gl;default:return Ul}}remuxAudio(e,t,n,i,r){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,c=s/o,u=this.getSamplesPerFrame(e),f=u*c,h=this._initPTS,v=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,x=[],S=r!==void 0;let B=e.samples,P=v?0:8,Q=this.nextAudioTs||-1;const ce=h.baseTime*s/h.timescale,ie=ce+t*s;if(this.isAudioContiguous=n=n||B.length&&Q>0&&(i&&Math.abs(ie-(Q+ce))<9e3||Math.abs(Yi(B[0].pts,ie)-(Q+ce))<20*f),B.forEach(function(Vt){Vt.pts=Yi(Vt.pts,ie)}),!n||Q<0){if(B=B.filter(Vt=>Vt.pts>=0),!B.length)return;r===0?Q=0:i&&!S?Q=Math.max(0,ie-ce):Q=B[0].pts-ce}if(e.segmentCodec==="aac"){const Vt=this.config.maxAudioFramesDrift;for(let hn=0,Bt=Q+ce;hn<B.length;hn++){const bn=B[hn],dn=bn.pts,zt=dn-Bt,Ft=Math.abs(1e3*zt/s);if(zt<=-Vt*f&&S)hn===0&&(this.warn(`Audio frame @ ${(dn/s).toFixed(3)}s overlaps marker by ${Math.round(1e3*zt/s)} ms.`),this.nextAudioTs=Q=dn-ce,Bt=dn);else if(zt>=Vt*f&&Ft<Bl&&S){let In=Math.round(zt/f);for(Bt=dn-In*f;Bt<0&&In&&f;)In--,Bt+=f;hn===0&&(this.nextAudioTs=Q=Bt-ce),this.warn(`Injecting ${In} audio frames @ ${((Bt-ce)/s).toFixed(3)}s due to ${Math.round(1e3*zt/s)} ms gap.`);for(let Mn=0;Mn<In;Mn++){let jn=Fl.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);jn||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),jn=bn.unit.subarray()),B.splice(hn,0,{unit:jn,pts:Bt}),Bt+=f,hn++}}bn.pts=Bt,Bt+=f}}let De=null,Be=null,ct,Oe=0,$e=B.length;for(;$e--;)Oe+=B[$e].unit.byteLength;for(let Vt=0,hn=B.length;Vt<hn;Vt++){const Bt=B[Vt],bn=Bt.unit;let dn=Bt.pts;if(Be!==null){const Ft=x[Vt-1];Ft.duration=Math.round((dn-Be)/c)}else if(n&&e.segmentCodec==="aac"&&(dn=Q+ce),De=dn,Oe>0){Oe+=P;try{ct=new Uint8Array(Oe)}catch(Ft){this.observer.emit(p.ERROR,p.ERROR,{type:ee.MUX_ERROR,details:W.REMUX_ALLOC_ERROR,fatal:!1,error:Ft,bytes:Oe,reason:`fail allocating audio mdat ${Oe}`});return}v||(new DataView(ct.buffer).setUint32(0,Oe),ct.set(Ge.types.mdat,4))}else return;ct.set(bn,P);const zt=bn.byteLength;P+=zt,x.push(Va(!0,u,zt,0)),Be=dn}const Xe=x.length;if(!Xe)return;const Ce=x[x.length-1];Q=Be-ce,this.nextAudioTs=Q+c*Ce.duration;const St=v?new Uint8Array(0):Ge.moof(e.sequenceNumber++,De/c,m({},e,{samples:x}));e.samples=[];const Nt=(De-ce)/s,sn=Q/s,Yt={data1:St,data2:ct,startPTS:Nt,endPTS:sn,startDTS:Nt,endDTS:sn,type:"audio",hasAudio:!0,hasVideo:!1,nb:Xe};return this.isAudioContiguous=!0,Yt}}function Yi(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 $a(a,e,t,n){const i=a.samples.length;if(!i)return;const r=a.inputTimeScale;for(let o=0;o<i;o++){const c=a.samples[o];c.pts=Yi(c.pts-t.baseTime*r/t.timescale,e*r)/r,c.dts=Yi(c.dts-n.baseTime*r/n.timescale,e*r)/r}const s=a.samples;return a.samples=[],{samples:s}}function Za(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=Yi(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 Wl extends K{constructor(e,t,n,i){super("passthrough-remuxer",i),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.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(ze(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=Ne(e);i.audio&&(t=Ya(i.audio,D.AUDIO,this)),i.video&&(n=Ya(i.video,D.VIDEO,this));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.warn("initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,n,i,r,s){var o,c;let{initPTS:u,lastEndTime:f}=this;const h={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};E(f)||(f=this.lastEndTime=r||0);const v=t.samples;if(!(v!=null&&v.length))return h;const x={initPTS:void 0,timescale:void 0,trackId:void 0};let S=this.initData;if((o=S)!=null&&o.length||(this.generateInitSegment(v),S=this.initData),!((c=S)!=null&&c.length))return this.warn("Failed to generate initSegment."),h;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1);const B=We(v,S,this),P=S.audio?B[S.audio.id]:null,Q=S.video?B[S.video.id]:null,ce=As(Q,1/0),ie=As(P,1/0),De=As(Q,0,!0),Be=As(P,0,!0);let ct,Oe=r,$e=0;if(P&&(!Q||!u&&ie<ce||u&&u.trackId===S.audio.id)?(x.trackId=S.audio.id,ct=P,$e=Be-ie):Q&&(x.trackId=S.video.id,ct=Q,$e=De-ce),ct){const Vt=ct.timescale;Oe=ct.start/Vt,x.initPTS=ct.start-r*Vt,x.timescale=Vt,u||(this.initPTS=u={baseTime:x.initPTS,timescale:Vt,trackId:x.trackId})}(s||!u)&&(Hl(u,Oe,r,$e)||x.timescale!==u.timescale)&&(x.initPTS=Oe-r,x.timescale=1,u&&u.timescale===1&&this.warn(`Adjusting initPTS @${r} from ${u.baseTime/u.timescale} to ${x.initPTS}`),this.initPTS=u={baseTime:x.initPTS,timescale:1});const Xe=e?Oe-u.baseTime/u.timescale:f,Ce=Xe+$e;$e>0?this.lastEndTime=Ce:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const St=!!S.audio,Nt=!!S.video;let sn="";St&&(sn+="audio"),Nt&&(sn+="video");const Xt={data1:v,startPTS:Xe,startDTS:Xe,endPTS:Ce,endDTS:Ce,type:sn,hasAudio:St,hasVideo:Nt,nb:1,dropped:0};h.audio=St&&!Nt?Xt:void 0,h.video=Nt?Xt:void 0;const Yt=Q==null?void 0:Q.sampleCount;if(Yt){const Vt=Q.keyFrameIndex,hn=Vt!==-1;Xt.nb=Yt,Xt.dropped=Vt===0||this.isVideoContiguous?0:hn?Vt:Yt,Xt.independent=hn,Xt.firstKeyFrame=Vt,hn&&Q.keyFrameStart&&(Xt.firstKeyFramePTS=(Q.keyFrameStart-u.baseTime)/u.timescale),this.isVideoContiguous||(h.independent=hn),this.isVideoContiguous||(this.isVideoContiguous=hn),Xt.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${Vt}/${Yt} dropped: ${Xt.dropped} start: ${Xt.firstKeyFramePTS||"NA"}`)}return h.initSegment=x,h.id3=$a(n,r,u,u),i.samples.length&&(h.text=Za(i,r,u)),h}}function As(a,e,t=!1){return(a==null?void 0:a.start)!==void 0?(a.start+(t?a.duration:0))/a.timescale:e}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,t){const n=a==null?void 0:a.codec;return n&&n.length>4?n:e===D.AUDIO?n==="ec-3"||n==="ac-3"||n==="alac"?n:n==="fLaC"||n==="Opus"?X(n,!1):(t.warn(`Unhandled audio codec "${n}" in mp4 MAP`),n||"mp4a"):(t.warn(`Unhandled video codec "${n}" in mp4 MAP`),n||"avc1")}let dr;try{dr=self.performance.now.bind(self.performance)}catch(a){dr=Date.now}const ws=[{demux:Il,remux:Wl},{demux:vr,remux:Ss},{demux:Dl,remux:Ss},{demux:Ll,remux:Ss}];ws.splice(2,0,{demux:Rl,remux:Ss});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=dr();let s=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:c}=this;i&&(this.currentTransmuxState=i);const{contiguous:u,discontinuity:f,trackSwitch:h,accurateTimeOffset:v,timeOffset:x,initSegmentChange:S}=i||o,{audioCodec:B,videoCodec:P,defaultInitPts:Q,duration:ce,initSegmentData:ie}=c,De=jl(s,t);if(De&&Li(De.method)){const $e=this.getDecrypter(),Xe=Mi(De.method);if($e.isSync()){let Ce=$e.softwareDecrypt(s,De.key.buffer,De.iv.buffer,Xe);if(n.part>-1){const Nt=$e.flush();Ce=Nt&&Nt.buffer}if(!Ce)return r.executeEnd=dr(),na(n);s=new Uint8Array(Ce)}else return this.asyncResult=!0,this.decryptionPromise=$e.webCryptoDecrypt(s,De.key.buffer,De.iv.buffer,Xe).then(Ce=>{const St=this.push(Ce,null,n);return this.decryptionPromise=null,St}),this.decryptionPromise}const Be=this.needsProbing(f,h);if(Be){const $e=this.configureTransmuxer(s);if($e)return this.logger.warn(`[transmuxer] ${$e.message}`),this.observer.emit(p.ERROR,p.ERROR,{type:ee.MEDIA_ERROR,details:W.FRAG_PARSING_ERROR,fatal:!1,error:$e,reason:$e.message}),r.executeEnd=dr(),na(n)}(f||h||S||Be)&&this.resetInitSegment(ie,B,P,ce,t),(f||S||Be)&&this.resetInitialTimestamp(Q),u||this.resetContiguity();const ct=this.transmux(s,De,x,v,n);this.asyncResult=es(ct);const Oe=this.currentTransmuxState;return Oe.contiguous=!0,Oe.discontinuity=!1,Oe.trackSwitch=!1,r.executeEnd=dr(),ct}flush(e){const t=e.transmuxing;t.executeStart=dr();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 h=n.flush();h&&s.push(this.push(h.buffer,null,e))}const{demuxer:c,remuxer:u}=this;if(!c||!u){t.executeEnd=dr();const h=[na(e)];return this.asyncResult?Promise.resolve(h):h}const f=c.flush(o);return es(f)?(this.asyncResult=!0,f.then(h=>(this.flushRemux(s,h,e),s))):(this.flushRemux(s,f,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:s,textTrack:o}=t,{accurateTimeOffset:c,timeOffset:u}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===Y.MAIN?"level":"track"} ${n.level}`);const f=this.remuxer.remux(i,r,s,o,u,c,!0,this.id);e.push({remuxResult:f,chunkMeta:n}),n.transmuxing.executeEnd=dr()}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:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,o,c,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 h=0,v=ws.length;h<v;h++){var s;if((s=ws[h].demux)!=null&&s.probe(e,this.logger)){r=ws[h];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const o=this.demuxer,c=this.remuxer,u=r.remux,f=r.demux;(!c||!(c instanceof u))&&(this.remuxer=new u(n,t,i,this.logger)),(!o||!(o instanceof f))&&(this.demuxer=new f(n,t,i,this.logger),this.probe=f.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new li(this.config)),e}}function jl(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 na=a=>({remuxResult:{},chunkMeta:a});function es(a){return"then"in a&&a.then instanceof Function}class Vl{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 $l{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 Ja{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=c=>{const u=c.data,f=this.hls;if(!(!f||!(u!=null&&u.event)||u.instanceNo!==this.instanceNo))switch(u.event){case"init":{var h;const v=(h=this.workerContext)==null?void 0:h.objectURL;v&&self.URL.revokeObjectURL(v);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}case"workerLog":{f.logger[u.data.logType]&&f.logger[u.data.logType](u.data.message);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.part=this.part,u.data.id=this.id,f.trigger(u.event,u.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const u=new Error(`${c.message} (${c.filename}:${c.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(p.ERROR,{type:ee.OTHER_ERROR,details:W.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:u})};const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const s=(c,u)=>{u=u||{},u.frag=this.frag||void 0,c===p.ERROR&&(u=u,u.parent=this.id,u.part=this.part,this.error=u.error),this.hls.trigger(c,u)};this.observer=new Nr,this.observer.on(p.FRAG_DECRYPTED,s),this.observer.on(p.ERROR,s);const o=je(r.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const c=this.hls.logger;if(r.workerPath||Hs()){try{r.workerPath?(c.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=tl(r.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=el());const{worker:f}=this.workerContext;f.addEventListener("message",this.onWorkerMessage),f.addEventListener("error",this.onWorkerError),f.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:o,id:t,config:Kt(r)})}catch(f){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,f),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=je(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:Kt(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),nl(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,c,u,f){var h,v;u.transmuxing.start=self.performance.now();const{instanceNo:x,transmuxer:S}=this,B=s?s.start:r.start,P=r.decryptdata,Q=this.frag,ce=!(Q&&r.cc===Q.cc),ie=!(Q&&u.level===Q.level),De=Q?u.sn-Q.sn:-1,Be=this.part?u.part-this.part.index:-1,ct=De===0&&u.id>1&&u.id===(Q==null?void 0:Q.stats.chunkCount),Oe=!ie&&(De===1||De===0&&(Be===1||ct&&Be<=0)),$e=self.performance.now();(ie||De||r.stats.parsing.start===0)&&(r.stats.parsing.start=$e),s&&(Be||!Oe)&&(s.stats.parsing.start=$e);const Xe=!(Q&&((h=r.initSegment)==null?void 0:h.url)===((v=Q.initSegment)==null?void 0:v.url)),Ce=new $l(ce,Oe,c,ie,B,Xe);if(!Oe||ce||Xe){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${u.sn}${u.part>-1?" part: "+u.part:""} ${this.id===Y.MAIN?"level":"track"}: ${u.level} id: ${u.id}
|
|
discontinuity: ${ce}
|
|
trackSwitch: ${ie}
|
|
contiguous: ${Oe}
|
|
accurateTimeOffset: ${c}
|
|
timeOffset: ${B}
|
|
initSegmentChange: ${Xe}`);const St=new Vl(n,i,t,o,f);this.configureTransmuxer(St)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:x,cmd:"demux",data:e,decryptdata:P,chunkMeta:u,state:Ce},e instanceof ArrayBuffer?[e]:[]);else if(S){const St=S.push(e,P,u,Ce);es(St)?St.then(Nt=>{this.handleTransmuxComplete(Nt)}).catch(Nt=>{this.transmuxerError(Nt,u,"transmuxer-interface push error")}):this.handleTransmuxComplete(St)}}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);es(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(p.ERROR,{type:ee.MEDIA_ERROR,details:W.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 qa=100;class Zl extends zn{constructor(e,t,n){super(e,t,n,"audio-stream-controller",Y.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(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){if(n===Y.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===st.WAITING_INIT_PTS){const c=this.waitingData;(!c&&!this.loadingParts||c&&c.frag.cc!==s)&&this.syncWithAnchor(t,c==null?void 0:c.frag)}else!this.hls.hasEnoughToStart&&o&&o.cc!==s?(o.abortRequests(),this.syncWithAnchor(t,o)):this.state===st.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var n;const i=((n=this.mainFragLoading)==null?void 0:n.frag)||null;if(t&&(i==null?void 0:i.cc)===t.cc)return;const r=(i||e).cc,s=this.getLevelDetails(),o=this.getLoadPosition(),c=Jt(s,r,o);c&&(this.log(`Syncing with main frag at ${c.start} cc ${c.cc}`),this.startFragRequested=!1,this.nextLoadPosition=c.start,this.resetLoadingState(),this.state===st.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=st.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(qa),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=st.IDLE):this.state=st.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case st.IDLE:this.doTickIdle();break;case st.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=st.WAITING_INIT_PTS}break}case st.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=st.IDLE}break}case st.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=st.FRAG_LOADING;const c=r.flush().buffer,u={frag:n,part:i,payload:c,networkDetails:null};this._handleFragmentLoadProgress(u),s&&super._handleFragmentLoadComplete(u)}else o&&o.cc!==t.frag.cc&&this.syncWithAnchor(o,t.frag)}else this.state=st.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),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],c=o.details;if(!c||this.waitForLive(o)||this.waitForCdnTuneIn(c)){this.state=st.WAITING_TRACK,this.startFragRequested=!1;return}const u=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&u&&(this.bufferFlushed=!1,this.afterBufferFlushed(u,D.AUDIO,Y.AUDIO));const f=this.getFwdBufferInfo(u,Y.AUDIO);if(f===null)return;if(!this.switchingTrack&&this._streamEnded(f,c)){t.trigger(p.BUFFER_EOS,{type:"audio"}),this.state=st.ENDED;return}const h=f.len,v=t.maxBufferLength,x=c.fragments,S=x[0].start,B=this.getLoadPosition(),P=this.flushing?B:f.end;if(this.switchingTrack&&i){const ie=B;c.PTSKnown&&ie<S&&(f.end>S||f.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=S+.05)}if(h>=v&&!this.switchingTrack&&P<x[x.length-1].start)return;let Q=this.getNextFragment(P,c);if(Q&&this.isLoopLoading(Q,P)&&(Q=this.getNextFragmentLoopLoading(Q,c,f,Y.MAIN,v)),!Q){this.bufferFlushed=!0;return}let ce=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&ce&&he(Q)&&!Q.endList&&(!c.live||!this.loadingParts&&P<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(ce)===xn.OK&&(this.mainFragLoading=ce=null),ce&&he(ce))){if(Q.start>ce.end){const De=this.fragmentTracker.getFragAtPos(P,Y.MAIN);De&&De.end>ce.end&&(ce=De,this.mainFragLoading={frag:De,targetBufferTime:null})}if(Q.start>ce.end)return}this.loadFragment(Q,o,P)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new Sn(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!==st.STOPPED&&(this.setInterval(qa),this.state=st.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(p.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:i}=this,{details:r,id:s,groupId:o,track:c}=t;if(!i){this.warn(`Audio tracks reset while loading track ${s} "${c.name}" of "${o}"`);return}const u=this.mainDetails;if(!u||r.endCC>u.endCC||u.expired){this.cachedTrackLoadedData=t,this.state!==st.STOPPED&&(this.state=st.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${c.name}" of "${o}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const f=i[s];let h=0;if(r.live||(n=f.details)!=null&&n.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;if(f.details){var v;h=this.alignPlaylists(r,f.details,(v=this.levelLastLoaded)==null?void 0:v.details)}r.alignedSliding||(_s(r,u),r.alignedSliding||Fr(r,u),h=r.fragmentStart)}f.details=r,this.levelLastLoaded=f,this.startFragRequested||this.setStartPosition(u,h),this.hls.trigger(p.AUDIO_TRACK_UPDATED,{details:r,id:s,groupId:t.groupId}),this.state===st.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=st.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{config:s,trackId:o,levels:c}=this;if(!c){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 u=c[o];if(!u){this.warn("Audio track is undefined on fragment load progress");return}const f=u.details;if(!f){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const h=s.defaultAudioCodec||u.audioCodec||"mp4a.40.2";let v=this.transmuxer;v||(v=this.transmuxer=new Ja(this.hls,Y.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const x=this.initPTS[n.cc],S=(t=n.initSegment)==null?void 0:t.data;if(x!==void 0){const P=i?i.index:-1,Q=P!==-1,ce=new ci(n.level,n.sn,n.stats.chunkCount,r.byteLength,P,Q);v.push(r,S,h,"",n,i,f.totalduration,!1,ce,x)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${f.startSN} ,${f.endSN}],track ${o}`);const{cache:B}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new ki,complete:!1};B.push(new Uint8Array(r)),this.state!==st.STOPPED&&(this.state=st.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===Y.MAIN&&he(t.frag)&&(this.mainFragLoading=t,this.state===st.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==Y.AUDIO){!this.audioOnly&&n.type===Y.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(he(n)){this.fragPrevious=n;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(p.AUDIO_TRACK_SWITCHED,y({},r)))}this.fragBufferedComplete(n,i),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=st.ERROR;return}switch(t.details){case W.FRAG_GAP:case W.FRAG_PARSING_ERROR:case W.FRAG_DECRYPT_ERROR:case W.FRAG_LOAD_ERROR:case W.FRAG_LOAD_TIMEOUT:case W.KEY_LOAD_ERROR:case W.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Y.AUDIO,t);break;case W.AUDIO_TRACK_LOAD_ERROR:case W.AUDIO_TRACK_LOAD_TIMEOUT:case W.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===st.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===ue.AUDIO_TRACK&&(this.state=st.IDLE);break;case W.BUFFER_ADD_CODEC_ERROR:case W.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case W.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case W.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==D.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==D.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===st.ENDED&&(this.state=st.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,Y.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:c,part:u,level:f}=o,{details:h}=f,{audio:v,text:x,id3:S,initSegment:B}=r;if(this.fragContextChanged(c)||!h){this.fragmentTracker.removeFragment(c);return}if(this.state=st.PARSING,this.switchingTrack&&v&&this.completeAudioSwitch(this.switchingTrack),B!=null&&B.tracks){const P=c.initSegment||c;this._bufferInitSegment(f,B.tracks,P,s),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:P,id:n,tracks:B.tracks})}if(v){const{startPTS:P,endPTS:Q,startDTS:ce,endDTS:ie}=v;u&&(u.elementaryStreams[D.AUDIO]={startPTS:P,endPTS:Q,startDTS:ce,endDTS:ie}),c.setElementaryStreamInfo(D.AUDIO,P,Q,ce,ie),this.bufferFragmentData(v,c,u,s)}if(S!=null&&(t=S.samples)!=null&&t.length){const P=m({id:n,frag:c,details:h},S);i.trigger(p.FRAG_PARSING_METADATA,P)}if(x){const P=m({id:n,frag:c,details:h},x);i.trigger(p.FRAG_PARSING_USERDATA,P)}}_bufferInitSegment(e,t,n,i){if(this.state!==st.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const r=t.audio;r.id=Y.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(p.BUFFER_CODECS,t);const o=r.initSegment;if(o!=null&&o.byteLength){const c={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:o};this.hls.trigger(p.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.switchingTrack||i===xn.NOT_LOADED||i===xn.PARTIAL){var r;if(!he(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=st.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&Fr(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;ht({name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:o},e,xt)||(yn(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(p.AUDIO_TRACK_SWITCHED,y({},e))}}class ia extends K{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 c;try{c=new self.URL(o.URI,t.url).href}catch(u){this.warn(`Could not construct new URL for Rendition Report: ${u}`),c=o.URI||""}if(c===e){r=s;break}else c===e.substring(0,c.length)&&(r=s)}if(r!==-1){const s=i[r],o=parseInt(s["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let c=parseInt(s["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const f=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&f>t.partTarget&&(c+=1)}const u=n&&fn(n);return new pn(o,c>=0?c:void 0,u)}}}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 c=this.hls.config.timelineOffset;if(c!==i.appliedTimelineOffset){const f=Math.max(c||0,0);i.appliedTimelineOffset=f,i.fragments.forEach(h=>{h.start=h.playlistOffset+f})}if(i.live||n!=null&&n.live){const f="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(n),n&&i.fragments.length>0){Ns(n,i);const ce=i.playlistParsingError;if(ce){this.warn(ce);const ie=this.hls;if(!ie.config.ignorePlaylistParsingErrors){var u;const{networkDetails:De}=t;ie.trigger(p.ERROR,{type:ee.NETWORK_ERROR,details:W.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:ce,reason:ce.message,level:t.level||void 0,parent:(u=i.fragments[0])==null?void 0:u.type,networkDetails:De,stats:r});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=r.loading.start);const h=this.hls.mainForwardBufferInfo,v=h?h.end-h.len:0,x=(i.edge-v)*1e3,S=ds(i,x);if(i.requestScheduled+S<s?i.requestScheduled=s:i.requestScheduled+=S,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let B,P,Q;if(i.canBlockReload&&i.endSN&&i.advanced){const ce=this.hls.config.lowLatencyMode,ie=i.lastPartSn,De=i.endSN,Be=i.lastPartIndex,ct=Be!==-1,Oe=ie===De;ct?Oe?(P=De+1,Q=ce?0:Be):(P=ie,Q=ce?Be+1:i.maxPartIndex):P=De+1;const $e=i.age,Xe=$e+i.ageHeader;let Ce=Math.min(Xe-i.partTarget,i.targetduration*1.5);if(Ce>0){if(Xe>i.targetduration*3)this.log(`Playlist last advanced ${$e.toFixed(2)}s ago. Omitting segment and part directives.`),P=void 0,Q=void 0;else if(n!=null&&n.tuneInGoal&&Xe-i.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${Ce} with playlist age: ${i.age}`),Ce=0;else{const St=Math.floor(Ce/i.targetduration);if(P+=St,Q!==void 0){const Nt=Math.round(Ce%i.targetduration/i.partTarget);Q+=Nt}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${$e.toFixed(2)}s goal: ${Ce} skip sn ${St} to part ${Q}`)}i.tuneInGoal=Ce}if(B=this.getDeliveryDirectives(i,t.deliveryDirectives,P,Q),ce||!Oe){i.requestScheduled=s,this.loadingPlaylist(f,B);return}}else(i.canBlockReload||i.canSkipUntil)&&(B=this.getDeliveryDirectives(i,t.deliveryDirectives,P,Q));B&&P!==void 0&&i.canBlockReload&&(i.requestScheduled=r.loading.first+Math.max(S-o*2,S/2)),this.scheduleLoading(f,B,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=fn(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=Bn.No),new pn(n,i,r)}checkRetry(e){const t=e.details,n=rn(e),i=e.errorAction,{action:r,retryCount:s=0,retryConfig:o}=i||{},c=!!i&&!!o&&(r===cn.RetryRequest||!i.resolved&&r===cn.SendAlternateToPenaltyBox);if(c){var u;if(s>=o.maxNumRetry)return!1;if(n&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const f=gn(o,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),f),this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" in ${f}ms`)}e.levelRetry=!0,i.resolved=!0}return c}}function eo(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!ts(a[t].attrs,e[t].attrs))return!1;return!0}function ts(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 ra(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Yl extends ia{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(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.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,x)=>{v.id=x});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const c=this.hls.config.audioPreference;if(!r&&c){const v=Je(c,o,xt);if(v>-1)r=o[v];else{const x=Je(c,this.tracks);r=this.tracks[x]}}let u=this.findTrackId(r);u===-1&&r&&(u=this.findTrackId(null));const f={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(p.AUDIO_TRACKS_UPDATED,f);const h=this.trackId;if(u!==-1&&h===-1)this.setAudioTrack(u);else if(o.length&&h===-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(p.ERROR,{type:ee.MEDIA_ERROR,details:W.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:v})}}}onError(e,t){t.fatal||!t.context||t.context.type===ue.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&&ht(e,i,xt))return i;const r=Je(e,this.tracksInGroup,xt);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=It(e,t.levels,n,s,xt);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const s=Je(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(p.AUDIO_TRACK_SWITCHING,y({},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||ht(e,i,xt)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:c}=e;for(let u=0;u<t.length;u++){const f=t[u];if(ht({name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:c},f,xt))return u}for(let u=0;u<t.length;u++){const f=t[u];if(ts(e.attrs,f.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return u}for(let u=0;u<t.length;u++){const f=t[u];if(ts(e.attrs,f.attrs,["LANGUAGE"]))return u}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&yn(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(p.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}}class Xl{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 to=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,no="HlsJsTrackRemovedError";class Ql extends Error{constructor(e){super(e),this.name=no}}class Jl extends K{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(p.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=oe(ae(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(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_APPENDING,this.onBufferAppending,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.BUFFER_EOS,this.onBufferEos,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.FRAG_PARSED,this.onFragParsed,this),e.on(p.FRAG_CHANGED,this.onFragChanged,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_APPENDING,this.onBufferAppending,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_EOS,this.onBufferEos,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.FRAG_PARSED,this.onFragParsed,this),e.off(p.FRAG_CHANGED,this.onFragChanged,this),e.off(p.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=ae(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 c=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||c&&s instanceof c,io(n),ql(n,o),n.load()}catch(c){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: ${Kt(n,(c,u)=>c==="initSegment"?void 0:u)};
|
|
transfer tracks: ${Kt(i,(c,u)=>c==="initSegment"?void 0:u)}}`),!re(i,n)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,u=this.details,f=Math.max(c,(u==null?void 0:u.fragments[0].start)||0);if(f-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${f}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(n)}") start time: ${f} currentTime: ${c}`),this.onMediaDetaching(p.MEDIA_DETACHING,{}),this.onMediaAttaching(p.MEDIA_ATTACHING,t),e.currentTime=f;return}this.transferData=void 0,r.forEach(c=>{const u=c,f=i[u];if(f){const h=f.buffer;if(h){const v=this.fragmentTracker,x=f.id;if(v.hasFragments(x)||v.hasParts(x)){const P=$t.getBuffered(h);v.detectEvictedFragments(u,P,x,null,!0)}const S=sa(u),B=[u,h];this.sourceBuffers[S]=B,h.updating&&this.operationQueue&&this.operationQueue.prependBlocker(u),this.trackSourceBuffer(u,f)}}}),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 c=r.sourceBuffers;for(let u=c.length;u--;)o&&c[u].abort(),r.removeSourceBuffer(c[u]);o&&r.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.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&&io(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(p.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[sa(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Xl(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 c,u,f;const h=t[o],{id:v,codec:x,levelCodec:S,container:B,metadata:P,supplemental:Q}=h;let ce=n[o];const ie=(c=this.transferData)==null||(u=c.tracks)==null?void 0:u[o],De=ie!=null&&ie.buffer?ie:ce,Be=(De==null?void 0:De.pendingCodec)||(De==null?void 0:De.codec),ct=De==null?void 0:De.levelCodec;ce||(ce=n[o]={buffer:void 0,listeners:[],codec:x,supplemental:Q,container:B,levelCodec:S,metadata:P,id:v});const Oe=fe(Be,ct),$e=Oe==null?void 0:Oe.replace(to,"$1");let Xe=fe(x,S);const Ce=(f=Xe)==null?void 0:f.replace(to,"$1");Xe&&Oe&&$e!==Ce&&(o.slice(0,5)==="audio"&&(Xe=X(Xe,this.appendSource)),this.log(`switching codec ${Be} to ${Xe}`),Xe!==(ce.pendingCodec||ce.codec)&&(ce.pendingCodec=Xe),ce.container=B,this.appendChangeType(o,B,Xe))}),(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,Y.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var o;const c=this.tracks.video;(this.lastVideoAppendEnd>i||c!=null&&c.buffer&&$t.isBuffered(c.buffer,i)||((o=this.fragmentTracker.getAppendedFrag(i,Y.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:c,chunkMeta:u,offset:f}=t,h=u.buffering[r],{sn:v,cc:x}=o,S=self.performance.now();h.start=S;const B=o.stats.buffering,P=c?c.stats.buffering:null;B.start===0&&(B.start=S),P&&P.start===0&&(P.start=S);const Q=n.audio;let ce=!1;r==="audio"&&(Q==null?void 0:Q.container)==="audio/mpeg"&&(ce=!this.lastMpegAudioChunk||u.id===1||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);const ie=n.video,De=ie==null?void 0:ie.buffer;if(De&&v!=="initSegment"){const Oe=c||o,$e=this.blockedAudioAppend;if(r==="audio"&&s!=="main"&&!this.blockedAudioAppend){const Ce=Oe.start+Oe.duration*.05,St=De.buffered,Nt=this.currentOp("video");!St.length&&!Nt?this.blockAudio(Oe):!Nt&&!$t.isBuffered(De,Ce)&&this.lastVideoAppendEnd<Ce&&this.blockAudio(Oe)}else if(r==="video"){const Xe=Oe.end;if($e){const Ce=$e.frag.start;(Xe>Ce||Xe<this.lastVideoAppendEnd||$t.isBuffered(De,Ce))&&this.unblockAudio()}this.lastVideoAppendEnd=Xe}}const Be=(c||o).start,ct={label:`append-${r}`,execute:()=>{var Oe;h.executeStart=self.performance.now();const $e=(Oe=this.tracks[r])==null?void 0:Oe.buffer;$e&&(ce?this.updateTimestampOffset($e,Be,.1,r,v,x):f!==void 0&&E(f)&&this.updateTimestampOffset($e,f,1e-6,r,v,x)),this.appendExecutor(i,r)},onStart:()=>{},onComplete:()=>{const Oe=self.performance.now();h.executeEnd=h.end=Oe,B.first===0&&(B.first=Oe),P&&P.first===0&&(P.first=Oe);const $e={};this.sourceBuffers.forEach(([Xe,Ce])=>{Xe&&($e[Xe]=$t.getBuffered(Ce))}),this.appendErrors[r]=0,r==="audio"||r==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(p.BUFFER_APPENDED,{type:r,frag:o,part:c,chunkMeta:u,parent:o.type,timeRanges:$e})},onError:Oe=>{var $e;const Xe={type:ee.MEDIA_ERROR,parent:o.type,details:W.BUFFER_APPEND_ERROR,sourceBufferName:r,frag:o,part:c,chunkMeta:u,error:Oe,err:Oe,fatal:!1},Ce=($e=this.media)==null?void 0:$e.error;if(Oe.code===DOMException.QUOTA_EXCEEDED_ERR||Oe.name=="QuotaExceededError"||"quota"in Oe)Xe.details=W.BUFFER_FULL_ERROR;else if(Oe.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!Ce)Xe.errorAction=ni(!0);else if(Oe.name===no&&this.sourceBufferCount===0)Xe.errorAction=ni(!0);else{const St=++this.appendErrors[r];this.warn(`Failed ${St}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${Ce||"no media error"})`),(St>=this.hls.config.appendErrorMaxRetry||Ce)&&(Xe.fatal=!0)}this.hls.trigger(p.ERROR,Xe)}};this.append(ct,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(p.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[D.AUDIOVIDEO]?r.push("audiovideo"):(s[D.AUDIO]&&r.push("audio"),s[D.VIDEO]&&r.push("video"));const o=()=>{const c=self.performance.now();n.stats.buffering.end=c,i&&(i.stats.buffering.end=c);const u=i?i.stats:n.stats;this.hls.trigger(p.FRAG_BUFFERED,{frag:n,part:i,stats:u,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(c=>{this.warn(`Fragment buffered callback ${c}`),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(p.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(p.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(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===W.BUFFER_APPEND_ERROR&&t.frag){var n;const i=(n=t.errorAction)==null?void 0:n.nextAutoLevel;E(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(E(o)&&o>=0){const c=Math.max(o,s),u=Math.floor(r/s)*s-c;this.flushBackBuffer(r,s,u)}if(E(i.frontBufferFlushThreshold)&&i.frontBufferFlushThreshold>0){const c=Math.max(i.maxBufferLength,i.frontBufferFlushThreshold),u=Math.max(c,s),f=Math.floor(r/s)*s+u;this.flushFrontBuffer(r,s,f)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const o=$t.getBuffered(r);if(o.length>0&&n>o.start(0)){var s;this.hls.trigger(p.BACK_BUFFER_REACHED,{bufferEnd:n});const c=this.tracks[i];if((s=this.details)!=null&&s.live)this.hls.trigger(p.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(c!=null&&c.ended){this.log(`Cannot flush ${i} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:i})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const s=$t.getBuffered(r),o=s.length;if(o<2)return;const c=s.start(o-1),u=s.end(o-1);if(n>c||e>=c&&e<=u)return;this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:c,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 u=Math.max(0,t.fragmentStart),f=Math.max(u,i);return{duration:1/0,start:u,end:f}}return{duration:1/0}}const r=(e=this.overrides)==null?void 0:e.duration;if(r)return E(r)?{duration:r}:null;const s=this.media.duration,o=E(n.duration)?n.duration:0;return i>o&&i>s||!E(s)?{duration:i}:null}updateMediaSource({duration:e,start:t,end:n}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==e&&(E(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}) ${Kt(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(p.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(p.ERROR,{type:ee.MEDIA_ERROR,details:W.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 c=this.getTrackCodec(o,s),u=`${o.container};codecs=${c}`;o.codec=c,this.log(`creating sourceBuffer(${u})${this.currentOp(s)?" Queued":""} ${Kt(o)}`);try{const f=n.addSourceBuffer(u),h=sa(s),v=[s,f];t[h]=v,o.buffer=f}catch(f){var i;this.error(`error while trying to add sourceBuffer: ${f.message}`),this.shiftAndExecuteNext(s),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[s],this.hls.trigger(p.ERROR,{type:ee.MEDIA_ERROR,details:W.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,sourceBufferName:s,mimeType:u,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")&&Ct(n,"video")&&(i=te(i,n));const r=fe(i,e.levelCodec);return r?t.slice(0,5)==="audio"?X(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(p.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(p.ERROR,{type:ee.MEDIA_ERROR,details:W.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.currentOp(e);r&&r.onError(i)}updateTimestampOffset(e,t,n,i,r,s){const o=t-e.timestampOffset;Math.abs(o)>=n&&(this.log(`Updating ${i} SourceBuffer timestampOffset to ${t} (sn: ${r} cc: ${s})`),e.timestampOffset=t)}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 c=E(i.duration)?i.duration:1/0,u=E(r.duration)?r.duration:1/0,f=Math.max(0,t),h=Math.min(n,c,u);h>f&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${f},${h}] from the ${e} SourceBuffer`),o.remove(f,h)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],i=n==null?void 0:n.buffer;if(!i)throw new Ql(`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 io(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function ql(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function sa(a){return a==="audio"?1:0}class aa{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(p.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(p.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.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&&E(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,aa.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,c)=>c?o.width!==c.width||o.height!==c.height:!0;let r=e.length-1;const s=Math.max(t,n);for(let o=0;o<e.length;o+=1){const c=e[o];if((c.width>=s||c.height>=s)&&i(c,e[o+1])){r=o;break}}return r}}const zi={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},eu={HLS:"h"},ns={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},tu={[ns.OBJECT]:["br","ab","d","ot","tb","tpb","lb","tab","lab","url"],[ns.REQUEST]:["pb","bl","tbl","dl","ltc","mtp","nor","nrr","rc","sn","sta","su","ttfb","ttfbb","ttlb","cmsdd","cmsds","smrt","df","cs"],[ns.SESSION]:["cid","pr","sf","sid","st","v","msd"],[ns.STATUS]:["bs","bsd","cdn","rtp","bg","pt","ec","e"]};class Kr{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof Kr?n:new Kr(n))),this.value=e,this.params=t}}const nu="Dict";function iu(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 ru(a,e,t,n){return new Error(`failed to ${a} "${iu(e)}" as ${t}`,{cause:n})}function cr(a,e,t){return ru("serialize",a,e,t)}class ro{constructor(e){this.description=e}}const so="Bare Item",su="Boolean";function au(a){if(typeof a!="boolean")throw cr(a,su);return a?"?1":"?0"}function ou(a){return btoa(String.fromCharCode(...a))}const lu="Byte Sequence";function uu(a){if(ArrayBuffer.isView(a)===!1)throw cr(a,lu);return`:${ou(a)}:`}const cu="Integer";function fu(a){return a<-999999999999999||999999999999999<a}function ao(a){if(fu(a))throw cr(a,cu);return a.toString()}function hu(a){return`@${ao(a.getTime()/1e3)}`}function oo(a,e){if(a<0)return-oo(-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}const du="Decimal";function pu(a){const e=oo(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw cr(a,du);const t=e.toString();return t.includes(".")?t:`${t}.0`}const gu="String",mu=/[\x00-\x1f\x7f]+/;function _u(a){if(mu.test(a))throw cr(a,gu);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function vu(a){return a.description||a.toString().slice(7,-1)}const yu="Token";function lo(a){const e=vu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw cr(e,yu);return e}function oa(a){switch(typeof a){case"number":if(!E(a))throw cr(a,so);return Number.isInteger(a)?ao(a):pu(a);case"string":return _u(a);case"symbol":return lo(a);case"boolean":return au(a);case"object":if(a instanceof Date)return hu(a);if(a instanceof Uint8Array)return uu(a);if(a instanceof ro)return lo(a);default:throw cr(a,so)}}const bu="Key";function la(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw cr(a,bu);return a}function ua(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${la(e)}`:`;${la(e)}=${oa(t)}`).join("")}function uo(a){return a instanceof Kr?`${oa(a.value)}${ua(a.params)}`:oa(a)}function Eu(a){return`(${a.value.map(uo).join(" ")})${ua(a.params)}`}function xu(a,e={whitespace:!0}){if(typeof a!="object")throw cr(a,nu);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof Kr||(r=new Kr(r));let s=la(i);return r.value===!0?s+=ua(r.params):(s+="=",Array.isArray(r.value)?s+=Eu(r):s+=uo(r)),s}).join(`,${n}`)}function Su(a,e){return xu(a,e)}function Au(a){return["ot","sf","st","e","sta"].includes(a)}function wu(a){return typeof a=="number"?E(a):a!=null&&a!==""&&a!==!1}function Tu(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("/")}const Ts=a=>Math.round(a),Du=(a,e)=>(e!=null&&e.baseUrl&&(a=Tu(a,e.baseUrl)),encodeURIComponent(a)),Ds=a=>Ts(a/100)*100,Ru={br:Ts,d:Ts,bl:Ds,dl:Ds,mtp:Ds,nor:Du,rtp:Ds,tb:Ts};function Lu(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),i=m({},Ru,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return n.forEach(s=>{if((r==null?void 0:r(s))===!1)return;let o=a[s];const c=i[s];c&&(o=c(o,e)),!(s==="v"&&o===1)&&(s=="pr"&&o===1||wu(o)&&(Au(s)&&typeof o=="string"&&(o=new ro(o)),t[s]=o))}),t}function co(a,e={}){return a?Su(Lu(a,e),m({whitespace:!1},e)):""}function Cu(a,e={}){const t={};if(!a)return t;const n=Object.entries(a),i=Object.entries(tu).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),r=n.reduce((s,o)=>{var c,u;const[f,h]=o,v=((c=i.find(x=>x[1].includes(f)))===null||c===void 0?void 0:c[0])||ns.REQUEST;return(u=s[v])!==null&&u!==void 0||(s[v]={}),s[v][f]=h,s},{});return Object.entries(r).reduce((s,[o,c])=>(s[o]=co(c,e),s),t)}function Iu(a,e,t){return m(a,Cu(e,t))}const ku="CMCD";function Pu(a,e={}){if(!a)return"";const t=co(a,e);return`${ku}=${encodeURIComponent(t)}`}const fo=/CMCD=[^&#]+/;function Ou(a,e,t){const n=Pu(e,t);if(!n)return a;if(fo.test(a))return a.replace(fo,n);const i=a.includes("?")?"&":"?";return`${a}${i}${n}`}class Fu{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:zi.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],c=this.getObjectType(r),u={d:(s||r).duration*1e3,ot:c};(c===zi.VIDEO||c===zi.AUDIO||c==zi.MUXED)&&(u.br=o.bitrate/1e3,u.tb=this.getTopBandwidth(c)/1e3,u.bl=this.getBufferLength(c));const f=s?this.getNextPart(s):this.getNextFrag(r);f!=null&&f.url&&f.url!==r.url&&(u.nor=f.url),this.apply(i,u)}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(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHED,this.onMediaDetached,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHED,this.onMediaDetached,this),e.off(p.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:eu.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===zi.INIT||t.ot===zi.VIDEO||t.ot===zi.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={}),Iu(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 c=s.length-1;c>=0;c--){const u=s[c];if(u.index===i&&u.fragment.sn===o)return s[c+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return zi.TIMED_TEXT;if(e.sn==="initSegment")return zi.INIT;if(t==="audio")return zi.AUDIO;if(t==="main")return this.hls.audioTracks.length?zi.VIDEO:zi.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===zi.AUDIO)n=i.audioTracks;else{const r=i.maxAutoLevel,s=r>-1?r+1:i.levels.length;n=i.levels.slice(0,s)}return n.forEach(r=>{r.bitrate>t&&(t=r.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===zi.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:$t.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 Mu=3e5;class Nu extends K{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(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.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===Pn.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:o,pathwayId:c,type:u}=t.context;o&&i?s=this.getPathwayForGroupId(o,u,s):c&&(s=c)}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),t.details===W.BUFFER_APPEND_ERROR&&!t.fatal?n.resolved=!0:n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${i&&i.length} priorities: ${Kt(r)} penalized: ${Kt(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]>Mu&&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,c=this.hls.levels[o];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,gs(t),this.hls.trigger(p.LEVELS_UPDATED,{levels:t});const u=this.hls.levels[o];c&&u&&this.levels&&(u.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&u.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${u.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===ue.AUDIO_TRACK&&i[r].hasAudioGroup(e)||t===ue.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":c}=r;if(t.some(f=>f.pathwayId===s))return;const u=this.getLevelsForPathway(o).map(f=>{const h=new an(f.attrs);h["PATHWAY-ID"]=s;const v=h.AUDIO&&`${h.AUDIO}_clone_${s}`,x=h.SUBTITLES&&`${h.SUBTITLES}_clone_${s}`;v&&(n[h.AUDIO]=v,h.AUDIO=v),x&&(i[h.SUBTITLES]=x,h.SUBTITLES=x);const S=po(f.uri,h["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),B=new Sn({attrs:h,audioCodec:f.audioCodec,bitrate:f.bitrate,height:f.height,name:f.name,url:S,videoCodec:f.videoCodec,width:f.width});if(f.audioGroups)for(let P=1;P<f.audioGroups.length;P++)B.addGroupId("audio",`${f.audioGroups[P]}_clone_${s}`);if(f.subtitleGroups)for(let P=1;P<f.subtitleGroups.length;P++)B.addGroupId("text",`${f.subtitleGroups[P]}_clone_${s}`);return B});t.push(...u),ho(this.audioTracks,n,c,s),ho(this.subtitleTracks,i,c,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(f){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const f=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+f)}const r={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,o=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},u={onSuccess:(f,h,v,x)=>{this.log(`Loaded steering manifest: "${i}"`);const S=f.data;if((S==null?void 0:S.VERSION)!==1){this.log(`Steering VERSION ${S.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=S.TTL;const{"RELOAD-URI":B,"PATHWAY-CLONES":P,"PATHWAY-PRIORITY":Q}=S;if(B)try{this.uri=new self.URL(B,i).href}catch(ie){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${B}`);return}this.scheduleRefresh(this.uri||v.url),P&&this.clonePathways(P);const ce={steeringManifest:S,url:i.toString()};this.hls.trigger(p.STEERING_MANIFEST_LOADED,ce),Q&&this.updatePathwayPriority(Q)},onError:(f,h,v,x)=>{if(this.log(`Error loading steering manifest: ${f.code} ${f.text} (${h.url})`),this.stopLoad(),f.code===410){this.enabled=!1,this.log(`Steering manifest ${h.url} no longer available`);return}let S=this.timeToLoad*1e3;if(f.code===429){const B=this.loader;if(typeof(B==null?void 0:B.getResponseHeader)=="function"){const P=B.getResponseHeader("Retry-After");P&&(S=parseFloat(P)*1e3)}this.log(`Steering manifest ${h.url} rate limited`);return}this.scheduleRefresh(this.uri||h.url,S)},onTimeout:(f,h,v)=>{this.log(`Timeout loading steering manifest (${h.url})`),this.scheduleRefresh(this.uri||h.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,c,u)}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 ho(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 an(o.attrs),o.url=o.attrs.URI=po(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 po(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 c=new self.URL(a);return i&&!o&&(c.host=i),r&&Object.keys(r).sort().forEach(u=>{u&&c.searchParams.set(u,r[u])}),c.href}function Xi(a,e,t){ir(a,e,t),a.addEventListener(e,t)}function ir(a,e,t){a.removeEventListener(e,t)}class Gr extends K{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.mediaKeys=null,this.setMediaKeysQueue=Gr.CDMCleanupPromise?[Gr.CDMCleanupPromise]:[],this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onWaitingForKey=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(p.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(p.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Rn.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,c)=>!!s&&c.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 c=u=>{const f=u.shift();this.getMediaKeysPromise(f,i,r).then(h=>s({keySystem:f,mediaKeys:h})).catch(h=>{u.length?c(u):h instanceof Qi?o(h):o(new Qi({type:ee.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_NO_ACCESS,error:h,fatal:!0},h.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return gr===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=fr(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: ${Kt(i)}`),s=this.requestMediaKeySystemAccess(e,i);const o=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),s.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const u=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=c.createMediaKeys().then(f=>(this.log(`Media-keys created for "${e}"`),o.hasMediaKeys=!0,u.then(h=>h?this.setMediaKeysServerCertificate(f,e,h):f))),o.mediaKeys.catch(f=>{this.error(`Failed to create media-keys for "${e}"}: ${f}`)}),o.mediaKeys})}return s.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${M.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 M.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${M.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
|
|
} (data length: ${t&&t.byteLength})`),i.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>er(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:n})=>this.attemptSetMediaKeys(t,n))}selectKeySystem(e){return new Promise((t,n)=>this.getKeySystemSelectionPromise(e).then(({keySystem:i})=>{const r=er(i);r?t(r):n(new Error(`Unable to find format for key-system "${i}"`))}).catch(n))}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){const t=tr(this.config),n=e.map(Gi).filter(i=>!!i&&t.indexOf(i)!==-1);return this.selectKeySystem(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:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(o,c).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:o,mediaKeys:c,decryptdata:t}))))),(this.keyIdToKeySessionPromise[n]=r.then(o=>{const c="cenc",u=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(o,c,u,"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 Qi?this.hls.trigger(p.ERROR,e.data):this.hls.trigger(p.ERROR,{type:ee.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=Gi(e.keyFormat),r=i?[i]:tr(this.config);return this.attemptKeySystemAccess(r)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=tr(this.config)),e.length===0)throw new Qi({type:ee.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${Kt({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaKeys===t)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then(()=>{if(!this.media)throw this.mediaKeys=null,new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.mediaKeys=t,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 S=o.call(this.hls,t,n,e);if(!S)throw new Error("Invalid response from configured generateRequest filter");t=S.initDataType,n=S.initData?S.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(S){var c;if(this.warn(S.message),(c=this.hls)!=null&&c.config.debug)throw S}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const u=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${u} (init data type: ${t} length: ${n?n.byteLength:null})`);const f=new Nr,h=e._onmessage=S=>{const B=e.mediaKeysSession;if(!B){f.emit("error",new Error("invalid state"));return}const{messageType:P,message:Q}=S;this.log(`"${P}" message event for session "${B.sessionId}" message size: ${Q.byteLength}`),P==="license-request"||P==="license-renewal"?this.renewLicense(e,Q).catch(ce=>{f.eventNames().length?f.emit("error",ce):this.handleError(ce)}):P==="license-release"?e.keySystem===Rn.FAIRPLAY&&(this.updateKeySession(e,hi("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${P}"`)},v=e._onkeystatuseschange=S=>{if(!e.mediaKeysSession){f.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const P=e.keyStatus;f.emit("keyStatus",P),P==="expired"&&(this.warn(`${e.keySystem} expired for key ${u}`),this.renewKeySession(e))};Xi(e.mediaKeysSession,"message",h),Xi(e.mediaKeysSession,"keystatuseschange",v);const x=new Promise((S,B)=>{f.on("error",B),f.on("keyStatus",P=>{P.startsWith("usable")?S():P==="output-restricted"?B(new Qi({type:ee.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):P==="internal-error"?B(new Qi({type:ee.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${P}"`)):P==="expired"?B(new Error("key expired while generating request")):this.warn(`unhandled key status change "${P}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var S;this.log(`Request generated for key-session "${(S=e.mediaKeysSession)==null?void 0:S.sessionId}" keyId: ${u}`)}).catch(S=>{throw new Qi({type:ee.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_NO_SESSION,error:S,fatal:!1},`Error generating key-session request: ${S}`)}).then(()=>x).catch(S=>{throw f.removeAllListeners(),this.removeSession(e),S}).then(()=>(f.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: ${M.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${M.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 c={responseType:"arraybuffer",url:r},u=t.certLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(v,x,S,B)=>{s(v.data)},onError:(v,x,S,B)=>{o(new Qi({type:ee.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:S,response:y({url:c.url,data:void 0},v)},`"${e}" certificate request failed (${r}). Status: ${v.code} (${v.text})`))},onTimeout:(v,x,S)=>{o(new Qi({type:ee.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:S,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(v,x,S)=>{o(new Error("aborted"))}};i.load(c,f,h)})):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 Qi({type:ee.KEY_SYSTEM_ERROR,details:W.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 Qi({type:ee.KEY_SYSTEM_ERROR,details:W.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 f;for(let h=0,v=r.length;h<v;h++){var s,o;f=r[h];const x=(s=f.querySelector("name"))==null?void 0:s.textContent,S=(o=f.querySelector("value"))==null?void 0:o.textContent;x&&S&&e.setRequestHeader(x,S)}}const c=i.querySelector("Challenge"),u=c==null?void 0:c.textContent;if(!u)throw new Error("Cannot find <Challenge> in key message");return hi(atob(u))}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 c=o.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const u=this.config.licenseResponseCallback;if(u)try{c=u.call(this.hls,o,s,e)}catch(f){this.error(f)}i(c)}else{const c=n.errorRetry,u=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||o.status>=400&&o.status<500)r(new Qi({type:ee.KEY_SYSTEM_ERROR,details:W.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 f=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${f} 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:c,licenseChallenge:u})=>{e.keySystem==Rn.PLAYREADY&&(u=this.unpackPlayReadyKeyMessage(c,u)),c.send(u)})})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,Xi(n,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(ir(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},!this.mediaKeys&&!this.mediaKeySessions.length)return;const t=this.media,n=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,ei.clearKeyUriToKeyIdMap();const i=n.length;Gr.CDMCleanupPromise=Promise.all(n.map(r=>this.removeSession(r)).concat(t==null||(e=t.setMediaKeys(null))==null?void 0:e.catch(r=>{var s;this.log(`Could not clear media keys: ${r}`),(s=this.hls)==null||s.trigger(p.ERROR,{type:ee.OTHER_ERROR,details:W.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${r}`)})}))).catch(r=>{var s;this.log(`Could not close sessions and clear media keys: ${r}`),(s=this.hls)==null||s.trigger(p.ERROR,{type:ee.OTHER_ERROR,details:W.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${r}`)})}).then(()=>{i&&this.log("finished closing key sessions and clearing media keys")})}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(Zt(r)?new Promise((o,c)=>{self.setTimeout(()=>c(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(o)}):Promise.resolve()).catch(o=>{var c;this.log(`Could not remove session: ${o}`),(c=this.hls)==null||c.trigger(p.ERROR,{type:ee.OTHER_ERROR,details:W.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${o}`)})}).then(()=>t.close()).catch(o=>{var c;this.log(`Could not close session: ${o}`),(c=this.hls)==null||c.trigger(p.ERROR,{type:ee.OTHER_ERROR,details:W.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${o}`)})})}}}Gr.CDMCleanupPromise=void 0;class Qi 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 Bu{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(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(p.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(p.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,c=1e3*s/r,u=this.hls;if(u.trigger(p.FPS_DROP,{currentDropped:s,currentDecoded:o,totalDroppedFrames:n}),c>0&&s>u.config.fpsDroppedMonitoringThreshold*o){let f=u.currentLevel;u.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=f)&&(f=f-1,u.trigger(p.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:u.currentLevel}),u.autoLevelCapping=f,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 go(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){Z.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){Z.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function zr(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 ca(a,e,t,n){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=Ku(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 Uu(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 Ku(a,e,t){const n=[],i=Uu(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 Rs(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 ia{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=Rs(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(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.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;Rs(n.textTracks).forEach(s=>{zr(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(f=>!n||n.indexOf(f.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(f=>f.default)&&(this.selectDefaultTrack=!1),s.forEach((f,h)=>{f.id=h});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const o=this.hls.config.subtitlePreference;if(!r&&o){this.selectDefaultTrack=!1;const f=Je(o,s);if(f>-1)r=s[f];else{const h=Je(o,this.tracks);r=this.tracks[h]}}let c=this.findTrackId(r);c===-1&&r&&(c=this.findTrackId(null));const u={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(p.SUBTITLE_TRACKS_UPDATED,u),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}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||ht(r,e)))return i}if(e){for(let i=0;i<t.length;i++){const r=t[i];if(ts(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const r=t[i];if(ts(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(ra(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===ue.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&&ht(e,n))return n;const i=Je(e,this.tracksInGroup);if(i>-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(n)return null;{const r=Je(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(p.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Rs(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(r=>ra(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||!E(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(p.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:c,type:u,url:f}=i;this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:c,type:u,url:f});const h=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(h)}}function zu(){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 is(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const Wr=.025;let Ls=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function Wu(a,e,t){return`${a.identifier}-${t+1}-${is(e)}`}class Hu{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){var t;if(e>0&&e>=this.assetList.length)return!0;const n=this.playoutLimit;return e<=0||isNaN(n)?!1:n===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>n}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 fa(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=fa(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=E(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 fa(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)<Wr))}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"?Ls.Range:Ls.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 ju(this)}}function fa(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<Wr)?e.start:e.start+e.duration}function _o(a,e,t){const n=new self.URL(a,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function ha(a,e){for(;(t=a.assetList[++e])!=null&&t.error;)var t;return e}function ju(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function Hr(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Vu{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=()=>{this.reachedPlayout(this.currentTime)&&this.hls.trigger(p.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new e(t);this.interstitial=n,this.assetItem=i;let s=i.uri;try{s=_o(s,t.primarySessionId).href}catch(c){}r.loadSource(s);const o=()=>{this.hasDetails=!0};r.once(p.LEVEL_LOADED,o),r.once(p.AUDIO_TRACK_LOADED,o),r.once(p.SUBTITLE_TRACK_LOADED,o),r.on(p.MEDIA_ATTACHING,(c,{media:u})=>{this.removeMediaListeners(),this.mediaAttached=u,this.interstitial.playoutLimit&&(u.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&r.on(p.BUFFER_APPENDED,()=>{const h=this.bufferedEnd;this.reachedPlayout(h)&&(this._bufferedEosTime=h,r.trigger(p.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){var e;return((e=this.interstitial)==null?void 0:e.appendInPlace)||!1}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e||!this._bufferedEosTime)return!1;const n=this.timelineOffset,i=$t.bufferInfo(e,n,0);return this.getAssetTime(i.end)>=this._bufferedEosTime-.02}reachedPlayout(e){const n=this.interstitial.playoutLimit;return this.startOffset+e>=n}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=$t.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()}resetDetails(){const e=this.hls;if(this.hasDetails){e.stopLoad();const t=n=>delete n.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}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;return`HlsAssetPlayer: ${Hr(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const vo=.033;class $u extends K{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),c=r?r.filter(u=>!o.includes(u.identifier)):[];s.length&&s.sort((u,f)=>{const h=u.cue.pre,v=u.cue.post,x=f.cue.pre,S=f.cue.post;if(h&&!x)return-1;if(x&&!h||v&&!S)return 1;if(S&&!v)return-1;if(!h&&!x&&!v&&!S){const B=u.startTime,P=f.startTime;if(B!==P)return B-P}return u.dateRange.tagOrder-f.dateRange.tagOrder}),this.events=s,c.forEach(u=>{this.removeEvent(u)}),this.updateSchedule(e,c)}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,c)=>Math.abs(o.playout.start-i[c].playout.start)>.005||Math.abs(o.playout.end-i[c].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],c=e[o];if(c.isInterstitial){let u=this.eventMap[o];u?u.setDateRange(c):(u=new Hu(c,t),this.eventMap[o]=u,n===!1&&(u.appendInPlace=n)),i.push(u)}}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(c=>!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,u=0;if(e.forEach((f,h)=>{const v=f.cue.pre,x=f.cue.post,S=e[h-1]||null,B=f.appendInPlace,P=x?r:f.startOffset,Q=f.duration,ce=f.timelineOccupancy===Ls.Range?Q:0,ie=f.resumptionOffset,De=(S==null?void 0:S.startTime)===P,Be=P+f.cumulativeDuration;let ct=B?Be+Q:P+ie;if(v||!x&&P<=0){const $e=u;u+=ce,f.timelineStart=Be;const Xe=s;s+=Q,n.push({event:f,start:Be,end:ct,playout:{start:Xe,end:s},integrated:{start:$e,end:u}})}else if(P<=r){if(!De){const Ce=P-c;if(Ce>vo){const St=c,Nt=u;u+=Ce;const sn=s;s+=Ce;const Xt={previousEvent:e[h-1]||null,nextEvent:f,start:St,end:St+Ce,playout:{start:sn,end:s},integrated:{start:Nt,end:u}};n.push(Xt)}else Ce>0&&S&&(S.cumulativeDuration+=Ce,n[n.length-1].end=P)}x&&(ct=Be),f.timelineStart=Be;const $e=u;u+=ce;const Xe=s;s+=Q,n.push({event:f,start:Be,end:ct,playout:{start:Xe,end:s},integrated:{start:$e,end:u}})}else return;const Oe=f.resumeTime;x||Oe>r?c=r:c=Oe}),c<r){var o;const f=c,h=u,v=r-c;u+=v;const x=s;s+=v,n.push({previousEvent:((o=n[n.length-1])==null?void 0:o.event)||null,nextEvent:null,start:c,end:f+v,playout:{start:x,end:s},integrated:{start:h,end:u}})}this.setDurations(r,s,u)}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,c)=>{const u=o.cue.pre,f=o.cue.post,h=u?0:f?i:o.startTime;this.updateAssetDurations(o),s===h?o.cumulativeDuration=r:(r=0,s=h),!f&&o.snapOptions.in&&(o.resumeAnchor=en(null,n.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)),!o.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<vo&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`));const x=E(o.resumeOffset)?o.resumeOffset:o.duration;r+=x})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,i=e.startTime+e.resumptionOffset;return Math.abs(n-i)>Wr?(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,c=o.edge;if(n>=c)return this.log(`"${e.identifier}" resumption ${n} past ${s} playlist end ${c}`),!1;const u=en(null,o.fragments,n);if(!u)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${s} playlist (${o.fragStart}-${o.fragmentEnd})`),!0;const f=s==="audio"?.175:0;return Math.abs(u.start-n)<Wr+f||Math.abs(u.end-n)<Wr+f?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${s} fragment bounds (${u.start}-${u.end} sn: ${u.sn} cc: ${u.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 c=t+n;s.startOffset=n,s.timelineStart=c,i||(i=s.duration===null),r||(r=!!s.error);const u=s.error?0:s.duration||0;n+=u}),i&&!r?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function br(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class Zu{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let i;try{i=_o(n,this.hls.sessionId,e.baseUrl)}catch(v){const x=this.assignAssetListError(e,W.ASSET_LIST_LOAD_ERROR,v,n);this.hls.trigger(p.ERROR,x);return}t&&i.protocol!=="data:"&&i.searchParams.set("_HLS_start_offset",""+t);const r=this.hls.config,s=r.loader,o=new s(r),c={responseType:"json",url:i.href},u=r.interstitialAssetListLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(v,x,S,B)=>{const P=v.data,Q=P==null?void 0:P.ASSETS;if(!Array.isArray(Q)){const ce=this.assignAssetListError(e,W.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),S.url,x,B);this.hls.trigger(p.ERROR,ce);return}e.assetListResponse=P,this.hls.trigger(p.ASSET_LIST_LOADED,{event:e,assetListResponse:P,networkDetails:B})},onError:(v,x,S,B)=>{const P=this.assignAssetListError(e,W.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${v.code} ${v.text} (${x.url})`),x.url,B,S);this.hls.trigger(p.ERROR,P)},onTimeout:(v,x,S)=>{const B=this.assignAssetListError(e,W.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${x.url})`),x.url,v,S);this.hls.trigger(p.ERROR,B)}};return o.load(c,f,h),this.hls.trigger(p.ASSET_LIST_LOADING,{event:e}),o}assignAssetListError(e,t,n,i,r,s){return e.error=n,{type:ee.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:n,networkDetails:s,stats:r}}}function yo(a){a==null||a.play().catch(()=>{})}class Yu extends K{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 c;const v=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(o)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!s){const x=this.findItemIndex(o);if(v>x){const S=this.schedule.findJumpRestrictedIndex(x+1,v);if(S>x){this.setSchedulePosition(S);return}}}this.setSchedulePosition(v);return}const u=this.playingAsset;if(!u){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 f=u.timelineStart,h=u.duration||0;(s&&n<f||n>=f+h)&&this.setScheduleToAssetAtTime(n,u)},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||[],c=r.items||[],u=r.durations,f=n.map(S=>S.identifier),h=!!(o.length||f.length);(h||i)&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
|
|
Schedule: ${c.map(S=>br(S))} pos: ${this.timelinePos}`),f.length&&this.log(`Removed events ${f}`),this.playerQueue.forEach(S=>{if(S.interstitial.appendInPlace){const B=S.assetItem.timelineStart,P=S.timelineOffset-B;if(P)try{S.timelineOffset=B}catch(Q){Math.abs(P)>Wr&&this.warn(`${Q} ("${S.assetId}" ${S.timelineOffset}->${B})`)}}});let v=null;if(s){const S=this.updateItem(s,this.timelinePos);this.itemsMatch(s,S)&&(this.playingItem=S,this.waitingItem=this.endedItem=null,v=()=>this.trimInPlace(S,s))}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const x=this.bufferingItem;if(x){const S=this.updateItem(x,this.bufferedPos);this.itemsMatch(x,S)?(this.bufferingItem=S,v||(v=()=>this.trimInPlace(S,x))):x.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(x.event,null))}if(n.forEach(S=>{S.assetList.forEach(B=>{this.clearAssetPlayer(B.identifier,null)})}),h||i){if(this.hls.trigger(p.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:c.slice(0),durations:u,removedIds:f}),this.isInterstitial(s)&&f.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}v&&v(),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Zu(e),this.schedule=new $u(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(p.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(p.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(p.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(p.MEDIA_ENDED,this.onMediaEnded,this),e.on(p.ERROR,this.onError,this),e.on(p.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(p.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(p.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(p.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(p.MEDIA_ENDED,this.onMediaEnded,this),e.off(p.ERROR,this.onError,this),e.off(p.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){ir(e,"play",this.onPlay),ir(e,"pause",this.onPause),ir(e,"seeking",this.onSeeking),ir(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;Xi(n,"seeking",this.onSeeking),Xi(n,"timeupdate",this.onTimeupdate),Xi(n,"play",this.onPlay),Xi(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=h=>h&&e.getAssetPlayer(h.identifier),i=(h,v,x,S,B)=>{if(h){let P=h[v].start;const Q=h.event;if(Q){if(v==="playout"||Q.timelineOccupancy!==Ls.Point){const ce=n(x);(ce==null?void 0:ce.interstitial)===Q&&(P+=ce.assetItem.startOffset+ce[B])}}else{const ce=S==="bufferedPos"?s():e[S];P+=ce-h.start}return P}return 0},r=(h,v)=>{if(h!==0&&v!=="primary"&&e.schedule.length){var x;const S=e.schedule.findItemIndexAtTime(h),B=(x=e.schedule.items)==null?void 0:x[S];if(B){const P=B[v].start-B.start;return h+P}}return h},s=()=>{const h=e.bufferedPos;return h===Number.MAX_VALUE?o("primary"):Math.max(h,0)},o=h=>{var v;return(v=e.primaryDetails)!=null&&v.live?e.primaryDetails.edge:e.schedule.durations[h]},c=(h,v)=>{var x,S;const B=e.effectivePlayingItem;if(B!=null&&(x=B.event)!=null&&x.restrictions.skip)return;e.log(`seek to ${h} "${v}"`);const P=e.effectivePlayingItem,Q=e.schedule.findItemIndexAtTime(h,v),ce=(S=e.schedule.items)==null?void 0:S[Q],ie=e.getBufferingPlayer(),De=ie==null?void 0:ie.interstitial,Be=De==null?void 0:De.appendInPlace,ct=P&&e.itemsMatch(P,ce);if(P&&(Be||ct)){const $e=n(e.playingAsset),Xe=($e==null?void 0:$e.media)||e.primaryMedia;if(Xe){const Ce=v==="primary"?Xe.currentTime:i(P,v,e.playingAsset,"timelinePos","currentTime"),St=h-Ce,Nt=(Be?Ce:Xe.currentTime)+St;if(Nt>=0&&(!$e||Be||Nt<=$e.duration)){Xe.currentTime=Nt;return}}}if(ce){let $e=h;if(v!=="primary"){const Ce=ce[v].start,St=h-Ce;$e=ce.start+St}const Xe=!e.isInterstitial(ce);if((!e.isInterstitial(P)||P.event.appendInPlace)&&(Xe||ce.event.appendInPlace)){const Ce=e.media||(Be?ie==null?void 0:ie.media:null);Ce&&(Ce.currentTime=$e)}else if(P){const Ce=e.findItemIndex(P);if(Q>Ce){const Nt=e.schedule.findJumpRestrictedIndex(Ce+1,Q);if(Nt>Ce){e.setSchedulePosition(Nt);return}}let St=0;if(Xe)e.timelinePos=$e,e.checkBuffer();else{var Oe;const Nt=ce==null||(Oe=ce.event)==null?void 0:Oe.assetList;if(Nt){const sn=h-(ce[v]||ce).start;for(let Xt=Nt.length;Xt--;){const Yt=Nt[Xt];if(Yt.duration&&sn>=Yt.startOffset&&sn<Yt.startOffset+Yt.duration){St=Xt;break}}}}e.setSchedulePosition(Q,St)}}},u=()=>{const h=e.effectivePlayingItem;if(e.isInterstitial(h))return h;const v=t();return e.isInterstitial(v)?v:null},f={get currentTime(){const h=u(),v=e.effectivePlayingItem;return v&&v===h?i(v,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-v.playout.start:0},set currentTime(h){const v=u(),x=e.effectivePlayingItem;x&&x===v&&c(h+x.playout.start,"playout")},get duration(){const h=u();return h?h.playout.end-h.playout.start:0},get assetPlayers(){var h;const v=(h=u())==null?void 0:h.event.assetList;return v?v.map(x=>e.getAssetPlayer(x.identifier)):[]},get playingIndex(){var h;const v=(h=u())==null?void 0:h.event;return v&&e.effectivePlayingAsset?v.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return u()}};this.manager={get events(){var h,v;return((h=e.schedule)==null||(v=h.events)==null?void 0:v.slice(0))||[]},get schedule(){var h,v;return((h=e.schedule)==null||(v=h.items)==null?void 0:v.slice(0))||[]},get interstitialPlayer(){return u()?f:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const h=t();return e.findItemIndex(h)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const h=e.effectivePlayingItem;return e.findItemIndex(h)},primary:{get bufferedEnd(){return s()},get currentTime(){const h=e.timelinePos;return h>0?h:0},set currentTime(h){c(h,"primary")},get duration(){return o("primary")},get seekableStart(){var h;return((h=e.primaryDetails)==null?void 0:h.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(h){c(h,"integrated")},get duration(){return o("integrated")},get seekableStart(){var h;return r(((h=e.primaryDetails)==null?void 0:h.fragmentStart)||0,"integrated")}},skip:()=>{const h=e.effectivePlayingItem,v=h==null?void 0:h.event;if(v&&!v.restrictions.skip){const x=e.findItemIndex(h);if(v.appendInPlace){const S=h.playout.start+h.event.duration;c(S+.001,"playout")}else e.advanceAfterAssetEnded(v,x,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||!E(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} ${Kt(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,c=o&&e.interstitial.appendInPlace,u=(n=this.detachedData)==null?void 0:n.mediaSource;let f;if(s.media)c&&(r=s.transferMedia(),this.detachedData=r),f="Primary";else if(u){const x=this.getBufferingPlayer();x?(r=x.transferMedia(),f=`${x}`):f="detached MediaSource"}else f="detached media";if(!r){if(u)r=this.detachedData,this.log(`using detachedData: MediaSource ${Kt(r)}`);else if(!this.detachedData||s.media===t){const x=this.playerQueue;x.length>1&&x.forEach(S=>{if(o&&S.interstitial.appendInPlace!==c){const B=S.interstitial;this.clearInterstitial(S.interstitial,null),B.appendInPlace=!1,B.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${B}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const h=r&&"mediaSource"in r&&((i=r.mediaSource)==null?void 0:i.readyState)!=="closed",v=h&&r?r:t;if(this.log(`${h?"transfering MediaSource":"attaching media"} to ${o?e:"Primary"} from ${f}`),v===r){const x=o&&e.assetId===this.schedule.assetIdAtEnd;v.overrides={duration:this.schedule.duration,endOfStream:!o||x,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=ha(e,n);if(!e.isAssetPastPlayoutLimit(i))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 c=e.resumeTime;this.timelinePos<c&&(this.timelinePos=c,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.advanceAfterAssetEnded(r,s,o-1)}}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 u=r.event,f=this.playingAsset,h=f==null?void 0:f.identifier,v=h?this.getAssetPlayer(h):null;if(v&&h&&(!this.eventItemsMatch(r,i)||t!==void 0&&h!==((o=u.assetList)==null?void 0:o[t].identifier))){var c;const x=u.findAssetIndex(f);if(this.log(`INTERSTITIAL_ASSET_ENDED ${x+1}/${u.assetList.length} ${Hr(f)}`),this.endedAsset=f,this.playingAsset=null,this.hls.trigger(p.INTERSTITIAL_ASSET_ENDED,{asset:f,assetListIndex:x,event:u,schedule:n.slice(0),scheduleIndex:e,player:v}),r!==this.playingItem){this.itemsMatch(r,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(u,this.findItemIndex(this.playingItem),x);return}this.retreiveMediaSource(h,i),v.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&v.detachMedia()}if(!this.eventItemsMatch(r,i)&&(this.endedItem=r,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${u} ${br(r)}`),u.hasPlayed=!0,this.hls.trigger(p.INTERSTITIAL_ENDED,{event:u,schedule:n.slice(0),scheduleIndex:e}),u.cue.once)){this.updateSchedule();const x=this.schedule.items;if(i&&x){const S=this.findItemIndex(i);this.advanceSchedule(S,x,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,c=this.playerQueue;if(c.length&&c.forEach(u=>{const f=u.interstitial,h=this.schedule.findEventIndex(f.identifier);(h<e||h>e+1)&&this.clearInterstitial(f,s)}),this.isInterstitial(s)){this.timelinePos=Math.min(Math.max(this.timelinePos,s.start),s.end);const u=s.event;if(n===void 0){n=this.schedule.findAssetIndex(u,this.timelinePos);const x=ha(u,n-1);if(u.isAssetPastPlayoutLimit(x)){this.advanceAfterAssetEnded(u,e,n);return}n=x}const f=this.waitingItem;this.assetsBuffered(s,o)||this.setBufferingItem(s);let h=this.preloadAssets(u,n);if(this.eventItemsMatch(s,f||i)||(this.waitingItem=s,this.log(`INTERSTITIAL_STARTED ${br(s)} ${u.appendInPlace?"append in place":""}`),this.hls.trigger(p.INTERSTITIAL_STARTED,{event:u,schedule:t.slice(0),scheduleIndex:e})),!u.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${u}`);return}if(u.assetListLoader&&(u.assetListLoader.destroy(),u.assetListLoader=void 0),!o){this.log(`Waiting for attachMedia to start Interstitial ${u}`);return}this.waitingItem=this.endedItem=null,this.playingItem=s;const v=u.assetList[n];if(!v){const x=t[e+1],S=this.media;x&&S&&!this.isInterstitial(x)&&S.currentTime<x.start&&(S.currentTime=this.timelinePos=x.start),this.advanceAfterAssetEnded(u,e,n||0);return}if(h||(h=this.getAssetPlayer(v.identifier)),h===null||h.destroyed){const x=u.assetList.length;this.warn(`asset ${n+1}/${x} player destroyed ${u}`),h=this.createAssetPlayer(u,v,n)}if(!this.eventItemsMatch(s,this.bufferingItem)&&u.appendInPlace&&this.isAssetBuffered(v))return;this.startAssetPlayer(h,n,t,e,o),this.shouldPlay&&yo(h.media)}else s!==null?(this.resumePrimary(s,e,i),this.shouldPlay&&yo(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 ${br(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(`INTERSTITIALS_PRIMARY_RESUMED ${br(e)}`),this.hls.trigger(p.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:$t.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(p.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(p.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1)return;const n=this.hls.levels[t.level],i=y(y({},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=y(y({},this.altSelection),{},{audio:n});return}const r=y(y({},i),{},{audio:n});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=y(y({},this.altSelection),{},{subtitles:n});return}const r=y(y({},i),{},{subtitles:n});this.mediaSelection=r}onAudioTrackSwitching(e,t){const n=we(t);this.playerQueue.forEach(i=>i.hls.setAudioOption(t)||i.hls.setAudioOption(n))}onSubtitleTrackSwitch(e,t){const n=we(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}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((r,s)=>{e.event.isAssetPastPlayoutLimit(s)&&this.clearAssetPlayer(r.identifier,null)});const n=e.end+.25,i=$t.bufferInfo(this.primaryMedia,n,0);(i.end>n||(i.nextStart||0)>n)&&(this.attachPrimary(n,null),this.flushFrontBuffer(n))}}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=$t.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 c=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var u,f;const h=this.findItemIndex(r),v=Math.min(h+1,t.length-1),x=t[v];if((c===-1&&r&&e>=r.end||(u=x.event)!=null&&u.appendInPlace&&e+.01>=x.start)&&(c=v),v-o>1&&(r==null||(f=r.event)==null?void 0:f.appendInPlace)===!1)return;if(this.bufferedPos=e,c>h&&c>o)this.bufferedToItem(x);else{const S=this.primaryDetails;this.primaryLive&&S&&e>S.edge-S.targetduration&&x.start<S.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(x)&&this.preloadAssets(x.event,0)}}else n&&s&&!this.itemsMatch(s,r)&&(c===o?this.bufferedToItem(s):c===o+1&&this.bufferedToItem(t[c]))}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();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const c=o?o.remaining:t?t.end-this.timelinePos:0;this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${br(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),this.playbackDisabled||(s?e.event.assetList.forEach(u=>{const f=this.getAssetPlayer(u.identifier);f&&f.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(u=>u.pauseBuffering()))),this.hls.trigger(p.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],c=this.primaryMedia;o&&c&&this.bufferAssetPlayer(s,c)}}}preloadAssets(e,t){const n=e.assetUrl,i=e.assetList.length,r=i===0&&!e.assetListLoader,s=e.cue.once;if(r){const c=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(c+.25)}let u,f=0;if(!this.playingItem&&this.primaryLive&&(f=this.hls.startPosition,f===-1&&(f=this.hls.liveSyncPosition||0)),f&&!(e.cue.pre||e.cue.post)){const v=f-c;v>0&&(u=Math.round(v*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:i} ${e}${u?` live-start: ${f} start-offset: ${u}`:""}`),n)return this.createAsset(e,0,0,c,e.duration,n);const h=this.assetListLoader.loadAssetList(e,u);h&&(e.assetListLoader=h)}else if(!s&&i){for(let c=t;c<i;c++){const u=e.assetList[c],f=this.getAssetPlayerQueueIndex(u.identifier);(f===-1||this.playerQueue[f].destroyed)&&!u.error&&this.createAssetPlayer(e,u,c)}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(p.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:Wu(e,s,t),duration:r,startOffset:n,timelineStart:i,uri:s};return this.createAssetPlayer(e,o,t)}createAssetPlayer(e,t,n){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 c=i.audioTracks[i.audioTrack],u=i.subtitleTracks[i.subtitleTrack];let f=0;if(this.primaryLive||e.appendInPlace){const ie=this.timelinePos-t.timelineStart;if(ie>1){const De=t.duration;De&&ie<De&&(f=ie)}}const h=t.identifier,v=y(y({},r),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:h,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:f,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:c||r.audioPreference,subtitlePreference:u||r.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(v.timelineOffset=t.timelineStart));const x=v.cmcd;x!=null&&x.sessionId&&x.contentId&&(v.cmcd=m({},x,{contentId:is(t.uri)})),this.getAssetPlayer(h)&&this.warn(`Duplicate date range identifier ${e} and asset ${h}`);const S=new Vu(this.HlsPlayerClass,v,e,t);this.playerQueue.push(S),e.assetList[n]=t;const B=ie=>{if(ie.live){const ct=new Error(`Interstitials MUST be VOD assets ${e}`),Oe={fatal:!0,type:ee.OTHER_ERROR,details:W.INTERSTITIAL_ASSET_ITEM_ERROR,error:ct};this.handleAssetItemError(Oe,e,this.schedule.findEventIndex(e.identifier),n,ct.message);return}const De=ie.edge-ie.fragmentStart,Be=t.duration;(Be===null||De>Be)&&(this.log(`Interstitial asset "${h}" duration change ${Be} > ${De}`),t.duration=De,this.updateSchedule())};S.on(p.LEVEL_UPDATED,(ie,{details:De})=>B(De)),S.on(p.LEVEL_PTS_UPDATED,(ie,{details:De})=>B(De));const P=(ie,De)=>{const Be=this.getAssetPlayer(h);if(Be&&De.tracks){Be.off(p.BUFFER_CODECS,P),Be.tracks=De.tracks;const ct=this.primaryMedia;this.bufferingAsset===Be.assetItem&&ct&&!Be.media&&this.bufferAssetPlayer(Be,ct)}};S.on(p.BUFFER_CODECS,P);const Q=()=>{var ie;const De=this.getAssetPlayer(h);if(this.log(`buffered to end of asset ${De}`),!De)return;const Be=this.schedule.findEventIndex(e.identifier),ct=(ie=this.schedule.items)==null?void 0:ie[Be];if(this.isInterstitial(ct)){const $e=e.findAssetIndex(t),Xe=ha(e,$e);if(!e.isAssetPastPlayoutLimit(Xe))this.bufferedToItem(ct,Xe);else{var Oe;const Ce=(Oe=this.schedule.items)==null?void 0:Oe[Be+1];Ce&&this.bufferedToItem(Ce)}}};S.on(p.BUFFERED_TO_END,Q);const ce=ie=>()=>{if(!this.getAssetPlayer(h))return;this.shouldPlay=!0;const Be=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,Be,ie)};return S.once(p.MEDIA_ENDED,ce(n)),S.once(p.PLAYOUT_LIMIT_REACHED,ce(1/0)),S.on(p.ERROR,(ie,De)=>{const Be=this.getAssetPlayer(h);if(De.details===W.BUFFER_STALLED_ERROR){if(Be!=null&&Be.media){const ct=Be.currentTime,Oe=Be.duration-ct;ct&&e.appendInPlace&&Oe/Be.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${h} ${e} at ${Be.media.currentTime}`),Q()):(this.warn(`Stalled at ${ct} of ${ct+Oe} in asset ${h} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError(De,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${De.error} ${e}`)}),S.on(p.DESTROYING,()=>{if(!this.getAssetPlayer(h))return;const De=new Error(`Asset player destroyed unexpectedly ${h}`),Be={fatal:!0,type:ee.OTHER_ERROR,details:W.INTERSTITIAL_ASSET_ITEM_ERROR,error:De};this.handleAssetItemError(Be,e,this.schedule.findEventIndex(e.identifier),n,De.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${Hr(t)}`),this.hls.trigger(p.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:S}),S}clearInterstitial(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)}),e.reset()}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const n=this.playerQueue[t];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(n!==-1){this.log(`clear asset player "${e}" toSegment: ${t&&br(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:c}=e,u=s.assetList.length,f=this.playingAsset;this.endedAsset=null,this.playingAsset=o,(!f||f.identifier!==c)&&(f&&(this.clearAssetPlayer(f.identifier,n[i]),delete f.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${u} ${Hr(o)}`),this.hls.trigger(p.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}=e,o=this.schedule.findEventIndex(r.identifier),c=(n=this.schedule.items)==null?void 0:n[o];if(!c)return;this.setBufferingItem(c),this.bufferingAsset=s;const u=this.getBufferingPlayer();if(u===e)return;const f=r.appendInPlace;if(f&&(u==null?void 0:u.interstitial.appendInPlace)===!1)return;const h=(u==null?void 0:u.tracks)||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(f&&s!==this.playingAsset){if(!e.tracks)return;if(h&&!re(h,e.tracks)){const v=new Error(`Asset ${Hr(s)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(h)}')`),x={fatal:!0,type:ee.OTHER_ERROR,details:W.INTERSTITIAL_ASSET_ITEM_ERROR,error:v},S=r.findAssetIndex(s);this.handleAssetItemError(x,r,o,S,v.message);return}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,n,i,r){if(e.details===W.BUFFER_STALLED_ERROR)return;const s=t.assetList[i];this.warn(`INTERSTITIAL_ASSET_ERROR ${s&&Hr(s)} ${e.error}`);const o=s==null?void 0:s.identifier,c=this.getAssetPlayerQueueIndex(o),u=this.playerQueue[c]||null,f=this.schedule.items,h=m({},e,{fatal:!1,errorAction:ni(!0),asset:s,assetListIndex:i,event:t,schedule:f,scheduleIndex:n,player:u});if(this.hls.trigger(p.INTERSTITIAL_ASSET_ERROR,h),!e.fatal)return;const v=this.playingAsset,x=new Error(r);if(s&&(this.clearAssetPlayer(o,null),s.error=x),!t.assetList.some(S=>!S.error))t.error=x;else{for(let S=i;S<t.assetList.length;S++)this.resetAssetPlayer(t.assetList[S].identifier);this.updateSchedule()}t.error?this.primaryFallback(t):v&&v.identifier===o&&this.advanceAfterAssetEnded(t,n,i)}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?br(n):"<none>"} error: ${e.error}`);let i=this.timelinePos;i===-1&&(i=this.hls.startPosition);const r=this.updateItem(n,i);this.itemsMatch(n,r)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));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,c=i.duration;let u=0;s.forEach((S,B)=>{const P=parseFloat(S.DURATION);this.createAsset(i,B,u,o+u,P,S.URI),u+=P}),i.duration=u,this.log(`Loaded asset-list with duration: ${u} (was: ${c}) ${i}`);const f=this.waitingItem,h=(f==null?void 0:f.event.identifier)===r;this.updateSchedule();const v=(n=this.bufferingItem)==null?void 0:n.event;if(h){var x;const S=this.schedule.findEventIndex(r),B=(x=this.schedule.items)==null?void 0:x[S];if(B){if(!this.playingItem&&this.timelinePos>B.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==S){i.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${i}`),this.primaryFallback(i);return}this.setBufferingItem(B)}this.setSchedulePosition(S)}else if((v==null?void 0:v.identifier)===r&&v.appendInPlace){const S=i.assetList[0],B=this.getAssetPlayer(S.identifier),P=this.primaryMedia;S&&B&&P&&this.bufferAssetPlayer(B,P)}}onError(e,t){switch(t.details){case W.ASSET_LIST_PARSING_ERROR:case W.ASSET_LIST_LOAD_ERROR:case W.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&this.primaryFallback(n);break}case W.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const bo=500;class Xu extends zn{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",Y.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(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=st.IDLE,this.setInterval(bo),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(this.fragContextChanged(n)||(he(n)&&(this.fragPrevious=n),this.state=st.IDLE),!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let s;const o=n.start;for(let u=0;u<r.length;u++)if(o>=r[u].start&&o<=r[u].end){s=r[u];break}const c=n.start+n.duration;s?s.end=c:(s={start:o,end:c},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,Y.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===Y.SUBTITLE&&(t.details===W.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==st.STOPPED&&(this.state=st.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&eo(this.levels,t)){this.levels=t.map(n=>new Sn(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new Sn(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Y.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!==st.STOPPED&&this.setInterval(bo)}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 c=r[o];if(o>=r.length||!c)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 u=0;if(s.live||(n=c.details)!=null&&n.live){if(s.deltaUpdateFailed)return;const h=this.mainDetails;if(!h){this.startFragRequested=!1;return}const v=h.fragments[0];if(!c.details)s.hasProgramDateTime&&h.hasProgramDateTime?(Fr(s,h),u=s.fragmentStart):v&&(u=v.start,Zr(s,u));else{var f;u=this.alignPlaylists(s,c.details,(f=this.levelLastLoaded)==null?void 0:f.details),u===0&&v&&(u=v.start,Zr(s,u))}h&&!this.startFragRequested&&this.setStartPosition(h,u)}c.details=s,this.levelLastLoaded=c,o===i&&(this.hls.trigger(p.SUBTITLE_TRACK_UPDATED,{details:s,id:o,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===st.IDLE&&(en(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.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&&Li(i.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer,Mi(i.method)).catch(o=>{throw r.trigger(p.ERROR,{type:ee.MEDIA_ERROR,details:W.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const c=performance.now();r.trigger(p.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:s,tdecrypt:c}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=st.IDLE})}}doTick(){if(!this.media){this.state=st.IDLE;return}if(this.state===st.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=$t.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:c}=s,u=n.details,f=this.hls.maxBufferLength+u.levelTargetDuration;if(c>f)return;const h=u.fragments,v=h.length,x=u.edge;let S=null;const B=this.fragPrevious;if(o<x){const ce=i.maxFragLookUpTolerance,ie=o>x-ce?0:ce;S=en(B,h,Math.max(h[0].start,o),ie),!S&&B&&B.start<h[0].start&&(S=h[0])}else S=h[v-1];if(S=this.filterReplacedPrimary(S,n.details),!S)return;const P=S.sn-u.startSN,Q=h[P-1];if(Q&&Q.cc===S.cc&&this.fragmentTracker.getState(Q)===xn.NOT_LOADED&&(S=Q),this.fragmentTracker.getState(S)===xn.NOT_LOADED){const ce=this.mapToInitFragWhenRequired(S);ce&&this.loadFragment(ce,n,o)}}}loadFragment(e,t,n){he(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Qu(this.tracksBuffered[this.currentTrackId]||[])}}class Qu{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 Ju={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(Ju[a]||a),rr=15,pr=100,qu={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ec={17:2,18:4,21:6,22:8,23:10,19:13,20:15},tc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},nc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},ic=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class rc{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;Z.log(`${this.time} [${e}] ${n}`)}}}const Tr=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class xo{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 sc{constructor(){this.uchar=" ",this.penState=new xo}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 ac{constructor(e){this.chars=[],this.pos=0,this.currPenState=new xo,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<pr;t++)this.chars.push(new sc);this.logger=e}equals(e){for(let t=0;t<pr;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<pr;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<pr;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>pr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=pr)}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>=pr){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<pr;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<pr;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=rr-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<rr;t++)this.rows.push(new ac(e));this.logger=e}reset(){for(let e=0;e<rr;e++)this.rows[e].clear();this.currRow=rr-1}equals(e){let t=!0;for(let n=0;n<rr;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<rr;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<rr;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 = "+Kt(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<rr;o++)this.rows[o].clear();const r=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const o=s.rows[r].cueStartTime,c=this.logger.time;if(o!==null&&c!==null&&o<c)for(let u=0;u<this.nrRollUpRows;u++)this.rows[t-this.nrRollUpRows+u+1].copy(s.rows[r+u])}}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 = "+Kt(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<rr;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 So{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[rr-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[rr-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: "+Kt(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 Ao{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=lc(),this.logger=void 0;const i=this.logger=new rc;this.channels=[null,new So(e,t,i),new So(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,()=>"["+Tr([t[n],t[n+1]])+"] -> ("+Tr([i,r])+")");const c=this.cmdHistory;if(i>=16&&i<=31){if(oc(i,r,c)){Cs(null,null,c),this.logger.log(3,()=>"Repeated command ("+Tr([i,r])+") is dropped");continue}Cs(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 Cs(null,null,c);if(!s&&(o=this.parseChars(i,r),o)){const f=this.currentChannel;f&&f>0?this.channels[f].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Tr([i,r])+" orig: "+Tr([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 ("+Tr([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]:tc[e]:n=s===1?ec[e]:nc[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 = "+Tr(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=ic[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()}Cs(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 Cs(a,e,t){t.a=a,t.b=e}function oc(a,e,t){return t.a===a&&t.b===e}function lc(){return{a:null,b:null}}var pa=function(){if(Yn!=null&&Yn.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,c){if(typeof c!="string"||!Array.isArray(o))return!1;const u=c.toLowerCase();return~o.indexOf(u)?u:!1}function n(o){return t(a,o)}function i(o){return t(e,o)}function r(o,...c){let u=1;for(;u<arguments.length;u++){const f=arguments[u];for(const h in f)o[h]=f[h]}return o}function s(o,c,u){const f=this,h={enumerable:!0};f.hasBeenReset=!1;let v="",x=!1,S=o,B=c,P=u,Q=null,ce="",ie=!0,De="auto",Be="start",ct=50,Oe="middle",$e=50,Xe="middle";Object.defineProperty(f,"id",r({},h,{get:function(){return v},set:function(Ce){v=""+Ce}})),Object.defineProperty(f,"pauseOnExit",r({},h,{get:function(){return x},set:function(Ce){x=!!Ce}})),Object.defineProperty(f,"startTime",r({},h,{get:function(){return S},set:function(Ce){if(typeof Ce!="number")throw new TypeError("Start time must be set to a number.");S=Ce,this.hasBeenReset=!0}})),Object.defineProperty(f,"endTime",r({},h,{get:function(){return B},set:function(Ce){if(typeof Ce!="number")throw new TypeError("End time must be set to a number.");B=Ce,this.hasBeenReset=!0}})),Object.defineProperty(f,"text",r({},h,{get:function(){return P},set:function(Ce){P=""+Ce,this.hasBeenReset=!0}})),Object.defineProperty(f,"region",r({},h,{get:function(){return Q},set:function(Ce){Q=Ce,this.hasBeenReset=!0}})),Object.defineProperty(f,"vertical",r({},h,{get:function(){return ce},set:function(Ce){const St=n(Ce);if(St===!1)throw new SyntaxError("An invalid or illegal string was specified.");ce=St,this.hasBeenReset=!0}})),Object.defineProperty(f,"snapToLines",r({},h,{get:function(){return ie},set:function(Ce){ie=!!Ce,this.hasBeenReset=!0}})),Object.defineProperty(f,"line",r({},h,{get:function(){return De},set:function(Ce){if(typeof Ce!="number"&&Ce!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");De=Ce,this.hasBeenReset=!0}})),Object.defineProperty(f,"lineAlign",r({},h,{get:function(){return Be},set:function(Ce){const St=i(Ce);if(!St)throw new SyntaxError("An invalid or illegal string was specified.");Be=St,this.hasBeenReset=!0}})),Object.defineProperty(f,"position",r({},h,{get:function(){return ct},set:function(Ce){if(Ce<0||Ce>100)throw new Error("Position must be between 0 and 100.");ct=Ce,this.hasBeenReset=!0}})),Object.defineProperty(f,"positionAlign",r({},h,{get:function(){return Oe},set:function(Ce){const St=i(Ce);if(!St)throw new SyntaxError("An invalid or illegal string was specified.");Oe=St,this.hasBeenReset=!0}})),Object.defineProperty(f,"size",r({},h,{get:function(){return $e},set:function(Ce){if(Ce<0||Ce>100)throw new Error("Size must be between 0 and 100.");$e=Ce,this.hasBeenReset=!0}})),Object.defineProperty(f,"align",r({},h,{get:function(){return Xe},set:function(Ce){const St=i(Ce);if(!St)throw new SyntaxError("An invalid or illegal string was specified.");Xe=St,this.hasBeenReset=!0}})),f.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class uc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function wo(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 cc{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 To(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],c=s[1];e(o,c)}}const ga=new pa(0,0,""),Is=ga.align==="middle"?"middle":"center";function fc(a,e,t){const n=a;function i(){const o=wo(a);if(o===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,c){const u=new cc;To(o,function(v,x){let S;switch(v){case"region":for(let B=t.length-1;B>=0;B--)if(t[B].id===x){u.set(v,t[B].region);break}break;case"vertical":u.alt(v,x,["rl","lr"]);break;case"line":S=x.split(","),u.integer(v,S[0]),u.percent(v,S[0])&&u.set("snapToLines",!1),u.alt(v,S[0],["auto"]),S.length===2&&u.alt("lineAlign",S[1],["start",Is,"end"]);break;case"position":S=x.split(","),u.percent(v,S[0]),S.length===2&&u.alt("positionAlign",S[1],["start",Is,"end","line-left","line-right","auto"]);break;case"size":u.percent(v,x);break;case"align":u.alt(v,x,["start",Is,"end","left","right"]);break}},/:/,/\s/),c.region=u.get("region",null),c.vertical=u.get("vertical","");let f=u.get("line","auto");f==="auto"&&ga.line===-1&&(f=-1),c.line=f,c.lineAlign=u.get("lineAlign","start"),c.snapToLines=u.get("snapToLines",!0),c.size=u.get("size",100),c.align=u.get("align",Is);let h=u.get("position","auto");h==="auto"&&ga.position===50&&(h=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=h}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 Do(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}class hc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new uc,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=Do(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){To(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 pa(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{fc(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},pc=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(!E(t)||!E(n)||!E(i)||!E(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*r,t};function _a(a,e,t){return is(a.toString())+is(e.toString())+is(t)}const gc=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 hc,c=Re(new Uint8Array(a)).trim().replace(dc,`
|
|
`).split(`
|
|
`),u=[],f=e?Nl(e.baseTime,e.timescale):0;let h="00:00.000",v=0,x=0,S,B=!0;o.oncue=function(P){const Q=t[n];let ce=t.ccOffset;const ie=(v-f)/9e4;if(Q!=null&&Q.new&&(x!==void 0?ce=t.ccOffset=Q.start:gc(t,n,ie)),ie){if(!e){S=new Error("Missing initPTS for VTT MPEGTS");return}ce=ie-t.presentationOffset}const De=P.endTime-P.startTime,Be=Yi((P.startTime+ce-x)*9e4,i*9e4)/9e4;P.startTime=Math.max(Be,0),P.endTime=Math.max(Be+De,0);const ct=P.text.trim();P.text=decodeURIComponent(encodeURIComponent(ct)),P.id||(P.id=_a(P.startTime,P.endTime,ct)),P.endTime>0&&u.push(P)},o.onparsingerror=function(P){S=P},o.onflush=function(){if(S){s(S);return}r(u)},c.forEach(P=>{if(B)if(ma(P,"X-TIMESTAMP-MAP=")){B=!1,P.slice(16).split(",").forEach(Q=>{ma(Q,"LOCAL:")?h=Q.slice(6):ma(Q,"MPEGTS:")&&(v=parseInt(Q.slice(7)))});try{x=pc(h)/1e3}catch(Q){S=Q}return}else P===""&&(B=!1);o.parse(P+`
|
|
`)}),o.flush()}const va="stpp.ttml.im1t",Ro=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Lo=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,_c={left:"start",center:"center",right:"end",start:"start",end:"end"};function Co(a,e,t,n){const i=q(new Uint8Array(a),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>Re(o)),s=Ml(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((h,v)=>(h[v]=i.getAttribute(`ttp:${v}`)||r[v],h),{}),o=i.getAttribute("xml:space")!=="preserve",c=Io(ya(i,"styling","style")),u=Io(ya(i,"layout","region")),f=ya(i,"body","[begin]");return[].map.call(f,h=>{const v=ko(h,o);if(!v||!h.hasAttribute("begin"))return null;const x=Ea(h.getAttribute("begin"),s),S=Ea(h.getAttribute("dur"),s);let B=Ea(h.getAttribute("end"),s);if(x===null)throw Po(h);if(B===null){if(S===null)throw Po(h);B=x+S}const P=new pa(x-e,B-e,v);P.id=_a(P.startTime,P.endTime,P.text);const Q=u[h.getAttribute("region")],ce=c[h.getAttribute("style")],ie=yc(Q,ce,c),{textAlign:De}=ie;if(De){const Be=_c[De];Be&&(P.lineAlign=Be),P.align=De}return m(P,ie),P}).filter(h=>h!==null)}function ya(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Io(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function ko(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?ko(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function yc(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,c)=>{const u=ba(e,n,c)||ba(a,n,c)||ba(i,n,c);return u&&(o[c]=u),o},{})}function ba(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function Po(a){return new Error(`Could not parse ttml timestamp ${a}`)}function Ea(a,e){if(!a)return null;let t=wo(a);return t===null&&(Ro.test(a)?t=bc(a,e):Lo.test(a)&&(t=Ec(a,e))),t}function bc(a,e){const t=Ro.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=Lo.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 ks{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 xc{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(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new ks(this,"textTrack1"),t=new ks(this,"textTrack2"),n=new ks(this,"textTrack3"),i=new ks(this,"textTrack4");this.cea608Parser1=new Ao(1,e,t),this.cea608Parser2=new Ao(3,n,i)}addCues(e,t,n,i,r){let s=!1;for(let o=r.length;o--;){const c=r[o],u=Sc(c[0],c[1],t,n);if(u>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],n),s=!0,u/(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(p.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){const{unparsedVttFrags:s}=this;n===Y.MAIN&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),s.length&&(this.unparsedVttFrags=[],s.forEach(o=>{this.initPTS[o.frag.cc]?this.onFragLoaded(p.FRAG_LOADED,o):this.hls.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const r=n.textTracks[i];if(Fo(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,zr(n[e]),go(n[e],i);else{const c=this.createTextTrack("captions",r,s);c&&(c[e]=!0,n[e]=c)}}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(p.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=>{zr(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++)zr(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(eo(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,o=s?Rs(s.textTracks):null;if(this.tracks.forEach((c,u)=>{let f;if(o){let h=null;for(let v=0;v<o.length;v++)if(o[v]&&Fo(o[v],c)){h=o[v],o[v]=null;break}h&&(f=h)}if(f)zr(f);else{const h=Oo(c);f=this.createTextTrack(h,c.name,c.lang),f&&(f.mode="disabled")}f&&this.textTracks.push(f)}),o!=null&&o.length){const c=o.filter(u=>u!==null).map(u=>u.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.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(p.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===Y.MAIN){var n,i;const{cea608Parser1:r,cea608Parser2:s,lastSn:o}=this,{cc:c,sn:u}=t.frag,f=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;r&&s&&(u!==o+1||u===o&&f!==this.lastPartIndex+1||c!==this.lastCc)&&(r.reset(),s.reset()),this.lastCc=c,this.lastSn=u,this.lastPartIndex=f}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===Y.SUBTITLE)if(i.byteLength){const r=n.decryptdata,s="stats"in t;if(r==null||!r.encrypted||s){const o=this.tracks[n.level],c=this.vttCCs;c[n.cc]||(c[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(p.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(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{n.logger.log(`Failed to parse IMSC1: ${i}`),n.trigger(p.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 c=this.hls,u=(t=n.initSegment)!=null&&t.data?Ve(n.initSegment.data,new Uint8Array(i)).buffer:i;mc(u,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,f=>{this._appendCues(f,n.level),c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},f=>{const h=f.message==="Missing initPTS for VTT MPEGTS";h?s.push(e):this._fallbackToIMSC1(n,i),c.logger.log(`Failed to parse VTT cue: ${f}`),!(h&&o>n.cc)&&c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:f})})}_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(p.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===Y.SUBTITLE&&this.onFragLoaded(p.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===Y.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(c=>ca(o[c],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(c=>ca(o[c],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++],c=127&e[i++];if(o===0&&c===0)continue;if((4&s)!==0){const f=3&s;(f===0||f===1)&&(t[f].push(o),t[f].push(c))}}return t}}function Oo(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Fo(a,e){return!!a&&a.kind===Oo(e)&&ra(e,a)}function Sc(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 Ac=/\s/,wc={newCue(a,e,t,n){const i=[];let r,s,o,c,u;const f=self.VTTCue||self.TextTrackCue;for(let v=0;v<n.rows.length;v++)if(r=n.rows[v],o=!0,c=0,u="",!r.isEmpty()){var h;for(let B=0;B<r.chars.length;B++)Ac.test(r.chars[B].uchar)&&o?c++:(u+=r.chars[B].uchar,o=!1);r.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const x=Do(u.trim()),S=_a(e,t,x);a!=null&&(h=a.cues)!=null&&h.getCueById(S)||(s=new f(e,t,x),s.id=S,s.line=v+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),i.push(s))}return a&&i.length&&(i.sort((v,x)=>v.line==="auto"||x.line==="auto"?0:v.line>8&&x.line>8?x.line-v.line:v.line-x.line),i.forEach(v=>mo(a,v))),i}};function Tc(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const Dc=/(\d+)-(\d+)\/(\d+)/;class No{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||Ic,this.controller=new self.AbortController,this.stats=new d}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=Rc(e,this.controller.signal),s=e.responseType==="arraybuffer",o=s?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&E(c)?c:u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},t.timeout),(es(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(h=>{var v;this.response=this.loader=h;const x=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},u-(x-i.loading.start)),!h.ok){const{status:B,statusText:P}=h;throw new kc(P||"fetch, bad network response",B,h)}i.loading.first=x,i.total=Cc(h.headers)||i.total;const S=(v=this.callbacks)==null?void 0:v.onProgress;return S&&E(t.highWaterMark)?this.loadProgressively(h,i,e,t.highWaterMark,S):s?h.arrayBuffer():e.responseType==="json"?h.json():h.text()}).then(h=>{var v,x;const S=this.response;if(!S)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const B=h[o];B&&(i.loaded=i.total=B);const P={url:S.url,data:h,code:S.status},Q=(v=this.callbacks)==null?void 0:v.onProgress;Q&&!E(t.highWaterMark)&&Q(i,e,h,S),(x=this.callbacks)==null||x.onSuccess(P,i,e,S)}).catch(h=>{var v;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const x=h&&h.code||0,S=h?h.message:null;(v=this.callbacks)==null||v.onError({code:x,text:S},e,h?h.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 ki,o=e.body.getReader(),c=()=>o.read().then(u=>{if(u.done)return s.dataLength&&r(t,n,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const f=u.value,h=f.length;return t.loaded+=h,h<i||s.dataLength?(s.push(f),s.dataLength>=i&&r(t,n,s.flush().buffer,e)):r(t,n,f.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function Rc(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 Lc(a){const e=Dc.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=Lc(e);if(E(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function Ic(a,e){return new self.Request(a.url,e)}class kc extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const Pc=/^age:\s*[\d.]+\s*$/im;class Bo{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 d,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&&E(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 u=t.status,f=t.responseType==="text"?t.responseText:null;if(u>=200&&u<300){const S=f!=null?f:t.response;if(S!=null){var s,o;n.loading.end=Math.max(self.performance.now(),n.loading.first);const B=t.responseType==="arraybuffer"?S.byteLength:S.length;n.loaded=n.total=B,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const P=(s=this.callbacks)==null?void 0:s.onProgress;P&&P(n,e,S,t);const Q={url:t.responseURL,data:S,code:u};(o=this.callbacks)==null||o.onSuccess(Q,n,e,t);return}}const h=r.loadPolicy.errorRetry,v=n.retry,x={url:e.url,data:void 0,code:u};if(Ln(h,v,!1,x))this.retry(h);else{var c;Z.error(`${u} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:u,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Ln(e,t,!0))this.retry(e);else{var n;Z.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=gn(e,n.retry),n.retry++,Z.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&&Pc.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 Oc={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Fc=y(y({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,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",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:Bo,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:nn,bufferController:Jl,capLevelController:aa,errorController:Hn,fpsController:Bu,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:gr,requireKeySystemAccessOnStart:!1,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,preserveManualLevelOnError:!1,certLoadPolicy:{default:Oc},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:Xu,subtitleTrackController:Gu,timelineController:xc,audioStreamController:Zl,audioTrackController:Yl,emeController:Gr,cmcdController:Fu,contentSteeringController:Nu,interstitialsController:Yu});function Mc(){return{cueHandler:wc,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 Nc(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=xa(a),i=["manifest","level","frag"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,c=e[o]===void 0,u=[];r.forEach(f=>{const h=`${s}Loading${f}`,v=e[h];if(v!==void 0&&c){u.push(h);const x=n[o].default;switch(e[o]={default:x},f){case"TimeOut":x.maxLoadTimeMs=v,x.maxTimeToFirstByteMs=v;break;case"MaxRetry":x.errorRetry.maxNumRetry=v,x.timeoutRetry.maxNumRetry=v;break;case"RetryDelay":x.errorRetry.retryDelayMs=v,x.timeoutRetry.retryDelayMs=v;break;case"MaxRetryTimeout":x.errorRetry.maxRetryDelayMs=v,x.timeoutRetry.maxRetryDelayMs=v;break}}}),u.length&&t.warn(`hls.js config: "${u.join('", "')}" setting(s) are deprecated, use "${o}": ${Kt(e[o])}`)}),y(y({},n),e)}function xa(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(xa):Object.keys(a).reduce((e,t)=>(e[t]=xa(a[t]),e),{}):a}function Bc(a,e){const t=a.loader;t!==No&&t!==Bo?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):Tc()&&(a.loader=No,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Ps=2,Uc=.1,Kc=.05,Gc=100;class zc extends Jn{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(p.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.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(Gc),this.mediaSource=t.mediaSource;const n=this.media=t.media;Xi(n,"playing",this.onMediaPlaying),Xi(n,"waiting",this.onMediaWaiting),Xi(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(ir(n,"playing",this.onMediaPlaying),ir(n,"waiting",this.onMediaWaiting),ir(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 s=this.media;if(!s)return;const{seeking:o}=s,c=this.seeking&&!o,u=!this.seeking&&o,f=s.paused&&!o||s.ended||s.playbackRate===0;if(this.seeking=o,e!==t){t&&(this.ended=0),this.moved=!0,o||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!f&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(u||c){c&&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(p.MEDIA_ENDED,{stalled:!1}));return}if(!$t.getBuffered(s).length){this.nudgeRetry=0;return}const h=$t.bufferInfo(s,e,0),v=h.nextStart||0,x=this.fragmentTracker;if(o&&x&&this.hls){const ct=Uo(this.hls.inFlightFragments,e),Oe=h.len>Ps,$e=!v||ct||v-e>Ps&&!x.getPartialFragment(e);if(Oe||$e)return;this.moved=!1}const S=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&x){if(!(h.len>0)&&!v)return;const Oe=Math.max(v,h.start||0)-e,Xe=!!(S!=null&&S.live)?S.targetduration*2:Ps,Ce=x.getPartialFragment(e);if(Oe>0&&(Oe<=Xe||Ce)){s.paused||this._trySkipBufferHole(Ce);return}}const B=r.detectStallWithCurrentTimeMs,P=self.performance.now(),Q=this.waiting;let ce=this.stalled;if(ce===null)if(Q>0&&P-Q<B)ce=this.stalled=Q;else{this.stalled=P;return}const ie=P-ce;if(!o&&(ie>=B||Q)&&this.hls){var De;if(((De=this.mediaSource)==null?void 0:De.readyState)==="ended"&&!(S!=null&&S.live)&&Math.abs(e-((S==null?void 0:S.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(h),!this.media||!this.hls)return}const Be=$t.bufferInfo(s,e,r.maxBufferHole);this._tryFixBufferStall(Be,ie,e)}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(p.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=$t.bufferedInfo($t.timeRangesToArray(this.buffered.audio),e,0);if(r.len>1&&t>=r.start){const s=$t.timeRangesToArray(i),o=$t.bufferedInfo(s,t,0).bufferedIndex;if(o>-1&&o<s.length-1){const c=$t.bufferedInfo(s,e,0).bufferedIndex,u=s[o].end,f=s[o+1].start;if((c===-1||c>o)&&f-u<1&&e-u<2){const h=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${u} -> ${f} buffered index: ${c}`);this.warn(h.message),this.media.currentTime+=1e-6;const v=this.fragmentTracker.getPartialFragment(e)||void 0,x=$t.bufferInfo(this.media,e,0);this.hls.trigger(p.ERROR,{type:ee.MEDIA_ERROR,details:W.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:h,reason:h.message,frag:v,buffer:x.len,bufferInfo:x})}}}}}_tryFixBufferStall(e,t,n){var i,r;const{fragmentTracker:s,media:o}=this,c=(i=this.hls)==null?void 0:i.config;if(!o||!s||!c)return;const u=(r=this.hls)==null?void 0:r.latestLevelDetails,f=s.getPartialFragment(n);if((f||u!=null&&u.live&&n<u.fragmentStart)&&(this._trySkipBufferHole(f)||!this.media))return;const h=e.buffered,v=this.adjacentTraversal(e,n);(h&&h.length>1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-n<c.maxBufferHole||v))&&(t>c.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const n=this.fragmentTracker,i=e.nextStart;if(n&&i){const r=n.getFragAtPos(t,Y.MAIN),s=n.getFragAtPos(i,Y.MAIN);if(r&&s)return s.sn-r.sn<2}return!1}_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 (${Kt(e)})`);this.warn(s.message),t.trigger(p.ERROR,{type:ee.MEDIA_ERROR,details:W.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=$t.bufferInfo(i,s,0),c=s<o.start?o.start:o.nextStart;if(c&&this.hls){const f=o.len<=r.maxBufferHole,h=o.len>0&&o.len<1&&i.readyState<3,v=c-s;if(v>0&&(f||h)){if(v>r.maxBufferHole){let S=!1;if(s===0){const B=n.getAppendedFrag(0,Y.MAIN);B&&c<B.end&&(S=!0)}if(!S){const B=e||n.getAppendedFrag(s,Y.MAIN);if(B){var u;if(!((u=this.hls.loadLevelObj)!=null&&u.details)||Uo(this.hls.inFlightFragments,c))return 0;let Q=!1,ce=B.end;for(;ce<c;){const ie=n.getAppendedFrag(ce,Y.MAIN)||n.getPartialFragment(ce);if(ie)ce+=ie.duration;else{Q=!0;break}}if(Q)return 0}}}const x=Math.max(c+Kc,s+Uc);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${x}`),this.moved=!0,i.currentTime=x,!(e!=null&&e.gap)){const S=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${x}`);this.hls.trigger(p.ERROR,{type:ee.MEDIA_ERROR,details:W.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:S,reason:S.message,frag:e||void 0,buffer:o.len,bufferInfo:o})}return x}}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,c=new Error(`Nudging 'currentTime' from ${s} to ${o}`);this.warn(c.message),n.currentTime=o,t.trigger(p.ERROR,{type:ee.MEDIA_ERROR,details:W.BUFFER_NUDGE_ON_STALL,error:c,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(p.ERROR,{type:ee.MEDIA_ERROR,details:W.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function Uo(a,e){const t=Ko(a.main);if(t&&t.start<=e)return t;const n=Ko(a.audio);return n&&n.start<=e?n:null}function Ko(a){if(!a)return null;switch(a.state){case st.IDLE:case st.STOPPED:case st.ENDED:case st.ERROR:return null}return a.frag}const Wc=.25;function Sa(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Go(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,Kt(i?y({type:i},n):n))}return r}const Os=(()=>{const a=Sa();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class Hc{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(p.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(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.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&&zr(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 go(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=Sa();if(s)for(let o=0;o<r.length;o++){const c=r[o].type;if(c===Hi.emsg&&!n||!i)continue;const u=Pa(r[o].data);if(u){const f=r[o].pts;let h=f+r[o].duration;h>Os&&(h=Os),h-f<=0&&(h=f+Wc);for(let x=0;x<u.length;x++){const S=u[x];if(!Oa(S)){this.updateId3CueEnds(f,c);const B=Go(s,f,h,S,c);B&&this.id3Track.addCue(B)}}}}}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===Os&&(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:c}}=s;if(r&&(o||c)){let u;i==="audio"?u=f=>f.type===Hi.audioId3&&c:i==="video"?u=f=>f.type===Hi.emsg&&o:u=f=>f.type===Hi.audioId3&&c||f.type===Hi.emsg&&o,ca(r,t,n,u)}}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 f=Object.keys(s).filter(h=>!r.includes(h));for(let h=f.length;h--;){const v=f[h],x=s[v].cues;delete s[v],Object.keys(x).forEach(S=>{try{const B=x[S];B.removeEventListener("enter",this.onEventCueEnter),n.removeCue(B)}catch(B){}})}}else s=this.dateRangeCuesAppended={}}const c=e.fragments[e.fragments.length-1];if(r.length===0||!E(c==null?void 0:c.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const u=Sa();for(let f=0;f<r.length;f++){const h=r[f],v=i[h],x=v.startTime,S=s[h],B=(S==null?void 0:S.cues)||{};let P=(S==null?void 0:S.durationKnown)||!1,Q=Os;const{duration:ce,endDate:ie}=v;if(ie&&ce!==null)Q=x+ce,P=!0;else if(v.endOnNext&&!P){const Be=r.reduce((ct,Oe)=>{if(Oe!==v.id){const $e=i[Oe];if($e.class===v.class&&$e.startDate>v.startDate&&(!ct||v.startDate<ct.startDate))return $e}return ct},null);Be&&(Q=Be.startTime,P=!0)}const De=Object.keys(v.attr);for(let Be=0;Be<De.length;Be++){const ct=De[Be];if(!fi(ct))continue;const Oe=B[ct];if(Oe)P&&!S.durationKnown?Oe.endTime=Q:Math.abs(Oe.startTime-x)>.01&&(Oe.startTime=x,Oe.endTime=Q);else if(u){let $e=v.attr[ct];pi(ct)&&($e=w($e));const Ce=Go(u,x,Q,{key:ct,data:$e},Hi.dateRange);Ce&&(Ce.id=h,this.id3Track.addCue(Ce),B[ct]=Ce,this.hls.config.interstitialsController&&(ct==="X-ASSET-LIST"||ct==="X-ASSET-URL")&&Ce.addEventListener("enter",this.onEventCueEnter))}}s[h]={cues:B,dateRange:v,durationKnown:P}}}}class jc{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 c=i-o,u=Math.min(this.maxLatency,o+n.targetduration);if(c<u&&c>.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,s)),v=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,x=Math.min(h,Math.max(1,v));this.changeMediaPlaybackRate(t,x)}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,c=this.hls.userConfig;let u=o&&n||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||u===0)&&(u=r!==void 0?r:s*i);const f=i;return u+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,f)}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(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.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===W.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 Vc extends ia{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(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.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,c=!1,u=!1;t.levels.forEach(f=>{const h=f.attrs;let{audioCodec:v,videoCodec:x}=f;v&&(f.audioCodec=v=X(v,n)||void 0),x&&(x=f.videoCodec=Te(x));const{width:S,height:B,unknownCodecs:P}=f;let Q=P?P.length:0;if(P)for(let Ce=Q;Ce--;){const St=P[Ce];this.isAudioSupported(St)?(f.audioCodec=v=v?`${v},${St}`:St,Q--,He.audio[v.substring(0,4)]=2):this.isVideoSupported(St)&&(f.videoCodec=x=x?`${x},${St}`:St,Q--,He.video[x.substring(0,4)]=2)}if(o||(o=!!(S&&B)),c||(c=!!x),u||(u=!!v),Q||v&&!this.isAudioSupported(v)||x&&!this.isVideoSupported(x)){this.log(`Some or all CODECS not supported "${h.CODECS}"`);return}const{CODECS:ce,"FRAME-RATE":ie,"HDCP-LEVEL":De,"PATHWAY-ID":Be,RESOLUTION:ct,"VIDEO-RANGE":Oe}=h,Xe=`${`${Be||"."}-`}${f.bitrate}-${ct}-${ie}-${ce}-${Oe}-${De}`;if(r[Xe])if(r[Xe].uri!==f.url&&!f.attrs["PATHWAY-ID"]){const Ce=s[Xe]+=1;f.attrs["PATHWAY-ID"]=new Array(Ce+1).join(".");const St=this.createLevel(f);r[Xe]=St,i.push(St)}else r[Xe].addGroupId("audio",h.AUDIO),r[Xe].addGroupId("text",h.SUBTITLES);else{const Ce=this.createLevel(f);r[Xe]=Ce,s[Xe]=1,i.push(Ce)}}),this.filterAndSortMediaOptions(i,t,o,c,u)}createLevel(e){const t=new Sn(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=dt(i,[])}return t}isAudioSupported(e){return Ct(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Ct(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,i,r){let s=[],o=[],c=e;if((n||i)&&r&&(c=c.filter(({videoCodec:P,videoRange:Q,width:ce,height:ie})=>(!!P||!!(ce&&ie))&&un(Q))),c.length===0){Promise.resolve().then(()=>{if(this.hls){let P="no level with compatible codecs found in manifest",Q=P;t.levels.length&&(Q=`one or more CODECS in variant not supported: ${Kt(t.levels.map(ie=>ie.attrs.CODECS).filter((ie,De,Be)=>Be.indexOf(ie)===De))}`,this.warn(Q),P+=` (${Q})`);const ce=new Error(P);this.hls.trigger(p.ERROR,{type:ee.MEDIA_ERROR,details:W.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:ce,reason:Q})}});return}t.audioTracks&&(s=t.audioTracks.filter(P=>!P.audioCodec||this.isAudioSupported(P.audioCodec)),zo(s)),t.subtitles&&(o=t.subtitles,zo(o));const u=c.slice(0);c.sort((P,Q)=>{if(P.attrs["HDCP-LEVEL"]!==Q.attrs["HDCP-LEVEL"])return(P.attrs["HDCP-LEVEL"]||"")>(Q.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&P.height!==Q.height)return P.height-Q.height;if(P.frameRate!==Q.frameRate)return P.frameRate-Q.frameRate;if(P.videoRange!==Q.videoRange)return Ht.indexOf(P.videoRange)-Ht.indexOf(Q.videoRange);if(P.videoCodec!==Q.videoCodec){const ce=_e(P.videoCodec),ie=_e(Q.videoCodec);if(ce!==ie)return ie-ce}if(P.uri===Q.uri&&P.codecSet!==Q.codecSet){const ce=me(P.codecSet),ie=me(Q.codecSet);if(ce!==ie)return ie-ce}return P.averageBitrate!==Q.averageBitrate?P.averageBitrate-Q.averageBitrate:0});let f=u[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==u.length)){for(let P=0;P<u.length;P++)if(u[P].pathwayId===c[0].pathwayId){f=u[P];break}}this._levels=c;for(let P=0;P<c.length;P++)if(c[P]===f){var h;this._firstLevel=P;const Q=f.bitrate,ce=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${Q}`),((h=this.hls.userConfig)==null?void 0:h.abrEwmaDefaultEstimate)===void 0){const ie=Math.min(Q,this.hls.config.abrEwmaDefaultEstimateMax);ie>ce&&ce===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=ie)}break}const v=r&&!i,x=this.hls.config,S=!!(x.audioStreamController&&x.audioTrackController),B={levels:c,audioTracks:s,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:S&&!v&&s.some(P=>!!P.url)};this.hls.trigger(p.MANIFEST_PARSED,B)}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 f=new Error("invalid level idx"),h=e<0;if(this.hls.trigger(p.ERROR,{type:ee.OTHER_ERROR,details:W.LEVEL_SWITCH_ERROR,level:e,fatal:h,error:f,reason:f.message}),h)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 c={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(p.LEVEL_SWITCHING,c);const u=s.details;if(!u||u.live){const f=this.switchParams(s.uri,i==null?void 0:i.details,u);this.loadPlaylist(f)}}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===ue.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===Y.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 c=s.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(i,t,c)}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(p.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));gs(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(p.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(p.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function zo(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function Wo(){return self.SourceBuffer||self.WebKitSourceBuffer}function Ho(){if(!ae())return!1;const e=Wo();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function $c(){if(!Ho())return!1;const a=ae();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(wt(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(wt(e,"audio"))))}function Zc(){var a;const e=Wo();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Yc=100;class Xc extends zn{constructor(e,t,n){super(e,t,n,"stream-controller",Y.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||!E(r)||(this.log(`Media seeked to ${r.toFixed(3)}`),!this.getBufferedFrag(r)))return;const s=this.getFwdBufferInfoAtPos(i,r,Y.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(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.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=st.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=st.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case st.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=st.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=st.IDLE;break}break}case st.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=st.IDLE}}break}this.state===st.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 c=this.getLevelDetails();if(c&&this._streamEnded(o,c)){const B={};this.altAudio===2&&(B.type="video"),this.hls.trigger(p.BUFFER_EOS,B),this.state=st.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 u=s.details;if(!u||this.state===st.WAITING_LEVEL||this.waitForLive(s)){this.level=r,this.state=st.WAITING_LEVEL,this.startFragRequested=!1;return}const f=o.len,h=this.getMaxBufferLength(s.maxBitrate);if(f>=h)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const v=this.backtrackFragment?this.backtrackFragment.start:o.end;let x=this.getNextFragment(v,u);if(this.couldBacktrack&&!this.fragPrevious&&x&&he(x)&&this.fragmentTracker.getState(x)!==xn.OK){var S;const P=((S=this.backtrackFragment)!=null?S:x).sn-u.startSN,Q=u.fragments[P-1];Q&&x.cc===Q.cc&&(x=Q,this.fragmentTracker.removeFragment(Q))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(x&&this.isLoopLoading(x,v)){if(!x.gap){const P=this.audioOnly&&!this.altAudio?D.AUDIO:D.VIDEO,Q=(P===D.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;Q&&this.afterBufferFlushed(Q,P,Y.MAIN)}x=this.getNextFragmentLoopLoading(x,u,o,Y.MAIN,h)}x&&(x.initSegment&&!x.initSegment.data&&!this.bitrateTest&&(x=x.initSegment),this.loadFragment(x,s,v))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);i===xn.NOT_LOADED||i===xn.PARTIAL?he(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,Y.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,c=e[o],u=this.fragLastKbps;u&&this.fragCurrent?n=this.fragCurrent.duration*c.maxBitrate/(1e3*u)+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 c=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,f=Math.max(s.end,c+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,u*(this.couldBacktrack?.5:.125)),u*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(f,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 st.KEY_LOADING:case st.FRAG_LOADING:case st.FRAG_LOADING_WAITING_RETRY:case st.PARSING:case st.PARSED:this.state=st.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;Xi(n,"playing",this.onMediaPlaying),Xi(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(ir(n,"playing",this.onMediaPlaying),ir(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(p.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&&!Zc(),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!==st.IDLE)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=st.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i,startFragRequested:r}=this,s=t.level,o=t.details,c=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:${c}`);const u=t.levelInfo,f=this.fragCurrent;f&&(this.state===st.FRAG_LOADING||this.state===st.FRAG_LOADING_WAITING_RETRY)&&f.level!==t.level&&f.loader&&this.abortCurrentFrag();let h=0;if(o.live||(n=u.details)!=null&&n.live){var v;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;h=this.alignPlaylists(o,u.details,(v=this.levelLastLoaded)==null?void 0:v.details)}if(u.details=o,this.levelLastLoaded=u,r||this.setStartPosition(o,h),this.hls.trigger(p.LEVEL_UPDATED,{details:o,level:s}),this.state===st.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=st.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,c=r>=s-t.maxFragLookUpTolerance&&r<=o;if(i!==null&&n.duration>i&&(r<i||!c)){const f=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&n.readyState<4||r<o-f)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),n.readyState))if(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${i.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var u;const h=$t.bufferInfo(n,i,0);if(!(h!=null&&(u=h.buffered)!=null&&u.length)){n.currentTime=i;return}if(h.start<=r){n.currentTime=i;return}const{nextStart:x}=$t.bufferedInfo(h.buffered,r,0);x&&(n.currentTime=x)}else 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 c=o.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const u=o.videoCodec,f=c.PTSKnown||!c.live,h=(t=n.initSegment)==null?void 0:t.data,v=this._getAudioCodec(o),x=this.transmuxer=this.transmuxer||new Ja(this.hls,Y.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),S=i?i.index:-1,B=S!==-1,P=new ci(n.level,n.sn,n.stats.chunkCount,r.byteLength,S,B),Q=this.initPTS[n.cc];x.push(r,h,v,u,n,i,c.totalduration,f,P,Q)}onAudioTrackSwitching(e,t){const n=this.hls,i=this.altAudio===2;if(yn(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(p.BUFFER_FLUSHED,()=>{var s;(s=this.hls)==null||s.trigger(p.AUDIO_TRACK_SWITCHED,t)}),n.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(p.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=yn(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 c=n[o];if(c.id==="main"){if(r=o,i=c,o==="video"){const u=n[o];u&&(this.videoBuffer=u.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===Y.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===st.PARSED&&(this.state=st.IDLE);return}const o=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),he(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}const s=this.media;s&&(!this._hasEnoughToStart&&$t.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=st.ERROR;return}switch(t.details){case W.FRAG_GAP:case W.FRAG_PARSING_ERROR:case W.FRAG_DECRYPT_ERROR:case W.FRAG_LOAD_ERROR:case W.FRAG_LOAD_TIMEOUT:case W.KEY_LOAD_ERROR:case W.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Y.MAIN,t);break;case W.LEVEL_LOAD_ERROR:case W.LEVEL_LOAD_TIMEOUT:case W.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===st.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===ue.LEVEL&&(this.state=st.IDLE);break;case W.BUFFER_ADD_CODEC_ERROR:case W.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case W.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case W.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=st.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==D.AUDIO||!this.altAudio){const n=(t===D.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,Y.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=$t.getBuffered(e),o=s.length?s.start(0):0,c=o-n,u=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<u||this.loadingParts&&c<2*((r==null?void 0:r.partTarget)||0)))&&(this.log(`adjusting start position by ${c} to match buffer start`),n+=c,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=st.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(p.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:c,part:u,level:f}=o,{video:h,text:v,id3:x,initSegment:S}=r,{details:B}=f,P=this.altAudio?void 0:r.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=st.PARSING,S){if(S!=null&&S.tracks){const De=c.initSegment||c;this._bufferInitSegment(f,S.tracks,De,s),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:De,id:n,tracks:S.tracks})}const Q=S.initPTS,ce=S.timescale,ie=this.initPTS[c.cc];E(Q)&&(!ie||ie.baseTime!==Q||ie.timescale!==ce)&&(this.initPTS[c.cc]={baseTime:Q,timescale:ce},i.trigger(p.INIT_PTS_FOUND,{frag:c,id:n,initPTS:Q,timescale:ce}))}if(h&&B){P&&h.type==="audiovideo"&&this.logMuxedErr(c);const Q=B.fragments[c.sn-1-B.startSN],ce=c.sn===B.startSN,ie=!Q||c.cc>Q.cc;if(r.independent!==!1){const{startPTS:De,endPTS:Be,startDTS:ct,endDTS:Oe}=h;if(u)u.elementaryStreams[h.type]={startPTS:De,endPTS:Be,startDTS:ct,endDTS:Oe};else if(h.firstKeyFrame&&h.independent&&s.id===1&&!ie&&(this.couldBacktrack=!0),h.dropped&&h.independent){const $e=this.getMainFwdBufferInfo(),Xe=($e?$e.end:this.getLoadPosition())+this.config.maxBufferHole,Ce=h.firstKeyFramePTS?h.firstKeyFramePTS:De;if(!ce&&Xe<Ce-this.config.maxBufferHole&&!ie){this.backtrack(c);return}else ie&&(c.gap=!0);c.setElementaryStreamInfo(h.type,c.start,Be,c.start,Oe,!0)}else ce&&De-(B.appliedTimelineOffset||0)>Ps&&(c.gap=!0);c.setElementaryStreamInfo(h.type,De,Be,ct,Oe),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(h,c,u,s,ce||ie)}else if(ce||ie)c.gap=!0;else{this.backtrack(c);return}}if(P){const{startPTS:Q,endPTS:ce,startDTS:ie,endDTS:De}=P;u&&(u.elementaryStreams[D.AUDIO]={startPTS:Q,endPTS:ce,startDTS:ie,endDTS:De}),c.setElementaryStreamInfo(D.AUDIO,Q,ce,ie,De),this.bufferFragmentData(P,c,u,s)}if(B&&x!=null&&(t=x.samples)!=null&&t.length){const Q={id:n,frag:c,details:B,samples:x.samples};i.trigger(p.FRAG_PARSING_METADATA,Q)}if(B&&v){const Q={id:n,frag:c,details:B,samples:v.samples};i.trigger(p.FRAG_PARSING_USERDATA,Q)}}logMuxedErr(e){this.warn(`${he(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,i){if(this.state!==st.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){const u=e.audioCodec;let f=fe(r.codec,u);f==="mp4a"&&(f="mp4a.40.5");const h=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){f&&(f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5");const v=r.metadata;v&&"channelCount"in v&&(v.channelCount||1)!==1&&h.indexOf("firefox")===-1&&(f="mp4a.40.5")}f&&f.indexOf("mp4a.40.5")!==-1&&h.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(f="mp4a.40.2",this.log(`Android: force audio codec to ${f}`)),u&&u!==f&&this.log(`Swapping manifest audio codec "${u}" for "${f}"`),r.levelCodec=f,r.id=Y.MAIN,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${f||""}/${u||""}/${r.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=Y.MAIN;const u=s.codec;if((u==null?void 0:u.length)===4)switch(u){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||""}/${u}]${s.codec!==u?" 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 c=Object.keys(t);if(c.length){if(this.hls.trigger(p.BUFFER_CODECS,t),!this.hls)return;c.forEach(u=>{const h=t[u].initSegment;h!=null&&h.byteLength&&this.hls.trigger(p.BUFFER_APPENDING,{type:u,data:h,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,Y.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=st.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if($t.isBuffered(e,n)?t=this.getAppendedFrag(n):$t.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(p.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(p.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 E(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(E(t)){const n=this.getLevelDetails(),i=this.currentFrag||(n?en(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=W.KEY_LOAD_ERROR,n,i,r){return new Qn({type:ee.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let i=0,r=t.length;i<r;i++){const s=t[i];if(e.cc<=s.cc&&(!he(e)||!he(s)||e.sn<s.sn)||!n&&i==r-1)return this.emeController.selectKeySystemFormat(s).then(o=>{if(!this.emeController)return;s.setKeyFormat(o);const c=Gi(o);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const i=tr(this.config);if(i.length)return this.emeController.getKeySystemAccess(i)}}return null}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 u=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,W.KEY_LOAD_ERROR,u))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,W.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 c;switch((c=o.mediaKeySessionContext)==null?void 0:c.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(u=>(r.key=u.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,W.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 c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=n.keyLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},h={onSuccess:(v,x,S,B)=>{const{frag:P,keyInfo:Q,url:ce}=S;if(!P.decryptdata||Q!==this.keyUriToKeyInfo[ce])return o(this.createKeyLoadError(P,W.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),B));Q.decryptdata.key=P.decryptdata.key=new Uint8Array(v.data),P.keyLoader=null,Q.loader=null,s({frag:P,keyInfo:Q})},onError:(v,x,S,B)=>{this.resetLoader(x),o(this.createKeyLoadError(t,W.KEY_LOAD_ERROR,new Error(`HTTP Error ${v.code} loading key ${v.text}`),S,y({url:c.url,data:void 0},v)))},onTimeout:(v,x,S)=>{this.resetLoader(x),o(this.createKeyLoadError(t,W.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),S))},onAbort:(v,x,S)=>{this.resetLoader(x),o(this.createKeyLoadError(t,W.INTERNAL_ABORTED,new Error("key loading aborted"),S))}};r.load(c,f,h)})}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 jo(a){const{type:e}=a;switch(e){case ue.AUDIO_TRACK:return Y.AUDIO;case ue.SUBTITLE_TRACK:return Y.SUBTITLE;default:return Y.MAIN}}function Aa(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Jc{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(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(p.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:ue.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:s,deliveryDirectives:o,levelInfo:c}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:ue.LEVEL,url:s,deliveryDirectives:o,levelOrTrack:c})}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:ue.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:ue.SUBTITLE_TRACK,url:r,deliveryDirectives:s,levelOrTrack:o})}onLevelsUpdated(e,t){const n=this.loaders[ue.LEVEL];if(n){const i=n.context;i&&!t.levels.some(r=>r===i.levelOrTrack)&&(n.abort(),delete this.loaders[ue.LEVEL])}}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const u=this.hls.logger,f=i.context;if(f&&f.levelOrTrack===e.levelOrTrack&&(f.url===e.url||f.deliveryDirectives&&!e.deliveryDirectives)){f.url===e.url?u.log(`[playlist-loader]: ignore ${e.url} ongoing request`):u.log(`[playlist-loader]: ignore ${e.url} in favor of ${f.url}`);return}u.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===ue.MANIFEST?r=n.manifestLoadPolicy.default:r=m({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),E((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===ue.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===ue.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===ue.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const f=u.partTarget,h=u.targetduration;if(f&&h){const v=Math.max(f*3,h*.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},c={onSuccess:(u,f,h,v)=>{const x=this.getInternalLoader(h);this.resetInternalLoader(h.type);const S=u.data;if(S.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,h,new Error("no EXTM3U delimiter"),v||null,f);return}f.parsing.start=performance.now(),$i.isMediaPlaylist(S)||h.type!==ue.MANIFEST?this.handleTrackOrLevelPlaylist(u,f,h,v||null,x):this.handleMasterPlaylist(u,f,h,v)},onError:(u,f,h,v)=>{this.handleNetworkError(f,h,!1,u,v)},onTimeout:(u,f,h)=>{this.handleNetworkError(f,h,!0,void 0,u)}};i.load(e,o,c)}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=Aa(e,n),c=$i.parseMasterPlaylist(s,o);if(c.playlistParsingError){this.handleManifestParsingError(e,n,c.playlistParsingError,i,t);return}const{contentSteering:u,levels:f,sessionData:h,sessionKeys:v,startTimeOffset:x,variableList:S}=c;this.variableList=S;const{AUDIO:B=[],SUBTITLES:P,"CLOSED-CAPTIONS":Q}=$i.parseMasterPlaylistMedia(s,o,c);B.length&&!B.some(ie=>!ie.url)&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),B.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new an({}),bitrate:0,url:""})),r.trigger(p.MANIFEST_LOADED,{levels:f,audioTracks:B,subtitles:P,captions:Q,contentSteering:u,url:o,stats:t,networkDetails:i,sessionData:h,sessionKeys:v,startTimeOffset:x,variableList:S})}handleTrackOrLevelPlaylist(e,t,n,i,r){const s=this.hls,{id:o,level:c,type:u}=n,f=Aa(e,n),h=E(c)?c:E(o)?o:0,v=jo(n),x=$i.parseLevelPlaylist(e.data,f,h,v,0,this.variableList);if(u===ue.MANIFEST){const S={attrs:new an({}),bitrate:0,details:x,name:"",url:f};x.requestScheduled=t.loading.start+ds(x,0),s.trigger(p.MANIFEST_LOADED,{levels:[S],audioTracks:[],url:f,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=x,this.handlePlaylistLoaded(x,e,t,n,i,r)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(p.ERROR,{type:ee.NETWORK_ERROR,details:W.MANIFEST_PARSING_ERROR,fatal:t.type===ue.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===ue.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===ue.AUDIO_TRACK||e.type===ue.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let c=W.UNKNOWN,u=!1;const f=this.getInternalLoader(e);switch(e.type){case ue.MANIFEST:c=n?W.MANIFEST_LOAD_TIMEOUT:W.MANIFEST_LOAD_ERROR,u=!0;break;case ue.LEVEL:c=n?W.LEVEL_LOAD_TIMEOUT:W.LEVEL_LOAD_ERROR,u=!1;break;case ue.AUDIO_TRACK:c=n?W.AUDIO_TRACK_LOAD_TIMEOUT:W.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case ue.SUBTITLE_TRACK:c=n?W.SUBTITLE_TRACK_LOAD_TIMEOUT:W.SUBTITLE_LOAD_ERROR,u=!1;break}f&&this.resetInternalLoader(e.type);const h={type:ee.NETWORK_ERROR,details:c,fatal:u,url:e.url,loader:f,context:e,error:o,networkDetails:t,stats:r};if(i){const v=(t==null?void 0:t.url)||e.url;h.response=y({url:v,data:void 0},i)}this.hls.trigger(p.ERROR,h)}handlePlaylistLoaded(e,t,n,i,r,s){const o=this.hls,{type:c,level:u,id:f,groupId:h,deliveryDirectives:v}=i,x=Aa(t,i),S=jo(i),B=typeof i.level=="number"&&S===Y.MAIN?u:void 0;if(!e.fragments.length){const Q=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(p.ERROR,{type:ee.NETWORK_ERROR,details:W.LEVEL_EMPTY_ERROR,fatal:!1,url:x,error:Q,reason:Q.message,response:t,context:i,level:B,parent:S,networkDetails:r,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const P=e.playlistParsingError;if(P){if(this.hls.logger.warn(P),!o.config.ignorePlaylistParsingErrors){o.trigger(p.ERROR,{type:ee.NETWORK_ERROR,details:W.LEVEL_PARSING_ERROR,fatal:!1,url:x,error:P,reason:P.message,response:t,context:i,level:B,parent:S,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)),c){case ue.MANIFEST:case ue.LEVEL:o.trigger(p.LEVEL_LOADED,{details:e,levelInfo:i.levelOrTrack||o.levels[0],level:B||0,id:f||0,stats:n,networkDetails:r,deliveryDirectives:v,withoutMultiVariant:c===ue.MANIFEST});break;case ue.AUDIO_TRACK:o.trigger(p.AUDIO_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:f||0,groupId:h||"",stats:n,networkDetails:r,deliveryDirectives:v});break;case ue.SUBTITLE_TRACK:o.trigger(p.SUBTITLE_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:f||0,groupId:h||"",stats:n,networkDetails:r,deliveryDirectives:v});break}}}class Er{static get version(){return nr}static isMSESupported(){return Ho()}static isSupported(){return $c()}static getMediaSource(){return ae()}static get Events(){return p}static get MetadataSchema(){return Hi}static get ErrorTypes(){return ee}static get ErrorDetails(){return W}static get DefaultConfig(){return Er.defaultConfig?Er.defaultConfig:Fc}static set DefaultConfig(e){Er.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 Nr,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=ne(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=Nc(Er.DefaultConfig,e,t);this.userConfig=e,n.progressive&&Bc(n,t);const{abrController:i,bufferController:r,capLevelController:s,errorController:o,fpsController:c}=n,u=new o(this),f=this.abrController=new i(this),h=new ii(this),v=n.interstitialsController,x=v?this.interstitialsController=new v(this,Er):null,S=this.bufferController=new r(this,h),B=this.capLevelController=new s(this),P=new c(this),Q=new Jc(this),ce=n.contentSteeringController,ie=ce?new ce(this):null,De=this.levelController=new Vc(this,ie),Be=new Hc(this),ct=new Qc(this.config),Oe=this.streamController=new Xc(this,h,ct),$e=this.gapController=new zc(this,h);B.setStreamController(Oe),P.setStreamController(Oe);const Xe=[Q,De,Oe];x&&Xe.splice(1,0,x),ie&&Xe.splice(1,0,ie),this.networkControllers=Xe;const Ce=[f,S,$e,B,P,Be,h];this.audioTrackController=this.createController(n.audioTrackController,Xe);const St=n.audioStreamController;St&&Xe.push(this.audioStreamController=new St(this,h,ct)),this.subtitleTrackController=this.createController(n.subtitleTrackController,Xe);const Nt=n.subtitleStreamController;Nt&&Xe.push(this.subtititleStreamController=new Nt(this,h,ct)),this.createController(n.timelineController,Ce),ct.emeController=this.emeController=this.createController(n.emeController,Ce),this.cmcdController=this.createController(n.cmcdController,Ce),this.latencyController=this.createController(jc,Ce),this.coreComponents=Ce,Xe.push(u);const sn=u.onErrorOut;typeof sn=="function"&&this.on(p.ERROR,sn,u),this.on(p.MANIFEST_LOADED,Q.onManifestLoaded,Q)}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===p.ERROR;this.trigger(p.ERROR,{type:ee.OTHER_ERROR,details:W.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(p.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(p.ERROR,{type:ee.OTHER_ERROR,details:W.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(p.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(p.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(p.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,i=this._url=g.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(p.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={[Y.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[Y.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[Y.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=zu()),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){Pt(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=jt(t);return Rt(e,n,navigator.mediaCapabilities)}}Er.defaultConfig=void 0}}]);
|
|
}()); |