|
|
!(function(){var Mo=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[9716],{65966:function(dt,me,b){"use strict";b.d(me,{Z:function(){return Nt}});var k=b(20439),I=b(50298),K=b(62646),T=b(43403),w=b(92310),_=b.n(w),O=b(29301),m=b(76846),n=b(96452),y=b(6089),f=b(80402),c=b(34280),l=b(49658),u=b(59301),p=b(14809),E=b(77900),D=b(8654);function L(Le){var Re=Le.prefixCls,he=Le.align,Oe=Le.arrow,We=Le.arrowPos,qe=Oe||{},ae=qe.className,se=qe.content,pe=We.x,ge=pe===void 0?0:pe,de=We.y,Ce=de===void 0?0:de,Fe=u.useRef();if(!he||!he.points)return null;var Te={position:"absolute"};if(he.autoArrow!==!1){var Ne=he.points[0],Me=he.points[1],je=Ne[0],tt=Ne[1],Ze=Me[0],it=Me[1];je===Ze||!["t","b"].includes(je)?Te.top=Ce:je==="t"?Te.top=0:Te.bottom=0,tt===it||!["l","r"].includes(tt)?Te.left=ge:tt==="l"?Te.left=0:Te.right=0}return u.createElement("div",{ref:Fe,className:_()("".concat(Re,"-arrow"),ae),style:Te},se)}function C(Le){var Re=Le.prefixCls,he=Le.open,Oe=Le.zIndex,We=Le.mask,qe=Le.motion;return We?u.createElement(E.default,(0,p.Z)({},qe,{motionAppear:!0,visible:he,removeOnLeave:!0}),function(ae){var se=ae.className;return u.createElement("div",{style:{zIndex:Oe},className:_()("".concat(Re,"-mask"),se)})}):null}var A=u.memo(function(Le){var Re=Le.children;return Re},function(Le,Re){return Re.cache}),P=A,U=u.forwardRef(function(Le,Re){var he=Le.popup,Oe=Le.className,We=Le.prefixCls,qe=Le.style,ae=Le.target,se=Le.onVisibleChanged,pe=Le.open,ge=Le.keepDom,de=Le.fresh,Ce=Le.onClick,Fe=Le.mask,Te=Le.arrow,Ne=Le.arrowPos,Me=Le.align,je=Le.motion,tt=Le.maskMotion,Ze=Le.forceRender,it=Le.getPopupContainer,ht=Le.autoDestroy,st=Le.portal,Qe=Le.zIndex,mt=Le.onMouseEnter,Dt=Le.onMouseLeave,Mt=Le.onPointerEnter,kt=Le.onPointerDownCapture,jt=Le.ready,Je=Le.offsetX,Ct=Le.offsetY,xe=Le.offsetR,ve=Le.offsetB,ye=Le.onAlign,ee=Le.onPrepare,ie=Le.stretch,ue=Le.targetWidth,ce=Le.targetHeight,_e=typeof he=="function"?he():he,Ve=pe||ge,Ye=(it==null?void 0:it.length)>0,at=u.useState(!it||!Ye),ft=(0,I.Z)(at,2),Lt=ft[0],Kt=ft[1];if((0,c.Z)(function(){!Lt&&Ye&&ae&&Kt(!0)},[Lt,Ye,ae]),!Lt)return null;var Et="auto",xt={left:"-1000vw",top:"-1000vh",right:Et,bottom:Et};if(jt||!pe){var ui,_i=Me.points,ci=Me.dynamicInset||((ui=Me._experimental)===null||ui===void 0?void 0:ui.dynamicInset),ii=ci&&_i[0][1]==="r",Ut=ci&&_i[0][0]==="b";ii?(xt.right=xe,xt.left=Et):(xt.left=Je,xt.right=Et),Ut?(xt.bottom=ve,xt.top=Et):(xt.top=Ct,xt.bottom=Et)}var St={};return ie&&(ie.includes("height")&&ce?St.height=ce:ie.includes("minHeight")&&ce&&(St.minHeight=ce),ie.includes("width")&&ue?St.width=ue:ie.includes("minWidth")&&ue&&(St.minWidth=ue)),pe||(St.pointerEvents="none"),u.createElement(st,{open:Ze||Ve,getContainer:it&&function(){return it(ae)},autoDestroy:ht},u.createElement(C,{prefixCls:We,open:pe,zIndex:Qe,mask:Fe,motion:tt}),u.createElement(O.Z,{onResize:ye,disabled:!pe},function(Ot){return u.createElement(E.default,(0,p.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Ze,leavedClassName:"".concat(We,"-hidden")},je,{onAppearPrepare:ee,onEnterPrepare:ee,visible:pe,onVisibleChanged:function(gi){var mi;je==null||(mi=je.onVisibleChanged)===null||mi===void 0||mi.call(je,gi),se(gi)}}),function(Xt,gi){var mi=Xt.className,qi=Xt.style,Ii=_()(We,mi,Oe);return u.createElement("div",{ref:(0,D.sQ)(Ot,Re,gi),className:Ii,style:(0,k.Z)((0,k.Z)((0,k.Z)((0,k.Z)({"--arrow-x":"".concat(Ne.x||0,"px"),"--arrow-y":"".concat(Ne.y||0,"px")},xt),St),qi),{},{boxSizing:"border-box",zIndex:Qe},qe),onMouseEnter:mt,onMouseLeave:Dt,onPointerEnter:Mt,onClick:Ce,onPointerDownCapture:kt},Te&&u.createElement(L,{prefixCls:We,arrow:Te,arrowPos:Ne,align:Me}),u.createElement(P,{cache:!pe&&!de},_e))})}))}),N=U,$=u.forwardRef(function(Le,Re){var he=Le.children,Oe=Le.getTriggerDOMNode,We=(0,D.Yr)(he),qe=u.useCallback(function(se){(0,D.mH)(Re,Oe?Oe(se):se)},[Oe]),ae=(0,D.x1)(qe,(0,D.C4)(he));return We?u.cloneElement(he,{ref:ae}):he}),F=$,q=u.createContext(null),V=q;function ne(Le){return Le?Array.isArray(Le)?Le:[Le]:[]}function oe(Le,Re,he,Oe){return u.useMemo(function(){var We=ne(he!=null?he:Re),qe=ne(Oe!=null?Oe:Re),ae=new Set(We),se=new Set(qe);return Le&&(ae.has("hover")&&(ae.delete("hover"),ae.add("click")),se.has("hover")&&(se.delete("hover"),se.add("click"))),[ae,se]},[Le,Re,he,Oe])}var J=b(29194);function z(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],he=arguments.length>2?arguments[2]:void 0;return he?Le[0]===Re[0]:Le[0]===Re[0]&&Le[1]===Re[1]}function X(Le,Re,he,Oe){for(var We=he.points,qe=Object.keys(Le),ae=0;ae<qe.length;ae+=1){var se,pe=qe[ae];if(z((se=Le[pe])===null||se===void 0?void 0:se.points,We,Oe))return"".concat(Re,"-placement-").concat(pe)}return""}function B(Le,Re,he,Oe){return Re||(he?{motionName:"".concat(Le,"-").concat(he)}:Oe?{motionName:Oe}:null)}function G(Le){return Le.ownerDocument.defaultView}function W(Le){for(var Re=[],he=Le==null?void 0:Le.parentElement,Oe=["hidden","scroll","clip","auto"];he;){var We=G(he).getComputedStyle(he),qe=We.overflowX,ae=We.overflowY,se=We.overflow;[qe,ae,se].some(function(pe){return Oe.includes(pe)})&&Re.push(he),he=he.parentElement}return Re}function R(Le){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Le)?Re:Le}function x(Le){return R(parseFloat(Le),0)}function Y(Le,Re){var he=(0,k.Z)({},Le);return(Re||[]).forEach(function(Oe){if(!(Oe instanceof HTMLBodyElement||Oe instanceof HTMLHtmlElement)){var We=G(Oe).getComputedStyle(Oe),qe=We.overflow,ae=We.overflowClipMargin,se=We.borderTopWidth,pe=We.borderBottomWidth,ge=We.borderLeftWidth,de=We.borderRightWidth,Ce=Oe.getBoundingClientRect(),Fe=Oe.offsetHeight,Te=Oe.clientHeight,Ne=Oe.offsetWidth,Me=Oe.clientWidth,je=x(se),tt=x(pe),Ze=x(ge),it=x(de),ht=R(Math.round(Ce.width/Ne*1e3)/1e3),st=R(Math.round(Ce.height/Fe*1e3)/1e3),Qe=(Ne-Me-Ze-it)*ht,mt=(Fe-Te-je-tt)*st,Dt=je*st,Mt=tt*st,kt=Ze*ht,jt=it*ht,Je=0,Ct=0;if(qe==="clip"){var xe=x(ae);Je=xe*ht,Ct=xe*st}var ve=Ce.x+kt-Je,ye=Ce.y+Dt-Ct,ee=ve+Ce.width+2*Je-kt-jt-Qe,ie=ye+Ce.height+2*Ct-Dt-Mt-mt;he.left=Math.max(he.left,ve),he.top=Math.max(he.top,ye),he.right=Math.min(he.right,ee),he.bottom=Math.min(he.bottom,ie)}}),he}function te(Le){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,he="".concat(Re),Oe=he.match(/^(.*)\%$/);return Oe?Le*(parseFloat(Oe[1])/100):parseFloat(he)}function Se(Le,Re){var he=Re||[],Oe=(0,I.Z)(he,2),We=Oe[0],qe=Oe[1];return[te(Le.width,We),te(Le.height,qe)]}function Ie(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Le[0],Le[1]]}function Ge(Le,Re){var he=Re[0],Oe=Re[1],We,qe;return he==="t"?qe=Le.y:he==="b"?qe=Le.y+Le.height:qe=Le.y+Le.height/2,Oe==="l"?We=Le.x:Oe==="r"?We=Le.x+Le.width:We=Le.x+Le.width/2,{x:We,y:qe}}function Ee(Le,Re){var he={t:"b",b:"t",l:"r",r:"l"};return Le.map(function(Oe,We){return We===Re?he[Oe]||"c":Oe}).join("")}function ze(Le,Re,he,Oe,We,qe,ae){var se=u.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:We[Oe]||{}}),pe=(0,I.Z)(se,2),ge=pe[0],de=pe[1],Ce=u.useRef(0),Fe=u.useMemo(function(){return Re?W(Re):[]},[Re]),Te=u.useRef({}),Ne=function(){Te.current={}};Le||Ne();var Me=(0,y.Z)(function(){if(Re&&he&&Le){let ki=function(Si,ji){var Ji=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pt,Pr=Ve.x+Si,Ar=Ve.y+ji,Tr=Pr+Ut,on=Ar+ii,_t=Math.max(Pr,Ji.left),It=Math.max(Ar,Ji.top),fi=Math.min(Tr,Ji.right),pi=Math.min(on,Ji.bottom);return Math.max(0,(fi-_t)*(pi-It))},Ht=function(){sr=Ve.y+hi,Li=sr+ii,xr=Ve.x+ei,ar=xr+Ut};var Ze,it,ht,st,Qe=Re,mt=Qe.ownerDocument,Dt=G(Qe),Mt=Dt.getComputedStyle(Qe),kt=Mt.position,jt=Qe.style.left,Je=Qe.style.top,Ct=Qe.style.right,xe=Qe.style.bottom,ve=Qe.style.overflow,ye=(0,k.Z)((0,k.Z)({},We[Oe]),qe),ee=mt.createElement("div");(Ze=Qe.parentElement)===null||Ze===void 0||Ze.appendChild(ee),ee.style.left="".concat(Qe.offsetLeft,"px"),ee.style.top="".concat(Qe.offsetTop,"px"),ee.style.position=kt,ee.style.height="".concat(Qe.offsetHeight,"px"),ee.style.width="".concat(Qe.offsetWidth,"px"),Qe.style.left="0",Qe.style.top="0",Qe.style.right="auto",Qe.style.bottom="auto",Qe.style.overflow="hidden";var ie;if(Array.isArray(he))ie={x:he[0],y:he[1],width:0,height:0};else{var ue,ce,_e=he.getBoundingClientRect();_e.x=(ue=_e.x)!==null&&ue!==void 0?ue:_e.left,_e.y=(ce=_e.y)!==null&&ce!==void 0?ce:_e.top,ie={x:_e.x,y:_e.y,width:_e.width,height:_e.height}}var Ve=Qe.getBoundingClientRect(),Ye=Dt.getComputedStyle(Qe),at=Ye.height,ft=Ye.width;Ve.x=(it=Ve.x)!==null&&it!==void 0?it:Ve.left,Ve.y=(ht=Ve.y)!==null&&ht!==void 0?ht:Ve.top;var Lt=mt.documentElement,Kt=Lt.clientWidth,Et=Lt.clientHeight,xt=Lt.scrollWidth,ui=Lt.scrollHeight,_i=Lt.scrollTop,ci=Lt.scrollLeft,ii=Ve.height,Ut=Ve.width,St=ie.height,Ot=ie.width,Xt={left:0,top:0,right:Kt,bottom:Et},gi={left:-ci,top:-_i,right:xt-ci,bottom:ui-_i},mi=ye.htmlRegion,qi="visible",Ii="visibleFirst";mi!=="scroll"&&mi!==Ii&&(mi=qi);var Mi=mi===Ii,br=Y(gi,Fe),ri=Y(Xt,Fe),pt=mi===qi?ri:br,ot=Mi?ri:pt;Qe.style.left="auto",Qe.style.top="auto",Qe.style.right="0",Qe.style.bottom="0";var yt=Qe.getBoundingClientRect();Qe.style.left=jt,Qe.style.top=Je,Qe.style.right=Ct,Qe.style.bottom=xe,Qe.style.overflow=ve,(st=Qe.parentElement)===null||st===void 0||st.removeChild(ee);var zt=R(Math.round(Ut/parseFloat(ft)*1e3)/1e3),Wt=R(Math.round(ii/parseFloat(at)*1e3)/1e3);if(zt===0||Wt===0||(0,m.Sh)(he)&&!(0,J.Z)(he))return;var Ti=ye.offset,Yi=ye.targetOffset,xi=Se(Ve,Ti),Qt=(0,I.Z)(xi,2),qt=Qt[0],vi=Qt[1],Bi=Se(ie,Yi),si=(0,I.Z)(Bi,2),Ki=si[0],Yt=si[1];ie.x-=Ki,ie.y-=Yt;var Gt=ye.points||[],Jt=(0,I.Z)(Gt,2),bi=Jt[0],Ei=Jt[1],ni=Ie(Ei),Pi=Ie(bi),wi=Ge(ie,ni),Qr=Ge(Ve,Pi),Ni=(0,k.Z)({},ye),ei=wi.x-Qr.x+qt,hi=wi.y-Qr.y+vi,Ui=ki(ei,hi),fr=ki(ei,hi,ri),Di=Ge(ie,["t","l"]),Jr=Ge(Ve,["t","l"]),yi=Ge(ie,["b","r"]),Ci=Ge(Ve,["b","r"]),Er=ye.overflow||{},Sr=Er.adjustX,di=Er.adjustY,kr=Er.shiftX,dr=Er.shiftY,nr=function(ji){return typeof ji=="boolean"?ji:ji>=0},sr,Li,xr,ar;Ht();var en=nr(di),Oi=Pi[0]===ni[0];if(en&&Pi[0]==="t"&&(Li>ot.bottom||Te.current.bt)){var wr=hi;Oi?wr-=ii-St:wr=Di.y-Ci.y-vi;var tn=ki(ei,wr),Ur=ki(ei,wr,ri);tn>Ui||tn===Ui&&(!Mi||Ur>=fr)?(Te.current.bt=!0,hi=wr,vi=-vi,Ni.points=[Ee(Pi,0),Ee(ni,0)]):Te.current.bt=!1}if(en&&Pi[0]==="b"&&(sr<ot.top||Te.current.tb)){var pr=hi;Oi?pr+=ii-St:pr=yi.y-Jr.y-vi;var rn=ki(ei,pr),nn=ki(ei,pr,ri);rn>Ui||rn===Ui&&(!Mi||nn>=fr)?(Te.current.tb=!0,hi=pr,vi=-vi,Ni.points=[Ee(Pi,0),Ee(ni,0)]):Te.current.tb=!1}var $r=nr(Sr),sn=Pi[1]===ni[1];if($r&&Pi[1]==="l"&&(ar>ot.right||Te.current.rl)){var Ri=ei;sn?Ri-=Ut-Ot:Ri=Di.x-Ci.x-qt;var _r=ki(Ri,hi),Cr=ki(Ri,hi,ri);_r>Ui||_r===Ui&&(!Mi||Cr>=fr)?(Te.current.rl=!0,ei=Ri,qt=-qt,Ni.points=[Ee(Pi,1),Ee(ni,1)]):Te.current.rl=!1}if($r&&Pi[1]==="r"&&(xr<ot.left||Te.current.lr)){var Zi=ei;sn?Zi+=Ut-Ot:Zi=yi.x-Jr.x-qt;var Ir=ki(Zi,hi),Rt=ki(Zi,hi,ri);Ir>Ui||Ir===Ui&&(!Mi||Rt>=fr)?(Te.current.lr=!0,ei=Zi,qt=-qt,Ni.points=[Ee(Pi,1),Ee(ni,1)]):Te.current.lr=!1}Ht();var Hi=kr===!0?0:kr;typeof Hi=="number"&&(xr<ri.left&&(ei-=xr-ri.left-qt,ie.x+Ot<ri.left+Hi&&(ei+=ie.x-ri.left+Ot-Hi)),ar>ri.right&&(ei-=ar-ri.right-qt,ie.x>ri.right-Hi&&(ei+=ie.x-ri.right+Hi)));var or=dr===!0?0:dr;typeof or=="number"&&(sr<ri.top&&(hi-=sr-ri.top-vi,ie.y+St<ri.top+or&&(hi+=ie.y-ri.top+St-or)),Li>ri.bottom&&(hi-=Li-ri.bottom-vi,ie.y>ri.bottom-or&&(hi+=ie.y-ri.bottom+or)));var Xi=Ve.x+ei,lr=Xi+Ut,Hr=Ve.y+hi,mn=Hr+ii,jr=ie.x,ai=jr+Ot,an=ie.y,vn=an+St,yn=Math.max(Xi,jr),Wr=Math.min(lr,ai),bn=(yn+Wr)/2,En=bn-Xi,ur=Math.max(Hr,an),Gr=Math.min(mn,vn),Kr=(ur+Gr)/2,zr=Kr-Hr;ae==null||ae(Re,Ni);var Qi=yt.right-Ve.x-(ei+Ve.width),Vr=yt.bottom-Ve.y-(hi+Ve.height);zt===1&&(ei=Math.round(ei),Qi=Math.round(Qi)),Wt===1&&(hi=Math.round(hi),Vr=Math.round(Vr));var Sn={ready:!0,offsetX:ei/zt,offsetY:hi/Wt,offsetR:Qi/zt,offsetB:Vr/Wt,arrowX:En/zt,arrowY:zr/Wt,scaleX:zt,scaleY:Wt,align:Ni};de(Sn)}}),je=function(){Ce.current+=1;var it=Ce.current;Promise.resolve().then(function(){Ce.current===it&&Me()})},tt=function(){de(function(it){return(0,k.Z)((0,k.Z)({},it),{},{ready:!1})})};return(0,c.Z)(tt,[Oe]),(0,c.Z)(function(){Le||tt()},[Le]),[ge.ready,ge.offsetX,ge.offsetY,ge.offsetR,ge.offsetB,ge.arrowX,ge.arrowY,ge.scaleX,ge.scaleY,ge.align,je]}var He=b(95190);function Be(Le,Re,he,Oe,We){(0,c.Z)(function(){if(Le&&Re&&he){let Ce=function(){Oe(),We()};var qe=Re,ae=he,se=W(qe),pe=W(ae),ge=G(ae),de=new Set([ge].concat((0,He.Z)(se),(0,He.Z)(pe)));return de.forEach(function(Fe){Fe.addEventListener("scroll",Ce,{passive:!0})}),ge.addEventListener("resize",Ce,{passive:!0}),Oe(),function(){de.forEach(function(Fe){Fe.removeEventListener("scroll",Ce),ge.removeEventListener("resize",Ce)})}}},[Le,Re,he])}var lt=b(48736);function At(Le,Re,he,Oe,We,qe,ae,se){var pe=u.useRef(Le);pe.current=Le;var ge=u.useRef(!1);u.useEffect(function(){if(Re&&Oe&&(!We||qe)){var Ce=function(){ge.current=!1},Fe=function(ht){var st;pe.current&&!ae(((st=ht.composedPath)===null||st===void 0||(st=st.call(ht))===null||st===void 0?void 0:st[0])||ht.target)&&!ge.current&&se(!1)},Te=G(Oe);Te.addEventListener("pointerdown",Ce,!0),Te.addEventListener("mousedown",Fe,!0),Te.addEventListener("contextmenu",Fe,!0);var Ne=(0,n.A)(he);if(Ne&&(Ne.addEventListener("mousedown",Fe,!0),Ne.addEventListener("contextmenu",Fe,!0)),0)var Me,je,tt,Ze;return function(){Te.removeEventListener("pointerdown",Ce,!0),Te.removeEventListener("mousedown",Fe,!0),Te.removeEventListener("contextmenu",Fe,!0),Ne&&(Ne.removeEventListener("mousedown",Fe,!0),Ne.removeEventListener("contextmenu",Fe,!0))}}},[Re,he,Oe,We,qe]);function de(){ge.current=!0}return de}var nt=["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 Bt(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T.Z,Re=u.forwardRef(function(he,Oe){var We=he.prefixCls,qe=We===void 0?"rc-trigger-popup":We,ae=he.children,se=he.action,pe=se===void 0?"hover":se,ge=he.showAction,de=he.hideAction,Ce=he.popupVisible,Fe=he.defaultPopupVisible,Te=he.onPopupVisibleChange,Ne=he.afterPopupVisibleChange,Me=he.mouseEnterDelay,je=he.mouseLeaveDelay,tt=je===void 0?.1:je,Ze=he.focusDelay,it=he.blurDelay,ht=he.mask,st=he.maskClosable,Qe=st===void 0?!0:st,mt=he.getPopupContainer,Dt=he.forceRender,Mt=he.autoDestroy,kt=he.destroyPopupOnHide,jt=he.popup,Je=he.popupClassName,Ct=he.popupStyle,xe=he.popupPlacement,ve=he.builtinPlacements,ye=ve===void 0?{}:ve,ee=he.popupAlign,ie=he.zIndex,ue=he.stretch,ce=he.getPopupClassNameFromAlign,_e=he.fresh,Ve=he.alignPoint,Ye=he.onPopupClick,at=he.onPopupAlign,ft=he.arrow,Lt=he.popupMotion,Kt=he.maskMotion,Et=he.popupTransitionName,xt=he.popupAnimation,ui=he.maskTransitionName,_i=he.maskAnimation,ci=he.className,ii=he.getTriggerDOMNode,Ut=(0,K.Z)(he,nt),St=Mt||kt||!1,Ot=u.useState(!1),Xt=(0,I.Z)(Ot,2),gi=Xt[0],mi=Xt[1];(0,c.Z)(function(){mi((0,l.Z)())},[]);var qi=u.useRef({}),Ii=u.useContext(V),Mi=u.useMemo(function(){return{registerSubPopup:function(It,fi){qi.current[It]=fi,Ii==null||Ii.registerSubPopup(It,fi)}}},[Ii]),br=(0,f.Z)(),ri=u.useState(null),pt=(0,I.Z)(ri,2),ot=pt[0],yt=pt[1],zt=u.useRef(null),Wt=(0,y.Z)(function(_t){zt.current=_t,(0,m.Sh)(_t)&&ot!==_t&&yt(_t),Ii==null||Ii.registerSubPopup(br,_t)}),Ti=u.useState(null),Yi=(0,I.Z)(Ti,2),xi=Yi[0],Qt=Yi[1],qt=u.useRef(null),vi=(0,y.Z)(function(_t){(0,m.Sh)(_t)&&xi!==_t&&(Qt(_t),qt.current=_t)}),Bi=u.Children.only(ae),si=(Bi==null?void 0:Bi.props)||{},Ki={},Yt=(0,y.Z)(function(_t){var It,fi,pi=xi;return(pi==null?void 0:pi.contains(_t))||((It=(0,n.A)(pi))===null||It===void 0?void 0:It.host)===_t||_t===pi||(ot==null?void 0:ot.contains(_t))||((fi=(0,n.A)(ot))===null||fi===void 0?void 0:fi.host)===_t||_t===ot||Object.values(qi.current).some(function(oi){return(oi==null?void 0:oi.contains(_t))||_t===oi})}),Gt=B(qe,Lt,xt,Et),Jt=B(qe,Kt,_i,ui),bi=u.useState(Fe||!1),Ei=(0,I.Z)(bi,2),ni=Ei[0],Pi=Ei[1],wi=Ce!=null?Ce:ni,Qr=(0,y.Z)(function(_t){Ce===void 0&&Pi(_t)});(0,c.Z)(function(){Pi(Ce||!1)},[Ce]);var Ni=u.useRef(wi);Ni.current=wi;var ei=u.useRef([]);ei.current=[];var hi=(0,y.Z)(function(_t){var It;Qr(_t),((It=ei.current[ei.current.length-1])!==null&&It!==void 0?It:wi)!==_t&&(ei.current.push(_t),Te==null||Te(_t))}),Ui=u.useRef(),fr=function(){clearTimeout(Ui.current)},Di=function(It){var fi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;fr(),fi===0?hi(It):Ui.current=setTimeout(function(){hi(It)},fi*1e3)};u.useEffect(function(){return fr},[]);var Jr=u.useState(!1),yi=(0,I.Z)(Jr,2),Ci=yi[0],Er=yi[1];(0,c.Z)(function(_t){(!_t||wi)&&Er(!0)},[wi]);var Sr=u.useState(null),di=(0,I.Z)(Sr,2),kr=di[0],dr=di[1],nr=u.useState(null),sr=(0,I.Z)(nr,2),Li=sr[0],xr=sr[1],ar=function(It){xr([It.clientX,It.clientY])},en=ze(wi,ot,Ve&&Li!==null?Li:xi,xe,ye,ee,at),Oi=(0,I.Z)(en,11),wr=Oi[0],tn=Oi[1],Ur=Oi[2],pr=Oi[3],rn=Oi[4],nn=Oi[5],$r=Oi[6],sn=Oi[7],Ri=Oi[8],_r=Oi[9],Cr=Oi[10],Zi=oe(gi,pe,ge,de),Ir=(0,I.Z)(Zi,2),Rt=Ir[0],Hi=Ir[1],or=Rt.has("click"),Xi=Hi.has("click")||Hi.has("contextMenu"),lr=(0,y.Z)(function(){Ci||Cr()}),Hr=function(){Ni.current&&Ve&&Xi&&Di(!1)};Be(wi,xi,ot,lr,Hr),(0,c.Z)(function(){lr()},[Li,xe]),(0,c.Z)(function(){wi&&!(ye!=null&&ye[xe])&&lr()},[JSON.stringify(ee)]);var mn=u.useMemo(function(){var _t=X(ye,qe,_r,Ve);return _()(_t,ce==null?void 0:ce(_r))},[_r,ce,ye,qe,Ve]);u.useImperativeHandle(Oe,function(){return{nativeElement:qt.current,popupElement:zt.current,forceAlign:lr}});var jr=u.useState(0),ai=(0,I.Z)(jr,2),an=ai[0],vn=ai[1],yn=u.useState(0),Wr=(0,I.Z)(yn,2),bn=Wr[0],En=Wr[1],ur=function(){if(ue&&xi){var It=xi.getBoundingClientRect();vn(It.width),En(It.height)}},Gr=function(){ur(),lr()},Kr=function(It){Er(!1),Cr(),Ne==null||Ne(It)},zr=function(){return new Promise(function(It){ur(),dr(function(){return It})})};(0,c.Z)(function(){kr&&(Cr(),kr(),dr(null))},[kr]);function Qi(_t,It,fi,pi){Ki[_t]=function(oi){var gr;pi==null||pi(oi),Di(It,fi);for(var xn=arguments.length,wn=new Array(xn>1?xn-1:0),qr=1;qr<xn;qr++)wn[qr-1]=arguments[qr];(gr=si[_t])===null||gr===void 0||gr.call.apply(gr,[si,oi].concat(wn))}}(or||Xi)&&(Ki.onClick=function(_t){var It;Ni.current&&Xi?Di(!1):!Ni.current&&or&&(ar(_t),Di(!0));for(var fi=arguments.length,pi=new Array(fi>1?fi-1:0),oi=1;oi<fi;oi++)pi[oi-1]=arguments[oi];(It=si.onClick)===null||It===void 0||It.call.apply(It,[si,_t].concat(pi))});var Vr=At(wi,Xi,xi,ot,ht,Qe,Yt,Di),Sn=Rt.has("hover"),ki=Hi.has("hover"),Ht,Si;Sn&&(Qi("onMouseEnter",!0,Me,function(_t){ar(_t)}),Qi("onPointerEnter",!0,Me,function(_t){ar(_t)}),Ht=function(It){(wi||Ci)&&ot!==null&&ot!==void 0&&ot.contains(It.target)&&Di(!0,Me)},Ve&&(Ki.onMouseMove=function(_t){var It;(It=si.onMouseMove)===null||It===void 0||It.call(si,_t)})),ki&&(Qi("onMouseLeave",!1,tt),Qi("onPointerLeave",!1,tt),Si=function(){Di(!1,tt)}),Rt.has("focus")&&Qi("onFocus",!0,Ze),Hi.has("focus")&&Qi("onBlur",!1,it),Rt.has("contextMenu")&&(Ki.onContextMenu=function(_t){var It;Ni.current&&Hi.has("contextMenu")?Di(!1):(ar(_t),Di(!0)),_t.preventDefault();for(var fi=arguments.length,pi=new Array(fi>1?fi-1:0),oi=1;oi<fi;oi++)pi[oi-1]=arguments[oi];(It=si.onContextMenu)===null||It===void 0||It.call.apply(It,[si,_t].concat(pi))}),ci&&(Ki.className=_()(si.className,ci));var ji=(0,k.Z)((0,k.Z)({},si),Ki),Ji={},Pr=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Pr.forEach(function(_t){Ut[_t]&&(Ji[_t]=function(){for(var It,fi=arguments.length,pi=new Array(fi),oi=0;oi<fi;oi++)pi[oi]=arguments[oi];(It=ji[_t])===null||It===void 0||It.call.apply(It,[ji].concat(pi)),Ut[_t].apply(Ut,pi)})});var Ar=u.cloneElement(Bi,(0,k.Z)((0,k.Z)({},ji),Ji)),Tr={x:nn,y:$r},on=ft?(0,k.Z)({},ft!==!0?ft:{}):null;return u.createElement(u.Fragment,null,u.createElement(O.Z,{disabled:!wi,ref:vi,onResize:Gr},u.createElement(F,{getTriggerDOMNode:ii},Ar)),u.createElement(V.Provider,{value:Mi},u.createElement(N,{portal:Le,ref:Wt,prefixCls:qe,popup:jt,className:_()(Je,mn),style:Ct,target:xi,onMouseEnter:Ht,onMouseLeave:Si,onPointerEnter:Ht,zIndex:ie,open:wi,keepDom:Ci,fresh:_e,onClick:Ye,onPointerDownCapture:Vr,mask:ht,motion:Gt,maskMotion:Jt,onVisibleChanged:Kr,onPrepare:zr,forceRender:Dt,autoDestroy:St,getPopupContainer:mt,align:_r,arrow:on,arrowPos:Tr,ready:wr,offsetX:tn,offsetY:Ur,offsetR:pr,offsetB:rn,onAlign:lr,stretch:ue,targetWidth:an/sn,targetHeight:bn/Ri})))});return Re}var Nt=Bt(T.Z)},42909:function(dt,me){"use strict";me.Z={header:"header___HqHSe",checkboxs:"checkboxs___ObBnD",field:"field___w_sM6","oj-form-container":"oj-form-container____odYP","oj-left-panel":"oj-left-panel___emEB2","oj-form-info":"oj-form-info___m00Ag",footer:"footer___O4iSJ",collapse:"collapse___Ltfkj","test-case-name":"test-case-name___miZcb","btn-remove-case":"btn-remove-case___cHap2","icon-tag":"icon-tag___gmyTb",btn_back:"btn_back___tNmX3",testJi:"testJi___L3fHb",upBtn:"upBtn___RGH6X",djs:"djs____TS0n",time:"time___IAdHc"}},28426:function(dt,me,b){"use strict";var k=b(59301),I=b(93314),K=b(99571),T=Object.defineProperty,w=Object.defineProperties,_=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,y=(u,p,E)=>p in u?T(u,p,{enumerable:!0,configurable:!0,writable:!0,value:E}):u[p]=E,f=(u,p)=>{for(var E in p||(p={}))m.call(p,E)&&y(u,E,p[E]);if(O)for(var E of O(p))n.call(p,E)&&y(u,E,p[E]);return u},c=(u,p)=>w(u,_(p));const l=({img:u,buttonProps:p={},styles:E={},customText:D,ButtonText:L,ButtonClick:C,Buttonclass:A,ButtonTwo:P,imgStyles:U,loading:N=!1,className:$=""})=>k.createElement("section",{className:`tc animated fadeIn ${$}`,style:f({color:"#999",margin:"100px auto",visibility:N?"hidden":"visible"},E)},k.createElement("img",{src:u||I,style:c(f({},U),{pointerEvents:"none",userSelect:"none"})}),k.createElement("p",{className:"mt20 font14"},D||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),L&&k.createElement(K.ZP,f({className:A,onClick:C},p),L),P&&P);me.Z=l},45677:function(dt,me,b){"use strict";b.d(me,{Z:function(){return A}});var k=b(59301),I={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},K=b(99571),T=b(70557),w=b(75975),_=b(25399),O=b(51257),m=b(81722),n=b(28426),y=b(346),f=b(44203),c=b(59301),l=Object.defineProperty,u=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,D=(P,U,N)=>U in P?l(P,U,{enumerable:!0,configurable:!0,writable:!0,value:N}):P[U]=N,L=(P,U)=>{for(var N in U||(U={}))p.call(U,N)&&D(P,N,U[N]);if(u)for(var N of u(U))E.call(U,N)&&D(P,N,U[N]);return P},C=(P,U,N)=>new Promise(($,F)=>{var q=oe=>{try{ne(N.next(oe))}catch(J){F(J)}},V=oe=>{try{ne(N.throw(oe))}catch(J){F(J)}},ne=oe=>oe.done?$(oe.value):Promise.resolve(oe.value).then(q,V);ne((N=N.apply(P,U)).next())}),A=({editOffice:P="view",data:U,issaver:N,onSaver:$,theme:F,type:q,filename:V,monacoEditor:ne,className:oe,style:J,close:z,onClose:X,hasMask:B,disabledDownload:G,onImgDimensions:W,showNodata:R,recordInfo:x})=>{const[Y,te]=(0,k.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Se,Ie]=(0,k.useState)(""),[Ge,Ee]=(0,k.useState)(),ze=window.ENV==="build"?"/react/build":"",He=location.host.startsWith("localhost")?y.Z.PROXY_SERVER:y.Z.API_SERVER,lt=10*(1024*1024),At=(0,k.useRef)();U!=null&&U.startsWith("/api")&&q!=="txt"&&(U=y.Z.API_SERVER+U);const nt=he=>he.substring(he.lastIndexOf("/")+1).split(".").pop();V&&ne&&(ne.filename=V),(0,k.useEffect)(()=>{var he,Oe;const We=(Oe=(he=document.cookie)==null?void 0:he.replace(/\s/g,""))==null?void 0:Oe.split(";");We==null||We.map(qe=>{let ae=qe.split("=");ae[0]==="_educoder_session"&&Ie(ae[1])})},[]),(0,k.useEffect)(()=>{q==="office"&&(U.indexOf("bigfilescdn.")>-1||U.indexOf("bigfiles1")>-1?Ee({url:U,fileType:nt(U),model:U.indexOf("model=edit")?"edit":"view"}):Nt())},[q,U]);function Bt(he){return C(this,null,function*(){he.data.type==="pdfdata"&&($(he.data.data),window.removeEventListener("message",Bt,!1)),console.log("mess---:",he.data)})}const Nt=()=>C(void 0,null,function*(){console.log("data:",U);let he=U;U.startsWith("http")||(he=location.origin+he);let Oe=new URL(he).pathname.split("/").pop();const We=yield(0,m.gJ)({attachment_id:Oe});We.url=He+We.url,Ee(We)}),Le=()=>{if(U.startsWith("http")||U.startsWith("blob:")){Re();return}(0,O.Sv)(V||"educoder",U,V)},Re=()=>{x&&(0,f.fc)({id:x==null?void 0:x.id,watch_type:1,course_id:x==null?void 0:x.course_id}),(0,O.Nd)(V||"educoder",decodeURIComponent(U))};return c.createElement("div",{style:L({},J||{}),className:`${B&&I.bgBlack} ${q?I.wrp:"hide"}`},z&&c.createElement("div",{className:I.close,ref:At},!!W&&c.createElement(_.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>At.current},c.createElement("span",{onClick:()=>{X(),W()}},c.createElement("i",{className:"icon-yulanpizhu"}))),!G&&c.createElement(_.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>At.current},c.createElement("span",{onClick:Re},c.createElement("i",{className:"icon-quxiaozhiding"}))),N&&c.createElement(_.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>At.current},c.createElement("span",{className:"",onClick:()=>{const he=document.getElementById("pdfiframe");window.addEventListener("message",Bt,!1),setTimeout(()=>{he.contentWindow.postMessage("getData","*")},300)}},c.createElement("i",{className:"icon-baocun"}))),c.createElement(_.Z,{title:"\u5173\u95ED",getPopupContainer:()=>At.current},c.createElement("span",{className:"",onClick:()=>{X()}},c.createElement("i",{className:"icon-guanbi1"})))),c.createElement("div",{className:`${I[oe]} ${oe} ${I.monaco} ${q==="txt"?"show":"hide"}`},q==="txt"&&c.createElement(c.Fragment,null,c.createElement(w.ZP,L({},ne)))),q==="audio"&&c.createElement("audio",{src:`${(U==null?void 0:U.indexOf("http://"))>-1||(U==null?void 0:U.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${U}`,autoPlay:!0}),q==="video"&&c.createElement(c.Fragment,null,(U==null?void 0:U.indexOf("http"))>-1?c.createElement("video",{controls:!0,src:`${U}`,autoPlay:!0}):c.createElement("video",{controls:!0,src:`data:video/mp4;base64,${U}`,autoPlay:!0})),q==="office"&&Ge&&c.createElement("iframe",{src:`${ze}/office.html?key=${Ge.key}&url=${btoa(Ge.url)}&callbackUrl=${He+(Ge.callbackUrl||"")}&fileType=${Ge.fileType}&title=${Ge.title||""}&model=${P}&officeServer=${y.Z.ONLYOFFICE}&disabledDownload=${!!G}`}),q==="html"&&c.createElement("iframe",{src:U+"&disposition=inline"}),q==="pdf"&&c.createElement("iframe",{id:"pdfiframe",src:`${ze}/js/pdfview/index.html?filename=${V||"educoder.pdf"}&url=${encodeURIComponent(U)}&disabledDownload=${!!G}&model=${P}`}),q==="image"&&c.createElement("img",{src:`${(U==null?void 0:U.indexOf("http://"))>-1||(U==null?void 0:U.indexOf("https://"))>-1?"":"data:image/png;base64,"}${U}`}),(q==="other"||q==="download")&&c.createElement(c.Fragment,null,R?c.createElement(n.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:c.createElement(K.ZP,{icon:c.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Le,disabled:G},"\u4E0B\u8F7D")}):c.createElement(K.ZP,{type:"primary",size:"middle",onClick:Le,disabled:G},c.createElement(T.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},76902:function(dt,me,b){"use strict";b.d(me,{z:function(){return F},Z:function(){return q}});var k=b(59301),I=b(8944),K=b(81428),T=b(64018),w=b(15360),_=b(346),O=b(51257),m=b(15342),n=b(1012),y=b(45677),f=b(59301),l=({html:V})=>{const ne=(0,k.useRef)(null),oe=(0,k.useRef)(null),J=`.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,k.useEffect)(()=>{const z=ne.current.attachShadow({mode:"open"});oe.current=document.createElement("div"),oe.current.className="markdown-body",oe.current.innerHTML=V,z.appendChild(oe.current);const X=document.createElement("style");return X.textContent=J,z.appendChild(X),()=>{z.innerHTML=""}},[]),(0,k.useEffect)(()=>{oe.current&&(oe.current.innerHTML=V)},[V]),f.createElement("div",{ref:ne})};function u(V){const ne=["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"],oe=new RegExp(`\\b(${ne.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return V.replace(oe,"").trim()}var p=Object.defineProperty,E=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,C=(V,ne,oe)=>ne in V?p(V,ne,{enumerable:!0,configurable:!0,writable:!0,value:oe}):V[ne]=oe,A=(V,ne)=>{for(var oe in ne||(ne={}))D.call(ne,oe)&&C(V,oe,ne[oe]);if(E)for(var oe of E(ne))L.call(ne,oe)&&C(V,oe,ne[oe]);return V};const P="@\u2581\u2581@",U="@\u2581@",N=/<pre[^>]*>/g;function $(V){let ne=document.createElement("div");return ne.innerHTML=V,ne.childNodes.length===0?"":ne.childNodes[0].nodeValue}const F=(V,ne)=>{V=V||"";const oe=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,J=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,z=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,X=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return ne?V.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(oe,(B,G,W,R,x,Y,te)=>{const Se=G||R||Y,Ie=W||x||te||"?";return _.Z.API_SERVER+"/api/attachments/"+Se+Ie+"&t="+(0,O.Jn)(Se,Date.now())+(B.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(V=V.replace(X,(B,G,W,R,x,Y,te)=>{const Se=G||R||Y,Ie=W||x||te||"?";return _.Z.API_SERVER+"/attachments/download/"+Se+Ie+"&t="+(0,O.Jn)(Se,Date.now())+(B.indexOf(")")>-1?")":"&")}).replace(oe,(B,G,W,R,x,Y,te)=>{const Se=G||R||Y,Ie=W||x||te||"?";return _.Z.API_SERVER+"/api/attachments/"+Se+Ie+"&t="+(0,O.Jn)(Se,Date.now())+(B.indexOf(")")>-1?")":"&")}).replace(J,(B,G,W,R,x)=>{const Y=G||R,te=W||x||"";return'"'+_.Z.API_SERVER+"/api/attachments/"+Y+te+Y+te+"&t="+(0,O.Jn)(Y,Date.now())}).replace(z,(B,G,W,R,x)=>{const Y=G||R,te=W||x||"";return"("+_.Z.API_SERVER+"/files/uploads/"+Y+te+Y+te+"&t="+(0,O.Jn)(Y,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,`
|
|
|
`),V)};var q=({value:V="",className:ne,showTextOnly:oe,showLines:J,style:z={},stylesPrev:X={},highlightKeywords:B,showProgramFill:G,isProgramFill:W,disabledFill:R=!1,programFillValue:x,onFillChange:Y=Ie=>{},onFillBlur:te=()=>{},onFillFocus:Se=()=>{}})=>{let Ie=u(String(V||""));const[Ge,Ee]=(0,k.useState)(""),[ze,He]=(0,k.useState)("office"),[Be,lt]=(0,k.useState)([]),At=(0,k.useRef)("a"+(0,n.Z)()),nt={},Bt=de=>/<style[\s\S]*?>/i.test(de||""),Nt=(de,Ce,Fe)=>{const Te=document.createElement(de===U?"input":"textarea");Te.style.width="100%",Te.style.height=de===U?"40px":"151px",Te.rows=5,Te.spellcheck=!1,Te.name="edu-program-fill",Te.placeholder="\u8BF7\u8F93\u5165",Te.dataset.id=Ce;const Ne=Object.keys(nt).length;return nt[Ne]=Te,`<span class="edu-program-fill-wrap ${de===U?"":"show"}" style="width:${de===U?"400px":"100%"}" title=${Fe||""}><span>${Te.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Le(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 Re=de=>!oe&&Bt(Ie)?de:de.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Ce,Fe){let Te=Fe.replace(/(\n|\r)/g,"").split("}"),Ne=[];return Te.map(Me=>{Me!=""&&Ne.push(`.${At.current} ${Me}`)}),`<style>${Ne.join("}")}</style>`}),he=(0,k.useMemo)(()=>{try{const Te=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Ne=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Me=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,je=/\(\/attachments\/download\//g;Ie=Ie.replace(je,"("+_.Z.API_SERVER+"/attachments/download/").replace(Te,"("+_.Z.API_SERVER+"/api/attachments/").replace(Ne,'"'+_.Z.API_SERVER+"/api/attachments/").replace(Me,'"'+_.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(Te){}if(G){let Te=-1;return Ie=Ie.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(Ne,Me,je){var tt;return++Te,Nt(Ne,Te,(tt=x==null?void 0:x[Te])==null?void 0:tt.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${Re(Ie||"")}</pre>`}let de=Re(Ie);de=(0,K.ZP)(de);const Ce=(0,K.ez)();Ie.match(/\[TOC\]/)&&(de=de.replace("<p>[TOC]</p>",(0,K.Qv)()),(0,K.Iy)()),de=de.replace(/(__special_katext_id_\d+__)/g,(Te,Ne)=>{const{type:Me,expression:je}=Ce[Ne];return(0,m.renderToString)($(je)||"",{displayMode:Me==="block",throwOnError:!1,output:"html"})}),de=de.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,K.AL)();const Fe=document.createElement("div");if(Fe.innerHTML=de,oe)return Fe.innerText;if(B){const Te=B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return ae(Fe,Te),Fe.innerHTML}return setTimeout(()=>ge(),500),Fe.innerHTML},[Ie,B]);(0,k.useEffect)(()=>{se.current&&se.current.querySelectorAll(["input","textarea"]).forEach(Ce=>{Ce.oninput=Oe,Ce.onblur=We,Ce.onfocus=qe})},[Be]),(0,k.useEffect)(()=>{var de,Ce,Fe,Te,Ne;if(x!=null&&x.length)try{const Me=se.current.querySelectorAll(".edu-program-fill-score"),je=se.current.querySelectorAll('[name="edu-program-fill"]');for(const[tt,Ze]of je.entries())Ze.value=((de=x==null?void 0:x[tt])==null?void 0:de.value)||"",((Ce=x==null?void 0:x[tt])==null?void 0:Ce.type)==="warning"?Ze.className="program-fill-warning":((Fe=x==null?void 0:x[tt])==null?void 0:Fe.type)==="success"?Ze.className="program-fill-success":Ze.className="";for(const[tt,Ze]of Me.entries())Ze.innerHTML=(Te=x==null?void 0:x[tt])!=null&&Te.score?`${(Ne=x==null?void 0:x[tt])==null?void 0:Ne.score}\u5206`:"";lt(x)}catch(Me){console.log(Me,"error")}},[x]);const Oe=de=>{Be[de.target.dataset.id]=Be[de.target.dataset.id]||{},Be[de.target.dataset.id].value=de.target.value,lt([...Be]),Y(Be,de.target.dataset.id)},We=de=>{Be[de.target.dataset.id]=Be[de.target.dataset.id]||{},Be[de.target.dataset.id].value=de.target.value,lt([...Be]),te(Be,de.target.dataset.id)},qe=de=>{Be[de.target.dataset.id]=Be[de.target.dataset.id]||{},Be[de.target.dataset.id].value=de.target.value,lt([...Be]),Se(Be,de.target.dataset.id)};function ae(de,Ce){return de.childNodes.forEach(Fe=>{var Te;if(Fe.childNodes.length>0)ae(Fe,Ce);else if(Fe.nodeName!=="IMG")if(Fe.innerHTML)Fe.innerHTML=(Te=Fe.innerHTML)==null?void 0:Te.replace(new RegExp(Ce,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const Ne=document.createElement("span");Ne.innerHTML=Fe.textContent.replace(new RegExp(Ce,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),Fe.replaceWith(Ne)}})}const se=(0,k.useRef)();K.jb.WebkitLineClamp=J,J&&(z=A(A({},z),K.jb));function pe(de){let Ce=de.target;if(Ce.tagName.toUpperCase()==="A"){let Fe=Ce.getAttribute("href");if(Fe.indexOf("office")>-1)de.preventDefault(),Ee(Fe),He("office");else if(Fe.indexOf("application/pdf")>-1)de.preventDefault(),Ee(Fe),He("pdf");else if(Fe.indexOf("text/html")>-1)de.preventDefault(),Ee(Fe),He("html");else if(Fe.startsWith("#")){de.preventDefault();let Te=document.getElementById(Fe.replace("#",""));Te&&Te.scrollIntoView(!0)}}}const ge=()=>{var de;const Ce=(de=se.current)==null?void 0:de.querySelectorAll("video");Ce==null||Ce.forEach(Fe=>{if(Fe.oncontextmenu=()=>!1,Fe.src.indexOf(".m3u8")>-1&&!Fe.canPlayType("application/vnd.apple.mpegurl")){if(w.ZP.isSupported()){var Te=new w.ZP;Te.loadSource(Fe.src),Te.attachMedia(Fe)}}})};return(0,k.useEffect)(()=>{if(se.current&&he&&he.match(N)&&window.PR.prettyPrint(),se.current)return se.current.addEventListener("click",pe),()=>{var de;(de=se.current)==null||de.removeEventListener("click",pe),(0,K.AL)(),(0,K.Iy)()}},[he,se.current,pe]),(0,k.useEffect)(()=>{var de;const Ce=Fe=>{Fe.preventDefault(),Fe.clipboardData.setData("text",window.getSelection().toString())};return(de=se.current)==null||de.addEventListener("copy",Ce),()=>{var Fe;(Fe=se.current)==null||Fe.removeEventListener("copy",Ce)}},[se.current]),k.createElement(k.Fragment,null,oe&&k.createElement("div",{ref:se},he),!oe&&!Bt(he)&&k.createElement("div",{ref:se,style:A({},z),className:`${ne||""} ${R?"disabled-fill":""} markdown-body ${At.current}`,dangerouslySetInnerHTML:{__html:he}}),!oe&&Bt(he)&&k.createElement(l,{html:he}),k.createElement(y.Z,{close:!0,data:Ge,type:Ge!=null&&Ge.length?ze:"",style:A({},X),onClose:()=>Ee("")}))}},86074:function(dt,me,b){"use strict";b.d(me,{Z:function(){return T}});var k=b(25690),I={ldsRing:"ldsRing___mpBZC",idsRingWrapper:"idsRingWrapper___Of9_n",ldsring:"ldsring___o0w2t"},K=b(59301),T=({message:w,className:_,children:O,style:m={}})=>K.createElement("div",{className:`custom-spinner ${I.idsRingWrapper} ${_}`},K.createElement("div",{className:I.ldsRing},K.createElement("div",null),K.createElement("div",null),K.createElement("div",null),K.createElement("div",null)),w?K.createElement("p",{style:m},w):null,O,K.createElement(k.Outlet,null))},94268:function(dt,me,b){"use strict";b.d(me,{Z:function(){return _}});var k=b(59301),I={flex_box_center:"flex_box_center___Gc4dd",flex_space_between:"flex_space_between___K2f1v",flex_box_vertical_center:"flex_box_vertical_center___pupRp",flex_box_center_end:"flex_box_center_end___UDLRC",flex_box_column:"flex_box_column___a5uDo",result:"result___gu5zt",title:"title___xrnx2",left:"left___IAxp9",leftNode:"leftNode___HL8fG",right:"right___ZXYmw",rightNode:"rightNode___jYL5_"},K=b(92310),T=b.n(K),_=({className:O,style:m={},leftNode:n,leftTitle:y="\u81EA\u6D4B\u8F93\u5165",rightNode:f,rightTitle:c="\u8FD0\u884C\u7ED3\u679C"})=>k.createElement("div",{className:T()(I.result,O),style:m},k.createElement("div",{className:I.left},k.createElement("div",{className:I.title},k.createElement("i",{style:{color:"#08CF76"},className:"iconfont iconfont icon-zidingyiceshiyongli font14 mr5"}),k.createElement("span",null,y)),k.createElement("div",{className:I.leftNode},n)),k.createElement("div",{className:I.right},k.createElement("div",{className:I.title},k.createElement("i",{style:{color:"#00DFFF"},className:"iconfont iconfont icon-daimazhihangjieguo font14 mr5"}),k.createElement("span",null,c)),k.createElement("div",{className:I.rightNode},f)))},75975:function(dt,me,b){"use strict";b.d(me,{SV:function(){return ae},ZP:function(){return qe}});var k=b(59301),I=b(76374);const K={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"]},T={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(`
|
|
|
`)}]},_={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(`
|
|
|
`)}]},O={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 m=b(53184),n=b.n(m),y=Object.defineProperty,f=Object.defineProperties,c=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,E=(se,pe,ge)=>pe in se?y(se,pe,{enumerable:!0,configurable:!0,writable:!0,value:ge}):se[pe]=ge,D=(se,pe)=>{for(var ge in pe||(pe={}))u.call(pe,ge)&&E(se,ge,pe[ge]);if(l)for(var ge of l(pe))p.call(pe,ge)&&E(se,ge,pe[ge]);return se},L=(se,pe)=>f(se,c(pe)),C=(se,pe,ge)=>new Promise((de,Ce)=>{var Fe=Me=>{try{Ne(ge.next(Me))}catch(je){Ce(je)}},Te=Me=>{try{Ne(ge.throw(Me))}catch(je){Ce(je)}},Ne=Me=>Me.done?de(Me.value):Promise.resolve(Me.value).then(Fe,Te);Ne((ge=ge.apply(se,pe)).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"]}},P=(se,pe)=>pe.map(ge=>({label:ge,kind:se.languages.CompletionItemKind.Keyword,insertText:ge})),U=se=>Object.keys(A.tables).map(pe=>({label:pe,kind:se.languages.CompletionItemKind.Variable,insertText:pe})),N=(se,pe)=>{const ge=A.tables[se];return ge?ge.map(de=>({label:de,kind:pe.languages.CompletionItemKind.Field,insertText:de})):[]};function $(se,pe,ge,de,Ce){let Fe=pe.getWordUntilPosition(ge),Te={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:Fe.startColumn,endColumn:Fe.endColumn},Ne=de.map(Me=>({label:Me,kind:se.languages.CompletionItemKind.Keyword,insertText:Me,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}));return Ce.map(Me=>{Ne.push(L(D({},Me),{range:Te}))}),Ne}var F=se=>{A.languages.map(Ce=>(se.languages.registerDocumentFormattingEditProvider(Ce,{provideDocumentFormattingEdits(Fe,Te,Ne){return C(this,null,function*(){const Me=n()(Fe.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:Fe.getFullModelRange(),text:Me}]})}}),Ce));const pe=w.quickKey.map(Ce=>({label:Ce.label,kind:se.languages.CompletionItemKind.Method,insertText:Ce.content,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet})),ge=_.quickKey.map(Ce=>({label:Ce.label,kind:se.languages.CompletionItemKind.Method,insertText:Ce.content,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet})),de=T.quickKey.map(Ce=>({label:Ce.label,kind:se.languages.CompletionItemKind.Method,insertText:Ce.content,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet}));se.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ce,Fe){var Te=Ce.getWordUntilPosition(Fe),Ne={startLineNumber:Fe.lineNumber,endLineNumber:Fe.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Me=Ce.getLineContent(Fe.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[...w.keywords.map(je=>({label:je,kind:se.languages.CompletionItemKind.Function,documentation:je,insertText:je,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ne})),...w.quickKey.map(je=>({label:je.label,kind:se.languages.CompletionItemKind.Function,documentation:je.content,insertText:Me.startsWith("#")?je.content.replace(/#/,""):je.content,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ne}))]}}}),se.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Ce,Fe){var Te=Ce.getWordUntilPosition(Fe),Ne={startLineNumber:Fe.lineNumber,endLineNumber:Fe.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn};return{suggestions:[...K.keywords.map(Me=>({label:Me,kind:se.languages.CompletionItemKind.Function,documentation:Me,insertText:Me,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ne}))]}}}),se.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ce,Fe){var Te=Ce.getWordUntilPosition(Fe),Ne={startLineNumber:Fe.lineNumber,endLineNumber:Fe.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Me=Ce.getLineContent(Fe.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[...T.keywords.map(je=>({label:je,kind:se.languages.CompletionItemKind.Function,documentation:je,insertText:je,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ne})),...T.quickKey.map(je=>({label:je.label,kind:se.languages.CompletionItemKind.Function,documentation:je.content,insertText:Me.startsWith("#")?je.content.replace(/#/,""):je.content,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ne}))]}}}),se.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(Ce,Fe){var Te=Ce.getWordUntilPosition(Fe),Ne={startLineNumber:Fe.lineNumber,endLineNumber:Fe.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Me=Ce.getLineContent(Fe.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[...O.keywords.map(je=>({label:je,kind:se.languages.CompletionItemKind.Function,documentation:je,insertText:je,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ne})),...O.quickKey.map(je=>({label:je.label,kind:se.languages.CompletionItemKind.Function,documentation:je.content,insertText:Me.startsWith("#")?je.content.replace(/#/,""):je.content,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ne}))]}}}),se.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ce,Fe){var Te=Ce.getWordUntilPosition(Fe),Ne={startLineNumber:Fe.lineNumber,endLineNumber:Fe.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Me=Ce.getLineContent(Fe.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[..._.keywords.map(je=>({label:je,kind:se.languages.CompletionItemKind.Function,documentation:je,insertText:je,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ne})),..._.quickKey.map(je=>({label:je.label,kind:se.languages.CompletionItemKind.Function,documentation:je.content,insertText:Me.startsWith("#")?je.content.replace(/#/,""):je.content,insertTextRules:se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ne}))]}}})};const q="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var V=Object.defineProperty,ne=(se,pe,ge)=>pe in se?V(se,pe,{enumerable:!0,configurable:!0,writable:!0,value:ge}):se[pe]=ge,oe=(se,pe,ge)=>ne(se,typeof pe!="symbol"?pe+"":pe,ge);const J=class Bo{constructor(pe,ge,de){this.placeholder=pe,this.editor=ge,this.monaco=de,ge.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Bo.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)}};oe(J,"ID","editor.widget.placeholderHint");var X=J,B=b(96236),G=b(6767),W=b(25399),R=b(89392),x=b(49535),Y=b(56102),te=Object.defineProperty,Se=Object.defineProperties,Ie=Object.getOwnPropertyDescriptors,Ge=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable,He=(se,pe,ge)=>pe in se?te(se,pe,{enumerable:!0,configurable:!0,writable:!0,value:ge}):se[pe]=ge,Be=(se,pe)=>{for(var ge in pe||(pe={}))Ee.call(pe,ge)&&He(se,ge,pe[ge]);if(Ge)for(var ge of Ge(pe))ze.call(pe,ge)&&He(se,ge,pe[ge]);return se},lt=(se,pe)=>Se(se,Ie(pe)),At=(se,pe)=>{var ge={};for(var de in se)Ee.call(se,de)&&pe.indexOf(de)<0&&(ge[de]=se[de]);if(se!=null&&Ge)for(var de of Ge(se))pe.indexOf(de)<0&&ze.call(se,de)&&(ge[de]=se[de]);return ge},nt=(se,pe,ge)=>new Promise((de,Ce)=>{var Fe=Me=>{try{Ne(ge.next(Me))}catch(je){Ce(je)}},Te=Me=>{try{Ne(ge.throw(Me))}catch(je){Ce(je)}},Ne=Me=>Me.done?de(Me.value):Promise.resolve(Me.value).then(Fe,Te);Ne((ge=ge.apply(se,pe)).next())});function Bt(se){return/^\d+$/.test(se)?`${se}px`:se}function Nt(){}let Le=!1;const Re={"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 he(se=[]){let pe=se;if(Array.isArray(se)){for(let ge=0;ge<se.length;ge++){let de=Re[se[ge]];if(de)return de}return pe[0]}return Re[pe]||pe}let Oe=null;const We=()=>nt(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(se){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",se)}});var qe=se=>{var pe=se,{width:ge="100%",height:de="100%",value:Ce,language:Fe="javascript",style:Te={},options:Ne={},overrideServices:Me={},theme:je="vs-dark",onEditBlur:tt,isCopy:Ze=!1,onSave:it,autoHeight:ht=!1,forbidCopy:st=!1,onChange:Qe=Nt,editorDidMount:mt=Nt,onFocus:Dt=Nt,onBreakPoint:Mt=Nt,breakPointValue:kt=[],filename:jt="educoder.txt",errorLine:Je,errorContent:Ct="",highlightLine:xe,openBreakPoint:ve=!1,placeholder:ye="",showMiniMap:ee=!0}=pe,ie=At(pe,["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 ue=(0,k.useRef)(),ce=(0,k.useRef)({}),_e=(0,k.useRef)(),Ve=(0,k.useRef)(),Ye=(0,k.useRef)([]),at=(0,k.useRef)(!1),ft=(0,k.useRef)(),Lt=(0,k.useRef)(),Kt=(0,k.useRef)(!1),[Et,xt]=(0,k.useState)(!1);function ui(){let pt;return ue.current&&(pt=new I.Z(ot=>{for(let yt of ot)(yt.target.offsetHeight>0||yt.target.offsetWidth>0)&&ce.current.instance.layout()}),pt.observe(ue.current)),pt}function _i(){G.ZP.warning({content:decodeURIComponent(q),key:"monaco-editor-tip"})}const ci=()=>{let pt=ce.current.instance;if(Ce!=null&&pt&&Et){const ot=pt.getModel();ot&&Ce!==ot.getValue()&&(Le=!0,ot.setValue(Ce),pt.layout(),Le=!1)}};(0,k.useEffect)(()=>{const pt=x.Z.subscribe("formatDocument",ot=>{var yt;let zt=ce.current.instance;(yt=zt==null?void 0:zt.getAction)==null||yt.call(zt,"editor.action.formatDocument").run()});return window.updateMonacoValue=ot=>{Qe(ot)},pt},[]),(0,k.useEffect)(()=>{var pt;let ot=ce.current.instance;Ve.current&&clearTimeout(Ve.current),Ve.current=setTimeout(()=>{ci()},500),Ce&&(Ce!=null&&Ce.length)&&((pt=ot==null?void 0:ot.updateOptions)==null||pt.call(ot,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Ce.split(/\r\n|\r|\n/g).length))+3,5)}))},[Ce,Et,ce.current]),(0,k.useEffect)(()=>{if(Je&&ce.current&&ce.current.instance){let ot=ce.current.instance;ot.changeViewZones(function(yt){var zt=document.createElement("div");zt.style.padding="10px 20px",zt.style.width="calc(100% - 20px)",zt.className="my-error-line-wrp",zt.innerHTML=Ct,yt.addZone({afterLineNumber:Je||11,heightInLines:3,domNode:zt})});var pt={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}};ot.addOverlayWidget(pt),ot.revealPositionInCenter({lineNumber:20,column:1})}},[Je,ce.current,Et]);const ii=(pt="",ot)=>{if(!pt||pt.trim()==="")return!0;const zt=ce.current.instance.getModel().getLineTokens(ot);let Wt=!1;for(let Ti=0;Ti<2;Ti++)zt.getStandardTokenType(Ti)===1&&(Wt=!0);return Wt};(0,k.useEffect)(()=>{var pt;const ot=(pt=ce.current)==null?void 0:pt.instance;if(ot&&Et&&st){const yt=ot.onDidBlurEditorWidget(()=>{Kt.current=!1}),zt=ot.onDidFocusEditorText(()=>{Kt.current=!0});return()=>{yt.dispose(),zt.dispose()}}},[ce.current,Et,st]),(0,k.useEffect)(()=>{var pt;if((pt=ce.current)!=null&&pt.instance&&Et&&ve){let ot=ce.current.instance,yt=ot.getModel();if(!yt)return;(()=>{var Yt;let Gt=[],Jt=[];const bi=yt.getAllDecorations();for(let ni of bi)ni.options.className==="highlighted-line"&&(Gt.push((Yt=ni==null?void 0:ni.range)==null?void 0:Yt.startLineNumber),Jt.push(ni==null?void 0:ni.id));if(xe===Gt[0])return;yt.deltaDecorations(Jt,[]);const Ei=yt.getLineCount();xe&&xe<=Ei&&(ot.deltaDecorations([],[{range:new Oe.Range(xe,1,xe,yt.getLineMaxColumn(xe)),options:{isWholeLine:!0,className:"highlighted-line"}}]),ot.revealLineInCenter(xe))})();const Wt=(Yt=!1)=>{var Gt;let Jt=[],bi=[];const Ei=yt.getAllDecorations();for(let ni of Ei)ni.options.linesDecorationsClassName==="breakpoints-select"&&(Jt.push((Gt=ni==null?void 0:ni.range)==null?void 0:Gt.startLineNumber),bi.push(ni==null?void 0:ni.id));if(Yt)return{lines:Jt,ids:bi};Mt(Jt)},Ti=Yt=>nt(void 0,null,function*(){let Gt={range:new Oe.Range(Yt,1,Yt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield yt.deltaDecorations([],[Gt]),Wt()}),Yi=Yt=>nt(void 0,null,function*(){let Gt=[];const Jt=ot.getLineDecorations(Yt);for(let bi of Jt)bi.options.linesDecorationsClassName==="breakpoints-select"&&Gt.push(bi.id);yield yt.deltaDecorations(Gt,[]),Wt()}),xi=Yt=>{let Gt=ot.getLineDecorations(Yt);for(let Jt of Gt)if(Jt.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,R.isEqual)(kt,Wt(!0).lines)){yt.deltaDecorations(Wt(!0).ids,[]);const Yt=kt.map(Gt=>({range:new Oe.Range(Gt,1,Gt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));yt.deltaDecorations([],Yt)}const Qt=ot.onDidChangeModelContent(Yt=>{let Gt=ot.getPosition();if(Gt){let Jt=Gt.lineNumber;clearTimeout(Lt.current),Lt.current=setTimeout(()=>{ii(yt.getLineContent(Jt),Jt)?Yi(Jt):xi(Jt)?(Yi(Jt),Ti(Jt)):Wt()},100)}}),qt=ot.onMouseDown(Yt=>{var Gt,Jt,bi;if(Yt.target.detail&&((bi=(Jt=(Gt=Yt.target)==null?void 0:Gt.element)==null?void 0:Jt.className)!=null&&bi.includes("line-numbers"))){let Ei=Yt.target.position.lineNumber;if(ii(yt.getLineContent(Ei),Ei))return;xi(Ei)?Yi(Ei):Ti(Ei)}}),vi=Yt=>{let Gt={range:new Oe.Range(Yt,1,Yt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Ye.current=ot.deltaDecorations(Ye.current,[Gt])},Bi=()=>{Ye.current=ot.deltaDecorations(Ye.current,[])},si=ot.onMouseMove(Yt=>{var Gt,Jt,bi;if(Bi(),Yt.target.detail&&((bi=(Jt=(Gt=Yt.target)==null?void 0:Gt.element)==null?void 0:Jt.className)!=null&&bi.includes("line-numbers"))){let Ei=Yt.target.position.lineNumber;if(ii(yt.getLineContent(Ei),Ei))return;vi(Ei)}}),Ki=ot.onMouseLeave(()=>{Bi()});return()=>{Qt.dispose(),qt.dispose(),si.dispose(),Ki.dispose()}}},[ce.current,Et,kt,xe,ve,Fe]),(0,k.useEffect)(()=>{var pt;(pt=ce.current)!=null&&pt.instance&&ve&&ce.current.instance.setPosition({lineNumber:0,column:0})},[xe]);function Ut(){let pt=ce.current.instance;if(pt){const ot=pt.getSelection(),yt=ce.current.pastePos||{},zt=new Oe.Range(yt.startLineNumber||ot.endLineNumber,yt.startColumn||ot.endColumn,yt.endLineNumber||ot.endLineNumber,yt.endColumn||ot.endColumn);setTimeout(()=>{pt.executeEdits("",[{range:zt,text:""}])},300)}}function St(pt){(window.navigator.platform.match("Mac")?pt.metaKey:pt.ctrlKey)&&pt.keyCode==83&&(pt.preventDefault(),it())}const Ot=()=>{if(ht&&ce.current.instance){const pt=ce.current.instance.getContentHeight();br(pt<de?de:pt)}else br(de)};function Xt(pt){var ot=document.createEvent("MouseEvents");ot.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),pt.dispatchEvent(ot)}const gi=pt=>{if(!Kt.current)return;const{keyCode:ot,ctrlKey:yt,metaKey:zt,target:Wt,type:Ti}=pt;return(Ti==="paste"||(ot===67||ot===86)&&(zt||yt))&&Wt.nodeName==="TEXTAREA"&&(_i(),pt.preventDefault()),!1};function mi(pt,ot){var yt=window.URL||window.webkitURL||window,zt=new Blob([ot]),Wt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Wt.href=yt.createObjectURL(zt),Wt.download=pt,Xt(Wt)}(0,k.useEffect)(()=>{Ot()},[Ot]),(0,k.useEffect)(()=>{ue.current&&!Et&&Promise.all([b.e(8909),b.e(6656)]).then(b.bind(b,71448)).then(pt=>{try{Oe=pt,ce.current.instance=Oe.editor.create(ue.current,{value:Ce,language:he(Fe),theme:je,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:ee||!1}},Me);const ot=ce.current.instance;let Wt=[...B.BH._menuItems].find(Qt=>Qt[0]._debugName=="EditorContext")[1],Ti=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Yi=(Qt,qt)=>{var vi,Bi;let si=Qt._first;do qt.includes((Bi=(vi=si.element)==null?void 0:vi.command)==null?void 0:Bi.id)&&Qt._remove(si);while(si=si.next)};if(mt(ot,Oe),setTimeout(()=>{Ot(),ce.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{mi(jt||"educoder.txt",ot.getValue())}})},500),ce.current.subscription=ot.onDidChangeModelContent(Qt=>{at.current?clearTimeout(ft.current):(Ot(),Qe(ot.getValue(),Qt)),ft.current=setTimeout(()=>{at.current=!1},500)}),window.Monaco||F(Oe,he(Fe)),st&&(Yi(Wt,Ti),ue.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",gi),window.removeEventListener("paste",gi),window.addEventListener("keydown",gi),window.addEventListener("paste",gi)),window.Monaco=Oe,tt&&ot.onDidBlurEditorWidget(()=>{tt(ot.getValue())}),Dt&&ot.onDidFocusEditorText(()=>{st&&We(),Dt(ot.getValue())}),st){We();try{ot.onDidPaste(Qt=>{const qt=ot.getSelection(),vi=ce.current.pastePos||{},Bi=new Oe.Range(vi.startLineNumber||qt.endLineNumber,vi.startColumn||qt.endColumn,vi.endLineNumber||qt.endLineNumber,vi.endColumn||qt.endColumn);ot.executeEdits("",[{range:Qt.range,text:""}])})}catch(Qt){}}let xi=ui();return ye&&typeof ye=="string"&&new X(ye,ot,Oe),xt(!0),()=>{const Qt=ce.current.instance;Qt.dispose();const qt=Qt.getModel();qt&&qt.dispose(),ce.current.subscription&&ce.current.subscription.dispose(),xi.unobserve(ue.current)}}catch(ot){}})},[]),(0,k.useEffect)(()=>{if(ce.current.instance&&Et)return document.addEventListener("keydown",St,!1),()=>{document.removeEventListener("keydown",St)}},[it,Et]),(0,k.useEffect)(()=>{let pt=ce.current.instance;if(pt&&Et){let ot=he(Fe);Oe.editor.setModelLanguage(pt.getModel(),ot)}},[Fe,Et]),(0,k.useEffect)(()=>{ce.current.instance&&Et&&Oe.editor.setTheme(je)},[je,Et]),(0,k.useEffect)(()=>{let pt=ce.current.instance;_e.current=Ne,pt&&Et&&(pt.updateOptions(Be({},Ne)),setTimeout(()=>{pt.getModel().updateOptions(Be({},Ne))},200))},[JSON.stringify(Ne),Et]),(0,k.useEffect)(()=>{let pt=ce.current.instance;pt&&Et&&pt.layout()},[ge,de,Et]);const[qi,Ii]=(0,k.useState)(Bt(ge)),[Mi,br]=(0,k.useState)(Bt(de)),ri=lt(Be({},Te),{width:qi,height:Mi,position:"relative"});return k.createElement("div",{className:"my-monaco-editor",ref:ue,style:ri},Ze&&k.createElement(Y.CopyToClipboard,{text:Ce,onCopy:()=>G.ZP.success("\u590D\u5236\u6210\u529F")},k.createElement(W.Z,{title:"\u590D\u5236\u4EE3\u7801"},k.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},k.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function ae({width:se="100%",height:pe="100%",original:ge,modified:de,language:Ce,options:Fe={}}){const Te=(0,k.useRef)(),[Ne,Me]=(0,k.useState)(null);function je(ht){let st;return Te.current&&(st=new I.Z(Qe=>{for(let mt of Qe)(mt.target.offsetHeight>0||mt.target.offsetWidth>0)&&ht.layout()}),st.observe(Te.current)),st}(0,k.useEffect)(()=>(Te.current&&Promise.all([b.e(8909),b.e(9404)]).then(b.bind(b,2550)).then(ht=>{Oe=ht;const st=Oe.editor.createDiffEditor(Te.current,lt(Be({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},Fe),{wordWrap:!0}));Me(st);let Qe=je(st);return()=>{st.dispose();const mt=st.getModel();mt&&mt.dispose(),Qe.unobserve(Te.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,k.useEffect)(()=>{Ne&&Ne.setModel({original:Oe.editor.createModel(ge,Ce),modified:Oe.editor.createModel(de,Ce)})},[ge,de,Ce,Ne]);const tt=Bt(se),Ze=Bt(pe),it={width:tt,height:Ze};return k.createElement("div",{className:"my-diff-editor",ref:Te,style:it})}},84958:function(dt,me,b){"use strict";b.r(me),b.d(me,{default:function(){return l}});var k=b(59301),I=b(42909),K=b(346),T=b(25690),w=b(29787),_=b(94881),O=b(10866),m=b(75975),n=b(24334),y=b(61186),f=b.n(y),c=(u,p,E)=>new Promise((D,L)=>{var C=U=>{try{P(E.next(U))}catch(N){L(N)}},A=U=>{try{P(E.throw(U))}catch(N){L(N)}},P=U=>U.done?D(U.value):Promise.resolve(U.value).then(C,A);P((E=E.apply(u,p)).next())}),l=()=>{const{submitId:u,id:p}=(0,T.useParams)(),[E,D]=(0,k.useState)(void 0);console.log((0,T.useLocation)(),33);const L=(0,T.useLocation)();function C(){var Y;T.history.push(`/problems/${p}/oj/${(Y=L==null?void 0:L.query)==null?void 0:Y.backId}?tab=1`)}(0,k.useEffect)(()=>((0,T.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),(0,T.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),()=>{(0,T.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),(0,T.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}),[]),(0,k.useEffect)(()=>{document.title="\u5728\u7EBF\u5237\u9898"}),(0,k.useEffect)(()=>{u&&function(){return c(this,null,function*(){const te=yield(0,_.X6)(u);D(te.data)})}()},[u]);const{status:A,created_at:P,code:U,name:N,language:$,pass_sets_count:F,set_count:q,error_msg:V,output:ne,input:oe,expected_output:J,execute_memory:z,user:X,execute_time:B,input_file_url:G,output_file_url:W,is_file:R,expected_output_file_url:x}=E||{};return k.createElement(w.Z,{spinning:!E,delay:500},k.createElement("div",{className:"record-detail-info"},E?k.createElement(k.Fragment,null,k.createElement("header",{className:I.Z.header},k.createElement("div",null,k.createElement("img",{src:`${K.Z.IMG_SERVER}/images/${X.image_url}`,alt:"user",width:30}),k.createElement("span",null,X.name)),k.createElement("h2",null," ",N," "),k.createElement("button",{className:"ant-btn",onClick:C,style:{border:"1px solid #bacffe",color:"#3061d0"}},"\u8FD4\u56DE\u8BE5\u9898")),k.createElement("div",{className:"record-detail-body"},k.createElement("h2",null," \u63D0\u4EA4\u8BB0\u5F55 "),k.createElement("ul",{className:"record-info"},k.createElement("li",null," \u72B6\u6001\uFF1A",k.createElement("span",{className:A===0?"c-green":"c-red"},O.Im[A])," "),k.createElement("li",null," \u63D0\u4EA4\u65F6\u95F4\uFF1A",k.createElement("span",null,f()(P).format("YYYY-MM-DD HH:mm:ss"))," "),k.createElement("li",null," \u8BED\u8A00\uFF1A",k.createElement("span",null,$)," "),k.createElement("li",null," \u6267\u884C\u7528\u65F6\uFF1A",k.createElement("span",null,B*1e3,"ms")," "),k.createElement("li",null," ",`${F} / ${q} \u4E2A\u901A\u8FC7\u7684\u6D4B\u8BD5\u7528\u4F8B`," ")),(0,O.gZ)({status:A,error_msg:V,execute_time:B,output:ne,input:oe,expected_output:J,input_file_url:G,output_file_url:W,is_file:R,expected_output_file_url:x}),k.createElement("h2",null," \u63D0\u4EA4\u7684\u5185\u5BB9 "),k.createElement(m.ZP,{height:"200px",width:"100%",language:$==null?void 0:$.toLocaleLowerCase(),value:n.Base64.decode(U),options:{readOnly:!0}}))):null))}},10866:function(dt,me,b){"use strict";b.d(me,{Im:function(){return V},ZP:function(){return B},gZ:function(){return z}});var k=b(59301),I=b(37568),K=b(99571),T=b(84105),w=b(87395),_=b(24363),O=b(24334),m=b(86074),n=b(76902),y=b(51257),f=b(94268),c=b(34376),l=b(92310),u=b.n(l),p=b(59301),E=Object.defineProperty,D=Object.defineProperties,L=Object.getOwnPropertyDescriptors,C=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,U=(G,W,R)=>W in G?E(G,W,{enumerable:!0,configurable:!0,writable:!0,value:R}):G[W]=R,N=(G,W)=>{for(var R in W||(W={}))A.call(W,R)&&U(G,R,W[R]);if(C)for(var R of C(W))P.call(W,R)&&U(G,R,W[R]);return G},$=(G,W)=>D(G,L(W));const{TextArea:F}=I.default,q={visible:!1,tabIndex:"0"},V={[_.h.HIDE_COMPILE_STATUS]:"\u6682\u4E0D\u652F\u6301\u67E5\u770B",[_.h.NOMATCH]:"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D",[_.h.OK]:"\u8C03\u8BD5\u901A\u8FC7",2:"\u8C03\u8BD5\u8D85\u65F6",3:"\u8C03\u8BD5pod\u5931\u8D25",4:"\u7F16\u8BD1\u5931\u8D25",5:"\u6267\u884C\u5931\u8D25"};var ne=(G=>(G[G.SET_VISIBLE=0]="SET_VISIBLE",G[G.SET_TABINDEX=1]="SET_TABINDEX",G))(ne||{});function oe(G,W){switch(W.type){case 0:return $(N({},G),{visible:W.payload});case 1:return $(N({},G),{tabIndex:W.payload});default:throw new Error}}function J({value:G,className:W}){const[R,x]=(0,k.useState)(!1),Y=(0,k.useRef)(),te=(0,k.useRef)();return(0,k.useEffect)(()=>{R&&(te.current.reset(),te.current.write((0,y.pp)(G||"")))},[G,R]),(0,k.useEffect)(()=>{var Se,Ie,Ge,Ee;if(Y.current){te.current=new c.Terminal({fontSize:14,disableStdin:!0}),te.current.open(Y.current);const ze=Y.current.offsetWidth-14,He=((Ee=(Ge=(Ie=(Se=te.current)==null?void 0:Se._core)==null?void 0:Ie._renderService)==null?void 0:Ge.dimensions)==null?void 0:Ee.actualCellWidth)||9.5,Be=Math.ceil(ze/He);te.current.resize(Be,8),x(!0)}},[]),p.createElement("div",{ref:Y,className:u()("XtermText-valueRef",W)})}function z(G){const{status:W,error_msg:R,output:x,input:Y,expected_output:te,is_file:Se,input_file_url:Ie,output_file_url:Ge,expected_output_file_url:Ee}=G;let ze=null;const He={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(W){case _.h.NOMATCH:ze=p.createElement(p.Fragment,null,p.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!Se&&p.createElement(J,{className:"mb10",value:Y}),Se&&p.createElement("div",{style:He},p.createElement("a",{onClick:()=>(0,y.LR)(Ie,Y)},Y)),p.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!Se&&p.createElement(J,{className:"mb10",value:x&&O.Base64.decode(x)||""}),Se&&p.createElement("div",{style:He},p.createElement("a",{onClick:()=>(0,y.LR)(Ge,x)},x)),p.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!Se&&p.createElement(J,{className:"mb10",value:te&&O.Base64.decode(te)||""}),Se&&p.createElement("div",{style:He},p.createElement("a",{onClick:()=>(0,y.LR)(Ee,te)},te)));break;case _.h.EXECUTEFAILURE:ze=p.createElement(p.Fragment,null,p.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!Se&&p.createElement(n.Z,{value:Y,style:He}),Se&&p.createElement("div",{style:He},p.createElement("a",{onClick:()=>(0,y.LR)(Ie,Y)},Y)),p.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.createElement("pre",{className:"error"},O.Base64.decode(R)));break;case _.h.COMPILEFAILURE:ze=p.createElement(p.Fragment,null,p.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!Se&&p.createElement(n.Z,{value:Y,style:He}),Se&&p.createElement("div",{style:He},p.createElement("a",{onClick:()=>(0,y.LR)(Ie,Y)},Y)),p.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.createElement("pre",{className:"error"},O.Base64.decode(R)));break;case _.h.PODFAILURE:ze=p.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case _.h.TIMEOUT:ze=p.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return p.createElement(p.Fragment,null," ",ze," ")}function X(G){const{status:W,error_msg:R,execute_time:x,output:Y,input:te,expected_output:Se,is_file:Ie,input_file_url:Ge,output_file_url:Ee,expected_output_file_url:ze}=G;let He=null;switch(W){case _.h.OK:He=p.createElement(p.Fragment,null,p.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",x,"\u79D2"),p.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),p.createElement("pre",null,O.Base64.decode(Y)));break;case _.h.NOMATCH:He=p.createElement(p.Fragment,null,p.createElement("p",null,"\u8F93\u5165\uFF1A",p.createElement("pre",null,te)),p.createElement("p",null,"\u8F93\u51FA\uFF1A",Y&&O.Base64.decode(Y)),p.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",Se&&O.Base64.decode(Se)));break;case _.h.EXECUTEFAILURE:He=p.createElement(p.Fragment,null,p.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",p.createElement("pre",null,te)),p.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.createElement("pre",{className:"error"},O.Base64.decode(R)));break;case _.h.COMPILEFAILURE:He=p.createElement(p.Fragment,null,p.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",p.createElement("pre",null,te)),p.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.createElement("pre",{className:"error"},O.Base64.decode(R)));break;case _.h.PODFAILURE:He=p.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case _.h.TIMEOUT:He=p.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return p.createElement(p.Fragment,null," ",He," ")}var B=({id:G,is_file:W,input:R,debuging:x,submitting:Y,executingMessage:te,debugResult:Se,onChangeInput:Ie,onDebugCode:Ge,onSubmitCode:Ee})=>{const[ze,He]=(0,k.useReducer)(oe,q),{visible:Be,tabIndex:lt}=ze;(0,k.useEffect)(()=>{He({type:0,payload:!1})},[G]);function At(Le){let Re=Le.target.id;He({type:1,payload:Re})}function nt(){He({type:0,payload:!Be})}const Bt=(0,k.useMemo)(()=>{if(Se){const{status:Le}=Se;return p.createElement(p.Fragment,null,X(Se))}return null},[Se]);function Nt(){He({type:0,payload:!0}),He({type:1,payload:"1"}),Ge()}return p.createElement("div",{className:"test-case-panel"},p.createElement("div",{className:`test-case-panel-body ${Be?"active":""}`},p.createElement("ul",{className:"s-navs"},p.createElement("li",null,p.createElement("a",{className:"active"},"\u8C03\u8BD5\u4EE3\u7801\u7ED3\u679C"))),p.createElement(f.Z,{leftTitle:"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B",rightTitle:"\u4EE3\u7801\u6267\u884C\u7ED3\u679C",style:{height:240},leftNode:p.createElement(F,{placeholder:"\u8BF7\u8F93\u5165\u81EA\u6D4B\u7528\u4F8B\uFF08\u5982\u679C\u672A\u586B\u5199\uFF0C\u9996\u6B21\u81EA\u6D4B\u8FD0\u884C\u65F6\uFF0C\u7CFB\u7EDF\u4F1A\u81EA\u52A8\u586B\u5145\u7B2C\u4E00\u4E2A\u975E\u9690\u85CF\u7684\u6587\u672C\u7C7B\u578B\u7684\u6D4B\u8BD5\u7528\u4F8B\uFF09",value:W?"":R,onChange:Ie}),rightNode:x?p.createElement(m.Z,{message:"\u4EE3\u7801\u6267\u884C\u4E2D..."}):Se?Bt:p.createElement("p",{style:{color:"#536879"}},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D")})),p.createElement("a",{className:`btn-collapse ${Be?"up":""}`,onClick:nt},Be?p.createElement(T.Z,null):p.createElement(w.Z,null)),p.createElement("footer",{className:"footer"},p.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),p.createElement("div",{className:"flex-container"},p.createElement(K.ZP,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),p.createElement(K.ZP,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),p.createElement(K.ZP,{className:"btn-green",type:"ghost",loading:x,onClick:Nt},"\u8C03\u8BD5\u4EE3\u7801"),p.createElement(K.ZP,{type:"primary",className:"custom-ant-disabled",loading:Y,disabled:Y,onClick:()=>{He({type:0,payload:!1}),Ee()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},24363:function(dt,me,b){"use strict";b.d(me,{h:function(){return k}});var k=(I=>(I[I.NOMATCH=-1]="NOMATCH",I[I.OK=0]="OK",I[I.TIMEOUT=2]="TIMEOUT",I[I.PODFAILURE=3]="PODFAILURE",I[I.COMPILEFAILURE=4]="COMPILEFAILURE",I[I.EXECUTEFAILURE=5]="EXECUTEFAILURE",I[I.HIDE_COMPILE_STATUS=11]="HIDE_COMPILE_STATUS",I))(k||{})},94881:function(dt,me,b){"use strict";b.d(me,{H7:function(){return n},KC:function(){return u},M3:function(){return L},MK:function(){return m},MU:function(){return T},Rg:function(){return P},WH:function(){return p},X6:function(){return _},bM:function(){return K},bx:function(){return E},dd:function(){return c},de:function(){return N},fi:function(){return y},fu:function(){return I},gu:function(){return D},n4:function(){return f},qe:function(){return A},rL:function(){return U},rX:function(){return O},uc:function(){return $},vl:function(){return l},wO:function(){return C},zO:function(){return w}});var k=b(38986);function I(F){return(0,k.U2)(`mypractices/${F}.json`,{hidePopLogin:!0})}function K(F,q){return(0,k.v_)(`mypractices/${F}/code_submit.json`,q)}function T(F,q){return(0,k.v_)(`mypractices/${F}/code_debug.json`,q)}function w(F,q){return q.language&&(q.language=encodeURIComponent(q.language)),(0,k.U2)(`mypractices/${F}/submit_records.json`,q)}function _(F){return(0,k.U2)("mypractices/record_detail.json",{id:F})}function O(F,q){return(0,k.U2)(`mypractices/${F}/result.json`,{mode:q})}function m(F,q){return(0,k.v_)(`mypractices/${F}/add_notes.json`,q)}function n(F,q){return(0,k.v_)(`mypractices/${F}/restore_initial_code.json`,q)}function y(F,q){return(0,k.v_)(`mypractices/${F}/sync_code.json`,q)}function f(F,q){return(0,k.v_)(`mypractices/${F}/update_code.json`,q)}function c(F){return(0,k.v_)(`mypractices/${F}/initial_codes.json`)}function l(F,q){return(0,k.v_)(`discusses/${F}/plus.json`,q)}function u(F){return(0,k.U2)("practices/practices_list.json",F)}function p(F,q){return(0,k.U2)(`practices/${F}/question_solution_articles`,q)}function E(F,q){return(0,k.v_)(`practices/${F}/question_solution_articles`,q)}function D(F,q){return(0,k.gz)(`practices/${F}/question_solution_articles/${q==null?void 0:q.active}`,q)}function L(F,q){return(0,k.U2)(`practices/${F}/question_solution_articles/${q==null?void 0:q.active}/edit`,q)}function C(F,q){return(0,k.U2)(`practices/${F}/question_solution_articles/${q==null?void 0:q.active}`,q)}function A(F,q){return(0,k.v_)(`practices/${F}/question_solution_articles/${q==null?void 0:q.active}/set_authority_or_excellent`,q)}function P(F,q){return(0,k.v_)(`practices/${F}/question_solution_articles/${q==null?void 0:q.active}/praise_or_treads`,q)}function U(F,q){return(0,k.v_)(`practices/${F}/question_solution_articles/${q==null?void 0:q.active}/hide`)}function N(F,q){return(0,k.IV)(`practices/${F}/question_solution_articles/${q==null?void 0:q.active}`,q)}function $(F,q){return(0,k.v_)(`mypractices/${F}/update_practice_time_sum`,q)}},81428:function(dt,me,b){"use strict";b.d(me,{AL:function(){return P},Iy:function(){return f},Qv:function(){return u},ez:function(){return A},jb:function(){return c}});var k=b(32834),I=b.n(k),K=b(11690),T=b.n(K);let w=1;function _(q,V){const ne=q.match(/^(\s+)(?:```)/);if(ne===null)return V;const oe=ne[1];return V.split(`
|
|
|
`).map(J=>{const z=J.match(/^\s+/);if(z===null)return J;const[X]=z;return X.length>=oe.length?J.slice(oe.length):J}).join(`
|
|
|
`)}let O=[],m=["<ul>"];const n=new(I()).Renderer,y=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function f(){O.length=0,m=["<ul>"]}const c={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function l(q,V,ne,oe){if(V>=q.length||q[V].level<=ne)return V;var J=q[V];oe.push("<li><a href='#"+w+J.anchor+"'>"+J.text+"</a>"),V++;var z=[];return V=l(q,V,J.level,z),z.length>0&&(oe.push("<ul>"),z.forEach(function(X){oe.push(X)}),oe.push("</ul>")),oe.push("</li>"),V=l(q,V,ne,oe),V}function u(){return l(O,0,0,m),m.push("</ul>"),m.join("")}const p={heading(q){const V=y.exec(q);if(w+=1,V)return{type:"heading",raw:V[0],depth:V[1].length,text:V[2]}},fences(q){const V=this.rules.block.fences.exec(q);if(V){const ne=V[0];let oe=_(ne,V[3]||"");const J=V[2]?V[2].trim():V[2];if(["latex","katex","math"].indexOf(J)>=0){const z=L(),X=oe;oe=z,C[z]={type:"block",expression:X}}return{type:"code",raw:ne,lang:J,text:oe}}}},E=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let D=0;const L=()=>`__special_katext_id_${D++}__`;let C={};function A(){return C}function P(){D=0,C={}}function U(q){return q=q.replace(E,(V,ne)=>{const oe=L();return C[oe]={type:"inline",expression:ne},oe}),q}const N=n.listitem;n.listitem=function(q){return N(U(q))};const $=n.paragraph;n.paragraph=function(q){return $(U(q))};const F=n.tablecell;n.tablecell=function(q,V){return F(U(q),V)},n.code=function(q,V,ne){const oe=(V||"").match(/\S*/)[0];return oe?["latex","katex","math"].indexOf(oe)>=0?`<p class='editormd-tex'>${q}</p>`:`<pre class="prettyprint linenums"><code class="language-${V}">${ne?q:(0,K.escape)(q,!0)}</code></pre>
|
|
|
`:'<pre class="prettyprint linenums"><code>'+(ne?q:(0,K.escape)(q,!0))+"</code></pre>"},n.heading=function(q,V,ne){let oe=this.options.headerPrefix+ne.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return O.push({anchor:oe,level:V,text:q}),"<h"+V+' id="'+w+oe+'">'+q+"</h"+V+">"},I().setOptions({silent:!0,gfm:!0,pedantic:!1}),I().use({tokenizer:p,renderer:n}),me.ZP=I()},64018:function(){var dt,me,b,k=!1,I,K;window.PR_SHOULD_USE_CONTINUATION=!0;var T,w;(function(){var _=window,O=["break,continue,do,else,for,if,return,while"],m=[O,"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"],n=[m,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],y=[n,"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"],f=[n,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[n,"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"],l="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",u=[n,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],p="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",E=[O,"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"],D=[O,"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"],L=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[y,c,f,u,p,E,D,L],A=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,P="str",U="kwd",N="com",$="typ",F="lit",q="pun",V="pln",ne="tag",oe="dec",J="src",z="atn",X="atv",B="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function W(Re){for(var he=0,Oe=!1,We=!1,qe=0,ae=Re.length;qe<ae;++qe){var se=Re[qe];if(se.ignoreCase)We=!0;else if(/[a-z]/i.test(se.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Oe=!0,We=!1;break}}var pe={b:8,t:9,n:10,v:11,f:12,r:13};function ge(Ne){var Me=Ne.charCodeAt(0);if(Me!==92)return Me;var je=Ne.charAt(1);return Me=pe[je],Me||("0"<=je&&je<="7"?parseInt(Ne.substring(1),8):je==="u"||je==="x"?parseInt(Ne.substring(2),16):Ne.charCodeAt(1))}function de(Ne){if(Ne<32)return(Ne<16?"\\x0":"\\x")+Ne.toString(16);var Me=String.fromCharCode(Ne);return Me==="\\"||Me==="-"||Me==="]"||Me==="^"?"\\"+Me:Me}function Ce(Ne){var Me=Ne.substring(1,Ne.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")),je=[],tt=Me[0]==="^",Ze=["["];tt&&Ze.push("^");for(var it=tt?1:0,ht=Me.length;it<ht;++it){var st=Me[it];if(/\\[bdsw]/i.test(st))Ze.push(st);else{var Qe=ge(st),mt;it+2<ht&&Me[it+1]==="-"?(mt=ge(Me[it+2]),it+=2):mt=Qe,je.push([Qe,mt]),mt<65||Qe>122||(mt<65||Qe>90||je.push([Math.max(65,Qe)|32,Math.min(mt,90)|32]),mt<97||Qe>122||je.push([Math.max(97,Qe)&-33,Math.min(mt,122)&-33]))}}je.sort(function(jt,Je){return jt[0]-Je[0]||Je[1]-jt[1]});for(var Dt=[],Mt=[],it=0;it<je.length;++it){var kt=je[it];kt[0]<=Mt[1]+1?Mt[1]=Math.max(Mt[1],kt[1]):Dt.push(Mt=kt)}for(var it=0;it<Dt.length;++it){var kt=Dt[it];Ze.push(de(kt[0])),kt[1]>kt[0]&&(kt[1]+1>kt[0]&&Ze.push("-"),Ze.push(de(kt[1])))}return Ze.push("]"),Ze.join("")}function Fe(Ne){for(var Me=Ne.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")),je=Me.length,tt=[],Ze=0,it=0;Ze<je;++Ze){var ht=Me[Ze];if(ht==="(")++it;else if(ht.charAt(0)==="\\"){var st=+ht.substring(1);st&&(st<=it?tt[st]=-1:Me[Ze]=de(st))}}for(var Ze=1;Ze<tt.length;++Ze)tt[Ze]===-1&&(tt[Ze]=++he);for(var Ze=0,it=0;Ze<je;++Ze){var ht=Me[Ze];if(ht==="(")++it,tt[it]||(Me[Ze]="(?:");else if(ht.charAt(0)==="\\"){var st=+ht.substring(1);st&&st<=it&&(Me[Ze]="\\"+tt[st])}}for(var Ze=0;Ze<je;++Ze)Me[Ze]==="^"&&Me[Ze+1]!=="^"&&(Me[Ze]="");if(Ne.ignoreCase&&Oe)for(var Ze=0;Ze<je;++Ze){var ht=Me[Ze],Qe=ht.charAt(0);ht.length>=2&&Qe==="["?Me[Ze]=Ce(ht):Qe!=="\\"&&(Me[Ze]=ht.replace(/[a-zA-Z]/g,function(Mt){var kt=Mt.charCodeAt(0);return"["+String.fromCharCode(kt&-33,kt|32)+"]"}))}return Me.join("")}for(var Te=[],qe=0,ae=Re.length;qe<ae;++qe){var se=Re[qe];if(se.global||se.multiline)throw new Error(""+se);Te.push("(?:"+Fe(se)+")")}return new RegExp(Te.join("|"),We?"gi":"g")}function R(Re,he){var Oe=/(?:^|\s)nocode(?:\s|$)/,We=[],qe=0,ae=[],se=0;function pe(ge){var de=ge.nodeType;if(de==1){if(Oe.test(ge.className))return;for(var Ce=ge.firstChild;Ce;Ce=Ce.nextSibling)pe(Ce);var Fe=ge.nodeName.toLowerCase();(Fe==="br"||Fe==="li")&&(We[se]=`
|
|
|
`,ae[se<<1]=qe++,ae[se++<<1|1]=ge)}else if(de==3||de==4){var Te=ge.nodeValue;Te.length&&(he?Te=Te.replace(/\r\n?/g,`
|
|
|
`):Te=Te.replace(/[ \t\r\n]+/g," "),We[se]=Te,ae[se<<1]=qe,qe+=Te.length,ae[se++<<1|1]=ge)}}return pe(Re),{sourceCode:We.join("").replace(/\n$/,""),spans:ae}}function x(Re,he,Oe,We,qe){if(Oe){var ae={sourceNode:Re,pre:1,langExtension:null,numberLines:null,sourceCode:Oe,spans:null,basePos:he,decorations:null};We(ae),qe.push.apply(qe,ae.decorations)}}var Y=/\S/;function te(Re){for(var he=void 0,Oe=Re.firstChild;Oe;Oe=Oe.nextSibling){var We=Oe.nodeType;he=We===1?he?Re:Oe:We===3&&Y.test(Oe.nodeValue)?Re:he}return he===Re?void 0:he}function Se(Re,he){var Oe={},We;(function(){for(var se=Re.concat(he),pe=[],ge={},de=0,Ce=se.length;de<Ce;++de){var Fe=se[de],Te=Fe[3];if(Te)for(var Ne=Te.length;--Ne>=0;)Oe[Te.charAt(Ne)]=Fe;var Me=Fe[1],je=""+Me;ge.hasOwnProperty(je)||(pe.push(Me),ge[je]=null)}pe.push(/[\0-\uffff]/),We=W(pe)})();var qe=he.length,ae=function(se){for(var pe=se.sourceCode,ge=se.basePos,de=se.sourceNode,Ce=[ge,V],Fe=0,Te=pe.match(We)||[],Ne={},Me=0,je=Te.length;Me<je;++Me){var tt=Te[Me],Ze=Ne[tt],it=void 0,ht;if(typeof Ze=="string")ht=!1;else{var st=Oe[tt.charAt(0)];if(st)it=tt.match(st[1]),Ze=st[0];else{for(var Qe=0;Qe<qe;++Qe)if(st=he[Qe],it=tt.match(st[1]),it){Ze=st[0];break}it||(Ze=V)}ht=Ze.length>=5&&Ze.substring(0,5)==="lang-",ht&&!(it&&typeof it[1]=="string")&&(ht=!1,Ze=J),ht||(Ne[tt]=Ze)}var mt=Fe;if(Fe+=tt.length,!ht)Ce.push(ge+mt,Ze);else{var Dt=it[1],Mt=tt.indexOf(Dt),kt=Mt+Dt.length;it[2]&&(kt=tt.length-it[2].length,Mt=kt-Dt.length);var jt=Ze.substring(5);x(de,ge+mt,tt.substring(0,Mt),ae,Ce),x(de,ge+mt+Mt,Dt,lt(jt,Dt),Ce),x(de,ge+mt+kt,tt.substring(kt),ae,Ce)}}se.decorations=Ce};return ae}function Ie(Re){var he=[],Oe=[];Re.tripleQuotedStrings?he.push([P,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Re.multiLineStrings?he.push([P,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):he.push([P,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Re.verbatimStrings&&Oe.push([P,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var We=Re.hashComments;We&&(Re.cStyleComments?(We>1?he.push([N,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):he.push([N,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Oe.push([P,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):he.push([N,/^#[^\r\n]*/,null,"#"])),Re.cStyleComments&&(Oe.push([N,/^\/\/[^\r\n]*/,null]),Oe.push([N,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var qe=Re.regexLiterals;if(qe){var ae=qe>1?"":`
|
|
|
\r`,se=ae?".":"[\\S\\s]",pe="/(?=[^/*"+ae+"])(?:[^/\\x5B\\x5C"+ae+"]|\\x5C"+se+"|\\x5B(?:[^\\x5C\\x5D"+ae+"]|\\x5C"+se+")*(?:\\x5D|$))+/";Oe.push(["lang-regex",RegExp("^"+G+"("+pe+")")])}var ge=Re.types;ge&&Oe.push([$,ge]);var de=(""+Re.keywords).replace(/^ | $/g,"");de.length&&Oe.push([U,new RegExp("^(?:"+de.replace(/[\s,]+/g,"|")+")\\b"),null]),he.push([V,/^\s+/,null,` \r
|
|
|
\xA0`]);var Ce="^.[^\\s\\w.$@'\"`/\\\\]*";return Re.regexLiterals&&(Ce+="(?!s*/)"),Oe.push([F,/^@[a-z_$][a-z_$@0-9]*/i,null],[$,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[V,/^[a-z_$][a-z_$@0-9]*/i,null],[F,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[V,/^\\[\s\S]?/,null],[q,new RegExp(Ce),null]),Se(he,Oe)}var Ge=Ie({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ee(Re,he,Oe){for(var We=/(?:^|\s)nocode(?:\s|$)/,qe=/\r\n?|\n/,ae=Re.ownerDocument,se=ae.createElement("li");Re.firstChild;)se.appendChild(Re.firstChild);var pe=[se];function ge(Me){var je=Me.nodeType;if(je==1&&!We.test(Me.className))if(Me.nodeName==="br")de(Me),Me.parentNode&&Me.parentNode.removeChild(Me);else for(var tt=Me.firstChild;tt;tt=tt.nextSibling)ge(tt);else if((je==3||je==4)&&Oe){var Ze=Me.nodeValue,it=Ze.match(qe);if(it){var ht=Ze.substring(0,it.index);Me.nodeValue=ht;var st=Ze.substring(it.index+it[0].length);if(st){var Qe=Me.parentNode;Qe.insertBefore(ae.createTextNode(st),Me.nextSibling)}de(Me),ht||Me.parentNode.removeChild(Me)}}}function de(Me){for(;!Me.nextSibling;)if(Me=Me.parentNode,!Me)return;function je(it,ht){var st=ht?it.cloneNode(!1):it,Qe=it.parentNode;if(Qe){var mt=je(Qe,1),Dt=it.nextSibling;mt.appendChild(st);for(var Mt=Dt;Mt;Mt=Dt)Dt=Mt.nextSibling,mt.appendChild(Mt)}return st}for(var tt=je(Me.nextSibling,0),Ze;(Ze=tt.parentNode)&&Ze.nodeType===1;)tt=Ze;pe.push(tt)}for(var Ce=0;Ce<pe.length;++Ce)ge(pe[Ce]);he===(he|0)&&pe[0].setAttribute("value",he);var Fe=ae.createElement("ol");Fe.className="linenums";for(var Te=Math.max(0,he-1|0)||0,Ce=0,Ne=pe.length;Ce<Ne;++Ce)se=pe[Ce],se.className="L"+(Ce+Te)%10,se.firstChild||se.appendChild(ae.createTextNode("\xA0")),Fe.appendChild(se);Re.appendChild(Fe)}function ze(Re){var he=/\bMSIE\s(\d+)/.exec(navigator.userAgent);he=he&&+he[1]<=8;var Oe=/\n/g,We=Re.sourceCode,qe=We.length,ae=0,se=Re.spans,pe=se.length,ge=0,de=Re.decorations,Ce=de.length,Fe=0;de[Ce]=qe;var Te,Ne;for(Ne=Te=0;Ne<Ce;)de[Ne]!==de[Ne+2]?(de[Te++]=de[Ne++],de[Te++]=de[Ne++]):Ne+=2;for(Ce=Te,Ne=Te=0;Ne<Ce;){for(var Me=de[Ne],je=de[Ne+1],tt=Ne+2;tt+2<=Ce&&de[tt+1]===je;)tt+=2;de[Te++]=Me,de[Te++]=je,Ne=tt}Ce=de.length=Te;var Ze=Re.sourceNode,it="";Ze&&(it=Ze.style.display,Ze.style.display="none");try{for(var ht=null;ge<pe;){var st=se[ge],Qe=se[ge+2]||qe,mt=de[Fe+2]||qe,tt=Math.min(Qe,mt),Dt=se[ge+1],Mt;if(Dt.nodeType!==1&&(Mt=We.substring(ae,tt))){he&&(Mt=Mt.replace(Oe,"\r")),Dt.nodeValue=Mt;var kt=Dt.ownerDocument,jt=kt.createElement("span");jt.className=de[Fe+1];var Je=Dt.parentNode;Je.replaceChild(jt,Dt),jt.appendChild(Dt),ae<Qe&&(se[ge+1]=Dt=kt.createTextNode(We.substring(tt,Qe)),Je.insertBefore(Dt,jt.nextSibling))}ae=tt,ae>=Qe&&(ge+=2),ae>=mt&&(Fe+=2)}}finally{Ze&&(Ze.style.display=it)}}var He={};function Be(Re,he){for(var Oe=he.length;--Oe>=0;){var We=he[Oe];He.hasOwnProperty(We)?_.console&&console.warn("cannot override language handler %s",We):He[We]=Re}}function lt(Re,he){return Re&&He.hasOwnProperty(Re)||(Re=/^\s*</.test(he)?"default-markup":"default-code"),He[Re]}Be(Ge,["default-code"]),Be(Se([],[[V,/^[^<?]+/],[oe,/^<!\w[^>]*(?:>|$)/],[N,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[q,/^(?:<[%?]|[%?]>)/],["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"]),Be(Se([[V,/^[\s]+/,null,` \r
|
|
|
`],[X,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ne,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[z,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[q,/^[=<>\/]+/],["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"]),Be(Se([],[[X,/^[\s\S]+/]]),["uq.val"]),Be(Ie({keywords:y,hashComments:!0,cStyleComments:!0,types:A}),["c","cc","cpp","cxx","cyc","m"]),Be(Ie({keywords:"null,true,false"}),["json"]),Be(Ie({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:A}),["cs"]),Be(Ie({keywords:f,cStyleComments:!0}),["java"]),Be(Ie({keywords:L,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Be(Ie({keywords:E,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Be(Ie({keywords:p,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Be(Ie({keywords:D,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Be(Ie({keywords:u,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Be(Ie({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Be(Se([],[[P,/^[\s\S]+/]]),["regex"]);function At(Re){var he=Re.langExtension;try{var Oe=R(Re.sourceNode,Re.pre),We=Oe.sourceCode;Re.sourceCode=We,Re.spans=Oe.spans,Re.basePos=0,lt(he,We)(Re),ze(Re)}catch(qe){_.console&&console.log(qe&&qe.stack||qe)}}function nt(Re,he,Oe){var We=Oe||!1,qe=he||null,ae=document.createElement("div");ae.innerHTML="<pre>"+Re+"</pre>",ae=ae.firstChild,We&&Ee(ae,We,!0);var se={langExtension:qe,numberLines:We,sourceNode:ae,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return At(se),ae.innerHTML}function Bt(Re,he){var Oe=he||document.body,We=Oe.ownerDocument||document;function qe(st){return Oe.getElementsByTagName(st)}for(var ae=[qe("pre"),qe("code"),qe("xmp")],se=[],pe=0;pe<ae.length;++pe)for(var ge=0,de=ae[pe].length;ge<de;++ge)se.push(ae[pe][ge]);ae=null;var Ce=Date;Ce.now||(Ce={now:function(){return+new Date}});var Fe=0,Te=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ne=/\bprettyprint\b/,Me=/\bprettyprinted\b/,je=/pre|xmp/i,tt=/^code$/i,Ze=/^(?:pre|code|xmp)$/i,it={};function ht(){for(var st=_.PR_SHOULD_USE_CONTINUATION?Ce.now()+250:1/0;Fe<se.length&&Ce.now()<st;Fe++){for(var Qe=se[Fe],mt=it,Dt=Qe;Dt=Dt.previousSibling;){var Mt=Dt.nodeType,kt=(Mt===7||Mt===8)&&Dt.nodeValue;if(kt?!/^\??prettify\b/.test(kt):Mt!==3||/\S/.test(Dt.nodeValue))break;if(kt){mt={},kt.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ye,at,ft){mt[at]=ft});break}}var jt=Qe.className;if((mt!==it||Ne.test(jt))&&!Me.test(jt)){for(var Je=!1,Ct=Qe.parentNode;Ct;Ct=Ct.parentNode){var xe=Ct.tagName;if(Ze.test(xe)&&Ct.className&&Ne.test(Ct.className)){Je=!0;break}}if(!Je){Qe.className+=" prettyprinted";var ve=mt.lang;if(!ve){ve=jt.match(Te);var ye;!ve&&(ye=te(Qe))&&tt.test(ye.tagName)&&(ve=ye.className.match(Te)),ve&&(ve=ve[1])}var ee;if(je.test(Qe.tagName))ee=1;else{var ie=Qe.currentStyle,ue=We.defaultView,ce=ie?ie.whiteSpace:ue&&ue.getComputedStyle?ue.getComputedStyle(Qe,null).getPropertyValue("white-space"):0;ee=ce&&ce.substring(0,3)==="pre"}var _e=mt.linenums;(_e=_e==="true"||+_e)||(_e=jt.match(/\blinenums\b(?::(\d+))?/),_e=_e?_e[1]&&_e[1].length?+_e[1]:!0:!1),_e&&Ee(Qe,_e,ee);var Ve={langExtension:ve,sourceNode:Qe,numberLines:_e,pre:ee,sourceCode:null,basePos:null,spans:null,decorations:null};At(Ve)}}}Fe<se.length?_.setTimeout(ht,250):typeof Re=="function"&&Re()}ht()}var Nt=_.PR={createSimpleLexer:Se,registerLangHandler:Be,sourceDecorator:Ie,PR_ATTRIB_NAME:z,PR_ATTRIB_VALUE:X,PR_COMMENT:N,PR_DECLARATION:oe,PR_KEYWORD:U,PR_LITERAL:F,PR_NOCODE:B,PR_PLAIN:V,PR_PUNCTUATION:q,PR_SOURCE:J,PR_STRING:P,PR_TAG:ne,PR_TYPE:$,prettyPrintOne:k?_.prettyPrintOne=nt:T=nt,prettyPrint:w=k?_.prettyPrint=Bt:w=Bt},Le=_.define;typeof Le=="function"&&Le.amd&&Le("google-code-prettify",[],function(){return Nt})})()},25769:function(dt,me,b){"use strict";var k=b(98040),I={"text/plain":"Text","text/html":"Url",default:"Text"},K="Copy to clipboard: #{key}, Enter";function T(_){var O=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return _.replace(/#{\s*key\s*}/g,O)}function w(_,O){var m,n,y,f,c,l,u=!1;O||(O={}),m=O.debug||!1;try{y=k(),f=document.createRange(),c=document.getSelection(),l=document.createElement("span"),l.textContent=_,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",function(E){if(E.stopPropagation(),O.format)if(E.preventDefault(),typeof E.clipboardData=="undefined"){m&&console.warn("unable to use e.clipboardData"),m&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var D=I[O.format]||I.default;window.clipboardData.setData(D,_)}else E.clipboardData.clearData(),E.clipboardData.setData(O.format,_);O.onCopy&&(E.preventDefault(),O.onCopy(E.clipboardData))}),document.body.appendChild(l),f.selectNodeContents(l),c.addRange(f);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");u=!0}catch(E){m&&console.error("unable to copy using execCommand: ",E),m&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(O.format||"text",_),O.onCopy&&O.onCopy(window.clipboardData),u=!0}catch(D){m&&console.error("unable to copy using clipboardData: ",D),m&&console.error("falling back to prompt"),n=T("message"in O?O.message:K),window.prompt(n,_)}}finally{c&&(typeof c.removeRange=="function"?c.removeRange(f):c.removeAllRanges()),l&&document.body.removeChild(l),y()}return u}dt.exports=w},24334:function(dt,me,b){var k,I;(function(K,T){dt.exports=T(K)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof b.g!="undefined"?b.g:this,function(K){"use strict";K=K||{};var T=K.Base64,w="2.6.4",_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=function(z){for(var X={},B=0,G=z.length;B<G;B++)X[z.charAt(B)]=B;return X}(_),m=String.fromCharCode,n=function(z){if(z.length<2){var X=z.charCodeAt(0);return X<128?z:X<2048?m(192|X>>>6)+m(128|X&63):m(224|X>>>12&15)+m(128|X>>>6&63)+m(128|X&63)}else{var X=65536+(z.charCodeAt(0)-55296)*1024+(z.charCodeAt(1)-56320);return m(240|X>>>18&7)+m(128|X>>>12&63)+m(128|X>>>6&63)+m(128|X&63)}},y=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(z){return z.replace(y,n)},c=function(z){var X=[0,2,1][z.length%3],B=z.charCodeAt(0)<<16|(z.length>1?z.charCodeAt(1):0)<<8|(z.length>2?z.charCodeAt(2):0),G=[_.charAt(B>>>18),_.charAt(B>>>12&63),X>=2?"=":_.charAt(B>>>6&63),X>=1?"=":_.charAt(B&63)];return G.join("")},l=K.btoa&&typeof K.btoa=="function"?function(z){return K.btoa(z)}:function(z){if(z.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return z.replace(/[\s\S]{1,3}/g,c)},u=function(z){return l(f(String(z)))},p=function(z){return z.replace(/[+\/]/g,function(X){return X=="+"?"-":"_"}).replace(/=/g,"")},E=function(z,X){return X?p(u(z)):u(z)},D=function(z){return E(z,!0)},L;K.Uint8Array&&(L=function(z,X){for(var B="",G=0,W=z.length;G<W;G+=3){var R=z[G],x=z[G+1],Y=z[G+2],te=R<<16|x<<8|Y;B+=_.charAt(te>>>18)+_.charAt(te>>>12&63)+(typeof x!="undefined"?_.charAt(te>>>6&63):"=")+(typeof Y!="undefined"?_.charAt(te&63):"=")}return X?p(B):B});var C=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,A=function(z){switch(z.length){case 4:var X=(7&z.charCodeAt(0))<<18|(63&z.charCodeAt(1))<<12|(63&z.charCodeAt(2))<<6|63&z.charCodeAt(3),B=X-65536;return m((B>>>10)+55296)+m((B&1023)+56320);case 3:return m((15&z.charCodeAt(0))<<12|(63&z.charCodeAt(1))<<6|63&z.charCodeAt(2));default:return m((31&z.charCodeAt(0))<<6|63&z.charCodeAt(1))}},P=function(z){return z.replace(C,A)},U=function(z){var X=z.length,B=X%4,G=(X>0?O[z.charAt(0)]<<18:0)|(X>1?O[z.charAt(1)]<<12:0)|(X>2?O[z.charAt(2)]<<6:0)|(X>3?O[z.charAt(3)]:0),W=[m(G>>>16),m(G>>>8&255),m(G&255)];return W.length-=[0,0,2,1][B],W.join("")},N=K.atob&&typeof K.atob=="function"?function(z){return K.atob(z)}:function(z){return z.replace(/\S{1,4}/g,U)},$=function(z){return N(String(z).replace(/[^A-Za-z0-9\+\/]/g,""))},F=function(z){return P(N(z))},q=function(z){return String(z).replace(/[-_]/g,function(X){return X=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},V=function(z){return F(q(z))},ne;K.Uint8Array&&(ne=function(z){return Uint8Array.from($(q(z)),function(X){return X.charCodeAt(0)})});var oe=function(){var z=K.Base64;return K.Base64=T,z};if(K.Base64={VERSION:w,atob:$,btoa:l,fromBase64:V,toBase64:E,utob:f,encode:E,encodeURI:D,btou:P,decode:V,noConflict:oe,fromUint8Array:L,toUint8Array:ne},typeof Object.defineProperty=="function"){var J=function(z){return{value:z,enumerable:!1,writable:!0,configurable:!0}};K.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",J(function(){return V(this)})),Object.defineProperty(String.prototype,"toBase64",J(function(z){return E(this,z)})),Object.defineProperty(String.prototype,"toBase64URI",J(function(){return E(this,!0)}))}}return K.Meteor&&(Base64=K.Base64),dt.exports?dt.exports.Base64=K.Base64:(k=[],I=function(){return K.Base64}.apply(me,k),I!==void 0&&(dt.exports=I)),{Base64:K.Base64}})},53184:function(dt,me,b){"use strict";var k,I;function K(T,w,_){var O=function(m,n){return T.js_beautify(m,n)};return O.js=T.js_beautify,O.css=w.css_beautify,O.html=_.html_beautify,O.js_beautify=T.js_beautify,O.css_beautify=w.css_beautify,O.html_beautify=_.html_beautify,O}k=[b(58553),b(87804),b(40998)],I=function(T,w,_){return K(T,w,_)}.apply(me,k),I!==void 0&&(dt.exports=I)},87804:function(dt,me){var b,k;(function(){var I;(function(){"use strict";var T=[,,function(m){function n(c){this.__parent=c,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=[]}n.prototype.clone_empty=function(){var c=new n(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},n.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},n.prototype.has_match=function(c){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(c))return!0;return!1},n.prototype.set_indent=function(c,l){this.is_empty()&&(this.__indent_count=c||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},n.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)},n.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},n.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var c=this.__parent.current_line;return c.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),c.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),c.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,c.__items[0]===" "&&(c.__items.splice(0,1),c.__character_count-=1),!0}return!1},n.prototype.is_empty=function(){return this.__items.length===0},n.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},n.prototype.push=function(c){this.__items.push(c);var l=c.lastIndexOf(`
|
|
|
`);l!==-1?this.__character_count=c.length-l:this.__character_count+=c.length},n.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},n.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},n.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},n.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},n.prototype.toString=function(){var c="";return this.is_empty()?this.__parent.indent_empty_lines&&(c=this.__parent.get_indent_string(this.__indent_count)):(c=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),c+=this.__items.join("")),c};function y(c,l){this.__cache=[""],this.__indent_size=c.indent_size,this.__indent_string=c.indent_char,c.indent_with_tabs||(this.__indent_string=new Array(c.indent_size+1).join(c.indent_char)),l=l||"",c.indent_level>0&&(l=new Array(c.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}y.prototype.get_indent_size=function(c,l){var u=this.__base_string_length;return l=l||0,c<0&&(u=0),u+=c*this.__indent_size,u+=l,u},y.prototype.get_indent_string=function(c,l){var u=this.__base_string;return l=l||0,c<0&&(c=0,u=""),l+=c*this.__indent_size,this.__ensure_cache(l),u+=this.__cache[l],u},y.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var c=this.__cache.length,l=0,u="";this.__indent_size&&c>=this.__indent_size&&(l=Math.floor(c/this.__indent_size),c-=l*this.__indent_size,u=new Array(l+1).join(this.__indent_string)),c&&(u+=new Array(c+1).join(" ")),this.__cache.push(u)};function f(c,l){this.__indent_cache=new y(c,l),this.raw=!1,this._end_with_newline=c.end_with_newline,this.indent_size=c.indent_size,this.wrap_line_length=c.wrap_line_length,this.indent_empty_lines=c.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new n(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(c,l){return this.__indent_cache.get_indent_string(c,l)},f.prototype.get_indent_size=function(c,l){return this.__indent_cache.get_indent_size(c,l)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(c){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
|
|
|
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
|
|
|
`);return c!==`
|
|
|
`&&(u=u.replace(/[\n]/g,c)),u},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(c,l){return c=c||0,l=l||0,this.next_line.set_indent(c,l),this.__lines.length>1?(this.current_line.set_indent(c,l),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(c){for(var l=0;l<c.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(c.whitespace_before),this.current_line.push(c.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(c){this.__add_space_before_token(),this.current_line.push(c),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.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(" "))},f.prototype.remove_indent=function(c){for(var l=this.__lines.length;c<l;)this.__lines[c]._remove_indent(),c++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(c){for(c=c===void 0?!1:c,this.current_line.trim();c&&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},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(c,l){for(var u=this.__lines.length-2;u>=0;){var p=this.__lines[u];if(p.is_empty())break;if(p.item(0).indexOf(c)!==0&&p.item(-1)!==l){this.__lines.splice(u+1,0,new n(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},m.exports.Output=f},,,,function(m){function n(c,l){this.raw_options=y(c,l),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"])}n.prototype._get_array=function(c,l){var u=this.raw_options[c],p=l||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(p=u.concat()):typeof u=="string"&&(p=u.split(/[^a-zA-Z0-9_\/\-]+/)),p},n.prototype._get_boolean=function(c,l){var u=this.raw_options[c],p=u===void 0?!!l:!!u;return p},n.prototype._get_characters=function(c,l){var u=this.raw_options[c],p=l||"";return typeof u=="string"&&(p=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),p},n.prototype._get_number=function(c,l){var u=this.raw_options[c];l=parseInt(l,10),isNaN(l)&&(l=0);var p=parseInt(u,10);return isNaN(p)&&(p=l),p},n.prototype._get_selection=function(c,l,u){var p=this._get_selection_list(c,l,u);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+c+`' can only be one of the following values:
|
|
|
`+l+`
|
|
|
You passed in: '`+this.raw_options[c]+"'");return p[0]},n.prototype._get_selection_list=function(c,l,u){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[l[0]],!this._is_valid_selection(u,l))throw new Error("Invalid Default Value!");var p=this._get_array(c,u);if(!this._is_valid_selection(p,l))throw new Error("Invalid Option Value: The option '"+c+`' can contain only the following values:
|
|
|
`+l+`
|
|
|
You passed in: '`+this.raw_options[c]+"'");return p},n.prototype._is_valid_selection=function(c,l){return c.length&&l.length&&!c.some(function(u){return l.indexOf(u)===-1})};function y(c,l){var u={};c=f(c);var p;for(p in c)p!==l&&(u[p]=c[p]);if(l&&c[l])for(p in c[l])u[p]=c[l][p];return u}function f(c){var l={},u;for(u in c){var p=u.replace(/-/g,"_");l[p]=c[u]}return l}m.exports.Options=n,m.exports.normalizeOpts=f,m.exports.mergeOpts=y},,function(m){var n=RegExp.prototype.hasOwnProperty("sticky");function y(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},y.prototype.peek=function(f){var c=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(c=this.__input.charAt(f)),c},y.prototype.__match=function(f,c){f.lastIndex=c;var l=f.exec(this.__input);return l&&!(n&&f.sticky)&&l.index!==c&&(l=null),l},y.prototype.test=function(f,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(f,c):!1},y.prototype.testChar=function(f,c){var l=this.peek(c);return f.lastIndex=0,l!==null&&f.test(l)},y.prototype.match=function(f){var c=this.__match(f,this.__position);return c?this.__position+=c[0].length:c=null,c},y.prototype.read=function(f,c,l){var u="",p;return f&&(p=this.match(f),p&&(u+=p[0])),c&&(p||!f)&&(u+=this.readUntil(c,l)),u},y.prototype.readUntil=function(f,c){var l="",u=this.__position;f.lastIndex=this.__position;var p=f.exec(this.__input);return p?(u=p.index,c&&(u+=p[0].length)):u=this.__input_length,l=this.__input.substring(this.__position,u),this.__position=u,l},y.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},y.prototype.get_regexp=function(f,c){var l=null,u="g";return c&&n&&(u="y"),typeof f=="string"&&f!==""?l=new RegExp(f,u):f&&(l=new RegExp(f.source,u)),l},y.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(f){var c=this.__position,l=this.readUntilAfter(f);return this.__position=c,l},y.prototype.lookBack=function(f){var c=this.__position-1;return c>=f.length&&this.__input.substring(c-f.length,c).toLowerCase()===f},m.exports.InputScanner=y},,,,,function(m){function n(y,f){y=typeof y=="string"?y:y.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+f,"g")}n.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(y);c;)f[c[1]]=c[2],c=this.__directive_pattern.exec(y);return f},n.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},m.exports.Directives=n},,function(m,n,y){var f=y(16).Beautifier,c=y(17).Options;function l(u,p){var E=new f(u,p);return E.beautify()}m.exports=l,m.exports.defaultOptions=function(){return new c}},function(m,n,y){var f=y(17).Options,c=y(2).Output,l=y(8).InputScanner,u=y(13).Directives,p=new u(/\/\*/,/\*\//),E=/\r\n|[\r\n]/,D=/\r\n|[\r\n]/g,L=/\s/,C=/(?:\s|\n)+/g,A=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,P=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function U(N,$){this._source_text=N||"",this._options=new f($),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"]}U.prototype.eatString=function(N){var $="";for(this._ch=this._input.next();this._ch;){if($+=this._ch,this._ch==="\\")$+=this._input.next();else if(N.indexOf(this._ch)!==-1||this._ch===`
|
|
|
`)break;this._ch=this._input.next()}return $},U.prototype.eatWhitespace=function(N){for(var $=L.test(this._input.peek()),F=0;L.test(this._input.peek());)this._ch=this._input.next(),N&&this._ch===`
|
|
|
`&&(F===0||F<this._options.max_preserve_newlines)&&(F++,this._output.add_new_line(!0));return $},U.prototype.foundNestedPseudoClass=function(){for(var N=0,$=1,F=this._input.peek($);F;){if(F==="{")return!0;if(F==="(")N+=1;else if(F===")"){if(N===0)return!1;N-=1}else if(F===";"||F==="}")return!1;$++,F=this._input.peek($)}return!1},U.prototype.print_string=function(N){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(N)},U.prototype.preserveSingleSpace=function(N){N&&(this._output.space_before_token=!0)},U.prototype.indent=function(){this._indentLevel++},U.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},U.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var N=this._source_text,$=this._options.eol;$==="auto"&&($=`
|
|
|
`,N&&E.test(N||"")&&($=N.match(E)[0])),N=N.replace(D,`
|
|
|
`);var F=N.match(/^[\t ]*/)[0];this._output=new c(this._options,F),this._input=new l(N),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var q=0,V=!1,ne=!1,oe=!1,J=!1,z=!1,X=this._ch,B=!1,G,W,R;G=this._input.read(C),W=G!=="",R=X,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),X=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var x=this._input.read(A),Y=p.get_directives(x);Y&&Y.ignore==="start"&&(x+=p.readIgnored(this._input)),this.print_string(x),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(P)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(W),this.print_string(this._ch);var te=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);te.match(/[ :]$/)&&(te=this.eatString(": ").replace(/\s+$/,""),this.print_string(te),this._output.space_before_token=!0),q===0&&te.indexOf(":")!==-1&&(ne=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(W),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Se=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Se.match(/[ :]$/)&&(Se=this.eatString(": ").replace(/\s+$/,""),this.print_string(Se),this._output.space_before_token=!0),q===0&&Se.indexOf(":")!==-1?(ne=!0,this.indent()):Se in this.NESTED_AT_RULE?(this._nestedLevel+=1,Se in this.CONDITIONAL_GROUP_RULE&&(oe=!0)):q===0&&!ne&&(J=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(W),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")ne&&(ne=!1,this.outdent()),J=!1,oe?(oe=!1,V=this._indentLevel>=this._nestedLevel):V=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&V&&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)):(R==="("?this._output.space_before_token=!1:R!==","&&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(),R==="{"&&this._output.trim(!0),ne&&(this.outdent(),ne=!1),this.print_string(this._ch),V=!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 Ie=0;Ie<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Ie++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Ie])){B=!0;break}(V||oe)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!J&&q===0?(this.print_string(":"),ne||(ne=!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 Ge=R==='"'||R==="'";this.preserveSingleSpace(Ge||W),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")B=!1,q===0?(ne&&(this.outdent(),ne=!1),J=!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(),q++,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(")")),q&&(q--,this.outdent()));else{var Ee=!1;this._input.lookBack("with")&&(Ee=!0),this.preserveSingleSpace(W||Ee),this.print_string(this._ch),ne&&R==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),z=!0):(this.eatWhitespace(),q++,this.indent())}else if(this._ch===")")q&&(q--,this.outdent()),z&&this._input.peek()===";"&&this._options.selector_separator_newline&&(z=!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&&(!ne||z)&&q===0&&!J?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!ne&&q===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&&L.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(W),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),L.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 ze=R==='"'||R==="'";this.preserveSingleSpace(ze||W),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
|
`&&B&&this._output.add_new_line()}var He=this._output.get_code($);return He},m.exports.Beautifier=U},function(m,n,y){var f=y(6).Options;function c(l){f.call(this,l,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var u=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||u;var p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var E=0;E<p.length;E++)p[E]!=="expand"?this.brace_style="collapse":this.brace_style=p[E]}c.prototype=new f,m.exports.Options=c}],w={};function _(m){var n=w[m];if(n!==void 0)return n.exports;var y=w[m]={exports:{}};return T[m](y,y.exports,_),y.exports}var O=_(15);I=O})();var K=I;b=[],k=function(){return{css_beautify:K}}.apply(me,b),k!==void 0&&(dt.exports=k)})()},40998:function(dt,me,b){var k,I;(function(){var K;(function(){"use strict";var O=[,,function(f){function c(p){this.__parent=p,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=[]}c.prototype.clone_empty=function(){var p=new c(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},c.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},c.prototype.has_match=function(p){for(var E=this.__items.length-1;E>=0;E--)if(this.__items[E].match(p))return!0;return!1},c.prototype.set_indent=function(p,E){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=E||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},c.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)},c.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},c.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},c.prototype.is_empty=function(){return this.__items.length===0},c.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},c.prototype.push=function(p){this.__items.push(p);var E=p.lastIndexOf(`
|
|
|
`);E!==-1?this.__character_count=p.length-E:this.__character_count+=p.length},c.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},c.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},c.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},c.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},c.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function l(p,E){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),E=E||"",p.indent_level>0&&(E=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=E,this.__base_string_length=E.length}l.prototype.get_indent_size=function(p,E){var D=this.__base_string_length;return E=E||0,p<0&&(D=0),D+=p*this.__indent_size,D+=E,D},l.prototype.get_indent_string=function(p,E){var D=this.__base_string;return E=E||0,p<0&&(p=0,D=""),E+=p*this.__indent_size,this.__ensure_cache(E),D+=this.__cache[E],D},l.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},l.prototype.__add_column=function(){var p=this.__cache.length,E=0,D="";this.__indent_size&&p>=this.__indent_size&&(E=Math.floor(p/this.__indent_size),p-=E*this.__indent_size,D=new Array(E+1).join(this.__indent_string)),p&&(D+=new Array(p+1).join(" ")),this.__cache.push(D)};function u(p,E){this.__indent_cache=new l(p,E),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new c(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(p,E){return this.__indent_cache.get_indent_string(p,E)},u.prototype.get_indent_size=function(p,E){return this.__indent_cache.get_indent_size(p,E)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(p){this.trim(!0);var E=this.current_line.pop();E&&(E[E.length-1]===`
|
|
|
`&&(E=E.replace(/\n+$/g,"")),this.current_line.push(E)),this._end_with_newline&&this.__add_outputline();var D=this.__lines.join(`
|
|
|
`);return p!==`
|
|
|
`&&(D=D.replace(/[\n]/g,p)),D},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(p,E){return p=p||0,E=E||0,this.next_line.set_indent(p,E),this.__lines.length>1?(this.current_line.set_indent(p,E),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(p){for(var E=0;E<p.newlines;E++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.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(" "))},u.prototype.remove_indent=function(p){for(var E=this.__lines.length;p<E;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(p,E){for(var D=this.__lines.length-2;D>=0;){var L=this.__lines[D];if(L.is_empty())break;if(L.item(0).indexOf(p)!==0&&L.item(-1)!==E){this.__lines.splice(D+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}D--}},f.exports.Output=u},function(f){function c(l,u,p,E){this.type=l,this.text=u,this.comments_before=null,this.newlines=p||0,this.whitespace_before=E||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}f.exports.Token=c},,,function(f){function c(p,E){this.raw_options=l(p,E),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"])}c.prototype._get_array=function(p,E){var D=this.raw_options[p],L=E||[];return typeof D=="object"?D!==null&&typeof D.concat=="function"&&(L=D.concat()):typeof D=="string"&&(L=D.split(/[^a-zA-Z0-9_\/\-]+/)),L},c.prototype._get_boolean=function(p,E){var D=this.raw_options[p],L=D===void 0?!!E:!!D;return L},c.prototype._get_characters=function(p,E){var D=this.raw_options[p],L=E||"";return typeof D=="string"&&(L=D.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),L},c.prototype._get_number=function(p,E){var D=this.raw_options[p];E=parseInt(E,10),isNaN(E)&&(E=0);var L=parseInt(D,10);return isNaN(L)&&(L=E),L},c.prototype._get_selection=function(p,E,D){var L=this._get_selection_list(p,E,D);if(L.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
|
`+E+`
|
|
|
You passed in: '`+this.raw_options[p]+"'");return L[0]},c.prototype._get_selection_list=function(p,E,D){if(!E||E.length===0)throw new Error("Selection list cannot be empty.");if(D=D||[E[0]],!this._is_valid_selection(D,E))throw new Error("Invalid Default Value!");var L=this._get_array(p,D);if(!this._is_valid_selection(L,E))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
|
`+E+`
|
|
|
You passed in: '`+this.raw_options[p]+"'");return L},c.prototype._is_valid_selection=function(p,E){return p.length&&E.length&&!p.some(function(D){return E.indexOf(D)===-1})};function l(p,E){var D={};p=u(p);var L;for(L in p)L!==E&&(D[L]=p[L]);if(E&&p[E])for(L in p[E])D[L]=p[E][L];return D}function u(p){var E={},D;for(D in p){var L=D.replace(/-/g,"_");E[L]=p[D]}return E}f.exports.Options=c,f.exports.normalizeOpts=u,f.exports.mergeOpts=l},,function(f){var c=RegExp.prototype.hasOwnProperty("sticky");function l(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}l.prototype.restart=function(){this.__position=0},l.prototype.back=function(){this.__position>0&&(this.__position-=1)},l.prototype.hasNext=function(){return this.__position<this.__input_length},l.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},l.prototype.peek=function(u){var p=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(p=this.__input.charAt(u)),p},l.prototype.__match=function(u,p){u.lastIndex=p;var E=u.exec(this.__input);return E&&!(c&&u.sticky)&&E.index!==p&&(E=null),E},l.prototype.test=function(u,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(u,p):!1},l.prototype.testChar=function(u,p){var E=this.peek(p);return u.lastIndex=0,E!==null&&u.test(E)},l.prototype.match=function(u){var p=this.__match(u,this.__position);return p?this.__position+=p[0].length:p=null,p},l.prototype.read=function(u,p,E){var D="",L;return u&&(L=this.match(u),L&&(D+=L[0])),p&&(L||!u)&&(D+=this.readUntil(p,E)),D},l.prototype.readUntil=function(u,p){var E="",D=this.__position;u.lastIndex=this.__position;var L=u.exec(this.__input);return L?(D=L.index,p&&(D+=L[0].length)):D=this.__input_length,E=this.__input.substring(this.__position,D),this.__position=D,E},l.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},l.prototype.get_regexp=function(u,p){var E=null,D="g";return p&&c&&(D="y"),typeof u=="string"&&u!==""?E=new RegExp(u,D):u&&(E=new RegExp(u.source,D)),E},l.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},l.prototype.peekUntilAfter=function(u){var p=this.__position,E=this.readUntilAfter(u);return this.__position=p,E},l.prototype.lookBack=function(u){var p=this.__position-1;return p>=u.length&&this.__input.substring(p-u.length,p).toLowerCase()===u},f.exports.InputScanner=l},function(f,c,l){var u=l(8).InputScanner,p=l(3).Token,E=l(10).TokenStream,D=l(11).WhitespacePattern,L={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},C=function(A,P){this._input=new u(A),this._options=P||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new D(this._input)};C.prototype.tokenize=function(){this._input.restart(),this.__tokens=new E,this._reset();for(var A,P=new p(L.START,""),U=null,N=[],$=new E;P.type!==L.EOF;){for(A=this._get_next_token(P,U);this._is_comment(A);)$.add(A),A=this._get_next_token(P,U);$.isEmpty()||(A.comments_before=$,$=new E),A.parent=U,this._is_opening(A)?(N.push(U),U=A):U&&this._is_closing(A,U)&&(A.opened=U,U.closed=A,U=N.pop(),A.parent=U),A.previous=P,P.next=A,this.__tokens.add(A),P=A}return this.__tokens},C.prototype._is_first_token=function(){return this.__tokens.isEmpty()},C.prototype._reset=function(){},C.prototype._get_next_token=function(A,P){this._readWhitespace();var U=this._input.read(/.+/g);return U?this._create_token(L.RAW,U):this._create_token(L.EOF,"")},C.prototype._is_comment=function(A){return!1},C.prototype._is_opening=function(A){return!1},C.prototype._is_closing=function(A,P){return!1},C.prototype._create_token=function(A,P){var U=new p(A,P,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return U},C.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},f.exports.Tokenizer=C,f.exports.TOKEN=L},function(f){function c(l){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=l}c.prototype.restart=function(){this.__position=0},c.prototype.isEmpty=function(){return this.__tokens_length===0},c.prototype.hasNext=function(){return this.__position<this.__tokens_length},c.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__tokens[this.__position],this.__position+=1),l},c.prototype.peek=function(l){var u=null;return l=l||0,l+=this.__position,l>=0&&l<this.__tokens_length&&(u=this.__tokens[l]),u},c.prototype.add=function(l){this.__parent_token&&(l.parent=this.__parent_token),this.__tokens.push(l),this.__tokens_length+=1},f.exports.TokenStream=c},function(f,c,l){var u=l(12).Pattern;function p(E,D){u.call(this,E,D),D?this._line_regexp=this._input.get_regexp(D._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new u,p.prototype.__set_whitespace_patterns=function(E,D){E+="\\t ",D+="\\n\\r",this._match_pattern=this._input.get_regexp("["+E+D+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+D+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var E=this._input.read(this._match_pattern);if(E===" ")this.whitespace_before_token=" ";else if(E){var D=this.__split(this._newline_regexp,E);this.newline_count=D.length-1,this.whitespace_before_token=D[this.newline_count]}return E},p.prototype.matching=function(E,D){var L=this._create();return L.__set_whitespace_patterns(E,D),L._update(),L},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(E,D){E.lastIndex=0;for(var L=0,C=[],A=E.exec(D);A;)C.push(D.substring(L,A.index)),L=A.index+A[0].length,A=E.exec(D);return L<D.length?C.push(D.substring(L,D.length)):C.push(""),C},f.exports.WhitespacePattern=p},function(f){function c(l,u){this._input=l,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}c.prototype.read=function(){var l=this._input.read(this._starting_pattern);return(!this._starting_pattern||l)&&(l+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),l},c.prototype.read_match=function(){return this._input.match(this._match_pattern)},c.prototype.until_after=function(l){var u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(l),u._update(),u},c.prototype.until=function(l){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(l),u._update(),u},c.prototype.starting_with=function(l){var u=this._create();return u._starting_pattern=this._input.get_regexp(l,!0),u._update(),u},c.prototype.matching=function(l){var u=this._create();return u._match_pattern=this._input.get_regexp(l,!0),u._update(),u},c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){},f.exports.Pattern=c},function(f){function c(l,u){l=typeof l=="string"?l:l.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(l+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(l+/\sbeautify\signore:end\s/.source+u,"g")}c.prototype.get_directives=function(l){if(!l.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(l);p;)u[p[1]]=p[2],p=this.__directive_pattern.exec(l);return u},c.prototype.readIgnored=function(l){return l.readUntilAfter(this.__directives_end_ignore_pattern)},f.exports.Directives=c},function(f,c,l){var u=l(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function E(D,L){u.call(this,D,L),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),L&&(this.__template_pattern=this._input.get_regexp(L.__template_pattern),this._excluded=Object.assign(this._excluded,L._excluded),this._disabled=Object.assign(this._disabled,L._disabled));var C=new u(D);this.__patterns={handlebars_comment:C.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:C.starting_with(/{{{/).until_after(/}}}/),handlebars:C.starting_with(/{{/).until_after(/}}/),php:C.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:C.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:C.starting_with(/{%/).until_after(/%}/),django_value:C.starting_with(/{{/).until_after(/}}/),django_comment:C.starting_with(/{#/).until_after(/#}/),smarty:C.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:C.starting_with(/{\*/).until_after(/\*}/),smarty_literal:C.starting_with(/{literal}/).until_after(/{\/literal}/)}}E.prototype=new u,E.prototype._create=function(){return new E(this._input,this)},E.prototype._update=function(){this.__set_templated_pattern()},E.prototype.disable=function(D){var L=this._create();return L._disabled[D]=!0,L._update(),L},E.prototype.read_options=function(D){var L=this._create();for(var C in p)L._disabled[C]=D.templating.indexOf(C)===-1;return L._update(),L},E.prototype.exclude=function(D){var L=this._create();return L._excluded[D]=!0,L._update(),L},E.prototype.read=function(){var D="";this._match_pattern?D=this._input.read(this._starting_pattern):D=this._input.read(this._starting_pattern,this.__template_pattern);for(var L=this._read_template();L;)this._match_pattern?L+=this._input.read(this._match_pattern):L+=this._input.readUntil(this.__template_pattern),D+=L,L=this._read_template();return this._until_after&&(D+=this._input.readUntilAfter(this._until_pattern)),D},E.prototype.__set_templated_pattern=function(){var D=[];this._disabled.php||D.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||D.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||D.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||D.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(D.push(this.__patterns.django._starting_pattern.source),D.push(this.__patterns.django_value._starting_pattern.source),D.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||D.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&D.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+D.join("|")+")")},E.prototype._read_template=function(){var D="",L=this._input.peek();if(L==="<"){var C=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&C==="?"&&(D=D||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&C==="%"&&(D=D||this.__patterns.erb.read())}else L==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(D=D||this.__patterns.handlebars_comment.read(),D=D||this.__patterns.handlebars_unescaped.read(),D=D||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(D=D||this.__patterns.django_value.read()),this._excluded.django||(D=D||this.__patterns.django_comment.read(),D=D||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(D=D||this.__patterns.smarty_comment.read(),D=D||this.__patterns.smarty_literal.read(),D=D||this.__patterns.smarty.read()));return D},f.exports.TemplatablePattern=E},,,,function(f,c,l){var u=l(19).Beautifier,p=l(20).Options;function E(D,L,C,A){var P=new u(D,L,C,A);return P.beautify()}f.exports=E,f.exports.defaultOptions=function(){return new p}},function(f,c,l){var u=l(20).Options,p=l(2).Output,E=l(21).Tokenizer,D=l(21).TOKEN,L=/\r\n|[\r\n]/,C=/\r\n|[\r\n]/g,A=function(J,z){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=J.max_preserve_newlines,this.preserve_newlines=J.preserve_newlines,this._output=new p(J,z)};A.prototype.current_line_has_match=function(J){return this._output.current_line.has_match(J)},A.prototype.set_space_before_token=function(J,z){this._output.space_before_token=J,this._output.non_breaking_space=z},A.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},A.prototype.add_raw_token=function(J){this._output.add_raw_token(J)},A.prototype.print_preserved_newlines=function(J){var z=0;J.type!==D.TEXT&&J.previous.type!==D.TEXT&&(z=J.newlines?1:0),this.preserve_newlines&&(z=J.newlines<this.max_preserve_newlines+1?J.newlines:this.max_preserve_newlines+1);for(var X=0;X<z;X++)this.print_newline(X>0);return z!==0},A.prototype.traverse_whitespace=function(J){return J.whitespace_before||J.newlines?(this.print_preserved_newlines(J)||(this._output.space_before_token=!0),!0):!1},A.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},A.prototype.print_newline=function(J){this._output.add_new_line(J)},A.prototype.print_token=function(J){J.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(J.text))},A.prototype.indent=function(){this.indent_level++},A.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},A.prototype.get_full_indent=function(J){return J=this.indent_level+(J||0),J<1?"":this._output.get_indent_string(J)};var P=function(J){for(var z=null,X=J.next;X.type!==D.EOF&&J.closed!==X;){if(X.type===D.ATTRIBUTE&&X.text==="type"){X.next&&X.next.type===D.EQUALS&&X.next.next&&X.next.next.type===D.VALUE&&(z=X.next.next.text);break}X=X.next}return z},U=function(J,z){var X=null,B=null;return z.closed?(J==="script"?X="text/javascript":J==="style"&&(X="text/css"),X=P(z)||X,X.search("text/css")>-1?B="css":X.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?B="javascript":X.search(/(text|application|dojo)\/(x-)?(html)/)>-1?B="html":X.search(/test\/null/)>-1&&(B="null"),B):null};function N(J,z){return z.indexOf(J)!==-1}function $(J,z,X){this.parent=J||null,this.tag=z?z.tag_name:"",this.indent_level=X||0,this.parser_token=z||null}function F(J){this._printer=J,this._current_frame=null}F.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},F.prototype.record_tag=function(J){var z=new $(this._current_frame,J,this._printer.indent_level);this._current_frame=z},F.prototype._try_pop_frame=function(J){var z=null;return J&&(z=J.parser_token,this._printer.indent_level=J.indent_level,this._current_frame=J.parent),z},F.prototype._get_frame=function(J,z){for(var X=this._current_frame;X&&J.indexOf(X.tag)===-1;){if(z&&z.indexOf(X.tag)!==-1){X=null;break}X=X.parent}return X},F.prototype.try_pop=function(J,z){var X=this._get_frame([J],z);return this._try_pop_frame(X)},F.prototype.indent_to_tag=function(J){var z=this._get_frame(J);z&&(this._printer.indent_level=z.indent_level)};function q(J,z,X,B){this._source_text=J||"",z=z||{},this._js_beautify=X,this._css_beautify=B,this._tag_stack=null;var G=new u(z,"html");this._options=G,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"}q.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var J=this._source_text,z=this._options.eol;this._options.eol==="auto"&&(z=`
|
|
|
`,J&&L.test(J)&&(z=J.match(L)[0])),J=J.replace(C,`
|
|
|
`);var X=J.match(/^[\t ]*/)[0],B={text:"",type:""},G=new V(this._options),W=new A(this._options,X),R=new E(J,this._options).tokenize();this._tag_stack=new F(W);for(var x=null,Y=R.next();Y.type!==D.EOF;)Y.type===D.TAG_OPEN||Y.type===D.COMMENT?(x=this._handle_tag_open(W,Y,G,B,R),G=x):Y.type===D.ATTRIBUTE||Y.type===D.EQUALS||Y.type===D.VALUE||Y.type===D.TEXT&&!G.tag_complete?x=this._handle_inside_tag(W,Y,G,B):Y.type===D.TAG_CLOSE?x=this._handle_tag_close(W,Y,G):Y.type===D.TEXT?x=this._handle_text(W,Y,G):Y.type===D.CONTROL_FLOW_OPEN?x=this._handle_control_flow_open(W,Y):Y.type===D.CONTROL_FLOW_CLOSE?x=this._handle_control_flow_close(W,Y):W.add_raw_token(Y),B=x,Y=R.next();var te=W._output.get_code(z);return te},q.prototype._handle_control_flow_open=function(J,z){var X={text:z.text,type:z.type};return J.set_space_before_token(z.newlines||z.whitespace_before!=="",!0),z.newlines?J.print_preserved_newlines(z):J.set_space_before_token(z.newlines||z.whitespace_before!=="",!0),J.print_token(z),J.indent(),X},q.prototype._handle_control_flow_close=function(J,z){var X={text:z.text,type:z.type};return J.deindent(),z.newlines?J.print_preserved_newlines(z):J.set_space_before_token(z.newlines||z.whitespace_before!=="",!0),J.print_token(z),X},q.prototype._handle_tag_close=function(J,z,X){var B={text:z.text,type:z.type};return J.alignment_size=0,X.tag_complete=!0,J.set_space_before_token(z.newlines||z.whitespace_before!=="",!0),X.is_unformatted?J.add_raw_token(z):(X.tag_start_char==="<"&&(J.set_space_before_token(z.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&X.has_wrapped_attrs&&J.print_newline(!1)),J.print_token(z)),X.indent_content&&!(X.is_unformatted||X.is_content_unformatted)&&(J.indent(),X.indent_content=!1),!X.is_inline_element&&!(X.is_unformatted||X.is_content_unformatted)&&J.set_wrap_point(),B},q.prototype._handle_inside_tag=function(J,z,X,B){var G=X.has_wrapped_attrs,W={text:z.text,type:z.type};return J.set_space_before_token(z.newlines||z.whitespace_before!=="",!0),X.is_unformatted?J.add_raw_token(z):X.tag_start_char==="{"&&z.type===D.TEXT?J.print_preserved_newlines(z)?(z.newlines=0,J.add_raw_token(z)):J.print_token(z):(z.type===D.ATTRIBUTE?J.set_space_before_token(!0):(z.type===D.EQUALS||z.type===D.VALUE&&z.previous.type===D.EQUALS)&&J.set_space_before_token(!1),z.type===D.ATTRIBUTE&&X.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(J.traverse_whitespace(z),G=G||z.newlines!==0),this._is_wrap_attributes_force&&X.attr_count>=this._options.wrap_attributes_min_attrs&&(B.type!==D.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(J.print_newline(!1),G=!0)),J.print_token(z),G=G||J.previous_token_wrapped(),X.has_wrapped_attrs=G),W},q.prototype._handle_text=function(J,z,X){var B={text:z.text,type:"TK_CONTENT"};return X.custom_beautifier_name?this._print_custom_beatifier_text(J,z,X):X.is_unformatted||X.is_content_unformatted?J.add_raw_token(z):(J.traverse_whitespace(z),J.print_token(z)),B},q.prototype._print_custom_beatifier_text=function(J,z,X){var B=this;if(z.text!==""){var G=z.text,W,R=1,x="",Y="";X.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?W=this._js_beautify:X.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?W=this._css_beautify:X.custom_beautifier_name==="html"&&(W=function(ze,He){var Be=new q(ze,He,B._js_beautify,B._css_beautify);return Be.beautify()}),this._options.indent_scripts==="keep"?R=0:this._options.indent_scripts==="separate"&&(R=-J.indent_level);var te=J.get_full_indent(R);if(G=G.replace(/\n[ \t]*$/,""),X.custom_beautifier_name!=="html"&&G[0]==="<"&&G.match(/^(<!--|<!\[CDATA\[)/)){var Se=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(G);if(!Se){J.add_raw_token(z);return}x=te+Se[1]+`
|
|
|
`,G=Se[4],Se[5]&&(Y=te+Se[5]),G=G.replace(/\n[ \t]*$/,""),(Se[2]||Se[3].indexOf(`
|
|
|
`)!==-1)&&(Se=Se[3].match(/[ \t]+$/),Se&&(z.whitespace_before=Se[0]))}if(G)if(W){var Ie=function(){this.eol=`
|
|
|
`};Ie.prototype=this._options.raw_options;var Ge=new Ie;G=W(te+G,Ge)}else{var Ee=z.whitespace_before;Ee&&(G=G.replace(new RegExp(`
|
|
|
(`+Ee+")?","g"),`
|
|
|
`)),G=te+G.replace(/\n/g,`
|
|
|
`+te)}x&&(G?G=x+G+`
|
|
|
`+Y:G=x+Y),J.print_newline(!1),G&&(z.text=G,z.whitespace_before="",z.newlines=0,J.add_raw_token(z),J.print_newline(!0))}},q.prototype._handle_tag_open=function(J,z,X,B,G){var W=this._get_tag_open_token(z);if((X.is_unformatted||X.is_content_unformatted)&&!X.is_empty_element&&z.type===D.TAG_OPEN&&!W.is_start_tag?(J.add_raw_token(z),W.start_tag_token=this._tag_stack.try_pop(W.tag_name)):(J.traverse_whitespace(z),this._set_tag_position(J,z,W,X,B),W.is_inline_element||J.set_wrap_point(),J.print_token(z)),W.is_start_tag&&this._is_wrap_attributes_force){var R=0,x;do x=G.peek(R),x.type===D.ATTRIBUTE&&(W.attr_count+=1),R+=1;while(x.type!==D.EOF&&x.type!==D.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(W.alignment_size=z.text.length+1),!W.tag_complete&&!W.is_unformatted&&(J.alignment_size=W.alignment_size),W};var V=function(J,z,X){if(this.parent=z||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="",!X)this.tag_complete=!0;else{var B;this.tag_start_char=X.text[0],this.text=X.text,this.tag_start_char==="<"?(B=X.text.match(/^<([^\s>]*)/),this.tag_check=B?B[1]:""):(B=X.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=B?B[1]:"",(X.text.startsWith("{{#>")||X.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&X.next!==null?this.tag_check=X.next.text.split(" ")[0]:this.tag_check=X.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),X.type===D.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||X.closed&&X.closed.text==="/>";var G=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(G=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!J.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(G)))}};q.prototype._get_tag_open_token=function(J){var z=new V(this._options,this._tag_stack.get_parser_token(),J);return z.alignment_size=this._options.wrap_attributes_indent_size,z.is_end_tag=z.is_end_tag||N(z.tag_check,this._options.void_elements),z.is_empty_element=z.tag_complete||z.is_start_tag&&z.is_end_tag,z.is_unformatted=!z.tag_complete&&N(z.tag_check,this._options.unformatted),z.is_content_unformatted=!z.is_empty_element&&N(z.tag_check,this._options.content_unformatted),z.is_inline_element=N(z.tag_name,this._options.inline)||this._options.inline_custom_elements&&z.tag_name.includes("-")||z.tag_start_char==="{",z},q.prototype._set_tag_position=function(J,z,X,B,G){if(X.is_empty_element||(X.is_end_tag?X.start_tag_token=this._tag_stack.try_pop(X.tag_name):(this._do_optional_end_element(X)&&(X.is_inline_element||J.print_newline(!1)),this._tag_stack.record_tag(X),(X.tag_name==="script"||X.tag_name==="style")&&!(X.is_unformatted||X.is_content_unformatted)&&(X.custom_beautifier_name=U(X.tag_check,z)))),N(X.tag_check,this._options.extra_liners)&&(J.print_newline(!1),J._output.just_added_blankline()||J.print_newline(!0)),X.is_empty_element){if(X.tag_start_char==="{"&&X.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),X.indent_content=!0;var W=J.current_line_has_match(/{{#if/);W||J.print_newline(!1)}X.tag_name==="!--"&&G.type===D.TAG_CLOSE&&B.is_end_tag&&X.text.indexOf(`
|
|
|
`)===-1||(X.is_inline_element||X.is_unformatted||J.print_newline(!1),this._calcluate_parent_multiline(J,X))}else if(X.is_end_tag){var R=!1;R=X.start_tag_token&&X.start_tag_token.multiline_content,R=R||!X.is_inline_element&&!(B.is_inline_element||B.is_unformatted)&&!(G.type===D.TAG_CLOSE&&X.start_tag_token===B)&&G.type!=="TK_CONTENT",(X.is_content_unformatted||X.is_unformatted)&&(R=!1),R&&J.print_newline(!1)}else X.indent_content=!X.custom_beautifier_name,X.tag_start_char==="<"&&(X.tag_name==="html"?X.indent_content=this._options.indent_inner_html:X.tag_name==="head"?X.indent_content=this._options.indent_head_inner_html:X.tag_name==="body"&&(X.indent_content=this._options.indent_body_inner_html)),!(X.is_inline_element||X.is_unformatted)&&(G.type!=="TK_CONTENT"||X.is_content_unformatted)&&J.print_newline(!1),this._calcluate_parent_multiline(J,X)},q.prototype._calcluate_parent_multiline=function(J,z){z.parent&&J._output.just_added_newline()&&!((z.is_inline_element||z.is_unformatted)&&z.parent.is_inline_element)&&(z.parent.multiline_content=!0)};var ne=["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"],oe=["a","audio","del","ins","map","noscript","video"];q.prototype._do_optional_end_element=function(J){var z=null;if(!(J.is_empty_element||!J.is_start_tag||!J.parent)){if(J.tag_name==="body")z=z||this._tag_stack.try_pop("head");else if(J.tag_name==="li")z=z||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(J.tag_name==="dd"||J.tag_name==="dt")z=z||this._tag_stack.try_pop("dt",["dl"]),z=z||this._tag_stack.try_pop("dd",["dl"]);else if(J.parent.tag_name==="p"&&ne.indexOf(J.tag_name)!==-1){var X=J.parent.parent;(!X||oe.indexOf(X.tag_name)===-1)&&(z=z||this._tag_stack.try_pop("p"))}else J.tag_name==="rp"||J.tag_name==="rt"?(z=z||this._tag_stack.try_pop("rt",["ruby","rtc"]),z=z||this._tag_stack.try_pop("rp",["ruby","rtc"])):J.tag_name==="optgroup"?z=z||this._tag_stack.try_pop("optgroup",["select"]):J.tag_name==="option"?z=z||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):J.tag_name==="colgroup"?z=z||this._tag_stack.try_pop("caption",["table"]):J.tag_name==="thead"?(z=z||this._tag_stack.try_pop("caption",["table"]),z=z||this._tag_stack.try_pop("colgroup",["table"])):J.tag_name==="tbody"||J.tag_name==="tfoot"?(z=z||this._tag_stack.try_pop("caption",["table"]),z=z||this._tag_stack.try_pop("colgroup",["table"]),z=z||this._tag_stack.try_pop("thead",["table"]),z=z||this._tag_stack.try_pop("tbody",["table"])):J.tag_name==="tr"?(z=z||this._tag_stack.try_pop("caption",["table"]),z=z||this._tag_stack.try_pop("colgroup",["table"]),z=z||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(J.tag_name==="th"||J.tag_name==="td")&&(z=z||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),z=z||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return J.parent=this._tag_stack.get_parser_token(),z}},f.exports.Beautifier=q},function(f,c,l){var u=l(6).Options;function p(E){u.call(this,E,"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"])}p.prototype=new u,f.exports.Options=p},function(f,c,l){var u=l(9).Tokenizer,p=l(9).TOKEN,E=l(13).Directives,D=l(14).TemplatablePattern,L=l(12).Pattern,C={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:p.START,RAW:p.RAW,EOF:p.EOF},A=new E(/<\!--/,/-->/),P=function(U,N){u.call(this,U,N),this._current_tag_name="";var $=new D(this._input).read_options(this._options),F=new L(this._input);if(this.__patterns={word:$.until(/[\n\r\t <]/),word_control_flow_close_excluded:$.until(/[\n\r\t <}]/),single_quote:$.until_after(/'/),double_quote:$.until_after(/"/),attribute:$.until(/[\n\r\t =>]|\/>/),element_name:$.until(/[\n\r\t >\/]/),angular_control_flow_start:F.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:F.starting_with(/{{!--/).until_after(/--}}/),handlebars:F.starting_with(/{{/).until_after(/}}/),handlebars_open:F.until(/[\n\r\t }]/),handlebars_raw_close:F.until(/}}/),comment:F.starting_with(/<!--/).until_after(/-->/),cdata:F.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:F.starting_with(/<!\[/).until_after(/]>/),processing:F.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 q=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=F.matching(q).until_after(q)}};P.prototype=new u,P.prototype._is_comment=function(U){return!1},P.prototype._is_opening=function(U){return U.type===C.TAG_OPEN||U.type===C.CONTROL_FLOW_OPEN},P.prototype._is_closing=function(U,N){return U.type===C.TAG_CLOSE&&N&&((U.text===">"||U.text==="/>")&&N.text[0]==="<"||U.text==="}}"&&N.text[0]==="{"&&N.text[1]==="{")||U.type===C.CONTROL_FLOW_CLOSE&&U.text==="}"&&N.text.endsWith("{")},P.prototype._reset=function(){this._current_tag_name=""},P.prototype._get_next_token=function(U,N){var $=null;this._readWhitespace();var F=this._input.peek();return F===null?this._create_token(C.EOF,""):($=$||this._read_open_handlebars(F,N),$=$||this._read_attribute(F,U,N),$=$||this._read_close(F,N),$=$||this._read_script_and_style(F,U),$=$||this._read_control_flows(F,N),$=$||this._read_raw_content(F,U,N),$=$||this._read_content_word(F,N),$=$||this._read_comment_or_cdata(F),$=$||this._read_processing(F),$=$||this._read_open(F,N),$=$||this._create_token(C.UNKNOWN,this._input.next()),$)},P.prototype._read_comment_or_cdata=function(U){var N=null,$=null,F=null;if(U==="<"){var q=this._input.peek(1);q==="!"&&($=this.__patterns.comment.read(),$?(F=A.get_directives($),F&&F.ignore==="start"&&($+=A.readIgnored(this._input))):$=this.__patterns.cdata.read()),$&&(N=this._create_token(C.COMMENT,$),N.directives=F)}return N},P.prototype._read_processing=function(U){var N=null,$=null,F=null;if(U==="<"){var q=this._input.peek(1);(q==="!"||q==="?")&&($=this.__patterns.conditional_comment.read(),$=$||this.__patterns.processing.read()),$&&(N=this._create_token(C.COMMENT,$),N.directives=F)}return N},P.prototype._read_open=function(U,N){var $=null,F=null;return(!N||N.type===C.CONTROL_FLOW_OPEN)&&U==="<"&&($=this._input.next(),this._input.peek()==="/"&&($+=this._input.next()),$+=this.__patterns.element_name.read(),F=this._create_token(C.TAG_OPEN,$)),F},P.prototype._read_open_handlebars=function(U,N){var $=null,F=null;return(!N||N.type===C.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&U==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?($=this.__patterns.handlebars_comment.read(),$=$||this.__patterns.handlebars.read(),F=this._create_token(C.COMMENT,$)):($=this.__patterns.handlebars_open.read(),F=this._create_token(C.TAG_OPEN,$))),F},P.prototype._read_control_flows=function(U,N){var $="",F=null;if(!this._options.templating.includes("angular"))return F;if(U==="@"){if($=this.__patterns.angular_control_flow_start.read(),$==="")return F;for(var q=$.endsWith("(")?1:0,V=0;!($.endsWith("{")&&q===V);){var ne=this._input.next();if(ne===null)break;ne==="("?q++:ne===")"&&V++,$+=ne}F=this._create_token(C.CONTROL_FLOW_OPEN,$)}else U==="}"&&N&&N.type===C.CONTROL_FLOW_OPEN&&($=this._input.next(),F=this._create_token(C.CONTROL_FLOW_CLOSE,$));return F},P.prototype._read_close=function(U,N){var $=null,F=null;return N&&N.type===C.TAG_OPEN&&(N.text[0]==="<"&&(U===">"||U==="/"&&this._input.peek(1)===">")?($=this._input.next(),U==="/"&&($+=this._input.next()),F=this._create_token(C.TAG_CLOSE,$)):N.text[0]==="{"&&U==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),F=this._create_token(C.TAG_CLOSE,"}}"))),F},P.prototype._read_attribute=function(U,N,$){var F=null,q="";if($&&$.text[0]==="<")if(U==="=")F=this._create_token(C.EQUALS,this._input.next());else if(U==='"'||U==="'"){var V=this._input.next();U==='"'?V+=this.__patterns.double_quote.read():V+=this.__patterns.single_quote.read(),F=this._create_token(C.VALUE,V)}else q=this.__patterns.attribute.read(),q&&(N.type===C.EQUALS?F=this._create_token(C.VALUE,q):F=this._create_token(C.ATTRIBUTE,q));return F},P.prototype._is_content_unformatted=function(U){return this._options.void_elements.indexOf(U)===-1&&(this._options.content_unformatted.indexOf(U)!==-1||this._options.unformatted.indexOf(U)!==-1)},P.prototype._read_raw_content=function(U,N,$){var F="";if($&&$.text[0]==="{")F=this.__patterns.handlebars_raw_close.read();else if(N.type===C.TAG_CLOSE&&N.opened.text[0]==="<"&&N.text[0]!=="/"){var q=N.opened.text.substr(1).toLowerCase();this._is_content_unformatted(q)&&(F=this._input.readUntil(new RegExp("</"+q+"[\\n\\r\\t ]*?>","ig")))}return F?this._create_token(C.TEXT,F):null},P.prototype._read_script_and_style=function(U,N){if(N.type===C.TAG_CLOSE&&N.opened.text[0]==="<"&&N.text[0]!=="/"){var $=N.opened.text.substr(1).toLowerCase();if($==="script"||$==="style"){var F=this._read_comment_or_cdata(U);if(F)return F.type=C.TEXT,F;var q=this._input.readUntil(new RegExp("</"+$+"[\\n\\r\\t ]*?>","ig"));if(q)return this._create_token(C.TEXT,q)}}return null},P.prototype._read_content_word=function(U,N){var $="";return this._options.unformatted_content_delimiter&&U===this._options.unformatted_content_delimiter[0]&&($=this.__patterns.unformatted_content_delimiter.read()),$||($=N&&N.type===C.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),$?this._create_token(C.TEXT,$):null},f.exports.Tokenizer=P,f.exports.TOKEN=C}],m={};function n(f){var c=m[f];if(c!==void 0)return c.exports;var l=m[f]={exports:{}};return O[f](l,l.exports,n),l.exports}var y=n(18);K=y})();var T=K;if(1)k=[b,b(58553),b(87804)],I=function(O){var m=b(58553),n=b(87804);return{html_beautify:function(y,f){return T(y,f,m.js_beautify,n.css_beautify)}}}.apply(me,k),I!==void 0&&(dt.exports=I);else var w,_})()},58553:function(dt,me){var b,k;(function(){var I;(function(){"use strict";var T=[function(m,n,y){var f=y(1).Beautifier,c=y(5).Options;function l(u,p){var E=new f(u,p);return E.beautify()}m.exports=l,m.exports.defaultOptions=function(){return new c}},function(m,n,y){var f=y(2).Output,c=y(3).Token,l=y(4),u=y(5).Options,p=y(7).Tokenizer,E=y(7).line_starters,D=y(7).positionable_operators,L=y(7).TOKEN;function C(x,Y){return Y.indexOf(x)!==-1}function A(x){return x.replace(/^\s+/g,"")}function P(x){for(var Y={},te=0;te<x.length;te++)Y[x[te].replace(/-/g,"_")]=x[te];return Y}function U(x,Y){return x&&x.type===L.RESERVED&&x.text===Y}function N(x,Y){return x&&x.type===L.RESERVED&&C(x.text,Y)}var $=["case","return","do","if","throw","else","await","break","continue","async"],F=["before-newline","after-newline","preserve-newline"],q=P(F),V=[q.before_newline,q.preserve_newline],ne={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function oe(x,Y){Y.multiline_frame||Y.mode===ne.ForInitializer||Y.mode===ne.Conditional||x.remove_indent(Y.start_line_index)}function J(x){x=x.replace(l.allLineBreaks,`
|
|
|
`);for(var Y=[],te=x.indexOf(`
|
|
|
`);te!==-1;)Y.push(x.substring(0,te)),x=x.substring(te+1),te=x.indexOf(`
|
|
|
`);return x.length&&Y.push(x),Y}function z(x){return x===ne.ArrayLiteral}function X(x){return C(x,[ne.Expression,ne.ForInitializer,ne.Conditional])}function B(x,Y){for(var te=0;te<x.length;te++){var Se=x[te].trim();if(Se.charAt(0)!==Y)return!1}return!0}function G(x,Y){for(var te=0,Se=x.length,Ie;te<Se;te++)if(Ie=x[te],Ie&&Ie.indexOf(Y)!==0)return!1;return!0}function W(x,Y){Y=Y||{},this._source_text=x||"",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 u(Y)}W.prototype.create_flags=function(x,Y){var te=0;x&&(te=x.indentation_level,!this._output.just_added_newline()&&x.line_indent_level>te&&(te=x.line_indent_level));var Se={mode:Y,parent:x,last_token:x?x.last_token:new c(L.START_BLOCK,""),last_word:x?x.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:te,alignment:0,line_indent_level:x?x.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return Se},W.prototype._reset=function(x){var Y=x.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(ne.BlockStatement);var te=new p(x,this._options);return this._tokens=te.tokenize(),x},W.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x,Y=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=`
|
|
|
`,Y&&l.lineBreak.test(Y||"")&&(te=Y.match(l.lineBreak)[0]));for(var Se=this._tokens.next();Se;)this.handle_token(Se),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Se,Se=this._tokens.next();return x=this._output.get_code(te),x},W.prototype.handle_token=function(x,Y){x.type===L.START_EXPR?this.handle_start_expr(x):x.type===L.END_EXPR?this.handle_end_expr(x):x.type===L.START_BLOCK?this.handle_start_block(x):x.type===L.END_BLOCK?this.handle_end_block(x):x.type===L.WORD?this.handle_word(x):x.type===L.RESERVED?this.handle_word(x):x.type===L.SEMICOLON?this.handle_semicolon(x):x.type===L.STRING?this.handle_string(x):x.type===L.EQUALS?this.handle_equals(x):x.type===L.OPERATOR?this.handle_operator(x):x.type===L.COMMA?this.handle_comma(x):x.type===L.BLOCK_COMMENT?this.handle_block_comment(x,Y):x.type===L.COMMENT?this.handle_comment(x,Y):x.type===L.DOT?this.handle_dot(x):x.type===L.EOF?this.handle_eof(x):x.type===L.UNKNOWN?this.handle_unknown(x,Y):this.handle_unknown(x,Y)},W.prototype.handle_whitespace_and_comments=function(x,Y){var te=x.newlines,Se=this._options.keep_array_indentation&&z(this._flags.mode);if(x.comments_before)for(var Ie=x.comments_before.next();Ie;)this.handle_whitespace_and_comments(Ie,Y),this.handle_token(Ie,Y),Ie=x.comments_before.next();if(Se)for(var Ge=0;Ge<te;Ge+=1)this.print_newline(Ge>0,Y);else if(this._options.max_preserve_newlines&&te>this._options.max_preserve_newlines&&(te=this._options.max_preserve_newlines),this._options.preserve_newlines&&te>1){this.print_newline(!1,Y);for(var Ee=1;Ee<te;Ee+=1)this.print_newline(!0,Y)}};var R=["async","break","continue","return","throw","yield"];W.prototype.allow_wrap_or_preserved_newline=function(x,Y){if(Y=Y===void 0?!1:Y,!this._output.just_added_newline()){var te=this._options.preserve_newlines&&x.newlines||Y,Se=C(this._flags.last_token.text,D)||C(x.text,D);if(Se){var Ie=C(this._flags.last_token.text,D)&&C(this._options.operator_position,V)||C(x.text,D);te=te&&Ie}if(te)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(N(this._flags.last_token,R))return;this._output.set_wrap_point()}}},W.prototype.print_newline=function(x,Y){if(!Y&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==L.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var te=this._tokens.peek();this._flags.mode===ne.Statement&&!(this._flags.if_block&&U(te,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(x)&&(this._flags.multiline_frame=!0)},W.prototype.print_token_line_indentation=function(x){this._output.just_added_newline()&&(this._options.keep_array_indentation&&x.newlines&&(x.text==="["||z(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(x.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))},W.prototype.print_token=function(x){if(this._output.raw){this._output.add_raw_token(x);return}if(this._options.comma_first&&x.previous&&x.previous.type===L.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var Y=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(Y),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(x),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(x),this._output.non_breaking_space=!0,this._output.add_token(x.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},W.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},W.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))},W.prototype.set_mode=function(x){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,x),this._flags=this.create_flags(this._previous_flags,x),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},W.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===ne.Statement&&oe(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},W.prototype.start_of_object_property=function(){return this._flags.parent.mode===ne.ObjectLiteral&&this._flags.mode===ne.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||N(this._flags.last_token,["get","set"]))},W.prototype.start_of_statement=function(x){var Y=!1;return Y=Y||N(this._flags.last_token,["var","let","const"])&&x.type===L.WORD,Y=Y||U(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===ne.ObjectLiteral&&this._flags.mode===ne.Statement)&&N(this._flags.last_token,R)&&!x.newlines,Y=Y||U(this._flags.last_token,"else")&&!(U(x,"if")&&!x.comments_before),Y=Y||this._flags.last_token.type===L.END_EXPR&&(this._previous_flags.mode===ne.ForInitializer||this._previous_flags.mode===ne.Conditional),Y=Y||this._flags.last_token.type===L.WORD&&this._flags.mode===ne.BlockStatement&&!this._flags.in_case&&!(x.text==="--"||x.text==="++")&&this._last_last_text!=="function"&&x.type!==L.WORD&&x.type!==L.RESERVED,Y=Y||this._flags.mode===ne.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||N(this._flags.last_token,["get","set"])),Y?(this.set_mode(ne.Statement),this.indent(),this.handle_whitespace_and_comments(x,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x,N(x,["do","for","if","while"])),!0):!1},W.prototype.handle_start_expr=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x);var Y=ne.Expression;if(x.text==="["){if(this._flags.last_token.type===L.WORD||this._flags.last_token.text===")"){N(this._flags.last_token,E)&&(this._output.space_before_token=!0),this.print_token(x),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=ne.ArrayLiteral,z(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()),C(this._flags.last_token.type,[L.START_EXPR,L.END_EXPR,L.WORD,L.OPERATOR,L.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===L.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,Y=ne.ForInitializer):C(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=ne.Conditional):C(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&x.whitespace_before===""?this._output.space_before_token=!1:(C(this._flags.last_token.text,E)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x);else if(this._flags.last_token.type===L.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var Se=this._tokens.peek(-4);N(te,["async","function"])||te.text==="*"&&N(Se,["async","function"])?this._output.space_before_token=!0:this._flags.mode===ne.ObjectLiteral?(te.text==="{"||te.text===","||te.text==="*"&&(Se.text==="{"||Se.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(x);(this._flags.last_token.type===L.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(C(this._last_last_text,["function","yield"])||this._flags.mode===ne.ObjectLiteral&&C(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===L.START_BLOCK?this.print_newline():(this._flags.last_token.type===L.END_EXPR||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===L.COMMA)&&this.allow_wrap_or_preserved_newline(x,x.newlines),this.print_token(x),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},W.prototype.handle_end_expr=function(x){for(;this._flags.mode===ne.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(x,x.text==="]"&&z(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===L.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(x),this.restore_mode(),oe(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===ne.Conditional&&(this._previous_flags.mode=ne.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},W.prototype.handle_start_block=function(x){this.handle_whitespace_and_comments(x);var Y=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===L.END_EXPR?(this.set_mode(ne.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(ne.BlockStatement):te&&(C(te.text,[":",","])&&C(Y.type,[L.STRING,L.WORD,L.RESERVED])||C(Y.text,["get","set","..."])&&C(te.type,[L.WORD,L.RESERVED]))?C(this._last_last_text,["class","interface"])&&!C(te.text,[":",","])?this.set_mode(ne.BlockStatement):this.set_mode(ne.ObjectLiteral):this._flags.last_token.type===L.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(ne.BlockStatement):C(this._flags.last_token.type,[L.EQUALS,L.START_EXPR,L.COMMA,L.OPERATOR])||N(this._flags.last_token,["return","throw","import","default"])?this.set_mode(ne.ObjectLiteral):this.set_mode(ne.BlockStatement),this._flags.last_token&&N(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var Se=!Y.comments_before&&Y.text==="}",Ie=Se&&this._flags.last_word==="function"&&this._flags.last_token.type===L.END_EXPR;if(this._options.brace_preserve_inline){var Ge=0,Ee=null;this._flags.inline_frame=!0;do if(Ge+=1,Ee=this._tokens.peek(Ge-1),Ee.newlines){this._flags.inline_frame=!1;break}while(Ee.type!==L.EOF&&!(Ee.type===L.END_BLOCK&&Ee.opened===x))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==L.OPERATOR&&(Ie||this._flags.last_token.type===L.EQUALS||N(this._flags.last_token,$)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(z(this._previous_flags.mode)&&(this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.COMMA)&&((this._flags.last_token.type===L.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(x),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==L.OPERATOR&&this._flags.last_token.type!==L.START_EXPR&&(C(this._flags.last_token.type,[L.START_BLOCK,L.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(x),this.indent(),!Se&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},W.prototype.handle_end_block=function(x){for(this.handle_whitespace_and_comments(x);this._flags.mode===ne.Statement;)this.restore_mode();var Y=this._flags.last_token.type===L.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(z(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(x)},W.prototype.handle_word=function(x){if(x.type===L.RESERVED){if(C(x.text,["set","get"])&&this._flags.mode!==ne.ObjectLiteral)x.type=L.WORD;else if(x.text==="import"&&C(this._tokens.peek().text,["(","."]))x.type=L.WORD;else if(C(x.text,["as","from"])&&!this._flags.import_block)x.type=L.WORD;else if(this._flags.mode===ne.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(x.type=L.WORD)}}if(this.start_of_statement(x)?N(this._flags.last_token,["var","let","const"])&&x.type===L.WORD&&(this._flags.declaration_statement=!0):x.newlines&&!X(this._flags.mode)&&(this._flags.last_token.type!==L.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==L.EQUALS&&(this._options.preserve_newlines||!N(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(x),this.print_newline()):this.handle_whitespace_and_comments(x),this._flags.do_block&&!this._flags.do_while)if(U(x,"while")){this._output.space_before_token=!0,this.print_token(x),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&&U(x,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===ne.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&N(x,["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(x),this._flags.in_case=!0;return}if((this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR)&&!this.start_of_object_property()&&!(C(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===ne.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(x),U(x,"function")){(C(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(C(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===L.OPERATOR))&&!this._output.just_added_blankline()&&!x.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD?N(this._flags.last_token,["get","set","new","export"])||N(this._flags.last_token,R)?this._output.space_before_token=!0:U(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===L.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(X(this._flags.mode)||z(this._flags.mode))||this.print_newline(),this.print_token(x),this._flags.last_word=x.text;return}var te="NONE";if(this._flags.last_token.type===L.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":N(x,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===L.SEMICOLON&&this._flags.mode===ne.BlockStatement?te="NEWLINE":this._flags.last_token.type===L.SEMICOLON&&X(this._flags.mode)?te="SPACE":this._flags.last_token.type===L.STRING?te="NEWLINE":this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD||this._flags.last_token.text==="*"&&(C(this._last_last_text,["function","yield"])||this._flags.mode===ne.ObjectLiteral&&C(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===L.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===L.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),N(x,E)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?te="SPACE":te="NEWLINE"),N(x,["else","catch","finally"]))if((!(this._flags.last_token.type===L.END_BLOCK&&this._previous_flags.mode===ne.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Se=this._output.current_line;Se.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else te==="NEWLINE"?N(this._flags.last_token,$)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&N(x,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==L.END_EXPR?(this._flags.last_token.type!==L.START_EXPR||!N(x,["var","let","const"]))&&this._flags.last_token.text!==":"&&(U(x,"if")&&U(x.previous,"else")?this._output.space_before_token=!0:this.print_newline()):N(x,E)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&z(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():te==="SPACE"&&(this._output.space_before_token=!0);x.previous&&(x.previous.type===L.WORD||x.previous.type===L.RESERVED)&&(this._output.space_before_token=!0),this.print_token(x),this._flags.last_word=x.text,x.type===L.RESERVED&&(x.text==="do"?this._flags.do_block=!0:x.text==="if"?this._flags.if_block=!0:x.text==="import"?this._flags.import_block=!0:this._flags.import_block&&U(x,"from")&&(this._flags.import_block=!1))},W.prototype.handle_semicolon=function(x){this.start_of_statement(x)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(x);for(var Y=this._tokens.peek();this._flags.mode===ne.Statement&&!(this._flags.if_block&&U(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(x)},W.prototype.handle_string=function(x){x.text.startsWith("`")&&x.newlines===0&&x.whitespace_before===""&&(x.previous.text===")"||this._flags.last_token.type===L.WORD)||(this.start_of_statement(x)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(x),this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x):x.text.startsWith("`")&&this._flags.last_token.type===L.END_EXPR&&(x.previous.text==="]"||x.previous.text===")")&&x.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(x)},W.prototype.handle_equals=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0},W.prototype.handle_comma=function(x){this.handle_whitespace_and_comments(x,!0),this.print_token(x),this._output.space_before_token=!0,this._flags.declaration_statement?(X(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(x)):this._flags.mode===ne.ObjectLiteral||this._flags.mode===ne.Statement&&this._flags.parent.mode===ne.ObjectLiteral?(this._flags.mode===ne.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)},W.prototype.handle_operator=function(x){var Y=x.text==="*"&&(N(this._flags.last_token,["function","yield"])||C(this._flags.last_token.type,[L.START_BLOCK,L.COMMA,L.END_BLOCK,L.SEMICOLON])),te=C(x.text,["-","+"])&&(C(this._flags.last_token.type,[L.START_BLOCK,L.START_EXPR,L.EQUALS,L.OPERATOR])||C(this._flags.last_token.text,E)||this._flags.last_token.text===",");if(!this.start_of_statement(x)){var Se=!Y;this.handle_whitespace_and_comments(x,Se)}if(x.text==="*"&&this._flags.last_token.type===L.DOT){this.print_token(x);return}if(x.text==="::"){this.print_token(x);return}if(C(x.text,["-","+"])&&this.start_of_object_property()){this.print_token(x);return}if(this._flags.last_token.type===L.OPERATOR&&C(this._options.operator_position,V)&&this.allow_wrap_or_preserved_newline(x),x.text===":"&&this._flags.in_case){this.print_token(x),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==L.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 Ie=!0,Ge=!0,Ee=!1;if(x.text===":"?this._flags.ternary_depth===0?Ie=!1:(this._flags.ternary_depth-=1,Ee=!0):x.text==="?"&&(this._flags.ternary_depth+=1),!te&&!Y&&this._options.preserve_newlines&&C(x.text,D)){var ze=x.text===":",He=ze&&Ee,Be=ze&&!Ee;switch(this._options.operator_position){case q.before_newline:this._output.space_before_token=!Be,this.print_token(x),(!ze||He)&&this.allow_wrap_or_preserved_newline(x),this._output.space_before_token=!0;return;case q.after_newline:this._output.space_before_token=!0,!ze||He?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(x):this._output.space_before_token=!1,this.print_token(x),this._output.space_before_token=!0;return;case q.preserve_newline:Be||this.allow_wrap_or_preserved_newline(x),Ie=!(this._output.just_added_newline()||Be),this._output.space_before_token=Ie,this.print_token(x),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(x),Ie=!1;var lt=this._tokens.peek();Ge=lt&&C(lt.type,[L.WORD,L.RESERVED])}else if(x.text==="...")this.allow_wrap_or_preserved_newline(x),Ie=this._flags.last_token.type===L.START_BLOCK,Ge=!1;else if(C(x.text,["--","++","!","~"])||te){if((this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR)&&this.allow_wrap_or_preserved_newline(x),Ie=!1,Ge=!1,x.newlines&&(x.text==="--"||x.text==="++"||x.text==="~")){var At=N(this._flags.last_token,$)&&x.newlines;At&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(At,!0)}this._flags.last_token.text===";"&&X(this._flags.mode)&&(Ie=!0),this._flags.last_token.type===L.RESERVED?Ie=!0:this._flags.last_token.type===L.END_EXPR?Ie=!(this._flags.last_token.text==="]"&&(x.text==="--"||x.text==="++")):this._flags.last_token.type===L.OPERATOR&&(Ie=C(x.text,["--","-","++","+"])&&C(this._flags.last_token.text,["--","-","++","+"]),C(x.text,["+","-"])&&C(this._flags.last_token.text,["--","++"])&&(Ge=!0)),(this._flags.mode===ne.BlockStatement&&!this._flags.inline_frame||this._flags.mode===ne.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Ie,this.print_token(x),this._output.space_before_token=Ge},W.prototype.handle_block_comment=function(x,Y){if(this._output.raw){this._output.add_raw_token(x),x.directives&&x.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(x.directives){this.print_newline(!1,Y),this.print_token(x),x.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!l.newline.test(x.text)&&!x.newlines){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0;return}else this.print_block_commment(x,Y)},W.prototype.print_block_commment=function(x,Y){var te=J(x.text),Se,Ie=!1,Ge=!1,Ee=x.whitespace_before,ze=Ee.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(x),this._output.add_token(te[0]),this.print_newline(!1,Y),te.length>1){for(te=te.slice(1),Ie=B(te,"*"),Ge=G(te,Ee),Ie&&(this._flags.alignment=1),Se=0;Se<te.length;Se++)Ie?(this.print_token_line_indentation(x),this._output.add_token(A(te[Se]))):Ge&&te[Se]?(this.print_token_line_indentation(x),this._output.add_token(te[Se].substring(ze))):(this._output.current_line.set_indent(-1),this._output.add_token(te[Se])),this.print_newline(!1,Y);this._flags.alignment=0}},W.prototype.handle_comment=function(x,Y){x.newlines?this.print_newline(!1,Y):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(x),this.print_newline(!1,Y)},W.prototype.handle_dot=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),N(this._flags.last_token,$)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(x,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(x)},W.prototype.handle_unknown=function(x,Y){this.print_token(x),x.text[x.text.length-1]===`
|
|
|
`&&this.print_newline(!1,Y)},W.prototype.handle_eof=function(x){for(;this._flags.mode===ne.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x)},m.exports.Beautifier=W},function(m){function n(c){this.__parent=c,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=[]}n.prototype.clone_empty=function(){var c=new n(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},n.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},n.prototype.has_match=function(c){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(c))return!0;return!1},n.prototype.set_indent=function(c,l){this.is_empty()&&(this.__indent_count=c||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},n.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)},n.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},n.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var c=this.__parent.current_line;return c.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),c.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),c.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,c.__items[0]===" "&&(c.__items.splice(0,1),c.__character_count-=1),!0}return!1},n.prototype.is_empty=function(){return this.__items.length===0},n.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},n.prototype.push=function(c){this.__items.push(c);var l=c.lastIndexOf(`
|
|
|
`);l!==-1?this.__character_count=c.length-l:this.__character_count+=c.length},n.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},n.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},n.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},n.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},n.prototype.toString=function(){var c="";return this.is_empty()?this.__parent.indent_empty_lines&&(c=this.__parent.get_indent_string(this.__indent_count)):(c=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),c+=this.__items.join("")),c};function y(c,l){this.__cache=[""],this.__indent_size=c.indent_size,this.__indent_string=c.indent_char,c.indent_with_tabs||(this.__indent_string=new Array(c.indent_size+1).join(c.indent_char)),l=l||"",c.indent_level>0&&(l=new Array(c.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}y.prototype.get_indent_size=function(c,l){var u=this.__base_string_length;return l=l||0,c<0&&(u=0),u+=c*this.__indent_size,u+=l,u},y.prototype.get_indent_string=function(c,l){var u=this.__base_string;return l=l||0,c<0&&(c=0,u=""),l+=c*this.__indent_size,this.__ensure_cache(l),u+=this.__cache[l],u},y.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var c=this.__cache.length,l=0,u="";this.__indent_size&&c>=this.__indent_size&&(l=Math.floor(c/this.__indent_size),c-=l*this.__indent_size,u=new Array(l+1).join(this.__indent_string)),c&&(u+=new Array(c+1).join(" ")),this.__cache.push(u)};function f(c,l){this.__indent_cache=new y(c,l),this.raw=!1,this._end_with_newline=c.end_with_newline,this.indent_size=c.indent_size,this.wrap_line_length=c.wrap_line_length,this.indent_empty_lines=c.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new n(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(c,l){return this.__indent_cache.get_indent_string(c,l)},f.prototype.get_indent_size=function(c,l){return this.__indent_cache.get_indent_size(c,l)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(c){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
|
|
|
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
|
|
|
`);return c!==`
|
|
|
`&&(u=u.replace(/[\n]/g,c)),u},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(c,l){return c=c||0,l=l||0,this.next_line.set_indent(c,l),this.__lines.length>1?(this.current_line.set_indent(c,l),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(c){for(var l=0;l<c.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(c.whitespace_before),this.current_line.push(c.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(c){this.__add_space_before_token(),this.current_line.push(c),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.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(" "))},f.prototype.remove_indent=function(c){for(var l=this.__lines.length;c<l;)this.__lines[c]._remove_indent(),c++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(c){for(c=c===void 0?!1:c,this.current_line.trim();c&&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},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(c,l){for(var u=this.__lines.length-2;u>=0;){var p=this.__lines[u];if(p.is_empty())break;if(p.item(0).indexOf(c)!==0&&p.item(-1)!==l){this.__lines.splice(u+1,0,new n(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},m.exports.Output=f},function(m){function n(y,f,c,l){this.type=y,this.text=f,this.comments_before=null,this.newlines=c||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}m.exports.Token=n},function(m,n){var y="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",c="\\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",l="\\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",u="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",p="(?:"+u+"|["+y+c+"])",E="(?:"+u+"|["+f+c+l+"])*";n.identifier=new RegExp(p+E,"g"),n.identifierStart=new RegExp(p),n.identifierMatch=new RegExp("(?:"+u+"|["+f+c+l+"])+");var D=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;n.newline=/[\n\r\u2028\u2029]/,n.lineBreak=new RegExp(`\r
|
|
|
|`+n.newline.source),n.allLineBreaks=new RegExp(n.lineBreak.source,"g")},function(m,n,y){var f=y(6).Options,c=["before-newline","after-newline","preserve-newline"];function l(u){f.call(this,u,"js");var p=this.raw_options.brace_style||null;p==="expand-strict"?this.raw_options.brace_style="expand":p==="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 E=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var D=0;D<E.length;D++)E[D]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=E[D];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",c),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}l.prototype=new f,m.exports.Options=l},function(m){function n(c,l){this.raw_options=y(c,l),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"])}n.prototype._get_array=function(c,l){var u=this.raw_options[c],p=l||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(p=u.concat()):typeof u=="string"&&(p=u.split(/[^a-zA-Z0-9_\/\-]+/)),p},n.prototype._get_boolean=function(c,l){var u=this.raw_options[c],p=u===void 0?!!l:!!u;return p},n.prototype._get_characters=function(c,l){var u=this.raw_options[c],p=l||"";return typeof u=="string"&&(p=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),p},n.prototype._get_number=function(c,l){var u=this.raw_options[c];l=parseInt(l,10),isNaN(l)&&(l=0);var p=parseInt(u,10);return isNaN(p)&&(p=l),p},n.prototype._get_selection=function(c,l,u){var p=this._get_selection_list(c,l,u);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+c+`' can only be one of the following values:
|
|
|
`+l+`
|
|
|
You passed in: '`+this.raw_options[c]+"'");return p[0]},n.prototype._get_selection_list=function(c,l,u){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[l[0]],!this._is_valid_selection(u,l))throw new Error("Invalid Default Value!");var p=this._get_array(c,u);if(!this._is_valid_selection(p,l))throw new Error("Invalid Option Value: The option '"+c+`' can contain only the following values:
|
|
|
`+l+`
|
|
|
You passed in: '`+this.raw_options[c]+"'");return p},n.prototype._is_valid_selection=function(c,l){return c.length&&l.length&&!c.some(function(u){return l.indexOf(u)===-1})};function y(c,l){var u={};c=f(c);var p;for(p in c)p!==l&&(u[p]=c[p]);if(l&&c[l])for(p in c[l])u[p]=c[l][p];return u}function f(c){var l={},u;for(u in c){var p=u.replace(/-/g,"_");l[p]=c[u]}return l}m.exports.Options=n,m.exports.normalizeOpts=f,m.exports.mergeOpts=y},function(m,n,y){var f=y(8).InputScanner,c=y(9).Tokenizer,l=y(9).TOKEN,u=y(13).Directives,p=y(4),E=y(12).Pattern,D=y(14).TemplatablePattern;function L(B,G){return G.indexOf(B)!==-1}var C={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:l.START,RAW:l.RAW,EOF:l.EOF},A=new u(/\/\*/,/\*\//),P=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,U=/[0-9]/,N=/[^\d\.]/,$=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),F=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";F=F.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),F="\\?\\.(?!\\d) "+F,F=F.replace(/ /g,"|");var q=new RegExp(F),V="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),ne=V.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),oe=new RegExp("^(?:"+ne.join("|")+")$"),J,z=function(B,G){c.call(this,B,G),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var W=new E(this._input),R=new D(this._input).read_options(this._options);this.__patterns={template:R,identifier:R.starting_with(p.identifier).matching(p.identifierMatch),number:W.matching(P),punct:W.matching(q),comment:W.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:W.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:W.matching(/<!--/),html_comment_end:W.matching(/-->/),include:W.starting_with(/#include/).until_after(p.lineBreak),shebang:W.starting_with(/#!/).until_after(p.lineBreak),xml:W.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:R.until(/['\\\n\r\u2028\u2029]/),double_quote:R.until(/["\\\n\r\u2028\u2029]/),template_text:R.until(/[`\\$]/),template_expression:R.until(/[`}\\]/)}};z.prototype=new c,z.prototype._is_comment=function(B){return B.type===C.COMMENT||B.type===C.BLOCK_COMMENT||B.type===C.UNKNOWN},z.prototype._is_opening=function(B){return B.type===C.START_BLOCK||B.type===C.START_EXPR},z.prototype._is_closing=function(B,G){return(B.type===C.END_BLOCK||B.type===C.END_EXPR)&&G&&(B.text==="]"&&G.text==="["||B.text===")"&&G.text==="("||B.text==="}"&&G.text==="{")},z.prototype._reset=function(){J=!1},z.prototype._get_next_token=function(B,G){var W=null;this._readWhitespace();var R=this._input.peek();return R===null?this._create_token(C.EOF,""):(W=W||this._read_non_javascript(R),W=W||this._read_string(R),W=W||this._read_pair(R,this._input.peek(1)),W=W||this._read_word(B),W=W||this._read_singles(R),W=W||this._read_comment(R),W=W||this._read_regexp(R,B),W=W||this._read_xml(R,B),W=W||this._read_punctuation(),W=W||this._create_token(C.UNKNOWN,this._input.next()),W)},z.prototype._read_word=function(B){var G;if(G=this.__patterns.identifier.read(),G!=="")return G=G.replace(p.allLineBreaks,`
|
|
|
`),!(B.type===C.DOT||B.type===C.RESERVED&&(B.text==="set"||B.text==="get"))&&oe.test(G)?(G==="in"||G==="of")&&(B.type===C.WORD||B.type===C.STRING)?this._create_token(C.OPERATOR,G):this._create_token(C.RESERVED,G):this._create_token(C.WORD,G);if(G=this.__patterns.number.read(),G!=="")return this._create_token(C.WORD,G)},z.prototype._read_singles=function(B){var G=null;return B==="("||B==="["?G=this._create_token(C.START_EXPR,B):B===")"||B==="]"?G=this._create_token(C.END_EXPR,B):B==="{"?G=this._create_token(C.START_BLOCK,B):B==="}"?G=this._create_token(C.END_BLOCK,B):B===";"?G=this._create_token(C.SEMICOLON,B):B==="."&&N.test(this._input.peek(1))?G=this._create_token(C.DOT,B):B===","&&(G=this._create_token(C.COMMA,B)),G&&this._input.next(),G},z.prototype._read_pair=function(B,G){var W=null;return B==="#"&&G==="{"&&(W=this._create_token(C.START_BLOCK,B+G)),W&&(this._input.next(),this._input.next()),W},z.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(C.EQUALS,B):B==="?."?this._create_token(C.DOT,B):this._create_token(C.OPERATOR,B)},z.prototype._read_non_javascript=function(B){var G="";if(B==="#"){if(this._is_first_token()&&(G=this.__patterns.shebang.read(),G))return this._create_token(C.UNKNOWN,G.trim()+`
|
|
|
`);if(G=this.__patterns.include.read(),G)return this._create_token(C.UNKNOWN,G.trim()+`
|
|
|
`);B=this._input.next();var W="#";if(this._input.hasNext()&&this._input.testChar(U)){do B=this._input.next(),W+=B;while(this._input.hasNext()&&B!=="#"&&B!=="=");return B==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(W+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(W+="{}",this._input.next(),this._input.next())),this._create_token(C.WORD,W)}this._input.back()}else if(B==="<"&&this._is_first_token()){if(G=this.__patterns.html_comment_start.read(),G){for(;this._input.hasNext()&&!this._input.testChar(p.newline);)G+=this._input.next();return J=!0,this._create_token(C.COMMENT,G)}}else if(J&&B==="-"&&(G=this.__patterns.html_comment_end.read(),G))return J=!1,this._create_token(C.COMMENT,G);return null},z.prototype._read_comment=function(B){var G=null;if(B==="/"){var W="";if(this._input.peek(1)==="*"){W=this.__patterns.block_comment.read();var R=A.get_directives(W);R&&R.ignore==="start"&&(W+=A.readIgnored(this._input)),W=W.replace(p.allLineBreaks,`
|
|
|
`),G=this._create_token(C.BLOCK_COMMENT,W),G.directives=R}else this._input.peek(1)==="/"&&(W=this.__patterns.comment.read(),G=this._create_token(C.COMMENT,W))}return G},z.prototype._read_string=function(B){if(B==="`"||B==="'"||B==='"'){var G=this._input.next();return this.has_char_escapes=!1,B==="`"?G+=this._read_string_recursive("`",!0,"${"):G+=this._read_string_recursive(B),this.has_char_escapes&&this._options.unescape_strings&&(G=X(G)),this._input.peek()===B&&(G+=this._input.next()),G=G.replace(p.allLineBreaks,`
|
|
|
`),this._create_token(C.STRING,G)}return null},z.prototype._allow_regexp_or_xml=function(B){return B.type===C.RESERVED&&L(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===C.END_EXPR&&B.text===")"&&B.opened.previous.type===C.RESERVED&&L(B.opened.previous.text,["if","while","for"])||L(B.type,[C.COMMENT,C.START_EXPR,C.START_BLOCK,C.START,C.END_BLOCK,C.OPERATOR,C.EQUALS,C.EOF,C.SEMICOLON,C.COMMA])},z.prototype._read_regexp=function(B,G){if(B==="/"&&this._allow_regexp_or_xml(G)){for(var W=this._input.next(),R=!1,x=!1;this._input.hasNext()&&(R||x||this._input.peek()!==B)&&!this._input.testChar(p.newline);)W+=this._input.peek(),R?R=!1:(R=this._input.peek()==="\\",this._input.peek()==="["?x=!0:this._input.peek()==="]"&&(x=!1)),this._input.next();return this._input.peek()===B&&(W+=this._input.next(),W+=this._input.read(p.identifier)),this._create_token(C.STRING,W)}return null},z.prototype._read_xml=function(B,G){if(this._options.e4x&&B==="<"&&this._allow_regexp_or_xml(G)){var W="",R=this.__patterns.xml.read_match();if(R){for(var x=R[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=x.indexOf("{")===0,te=0;R;){var Se=!!R[1],Ie=R[2],Ge=!!R[R.length-1]||Ie.slice(0,8)==="![CDATA[";if(!Ge&&(Ie===x||Y&&Ie.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Se?--te:++te),W+=R[0],te<=0)break;R=this.__patterns.xml.read_match()}return R||(W+=this._input.match(/[\s\S]*/g)[0]),W=W.replace(p.allLineBreaks,`
|
|
|
`),this._create_token(C.STRING,W)}}return null};function X(B){for(var G="",W=0,R=new f(B),x=null;R.hasNext();)if(x=R.match(/([\s]|[^\\]|\\\\)+/g),x&&(G+=x[0]),R.peek()==="\\"){if(R.next(),R.peek()==="x")x=R.match(/x([0-9A-Fa-f]{2})/g);else if(R.peek()==="u")x=R.match(/u([0-9A-Fa-f]{4})/g),x||(x=R.match(/u\{([0-9A-Fa-f]+)\}/g));else{G+="\\",R.hasNext()&&(G+=R.next());continue}if(!x||(W=parseInt(x[1],16),W>126&&W<=255&&x[0].indexOf("x")===0))return B;W>=0&&W<32||W>1114111?G+="\\"+x[0]:W===34||W===39||W===92?G+="\\"+String.fromCharCode(W):G+=String.fromCharCode(W)}return G}z.prototype._read_string_recursive=function(B,G,W){var R,x;B==="'"?x=this.__patterns.single_quote:B==='"'?x=this.__patterns.double_quote:B==="`"?x=this.__patterns.template_text:B==="}"&&(x=this.__patterns.template_expression);for(var Y=x.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===B||!G&&p.newline.test(te)){this._input.back();break}else te==="\\"&&this._input.hasNext()?(R=this._input.peek(),R==="x"||R==="u"?this.has_char_escapes=!0:R==="\r"&&this._input.peek(1)===`
|
|
|
`&&this._input.next(),te+=this._input.next()):W&&(W==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),W===te&&(B==="`"?te+=this._read_string_recursive("}",G,"`"):te+=this._read_string_recursive("`",G,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=x.read(),Y+=te}return Y},m.exports.Tokenizer=z,m.exports.TOKEN=C,m.exports.positionable_operators=$.slice(),m.exports.line_starters=V.slice()},function(m){var n=RegExp.prototype.hasOwnProperty("sticky");function y(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},y.prototype.peek=function(f){var c=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(c=this.__input.charAt(f)),c},y.prototype.__match=function(f,c){f.lastIndex=c;var l=f.exec(this.__input);return l&&!(n&&f.sticky)&&l.index!==c&&(l=null),l},y.prototype.test=function(f,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(f,c):!1},y.prototype.testChar=function(f,c){var l=this.peek(c);return f.lastIndex=0,l!==null&&f.test(l)},y.prototype.match=function(f){var c=this.__match(f,this.__position);return c?this.__position+=c[0].length:c=null,c},y.prototype.read=function(f,c,l){var u="",p;return f&&(p=this.match(f),p&&(u+=p[0])),c&&(p||!f)&&(u+=this.readUntil(c,l)),u},y.prototype.readUntil=function(f,c){var l="",u=this.__position;f.lastIndex=this.__position;var p=f.exec(this.__input);return p?(u=p.index,c&&(u+=p[0].length)):u=this.__input_length,l=this.__input.substring(this.__position,u),this.__position=u,l},y.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},y.prototype.get_regexp=function(f,c){var l=null,u="g";return c&&n&&(u="y"),typeof f=="string"&&f!==""?l=new RegExp(f,u):f&&(l=new RegExp(f.source,u)),l},y.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(f){var c=this.__position,l=this.readUntilAfter(f);return this.__position=c,l},y.prototype.lookBack=function(f){var c=this.__position-1;return c>=f.length&&this.__input.substring(c-f.length,c).toLowerCase()===f},m.exports.InputScanner=y},function(m,n,y){var f=y(8).InputScanner,c=y(3).Token,l=y(10).TokenStream,u=y(11).WhitespacePattern,p={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},E=function(D,L){this._input=new f(D),this._options=L||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new u(this._input)};E.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var D,L=new c(p.START,""),C=null,A=[],P=new l;L.type!==p.EOF;){for(D=this._get_next_token(L,C);this._is_comment(D);)P.add(D),D=this._get_next_token(L,C);P.isEmpty()||(D.comments_before=P,P=new l),D.parent=C,this._is_opening(D)?(A.push(C),C=D):C&&this._is_closing(D,C)&&(D.opened=C,C.closed=D,C=A.pop(),D.parent=C),D.previous=L,L.next=D,this.__tokens.add(D),L=D}return this.__tokens},E.prototype._is_first_token=function(){return this.__tokens.isEmpty()},E.prototype._reset=function(){},E.prototype._get_next_token=function(D,L){this._readWhitespace();var C=this._input.read(/.+/g);return C?this._create_token(p.RAW,C):this._create_token(p.EOF,"")},E.prototype._is_comment=function(D){return!1},E.prototype._is_opening=function(D){return!1},E.prototype._is_closing=function(D,L){return!1},E.prototype._create_token=function(D,L){var C=new c(D,L,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return C},E.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},m.exports.Tokenizer=E,m.exports.TOKEN=p},function(m){function n(y){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=y}n.prototype.restart=function(){this.__position=0},n.prototype.isEmpty=function(){return this.__tokens_length===0},n.prototype.hasNext=function(){return this.__position<this.__tokens_length},n.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__tokens[this.__position],this.__position+=1),y},n.prototype.peek=function(y){var f=null;return y=y||0,y+=this.__position,y>=0&&y<this.__tokens_length&&(f=this.__tokens[y]),f},n.prototype.add=function(y){this.__parent_token&&(y.parent=this.__parent_token),this.__tokens.push(y),this.__tokens_length+=1},m.exports.TokenStream=n},function(m,n,y){var f=y(12).Pattern;function c(l,u){f.call(this,l,u),u?this._line_regexp=this._input.get_regexp(u._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}c.prototype=new f,c.prototype.__set_whitespace_patterns=function(l,u){l+="\\t ",u+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+u+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+u+"]")},c.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var u=this.__split(this._newline_regexp,l);this.newline_count=u.length-1,this.whitespace_before_token=u[this.newline_count]}return l},c.prototype.matching=function(l,u){var p=this._create();return p.__set_whitespace_patterns(l,u),p._update(),p},c.prototype._create=function(){return new c(this._input,this)},c.prototype.__split=function(l,u){l.lastIndex=0;for(var p=0,E=[],D=l.exec(u);D;)E.push(u.substring(p,D.index)),p=D.index+D[0].length,D=l.exec(u);return p<u.length?E.push(u.substring(p,u.length)):E.push(""),E},m.exports.WhitespacePattern=c},function(m){function n(y,f){this._input=y,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,f&&(this._starting_pattern=this._input.get_regexp(f._starting_pattern,!0),this._match_pattern=this._input.get_regexp(f._match_pattern,!0),this._until_pattern=this._input.get_regexp(f._until_pattern),this._until_after=f._until_after)}n.prototype.read=function(){var y=this._input.read(this._starting_pattern);return(!this._starting_pattern||y)&&(y+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),y},n.prototype.read_match=function(){return this._input.match(this._match_pattern)},n.prototype.until_after=function(y){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(y),f._update(),f},n.prototype.until=function(y){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(y),f._update(),f},n.prototype.starting_with=function(y){var f=this._create();return f._starting_pattern=this._input.get_regexp(y,!0),f._update(),f},n.prototype.matching=function(y){var f=this._create();return f._match_pattern=this._input.get_regexp(y,!0),f._update(),f},n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){},m.exports.Pattern=n},function(m){function n(y,f){y=typeof y=="string"?y:y.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+f,"g")}n.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(y);c;)f[c[1]]=c[2],c=this.__directive_pattern.exec(y);return f},n.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},m.exports.Directives=n},function(m,n,y){var f=y(12).Pattern,c={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function l(u,p){f.call(this,u,p),this.__template_pattern=null,this._disabled=Object.assign({},c),this._excluded=Object.assign({},c),p&&(this.__template_pattern=this._input.get_regexp(p.__template_pattern),this._excluded=Object.assign(this._excluded,p._excluded),this._disabled=Object.assign(this._disabled,p._disabled));var E=new f(u);this.__patterns={handlebars_comment:E.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:E.starting_with(/{{{/).until_after(/}}}/),handlebars:E.starting_with(/{{/).until_after(/}}/),php:E.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:E.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:E.starting_with(/{%/).until_after(/%}/),django_value:E.starting_with(/{{/).until_after(/}}/),django_comment:E.starting_with(/{#/).until_after(/#}/),smarty:E.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:E.starting_with(/{\*/).until_after(/\*}/),smarty_literal:E.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new f,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(u){var p=this._create();return p._disabled[u]=!0,p._update(),p},l.prototype.read_options=function(u){var p=this._create();for(var E in c)p._disabled[E]=u.templating.indexOf(E)===-1;return p._update(),p},l.prototype.exclude=function(u){var p=this._create();return p._excluded[u]=!0,p._update(),p},l.prototype.read=function(){var u="";this._match_pattern?u=this._input.read(this._starting_pattern):u=this._input.read(this._starting_pattern,this.__template_pattern);for(var p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),u+=p,p=this._read_template();return this._until_after&&(u+=this._input.readUntilAfter(this._until_pattern)),u},l.prototype.__set_templated_pattern=function(){var u=[];this._disabled.php||u.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||u.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||u.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||u.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(u.push(this.__patterns.django._starting_pattern.source),u.push(this.__patterns.django_value._starting_pattern.source),u.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||u.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&u.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+u.join("|")+")")},l.prototype._read_template=function(){var u="",p=this._input.peek();if(p==="<"){var E=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&E==="?"&&(u=u||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&E==="%"&&(u=u||this.__patterns.erb.read())}else p==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(u=u||this.__patterns.handlebars_comment.read(),u=u||this.__patterns.handlebars_unescaped.read(),u=u||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(u=u||this.__patterns.django_value.read()),this._excluded.django||(u=u||this.__patterns.django_comment.read(),u=u||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(u=u||this.__patterns.smarty_comment.read(),u=u||this.__patterns.smarty_literal.read(),u=u||this.__patterns.smarty.read()));return u},m.exports.TemplatablePattern=l}],w={};function _(m){var n=w[m];if(n!==void 0)return n.exports;var y=w[m]={exports:{}};return T[m](y,y.exports,_),y.exports}var O=_(0);I=O})();var K=I;b=[],k=function(){return{js_beautify:K}}.apply(me,b),k!==void 0&&(dt.exports=k)})()},32834:function(dt){(function(me,b){dt.exports=b()})(this,function(){"use strict";function me(xe,ve){for(var ye=0;ye<ve.length;ye++){var ee=ve[ye];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(xe,ee.key,ee)}}function b(xe,ve,ye){return ve&&me(xe.prototype,ve),ye&&me(xe,ye),xe}function k(xe,ve){if(xe){if(typeof xe=="string")return I(xe,ve);var ye=Object.prototype.toString.call(xe).slice(8,-1);if(ye==="Object"&&xe.constructor&&(ye=xe.constructor.name),ye==="Map"||ye==="Set")return Array.from(xe);if(ye==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ye))return I(xe,ve)}}function I(xe,ve){(ve==null||ve>xe.length)&&(ve=xe.length);for(var ye=0,ee=new Array(ve);ye<ve;ye++)ee[ye]=xe[ye];return ee}function K(xe,ve){var ye=typeof Symbol!="undefined"&&xe[Symbol.iterator]||xe["@@iterator"];if(ye)return(ye=ye.call(xe)).next.bind(ye);if(Array.isArray(xe)||(ye=k(xe))||ve&&xe&&typeof xe.length=="number"){ye&&(xe=ye);var ee=0;return function(){return ee>=xe.length?{done:!0}:{done:!1,value:xe[ee++]}}}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 T={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 _(xe){T.exports.defaults=xe}T.exports={defaults:w(),getDefaults:w,changeDefaults:_};var O=/[&<>"']/,m=/[&<>"']/g,n=/[<>"']|&(?!#?\w+;)/,y=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(ve){return f[ve]};function l(xe,ve){if(ve){if(O.test(xe))return xe.replace(m,c)}else if(n.test(xe))return xe.replace(y,c);return xe}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function p(xe){return xe.replace(u,function(ve,ye){return ye=ye.toLowerCase(),ye==="colon"?":":ye.charAt(0)==="#"?ye.charAt(1)==="x"?String.fromCharCode(parseInt(ye.substring(2),16)):String.fromCharCode(+ye.substring(1)):""})}var E=/(^|[^\[])\^/g;function D(xe,ve){xe=xe.source||xe,ve=ve||"";var ye={replace:function(ie,ue){return ue=ue.source||ue,ue=ue.replace(E,"$1"),xe=xe.replace(ie,ue),ye},getRegex:function(){return new RegExp(xe,ve)}};return ye}var L=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(xe,ve,ye){if(xe){var ee;try{ee=decodeURIComponent(p(ye)).replace(L,"").toLowerCase()}catch(ie){return null}if(ee.indexOf("javascript:")===0||ee.indexOf("vbscript:")===0||ee.indexOf("data:")===0)return null}ve&&!C.test(ye)&&(ye=F(ve,ye));try{ye=encodeURI(ye).replace(/%25/g,"%")}catch(ie){return null}return ye}var P={},U=/^[^:]+:\/*[^/]*$/,N=/^([^:]+:)[\s\S]*$/,$=/^([^:]+:\/*[^/]*)[\s\S]*$/;function F(xe,ve){P[" "+xe]||(U.test(xe)?P[" "+xe]=xe+"/":P[" "+xe]=oe(xe,"/",!0)),xe=P[" "+xe];var ye=xe.indexOf(":")===-1;return ve.substring(0,2)==="//"?ye?ve:xe.replace(N,"$1")+ve:ve.charAt(0)==="/"?ye?ve:xe.replace($,"$1")+ve:xe+ve}var q={exec:function(){}};function V(xe){for(var ve=1,ye,ee;ve<arguments.length;ve++){ye=arguments[ve];for(ee in ye)Object.prototype.hasOwnProperty.call(ye,ee)&&(xe[ee]=ye[ee])}return xe}function ne(xe,ve){var ye=xe.replace(/\|/g,function(ue,ce,_e){for(var Ve=!1,Ye=ce;--Ye>=0&&_e[Ye]==="\\";)Ve=!Ve;return Ve?"|":" |"}),ee=ye.split(/ \|/),ie=0;if(ee.length>ve)ee.splice(ve);else for(;ee.length<ve;)ee.push("");for(;ie<ee.length;ie++)ee[ie]=ee[ie].trim().replace(/\\\|/g,"|");return ee}function oe(xe,ve,ye){var ee=xe.length;if(ee===0)return"";for(var ie=0;ie<ee;){var ue=xe.charAt(ee-ie-1);if(ue===ve&&!ye)ie++;else if(ue!==ve&&ye)ie++;else break}return xe.substr(0,ee-ie)}function J(xe,ve){if(xe.indexOf(ve[1])===-1)return-1;for(var ye=xe.length,ee=0,ie=0;ie<ye;ie++)if(xe[ie]==="\\")ie++;else if(xe[ie]===ve[0])ee++;else if(xe[ie]===ve[1]&&(ee--,ee<0))return ie;return-1}function z(xe){xe&&xe.sanitize&&!xe.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 X(xe,ve){if(ve<1)return"";for(var ye="";ve>1;)ve&1&&(ye+=xe),ve>>=1,xe+=xe;return ye+xe}var B={escape:l,unescape:p,edit:D,cleanUrl:A,resolveUrl:F,noopTest:q,merge:V,splitCells:ne,rtrim:oe,findClosingBracket:J,checkSanitizeDeprecation:z,repeatString:X},G=T.exports.defaults,W=B.rtrim,R=B.splitCells,x=B.escape,Y=B.findClosingBracket;function te(xe,ve,ye){var ee=ve.href,ie=ve.title?x(ve.title):null,ue=xe[1].replace(/\\([\[\]])/g,"$1");return xe[0].charAt(0)!=="!"?{type:"link",raw:ye,href:ee,title:ie,text:ue}:{type:"image",raw:ye,href:ee,title:ie,text:x(ue)}}function Se(xe,ve){var ye=xe.match(/^(\s+)(?:```)/);if(ye===null)return ve;var ee=ye[1];return ve.split(`
|
|
|
`).map(function(ie){var ue=ie.match(/^\s+/);if(ue===null)return ie;var ce=ue[0];return ce.length>=ee.length?ie.slice(ee.length):ie}).join(`
|
|
|
`)}var Ie=function(){function xe(ye){this.options=ye||G}var ve=xe.prototype;return ve.space=function(ee){var ie=this.rules.block.newline.exec(ee);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
|
|
|
`}},ve.code=function(ee){var ie=this.rules.block.code.exec(ee);if(ie){var ue=ie[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ie[0],codeBlockStyle:"indented",text:this.options.pedantic?ue:W(ue,`
|
|
|
`)}}},ve.fences=function(ee){var ie=this.rules.block.fences.exec(ee);if(ie){var ue=ie[0],ce=Se(ue,ie[3]||"");return{type:"code",raw:ue,lang:ie[2]?ie[2].trim():ie[2],text:ce}}},ve.heading=function(ee){var ie=this.rules.block.heading.exec(ee);if(ie){var ue=ie[2].trim();if(/#$/.test(ue)){var ce=W(ue,"#");(this.options.pedantic||!ce||/ $/.test(ce))&&(ue=ce.trim())}return{type:"heading",raw:ie[0],depth:ie[1].length,text:ue}}},ve.nptable=function(ee){var ie=this.rules.block.nptable.exec(ee);if(ie){var ue={type:"table",header:R(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:ie[0]};if(ue.header.length===ue.align.length){var ce=ue.align.length,_e;for(_e=0;_e<ce;_e++)/^ *-+: *$/.test(ue.align[_e])?ue.align[_e]="right":/^ *:-+: *$/.test(ue.align[_e])?ue.align[_e]="center":/^ *:-+ *$/.test(ue.align[_e])?ue.align[_e]="left":ue.align[_e]=null;for(ce=ue.cells.length,_e=0;_e<ce;_e++)ue.cells[_e]=R(ue.cells[_e],ue.header.length);return ue}}},ve.hr=function(ee){var ie=this.rules.block.hr.exec(ee);if(ie)return{type:"hr",raw:ie[0]}},ve.blockquote=function(ee){var ie=this.rules.block.blockquote.exec(ee);if(ie){var ue=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:ue}}},ve.list=function(ee){var ie=this.rules.block.list.exec(ee);if(ie){var ue=ie[0],ce=ie[2],_e=ce.length>1,Ve={type:"list",raw:ue,ordered:_e,start:_e?+ce.slice(0,-1):"",loose:!1,items:[]},Ye=ie[0].match(this.rules.block.item),at=!1,ft,Lt,Kt,Et,xt,ui,_i,ci,ii,Ut=Ye.length;Kt=this.rules.block.listItemStart.exec(Ye[0]);for(var St=0;St<Ut;St++){if(ft=Ye[St],ue=ft,this.options.pedantic||(ii=ft.match(new RegExp("\\n\\s*\\n {0,"+(Kt[0].length-1)+"}\\S")),ii&&(xt=ft.length-ii.index+Ye.slice(St+1).join(`
|
|
|
`).length,Ve.raw=Ve.raw.substring(0,Ve.raw.length-xt),ft=ft.substring(0,ii.index),ue=ft,Ut=St+1)),St!==Ut-1){if(Et=this.rules.block.listItemStart.exec(Ye[St+1]),this.options.pedantic?Et[1].length>Kt[1].length:Et[1].length>=Kt[0].length||Et[1].length>3){Ye.splice(St,2,Ye[St]+(!this.options.pedantic&&Et[1].length<Kt[0].length&&!Ye[St].match(/\n$/)?"":`
|
|
|
`)+Ye[St+1]),St--,Ut--;continue}else(!this.options.pedantic||this.options.smartLists?Et[2][Et[2].length-1]!==ce[ce.length-1]:_e===(Et[2].length===1))&&(xt=Ye.slice(St+1).join(`
|
|
|
`).length,Ve.raw=Ve.raw.substring(0,Ve.raw.length-xt),St=Ut-1);Kt=Et}Lt=ft.length,ft=ft.replace(/^ *([*+-]|\d+[.)]) ?/,""),~ft.indexOf(`
|
|
|
`)&&(Lt-=ft.length,ft=this.options.pedantic?ft.replace(/^ {1,4}/gm,""):ft.replace(new RegExp("^ {1,"+Lt+"}","gm"),"")),ft=W(ft,`
|
|
|
`),St!==Ut-1&&(ue=ue+`
|
|
|
`),ui=at||/\n\n(?!\s*$)/.test(ue),St!==Ut-1&&(at=ue.slice(-2)===`
|
|
|
|
|
|
`,ui||(ui=at)),ui&&(Ve.loose=!0),this.options.gfm&&(_i=/^\[[ xX]\] /.test(ft),ci=void 0,_i&&(ci=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,""))),Ve.items.push({type:"list_item",raw:ue,task:_i,checked:ci,loose:ui,text:ft})}return Ve}},ve.html=function(ee){var ie=this.rules.block.html.exec(ee);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):x(ie[0]):ie[0]}},ve.def=function(ee){var ie=this.rules.block.def.exec(ee);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var ue=ie[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:ue,raw:ie[0],href:ie[2],title:ie[3]}}},ve.table=function(ee){var ie=this.rules.block.table.exec(ee);if(ie){var ue={type:"table",header:R(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(ue.header.length===ue.align.length){ue.raw=ie[0];var ce=ue.align.length,_e;for(_e=0;_e<ce;_e++)/^ *-+: *$/.test(ue.align[_e])?ue.align[_e]="right":/^ *:-+: *$/.test(ue.align[_e])?ue.align[_e]="center":/^ *:-+ *$/.test(ue.align[_e])?ue.align[_e]="left":ue.align[_e]=null;for(ce=ue.cells.length,_e=0;_e<ce;_e++)ue.cells[_e]=R(ue.cells[_e].replace(/^ *\| *| *\| *$/g,""),ue.header.length);return ue}}},ve.lheading=function(ee){var ie=this.rules.block.lheading.exec(ee);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},ve.paragraph=function(ee){var ie=this.rules.block.paragraph.exec(ee);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
|
|
|
`?ie[1].slice(0,-1):ie[1]}},ve.text=function(ee){var ie=this.rules.block.text.exec(ee);if(ie)return{type:"text",raw:ie[0],text:ie[0]}},ve.escape=function(ee){var ie=this.rules.inline.escape.exec(ee);if(ie)return{type:"escape",raw:ie[0],text:x(ie[1])}},ve.tag=function(ee,ie,ue){var ce=this.rules.inline.tag.exec(ee);if(ce)return!ie&&/^<a /i.test(ce[0])?ie=!0:ie&&/^<\/a>/i.test(ce[0])&&(ie=!1),!ue&&/^<(pre|code|kbd|script)(\s|>)/i.test(ce[0])?ue=!0:ue&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ce[0])&&(ue=!1),{type:this.options.sanitize?"text":"html",raw:ce[0],inLink:ie,inRawBlock:ue,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ce[0]):x(ce[0]):ce[0]}},ve.link=function(ee){var ie=this.rules.inline.link.exec(ee);if(ie){var ue=ie[2].trim();if(!this.options.pedantic&&/^</.test(ue)){if(!/>$/.test(ue))return;var ce=W(ue.slice(0,-1),"\\");if((ue.length-ce.length)%2===0)return}else{var _e=Y(ie[2],"()");if(_e>-1){var Ve=ie[0].indexOf("!")===0?5:4,Ye=Ve+ie[1].length+_e;ie[2]=ie[2].substring(0,_e),ie[0]=ie[0].substring(0,Ye).trim(),ie[3]=""}}var at=ie[2],ft="";if(this.options.pedantic){var Lt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(at);Lt&&(at=Lt[1],ft=Lt[3])}else ft=ie[3]?ie[3].slice(1,-1):"";return at=at.trim(),/^</.test(at)&&(this.options.pedantic&&!/>$/.test(ue)?at=at.slice(1):at=at.slice(1,-1)),te(ie,{href:at&&at.replace(this.rules.inline._escapes,"$1"),title:ft&&ft.replace(this.rules.inline._escapes,"$1")},ie[0])}},ve.reflink=function(ee,ie){var ue;if((ue=this.rules.inline.reflink.exec(ee))||(ue=this.rules.inline.nolink.exec(ee))){var ce=(ue[2]||ue[1]).replace(/\s+/g," ");if(ce=ie[ce.toLowerCase()],!ce||!ce.href){var _e=ue[0].charAt(0);return{type:"text",raw:_e,text:_e}}return te(ue,ce,ue[0])}},ve.emStrong=function(ee,ie,ue){ue===void 0&&(ue="");var ce=this.rules.inline.emStrong.lDelim.exec(ee);if(ce&&!(ce[3]&&ue.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 _e=ce[1]||ce[2]||"";if(!_e||_e&&(ue===""||this.rules.inline.punctuation.exec(ue))){var Ve=ce[0].length-1,Ye,at,ft=Ve,Lt=0,Kt=ce[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Kt.lastIndex=0,ie=ie.slice(-1*ee.length+Ve);(ce=Kt.exec(ie))!=null;)if(Ye=ce[1]||ce[2]||ce[3]||ce[4]||ce[5]||ce[6],!!Ye){if(at=Ye.length,ce[3]||ce[4]){ft+=at;continue}else if((ce[5]||ce[6])&&Ve%3&&!((Ve+at)%3)){Lt+=at;continue}if(ft-=at,!(ft>0))return at=Math.min(at,at+ft+Lt),Math.min(Ve,at)%2?{type:"em",raw:ee.slice(0,Ve+ce.index+at+1),text:ee.slice(1,Ve+ce.index+at)}:{type:"strong",raw:ee.slice(0,Ve+ce.index+at+1),text:ee.slice(2,Ve+ce.index+at-1)}}}}},ve.codespan=function(ee){var ie=this.rules.inline.code.exec(ee);if(ie){var ue=ie[2].replace(/\n/g," "),ce=/[^ ]/.test(ue),_e=/^ /.test(ue)&&/ $/.test(ue);return ce&&_e&&(ue=ue.substring(1,ue.length-1)),ue=x(ue,!0),{type:"codespan",raw:ie[0],text:ue}}},ve.br=function(ee){var ie=this.rules.inline.br.exec(ee);if(ie)return{type:"br",raw:ie[0]}},ve.del=function(ee){var ie=this.rules.inline.del.exec(ee);if(ie)return{type:"del",raw:ie[0],text:ie[2]}},ve.autolink=function(ee,ie){var ue=this.rules.inline.autolink.exec(ee);if(ue){var ce,_e;return ue[2]==="@"?(ce=x(this.options.mangle?ie(ue[1]):ue[1]),_e="mailto:"+ce):(ce=x(ue[1]),_e=ce),{type:"link",raw:ue[0],text:ce,href:_e,tokens:[{type:"text",raw:ce,text:ce}]}}},ve.url=function(ee,ie){var ue;if(ue=this.rules.inline.url.exec(ee)){var ce,_e;if(ue[2]==="@")ce=x(this.options.mangle?ie(ue[0]):ue[0]),_e="mailto:"+ce;else{var Ve;do Ve=ue[0],ue[0]=this.rules.inline._backpedal.exec(ue[0])[0];while(Ve!==ue[0]);ce=x(ue[0]),ue[1]==="www."?_e="http://"+ce:_e=ce}return{type:"link",raw:ue[0],text:ce,href:_e,tokens:[{type:"text",raw:ce,text:ce}]}}},ve.inlineText=function(ee,ie,ue){var ce=this.rules.inline.text.exec(ee);if(ce){var _e;return ie?_e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ce[0]):x(ce[0]):ce[0]:_e=x(this.options.smartypants?ue(ce[0]):ce[0]),{type:"text",raw:ce[0],text:_e}}},xe}(),Ge=B.noopTest,Ee=B.edit,ze=B.merge,He={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:Ge,table:Ge,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};He._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,He._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,He.def=Ee(He.def).replace("label",He._label).replace("title",He._title).getRegex(),He.bullet=/(?:[*+-]|\d{1,9}[.)])/,He.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,He.item=Ee(He.item,"gm").replace(/bull/g,He.bullet).getRegex(),He.listItemStart=Ee(/^( *)(bull) */).replace("bull",He.bullet).getRegex(),He.list=Ee(He.list).replace(/bull/g,He.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+He.def.source+")").getRegex(),He._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",He._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,He.html=Ee(He.html,"i").replace("comment",He._comment).replace("tag",He._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),He.paragraph=Ee(He._paragraph).replace("hr",He.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",He._tag).getRegex(),He.blockquote=Ee(He.blockquote).replace("paragraph",He.paragraph).getRegex(),He.normal=ze({},He),He.gfm=ze({},He.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*|$)"}),He.gfm.nptable=Ee(He.gfm.nptable).replace("hr",He.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",He._tag).getRegex(),He.gfm.table=Ee(He.gfm.table).replace("hr",He.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",He._tag).getRegex(),He.pedantic=ze({},He.normal,{html:Ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",He._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:Ge,paragraph:Ee(He.normal._paragraph).replace("hr",He.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",He.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Be={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ge,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:Ge,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Be._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Be.punctuation=Ee(Be.punctuation).replace(/punctuation/g,Be._punctuation).getRegex(),Be.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Be.escapedEmSt=/\\\*|\\_/g,Be._comment=Ee(He._comment).replace("(?:-->|$)","-->").getRegex(),Be.emStrong.lDelim=Ee(Be.emStrong.lDelim).replace(/punct/g,Be._punctuation).getRegex(),Be.emStrong.rDelimAst=Ee(Be.emStrong.rDelimAst,"g").replace(/punct/g,Be._punctuation).getRegex(),Be.emStrong.rDelimUnd=Ee(Be.emStrong.rDelimUnd,"g").replace(/punct/g,Be._punctuation).getRegex(),Be._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Be._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Be._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])?)+(?![-_])/,Be.autolink=Ee(Be.autolink).replace("scheme",Be._scheme).replace("email",Be._email).getRegex(),Be._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Be.tag=Ee(Be.tag).replace("comment",Be._comment).replace("attribute",Be._attribute).getRegex(),Be._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Be._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Be._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Be.link=Ee(Be.link).replace("label",Be._label).replace("href",Be._href).replace("title",Be._title).getRegex(),Be.reflink=Ee(Be.reflink).replace("label",Be._label).getRegex(),Be.reflinkSearch=Ee(Be.reflinkSearch,"g").replace("reflink",Be.reflink).replace("nolink",Be.nolink).getRegex(),Be.normal=ze({},Be),Be.pedantic=ze({},Be.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:Ee(/^!?\[(label)\]\((.*?)\)/).replace("label",Be._label).getRegex(),reflink:Ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Be._label).getRegex()}),Be.gfm=ze({},Be.normal,{escape:Ee(Be.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Be.gfm.url=Ee(Be.gfm.url,"i").replace("email",Be.gfm._extended_email).getRegex(),Be.breaks=ze({},Be.gfm,{br:Ee(Be.br).replace("{2,}","*").getRegex(),text:Ee(Be.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var lt={block:He,inline:Be},At=Ie,nt=T.exports.defaults,Bt=lt.block,Nt=lt.inline,Le=B.repeatString;function Re(xe){return xe.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 he(xe){var ve="",ye,ee,ie=xe.length;for(ye=0;ye<ie;ye++)ee=xe.charCodeAt(ye),Math.random()>.5&&(ee="x"+ee.toString(16)),ve+="&#"+ee+";";return ve}var Oe=function(){function xe(ye){this.tokens=[],this.tokens.links=Object.create(null),this.options=ye||nt,this.options.tokenizer=this.options.tokenizer||new At,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ee={block:Bt.normal,inline:Nt.normal};this.options.pedantic?(ee.block=Bt.pedantic,ee.inline=Nt.pedantic):this.options.gfm&&(ee.block=Bt.gfm,this.options.breaks?ee.inline=Nt.breaks:ee.inline=Nt.gfm),this.tokenizer.rules=ee}xe.lex=function(ee,ie){var ue=new xe(ie);return ue.lex(ee)},xe.lexInline=function(ee,ie){var ue=new xe(ie);return ue.inlineTokens(ee)};var ve=xe.prototype;return ve.lex=function(ee){return ee=ee.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(ee,this.tokens,!0),this.inline(this.tokens),this.tokens},ve.blockTokens=function(ee,ie,ue){ie===void 0&&(ie=[]),ue===void 0&&(ue=!0),this.options.pedantic&&(ee=ee.replace(/^ +$/gm,""));for(var ce,_e,Ve,Ye;ee;){if(ce=this.tokenizer.space(ee)){ee=ee.substring(ce.raw.length),ce.type&&ie.push(ce);continue}if(ce=this.tokenizer.code(ee)){ee=ee.substring(ce.raw.length),Ye=ie[ie.length-1],Ye&&Ye.type==="paragraph"?(Ye.raw+=`
|
|
|
`+ce.raw,Ye.text+=`
|
|
|
`+ce.text):ie.push(ce);continue}if(ce=this.tokenizer.fences(ee)){ee=ee.substring(ce.raw.length),ie.push(ce);continue}if(ce=this.tokenizer.heading(ee)){ee=ee.substring(ce.raw.length),ie.push(ce);continue}if(ce=this.tokenizer.nptable(ee)){ee=ee.substring(ce.raw.length),ie.push(ce);continue}if(ce=this.tokenizer.hr(ee)){ee=ee.substring(ce.raw.length),ie.push(ce);continue}if(ce=this.tokenizer.blockquote(ee)){ee=ee.substring(ce.raw.length),ce.tokens=this.blockTokens(ce.text,[],ue),ie.push(ce);continue}if(ce=this.tokenizer.list(ee)){for(ee=ee.substring(ce.raw.length),Ve=ce.items.length,_e=0;_e<Ve;_e++)ce.items[_e].tokens=this.blockTokens(ce.items[_e].text,[],!1);ie.push(ce);continue}if(ce=this.tokenizer.html(ee)){ee=ee.substring(ce.raw.length),ie.push(ce);continue}if(ue&&(ce=this.tokenizer.def(ee))){ee=ee.substring(ce.raw.length),this.tokens.links[ce.tag]||(this.tokens.links[ce.tag]={href:ce.href,title:ce.title});continue}if(ce=this.tokenizer.table(ee)){ee=ee.substring(ce.raw.length),ie.push(ce);continue}if(ce=this.tokenizer.lheading(ee)){ee=ee.substring(ce.raw.length),ie.push(ce);continue}if(ue&&(ce=this.tokenizer.paragraph(ee))){ee=ee.substring(ce.raw.length),ie.push(ce);continue}if(ce=this.tokenizer.text(ee)){ee=ee.substring(ce.raw.length),Ye=ie[ie.length-1],Ye&&Ye.type==="text"?(Ye.raw+=`
|
|
|
`+ce.raw,Ye.text+=`
|
|
|
`+ce.text):ie.push(ce);continue}if(ee){var at="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(at);break}else throw new Error(at)}}return ie},ve.inline=function(ee){var ie,ue,ce,_e,Ve,Ye,at=ee.length;for(ie=0;ie<at;ie++)switch(Ye=ee[ie],Ye.type){case"paragraph":case"text":case"heading":{Ye.tokens=[],this.inlineTokens(Ye.text,Ye.tokens);break}case"table":{for(Ye.tokens={header:[],cells:[]},_e=Ye.header.length,ue=0;ue<_e;ue++)Ye.tokens.header[ue]=[],this.inlineTokens(Ye.header[ue],Ye.tokens.header[ue]);for(_e=Ye.cells.length,ue=0;ue<_e;ue++)for(Ve=Ye.cells[ue],Ye.tokens.cells[ue]=[],ce=0;ce<Ve.length;ce++)Ye.tokens.cells[ue][ce]=[],this.inlineTokens(Ve[ce],Ye.tokens.cells[ue][ce]);break}case"blockquote":{this.inline(Ye.tokens);break}case"list":{for(_e=Ye.items.length,ue=0;ue<_e;ue++)this.inline(Ye.items[ue].tokens);break}}return ee},ve.inlineTokens=function(ee,ie,ue,ce){ie===void 0&&(ie=[]),ue===void 0&&(ue=!1),ce===void 0&&(ce=!1);var _e,Ve,Ye=ee,at,ft,Lt;if(this.tokens.links){var Kt=Object.keys(this.tokens.links);if(Kt.length>0)for(;(at=this.tokenizer.rules.inline.reflinkSearch.exec(Ye))!=null;)Kt.includes(at[0].slice(at[0].lastIndexOf("[")+1,-1))&&(Ye=Ye.slice(0,at.index)+"["+Le("a",at[0].length-2)+"]"+Ye.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(at=this.tokenizer.rules.inline.blockSkip.exec(Ye))!=null;)Ye=Ye.slice(0,at.index)+"["+Le("a",at[0].length-2)+"]"+Ye.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(at=this.tokenizer.rules.inline.escapedEmSt.exec(Ye))!=null;)Ye=Ye.slice(0,at.index)+"++"+Ye.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;ee;){if(ft||(Lt=""),ft=!1,_e=this.tokenizer.escape(ee)){ee=ee.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.tag(ee,ue,ce)){ee=ee.substring(_e.raw.length),ue=_e.inLink,ce=_e.inRawBlock;var Et=ie[ie.length-1];Et&&_e.type==="text"&&Et.type==="text"?(Et.raw+=_e.raw,Et.text+=_e.text):ie.push(_e);continue}if(_e=this.tokenizer.link(ee)){ee=ee.substring(_e.raw.length),_e.type==="link"&&(_e.tokens=this.inlineTokens(_e.text,[],!0,ce)),ie.push(_e);continue}if(_e=this.tokenizer.reflink(ee,this.tokens.links)){ee=ee.substring(_e.raw.length);var xt=ie[ie.length-1];_e.type==="link"?(_e.tokens=this.inlineTokens(_e.text,[],!0,ce),ie.push(_e)):xt&&_e.type==="text"&&xt.type==="text"?(xt.raw+=_e.raw,xt.text+=_e.text):ie.push(_e);continue}if(_e=this.tokenizer.emStrong(ee,Ye,Lt)){ee=ee.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],ue,ce),ie.push(_e);continue}if(_e=this.tokenizer.codespan(ee)){ee=ee.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.br(ee)){ee=ee.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.del(ee)){ee=ee.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],ue,ce),ie.push(_e);continue}if(_e=this.tokenizer.autolink(ee,he)){ee=ee.substring(_e.raw.length),ie.push(_e);continue}if(!ue&&(_e=this.tokenizer.url(ee,he))){ee=ee.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.inlineText(ee,ce,Re)){ee=ee.substring(_e.raw.length),_e.raw.slice(-1)!=="_"&&(Lt=_e.raw.slice(-1)),ft=!0,Ve=ie[ie.length-1],Ve&&Ve.type==="text"?(Ve.raw+=_e.raw,Ve.text+=_e.text):ie.push(_e);continue}if(ee){var ui="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(ui);break}else throw new Error(ui)}}return ie},b(xe,null,[{key:"rules",get:function(){return{block:Bt,inline:Nt}}}]),xe}(),We=T.exports.defaults,qe=B.cleanUrl,ae=B.escape,se=function(){function xe(ye){this.options=ye||We}var ve=xe.prototype;return ve.code=function(ee,ie,ue){var ce=(ie||"").match(/\S*/)[0];if(this.options.highlight){var _e=this.options.highlight(ee,ce);_e!=null&&_e!==ee&&(ue=!0,ee=_e)}return ee=ee.replace(/\n$/,"")+`
|
|
|
`,ce?'<pre><code class="'+this.options.langPrefix+ae(ce,!0)+'">'+(ue?ee:ae(ee,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(ue?ee:ae(ee,!0))+`</code></pre>
|
|
|
`},ve.blockquote=function(ee){return`<blockquote>
|
|
|
`+ee+`</blockquote>
|
|
|
`},ve.html=function(ee){return ee},ve.heading=function(ee,ie,ue,ce){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+ce.slug(ue)+'">'+ee+"</h"+ie+`>
|
|
|
`:"<h"+ie+">"+ee+"</h"+ie+`>
|
|
|
`},ve.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},ve.list=function(ee,ie,ue){var ce=ie?"ol":"ul",_e=ie&&ue!==1?' start="'+ue+'"':"";return"<"+ce+_e+`>
|
|
|
`+ee+"</"+ce+`>
|
|
|
`},ve.listitem=function(ee){return"<li>"+ee+`</li>
|
|
|
`},ve.checkbox=function(ee){return"<input "+(ee?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ve.paragraph=function(ee){return"<p>"+ee+`</p>
|
|
|
`},ve.table=function(ee,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+ee+`</thead>
|
|
|
`+ie+`</table>
|
|
|
`},ve.tablerow=function(ee){return`<tr>
|
|
|
`+ee+`</tr>
|
|
|
`},ve.tablecell=function(ee,ie){var ue=ie.header?"th":"td",ce=ie.align?"<"+ue+' align="'+ie.align+'">':"<"+ue+">";return ce+ee+"</"+ue+`>
|
|
|
`},ve.strong=function(ee){return"<strong>"+ee+"</strong>"},ve.em=function(ee){return"<em>"+ee+"</em>"},ve.codespan=function(ee){return"<code>"+ee+"</code>"},ve.br=function(){return this.options.xhtml?"<br/>":"<br>"},ve.del=function(ee){return"<del>"+ee+"</del>"},ve.link=function(ee,ie,ue){if(ee=qe(this.options.sanitize,this.options.baseUrl,ee),ee===null)return ue;var ce='<a href="'+ae(ee)+'"';return ie&&(ce+=' title="'+ie+'"'),ce+=">"+ue+"</a>",ce},ve.image=function(ee,ie,ue){if(ee=qe(this.options.sanitize,this.options.baseUrl,ee),ee===null)return ue;var ce='<img src="'+ee+'" alt="'+ue+'"';return ie&&(ce+=' title="'+ie+'"'),ce+=this.options.xhtml?"/>":">",ce},ve.text=function(ee){return ee},xe}(),pe=function(){function xe(){}var ve=xe.prototype;return ve.strong=function(ee){return ee},ve.em=function(ee){return ee},ve.codespan=function(ee){return ee},ve.del=function(ee){return ee},ve.html=function(ee){return ee},ve.text=function(ee){return ee},ve.link=function(ee,ie,ue){return""+ue},ve.image=function(ee,ie,ue){return""+ue},ve.br=function(){return""},xe}(),ge=function(){function xe(){this.seen={}}var ve=xe.prototype;return ve.serialize=function(ee){return ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ve.getNextSafeSlug=function(ee,ie){var ue=ee,ce=0;if(this.seen.hasOwnProperty(ue)){ce=this.seen[ee];do ce++,ue=ee+"-"+ce;while(this.seen.hasOwnProperty(ue))}return ie||(this.seen[ee]=ce,this.seen[ue]=0),ue},ve.slug=function(ee,ie){ie===void 0&&(ie={});var ue=this.serialize(ee);return this.getNextSafeSlug(ue,ie.dryrun)},xe}(),de=se,Ce=pe,Fe=ge,Te=T.exports.defaults,Ne=B.unescape,Me=function(){function xe(ye){this.options=ye||Te,this.options.renderer=this.options.renderer||new de,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ce,this.slugger=new Fe}xe.parse=function(ee,ie){var ue=new xe(ie);return ue.parse(ee)},xe.parseInline=function(ee,ie){var ue=new xe(ie);return ue.parseInline(ee)};var ve=xe.prototype;return ve.parse=function(ee,ie){ie===void 0&&(ie=!0);var ue="",ce,_e,Ve,Ye,at,ft,Lt,Kt,Et,xt,ui,_i,ci,ii,Ut,St,Ot,Xt,gi=ee.length;for(ce=0;ce<gi;ce++)switch(xt=ee[ce],xt.type){case"space":continue;case"hr":{ue+=this.renderer.hr();continue}case"heading":{ue+=this.renderer.heading(this.parseInline(xt.tokens),xt.depth,Ne(this.parseInline(xt.tokens,this.textRenderer)),this.slugger);continue}case"code":{ue+=this.renderer.code(xt.text,xt.lang,xt.escaped);continue}case"table":{for(Kt="",Lt="",Ye=xt.header.length,_e=0;_e<Ye;_e++)Lt+=this.renderer.tablecell(this.parseInline(xt.tokens.header[_e]),{header:!0,align:xt.align[_e]});for(Kt+=this.renderer.tablerow(Lt),Et="",Ye=xt.cells.length,_e=0;_e<Ye;_e++){for(ft=xt.tokens.cells[_e],Lt="",at=ft.length,Ve=0;Ve<at;Ve++)Lt+=this.renderer.tablecell(this.parseInline(ft[Ve]),{header:!1,align:xt.align[Ve]});Et+=this.renderer.tablerow(Lt)}ue+=this.renderer.table(Kt,Et);continue}case"blockquote":{Et=this.parse(xt.tokens),ue+=this.renderer.blockquote(Et);continue}case"list":{for(ui=xt.ordered,_i=xt.start,ci=xt.loose,Ye=xt.items.length,Et="",_e=0;_e<Ye;_e++)Ut=xt.items[_e],St=Ut.checked,Ot=Ut.task,ii="",Ut.task&&(Xt=this.renderer.checkbox(St),ci?Ut.tokens.length>0&&Ut.tokens[0].type==="text"?(Ut.tokens[0].text=Xt+" "+Ut.tokens[0].text,Ut.tokens[0].tokens&&Ut.tokens[0].tokens.length>0&&Ut.tokens[0].tokens[0].type==="text"&&(Ut.tokens[0].tokens[0].text=Xt+" "+Ut.tokens[0].tokens[0].text)):Ut.tokens.unshift({type:"text",text:Xt}):ii+=Xt),ii+=this.parse(Ut.tokens,ci),Et+=this.renderer.listitem(ii,Ot,St);ue+=this.renderer.list(Et,ui,_i);continue}case"html":{ue+=this.renderer.html(xt.text);continue}case"paragraph":{ue+=this.renderer.paragraph(this.parseInline(xt.tokens));continue}case"text":{for(Et=xt.tokens?this.parseInline(xt.tokens):xt.text;ce+1<gi&&ee[ce+1].type==="text";)xt=ee[++ce],Et+=`
|
|
|
`+(xt.tokens?this.parseInline(xt.tokens):xt.text);ue+=ie?this.renderer.paragraph(Et):Et;continue}default:{var mi='Token with "'+xt.type+'" type was not found.';if(this.options.silent){console.error(mi);return}else throw new Error(mi)}}return ue},ve.parseInline=function(ee,ie){ie=ie||this.renderer;var ue="",ce,_e,Ve=ee.length;for(ce=0;ce<Ve;ce++)switch(_e=ee[ce],_e.type){case"escape":{ue+=ie.text(_e.text);break}case"html":{ue+=ie.html(_e.text);break}case"link":{ue+=ie.link(_e.href,_e.title,this.parseInline(_e.tokens,ie));break}case"image":{ue+=ie.image(_e.href,_e.title,_e.text);break}case"strong":{ue+=ie.strong(this.parseInline(_e.tokens,ie));break}case"em":{ue+=ie.em(this.parseInline(_e.tokens,ie));break}case"codespan":{ue+=ie.codespan(_e.text);break}case"br":{ue+=ie.br();break}case"del":{ue+=ie.del(this.parseInline(_e.tokens,ie));break}case"text":{ue+=ie.text(_e.text);break}default:{var Ye='Token with "'+_e.type+'" type was not found.';if(this.options.silent){console.error(Ye);return}else throw new Error(Ye)}}return ue},xe}(),je=Oe,tt=Me,Ze=Ie,it=se,ht=pe,st=ge,Qe=B.merge,mt=B.checkSanitizeDeprecation,Dt=B.escape,Mt=T.exports.getDefaults,kt=T.exports.changeDefaults,jt=T.exports.defaults;function Je(xe,ve,ye){if(typeof xe=="undefined"||xe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof xe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(xe)+", string expected");if(typeof ve=="function"&&(ye=ve,ve=null),ve=Qe({},Je.defaults,ve||{}),mt(ve),ye){var ee=ve.highlight,ie;try{ie=je.lex(xe,ve)}catch(Ve){return ye(Ve)}var ue=function(Ye){var at;if(!Ye)try{ve.walkTokens&&Je.walkTokens(ie,ve.walkTokens),at=tt.parse(ie,ve)}catch(ft){Ye=ft}return ve.highlight=ee,Ye?ye(Ye):ye(null,at)};if(!ee||ee.length<3||(delete ve.highlight,!ie.length))return ue();var ce=0;Je.walkTokens(ie,function(Ve){Ve.type==="code"&&(ce++,setTimeout(function(){ee(Ve.text,Ve.lang,function(Ye,at){if(Ye)return ue(Ye);at!=null&&at!==Ve.text&&(Ve.text=at,Ve.escaped=!0),ce--,ce===0&&ue()})},0))}),ce===0&&ue();return}try{var _e=je.lex(xe,ve);return ve.walkTokens&&Je.walkTokens(_e,ve.walkTokens),tt.parse(_e,ve)}catch(Ve){if(Ve.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,ve.silent)return"<p>An error occurred:</p><pre>"+Dt(Ve.message+"",!0)+"</pre>";throw Ve}}Je.options=Je.setOptions=function(xe){return Qe(Je.defaults,xe),kt(Je.defaults),Je},Je.getDefaults=Mt,Je.defaults=jt,Je.use=function(xe){var ve=Qe({},xe);if(xe.renderer&&function(){var ee=Je.defaults.renderer||new it,ie=function(_e){var Ve=ee[_e];ee[_e]=function(){for(var Ye=arguments.length,at=new Array(Ye),ft=0;ft<Ye;ft++)at[ft]=arguments[ft];var Lt=xe.renderer[_e].apply(ee,at);return Lt===!1&&(Lt=Ve.apply(ee,at)),Lt}};for(var ue in xe.renderer)ie(ue);ve.renderer=ee}(),xe.tokenizer&&function(){var ee=Je.defaults.tokenizer||new Ze,ie=function(_e){var Ve=ee[_e];ee[_e]=function(){for(var Ye=arguments.length,at=new Array(Ye),ft=0;ft<Ye;ft++)at[ft]=arguments[ft];var Lt=xe.tokenizer[_e].apply(ee,at);return Lt===!1&&(Lt=Ve.apply(ee,at)),Lt}};for(var ue in xe.tokenizer)ie(ue);ve.tokenizer=ee}(),xe.walkTokens){var ye=Je.defaults.walkTokens;ve.walkTokens=function(ee){xe.walkTokens(ee),ye&&ye(ee)}}Je.setOptions(ve)},Je.walkTokens=function(xe,ve){for(var ye=K(xe),ee;!(ee=ye()).done;){var ie=ee.value;switch(ve(ie),ie.type){case"table":{for(var ue=K(ie.tokens.header),ce;!(ce=ue()).done;){var _e=ce.value;Je.walkTokens(_e,ve)}for(var Ve=K(ie.tokens.cells),Ye;!(Ye=Ve()).done;)for(var at=Ye.value,ft=K(at),Lt;!(Lt=ft()).done;){var Kt=Lt.value;Je.walkTokens(Kt,ve)}break}case"list":{Je.walkTokens(ie.items,ve);break}default:ie.tokens&&Je.walkTokens(ie.tokens,ve)}}},Je.parseInline=function(xe,ve){if(typeof xe=="undefined"||xe===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof xe!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(xe)+", string expected");ve=Qe({},Je.defaults,ve||{}),mt(ve);try{var ye=je.lexInline(xe,ve);return ve.walkTokens&&Je.walkTokens(ye,ve.walkTokens),tt.parseInline(ye,ve)}catch(ee){if(ee.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,ve.silent)return"<p>An error occurred:</p><pre>"+Dt(ee.message+"",!0)+"</pre>";throw ee}},Je.Parser=tt,Je.parser=tt.parse,Je.Renderer=it,Je.TextRenderer=ht,Je.Lexer=je,Je.lexer=je.lex,Je.Tokenizer=Ze,Je.Slugger=st,Je.parse=Je;var Ct=Je;return Ct})},11690:function(dt){const me=/[&<>"']/,b=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,K={"&":"&","<":"<",">":">",'"':""","'":"'"},T=F=>K[F];function w(F,q){if(q){if(me.test(F))return F.replace(b,T)}else if(k.test(F))return F.replace(I,T);return F}const _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function O(F){return F.replace(_,(q,V)=>(V=V.toLowerCase(),V==="colon"?":":V.charAt(0)==="#"?V.charAt(1)==="x"?String.fromCharCode(parseInt(V.substring(2),16)):String.fromCharCode(+V.substring(1)):""))}const m=/(^|[^\[])\^/g;function n(F,q){F=F.source||F,q=q||"";const V={replace:(ne,oe)=>(oe=oe.source||oe,oe=oe.replace(m,"$1"),F=F.replace(ne,oe),V),getRegex:()=>new RegExp(F,q)};return V}const y=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function c(F,q,V){if(F){let ne;try{ne=decodeURIComponent(O(V)).replace(y,"").toLowerCase()}catch(oe){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}q&&!f.test(V)&&(V=D(q,V));try{V=encodeURI(V).replace(/%25/g,"%")}catch(ne){return null}return V}const l={},u=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,E=/^([^:]+:\/*[^/]*)[\s\S]*$/;function D(F,q){l[" "+F]||(u.test(F)?l[" "+F]=F+"/":l[" "+F]=P(F,"/",!0)),F=l[" "+F];const V=F.indexOf(":")===-1;return q.substring(0,2)==="//"?V?q:F.replace(p,"$1")+q:q.charAt(0)==="/"?V?q:F.replace(E,"$1")+q:F+q}const L={exec:function(){}};function C(F){let q=1,V,ne;for(;q<arguments.length;q++){V=arguments[q];for(ne in V)Object.prototype.hasOwnProperty.call(V,ne)&&(F[ne]=V[ne])}return F}function A(F,q){const V=F.replace(/\|/g,(J,z,X)=>{let B=!1,G=z;for(;--G>=0&&X[G]==="\\";)B=!B;return B?"|":" |"}),ne=V.split(/ \|/);let oe=0;if(ne.length>q)ne.splice(q);else for(;ne.length<q;)ne.push("");for(;oe<ne.length;oe++)ne[oe]=ne[oe].trim().replace(/\\\|/g,"|");return ne}function P(F,q,V){const ne=F.length;if(ne===0)return"";let oe=0;for(;oe<ne;){const J=F.charAt(ne-oe-1);if(J===q&&!V)oe++;else if(J!==q&&V)oe++;else break}return F.substr(0,ne-oe)}function U(F,q){if(F.indexOf(q[1])===-1)return-1;const V=F.length;let ne=0,oe=0;for(;oe<V;oe++)if(F[oe]==="\\")oe++;else if(F[oe]===q[0])ne++;else if(F[oe]===q[1]&&(ne--,ne<0))return oe;return-1}function N(F){F&&F.sanitize&&!F.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 $(F,q){if(q<1)return"";let V="";for(;q>1;)q&1&&(V+=F),q>>=1,F+=F;return V+F}dt.exports={escape:w,unescape:O,edit:n,cleanUrl:c,resolveUrl:D,noopTest:L,merge:C,splitCells:A,rtrim:P,findClosingBracket:U,checkSanitizeDeprecation:N,repeatString:$}},75918:function(dt,me,b){"use strict";b.d(me,{Wi:function(){return _},Z0:function(){return O},aU:function(){return w},eZ:function(){return n},wY:function(){return m}});var k=b(4348),I=b(69323),K=b(13268),T=function(y,f,c,l){function u(p){return p instanceof c?p:new c(function(E){E(p)})}return new(c||(c=Promise))(function(p,E){function D(A){try{C(l.next(A))}catch(P){E(P)}}function L(A){try{C(l.throw(A))}catch(P){E(P)}}function C(A){A.done?p(A.value):u(A.value).then(D,L)}C((l=l.apply(y,f||[])).next())})};class w extends I.JT{constructor(f,c="",l="",u=!0,p){super(),this._onDidChange=this._register(new k.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=f,this._label=c,this._cssClass=l,this._enabled=u,this._actionCallback=p}get id(){return this._id}get label(){return this._label}set label(f){this._setLabel(f)}_setLabel(f){this._label!==f&&(this._label=f,this._onDidChange.fire({label:f}))}get tooltip(){return this._tooltip||""}set tooltip(f){this._setTooltip(f)}_setTooltip(f){this._tooltip!==f&&(this._tooltip=f,this._onDidChange.fire({tooltip:f}))}get class(){return this._cssClass}set class(f){this._setClass(f)}_setClass(f){this._cssClass!==f&&(this._cssClass=f,this._onDidChange.fire({class:f}))}get enabled(){return this._enabled}set enabled(f){this._setEnabled(f)}_setEnabled(f){this._enabled!==f&&(this._enabled=f,this._onDidChange.fire({enabled:f}))}get checked(){return this._checked}set checked(f){this._setChecked(f)}_setChecked(f){this._checked!==f&&(this._checked=f,this._onDidChange.fire({checked:f}))}run(f,c){return T(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(f))})}}class _ extends I.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new k.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new k.Q5),this.onDidRun=this._onDidRun.event}run(f,c){return T(this,void 0,void 0,function*(){if(!f.enabled)return;this._onBeforeRun.fire({action:f});let l;try{yield this.runAction(f,c)}catch(u){l=u}this._onDidRun.fire({action:f,error:l})})}runAction(f,c){return T(this,void 0,void 0,function*(){yield f.run(c)})}}class O extends w{constructor(f){super(O.ID,f,f?"separator text":"separator"),this.checked=!1,this.enabled=!1}}O.ID="vs.actions.separator";class m{constructor(f,c,l,u){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=f,this.label=c,this.class=u,this._actions=l}get actions(){return this._actions}dispose(){}run(){return T(this,void 0,void 0,function*(){})}}class n extends w{constructor(){super(n.ID,K.N("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},76068:function(dt,me,b){"use strict";b.d(me,{ok:function(){return k}});function k(I,K){if(!I)throw new Error(K?`Assertion failed (${K})`:"Assertion Failed")}},52615:function(dt,me,b){"use strict";b.d(me,{CM:function(){return w},JL:function(){return _},dT:function(){return m},fK:function(){return T},lA:function(){return O}});var k=b(4348);class I{constructor(){this._icons=new Map,this._onDidRegister=new k.Q5}add(y){const f=this._icons.get(y.id);f?y.description?f.description=y.description:console.error(`Duplicate registration of codicon ${y.id}`):(this._icons.set(y.id,y),this._onDidRegister.fire(y))}get(y){return this._icons.get(y)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const K=new I,T=K;function w(n,y){return new O(n,y)}function _(n){return n?n.replace(/\$\((.*?)\)/g,(y,f)=>` ${f} `).trim():""}class O{constructor(y,f,c){this.id=y,this.definition=f,this.description=c,K.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var m;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const y=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function f(u){if(u instanceof O)return["codicon","codicon-"+u.id];const p=y.exec(u.id);if(!p)return f(O.error);let[,E,D]=p;const L=["codicon","codicon-"+E];return D&&L.push("codicon-modifier-"+D.substr(1)),L}n.asClassNameArray=f;function c(u){return f(u).join(" ")}n.asClassName=c;function l(u){return"."+f(u).join(".")}n.asCSSSelector=l})(m||(m={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(O||(O={}))},79881:function(dt,me,b){"use strict";b.d(me,{B8:function(){return f},Cp:function(){return T},F0:function(){return m},L6:function(){return y},VV:function(){return O},b1:function(){return n},dL:function(){return K},ri:function(){return w}});class k{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(l){setTimeout(()=>{throw l.stack?new Error(l.message+`
|
|
|
|
|
|
`+l.stack):l},0)}}emit(l){this.listeners.forEach(u=>{u(l)})}onUnexpectedError(l){this.unexpectedErrorHandler(l),this.emit(l)}onUnexpectedExternalError(l){this.unexpectedErrorHandler(l)}}const I=new k;function K(c){O(c)||I.onUnexpectedError(c)}function T(c){O(c)||I.onUnexpectedExternalError(c)}function w(c){if(c instanceof Error){let{name:l,message:u}=c;const p=c.stacktrace||c.stack;return{$isError:!0,name:l,message:u,stack:p}}return c}const _="Canceled";function O(c){return c instanceof Error&&c.name===_&&c.message===_}function m(){const c=new Error(_);return c.name=c.message,c}function n(c){return c?new Error(`Illegal argument: ${c}`):new Error("Illegal argument")}function y(c){return c?new Error(`Illegal state: ${c}`):new Error("Illegal state")}class f extends Error{constructor(l){super("NotSupported"),l&&(this.message=l)}}},4348:function(dt,me,b){"use strict";b.d(me,{D0:function(){return f},E7:function(){return c},K3:function(){return y},Q5:function(){return n},ZD:function(){return l},ju:function(){return w}});var k=b(79881),I=b(69323),K=b(34502),T=b(95830),w;(function(u){u.None=()=>I.JT.None;function p(X){return(B,G=null,W)=>{let R=!1,x;return x=X(Y=>{if(!R)return x?x.dispose():R=!0,B.call(G,Y)},null,W),R&&x.dispose(),x}}u.once=p;function E(X,B){return U((G,W=null,R)=>X(x=>G.call(W,B(x)),null,R))}u.map=E;function D(X,B){return U((G,W=null,R)=>X(x=>{B(x),G.call(W,x)},null,R))}u.forEach=D;function L(X,B){return U((G,W=null,R)=>X(x=>B(x)&&G.call(W,x),null,R))}u.filter=L;function C(X){return X}u.signal=C;function A(...X){return(B,G=null,W)=>(0,I.F8)(...X.map(R=>R(x=>B.call(G,x),null,W)))}u.any=A;function P(X,B,G){let W=G;return E(X,R=>(W=B(W,R),W))}u.reduce=P;function U(X){let B;const G=new n({onFirstListenerAdd(){B=X(G.fire,G)},onLastListenerRemove(){B.dispose()}});return G.event}function N(X,B,G=100,W=!1,R){let x,Y,te,Se=0;const Ie=new n({leakWarningThreshold:R,onFirstListenerAdd(){x=X(Ge=>{Se++,Y=B(Y,Ge),W&&!te&&(Ie.fire(Y),Y=void 0),clearTimeout(te),te=setTimeout(()=>{const Ee=Y;Y=void 0,te=void 0,(!W||Se>1)&&Ie.fire(Ee),Se=0},G)})},onLastListenerRemove(){x.dispose()}});return Ie.event}u.debounce=N;function $(X,B=(G,W)=>G===W){let G=!0,W;return L(X,R=>{const x=G||!B(R,W);return G=!1,W=R,x})}u.latch=$;function F(X,B){return[u.filter(X,B),u.filter(X,G=>!B(G))]}u.split=F;function q(X,B=!1,G=[]){let W=G.slice(),R=X(te=>{W?W.push(te):Y.fire(te)});const x=()=>{W&&W.forEach(te=>Y.fire(te)),W=null},Y=new n({onFirstListenerAdd(){R||(R=X(te=>Y.fire(te)))},onFirstListenerDidAdd(){W&&(B?setTimeout(x):x())},onLastListenerRemove(){R&&R.dispose(),R=null}});return Y.event}u.buffer=q;class V{constructor(B){this.event=B}map(B){return new V(E(this.event,B))}forEach(B){return new V(D(this.event,B))}filter(B){return new V(L(this.event,B))}reduce(B,G){return new V(P(this.event,B,G))}latch(){return new V($(this.event))}debounce(B,G=100,W=!1,R){return new V(N(this.event,B,G,W,R))}on(B,G,W){return this.event(B,G,W)}once(B,G,W){return p(this.event)(B,G,W)}}function ne(X){return new V(X)}u.chain=ne;function oe(X,B,G=W=>W){const W=(...te)=>Y.fire(G(...te)),R=()=>X.on(B,W),x=()=>X.removeListener(B,W),Y=new n({onFirstListenerAdd:R,onLastListenerRemove:x});return Y.event}u.fromNodeEventEmitter=oe;function J(X,B,G=W=>W){const W=(...te)=>Y.fire(G(...te)),R=()=>X.addEventListener(B,W),x=()=>X.removeEventListener(B,W),Y=new n({onFirstListenerAdd:R,onLastListenerRemove:x});return Y.event}u.fromDOMEventEmitter=J;function z(X){return new Promise(B=>p(X)(B))}u.toPromise=z})(w||(w={}));class _{constructor(p){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${p}_${_._idPool++}`}start(p){this._stopWatch=new T.G(!0),this._listenerCount=p}stop(){if(this._stopWatch){const p=this._stopWatch.elapsed();this._elapsedOverall+=p,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${p.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}_._idPool=0;let O=-1;class m{constructor(p,E=Math.random().toString(18).slice(2,5)){this.customThreshold=p,this.name=E,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(p){let E=O;if(typeof this.customThreshold=="number"&&(E=this.customThreshold),E<=0||p<E)return;this._stacks||(this._stacks=new Map);const D=new Error().stack.split(`
|
|
|
`).slice(3).join(`
|
|
|
`),L=this._stacks.get(D)||0;if(this._stacks.set(D,L+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=E*.5;let C,A=0;for(const[P,U]of this._stacks)(!C||A<U)&&(C=P,A=U);console.warn(`[${this.name}] potential listener LEAK detected, having ${p} listeners already. MOST frequent listener (${A}):`),console.warn(C)}return()=>{const C=this._stacks.get(D)||0;this._stacks.set(D,C-1)}}}class n{constructor(p){var E;this._disposed=!1,this._options=p,this._leakageMon=O>0?new m(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((E=this._options)===null||E===void 0)&&E._profName?new _(this._options._profName):void 0}get event(){return this._event||(this._event=(p,E,D)=>{var L;this._listeners||(this._listeners=new K.S);const C=this._listeners.isEmpty();C&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const A=this._listeners.push(E?[p,E]:p);C&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,p,E);const P=(L=this._leakageMon)===null||L===void 0?void 0:L.check(this._listeners.size),U=(0,I.OF)(()=>{P&&P(),this._disposed||(A(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return D instanceof I.SL?D.add(U):Array.isArray(D)&&D.push(U),U}),this._event}fire(p){var E,D;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new K.S);for(let L of this._listeners)this._deliveryQueue.push([L,p]);for((E=this._perfMon)===null||E===void 0||E.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[L,C]=this._deliveryQueue.shift();try{typeof L=="function"?L.call(void 0,C):L[0].call(L[1],C)}catch(A){(0,k.dL)(A)}}(D=this._perfMon)===null||D===void 0||D.stop()}}dispose(){var p,E,D,L,C;this._disposed||(this._disposed=!0,(p=this._listeners)===null||p===void 0||p.clear(),(E=this._deliveryQueue)===null||E===void 0||E.clear(),(L=(D=this._options)===null||D===void 0?void 0:D.onLastListenerRemove)===null||L===void 0||L.call(D),(C=this._leakageMon)===null||C===void 0||C.dispose())}}class y extends n{constructor(p){super(p),this._isPaused=0,this._eventQueue=new K.S,this._mergeFn=p==null?void 0:p.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const p=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(p))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(p){this._listeners&&(this._isPaused!==0?this._eventQueue.push(p):super.fire(p))}}class f extends y{constructor(p){var E;super(p),this._delay=(E=p.delay)!==null&&E!==void 0?E:100}fire(p){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(p)}}class c{constructor(){this.buffers=[]}wrapEvent(p){return(E,D,L)=>p(C=>{const A=this.buffers[this.buffers.length-1];A?A.push(()=>E.call(D,C)):E.call(D,C)},void 0,L)}bufferEvents(p){const E=[];this.buffers.push(E);const D=p();return this.buffers.pop(),E.forEach(L=>L()),D}}class l{constructor(){this.listening=!1,this.inputEvent=w.None,this.inputEventListener=I.JT.None,this.emitter=new n({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(p){this.inputEvent=p,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=p(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(dt,me,b){"use strict";b.d(me,{I:function(){return k}});function k(I){const K=this;let T=!1,w;return function(){return T||(T=!0,w=I.apply(K,arguments)),w}}},88226:function(dt,me,b){"use strict";b.d(me,{$:function(){return k}});var k;(function(I){function K(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}I.is=K;const T=Object.freeze([]);function w(){return T}I.empty=w;function*_(A){yield A}I.single=_;function O(A){return A||T}I.from=O;function m(A){return!A||A[Symbol.iterator]().next().done===!0}I.isEmpty=m;function n(A){return A[Symbol.iterator]().next().value}I.first=n;function y(A,P){for(const U of A)if(P(U))return!0;return!1}I.some=y;function f(A,P){for(const U of A)if(P(U))return U}I.find=f;function*c(A,P){for(const U of A)P(U)&&(yield U)}I.filter=c;function*l(A,P){let U=0;for(const N of A)yield P(N,U++)}I.map=l;function*u(...A){for(const P of A)for(const U of P)yield U}I.concat=u;function*p(A){for(const P of A)for(const U of P)yield U}I.concatNested=p;function E(A,P,U){let N=U;for(const $ of A)N=P(N,$);return N}I.reduce=E;function*D(A,P,U=A.length){for(P<0&&(P+=A.length),U<0?U+=A.length:U>A.length&&(U=A.length);P<U;P++)yield A[P]}I.slice=D;function L(A,P=Number.POSITIVE_INFINITY){const U=[];if(P===0)return[U,A];const N=A[Symbol.iterator]();for(let $=0;$<P;$++){const F=N.next();if(F.done)return[U,I.empty()];U.push(F.value)}return[U,{[Symbol.iterator](){return N}}]}I.consume=L;function C(A,P,U=(N,$)=>N===$){const N=A[Symbol.iterator](),$=P[Symbol.iterator]();for(;;){const F=N.next(),q=$.next();if(F.done!==q.done)return!1;if(F.done)return!0;if(!U(F.value,q.value))return!1}}I.equals=C})(k||(k={}))},69323:function(dt,me,b){"use strict";b.d(me,{B9:function(){return l},F8:function(){return u},JT:function(){return D},Jz:function(){return C},OF:function(){return p},SL:function(){return E},Wf:function(){return c},XK:function(){return L},dk:function(){return y}});var k=b(17845),I=b(88226);const K=!1;let T=null;function w(A){T=A}if(K){const A="__is_disposable_tracked__";w(new class{trackDisposable(P){const U=new Error("Potentially leaked disposable").stack;setTimeout(()=>{P[A]||console.log(U)},3e3)}setParent(P,U){if(P&&P!==D.None)try{P[A]=!0}catch(N){}}markAsDisposed(P){if(P&&P!==D.None)try{P[A]=!0}catch(U){}}markAsSingleton(P){}})}function _(A){return T==null||T.trackDisposable(A),A}function O(A){T==null||T.markAsDisposed(A)}function m(A,P){T==null||T.setParent(A,P)}function n(A,P){if(T)for(const U of A)T.setParent(U,P)}function y(A){return T==null||T.markAsSingleton(A),A}class f extends Error{constructor(P){super(`Encountered errors while disposing of store. Errors: [${P.join(", ")}]`),this.errors=P}}function c(A){return typeof A.dispose=="function"&&A.dispose.length===0}function l(A){if(I.$.is(A)){let P=[];for(const U of A)if(U)try{U.dispose()}catch(N){P.push(N)}if(P.length===1)throw P[0];if(P.length>1)throw new f(P);return Array.isArray(A)?[]:A}else if(A)return A.dispose(),A}function u(...A){const P=p(()=>l(A));return n(A,P),P}function p(A){const P=_({dispose:(0,k.I)(()=>{O(P),A()})});return P}class E{constructor(){this._toDispose=new Set,this._isDisposed=!1,_(this)}dispose(){this._isDisposed||(O(this),this._isDisposed=!0,this.clear())}clear(){try{l(this._toDispose.values())}finally{this._toDispose.clear()}}add(P){if(!P)return P;if(P===this)throw new Error("Cannot register a disposable on itself!");return m(P,this),this._isDisposed?E.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(P),P}}E.DISABLE_DISPOSED_WARNING=!1;class D{constructor(){this._store=new E,_(this),m(this._store,this)}dispose(){O(this),this._store.dispose()}_register(P){if(P===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(P)}}D.None=Object.freeze({dispose(){}});class L{constructor(){this._isDisposed=!1,_(this)}get value(){return this._isDisposed?void 0:this._value}set value(P){var U;this._isDisposed||P===this._value||((U=this._value)===null||U===void 0||U.dispose(),P&&m(P,this),this._value=P)}clear(){this.value=void 0}dispose(){var P;this._isDisposed=!0,O(this),(P=this._value)===null||P===void 0||P.dispose(),this._value=void 0}clearAndLeak(){const P=this._value;return this._value=void 0,P&&m(P,null),P}}class C{constructor(P){this.object=P}dispose(){}}},34502:function(dt,me,b){"use strict";b.d(me,{S:function(){return I}});class k{constructor(T){this.element=T,this.next=k.Undefined,this.prev=k.Undefined}}k.Undefined=new k(void 0);class I{constructor(){this._first=k.Undefined,this._last=k.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===k.Undefined}clear(){let T=this._first;for(;T!==k.Undefined;){const w=T.next;T.prev=k.Undefined,T.next=k.Undefined,T=w}this._first=k.Undefined,this._last=k.Undefined,this._size=0}unshift(T){return this._insert(T,!1)}push(T){return this._insert(T,!0)}_insert(T,w){const _=new k(T);if(this._first===k.Undefined)this._first=_,this._last=_;else if(w){const m=this._last;this._last=_,_.prev=m,m.next=_}else{const m=this._first;this._first=_,_.next=m,m.prev=_}this._size+=1;let O=!1;return()=>{O||(O=!0,this._remove(_))}}shift(){if(this._first!==k.Undefined){const T=this._first.element;return this._remove(this._first),T}}pop(){if(this._last!==k.Undefined){const T=this._last.element;return this._remove(this._last),T}}_remove(T){if(T.prev!==k.Undefined&&T.next!==k.Undefined){const w=T.prev;w.next=T.next,T.next.prev=w}else T.prev===k.Undefined&&T.next===k.Undefined?(this._first=k.Undefined,this._last=k.Undefined):T.next===k.Undefined?(this._last=this._last.prev,this._last.next=k.Undefined):T.prev===k.Undefined&&(this._first=this._first.next,this._first.prev=k.Undefined);this._size-=1}*[Symbol.iterator](){let T=this._first;for(;T!==k.Undefined;)yield T.element,T=T.next}}},23345:function(dt,me,b){"use strict";b.d(me,{$L:function(){return N},ED:function(){return C},IJ:function(){return P},OS:function(){return V},WE:function(){return F},dz:function(){return A},gn:function(){return $},li:function(){return p},r:function(){return J},tY:function(){return U},xS:function(){return q}});var k=b(97671),I;const K="en";let T=!1,w=!1,_=!1,O=!1,m=!1,n=!1,y=!1,f,c=null,l=null,u;const p=typeof self=="object"?self:typeof b.g=="object"?b.g:{};let E;typeof p.vscode!="undefined"&&typeof p.vscode.process!="undefined"?E=p.vscode.process:typeof k!="undefined"&&(E=k);const D=typeof((I=E==null?void 0:E.versions)===null||I===void 0?void 0:I.electron)=="string"&&E.type==="renderer";if(typeof navigator=="object"&&!D)u=navigator.userAgent,T=u.indexOf("Windows")>=0,w=u.indexOf("Macintosh")>=0,y=(u.indexOf("Macintosh")>=0||u.indexOf("iPad")>=0||u.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_=u.indexOf("Linux")>=0,n=!0,f=navigator.language,c=f;else if(typeof E=="object"){T=E.platform==="win32",w=E.platform==="darwin",_=E.platform==="linux",O=_&&!!E.env.SNAP&&!!E.env.SNAP_REVISION,f=K,c=K;const z=E.env.VSCODE_NLS_CONFIG;if(z)try{const X=JSON.parse(z),B=X.availableLanguages["*"];f=X.locale,c=B||K,l=X._translationsConfigFile}catch(X){}m=!0}else console.error("Unable to resolve platform.");let L=0;w?L=1:T?L=3:_&&(L=2);const C=T,A=w,P=_,U=m,N=n,$=y,F=u,q=function(){if(p.setImmediate)return p.setImmediate.bind(p);if(typeof p.postMessage=="function"&&!p.importScripts){let B=[];p.addEventListener("message",W=>{if(W.data&&W.data.vscodeSetImmediateId)for(let R=0,x=B.length;R<x;R++){const Y=B[R];if(Y.id===W.data.vscodeSetImmediateId){B.splice(R,1),Y.callback();return}}});let G=0;return W=>{const R=++G;B.push({id:R,callback:W}),p.postMessage({vscodeSetImmediateId:R},"*")}}if(typeof(E==null?void 0:E.nextTick)=="function")return E.nextTick.bind(E);const X=Promise.resolve();return B=>X.then(B)}(),V=w||y?2:T?1:3;let ne=!0,oe=!1;function J(){if(!oe){oe=!0;const z=new Uint8Array(2);z[0]=1,z[1]=2,ne=new Uint16Array(z.buffer)[0]===513}return ne}},95830:function(dt,me,b){"use strict";b.d(me,{G:function(){return K}});var k=b(23345);const I=k.li.performance&&typeof k.li.performance.now=="function";class K{constructor(w){this._highResolution=I&&w,this._startTime=this._now(),this._stopTime=-1}static create(w=!0){return new K(w)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?k.li.performance.now():Date.now()}}},82983:function(dt,me,b){"use strict";b.d(me,{$i:function(){return Se},C8:function(){return He},GF:function(){return f},HO:function(){return G},IO:function(){return c},K7:function(){return ze},Kw:function(){return At},LC:function(){return p},Mh:function(){return q},P1:function(){return V},PJ:function(){return nt},Qe:function(){return Ie},R1:function(){return y},RP:function(){return Y},S6:function(){return Bt},TT:function(){return C},Ut:function(){return R},V8:function(){return E},WU:function(){return K},YK:function(){return oe},YU:function(){return T},ZG:function(){return ne},ZH:function(){return z},ab:function(){return Ge},c1:function(){return Be},df:function(){return N},ec:function(){return w},fi:function(){return Nt},fy:function(){return _},j3:function(){return O},j_:function(){return P},m5:function(){return k},mK:function(){return U},mr:function(){return l},oH:function(){return he},oL:function(){return m},ok:function(){return F},ow:function(){return D},qq:function(){return $},qu:function(){return L},rL:function(){return J},uS:function(){return lt},un:function(){return n},uq:function(){return u},vH:function(){return B},xe:function(){return Ee},zY:function(){return A}});function k(ae){return!ae||typeof ae!="string"?!0:ae.trim().length===0}const I=/{(\d+)}/g;function K(ae,...se){return se.length===0?ae:ae.replace(I,function(pe,ge){const de=parseInt(ge,10);return isNaN(de)||de<0||de>=se.length?pe:se[de]})}function T(ae){return ae.replace(/[<>&]/g,function(se){switch(se){case"<":return"<";case">":return">";case"&":return"&";default:return se}})}function w(ae){return ae.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function _(ae,se=" "){const pe=O(ae,se);return m(pe,se)}function O(ae,se){if(!ae||!se)return ae;const pe=se.length;if(pe===0||ae.length===0)return ae;let ge=0;for(;ae.indexOf(se,ge)===ge;)ge=ge+pe;return ae.substring(ge)}function m(ae,se){if(!ae||!se)return ae;const pe=se.length,ge=ae.length;if(pe===0||ge===0)return ae;let de=ge,Ce=-1;for(;Ce=ae.lastIndexOf(se,de-1),!(Ce===-1||Ce+pe!==de);){if(Ce===0)return"";de=Ce}return ae.substring(0,de)}function n(ae){return ae.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function y(ae){return ae.replace(/\*/g,"")}function f(ae,se,pe={}){if(!ae)throw new Error("Cannot create regex from empty string");se||(ae=w(ae)),pe.wholeWord&&(/\B/.test(ae.charAt(0))||(ae="\\b"+ae),/\B/.test(ae.charAt(ae.length-1))||(ae=ae+"\\b"));let ge="";return pe.global&&(ge+="g"),pe.matchCase||(ge+="i"),pe.multiline&&(ge+="m"),pe.unicode&&(ge+="u"),new RegExp(ae,ge)}function c(ae){return ae.source==="^"||ae.source==="^$"||ae.source==="$"||ae.source==="^\\s*$"?!1:!!(ae.exec("")&&ae.lastIndex===0)}function l(ae){return(ae.global?"g":"")+(ae.ignoreCase?"i":"")+(ae.multiline?"m":"")+(ae.unicode?"u":"")}function u(ae){return ae.split(/\r\n|\r|\n/)}function p(ae){for(let se=0,pe=ae.length;se<pe;se++){const ge=ae.charCodeAt(se);if(ge!==32&&ge!==9)return se}return-1}function E(ae,se=0,pe=ae.length){for(let ge=se;ge<pe;ge++){const de=ae.charCodeAt(ge);if(de!==32&&de!==9)return ae.substring(se,ge)}return ae.substring(se,pe)}function D(ae,se=ae.length-1){for(let pe=se;pe>=0;pe--){const ge=ae.charCodeAt(pe);if(ge!==32&&ge!==9)return pe}return-1}function L(ae,se){return ae<se?-1:ae>se?1:0}function C(ae,se,pe=0,ge=ae.length,de=0,Ce=se.length){for(;pe<ge&&de<Ce;pe++,de++){let Ne=ae.charCodeAt(pe),Me=se.charCodeAt(de);if(Ne<Me)return-1;if(Ne>Me)return 1}const Fe=ge-pe,Te=Ce-de;return Fe<Te?-1:Fe>Te?1:0}function A(ae,se){return P(ae,se,0,ae.length,0,se.length)}function P(ae,se,pe=0,ge=ae.length,de=0,Ce=se.length){for(;pe<ge&&de<Ce;pe++,de++){let Ne=ae.charCodeAt(pe),Me=se.charCodeAt(de);if(Ne===Me)continue;if(Ne>=128||Me>=128)return C(ae.toLowerCase(),se.toLowerCase(),pe,ge,de,Ce);U(Ne)&&(Ne-=32),U(Me)&&(Me-=32);const je=Ne-Me;if(je!==0)return je}const Fe=ge-pe,Te=Ce-de;return Fe<Te?-1:Fe>Te?1:0}function U(ae){return ae>=97&&ae<=122}function N(ae){return ae>=65&&ae<=90}function $(ae,se){return ae.length===se.length&&P(ae,se)===0}function F(ae,se){const pe=se.length;return se.length>ae.length?!1:P(ae,se,0,pe)===0}function q(ae,se){let pe,ge=Math.min(ae.length,se.length);for(pe=0;pe<ge;pe++)if(ae.charCodeAt(pe)!==se.charCodeAt(pe))return pe;return ge}function V(ae,se){let pe,ge=Math.min(ae.length,se.length);const de=ae.length-1,Ce=se.length-1;for(pe=0;pe<ge;pe++)if(ae.charCodeAt(de-pe)!==se.charCodeAt(Ce-pe))return pe;return ge}function ne(ae){return 55296<=ae&&ae<=56319}function oe(ae){return 56320<=ae&&ae<=57343}function J(ae,se){return(ae-55296<<10)+(se-56320)+65536}function z(ae,se,pe){const ge=ae.charCodeAt(pe);if(ne(ge)&&pe+1<se){const de=ae.charCodeAt(pe+1);if(oe(de))return J(ge,de)}return ge}function X(ae,se){const pe=ae.charCodeAt(se-1);if(oe(pe)&&se>1){const ge=ae.charCodeAt(se-2);if(ne(ge))return J(ge,pe)}return pe}function B(ae,se){const pe=Le.getInstance(),ge=se,de=ae.length,Ce=z(ae,de,se);se+=Ce>=65536?2:1;let Fe=pe.getGraphemeBreakType(Ce);for(;se<de;){const Te=z(ae,de,se),Ne=pe.getGraphemeBreakType(Te);if(Nt(Fe,Ne))break;se+=Te>=65536?2:1,Fe=Ne}return se-ge}function G(ae,se){const pe=Le.getInstance(),ge=se,de=X(ae,se);se-=de>=65536?2:1;let Ce=pe.getGraphemeBreakType(de);for(;se>0;){const Fe=X(ae,se),Te=pe.getGraphemeBreakType(Fe);if(Nt(Te,Ce))break;se-=Fe>=65536?2:1,Ce=Te}return ge-se}const W=/(?:[\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 R(ae){return W.test(ae)}const x=/(?:[\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 Y(ae){return x.test(ae)}const te=/^[\t\n\r\x20-\x7E]*$/;function Se(ae){return te.test(ae)}const Ie=/[\u2028\u2029]/;function Ge(ae){return Ie.test(ae)}function Ee(ae){for(let se=0,pe=ae.length;se<pe;se++)if(ze(ae.charCodeAt(se)))return!0;return!1}function ze(ae){return ae=+ae,ae>=11904&&ae<=55215||ae>=63744&&ae<=64255||ae>=65281&&ae<=65374}function He(ae){return ae>=127462&&ae<=127487||ae===8986||ae===8987||ae===9200||ae===9203||ae>=9728&&ae<=10175||ae===11088||ae===11093||ae>=127744&&ae<=128591||ae>=128640&&ae<=128764||ae>=128992&&ae<=129003||ae>=129280&&ae<=129535||ae>=129648&&ae<=129750}const Be="\uFEFF";function lt(ae){return!!(ae&&ae.length>0&&ae.charCodeAt(0)===65279)}function At(ae,se=!1){return ae?(se&&(ae=ae.replace(/\\./g,"")),ae.toLowerCase()!==ae):!1}function nt(ae){return ae=ae%(2*26),ae<26?String.fromCharCode(97+ae):String.fromCharCode(65+ae-26)}function Bt(ae){return Le.getInstance().getGraphemeBreakType(ae)}function Nt(ae,se){return ae===0?se!==5&&se!==7:ae===2&&se===3?!1:ae===4||ae===2||ae===3||se===4||se===2||se===3?!0:!(ae===8&&(se===8||se===9||se===11||se===12)||(ae===11||ae===9)&&(se===9||se===10)||(ae===12||ae===10)&&se===10||se===5||se===13||se===7||ae===1||ae===13&&se===14||ae===6&&se===6)}class Le{constructor(){this._data=Re()}static getInstance(){return Le._INSTANCE||(Le._INSTANCE=new Le),Le._INSTANCE}getGraphemeBreakType(se){if(se<32)return se===10?3:se===13?2:4;if(se<127)return 0;const pe=this._data,ge=pe.length/3;let de=1;for(;de<=ge;)if(se<pe[3*de])de=2*de;else if(se>pe[3*de+1])de=2*de+1;else return pe[3*de+2];return 0}}Le._INSTANCE=null;function Re(){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 he(ae,se){if(ae===0)return 0;const pe=Oe(ae,se);if(pe!==void 0)return pe;const ge=X(se,ae);return ae-=We(ge),ae}function Oe(ae,se){let pe=X(se,ae);for(ae-=We(pe);qe(pe)||pe===65039||pe===8419;){if(ae===0)return;pe=X(se,ae),ae-=We(pe)}if(He(pe)){if(ae>=0){const ge=X(se,ae);ge===8205&&(ae-=We(ge))}return ae}}function We(ae){return ae>=65536?2:1}function qe(ae){return 127995<=ae&&ae<=127999}},72999:function(dt,me,b){"use strict";b.d(me,{$E:function(){return p},$K:function(){return O},D8:function(){return c},HD:function(){return I},IU:function(){return E},Jp:function(){return m},Kn:function(){return K},cW:function(){return y},f6:function(){return D},hj:function(){return T},jn:function(){return w},kJ:function(){return k},mf:function(){return f},o8:function(){return _},p_:function(){return n},vE:function(){return L}});function k(C){return Array.isArray(C)}function I(C){return typeof C=="string"}function K(C){return typeof C=="object"&&C!==null&&!Array.isArray(C)&&!(C instanceof RegExp)&&!(C instanceof Date)}function T(C){return typeof C=="number"&&!isNaN(C)}function w(C){return C===!0||C===!1}function _(C){return typeof C=="undefined"}function O(C){return!m(C)}function m(C){return _(C)||C===null}function n(C,A){if(!C)throw new Error(A?`Unexpected type, expected '${A}'`:"Unexpected type")}function y(C){if(m(C))throw new Error("Assertion Failed: argument is undefined or null");return C}function f(C){return typeof C=="function"}function c(C,A){const P=Math.min(C.length,A.length);for(let U=0;U<P;U++)l(C[U],A[U])}function l(C,A){if(I(A)){if(typeof C!==A)throw new Error(`argument does not match constraint: typeof ${A}`)}else if(f(A)){try{if(C instanceof A)return}catch(P){}if(!m(C)&&C.constructor===A||A.length===1&&A.call(void 0,C)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function u(C){let A=[],P=Object.getPrototypeOf(C);for(;Object.prototype!==P;)A=A.concat(Object.getOwnPropertyNames(P)),P=Object.getPrototypeOf(P);return A}function p(C){const A=[];for(const P of u(C))typeof C[P]=="function"&&A.push(P);return A}function E(C,A){const P=N=>function(){const $=Array.prototype.slice.call(arguments,0);return A(N,$)};let U={};for(const N of C)U[N]=P(N);return U}function D(C){return C===null?void 0:C}function L(C,A="Unreachable"){throw new Error(A)}},13268:function(dt,me,b){"use strict";b.d(me,{N:function(){return I}});function k(K,T){let w;return T.length===0?w=K:w=K.replace(/\{(\d+)\}/g,function(_,O){const m=O[0];return typeof T[m]!="undefined"?T[m]:_}),w}function I(K,T,...w){return k(T,w)}},96236:function(dt,me,b){"use strict";b.d(me,{BH:function(){return E},NZ:function(){return D},U8:function(){return L},co:function(){return p},eH:function(){return u},vr:function(){return l}});var k=b(75918),I=b(52615),K=b(4348),T=b(88226),w=b(69323),_=b(34502),O=b(35884),m=b(90689),n=b(16925),y=b(49055),f=function(C,A,P,U){var N=arguments.length,$=N<3?A:U===null?U=Object.getOwnPropertyDescriptor(A,P):U,F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(C,A,P,U);else for(var q=C.length-1;q>=0;q--)(F=C[q])&&($=(N<3?F($):N>3?F(A,P,$):F(A,P))||$);return N>3&&$&&Object.defineProperty(A,P,$),$},c=function(C,A){return function(P,U){A(P,U,C)}};function l(C){return C.command!==void 0}class u{constructor(A){this.id=u._idPool++,this._debugName=A}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const p=(0,n.yh)("menuService"),E=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new K.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:C=>C===u.CommandPalette}}addCommand(C){return this.addCommands(T.$.single(C))}addCommands(C){for(const A of C)this._commands.set(A.id,A);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,w.OF)(()=>{let A=!1;for(const P of C)A=this._commands.delete(P.id)||A;A&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(C){return this._commands.get(C)}getCommands(){const C=new Map;return this._commands.forEach((A,P)=>C.set(P,A)),C}appendMenuItem(C,A){return this.appendMenuItems(T.$.single({id:C,item:A}))}appendMenuItems(C){const A=new Set,P=new _.S;for(const{id:U,item:N}of C){let $=this._menuItems.get(U);$||($=new _.S,this._menuItems.set(U,$)),P.push($.push(N)),A.add(U)}return this._onDidChangeMenu.fire(A),(0,w.OF)(()=>{if(P.size>0){for(let U of P)U();this._onDidChangeMenu.fire(A),P.clear()}})}getMenuItems(C){let A;return this._menuItems.has(C)?A=[...this._menuItems.get(C)]:A=[],C===u.CommandPalette&&this._appendImplicitItems(A),A}_appendImplicitItems(C){const A=new Set;for(const P of C)l(P)&&(A.add(P.command.id),P.alt&&A.add(P.alt.id));this._commands.forEach((P,U)=>{A.has(U)||C.push({command:P})})}};class D extends k.wY{constructor(A,P,U,N){super(`submenuitem.${A.submenu.id}`,typeof A.title=="string"?A.title:A.title.value,[],"submenu"),this.item=A,this._menuService=P,this._contextKeyService=U,this._options=N}get actions(){const A=[],P=this._menuService.createMenu(this.item.submenu,this._contextKeyService),U=P.getActions(this._options);P.dispose();for(const[,N]of U)N.length>0&&(A.push(...N),A.push(new k.Z0));return A.length&&A.pop(),A}}let L=class No{constructor(A,P,U,N,$){var F,q;if(this._commandService=$,this.id=A.id,this.label=U!=null&&U.renderShortTitle&&A.shortTitle?typeof A.shortTitle=="string"?A.shortTitle:A.shortTitle.value:typeof A.title=="string"?A.title:A.title.value,this.tooltip=(q=typeof A.tooltip=="string"?A.tooltip:(F=A.tooltip)===null||F===void 0?void 0:F.value)!==null&&q!==void 0?q:"",this.enabled=!A.precondition||N.contextMatchesRules(A.precondition),this.checked=void 0,A.toggled){const V=A.toggled.condition?A.toggled:{condition:A.toggled};this.checked=N.contextMatchesRules(V.condition),this.checked&&V.tooltip&&(this.tooltip=typeof V.tooltip=="string"?V.tooltip:V.tooltip.value),V.title&&(this.label=typeof V.title=="string"?V.title:V.title.value)}this.item=A,this.alt=P?new No(P,void 0,U,N,$):void 0,this._options=U,y.kS.isThemeIcon(A.icon)&&(this.class=I.dT.asClassName(A.icon))}dispose(){}run(...A){var P,U;let N=[];return!((P=this._options)===null||P===void 0)&&P.arg&&(N=[...N,this._options.arg]),!((U=this._options)===null||U===void 0)&&U.shouldForwardArgs&&(N=[...N,...A]),this._commandService.executeCommand(this.id,...N)}};L=f([c(3,m.i6),c(4,O.H)],L)},35884:function(dt,me,b){"use strict";b.d(me,{H:function(){return O},P:function(){return m}});var k=b(4348),I=b(88226),K=b(69323),T=b(34502),w=b(72999),_=b(16925);const O=(0,_.yh)("commandService"),m=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new k.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,y){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!y)throw new Error("invalid command");return this.registerCommand({id:n,handler:y})}if(n.description){const p=[];for(let D of n.description.args)p.push(D.constraint);const E=n.handler;n.handler=function(D,...L){return(0,w.D8)(L,p),E(D,...L)}}const{id:f}=n;let c=this._commands.get(f);c||(c=new T.S,this._commands.set(f,c));let l=c.unshift(n),u=(0,K.OF)(()=>{l();const p=this._commands.get(f);p!=null&&p.isEmpty()&&this._commands.delete(f)});return this._onDidRegisterCommand.fire(f),u}registerCommandAlias(n,y){return m.registerCommand(n,(f,...c)=>f.get(O).executeCommand(y,...c))}getCommand(n){const y=this._commands.get(n);if(!(!y||y.isEmpty()))return I.$.first(y)}getCommands(){const n=new Map;for(const y of this._commands.keys()){const f=this.getCommand(y);f&&n.set(y,f)}return n}};m.registerCommand("noop",()=>{})},90689:function(dt,me,b){"use strict";b.d(me,{Ao:function(){return O},Eq:function(){return J},Fb:function(){return m},K8:function(){return B},i6:function(){return oe},uy:function(){return ne}});var k=b(23345),I=b(82983),K=b(16925);let T=k.WE||"";const w=new Map;w.set("false",!1),w.set("true",!0),w.set("isMac",k.dz),w.set("isLinux",k.IJ),w.set("isWindows",k.ED),w.set("isWeb",k.$L),w.set("isMacNative",k.dz&&!k.$L),w.set("isEdge",T.indexOf("Edg/")>=0),w.set("isFirefox",T.indexOf("Firefox")>=0),w.set("isChrome",T.indexOf("Chrome")>=0),w.set("isSafari",T.indexOf("Safari")>=0);const _=Object.prototype.hasOwnProperty;class O{static has(R){return c.create(R)}static equals(R,x){return l.create(R,x)}static regex(R,x){return N.create(R,x)}static not(R){return D.create(R)}static and(...R){return q.create(R,null)}static or(...R){return V.create(R,null,!0)}static deserialize(R,x=!1){if(R)return this._deserializeOrExpression(R,x)}static _deserializeOrExpression(R,x){let Y=R.split("||");return V.create(Y.map(te=>this._deserializeAndExpression(te,x)),null,!0)}static _deserializeAndExpression(R,x){let Y=R.split("&&");return q.create(Y.map(te=>this._deserializeOne(te,x)),null)}static _deserializeOne(R,x){if(R=R.trim(),R.indexOf("!=")>=0){let Y=R.split("!=");return E.create(Y[0].trim(),this._deserializeValue(Y[1],x))}if(R.indexOf("==")>=0){let Y=R.split("==");return l.create(Y[0].trim(),this._deserializeValue(Y[1],x))}if(R.indexOf("=~")>=0){let Y=R.split("=~");return N.create(Y[0].trim(),this._deserializeRegexValue(Y[1],x))}if(R.indexOf(" in ")>=0){let Y=R.split(" in ");return u.create(Y[0].trim(),Y[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(R)){const Y=R.split(">=");return A.create(Y[0].trim(),Y[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(R)){const Y=R.split(">");return C.create(Y[0].trim(),Y[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(R)){const Y=R.split("<=");return U.create(Y[0].trim(),Y[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(R)){const Y=R.split("<");return P.create(Y[0].trim(),Y[1].trim())}return/^\!\s*/.test(R)?D.create(R.substr(1).trim()):c.create(R)}static _deserializeValue(R,x){if(R=R.trim(),R==="true")return!0;if(R==="false")return!1;let Y=/^'([^']*)'$/.exec(R);return Y?Y[1].trim():R}static _deserializeRegexValue(R,x){if((0,I.m5)(R)){if(x)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let Y=R.indexOf("/"),te=R.lastIndexOf("/");if(Y===te||Y<0){if(x)throw new Error(`bad regexp-value '${R}', missing /-enclosure`);return console.warn(`bad regexp-value '${R}', missing /-enclosure`),null}let Se=R.slice(Y+1,te),Ie=R[te+1]==="i"?"i":"";try{return new RegExp(Se,Ie)}catch(Ge){if(x)throw new Error(`bad regexp-value '${R}', parse error: ${Ge}`);return console.warn(`bad regexp-value '${R}', parse error: ${Ge}`),null}}}function m(W,R){const x=W?W.substituteConstants():void 0,Y=R?R.substituteConstants():void 0;return!x&&!Y?!0:!x||!Y?!1:x.equals(Y)}function n(W,R){return W.cmp(R)}class y{constructor(){this.type=0}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!1}serialize(){return"false"}keys(){return[]}negate(){return f.INSTANCE}}y.INSTANCE=new y;class f{constructor(){this.type=1}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!0}serialize(){return"true"}keys(){return[]}negate(){return y.INSTANCE}}f.INSTANCE=new f;class c{constructor(R,x){this.key=R,this.negated=x,this.type=2}static create(R,x=null){const Y=w.get(R);return typeof Y=="boolean"?Y?f.INSTANCE:y.INSTANCE:new c(R,x)}cmp(R){return R.type!==this.type?this.type-R.type:z(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=w.get(this.key);return typeof R=="boolean"?R?f.INSTANCE:y.INSTANCE:this}evaluate(R){return!!R.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this.key,this)),this.negated}}class l{constructor(R,x,Y){this.key=R,this.value=x,this.negated=Y,this.type=4}static create(R,x,Y=null){if(typeof x=="boolean")return x?c.create(R,Y):D.create(R,Y);const te=w.get(R);return typeof te=="boolean"?x===(te?"true":"false")?f.INSTANCE:y.INSTANCE:new l(R,x,Y)}cmp(R){return R.type!==this.type?this.type-R.type:X(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=w.get(this.key);if(typeof R=="boolean"){const x=R?"true":"false";return this.value===x?f.INSTANCE:y.INSTANCE}return this}evaluate(R){return R.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class u{constructor(R,x){this.key=R,this.valueKey=x,this.type=10,this.negated=null}static create(R,x){return new u(R,x)}cmp(R){return R.type!==this.type?this.type-R.type:X(this.key,this.valueKey,R.key,R.valueKey)}equals(R){return R.type===this.type?this.key===R.key&&this.valueKey===R.valueKey:!1}substituteConstants(){return this}evaluate(R){const x=R.getValue(this.valueKey),Y=R.getValue(this.key);return Array.isArray(x)?x.indexOf(Y)>=0:typeof Y=="string"&&typeof x=="object"&&x!==null?_.call(x,Y):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=p.create(this)),this.negated}}class p{constructor(R){this._actual=R,this.type=11}static create(R){return new p(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class E{constructor(R,x,Y){this.key=R,this.value=x,this.negated=Y,this.type=5}static create(R,x,Y=null){if(typeof x=="boolean")return x?D.create(R,Y):c.create(R,Y);const te=w.get(R);return typeof te=="boolean"?x===(te?"true":"false")?y.INSTANCE:f.INSTANCE:new E(R,x,Y)}cmp(R){return R.type!==this.type?this.type-R.type:X(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=w.get(this.key);if(typeof R=="boolean"){const x=R?"true":"false";return this.value===x?y.INSTANCE:f.INSTANCE}return this}evaluate(R){return R.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 D{constructor(R,x){this.key=R,this.negated=x,this.type=3}static create(R,x=null){const Y=w.get(R);return typeof Y=="boolean"?Y?y.INSTANCE:f.INSTANCE:new D(R,x)}cmp(R){return R.type!==this.type?this.type-R.type:z(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=w.get(this.key);return typeof R=="boolean"?R?y.INSTANCE:f.INSTANCE:this}evaluate(R){return!R.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=c.create(this.key,this)),this.negated}}function L(W,R){if(typeof W=="string"){const x=parseFloat(W);isNaN(x)||(W=x)}return typeof W=="string"||typeof W=="number"?R(W):y.INSTANCE}class C{constructor(R,x,Y){this.key=R,this.value=x,this.negated=Y,this.type=12}static create(R,x,Y=null){return L(x,te=>new C(R,te,Y))}cmp(R){return R.type!==this.type?this.type-R.type:X(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=U.create(this.key,this.value,this)),this.negated}}class A{constructor(R,x,Y){this.key=R,this.value=x,this.negated=Y,this.type=13}static create(R,x,Y=null){return L(x,te=>new A(R,te,Y))}cmp(R){return R.type!==this.type?this.type-R.type:X(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=P.create(this.key,this.value,this)),this.negated}}class P{constructor(R,x,Y){this.key=R,this.value=x,this.negated=Y,this.type=14}static create(R,x,Y=null){return L(x,te=>new P(R,te,Y))}cmp(R){return R.type!==this.type?this.type-R.type:X(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this.value,this)),this.negated}}class U{constructor(R,x,Y){this.key=R,this.value=x,this.negated=Y,this.type=15}static create(R,x,Y=null){return L(x,te=>new U(R,te,Y))}cmp(R){return R.type!==this.type?this.type-R.type:X(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this.key,this.value,this)),this.negated}}class N{constructor(R,x){this.key=R,this.regexp=x,this.type=7,this.negated=null}static create(R,x){return new N(R,x)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.key<R.key)return-1;if(this.key>R.key)return 1;const x=this.regexp?this.regexp.source:"",Y=R.regexp?R.regexp.source:"";return x<Y?-1:x>Y?1:0}equals(R){if(R.type===this.type){const x=this.regexp?this.regexp.source:"",Y=R.regexp?R.regexp.source:"";return this.key===R.key&&x===Y}return!1}substituteConstants(){return this}evaluate(R){let x=R.getValue(this.key);return this.regexp?this.regexp.test(x):!1}serialize(){const R=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${R}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=$.create(this)),this.negated}}class ${constructor(R){this._actual=R,this.type=8}static create(R){return new $(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function F(W){let R=null;for(let x=0,Y=W.length;x<Y;x++){const te=W[x].substituteConstants();if(W[x]!==te&&R===null){R=[];for(let Se=0;Se<x;Se++)R[Se]=W[Se]}R!==null&&(R[x]=te)}return R===null?W:R}class q{constructor(R,x){this.expr=R,this.negated=x,this.type=6}static create(R,x){return q._normalizeArr(R,x)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let x=0,Y=this.expr.length;x<Y;x++){const te=n(this.expr[x],R.expr[x]);if(te!==0)return te}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let x=0,Y=this.expr.length;x<Y;x++)if(!this.expr[x].equals(R.expr[x]))return!1;return!0}return!1}substituteConstants(){const R=F(this.expr);return R===this.expr?this:q.create(R,this.negated)}evaluate(R){for(let x=0,Y=this.expr.length;x<Y;x++)if(!this.expr[x].evaluate(R))return!1;return!0}static _normalizeArr(R,x){const Y=[];let te=!1;for(const Se of R)if(Se){if(Se.type===1){te=!0;continue}if(Se.type===0)return y.INSTANCE;if(Se.type===6){Y.push(...Se.expr);continue}Y.push(Se)}if(Y.length===0&&te)return f.INSTANCE;if(Y.length!==0){if(Y.length===1)return Y[0];Y.sort(n);for(let Se=1;Se<Y.length;Se++)Y[Se-1].equals(Y[Se])&&(Y.splice(Se,1),Se--);if(Y.length===1)return Y[0];for(;Y.length>1;){const Se=Y[Y.length-1];if(Se.type!==9)break;Y.pop();const Ie=Y.pop(),Ge=Y.length===0,Ee=V.create(Se.expr.map(ze=>q.create([ze,Ie],null)),null,Ge);Ee&&(Y.push(Ee),Y.sort(n))}return Y.length===1?Y[0]:new q(Y,x)}}serialize(){return this.expr.map(R=>R.serialize()).join(" && ")}keys(){const R=[];for(let x of this.expr)R.push(...x.keys());return R}negate(){if(!this.negated){const R=[];for(let x of this.expr)R.push(x.negate());this.negated=V.create(R,this,!0)}return this.negated}}class V{constructor(R,x){this.expr=R,this.negated=x,this.type=9}static create(R,x,Y){return V._normalizeArr(R,x,Y)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let x=0,Y=this.expr.length;x<Y;x++){const te=n(this.expr[x],R.expr[x]);if(te!==0)return te}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let x=0,Y=this.expr.length;x<Y;x++)if(!this.expr[x].equals(R.expr[x]))return!1;return!0}return!1}substituteConstants(){const R=F(this.expr);return R===this.expr?this:V.create(R,this.negated,!1)}evaluate(R){for(let x=0,Y=this.expr.length;x<Y;x++)if(this.expr[x].evaluate(R))return!0;return!1}static _normalizeArr(R,x,Y){let te=[],Se=!1;if(R){for(let Ie=0,Ge=R.length;Ie<Ge;Ie++){const Ee=R[Ie];if(Ee){if(Ee.type===0){Se=!0;continue}if(Ee.type===1)return f.INSTANCE;if(Ee.type===9){te=te.concat(Ee.expr);continue}te.push(Ee)}}if(te.length===0&&Se)return y.INSTANCE;te.sort(n)}if(te.length!==0){if(te.length===1)return te[0];for(let Ie=1;Ie<te.length;Ie++)te[Ie-1].equals(te[Ie])&&(te.splice(Ie,1),Ie--);if(te.length===1)return te[0];if(Y){for(let Ie=0;Ie<te.length;Ie++)for(let Ge=Ie+1;Ge<te.length;Ge++)B(te[Ie],te[Ge])&&(te.splice(Ge,1),Ge--);if(te.length===1)return te[0]}return new V(te,x)}}serialize(){return this.expr.map(R=>R.serialize()).join(" || ")}keys(){const R=[];for(let x of this.expr)R.push(...x.keys());return R}negate(){if(!this.negated){let R=[];for(let x of this.expr)R.push(x.negate());for(;R.length>1;){const x=R.shift(),Y=R.shift(),te=[];for(const Ie of G(x))for(const Ge of G(Y))te.push(q.create([Ie,Ge],null));const Se=R.length===0;R.unshift(V.create(te,null,Se))}this.negated=R[0]}return this.negated}}class ne extends c{constructor(R,x,Y){super(R,null),this._defaultValue=x,typeof Y=="object"?ne._info.push(Object.assign(Object.assign({},Y),{key:R})):Y!==!0&&ne._info.push({key:R,description:Y,type:x!=null?typeof x:void 0})}static all(){return ne._info.values()}bindTo(R){return R.createKey(this.key,this._defaultValue)}getValue(R){return R.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(R){return l.create(this.key,R)}}ne._info=[];const oe=(0,K.yh)("contextKeyService"),J="setContext";function z(W,R){return W<R?-1:W>R?1:0}function X(W,R,x,Y){return W<x?-1:W>x?1:R<Y?-1:R>Y?1:0}function B(W,R){if(R.type===6&&W.type!==9&&W.type!==6){for(const te of R.expr)if(W.equals(te))return!0}const x=W.negate(),Y=G(x).concat(G(R));Y.sort(n);for(let te=0;te<Y.length;te++){const Ie=Y[te].negate();for(let Ge=te+1;Ge<Y.length;Ge++){const Ee=Y[Ge];if(Ie.equals(Ee))return!0}}return!1}function G(W){return W.type===9?W.expr:[W]}},16925:function(dt,me,b){"use strict";b.d(me,{I8:function(){return k},TG:function(){return I},jt:function(){return w},yh:function(){return T}});var k;(function(_){_.serviceIds=new Map,_.DI_TARGET="$di$target",_.DI_DEPENDENCIES="$di$dependencies";function O(m){return m[_.DI_DEPENDENCIES]||[]}_.getServiceDependencies=O})(k||(k={}));const I=T("instantiationService");function K(_,O,m,n){O[k.DI_TARGET]===O?O[k.DI_DEPENDENCIES].push({id:_,index:m,optional:n}):(O[k.DI_DEPENDENCIES]=[{id:_,index:m,optional:n}],O[k.DI_TARGET]=O)}function T(_){if(k.serviceIds.has(_))return k.serviceIds.get(_);const O=function(m,n,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");K(O,m,y,!1)};return O.toString=()=>_,k.serviceIds.set(_,O),O}function w(_){return function(O,m,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");K(_,O,n,!0)}}},44650:function(dt,me,b){"use strict";b.d(me,{B:function(){return T}});var k=b(76068),I=b(72999);class K{constructor(){this.data=new Map}add(_,O){k.ok(I.HD(_)),k.ok(I.Kn(O)),k.ok(!this.data.has(_),"There is already an extension with this id"),this.data.set(_,O)}as(_){return this.data.get(_)||null}}const T=new K},66213:function(dt,me,b){"use strict";b.d(me,{e:function(){return k}});var k;(function(I){I.DARK="dark",I.LIGHT="light",I.HIGH_CONTRAST="hc"})(k||(k={}))},49055:function(dt,me,b){"use strict";b.d(me,{EN:function(){return n},IP:function(){return c},Ic:function(){return p},XE:function(){return O},bB:function(){return E},kS:function(){return y},m6:function(){return f}});var k=b(52615),I=b(4348),K=b(69323),T=b(16925),w=b(44650),_=b(66213);const O=(0,T.yh)("themeService");var m;(function(D){function L(C){return C&&typeof C=="object"&&typeof C.id=="string"}D.isThemeColor=L})(m||(m={}));function n(D){return{id:D}}var y;(function(D){function L($){return $&&typeof $=="object"&&typeof $.id=="string"&&(typeof $.color=="undefined"||m.isThemeColor($.color))}D.isThemeIcon=L;const C=new RegExp(`^\\$\\((${k.dT.iconNameExpression}(?:${k.dT.iconModifierExpression})?)\\)$`);function A($){const F=C.exec($);if(!F)return;let[,q]=F;return{id:q}}D.fromString=A;function P($,F){let q=$.id;const V=q.lastIndexOf("~");return V!==-1&&(q=q.substring(0,V)),F&&(q=`${q}~${F}`),{id:q}}D.modify=P;function U($,F){var q,V;return $.id===F.id&&((q=$.color)===null||q===void 0?void 0:q.id)===((V=F.color)===null||V===void 0?void 0:V.id)}D.isEqual=U;function N($,F){return{id:$.id,color:F?n(F):void 0}}D.asThemeIcon=N,D.asClassNameArray=k.dT.asClassNameArray,D.asClassName=k.dT.asClassName,D.asCSSSelector=k.dT.asCSSSelector})(y||(y={}));function f(D){switch(D){case _.e.DARK:return"vs-dark";case _.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const c={ThemingContribution:"base.contributions.theming"};class l{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new I.Q5}onColorThemeChange(L){return this.themingParticipants.push(L),this.onThemingParticipantAddedEmitter.fire(L),(0,K.OF)(()=>{const C=this.themingParticipants.indexOf(L);this.themingParticipants.splice(C,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new l;w.B.add(c.ThemingContribution,u);function p(D){return u.onColorThemeChange(D)}class E extends K.JT{constructor(L){super(),this.themeService=L,this.theme=L.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(C=>this.onThemeChange(C)))}onThemeChange(L){this.theme=L,this.updateStyles()}updateStyles(){}}},66003:function(dt,me,b){"use strict";b.d(me,{Z:function(){return O}});var k=b(62646),I=b(20439),K=b(93664),T=b(59301),w=["show"];function _(m,n){if(!n.max)return!0;var y=n.strategy(m);return y<=n.max}function O(m,n){return T.useMemo(function(){var y={};n&&(y.show=(0,K.Z)(n)==="object"&&n.formatter?n.formatter:!!n),y=(0,I.Z)((0,I.Z)({},y),m);var f=y,c=f.show,l=(0,k.Z)(f,w);return(0,I.Z)((0,I.Z)({},l),{},{show:!!c,showFormatter:typeof c=="function"?c:void 0,strategy:l.strategy||function(u){return u.length}})},[m,n])}},36901:function(dt,me,b){"use strict";b.r(me),b.d(me,{BaseInput:function(){return y},default:function(){return A}});var k=b(20439),I=b(14809),K=b(4635),T=b(93664),w=b(92310),_=b.n(w),O=b(59301),m=b(30292),n=O.forwardRef(function(P,U){var N,$,F,q=P.inputElement,V=P.children,ne=P.prefixCls,oe=P.prefix,J=P.suffix,z=P.addonBefore,X=P.addonAfter,B=P.className,G=P.style,W=P.disabled,R=P.readOnly,x=P.focused,Y=P.triggerFocus,te=P.allowClear,Se=P.value,Ie=P.handleReset,Ge=P.hidden,Ee=P.classes,ze=P.classNames,He=P.dataAttrs,Be=P.styles,lt=P.components,At=P.onClear,nt=V!=null?V:q,Bt=(lt==null?void 0:lt.affixWrapper)||"span",Nt=(lt==null?void 0:lt.groupWrapper)||"span",Le=(lt==null?void 0:lt.wrapper)||"span",Re=(lt==null?void 0:lt.groupAddon)||"span",he=(0,O.useRef)(null),Oe=function(ht){var st;(st=he.current)!==null&&st!==void 0&&st.contains(ht.target)&&(Y==null||Y())},We=(0,m.X3)(P),qe=(0,O.cloneElement)(nt,{value:Se,className:_()((N=nt.props)===null||N===void 0?void 0:N.className,!We&&(ze==null?void 0:ze.variant))||null}),ae=(0,O.useRef)(null);if(O.useImperativeHandle(U,function(){return{nativeElement:ae.current||he.current}}),We){var se=null;if(te){var pe=!W&&!R&&Se,ge="".concat(ne,"-clear-icon"),de=(0,T.Z)(te)==="object"&&te!==null&&te!==void 0&&te.clearIcon?te.clearIcon:"\u2716";se=O.createElement("button",{type:"button",tabIndex:-1,onClick:function(ht){Ie==null||Ie(ht),At==null||At()},onMouseDown:function(ht){return ht.preventDefault()},className:_()(ge,(0,K.Z)((0,K.Z)({},"".concat(ge,"-hidden"),!pe),"".concat(ge,"-has-suffix"),!!J))},de)}var Ce="".concat(ne,"-affix-wrapper"),Fe=_()(Ce,(0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)({},"".concat(ne,"-disabled"),W),"".concat(Ce,"-disabled"),W),"".concat(Ce,"-focused"),x),"".concat(Ce,"-readonly"),R),"".concat(Ce,"-input-with-clear-btn"),J&&te&&Se),Ee==null?void 0:Ee.affixWrapper,ze==null?void 0:ze.affixWrapper,ze==null?void 0:ze.variant),Te=(J||te)&&O.createElement("span",{className:_()("".concat(ne,"-suffix"),ze==null?void 0:ze.suffix),style:Be==null?void 0:Be.suffix},se,J);qe=O.createElement(Bt,(0,I.Z)({className:Fe,style:Be==null?void 0:Be.affixWrapper,onClick:Oe},He==null?void 0:He.affixWrapper,{ref:he}),oe&&O.createElement("span",{className:_()("".concat(ne,"-prefix"),ze==null?void 0:ze.prefix),style:Be==null?void 0:Be.prefix},oe),qe,Te)}if((0,m.He)(P)){var Ne="".concat(ne,"-group"),Me="".concat(Ne,"-addon"),je="".concat(Ne,"-wrapper"),tt=_()("".concat(ne,"-wrapper"),Ne,Ee==null?void 0:Ee.wrapper,ze==null?void 0:ze.wrapper),Ze=_()(je,(0,K.Z)({},"".concat(je,"-disabled"),W),Ee==null?void 0:Ee.group,ze==null?void 0:ze.groupWrapper);qe=O.createElement(Nt,{className:Ze,ref:ae},O.createElement(Le,{className:tt},z&&O.createElement(Re,{className:Me},z),qe,X&&O.createElement(Re,{className:Me},X)))}return O.cloneElement(qe,{className:_()(($=qe.props)===null||$===void 0?void 0:$.className,B)||null,style:(0,k.Z)((0,k.Z)({},(F=qe.props)===null||F===void 0?void 0:F.style),G),hidden:Ge})}),y=n,f=b(95190),c=b(50298),l=b(62646),u=b(18929),p=b(2738),E=b(66003),D=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],L=(0,O.forwardRef)(function(P,U){var N=P.autoComplete,$=P.onChange,F=P.onFocus,q=P.onBlur,V=P.onPressEnter,ne=P.onKeyDown,oe=P.onKeyUp,J=P.prefixCls,z=J===void 0?"rc-input":J,X=P.disabled,B=P.htmlSize,G=P.className,W=P.maxLength,R=P.suffix,x=P.showCount,Y=P.count,te=P.type,Se=te===void 0?"text":te,Ie=P.classes,Ge=P.classNames,Ee=P.styles,ze=P.onCompositionStart,He=P.onCompositionEnd,Be=(0,l.Z)(P,D),lt=(0,O.useState)(!1),At=(0,c.Z)(lt,2),nt=At[0],Bt=At[1],Nt=(0,O.useRef)(!1),Le=(0,O.useRef)(!1),Re=(0,O.useRef)(null),he=(0,O.useRef)(null),Oe=function(Ct){Re.current&&(0,m.nH)(Re.current,Ct)},We=(0,u.Z)(P.defaultValue,{value:P.value}),qe=(0,c.Z)(We,2),ae=qe[0],se=qe[1],pe=ae==null?"":String(ae),ge=(0,O.useState)(null),de=(0,c.Z)(ge,2),Ce=de[0],Fe=de[1],Te=(0,E.Z)(Y,x),Ne=Te.max||W,Me=Te.strategy(pe),je=!!Ne&&Me>Ne;(0,O.useImperativeHandle)(U,function(){var Je;return{focus:Oe,blur:function(){var xe;(xe=Re.current)===null||xe===void 0||xe.blur()},setSelectionRange:function(xe,ve,ye){var ee;(ee=Re.current)===null||ee===void 0||ee.setSelectionRange(xe,ve,ye)},select:function(){var xe;(xe=Re.current)===null||xe===void 0||xe.select()},input:Re.current,nativeElement:((Je=he.current)===null||Je===void 0?void 0:Je.nativeElement)||Re.current}}),(0,O.useEffect)(function(){Le.current&&(Le.current=!1),Bt(function(Je){return Je&&X?!1:Je})},[X]);var tt=function(Ct,xe,ve){var ye=xe;if(!Nt.current&&Te.exceedFormatter&&Te.max&&Te.strategy(xe)>Te.max){if(ye=Te.exceedFormatter(xe,{max:Te.max}),xe!==ye){var ee,ie;Fe([((ee=Re.current)===null||ee===void 0?void 0:ee.selectionStart)||0,((ie=Re.current)===null||ie===void 0?void 0:ie.selectionEnd)||0])}}else if(ve.source==="compositionEnd")return;se(ye),Re.current&&(0,m.rJ)(Re.current,Ct,$,ye)};(0,O.useEffect)(function(){if(Ce){var Je;(Je=Re.current)===null||Je===void 0||Je.setSelectionRange.apply(Je,(0,f.Z)(Ce))}},[Ce]);var Ze=function(Ct){tt(Ct,Ct.target.value,{source:"change"})},it=function(Ct){Nt.current=!1,tt(Ct,Ct.currentTarget.value,{source:"compositionEnd"}),He==null||He(Ct)},ht=function(Ct){V&&Ct.key==="Enter"&&!Le.current&&(Le.current=!0,V(Ct)),ne==null||ne(Ct)},st=function(Ct){Ct.key==="Enter"&&(Le.current=!1),oe==null||oe(Ct)},Qe=function(Ct){Bt(!0),F==null||F(Ct)},mt=function(Ct){Le.current&&(Le.current=!1),Bt(!1),q==null||q(Ct)},Dt=function(Ct){se(""),Oe(),Re.current&&(0,m.rJ)(Re.current,Ct,$)},Mt=je&&"".concat(z,"-out-of-range"),kt=function(){var Ct=(0,p.Z)(P,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return O.createElement("input",(0,I.Z)({autoComplete:N},Ct,{onChange:Ze,onFocus:Qe,onBlur:mt,onKeyDown:ht,onKeyUp:st,className:_()(z,(0,K.Z)({},"".concat(z,"-disabled"),X),Ge==null?void 0:Ge.input),style:Ee==null?void 0:Ee.input,ref:Re,size:B,type:Se,onCompositionStart:function(ve){Nt.current=!0,ze==null||ze(ve)},onCompositionEnd:it}))},jt=function(){var Ct=Number(Ne)>0;if(R||Te.show){var xe=Te.showFormatter?Te.showFormatter({value:pe,count:Me,maxLength:Ne}):"".concat(Me).concat(Ct?" / ".concat(Ne):"");return O.createElement(O.Fragment,null,Te.show&&O.createElement("span",{className:_()("".concat(z,"-show-count-suffix"),(0,K.Z)({},"".concat(z,"-show-count-has-suffix"),!!R),Ge==null?void 0:Ge.count),style:(0,k.Z)({},Ee==null?void 0:Ee.count)},xe),R)}return null};return O.createElement(y,(0,I.Z)({},Be,{prefixCls:z,className:_()(G,Mt),handleReset:Dt,value:pe,focused:nt,triggerFocus:Oe,suffix:jt(),disabled:X,classes:Ie,classNames:Ge,styles:Ee}),kt())}),C=L,A=C},30292:function(dt,me,b){"use strict";b.d(me,{He:function(){return k},X3:function(){return I},nH:function(){return w},rJ:function(){return T}});function k(_){return!!(_.addonBefore||_.addonAfter)}function I(_){return!!(_.prefix||_.suffix||_.allowClear)}function K(_,O,m){var n=O.cloneNode(!0),y=Object.create(_,{target:{value:n},currentTarget:{value:n}});return n.value=m,typeof O.selectionStart=="number"&&typeof O.selectionEnd=="number"&&(n.selectionStart=O.selectionStart,n.selectionEnd=O.selectionEnd),n.setSelectionRange=function(){O.setSelectionRange.apply(O,arguments)},y}function T(_,O,m,n){if(m){var y=O;if(O.type==="click"){y=K(O,_,""),m(y);return}if(_.type!=="file"&&n!==void 0){y=K(O,_,n),m(y);return}m(y)}}function w(_,O){if(_){_.focus(O);var m=O||{},n=m.cursor;if(n){var y=_.value.length;switch(n){case"start":_.setSelectionRange(0,0);break;case"end":_.setSelectionRange(y,y);break;default:_.setSelectionRange(0,y)}}}}},29301:function(dt,me,b){"use strict";b.d(me,{Z:function(){return J}});var k=b(14809),I=b(59301),K=b(11592),T=b(48736),w=b(20439),_=b(93664),O=b(76846),m=b(8654),n=I.createContext(null);function y(z){var X=z.children,B=z.onBatchResize,G=I.useRef(0),W=I.useRef([]),R=I.useContext(n),x=I.useCallback(function(Y,te,Se){G.current+=1;var Ie=G.current;W.current.push({size:Y,element:te,data:Se}),Promise.resolve().then(function(){Ie===G.current&&(B==null||B(W.current),W.current=[])}),R==null||R(Y,te,Se)},[B,R]);return I.createElement(n.Provider,{value:x},X)}var f=b(76374),c=new Map;function l(z){z.forEach(function(X){var B,G=X.target;(B=c.get(G))===null||B===void 0||B.forEach(function(W){return W(G)})})}var u=new f.Z(l),p=null,E=null;function D(z,X){c.has(z)||(c.set(z,new Set),u.observe(z)),c.get(z).add(X)}function L(z,X){c.has(z)&&(c.get(z).delete(X),c.get(z).size||(u.unobserve(z),c.delete(z)))}var C=b(99153),A=b(84851),P=b(19257),U=b(93046),N=function(z){(0,P.Z)(B,z);var X=(0,U.Z)(B);function B(){return(0,C.Z)(this,B),X.apply(this,arguments)}return(0,A.Z)(B,[{key:"render",value:function(){return this.props.children}}]),B}(I.Component);function $(z,X){var B=z.children,G=z.disabled,W=I.useRef(null),R=I.useRef(null),x=I.useContext(n),Y=typeof B=="function",te=Y?B(W):B,Se=I.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ie=!Y&&I.isValidElement(te)&&(0,m.Yr)(te),Ge=Ie?(0,m.C4)(te):null,Ee=(0,m.x1)(Ge,W),ze=function(){var At;return(0,O.ZP)(W.current)||(W.current&&(0,_.Z)(W.current)==="object"?(0,O.ZP)((At=W.current)===null||At===void 0?void 0:At.nativeElement):null)||(0,O.ZP)(R.current)};I.useImperativeHandle(X,function(){return ze()});var He=I.useRef(z);He.current=z;var Be=I.useCallback(function(lt){var At=He.current,nt=At.onResize,Bt=At.data,Nt=lt.getBoundingClientRect(),Le=Nt.width,Re=Nt.height,he=lt.offsetWidth,Oe=lt.offsetHeight,We=Math.floor(Le),qe=Math.floor(Re);if(Se.current.width!==We||Se.current.height!==qe||Se.current.offsetWidth!==he||Se.current.offsetHeight!==Oe){var ae={width:We,height:qe,offsetWidth:he,offsetHeight:Oe};Se.current=ae;var se=he===Math.round(Le)?Le:he,pe=Oe===Math.round(Re)?Re:Oe,ge=(0,w.Z)((0,w.Z)({},ae),{},{offsetWidth:se,offsetHeight:pe});x==null||x(ge,lt,Bt),nt&&Promise.resolve().then(function(){nt(ge,lt)})}},[]);return I.useEffect(function(){var lt=ze();return lt&&!G&&D(lt,Be),function(){return L(lt,Be)}},[W.current,G]),I.createElement(N,{ref:R},Ie?I.cloneElement(te,{ref:Ee}):te)}var F=I.forwardRef($),q=F,V="rc-observer-key";function ne(z,X){var B=z.children,G=typeof B=="function"?[B]:(0,K.Z)(B);return G.map(function(W,R){var x=(W==null?void 0:W.key)||"".concat(V,"-").concat(R);return I.createElement(q,(0,k.Z)({},z,{key:x,ref:R===0?X:void 0}),W)})}var oe=I.forwardRef(ne);oe.Collection=y;var J=oe},22711:function(dt,me,b){"use strict";b.r(me),b.d(me,{ResizableTextArea:function(){return oe},default:function(){return B}});var k=b(14809),I=b(4635),K=b(20439),T=b(95190),w=b(50298),_=b(62646),O=b(92310),m=b.n(O),n=b(36901),y=b(66003),f=b(30292),c=b(18929),l=b(59301),u=b(93664),p=b(29301),E=b(34280),D=b(16089),L=`
|
|
|
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;
|
|
|
`,C=["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"],A={},P;function U(G){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,R=G.getAttribute("id")||G.getAttribute("data-reactid")||G.getAttribute("name");if(W&&A[R])return A[R];var x=window.getComputedStyle(G),Y=x.getPropertyValue("box-sizing")||x.getPropertyValue("-moz-box-sizing")||x.getPropertyValue("-webkit-box-sizing"),te=parseFloat(x.getPropertyValue("padding-bottom"))+parseFloat(x.getPropertyValue("padding-top")),Se=parseFloat(x.getPropertyValue("border-bottom-width"))+parseFloat(x.getPropertyValue("border-top-width")),Ie=C.map(function(Ee){return"".concat(Ee,":").concat(x.getPropertyValue(Ee))}).join(";"),Ge={sizingStyle:Ie,paddingSize:te,borderSize:Se,boxSizing:Y};return W&&R&&(A[R]=Ge),Ge}function N(G){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;P||(P=document.createElement("textarea"),P.setAttribute("tab-index","-1"),P.setAttribute("aria-hidden","true"),P.setAttribute("name","hiddenTextarea"),document.body.appendChild(P)),G.getAttribute("wrap")?P.setAttribute("wrap",G.getAttribute("wrap")):P.removeAttribute("wrap");var Y=U(G,W),te=Y.paddingSize,Se=Y.borderSize,Ie=Y.boxSizing,Ge=Y.sizingStyle;P.setAttribute("style","".concat(Ge,";").concat(L)),P.value=G.value||G.placeholder||"";var Ee=void 0,ze=void 0,He,Be=P.scrollHeight;if(Ie==="border-box"?Be+=Se:Ie==="content-box"&&(Be-=te),R!==null||x!==null){P.value=" ";var lt=P.scrollHeight-te;R!==null&&(Ee=lt*R,Ie==="border-box"&&(Ee=Ee+te+Se),Be=Math.max(Ee,Be)),x!==null&&(ze=lt*x,Ie==="border-box"&&(ze=ze+te+Se),He=Be>ze?"":"hidden",Be=Math.min(ze,Be))}var At={height:Be,overflowY:He,resize:"none"};return Ee&&(At.minHeight=Ee),ze&&(At.maxHeight=ze),At}var $=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],F=0,q=1,V=2,ne=l.forwardRef(function(G,W){var R=G,x=R.prefixCls,Y=R.defaultValue,te=R.value,Se=R.autoSize,Ie=R.onResize,Ge=R.className,Ee=R.style,ze=R.disabled,He=R.onChange,Be=R.onInternalAutoSize,lt=(0,_.Z)(R,$),At=(0,c.Z)(Y,{value:te,postState:function(mt){return mt!=null?mt:""}}),nt=(0,w.Z)(At,2),Bt=nt[0],Nt=nt[1],Le=function(mt){Nt(mt.target.value),He==null||He(mt)},Re=l.useRef();l.useImperativeHandle(W,function(){return{textArea:Re.current}});var he=l.useMemo(function(){return Se&&(0,u.Z)(Se)==="object"?[Se.minRows,Se.maxRows]:[]},[Se]),Oe=(0,w.Z)(he,2),We=Oe[0],qe=Oe[1],ae=!!Se,se=function(){try{if(document.activeElement===Re.current){var mt=Re.current,Dt=mt.selectionStart,Mt=mt.selectionEnd,kt=mt.scrollTop;Re.current.setSelectionRange(Dt,Mt),Re.current.scrollTop=kt}}catch(jt){}},pe=l.useState(V),ge=(0,w.Z)(pe,2),de=ge[0],Ce=ge[1],Fe=l.useState(),Te=(0,w.Z)(Fe,2),Ne=Te[0],Me=Te[1],je=function(){Ce(F)};(0,E.Z)(function(){ae&&je()},[te,We,qe,ae]),(0,E.Z)(function(){if(de===F)Ce(q);else if(de===q){var Qe=N(Re.current,!1,We,qe);Ce(V),Me(Qe)}else se()},[de]);var tt=l.useRef(),Ze=function(){D.Z.cancel(tt.current)},it=function(mt){de===V&&(Ie==null||Ie(mt),Se&&(Ze(),tt.current=(0,D.Z)(function(){je()})))};l.useEffect(function(){return Ze},[]);var ht=ae?Ne:null,st=(0,K.Z)((0,K.Z)({},Ee),ht);return(de===F||de===q)&&(st.overflowY="hidden",st.overflowX="hidden"),l.createElement(p.Z,{onResize:it,disabled:!(Se||Ie)},l.createElement("textarea",(0,k.Z)({},lt,{ref:Re,style:st,className:m()(x,Ge,(0,I.Z)({},"".concat(x,"-disabled"),ze)),disabled:ze,value:Bt,onChange:Le})))}),oe=ne,J=["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"],z=l.forwardRef(function(G,W){var R,x=G.defaultValue,Y=G.value,te=G.onFocus,Se=G.onBlur,Ie=G.onChange,Ge=G.allowClear,Ee=G.maxLength,ze=G.onCompositionStart,He=G.onCompositionEnd,Be=G.suffix,lt=G.prefixCls,At=lt===void 0?"rc-textarea":lt,nt=G.showCount,Bt=G.count,Nt=G.className,Le=G.style,Re=G.disabled,he=G.hidden,Oe=G.classNames,We=G.styles,qe=G.onResize,ae=G.onClear,se=G.onPressEnter,pe=G.readOnly,ge=G.autoSize,de=G.onKeyDown,Ce=(0,_.Z)(G,J),Fe=(0,c.Z)(x,{value:Y,defaultValue:x}),Te=(0,w.Z)(Fe,2),Ne=Te[0],Me=Te[1],je=Ne==null?"":String(Ne),tt=l.useState(!1),Ze=(0,w.Z)(tt,2),it=Ze[0],ht=Ze[1],st=l.useRef(!1),Qe=l.useState(null),mt=(0,w.Z)(Qe,2),Dt=mt[0],Mt=mt[1],kt=(0,l.useRef)(null),jt=(0,l.useRef)(null),Je=function(){var Ot;return(Ot=jt.current)===null||Ot===void 0?void 0:Ot.textArea},Ct=function(){Je().focus()};(0,l.useImperativeHandle)(W,function(){var St;return{resizableTextArea:jt.current,focus:Ct,blur:function(){Je().blur()},nativeElement:((St=kt.current)===null||St===void 0?void 0:St.nativeElement)||Je()}}),(0,l.useEffect)(function(){ht(function(St){return!Re&&St})},[Re]);var xe=l.useState(null),ve=(0,w.Z)(xe,2),ye=ve[0],ee=ve[1];l.useEffect(function(){if(ye){var St;(St=Je()).setSelectionRange.apply(St,(0,T.Z)(ye))}},[ye]);var ie=(0,y.Z)(Bt,nt),ue=(R=ie.max)!==null&&R!==void 0?R:Ee,ce=Number(ue)>0,_e=ie.strategy(je),Ve=!!ue&&_e>ue,Ye=function(Ot,Xt){var gi=Xt;!st.current&&ie.exceedFormatter&&ie.max&&ie.strategy(Xt)>ie.max&&(gi=ie.exceedFormatter(Xt,{max:ie.max}),Xt!==gi&&ee([Je().selectionStart||0,Je().selectionEnd||0])),Me(gi),(0,f.rJ)(Ot.currentTarget,Ot,Ie,gi)},at=function(Ot){st.current=!0,ze==null||ze(Ot)},ft=function(Ot){st.current=!1,Ye(Ot,Ot.currentTarget.value),He==null||He(Ot)},Lt=function(Ot){Ye(Ot,Ot.target.value)},Kt=function(Ot){Ot.key==="Enter"&&se&&se(Ot),de==null||de(Ot)},Et=function(Ot){ht(!0),te==null||te(Ot)},xt=function(Ot){ht(!1),Se==null||Se(Ot)},ui=function(Ot){Me(""),Ct(),(0,f.rJ)(Je(),Ot,Ie)},_i=Be,ci;ie.show&&(ie.showFormatter?ci=ie.showFormatter({value:je,count:_e,maxLength:ue}):ci="".concat(_e).concat(ce?" / ".concat(ue):""),_i=l.createElement(l.Fragment,null,_i,l.createElement("span",{className:m()("".concat(At,"-data-count"),Oe==null?void 0:Oe.count),style:We==null?void 0:We.count},ci)));var ii=function(Ot){var Xt;qe==null||qe(Ot),(Xt=Je())!==null&&Xt!==void 0&&Xt.style.height&&Mt(!0)},Ut=!ge&&!nt&&!Ge;return l.createElement(n.BaseInput,{ref:kt,value:je,allowClear:Ge,handleReset:ui,suffix:_i,prefixCls:At,classNames:(0,K.Z)((0,K.Z)({},Oe),{},{affixWrapper:m()(Oe==null?void 0:Oe.affixWrapper,(0,I.Z)((0,I.Z)({},"".concat(At,"-show-count"),nt),"".concat(At,"-textarea-allow-clear"),Ge))}),disabled:Re,focused:it,className:m()(Nt,Ve&&"".concat(At,"-out-of-range")),style:(0,K.Z)((0,K.Z)({},Le),Dt&&!Ut?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof ci=="string"?ci:void 0}},hidden:he,readOnly:pe,onClear:ae},l.createElement(oe,(0,k.Z)({},Ce,{autoSize:ge,maxLength:Ee,onKeyDown:Kt,onChange:Lt,onFocus:Et,onBlur:xt,onCompositionStart:at,onCompositionEnd:ft,className:m()(Oe==null?void 0:Oe.textarea),style:(0,K.Z)((0,K.Z)({},We==null?void 0:We.textarea),{},{resize:Le==null?void 0:Le.resize}),disabled:Re,prefixCls:At,onResize:ii,ref:jt,readOnly:pe})))}),X=z,B=X},29125:function(dt,me,b){"use strict";b.d(me,{G:function(){return T},Z:function(){return L}});var k=b(92310),I=b.n(k),K=b(59301);function T(C){var A=C.children,P=C.prefixCls,U=C.id,N=C.overlayInnerStyle,$=C.bodyClassName,F=C.className,q=C.style;return K.createElement("div",{className:I()("".concat(P,"-content"),F),style:q},K.createElement("div",{className:I()("".concat(P,"-inner"),$),id:U,role:"tooltip",style:N},typeof A=="function"?A():A))}var w=b(14809),_=b(20439),O=b(62646),m=b(65966),n={shiftX:64,adjustY:1},y={adjustX:1,shiftY:!0},f=[0,0],c={left:{points:["cr","cl"],overflow:y,offset:[-4,0],targetOffset:f},right:{points:["cl","cr"],overflow:y,offset:[4,0],targetOffset:f},top:{points:["bc","tc"],overflow:n,offset:[0,-4],targetOffset:f},bottom:{points:["tc","bc"],overflow:n,offset:[0,4],targetOffset:f},topLeft:{points:["bl","tl"],overflow:n,offset:[0,-4],targetOffset:f},leftTop:{points:["tr","tl"],overflow:y,offset:[-4,0],targetOffset:f},topRight:{points:["br","tr"],overflow:n,offset:[0,-4],targetOffset:f},rightTop:{points:["tl","tr"],overflow:y,offset:[4,0],targetOffset:f},bottomRight:{points:["tr","br"],overflow:n,offset:[0,4],targetOffset:f},rightBottom:{points:["bl","br"],overflow:y,offset:[4,0],targetOffset:f},bottomLeft:{points:["tl","bl"],overflow:n,offset:[0,4],targetOffset:f},leftBottom:{points:["br","bl"],overflow:y,offset:[-4,0],targetOffset:f}},l=null,u=b(80402),p=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],E=function(A,P){var U=A.overlayClassName,N=A.trigger,$=N===void 0?["hover"]:N,F=A.mouseEnterDelay,q=F===void 0?0:F,V=A.mouseLeaveDelay,ne=V===void 0?.1:V,oe=A.overlayStyle,J=A.prefixCls,z=J===void 0?"rc-tooltip":J,X=A.children,B=A.onVisibleChange,G=A.afterVisibleChange,W=A.transitionName,R=A.animation,x=A.motion,Y=A.placement,te=Y===void 0?"right":Y,Se=A.align,Ie=Se===void 0?{}:Se,Ge=A.destroyTooltipOnHide,Ee=Ge===void 0?!1:Ge,ze=A.defaultVisible,He=A.getTooltipContainer,Be=A.overlayInnerStyle,lt=A.arrowContent,At=A.overlay,nt=A.id,Bt=A.showArrow,Nt=Bt===void 0?!0:Bt,Le=A.classNames,Re=A.styles,he=(0,O.Z)(A,p),Oe=(0,u.Z)(nt),We=(0,K.useRef)(null);(0,K.useImperativeHandle)(P,function(){return We.current});var qe=(0,_.Z)({},he);"visible"in A&&(qe.popupVisible=A.visible);var ae=function(){return K.createElement(T,{key:"content",prefixCls:z,id:Oe,bodyClassName:Le==null?void 0:Le.body,overlayInnerStyle:(0,_.Z)((0,_.Z)({},Be),Re==null?void 0:Re.body)},At)},se=function(){var ge=K.Children.only(X),de=(ge==null?void 0:ge.props)||{},Ce=(0,_.Z)((0,_.Z)({},de),{},{"aria-describedby":At?Oe:null});return K.cloneElement(X,Ce)};return K.createElement(m.Z,(0,w.Z)({popupClassName:I()(U,Le==null?void 0:Le.root),prefixCls:z,popup:ae,action:$,builtinPlacements:c,popupPlacement:te,ref:We,popupAlign:Ie,getPopupContainer:He,onPopupVisibleChange:B,afterPopupVisibleChange:G,popupTransitionName:W,popupAnimation:R,popupMotion:x,defaultPopupVisible:ze,autoDestroy:Ee,mouseLeaveDelay:ne,popupStyle:(0,_.Z)((0,_.Z)({},oe),Re==null?void 0:Re.root),mouseEnterDelay:q,arrow:Nt},qe),se())},D=(0,K.forwardRef)(E),L=D},49658:function(dt,me){"use strict";me.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var b=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(b)||/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(b==null?void 0:b.substr(0,4))}},83145:function(dt,me,b){"use strict";Object.defineProperty(me,"__esModule",{value:!0}),me.CopyToClipboard=void 0;var k=K(b(59301)),I=K(b(25769));function K(C){return C&&C.__esModule?C:{default:C}}function T(C){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?T=function(P){return typeof P}:T=function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},T(C)}function w(C,A){var P=Object.keys(C);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(C);A&&(U=U.filter(function(N){return Object.getOwnPropertyDescriptor(C,N).enumerable})),P.push.apply(P,U)}return P}function _(C){for(var A=1;A<arguments.length;A++){var P=arguments[A]!=null?arguments[A]:{};A%2?w(P,!0).forEach(function(U){D(C,U,P[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(P)):w(P).forEach(function(U){Object.defineProperty(C,U,Object.getOwnPropertyDescriptor(P,U))})}return C}function O(C,A){if(C==null)return{};var P=m(C,A),U,N;if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(C);for(N=0;N<$.length;N++)U=$[N],!(A.indexOf(U)>=0)&&Object.prototype.propertyIsEnumerable.call(C,U)&&(P[U]=C[U])}return P}function m(C,A){if(C==null)return{};var P={},U=Object.keys(C),N,$;for($=0;$<U.length;$++)N=U[$],!(A.indexOf(N)>=0)&&(P[N]=C[N]);return P}function n(C,A){if(!(C instanceof A))throw new TypeError("Cannot call a class as a function")}function y(C,A){for(var P=0;P<A.length;P++){var U=A[P];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(C,U.key,U)}}function f(C,A,P){return A&&y(C.prototype,A),P&&y(C,P),C}function c(C,A){return A&&(T(A)==="object"||typeof A=="function")?A:u(C)}function l(C){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(P){return P.__proto__||Object.getPrototypeOf(P)},l(C)}function u(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function p(C,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");C.prototype=Object.create(A&&A.prototype,{constructor:{value:C,writable:!0,configurable:!0}}),A&&E(C,A)}function E(C,A){return E=Object.setPrototypeOf||function(U,N){return U.__proto__=N,U},E(C,A)}function D(C,A,P){return A in C?Object.defineProperty(C,A,{value:P,enumerable:!0,configurable:!0,writable:!0}):C[A]=P,C}var L=function(C){p(A,C);function A(){var P,U;n(this,A);for(var N=arguments.length,$=new Array(N),F=0;F<N;F++)$[F]=arguments[F];return U=c(this,(P=l(A)).call.apply(P,[this].concat($))),D(u(U),"onClick",function(q){var V=U.props,ne=V.text,oe=V.onCopy,J=V.children,z=V.options,X=k.default.Children.only(J),B=(0,I.default)(ne,z);oe&&oe(ne,B),X&&X.props&&typeof X.props.onClick=="function"&&X.props.onClick(q)}),U}return f(A,[{key:"render",value:function(){var U=this.props,N=U.text,$=U.onCopy,F=U.options,q=U.children,V=O(U,["text","onCopy","options","children"]),ne=k.default.Children.only(q);return k.default.cloneElement(ne,_({},V,{onClick:this.onClick}))}}]),A}(k.default.PureComponent);me.CopyToClipboard=L,D(L,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(dt,me,b){"use strict";var k=b(83145),I=k.CopyToClipboard;I.CopyToClipboard=I,dt.exports=I},76374:function(dt,me,b){"use strict";var k=function(){if(typeof Map!="undefined")return Map;function J(z,X){var B=-1;return z.some(function(G,W){return G[0]===X?(B=W,!0):!1}),B}return function(){function z(){this.__entries__=[]}return Object.defineProperty(z.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),z.prototype.get=function(X){var B=J(this.__entries__,X),G=this.__entries__[B];return G&&G[1]},z.prototype.set=function(X,B){var G=J(this.__entries__,X);~G?this.__entries__[G][1]=B:this.__entries__.push([X,B])},z.prototype.delete=function(X){var B=this.__entries__,G=J(B,X);~G&&B.splice(G,1)},z.prototype.has=function(X){return!!~J(this.__entries__,X)},z.prototype.clear=function(){this.__entries__.splice(0)},z.prototype.forEach=function(X,B){B===void 0&&(B=null);for(var G=0,W=this.__entries__;G<W.length;G++){var R=W[G];X.call(B,R[1],R[0])}},z}()}(),I=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,K=function(){return typeof b.g!="undefined"&&b.g.Math===Math?b.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),T=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(K):function(J){return setTimeout(function(){return J(Date.now())},1e3/60)}}(),w=2;function _(J,z){var X=!1,B=!1,G=0;function W(){X&&(X=!1,J()),B&&x()}function R(){T(W)}function x(){var Y=Date.now();if(X){if(Y-G<w)return;B=!0}else X=!0,B=!1,setTimeout(R,z);G=Y}return x}var O=20,m=["top","right","bottom","left","width","height","size","weight"],n=typeof MutationObserver!="undefined",y=function(){function J(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=_(this.refresh.bind(this),O)}return J.prototype.addObserver=function(z){~this.observers_.indexOf(z)||this.observers_.push(z),this.connected_||this.connect_()},J.prototype.removeObserver=function(z){var X=this.observers_,B=X.indexOf(z);~B&&X.splice(B,1),!X.length&&this.connected_&&this.disconnect_()},J.prototype.refresh=function(){var z=this.updateObservers_();z&&this.refresh()},J.prototype.updateObservers_=function(){var z=this.observers_.filter(function(X){return X.gatherActive(),X.hasActive()});return z.forEach(function(X){return X.broadcastActive()}),z.length>0},J.prototype.connect_=function(){!I||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),n?(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)},J.prototype.disconnect_=function(){!I||!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)},J.prototype.onTransitionEnd_=function(z){var X=z.propertyName,B=X===void 0?"":X,G=m.some(function(W){return!!~B.indexOf(W)});G&&this.refresh()},J.getInstance=function(){return this.instance_||(this.instance_=new J),this.instance_},J.instance_=null,J}(),f=function(J,z){for(var X=0,B=Object.keys(z);X<B.length;X++){var G=B[X];Object.defineProperty(J,G,{value:z[G],enumerable:!1,writable:!1,configurable:!0})}return J},c=function(J){var z=J&&J.ownerDocument&&J.ownerDocument.defaultView;return z||K},l=N(0,0,0,0);function u(J){return parseFloat(J)||0}function p(J){for(var z=[],X=1;X<arguments.length;X++)z[X-1]=arguments[X];return z.reduce(function(B,G){var W=J["border-"+G+"-width"];return B+u(W)},0)}function E(J){for(var z=["top","right","bottom","left"],X={},B=0,G=z;B<G.length;B++){var W=G[B],R=J["padding-"+W];X[W]=u(R)}return X}function D(J){var z=J.getBBox();return N(0,0,z.width,z.height)}function L(J){var z=J.clientWidth,X=J.clientHeight;if(!z&&!X)return l;var B=c(J).getComputedStyle(J),G=E(B),W=G.left+G.right,R=G.top+G.bottom,x=u(B.width),Y=u(B.height);if(B.boxSizing==="border-box"&&(Math.round(x+W)!==z&&(x-=p(B,"left","right")+W),Math.round(Y+R)!==X&&(Y-=p(B,"top","bottom")+R)),!A(J)){var te=Math.round(x+W)-z,Se=Math.round(Y+R)-X;Math.abs(te)!==1&&(x-=te),Math.abs(Se)!==1&&(Y-=Se)}return N(G.left,G.top,x,Y)}var C=function(){return typeof SVGGraphicsElement!="undefined"?function(J){return J instanceof c(J).SVGGraphicsElement}:function(J){return J instanceof c(J).SVGElement&&typeof J.getBBox=="function"}}();function A(J){return J===c(J).document.documentElement}function P(J){return I?C(J)?D(J):L(J):l}function U(J){var z=J.x,X=J.y,B=J.width,G=J.height,W=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,R=Object.create(W.prototype);return f(R,{x:z,y:X,width:B,height:G,top:X,right:z+B,bottom:G+X,left:z}),R}function N(J,z,X,B){return{x:J,y:z,width:X,height:B}}var $=function(){function J(z){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=N(0,0,0,0),this.target=z}return J.prototype.isActive=function(){var z=P(this.target);return this.contentRect_=z,z.width!==this.broadcastWidth||z.height!==this.broadcastHeight},J.prototype.broadcastRect=function(){var z=this.contentRect_;return this.broadcastWidth=z.width,this.broadcastHeight=z.height,z},J}(),F=function(){function J(z,X){var B=U(X);f(this,{target:z,contentRect:B})}return J}(),q=function(){function J(z,X,B){if(this.activeObservations_=[],this.observations_=new k,typeof z!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=z,this.controller_=X,this.callbackCtx_=B}return J.prototype.observe=function(z){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(z instanceof c(z).Element))throw new TypeError('parameter 1 is not of type "Element".');var X=this.observations_;X.has(z)||(X.set(z,new $(z)),this.controller_.addObserver(this),this.controller_.refresh())}},J.prototype.unobserve=function(z){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(z instanceof c(z).Element))throw new TypeError('parameter 1 is not of type "Element".');var X=this.observations_;X.has(z)&&(X.delete(z),X.size||this.controller_.removeObserver(this))}},J.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},J.prototype.gatherActive=function(){var z=this;this.clearActive(),this.observations_.forEach(function(X){X.isActive()&&z.activeObservations_.push(X)})},J.prototype.broadcastActive=function(){if(this.hasActive()){var z=this.callbackCtx_,X=this.activeObservations_.map(function(B){return new F(B.target,B.broadcastRect())});this.callback_.call(z,X,z),this.clearActive()}},J.prototype.clearActive=function(){this.activeObservations_.splice(0)},J.prototype.hasActive=function(){return this.activeObservations_.length>0},J}(),V=typeof WeakMap!="undefined"?new WeakMap:new k,ne=function(){function J(z){if(!(this instanceof J))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var X=y.getInstance(),B=new q(z,X,this);V.set(this,B)}return J}();["observe","unobserve","disconnect"].forEach(function(J){ne.prototype[J]=function(){var z;return(z=V.get(this))[J].apply(z,arguments)}});var oe=function(){return typeof K.ResizeObserver!="undefined"?K.ResizeObserver:ne}();me.Z=oe},98040:function(dt){dt.exports=function(){var me=document.getSelection();if(!me.rangeCount)return function(){};for(var b=document.activeElement,k=[],I=0;I<me.rangeCount;I++)k.push(me.getRangeAt(I));switch(b.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":b.blur();break;default:b=null;break}return me.removeAllRanges(),function(){me.type==="Caret"&&me.removeAllRanges(),me.rangeCount||k.forEach(function(K){me.addRange(K)}),b&&b.focus()}}},34376:function(dt){(function(me,b){if(1)dt.exports=b();else var k,I})(window,function(){return function(me){var b={};function k(I){if(b[I])return b[I].exports;var K=b[I]={i:I,l:!1,exports:{}};return me[I].call(K.exports,K,K.exports,k),K.l=!0,K.exports}return k.m=me,k.c=b,k.d=function(I,K,T){k.o(I,K)||Object.defineProperty(I,K,{enumerable:!0,get:T})},k.r=function(I){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(I,"__esModule",{value:!0})},k.t=function(I,K){if(1&K&&(I=k(I)),8&K||4&K&&typeof I=="object"&&I&&I.__esModule)return I;var T=Object.create(null);if(k.r(T),Object.defineProperty(T,"default",{enumerable:!0,value:I}),2&K&&typeof I!="string")for(var w in I)k.d(T,w,function(_){return I[_]}.bind(null,w));return T},k.n=function(I){var K=I&&I.__esModule?function(){return I.default}:function(){return I};return k.d(K,"a",K),K},k.o=function(I,K){return Object.prototype.hasOwnProperty.call(I,K)},k.p="",k(k.s=34)}([function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.forwardEvent=b.EventEmitter=void 0;var I=function(){function K(){this._listeners=[],this._disposed=!1}return Object.defineProperty(K.prototype,"event",{get:function(){var T=this;return this._event||(this._event=function(w){return T._listeners.push(w),{dispose:function(){if(!T._disposed){for(var _=0;_<T._listeners.length;_++)if(T._listeners[_]===w)return void T._listeners.splice(_,1)}}}}),this._event},enumerable:!1,configurable:!0}),K.prototype.fire=function(T,w){for(var _=[],O=0;O<this._listeners.length;O++)_.push(this._listeners[O]);for(O=0;O<_.length;O++)_[O].call(void 0,T,w)},K.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},K}();b.EventEmitter=I,b.forwardEvent=function(K,T){return K(function(w){return T.fire(w)})}},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.IUnicodeService=b.IOptionsService=b.ILogService=b.IInstantiationService=b.IDirtyRowService=b.ICharsetService=b.ICoreService=b.ICoreMouseService=b.IBufferService=void 0;var I=k(14);b.IBufferService=I.createDecorator("BufferService"),b.ICoreMouseService=I.createDecorator("CoreMouseService"),b.ICoreService=I.createDecorator("CoreService"),b.ICharsetService=I.createDecorator("CharsetService"),b.IDirtyRowService=I.createDecorator("DirtyRowService"),b.IInstantiationService=I.createDecorator("InstantiationService"),b.ILogService=I.createDecorator("LogService"),b.IOptionsService=I.createDecorator("OptionsService"),b.IUnicodeService=I.createDecorator("UnicodeService")},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.getDisposeArrayDisposable=b.disposeArray=b.Disposable=void 0;var I=function(){function T(){this._disposables=[],this._isDisposed=!1}return T.prototype.dispose=function(){this._isDisposed=!0;for(var w=0,_=this._disposables;w<_.length;w++)_[w].dispose();this._disposables.length=0},T.prototype.register=function(w){return this._disposables.push(w),w},T.prototype.unregister=function(w){var _=this._disposables.indexOf(w);_!==-1&&this._disposables.splice(_,1)},T}();function K(T){for(var w=0,_=T;w<_.length;w++)_[w].dispose();T.length=0}b.Disposable=I,b.disposeArray=K,b.getDisposeArrayDisposable=function(T){return{dispose:function(){return K(T)}}}},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.WHITESPACE_CELL_CODE=b.WHITESPACE_CELL_WIDTH=b.WHITESPACE_CELL_CHAR=b.NULL_CELL_CODE=b.NULL_CELL_WIDTH=b.NULL_CELL_CHAR=b.CHAR_DATA_CODE_INDEX=b.CHAR_DATA_WIDTH_INDEX=b.CHAR_DATA_CHAR_INDEX=b.CHAR_DATA_ATTR_INDEX=b.DEFAULT_ATTR=b.DEFAULT_COLOR=void 0,b.DEFAULT_COLOR=256,b.DEFAULT_ATTR=256|b.DEFAULT_COLOR<<9,b.CHAR_DATA_ATTR_INDEX=0,b.CHAR_DATA_CHAR_INDEX=1,b.CHAR_DATA_WIDTH_INDEX=2,b.CHAR_DATA_CODE_INDEX=3,b.NULL_CELL_CHAR="",b.NULL_CELL_WIDTH=1,b.NULL_CELL_CODE=0,b.WHITESPACE_CELL_CHAR=" ",b.WHITESPACE_CELL_WIDTH=1,b.WHITESPACE_CELL_CODE=32},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(m,n){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,f){y.__proto__=f}||function(y,f){for(var c in f)f.hasOwnProperty(c)&&(y[c]=f[c])})(m,n)},function(m,n){function y(){this.constructor=m}I(m,n),m.prototype=n===null?Object.create(n):(y.prototype=n.prototype,new y)});Object.defineProperty(b,"__esModule",{value:!0}),b.CellData=void 0;var T=k(8),w=k(3),_=k(6),O=function(m){function n(){var y=m!==null&&m.apply(this,arguments)||this;return y.content=0,y.fg=0,y.bg=0,y.extended=new _.ExtendedAttrs,y.combinedData="",y}return K(n,m),n.fromCharData=function(y){var f=new n;return f.setFromCharData(y),f},n.prototype.isCombined=function(){return 2097152&this.content},n.prototype.getWidth=function(){return this.content>>22},n.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?T.stringFromCodePoint(2097151&this.content):""},n.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},n.prototype.setFromCharData=function(y){this.fg=y[w.CHAR_DATA_ATTR_INDEX],this.bg=0;var f=!1;if(y[w.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(y[w.CHAR_DATA_CHAR_INDEX].length===2){var c=y[w.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){var l=y[w.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(c-55296)+l-56320+65536|y[w.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=y[w.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[w.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=y[w.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[w.CHAR_DATA_WIDTH_INDEX]<<22)},n.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},n}(_.AttributeData);b.CellData=O},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ISoundService=b.ISelectionService=b.IRenderService=b.IMouseService=b.ICoreBrowserService=b.ICharSizeService=void 0;var I=k(14);b.ICharSizeService=I.createDecorator("CharSizeService"),b.ICoreBrowserService=I.createDecorator("CoreBrowserService"),b.IMouseService=I.createDecorator("MouseService"),b.IRenderService=I.createDecorator("RenderService"),b.ISelectionService=I.createDecorator("SelectionService"),b.ISoundService=I.createDecorator("SoundService")},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ExtendedAttrs=b.AttributeData=void 0;var I=function(){function T(){this.fg=0,this.bg=0,this.extended=new K}return T.toColorRGB=function(w){return[w>>>16&255,w>>>8&255,255&w]},T.fromColorRGB=function(w){return(255&w[0])<<16|(255&w[1])<<8|255&w[2]},T.prototype.clone=function(){var w=new T;return w.fg=this.fg,w.bg=this.bg,w.extended=this.extended.clone(),w},T.prototype.isInverse=function(){return 67108864&this.fg},T.prototype.isBold=function(){return 134217728&this.fg},T.prototype.isUnderline=function(){return 268435456&this.fg},T.prototype.isBlink=function(){return 536870912&this.fg},T.prototype.isInvisible=function(){return 1073741824&this.fg},T.prototype.isItalic=function(){return 67108864&this.bg},T.prototype.isDim=function(){return 134217728&this.bg},T.prototype.getFgColorMode=function(){return 50331648&this.fg},T.prototype.getBgColorMode=function(){return 50331648&this.bg},T.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},T.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},T.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},T.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},T.prototype.isFgDefault=function(){return(50331648&this.fg)==0},T.prototype.isBgDefault=function(){return(50331648&this.bg)==0},T.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},T.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},T.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},T.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},T.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},T.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},T.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},T.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},T.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},T.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},T.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},T}();b.AttributeData=I;var K=function(){function T(w,_){w===void 0&&(w=0),_===void 0&&(_=-1),this.underlineStyle=w,this.underlineColor=_}return T.prototype.clone=function(){return new T(this.underlineStyle,this.underlineColor)},T.prototype.isEmpty=function(){return this.underlineStyle===0},T}();b.ExtendedAttrs=K},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.addDisposableDomListener=void 0,b.addDisposableDomListener=function(I,K,T,w){I.addEventListener(K,T,w);var _=!1;return{dispose:function(){_||(_=!0,I.removeEventListener(K,T,w))}}}},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.Utf8ToUtf32=b.StringToUtf32=b.utf32ToString=b.stringFromCodePoint=void 0,b.stringFromCodePoint=function(T){return T>65535?(T-=65536,String.fromCharCode(55296+(T>>10))+String.fromCharCode(T%1024+56320)):String.fromCharCode(T)},b.utf32ToString=function(T,w,_){w===void 0&&(w=0),_===void 0&&(_=T.length);for(var O="",m=w;m<_;++m){var n=T[m];n>65535?(n-=65536,O+=String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):O+=String.fromCharCode(n)}return O};var I=function(){function T(){this._interim=0}return T.prototype.clear=function(){this._interim=0},T.prototype.decode=function(w,_){var O=w.length;if(!O)return 0;var m=0,n=0;this._interim&&(56320<=(c=w.charCodeAt(n++))&&c<=57343?_[m++]=1024*(this._interim-55296)+c-56320+65536:(_[m++]=this._interim,_[m++]=c),this._interim=0);for(var y=n;y<O;++y){var f=w.charCodeAt(y);if(55296<=f&&f<=56319){if(++y>=O)return this._interim=f,m;var c;56320<=(c=w.charCodeAt(y))&&c<=57343?_[m++]=1024*(f-55296)+c-56320+65536:(_[m++]=f,_[m++]=c)}else _[m++]=f}return m},T}();b.StringToUtf32=I;var K=function(){function T(){this.interim=new Uint8Array(3)}return T.prototype.clear=function(){this.interim.fill(0)},T.prototype.decode=function(w,_){var O=w.length;if(!O)return 0;var m,n,y,f,c=0,l=0,u=0;if(this.interim[0]){var p=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;for(var D=0,L=void 0;(L=63&this.interim[++D])&&D<4;)E<<=6,E|=L;for(var C=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,A=C-D;u<A;){if(u>=O)return 0;if((192&(L=w[u++]))!=128){u--,p=!0;break}this.interim[D++]=L,E<<=6,E|=63&L}p||(C===2?E<128?u--:_[c++]=E:C===3?E<2048||E>=55296&&E<=57343||(_[c++]=E):E<65536||E>1114111||(_[c++]=E)),this.interim.fill(0)}for(var P=O-4,U=u;U<O;){for(;!(!(U<P)||128&(m=w[U])||128&(n=w[U+1])||128&(y=w[U+2])||128&(f=w[U+3]));)_[c++]=m,_[c++]=n,_[c++]=y,_[c++]=f,U+=4;if((m=w[U++])<128)_[c++]=m;else if((224&m)==192){if(U>=O)return this.interim[0]=m,c;if((192&(n=w[U++]))!=128){U--;continue}if((l=(31&m)<<6|63&n)<128){U--;continue}_[c++]=l}else if((240&m)==224){if(U>=O)return this.interim[0]=m,c;if((192&(n=w[U++]))!=128){U--;continue}if(U>=O)return this.interim[0]=m,this.interim[1]=n,c;if((192&(y=w[U++]))!=128){U--;continue}if((l=(15&m)<<12|(63&n)<<6|63&y)<2048||l>=55296&&l<=57343)continue;_[c++]=l}else if((248&m)==240){if(U>=O)return this.interim[0]=m,c;if((192&(n=w[U++]))!=128){U--;continue}if(U>=O)return this.interim[0]=m,this.interim[1]=n,c;if((192&(y=w[U++]))!=128){U--;continue}if(U>=O)return this.interim[0]=m,this.interim[1]=n,this.interim[2]=y,c;if((192&(f=w[U++]))!=128){U--;continue}if((l=(7&m)<<18|(63&n)<<12|(63&y)<<6|63&f)<65536||l>1114111)continue;_[c++]=l}}return c},T}();b.Utf8ToUtf32=K},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CHAR_ATLAS_CELL_SPACING=b.DIM_OPACITY=b.INVERTED_DEFAULT_COLOR=void 0,b.INVERTED_DEFAULT_COLOR=257,b.DIM_OPACITY=.5,b.CHAR_ATLAS_CELL_SPACING=1},function(me,b,k){"use strict";var I,K,T,w;function _(m){var n=m.toString(16);return n.length<2?"0"+n:n}function O(m,n){return m<n?(n+.05)/(m+.05):(m+.05)/(n+.05)}Object.defineProperty(b,"__esModule",{value:!0}),b.contrastRatio=b.toPaddedHex=b.rgba=b.rgb=b.css=b.color=b.channels=void 0,function(m){m.toCss=function(n,y,f,c){return c!==void 0?"#"+_(n)+_(y)+_(f)+_(c):"#"+_(n)+_(y)+_(f)},m.toRgba=function(n,y,f,c){return c===void 0&&(c=255),(n<<24|y<<16|f<<8|c)>>>0}}(I=b.channels||(b.channels={})),(K=b.color||(b.color={})).blend=function(m,n){var y=(255&n.rgba)/255;if(y===1)return{css:n.css,rgba:n.rgba};var f=n.rgba>>24&255,c=n.rgba>>16&255,l=n.rgba>>8&255,u=m.rgba>>24&255,p=m.rgba>>16&255,E=m.rgba>>8&255,D=u+Math.round((f-u)*y),L=p+Math.round((c-p)*y),C=E+Math.round((l-E)*y);return{css:I.toCss(D,L,C),rgba:I.toRgba(D,L,C)}},K.isOpaque=function(m){return(255&m.rgba)==255},K.ensureContrastRatio=function(m,n,y){var f=w.ensureContrastRatio(m.rgba,n.rgba,y);if(f)return w.toColor(f>>24&255,f>>16&255,f>>8&255)},K.opaque=function(m){var n=(255|m.rgba)>>>0,y=w.toChannels(n),f=y[0],c=y[1],l=y[2];return{css:I.toCss(f,c,l),rgba:n}},K.opacity=function(m,n){var y=Math.round(255*n),f=w.toChannels(m.rgba),c=f[0],l=f[1],u=f[2];return{css:I.toCss(c,l,u,y),rgba:I.toRgba(c,l,u,y)}},(b.css||(b.css={})).toColor=function(m){switch(m.length){case 7:return{css:m,rgba:(parseInt(m.slice(1),16)<<8|255)>>>0};case 9:return{css:m,rgba:parseInt(m.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(m){function n(y,f,c){var l=y/255,u=f/255,p=c/255;return .2126*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.7152*(u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4))+.0722*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))}m.relativeLuminance=function(y){return n(y>>16&255,y>>8&255,255&y)},m.relativeLuminance2=n}(T=b.rgb||(b.rgb={})),function(m){function n(f,c,l){for(var u=f>>24&255,p=f>>16&255,E=f>>8&255,D=c>>24&255,L=c>>16&255,C=c>>8&255,A=O(T.relativeLuminance2(D,C,L),T.relativeLuminance2(u,p,E));A<l&&(D>0||L>0||C>0);)D-=Math.max(0,Math.ceil(.1*D)),L-=Math.max(0,Math.ceil(.1*L)),C-=Math.max(0,Math.ceil(.1*C)),A=O(T.relativeLuminance2(D,C,L),T.relativeLuminance2(u,p,E));return(D<<24|L<<16|C<<8|255)>>>0}function y(f,c,l){for(var u=f>>24&255,p=f>>16&255,E=f>>8&255,D=c>>24&255,L=c>>16&255,C=c>>8&255,A=O(T.relativeLuminance2(D,C,L),T.relativeLuminance2(u,p,E));A<l&&(D<255||L<255||C<255);)D=Math.min(255,D+Math.ceil(.1*(255-D))),L=Math.min(255,L+Math.ceil(.1*(255-L))),C=Math.min(255,C+Math.ceil(.1*(255-C))),A=O(T.relativeLuminance2(D,C,L),T.relativeLuminance2(u,p,E));return(D<<24|L<<16|C<<8|255)>>>0}m.ensureContrastRatio=function(f,c,l){var u=T.relativeLuminance(f>>8),p=T.relativeLuminance(c>>8);if(O(u,p)<l)return p<u?n(f,c,l):y(f,c,l)},m.reduceLuminance=n,m.increaseLuminance=y,m.toChannels=function(f){return[f>>24&255,f>>16&255,f>>8&255,255&f]},m.toColor=function(f,c,l){return{css:I.toCss(f,c,l),rgba:I.toRgba(f,c,l)}}}(w=b.rgba||(b.rgba={})),b.toPaddedHex=_,b.contrastRatio=O},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.isLinux=b.isWindows=b.isIphone=b.isIpad=b.isMac=b.isSafari=b.isFirefox=void 0;var I=typeof navigator=="undefined",K=I?"node":navigator.userAgent,T=I?"node":navigator.platform;function w(_,O){return _.indexOf(O)>=0}b.isFirefox=!!~K.indexOf("Firefox"),b.isSafari=/^((?!chrome|android).)*safari/i.test(K),b.isMac=w(["Macintosh","MacIntel","MacPPC","Mac68K"],T),b.isIpad=T==="iPad",b.isIphone=T==="iPhone",b.isWindows=w(["Windows","Win16","Win32","WinCE"],T),b.isLinux=T.indexOf("Linux")>=0},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.C1=b.C0=void 0,function(I){I.NUL="\0",I.SOH="",I.STX="",I.ETX="",I.EOT="",I.ENQ="",I.ACK="",I.BEL="\x07",I.BS="\b",I.HT=" ",I.LF=`
|
|
|
`,I.VT="\v",I.FF="\f",I.CR="\r",I.SO="",I.SI="",I.DLE="",I.DC1="",I.DC2="",I.DC3="",I.DC4="",I.NAK="",I.SYN="",I.ETB="",I.CAN="",I.EM="",I.SUB="",I.ESC="\x1B",I.FS="",I.GS="",I.RS="",I.US="",I.SP=" ",I.DEL="\x7F"}(b.C0||(b.C0={})),function(I){I.PAD="\x80",I.HOP="\x81",I.BPH="\x82",I.NBH="\x83",I.IND="\x84",I.NEL="\x85",I.SSA="\x86",I.ESA="\x87",I.HTS="\x88",I.HTJ="\x89",I.VTS="\x8A",I.PLD="\x8B",I.PLU="\x8C",I.RI="\x8D",I.SS2="\x8E",I.SS3="\x8F",I.DCS="\x90",I.PU1="\x91",I.PU2="\x92",I.STS="\x93",I.CCH="\x94",I.MW="\x95",I.SPA="\x96",I.EPA="\x97",I.SOS="\x98",I.SGCI="\x99",I.SCI="\x9A",I.CSI="\x9B",I.ST="\x9C",I.OSC="\x9D",I.PM="\x9E",I.APC="\x9F"}(b.C1||(b.C1={}))},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.BaseRenderLayer=void 0;var I=k(3),K=k(9),T=k(25),w=k(6),_=k(28),O=k(10),m=k(17),n=function(){function y(f,c,l,u,p,E,D,L){this._container=f,this._alpha=u,this._colors=p,this._rendererId=E,this._bufferService=D,this._optionsService=L,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+c+"-layer"),this._canvas.style.zIndex=l.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return y.prototype.dispose=function(){var f;m.removeElementFromParent(this._canvas),(f=this._charAtlas)===null||f===void 0||f.dispose()},y.prototype._initCanvas=function(){this._ctx=_.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},y.prototype.onOptionsChanged=function(){},y.prototype.onBlur=function(){},y.prototype.onFocus=function(){},y.prototype.onCursorMove=function(){},y.prototype.onGridChanged=function(f,c){},y.prototype.onSelectionChanged=function(f,c,l){l===void 0&&(l=!1)},y.prototype.setColors=function(f){this._refreshCharAtlas(f)},y.prototype._setTransparency=function(f){if(f!==this._alpha){var c=this._canvas;this._alpha=f,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,c),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},y.prototype._refreshCharAtlas=function(f){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=T.acquireCharAtlas(this._optionsService.options,this._rendererId,f,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},y.prototype.resize=function(f){this._scaledCellWidth=f.scaledCellWidth,this._scaledCellHeight=f.scaledCellHeight,this._scaledCharWidth=f.scaledCharWidth,this._scaledCharHeight=f.scaledCharHeight,this._scaledCharLeft=f.scaledCharLeft,this._scaledCharTop=f.scaledCharTop,this._canvas.width=f.scaledCanvasWidth,this._canvas.height=f.scaledCanvasHeight,this._canvas.style.width=f.canvasWidth+"px",this._canvas.style.height=f.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},y.prototype._fillCells=function(f,c,l,u){this._ctx.fillRect(f*this._scaledCellWidth,c*this._scaledCellHeight,l*this._scaledCellWidth,u*this._scaledCellHeight)},y.prototype._fillBottomLineAtCells=function(f,c,l){l===void 0&&(l=1),this._ctx.fillRect(f*this._scaledCellWidth,(c+1)*this._scaledCellHeight-window.devicePixelRatio-1,l*this._scaledCellWidth,window.devicePixelRatio)},y.prototype._fillLeftLineAtCell=function(f,c,l){this._ctx.fillRect(f*this._scaledCellWidth,c*this._scaledCellHeight,window.devicePixelRatio*l,this._scaledCellHeight)},y.prototype._strokeRectAtCell=function(f,c,l,u){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(f*this._scaledCellWidth+window.devicePixelRatio/2,c*this._scaledCellHeight+window.devicePixelRatio/2,l*this._scaledCellWidth-window.devicePixelRatio,u*this._scaledCellHeight-window.devicePixelRatio)},y.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},y.prototype._clearCells=function(f,c,l,u){this._alpha?this._ctx.clearRect(f*this._scaledCellWidth,c*this._scaledCellHeight,l*this._scaledCellWidth,u*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(f*this._scaledCellWidth,c*this._scaledCellHeight,l*this._scaledCellWidth,u*this._scaledCellHeight))},y.prototype._fillCharTrueColor=function(f,c,l){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(l),this._ctx.fillText(f.getChars(),c*this._scaledCellWidth+this._scaledCharLeft,l*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},y.prototype._drawChars=function(f,c,l){var u,p,E=this._getContrastColor(f);E||f.isFgRGB()||f.isBgRGB()?this._drawUncachedChars(f,c,l,E):(f.isInverse()?(u=f.isBgDefault()?K.INVERTED_DEFAULT_COLOR:f.getBgColor(),p=f.isFgDefault()?K.INVERTED_DEFAULT_COLOR:f.getFgColor()):(p=f.isBgDefault()?I.DEFAULT_COLOR:f.getBgColor(),u=f.isFgDefault()?I.DEFAULT_COLOR:f.getFgColor()),u+=this._optionsService.options.drawBoldTextInBrightColors&&f.isBold()&&u<8?8:0,this._currentGlyphIdentifier.chars=f.getChars()||I.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=f.getCode()||I.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=p,this._currentGlyphIdentifier.fg=u,this._currentGlyphIdentifier.bold=!!f.isBold(),this._currentGlyphIdentifier.dim=!!f.isDim(),this._currentGlyphIdentifier.italic=!!f.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,c*this._scaledCellWidth+this._scaledCharLeft,l*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(f,c,l))},y.prototype._drawUncachedChars=function(f,c,l,u){if(this._ctx.save(),this._ctx.font=this._getFont(!!f.isBold(),!!f.isItalic()),this._ctx.textBaseline="middle",f.isInverse())if(u)this._ctx.fillStyle=u.css;else if(f.isBgDefault())this._ctx.fillStyle=O.color.opaque(this._colors.background).css;else if(f.isBgRGB())this._ctx.fillStyle="rgb("+w.AttributeData.toColorRGB(f.getBgColor()).join(",")+")";else{var p=f.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&f.isBold()&&p<8&&(p+=8),this._ctx.fillStyle=this._colors.ansi[p].css}else if(u)this._ctx.fillStyle=u.css;else if(f.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(f.isFgRGB())this._ctx.fillStyle="rgb("+w.AttributeData.toColorRGB(f.getFgColor()).join(",")+")";else{var E=f.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&f.isBold()&&E<8&&(E+=8),this._ctx.fillStyle=this._colors.ansi[E].css}this._clipRow(l),f.isDim()&&(this._ctx.globalAlpha=K.DIM_OPACITY),this._ctx.fillText(f.getChars(),c*this._scaledCellWidth+this._scaledCharLeft,l*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},y.prototype._clipRow=function(f){this._ctx.beginPath(),this._ctx.rect(0,f*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},y.prototype._getFont=function(f,c){return(c?"italic":"")+" "+(f?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},y.prototype._getContrastColor=function(f){if(this._optionsService.options.minimumContrastRatio!==1){var c=this._colors.contrastCache.getColor(f.bg,f.fg);if(c!==void 0)return c||void 0;var l=f.getFgColor(),u=f.getFgColorMode(),p=f.getBgColor(),E=f.getBgColorMode(),D=!!f.isInverse(),L=!!f.isInverse();if(D){var C=l;l=p,p=C;var A=u;u=E,E=A}var P=this._resolveBackgroundRgba(E,p,D),U=this._resolveForegroundRgba(u,l,D,L),N=O.rgba.ensureContrastRatio(P,U,this._optionsService.options.minimumContrastRatio);if(N){var $={css:O.channels.toCss(N>>24&255,N>>16&255,N>>8&255),rgba:N};return this._colors.contrastCache.setColor(f.bg,f.fg,$),$}this._colors.contrastCache.setColor(f.bg,f.fg,null)}},y.prototype._resolveBackgroundRgba=function(f,c,l){switch(f){case 16777216:case 33554432:return this._colors.ansi[c].rgba;case 50331648:return c<<8;case 0:default:return l?this._colors.foreground.rgba:this._colors.background.rgba}},y.prototype._resolveForegroundRgba=function(f,c,l,u){switch(f){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&u&&c<8&&(c+=8),this._colors.ansi[c].rgba;case 50331648:return c<<8;case 0:default:return l?this._colors.background.rgba:this._colors.foreground.rgba}},y}();b.BaseRenderLayer=n},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.createDecorator=b.getServiceDependencies=b.serviceRegistry=void 0;function I(K,T,w){T.di$target===T?T.di$dependencies.push({id:K,index:w}):(T.di$dependencies=[{id:K,index:w}],T.di$target=T)}b.serviceRegistry=new Map,b.getServiceDependencies=function(K){return K.di$dependencies||[]},b.createDecorator=function(K){if(b.serviceRegistry.has(K))return b.serviceRegistry.get(K);var T=function(w,_,O){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");I(T,w,O)};return T.toString=function(){return K},b.serviceRegistry.set(K,T),T}},function(me,b,k){"use strict";function I(K,T,w,_){if(w===void 0&&(w=0),_===void 0&&(_=K.length),w>=K.length)return K;w=(K.length+w)%K.length,_=_>=K.length?K.length:(K.length+_)%K.length;for(var O=w;O<_;++O)K[O]=T;return K}Object.defineProperty(b,"__esModule",{value:!0}),b.concat=b.fillFallback=b.fill=void 0,b.fill=function(K,T,w,_){return K.fill?K.fill(T,w,_):I(K,T,w,_)},b.fillFallback=I,b.concat=function(K,T){var w=new K.constructor(K.length+T.length);return w.set(K),w.set(T,K.length),w}},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.BufferLine=b.DEFAULT_ATTR_DATA=void 0;var I=k(8),K=k(3),T=k(4),w=k(6);b.DEFAULT_ATTR_DATA=Object.freeze(new w.AttributeData);var _=function(){function O(m,n,y){y===void 0&&(y=!1),this.isWrapped=y,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);for(var f=n||T.CellData.fromCharData([0,K.NULL_CELL_CHAR,K.NULL_CELL_WIDTH,K.NULL_CELL_CODE]),c=0;c<m;++c)this.setCell(c,f);this.length=m}return O.prototype.get=function(m){var n=this._data[3*m+0],y=2097151&n;return[this._data[3*m+1],2097152&n?this._combined[m]:y?I.stringFromCodePoint(y):"",n>>22,2097152&n?this._combined[m].charCodeAt(this._combined[m].length-1):y]},O.prototype.set=function(m,n){this._data[3*m+1]=n[K.CHAR_DATA_ATTR_INDEX],n[K.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=n[1],this._data[3*m+0]=2097152|m|n[K.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=n[K.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|n[K.CHAR_DATA_WIDTH_INDEX]<<22},O.prototype.getWidth=function(m){return this._data[3*m+0]>>22},O.prototype.hasWidth=function(m){return 12582912&this._data[3*m+0]},O.prototype.getFg=function(m){return this._data[3*m+1]},O.prototype.getBg=function(m){return this._data[3*m+2]},O.prototype.hasContent=function(m){return 4194303&this._data[3*m+0]},O.prototype.getCodePoint=function(m){var n=this._data[3*m+0];return 2097152&n?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&n},O.prototype.isCombined=function(m){return 2097152&this._data[3*m+0]},O.prototype.getString=function(m){var n=this._data[3*m+0];return 2097152&n?this._combined[m]:2097151&n?I.stringFromCodePoint(2097151&n):""},O.prototype.loadCell=function(m,n){var y=3*m;return n.content=this._data[y+0],n.fg=this._data[y+1],n.bg=this._data[y+2],2097152&n.content&&(n.combinedData=this._combined[m]),268435456&n.bg&&(n.extended=this._extendedAttrs[m]),n},O.prototype.setCell=function(m,n){2097152&n.content&&(this._combined[m]=n.combinedData),268435456&n.bg&&(this._extendedAttrs[m]=n.extended),this._data[3*m+0]=n.content,this._data[3*m+1]=n.fg,this._data[3*m+2]=n.bg},O.prototype.setCellFromCodePoint=function(m,n,y,f,c,l){268435456&c&&(this._extendedAttrs[m]=l),this._data[3*m+0]=n|y<<22,this._data[3*m+1]=f,this._data[3*m+2]=c},O.prototype.addCodepointToCell=function(m,n){var y=this._data[3*m+0];2097152&y?this._combined[m]+=I.stringFromCodePoint(n):(2097151&y?(this._combined[m]=I.stringFromCodePoint(2097151&y)+I.stringFromCodePoint(n),y&=-2097152,y|=2097152):y=n|1<<22,this._data[3*m+0]=y)},O.prototype.insertCells=function(m,n,y,f){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodePoint(m-1,0,1,(f==null?void 0:f.fg)||0,(f==null?void 0:f.bg)||0,(f==null?void 0:f.extended)||new w.ExtendedAttrs),n<this.length-m){for(var c=new T.CellData,l=this.length-m-n-1;l>=0;--l)this.setCell(m+n+l,this.loadCell(m+l,c));for(l=0;l<n;++l)this.setCell(m+l,y)}else for(l=m;l<this.length;++l)this.setCell(l,y);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(f==null?void 0:f.fg)||0,(f==null?void 0:f.bg)||0,(f==null?void 0:f.extended)||new w.ExtendedAttrs)},O.prototype.deleteCells=function(m,n,y,f){if(m%=this.length,n<this.length-m){for(var c=new T.CellData,l=0;l<this.length-m-n;++l)this.setCell(m+l,this.loadCell(m+n+l,c));for(l=this.length-n;l<this.length;++l)this.setCell(l,y)}else for(l=m;l<this.length;++l)this.setCell(l,y);m&&this.getWidth(m-1)===2&&this.setCellFromCodePoint(m-1,0,1,(f==null?void 0:f.fg)||0,(f==null?void 0:f.bg)||0,(f==null?void 0:f.extended)||new w.ExtendedAttrs),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodePoint(m,0,1,(f==null?void 0:f.fg)||0,(f==null?void 0:f.bg)||0,(f==null?void 0:f.extended)||new w.ExtendedAttrs)},O.prototype.replaceCells=function(m,n,y,f){for(m&&this.getWidth(m-1)===2&&this.setCellFromCodePoint(m-1,0,1,(f==null?void 0:f.fg)||0,(f==null?void 0:f.bg)||0,(f==null?void 0:f.extended)||new w.ExtendedAttrs),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodePoint(n,0,1,(f==null?void 0:f.fg)||0,(f==null?void 0:f.bg)||0,(f==null?void 0:f.extended)||new w.ExtendedAttrs);m<n&&m<this.length;)this.setCell(m++,y)},O.prototype.resize=function(m,n){if(m!==this.length){if(m>this.length){var y=new Uint32Array(3*m);this.length&&(3*m<this._data.length?y.set(this._data.subarray(0,3*m)):y.set(this._data)),this._data=y;for(var f=this.length;f<m;++f)this.setCell(f,n)}else if(m){(y=new Uint32Array(3*m)).set(this._data.subarray(0,3*m)),this._data=y;var c=Object.keys(this._combined);for(f=0;f<c.length;f++){var l=parseInt(c[f],10);l>=m&&delete this._combined[l]}}else this._data=new Uint32Array(0),this._combined={};this.length=m}},O.prototype.fill=function(m){this._combined={},this._extendedAttrs={};for(var n=0;n<this.length;++n)this.setCell(n,m)},O.prototype.copyFrom=function(m){for(var n in this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={},m._combined)this._combined[n]=m._combined[n];for(var n in this._extendedAttrs={},m._extendedAttrs)this._extendedAttrs[n]=m._extendedAttrs[n];this.isWrapped=m.isWrapped},O.prototype.clone=function(){var m=new O(0);for(var n in m._data=new Uint32Array(this._data),m.length=this.length,this._combined)m._combined[n]=this._combined[n];for(var n in this._extendedAttrs)m._extendedAttrs[n]=this._extendedAttrs[n];return m.isWrapped=this.isWrapped,m},O.prototype.getTrimmedLength=function(){for(var m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0},O.prototype.copyCellsFrom=function(m,n,y,f,c){var l=m._data;if(c)for(var u=f-1;u>=0;u--)for(var p=0;p<3;p++)this._data[3*(y+u)+p]=l[3*(n+u)+p];else for(u=0;u<f;u++)for(p=0;p<3;p++)this._data[3*(y+u)+p]=l[3*(n+u)+p];var E=Object.keys(m._combined);for(p=0;p<E.length;p++){var D=parseInt(E[p],10);D>=n&&(this._combined[D-n+y]=m._combined[D])}},O.prototype.translateToString=function(m,n,y){m===void 0&&(m=!1),n===void 0&&(n=0),y===void 0&&(y=this.length),m&&(y=Math.min(y,this.getTrimmedLength()));for(var f="";n<y;){var c=this._data[3*n+0],l=2097151&c;f+=2097152&c?this._combined[n]:l?I.stringFromCodePoint(l):K.WHITESPACE_CELL_CHAR,n+=c>>22||1}return f},O}();b.BufferLine=_},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.removeElementFromParent=void 0,b.removeElementFromParent=function(){for(var I,K=[],T=0;T<arguments.length;T++)K[T]=arguments[T];for(var w=0,_=K;w<_.length;w++){var O=_[w];(I=O==null?void 0:O.parentElement)===null||I===void 0||I.removeChild(O)}}},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.tooMuchOutput=b.promptLabel=void 0,b.promptLabel="Terminal input",b.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(U,N){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function($,F){$.__proto__=F}||function($,F){for(var q in F)F.hasOwnProperty(q)&&($[q]=F[q])})(U,N)},function(U,N){function $(){this.constructor=U}I(U,N),U.prototype=N===null?Object.create(N):($.prototype=N.prototype,new $)});Object.defineProperty(b,"__esModule",{value:!0}),b.InputHandler=b.WindowsOptionsReportType=void 0;var T,w=k(12),_=k(20),O=k(39),m=k(2),n=k(15),y=k(8),f=k(16),c=k(0),l=k(3),u=k(4),p=k(6),E=k(22),D=k(24),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function C(U,N){if(U>24)return N.setWinLines||!1;switch(U){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T=b.WindowsOptionsReportType||(b.WindowsOptionsReportType={}));var A=function(){function U(N,$,F,q){this._bufferService=N,this._coreService=$,this._logService=F,this._optionsService=q,this._data=new Uint32Array(0)}return U.prototype.hook=function(N){this._data=new Uint32Array(0)},U.prototype.put=function(N,$,F){this._data=n.concat(this._data,N.subarray($,F))},U.prototype.unhook=function(N){if(N){var $=y.utf32ToString(this._data);switch(this._data=new Uint32Array(0),$){case'"q':return this._coreService.triggerDataEvent(w.C0.ESC+'P1$r0"q'+w.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(w.C0.ESC+'P1$r61;1"p'+w.C0.ESC+"\\");case"r":var F=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(w.C0.ESC+"P1$r"+F+w.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(w.C0.ESC+"P1$r0m"+w.C0.ESC+"\\");case" q":var q={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return q-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(w.C0.ESC+"P1$r"+q+" q"+w.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",$),this._coreService.triggerDataEvent(w.C0.ESC+"P0$r"+w.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},U}(),P=function(U){function N($,F,q,V,ne,oe,J,z,X){X===void 0&&(X=new O.EscapeSequenceParser);var B=U.call(this)||this;B._bufferService=$,B._charsetService=F,B._coreService=q,B._dirtyRowService=V,B._logService=ne,B._optionsService=oe,B._coreMouseService=J,B._unicodeService=z,B._parser=X,B._parseBuffer=new Uint32Array(4096),B._stringDecoder=new y.StringToUtf32,B._utf8Decoder=new y.Utf8ToUtf32,B._workCell=new u.CellData,B._windowTitle="",B._iconName="",B._windowTitleStack=[],B._iconNameStack=[],B._curAttrData=f.DEFAULT_ATTR_DATA.clone(),B._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone(),B._onRequestBell=new c.EventEmitter,B._onRequestRefreshRows=new c.EventEmitter,B._onRequestReset=new c.EventEmitter,B._onRequestScroll=new c.EventEmitter,B._onRequestSyncScrollBar=new c.EventEmitter,B._onRequestWindowsOptionsReport=new c.EventEmitter,B._onA11yChar=new c.EventEmitter,B._onA11yTab=new c.EventEmitter,B._onCursorMove=new c.EventEmitter,B._onLineFeed=new c.EventEmitter,B._onScroll=new c.EventEmitter,B._onTitleChange=new c.EventEmitter,B.register(B._parser),B._parser.setCsiHandlerFallback(function(x,Y){B._logService.debug("Unknown CSI code: ",{identifier:B._parser.identToString(x),params:Y.toArray()})}),B._parser.setEscHandlerFallback(function(x){B._logService.debug("Unknown ESC code: ",{identifier:B._parser.identToString(x)})}),B._parser.setExecuteHandlerFallback(function(x){B._logService.debug("Unknown EXECUTE code: ",{code:x})}),B._parser.setOscHandlerFallback(function(x,Y,te){B._logService.debug("Unknown OSC code: ",{identifier:x,action:Y,data:te})}),B._parser.setDcsHandlerFallback(function(x,Y,te){Y==="HOOK"&&(te=te.toArray()),B._logService.debug("Unknown DCS code: ",{identifier:B._parser.identToString(x),action:Y,payload:te})}),B._parser.setPrintHandler(function(x,Y,te){return B.print(x,Y,te)}),B._parser.setCsiHandler({final:"@"},function(x){return B.insertChars(x)}),B._parser.setCsiHandler({intermediates:" ",final:"@"},function(x){return B.scrollLeft(x)}),B._parser.setCsiHandler({final:"A"},function(x){return B.cursorUp(x)}),B._parser.setCsiHandler({intermediates:" ",final:"A"},function(x){return B.scrollRight(x)}),B._parser.setCsiHandler({final:"B"},function(x){return B.cursorDown(x)}),B._parser.setCsiHandler({final:"C"},function(x){return B.cursorForward(x)}),B._parser.setCsiHandler({final:"D"},function(x){return B.cursorBackward(x)}),B._parser.setCsiHandler({final:"E"},function(x){return B.cursorNextLine(x)}),B._parser.setCsiHandler({final:"F"},function(x){return B.cursorPrecedingLine(x)}),B._parser.setCsiHandler({final:"G"},function(x){return B.cursorCharAbsolute(x)}),B._parser.setCsiHandler({final:"H"},function(x){return B.cursorPosition(x)}),B._parser.setCsiHandler({final:"I"},function(x){return B.cursorForwardTab(x)}),B._parser.setCsiHandler({final:"J"},function(x){return B.eraseInDisplay(x)}),B._parser.setCsiHandler({prefix:"?",final:"J"},function(x){return B.eraseInDisplay(x)}),B._parser.setCsiHandler({final:"K"},function(x){return B.eraseInLine(x)}),B._parser.setCsiHandler({prefix:"?",final:"K"},function(x){return B.eraseInLine(x)}),B._parser.setCsiHandler({final:"L"},function(x){return B.insertLines(x)}),B._parser.setCsiHandler({final:"M"},function(x){return B.deleteLines(x)}),B._parser.setCsiHandler({final:"P"},function(x){return B.deleteChars(x)}),B._parser.setCsiHandler({final:"S"},function(x){return B.scrollUp(x)}),B._parser.setCsiHandler({final:"T"},function(x){return B.scrollDown(x)}),B._parser.setCsiHandler({final:"X"},function(x){return B.eraseChars(x)}),B._parser.setCsiHandler({final:"Z"},function(x){return B.cursorBackwardTab(x)}),B._parser.setCsiHandler({final:"`"},function(x){return B.charPosAbsolute(x)}),B._parser.setCsiHandler({final:"a"},function(x){return B.hPositionRelative(x)}),B._parser.setCsiHandler({final:"b"},function(x){return B.repeatPrecedingCharacter(x)}),B._parser.setCsiHandler({final:"c"},function(x){return B.sendDeviceAttributesPrimary(x)}),B._parser.setCsiHandler({prefix:">",final:"c"},function(x){return B.sendDeviceAttributesSecondary(x)}),B._parser.setCsiHandler({final:"d"},function(x){return B.linePosAbsolute(x)}),B._parser.setCsiHandler({final:"e"},function(x){return B.vPositionRelative(x)}),B._parser.setCsiHandler({final:"f"},function(x){return B.hVPosition(x)}),B._parser.setCsiHandler({final:"g"},function(x){return B.tabClear(x)}),B._parser.setCsiHandler({final:"h"},function(x){return B.setMode(x)}),B._parser.setCsiHandler({prefix:"?",final:"h"},function(x){return B.setModePrivate(x)}),B._parser.setCsiHandler({final:"l"},function(x){return B.resetMode(x)}),B._parser.setCsiHandler({prefix:"?",final:"l"},function(x){return B.resetModePrivate(x)}),B._parser.setCsiHandler({final:"m"},function(x){return B.charAttributes(x)}),B._parser.setCsiHandler({final:"n"},function(x){return B.deviceStatus(x)}),B._parser.setCsiHandler({prefix:"?",final:"n"},function(x){return B.deviceStatusPrivate(x)}),B._parser.setCsiHandler({intermediates:"!",final:"p"},function(x){return B.softReset(x)}),B._parser.setCsiHandler({intermediates:" ",final:"q"},function(x){return B.setCursorStyle(x)}),B._parser.setCsiHandler({final:"r"},function(x){return B.setScrollRegion(x)}),B._parser.setCsiHandler({final:"s"},function(x){return B.saveCursor(x)}),B._parser.setCsiHandler({final:"t"},function(x){return B.windowOptions(x)}),B._parser.setCsiHandler({final:"u"},function(x){return B.restoreCursor(x)}),B._parser.setCsiHandler({intermediates:"'",final:"}"},function(x){return B.insertColumns(x)}),B._parser.setCsiHandler({intermediates:"'",final:"~"},function(x){return B.deleteColumns(x)}),B._parser.setExecuteHandler(w.C0.BEL,function(){return B.bell()}),B._parser.setExecuteHandler(w.C0.LF,function(){return B.lineFeed()}),B._parser.setExecuteHandler(w.C0.VT,function(){return B.lineFeed()}),B._parser.setExecuteHandler(w.C0.FF,function(){return B.lineFeed()}),B._parser.setExecuteHandler(w.C0.CR,function(){return B.carriageReturn()}),B._parser.setExecuteHandler(w.C0.BS,function(){return B.backspace()}),B._parser.setExecuteHandler(w.C0.HT,function(){return B.tab()}),B._parser.setExecuteHandler(w.C0.SO,function(){return B.shiftOut()}),B._parser.setExecuteHandler(w.C0.SI,function(){return B.shiftIn()}),B._parser.setExecuteHandler(w.C1.IND,function(){return B.index()}),B._parser.setExecuteHandler(w.C1.NEL,function(){return B.nextLine()}),B._parser.setExecuteHandler(w.C1.HTS,function(){return B.tabSet()}),B._parser.setOscHandler(0,new E.OscHandler(function(x){B.setTitle(x),B.setIconName(x)})),B._parser.setOscHandler(1,new E.OscHandler(function(x){return B.setIconName(x)})),B._parser.setOscHandler(2,new E.OscHandler(function(x){return B.setTitle(x)})),B._parser.setEscHandler({final:"7"},function(){return B.saveCursor()}),B._parser.setEscHandler({final:"8"},function(){return B.restoreCursor()}),B._parser.setEscHandler({final:"D"},function(){return B.index()}),B._parser.setEscHandler({final:"E"},function(){return B.nextLine()}),B._parser.setEscHandler({final:"H"},function(){return B.tabSet()}),B._parser.setEscHandler({final:"M"},function(){return B.reverseIndex()}),B._parser.setEscHandler({final:"="},function(){return B.keypadApplicationMode()}),B._parser.setEscHandler({final:">"},function(){return B.keypadNumericMode()}),B._parser.setEscHandler({final:"c"},function(){return B.fullReset()}),B._parser.setEscHandler({final:"n"},function(){return B.setgLevel(2)}),B._parser.setEscHandler({final:"o"},function(){return B.setgLevel(3)}),B._parser.setEscHandler({final:"|"},function(){return B.setgLevel(3)}),B._parser.setEscHandler({final:"}"},function(){return B.setgLevel(2)}),B._parser.setEscHandler({final:"~"},function(){return B.setgLevel(1)}),B._parser.setEscHandler({intermediates:"%",final:"@"},function(){return B.selectDefaultCharset()}),B._parser.setEscHandler({intermediates:"%",final:"G"},function(){return B.selectDefaultCharset()});var G=function(x){W._parser.setEscHandler({intermediates:"(",final:x},function(){return B.selectCharset("("+x)}),W._parser.setEscHandler({intermediates:")",final:x},function(){return B.selectCharset(")"+x)}),W._parser.setEscHandler({intermediates:"*",final:x},function(){return B.selectCharset("*"+x)}),W._parser.setEscHandler({intermediates:"+",final:x},function(){return B.selectCharset("+"+x)}),W._parser.setEscHandler({intermediates:"-",final:x},function(){return B.selectCharset("-"+x)}),W._parser.setEscHandler({intermediates:".",final:x},function(){return B.selectCharset("."+x)}),W._parser.setEscHandler({intermediates:"/",final:x},function(){return B.selectCharset("/"+x)})},W=this;for(var R in _.CHARSETS)G(R);return B._parser.setEscHandler({intermediates:"#",final:"8"},function(){return B.screenAlignmentPattern()}),B._parser.setErrorHandler(function(x){return B._logService.error("Parsing error: ",x),x}),B._parser.setDcsHandler({intermediates:"$",final:"q"},new A(B._bufferService,B._coreService,B._logService,B._optionsService)),B}return K(N,U),Object.defineProperty(N.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),N.prototype.dispose=function(){U.prototype.dispose.call(this)},N.prototype.parse=function($){var F=this._bufferService.buffer,q=F.x,V=F.y;if(this._logService.debug("parsing data",$),this._parseBuffer.length<$.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min($.length,131072))),this._dirtyRowService.clearRange(),$.length>131072)for(var ne=0;ne<$.length;ne+=131072){var oe=ne+131072<$.length?ne+131072:$.length,J=typeof $=="string"?this._stringDecoder.decode($.substring(ne,oe),this._parseBuffer):this._utf8Decoder.decode($.subarray(ne,oe),this._parseBuffer);this._parser.parse(this._parseBuffer,J)}else J=typeof $=="string"?this._stringDecoder.decode($,this._parseBuffer):this._utf8Decoder.decode($,this._parseBuffer),this._parser.parse(this._parseBuffer,J);(F=this._bufferService.buffer).x===q&&F.y===V||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},N.prototype.print=function($,F,q){var V,ne,oe=this._bufferService.buffer,J=this._charsetService.charset,z=this._optionsService.options.screenReaderMode,X=this._bufferService.cols,B=this._coreService.decPrivateModes.wraparound,G=this._coreService.modes.insertMode,W=this._curAttrData,R=oe.lines.get(oe.ybase+oe.y);this._dirtyRowService.markDirty(oe.y),oe.x&&q-F>0&&R.getWidth(oe.x-1)===2&&R.setCellFromCodePoint(oe.x-1,0,1,W.fg,W.bg,W.extended);for(var x=F;x<q;++x){if(V=$[x],ne=this._unicodeService.wcwidth(V),V<127&&J){var Y=J[String.fromCharCode(V)];Y&&(V=Y.charCodeAt(0))}if(z&&this._onA11yChar.fire(y.stringFromCodePoint(V)),ne||!oe.x){if(oe.x+ne-1>=X){if(B){for(;oe.x<X;)R.setCellFromCodePoint(oe.x++,0,1,W.fg,W.bg,W.extended);oe.x=0,oe.y++,oe.y===oe.scrollBottom+1?(oe.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(oe.y>=this._bufferService.rows&&(oe.y=this._bufferService.rows-1),oe.lines.get(oe.ybase+oe.y).isWrapped=!0),R=oe.lines.get(oe.ybase+oe.y)}else if(oe.x=X-1,ne===2)continue}if(G&&(R.insertCells(oe.x,ne,oe.getNullCell(W),W),R.getWidth(X-1)===2&&R.setCellFromCodePoint(X-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,W.fg,W.bg,W.extended)),R.setCellFromCodePoint(oe.x++,V,ne,W.fg,W.bg,W.extended),ne>0)for(;--ne;)R.setCellFromCodePoint(oe.x++,0,0,W.fg,W.bg,W.extended)}else R.getWidth(oe.x-1)?R.addCodepointToCell(oe.x-1,V):R.addCodepointToCell(oe.x-2,V)}q-F>0&&(R.loadCell(oe.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),oe.x<X&&q-F>0&&R.getWidth(oe.x)===0&&!R.hasContent(oe.x)&&R.setCellFromCodePoint(oe.x,0,1,W.fg,W.bg,W.extended),this._dirtyRowService.markDirty(oe.y)},N.prototype.addCsiHandler=function($,F){var q=this;return $.final!=="t"||$.prefix||$.intermediates?this._parser.addCsiHandler($,F):this._parser.addCsiHandler($,function(V){return!C(V.params[0],q._optionsService.options.windowOptions)||F(V)})},N.prototype.addDcsHandler=function($,F){return this._parser.addDcsHandler($,new D.DcsHandler(F))},N.prototype.addEscHandler=function($,F){return this._parser.addEscHandler($,F)},N.prototype.addOscHandler=function($,F){return this._parser.addOscHandler($,new E.OscHandler(F))},N.prototype.bell=function(){this._onRequestBell.fire()},N.prototype.lineFeed=function(){var $=this._bufferService.buffer;this._dirtyRowService.markDirty($.y),this._optionsService.options.convertEol&&($.x=0),$.y++,$.y===$.scrollBottom+1?($.y--,this._onRequestScroll.fire(this._eraseAttrData())):$.y>=this._bufferService.rows&&($.y=this._bufferService.rows-1),$.x>=this._bufferService.cols&&$.x--,this._dirtyRowService.markDirty($.y),this._onLineFeed.fire()},N.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},N.prototype.backspace=function(){var $,F=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(F.x>0&&F.x--);if(this._restrictCursor(this._bufferService.cols),F.x>0)F.x--;else if(F.x===0&&F.y>F.scrollTop&&F.y<=F.scrollBottom&&(!(($=F.lines.get(F.ybase+F.y))===null||$===void 0)&&$.isWrapped)){F.lines.get(F.ybase+F.y).isWrapped=!1,F.y--,F.x=this._bufferService.cols-1;var q=F.lines.get(F.ybase+F.y);q.hasWidth(F.x)&&!q.hasContent(F.x)&&F.x--}this._restrictCursor()},N.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var $=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-$)}},N.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},N.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},N.prototype._restrictCursor=function($){$===void 0&&($=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min($,Math.max(0,this._bufferService.buffer.x)),this._bufferService.buffer.y=this._coreService.decPrivateModes.origin?Math.min(this._bufferService.buffer.scrollBottom,Math.max(this._bufferService.buffer.scrollTop,this._bufferService.buffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._bufferService.buffer.y)),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},N.prototype._setCursor=function($,F){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=$,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+F):(this._bufferService.buffer.x=$,this._bufferService.buffer.y=F),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},N.prototype._moveCursor=function($,F){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+$,this._bufferService.buffer.y+F)},N.prototype.cursorUp=function($){var F=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;F>=0?this._moveCursor(0,-Math.min(F,$.params[0]||1)):this._moveCursor(0,-($.params[0]||1))},N.prototype.cursorDown=function($){var F=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;F>=0?this._moveCursor(0,Math.min(F,$.params[0]||1)):this._moveCursor(0,$.params[0]||1)},N.prototype.cursorForward=function($){this._moveCursor($.params[0]||1,0)},N.prototype.cursorBackward=function($){this._moveCursor(-($.params[0]||1),0)},N.prototype.cursorNextLine=function($){this.cursorDown($),this._bufferService.buffer.x=0},N.prototype.cursorPrecedingLine=function($){this.cursorUp($),this._bufferService.buffer.x=0},N.prototype.cursorCharAbsolute=function($){this._setCursor(($.params[0]||1)-1,this._bufferService.buffer.y)},N.prototype.cursorPosition=function($){this._setCursor($.length>=2?($.params[1]||1)-1:0,($.params[0]||1)-1)},N.prototype.charPosAbsolute=function($){this._setCursor(($.params[0]||1)-1,this._bufferService.buffer.y)},N.prototype.hPositionRelative=function($){this._moveCursor($.params[0]||1,0)},N.prototype.linePosAbsolute=function($){this._setCursor(this._bufferService.buffer.x,($.params[0]||1)-1)},N.prototype.vPositionRelative=function($){this._moveCursor(0,$.params[0]||1)},N.prototype.hVPosition=function($){this.cursorPosition($)},N.prototype.tabClear=function($){var F=$.params[0];F===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:F===3&&(this._bufferService.buffer.tabs={})},N.prototype.cursorForwardTab=function($){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var F=$.params[0]||1;F--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},N.prototype.cursorBackwardTab=function($){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var F=$.params[0]||1,q=this._bufferService.buffer;F--;)q.x=q.prevStop()},N.prototype._eraseInBufferLine=function($,F,q,V){V===void 0&&(V=!1);var ne=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+$);ne.replaceCells(F,q,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),V&&(ne.isWrapped=!1)},N.prototype._resetBufferLine=function($){var F=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+$);F.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1},N.prototype.eraseInDisplay=function($){var F;switch(this._restrictCursor(),$.params[0]){case 0:for(F=this._bufferService.buffer.y,this._dirtyRowService.markDirty(F),this._eraseInBufferLine(F++,this._bufferService.buffer.x,this._bufferService.cols,this._bufferService.buffer.x===0);F<this._bufferService.rows;F++)this._resetBufferLine(F);this._dirtyRowService.markDirty(F);break;case 1:for(F=this._bufferService.buffer.y,this._dirtyRowService.markDirty(F),this._eraseInBufferLine(F,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F);this._dirtyRowService.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowService.markDirty(F-1);F--;)this._resetBufferLine(F);this._dirtyRowService.markDirty(0);break;case 3:var q=this._bufferService.buffer.lines.length-this._bufferService.rows;q>0&&(this._bufferService.buffer.lines.trimStart(q),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-q,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-q,0),this._onScroll.fire(0))}},N.prototype.eraseInLine=function($){switch(this._restrictCursor(),$.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}this._dirtyRowService.markDirty(this._bufferService.buffer.y)},N.prototype.insertLines=function($){this._restrictCursor();var F=$.params[0]||1,q=this._bufferService.buffer;if(!(q.y>q.scrollBottom||q.y<q.scrollTop)){for(var V=q.ybase+q.y,ne=this._bufferService.rows-1-q.scrollBottom,oe=this._bufferService.rows-1+q.ybase-ne+1;F--;)q.lines.splice(oe-1,1),q.lines.splice(V,0,q.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(q.y,q.scrollBottom),q.x=0}},N.prototype.deleteLines=function($){this._restrictCursor();var F=$.params[0]||1,q=this._bufferService.buffer;if(!(q.y>q.scrollBottom||q.y<q.scrollTop)){var V,ne=q.ybase+q.y;for(V=this._bufferService.rows-1-q.scrollBottom,V=this._bufferService.rows-1+q.ybase-V;F--;)q.lines.splice(ne,1),q.lines.splice(V,0,q.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(q.y,q.scrollBottom),q.x=0}},N.prototype.insertChars=function($){this._restrictCursor();var F=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);F&&(F.insertCells(this._bufferService.buffer.x,$.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},N.prototype.deleteChars=function($){this._restrictCursor();var F=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);F&&(F.deleteCells(this._bufferService.buffer.x,$.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},N.prototype.scrollUp=function($){for(var F=$.params[0]||1,q=this._bufferService.buffer;F--;)q.lines.splice(q.ybase+q.scrollTop,1),q.lines.splice(q.ybase+q.scrollBottom,0,q.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(q.scrollTop,q.scrollBottom)},N.prototype.scrollDown=function($){for(var F=$.params[0]||1,q=this._bufferService.buffer;F--;)q.lines.splice(q.ybase+q.scrollBottom,1),q.lines.splice(q.ybase+q.scrollTop,0,q.getBlankLine(f.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(q.scrollTop,q.scrollBottom)},N.prototype.scrollLeft=function($){var F=this._bufferService.buffer;if(!(F.y>F.scrollBottom||F.y<F.scrollTop)){for(var q=$.params[0]||1,V=F.scrollTop;V<=F.scrollBottom;++V){var ne=F.lines.get(F.ybase+V);ne.deleteCells(0,q,F.getNullCell(this._eraseAttrData()),this._eraseAttrData()),ne.isWrapped=!1}this._dirtyRowService.markRangeDirty(F.scrollTop,F.scrollBottom)}},N.prototype.scrollRight=function($){var F=this._bufferService.buffer;if(!(F.y>F.scrollBottom||F.y<F.scrollTop)){for(var q=$.params[0]||1,V=F.scrollTop;V<=F.scrollBottom;++V){var ne=F.lines.get(F.ybase+V);ne.insertCells(0,q,F.getNullCell(this._eraseAttrData()),this._eraseAttrData()),ne.isWrapped=!1}this._dirtyRowService.markRangeDirty(F.scrollTop,F.scrollBottom)}},N.prototype.insertColumns=function($){var F=this._bufferService.buffer;if(!(F.y>F.scrollBottom||F.y<F.scrollTop)){for(var q=$.params[0]||1,V=F.scrollTop;V<=F.scrollBottom;++V){var ne=this._bufferService.buffer.lines.get(F.ybase+V);ne.insertCells(F.x,q,F.getNullCell(this._eraseAttrData()),this._eraseAttrData()),ne.isWrapped=!1}this._dirtyRowService.markRangeDirty(F.scrollTop,F.scrollBottom)}},N.prototype.deleteColumns=function($){var F=this._bufferService.buffer;if(!(F.y>F.scrollBottom||F.y<F.scrollTop)){for(var q=$.params[0]||1,V=F.scrollTop;V<=F.scrollBottom;++V){var ne=F.lines.get(F.ybase+V);ne.deleteCells(F.x,q,F.getNullCell(this._eraseAttrData()),this._eraseAttrData()),ne.isWrapped=!1}this._dirtyRowService.markRangeDirty(F.scrollTop,F.scrollBottom)}},N.prototype.eraseChars=function($){this._restrictCursor();var F=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);F&&(F.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+($.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},N.prototype.repeatPrecedingCharacter=function($){if(this._parser.precedingCodepoint){for(var F=$.params[0]||1,q=new Uint32Array(F),V=0;V<F;++V)q[V]=this._parser.precedingCodepoint;this.print(q,0,q.length)}},N.prototype.sendDeviceAttributesPrimary=function($){$.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(w.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(w.C0.ESC+"[?6c"))},N.prototype.sendDeviceAttributesSecondary=function($){$.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(w.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(w.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent($.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(w.C0.ESC+"[>83;40003;0c"))},N.prototype._is=function($){return(this._optionsService.options.termName+"").indexOf($)===0},N.prototype.setMode=function($){for(var F=0;F<$.length;F++)switch($.params[F]){case 4:this._coreService.modes.insertMode=!0}},N.prototype.setModePrivate=function($){for(var F=0;F<$.length;F++)switch($.params[F]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0;break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}},N.prototype.resetMode=function($){for(var F=0;F<$.length;F++)switch($.params[F]){case 4:this._coreService.modes.insertMode=!1}},N.prototype.resetModePrivate=function($){for(var F=0;F<$.length;F++)switch($.params[F]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),$.params[F]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}},N.prototype._updateAttrColor=function($,F,q,V,ne){return F===2?($|=50331648,$&=-16777216,$|=p.AttributeData.fromColorRGB([q,V,ne])):F===5&&($&=-50331904,$|=33554432|255&q),$},N.prototype._extractColor=function($,F,q){var V=[0,0,-1,0,0,0],ne=0,oe=0;do{if(V[oe+ne]=$.params[F+oe],$.hasSubParams(F+oe)){var J=$.getSubParams(F+oe),z=0;do V[1]===5&&(ne=1),V[oe+z+1+ne]=J[z];while(++z<J.length&&z+oe+1+ne<V.length);break}if(V[1]===5&&oe+ne>=2||V[1]===2&&oe+ne>=5)break;V[1]&&(ne=1)}while(++oe+F<$.length&&oe+ne<V.length);for(z=2;z<V.length;++z)V[z]===-1&&(V[z]=0);switch(V[0]){case 38:q.fg=this._updateAttrColor(q.fg,V[1],V[3],V[4],V[5]);break;case 48:q.bg=this._updateAttrColor(q.bg,V[1],V[3],V[4],V[5]);break;case 58:q.extended=q.extended.clone(),q.extended.underlineColor=this._updateAttrColor(q.extended.underlineColor,V[1],V[3],V[4],V[5])}return oe},N.prototype._processUnderline=function($,F){F.extended=F.extended.clone(),(!~$||$>5)&&($=1),F.extended.underlineStyle=$,F.fg|=268435456,$===0&&(F.fg&=-268435457),F.updateExtended()},N.prototype.charAttributes=function($){if($.length===1&&$.params[0]===0)return this._curAttrData.fg=f.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=f.DEFAULT_ATTR_DATA.bg);for(var F,q=$.length,V=this._curAttrData,ne=0;ne<q;ne++)(F=$.params[ne])>=30&&F<=37?(V.fg&=-50331904,V.fg|=16777216|F-30):F>=40&&F<=47?(V.bg&=-50331904,V.bg|=16777216|F-40):F>=90&&F<=97?(V.fg&=-50331904,V.fg|=16777224|F-90):F>=100&&F<=107?(V.bg&=-50331904,V.bg|=16777224|F-100):F===0?(V.fg=f.DEFAULT_ATTR_DATA.fg,V.bg=f.DEFAULT_ATTR_DATA.bg):F===1?V.fg|=134217728:F===3?V.bg|=67108864:F===4?(V.fg|=268435456,this._processUnderline($.hasSubParams(ne)?$.getSubParams(ne)[0]:1,V)):F===5?V.fg|=536870912:F===7?V.fg|=67108864:F===8?V.fg|=1073741824:F===2?V.bg|=134217728:F===21?this._processUnderline(2,V):F===22?(V.fg&=-134217729,V.bg&=-134217729):F===23?V.bg&=-67108865:F===24?V.fg&=-268435457:F===25?V.fg&=-536870913:F===27?V.fg&=-67108865:F===28?V.fg&=-1073741825:F===39?(V.fg&=-67108864,V.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):F===49?(V.bg&=-67108864,V.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?ne+=this._extractColor($,ne,V):F===59?(V.extended=V.extended.clone(),V.extended.underlineColor=-1,V.updateExtended()):F===100?(V.fg&=-67108864,V.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,V.bg&=-67108864,V.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F)},N.prototype.deviceStatus=function($){switch($.params[0]){case 5:this._coreService.triggerDataEvent(w.C0.ESC+"[0n");break;case 6:var F=this._bufferService.buffer.y+1,q=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(w.C0.ESC+"["+F+";"+q+"R")}},N.prototype.deviceStatusPrivate=function($){switch($.params[0]){case 6:var F=this._bufferService.buffer.y+1,q=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(w.C0.ESC+"[?"+F+";"+q+"R")}},N.prototype.softReset=function($){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._bufferService.buffer.savedX=0,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1},N.prototype.setCursorStyle=function($){var F=$.params[0]||1;switch(F){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var q=F%2==1;this._optionsService.options.cursorBlink=q},N.prototype.setScrollRegion=function($){var F,q=$.params[0]||1;($.length<2||(F=$.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>q&&(this._bufferService.buffer.scrollTop=q-1,this._bufferService.buffer.scrollBottom=F-1,this._setCursor(0,0))},N.prototype.windowOptions=function($){if(C($.params[0],this._optionsService.options.windowOptions)){var F=$.length>1?$.params[1]:0;switch($.params[0]){case 14:F!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(w.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:F!==0&&F!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),F!==0&&F!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:F!==0&&F!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),F!==0&&F!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},N.prototype.saveCursor=function($){this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset},N.prototype.restoreCursor=function($){this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor()},N.prototype.setTitle=function($){this._windowTitle=$,this._onTitleChange.fire($)},N.prototype.setIconName=function($){this._iconName=$},N.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},N.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},N.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},N.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET)},N.prototype.selectCharset=function($){$.length===2?$[0]!=="/"&&this._charsetService.setgCharset(L[$[0]],_.CHARSETS[$[1]]||_.DEFAULT_CHARSET):this.selectDefaultCharset()},N.prototype.index=function(){this._restrictCursor();var $=this._bufferService.buffer;this._bufferService.buffer.y++,$.y===$.scrollBottom+1?($.y--,this._onRequestScroll.fire(this._eraseAttrData())):$.y>=this._bufferService.rows&&($.y=this._bufferService.rows-1),this._restrictCursor()},N.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},N.prototype.reverseIndex=function(){this._restrictCursor();var $=this._bufferService.buffer;if($.y===$.scrollTop){var F=$.scrollBottom-$.scrollTop;$.lines.shiftElements($.ybase+$.y,F,1),$.lines.set($.ybase+$.y,$.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty($.scrollTop,$.scrollBottom)}else $.y--,this._restrictCursor()},N.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},N.prototype.reset=function(){this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()},N.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},N.prototype.setgLevel=function($){this._charsetService.setgLevel($)},N.prototype.screenAlignmentPattern=function(){var $=new u.CellData;$.content=1<<22|69,$.fg=this._curAttrData.fg,$.bg=this._curAttrData.bg;var F=this._bufferService.buffer;this._setCursor(0,0);for(var q=0;q<this._bufferService.rows;++q){var V=F.ybase+F.y+q,ne=F.lines.get(V);ne&&(ne.fill($),ne.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},N}(m.Disposable);b.InputHandler=P},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.DEFAULT_CHARSET=b.CHARSETS=void 0,b.CHARSETS={},b.DEFAULT_CHARSET=b.CHARSETS.B,b.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},b.CHARSETS.A={"#":"\xA3"},b.CHARSETS.B=void 0,b.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},b.CHARSETS.C=b.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},b.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},b.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},b.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},b.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},b.CHARSETS.E=b.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},b.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},b.CHARSETS.H=b.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},b.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.Params=void 0;var I=function(){function K(T,w){if(T===void 0&&(T=32),w===void 0&&(w=32),this.maxLength=T,this.maxSubParamsLength=w,w>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(T),this.length=0,this._subParams=new Int32Array(w),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(T),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return K.fromArray=function(T){var w=new K;if(!T.length)return w;for(var _=T[0]instanceof Array?1:0;_<T.length;++_){var O=T[_];if(O instanceof Array)for(var m=0;m<O.length;++m)w.addSubParam(O[m]);else w.addParam(O)}return w},K.prototype.clone=function(){var T=new K(this.maxLength,this.maxSubParamsLength);return T.params.set(this.params),T.length=this.length,T._subParams.set(this._subParams),T._subParamsLength=this._subParamsLength,T._subParamsIdx.set(this._subParamsIdx),T._rejectDigits=this._rejectDigits,T._rejectSubDigits=this._rejectSubDigits,T._digitIsSub=this._digitIsSub,T},K.prototype.toArray=function(){for(var T=[],w=0;w<this.length;++w){T.push(this.params[w]);var _=this._subParamsIdx[w]>>8,O=255&this._subParamsIdx[w];O-_>0&&T.push(Array.prototype.slice.call(this._subParams,_,O))}return T},K.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},K.prototype.addParam=function(T){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(T<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=T>2147483647?2147483647:T}},K.prototype.addSubParam=function(T){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(T<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=T>2147483647?2147483647:T,this._subParamsIdx[this.length-1]++}},K.prototype.hasSubParams=function(T){return(255&this._subParamsIdx[T])-(this._subParamsIdx[T]>>8)>0},K.prototype.getSubParams=function(T){var w=this._subParamsIdx[T]>>8,_=255&this._subParamsIdx[T];return _-w>0?this._subParams.subarray(w,_):null},K.prototype.getSubParamsAll=function(){for(var T={},w=0;w<this.length;++w){var _=this._subParamsIdx[w]>>8,O=255&this._subParamsIdx[w];O-_>0&&(T[w]=this._subParams.slice(_,O))}return T},K.prototype.addDigit=function(T){var w;if(!(this._rejectDigits||!(w=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var _=this._digitIsSub?this._subParams:this.params,O=_[w-1];_[w-1]=~O?Math.min(10*O+T,2147483647):T}},K}();b.Params=I},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.OscHandler=b.OscParser=void 0;var I=k(23),K=k(8),T=function(){function _(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return _.prototype.addHandler=function(O,m){this._handlers[O]===void 0&&(this._handlers[O]=[]);var n=this._handlers[O];return n.push(m),{dispose:function(){var y=n.indexOf(m);y!==-1&&n.splice(y,1)}}},_.prototype.setHandler=function(O,m){this._handlers[O]=[m]},_.prototype.clearHandler=function(O){this._handlers[O]&&delete this._handlers[O]},_.prototype.setHandlerFallback=function(O){this._handlerFb=O},_.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},_.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},_.prototype._start=function(){var O=this._handlers[this._id];if(O)for(var m=O.length-1;m>=0;m--)O[m].start();else this._handlerFb(this._id,"START")},_.prototype._put=function(O,m,n){var y=this._handlers[this._id];if(y)for(var f=y.length-1;f>=0;f--)y[f].put(O,m,n);else this._handlerFb(this._id,"PUT",K.utf32ToString(O,m,n))},_.prototype._end=function(O){var m=this._handlers[this._id];if(m){for(var n=m.length-1;n>=0&&m[n].end(O)===!1;n--);for(n--;n>=0;n--)m[n].end(!1)}else this._handlerFb(this._id,"END",O)},_.prototype.start=function(){this.reset(),this._id=-1,this._state=1},_.prototype.put=function(O,m,n){if(this._state!==3){if(this._state===1)for(;m<n;){var y=O[m++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&n-m>0&&this._put(O,m,n)}},_.prototype.end=function(O){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(O)),this._id=-1,this._state=0)},_}();b.OscParser=T;var w=function(){function _(O){this._handler=O,this._data="",this._hitLimit=!1}return _.prototype.start=function(){this._data="",this._hitLimit=!1},_.prototype.put=function(O,m,n){this._hitLimit||(this._data+=K.utf32ToString(O,m,n),this._data.length>I.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},_.prototype.end=function(O){var m;return this._hitLimit?m=!1:O&&(m=this._handler(this._data)),this._data="",this._hitLimit=!1,m},_}();b.OscHandler=w},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.PAYLOAD_LIMIT=void 0,b.PAYLOAD_LIMIT=1e7},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.DcsHandler=b.DcsParser=void 0;var I=k(8),K=k(21),T=k(23),w=[],_=function(){function m(){this._handlers=Object.create(null),this._active=w,this._ident=0,this._handlerFb=function(){}}return m.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},m.prototype.addHandler=function(n,y){this._handlers[n]===void 0&&(this._handlers[n]=[]);var f=this._handlers[n];return f.push(y),{dispose:function(){var c=f.indexOf(y);c!==-1&&f.splice(c,1)}}},m.prototype.setHandler=function(n,y){this._handlers[n]=[y]},m.prototype.clearHandler=function(n){this._handlers[n]&&delete this._handlers[n]},m.prototype.setHandlerFallback=function(n){this._handlerFb=n},m.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=w,this._ident=0},m.prototype.hook=function(n,y){if(this.reset(),this._ident=n,this._active=this._handlers[n]||w,this._active.length)for(var f=this._active.length-1;f>=0;f--)this._active[f].hook(y);else this._handlerFb(this._ident,"HOOK",y)},m.prototype.put=function(n,y,f){if(this._active.length)for(var c=this._active.length-1;c>=0;c--)this._active[c].put(n,y,f);else this._handlerFb(this._ident,"PUT",I.utf32ToString(n,y,f))},m.prototype.unhook=function(n){if(this._active.length){for(var y=this._active.length-1;y>=0&&this._active[y].unhook(n)===!1;y--);for(y--;y>=0;y--)this._active[y].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",n);this._active=w,this._ident=0},m}();b.DcsParser=_;var O=function(){function m(n){this._handler=n,this._data="",this._hitLimit=!1}return m.prototype.hook=function(n){this._params=n.clone(),this._data="",this._hitLimit=!1},m.prototype.put=function(n,y,f){this._hitLimit||(this._data+=I.utf32ToString(n,y,f),this._data.length>T.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},m.prototype.unhook=function(n){var y;return this._hitLimit?y=!1:n&&(y=this._handler(this._data,this._params||new K.Params)),this._params=void 0,this._data="",this._hitLimit=!1,y},m}();b.DcsHandler=O},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.removeTerminalFromCache=b.acquireCharAtlas=void 0;var I=k(26),K=k(43),T=[];b.acquireCharAtlas=function(w,_,O,m,n){for(var y=I.generateConfig(m,n,w,O),f=0;f<T.length;f++){var c=(l=T[f]).ownedBy.indexOf(_);if(c>=0){if(I.configEquals(l.config,y))return l.atlas;l.ownedBy.length===1?(l.atlas.dispose(),T.splice(f,1)):l.ownedBy.splice(c,1);break}}for(f=0;f<T.length;f++){var l=T[f];if(I.configEquals(l.config,y))return l.ownedBy.push(_),l.atlas}var u={atlas:new K.DynamicCharAtlas(document,y),config:y,ownedBy:[_]};return T.push(u),u.atlas},b.removeTerminalFromCache=function(w){for(var _=0;_<T.length;_++){var O=T[_].ownedBy.indexOf(w);if(O!==-1){T[_].ownedBy.length===1?(T[_].atlas.dispose(),T.splice(_,1)):T[_].ownedBy.splice(O,1);break}}}},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.is256Color=b.configEquals=b.generateConfig=void 0;var I=k(3);b.generateConfig=function(K,T,w,_){var O={foreground:_.foreground,background:_.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:_.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:K,scaledCharHeight:T,fontFamily:w.fontFamily,fontSize:w.fontSize,fontWeight:w.fontWeight,fontWeightBold:w.fontWeightBold,allowTransparency:w.allowTransparency,colors:O}},b.configEquals=function(K,T){for(var w=0;w<K.colors.ansi.length;w++)if(K.colors.ansi[w].rgba!==T.colors.ansi[w].rgba)return!1;return K.devicePixelRatio===T.devicePixelRatio&&K.fontFamily===T.fontFamily&&K.fontSize===T.fontSize&&K.fontWeight===T.fontWeight&&K.fontWeightBold===T.fontWeightBold&&K.allowTransparency===T.allowTransparency&&K.scaledCharWidth===T.scaledCharWidth&&K.scaledCharHeight===T.scaledCharHeight&&K.colors.foreground===T.colors.foreground&&K.colors.background===T.colors.background},b.is256Color=function(K){return K<I.DEFAULT_COLOR}},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ColorManager=b.DEFAULT_ANSI_COLORS=void 0;var I=k(10),K=k(45),T=I.css.toColor("#ffffff"),w=I.css.toColor("#000000"),_=I.css.toColor("#ffffff"),O=I.css.toColor("#000000"),m={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};b.DEFAULT_ANSI_COLORS=function(){for(var y=[I.css.toColor("#2e3436"),I.css.toColor("#cc0000"),I.css.toColor("#4e9a06"),I.css.toColor("#c4a000"),I.css.toColor("#3465a4"),I.css.toColor("#75507b"),I.css.toColor("#06989a"),I.css.toColor("#d3d7cf"),I.css.toColor("#555753"),I.css.toColor("#ef2929"),I.css.toColor("#8ae234"),I.css.toColor("#fce94f"),I.css.toColor("#729fcf"),I.css.toColor("#ad7fa8"),I.css.toColor("#34e2e2"),I.css.toColor("#eeeeec")],f=[0,95,135,175,215,255],c=0;c<216;c++){var l=f[c/36%6|0],u=f[c/6%6|0],p=f[c%6];y.push({css:I.channels.toCss(l,u,p),rgba:I.channels.toRgba(l,u,p)})}for(c=0;c<24;c++){var E=8+10*c;y.push({css:I.channels.toCss(E,E,E),rgba:I.channels.toRgba(E,E,E)})}return y}();var n=function(){function y(f,c){this.allowTransparency=c;var l=f.createElement("canvas");l.width=1,l.height=1;var u=l.getContext("2d");if(!u)throw new Error("Could not get rendering context");this._ctx=u,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new K.ColorContrastCache,this.colors={foreground:T,background:w,cursor:_,cursorAccent:O,selectionTransparent:m,selectionOpaque:I.color.blend(w,m),ansi:b.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return y.prototype.onOptionsChange=function(f){f==="minimumContrastRatio"&&this._contrastCache.clear()},y.prototype.setTheme=function(f){f===void 0&&(f={}),this.colors.foreground=this._parseColor(f.foreground,T),this.colors.background=this._parseColor(f.background,w),this.colors.cursor=this._parseColor(f.cursor,_,!0),this.colors.cursorAccent=this._parseColor(f.cursorAccent,O,!0),this.colors.selectionTransparent=this._parseColor(f.selection,m,!0),this.colors.selectionOpaque=I.color.blend(this.colors.background,this.colors.selectionTransparent),I.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=I.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(f.black,b.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(f.red,b.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(f.green,b.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(f.yellow,b.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(f.blue,b.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(f.magenta,b.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(f.cyan,b.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(f.white,b.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(f.brightBlack,b.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(f.brightRed,b.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(f.brightGreen,b.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(f.brightYellow,b.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(f.brightBlue,b.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(f.brightMagenta,b.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(f.brightCyan,b.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(f.brightWhite,b.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},y.prototype._parseColor=function(f,c,l){if(l===void 0&&(l=this.allowTransparency),f===void 0)return c;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=f,typeof this._ctx.fillStyle!="string")return console.warn("Color: "+f+" is invalid using fallback "+c.css),c;this._ctx.fillRect(0,0,1,1);var u=this._ctx.getImageData(0,0,1,1).data;if(u[3]!==255){if(!l)return console.warn("Color: "+f+" is using transparency, but allowTransparency is false. Using fallback "+c.css+"."),c;var p=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(P){return Number(P)}),E=p[0],D=p[1],L=p[2],C=p[3],A=Math.round(255*C);return{rgba:I.channels.toRgba(E,D,L,A),css:f}}return{css:this._ctx.fillStyle,rgba:I.channels.toRgba(u[0],u[1],u[2],u[3])}},y}();b.ColorManager=n},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.throwIfFalsy=void 0,b.throwIfFalsy=function(I){if(!I)throw new Error("value must not be falsy");return I}},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(n,y){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,c){f.__proto__=c}||function(f,c){for(var l in c)c.hasOwnProperty(l)&&(f[l]=c[l])})(n,y)},function(n,y){function f(){this.constructor=n}I(n,y),n.prototype=y===null?Object.create(y):(f.prototype=y.prototype,new f)});Object.defineProperty(b,"__esModule",{value:!0}),b.CharacterJoinerRegistry=b.JoinedCellData=void 0;var T=k(6),w=k(3),_=k(4),O=function(n){function y(f,c,l){var u=n.call(this)||this;return u.content=0,u.combinedData="",u.fg=f.fg,u.bg=f.bg,u.combinedData=c,u._width=l,u}return K(y,n),y.prototype.isCombined=function(){return 2097152},y.prototype.getWidth=function(){return this._width},y.prototype.getChars=function(){return this.combinedData},y.prototype.getCode=function(){return 2097151},y.prototype.setFromCharData=function(f){throw new Error("not implemented")},y.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},y}(T.AttributeData);b.JoinedCellData=O;var m=function(){function n(y){this._bufferService=y,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}return n.prototype.registerCharacterJoiner=function(y){var f={id:this._nextCharacterJoinerId++,handler:y};return this._characterJoiners.push(f),f.id},n.prototype.deregisterCharacterJoiner=function(y){for(var f=0;f<this._characterJoiners.length;f++)if(this._characterJoiners[f].id===y)return this._characterJoiners.splice(f,1),!0;return!1},n.prototype.getJoinedCharacters=function(y){if(this._characterJoiners.length===0)return[];var f=this._bufferService.buffer.lines.get(y);if(!f||f.length===0)return[];for(var c=[],l=f.translateToString(!0),u=0,p=0,E=0,D=f.getFg(0),L=f.getBg(0),C=0;C<f.getTrimmedLength();C++)if(f.loadCell(C,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==D||this._workCell.bg!==L){if(C-u>1)for(var A=this._getJoinedRanges(l,E,p,f,u),P=0;P<A.length;P++)c.push(A[P]);u=C,E=p,D=this._workCell.fg,L=this._workCell.bg}p+=this._workCell.getChars().length||w.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-u>1)for(A=this._getJoinedRanges(l,E,p,f,u),P=0;P<A.length;P++)c.push(A[P]);return c},n.prototype._getJoinedRanges=function(y,f,c,l,u){for(var p=y.substring(f,c),E=this._characterJoiners[0].handler(p),D=1;D<this._characterJoiners.length;D++)for(var L=this._characterJoiners[D].handler(p),C=0;C<L.length;C++)n._mergeRanges(E,L[C]);return this._stringRangesToCellRanges(E,l,u),E},n.prototype._stringRangesToCellRanges=function(y,f,c){var l=0,u=!1,p=0,E=y[l];if(E){for(var D=c;D<this._bufferService.cols;D++){var L=f.getWidth(D),C=f.getString(D).length||w.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!u&&E[0]<=p&&(E[0]=D,u=!0),E[1]<=p){if(E[1]=D,!(E=y[++l]))break;E[0]<=p?(E[0]=D,u=!0):u=!1}p+=C}}E&&(E[1]=this._bufferService.cols)}},n._mergeRanges=function(y,f){for(var c=!1,l=0;l<y.length;l++){var u=y[l];if(c){if(f[1]<=u[0])return y[l-1][1]=f[1],y;if(f[1]<=u[1])return y[l-1][1]=Math.max(f[1],u[1]),y.splice(l,1),y;y.splice(l,1),l--}else{if(f[1]<=u[0])return y.splice(l,0,f),y;if(f[1]<=u[1])return u[0]=Math.min(f[0],u[0]),y;f[0]<u[1]&&(u[0]=Math.min(f[0],u[0]),c=!0)}}return c?y[y.length-1][1]=f[1]:y.push(f),y},n}();b.CharacterJoinerRegistry=m},function(me,b,k){"use strict";function I(K,T){var w=T.getBoundingClientRect();return[K.clientX-w.left,K.clientY-w.top]}Object.defineProperty(b,"__esModule",{value:!0}),b.getRawByteCoords=b.getCoords=b.getCoordsRelativeToElement=void 0,b.getCoordsRelativeToElement=I,b.getCoords=function(K,T,w,_,O,m,n,y){if(O){var f=I(K,T);if(f)return f[0]=Math.ceil((f[0]+(y?m/2:0))/m),f[1]=Math.ceil(f[1]/n),f[0]=Math.min(Math.max(f[0],1),w+(y?1:0)),f[1]=Math.min(Math.max(f[1],1),_),f}},b.getRawByteCoords=function(K){if(K)return{x:K[0]+32,y:K[1]+32}}},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.RenderDebouncer=void 0;var I=function(){function K(T){this._renderCallback=T}return K.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},K.prototype.refresh=function(T,w,_){var O=this;this._rowCount=_,T=T!==void 0?T:0,w=w!==void 0?w:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,T):T,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,w):w,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return O._innerRefresh()}))},K.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var T=Math.max(this._rowStart,0),w=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(T,w)}},K}();b.RenderDebouncer=I},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(w,_){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,m){O.__proto__=m}||function(O,m){for(var n in m)m.hasOwnProperty(n)&&(O[n]=m[n])})(w,_)},function(w,_){function O(){this.constructor=w}I(w,_),w.prototype=_===null?Object.create(_):(O.prototype=_.prototype,new O)});Object.defineProperty(b,"__esModule",{value:!0}),b.ScreenDprMonitor=void 0;var T=function(w){function _(){var O=w!==null&&w.apply(this,arguments)||this;return O._currentDevicePixelRatio=window.devicePixelRatio,O}return K(_,w),_.prototype.setListener=function(O){var m=this;this._listener&&this.clearListener(),this._listener=O,this._outerListener=function(){m._listener&&(m._listener(window.devicePixelRatio,m._currentDevicePixelRatio),m._updateDpr())},this._updateDpr()},_.prototype.dispose=function(){w.prototype.dispose.call(this),this.clearListener()},_.prototype._updateDpr=function(){var O;this._outerListener&&((O=this._resolutionMediaMatchList)===null||O===void 0||O.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},_.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},_}(k(2).Disposable);b.ScreenDprMonitor=T},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.clone=void 0,b.clone=function I(K,T){if(T===void 0&&(T=5),typeof K!="object")return K;var w=Array.isArray(K)?[]:{};for(var _ in K)w[_]=T<=1?K[_]:K[_]?I(K[_],T-1):K[_];return w}},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.Terminal=void 0;var I=k(4),K=k(35),T=k(18),w=k(0),_=k(83),O=function(){function l(u){this._core=new K.Terminal(u),this._addonManager=new _.AddonManager}return l.prototype._checkProposedApi=function(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(l.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new f(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"unicode",{get:function(){return this._checkProposedApi(),new c(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"buffer",{get:function(){return this._checkProposedApi(),new n(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),l.prototype.blur=function(){this._core.blur()},l.prototype.focus=function(){this._core.focus()},l.prototype.resize=function(u,p){this._verifyIntegers(u,p),this._core.resize(u,p)},l.prototype.open=function(u){this._core.open(u)},l.prototype.attachCustomKeyEventHandler=function(u){this._core.attachCustomKeyEventHandler(u)},l.prototype.registerLinkMatcher=function(u,p,E){return this._checkProposedApi(),this._core.registerLinkMatcher(u,p,E)},l.prototype.deregisterLinkMatcher=function(u){this._checkProposedApi(),this._core.deregisterLinkMatcher(u)},l.prototype.registerLinkProvider=function(u){return this._checkProposedApi(),this._core.registerLinkProvider(u)},l.prototype.registerCharacterJoiner=function(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)},l.prototype.deregisterCharacterJoiner=function(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)},l.prototype.registerMarker=function(u){return this._checkProposedApi(),this._verifyIntegers(u),this._core.addMarker(u)},l.prototype.addMarker=function(u){return this.registerMarker(u)},l.prototype.hasSelection=function(){return this._core.hasSelection()},l.prototype.select=function(u,p,E){this._verifyIntegers(u,p,E),this._core.select(u,p,E)},l.prototype.getSelection=function(){return this._core.getSelection()},l.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},l.prototype.clearSelection=function(){this._core.clearSelection()},l.prototype.selectAll=function(){this._core.selectAll()},l.prototype.selectLines=function(u,p){this._verifyIntegers(u,p),this._core.selectLines(u,p)},l.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},l.prototype.scrollLines=function(u){this._verifyIntegers(u),this._core.scrollLines(u)},l.prototype.scrollPages=function(u){this._verifyIntegers(u),this._core.scrollPages(u)},l.prototype.scrollToTop=function(){this._core.scrollToTop()},l.prototype.scrollToBottom=function(){this._core.scrollToBottom()},l.prototype.scrollToLine=function(u){this._verifyIntegers(u),this._core.scrollToLine(u)},l.prototype.clear=function(){this._core.clear()},l.prototype.write=function(u,p){this._core.write(u,p)},l.prototype.writeUtf8=function(u,p){this._core.write(u,p)},l.prototype.writeln=function(u,p){this._core.write(u),this._core.write(`\r
|
|
|
`,p)},l.prototype.paste=function(u){this._core.paste(u)},l.prototype.getOption=function(u){return this._core.optionsService.getOption(u)},l.prototype.setOption=function(u,p){this._core.optionsService.setOption(u,p)},l.prototype.refresh=function(u,p){this._verifyIntegers(u,p),this._core.refresh(u,p)},l.prototype.reset=function(){this._core.reset()},l.prototype.loadAddon=function(u){return this._addonManager.loadAddon(this,u)},Object.defineProperty(l,"strings",{get:function(){return T},enumerable:!1,configurable:!0}),l.prototype._verifyIntegers=function(){for(var u=[],p=0;p<arguments.length;p++)u[p]=arguments[p];for(var E=0,D=u;E<D.length;E++){var L=D[E];if(L===1/0||isNaN(L)||L%1!=0)throw new Error("This API only accepts integers")}},l}();b.Terminal=O;var m=function(){function l(u,p){this._buffer=u,this.type=p}return l.prototype.init=function(u){return this._buffer=u,this},Object.defineProperty(l.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),l.prototype.getLine=function(u){var p=this._buffer.lines.get(u);if(p)return new y(p)},l.prototype.getNullCell=function(){return new I.CellData},l}(),n=function(){function l(u){var p=this;this._buffers=u,this._onBufferChange=new w.EventEmitter,this._normal=new m(this._buffers.normal,"normal"),this._alternate=new m(this._buffers.alt,"alternate"),this._buffers.onBufferActivate(function(){return p._onBufferChange.fire(p.active)})}return Object.defineProperty(l.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"active",{get:function(){if(this._buffers.active===this._buffers.normal)return this.normal;if(this._buffers.active===this._buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),l}(),y=function(){function l(u){this._line=u}return Object.defineProperty(l.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),l.prototype.getCell=function(u,p){if(!(u<0||u>=this._line.length))return p?(this._line.loadCell(u,p),p):this._line.loadCell(u,new I.CellData)},l.prototype.translateToString=function(u,p,E){return this._line.translateToString(u,p,E)},l}(),f=function(){function l(u){this._core=u}return l.prototype.registerCsiHandler=function(u,p){return this._core.addCsiHandler(u,function(E){return p(E.toArray())})},l.prototype.addCsiHandler=function(u,p){return this.registerCsiHandler(u,p)},l.prototype.registerDcsHandler=function(u,p){return this._core.addDcsHandler(u,function(E,D){return p(E,D.toArray())})},l.prototype.addDcsHandler=function(u,p){return this.registerDcsHandler(u,p)},l.prototype.registerEscHandler=function(u,p){return this._core.addEscHandler(u,p)},l.prototype.addEscHandler=function(u,p){return this.registerEscHandler(u,p)},l.prototype.registerOscHandler=function(u,p){return this._core.addOscHandler(u,p)},l.prototype.addOscHandler=function(u,p){return this.registerOscHandler(u,p)},l}(),c=function(){function l(u){this._core=u}return l.prototype.register=function(u){this._core.unicodeService.register(u)},Object.defineProperty(l.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(u){this._core.unicodeService.activeVersion=u},enumerable:!1,configurable:!0}),l}()},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(X,B){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,W){G.__proto__=W}||function(G,W){for(var R in W)W.hasOwnProperty(R)&&(G[R]=W[R])})(X,B)},function(X,B){function G(){this.constructor=X}I(X,B),X.prototype=B===null?Object.create(B):(G.prototype=B.prototype,new G)});Object.defineProperty(b,"__esModule",{value:!0}),b.Terminal=void 0;var T=k(36),w=k(37),_=k(38),O=k(12),m=k(19),n=k(40),y=k(50),f=k(51),c=k(11),l=k(7),u=k(18),p=k(54),E=k(55),D=k(56),L=k(57),C=k(59),A=k(0),P=k(16),U=k(27),N=k(60),$=k(5),F=k(61),q=k(62),V=k(63),ne=k(64),oe=k(65),J=typeof window!="undefined"?window.document:null,z=function(X){function B(G){G===void 0&&(G={});var W=X.call(this,G)||this;return W.browser=c,W._keyDownHandled=!1,W._onCursorMove=new A.EventEmitter,W._onKey=new A.EventEmitter,W._onRender=new A.EventEmitter,W._onSelectionChange=new A.EventEmitter,W._onTitleChange=new A.EventEmitter,W._onFocus=new A.EventEmitter,W._onBlur=new A.EventEmitter,W._onA11yCharEmitter=new A.EventEmitter,W._onA11yTabEmitter=new A.EventEmitter,W._setup(),W.linkifier=W._instantiationService.createInstance(y.Linkifier),W.linkifier2=W.register(W._instantiationService.createInstance(V.Linkifier2)),W.register(W._inputHandler.onRequestBell(function(){return W.bell()})),W.register(W._inputHandler.onRequestRefreshRows(function(R,x){return W.refresh(R,x)})),W.register(W._inputHandler.onRequestReset(function(){return W.reset()})),W.register(W._inputHandler.onRequestScroll(function(R,x){return W.scroll(R,x||void 0)})),W.register(W._inputHandler.onRequestWindowsOptionsReport(function(R){return W._reportWindowsOptions(R)})),W.register(A.forwardEvent(W._inputHandler.onCursorMove,W._onCursorMove)),W.register(A.forwardEvent(W._inputHandler.onTitleChange,W._onTitleChange)),W.register(A.forwardEvent(W._inputHandler.onA11yChar,W._onA11yCharEmitter)),W.register(A.forwardEvent(W._inputHandler.onA11yTab,W._onA11yTabEmitter)),W.register(W._bufferService.onResize(function(R){return W._afterResize(R.cols,R.rows)})),W}return K(B,X),Object.defineProperty(B.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),B.prototype.dispose=function(){var G,W,R;this._isDisposed||(X.prototype.dispose.call(this),(G=this._renderService)===null||G===void 0||G.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},(R=(W=this.element)===null||W===void 0?void 0:W.parentNode)===null||R===void 0||R.removeChild(this.element))},B.prototype._setup=function(){X.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(B.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),B.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},B.prototype._updateOptions=function(G){var W,R,x,Y;switch(X.prototype._updateOptions.call(this,G),G){case"fontFamily":case"fontSize":(W=this._renderService)===null||W===void 0||W.clear(),(R=this._charSizeService)===null||R===void 0||R.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderService&&(this._renderService.setRenderer(this._createRenderer()),this._renderService.onResize(this.cols,this.rows));break;case"scrollback":(x=this.viewport)===null||x===void 0||x.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new D.AccessibilityManager(this,this._renderService)):((Y=this._accessibilityManager)===null||Y===void 0||Y.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},B.prototype._onTextAreaFocus=function(G){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(O.C0.ESC+"[I"),this.updateCursorStyle(G),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},B.prototype.blur=function(){var G;return(G=this.textarea)===null||G===void 0?void 0:G.blur()},B.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(O.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},B.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var G=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),W=this._bufferService.buffer.y*G,R=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=R+"px",this.textarea.style.top=W+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=G+"px",this.textarea.style.lineHeight=G+"px",this.textarea.style.zIndex="-5"}},B.prototype._initGlobal=function(){var G=this;this._bindKeys(),this.register(l.addDisposableDomListener(this.element,"copy",function(R){G.hasSelection()&&_.copyHandler(R,G._selectionService)}));var W=function(R){return _.handlePasteEvent(R,G.textarea,G._coreService)};this.register(l.addDisposableDomListener(this.textarea,"paste",W)),this.register(l.addDisposableDomListener(this.element,"paste",W)),c.isFirefox?this.register(l.addDisposableDomListener(this.element,"mousedown",function(R){R.button===2&&_.rightClickHandler(R,G.textarea,G.screenElement,G._selectionService,G.options.rightClickSelectsWord)})):this.register(l.addDisposableDomListener(this.element,"contextmenu",function(R){_.rightClickHandler(R,G.textarea,G.screenElement,G._selectionService,G.options.rightClickSelectsWord)})),c.isLinux&&this.register(l.addDisposableDomListener(this.element,"auxclick",function(R){R.button===1&&_.moveTextAreaUnderMouseCursor(R,G.textarea,G.screenElement)}))},B.prototype._bindKeys=function(){var G=this;this.register(l.addDisposableDomListener(this.textarea,"keyup",function(W){return G._keyUp(W)},!0)),this.register(l.addDisposableDomListener(this.textarea,"keydown",function(W){return G._keyDown(W)},!0)),this.register(l.addDisposableDomListener(this.textarea,"keypress",function(W){return G._keyPress(W)},!0)),this.register(l.addDisposableDomListener(this.textarea,"compositionstart",function(){return G._compositionHelper.compositionstart()})),this.register(l.addDisposableDomListener(this.textarea,"compositionupdate",function(W){return G._compositionHelper.compositionupdate(W)})),this.register(l.addDisposableDomListener(this.textarea,"compositionend",function(){return G._compositionHelper.compositionend()})),this.register(this.onRender(function(){return G._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(W){return G._queueLinkification(W.start,W.end)}))},B.prototype.open=function(G){var W=this;if(!G)throw new Error("Terminal requires a parent element.");J.body.contains(G)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=G.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),G.appendChild(this.element);var R=J.createDocumentFragment();this._viewportElement=J.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),R.appendChild(this._viewportElement),this._viewportScrollArea=J.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=J.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=J.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),R.appendChild(this.screenElement),this.textarea=J.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",u.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register(l.addDisposableDomListener(this.textarea,"focus",function(te){return W._onTextAreaFocus(te)})),this.register(l.addDisposableDomListener(this.textarea,"blur",function(){return W._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var x=this._instantiationService.createInstance(ne.CoreBrowserService,this.textarea);this._instantiationService.setService($.ICoreBrowserService,x),this._charSizeService=this._instantiationService.createInstance(F.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService($.ICharSizeService,this._charSizeService),this._compositionView=J.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(T.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(R),this._theme=this.options.theme||this._theme,this._colorManager=new U.ColorManager(J,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(te){return W._colorManager.onOptionsChange(te)})),this._colorManager.setTheme(this._theme);var Y=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(N.RenderService,Y,this.rows,this.screenElement)),this._instantiationService.setService($.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(te){return W._onRender.fire(te)})),this.onResize(function(te){return W._renderService.resize(te.cols,te.rows)}),this._soundService=this._instantiationService.createInstance(p.SoundService),this._instantiationService.setService($.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(q.MouseService),this._instantiationService.setService($.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(w.Viewport,function(te,Se){return W.scrollLines(te,Se)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(function(){return W.viewport.syncScrollArea()})),this.register(this.viewport),this.register(this.onCursorMove(function(){W._renderService.onCursorMove(),W._syncTextArea()})),this.register(this.onResize(function(){return W._renderService.onResize(W.cols,W.rows)})),this.register(this.onBlur(function(){return W._renderService.onBlur()})),this.register(this.onFocus(function(){return W._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return W.viewport.syncScrollArea()})),this._selectionService=this.register(this._instantiationService.createInstance(f.SelectionService,this.element,this.screenElement)),this._instantiationService.setService($.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(te){return W.scrollLines(te.amount,te.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return W._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(te){return W._renderService.onSelectionChanged(te.start,te.end,te.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(te){W.textarea.value=te,W.textarea.focus(),W.textarea.select()})),this.register(this.onScroll(function(){W.viewport.syncScrollArea(),W._selectionService.refresh()})),this.register(l.addDisposableDomListener(this._viewportElement,"scroll",function(){return W._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(E.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return W._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.linkifier2.attachToDom(this.element,this._mouseService,this._renderService),this.register(l.addDisposableDomListener(this.element,"mousedown",function(te){return W._selectionService.onMouseDown(te)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new D.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},B.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(n.Renderer,this._colorManager.colors,this.screenElement,this.linkifier,this.linkifier2);case"dom":return this._instantiationService.createInstance(L.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},B.prototype._setTheme=function(G){var W,R,x;this._theme=G,(W=this._colorManager)===null||W===void 0||W.setTheme(G),(R=this._renderService)===null||R===void 0||R.setColors(this._colorManager.colors),(x=this.viewport)===null||x===void 0||x.onThemeChange(this._colorManager.colors)},B.prototype.bindMouse=function(){var G=this,W=this,R=this.element;function x(Ee){var ze,He,Be=W._mouseService.getRawByteCoords(Ee,W.screenElement,W.cols,W.rows);if(!Be)return!1;switch(Ee.overrideType||Ee.type){case"mousemove":He=32,Ee.buttons===void 0?(ze=3,Ee.button!==void 0&&(ze=Ee.button<3?Ee.button:3)):ze=1&Ee.buttons?0:4&Ee.buttons?1:2&Ee.buttons?2:3;break;case"mouseup":He=0,ze=Ee.button<3?Ee.button:3;break;case"mousedown":He=1,ze=Ee.button<3?Ee.button:3;break;case"wheel":Ee.deltaY!==0&&(He=Ee.deltaY<0?0:1),ze=4;break;default:return!1}return!(He===void 0||ze===void 0||ze>4)&&W._coreMouseService.triggerMouseEvent({col:Be.x-33,row:Be.y-33,button:ze,action:He,ctrl:Ee.ctrlKey,alt:Ee.altKey,shift:Ee.shiftKey})}var Y={mouseup:null,wheel:null,mousedrag:null,mousemove:null},te=function(Ee){return x(Ee),Ee.buttons||(G._document.removeEventListener("mouseup",Y.mouseup),Y.mousedrag&&G._document.removeEventListener("mousemove",Y.mousedrag)),G.cancel(Ee)},Se=function(Ee){return x(Ee),Ee.preventDefault(),G.cancel(Ee)},Ie=function(Ee){Ee.buttons&&x(Ee)},Ge=function(Ee){Ee.buttons||x(Ee)};this.register(this._coreMouseService.onProtocolChange(function(Ee){Ee?(G.optionsService.options.logLevel==="debug"&&G._logService.debug("Binding to mouse events:",G._coreMouseService.explainEvents(Ee)),G.element.classList.add("enable-mouse-events"),G._selectionService.disable()):(G._logService.debug("Unbinding from mouse events."),G.element.classList.remove("enable-mouse-events"),G._selectionService.enable()),8&Ee?Y.mousemove||(R.addEventListener("mousemove",Ge),Y.mousemove=Ge):(R.removeEventListener("mousemove",Y.mousemove),Y.mousemove=null),16&Ee?Y.wheel||(R.addEventListener("wheel",Se,{passive:!1}),Y.wheel=Se):(R.removeEventListener("wheel",Y.wheel),Y.wheel=null),2&Ee?Y.mouseup||(Y.mouseup=te):(G._document.removeEventListener("mouseup",Y.mouseup),Y.mouseup=null),4&Ee?Y.mousedrag||(Y.mousedrag=Ie):(G._document.removeEventListener("mousemove",Y.mousedrag),Y.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(l.addDisposableDomListener(R,"mousedown",function(Ee){if(Ee.preventDefault(),G.focus(),G._coreMouseService.areMouseEventsActive&&!G._selectionService.shouldForceSelection(Ee))return x(Ee),Y.mouseup&&G._document.addEventListener("mouseup",Y.mouseup),Y.mousedrag&&G._document.addEventListener("mousemove",Y.mousedrag),G.cancel(Ee)})),this.register(l.addDisposableDomListener(R,"wheel",function(Ee){if(!Y.wheel){if(!G.buffer.hasScrollback){var ze=G.viewport.getLinesScrolled(Ee);if(ze===0)return;for(var He=O.C0.ESC+(G._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Ee.deltaY<0?"A":"B"),Be="",lt=0;lt<Math.abs(ze);lt++)Be+=He;G._coreService.triggerDataEvent(Be,!0)}}},{passive:!0})),this.register(l.addDisposableDomListener(R,"wheel",function(Ee){if(!Y.wheel)return G.viewport.onWheel(Ee)?void 0:G.cancel(Ee)},{passive:!1})),this.register(l.addDisposableDomListener(R,"touchstart",function(Ee){if(!G._coreMouseService.areMouseEventsActive)return G.viewport.onTouchStart(Ee),G.cancel(Ee)},{passive:!0})),this.register(l.addDisposableDomListener(R,"touchmove",function(Ee){if(!G._coreMouseService.areMouseEventsActive)return G.viewport.onTouchMove(Ee)?void 0:G.cancel(Ee)},{passive:!1}))},B.prototype.refresh=function(G,W){var R;(R=this._renderService)===null||R===void 0||R.refreshRows(G,W)},B.prototype._queueLinkification=function(G,W){var R;(R=this.linkifier)===null||R===void 0||R.linkifyRows(G,W)},B.prototype.updateCursorStyle=function(G){this._selectionService&&this._selectionService.shouldColumnSelect(G)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},B.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},B.prototype.scrollLines=function(G,W){X.prototype.scrollLines.call(this,G,W),this.refresh(0,this.rows-1)},B.prototype.paste=function(G){_.paste(G,this.textarea,this._coreService)},B.prototype.attachCustomKeyEventHandler=function(G){this._customKeyEventHandler=G},B.prototype.registerLinkMatcher=function(G,W,R){var x=this.linkifier.registerLinkMatcher(G,W,R);return this.refresh(0,this.rows-1),x},B.prototype.deregisterLinkMatcher=function(G){this.linkifier.deregisterLinkMatcher(G)&&this.refresh(0,this.rows-1)},B.prototype.registerLinkProvider=function(G){return this.linkifier2.registerLinkProvider(G)},B.prototype.registerCharacterJoiner=function(G){var W=this._renderService.registerCharacterJoiner(G);return this.refresh(0,this.rows-1),W},B.prototype.deregisterCharacterJoiner=function(G){this._renderService.deregisterCharacterJoiner(G)&&this.refresh(0,this.rows-1)},Object.defineProperty(B.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),B.prototype.addMarker=function(G){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+G)},B.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},B.prototype.select=function(G,W,R){this._selectionService.setSelection(G,W,R)},B.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},B.prototype.getSelectionPosition=function(){if(this._selectionService&&this._selectionService.hasSelection)return{startColumn:this._selectionService.selectionStart[0],startRow:this._selectionService.selectionStart[1],endColumn:this._selectionService.selectionEnd[0],endRow:this._selectionService.selectionEnd[1]}},B.prototype.clearSelection=function(){var G;(G=this._selectionService)===null||G===void 0||G.clearSelection()},B.prototype.selectAll=function(){var G;(G=this._selectionService)===null||G===void 0||G.selectAll()},B.prototype.selectLines=function(G,W){var R;(R=this._selectionService)===null||R===void 0||R.selectLines(G,W)},B.prototype._keyDown=function(G){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;if(!this._compositionHelper.keydown(G))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var W=C.evaluateKeyboardEvent(G,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(G),W.type===3||W.type===2){var R=this.rows-1;return this.scrollLines(W.type===2?-R:R),this.cancel(G,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,G)||(W.cancel&&this.cancel(G,!0),!W.key||(W.key!==O.C0.ETX&&W.key!==O.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:G}),this._showCursor(),this._coreService.triggerDataEvent(W.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(G,!0)))},B.prototype._isThirdLevelShift=function(G,W){var R=G.isMac&&!this.options.macOptionIsMeta&&W.altKey&&!W.ctrlKey&&!W.metaKey||G.isWindows&&W.altKey&&W.ctrlKey&&!W.metaKey;return W.type==="keypress"?R:R&&(!W.keyCode||W.keyCode>47)},B.prototype._keyUp=function(G){this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1||(function(W){return W.keyCode===16||W.keyCode===17||W.keyCode===18}(G)||this.focus(),this.updateCursorStyle(G))},B.prototype._keyPress=function(G){var W;if(this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;if(this.cancel(G),G.charCode)W=G.charCode;else if(G.which===null||G.which===void 0)W=G.keyCode;else{if(G.which===0||G.charCode===0)return!1;W=G.which}return!(!W||(G.altKey||G.ctrlKey||G.metaKey)&&!this._isThirdLevelShift(this.browser,G))&&(W=String.fromCharCode(W),this._onKey.fire({key:W,domEvent:G}),this._showCursor(),this._coreService.triggerDataEvent(W,!0),!0)},B.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},B.prototype.resize=function(G,W){G!==this.cols||W!==this.rows?X.prototype.resize.call(this,G,W):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},B.prototype._afterResize=function(G,W){var R,x;(R=this._charSizeService)===null||R===void 0||R.measure(),(x=this.viewport)===null||x===void 0||x.syncScrollArea(!0)},B.prototype.clear=function(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var G=1;G<this.rows;G++)this.buffer.lines.push(this.buffer.getBlankLine(P.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},B.prototype.reset=function(){var G,W;this.options.rows=this.rows,this.options.cols=this.cols;var R=this._customKeyEventHandler;this._setup(),X.prototype.reset.call(this),(G=this._selectionService)===null||G===void 0||G.reset(),this._customKeyEventHandler=R,this.refresh(0,this.rows-1),(W=this.viewport)===null||W===void 0||W.syncScrollArea()},B.prototype._reportWindowsOptions=function(G){if(this._renderService)switch(G){case m.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var W=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),R=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(O.C0.ESC+"[4;"+R+";"+W+"t");break;case m.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var x=this._renderService.dimensions.scaledCellWidth.toFixed(0),Y=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(O.C0.ESC+"[6;"+Y+";"+x+"t")}},B.prototype.cancel=function(G,W){if(this.options.cancelEvents||W)return G.preventDefault(),G.stopPropagation(),!1},B.prototype._visualBell=function(){return!1},B.prototype._soundBell=function(){return this.options.bellStyle==="sound"},B}(oe.CoreTerminal);b.Terminal=z},function(me,b,k){"use strict";var I=this&&this.__decorate||function(O,m,n,y){var f,c=arguments.length,l=c<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,n):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(O,m,n,y);else for(var u=O.length-1;u>=0;u--)(f=O[u])&&(l=(c<3?f(l):c>3?f(m,n,l):f(m,n))||l);return c>3&&l&&Object.defineProperty(m,n,l),l},K=this&&this.__param||function(O,m){return function(n,y){m(n,y,O)}};Object.defineProperty(b,"__esModule",{value:!0}),b.CompositionHelper=void 0;var T=k(5),w=k(1),_=function(){function O(m,n,y,f,c,l){this._textarea=m,this._compositionView=n,this._bufferService=y,this._optionsService=f,this._charSizeService=c,this._coreService=l,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(O.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),O.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},O.prototype.compositionupdate=function(m){var n=this;this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout(function(){n._compositionPosition.end=n._textarea.value.length},0)},O.prototype.compositionend=function(){this._finalizeComposition(!0)},O.prototype.keydown=function(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},O.prototype._finalizeComposition=function(m){var n=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){var y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(n._isSendingComposition){n._isSendingComposition=!1;var c=void 0;c=n._isComposing?n._textarea.value.substring(y.start,y.end):n._textarea.value.substring(y.start),n._coreService.triggerDataEvent(c,!0)}},0)}else{this._isSendingComposition=!1;var f=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(f,!0)}},O.prototype._handleAnyTextareaChanges=function(){var m=this,n=this._textarea.value;setTimeout(function(){if(!m._isComposing){var y=m._textarea.value.replace(n,"");y.length>0&&m._coreService.triggerDataEvent(y,!0)}},0)},O.prototype.updateCompositionElements=function(m){var n=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var y=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),f=this._bufferService.buffer.y*y,c=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var l=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=f+"px",this._textarea.style.width=l.width+"px",this._textarea.style.height=l.height+"px",this._textarea.style.lineHeight=l.height+"px"}m||setTimeout(function(){return n.updateCompositionElements(!0)},0)}},O=I([K(2,w.IBufferService),K(3,w.IOptionsService),K(4,T.ICharSizeService),K(5,w.ICoreService)],O)}();b.CompositionHelper=_},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(f,c){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var p in u)u.hasOwnProperty(p)&&(l[p]=u[p])})(f,c)},function(f,c){function l(){this.constructor=f}I(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)}),T=this&&this.__decorate||function(f,c,l,u){var p,E=arguments.length,D=E<3?c:u===null?u=Object.getOwnPropertyDescriptor(c,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(f,c,l,u);else for(var L=f.length-1;L>=0;L--)(p=f[L])&&(D=(E<3?p(D):E>3?p(c,l,D):p(c,l))||D);return E>3&&D&&Object.defineProperty(c,l,D),D},w=this&&this.__param||function(f,c){return function(l,u){c(l,u,f)}};Object.defineProperty(b,"__esModule",{value:!0}),b.Viewport=void 0;var _=k(2),O=k(7),m=k(5),n=k(1),y=function(f){function c(l,u,p,E,D,L,C){var A=f.call(this)||this;return A._scrollLines=l,A._viewportElement=u,A._scrollArea=p,A._bufferService=E,A._optionsService=D,A._charSizeService=L,A._renderService=C,A.scrollBarWidth=0,A._currentRowHeight=0,A._lastRecordedBufferLength=0,A._lastRecordedViewportHeight=0,A._lastRecordedBufferHeight=0,A._lastTouchY=0,A._lastScrollTop=0,A._wheelPartialScroll=0,A._refreshAnimationFrame=null,A._ignoreNextScrollEvent=!1,A.scrollBarWidth=A._viewportElement.offsetWidth-A._scrollArea.offsetWidth||15,A.register(O.addDisposableDomListener(A._viewportElement,"scroll",A._onScroll.bind(A))),setTimeout(function(){return A.syncScrollArea()},0),A}return K(c,f),c.prototype.onThemeChange=function(l){this._viewportElement.style.backgroundColor=l.background.css},c.prototype._refresh=function(l){var u=this;if(l)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return u._innerRefresh()}))},c.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null},c.prototype.syncScrollArea=function(l){if(l===void 0&&(l=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(l);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===u&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(l)}else this._refresh(l)},c.prototype._onScroll=function(l){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var u=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(u,!0)}},c.prototype._bubbleScroll=function(l,u){var p=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(u<0&&this._viewportElement.scrollTop!==0||u>0&&p<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)},c.prototype.onWheel=function(l){var u=this._getPixelsScrolled(l);return u!==0&&(this._viewportElement.scrollTop+=u,this._bubbleScroll(l,u))},c.prototype._getPixelsScrolled=function(l){if(l.deltaY===0)return 0;var u=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?u*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(u*=this._currentRowHeight*this._bufferService.rows),u},c.prototype.getLinesScrolled=function(l){if(l.deltaY===0)return 0;var u=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(u/=this._currentRowHeight+0,this._wheelPartialScroll+=u,u=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(u*=this._bufferService.rows),u},c.prototype._applyScrollModifier=function(l,u){var p=this._optionsService.options.fastScrollModifier;return p==="alt"&&u.altKey||p==="ctrl"&&u.ctrlKey||p==="shift"&&u.shiftKey?l*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:l*this._optionsService.options.scrollSensitivity},c.prototype.onTouchStart=function(l){this._lastTouchY=l.touches[0].pageY},c.prototype.onTouchMove=function(l){var u=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,u!==0&&(this._viewportElement.scrollTop+=u,this._bubbleScroll(l,u))},c=T([w(3,n.IBufferService),w(4,n.IOptionsService),w(5,m.ICharSizeService),w(6,m.IRenderService)],c)}(_.Disposable);b.Viewport=y},function(me,b,k){"use strict";function I(_){return _.replace(/\r?\n/g,"\r")}function K(_,O){return O?"\x1B[200~"+_+"\x1B[201~":_}function T(_,O,m){_=K(_=I(_),m.decPrivateModes.bracketedPasteMode),m.triggerDataEvent(_,!0),O.value=""}function w(_,O,m){var n=m.getBoundingClientRect(),y=_.clientX-n.left-10,f=_.clientY-n.top-10;O.style.width="20px",O.style.height="20px",O.style.left=y+"px",O.style.top=f+"px",O.style.zIndex="1000",O.focus()}Object.defineProperty(b,"__esModule",{value:!0}),b.rightClickHandler=b.moveTextAreaUnderMouseCursor=b.paste=b.handlePasteEvent=b.copyHandler=b.bracketTextForPaste=b.prepareTextForTerminal=void 0,b.prepareTextForTerminal=I,b.bracketTextForPaste=K,b.copyHandler=function(_,O){_.clipboardData&&_.clipboardData.setData("text/plain",O.selectionText),_.preventDefault()},b.handlePasteEvent=function(_,O,m){_.stopPropagation(),_.clipboardData&&T(_.clipboardData.getData("text/plain"),O,m)},b.paste=T,b.moveTextAreaUnderMouseCursor=w,b.rightClickHandler=function(_,O,m,n,y){w(_,O,m),y&&!n.isClickInSelection(_)&&n.selectWordAtCursor(_),O.value=n.selectionText,O.select()}},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(f,c){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var p in u)u.hasOwnProperty(p)&&(l[p]=u[p])})(f,c)},function(f,c){function l(){this.constructor=f}I(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)});Object.defineProperty(b,"__esModule",{value:!0}),b.EscapeSequenceParser=b.VT500_TRANSITION_TABLE=b.TransitionTable=void 0;var T=k(2),w=k(15),_=k(21),O=k(22),m=k(24),n=function(){function f(c){this.table=new Uint8Array(c)}return f.prototype.setDefault=function(c,l){w.fill(this.table,c<<4|l)},f.prototype.add=function(c,l,u,p){this.table[l<<8|c]=u<<4|p},f.prototype.addMany=function(c,l,u,p){for(var E=0;E<c.length;E++)this.table[l<<8|c[E]]=u<<4|p},f}();b.TransitionTable=n,b.VT500_TRANSITION_TABLE=function(){var f=new n(4095),c=Array.apply(null,Array(256)).map(function(L,C){return C}),l=function(L,C){return c.slice(L,C)},u=l(32,127),p=l(0,24);p.push(25),p.push.apply(p,l(28,32));var E,D=l(0,14);for(E in f.setDefault(1,0),f.addMany(u,0,2,0),D)f.addMany([24,26,153,154],E,3,0),f.addMany(l(128,144),E,3,0),f.addMany(l(144,152),E,3,0),f.add(156,E,0,0),f.add(27,E,11,1),f.add(157,E,4,8),f.addMany([152,158,159],E,0,7),f.add(155,E,11,3),f.add(144,E,11,9);return f.addMany(p,0,3,0),f.addMany(p,1,3,1),f.add(127,1,0,1),f.addMany(p,8,0,8),f.addMany(p,3,3,3),f.add(127,3,0,3),f.addMany(p,4,3,4),f.add(127,4,0,4),f.addMany(p,6,3,6),f.addMany(p,5,3,5),f.add(127,5,0,5),f.addMany(p,2,3,2),f.add(127,2,0,2),f.add(93,1,4,8),f.addMany(u,8,5,8),f.add(127,8,5,8),f.addMany([156,27,24,26,7],8,6,0),f.addMany(l(28,32),8,0,8),f.addMany([88,94,95],1,0,7),f.addMany(u,7,0,7),f.addMany(p,7,0,7),f.add(156,7,0,0),f.add(127,7,0,7),f.add(91,1,11,3),f.addMany(l(64,127),3,7,0),f.addMany(l(48,60),3,8,4),f.addMany([60,61,62,63],3,9,4),f.addMany(l(48,60),4,8,4),f.addMany(l(64,127),4,7,0),f.addMany([60,61,62,63],4,0,6),f.addMany(l(32,64),6,0,6),f.add(127,6,0,6),f.addMany(l(64,127),6,0,0),f.addMany(l(32,48),3,9,5),f.addMany(l(32,48),5,9,5),f.addMany(l(48,64),5,0,6),f.addMany(l(64,127),5,7,0),f.addMany(l(32,48),4,9,5),f.addMany(l(32,48),1,9,2),f.addMany(l(32,48),2,9,2),f.addMany(l(48,127),2,10,0),f.addMany(l(48,80),1,10,0),f.addMany(l(81,88),1,10,0),f.addMany([89,90,92],1,10,0),f.addMany(l(96,127),1,10,0),f.add(80,1,11,9),f.addMany(p,9,0,9),f.add(127,9,0,9),f.addMany(l(28,32),9,0,9),f.addMany(l(32,48),9,9,12),f.addMany(l(48,60),9,8,10),f.addMany([60,61,62,63],9,9,10),f.addMany(p,11,0,11),f.addMany(l(32,128),11,0,11),f.addMany(l(28,32),11,0,11),f.addMany(p,10,0,10),f.add(127,10,0,10),f.addMany(l(28,32),10,0,10),f.addMany(l(48,60),10,8,10),f.addMany([60,61,62,63],10,0,11),f.addMany(l(32,48),10,9,12),f.addMany(p,12,0,12),f.add(127,12,0,12),f.addMany(l(28,32),12,0,12),f.addMany(l(32,48),12,9,12),f.addMany(l(48,64),12,0,11),f.addMany(l(64,127),12,12,13),f.addMany(l(64,127),10,12,13),f.addMany(l(64,127),9,12,13),f.addMany(p,13,13,13),f.addMany(u,13,13,13),f.add(127,13,0,13),f.addMany([27,156,24,26],13,14,0),f.add(160,0,2,0),f.add(160,8,5,8),f.add(160,6,0,6),f.add(160,11,0,11),f.add(160,13,13,13),f}();var y=function(f){function c(l){l===void 0&&(l=b.VT500_TRANSITION_TABLE);var u=f.call(this)||this;return u._transitions=l,u.initialState=0,u.currentState=u.initialState,u._params=new _.Params,u._params.addParam(0),u._collect=0,u.precedingCodepoint=0,u._printHandlerFb=function(p,E,D){},u._executeHandlerFb=function(p){},u._csiHandlerFb=function(p,E){},u._escHandlerFb=function(p){},u._errorHandlerFb=function(p){return p},u._printHandler=u._printHandlerFb,u._executeHandlers=Object.create(null),u._csiHandlers=Object.create(null),u._escHandlers=Object.create(null),u._oscParser=new O.OscParser,u._dcsParser=new m.DcsParser,u._errorHandler=u._errorHandlerFb,u.setEscHandler({final:"\\"},function(){}),u}return K(c,f),c.prototype._identifier=function(l,u){u===void 0&&(u=[64,126]);var p=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if((p=l.prefix.charCodeAt(0))&&60>p||p>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var E=0;E<l.intermediates.length;++E){var D=l.intermediates.charCodeAt(E);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");p<<=8,p|=D}}if(l.final.length!==1)throw new Error("final must be a single byte");var L=l.final.charCodeAt(0);if(u[0]>L||L>u[1])throw new Error("final must be in range "+u[0]+" .. "+u[1]);return p<<=8,p|=L},c.prototype.identToString=function(l){for(var u=[];l;)u.push(String.fromCharCode(255&l)),l>>=8;return u.reverse().join("")},c.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},c.prototype.setPrintHandler=function(l){this._printHandler=l},c.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},c.prototype.addEscHandler=function(l,u){var p=this._identifier(l,[48,126]);this._escHandlers[p]===void 0&&(this._escHandlers[p]=[]);var E=this._escHandlers[p];return E.push(u),{dispose:function(){var D=E.indexOf(u);D!==-1&&E.splice(D,1)}}},c.prototype.setEscHandler=function(l,u){this._escHandlers[this._identifier(l,[48,126])]=[u]},c.prototype.clearEscHandler=function(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]},c.prototype.setEscHandlerFallback=function(l){this._escHandlerFb=l},c.prototype.setExecuteHandler=function(l,u){this._executeHandlers[l.charCodeAt(0)]=u},c.prototype.clearExecuteHandler=function(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]},c.prototype.setExecuteHandlerFallback=function(l){this._executeHandlerFb=l},c.prototype.addCsiHandler=function(l,u){var p=this._identifier(l);this._csiHandlers[p]===void 0&&(this._csiHandlers[p]=[]);var E=this._csiHandlers[p];return E.push(u),{dispose:function(){var D=E.indexOf(u);D!==-1&&E.splice(D,1)}}},c.prototype.setCsiHandler=function(l,u){this._csiHandlers[this._identifier(l)]=[u]},c.prototype.clearCsiHandler=function(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]},c.prototype.setCsiHandlerFallback=function(l){this._csiHandlerFb=l},c.prototype.addDcsHandler=function(l,u){return this._dcsParser.addHandler(this._identifier(l),u)},c.prototype.setDcsHandler=function(l,u){this._dcsParser.setHandler(this._identifier(l),u)},c.prototype.clearDcsHandler=function(l){this._dcsParser.clearHandler(this._identifier(l))},c.prototype.setDcsHandlerFallback=function(l){this._dcsParser.setHandlerFallback(l)},c.prototype.addOscHandler=function(l,u){return this._oscParser.addHandler(l,u)},c.prototype.setOscHandler=function(l,u){this._oscParser.setHandler(l,u)},c.prototype.clearOscHandler=function(l){this._oscParser.clearHandler(l)},c.prototype.setOscHandlerFallback=function(l){this._oscParser.setHandlerFallback(l)},c.prototype.setErrorHandler=function(l){this._errorHandler=l},c.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},c.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0},c.prototype.parse=function(l,u){for(var p=0,E=0,D=this.currentState,L=this._oscParser,C=this._dcsParser,A=this._collect,P=this._params,U=this._transitions.table,N=0;N<u;++N){switch((E=U[D<<8|((p=l[N])<160?p:160)])>>4){case 2:for(var $=N+1;;++$){if($>=u||(p=l[$])<32||p>126&&p<160){this._printHandler(l,N,$),N=$-1;break}if(++$>=u||(p=l[$])<32||p>126&&p<160){this._printHandler(l,N,$),N=$-1;break}if(++$>=u||(p=l[$])<32||p>126&&p<160){this._printHandler(l,N,$),N=$-1;break}if(++$>=u||(p=l[$])<32||p>126&&p<160){this._printHandler(l,N,$),N=$-1;break}}break;case 3:this._executeHandlers[p]?this._executeHandlers[p]():this._executeHandlerFb(p),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:N,code:p,currentState:D,collect:A,params:P,abort:!1}).abort)return;break;case 7:for(var F=this._csiHandlers[A<<8|p],q=F?F.length-1:-1;q>=0&&F[q](P)===!1;q--);q<0&&this._csiHandlerFb(A<<8|p,P),this.precedingCodepoint=0;break;case 8:do switch(p){case 59:P.addParam(0);break;case 58:P.addSubParam(-1);break;default:P.addDigit(p-48)}while(++N<u&&(p=l[N])>47&&p<60);N--;break;case 9:A<<=8,A|=p;break;case 10:for(var V=this._escHandlers[A<<8|p],ne=V?V.length-1:-1;ne>=0&&V[ne]()===!1;ne--);ne<0&&this._escHandlerFb(A<<8|p),this.precedingCodepoint=0;break;case 11:P.reset(),P.addParam(0),A=0;break;case 12:C.hook(A<<8|p,P);break;case 13:for(var oe=N+1;;++oe)if(oe>=u||(p=l[oe])===24||p===26||p===27||p>127&&p<160){C.put(l,N,oe),N=oe-1;break}break;case 14:C.unhook(p!==24&&p!==26),p===27&&(E|=1),P.reset(),P.addParam(0),A=0,this.precedingCodepoint=0;break;case 4:L.start();break;case 5:for(var J=N+1;;J++)if(J>=u||(p=l[J])<32||p>127&&p<=159){L.put(l,N,J),N=J-1;break}break;case 6:L.end(p!==24&&p!==26),p===27&&(E|=1),P.reset(),P.addParam(0),A=0,this.precedingCodepoint=0}D=15&E}this._collect=A,this.currentState=D},c}(T.Disposable);b.EscapeSequenceParser=y},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(L,C){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,P){A.__proto__=P}||function(A,P){for(var U in P)P.hasOwnProperty(U)&&(A[U]=P[U])})(L,C)},function(L,C){function A(){this.constructor=L}I(L,C),L.prototype=C===null?Object.create(C):(A.prototype=C.prototype,new A)}),T=this&&this.__decorate||function(L,C,A,P){var U,N=arguments.length,$=N<3?C:P===null?P=Object.getOwnPropertyDescriptor(C,A):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(L,C,A,P);else for(var F=L.length-1;F>=0;F--)(U=L[F])&&($=(N<3?U($):N>3?U(C,A,$):U(C,A))||$);return N>3&&$&&Object.defineProperty(C,A,$),$},w=this&&this.__param||function(L,C){return function(A,P){C(A,P,L)}};Object.defineProperty(b,"__esModule",{value:!0}),b.Renderer=void 0;var _=k(41),O=k(47),m=k(48),n=k(49),y=k(29),f=k(2),c=k(5),l=k(1),u=k(25),p=k(0),E=1,D=function(L){function C(A,P,U,N,$,F,q,V,ne){var oe=L.call(this)||this;oe._colors=A,oe._screenElement=P,oe._bufferService=$,oe._charSizeService=F,oe._optionsService=q,oe._id=E++,oe._onRequestRedraw=new p.EventEmitter;var J=oe._optionsService.options.allowTransparency;return oe._characterJoinerRegistry=new y.CharacterJoinerRegistry(oe._bufferService),oe._renderLayers=[new _.TextRenderLayer(oe._screenElement,0,oe._colors,oe._characterJoinerRegistry,J,oe._id,oe._bufferService,q),new O.SelectionRenderLayer(oe._screenElement,1,oe._colors,oe._id,oe._bufferService,q),new n.LinkRenderLayer(oe._screenElement,2,oe._colors,oe._id,U,N,oe._bufferService,q),new m.CursorRenderLayer(oe._screenElement,3,oe._colors,oe._id,oe._onRequestRedraw,oe._bufferService,q,V,ne)],oe.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},oe._devicePixelRatio=window.devicePixelRatio,oe._updateDimensions(),oe.onOptionsChanged(),oe}return K(C,L),Object.defineProperty(C.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),C.prototype.dispose=function(){for(var A=0,P=this._renderLayers;A<P.length;A++)P[A].dispose();L.prototype.dispose.call(this),u.removeTerminalFromCache(this._id)},C.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},C.prototype.setColors=function(A){this._colors=A;for(var P=0,U=this._renderLayers;P<U.length;P++){var N=U[P];N.setColors(this._colors),N.reset()}},C.prototype.onResize=function(A,P){this._updateDimensions();for(var U=0,N=this._renderLayers;U<N.length;U++)N[U].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},C.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},C.prototype.onBlur=function(){this._runOperation(function(A){return A.onBlur()})},C.prototype.onFocus=function(){this._runOperation(function(A){return A.onFocus()})},C.prototype.onSelectionChanged=function(A,P,U){U===void 0&&(U=!1),this._runOperation(function(N){return N.onSelectionChanged(A,P,U)})},C.prototype.onCursorMove=function(){this._runOperation(function(A){return A.onCursorMove()})},C.prototype.onOptionsChanged=function(){this._runOperation(function(A){return A.onOptionsChanged()})},C.prototype.clear=function(){this._runOperation(function(A){return A.reset()})},C.prototype._runOperation=function(A){for(var P=0,U=this._renderLayers;P<U.length;P++)A(U[P])},C.prototype.renderRows=function(A,P){for(var U=0,N=this._renderLayers;U<N.length;U++)N[U].onGridChanged(A,P)},C.prototype._updateDimensions=function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharTop=this._optionsService.options.lineHeight===1?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},C.prototype.registerCharacterJoiner=function(A){return this._characterJoinerRegistry.registerCharacterJoiner(A)},C.prototype.deregisterCharacterJoiner=function(A){return this._characterJoinerRegistry.deregisterCharacterJoiner(A)},C=T([w(4,l.IBufferService),w(5,c.ICharSizeService),w(6,l.IOptionsService),w(7,l.ICoreService),w(8,c.ICoreBrowserService)],C)}(f.Disposable);b.Renderer=D},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(f,c){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var p in u)u.hasOwnProperty(p)&&(l[p]=u[p])})(f,c)},function(f,c){function l(){this.constructor=f}I(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)});Object.defineProperty(b,"__esModule",{value:!0}),b.TextRenderLayer=void 0;var T=k(42),w=k(13),_=k(6),O=k(3),m=k(29),n=k(4),y=function(f){function c(l,u,p,E,D,L,C,A){var P=f.call(this,l,"text",u,D,p,L,C,A)||this;return P._characterWidth=0,P._characterFont="",P._characterOverlapCache={},P._workCell=new n.CellData,P._state=new T.GridCache,P._characterJoinerRegistry=E,P}return K(c,f),c.prototype.resize=function(l){f.prototype.resize.call(this,l);var u=this._getFont(!1,!1);this._characterWidth===l.scaledCharWidth&&this._characterFont===u||(this._characterWidth=l.scaledCharWidth,this._characterFont=u,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},c.prototype.reset=function(){this._state.clear(),this._clearAll()},c.prototype._forEachCell=function(l,u,p,E){for(var D=l;D<=u;D++)for(var L=D+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.lines.get(L),A=p?p.getJoinedCharacters(L):[],P=0;P<this._bufferService.cols;P++){C.loadCell(P,this._workCell);var U=this._workCell,N=!1,$=P;if(U.getWidth()!==0){if(A.length>0&&P===A[0][0]){N=!0;var F=A.shift();U=new m.JoinedCellData(this._workCell,C.translateToString(!0,F[0],F[1]),F[1]-F[0]),$=F[1]-1}!N&&this._isOverlapping(U)&&$<C.length-1&&C.getCodePoint($+1)===O.NULL_CELL_CODE&&(U.content&=-12582913,U.content|=2<<22),E(U,P,D),P=$}}},c.prototype._drawBackground=function(l,u){var p=this,E=this._ctx,D=this._bufferService.cols,L=0,C=0,A=null;E.save(),this._forEachCell(l,u,null,function(P,U,N){var $=null;P.isInverse()?$=P.isFgDefault()?p._colors.foreground.css:P.isFgRGB()?"rgb("+_.AttributeData.toColorRGB(P.getFgColor()).join(",")+")":p._colors.ansi[P.getFgColor()].css:P.isBgRGB()?$="rgb("+_.AttributeData.toColorRGB(P.getBgColor()).join(",")+")":P.isBgPalette()&&($=p._colors.ansi[P.getBgColor()].css),A===null&&(L=U,C=N),N!==C?(E.fillStyle=A||"",p._fillCells(L,C,D-L,1),L=U,C=N):A!==$&&(E.fillStyle=A||"",p._fillCells(L,C,U-L,1),L=U,C=N),A=$}),A!==null&&(E.fillStyle=A,this._fillCells(L,C,D-L,1)),E.restore()},c.prototype._drawForeground=function(l,u){var p=this;this._forEachCell(l,u,this._characterJoinerRegistry,function(E,D,L){if(!E.isInvisible()&&(p._drawChars(E,D,L),E.isUnderline())){if(p._ctx.save(),E.isInverse())if(E.isBgDefault())p._ctx.fillStyle=p._colors.background.css;else if(E.isBgRGB())p._ctx.fillStyle="rgb("+_.AttributeData.toColorRGB(E.getBgColor()).join(",")+")";else{var C=E.getBgColor();p._optionsService.options.drawBoldTextInBrightColors&&E.isBold()&&C<8&&(C+=8),p._ctx.fillStyle=p._colors.ansi[C].css}else if(E.isFgDefault())p._ctx.fillStyle=p._colors.foreground.css;else if(E.isFgRGB())p._ctx.fillStyle="rgb("+_.AttributeData.toColorRGB(E.getFgColor()).join(",")+")";else{var A=E.getFgColor();p._optionsService.options.drawBoldTextInBrightColors&&E.isBold()&&A<8&&(A+=8),p._ctx.fillStyle=p._colors.ansi[A].css}p._fillBottomLineAtCells(D,L,E.getWidth()),p._ctx.restore()}})},c.prototype.onGridChanged=function(l,u){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,l,this._bufferService.cols,u-l+1),this._drawBackground(l,u),this._drawForeground(l,u))},c.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},c.prototype._isOverlapping=function(l){if(l.getWidth()!==1||l.getCode()<256)return!1;var u=l.getChars();if(this._characterOverlapCache.hasOwnProperty(u))return this._characterOverlapCache[u];this._ctx.save(),this._ctx.font=this._characterFont;var p=Math.floor(this._ctx.measureText(u).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[u]=p,p},c}(w.BaseRenderLayer);b.TextRenderLayer=y},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.GridCache=void 0;var I=function(){function K(){this.cache=[]}return K.prototype.resize=function(T,w){for(var _=0;_<T;_++){this.cache.length<=_&&this.cache.push([]);for(var O=this.cache[_].length;O<w;O++)this.cache[_].push(void 0);this.cache[_].length=w}this.cache.length=T},K.prototype.clear=function(){for(var T=0;T<this.cache.length;T++)for(var w=0;w<this.cache[T].length;w++)this.cache[T][w]=void 0},K}();b.GridCache=I},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(p,E){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,L){D.__proto__=L}||function(D,L){for(var C in L)L.hasOwnProperty(C)&&(D[C]=L[C])})(p,E)},function(p,E){function D(){this.constructor=p}I(p,E),p.prototype=E===null?Object.create(E):(D.prototype=E.prototype,new D)});Object.defineProperty(b,"__esModule",{value:!0}),b.NoneCharAtlas=b.DynamicCharAtlas=b.getGlyphCacheKey=void 0;var T=k(9),w=k(44),_=k(27),O=k(46),m=k(11),n=k(28),y=k(10),f={css:"rgba(0, 0, 0, 0)",rgba:0};function c(p){return p.code<<21|p.bg<<12|p.fg<<3|(p.bold?0:4)+(p.dim?0:2)+(p.italic?0:1)}b.getGlyphCacheKey=c;var l=function(p){function E(D,L){var C=p.call(this)||this;C._config=L,C._drawToCacheCount=0,C._glyphsWaitingOnBitmap=[],C._bitmapCommitTimeout=null,C._bitmap=null,C._cacheCanvas=D.createElement("canvas"),C._cacheCanvas.width=1024,C._cacheCanvas.height=1024,C._cacheCtx=n.throwIfFalsy(C._cacheCanvas.getContext("2d",{alpha:!0}));var A=D.createElement("canvas");A.width=C._config.scaledCharWidth,A.height=C._config.scaledCharHeight,C._tmpCtx=n.throwIfFalsy(A.getContext("2d",{alpha:C._config.allowTransparency})),C._width=Math.floor(1024/C._config.scaledCharWidth),C._height=Math.floor(1024/C._config.scaledCharHeight);var P=C._width*C._height;return C._cacheMap=new O.LRUMap(P),C._cacheMap.prealloc(P),C}return K(E,p),E.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},E.prototype.beginFrame=function(){this._drawToCacheCount=0},E.prototype.draw=function(D,L,C,A){if(L.code===32)return!0;if(!this._canCache(L))return!1;var P=c(L),U=this._cacheMap.get(P);if(U!=null)return this._drawFromCache(D,U,C,A),!0;if(this._drawToCacheCount<100){var N=void 0;N=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var $=this._drawToCache(L,N);return this._cacheMap.set(P,$),this._drawFromCache(D,$,C,A),!0}return!1},E.prototype._canCache=function(D){return D.code<256},E.prototype._toCoordinateX=function(D){return D%this._width*this._config.scaledCharWidth},E.prototype._toCoordinateY=function(D){return Math.floor(D/this._width)*this._config.scaledCharHeight},E.prototype._drawFromCache=function(D,L,C,A){if(!L.isEmpty){var P=this._toCoordinateX(L.index),U=this._toCoordinateY(L.index);D.drawImage(L.inBitmap?this._bitmap:this._cacheCanvas,P,U,this._config.scaledCharWidth,this._config.scaledCharHeight,C,A,this._config.scaledCharWidth,this._config.scaledCharHeight)}},E.prototype._getColorFromAnsiIndex=function(D){return D<this._config.colors.ansi.length?this._config.colors.ansi[D]:_.DEFAULT_ANSI_COLORS[D]},E.prototype._getBackgroundColor=function(D){return this._config.allowTransparency?f:D.bg===T.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:D.bg<256?this._getColorFromAnsiIndex(D.bg):this._config.colors.background},E.prototype._getForegroundColor=function(D){return D.fg===T.INVERTED_DEFAULT_COLOR?y.color.opaque(this._config.colors.background):D.fg<256?this._getColorFromAnsiIndex(D.fg):this._config.colors.foreground},E.prototype._drawToCache=function(D,L){this._drawToCacheCount++,this._tmpCtx.save();var C=this._getBackgroundColor(D);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=C.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var A=D.bold?this._config.fontWeightBold:this._config.fontWeight,P=D.italic?"italic":"";this._tmpCtx.font=P+" "+A+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(D).css,D.dim&&(this._tmpCtx.globalAlpha=T.DIM_OPACITY),this._tmpCtx.fillText(D.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var U=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),N=!1;this._config.allowTransparency||(N=function(V,ne){for(var oe=!0,J=ne.rgba>>>24,z=ne.rgba>>>16&255,X=ne.rgba>>>8&255,B=0;B<V.data.length;B+=4)V.data[B]===J&&V.data[B+1]===z&&V.data[B+2]===X?V.data[B+3]=0:oe=!1;return oe}(U,C));var $=this._toCoordinateX(L),F=this._toCoordinateY(L);this._cacheCtx.putImageData(U,$,F);var q={index:L,isEmpty:N,inBitmap:!1};return this._addGlyphToBitmap(q),q},E.prototype._addGlyphToBitmap=function(D){var L=this;!("createImageBitmap"in window)||m.isFirefox||m.isSafari||(this._glyphsWaitingOnBitmap.push(D),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return L._generateBitmap()},100)))},E.prototype._generateBitmap=function(){var D=this,L=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(C){D._bitmap=C;for(var A=0;A<L.length;A++)L[A].inBitmap=!0}),this._bitmapCommitTimeout=null},E}(w.BaseCharAtlas);b.DynamicCharAtlas=l;var u=function(p){function E(D,L){return p.call(this)||this}return K(E,p),E.prototype.draw=function(D,L,C,A){return!1},E}(w.BaseCharAtlas);b.NoneCharAtlas=u},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.BaseCharAtlas=void 0;var I=function(){function K(){this._didWarmUp=!1}return K.prototype.dispose=function(){},K.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},K.prototype._doWarmUp=function(){},K.prototype.beginFrame=function(){},K}();b.BaseCharAtlas=I},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ColorContrastCache=void 0;var I=function(){function K(){this._color={},this._rgba={}}return K.prototype.clear=function(){this._color={},this._rgba={}},K.prototype.setCss=function(T,w,_){this._rgba[T]||(this._rgba[T]={}),this._rgba[T][w]=_},K.prototype.getCss=function(T,w){return this._rgba[T]?this._rgba[T][w]:void 0},K.prototype.setColor=function(T,w,_){this._color[T]||(this._color[T]={}),this._color[T][w]=_},K.prototype.getColor=function(T,w){return this._color[T]?this._color[T][w]:void 0},K}();b.ColorContrastCache=I},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.LRUMap=void 0;var I=function(){function K(T){this.capacity=T,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return K.prototype._unlinkNode=function(T){var w=T.prev,_=T.next;T===this._head&&(this._head=_),T===this._tail&&(this._tail=w),w!==null&&(w.next=_),_!==null&&(_.prev=w)},K.prototype._appendNode=function(T){var w=this._tail;w!==null&&(w.next=T),T.prev=w,T.next=null,this._tail=T,this._head===null&&(this._head=T)},K.prototype.prealloc=function(T){for(var w=this._nodePool,_=0;_<T;_++)w.push({prev:null,next:null,key:null,value:null})},K.prototype.get=function(T){var w=this._map[T];return w!==void 0?(this._unlinkNode(w),this._appendNode(w),w.value):null},K.prototype.peekValue=function(T){var w=this._map[T];return w!==void 0?w.value:null},K.prototype.peek=function(){var T=this._head;return T===null?null:T.value},K.prototype.set=function(T,w){var _=this._map[T];if(_!==void 0)_=this._map[T],this._unlinkNode(_),_.value=w;else if(this.size>=this.capacity)_=this._head,this._unlinkNode(_),delete this._map[_.key],_.key=T,_.value=w,this._map[T]=_;else{var O=this._nodePool;O.length>0?((_=O.pop()).key=T,_.value=w):_={prev:null,next:null,key:T,value:w},this._map[T]=_,this.size++}this._appendNode(_)},K}();b.LRUMap=I},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(w,_){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,m){O.__proto__=m}||function(O,m){for(var n in m)m.hasOwnProperty(n)&&(O[n]=m[n])})(w,_)},function(w,_){function O(){this.constructor=w}I(w,_),w.prototype=_===null?Object.create(_):(O.prototype=_.prototype,new O)});Object.defineProperty(b,"__esModule",{value:!0}),b.SelectionRenderLayer=void 0;var T=function(w){function _(O,m,n,y,f,c){var l=w.call(this,O,"selection",m,!0,n,y,f,c)||this;return l._clearState(),l}return K(_,w),_.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},_.prototype.resize=function(O){w.prototype.resize.call(this,O),this._clearState()},_.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},_.prototype.onSelectionChanged=function(O,m,n){if(this._didStateChange(O,m,n,this._bufferService.buffer.ydisp))if(this._clearAll(),O&&m){var y=O[1]-this._bufferService.buffer.ydisp,f=m[1]-this._bufferService.buffer.ydisp,c=Math.max(y,0),l=Math.min(f,this._bufferService.rows-1);if(!(c>=this._bufferService.rows||l<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,n){var u=O[0],p=m[0]-u,E=l-c+1;this._fillCells(u,c,p,E)}else{u=y===c?O[0]:0;var D=c===l?m[0]:this._bufferService.cols;this._fillCells(u,c,D-u,1);var L=Math.max(l-c-1,0);if(this._fillCells(0,c+1,this._bufferService.cols,L),c!==l){var C=f===l?m[0]:this._bufferService.cols;this._fillCells(0,l,C,1)}}this._state.start=[O[0],O[1]],this._state.end=[m[0],m[1]],this._state.columnSelectMode=n,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},_.prototype._didStateChange=function(O,m,n,y){return!this._areCoordinatesEqual(O,this._state.start)||!this._areCoordinatesEqual(m,this._state.end)||n!==this._state.columnSelectMode||y!==this._state.ydisp},_.prototype._areCoordinatesEqual=function(O,m){return!(!O||!m)&&O[0]===m[0]&&O[1]===m[1]},_}(k(13).BaseRenderLayer);b.SelectionRenderLayer=T},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(m,n){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,f){y.__proto__=f}||function(y,f){for(var c in f)f.hasOwnProperty(c)&&(y[c]=f[c])})(m,n)},function(m,n){function y(){this.constructor=m}I(m,n),m.prototype=n===null?Object.create(n):(y.prototype=n.prototype,new y)});Object.defineProperty(b,"__esModule",{value:!0}),b.CursorRenderLayer=void 0;var T=k(13),w=k(4),_=function(m){function n(y,f,c,l,u,p,E,D,L){var C=m.call(this,y,"cursor",f,!0,c,l,p,E)||this;return C._onRequestRedraw=u,C._coreService=D,C._coreBrowserService=L,C._cell=new w.CellData,C._state={x:0,y:0,isFocused:!1,style:"",width:0},C._cursorRenderers={bar:C._renderBarCursor.bind(C),block:C._renderBlockCursor.bind(C),underline:C._renderUnderlineCursor.bind(C)},C}return K(n,m),n.prototype.resize=function(y){m.prototype.resize.call(this,y),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},n.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},n.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},n.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},n.prototype.onOptionsChanged=function(){var y,f=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new O(this._coreBrowserService.isFocused,function(){f._render(!0)})):((y=this._cursorBlinkStateManager)===null||y===void 0||y.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},n.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},n.prototype.onGridChanged=function(y,f){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},n.prototype._render=function(y){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var f=this._bufferService.buffer.ybase+this._bufferService.buffer.y,c=f-this._bufferService.buffer.ydisp;if(c<0||c>=this._bufferService.rows)this._clearCursor();else{var l=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(f).loadCell(l,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var u=this._optionsService.options.cursorStyle;return u&&u!=="block"?this._cursorRenderers[u](l,c,this._cell):this._renderBlurCursor(l,c,this._cell),this._ctx.restore(),this._state.x=l,this._state.y=c,this._state.isFocused=!1,this._state.style=u,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===l&&this._state.y===c&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](l,c,this._cell),this._ctx.restore(),this._state.x=l,this._state.y=c,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},n.prototype._clearCursor=function(){this._state&&(this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},n.prototype._renderBarCursor=function(y,f,c){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(y,f,this._optionsService.options.cursorWidth),this._ctx.restore()},n.prototype._renderBlockCursor=function(y,f,c){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(y,f,c.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(c,y,f),this._ctx.restore()},n.prototype._renderUnderlineCursor=function(y,f,c){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(y,f),this._ctx.restore()},n.prototype._renderBlurCursor=function(y,f,c){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(y,f,c.getWidth(),1),this._ctx.restore()},n}(T.BaseRenderLayer);b.CursorRenderLayer=_;var O=function(){function m(n,y){this._renderCallback=y,this.isCursorVisible=!0,n&&this._restartInterval()}return Object.defineProperty(m.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),m.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},m.prototype.restartBlinkAnimation=function(){var n=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){n._renderCallback(),n._animationFrame=void 0})))},m.prototype._restartInterval=function(n){var y=this;n===void 0&&(n=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(y._animationTimeRestarted){var f=600-(Date.now()-y._animationTimeRestarted);if(y._animationTimeRestarted=void 0,f>0)return void y._restartInterval(f)}y.isCursorVisible=!1,y._animationFrame=window.requestAnimationFrame(function(){y._renderCallback(),y._animationFrame=void 0}),y._blinkInterval=window.setInterval(function(){if(y._animationTimeRestarted){var c=600-(Date.now()-y._animationTimeRestarted);return y._animationTimeRestarted=void 0,void y._restartInterval(c)}y.isCursorVisible=!y.isCursorVisible,y._animationFrame=window.requestAnimationFrame(function(){y._renderCallback(),y._animationFrame=void 0})},600)},n)},m.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},m.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},m}()},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(m,n){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,f){y.__proto__=f}||function(y,f){for(var c in f)f.hasOwnProperty(c)&&(y[c]=f[c])})(m,n)},function(m,n){function y(){this.constructor=m}I(m,n),m.prototype=n===null?Object.create(n):(y.prototype=n.prototype,new y)});Object.defineProperty(b,"__esModule",{value:!0}),b.LinkRenderLayer=void 0;var T=k(13),w=k(9),_=k(26),O=function(m){function n(y,f,c,l,u,p,E,D){var L=m.call(this,y,"link",f,!0,c,l,E,D)||this;return u.onShowLinkUnderline(function(C){return L._onShowLinkUnderline(C)}),u.onHideLinkUnderline(function(C){return L._onHideLinkUnderline(C)}),p.onShowLinkUnderline(function(C){return L._onShowLinkUnderline(C)}),p.onHideLinkUnderline(function(C){return L._onHideLinkUnderline(C)}),L}return K(n,m),n.prototype.resize=function(y){m.prototype.resize.call(this,y),this._state=void 0},n.prototype.reset=function(){this._clearCurrentLink()},n.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var y=this._state.y2-this._state.y1-1;y>0&&this._clearCells(0,this._state.y1+1,this._state.cols,y),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},n.prototype._onShowLinkUnderline=function(y){if(y.fg===w.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:y.fg&&_.is256Color(y.fg)?this._ctx.fillStyle=this._colors.ansi[y.fg].css:this._ctx.fillStyle=this._colors.foreground.css,y.y1===y.y2)this._fillBottomLineAtCells(y.x1,y.y1,y.x2-y.x1);else{this._fillBottomLineAtCells(y.x1,y.y1,y.cols-y.x1);for(var f=y.y1+1;f<y.y2;f++)this._fillBottomLineAtCells(0,f,y.cols);this._fillBottomLineAtCells(0,y.y2,y.x2)}this._state=y},n.prototype._onHideLinkUnderline=function(y){this._clearCurrentLink()},n}(T.BaseRenderLayer);b.LinkRenderLayer=O},function(me,b,k){"use strict";var I=this&&this.__decorate||function(m,n,y,f){var c,l=arguments.length,u=l<3?n:f===null?f=Object.getOwnPropertyDescriptor(n,y):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(m,n,y,f);else for(var p=m.length-1;p>=0;p--)(c=m[p])&&(u=(l<3?c(u):l>3?c(n,y,u):c(n,y))||u);return l>3&&u&&Object.defineProperty(n,y,u),u},K=this&&this.__param||function(m,n){return function(y,f){n(y,f,m)}};Object.defineProperty(b,"__esModule",{value:!0}),b.MouseZone=b.Linkifier=void 0;var T=k(0),w=k(1),_=function(){function m(n,y,f){this._bufferService=n,this._logService=y,this._unicodeService=f,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new T.EventEmitter,this._onHideLinkUnderline=new T.EventEmitter,this._onLinkTooltip=new T.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(m.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),m.prototype.attachToDom=function(n,y){this._element=n,this._mouseZoneManager=y},m.prototype.linkifyRows=function(n,y){var f=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=n,this._rowsToLinkify.end=y):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,n),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,y)),this._mouseZoneManager.clearAll(n,y),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return f._linkifyRows()},m._timeBeforeLatency))},m.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var n=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var y=n.ydisp+this._rowsToLinkify.start;if(!(y>=n.lines.length)){for(var f=n.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,c=Math.ceil(2e3/this._bufferService.cols),l=this._bufferService.buffer.iterator(!1,y,f,c,c);l.hasNext();)for(var u=l.next(),p=0;p<this._linkMatchers.length;p++)this._doLinkifyRow(u.range.first,u.content,this._linkMatchers[p]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},m.prototype.registerLinkMatcher=function(n,y,f){if(f===void 0&&(f={}),!y)throw new Error("handler must be defined");var c={id:this._nextLinkMatcherId++,regex:n,handler:y,matchIndex:f.matchIndex,validationCallback:f.validationCallback,hoverTooltipCallback:f.tooltipCallback,hoverLeaveCallback:f.leaveCallback,willLinkActivate:f.willLinkActivate,priority:f.priority||0};return this._addLinkMatcherToList(c),c.id},m.prototype._addLinkMatcherToList=function(n){if(this._linkMatchers.length!==0){for(var y=this._linkMatchers.length-1;y>=0;y--)if(n.priority<=this._linkMatchers[y].priority)return void this._linkMatchers.splice(y+1,0,n);this._linkMatchers.splice(0,0,n)}else this._linkMatchers.push(n)},m.prototype.deregisterLinkMatcher=function(n){for(var y=0;y<this._linkMatchers.length;y++)if(this._linkMatchers[y].id===n)return this._linkMatchers.splice(y,1),!0;return!1},m.prototype._doLinkifyRow=function(n,y,f){for(var c,l=this,u=new RegExp(f.regex.source,(f.regex.flags||"")+"g"),p=-1,E=function(){var L=c[typeof f.matchIndex!="number"?0:f.matchIndex];if(!L)return D._logService.debug("match found without corresponding matchIndex",c,f),"break";if(p=y.indexOf(L,p+1),u.lastIndex=p+L.length,p<0)return"break";var C=D._bufferService.buffer.stringIndexToBufferIndex(n,p);if(C[0]<0)return"break";var A=D._bufferService.buffer.lines.get(C[0]);if(!A)return"break";var P=A.getFg(C[1]),U=P?P>>9&511:void 0;f.validationCallback?f.validationCallback(L,function(N){l._rowsTimeoutId||N&&l._addLink(C[1],C[0]-l._bufferService.buffer.ydisp,L,f,U)}):D._addLink(C[1],C[0]-D._bufferService.buffer.ydisp,L,f,U)},D=this;(c=u.exec(y))!==null&&E()!=="break";);},m.prototype._addLink=function(n,y,f,c,l){var u=this;if(this._mouseZoneManager&&this._element){var p=this._unicodeService.getStringCellWidth(f),E=n%this._bufferService.cols,D=y+Math.floor(n/this._bufferService.cols),L=(E+p)%this._bufferService.cols,C=D+Math.floor((E+p)/this._bufferService.cols);L===0&&(L=this._bufferService.cols,C--),this._mouseZoneManager.add(new O(E+1,D+1,L+1,C+1,function(A){if(c.handler)return c.handler(A,f);var P=window.open();P?(P.opener=null,P.location.href=f):console.warn("Opening link blocked as opener could not be cleared")},function(){u._onShowLinkUnderline.fire(u._createLinkHoverEvent(E,D,L,C,l)),u._element.classList.add("xterm-cursor-pointer")},function(A){u._onLinkTooltip.fire(u._createLinkHoverEvent(E,D,L,C,l)),c.hoverTooltipCallback&&c.hoverTooltipCallback(A,f,{start:{x:E,y:D},end:{x:L,y:C}})},function(){u._onHideLinkUnderline.fire(u._createLinkHoverEvent(E,D,L,C,l)),u._element.classList.remove("xterm-cursor-pointer"),c.hoverLeaveCallback&&c.hoverLeaveCallback()},function(A){return!c.willLinkActivate||c.willLinkActivate(A,f)}))}},m.prototype._createLinkHoverEvent=function(n,y,f,c,l){return{x1:n,y1:y,x2:f,y2:c,cols:this._bufferService.cols,fg:l}},m._timeBeforeLatency=200,m=I([K(0,w.IBufferService),K(1,w.ILogService),K(2,w.IUnicodeService)],m)}();b.Linkifier=_;var O=function(m,n,y,f,c,l,u,p,E){this.x1=m,this.y1=n,this.x2=y,this.y2=f,this.clickCallback=c,this.hoverCallback=l,this.tooltipCallback=u,this.leaveCallback=p,this.willLinkActivate=E};b.MouseZone=O},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(L,C){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,P){A.__proto__=P}||function(A,P){for(var U in P)P.hasOwnProperty(U)&&(A[U]=P[U])})(L,C)},function(L,C){function A(){this.constructor=L}I(L,C),L.prototype=C===null?Object.create(C):(A.prototype=C.prototype,new A)}),T=this&&this.__decorate||function(L,C,A,P){var U,N=arguments.length,$=N<3?C:P===null?P=Object.getOwnPropertyDescriptor(C,A):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(L,C,A,P);else for(var F=L.length-1;F>=0;F--)(U=L[F])&&($=(N<3?U($):N>3?U(C,A,$):U(C,A))||$);return N>3&&$&&Object.defineProperty(C,A,$),$},w=this&&this.__param||function(L,C){return function(A,P){C(A,P,L)}};Object.defineProperty(b,"__esModule",{value:!0}),b.SelectionService=void 0;var _=k(11),O=k(52),m=k(4),n=k(0),y=k(5),f=k(1),c=k(30),l=k(53),u=k(2),p="\xA0",E=new RegExp(p,"g"),D=function(L){function C(A,P,U,N,$,F,q){var V=L.call(this)||this;return V._element=A,V._screenElement=P,V._bufferService=U,V._coreService=N,V._mouseService=$,V._optionsService=F,V._renderService=q,V._dragScrollAmount=0,V._enabled=!0,V._workCell=new m.CellData,V._mouseDownTimeStamp=0,V._onLinuxMouseSelection=V.register(new n.EventEmitter),V._onRedrawRequest=V.register(new n.EventEmitter),V._onSelectionChange=V.register(new n.EventEmitter),V._onRequestScrollLines=V.register(new n.EventEmitter),V._mouseMoveListener=function(ne){return V._onMouseMove(ne)},V._mouseUpListener=function(ne){return V._onMouseUp(ne)},V._coreService.onUserInput(function(){V.hasSelection&&V.clearSelection()}),V._trimListener=V._bufferService.buffer.lines.onTrim(function(ne){return V._onTrim(ne)}),V.register(V._bufferService.buffers.onBufferActivate(function(ne){return V._onBufferActivate(ne)})),V.enable(),V._model=new O.SelectionModel(V._bufferService),V._activeSelectionMode=0,V}return K(C,L),Object.defineProperty(C.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),C.prototype.dispose=function(){this._removeMouseDownListeners()},C.prototype.reset=function(){this.clearSelection()},C.prototype.disable=function(){this.clearSelection(),this._enabled=!1},C.prototype.enable=function(){this._enabled=!0},Object.defineProperty(C.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"hasSelection",{get:function(){var A=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!A||!P)&&(A[0]!==P[0]||A[1]!==P[1])},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"selectionText",{get:function(){var A=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;if(!A||!P)return"";var U=this._bufferService.buffer,N=[];if(this._activeSelectionMode===3){if(A[0]===P[0])return"";for(var $=A[1];$<=P[1];$++){var F=U.translateBufferLineToString($,!0,A[0],P[0]);N.push(F)}}else{var q=A[1]===P[1]?P[0]:void 0;for(N.push(U.translateBufferLineToString(A[1],!0,A[0],q)),$=A[1]+1;$<=P[1]-1;$++){var V=U.lines.get($);F=U.translateBufferLineToString($,!0),V&&V.isWrapped?N[N.length-1]+=F:N.push(F)}A[1]!==P[1]&&(V=U.lines.get(P[1]),F=U.translateBufferLineToString(P[1],!0,0,P[0]),V&&V.isWrapped?N[N.length-1]+=F:N.push(F))}return N.map(function(ne){return ne.replace(E," ")}).join(_.isWindows?`\r
|
|
|
`:`
|
|
|
`)},enumerable:!1,configurable:!0}),C.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},C.prototype.refresh=function(A){var P=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return P._refresh()})),_.isLinux&&A&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},C.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},C.prototype.isClickInSelection=function(A){var P=this._getMouseBufferCoords(A),U=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;return!!(U&&N&&P)&&this._areCoordsInSelection(P,U,N)},C.prototype._areCoordsInSelection=function(A,P,U){return A[1]>P[1]&&A[1]<U[1]||P[1]===U[1]&&A[1]===P[1]&&A[0]>=P[0]&&A[0]<U[0]||P[1]<U[1]&&A[1]===U[1]&&A[0]<U[0]||P[1]<U[1]&&A[1]===P[1]&&A[0]>=P[0]},C.prototype.selectWordAtCursor=function(A){var P=this._getMouseBufferCoords(A);P&&(this._selectWordAt(P,!1),this._model.selectionEnd=void 0,this.refresh(!0))},C.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},C.prototype.selectLines=function(A,P){this._model.clearSelection(),A=Math.max(A,0),P=Math.min(P,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,P],this.refresh(),this._onSelectionChange.fire()},C.prototype._onTrim=function(A){this._model.onTrim(A)&&this.refresh()},C.prototype._getMouseBufferCoords=function(A){var P=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(P)return P[0]--,P[1]--,P[1]+=this._bufferService.buffer.ydisp,P},C.prototype._getMouseEventScrollAmount=function(A){var P=c.getCoordsRelativeToElement(A,this._screenElement)[1],U=this._renderService.dimensions.canvasHeight;return P>=0&&P<=U?0:(P>U&&(P-=U),P=Math.min(Math.max(P,-50),50),(P/=50)/Math.abs(P)+Math.round(14*P))},C.prototype.shouldForceSelection=function(A){return _.isMac?A.altKey&&this._optionsService.options.macOptionClickForcesSelection:A.shiftKey},C.prototype.onMouseDown=function(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._onIncrementalClick(A):A.detail===1?this._onSingleClick(A):A.detail===2?this._onDoubleClick(A):A.detail===3&&this._onTripleClick(A),this._addMouseDownListeners(),this.refresh(!0)}},C.prototype._addMouseDownListeners=function(){var A=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return A._dragScroll()},50)},C.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},C.prototype._onIncrementalClick=function(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))},C.prototype._onSingleClick=function(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),this._model.selectionStart){this._model.selectionEnd=void 0;var P=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);P&&P.length!==this._model.selectionStart[0]&&P.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},C.prototype._onDoubleClick=function(A){var P=this._getMouseBufferCoords(A);P&&(this._activeSelectionMode=1,this._selectWordAt(P,!0))},C.prototype._onTripleClick=function(A){var P=this._getMouseBufferCoords(A);P&&(this._activeSelectionMode=2,this._selectLineAt(P[1]))},C.prototype.shouldColumnSelect=function(A){return A.altKey&&!(_.isMac&&this._optionsService.options.macOptionClickForcesSelection)},C.prototype._onMouseMove=function(A){if(A.stopImmediatePropagation(),this._model.selectionStart){var P=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),this._model.selectionEnd){this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var U=this._bufferService.buffer;if(this._model.selectionEnd[1]<U.lines.length){var N=U.lines.get(this._model.selectionEnd[1]);N&&N.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}P&&P[0]===this._model.selectionEnd[0]&&P[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},C.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}},C.prototype._onMouseUp=function(A){var P=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&P<500&&A.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var U=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(U&&U[0]!==void 0&&U[1]!==void 0){var N=l.moveToCellSequence(U[0]-1,U[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(N,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},C.prototype._onBufferActivate=function(A){var P=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim(function(U){return P._onTrim(U)})},C.prototype._convertViewportColToCharacterIndex=function(A,P){for(var U=P[0],N=0;P[0]>=N;N++){var $=A.loadCell(N,this._workCell).getChars().length;this._workCell.getWidth()===0?U--:$>1&&P[0]!==N&&(U+=$-1)}return U},C.prototype.setSelection=function(A,P,U){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,P],this._model.selectionStartLength=U,this.refresh()},C.prototype._getWordAt=function(A,P,U,N){if(U===void 0&&(U=!0),N===void 0&&(N=!0),!(A[0]>=this._bufferService.cols)){var $=this._bufferService.buffer,F=$.lines.get(A[1]);if(F){var q=$.translateBufferLineToString(A[1],!1),V=this._convertViewportColToCharacterIndex(F,A),ne=V,oe=A[0]-V,J=0,z=0,X=0,B=0;if(q.charAt(V)===" "){for(;V>0&&q.charAt(V-1)===" ";)V--;for(;ne<q.length&&q.charAt(ne+1)===" ";)ne++}else{var G=A[0],W=A[0];F.getWidth(G)===0&&(J++,G--),F.getWidth(W)===2&&(z++,W++);var R=F.getString(W).length;for(R>1&&(B+=R-1,ne+=R-1);G>0&&V>0&&!this._isCharWordSeparator(F.loadCell(G-1,this._workCell));){F.loadCell(G-1,this._workCell);var x=this._workCell.getChars().length;this._workCell.getWidth()===0?(J++,G--):x>1&&(X+=x-1,V-=x-1),V--,G--}for(;W<F.length&&ne+1<q.length&&!this._isCharWordSeparator(F.loadCell(W+1,this._workCell));){F.loadCell(W+1,this._workCell);var Y=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,W++):Y>1&&(B+=Y-1,ne+=Y-1),ne++,W++}}ne++;var te=V+oe-J+X,Se=Math.min(this._bufferService.cols,ne-V+J+z-X-B);if(P||q.slice(V,ne).trim()!==""){if(U&&te===0&&F.getCodePoint(0)!==32){var Ie=$.lines.get(A[1]-1);if(Ie&&F.isWrapped&&Ie.getCodePoint(this._bufferService.cols-1)!==32){var Ge=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(Ge){var Ee=this._bufferService.cols-Ge.start;te-=Ee,Se+=Ee}}}if(N&&te+Se===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){var ze=$.lines.get(A[1]+1);if(ze&&ze.isWrapped&&ze.getCodePoint(0)!==32){var He=this._getWordAt([0,A[1]+1],!1,!1,!0);He&&(Se+=He.length)}}return{start:te,length:Se}}}}},C.prototype._selectWordAt=function(A,P){var U=this._getWordAt(A,P);if(U){for(;U.start<0;)U.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[U.start,A[1]],this._model.selectionStartLength=U.length}},C.prototype._selectToWordAt=function(A){var P=this._getWordAt(A,!0);if(P){for(var U=A[1];P.start<0;)P.start+=this._bufferService.cols,U--;if(!this._model.areSelectionValuesReversed())for(;P.start+P.length>this._bufferService.cols;)P.length-=this._bufferService.cols,U++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?P.start:P.start+P.length,U]}},C.prototype._isCharWordSeparator=function(A){return A.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(A.getChars())>=0},C.prototype._selectLineAt=function(A){var P=this._bufferService.buffer.getWrappedRangeForLine(A);this._model.selectionStart=[0,P.first],this._model.selectionEnd=[this._bufferService.cols,P.last],this._model.selectionStartLength=0},C=T([w(2,f.IBufferService),w(3,f.ICoreService),w(4,y.IMouseService),w(5,f.IOptionsService),w(6,y.IRenderService)],C)}(u.Disposable);b.SelectionService=D},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.SelectionModel=void 0;var I=function(){function K(T){this._bufferService=T,this.isSelectAllActive=!1,this.selectionStartLength=0}return K.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(K.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var T=this.selectionStart[0]+this.selectionStartLength;return T>this._bufferService.cols?[T%this._bufferService.cols,this.selectionStart[1]+Math.floor(T/this._bufferService.cols)]:[T,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),K.prototype.areSelectionValuesReversed=function(){var T=this.selectionStart,w=this.selectionEnd;return!(!T||!w)&&(T[1]>w[1]||T[1]===w[1]&&T[0]>w[0])},K.prototype.onTrim=function(T){return this.selectionStart&&(this.selectionStart[1]-=T),this.selectionEnd&&(this.selectionEnd[1]-=T),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},K}();b.SelectionModel=I},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.moveToCellSequence=void 0;var I=k(12);function K(n,y,f,c){var l=n-T(f,n),u=y-T(f,y);return m(Math.abs(l-u)-function(p,E,D){for(var L=0,C=p-T(D,p),A=E-T(D,E),P=0;P<Math.abs(C-A);P++){var U=w(p,E)==="A"?-1:1,N=D.buffer.lines.get(C+U*P);N&&N.isWrapped&&L++}return L}(n,y,f),O(w(n,y),c))}function T(n,y){for(var f=0,c=n.buffer.lines.get(y),l=c&&c.isWrapped;l&&y>=0&&y<n.rows;)f++,l=(c=n.buffer.lines.get(--y))&&c.isWrapped;return f}function w(n,y){return n>y?"A":"B"}function _(n,y,f,c,l,u){for(var p=n,E=y,D="";p!==f||E!==c;)p+=l?1:-1,l&&p>u.cols-1?(D+=u.buffer.translateBufferLineToString(E,!1,n,p),p=0,n=0,E++):!l&&p<0&&(D+=u.buffer.translateBufferLineToString(E,!1,0,n+1),n=p=u.cols-1,E--);return D+u.buffer.translateBufferLineToString(E,!1,n,p)}function O(n,y){var f=y?"O":"[";return I.C0.ESC+f+n}function m(n,y){n=Math.floor(n);for(var f="",c=0;c<n;c++)f+=y;return f}b.moveToCellSequence=function(n,y,f,c){var l,u=f.buffer.x,p=f.buffer.y;if(!f.buffer.hasScrollback)return function(D,L,C,A,P,U){return K(L,A,P,U).length===0?"":m(_(D,L,D,L-T(P,L),!1,P).length,O("D",U))}(u,p,0,y,f,c)+K(p,y,f,c)+function(D,L,C,A,P,U){var N;N=K(L,A,P,U).length>0?A-T(P,A):L;var $=A,F=function(q,V,ne,oe,J,z){var X;return X=K(ne,oe,J,z).length>0?oe-T(J,oe):V,q<ne&&X<=oe||q>=ne&&X<oe?"C":"D"}(D,L,C,A,P,U);return m(_(D,N,C,$,F==="C",P).length,O(F,U))}(u,p,n,y,f,c);if(p===y)return l=u>n?"D":"C",m(Math.abs(u-n),O(l,c));l=p>y?"D":"C";var E=Math.abs(p-y);return m(function(D,L){return L.cols-D}(p>y?n:u,f)+(E-1)*f.cols+1+((p>y?u:n)-1),O(l,c))}},function(me,b,k){"use strict";var I=this&&this.__decorate||function(_,O,m,n){var y,f=arguments.length,c=f<3?O:n===null?n=Object.getOwnPropertyDescriptor(O,m):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(_,O,m,n);else for(var l=_.length-1;l>=0;l--)(y=_[l])&&(c=(f<3?y(c):f>3?y(O,m,c):y(O,m))||c);return f>3&&c&&Object.defineProperty(O,m,c),c},K=this&&this.__param||function(_,O){return function(m,n){O(m,n,_)}};Object.defineProperty(b,"__esModule",{value:!0}),b.SoundService=void 0;var T=k(1),w=function(){function _(O){this._optionsService=O}return Object.defineProperty(_,"audioContext",{get:function(){if(!_._audioContext){var O=window.AudioContext||window.webkitAudioContext;if(!O)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;_._audioContext=new O}return _._audioContext},enumerable:!1,configurable:!0}),_.prototype.playBellSound=function(){var O=_.audioContext;if(O){var m=O.createBufferSource();O.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(n){m.buffer=n,m.connect(O.destination),m.start(0)})}},_.prototype._base64ToArrayBuffer=function(O){for(var m=window.atob(O),n=m.length,y=new Uint8Array(n),f=0;f<n;f++)y[f]=m.charCodeAt(f);return y.buffer},_.prototype._removeMimeType=function(O){return O.split(",")[1]},_=I([K(0,T.IOptionsService)],_)}();b.SoundService=w},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(f,c){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var p in u)u.hasOwnProperty(p)&&(l[p]=u[p])})(f,c)},function(f,c){function l(){this.constructor=f}I(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)}),T=this&&this.__decorate||function(f,c,l,u){var p,E=arguments.length,D=E<3?c:u===null?u=Object.getOwnPropertyDescriptor(c,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(f,c,l,u);else for(var L=f.length-1;L>=0;L--)(p=f[L])&&(D=(E<3?p(D):E>3?p(c,l,D):p(c,l))||D);return E>3&&D&&Object.defineProperty(c,l,D),D},w=this&&this.__param||function(f,c){return function(l,u){c(l,u,f)}};Object.defineProperty(b,"__esModule",{value:!0}),b.MouseZoneManager=void 0;var _=k(2),O=k(7),m=k(5),n=k(1),y=function(f){function c(l,u,p,E,D,L){var C=f.call(this)||this;return C._element=l,C._screenElement=u,C._bufferService=p,C._mouseService=E,C._selectionService=D,C._optionsService=L,C._zones=[],C._areZonesActive=!1,C._lastHoverCoords=[void 0,void 0],C._initialSelectionLength=0,C.register(O.addDisposableDomListener(C._element,"mousedown",function(A){return C._onMouseDown(A)})),C._mouseMoveListener=function(A){return C._onMouseMove(A)},C._mouseLeaveListener=function(A){return C._onMouseLeave(A)},C._clickListener=function(A){return C._onClick(A)},C}return K(c,f),c.prototype.dispose=function(){f.prototype.dispose.call(this),this._deactivate()},c.prototype.add=function(l){this._zones.push(l),this._zones.length===1&&this._activate()},c.prototype.clearAll=function(l,u){if(this._zones.length!==0){l&&u||(l=0,u=this._bufferService.rows-1);for(var p=0;p<this._zones.length;p++){var E=this._zones[p];(E.y1>l&&E.y1<=u+1||E.y2>l&&E.y2<=u+1||E.y1<l&&E.y2>u+1)&&(this._currentZone&&this._currentZone===E&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(p--,1))}this._zones.length===0&&this._deactivate()}},c.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},c.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},c.prototype._onMouseMove=function(l){this._lastHoverCoords[0]===l.pageX&&this._lastHoverCoords[1]===l.pageY||(this._onHover(l),this._lastHoverCoords=[l.pageX,l.pageY])},c.prototype._onHover=function(l){var u=this,p=this._findZoneEventAt(l);p!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),p&&(this._currentZone=p,p.hoverCallback&&p.hoverCallback(l),this._tooltipTimeout=window.setTimeout(function(){return u._onTooltip(l)},this._optionsService.options.linkTooltipHoverDuration)))},c.prototype._onTooltip=function(l){this._tooltipTimeout=void 0;var u=this._findZoneEventAt(l);u&&u.tooltipCallback&&u.tooltipCallback(l)},c.prototype._onMouseDown=function(l){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var u=this._findZoneEventAt(l);u!=null&&u.willLinkActivate(l)&&(l.preventDefault(),l.stopImmediatePropagation())}},c.prototype._onMouseLeave=function(l){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},c.prototype._onClick=function(l){var u=this._findZoneEventAt(l),p=this._getSelectionLength();u&&p===this._initialSelectionLength&&(u.clickCallback(l),l.preventDefault(),l.stopImmediatePropagation())},c.prototype._getSelectionLength=function(){var l=this._selectionService.selectionText;return l?l.length:0},c.prototype._findZoneEventAt=function(l){var u=this._mouseService.getCoords(l,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(u)for(var p=u[0],E=u[1],D=0;D<this._zones.length;D++){var L=this._zones[D];if(L.y1===L.y2){if(E===L.y1&&p>=L.x1&&p<L.x2)return L}else if(E===L.y1&&p>=L.x1||E===L.y2&&p<L.x2||E>L.y1&&E<L.y2)return L}},c=T([w(2,n.IBufferService),w(3,m.IMouseService),w(4,m.ISelectionService),w(5,n.IOptionsService)],c)}(_.Disposable);b.MouseZoneManager=y},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(c,l){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var E in p)p.hasOwnProperty(E)&&(u[E]=p[E])})(c,l)},function(c,l){function u(){this.constructor=c}I(c,l),c.prototype=l===null?Object.create(l):(u.prototype=l.prototype,new u)});Object.defineProperty(b,"__esModule",{value:!0}),b.AccessibilityManager=void 0;var T=k(18),w=k(11),_=k(31),O=k(7),m=k(2),n=k(32),y=k(17),f=function(c){function l(u,p){var E=c.call(this)||this;E._terminal=u,E._renderService=p,E._liveRegionLineCount=0,E._charsToConsume=[],E._charsToAnnounce="",E._accessibilityTreeRoot=document.createElement("div"),E._accessibilityTreeRoot.classList.add("xterm-accessibility"),E._rowContainer=document.createElement("div"),E._rowContainer.classList.add("xterm-accessibility-tree"),E._rowContainer.setAttribute("role","list"),E._rowElements=[];for(var D=0;D<E._terminal.rows;D++)E._rowElements[D]=E._createAccessibilityTreeNode(),E._rowContainer.appendChild(E._rowElements[D]);if(E._topBoundaryFocusListener=function(L){return E._onBoundaryFocus(L,0)},E._bottomBoundaryFocusListener=function(L){return E._onBoundaryFocus(L,1)},E._rowElements[0].addEventListener("focus",E._topBoundaryFocusListener),E._rowElements[E._rowElements.length-1].addEventListener("focus",E._bottomBoundaryFocusListener),E._refreshRowsDimensions(),E._accessibilityTreeRoot.appendChild(E._rowContainer),E._renderRowsDebouncer=new _.RenderDebouncer(E._renderRows.bind(E)),E._refreshRows(),E._liveRegion=document.createElement("div"),E._liveRegion.classList.add("live-region"),E._liveRegion.setAttribute("aria-live","assertive"),E._accessibilityTreeRoot.appendChild(E._liveRegion),!E._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return E._terminal.element.insertAdjacentElement("afterbegin",E._accessibilityTreeRoot),E.register(E._renderRowsDebouncer),E.register(E._terminal.onResize(function(L){return E._onResize(L.rows)})),E.register(E._terminal.onRender(function(L){return E._refreshRows(L.start,L.end)})),E.register(E._terminal.onScroll(function(){return E._refreshRows()})),E.register(E._terminal.onA11yChar(function(L){return E._onChar(L)})),E.register(E._terminal.onLineFeed(function(){return E._onChar(`
|
|
|
`)})),E.register(E._terminal.onA11yTab(function(L){return E._onTab(L)})),E.register(E._terminal.onKey(function(L){return E._onKey(L.key)})),E.register(E._terminal.onBlur(function(){return E._clearLiveRegion()})),E.register(E._renderService.onDimensionsChange(function(){return E._refreshRowsDimensions()})),E._screenDprMonitor=new n.ScreenDprMonitor,E.register(E._screenDprMonitor),E._screenDprMonitor.setListener(function(){return E._refreshRowsDimensions()}),E.register(O.addDisposableDomListener(window,"resize",function(){return E._refreshRowsDimensions()})),E}return K(l,c),l.prototype.dispose=function(){c.prototype.dispose.call(this),y.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},l.prototype._onBoundaryFocus=function(u,p){var E=u.target,D=this._rowElements[p===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")!==(p===0?"1":""+this._terminal.buffer.lines.length)&&u.relatedTarget===D){var L,C;if(p===0?(L=E,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(L=this._rowElements.shift(),C=E,this._rowContainer.removeChild(L)),L.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),p===0){var A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else A=this._createAccessibilityTreeNode(),this._rowElements.push(A),this._rowContainer.appendChild(A);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(p===0?-1:1),this._rowElements[p===0?1:this._rowElements.length-2].focus(),u.preventDefault(),u.stopImmediatePropagation()}},l.prototype._onResize=function(u){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var p=this._rowContainer.children.length;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);for(;this._rowElements.length>u;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},l.prototype._createAccessibilityTreeNode=function(){var u=document.createElement("div");return u.setAttribute("role","listitem"),u.tabIndex=-1,this._refreshRowDimensions(u),u},l.prototype._onTab=function(u){for(var p=0;p<u;p++)this._onChar(" ")},l.prototype._onChar=function(u){var p=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==u&&(this._charsToAnnounce+=u):this._charsToAnnounce+=u,u===`
|
|
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=T.tooMuchOutput)),w.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){p._accessibilityTreeRoot.appendChild(p._liveRegion)},0))},l.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,w.isMac&&y.removeElementFromParent(this._liveRegion)},l.prototype._onKey=function(u){this._clearLiveRegion(),this._charsToConsume.push(u)},l.prototype._refreshRows=function(u,p){this._renderRowsDebouncer.refresh(u,p,this._terminal.rows)},l.prototype._renderRows=function(u,p){for(var E=this._terminal.buffer,D=E.lines.length.toString(),L=u;L<=p;L++){var C=E.translateBufferLineToString(E.ydisp+L,!0),A=(E.ydisp+L+1).toString(),P=this._rowElements[L];P&&(C.length===0?P.innerHTML=" ":P.textContent=C,P.setAttribute("aria-posinset",A),P.setAttribute("aria-setsize",D))}this._announceCharacters()},l.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var u=0;u<this._terminal.rows;u++)this._refreshRowDimensions(this._rowElements[u])}},l.prototype._refreshRowDimensions=function(u){u.style.height=this._renderService.dimensions.actualCellHeight+"px"},l.prototype._announceCharacters=function(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},l}(m.Disposable);b.AccessibilityManager=f},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(E,D){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,C){L.__proto__=C}||function(L,C){for(var A in C)C.hasOwnProperty(A)&&(L[A]=C[A])})(E,D)},function(E,D){function L(){this.constructor=E}I(E,D),E.prototype=D===null?Object.create(D):(L.prototype=D.prototype,new L)}),T=this&&this.__decorate||function(E,D,L,C){var A,P=arguments.length,U=P<3?D:C===null?C=Object.getOwnPropertyDescriptor(D,L):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(E,D,L,C);else for(var N=E.length-1;N>=0;N--)(A=E[N])&&(U=(P<3?A(U):P>3?A(D,L,U):A(D,L))||U);return P>3&&U&&Object.defineProperty(D,L,U),U},w=this&&this.__param||function(E,D){return function(L,C){D(L,C,E)}};Object.defineProperty(b,"__esModule",{value:!0}),b.DomRenderer=void 0;var _=k(58),O=k(9),m=k(2),n=k(5),y=k(1),f=k(0),c=k(10),l=k(17),u=1,p=function(E){function D(L,C,A,P,U,N,$,F,q){var V=E.call(this)||this;return V._colors=L,V._element=C,V._screenElement=A,V._viewportElement=P,V._linkifier=U,V._linkifier2=N,V._charSizeService=$,V._optionsService=F,V._bufferService=q,V._terminalClass=u++,V._rowElements=[],V._rowContainer=document.createElement("div"),V._rowContainer.classList.add("xterm-rows"),V._rowContainer.style.lineHeight="normal",V._rowContainer.setAttribute("aria-hidden","true"),V._refreshRowElements(V._bufferService.cols,V._bufferService.rows),V._selectionContainer=document.createElement("div"),V._selectionContainer.classList.add("xterm-selection"),V._selectionContainer.setAttribute("aria-hidden","true"),V.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},V._updateDimensions(),V._injectCss(),V._rowFactory=new _.DomRendererRowFactory(document,V._optionsService,V._colors),V._element.classList.add("xterm-dom-renderer-owner-"+V._terminalClass),V._screenElement.appendChild(V._rowContainer),V._screenElement.appendChild(V._selectionContainer),V._linkifier.onShowLinkUnderline(function(ne){return V._onLinkHover(ne)}),V._linkifier.onHideLinkUnderline(function(ne){return V._onLinkLeave(ne)}),V._linkifier2.onShowLinkUnderline(function(ne){return V._onLinkHover(ne)}),V._linkifier2.onHideLinkUnderline(function(ne){return V._onLinkLeave(ne)}),V}return K(D,E),Object.defineProperty(D.prototype,"onRequestRedraw",{get:function(){return new f.EventEmitter().event},enumerable:!1,configurable:!0}),D.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),l.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),E.prototype.dispose.call(this)},D.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var L=0,C=this._rowElements;L<C.length;L++){var A=C[L];A.style.width=this.dimensions.canvasWidth+"px",A.style.height=this.dimensions.actualCellHeight+"px",A.style.lineHeight=this.dimensions.actualCellHeight+"px",A.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var P=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=P,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},D.prototype.setColors=function(L){this._colors=L,this._injectCss()},D.prototype._injectCss=function(){var L=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var C=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";C+=this._terminalSelector+" span:not(."+_.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+_.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+_.ITALIC_CLASS+" { font-style: italic;}",C+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",C+="@keyframes blink_block_"+this._terminalClass+" { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}",C+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+_.CURSOR_CLASS+"."+_.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+_.CURSOR_CLASS+"."+_.CURSOR_BLINK_CLASS+":not(."+_.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+_.CURSOR_CLASS+"."+_.CURSOR_BLINK_CLASS+"."+_.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+_.CURSOR_CLASS+"."+_.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+_.CURSOR_CLASS+"."+_.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+_.CURSOR_CLASS+"."+_.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",C+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" .xterm-selection div { position: absolute; background-color: "+this._colors.selectionTransparent.css+";}",this._colors.ansi.forEach(function(A,P){C+=L._terminalSelector+" .xterm-fg-"+P+" { color: "+A.css+"; }"+L._terminalSelector+" .xterm-bg-"+P+" { background-color: "+A.css+"; }"}),C+=this._terminalSelector+" .xterm-fg-"+O.INVERTED_DEFAULT_COLOR+" { color: "+c.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+O.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=C},D.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},D.prototype._refreshRowElements=function(L,C){for(var A=this._rowElements.length;A<=C;A++){var P=document.createElement("div");this._rowContainer.appendChild(P),this._rowElements.push(P)}for(;this._rowElements.length>C;)this._rowContainer.removeChild(this._rowElements.pop())},D.prototype.onResize=function(L,C){this._refreshRowElements(L,C),this._updateDimensions()},D.prototype.onCharSizeChanged=function(){this._updateDimensions()},D.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},D.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},D.prototype.onSelectionChanged=function(L,C,A){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(L&&C){var P=L[1]-this._bufferService.buffer.ydisp,U=C[1]-this._bufferService.buffer.ydisp,N=Math.max(P,0),$=Math.min(U,this._bufferService.rows-1);if(!(N>=this._bufferService.rows||$<0)){var F=document.createDocumentFragment();if(A)F.appendChild(this._createSelectionElement(N,L[0],C[0],$-N+1));else{var q=P===N?L[0]:0,V=N===$?C[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(N,q,V));var ne=$-N-1;if(F.appendChild(this._createSelectionElement(N+1,0,this._bufferService.cols,ne)),N!==$){var oe=U===$?C[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement($,0,oe))}}this._selectionContainer.appendChild(F)}}},D.prototype._createSelectionElement=function(L,C,A,P){P===void 0&&(P=1);var U=document.createElement("div");return U.style.height=P*this.dimensions.actualCellHeight+"px",U.style.top=L*this.dimensions.actualCellHeight+"px",U.style.left=C*this.dimensions.actualCellWidth+"px",U.style.width=this.dimensions.actualCellWidth*(A-C)+"px",U},D.prototype.onCursorMove=function(){},D.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},D.prototype.clear=function(){for(var L=0,C=this._rowElements;L<C.length;L++)C[L].innerHTML=""},D.prototype.renderRows=function(L,C){for(var A=this._bufferService.buffer.ybase+this._bufferService.buffer.y,P=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),U=this._optionsService.options.cursorBlink,N=L;N<=C;N++){var $=this._rowElements[N];$.innerHTML="";var F=N+this._bufferService.buffer.ydisp,q=this._bufferService.buffer.lines.get(F),V=this._optionsService.options.cursorStyle;$.appendChild(this._rowFactory.createRow(q,F===A,V,P,U,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(D.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),D.prototype.registerCharacterJoiner=function(L){return-1},D.prototype.deregisterCharacterJoiner=function(L){return!1},D.prototype._onLinkHover=function(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!0)},D.prototype._onLinkLeave=function(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!1)},D.prototype._setCellUnderline=function(L,C,A,P,U,N){for(;L!==C||A!==P;){var $=this._rowElements[A];if(!$)return;var F=$.children[L];F&&(F.style.textDecoration=N?"underline":"none"),++L>=U&&(L=0,A++)}},D=T([w(6,n.ICharSizeService),w(7,y.IOptionsService),w(8,y.IBufferService)],D)}(m.Disposable);b.DomRenderer=p},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.DomRendererRowFactory=b.CURSOR_STYLE_UNDERLINE_CLASS=b.CURSOR_STYLE_BAR_CLASS=b.CURSOR_STYLE_BLOCK_CLASS=b.CURSOR_BLINK_CLASS=b.CURSOR_CLASS=b.UNDERLINE_CLASS=b.ITALIC_CLASS=b.DIM_CLASS=b.BOLD_CLASS=void 0;var I=k(9),K=k(3),T=k(4),w=k(10);b.BOLD_CLASS="xterm-bold",b.DIM_CLASS="xterm-dim",b.ITALIC_CLASS="xterm-italic",b.UNDERLINE_CLASS="xterm-underline",b.CURSOR_CLASS="xterm-cursor",b.CURSOR_BLINK_CLASS="xterm-cursor-blink",b.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",b.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",b.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var _=function(){function m(n,y,f){this._document=n,this._optionsService=y,this._colors=f,this._workCell=new T.CellData}return m.prototype.setColors=function(n){this._colors=n},m.prototype.createRow=function(n,y,f,c,l,u,p){for(var E=this._document.createDocumentFragment(),D=0,L=Math.min(n.length,p)-1;L>=0;L--)if(n.loadCell(L,this._workCell).getCode()!==K.NULL_CELL_CODE||y&&L===c){D=L+1;break}for(L=0;L<D;L++){n.loadCell(L,this._workCell);var C=this._workCell.getWidth();if(C!==0){var A=this._document.createElement("span");if(C>1&&(A.style.width=u*C+"px"),y&&L===c)switch(A.classList.add(b.CURSOR_CLASS),l&&A.classList.add(b.CURSOR_BLINK_CLASS),f){case"bar":A.classList.add(b.CURSOR_STYLE_BAR_CLASS);break;case"underline":A.classList.add(b.CURSOR_STYLE_UNDERLINE_CLASS);break;default:A.classList.add(b.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&A.classList.add(b.BOLD_CLASS),this._workCell.isItalic()&&A.classList.add(b.ITALIC_CLASS),this._workCell.isDim()&&A.classList.add(b.DIM_CLASS),this._workCell.isUnderline()&&A.classList.add(b.UNDERLINE_CLASS),this._workCell.isInvisible()?A.textContent=K.WHITESPACE_CELL_CHAR:A.textContent=this._workCell.getChars()||K.WHITESPACE_CELL_CHAR;var P=this._workCell.getFgColor(),U=this._workCell.getFgColorMode(),N=this._workCell.getBgColor(),$=this._workCell.getBgColorMode(),F=!!this._workCell.isInverse();if(F){var q=P;P=N,N=q;var V=U;U=$,$=V}switch(U){case 16777216:case 33554432:this._workCell.isBold()&&P<8&&this._optionsService.options.drawBoldTextInBrightColors&&(P+=8),this._applyMinimumContrast(A,this._colors.background,this._colors.ansi[P])||A.classList.add("xterm-fg-"+P);break;case 50331648:var ne=w.rgba.toColor(P>>16&255,P>>8&255,255&P);this._applyMinimumContrast(A,this._colors.background,ne)||this._addStyle(A,"color:#"+O(P.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(A,this._colors.background,this._colors.foreground)||F&&A.classList.add("xterm-fg-"+I.INVERTED_DEFAULT_COLOR)}switch($){case 16777216:case 33554432:A.classList.add("xterm-bg-"+N);break;case 50331648:this._addStyle(A,"background-color:#"+O(N.toString(16),"0",6));break;case 0:default:F&&A.classList.add("xterm-bg-"+I.INVERTED_DEFAULT_COLOR)}E.appendChild(A)}}return E},m.prototype._applyMinimumContrast=function(n,y,f){if(this._optionsService.options.minimumContrastRatio===1)return!1;var c=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return c===void 0&&(c=w.color.ensureContrastRatio(y,f,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,c!=null?c:null)),!!c&&(this._addStyle(n,"color:"+c.css),!0)},m.prototype._addStyle=function(n,y){n.setAttribute("style",""+(n.getAttribute("style")||"")+y+";")},m}();function O(m,n,y){for(;m.length<y;)m=n+m;return m}b.DomRendererRowFactory=_},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.evaluateKeyboardEvent=void 0;var I=k(12),K={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};b.evaluateKeyboardEvent=function(T,w,_,O){var m={type:0,cancel:!1,key:void 0},n=(T.shiftKey?1:0)|(T.altKey?2:0)|(T.ctrlKey?4:0)|(T.metaKey?8:0);switch(T.keyCode){case 0:T.key==="UIKeyInputUpArrow"?m.key=w?I.C0.ESC+"OA":I.C0.ESC+"[A":T.key==="UIKeyInputLeftArrow"?m.key=w?I.C0.ESC+"OD":I.C0.ESC+"[D":T.key==="UIKeyInputRightArrow"?m.key=w?I.C0.ESC+"OC":I.C0.ESC+"[C":T.key==="UIKeyInputDownArrow"&&(m.key=w?I.C0.ESC+"OB":I.C0.ESC+"[B");break;case 8:if(T.shiftKey){m.key=I.C0.BS;break}if(T.altKey){m.key=I.C0.ESC+I.C0.DEL;break}m.key=I.C0.DEL;break;case 9:if(T.shiftKey){m.key=I.C0.ESC+"[Z";break}m.key=I.C0.HT,m.cancel=!0;break;case 13:m.key=T.altKey?I.C0.ESC+I.C0.CR:I.C0.CR,m.cancel=!0;break;case 27:m.key=I.C0.ESC,T.altKey&&(m.key=I.C0.ESC+I.C0.ESC),m.cancel=!0;break;case 37:if(T.metaKey)break;n?(m.key=I.C0.ESC+"[1;"+(n+1)+"D",m.key===I.C0.ESC+"[1;3D"&&(m.key=I.C0.ESC+(_?"b":"[1;5D"))):m.key=w?I.C0.ESC+"OD":I.C0.ESC+"[D";break;case 39:if(T.metaKey)break;n?(m.key=I.C0.ESC+"[1;"+(n+1)+"C",m.key===I.C0.ESC+"[1;3C"&&(m.key=I.C0.ESC+(_?"f":"[1;5C"))):m.key=w?I.C0.ESC+"OC":I.C0.ESC+"[C";break;case 38:if(T.metaKey)break;n?(m.key=I.C0.ESC+"[1;"+(n+1)+"A",_||m.key!==I.C0.ESC+"[1;3A"||(m.key=I.C0.ESC+"[1;5A")):m.key=w?I.C0.ESC+"OA":I.C0.ESC+"[A";break;case 40:if(T.metaKey)break;n?(m.key=I.C0.ESC+"[1;"+(n+1)+"B",_||m.key!==I.C0.ESC+"[1;3B"||(m.key=I.C0.ESC+"[1;5B")):m.key=w?I.C0.ESC+"OB":I.C0.ESC+"[B";break;case 45:T.shiftKey||T.ctrlKey||(m.key=I.C0.ESC+"[2~");break;case 46:m.key=n?I.C0.ESC+"[3;"+(n+1)+"~":I.C0.ESC+"[3~";break;case 36:m.key=n?I.C0.ESC+"[1;"+(n+1)+"H":w?I.C0.ESC+"OH":I.C0.ESC+"[H";break;case 35:m.key=n?I.C0.ESC+"[1;"+(n+1)+"F":w?I.C0.ESC+"OF":I.C0.ESC+"[F";break;case 33:T.shiftKey?m.type=2:m.key=I.C0.ESC+"[5~";break;case 34:T.shiftKey?m.type=3:m.key=I.C0.ESC+"[6~";break;case 112:m.key=n?I.C0.ESC+"[1;"+(n+1)+"P":I.C0.ESC+"OP";break;case 113:m.key=n?I.C0.ESC+"[1;"+(n+1)+"Q":I.C0.ESC+"OQ";break;case 114:m.key=n?I.C0.ESC+"[1;"+(n+1)+"R":I.C0.ESC+"OR";break;case 115:m.key=n?I.C0.ESC+"[1;"+(n+1)+"S":I.C0.ESC+"OS";break;case 116:m.key=n?I.C0.ESC+"[15;"+(n+1)+"~":I.C0.ESC+"[15~";break;case 117:m.key=n?I.C0.ESC+"[17;"+(n+1)+"~":I.C0.ESC+"[17~";break;case 118:m.key=n?I.C0.ESC+"[18;"+(n+1)+"~":I.C0.ESC+"[18~";break;case 119:m.key=n?I.C0.ESC+"[19;"+(n+1)+"~":I.C0.ESC+"[19~";break;case 120:m.key=n?I.C0.ESC+"[20;"+(n+1)+"~":I.C0.ESC+"[20~";break;case 121:m.key=n?I.C0.ESC+"[21;"+(n+1)+"~":I.C0.ESC+"[21~";break;case 122:m.key=n?I.C0.ESC+"[23;"+(n+1)+"~":I.C0.ESC+"[23~";break;case 123:m.key=n?I.C0.ESC+"[24;"+(n+1)+"~":I.C0.ESC+"[24~";break;default:if(!T.ctrlKey||T.shiftKey||T.altKey||T.metaKey)if(_&&!O||!T.altKey||T.metaKey)_&&!T.altKey&&!T.ctrlKey&&T.metaKey?T.keyCode===65&&(m.type=1):T.key&&!T.ctrlKey&&!T.altKey&&!T.metaKey&&T.keyCode>=48&&T.key.length===1?m.key=T.key:T.key&&T.ctrlKey&&T.key==="_"&&(m.key=I.C0.US);else{var y=K[T.keyCode],f=y&&y[T.shiftKey?1:0];if(f)m.key=I.C0.ESC+f;else if(T.keyCode>=65&&T.keyCode<=90){var c=T.ctrlKey?T.keyCode-64:T.keyCode+32;m.key=I.C0.ESC+String.fromCharCode(c)}}else T.keyCode>=65&&T.keyCode<=90?m.key=String.fromCharCode(T.keyCode-64):T.keyCode===32?m.key=I.C0.NUL:T.keyCode>=51&&T.keyCode<=55?m.key=String.fromCharCode(T.keyCode-51+27):T.keyCode===56?m.key=I.C0.DEL:T.keyCode===219?m.key=I.C0.ESC:T.keyCode===220?m.key=I.C0.FS:T.keyCode===221&&(m.key=I.C0.GS)}return m}},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(u,p){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,D){E.__proto__=D}||function(E,D){for(var L in D)D.hasOwnProperty(L)&&(E[L]=D[L])})(u,p)},function(u,p){function E(){this.constructor=u}I(u,p),u.prototype=p===null?Object.create(p):(E.prototype=p.prototype,new E)}),T=this&&this.__decorate||function(u,p,E,D){var L,C=arguments.length,A=C<3?p:D===null?D=Object.getOwnPropertyDescriptor(p,E):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(u,p,E,D);else for(var P=u.length-1;P>=0;P--)(L=u[P])&&(A=(C<3?L(A):C>3?L(p,E,A):L(p,E))||A);return C>3&&A&&Object.defineProperty(p,E,A),A},w=this&&this.__param||function(u,p){return function(E,D){p(E,D,u)}};Object.defineProperty(b,"__esModule",{value:!0}),b.RenderService=void 0;var _=k(31),O=k(0),m=k(2),n=k(32),y=k(7),f=k(1),c=k(5),l=function(u){function p(E,D,L,C,A,P){var U=u.call(this)||this;if(U._renderer=E,U._rowCount=D,U._isPaused=!1,U._needsFullRefresh=!1,U._isNextRenderRedrawOnly=!0,U._needsSelectionRefresh=!1,U._canvasWidth=0,U._canvasHeight=0,U._selectionState={start:void 0,end:void 0,columnSelectMode:!1},U._onDimensionsChange=new O.EventEmitter,U._onRender=new O.EventEmitter,U._onRefreshRequest=new O.EventEmitter,U.register({dispose:function(){return U._renderer.dispose()}}),U._renderDebouncer=new _.RenderDebouncer(function($,F){return U._renderRows($,F)}),U.register(U._renderDebouncer),U._screenDprMonitor=new n.ScreenDprMonitor,U._screenDprMonitor.setListener(function(){return U.onDevicePixelRatioChange()}),U.register(U._screenDprMonitor),U.register(P.onResize(function($){return U._fullRefresh()})),U.register(C.onOptionChange(function(){return U._renderer.onOptionsChanged()})),U.register(A.onCharSizeChange(function(){return U.onCharSizeChanged()})),U._renderer.onRequestRedraw(function($){return U.refreshRows($.start,$.end,!0)}),U.register(y.addDisposableDomListener(window,"resize",function(){return U.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var N=new IntersectionObserver(function($){return U._onIntersectionChange($[$.length-1])},{threshold:0});N.observe(L),U.register({dispose:function(){return N.disconnect()}})}return U}return K(p,u),Object.defineProperty(p.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),p.prototype._onIntersectionChange=function(E){this._isPaused=E.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},p.prototype.refreshRows=function(E,D,L){L===void 0&&(L=!1),this._isPaused?this._needsFullRefresh=!0:(L||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(E,D,this._rowCount))},p.prototype._renderRows=function(E,D){this._renderer.renderRows(E,D),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:E,end:D}),this._isNextRenderRedrawOnly=!0},p.prototype.resize=function(E,D){this._rowCount=D,this._fireOnCanvasResize()},p.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},p.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},p.prototype.dispose=function(){u.prototype.dispose.call(this)},p.prototype.setRenderer=function(E){var D=this;this._renderer.dispose(),this._renderer=E,this._renderer.onRequestRedraw(function(L){return D.refreshRows(L.start,L.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},p.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},p.prototype.setColors=function(E){this._renderer.setColors(E),this._fullRefresh()},p.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},p.prototype.onResize=function(E,D){this._renderer.onResize(E,D),this._fullRefresh()},p.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},p.prototype.onBlur=function(){this._renderer.onBlur()},p.prototype.onFocus=function(){this._renderer.onFocus()},p.prototype.onSelectionChanged=function(E,D,L){this._selectionState.start=E,this._selectionState.end=D,this._selectionState.columnSelectMode=L,this._renderer.onSelectionChanged(E,D,L)},p.prototype.onCursorMove=function(){this._renderer.onCursorMove()},p.prototype.clear=function(){this._renderer.clear()},p.prototype.registerCharacterJoiner=function(E){return this._renderer.registerCharacterJoiner(E)},p.prototype.deregisterCharacterJoiner=function(E){return this._renderer.deregisterCharacterJoiner(E)},p=T([w(3,f.IOptionsService),w(4,c.ICharSizeService),w(5,f.IBufferService)],p)}(m.Disposable);b.RenderService=l},function(me,b,k){"use strict";var I=this&&this.__decorate||function(m,n,y,f){var c,l=arguments.length,u=l<3?n:f===null?f=Object.getOwnPropertyDescriptor(n,y):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(m,n,y,f);else for(var p=m.length-1;p>=0;p--)(c=m[p])&&(u=(l<3?c(u):l>3?c(n,y,u):c(n,y))||u);return l>3&&u&&Object.defineProperty(n,y,u),u},K=this&&this.__param||function(m,n){return function(y,f){n(y,f,m)}};Object.defineProperty(b,"__esModule",{value:!0}),b.CharSizeService=void 0;var T=k(1),w=k(0),_=function(){function m(n,y,f){this._optionsService=f,this.width=0,this.height=0,this._onCharSizeChange=new w.EventEmitter,this._measureStrategy=new O(n,y,this._optionsService)}return Object.defineProperty(m.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),m.prototype.measure=function(){var n=this._measureStrategy.measure();n.width===this.width&&n.height===this.height||(this.width=n.width,this.height=n.height,this._onCharSizeChange.fire())},m=I([K(2,T.IOptionsService)],m)}();b.CharSizeService=_;var O=function(){function m(n,y,f){this._document=n,this._parentElement=y,this._optionsService=f,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return m.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var n=this._measureElement.getBoundingClientRect();return n.width!==0&&n.height!==0&&(this._result.width=n.width,this._result.height=Math.ceil(n.height)),this._result},m}()},function(me,b,k){"use strict";var I=this&&this.__decorate||function(O,m,n,y){var f,c=arguments.length,l=c<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,n):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(O,m,n,y);else for(var u=O.length-1;u>=0;u--)(f=O[u])&&(l=(c<3?f(l):c>3?f(m,n,l):f(m,n))||l);return c>3&&l&&Object.defineProperty(m,n,l),l},K=this&&this.__param||function(O,m){return function(n,y){m(n,y,O)}};Object.defineProperty(b,"__esModule",{value:!0}),b.MouseService=void 0;var T=k(5),w=k(30),_=function(){function O(m,n){this._renderService=m,this._charSizeService=n}return O.prototype.getCoords=function(m,n,y,f,c){return w.getCoords(m,n,y,f,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,c)},O.prototype.getRawByteCoords=function(m,n,y,f){var c=this.getCoords(m,n,y,f);return w.getRawByteCoords(c)},O=I([K(0,T.IRenderService),K(1,T.ICharSizeService)],O)}();b.MouseService=_},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(f,c){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var p in u)u.hasOwnProperty(p)&&(l[p]=u[p])})(f,c)},function(f,c){function l(){this.constructor=f}I(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)}),T=this&&this.__decorate||function(f,c,l,u){var p,E=arguments.length,D=E<3?c:u===null?u=Object.getOwnPropertyDescriptor(c,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(f,c,l,u);else for(var L=f.length-1;L>=0;L--)(p=f[L])&&(D=(E<3?p(D):E>3?p(c,l,D):p(c,l))||D);return E>3&&D&&Object.defineProperty(c,l,D),D},w=this&&this.__param||function(f,c){return function(l,u){c(l,u,f)}};Object.defineProperty(b,"__esModule",{value:!0}),b.Linkifier2=void 0;var _=k(1),O=k(0),m=k(2),n=k(7),y=function(f){function c(l){var u=f.call(this)||this;return u._bufferService=l,u._linkProviders=[],u._linkCacheDisposables=[],u._isMouseOut=!0,u._activeLine=-1,u._onShowLinkUnderline=u.register(new O.EventEmitter),u._onHideLinkUnderline=u.register(new O.EventEmitter),u.register(m.getDisposeArrayDisposable(u._linkCacheDisposables)),u}return K(c,f),Object.defineProperty(c.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),c.prototype.registerLinkProvider=function(l){var u=this;return this._linkProviders.push(l),{dispose:function(){var p=u._linkProviders.indexOf(l);p!==-1&&u._linkProviders.splice(p,1)}}},c.prototype.attachToDom=function(l,u,p){var E=this;this._element=l,this._mouseService=u,this._renderService=p,this.register(n.addDisposableDomListener(this._element,"mouseleave",function(){E._isMouseOut=!0,E._clearCurrentLink()})),this.register(n.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(n.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},c.prototype._onMouseMove=function(l){if(this._lastMouseEvent=l,this._element&&this._mouseService){var u=this._positionFromMouseEvent(l,this._element,this._mouseService);if(u){this._isMouseOut=!1;for(var p=l.composedPath(),E=0;E<p.length;E++){var D=p[E];if(D.classList.contains("xterm"))break;if(D.classList.contains("xterm-hover"))return}this._lastBufferCell&&u.x===this._lastBufferCell.x&&u.y===this._lastBufferCell.y||(this._onHover(u),this._lastBufferCell=u)}}},c.prototype._onHover=function(l){if(this._activeLine!==l.y)return this._clearCurrentLink(),void this._askForLink(l,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,l)||(this._clearCurrentLink(),this._askForLink(l,!0))},c.prototype._askForLink=function(l,u){var p=this;this._activeProviderReplies&&u||(this._activeProviderReplies=new Map,this._activeLine=l.y);var E=!1;this._linkProviders.forEach(function(D,L){var C;u?!((C=p._activeProviderReplies)===null||C===void 0)&&C.get(L)&&(E=p._checkLinkProviderResult(L,l,E)):D.provideLinks(l.y,function(A){var P,U;if(!p._isMouseOut){var N=A==null?void 0:A.map(function($){return{link:$}});(P=p._activeProviderReplies)===null||P===void 0||P.set(L,N),E=p._checkLinkProviderResult(L,l,E),((U=p._activeProviderReplies)===null||U===void 0?void 0:U.size)===p._linkProviders.length&&p._removeIntersectingLinks(l.y,p._activeProviderReplies)}})})},c.prototype._removeIntersectingLinks=function(l,u){for(var p=new Set,E=0;E<u.size;E++){var D=u.get(E);if(D)for(var L=0;L<D.length;L++)for(var C=D[L],A=C.link.range.start.y<l?0:C.link.range.start.x,P=C.link.range.end.y>l?this._bufferService.cols:C.link.range.end.x,U=A;U<=P;U++){if(p.has(U)){D.splice(L--,1);break}p.add(U)}}},c.prototype._checkLinkProviderResult=function(l,u,p){var E,D=this;if(!this._activeProviderReplies)return p;for(var L=this._activeProviderReplies.get(l),C=!1,A=0;A<l;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(C=!0);if(!C&&L){var P=L.find(function(N){return D._linkAtPosition(N.link,u)});P&&(p=!0,this._handleNewLink(P))}if(this._activeProviderReplies.size===this._linkProviders.length&&!p)for(A=0;A<this._activeProviderReplies.size;A++){var U=(E=this._activeProviderReplies.get(A))===null||E===void 0?void 0:E.find(function(N){return D._linkAtPosition(N.link,u)});if(U){p=!0,this._handleNewLink(U);break}}return p},c.prototype._onClick=function(l){if(this._element&&this._mouseService&&this._currentLink){var u=this._positionFromMouseEvent(l,this._element,this._mouseService);u&&this._linkAtPosition(this._currentLink.link,u)&&this._currentLink.link.activate(l,this._currentLink.link.text)}},c.prototype._clearCurrentLink=function(l,u){this._element&&this._currentLink&&this._lastMouseEvent&&(!l||!u||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=u)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,m.disposeArray(this._linkCacheDisposables))},c.prototype._handleNewLink=function(l){var u=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(l.link,p)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:function(){var E,D;return(D=(E=u._currentLink)===null||E===void 0?void 0:E.state)===null||D===void 0?void 0:D.decorations.pointerCursor},set:function(E){var D,L;!((D=u._currentLink)===null||D===void 0)&&D.state&&u._currentLink.state.decorations.pointerCursor!==E&&(u._currentLink.state.decorations.pointerCursor=E,u._currentLink.state.isHovered&&((L=u._element)===null||L===void 0||L.classList.toggle("xterm-cursor-pointer",E)))}},underline:{get:function(){var E,D;return(D=(E=u._currentLink)===null||E===void 0?void 0:E.state)===null||D===void 0?void 0:D.decorations.underline},set:function(E){var D,L,C;!((D=u._currentLink)===null||D===void 0)&&D.state&&((C=(L=u._currentLink)===null||L===void 0?void 0:L.state)===null||C===void 0?void 0:C.decorations.underline)!==E&&(u._currentLink.state.decorations.underline=E,u._currentLink.state.isHovered&&u._fireUnderlineEvent(l.link,E))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(E){var D=E.start===0?0:E.start+1+u._bufferService.buffer.ydisp;u._clearCurrentLink(D,E.end+1+u._bufferService.buffer.ydisp)})))}},c.prototype._linkHover=function(l,u,p){var E;!((E=this._currentLink)===null||E===void 0)&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),u.hover&&u.hover(p,u.text)},c.prototype._fireUnderlineEvent=function(l,u){var p=l.range,E=this._bufferService.buffer.ydisp,D=this._createLinkUnderlineEvent(p.start.x-1,p.start.y-E-1,p.end.x,p.end.y-E-1,void 0);(u?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(D)},c.prototype._linkLeave=function(l,u,p){var E;!((E=this._currentLink)===null||E===void 0)&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),u.leave&&u.leave(p,u.text)},c.prototype._linkAtPosition=function(l,u){var p=l.range.start.y===l.range.end.y,E=l.range.start.y<u.y,D=l.range.end.y>u.y;return(p&&l.range.start.x<=u.x&&l.range.end.x>=u.x||E&&l.range.end.x>=u.x||D&&l.range.start.x<=u.x||E&&D)&&l.range.start.y<=u.y&&l.range.end.y>=u.y},c.prototype._positionFromMouseEvent=function(l,u,p){var E=p.getCoords(l,u,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}},c.prototype._createLinkUnderlineEvent=function(l,u,p,E,D){return{x1:l,y1:u,x2:p,y2:E,cols:this._bufferService.cols,fg:D}},c=T([w(0,_.IBufferService)],c)}(m.Disposable);b.Linkifier2=y},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CoreBrowserService=void 0;var I=function(){function K(T){this._textarea=T}return Object.defineProperty(K.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),K}();b.CoreBrowserService=I},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(A,P){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,N){U.__proto__=N}||function(U,N){for(var $ in N)N.hasOwnProperty($)&&(U[$]=N[$])})(A,P)},function(A,P){function U(){this.constructor=A}I(A,P),A.prototype=P===null?Object.create(P):(U.prototype=P.prototype,new U)});Object.defineProperty(b,"__esModule",{value:!0}),b.CoreTerminal=void 0;var T=k(2),w=k(1),_=k(66),O=k(67),m=k(68),n=k(74),y=k(75),f=k(0),c=k(76),l=k(77),u=k(78),p=k(80),E=k(81),D=k(19),L=k(82),C=function(A){function P(U){var N=A.call(this)||this;return N._onBinary=new f.EventEmitter,N._onData=new f.EventEmitter,N._onLineFeed=new f.EventEmitter,N._onResize=new f.EventEmitter,N._onScroll=new f.EventEmitter,N._instantiationService=new _.InstantiationService,N.optionsService=new n.OptionsService(U),N._instantiationService.setService(w.IOptionsService,N.optionsService),N._bufferService=N.register(N._instantiationService.createInstance(m.BufferService)),N._instantiationService.setService(w.IBufferService,N._bufferService),N._logService=N._instantiationService.createInstance(O.LogService),N._instantiationService.setService(w.ILogService,N._logService),N._coreService=N.register(N._instantiationService.createInstance(y.CoreService,function(){return N.scrollToBottom()})),N._instantiationService.setService(w.ICoreService,N._coreService),N._coreMouseService=N._instantiationService.createInstance(c.CoreMouseService),N._instantiationService.setService(w.ICoreMouseService,N._coreMouseService),N._dirtyRowService=N._instantiationService.createInstance(l.DirtyRowService),N._instantiationService.setService(w.IDirtyRowService,N._dirtyRowService),N.unicodeService=N._instantiationService.createInstance(u.UnicodeService),N._instantiationService.setService(w.IUnicodeService,N.unicodeService),N._charsetService=N._instantiationService.createInstance(p.CharsetService),N._instantiationService.setService(w.ICharsetService,N._charsetService),N._inputHandler=new D.InputHandler(N._bufferService,N._charsetService,N._coreService,N._dirtyRowService,N._logService,N.optionsService,N._coreMouseService,N.unicodeService),N.register(f.forwardEvent(N._inputHandler.onLineFeed,N._onLineFeed)),N.register(N._inputHandler),N.register(f.forwardEvent(N._bufferService.onResize,N._onResize)),N.register(f.forwardEvent(N._coreService.onData,N._onData)),N.register(f.forwardEvent(N._coreService.onBinary,N._onBinary)),N.register(N.optionsService.onOptionChange(function($){return N._updateOptions($)})),N._writeBuffer=new L.WriteBuffer(function($){return N._inputHandler.parse($)}),N}return K(P,A),Object.defineProperty(P.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),P.prototype.dispose=function(){var U;this._isDisposed||(A.prototype.dispose.call(this),(U=this._windowsMode)===null||U===void 0||U.dispose(),this._windowsMode=void 0)},P.prototype.write=function(U,N){this._writeBuffer.write(U,N)},P.prototype.writeSync=function(U){this._writeBuffer.writeSync(U)},P.prototype.resize=function(U,N){isNaN(U)||isNaN(N)||(U=Math.max(U,m.MINIMUM_COLS),N=Math.max(N,m.MINIMUM_ROWS),this._bufferService.resize(U,N))},P.prototype.scroll=function(U,N){N===void 0&&(N=!1);var $,F=this._bufferService.buffer;($=this._cachedBlankLine)&&$.length===this.cols&&$.getFg(0)===U.fg&&$.getBg(0)===U.bg||($=F.getBlankLine(U,N),this._cachedBlankLine=$),$.isWrapped=N;var q=F.ybase+F.scrollTop,V=F.ybase+F.scrollBottom;if(F.scrollTop===0){var ne=F.lines.isFull;V===F.lines.length-1?ne?F.lines.recycle().copyFrom($):F.lines.push($.clone()):F.lines.splice(V+1,0,$.clone()),ne?this._bufferService.isUserScrolling&&(F.ydisp=Math.max(F.ydisp-1,0)):(F.ybase++,this._bufferService.isUserScrolling||F.ydisp++)}else{var oe=V-q+1;F.lines.shiftElements(q+1,oe-1,-1),F.lines.set(V,$.clone())}this._bufferService.isUserScrolling||(F.ydisp=F.ybase),this._dirtyRowService.markRangeDirty(F.scrollTop,F.scrollBottom),this._onScroll.fire(F.ydisp)},P.prototype.scrollLines=function(U,N){var $=this._bufferService.buffer;if(U<0){if($.ydisp===0)return;this._bufferService.isUserScrolling=!0}else U+$.ydisp>=$.ybase&&(this._bufferService.isUserScrolling=!1);var F=$.ydisp;$.ydisp=Math.max(Math.min($.ydisp+U,$.ybase),0),F!==$.ydisp&&(N||this._onScroll.fire($.ydisp))},P.prototype.scrollPages=function(U){this.scrollLines(U*(this.rows-1))},P.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},P.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},P.prototype.scrollToLine=function(U){var N=U-this._bufferService.buffer.ydisp;N!==0&&this.scrollLines(N)},P.prototype.addEscHandler=function(U,N){return this._inputHandler.addEscHandler(U,N)},P.prototype.addDcsHandler=function(U,N){return this._inputHandler.addDcsHandler(U,N)},P.prototype.addCsiHandler=function(U,N){return this._inputHandler.addCsiHandler(U,N)},P.prototype.addOscHandler=function(U,N){return this._inputHandler.addOscHandler(U,N)},P.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},P.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},P.prototype._updateOptions=function(U){var N;switch(U){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((N=this._windowsMode)===null||N===void 0||N.dispose(),this._windowsMode=void 0)}},P.prototype._enableWindowsMode=function(){var U=this;if(!this._windowsMode){var N=[];N.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),N.push(this.addCsiHandler({final:"H"},function(){return E.updateWindowsModeWrappedState(U._bufferService),!1})),this._windowsMode={dispose:function(){for(var $=0,F=N;$<F.length;$++)F[$].dispose()}}}},P}(T.Disposable);b.CoreTerminal=C},function(me,b,k){"use strict";var I=this&&this.__spreadArrays||function(){for(var O=0,m=0,n=arguments.length;m<n;m++)O+=arguments[m].length;var y=Array(O),f=0;for(m=0;m<n;m++)for(var c=arguments[m],l=0,u=c.length;l<u;l++,f++)y[f]=c[l];return y};Object.defineProperty(b,"__esModule",{value:!0}),b.InstantiationService=b.ServiceCollection=void 0;var K=k(1),T=k(14),w=function(){function O(){for(var m=[],n=0;n<arguments.length;n++)m[n]=arguments[n];this._entries=new Map;for(var y=0,f=m;y<f.length;y++){var c=f[y],l=c[0],u=c[1];this.set(l,u)}}return O.prototype.set=function(m,n){var y=this._entries.get(m);return this._entries.set(m,n),y},O.prototype.forEach=function(m){this._entries.forEach(function(n,y){return m(y,n)})},O.prototype.has=function(m){return this._entries.has(m)},O.prototype.get=function(m){return this._entries.get(m)},O}();b.ServiceCollection=w;var _=function(){function O(){this._services=new w,this._services.set(K.IInstantiationService,this)}return O.prototype.setService=function(m,n){this._services.set(m,n)},O.prototype.getService=function(m){return this._services.get(m)},O.prototype.createInstance=function(m){for(var n=[],y=1;y<arguments.length;y++)n[y-1]=arguments[y];for(var f=T.getServiceDependencies(m).sort(function(L,C){return L.index-C.index}),c=[],l=0,u=f;l<u.length;l++){var p=u[l],E=this._services.get(p.id);if(!E)throw new Error("[createInstance] "+m.name+" depends on UNKNOWN service "+p.id+".");c.push(E)}var D=f.length>0?f[0].index:n.length;if(n.length!==D)throw new Error("[createInstance] First service dependency of "+m.name+" at position "+(D+1)+" conflicts with "+n.length+" static arguments");return new(m.bind.apply(m,I([void 0],I(n,c))))},O}();b.InstantiationService=_},function(me,b,k){"use strict";var I=this&&this.__decorate||function(n,y,f,c){var l,u=arguments.length,p=u<3?y:c===null?c=Object.getOwnPropertyDescriptor(y,f):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(n,y,f,c);else for(var E=n.length-1;E>=0;E--)(l=n[E])&&(p=(u<3?l(p):u>3?l(y,f,p):l(y,f))||p);return u>3&&p&&Object.defineProperty(y,f,p),p},K=this&&this.__param||function(n,y){return function(f,c){y(f,c,n)}},T=this&&this.__spreadArrays||function(){for(var n=0,y=0,f=arguments.length;y<f;y++)n+=arguments[y].length;var c=Array(n),l=0;for(y=0;y<f;y++)for(var u=arguments[y],p=0,E=u.length;p<E;p++,l++)c[l]=u[p];return c};Object.defineProperty(b,"__esModule",{value:!0}),b.LogService=b.LogLevel=void 0;var w,_=k(1);(function(n){n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR",n[n.OFF=4]="OFF"})(w=b.LogLevel||(b.LogLevel={}));var O={debug:w.DEBUG,info:w.INFO,warn:w.WARN,error:w.ERROR,off:w.OFF},m=function(){function n(y){var f=this;this._optionsService=y,this._updateLogLevel(),this._optionsService.onOptionChange(function(c){c==="logLevel"&&f._updateLogLevel()})}return n.prototype._updateLogLevel=function(){this._logLevel=O[this._optionsService.options.logLevel]},n.prototype._evalLazyOptionalParams=function(y){for(var f=0;f<y.length;f++)typeof y[f]=="function"&&(y[f]=y[f]())},n.prototype._log=function(y,f,c){this._evalLazyOptionalParams(c),y.call.apply(y,T([console,"xterm.js: "+f],c))},n.prototype.debug=function(y){for(var f=[],c=1;c<arguments.length;c++)f[c-1]=arguments[c];this._logLevel<=w.DEBUG&&this._log(console.log,y,f)},n.prototype.info=function(y){for(var f=[],c=1;c<arguments.length;c++)f[c-1]=arguments[c];this._logLevel<=w.INFO&&this._log(console.info,y,f)},n.prototype.warn=function(y){for(var f=[],c=1;c<arguments.length;c++)f[c-1]=arguments[c];this._logLevel<=w.WARN&&this._log(console.warn,y,f)},n.prototype.error=function(y){for(var f=[],c=1;c<arguments.length;c++)f[c-1]=arguments[c];this._logLevel<=w.ERROR&&this._log(console.error,y,f)},n=I([K(0,_.IOptionsService)],n)}();b.LogService=m},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(f,c){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var p in u)u.hasOwnProperty(p)&&(l[p]=u[p])})(f,c)},function(f,c){function l(){this.constructor=f}I(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)}),T=this&&this.__decorate||function(f,c,l,u){var p,E=arguments.length,D=E<3?c:u===null?u=Object.getOwnPropertyDescriptor(c,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(f,c,l,u);else for(var L=f.length-1;L>=0;L--)(p=f[L])&&(D=(E<3?p(D):E>3?p(c,l,D):p(c,l))||D);return E>3&&D&&Object.defineProperty(c,l,D),D},w=this&&this.__param||function(f,c){return function(l,u){c(l,u,f)}};Object.defineProperty(b,"__esModule",{value:!0}),b.BufferService=b.MINIMUM_ROWS=b.MINIMUM_COLS=void 0;var _=k(1),O=k(69),m=k(0),n=k(2);b.MINIMUM_COLS=2,b.MINIMUM_ROWS=1;var y=function(f){function c(l){var u=f.call(this)||this;return u._optionsService=l,u.isUserScrolling=!1,u._onResize=new m.EventEmitter,u.cols=Math.max(l.options.cols,b.MINIMUM_COLS),u.rows=Math.max(l.options.rows,b.MINIMUM_ROWS),u.buffers=new O.BufferSet(l,u),u}return K(c,f),Object.defineProperty(c.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),c.prototype.dispose=function(){f.prototype.dispose.call(this),this.buffers.dispose()},c.prototype.resize=function(l,u){this.cols=l,this.rows=u,this.buffers.resize(l,u),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:l,rows:u})},c.prototype.reset=function(){this.buffers.dispose(),this.buffers=new O.BufferSet(this._optionsService,this),this.isUserScrolling=!1},c=T([w(0,_.IOptionsService)],c)}(n.Disposable);b.BufferService=y},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(O,m){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,y){n.__proto__=y}||function(n,y){for(var f in y)y.hasOwnProperty(f)&&(n[f]=y[f])})(O,m)},function(O,m){function n(){this.constructor=O}I(O,m),O.prototype=m===null?Object.create(m):(n.prototype=m.prototype,new n)});Object.defineProperty(b,"__esModule",{value:!0}),b.BufferSet=void 0;var T=k(70),w=k(0),_=function(O){function m(n,y){var f=O.call(this)||this;return f._onBufferActivate=f.register(new w.EventEmitter),f._normal=new T.Buffer(!0,n,y),f._normal.fillViewportRows(),f._alt=new T.Buffer(!1,n,y),f._activeBuffer=f._normal,f.setupTabStops(),f}return K(m,O),Object.defineProperty(m.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),m.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},m.prototype.activateAltBuffer=function(n){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(n),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},m.prototype.resize=function(n,y){this._normal.resize(n,y),this._alt.resize(n,y)},m.prototype.setupTabStops=function(n){this._normal.setupTabStops(n),this._alt.setupTabStops(n)},m}(k(2).Disposable);b.BufferSet=_},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.BufferStringIterator=b.Buffer=b.MAX_BUFFER_SIZE=void 0;var I=k(71),K=k(16),T=k(4),w=k(3),_=k(72),O=k(73),m=k(20),n=k(6);b.MAX_BUFFER_SIZE=4294967295;var y=function(){function c(l,u,p){this._hasScrollback=l,this._optionsService=u,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=K.DEFAULT_ATTR_DATA.clone(),this.savedCharset=m.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new I.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return c.prototype.getNullCell=function(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell},c.prototype.getWhitespaceCell=function(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell},c.prototype.getBlankLine=function(l,u){return new K.BufferLine(this._bufferService.cols,this.getNullCell(l),u)},Object.defineProperty(c.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isCursorInViewport",{get:function(){var l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows},enumerable:!1,configurable:!0}),c.prototype._getCorrectBufferLength=function(l){if(!this._hasScrollback)return l;var u=l+this._optionsService.options.scrollback;return u>b.MAX_BUFFER_SIZE?b.MAX_BUFFER_SIZE:u},c.prototype.fillViewportRows=function(l){if(this.lines.length===0){l===void 0&&(l=K.DEFAULT_ATTR_DATA);for(var u=this._rows;u--;)this.lines.push(this.getBlankLine(l))}},c.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new I.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},c.prototype.resize=function(l,u){var p=this.getNullCell(K.DEFAULT_ATTR_DATA),E=this._getCorrectBufferLength(u);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols<l)for(var D=0;D<this.lines.length;D++)this.lines.get(D).resize(l,p);var L=0;if(this._rows<u)for(var C=this._rows;C<u;C++)this.lines.length<u+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new K.BufferLine(l,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+L+1?(this.ybase--,L++,this.ydisp>0&&this.ydisp--):this.lines.push(new K.BufferLine(l,p)));else for(C=this._rows;C>u;C--)this.lines.length>u+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(E<this.lines.maxLength){var A=this.lines.length-E;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=E}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,u-1),L&&(this.y+=L),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=u-1,this._isReflowEnabled&&(this._reflow(l,u),this._cols>l))for(D=0;D<this.lines.length;D++)this.lines.get(D).resize(l,p);this._cols=l,this._rows=u},Object.defineProperty(c.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),c.prototype._reflow=function(l,u){this._cols!==l&&(l>this._cols?this._reflowLarger(l,u):this._reflowSmaller(l,u))},c.prototype._reflowLarger=function(l,u){var p=_.reflowLargerGetLinesToRemove(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(K.DEFAULT_ATTR_DATA));if(p.length>0){var E=_.reflowLargerCreateNewLayout(this.lines,p);_.reflowLargerApplyNewLayout(this.lines,E.layout),this._reflowLargerAdjustViewport(l,u,E.countRemoved)}},c.prototype._reflowLargerAdjustViewport=function(l,u,p){for(var E=this.getNullCell(K.DEFAULT_ATTR_DATA),D=p;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<u&&this.lines.push(new K.BufferLine(l,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)},c.prototype._reflowSmaller=function(l,u){for(var p=this.getNullCell(K.DEFAULT_ATTR_DATA),E=[],D=0,L=this.lines.length-1;L>=0;L--){var C=this.lines.get(L);if(!(!C||!C.isWrapped&&C.getTrimmedLength()<=l)){for(var A=[C];C.isWrapped&&L>0;)C=this.lines.get(--L),A.unshift(C);var P=this.ybase+this.y;if(!(P>=L&&P<L+A.length)){var U=A[A.length-1].getTrimmedLength(),N=_.reflowSmallerGetNewLineLengths(A,this._cols,l),$=N.length-A.length,F=void 0;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+$):Math.max(0,this.lines.length-this.lines.maxLength+$);for(var q=[],V=0;V<$;V++){var ne=this.getBlankLine(K.DEFAULT_ATTR_DATA,!0);q.push(ne)}q.length>0&&(E.push({start:L+A.length+D,newLines:q}),D+=q.length),A.push.apply(A,q);var oe=N.length-1,J=N[oe];J===0&&(J=N[--oe]);for(var z=A.length-$-1,X=U;z>=0;){var B=Math.min(X,J);if(A[oe].copyCellsFrom(A[z],X-B,J-B,B,!0),(J-=B)===0&&(J=N[--oe]),(X-=B)===0){z--;var G=Math.max(z,0);X=_.getWrappedLineTrimmedLength(A,G,this._cols)}}for(V=0;V<A.length;V++)N[V]<l&&A[V].setCell(N[V],p);for(var W=$-F;W-- >0;)this.ybase===0?this.y<u-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-u&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+$,this.ybase+u-1)}}}if(E.length>0){var R=[],x=[];for(V=0;V<this.lines.length;V++)x.push(this.lines.get(V));var Y=this.lines.length,te=Y-1,Se=0,Ie=E[Se];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+D);var Ge=0;for(V=Math.min(this.lines.maxLength-1,Y+D-1);V>=0;V--)if(Ie&&Ie.start>te+Ge){for(var Ee=Ie.newLines.length-1;Ee>=0;Ee--)this.lines.set(V--,Ie.newLines[Ee]);V++,R.push({index:te+1,amount:Ie.newLines.length}),Ge+=Ie.newLines.length,Ie=E[++Se]}else this.lines.set(V,x[te--]);var ze=0;for(V=R.length-1;V>=0;V--)R[V].index+=ze,this.lines.onInsertEmitter.fire(R[V]),ze+=R[V].amount;var He=Math.max(0,Y+D-this.lines.maxLength);He>0&&this.lines.onTrimEmitter.fire(He)}},c.prototype.stringIndexToBufferIndex=function(l,u,p){for(p===void 0&&(p=!1);u;){var E=this.lines.get(l);if(!E)return[-1,-1];for(var D=p?E.getTrimmedLength():E.length,L=0;L<D;++L)if(E.get(L)[w.CHAR_DATA_WIDTH_INDEX]&&(u-=E.get(L)[w.CHAR_DATA_CHAR_INDEX].length||1),u<0)return[l,L];l++}return[l,0]},c.prototype.translateBufferLineToString=function(l,u,p,E){p===void 0&&(p=0);var D=this.lines.get(l);return D?D.translateToString(u,p,E):""},c.prototype.getWrappedRangeForLine=function(l){for(var u=l,p=l;u>0&&this.lines.get(u).isWrapped;)u--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:u,last:p}},c.prototype.setupTabStops=function(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.options.tabStopWidth)this.tabs[l]=!0},c.prototype.prevStop=function(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l},c.prototype.nextStop=function(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l},c.prototype.addMarker=function(l){var u=this,p=new O.Marker(l);return this.markers.push(p),p.register(this.lines.onTrim(function(E){p.line-=E,p.line<0&&p.dispose()})),p.register(this.lines.onInsert(function(E){p.line>=E.index&&(p.line+=E.amount)})),p.register(this.lines.onDelete(function(E){p.line>=E.index&&p.line<E.index+E.amount&&p.dispose(),p.line>E.index&&(p.line-=E.amount)})),p.register(p.onDispose(function(){return u._removeMarker(p)})),p},c.prototype._removeMarker=function(l){this.markers.splice(this.markers.indexOf(l),1)},c.prototype.iterator=function(l,u,p,E,D){return new f(this,l,u,p,E,D)},c}();b.Buffer=y;var f=function(){function c(l,u,p,E,D,L){p===void 0&&(p=0),E===void 0&&(E=l.lines.length),D===void 0&&(D=0),L===void 0&&(L=0),this._buffer=l,this._trimRight=u,this._startIndex=p,this._endIndex=E,this._startOverscan=D,this._endOverscan=L,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return c.prototype.hasNext=function(){return this._current<this._endIndex},c.prototype.next=function(){var l=this._buffer.getWrappedRangeForLine(this._current);l.first<this._startIndex-this._startOverscan&&(l.first=this._startIndex-this._startOverscan),l.last>this._endIndex+this._endOverscan&&(l.last=this._endIndex+this._endOverscan),l.first=Math.max(l.first,0),l.last=Math.min(l.last,this._buffer.lines.length);for(var u="",p=l.first;p<=l.last;++p)u+=this._buffer.translateBufferLineToString(p,this._trimRight);return this._current=l.last+1,{range:l,content:u}},c}();b.BufferStringIterator=f},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CircularList=void 0;var I=k(0),K=function(){function T(w){this._maxLength=w,this.onDeleteEmitter=new I.EventEmitter,this.onInsertEmitter=new I.EventEmitter,this.onTrimEmitter=new I.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(T.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"maxLength",{get:function(){return this._maxLength},set:function(w){if(this._maxLength!==w){for(var _=new Array(w),O=0;O<Math.min(w,this.length);O++)_[O]=this._array[this._getCyclicIndex(O)];this._array=_,this._maxLength=w,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"length",{get:function(){return this._length},set:function(w){if(w>this._length)for(var _=this._length;_<w;_++)this._array[_]=void 0;this._length=w},enumerable:!1,configurable:!0}),T.prototype.get=function(w){return this._array[this._getCyclicIndex(w)]},T.prototype.set=function(w,_){this._array[this._getCyclicIndex(w)]=_},T.prototype.push=function(w){this._array[this._getCyclicIndex(this._length)]=w,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},T.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(T.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),T.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},T.prototype.splice=function(w,_){for(var O=[],m=2;m<arguments.length;m++)O[m-2]=arguments[m];if(_){for(var n=w;n<this._length-_;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+_)];this._length-=_}for(n=this._length-1;n>=w;n--)this._array[this._getCyclicIndex(n+O.length)]=this._array[this._getCyclicIndex(n)];for(n=0;n<O.length;n++)this._array[this._getCyclicIndex(w+n)]=O[n];if(this._length+O.length>this._maxLength){var y=this._length+O.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=O.length},T.prototype.trimStart=function(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)},T.prototype.shiftElements=function(w,_,O){if(!(_<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+O<0)throw new Error("Cannot shift elements in list beyond index 0");if(O>0){for(var m=_-1;m>=0;m--)this.set(w+m+O,this.get(w+m));var n=w+_+O-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(m=0;m<_;m++)this.set(w+m+O,this.get(w+m))}},T.prototype._getCyclicIndex=function(w){return(this._startIndex+w)%this._maxLength},T}();b.CircularList=K},function(me,b,k){"use strict";function I(K,T,w){if(T===K.length-1)return K[T].getTrimmedLength();var _=!K[T].hasContent(w-1)&&K[T].getWidth(w-1)===1,O=K[T+1].getWidth(0)===2;return _&&O?w-1:w}Object.defineProperty(b,"__esModule",{value:!0}),b.getWrappedLineTrimmedLength=b.reflowSmallerGetNewLineLengths=b.reflowLargerApplyNewLayout=b.reflowLargerCreateNewLayout=b.reflowLargerGetLinesToRemove=void 0,b.reflowLargerGetLinesToRemove=function(K,T,w,_,O){for(var m=[],n=0;n<K.length-1;n++){var y=n,f=K.get(++y);if(f.isWrapped){for(var c=[K.get(n)];y<K.length&&f.isWrapped;)c.push(f),f=K.get(++y);if(_>=n&&_<y)n+=c.length-1;else{for(var l=0,u=I(c,l,T),p=1,E=0;p<c.length;){var D=I(c,p,T),L=D-E,C=w-u,A=Math.min(L,C);c[l].copyCellsFrom(c[p],E,u,A,!1),(u+=A)===w&&(l++,u=0),(E+=A)===D&&(p++,E=0),u===0&&l!==0&&c[l-1].getWidth(w-1)===2&&(c[l].copyCellsFrom(c[l-1],w-1,u++,1,!1),c[l-1].setCell(w-1,O))}c[l].replaceCells(u,w,O);for(var P=0,U=c.length-1;U>0&&(U>l||c[U].getTrimmedLength()===0);U--)P++;P>0&&(m.push(n+c.length-P),m.push(P)),n+=c.length-1}}}return m},b.reflowLargerCreateNewLayout=function(K,T){for(var w=[],_=0,O=T[_],m=0,n=0;n<K.length;n++)if(O===n){var y=T[++_];K.onDeleteEmitter.fire({index:n-m,amount:y}),n+=y-1,m+=y,O=T[++_]}else w.push(n);return{layout:w,countRemoved:m}},b.reflowLargerApplyNewLayout=function(K,T){for(var w=[],_=0;_<T.length;_++)w.push(K.get(T[_]));for(_=0;_<w.length;_++)K.set(_,w[_]);K.length=T.length},b.reflowSmallerGetNewLineLengths=function(K,T,w){for(var _=[],O=K.map(function(u,p){return I(K,p,T)}).reduce(function(u,p){return u+p}),m=0,n=0,y=0;y<O;){if(O-y<w){_.push(O-y);break}m+=w;var f=I(K,n,T);m>f&&(m-=f,n++);var c=K[n].getWidth(m-1)===2;c&&m--;var l=c?w-1:w;_.push(l),y+=l}return _},b.getWrappedLineTrimmedLength=I},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(_,O){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,n){m.__proto__=n}||function(m,n){for(var y in n)n.hasOwnProperty(y)&&(m[y]=n[y])})(_,O)},function(_,O){function m(){this.constructor=_}I(_,O),_.prototype=O===null?Object.create(O):(m.prototype=O.prototype,new m)});Object.defineProperty(b,"__esModule",{value:!0}),b.Marker=void 0;var T=k(0),w=function(_){function O(m){var n=_.call(this)||this;return n.line=m,n._id=O._nextId++,n.isDisposed=!1,n._onDispose=new T.EventEmitter,n}return K(O,_),Object.defineProperty(O.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),O.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},O._nextId=1,O}(k(2).Disposable);b.Marker=w},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.OptionsService=b.DEFAULT_OPTIONS=b.DEFAULT_BELL_SOUND=void 0;var I=k(0),K=k(11),T=k(33);b.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",b.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:b.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:K.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var w=["cols","rows"],_=function(){function O(m){this._onOptionChange=new I.EventEmitter,this.options=T.clone(b.DEFAULT_OPTIONS);for(var n=0,y=Object.keys(m);n<y.length;n++){var f=y[n];if(f in this.options){var c=m[f];this.options[f]=c}}}return Object.defineProperty(O.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),O.prototype.setOption=function(m,n){if(!(m in b.DEFAULT_OPTIONS))throw new Error('No option with key "'+m+'"');if(w.indexOf(m)!==-1)throw new Error('Option "'+m+'" can only be set in the constructor');this.options[m]!==n&&(n=this._sanitizeAndValidateOption(m,n),this.options[m]!==n&&(this.options[m]=n,this._onOptionChange.fire(m)))},O.prototype._sanitizeAndValidateOption=function(m,n){switch(m){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":n||(n=b.DEFAULT_OPTIONS[m]);break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(m+" cannot be less than 1, value: "+n);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(m+" cannot be less than 0, value: "+n);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(m+" cannot be less than or equal to 0, value: "+n)}return n},O.prototype.getOption=function(m){if(!(m in b.DEFAULT_OPTIONS))throw new Error('No option with key "'+m+'"');return this.options[m]},O}();b.OptionsService=_},function(me,b,k){"use strict";var I,K=this&&this.__extends||(I=function(l,u){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,E){p.__proto__=E}||function(p,E){for(var D in E)E.hasOwnProperty(D)&&(p[D]=E[D])})(l,u)},function(l,u){function p(){this.constructor=l}I(l,u),l.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}),T=this&&this.__decorate||function(l,u,p,E){var D,L=arguments.length,C=L<3?u:E===null?E=Object.getOwnPropertyDescriptor(u,p):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(l,u,p,E);else for(var A=l.length-1;A>=0;A--)(D=l[A])&&(C=(L<3?D(C):L>3?D(u,p,C):D(u,p))||C);return L>3&&C&&Object.defineProperty(u,p,C),C},w=this&&this.__param||function(l,u){return function(p,E){u(p,E,l)}};Object.defineProperty(b,"__esModule",{value:!0}),b.CoreService=void 0;var _=k(1),O=k(0),m=k(33),n=k(2),y=Object.freeze({insertMode:!1}),f=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),c=function(l){function u(p,E,D,L){var C=l.call(this)||this;return C._bufferService=E,C._logService=D,C._optionsService=L,C.isCursorInitialized=!1,C.isCursorHidden=!1,C._onData=C.register(new O.EventEmitter),C._onUserInput=C.register(new O.EventEmitter),C._onBinary=C.register(new O.EventEmitter),C._scrollToBottom=p,C.register({dispose:function(){return C._scrollToBottom=void 0}}),C.modes=m.clone(y),C.decPrivateModes=m.clone(f),C}return K(u,l),Object.defineProperty(u.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),u.prototype.reset=function(){this.modes=m.clone(y),this.decPrivateModes=m.clone(f)},u.prototype.triggerDataEvent=function(p,E){if(E===void 0&&(E=!1),!this._optionsService.options.disableStdin){var D=this._bufferService.buffer;D.ybase!==D.ydisp&&this._scrollToBottom(),E&&this._onUserInput.fire(),this._logService.debug('sending data "'+p+'"',function(){return p.split("").map(function(L){return L.charCodeAt(0)})}),this._onData.fire(p)}},u.prototype.triggerBinaryEvent=function(p){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+p+'"',function(){return p.split("").map(function(E){return E.charCodeAt(0)})}),this._onBinary.fire(p))},u=T([w(1,_.IBufferService),w(2,_.ILogService),w(3,_.IOptionsService)],u)}(n.Disposable);b.CoreService=c},function(me,b,k){"use strict";var I=this&&this.__decorate||function(f,c,l,u){var p,E=arguments.length,D=E<3?c:u===null?u=Object.getOwnPropertyDescriptor(c,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(f,c,l,u);else for(var L=f.length-1;L>=0;L--)(p=f[L])&&(D=(E<3?p(D):E>3?p(c,l,D):p(c,l))||D);return E>3&&D&&Object.defineProperty(c,l,D),D},K=this&&this.__param||function(f,c){return function(l,u){c(l,u,f)}};Object.defineProperty(b,"__esModule",{value:!0}),b.CoreMouseService=void 0;var T=k(1),w=k(0),_={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(f){return f.button!==4&&f.action===1&&(f.ctrl=!1,f.alt=!1,f.shift=!1,!0)}},VT200:{events:19,restrict:function(f){return f.action!==32}},DRAG:{events:23,restrict:function(f){return f.action!==32||f.button!==3}},ANY:{events:31,restrict:function(f){return!0}}};function O(f,c){var l=(f.ctrl?16:0)|(f.shift?4:0)|(f.alt?8:0);return f.button===4?(l|=64,l|=f.action):(l|=3&f.button,4&f.button&&(l|=64),8&f.button&&(l|=128),f.action===32?l|=32:f.action!==0||c||(l|=3)),l}var m=String.fromCharCode,n={DEFAULT:function(f){var c=[O(f,!1)+32,f.col+32,f.row+32];return c[0]>255||c[1]>255||c[2]>255?"":"\x1B[M"+m(c[0])+m(c[1])+m(c[2])},SGR:function(f){var c=f.action===0&&f.button!==4?"m":"M";return"\x1B[<"+O(f,!0)+";"+f.col+";"+f.row+c}},y=function(){function f(c,l){this._bufferService=c,this._coreService=l,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new w.EventEmitter,this._lastEvent=null;for(var u=0,p=Object.keys(_);u<p.length;u++){var E=p[u];this.addProtocol(E,_[E])}for(var D=0,L=Object.keys(n);D<L.length;D++){var C=L[D];this.addEncoding(C,n[C])}this.reset()}return f.prototype.addProtocol=function(c,l){this._protocols[c]=l},f.prototype.addEncoding=function(c,l){this._encodings[c]=l},Object.defineProperty(f.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(c){if(!this._protocols[c])throw new Error('unknown protocol "'+c+'"');this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"areMouseEventsActive",{get:function(){return this._protocols[this._activeProtocol].events!==0},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(c){if(!this._encodings[c])throw new Error('unknown encoding "'+c+'"');this._activeEncoding=c},enumerable:!1,configurable:!0}),f.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(f.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),f.prototype.triggerMouseEvent=function(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,c))||!this._protocols[this._activeProtocol].restrict(c))return!1;var l=this._encodings[this._activeEncoding](c);return l&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(l):this._coreService.triggerDataEvent(l,!0)),this._lastEvent=c,!0},f.prototype.explainEvents=function(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}},f.prototype._compareEvents=function(c,l){return c.col===l.col&&c.row===l.row&&c.button===l.button&&c.action===l.action&&c.ctrl===l.ctrl&&c.alt===l.alt&&c.shift===l.shift},f=I([K(0,T.IBufferService),K(1,T.ICoreService)],f)}();b.CoreMouseService=y},function(me,b,k){"use strict";var I=this&&this.__decorate||function(_,O,m,n){var y,f=arguments.length,c=f<3?O:n===null?n=Object.getOwnPropertyDescriptor(O,m):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(_,O,m,n);else for(var l=_.length-1;l>=0;l--)(y=_[l])&&(c=(f<3?y(c):f>3?y(O,m,c):y(O,m))||c);return f>3&&c&&Object.defineProperty(O,m,c),c},K=this&&this.__param||function(_,O){return function(m,n){O(m,n,_)}};Object.defineProperty(b,"__esModule",{value:!0}),b.DirtyRowService=void 0;var T=k(1),w=function(){function _(O){this._bufferService=O,this.clearRange()}return Object.defineProperty(_.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),_.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},_.prototype.markDirty=function(O){O<this._start?this._start=O:O>this._end&&(this._end=O)},_.prototype.markRangeDirty=function(O,m){if(O>m){var n=O;O=m,m=n}O<this._start&&(this._start=O),m>this._end&&(this._end=m)},_.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},_=I([K(0,T.IBufferService)],_)}();b.DirtyRowService=w},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.UnicodeService=void 0;var I=k(0),K=k(79),T=function(){function w(){this._providers=Object.create(null),this._active="",this._onChange=new I.EventEmitter;var _=new K.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}return Object.defineProperty(w.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"activeVersion",{get:function(){return this._active},set:function(_){if(!this._providers[_])throw new Error('unknown Unicode version "'+_+'"');this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)},enumerable:!1,configurable:!0}),w.prototype.register=function(_){this._providers[_.version]=_},w.prototype.wcwidth=function(_){return this._activeProvider.wcwidth(_)},w.prototype.getStringCellWidth=function(_){for(var O=0,m=_.length,n=0;n<m;++n){var y=_.charCodeAt(n);if(55296<=y&&y<=56319){if(++n>=m)return O+this.wcwidth(y);var f=_.charCodeAt(n);56320<=f&&f<=57343?y=1024*(y-55296)+f-56320+65536:O+=this.wcwidth(f)}O+=this.wcwidth(y)}return O},w}();b.UnicodeService=T},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.UnicodeV6=void 0;var I,K=k(15),T=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],w=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],_=function(){function O(){if(this.version="6",!I){I=new Uint8Array(65536),K.fill(I,1),I[0]=0,K.fill(I,0,1,32),K.fill(I,0,127,160),K.fill(I,2,4352,4448),I[9001]=2,I[9002]=2,K.fill(I,2,11904,42192),I[12351]=1,K.fill(I,2,44032,55204),K.fill(I,2,63744,64256),K.fill(I,2,65040,65050),K.fill(I,2,65072,65136),K.fill(I,2,65280,65377),K.fill(I,2,65504,65511);for(var m=0;m<T.length;++m)K.fill(I,0,T[m][0],T[m][1]+1)}}return O.prototype.wcwidth=function(m){return m<32?0:m<127?1:m<65536?I[m]:function(n,y){var f,c=0,l=y.length-1;if(n<y[0][0]||n>y[l][1])return!1;for(;l>=c;)if(n>y[f=c+l>>1][1])c=f+1;else{if(!(n<y[f][0]))return!0;l=f-1}return!1}(m,w)?0:m>=131072&&m<=196605||m>=196608&&m<=262141?2:1},O}();b.UnicodeV6=_},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CharsetService=void 0;var I=function(){function K(){this.glevel=0,this._charsets=[]}return K.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},K.prototype.setgLevel=function(T){this.glevel=T,this.charset=this._charsets[T]},K.prototype.setgCharset=function(T,w){this._charsets[T]=w,this.glevel===T&&(this.charset=w)},K}();b.CharsetService=I},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.updateWindowsModeWrappedState=void 0;var I=k(3);b.updateWindowsModeWrappedState=function(K){var T=K.buffer.lines.get(K.buffer.ybase+K.buffer.y-1),w=T==null?void 0:T.get(K.cols-1),_=K.buffer.lines.get(K.buffer.ybase+K.buffer.y);_&&w&&(_.isWrapped=w[I.CHAR_DATA_CODE_INDEX]!==I.NULL_CELL_CODE&&w[I.CHAR_DATA_CODE_INDEX]!==I.WHITESPACE_CELL_CODE)}},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.WriteBuffer=void 0;var I=function(){function K(T){this._action=T,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return K.prototype.writeSync=function(T){if(this._writeBuffer.length){for(var w=this._bufferOffset;w<this._writeBuffer.length;++w){var _=this._writeBuffer[w],O=this._callbacks[w];this._action(_),O&&O()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(T)},K.prototype.write=function(T,w){var _=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return _._innerWrite()})),this._pendingData+=T.length,this._writeBuffer.push(T),this._callbacks.push(w)},K.prototype._innerWrite=function(){for(var T=this,w=Date.now();this._writeBuffer.length>this._bufferOffset;){var _=this._writeBuffer[this._bufferOffset],O=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(_),this._pendingData-=_.length,O&&O(),Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return T._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},K}();b.WriteBuffer=I},function(me,b,k){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.AddonManager=void 0;var I=function(){function K(){this._addons=[]}return K.prototype.dispose=function(){for(var T=this._addons.length-1;T>=0;T--)this._addons[T].instance.dispose()},K.prototype.loadAddon=function(T,w){var _=this,O={instance:w,dispose:w.dispose,isDisposed:!1};this._addons.push(O),w.dispose=function(){return _._wrappedAddonDispose(O)},w.activate(T)},K.prototype._wrappedAddonDispose=function(T){if(!T.isDisposed){for(var w=-1,_=0;_<this._addons.length;_++)if(this._addons[_]===T){w=_;break}if(w===-1)throw new Error("Could not dispose an addon that has not been loaded");T.isDisposed=!0,T.dispose.apply(T.instance),this._addons.splice(w,1)}},K}();b.AddonManager=I}])})},93314:function(dt){"use strict";dt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},15360:function(dt,me,b){"use strict";b.d(me,{ZP:function(){return Br}});const k=Number.isFinite||function(o){return typeof o=="number"&&isFinite(o)},I=Number.isSafeInteger||function(o){return typeof o=="number"&&Math.abs(o)<=K},K=Number.MAX_SAFE_INTEGER||9007199254740991;let T=function(o){return o.NETWORK_ERROR="networkError",o.MEDIA_ERROR="mediaError",o.KEY_SYSTEM_ERROR="keySystemError",o.MUX_ERROR="muxError",o.OTHER_ERROR="otherError",o}({}),w=function(o){return o.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",o.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",o.KEY_SYSTEM_NO_SESSION="keySystemNoSession",o.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",o.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",o.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",o.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",o.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",o.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",o.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",o.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",o.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",o.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",o.MANIFEST_LOAD_ERROR="manifestLoadError",o.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",o.MANIFEST_PARSING_ERROR="manifestParsingError",o.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",o.LEVEL_EMPTY_ERROR="levelEmptyError",o.LEVEL_LOAD_ERROR="levelLoadError",o.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",o.LEVEL_PARSING_ERROR="levelParsingError",o.LEVEL_SWITCH_ERROR="levelSwitchError",o.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",o.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",o.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",o.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",o.FRAG_LOAD_ERROR="fragLoadError",o.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",o.FRAG_DECRYPT_ERROR="fragDecryptError",o.FRAG_PARSING_ERROR="fragParsingError",o.FRAG_GAP="fragGap",o.REMUX_ALLOC_ERROR="remuxAllocError",o.KEY_LOAD_ERROR="keyLoadError",o.KEY_LOAD_TIMEOUT="keyLoadTimeOut",o.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",o.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",o.BUFFER_APPEND_ERROR="bufferAppendError",o.BUFFER_APPENDING_ERROR="bufferAppendingError",o.BUFFER_STALLED_ERROR="bufferStalledError",o.BUFFER_FULL_ERROR="bufferFullError",o.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",o.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",o.ASSET_LIST_LOAD_ERROR="assetListLoadError",o.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",o.ASSET_LIST_PARSING_ERROR="assetListParsingError",o.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",o.INTERNAL_EXCEPTION="internalException",o.INTERNAL_ABORTED="aborted",o.ATTACH_MEDIA_ERROR="attachMediaError",o.UNKNOWN="unknown",o}({}),_=function(o){return o.MEDIA_ATTACHING="hlsMediaAttaching",o.MEDIA_ATTACHED="hlsMediaAttached",o.MEDIA_DETACHING="hlsMediaDetaching",o.MEDIA_DETACHED="hlsMediaDetached",o.MEDIA_ENDED="hlsMediaEnded",o.STALL_RESOLVED="hlsStallResolved",o.BUFFER_RESET="hlsBufferReset",o.BUFFER_CODECS="hlsBufferCodecs",o.BUFFER_CREATED="hlsBufferCreated",o.BUFFER_APPENDING="hlsBufferAppending",o.BUFFER_APPENDED="hlsBufferAppended",o.BUFFER_EOS="hlsBufferEos",o.BUFFERED_TO_END="hlsBufferedToEnd",o.BUFFER_FLUSHING="hlsBufferFlushing",o.BUFFER_FLUSHED="hlsBufferFlushed",o.MANIFEST_LOADING="hlsManifestLoading",o.MANIFEST_LOADED="hlsManifestLoaded",o.MANIFEST_PARSED="hlsManifestParsed",o.LEVEL_SWITCHING="hlsLevelSwitching",o.LEVEL_SWITCHED="hlsLevelSwitched",o.LEVEL_LOADING="hlsLevelLoading",o.LEVEL_LOADED="hlsLevelLoaded",o.LEVEL_UPDATED="hlsLevelUpdated",o.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",o.LEVELS_UPDATED="hlsLevelsUpdated",o.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",o.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",o.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",o.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",o.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",o.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",o.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",o.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",o.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",o.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",o.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",o.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",o.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",o.CUES_PARSED="hlsCuesParsed",o.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",o.INIT_PTS_FOUND="hlsInitPtsFound",o.FRAG_LOADING="hlsFragLoading",o.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",o.FRAG_LOADED="hlsFragLoaded",o.FRAG_DECRYPTED="hlsFragDecrypted",o.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",o.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",o.FRAG_PARSING_METADATA="hlsFragParsingMetadata",o.FRAG_PARSED="hlsFragParsed",o.FRAG_BUFFERED="hlsFragBuffered",o.FRAG_CHANGED="hlsFragChanged",o.FPS_DROP="hlsFpsDrop",o.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",o.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",o.ERROR="hlsError",o.DESTROYING="hlsDestroying",o.KEY_LOADING="hlsKeyLoading",o.KEY_LOADED="hlsKeyLoaded",o.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",o.BACK_BUFFER_REACHED="hlsBackBufferReached",o.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",o.ASSET_LIST_LOADING="hlsAssetListLoading",o.ASSET_LIST_LOADED="hlsAssetListLoaded",o.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",o.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",o.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",o.INTERSTITIAL_STARTED="hlsInterstitialStarted",o.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",o.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",o.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",o.INTERSTITIAL_ENDED="hlsInterstitialEnded",o.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",o.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",o.EVENT_CUE_ENTER="hlsEventCueEnter",o}({});var O={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},m={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class n{constructor(e,t=0,i=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_=i}sample(e,t){const i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*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 y{constructor(e,t,i,r=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_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new n(e),this.fast_=new n(t),this.defaultTTFB_=r,this.ttfb_=new n(e)}update(e,t){const{slow_:i,fast_:r,ttfb_:s}=this;i.halfLife!==e&&(this.slow_=new n(e,i.getEstimate(),i.getTotalWeight())),r.halfLife!==t&&(this.fast_=new n(t,r.getEstimate(),r.getTotalWeight())),s.halfLife!==e&&(this.ttfb_=new n(e,s.getEstimate(),s.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const i=8*t,r=e/1e3,s=i/r;this.fast_.sample(r,s),this.slow_.sample(r,s)}sampleTTFB(e){const t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,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 f(o,e,t){return(e=E(e))in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function c(){return c=Object.assign?Object.assign.bind():function(o){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(o[i]=t[i])}return o},c.apply(null,arguments)}function l(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(o);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,i)}return t}function u(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?l(Object(t),!0).forEach(function(i){f(o,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach(function(i){Object.defineProperty(o,i,Object.getOwnPropertyDescriptor(t,i))})}return o}function p(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var i=t.call(o,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function E(o){var e=p(o,"string");return typeof e=="symbol"?e:e+""}class D{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 i=`[${e}]:`;this.trace=L,this.debug=t.debug.bind(null,i),this.log=t.log.bind(null,i),this.warn=t.warn.bind(null,i),this.info=t.info.bind(null,i),this.error=t.error.bind(null,i)}}const L=function(){},C={trace:L,debug:L,log:L,warn:L,info:L,error:L};function A(){return c({},C)}function P(o,e){const t=self.console[o];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${o}] >`):L}function U(o,e,t){return e[o]?e[o].bind(e):P(o,t)}const N=A();function $(o,e,t){const i=A();if(typeof console=="object"&&o===!0||typeof o=="object"){const r=["debug","log","info","warn","error"];r.forEach(s=>{i[s]=U(s,o,t)});try{i.log(`Debug logs enabled for "${e}" in hls.js version 1.6.5`)}catch(s){return A()}r.forEach(s=>{N[s]=U(s,o)})}else c(N,i);return i}const F=N;function q(o=!0){return typeof self=="undefined"?void 0:(o||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function V(o){return typeof self!="undefined"&&o===self.ManagedMediaSource}function ne(o,e){const t=Object.keys(o),i=Object.keys(e),r=t.length,s=i.length;return!r||!s||r===s&&!t.some(a=>i.indexOf(a)===-1)}function oe(o,e=!1){if(typeof TextDecoder!="undefined"){const d=new TextDecoder("utf-8").decode(o);if(e){const v=d.indexOf("\0");return v!==-1?d.substring(0,v):d}return d.replace(/\0/g,"")}const t=o.length;let i,r,s,a="",h=0;for(;h<t;){if(i=o[h++],i===0&&e)return a;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(i);break;case 12:case 13:r=o[h++],a+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=o[h++],s=o[h++],a+=String.fromCharCode((i&15)<<12|(r&63)<<6|(s&63)<<0);break}}return a}const J={hexDump:function(o){let e="";for(let t=0;t<o.length;t++){let i=o[t].toString(16);i.length<2&&(i="0"+i),e+=i}return e}};function z(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var X={exports:{}},B;function G(){return B||(B=1,function(o,e){(function(t){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,h={buildAbsoluteURL:function(g,d,v){if(v=v||{},g=g.trim(),d=d.trim(),!d){if(!v.alwaysNormalize)return g;var S=h.parseURL(g);if(!S)throw new Error("Error trying to parse base URL.");return S.path=h.normalizePath(S.path),h.buildURLFromParts(S)}var M=h.parseURL(d);if(!M)throw new Error("Error trying to parse relative URL.");if(M.scheme)return v.alwaysNormalize?(M.path=h.normalizePath(M.path),h.buildURLFromParts(M)):d;var j=h.parseURL(g);if(!j)throw new Error("Error trying to parse base URL.");if(!j.netLoc&&j.path&&j.path[0]!=="/"){var H=r.exec(j.path);j.netLoc=H[1],j.path=H[2]}j.netLoc&&!j.path&&(j.path="/");var Q={scheme:j.scheme,netLoc:M.netLoc,path:null,params:M.params,query:M.query,fragment:M.fragment};if(!M.netLoc&&(Q.netLoc=j.netLoc,M.path[0]!=="/"))if(!M.path)Q.path=j.path,M.params||(Q.params=j.params,M.query||(Q.query=j.query));else{var Z=j.path,re=Z.substring(0,Z.lastIndexOf("/")+1)+M.path;Q.path=h.normalizePath(re)}return Q.path===null&&(Q.path=v.alwaysNormalize?h.normalizePath(M.path):M.path),h.buildURLFromParts(Q)},parseURL:function(g){var d=i.exec(g);return d?{scheme:d[1]||"",netLoc:d[2]||"",path:d[3]||"",params:d[4]||"",query:d[5]||"",fragment:d[6]||""}:null},normalizePath:function(g){for(g=g.split("").reverse().join("").replace(s,"");g.length!==(g=g.replace(a,"")).length;);return g.split("").reverse().join("")},buildURLFromParts:function(g){return g.scheme+g.netLoc+g.path+g.params+g.query+g.fragment}};o.exports=h})()}(X)),X.exports}var W=G();class R{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 x={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Y{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,Ee(this,"stats")}setByteRange(e,t){const i=e.split("@",2);let r;i.length===1?r=(t==null?void 0:t.byteRangeEndOffset)||0:r=parseInt(i[1]),this._byteRange=[r,parseInt(i[0])+r]}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={[x.AUDIO]:null,[x.VIDEO]:null,[x.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 R),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=W.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[x.AUDIO]=null,e[x.VIDEO]=null,e[x.AUDIOVIDEO]=null}}function te(o){return o.sn!=="initSegment"}class Se extends Y{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(k(e)&&k(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 i=Object.keys(this.levelkeys);if(i.length===1)return this._decryptdata=this.levelkeys[i[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=k(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),i=t.length;if(i>1||i===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(!k(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return te(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,i,r,s,a=!1){const{elementaryStreams:h}=this,g=h[e];if(!g){h[e]={startPTS:t,endPTS:i,startDTS:r,endDTS:s,partial:a};return}g.startPTS=Math.min(g.startPTS,t),g.endPTS=Math.max(g.endPTS,i),g.startDTS=Math.min(g.startDTS,r),g.endDTS=Math.max(g.endDTS,s)}}class Ie extends Y{constructor(e,t,i,r,s){super(i),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=r;const a=e.enumeratedString("BYTERANGE");a&&this.setByteRange(a,s),s&&(this.fragOffset=s.fragOffset+s.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 Ge(o,e){const t=Object.getPrototypeOf(o);if(t){const i=Object.getOwnPropertyDescriptor(t,e);return i||Ge(t,e)}}function Ee(o,e){const t=Ge(o,e);t&&(t.enumerable=!0,Object.defineProperty(o,e,t))}const ze=Math.pow(2,32)-1,He=[].push,Be={video:1,audio:2,id3:3,text:4};function lt(o){return String.fromCharCode.apply(null,o)}function At(o,e){const t=o[e]<<8|o[e+1];return t<0?65536+t:t}function nt(o,e){const t=Nt(o,e);return t<0?4294967296+t:t}function Bt(o,e){let t=nt(o,e);return t*=Math.pow(2,32),t+=nt(o,e+4),t}function Nt(o,e){return o[e]<<24|o[e+1]<<16|o[e+2]<<8|o[e+3]}function Le(o,e,t){o[e]=t>>24,o[e+1]=t>>16&255,o[e+2]=t>>8&255,o[e+3]=t&255}function Re(o){const e=o.byteLength;for(let t=0;t<e;){const i=nt(o,t);if(i>8&&o[t+4]===109&&o[t+5]===111&&o[t+6]===111&&o[t+7]===102)return!0;t=i>1?t+i:e}return!1}function he(o,e){const t=[];if(!e.length)return t;const i=o.byteLength;for(let r=0;r<i;){const s=nt(o,r),a=lt(o.subarray(r+4,r+8)),h=s>1?r+s:i;if(a===e[0])if(e.length===1)t.push(o.subarray(r+8,h));else{const g=he(o.subarray(r+8,h),e.slice(1));g.length&&He.apply(t,g)}r=h}return t}function Oe(o){const e=[],t=o[0];let i=8;const r=nt(o,i);i+=4;let s=0,a=0;t===0?(s=nt(o,i),a=nt(o,i+4),i+=8):(s=Bt(o,i),a=Bt(o,i+8),i+=16),i+=2;let h=o.length+a;const g=At(o,i);i+=2;for(let d=0;d<g;d++){let v=i;const S=nt(o,v);v+=4;const M=S&2147483647;if((S&2147483648)>>>31===1)return F.warn("SIDX has hierarchical references (not supported)"),null;const H=nt(o,v);v+=4,e.push({referenceSize:M,subsegmentDuration:H,info:{duration:H/r,start:h,end:h+M-1}}),h+=M,v+=4,i=v}return{earliestPresentationTime:s,timescale:r,version:t,referencesCount:g,references:e}}function We(o){const e=[],t=he(o,["moov","trak"]);for(let r=0;r<t.length;r++){const s=t[r],a=he(s,["tkhd"])[0];if(a){let h=a[0];const g=nt(a,h===0?12:20),d=he(s,["mdia","mdhd"])[0];if(d){h=d[0];const v=nt(d,h===0?12:20),S=he(s,["mdia","hdlr"])[0];if(S){const M=lt(S.subarray(8,12)),j={soun:x.AUDIO,vide:x.VIDEO}[M],H=he(s,["mdia","minf","stbl","stsd"])[0],Q=qe(H);j?(e[g]={timescale:v,type:j,stsd:Q},e[j]=u({timescale:v,id:g},Q)):e[g]={timescale:v,type:M,stsd:Q}}}}}return he(o,["moov","mvex","trex"]).forEach(r=>{const s=nt(r,4),a=e[s];a&&(a.default={duration:nt(r,12),flags:nt(r,20)})}),e}function qe(o){const e=o.subarray(8),t=e.subarray(86),i=lt(e.subarray(4,8));let r=i,s;const a=i==="enca"||i==="encv";if(a){const d=he(e,[i])[0].subarray(i==="enca"?28:78);he(d,["sinf"]).forEach(S=>{const M=he(S,["schm"])[0];if(M){const j=lt(M.subarray(4,8));if(j==="cbcs"||j==="cenc"){const H=he(S,["frma"])[0];H&&(r=lt(H))}}})}const h=r;switch(r){case"avc1":case"avc2":case"avc3":case"avc4":{const g=he(t,["avcC"])[0];g&&g.length>3&&(r+="."+ge(g[1])+ge(g[2])+ge(g[3]),s=ae(h==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const g=he(e,[i])[0],d=he(g.subarray(28),["esds"])[0];if(d&&d.length>7){let v=4;if(d[v++]!==3)break;v=pe(d,v),v+=2;const S=d[v++];if(S&128&&(v+=2),S&64&&(v+=d[v++]),d[v++]!==4)break;v=pe(d,v);const M=d[v++];if(M===64)r+="."+ge(M);else break;if(v+=12,d[v++]!==5)break;v=pe(d,v);const j=d[v++];let H=(j&248)>>3;H===31&&(H+=1+((j&7)<<3)+((d[v]&224)>>5)),r+="."+H}break}case"hvc1":case"hev1":{const g=he(t,["hvcC"])[0];if(g&&g.length>12){const d=g[1],v=["","A","B","C"][d>>6],S=d&31,M=nt(g,2),j=(d&32)>>5?"H":"L",H=g[12],Q=g.subarray(6,12);r+="."+v+S,r+="."+se(M).toString(16).toUpperCase(),r+="."+j+H;let Z="";for(let re=Q.length;re--;){const fe=Q[re];(fe||Z)&&(Z="."+fe.toString(16).toUpperCase()+Z)}r+=Z}s=ae(h=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{r=ae(r,t)||r;break}case"vp09":{const g=he(t,["vpcC"])[0];if(g&&g.length>6){const d=g[4],v=g[5],S=g[6]>>4&15;r+="."+de(d)+"."+de(v)+"."+de(S)}break}case"av01":{const g=he(t,["av1C"])[0];if(g&&g.length>2){const d=g[1]>>>5,v=g[1]&31,S=g[2]>>>7?"H":"M",M=(g[2]&64)>>6,j=(g[2]&32)>>5,H=d===2&&M?j?12:10:M?10:8,Q=(g[2]&16)>>4,Z=(g[2]&8)>>3,re=(g[2]&4)>>2,fe=g[2]&3;r+="."+d+"."+de(v)+S+"."+de(H)+"."+Q+"."+Z+re+fe+"."+de(1)+"."+de(1)+"."+de(1)+"."+0,s=ae("dav1",t)}break}}return{codec:r,encrypted:a,supplemental:s}}function ae(o,e){const t=he(e,["dvvC"]),i=t.length?t[0]:he(e,["dvcC"])[0];if(i){const r=i[2]>>1&127,s=i[2]<<5&32|i[3]>>3&31;return o+"."+de(r)+"."+de(s)}}function se(o){let e=0;for(let t=0;t<32;t++)e|=(o>>t&1)<<31-t;return e>>>0}function pe(o,e){const t=e+5;for(;o[e++]&128&&e<t;);return e}function ge(o){return("0"+o.toString(16).toUpperCase()).slice(-2)}function de(o){return(o<10?"0":"")+o}function Ce(o,e){if(!o||!e)return o;const t=e.keyId;return t&&e.isCommonEncryption&&he(o,["moov","trak"]).forEach(r=>{const a=he(r,["mdia","minf","stbl","stsd"])[0].subarray(8);let h=he(a,["enca"]);const g=h.length>0;g||(h=he(a,["encv"])),h.forEach(d=>{const v=g?d.subarray(28):d.subarray(78);he(v,["sinf"]).forEach(M=>{const j=Fe(M);if(j){const H=j.subarray(8,24);H.some(Q=>Q!==0)||(F.log(`[eme] Patching keyId in 'enc${g?"a":"v"}>sinf>>tenc' box: ${J.hexDump(H)} -> ${J.hexDump(t)}`),j.set(t,8))}})})}),o}function Fe(o){const e=he(o,["schm"])[0];if(e){const t=lt(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return he(o,["schi","tenc"])[0]}return null}function Te(o,e,t){const i={},r=he(o,["moof","traf"]);for(let s=0;s<r.length;s++){const a=r[s],h=he(a,["tfhd"])[0],g=nt(h,4),d=e[g];if(!d)continue;const v=i[g]||(i[g]={start:NaN,duration:0,sampleCount:0,timescale:d.timescale,type:d.type}),S=he(a,["tfdt"])[0];if(S){const le=S[0];let be=nt(S,4);le===1&&(be===ze?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(be*=ze+1,be+=nt(S,8))),k(be)&&(!k(v.start)||be<v.start)&&(v.start=be)}const M=d.default,j=nt(h,0)|(M==null?void 0:M.flags);let H=(M==null?void 0:M.duration)||0;j&8&&(j&2?H=nt(h,12):H=nt(h,8));const Q=he(a,["trun"]);let Z=v.start||0,re=0,fe=H;for(let le=0;le<Q.length;le++){const be=Q[le],we=nt(be,4),$e=v.sampleCount;v.sampleCount+=we;const Ae=be[3]&1,Pe=be[3]&4,Ue=be[2]&1,De=be[2]&2,Xe=be[2]&4,ut=be[2]&8;let Tt=8,gt=we;for(Ae&&(Tt+=4),Pe&&we&&(!(be[Tt+1]&1)&&v.keyFrameIndex===void 0&&(v.keyFrameIndex=$e),Tt+=4,Ue?(fe=nt(be,Tt),Tt+=4):fe=H,De&&(Tt+=4),ut&&(Tt+=4),Z+=fe,re+=fe,gt--);gt--;)Ue?(fe=nt(be,Tt),Tt+=4):fe=H,De&&(Tt+=4),Xe&&(be[Tt+1]&1||v.keyFrameIndex===void 0&&(v.keyFrameIndex=v.sampleCount-(gt+1),v.keyFrameStart=Z),Tt+=4),ut&&(Tt+=4),Z+=fe,re+=fe;!re&&H&&(re+=H*we)}v.duration+=re}if(!Object.keys(i).some(s=>i[s].duration)){let s=1/0,a=0;const h=he(o,["sidx"]);for(let g=0;g<h.length;g++){const d=Oe(h[g]);if(d!=null&&d.references){s=Math.min(s,d.earliestPresentationTime/d.timescale);const v=d.references.reduce((S,M)=>S+M.info.duration||0,0);a=Math.max(a,v+d.earliestPresentationTime/d.timescale)}}a&&k(a)&&Object.keys(i).forEach(g=>{i[g].duration||(i[g].duration=a*i[g].timescale-i[g].start)})}return i}function Ne(o,e,t){he(e,["moof","traf"]).forEach(i=>{he(i,["tfhd"]).forEach(r=>{const s=nt(r,4),a=o[s];if(!a)return;const h=a.timescale||9e4;he(i,["tfdt"]).forEach(g=>{const d=g[0],v=t*h;if(v){let S=nt(g,4);if(d===0)S-=v,S=Math.max(S,0),Le(g,4,S);else{S*=Math.pow(2,32),S+=nt(g,8),S-=v,S=Math.max(S,0);const M=Math.floor(S/(ze+1)),j=Math.floor(S%(ze+1));Le(g,4,M),Le(g,8,j)}}})})})}function Me(o){const e={valid:null,remainder:null},t=he(o,["moof"]);if(t.length<2)return e.remainder=o,e;const i=t[t.length-1];return e.valid=o.slice(0,i.byteOffset-8),e.remainder=o.slice(i.byteOffset-8),e}function je(o,e){const t=new Uint8Array(o.length+e.length);return t.set(o),t.set(e,o.length),t}function tt(o,e){const t=[],i=e.samples,r=e.timescale,s=e.id;let a=!1;return he(i,["moof"]).map(g=>{const d=g.byteOffset-8;he(g,["traf"]).map(S=>{const M=he(S,["tfdt"]).map(j=>{const H=j[0];let Q=nt(j,4);return H===1&&(Q*=Math.pow(2,32),Q+=nt(j,8)),Q/r})[0];return M!==void 0&&(o=M),he(S,["tfhd"]).map(j=>{const H=nt(j,4),Q=nt(j,0)&16777215,Z=(Q&1)!==0,re=(Q&2)!==0,fe=(Q&8)!==0;let le=0;const be=(Q&16)!==0;let we=0;const $e=(Q&32)!==0;let Ae=8;H===s&&(Z&&(Ae+=8),re&&(Ae+=4),fe&&(le=nt(j,Ae),Ae+=4),be&&(we=nt(j,Ae),Ae+=4),$e&&(Ae+=4),e.type==="video"&&(a=Ze(e.codec)),he(S,["trun"]).map(Pe=>{const Ue=Pe[0],De=nt(Pe,0)&16777215,Xe=(De&1)!==0;let ut=0;const Tt=(De&4)!==0,gt=(De&256)!==0;let vt=0;const ct=(De&512)!==0;let bt=0;const wt=(De&1024)!==0,et=(De&2048)!==0;let rt=0;const Ft=nt(Pe,4);let Pt=8;Xe&&(ut=nt(Pe,Pt),Pt+=4),Tt&&(Pt+=4);let $t=ut+d;for(let Vt=0;Vt<Ft;Vt++){if(gt?(vt=nt(Pe,Pt),Pt+=4):vt=le,ct?(bt=nt(Pe,Pt),Pt+=4):bt=we,wt&&(Pt+=4),et&&(Ue===0?rt=nt(Pe,Pt):rt=Nt(Pe,Pt),Pt+=4),e.type===x.VIDEO){let ti=0;for(;ti<bt;){const li=nt(i,$t);if($t+=4,it(a,i[$t])){const $i=i.subarray($t,$t+li);ht($i,a?2:1,o+rt/r,t)}$t+=li,ti+=li+4}}o+=vt/r}}))})})}),t}function Ze(o){if(!o)return!1;const e=o.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function it(o,e){if(o){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function ht(o,e,t,i){const r=st(o);let s=0;s+=e;let a=0,h=0,g=0;for(;s<r.length;){a=0;do{if(s>=r.length)break;g=r[s++],a+=g}while(g===255);h=0;do{if(s>=r.length)break;g=r[s++],h+=g}while(g===255);const d=r.length-s;let v=s;if(h<d)s+=h;else if(h>d){F.error(`Malformed SEI payload. ${h} is too small, only ${d} bytes left to parse.`);break}if(a===4){if(r[v++]===181){const M=At(r,v);if(v+=2,M===49){const j=nt(r,v);if(v+=4,j===1195456820){const H=r[v++];if(H===3){const Q=r[v++],Z=31&Q,re=64&Q,fe=re?2+Z*3:0,le=new Uint8Array(fe);if(re){le[0]=Q;for(let be=1;be<fe;be++)le[be]=r[v++]}i.push({type:H,payloadType:a,pts:t,bytes:le})}}}}}else if(a===5&&h>16){const S=[];for(let H=0;H<16;H++){const Q=r[v++].toString(16);S.push(Q.length==1?"0"+Q:Q),(H===3||H===5||H===7||H===9)&&S.push("-")}const M=h-16,j=new Uint8Array(M);for(let H=0;H<M;H++)j[H]=r[v++];i.push({payloadType:a,pts:t,uuid:S.join(""),userData:oe(j),userDataBytes:j})}}}function st(o){const e=o.byteLength,t=[];let i=1;for(;i<e-2;)o[i]===0&&o[i+1]===0&&o[i+2]===3?(t.push(i+2),i+=2):i++;if(t.length===0)return o;const r=e-t.length,s=new Uint8Array(r);let a=0;for(i=0;i<r;a++,i++)a===t[0]&&(a++,t.shift()),s[i]=o[a];return s}function Qe(o){const e=o[0];let t="",i="",r=0,s=0,a=0,h=0,g=0,d=0;if(e===0){for(;lt(o.subarray(d,d+1))!=="\0";)t+=lt(o.subarray(d,d+1)),d+=1;for(t+=lt(o.subarray(d,d+1)),d+=1;lt(o.subarray(d,d+1))!=="\0";)i+=lt(o.subarray(d,d+1)),d+=1;i+=lt(o.subarray(d,d+1)),d+=1,r=nt(o,12),s=nt(o,16),h=nt(o,20),g=nt(o,24),d=28}else if(e===1){d+=4,r=nt(o,d),d+=4;const S=nt(o,d);d+=4;const M=nt(o,d);for(d+=4,a=Mo(2,32)*S+M,I(a)||(a=Number.MAX_SAFE_INTEGER,F.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),h=nt(o,d),d+=4,g=nt(o,d),d+=4;lt(o.subarray(d,d+1))!=="\0";)t+=lt(o.subarray(d,d+1)),d+=1;for(t+=lt(o.subarray(d,d+1)),d+=1;lt(o.subarray(d,d+1))!=="\0";)i+=lt(o.subarray(d,d+1)),d+=1;i+=lt(o.subarray(d,d+1)),d+=1}const v=o.subarray(d,o.byteLength);return{schemeIdUri:t,value:i,timeScale:r,presentationTime:a,presentationTimeDelta:s,eventDuration:h,id:g,payload:v}}function mt(o,...e){const t=e.length;let i=8,r=t;for(;r--;)i+=e[r].byteLength;const s=new Uint8Array(i);for(s[0]=i>>24&255,s[1]=i>>16&255,s[2]=i>>8&255,s[3]=i&255,s.set(o,4),r=0,i=8;r<t;r++)s.set(e[r],i),i+=e[r].byteLength;return s}function Dt(o,e,t){if(o.byteLength!==16)throw new RangeError("Invalid system id");let i,r;i=0,r=new Uint8Array;let s;i>0?(s=new Uint8Array(4),e.length>0&&new DataView(s.buffer).setUint32(0,e.length,!1)):s=new Uint8Array;const a=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(a.buffer).setUint32(0,t.byteLength,!1),mt([112,115,115,104],new Uint8Array([i,0,0,0]),o,s,r,a,t||new Uint8Array)}function Mt(o){const e=[];if(o instanceof ArrayBuffer){const t=o.byteLength;let i=0;for(;i+32<t;){const r=new DataView(o,i),s=kt(r);e.push(s),i+=s.size}}return e}function kt(o){const e=o.getUint32(0),t=o.byteOffset,i=o.byteLength;if(i<e)return{offset:t,size:i};if(o.getUint32(4)!==1886614376)return{offset:t,size:e};const s=o.getUint32(8)>>>24;if(s!==0&&s!==1)return{offset:t,size:e};const a=o.buffer,h=J.hexDump(new Uint8Array(a,t+12,16)),g=o.getUint32(28);let d=null,v=null;if(s===0){if(e-32<g||g<22)return{offset:t,size:e};v=new Uint8Array(a,t+32,g)}else if(s===1){if(!g||i<t+32+g*16+16)return{offset:t,size:e};d=[];for(let S=0;S<g;S++)d.push(new Uint8Array(a,t+32+S*16,16))}return{version:s,systemId:h,kids:d,data:v,offset:t,size:e}}const jt=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Je={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 Ct(o,e){const t=Je[e];return!!t&&!!t[o.slice(0,4)]}function xe(o,e,t=!0){return!o.split(",").some(i=>!ve(i,e,t))}function ve(o,e,t=!0){var i;const r=q(t);return(i=r==null?void 0:r.isTypeSupported(ye(o,e)))!=null?i:!1}function ye(o,e){return`${e}/mp4;codecs=${o}`}function ee(o){if(o){const e=o.substring(0,4);return Je.video[e]}return 2}function ie(o){const e=jt();return o.split(",").reduce((t,i)=>{const s=e&&Ze(i)?9:Je.video[i];return s?(s*2+t)/(t?3:2):(Je.audio[i]+t)/(t?2:1)},0)}const ue={};function ce(o,e=!0){if(ue[o])return ue[o];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[o];for(let r=0;r<t.length;r++){var i;if(ve(t[r],"audio",e))return ue[o]=t[r],t[r];if(t[r]==="mp3"&&(i=q(e))!=null&&i.isTypeSupported("audio/mpeg"))return""}return o}const _e=/flac|opus|mp4a\.40\.34/i;function Ve(o,e=!0){return o.replace(_e,t=>ce(t.toLowerCase(),e))}function Ye(o,e){const t=[];if(o){const i=o.split(",");for(let r=0;r<i.length;r++)Ct(i[r],"video")||t.push(i[r])}return e&&t.push(e),t.join(",")}function at(o,e){if(o&&(o.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(o)!==-1))return o;if(e){const t=e.split(",");if(t.length>1){if(o){for(let i=t.length;i--;)if(t[i].substring(0,4)===o.substring(0,4))return t[i]}return t[0]}}return e||o}function ft(o){const e=o.split(",");for(let t=0;t<e.length;t++){const i=e[t].split(".");i.length>2&&i[0]==="avc1"&&(e[t]=`avc1.${parseInt(i[1]).toString(16)}${("000"+parseInt(i[2]).toString(16)).slice(-4)}`)}return e.join(",")}function Lt(o){if(o.startsWith("av01.")){const e=o.split("."),t=["0","111","01","01","01","0"];for(let i=e.length;i>4&&i<10;i++)e[i]=t[i-4];return e.join(".")}return o}function Kt(o){const e=q(o)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Et(o){return o.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const xt={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function ui(o,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:o}}const _i={};function ci(o,e,t,i,r,s){const a=o.audioCodec?o.audioGroups:null,h=s==null?void 0:s.audioCodec,g=s==null?void 0:s.channels,d=g?parseInt(g):h?1/0:2;let v=null;if(a!=null&&a.length)try{a.length===1&&a[0]?v=e.groups[a[0]].channels:v=a.reduce((S,M)=>{if(M){const j=e.groups[M];if(!j)throw new Error(`Audio track group ${M} not found`);Object.keys(j.channels).forEach(H=>{S[H]=(S[H]||0)+j.channels[H]})}return S},{2:0})}catch(S){return!0}return o.videoCodec!==void 0&&(o.width>1920&&o.height>1088||o.height>1920&&o.width>1088||o.frameRate>Math.max(i,30)||o.videoRange!=="SDR"&&o.videoRange!==t||o.bitrate>Math.max(r,8e6))||!!v&&k(d)&&Object.keys(v).some(S=>parseInt(S)>d)}function ii(o,e,t){const i=o.videoCodec,r=o.audioCodec;if(!i&&!r||!t)return Promise.resolve(xt);const s=[];if(i){const a={width:o.width,height:o.height,bitrate:Math.ceil(Math.max(o.bitrate*.9,o.averageBitrate)),framerate:o.frameRate||30},h=o.videoRange;h!=="SDR"&&(a.transferFunction=h.toLowerCase());const g=i.split(","),d=navigator.userAgent;if(g.some(v=>Ze(v))&&jt())return Promise.resolve(ui(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${d})`),s));s.push.apply(s,g.map(v=>({type:"media-source",video:u(u({},a),{},{contentType:ye(Lt(v),"video")})})))}return r&&o.audioGroups&&o.audioGroups.forEach(a=>{var h;a&&((h=e.groups[a])==null||h.tracks.forEach(g=>{if(g.groupId===a){const d=g.channels||"",v=parseFloat(d);k(v)&&v>2&&s.push.apply(s,r.split(",").map(S=>({type:"media-source",audio:{contentType:ye(S,"audio"),channels:""+v}})))}}))}),Promise.all(s.map(a=>{const h=Ut(a);return _i[h]||(_i[h]=t.decodingInfo(a))})).then(a=>({supported:!a.some(h=>!h.supported),configurations:s,decodingInfoResults:a})).catch(a=>({supported:!1,configurations:s,decodingInfoResults:[],error:a}))}function Ut(o){const{audio:e,video:t}=o,i=t||e;if(i){const r=Et(i.contentType);if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${r}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${r}`}return""}const St=["NONE","TYPE-0","TYPE-1",null];function Ot(o){return St.indexOf(o)>-1}const Xt=["SDR","PQ","HLG"];function gi(o){return!!o&&Xt.indexOf(o)>-1}var mi={No:"",Yes:"YES",v2:"v2"};function qi(o){const{canSkipUntil:e,canSkipDateRanges:t,age:i}=o,r=i<e/2;return e&&r?t?mi.v2:mi.Yes:mi.No}class Ii{constructor(e,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=i}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 Mi{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(i=>!!i).map(i=>i.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const i=(t=e.supplemental)==null?void 0:t.videoCodec;i&&i!==e.videoCodec&&(this.codecSet+=`,${i.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 br(this._audioGroups,e)}hasSubtitleGroup(e){return br(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let i=this._audioGroups;i||(i=this._audioGroups=[]),i.indexOf(t)===-1&&i.push(t)}else if(e==="text"){let i=this._subtitleGroups;i||(i=this._subtitleGroups=[]),i.indexOf(t)===-1&&i.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 br(o,e){return!e||!o?!1:o.indexOf(e)!==-1}function ri(){if(typeof matchMedia=="function"){const o=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(o.media!==e.media)return o.matches===!0}return!1}function pt(o,e){let t=!1,i=[];if(o&&(t=o!=="SDR",i=[o]),e){i=e.allowedVideoRanges||Xt.slice(0);const r=i.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:r&&ri(),t||(i=["SDR"])}return{preferHDR:t,allowedVideoRanges:i}}const ot=o=>{const e=new WeakSet;return(t,i)=>{if(o&&(i=o(t,i)),typeof i=="object"&&i!==null){if(e.has(i))return;e.add(i)}return i}},yt=(o,e)=>JSON.stringify(o,ot(e));function zt(o,e,t,i,r){const s=Object.keys(o),a=i==null?void 0:i.channels,h=i==null?void 0:i.audioCodec,g=r==null?void 0:r.videoCodec,d=a&&parseInt(a)===2;let v=!1,S=!1,M=1/0,j=1/0,H=1/0,Q=1/0,Z=0,re=[];const{preferHDR:fe,allowedVideoRanges:le}=pt(e,r);for(let Pe=s.length;Pe--;){const Ue=o[s[Pe]];v||(v=Ue.channels[2]>0),M=Math.min(M,Ue.minHeight),j=Math.min(j,Ue.minFramerate),H=Math.min(H,Ue.minBitrate),le.filter(Xe=>Ue.videoRanges[Xe]>0).length>0&&(S=!0)}M=k(M)?M:0,j=k(j)?j:0;const be=Math.max(1080,M),we=Math.max(30,j);H=k(H)?H:t,t=Math.max(H,t),S||(e=void 0);const $e=s.length>1;return{codecSet:s.reduce((Pe,Ue)=>{const De=o[Ue];if(Ue===Pe)return Pe;if(re=S?le.filter(Xe=>De.videoRanges[Xe]>0):[],$e){if(De.minBitrate>t)return Wt(Ue,`min bitrate of ${De.minBitrate} > current estimate of ${t}`),Pe;if(!De.hasDefaultAudio)return Wt(Ue,"no renditions with default or auto-select sound found"),Pe;if(h&&Ue.indexOf(h.substring(0,4))%5!==0)return Wt(Ue,`audio codec preference "${h}" not found`),Pe;if(a&&!d){if(!De.channels[a])return Wt(Ue,`no renditions with ${a} channel sound found (channels options: ${Object.keys(De.channels)})`),Pe}else if((!h||d)&&v&&De.channels[2]===0)return Wt(Ue,"no renditions with stereo sound found"),Pe;if(De.minHeight>be)return Wt(Ue,`min resolution of ${De.minHeight} > maximum of ${be}`),Pe;if(De.minFramerate>we)return Wt(Ue,`min framerate of ${De.minFramerate} > maximum of ${we}`),Pe;if(!re.some(Xe=>De.videoRanges[Xe]>0))return Wt(Ue,`no variants with VIDEO-RANGE of ${yt(re)} found`),Pe;if(g&&Ue.indexOf(g.substring(0,4))%5!==0)return Wt(Ue,`video codec preference "${g}" not found`),Pe;if(De.maxScore<Z)return Wt(Ue,`max score of ${De.maxScore} < selected max of ${Z}`),Pe}return Pe&&(ie(Ue)>=ie(Pe)||De.fragmentError>o[Pe].fragmentError)?Pe:(Q=De.minIndex,Z=De.maxScore,Ue)},void 0),videoRanges:re,preferHDR:fe,minFramerate:j,minBitrate:H,minIndex:Q}}function Wt(o,e){F.log(`[abr] start candidates with "${o}" ignored because ${e}`)}function Ti(o){return o.reduce((e,t)=>{let i=e.groups[t.groupId];i||(i=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),i.tracks.push(t);const r=t.channels||"2";return i.channels[r]=(i.channels[r]||0)+1,i.hasDefault=i.hasDefault||t.default,i.hasAutoSelect=i.hasAutoSelect||t.autoselect,i.hasDefault&&(e.hasDefaultAudio=!0),i.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Yi(o,e,t,i){return o.slice(t,i+1).reduce((r,s,a)=>{if(!s.codecSet)return r;const h=s.audioGroups;let g=r[s.codecSet];g||(r[s.codecSet]=g={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:a,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!h,fragmentError:0}),g.minBitrate=Math.min(g.minBitrate,s.bitrate);const d=Math.min(s.height,s.width);return g.minHeight=Math.min(g.minHeight,d),g.minFramerate=Math.min(g.minFramerate,s.frameRate),g.minIndex=Math.min(g.minIndex,a),g.maxScore=Math.max(g.maxScore,s.score),g.fragmentError+=s.fragmentError,g.videoRanges[s.videoRange]=(g.videoRanges[s.videoRange]||0)+1,h&&h.forEach(v=>{if(!v)return;const S=e.groups[v];S&&(g.hasDefaultAudio=g.hasDefaultAudio||e.hasDefaultAudio?S.hasDefault:S.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(S.channels).forEach(M=>{g.channels[M]=(g.channels[M]||0)+S.channels[M]}))}),r},{})}function xi(o){if(!o)return o;const{lang:e,assocLang:t,characteristics:i,channels:r,audioCodec:s}=o;return{lang:e,assocLang:t,characteristics:i,channels:r,audioCodec:s}}function Qt(o,e,t){if("attrs"in o){const i=e.indexOf(o);if(i!==-1)return i}for(let i=0;i<e.length;i++){const r=e[i];if(qt(o,r,t))return i}return-1}function qt(o,e,t){const{groupId:i,name:r,lang:s,assocLang:a,default:h}=o,g=o.forced;return(i===void 0||e.groupId===i)&&(r===void 0||e.name===r)&&(s===void 0||vi(s,e.lang))&&(s===void 0||e.assocLang===a)&&(h===void 0||e.default===h)&&(g===void 0||e.forced===g)&&(!("characteristics"in o)||Bi(o.characteristics||"",e.characteristics))&&(t===void 0||t(o,e))}function vi(o,e="--"){return o.length===e.length?o===e:o.startsWith(e)||e.startsWith(o)}function Bi(o,e=""){const t=o.split(","),i=e.split(",");return t.length===i.length&&!t.some(r=>i.indexOf(r)===-1)}function si(o,e){const{audioCodec:t,channels:i}=o;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(i===void 0||i===(e.channels||"2"))}function Ki(o,e,t,i,r){const s=e[i],h=e.reduce((M,j,H)=>{const Q=j.uri;return(M[Q]||(M[Q]=[])).push(H),M},{})[s.uri];h.length>1&&(i=Math.max.apply(Math,h));const g=s.videoRange,d=s.frameRate,v=s.codecSet.substring(0,4),S=Yt(e,i,M=>{if(M.videoRange!==g||M.frameRate!==d||M.codecSet.substring(0,4)!==v)return!1;const j=M.audioGroups,H=t.filter(Q=>!j||j.indexOf(Q.groupId)!==-1);return Qt(o,H,r)>-1});return S>-1?S:Yt(e,i,M=>{const j=M.audioGroups,H=t.filter(Q=>!j||j.indexOf(Q.groupId)!==-1);return Qt(o,H,r)>-1})}function Yt(o,e,t){for(let i=e;i>-1;i--)if(t(o[i]))return i;for(let i=e+1;i<o.length;i++)if(t(o[i]))return i;return-1}function Gt(o,e){var t;return!!o&&o!==((t=e.loadLevelObj)==null?void 0:t.uri)}class Jt extends D{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var i;const{fragCurrent:r,partCurrent:s,hls:a}=this,{autoLevelEnabled:h,media:g}=a;if(!r||!g)return;const d=performance.now(),v=s?s.stats:r.stats,S=s?s.duration:r.duration,M=d-v.loading.start,j=a.minAutoLevel,H=r.level,Q=this._nextAutoLevel;if(v.aborted||v.loaded&&v.loaded===v.total||H<=j){this.clearTimer(),this._nextAutoLevel=-1;return}if(!h)return;const Z=Q>-1&&Q!==H,re=!!t||Z;if(!re&&(g.paused||!g.playbackRate||!g.readyState))return;const fe=a.mainForwardBufferInfo;if(!re&&fe===null)return;const le=this.bwEstimator.getEstimateTTFB(),be=Math.abs(g.playbackRate);if(M<=Math.max(le,1e3*(S/(be*2))))return;const we=fe?fe.len/be:0,$e=v.loading.first?v.loading.first-v.loading.start:-1,Ae=v.loaded&&$e>-1,Pe=this.getBwEstimate(),Ue=a.levels,De=Ue[H],Xe=Math.max(v.loaded,Math.round(S*(r.bitrate||De.averageBitrate)/8));let ut=Ae?M-$e:M;ut<1&&Ae&&(ut=Math.min(M,v.loaded*8/Pe));const Tt=Ae?v.loaded*1e3/ut:0,gt=le/1e3,vt=Tt?(Xe-v.loaded)/Tt:Xe*8/Pe+gt;if(vt<=we)return;const ct=Tt?Tt*8:Pe,bt=((i=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:i.live)===!0,wt=this.hls.config.abrBandWidthUpFactor;let et=Number.POSITIVE_INFINITY,rt;for(rt=H-1;rt>j;rt--){const Vt=Ue[rt].maxBitrate,ti=!Ue[rt].details||bt;if(et=this.getTimeToLoadFrag(gt,ct,S*Vt,ti),et<Math.min(we,S+gt))break}if(et>=vt||et>S*10)return;Ae?this.bwEstimator.sample(M-Math.min(le,$e),v.loaded):this.bwEstimator.sampleTTFB(M);const Ft=Ue[rt].maxBitrate;this.getBwEstimate()*wt>Ft&&this.resetEstimator(Ft);const Pt=this.findBestLevel(Ft,j,rt,0,we,1,1);Pt>-1&&(rt=Pt),this.warn(`Fragment ${r.sn}${s?" part "+s.index:""} of level ${H} is loading too slowly;
|
|
|
Fragment duration: ${r.duration.toFixed(3)}
|
|
|
Time to underbuffer: ${we.toFixed(3)} s
|
|
|
Estimated load time for current fragment: ${vt.toFixed(3)} s
|
|
|
Estimated load time for down switch fragment: ${et.toFixed(3)} s
|
|
|
TTFB estimate: ${$e|0} ms
|
|
|
Current BW estimate: ${k(Pe)?Pe|0:"Unknown"} bps
|
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
|
Switching to level ${rt} @ ${Ft|0} bps`),a.nextLoadLevel=a.nextAutoLevel=rt,this.clearTimer();const $t=()=>{if(this.clearTimer(),this.fragCurrent===r&&this.hls.loadLevel===rt&&rt>0){const Vt=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${rt>0?"and switching down":""}
|
|
|
Fragment duration: ${r.duration.toFixed(3)} s
|
|
|
Time to underbuffer: ${Vt.toFixed(3)} s`),r.abortRequests(),this.fragCurrent=this.partCurrent=null,rt>j){let ti=this.findBestLevel(this.hls.levels[j].bitrate,j,rt,0,Vt,1,1);ti===-1&&(ti=j),this.hls.nextLoadLevel=this.hls.nextAutoLevel=ti,this.resetEstimator(this.hls.levels[ti].bitrate)}}};Z||vt>et*2?$t():this.timer=self.setInterval($t,et*1e3),a.trigger(_.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:s,stats:v})},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 y(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.FRAG_LOADING,this.onFragLoading,this),e.on(_.FRAG_LOADED,this.onFragLoaded,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this),e.on(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.FRAG_LOADING,this.onFragLoading,this),e.off(_.FRAG_LOADED,this.onFragLoaded,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this),e.off(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(_.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const i=t.frag;if(!this.ignoreFragment(i)){if(!i.bitrateTest){var r;this.fragCurrent=i,this.partCurrent=(r=t.part)!=null?r: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 i=t.frag,{fragCurrent:r,partCurrent:s}=this;if(i&&r&&i.sn===r.sn&&i.level===r.level){const a=performance.now(),h=s?s.stats:i.stats,g=a-h.loading.start,d=h.loading.first?h.loading.first-h.loading.start:-1;if(h.loaded&&d>-1){const S=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(g-Math.min(S,d),h.loaded)}else this.bwEstimator.sampleTTFB(g)}break}}}getTimeToLoadFrag(e,t,i,r){const s=e+i/t,a=r?e+this.lastLevelLoadSec:0;return s+a}onLevelLoaded(e,t){const i=this.hls.config,{loading:r}=t.stats,s=r.end-r.first;k(s)&&(this.lastLevelLoadSec=s/1e3),t.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:i}){const r=i?i.stats:t.stats;if(t.type===m.MAIN&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const s=i?i.duration:t.duration,a=this.hls.levels[t.level],h=(a.loaded?a.loaded.bytes:0)+r.loaded,g=(a.loaded?a.loaded.duration:0)+s;a.loaded={bytes:h,duration:g},a.realBitrate=Math.round(8*h/g)}if(t.bitrateTest){const s={stats:r,frag:t,part:i,id:t.type};this.onFragBuffered(_.FRAG_BUFFERED,s),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:i,part:r}=t,s=r!=null&&r.stats.loaded?r.stats:i.stats;if(s.aborted||this.ignoreFragment(i))return;const a=s.parsing.end-s.loading.start-Math.min(s.loading.first-s.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(a,s.loaded),s.bwEstimate=this.getBwEstimate(),i.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==m.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,i=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,s=this.findBestLevel(i,t,e,0,r,1,1);if(s>-1)return s;const a=this.hls.firstLevel,h=Math.min(Math.max(a,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${a} clamped to ${h}`),h}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,i=this.bwEstimator.canEstimate(),r=this.lastLoadedFragLevel>-1;if(e!==-1&&(!i||!r||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const s=i&&r?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const a=this.hls.levels;if(a.length>Math.max(e,s)&&a[e].loadError<=a[s].loadError)return e}return this._nextAutoLevel=s,this.nextAutoLevelKey=this.getAutoLevelKey(),s}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:i}=this;if(i.levels.length<=1)return i.loadLevel;const{maxAutoLevel:r,config:s,minAutoLevel:a}=i,h=t?t.duration:e?e.duration:0,g=this.getBwEstimate(),d=this.getStarvationDelay();let v=s.abrBandWidthFactor,S=s.abrBandWidthUpFactor;if(d){const Z=this.findBestLevel(g,a,r,d,0,v,S);if(Z>=0)return this.rebufferNotice=-1,Z}let M=h?Math.min(h,s.maxStarvationDelay):s.maxStarvationDelay;if(!d){const Z=this.bitrateTestDelay;Z&&(M=(h?Math.min(h,s.maxLoadingDelay):s.maxLoadingDelay)-Z,this.info(`bitrate test took ${Math.round(1e3*Z)}ms, set first fragment max fetchDuration to ${Math.round(1e3*M)} ms`),v=S=1)}const j=this.findBestLevel(g,a,r,d,M,v,S);if(this.rebufferNotice!==j&&(this.rebufferNotice=j,this.info(`${d?"rebuffering expected":"buffer is empty"}, optimal quality level ${j}`)),j>-1)return j;const H=i.levels[a],Q=i.loadLevelObj;return Q&&(H==null?void 0:H.bitrate)<Q.bitrate?a:i.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const i=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,r=e.mainForwardBufferInfo;return(r?r.len:0)/i}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,i,r,s,a,h){var g;const d=r+s,v=this.lastLoadedFragLevel,S=v===-1?this.hls.firstLevel:v,{fragCurrent:M,partCurrent:j}=this,{levels:H,allAudioTracks:Q,loadLevel:Z,config:re}=this.hls;if(H.length===1)return 0;const fe=H[S],le=!!((g=this.hls.latestLevelDetails)!=null&&g.live),be=Z===-1||v===-1;let we,$e="SDR",Ae=(fe==null?void 0:fe.frameRate)||0;const{audioPreference:Pe,videoPreference:Ue}=re,De=this.audioTracksByGroup||(this.audioTracksByGroup=Ti(Q));let Xe=-1;if(be){if(this.firstSelection!==-1)return this.firstSelection;const ct=this.codecTiers||(this.codecTiers=Yi(H,De,t,i)),bt=zt(ct,$e,e,Pe,Ue),{codecSet:wt,videoRanges:et,minFramerate:rt,minBitrate:Ft,minIndex:Pt,preferHDR:$t}=bt;Xe=Pt,we=wt,$e=$t?et[et.length-1]:et[0],Ae=rt,e=Math.max(e,Ft),this.log(`picked start tier ${yt(bt)}`)}else we=fe==null?void 0:fe.codecSet,$e=fe==null?void 0:fe.videoRange;const ut=j?j.duration:M?M.duration:0,Tt=this.bwEstimator.getEstimateTTFB()/1e3,gt=[];for(let ct=i;ct>=t;ct--){var vt;const bt=H[ct],wt=ct>S;if(!bt)continue;if(re.useMediaCapabilities&&!bt.supportedResult&&!bt.supportedPromise){const ti=navigator.mediaCapabilities;typeof(ti==null?void 0:ti.decodingInfo)=="function"&&(ci(bt,De,$e,Ae,e,Pe)||Ze(bt.videoCodec))?(bt.supportedPromise=ii(bt,De,ti),bt.supportedPromise.then(li=>{if(!this.hls)return;bt.supportedResult=li;const $i=this.hls.levels,Gi=$i.indexOf(bt);li.error?this.warn(`MediaCapabilities decodingInfo error: "${li.error}" for level ${Gi} ${yt(li)}`):li.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${Gi} ${yt(li)}`),Gi>-1&&$i.length>1&&(this.log(`Removing unsupported level ${Gi}`),this.hls.removeLevel(Gi),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):bt.supportedResult=xt}if((we&&bt.codecSet!==we||$e&&bt.videoRange!==$e||wt&&Ae>bt.frameRate||!wt&&Ae>0&&Ae<bt.frameRate||bt.supportedResult&&!((vt=bt.supportedResult.decodingInfoResults)!=null&&vt[0].smooth))&&(!be||ct!==Xe)){gt.push(ct);continue}const et=bt.details,rt=(j?et==null?void 0:et.partTarget:et==null?void 0:et.averagetargetduration)||ut;let Ft;wt?Ft=h*e:Ft=a*e;const Pt=ut&&r>=ut*2&&s===0?bt.averageBitrate:bt.maxBitrate,$t=this.getTimeToLoadFrag(Tt,Ft,Pt*rt,et===void 0);if(Ft>=Pt&&(ct===v||bt.loadError===0&&bt.fragmentError===0)&&($t<=Tt||!k($t)||le&&!this.bitrateTestDelay||$t<d)){const ti=this.forcedAutoLevel;return ct!==Z&&(ti===-1||ti!==Z)&&(gt.length&&this.trace(`Skipped level(s) ${gt.join(",")} of ${i} max with CODECS and VIDEO-RANGE:"${H[gt[0]].codecs}" ${H[gt[0]].videoRange}; not compatible with "${we}" ${$e}`),this.info(`switch candidate:${S}->${ct} adjustedbw(${Math.round(Ft)})-bitrate=${Math.round(Ft-Pt)} ttfb:${Tt.toFixed(1)} avgDuration:${rt.toFixed(1)} maxFetchDuration:${d.toFixed(1)} fetchDuration:${$t.toFixed(1)} firstSelection:${be} codecSet:${bt.codecSet} videoRange:${bt.videoRange} hls.loadLevel:${Z}`)),be&&(this.firstSelection=ct),ct}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:i}=this.hls;return Math.min(Math.max(e,i),t)}}const bi={search:function(o,e){let t=0,i=o.length-1,r=null,s=null;for(;t<=i;){r=(t+i)/2|0,s=o[r];const a=e(s);if(a>0)t=r+1;else if(a<0)i=r-1;else return s}return null}};function Ei(o,e,t){if(e===null||!Array.isArray(o)||!o.length||!k(e))return null;const i=o[0].programDateTime;if(e<(i||0))return null;const r=o[o.length-1].endProgramDateTime;if(e>=(r||0))return null;for(let s=0;s<o.length;++s){const a=o[s];if(Qr(e,t,a))return a}return null}function ni(o,e,t=0,i=0,r=.005){let s=null;if(o){s=e[1+o.sn-e[0].sn]||null;const h=o.endDTS-t;h>0&&h<15e-7&&(t+=15e-7),s&&o.level!==s.level&&s.end<=o.end&&(s=e[2+o.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(s=e[0]);if(s&&((!o||o.level===s.level)&&wi(t,i,s)===0||Pi(s,o,Math.min(r,i))))return s;const a=bi.search(e,wi.bind(null,t,i));return a&&(a!==o||!s)?a:s}function Pi(o,e,t){if(e&&e.start===0&&e.level<o.level&&(e.endPTS||0)>0){const i=e.tagList.reduce((r,s)=>(s[0]==="INF"&&(r+=parseFloat(s[1])),r),t);return o.start<=i}return!1}function wi(o=0,e=0,t){if(t.start<=o&&t.start+t.duration>o)return 0;const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-i<=o?1:t.start-i>o&&t.start?-1:0}function Qr(o,e,t){const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-i>o}function Ni(o,e,t){if(o&&o.startCC<=e&&o.endCC>=e){let i=o.fragments;const{fragmentHint:r}=o;r&&(i=i.concat(r));let s;return bi.search(i,a=>a.cc<e?1:a.cc>e?-1:(s=a,a.end<=t?1:a.start>t?-1:0)),s||null}return null}function ei(o){switch(o.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 hi(o,e){const t=ei(e);return o.default[`${t?"timeout":"error"}Retry`]}function Ui(o,e){const t=o.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*o.retryDelayMs,o.maxRetryDelayMs)}function fr(o){return u(u({},o),{errorRetry:null,timeoutRetry:null})}function Di(o,e,t,i){if(!o)return!1;const r=i==null?void 0:i.code,s=e<o.maxNumRetry&&(Jr(r)||!!t);return o.shouldRetry?o.shouldRetry(o,e,t,i,s):s}function Jr(o){return o===0&&navigator.onLine===!1||!!o&&(o<400||o>499)}var yi={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Ci={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Er extends D{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(_.ERROR,this.onError,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(_.ERROR,this.onError,this),e.off(_.ERROR,this.onErrorOut,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.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)===m.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var i;if(t.fatal)return;const r=this.hls,s=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((i=t.frag)!=null&&i.gap){t.errorAction=Sr();return}case w.FRAG_GAP:case w.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=yi.SendAlternateToPenaltyBox;return}case w.LEVEL_EMPTY_ERROR:case w.LEVEL_PARSING_ERROR:{var a,h;const d=t.parent===m.MAIN?t.level:r.loadLevel;t.details===w.LEVEL_EMPTY_ERROR&&((a=t.context)!=null&&(h=a.levelDetails)!=null&&h.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,d):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,d))}return;case w.LEVEL_LOAD_ERROR:case w.LEVEL_LOAD_TIMEOUT:typeof(s==null?void 0:s.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.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(s){const d=r.loadLevelObj;if(d&&(s.type===O.AUDIO_TRACK&&d.hasAudioGroup(s.groupId)||s.type===O.SUBTITLE_TRACK&&d.hasSubtitleGroup(s.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=yi.SendAlternateToPenaltyBox,t.errorAction.flags=Ci.MoveAllAlternatesMatchingHost;return}}return;case w.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const d=r.loadLevelObj,v=d==null?void 0:d.attrs["HDCP-LEVEL"];v?t.errorAction={action:yi.SendAlternateToPenaltyBox,flags:Ci.MoveAllAlternatesMatchingHDCP,hdcpLevel:v}:this.keySystemError(t)}return;case w.BUFFER_ADD_CODEC_ERROR:case w.REMUX_ALLOC_ERROR:case w.BUFFER_APPEND_ERROR:if(!t.errorAction){var g;t.errorAction=this.getLevelSwitchAction(t,(g=t.level)!=null?g:r.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=Sr();return}t.type===T.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 i=this.hls,r=hi(i.config.playlistLoadPolicy,e),s=this.playlistError++;if(Di(r,s,ei(e),e.response))return{action:yi.RetryRequest,flags:Ci.None,retryConfig:r,retryCount:s};const h=this.getLevelSwitchAction(e,t);return r&&(h.retryConfig=r,h.retryCount=s),h}getFragRetryOrSwitchAction(e){const t=this.hls,i=this.getVariantLevelIndex(e.frag),r=t.levels[i],{fragLoadPolicy:s,keyLoadPolicy:a}=t.config,h=hi(e.details.startsWith("key")?a:s,e),g=t.levels.reduce((v,S)=>v+S.fragmentError,0);if(r&&(e.details!==w.FRAG_GAP&&r.fragmentError++,Di(h,g,ei(e),e.response)))return{action:yi.RetryRequest,flags:Ci.None,retryConfig:h,retryCount:g};const d=this.getLevelSwitchAction(e,i);return h&&(d.retryConfig=h,d.retryCount=g),d}getLevelSwitchAction(e,t){const i=this.hls;t==null&&(t=i.loadLevel);const r=this.hls.levels[t];if(r){var s,a;const d=e.details;r.loadError++,d===w.BUFFER_APPEND_ERROR&&r.fragmentError++;let v=-1;const{levels:S,loadLevel:M,minAutoLevel:j,maxAutoLevel:H}=i;!i.autoLevelEnabled&&!i.config.preserveManualLevelOnError&&(i.loadLevel=-1);const Q=(s=e.frag)==null?void 0:s.type,re=(Q===m.AUDIO&&d===w.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(d===w.BUFFER_ADD_CODEC_ERROR||d===w.BUFFER_APPEND_ERROR))&&S.some(({audioCodec:$e})=>r.audioCodec!==$e),le=e.sourceBufferName==="video"&&(d===w.BUFFER_ADD_CODEC_ERROR||d===w.BUFFER_APPEND_ERROR)&&S.some(({codecSet:$e,audioCodec:Ae})=>r.codecSet!==$e&&r.audioCodec===Ae),{type:be,groupId:we}=(a=e.context)!=null?a:{};for(let $e=S.length;$e--;){const Ae=($e+M)%S.length;if(Ae!==M&&Ae>=j&&Ae<=H&&S[Ae].loadError===0){var h,g;const Pe=S[Ae];if(d===w.FRAG_GAP&&Q===m.MAIN&&e.frag){const Ue=S[Ae].details;if(Ue){const De=ni(e.frag,Ue.fragments,e.frag.start);if(De!=null&&De.gap)continue}}else{if(be===O.AUDIO_TRACK&&Pe.hasAudioGroup(we)||be===O.SUBTITLE_TRACK&&Pe.hasSubtitleGroup(we))continue;if(Q===m.AUDIO&&(h=r.audioGroups)!=null&&h.some(Ue=>Pe.hasAudioGroup(Ue))||Q===m.SUBTITLE&&(g=r.subtitleGroups)!=null&&g.some(Ue=>Pe.hasSubtitleGroup(Ue))||re&&r.audioCodec===Pe.audioCodec||!re&&r.audioCodec!==Pe.audioCodec||le&&r.codecSet===Pe.codecSet)continue}v=Ae;break}}if(v>-1&&i.loadLevel!==v)return e.levelRetry=!0,this.playlistError=0,{action:yi.SendAlternateToPenaltyBox,flags:Ci.None,nextAutoLevel:v}}return{action:yi.SendAlternateToPenaltyBox,flags:Ci.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var i;switch((i=t.errorAction)==null?void 0:i.action){case yi.DoNothing:break;case yi.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 yi.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,i=e.errorAction;if(!i)return;const{flags:r,hdcpLevel:s,nextAutoLevel:a}=i;switch(r){case Ci.None:this.switchLevel(e,a);break;case Ci.MoveAllAlternatesMatchingHDCP:s&&(t.maxHdcpLevel=St[St.indexOf(s)-1],i.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}i.resolved||this.switchLevel(e,a)}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 i=Et(e.mimeType),r=this.hls.levels;for(let s=r.length;s--;)r[s][`${e.sourceBufferName}Codec`]===i&&this.hls.removeLevel(s)}}}function Sr(o){const e={action:yi.DoNothing,flags:Ci.None};return o&&(e.resolved=!0),e}var di={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class kr{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(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.BUFFER_APPENDED,this.onBufferAppended,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this),e.on(_.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.BUFFER_APPENDED,this.onBufferAppended,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this),e.off(_.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const i=this.activePartLists[t];if(i)for(let r=i.length;r--;){const s=i[r];if(!s)break;const a=s.end;if(s.start<=e&&a!==null&&e<=a)return s}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,i){const{fragments:r}=this,s=Object.keys(r);for(let a=s.length;a--;){const h=r[s[a]];if((h==null?void 0:h.body.type)===t&&(!i||h.buffered)){const g=h.body;if(g.start<=e&&e<=g.end)return g}}return null}detectEvictedFragments(e,t,i,r,s){this.timeRanges&&(this.timeRanges[e]=t);const a=(r==null?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach(h=>{const g=this.fragments[h];if(!g||a>=g.body.sn)return;if(!g.buffered&&(!g.loaded||s)){g.body.type===i&&this.removeFragment(g.body);return}const d=g.range[e];if(d){if(d.time.length===0){this.removeFragment(g.body);return}d.time.some(v=>{const S=!this.isTimeBuffered(v.startPTS,v.endPTS,t);return S&&this.removeFragment(g.body),S})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const i=e.frag,r=nr(i),s=this.fragments[r];if(!s||s.buffered&&i.gap)return;const a=!i.relurl;Object.keys(t).forEach(h=>{const g=i.elementaryStreams[h];if(!g)return;const d=t[h],v=a||g.partial===!0;s.range[h]=this.getBufferedTimes(i,e.part,v,d)}),s.loaded=null,Object.keys(s.range).length?(s.buffered=!0,(s.body.endList=i.endList||s.body.endList)&&(this.endListFragments[s.body.type]=s),dr(s)||this.removeParts(i.sn-1,i.type)):this.removeFragment(s.body)}removeParts(e,t){const i=this.activePartLists[t];i&&(this.activePartLists[t]=sr(i,r=>r.fragment.sn>=e))}fragBuffered(e,t){const i=nr(e);let r=this.fragments[i];!r&&t&&(r=this.fragments[i]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(e,t,i,r){const s={time:[],partial:i},a=e.start,h=e.end,g=e.minEndPTS||h,d=e.maxStartPTS||a;for(let v=0;v<r.length;v++){const S=r.start(v)-this.bufferPadding,M=r.end(v)+this.bufferPadding;if(d>=S&&g<=M){s.time.push({startPTS:Math.max(a,r.start(v)),endPTS:Math.min(h,r.end(v))});break}else if(a<M&&h>S){const j=Math.max(a,r.start(v)),H=Math.min(h,r.end(v));H>j&&(s.partial=!0,s.time.push({startPTS:j,endPTS:H}))}else if(h<=S)break}return s}getPartialFragment(e){let t=null,i,r,s,a=0;const{bufferPadding:h,fragments:g}=this;return Object.keys(g).forEach(d=>{const v=g[d];v&&dr(v)&&(r=v.body.start-h,s=v.body.end+h,e>=r&&e<=s&&(i=Math.min(e-r,s-e),a<=i&&(t=v.body,a=i)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||dr(t))}getState(e){const t=nr(e),i=this.fragments[t];return i?i.buffered?dr(i)?di.PARTIAL:di.OK:di.APPENDING:di.NOT_LOADED}isTimeBuffered(e,t,i){let r,s;for(let a=0;a<i.length;a++){if(r=i.start(a)-this.bufferPadding,s=i.end(a)+this.bufferPadding,e>=r&&t<=s)return!0;if(t<=r)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const i=t.frag,r=t.part?null:t,s=nr(i);this.fragments[s]={body:i,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:i,part:r,timeRanges:s,type:a}=t;if(i.sn==="initSegment")return;const h=i.type;if(r){let d=this.activePartLists[h];d||(this.activePartLists[h]=d=[]),d.push(r)}this.timeRanges=s;const g=s[a];this.detectEvictedFragments(a,g,h,r)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=nr(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,i=Object.keys(t);if(!e)return i.length>0;for(let r=i.length;r--;){const s=t[i[r]];if((s==null?void 0:s.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,i,r,s){r&&!this.hasGaps||Object.keys(this.fragments).forEach(a=>{const h=this.fragments[a];if(!h)return;const g=h.body;g.type!==i||r&&!g.gap||g.start<t&&g.end>e&&(h.buffered||s)&&this.removeFragment(g)})}removeFragment(e){const t=nr(e);e.clearElementaryStreamInfo();const i=this.activePartLists[e.type];if(i){const r=e.sn;this.activePartLists[e.type]=sr(i,s=>s.fragment.sn!==r)}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 i=(e=this.hls)==null||(t=e.latestLevelDetails)==null?void 0:t.partList;i&&i.forEach(r=>r.clearElementaryStreamInfo())}}function dr(o){var e,t,i;return o.buffered&&(o.body.gap||((e=o.range.video)==null?void 0:e.partial)||((t=o.range.audio)==null?void 0:t.partial)||((i=o.range.audiovideo)==null?void 0:i.partial))}function nr(o){return`${o.type}_${o.level}_${o.sn}`}function sr(o,e){return o.filter(t=>{const i=e(t);return i||t.clearElementaryStreamInfo(),i})}var Li={cbc:0,ctr:1};class xr{constructor(e,t,i){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=i}decrypt(e,t){switch(this.aesMode){case Li.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Li.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 ar(o){const e=o.byteLength,t=e&&new DataView(o.buffer).getUint8(e-1);return t?o.slice(0,e-t):o}class en{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),i=new Uint32Array(4);for(let r=0;r<4;r++)i[r]=t.getUint32(r*4);return i}initTable(){const e=this.sBox,t=this.invSBox,i=this.subMix,r=i[0],s=i[1],a=i[2],h=i[3],g=this.invSubMix,d=g[0],v=g[1],S=g[2],M=g[3],j=new Uint32Array(256);let H=0,Q=0,Z=0;for(Z=0;Z<256;Z++)Z<128?j[Z]=Z<<1:j[Z]=Z<<1^283;for(Z=0;Z<256;Z++){let re=Q^Q<<1^Q<<2^Q<<3^Q<<4;re=re>>>8^re&255^99,e[H]=re,t[re]=H;const fe=j[H],le=j[fe],be=j[le];let we=j[re]*257^re*16843008;r[H]=we<<24|we>>>8,s[H]=we<<16|we>>>16,a[H]=we<<8|we>>>24,h[H]=we,we=be*16843009^le*65537^fe*257^H*16843008,d[re]=we<<24|we>>>8,v[re]=we<<16|we>>>16,S[re]=we<<8|we>>>24,M[re]=we,H?(H=fe^j[j[j[be^fe]]],Q^=j[j[Q]]):H=Q=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let i=!0,r=0;for(;r<t.length&&i;)i=t[r]===this.key[r],r++;if(i)return;this.key=t;const s=this.keySize=t.length;if(s!==4&&s!==6&&s!==8)throw new Error("Invalid aes key size="+s);const a=this.ksRows=(s+6+1)*4;let h,g;const d=this.keySchedule=new Uint32Array(a),v=this.invKeySchedule=new Uint32Array(a),S=this.sBox,M=this.rcon,j=this.invSubMix,H=j[0],Q=j[1],Z=j[2],re=j[3];let fe,le;for(h=0;h<a;h++){if(h<s){fe=d[h]=t[h];continue}le=fe,h%s===0?(le=le<<8|le>>>24,le=S[le>>>24]<<24|S[le>>>16&255]<<16|S[le>>>8&255]<<8|S[le&255],le^=M[h/s|0]<<24):s>6&&h%s===4&&(le=S[le>>>24]<<24|S[le>>>16&255]<<16|S[le>>>8&255]<<8|S[le&255]),d[h]=fe=(d[h-s]^le)>>>0}for(g=0;g<a;g++)h=a-g,g&3?le=d[h]:le=d[h-4],g<4||h<=4?v[g]=le:v[g]=H[S[le>>>24]]^Q[S[le>>>16&255]]^Z[S[le>>>8&255]]^re[S[le&255]],v[g]=v[g]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,i){const r=this.keySize+6,s=this.invKeySchedule,a=this.invSBox,h=this.invSubMix,g=h[0],d=h[1],v=h[2],S=h[3],M=this.uint8ArrayToUint32Array_(i);let j=M[0],H=M[1],Q=M[2],Z=M[3];const re=new Int32Array(e),fe=new Int32Array(re.length);let le,be,we,$e,Ae,Pe,Ue,De,Xe,ut,Tt,gt,vt,ct;const bt=this.networkToHostOrderSwap;for(;t<re.length;){for(Xe=bt(re[t]),ut=bt(re[t+1]),Tt=bt(re[t+2]),gt=bt(re[t+3]),Ae=Xe^s[0],Pe=gt^s[1],Ue=Tt^s[2],De=ut^s[3],vt=4,ct=1;ct<r;ct++)le=g[Ae>>>24]^d[Pe>>16&255]^v[Ue>>8&255]^S[De&255]^s[vt],be=g[Pe>>>24]^d[Ue>>16&255]^v[De>>8&255]^S[Ae&255]^s[vt+1],we=g[Ue>>>24]^d[De>>16&255]^v[Ae>>8&255]^S[Pe&255]^s[vt+2],$e=g[De>>>24]^d[Ae>>16&255]^v[Pe>>8&255]^S[Ue&255]^s[vt+3],Ae=le,Pe=be,Ue=we,De=$e,vt=vt+4;le=a[Ae>>>24]<<24^a[Pe>>16&255]<<16^a[Ue>>8&255]<<8^a[De&255]^s[vt],be=a[Pe>>>24]<<24^a[Ue>>16&255]<<16^a[De>>8&255]<<8^a[Ae&255]^s[vt+1],we=a[Ue>>>24]<<24^a[De>>16&255]<<16^a[Ae>>8&255]<<8^a[Pe&255]^s[vt+2],$e=a[De>>>24]<<24^a[Ae>>16&255]<<16^a[Pe>>8&255]<<8^a[Ue&255]^s[vt+3],fe[t]=bt(le^j),fe[t+1]=bt($e^H),fe[t+2]=bt(we^Q),fe[t+3]=bt(be^Z),j=Xe,H=ut,Q=Tt,Z=gt,t=t+4}return fe.buffer}}class Oi{constructor(e,t,i){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=i}expandKey(){const e=wr(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function wr(o){switch(o){case Li.cbc:return"AES-CBC";case Li.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${o}`)}}const tn=16;class Ur{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 i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(i){}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 i=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?ar(i):i}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,i,r){return this.useSoftware?new Promise((s,a)=>{const h=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(h,t,i,r);const g=this.flush();g?s(g.buffer):a(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,i,r)}softwareDecrypt(e,t,i,r){const{currentIV:s,currentResult:a,remainderData:h}=this;if(r!==Li.cbc||t.byteLength!==16)return F.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),h&&(e=je(h,e),this.remainderData=null);const g=this.getValidChunk(e);if(!g.length)return null;s&&(i=s);let d=this.softwareDecrypter;d||(d=this.softwareDecrypter=new en),d.expandKey(t);const v=a;return this.currentResult=d.decrypt(g.buffer,0,i),this.currentIV=g.slice(-16).buffer,v||null}webCryptoDecrypt(e,t,i,r){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,i,r));this.key=t,this.fastAesKey=new Oi(this.subtle,t,r)}return this.fastAesKey.expandKey().then(s=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new xr(this.subtle,new Uint8Array(i),r).decrypt(e.buffer,s)):Promise.reject(new Error("web crypto not initialized"))).catch(s=>(F.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${s.name}: ${s.message}`),this.onWebCryptoError(e,t,i,r)))}onWebCryptoError(e,t,i,r){const s=this.enableSoftwareAES;if(s){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,i,r);const a=this.flush();if(a)return a.buffer}throw new Error("WebCrypto"+(s?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const i=e.length-e.length%tn;return i!==e.length&&(t=e.slice(0,i),this.remainderData=e.slice(i)),t}logOnce(e){this.logEnabled&&(F.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const pr=Math.pow(2,17);class rn{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 i=e.url;if(!i)return Promise.reject(new Ri({type:T.NETWORK_ERROR,details:w.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${i?"part list":"url"}`),networkDetails:null}));this.abort();const r=this.config,s=r.fLoader,a=r.loader;return new Promise((h,g)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(H=>H[0]==="GAP")){g($r(e));return}else e.gap=!1;const d=this.loader=s?new s(r):new a(r),v=nn(e);e.loader=d;const S=fr(r.fragLoadPolicy.default),M={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:pr};e.stats=d.stats;const j={onSuccess:(H,Q,Z,re)=>{this.resetLoader(e,d);let fe=H.data;Z.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(fe.slice(0,16)),fe=fe.slice(16)),h({frag:e,part:null,payload:fe,networkDetails:re})},onError:(H,Q,Z,re)=>{this.resetLoader(e,d),g(new Ri({type:T.NETWORK_ERROR,details:w.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:u({url:i,data:void 0},H),error:new Error(`HTTP Error ${H.code} ${H.text}`),networkDetails:Z,stats:re}))},onAbort:(H,Q,Z)=>{this.resetLoader(e,d),g(new Ri({type:T.NETWORK_ERROR,details:w.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:Z,stats:H}))},onTimeout:(H,Q,Z)=>{this.resetLoader(e,d),g(new Ri({type:T.NETWORK_ERROR,details:w.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${M.timeout}ms`),networkDetails:Z,stats:H}))}};t&&(j.onProgress=(H,Q,Z,re)=>t({frag:e,part:null,payload:Z,networkDetails:re})),d.load(v,M,j)})}loadPart(e,t,i){this.abort();const r=this.config,s=r.fLoader,a=r.loader;return new Promise((h,g)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){g($r(e,t));return}const d=this.loader=s?new s(r):new a(r),v=nn(e,t);e.loader=d;const S=fr(r.fragLoadPolicy.default),M={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:pr};t.stats=d.stats,d.load(v,M,{onSuccess:(j,H,Q,Z)=>{this.resetLoader(e,d),this.updateStatsFromPart(e,t);const re={frag:e,part:t,payload:j.data,networkDetails:Z};i(re),h(re)},onError:(j,H,Q,Z)=>{this.resetLoader(e,d),g(new Ri({type:T.NETWORK_ERROR,details:w.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:u({url:v.url,data:void 0},j),error:new Error(`HTTP Error ${j.code} ${j.text}`),networkDetails:Q,stats:Z}))},onAbort:(j,H,Q)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,d),g(new Ri({type:T.NETWORK_ERROR,details:w.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:Q,stats:j}))},onTimeout:(j,H,Q)=>{this.resetLoader(e,d),g(new Ri({type:T.NETWORK_ERROR,details:w.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${M.timeout}ms`),networkDetails:Q,stats:j}))}})})}updateStatsFromPart(e,t){const i=e.stats,r=t.stats,s=r.total;if(i.loaded+=r.loaded,s){const g=Math.round(e.duration/t.duration),d=Math.min(Math.round(i.loaded/s),g),S=(g-d)*Math.round(i.loaded/d);i.total=i.loaded+S}else i.total=Math.max(i.loaded,i.total);const a=i.loading,h=r.loading;a.start?a.first+=h.first-h.start:(a.start=h.start,a.first=h.first),a.end=h.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function nn(o,e=null){const t=e||o,i={frag:o,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},r=t.byteRangeStartOffset,s=t.byteRangeEndOffset;if(k(r)&&k(s)){var a;let h=r,g=s;if(o.sn==="initSegment"&&sn((a=o.decryptdata)==null?void 0:a.method)){const d=s-r;d%16&&(g=s+(16-d%16)),r!==0&&(i.resetIV=!0,h=r-16)}i.rangeStart=h,i.rangeEnd=g}return i}function $r(o,e){const t=new Error(`GAP ${o.gap?"tag":"attribute"} found`),i={type:T.MEDIA_ERROR,details:w.FRAG_GAP,fatal:!1,frag:o,error:t,networkDetails:null};return e&&(i.part=e),(e||o).stats.aborted=!0,new Ri(i)}function sn(o){return o==="AES-128"||o==="AES-256"}class Ri extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class _r extends D{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 Cr{constructor(e,t,i,r=0,s=-1,a=!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=Zi(),this.buffering={audio:Zi(),video:Zi(),audiovideo:Zi()},this.level=e,this.sn=t,this.id=i,this.size=r,this.part=s,this.partial=a}}function Zi(){return{start:0,executeStart:0,executeEnd:0,end:0}}const Ir={length:0,start:()=>0,end:()=>0};class Rt{static isBuffered(e,t){if(e){const i=Rt.getBuffered(e);for(let r=i.length;r--;)if(t>=i.start(r)&&t<=i.end(r))return!0}return!1}static bufferedRanges(e){if(e){const t=Rt.getBuffered(e);return Rt.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}static bufferInfo(e,t,i){if(e){const r=Rt.bufferedRanges(e);if(r.length)return Rt.bufferedInfo(r,t,i)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,i){t=Math.max(0,t),e.length>1&&e.sort((v,S)=>v.start-S.start||S.end-v.end);let r=-1,s=[];if(i)for(let v=0;v<e.length;v++){t>=e[v].start&&t<=e[v].end&&(r=v);const S=s.length;if(S){const M=s[S-1].end;e[v].start-M<i?e[v].end>M&&(s[S-1].end=e[v].end):s.push(e[v])}else s.push(e[v])}else s=e;let a=0,h,g=t,d=t;for(let v=0;v<s.length;v++){const S=s[v].start,M=s[v].end;if(r===-1&&t>=S&&t<=M&&(r=v),t+i>=S&&t<M)g=S,d=M,a=d-t;else if(t+i<S){h=S;break}}return{len:a,start:g||0,end:d||0,nextStart:h,buffered:e,bufferedIndex:r}}static getBuffered(e){try{return e.buffered||Ir}catch(t){return F.log("failed to get media.buffered",t),Ir}}}const Hi=/\{\$([a-zA-Z0-9-_]+)\}/g;function or(o){return Hi.test(o)}function Xi(o,e){if(o.variableList!==null||o.hasVariableRefs){const t=o.variableList;return e.replace(Hi,i=>{const r=i.substring(2,i.length-1),s=t==null?void 0:t[r];return s===void 0?(o.playlistParsingError||(o.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),i):s})}return e}function lr(o,e,t){let i=o.variableList;i||(o.variableList=i={});let r,s;if("QUERYPARAM"in e){r=e.QUERYPARAM;try{const a=new self.URL(t).searchParams;if(a.has(r))s=a.get(r);else throw new Error(`"${r}" does not match any query parameter in URI: "${t}"`)}catch(a){o.playlistParsingError||(o.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${a.message}`))}}else r=e.NAME,s=e.VALUE;r in i?o.playlistParsingError||(o.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):i[r]=s||""}function Hr(o,e,t){const i=e.IMPORT;if(t&&i in t){let r=o.variableList;r||(o.variableList=r={}),r[i]=t[i]}else o.playlistParsingError||(o.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${i}"`))}const mn=/^(\d+)x(\d+)$/,jr=/(.+?)=(".*?"|.*?)(?:,|$)/g;class ai{constructor(e,t){typeof e=="string"&&(e=ai.parseAttrList(e,t)),c(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 i=new Uint8Array(t.length/2);for(let r=0;r<t.length/2;r++)i[r]=parseInt(t.slice(r*2,r*2+2),16);return i}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 i=this[e];return i?parseFloat(i):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const i=this[e];return(i?i.split(/[ ,]+/):[]).reduce((r,s)=>(r[s.toLowerCase()]=!0,r),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=mn.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let i;const r={},s='"';for(jr.lastIndex=0;(i=jr.exec(e))!==null;){const a=i[1].trim();let h=i[2];const g=h.indexOf(s)===0&&h.lastIndexOf(s)===h.length-1;let d=!1;if(g)h=h.slice(1,-1);else switch(a){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":d=!0}if(t&&(g||d))h=Xi(t,h);else if(!d&&!g)switch(a){case"CLOSED-CAPTIONS":if(h==="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":F.warn(`${e}: attribute ${a} is missing quotes`)}r[a]=h}return r}}const an="com.apple.hls.interstitial";function vn(o){return o!=="ID"&&o!=="CLASS"&&o!=="CUE"&&o!=="START-DATE"&&o!=="DURATION"&&o!=="END-DATE"&&o!=="END-ON-NEXT"}function yn(o){return o==="SCTE35-OUT"||o==="SCTE35-IN"||o==="SCTE35-CMD"}class Wr{constructor(e,t,i=0){var r;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=(r=t==null?void 0:t.tagOrder)!=null?r:i,t){const s=t.attr;for(const a in s)if(Object.prototype.hasOwnProperty.call(e,a)&&e[a]!==s[a]){F.warn(`DATERANGE tag attribute: "${a}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=a;break}e=c(new ai({}),s,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 s=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);k(s.getTime())&&(this._endDate=s)}}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?(F.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(k(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===an}get isValid(){return!!this.id&&!this._badValueForSameId&&k(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 bn=10;class En{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,i=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!i||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&i>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?k(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||bn}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 i=e.length;i--;)if(e[i].index>t)return e[i].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 ur(o){return o==="AES-128"||o==="AES-256"||o==="AES-256-CTR"}function Gr(o){switch(o){case"AES-128":case"AES-256":return Li.cbc;case"AES-256-CTR":return Li.ctr;default:throw new Error(`invalid full segment method ${o}`)}}function Kr(o){return Uint8Array.from(atob(o),e=>e.charCodeAt(0))}function zr(o){return Uint8Array.from(unescape(encodeURIComponent(o)),e=>e.charCodeAt(0))}function Qi(o){const e=zr(o).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Vr(o){const e=function(i,r,s){const a=i[r];i[r]=i[s],i[s]=a};e(o,0,3),e(o,1,2),e(o,4,5),e(o,6,7)}function Sn(o){const e=o.split(":");let t=null;if(e[0]==="data"&&e.length===2){const i=e[1].split(";"),r=i[i.length-1].split(",");if(r.length===2){const s=r[0]==="base64",a=r[1];s?(i.splice(-1,1),t=Kr(a)):t=Qi(a)}}return t}const ki=typeof self!="undefined"?self:void 0;var Ht={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Si={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function ji(o){switch(o){case Si.FAIRPLAY:return Ht.FAIRPLAY;case Si.PLAYREADY:return Ht.PLAYREADY;case Si.WIDEVINE:return Ht.WIDEVINE;case Si.CLEARKEY:return Ht.CLEARKEY}}var Ji={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Pr(o){if(o===Ji.WIDEVINE)return Ht.WIDEVINE;if(o===Ji.PLAYREADY)return Ht.PLAYREADY;if(o===Ji.CENC||o===Ji.CLEARKEY)return Ht.CLEARKEY}function Ar(o){switch(o){case Ht.FAIRPLAY:return Si.FAIRPLAY;case Ht.PLAYREADY:return Si.PLAYREADY;case Ht.WIDEVINE:return Si.WIDEVINE;case Ht.CLEARKEY:return Si.CLEARKEY}}function Tr(o){const{drmSystems:e,widevineLicenseUrl:t}=o,i=e?[Ht.FAIRPLAY,Ht.WIDEVINE,Ht.PLAYREADY,Ht.CLEARKEY].filter(r=>!!e[r]):[];return!i[Ht.WIDEVINE]&&t&&i.push(Ht.WIDEVINE),i}const on=function(o){return ki!=null&&(o=ki.navigator)!=null&&o.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function _t(o,e,t,i){let r;switch(o){case Ht.FAIRPLAY:r=["cenc","sinf"];break;case Ht.WIDEVINE:case Ht.PLAYREADY:r=["cenc"];break;case Ht.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${o}`)}return It(r,e,t,i)}function It(o,e,t,i){return[{initDataTypes:o,persistentState:i.persistentState||"optional",distinctiveIdentifier:i.distinctiveIdentifier||"optional",sessionTypes:i.sessionTypes||[i.sessionType||"temporary"],audioCapabilities:e.map(s=>({contentType:`audio/mp4; codecs=${s}`,robustness:i.audioRobustness||"",encryptionScheme:i.audioEncryptionScheme||null})),videoCapabilities:t.map(s=>({contentType:`video/mp4; codecs=${s}`,robustness:i.videoRobustness||"",encryptionScheme:i.videoEncryptionScheme||null}))}]}function fi(o){var e;return o.sessionType==="persistent-license"||!!((e=o.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function pi(o){const e=new Uint16Array(o.buffer,o.byteOffset,o.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),i=t.substring(t.indexOf("<"),t.length),a=new DOMParser().parseFromString(i,"text/xml").getElementsByTagName("KID")[0];if(a){const h=a.childNodes[0]?a.childNodes[0].nodeValue:a.getAttribute("VALUE");if(h){const g=Kr(h).subarray(0,16);return Vr(g),g}}return null}let oi={};class gr{static clearKeyUriToKeyIdMap(){oi={}}constructor(e,t,i,r=[1],s=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=i,this.keyFormatVersions=r,this.iv=s,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!ur(e)}isSupported(){if(this.method){if(ur(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case Si.FAIRPLAY:case Si.WIDEVINE:case Si.PLAYREADY:case Si.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(ur(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(F.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const i=xn(e);return new gr(this.method,this.uri,"identity",this.keyFormatVersions,i)}const t=Sn(this.uri);if(t)switch(this.keyFormat){case Si.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case Si.PLAYREADY:{const i=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Dt(i,null,t),this.keyId=pi(t);break}default:{let i=t.subarray(0,16);if(i.length!==16){const r=new Uint8Array(16);r.set(i,16-i.length),i=r}this.keyId=i;break}}if(!this.keyId||this.keyId.byteLength!==16){let i=oi[this.uri];if(!i){const r=Object.keys(oi).length%Number.MAX_SAFE_INTEGER;i=new Uint8Array(16),new DataView(i.buffer,12,4).setUint32(0,r),oi[this.uri]=i}this.keyId=i}return this}}function xn(o){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=o>>8*(15-t)&255;return e}const wn=/#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,qr=/#EXT-X-MEDIA:(.*)/g,Uo=/^#EXT(?:INF|-X-TARGETDURATION):/m,es=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),$o=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 mr{static findGroup(e,t){for(let i=0;i<e.length;i++){const r=e[i];if(r.id===t)return r}}static resolve(e,t){return W.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Uo.test(e)}static parseMasterPlaylist(e,t){const i=or(e),r={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:i},s=[];wn.lastIndex=0;let a;for(;(a=wn.exec(e))!=null;)if(a[1]){var h;const d=new ai(a[1],r),v=Xi(r,a[2]),S={attrs:d,bitrate:d.decimalInteger("BANDWIDTH")||d.decimalInteger("AVERAGE-BANDWIDTH"),name:d.NAME,url:mr.resolve(v,t)},M=d.decimalResolution("RESOLUTION");M&&(S.width=M.width,S.height=M.height),zs(d.CODECS,S);const j=d["SUPPLEMENTAL-CODECS"];j&&(S.supplemental={},zs(j,S.supplemental)),(h=S.unknownCodecs)!=null&&h.length||s.push(S),r.levels.push(S)}else if(a[3]){const d=a[3],v=a[4];switch(d){case"SESSION-DATA":{const S=new ai(v,r),M=S["DATA-ID"];M&&(r.sessionData===null&&(r.sessionData={}),r.sessionData[M]=S);break}case"SESSION-KEY":{const S=Gs(v,t,r);S.encrypted&&S.isSupported()?(r.sessionKeys===null&&(r.sessionKeys=[]),r.sessionKeys.push(S)):F.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${v}"`);break}case"DEFINE":{{const S=new ai(v,r);lr(r,S,t)}break}case"CONTENT-STEERING":{const S=new ai(v,r);r.contentSteering={uri:mr.resolve(S["SERVER-URI"],t),pathwayId:S["PATHWAY-ID"]||"."};break}case"START":{r.startTimeOffset=Ks(v);break}}}const g=s.length>0&&s.length<r.levels.length;return r.levels=g?s:r.levels,r.levels.length===0&&(r.playlistParsingError=new Error("no levels found in manifest")),r}static parseMasterPlaylistMedia(e,t,i){let r;const s={},a=i.levels,h={AUDIO:a.map(d=>({id:d.attrs.AUDIO,audioCodec:d.audioCodec})),SUBTITLES:a.map(d=>({id:d.attrs.SUBTITLES,textCodec:d.textCodec})),"CLOSED-CAPTIONS":[]};let g=0;for(qr.lastIndex=0;(r=qr.exec(e))!==null;){const d=new ai(r[1],i),v=d.TYPE;if(v){const S=h[v],M=s[v]||[];s[v]=M;const j=d.LANGUAGE,H=d["ASSOC-LANGUAGE"],Q=d.CHANNELS,Z=d.CHARACTERISTICS,re=d["INSTREAM-ID"],fe={attrs:d,bitrate:0,id:g++,groupId:d["GROUP-ID"]||"",name:d.NAME||j||"",type:v,default:d.bool("DEFAULT"),autoselect:d.bool("AUTOSELECT"),forced:d.bool("FORCED"),lang:j,url:d.URI?mr.resolve(d.URI,t):""};if(H&&(fe.assocLang=H),Q&&(fe.channels=Q),Z&&(fe.characteristics=Z),re&&(fe.instreamId=re),S!=null&&S.length){const le=mr.findGroup(S,fe.groupId)||S[0];Vs(fe,le,"audioCodec"),Vs(fe,le,"textCodec")}M.push(fe)}}return s}static parseLevelPlaylist(e,t,i,r,s,a){var h;const g={url:t},d=new En(t),v=d.fragments,S=[];let M=null,j=0,H=0,Q=0,Z=0,re=0,fe=null,le=new Se(r,g),be,we,$e,Ae=-1,Pe=!1,Ue=null,De;if(es.lastIndex=0,d.m3u8=e,d.hasVariableRefs=or(e),((h=es.exec(e))==null?void 0:h[0])!=="#EXTM3U")return d.playlistParsingError=new Error("Missing format identifier #EXTM3U"),d;for(;(be=es.exec(e))!==null;){Pe&&(Pe=!1,le=new Se(r,g),le.playlistOffset=Q,le.start=Q,le.sn=j,le.cc=Z,re&&(le.bitrate=re),le.level=i,M&&(le.initSegment=M,M.rawProgramDateTime&&(le.rawProgramDateTime=M.rawProgramDateTime,M.rawProgramDateTime=null),Ue&&(le.setByteRange(Ue),Ue=null)));const gt=be[1];if(gt){le.duration=parseFloat(gt);const vt=(" "+be[2]).slice(1);le.title=vt||null,le.tagList.push(vt?["INF",gt,vt]:["INF",gt])}else if(be[3]){if(k(le.duration)){le.playlistOffset=Q,le.start=Q,$e&&Ys(le,$e,d),le.sn=j,le.level=i,le.cc=Z,v.push(le);const vt=(" "+be[3]).slice(1);le.relurl=Xi(d,vt),ts(le,fe,S),fe=le,Q+=le.duration,j++,H=0,Pe=!0}}else{if(be=be[0].match($o),!be){F.warn("No matches on slow regex match for level playlist!");continue}for(we=1;we<be.length&&be[we]===void 0;we++);const vt=(" "+be[we]).slice(1),ct=(" "+be[we+1]).slice(1),bt=be[we+2]?(" "+be[we+2]).slice(1):null;switch(vt){case"BYTERANGE":fe?le.setByteRange(ct,fe):le.setByteRange(ct);break;case"PROGRAM-DATE-TIME":le.rawProgramDateTime=ct,le.tagList.push(["PROGRAM-DATE-TIME",ct]),Ae===-1&&(Ae=v.length);break;case"PLAYLIST-TYPE":d.type&&Dr(d,vt,be),d.type=ct.toUpperCase();break;case"MEDIA-SEQUENCE":d.startSN!==0?Dr(d,vt,be):v.length>0&&Zs(d,vt,be),j=d.startSN=parseInt(ct);break;case"SKIP":{d.skippedSegments&&Dr(d,vt,be);const wt=new ai(ct,d),et=wt.decimalInteger("SKIPPED-SEGMENTS");if(k(et)){d.skippedSegments+=et;for(let Ft=et;Ft--;)v.push(null);j+=et}const rt=wt.enumeratedString("RECENTLY-REMOVED-DATERANGES");rt&&(d.recentlyRemovedDateranges=(d.recentlyRemovedDateranges||[]).concat(rt.split(" ")));break}case"TARGETDURATION":d.targetduration!==0&&Dr(d,vt,be),d.targetduration=Math.max(parseInt(ct),1);break;case"VERSION":d.version!==null&&Dr(d,vt,be),d.version=parseInt(ct);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":d.live||Dr(d,vt,be),d.live=!1;break;case"#":(ct||bt)&&le.tagList.push(bt?[ct,bt]:[ct]);break;case"DISCONTINUITY":Z++,le.tagList.push(["DIS"]);break;case"GAP":le.gap=!0,le.tagList.push([vt]);break;case"BITRATE":le.tagList.push([vt,ct]),re=parseInt(ct)*1e3,k(re)?le.bitrate=re:re=0;break;case"DATERANGE":{const wt=new ai(ct,d),et=new Wr(wt,d.dateRanges[wt.ID],d.dateRangeTagCount);d.dateRangeTagCount++,et.isValid||d.skippedSegments?d.dateRanges[et.id]=et:F.warn(`Ignoring invalid DATERANGE tag: "${ct}"`),le.tagList.push(["EXT-X-DATERANGE",ct]);break}case"DEFINE":{{const wt=new ai(ct,d);"IMPORT"in wt?Hr(d,wt,a):lr(d,wt,t)}break}case"DISCONTINUITY-SEQUENCE":d.startCC!==0?Dr(d,vt,be):v.length>0&&Zs(d,vt,be),d.startCC=Z=parseInt(ct);break;case"KEY":{const wt=Gs(ct,t,d);if(wt.isSupported()){if(wt.method==="NONE"){$e=void 0;break}$e||($e={}),$e[wt.keyFormat]&&($e=c({},$e)),$e[wt.keyFormat]=wt}else F.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${ct}"`);break}case"START":d.startTimeOffset=Ks(ct);break;case"MAP":{const wt=new ai(ct,d);if(le.duration){const et=new Se(r,g);qs(et,wt,i,$e),M=et,le.initSegment=M,M.rawProgramDateTime&&!le.rawProgramDateTime&&(le.rawProgramDateTime=M.rawProgramDateTime)}else{const et=le.byteRangeEndOffset;if(et){const rt=le.byteRangeStartOffset;Ue=`${et-rt}@${rt}`}else Ue=null;qs(le,wt,i,$e),M=le,Pe=!0}M.cc=Z;break}case"SERVER-CONTROL":{De&&Dr(d,vt,be),De=new ai(ct),d.canBlockReload=De.bool("CAN-BLOCK-RELOAD"),d.canSkipUntil=De.optionalFloat("CAN-SKIP-UNTIL",0),d.canSkipDateRanges=d.canSkipUntil>0&&De.bool("CAN-SKIP-DATERANGES"),d.partHoldBack=De.optionalFloat("PART-HOLD-BACK",0),d.holdBack=De.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{d.partTarget&&Dr(d,vt,be);const wt=new ai(ct);d.partTarget=wt.decimalFloatingPoint("PART-TARGET");break}case"PART":{let wt=d.partList;wt||(wt=d.partList=[]);const et=H>0?wt[wt.length-1]:void 0,rt=H++,Ft=new ai(ct,d),Pt=new Ie(Ft,le,g,rt,et);wt.push(Pt),le.duration+=Pt.duration;break}case"PRELOAD-HINT":{const wt=new ai(ct,d);d.preloadHint=wt;break}case"RENDITION-REPORT":{const wt=new ai(ct,d);d.renditionReports=d.renditionReports||[],d.renditionReports.push(wt);break}default:F.warn(`line parsed but not handled: ${be}`);break}}}fe&&!fe.relurl?(v.pop(),Q-=fe.duration,d.partList&&(d.fragmentHint=fe)):d.partList&&(ts(le,fe,S),le.cc=Z,d.fragmentHint=le,$e&&Ys(le,$e,d)),d.targetduration||(d.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const Xe=v.length,ut=v[0],Tt=v[Xe-1];if(Q+=d.skippedSegments*d.targetduration,Q>0&&Xe&&Tt){d.averagetargetduration=Q/Xe;const gt=Tt.sn;d.endSN=gt!=="initSegment"?gt:0,d.live||(Tt.endList=!0),ut&&d.startCC===void 0&&(d.startCC=ut.cc),Ae>0&&(jo(v,Ae),ut&&S.unshift(ut))}else d.endSN=0,d.startCC=0;return d.fragmentHint&&(Q+=d.fragmentHint.duration),d.totalduration=Q,S.length&&d.dateRangeTagCount&&ut&&Ws(S,d),d.endCC=Z,d}}function Ws(o,e){const t=o.length;if(!t)return;const i=o[t-1],r=e.live?1/0:e.totalduration,s=Object.keys(e.dateRanges);for(let a=s.length;a--;){const h=e.dateRanges[s[a]],g=h.startDate.getTime();h.tagAnchor=i.ref;for(let d=t;d--;){const v=Ho(e,g,o,d,r);if(v!==-1){h.tagAnchor=e.fragments[v].ref;break}}}}function Ho(o,e,t,i,r){const s=t[i];if(s){const h=s.programDateTime;if(e>=h||i===0){var a;const g=(((a=t[i+1])==null?void 0:a.start)||r)-s.start;if(e<=h+g*1e3){const d=t[i].sn-o.startSN,v=o.fragments;if(v.length>t.length){const M=(t[i+1]||v[v.length-1]).sn-o.startSN;for(let j=M;j>d;j--){const H=v[j].programDateTime;if(e>=H&&e<H+v[j].duration*1e3)return j}}return d}}}return-1}function Gs(o,e,t){var i,r;const s=new ai(o,t),a=(i=s.METHOD)!=null?i:"",h=s.URI,g=s.hexadecimalInteger("IV"),d=s.KEYFORMATVERSIONS,v=(r=s.KEYFORMAT)!=null?r:"identity";h&&s.IV&&!g&&F.error(`Invalid IV: ${s.IV}`);const S=h?mr.resolve(h,e):"",M=(d||"1").split("/").map(Number).filter(Number.isFinite);return new gr(a,S,v,M,g)}function Ks(o){const t=new ai(o).decimalFloatingPoint("TIME-OFFSET");return k(t)?t:null}function zs(o,e){let t=(o||"").split(/[ ,]+/).filter(i=>i);["video","audio","text"].forEach(i=>{const r=t.filter(s=>Ct(s,i));r.length&&(e[`${i}Codec`]=r.map(s=>s.split("/")[0]).join(","),t=t.filter(s=>r.indexOf(s)===-1))}),e.unknownCodecs=t}function Vs(o,e,t){const i=e[t];i&&(o[t]=i)}function jo(o,e){let t=o[e];for(let i=e;i--;){const r=o[i];if(!r)return;r.programDateTime=t.programDateTime-r.duration*1e3,t=r}}function ts(o,e,t){o.rawProgramDateTime?t.push(o):e!=null&&e.programDateTime&&(o.programDateTime=e.endProgramDateTime)}function qs(o,e,t,i){o.relurl=e.URI,e.BYTERANGE&&o.setByteRange(e.BYTERANGE),o.level=t,o.sn="initSegment",i&&(o.levelkeys=i),o.initSegment=null}function Ys(o,e,t){o.levelkeys=e;const{encryptedFragments:i}=t;(!i.length||i[i.length-1].levelkeys!==e)&&Object.keys(e).some(r=>e[r].isCommonEncryption)&&i.push(o)}function Dr(o,e,t){o.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function Zs(o,e,t){o.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function is(o,e){const t=e.startPTS;if(k(t)){let i=0,r;e.sn>o.sn?(i=t-o.start,r=o):(i=o.start-t,r=e),r.duration!==i&&r.setDuration(i)}else e.sn>o.sn?o.cc===e.cc&&o.minEndPTS?e.setStart(o.start+(o.minEndPTS-o.start)):e.setStart(o.start+o.duration):e.setStart(Math.max(o.start-e.duration,0))}function Xs(o,e,t,i,r,s){i-t<=0&&(F.warn("Fragment should have a positive duration",e),i=t+e.duration,s=r+e.duration);let h=t,g=i;const d=e.startPTS,v=e.endPTS;if(k(d)){const Z=Math.abs(d-t);k(e.deltaPTS)?e.deltaPTS=Math.max(Z,e.deltaPTS):e.deltaPTS=Z,h=Math.max(t,d),t=Math.min(t,d),r=Math.min(r,e.startDTS),g=Math.min(i,v),i=Math.max(i,v),s=Math.max(s,e.endDTS)}const S=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(i-e.start),e.startPTS=t,e.maxStartPTS=h,e.startDTS=r,e.endPTS=i,e.minEndPTS=g,e.endDTS=s;const M=e.sn;if(!o||M<o.startSN||M>o.endSN)return 0;let j;const H=M-o.startSN,Q=o.fragments;for(Q[H]=e,j=H;j>0;j--)is(Q[j],Q[j-1]);for(j=H;j<Q.length-1;j++)is(Q[j],Q[j+1]);return o.fragmentHint&&is(Q[Q.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,S}function Wo(o,e){if(o===e)return;let t=null;const i=o.fragments;for(let d=i.length-1;d>=0;d--){const v=i[d].initSegment;if(v){t=v;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;let r;zo(o,e,(d,v,S,M)=>{if((!e.startCC||e.skippedSegments)&&v.cc!==d.cc){const j=d.cc-v.cc;for(let H=S;H<M.length;H++)M[H].cc+=j;e.endCC=M[M.length-1].cc}k(d.startPTS)&&k(d.endPTS)&&(v.setStart(v.startPTS=d.startPTS),v.startDTS=d.startDTS,v.maxStartPTS=d.maxStartPTS,v.endPTS=d.endPTS,v.endDTS=d.endDTS,v.minEndPTS=d.minEndPTS,v.setDuration(d.endPTS-d.startPTS),v.duration&&(r=v),e.PTSKnown=e.alignedSliding=!0),d.hasStreams&&(v.elementaryStreams=d.elementaryStreams),v.loader=d.loader,d.hasStats&&(v.stats=d.stats),d.initSegment&&(v.initSegment=d.initSegment,t=d.initSegment)});const s=e.fragments,a=e.fragmentHint?s.concat(e.fragmentHint):s;if(t&&a.forEach(d=>{var v;d&&(!d.initSegment||d.initSegment.relurl===((v=t)==null?void 0:v.relurl))&&(d.initSegment=t)}),e.skippedSegments){if(e.deltaUpdateFailed=s.some(d=>!d),e.deltaUpdateFailed){F.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let d=e.skippedSegments;d--;)s.shift();e.startSN=s[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=Go(o.dateRanges,e));const d=o.fragments.filter(v=>v.rawProgramDateTime);if(o.hasProgramDateTime&&!e.hasProgramDateTime)for(let v=1;v<a.length;v++)a[v].programDateTime===null&&ts(a[v],a[v-1],d);Ws(d,e)}e.endCC=s[s.length-1].cc}if(!e.startCC){var h;const d=ta(o,e.startSN-1);e.startCC=(h=d==null?void 0:d.cc)!=null?h:s[0].cc}Ko(o.partList,e.partList,(d,v)=>{v.elementaryStreams=d.elementaryStreams,v.stats=d.stats}),r?Xs(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):Js(o,e),s.length&&(e.totalduration=e.edge-s[0].start),e.driftStartTime=o.driftStartTime,e.driftStart=o.driftStart;const g=e.advancedDateTime;if(e.advanced&&g){const d=e.edge;e.driftStart||(e.driftStartTime=g,e.driftStart=d),e.driftEndTime=g,e.driftEnd=d}else e.driftEndTime=o.driftEndTime,e.driftEnd=o.driftEnd,e.advancedDateTime=o.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=o.requestScheduled)}function Go(o,e){const{dateRanges:t,recentlyRemovedDateranges:i}=e,r=c({},o);i&&i.forEach(h=>{delete r[h]});const a=Object.keys(r).length;return a&&Object.keys(t).forEach(h=>{const g=r[h],d=new Wr(t[h].attr,g);d.isValid?(r[h]=d,g||(d.tagOrder+=a)):F.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${yt(t[h].attr)}"`)}),r}function Ko(o,e,t){if(o&&e){let i=0;for(let r=0,s=o.length;r<=s;r++){const a=o[r],h=e[r+i];a&&h&&a.index===h.index&&a.fragment.sn===h.fragment.sn?t(a,h):i--}}}function zo(o,e,t){const i=e.skippedSegments,r=Math.max(o.startSN,e.startSN)-e.startSN,s=(o.fragmentHint?1:0)+(i?e.endSN:Math.min(o.endSN,e.endSN))-e.startSN,a=e.startSN-o.startSN,h=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,g=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments;for(let d=r;d<=s;d++){const v=g[a+d];let S=h[d];if(i&&!S&&v&&(S=e.fragments[d]=v),v&&S){if(t(v,S,d,h),v.url&&v.url!==S.url){e.playlistParsingError=Qs(`media sequence mismatch ${S.sn}:`,o,e,v,S);return}else if(v.cc!==S.cc){e.playlistParsingError=Qs(`discontinuity sequence mismatch (${v.cc}!=${S.cc})`,o,e,v,S);return}}}}function Qs(o,e,t,i,r){return new Error(`${o} ${r.url}
|
|
|
Playlist starting @${e.startSN}
|
|
|
${e.m3u8}
|
|
|
|
|
|
Playlist starting @${t.startSN}
|
|
|
${t.m3u8}`)}function Js(o,e,t=!0){const i=e.startSN+e.skippedSegments-o.startSN,r=o.fragments,s=i>=0;let a=0;if(s&&i<r.length)a=r[i].start;else if(s&&e.startSN===o.endSN+1)a=o.fragmentEnd;else if(s&&t)a=o.fragmentStart+i*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)a=o.fragmentStart;else return;rs(e,a)}function rs(o,e){if(e){const t=o.fragments;for(let i=o.skippedSegments;i<t.length;i++)t[i].addStart(e);o.fragmentHint&&o.fragmentHint.addStart(e)}}function ea(o,e=1/0){let t=1e3*o.targetduration;if(o.updated){const i=o.fragments;if(i.length&&t*4>e){const s=i[i.length-1].duration*1e3;s<t&&(t=s)}}else t/=2;return Math.round(t)}function ta(o,e,t){if(!o)return null;let i=o.fragments[e-o.startSN];return i||(i=o.fragmentHint,i&&i.sn===e)?i:e<o.startSN&&t&&t.sn===e?t:null}function ia(o,e,t){return o?ra(o.partList,e,t):null}function ra(o,e,t){if(o)for(let i=o.length;i--;){const r=o[i];if(r.index===t&&r.fragment.sn===e)return r}return null}function na(o){o.forEach((e,t)=>{var i;(i=e.details)==null||i.fragments.forEach(r=>{r.level=t,r.initSegment&&(r.initSegment.level=t)})})}function Cn(o,e){for(let i=0,r=o.length;i<r;i++){var t;if(((t=o[i])==null?void 0:t.cc)===e)return o[i]}return null}function Vo(o,e){return!!(o&&e.startCC<o.endCC&&e.endCC>o.startCC)}function sa(o,e){if(o){const t=o.start+e;o.start=o.startPTS=t,o.endPTS=t+o.duration}}function aa(o,e){const t=e.fragments;for(let i=0,r=t.length;i<r;i++)sa(t[i],o);e.fragmentHint&&sa(e.fragmentHint,o),e.alignedSliding=!0}function qo(o,e){o&&(oa(e,o),!e.alignedSliding&&o&&Mn(e,o),!e.alignedSliding&&o&&!e.skippedSegments&&Js(o,e,!1))}function oa(o,e){if(!Vo(e,o))return;const t=Math.min(e.endCC,o.endCC),i=Cn(e.fragments,t),r=Cn(o.fragments,t);if(!i||!r)return;F.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const s=i.start-r.start;aa(s,o)}function Mn(o,e){if(!o.hasProgramDateTime||!e.hasProgramDateTime)return;const t=o.fragments,i=e.fragments;if(!t.length||!i.length)return;let r,s;const a=Math.min(e.endCC,o.endCC);e.startCC<a&&o.startCC<a&&(r=Cn(i,a),s=Cn(t,a)),(!r||!s)&&(r=i[Math.floor(i.length/2)],s=Cn(t,r.cc)||t[Math.floor(t.length/2)]);const h=r.programDateTime,g=s.programDateTime;if(!h||!g)return;const d=(g-h)/1e3-(s.start-r.start);aa(d,o)}const Yo={toString:function(o){let e="";const t=o.length;for(let i=0;i<t;i++)e+=`[${o.start(i).toFixed(3)}-${o.end(i).toFixed(3)}]`;return e}},Ke={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 ns extends _r{constructor(e,t,i,r,s){super(r,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Ke.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:a,fragCurrent:h,media:g,mediaBuffer:d,state:v}=this,S=g?g.currentTime:0,M=Rt.bufferInfo(d||g,S,a.maxBufferHole);if(this.log(`media seeking to ${k(S)?S.toFixed(3):S}, state: ${v}`),this.state===Ke.ENDED)this.resetLoadingState();else if(h){const j=a.maxFragLookUpTolerance,H=h.start-j,Q=h.start+h.duration+j;if(!M.len||Q<M.start||H>M.end){const Z=S>Q;(S<H||Z)&&(Z&&h.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),h.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(g){this.fragmentTracker.removeFragmentsInRange(S,1/0,this.playlistType,!0);const j=this.lastCurrentTime;if(S>j&&(this.lastCurrentTime=S),!this.loadingParts){const H=Math.max(M.end,S),Q=this.shouldLoadParts(this.getLevelDetails(),H);Q&&(this.log(`LL-Part loading ON after seeking to ${S.toFixed(2)} with buffer @${H.toFixed(2)}`),this.loadingParts=Q)}}!this.hls.hasEnoughToStart&&!M.len&&(this.log(`setting startPosition to ${S} because of seek before start`),this.nextLoadPosition=this.startPosition=S),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=s,this.hls=e,this.fragmentLoader=new rn(e.config),this.keyLoader=i,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Ur(e.config)}registerListeners(){const{hls:e}=this;e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===Ke.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=Ke.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 i=e.end||0,r=this.config.timelineOffset||0;if(i<=r)return!1;const s=e.buffered;this.config.maxBufferHole&&s&&s.length>1&&(e=Rt.bufferedInfo(s,e.start,0));const a=e.nextStart;if(a&&a>r&&a<t.edge||this.media.currentTime<e.start)return!1;const g=t.partList;if(g!=null&&g.length){const v=g[g.length-1];return Rt.isBuffered(this.media,v.start+v.duration/2)}const d=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(d)}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 i=this.media=this.mediaBuffer=t.media;i.removeEventListener("seeking",this.onMediaSeeking),i.removeEventListener("ended",this.onMediaEnded),i.addEventListener("seeking",this.onMediaSeeking),i.addEventListener("ended",this.onMediaEnded);const r=this.config;this.levels&&r.autoStartLoad&&this.state===Ke.STOPPED&&this.startLoad(r.startPosition)}onMediaDetaching(e,t){const i=!!t.transferMedia,r=this.media;if(r!==null){if(r.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),r.removeEventListener("seeking",this.onMediaSeeking),r.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!i&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,i){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=Ke.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,i){this.startFragRequested=!0,this._loadFragForPlayback(e,t,i)}_loadFragForPlayback(e,t,i){const r=s=>{const a=s.frag;if(this.fragContextChanged(a)){this.warn(`${a.type} sn: ${a.sn}${s.part?" part: "+s.part.index:""} of ${this.fragInfo(a,!1,s.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(a);return}a.stats.chunkCount++,this._handleFragmentLoadProgress(s)};this._doFragLoad(e,t,i,r).then(s=>{if(!s)return;const a=this.state,h=s.frag;if(this.fragContextChanged(h)){(a===Ke.FRAG_LOADING||!this.fragCurrent&&a===Ke.PARSING)&&(this.fragmentTracker.removeFragment(h),this.state=Ke.IDLE);return}"payload"in s&&(this.log(`Loaded ${h.type} sn: ${h.sn} of ${this.playlistLabel()} ${h.level}`),this.hls.trigger(_.FRAG_LOADED,s)),this._handleFragmentLoadComplete(s)}).catch(s=>{this.state===Ke.STOPPED||this.state===Ke.ERROR||(this.warn(`Frag error: ${(s==null?void 0:s.message)||s}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:i}=this;if(i.getState(e)===di.APPENDING){const s=e.type,a=this.getFwdBufferInfo(this.mediaBuffer,s),h=Math.max(e.duration,a?a.len:this.config.maxBufferLength),g=this.backtrackFragment;((g?e.sn-g.sn:0)===1||this.reduceMaxBufferLength(h,e.duration))&&i.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?i.removeAllFragments():i.hasParts(e.type)&&(i.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),i.getState(e)===di.PARTIAL&&i.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,i=null){if(!(e-t))return;const r={startOffset:e,endOffset:t,type:i};this.hls.trigger(_.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(i=>{const r=i==null?void 0:i.frag;if(!r||this.fragContextChanged(r)||!this.levels)throw new Error("init load aborted");return i}).then(i=>{const{hls:r}=this,{frag:s,payload:a}=i,h=s.decryptdata;if(a&&a.byteLength>0&&h!=null&&h.key&&h.iv&&ur(h.method)){const g=self.performance.now();return this.decrypter.decrypt(new Uint8Array(a),h.key.buffer,h.iv.buffer,Gr(h.method)).catch(d=>{throw r.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.FRAG_DECRYPT_ERROR,fatal:!1,error:d,reason:d.message,frag:s}),d}).then(d=>{const v=self.performance.now();return r.trigger(_.FRAG_DECRYPTED,{frag:s,payload:d,stats:{tstart:g,tdecrypt:v}}),i.payload=d,this.completeInitSegmentLoad(i)})}return this.completeInitSegmentLoad(i)}).catch(i=>{this.state===Ke.STOPPED||this.state===Ke.ERROR||(this.warn(i),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const i=e.frag.stats;this.state!==Ke.STOPPED&&(this.state=Ke.IDLE),e.frag.data=new Uint8Array(e.payload),i.parsing.start=i.buffering.start=self.performance.now(),i.parsing.end=i.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 i=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:${i?Yo.toString(Rt.getBuffered(i)):"(detached)"})`),te(e)){var r;if(e.type!==m.SUBTITLE){const a=e.elementaryStreams;if(!Object.keys(a).some(h=>!!a[h])){this.state=Ke.IDLE;return}}const s=(r=this.levels)==null?void 0:r[e.level];s!=null&&s.fragmentError&&(this.log(`Resetting level fragment error count of ${s.fragmentError} on frag buffered`),s.fragmentError=0)}this.state=Ke.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:i,part:r,partsLoaded:s}=e,a=!s||s.length===0||s.some(g=>!g),h=new Cr(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!a);t.flush(h)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,i=null,r){var s;this.fragCurrent=e;const a=t==null?void 0:t.details;if(!this.levels||!a)throw new Error(`frag load aborted, missing level${a?"":" detail"}s`);let h=null;e.encrypted&&!((s=e.decryptdata)!=null&&s.key)?(this.log(`Loading key for ${e.sn} of [${a.startSN}-${a.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=Ke.KEY_LOADING,this.fragCurrent=e,h=this.keyLoader.load(e).then(S=>{if(!this.fragContextChanged(S.frag))return this.hls.trigger(_.KEY_LOADED,S),this.state===Ke.KEY_LOADING&&(this.state=Ke.IDLE),S}),this.hls.trigger(_.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(h=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):e.encrypted||(h=this.keyLoader.loadClear(e,a.encryptedFragments),h&&this.log("[eme] blocking frag load until media-keys acquired"));const g=this.fragPrevious;if(te(e)&&(!g||e.sn!==g.sn)){const S=this.shouldLoadParts(t.details,e.end);S!==this.loadingParts&&(this.log(`LL-Part loading ${S?"ON":"OFF"} loading sn ${g==null?void 0:g.sn}->${e.sn}`),this.loadingParts=S)}if(i=Math.max(e.start,i||0),this.loadingParts&&te(e)){const S=a.partList;if(S&&r){i>e.end&&a.fragmentHint&&(e=a.fragmentHint);const M=this.getNextPart(S,e,i);if(M>-1){const j=S[M];e=this.fragCurrent=j.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${j.index} (${M}/${S.length-1}) of ${this.fragInfo(e,!1,j)}) cc: ${e.cc} [${a.startSN}-${a.endSN}], target: ${parseFloat(i.toFixed(3))}`),this.nextLoadPosition=j.start+j.duration,this.state=Ke.FRAG_LOADING;let H;return h?H=h.then(Q=>!Q||this.fragContextChanged(Q.frag)?null:this.doFragPartsLoad(e,j,t,r)).catch(Q=>this.handleFragLoadError(Q)):H=this.doFragPartsLoad(e,j,t,r).catch(Q=>this.handleFragLoadError(Q)),this.hls.trigger(_.FRAG_LOADING,{frag:e,part:j,targetBufferTime:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):H}else if(!e.url||this.loadedEndOfParts(S,i))return Promise.resolve(null)}}if(te(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${i.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} ${a?"["+a.startSN+"-"+a.endSN+"]":""}, target: ${parseFloat(i.toFixed(3))}`),k(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Ke.FRAG_LOADING;const d=this.config.progressive;let v;return d&&h?v=h.then(S=>!S||this.fragContextChanged(S==null?void 0:S.frag)?null:this.fragmentLoader.load(e,r)).catch(S=>this.handleFragLoadError(S)):v=Promise.all([this.fragmentLoader.load(e,d?r:void 0),h]).then(([S])=>(!d&&S&&r&&r(S),S)).catch(S=>this.handleFragLoadError(S)),this.hls.trigger(_.FRAG_LOADING,{frag:e,targetBufferTime:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):v}doFragPartsLoad(e,t,i,r){return new Promise((s,a)=>{var h;const g=[],d=(h=i.details)==null?void 0:h.partList,v=S=>{this.fragmentLoader.loadPart(e,S,r).then(M=>{g[S.index]=M;const j=M.part;this.hls.trigger(_.FRAG_LOADED,M);const H=ia(i.details,e.sn,S.index+1)||ra(d,e.sn,S.index+1);if(H)v(H);else return s({frag:e,part:j,partsLoaded:g})}).catch(a)};v(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(_.ERROR,t)}else this.hls.trigger(_.ERROR,{type:T.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!==Ke.PARSING){!this.fragCurrent&&this.state!==Ke.STOPPED&&this.state!==Ke.ERROR&&(this.state=Ke.IDLE);return}const{frag:i,part:r,level:s}=t,a=self.performance.now();i.stats.parsing.end=a,r&&(r.stats.parsing.end=a);const h=this.getLevelDetails(),d=h&&i.sn>h.endSN||this.shouldLoadParts(h,i.end);d!==this.loadingParts&&(this.log(`LL-Part loading ${d?"ON":"OFF"} after parsing segment ending @${i.end.toFixed(2)}`),this.loadingParts=d),this.updateLevelTiming(i,r,s,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var i;const s=e.partList[0],a=s.end+(((i=e.fragmentHint)==null?void 0:i.duration)||0);if(t>=a){var r;if((this.hls.hasEnoughToStart?((r=this.media)==null?void 0:r.currentTime)||this.lastCurrentTime:this.getLoadPosition())>s.start-s.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:i}=this,{level:r,sn:s,part:a}=e;if(!(t!=null&&t[r]))return this.warn(`Levels object was unset while buffering fragment ${s} of ${this.playlistLabel()} ${r}. The current chunk will not be buffered.`),null;const h=t[r],g=h.details,d=a>-1?ia(g,s,a):null,v=d?d.fragment:ta(g,s,i);return v?(i&&i!==v&&(v.stats=i.stats),{frag:v,part:d,level:h}):null}bufferFragmentData(e,t,i,r,s){var a;if(!e||this.state!==Ke.PARSING)return;const{data1:h,data2:g}=e;let d=h;if(h&&g&&(d=je(h,g)),!((a=d)!=null&&a.length))return;const v={type:e.type,frag:t,part:i,chunkMeta:r,parent:t.type,data:d};if(this.hls.trigger(_.BUFFER_APPENDING,v),e.dropped&&e.independent&&!i){if(s)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Rt.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const i=t.currentTime,r=Rt.bufferInfo(t,i,0),s=e.duration,a=Math.min(this.config.maxFragLookUpTolerance*2,s*.25),h=Math.max(Math.min(e.start-a,r.end-a),i+a);e.start-h>a&&this.flushMainBuffer(h,e.start)}getFwdBufferInfo(e,t){var i;const r=this.getLoadPosition();if(!k(r))return null;const a=this.lastCurrentTime>r||(i=this.media)!=null&&i.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,r,t,a)}getFwdBufferInfoAtPos(e,t,i,r){const s=Rt.bufferInfo(e,t,r);if(s.len===0&&s.nextStart!==void 0){const a=this.fragmentTracker.getBufferedFrag(t,i);if(a&&(s.nextStart<=a.end||a.gap)){const h=Math.max(Math.min(s.nextStart,a.end)-t,r);return Rt.bufferInfo(e,t,h)}}return s}getMaxBufferLength(e){const{config:t}=this;let i;return e?i=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):i=t.maxBufferLength,Math.min(i,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const i=this.config,r=Math.max(Math.min(e-t,i.maxBufferLength),t),s=Math.max(e-t*3,i.maxMaxBufferLength/2,r);return s>=r?(i.maxMaxBufferLength=s,this.warn(`Reduce max buffer length to ${s}s`),!0):!1}getAppendedFrag(e,t=m.MAIN){var i;const r=(i=this.fragmentTracker)==null?void 0:i.getAppendedFrag(e,t);return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const i=t.fragments,r=i.length;if(!r)return null;const{config:s}=this,a=i[0].start,h=s.lowLatencyMode&&!!t.partList;let g=null;if(t.live){const S=s.initialLiveManifestSize;if(r<S)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${S})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<a){var d;h&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),g=this.getInitialLiveFragment(t);const M=this.hls.startPosition,j=this.hls.liveSyncPosition,H=g?(M!==-1&&M>=a?M:j)||g.start:e;this.log(`Setting startPosition to ${H} to match start frag at live edge. mainStart: ${M} liveSyncPosition: ${j} frag.start: ${(d=g)==null?void 0:d.start}`),this.startPosition=this.nextLoadPosition=H}}else e<=a&&(g=i[0]);if(!g){const S=this.loadingParts?t.partEnd:t.fragmentEnd;g=this.getFragmentAtPosition(e,S,t)}let v=this.filterReplacedPrimary(g,t);if(!v&&g){const S=g.sn-t.startSN;v=this.filterReplacedPrimary(i[S+1]||null,t)}return this.mapToInitFragWhenRequired(v)}isLoopLoading(e,t){const i=this.fragmentTracker.getState(e);return(i===di.OK||i===di.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,i,r,s){let a=null;if(e.gap&&(a=this.getNextFragment(this.nextLoadPosition,t),a&&!a.gap&&i.nextStart)){const h=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,r,0);if(h!==null&&i.len+h.len>=s){const g=a.sn;return this.loopSn!==g&&(this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${g}`),this.loopSn=g),null}}return this.loopSn=void 0,a}get primaryPrefetch(){if(la(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(la(this.hls.config)&&e.type!==m.SUBTITLE){const i=this.hls.interstitialsManager,r=i==null?void 0:i.bufferingItem;if(r){const a=r.event;if(a){if(a.appendInPlace||Math.abs(e.start-r.start)>1||r.start===0)return null}else if(e.end<=r.start&&(t==null?void 0:t.live)===!1||e.start>r.end&&r.nextEvent&&(r.nextEvent.appendInPlace||e.start-r.end>1))return null}const s=i==null?void 0:i.playerQueue;if(s)for(let a=s.length;a--;){const h=s[a].interstitial;if(h.appendInPlace&&e.start>=h.startTime&&e.end<=h.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,i){let r=-1,s=!1,a=!0;for(let h=0,g=e.length;h<g;h++){const d=e[h];if(a=a&&!d.independent,r>-1&&i<d.start)break;const v=d.loaded;v?r=-1:(s||d.independent||a)&&d.fragment===t&&(r=h),s=v}return r}loadedEndOfParts(e,t){const i=e[e.length-1];return i&&t>i.start&&i.loaded}getInitialLiveFragment(e){const t=e.fragments,i=this.fragPrevious;let r=null;if(i){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`),r=Ei(t,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const s=i.sn+1;if(s>=e.startSN&&s<=e.endSN){const a=t[s-e.startSN];i.cc===a.cc&&(r=a,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=Ni(e,i.cc,i.end),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const s=this.hls.liveSyncPosition;s!==null&&(r=this.getFragmentAtPosition(s,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,i){const{config:r}=this;let{fragPrevious:s}=this,{fragments:a,endSN:h}=i;const{fragmentHint:g}=i,{maxFragLookUpTolerance:d}=r,v=i.partList,S=!!(this.loadingParts&&v!=null&&v.length&&g);S&&g&&!this.bitrateTest&&v[v.length-1].fragment.sn===g.sn&&(a=a.concat(g),h=g.sn);let M;if(e<t){var j;const Q=e<this.lastCurrentTime||e>t-d||(j=this.media)!=null&&j.paused||!this.startFragRequested?0:d;M=ni(s,a,e,Q)}else M=a[a.length-1];if(M){const H=M.sn-i.startSN,Q=this.fragmentTracker.getState(M);if((Q===di.OK||Q===di.PARTIAL&&M.gap)&&(s=M),s&&M.sn===s.sn&&(!S||v[0].fragment.sn>M.sn||!i.live&&!S)&&s&&M.level===s.level){const re=a[H+1];M.sn<h&&this.fragmentTracker.getState(re)!==di.OK?M=re:M=null}}return M}alignPlaylists(e,t,i){const r=e.fragments.length;if(!r)return this.warn("No fragments in live playlist"),0;const s=e.fragmentStart,a=!t,h=e.alignedSliding&&k(s);if(a||!h&&!s){qo(i,e);const g=e.fragmentStart;return this.log(`Live playlist sliding: ${g.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${r}`),g}return s}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let i=this.startPosition;i<t&&(i=-1);const r=this.timelineOffset;if(i===-1){const s=this.startTimeOffset!==null,a=s?this.startTimeOffset:e.startTimeOffset;a!==null&&k(a)?(i=t+a,a<0&&(i+=e.edge),i=Math.min(Math.max(t,i),t+e.totalduration),this.log(`Setting startPosition to ${i} for start time offset ${a} found in ${s?"multivariant":"media"} playlist`),this.startPosition=i):e.live?(i=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${i}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=i=0),this.lastCurrentTime=i+r}this.nextLoadPosition=i+r}getLoadPosition(){var e;const{media:t}=this;let i=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?i=t.currentTime:this.nextLoadPosition>=0&&(i=this.nextLoadPosition),i}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&te(e)&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==Ke.FRAG_LOADING_WAITING_RETRY)&&(this.state=Ke.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const H=this.getCurrentContext(t.chunkMeta);H&&(t.frag=H.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;if(this.fragContextChanged(i)){var r;this.warn(`Frag load error must match current frag to retry ${i.url} > ${(r=this.fragCurrent)==null?void 0:r.url}`);return}const s=t.details===w.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(i,!0);const a=t.errorAction,{action:h,flags:g,retryCount:d=0,retryConfig:v}=a||{},S=!!a&&!!v,M=S&&h===yi.RetryRequest,j=S&&!a.resolved&&g===Ci.MoveAllAlternatesMatchingHost;if(!M&&j&&te(i)&&!i.endList)this.resetFragmentErrors(e),this.treatAsGap(i),a.resolved=!0;else if((M||j)&&d<v.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const H=Ui(v,d);this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${d+1}/${v.maxNumRetry} in ${H}ms`),a.resolved=!0,this.retryDate=self.performance.now()+H,this.state=Ke.FRAG_LOADING_WAITING_RETRY}else if(v&&a)if(this.resetFragmentErrors(e),d<v.maxNumRetry)!s&&h!==yi.RemoveAlternatePermanently&&(a.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${d})`);return}else h===yi.SendAlternateToPenaltyBox?this.state=Ke.WAITING_LEVEL:this.state=Ke.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===Ke.PARSING||this.state===Ke.PARSED){const t=e.frag,i=e.parent,r=this.getFwdBufferInfo(this.mediaBuffer,i),s=r&&r.len>.5;s&&this.reduceMaxBufferLength(r.len,(t==null?void 0:t.duration)||10);const a=!s;return a&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${i} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),a}return!1}resetFragmentErrors(e){e===m.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==Ke.STOPPED&&(this.state=Ke.IDLE)}afterBufferFlushed(e,t,i){if(!e)return;const r=Rt.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,i),this.state===Ke.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==Ke.STOPPED&&(this.state=Ke.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,i,r){const s=i.details;if(!s){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((g,d)=>{const v=e.elementaryStreams[d];if(v){const S=v.endPTS-v.startPTS;if(S<=0)return this.warn(`Could not parse fragment ${e.sn} ${d} duration reliably (${S})`),g||!1;const M=r?0:Xs(s,e,v.startPTS,v.endPTS,v.startDTS,v.endDTS);return this.hls.trigger(_.LEVEL_PTS_UPDATED,{details:s,level:i,drift:M,type:d,frag:e,start:v.startPTS,end:v.endPTS}),!0}return g},!1)){var h;if(i.fragmentError===0&&this.treatAsGap(e,i),((h=this.transmuxer)==null?void 0:h.error)===null){const g=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(g.message),this.hls.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.FRAG_PARSING_ERROR,fatal:!1,error:g,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${i.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=Ke.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(_.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===m.MAIN?"level":"track"}fragInfo(e,t=!0,i){var r,s;return`${this.playlistLabel()} ${e.level} (${i?"part":"frag"}:[${((r=t&&!i?e.startPTS:(i||e).start)!=null?r:NaN).toFixed(3)}-${((s=t&&!i?e.endPTS:(i||e).end)!=null?s:NaN).toFixed(3)}]${i&&e.type==="main"?"INDEPENDENT="+(i.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 la(o){return!!o.interstitialsController&&o.enableInterstitialPlayback!==!1}class ua{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let i;if(e.length)e.length===1?i=e[0]:i=Zo(e,t);else return new Uint8Array(0);return this.reset(),i}reset(){this.chunks.length=0,this.dataLength=0}}function Zo(o,e){const t=new Uint8Array(e);let i=0;for(let r=0;r<o.length;r++){const s=o[r];t.set(s,i),i+=s.length}return t}var ss={exports:{}},ca;function Xo(){return ca||(ca=1,function(o){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function r(g,d,v){this.fn=g,this.context=d,this.once=v||!1}function s(g,d,v,S,M){if(typeof v!="function")throw new TypeError("The listener must be a function");var j=new r(v,S||g,M),H=t?t+d:d;return g._events[H]?g._events[H].fn?g._events[H]=[g._events[H],j]:g._events[H].push(j):(g._events[H]=j,g._eventsCount++),g}function a(g,d){--g._eventsCount===0?g._events=new i:delete g._events[d]}function h(){this._events=new i,this._eventsCount=0}h.prototype.eventNames=function(){var d=[],v,S;if(this._eventsCount===0)return d;for(S in v=this._events)e.call(v,S)&&d.push(t?S.slice(1):S);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(v)):d},h.prototype.listeners=function(d){var v=t?t+d:d,S=this._events[v];if(!S)return[];if(S.fn)return[S.fn];for(var M=0,j=S.length,H=new Array(j);M<j;M++)H[M]=S[M].fn;return H},h.prototype.listenerCount=function(d){var v=t?t+d:d,S=this._events[v];return S?S.fn?1:S.length:0},h.prototype.emit=function(d,v,S,M,j,H){var Q=t?t+d:d;if(!this._events[Q])return!1;var Z=this._events[Q],re=arguments.length,fe,le;if(Z.fn){switch(Z.once&&this.removeListener(d,Z.fn,void 0,!0),re){case 1:return Z.fn.call(Z.context),!0;case 2:return Z.fn.call(Z.context,v),!0;case 3:return Z.fn.call(Z.context,v,S),!0;case 4:return Z.fn.call(Z.context,v,S,M),!0;case 5:return Z.fn.call(Z.context,v,S,M,j),!0;case 6:return Z.fn.call(Z.context,v,S,M,j,H),!0}for(le=1,fe=new Array(re-1);le<re;le++)fe[le-1]=arguments[le];Z.fn.apply(Z.context,fe)}else{var be=Z.length,we;for(le=0;le<be;le++)switch(Z[le].once&&this.removeListener(d,Z[le].fn,void 0,!0),re){case 1:Z[le].fn.call(Z[le].context);break;case 2:Z[le].fn.call(Z[le].context,v);break;case 3:Z[le].fn.call(Z[le].context,v,S);break;case 4:Z[le].fn.call(Z[le].context,v,S,M);break;default:if(!fe)for(we=1,fe=new Array(re-1);we<re;we++)fe[we-1]=arguments[we];Z[le].fn.apply(Z[le].context,fe)}}return!0},h.prototype.on=function(d,v,S){return s(this,d,v,S,!1)},h.prototype.once=function(d,v,S){return s(this,d,v,S,!0)},h.prototype.removeListener=function(d,v,S,M){var j=t?t+d:d;if(!this._events[j])return this;if(!v)return a(this,j),this;var H=this._events[j];if(H.fn)H.fn===v&&(!M||H.once)&&(!S||H.context===S)&&a(this,j);else{for(var Q=0,Z=[],re=H.length;Q<re;Q++)(H[Q].fn!==v||M&&!H[Q].once||S&&H[Q].context!==S)&&Z.push(H[Q]);Z.length?this._events[j]=Z.length===1?Z[0]:Z:a(this,j)}return this},h.prototype.removeAllListeners=function(d){var v;return d?(v=t?t+d:d,this._events[v]&&a(this,v)):(this._events=new i,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=t,h.EventEmitter=h,o.exports=h}(ss)),ss.exports}var Qo=Xo(),as=z(Qo);const An="1.6.5",ln={};function Jo(){return typeof __HLS_WORKER_BUNDLE__=="function"}function el(){const o=ln[An];if(o)return o.clientCount++,o;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),r={worker:new self.Worker(t),objectURL:t,clientCount:1};return ln[An]=r,r}function tl(o){const e=ln[o];if(e)return e.clientCount++,e;const t=new self.URL(o,self.location.href).href,r={worker:new self.Worker(t),scriptURL:t,clientCount:1};return ln[o]=r,r}function il(o){const e=ln[o||An];if(e&&e.clientCount--===1){const{worker:i,objectURL:r}=e;delete ln[o||An],r&&self.URL.revokeObjectURL(r),i.terminate()}}function ha(o,e){return e+10<=o.length&&o[e]===51&&o[e+1]===68&&o[e+2]===73&&o[e+3]<255&&o[e+4]<255&&o[e+6]<128&&o[e+7]<128&&o[e+8]<128&&o[e+9]<128}function os(o,e){return e+10<=o.length&&o[e]===73&&o[e+1]===68&&o[e+2]===51&&o[e+3]<255&&o[e+4]<255&&o[e+6]<128&&o[e+7]<128&&o[e+8]<128&&o[e+9]<128}function Bn(o,e){let t=0;return t=(o[e]&127)<<21,t|=(o[e+1]&127)<<14,t|=(o[e+2]&127)<<7,t|=o[e+3]&127,t}function Tn(o,e){const t=e;let i=0;for(;os(o,e);){i+=10;const r=Bn(o,e+6);i+=r,ha(o,e+10)&&(i+=10),e+=i}if(i>0)return o.subarray(t,t+i)}function rl(o,e,t,i){const r=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],s=e[t+2],a=s>>2&15;if(a>12){const j=new Error(`invalid ADTS sampling index:${a}`);o.emit(_.ERROR,_.ERROR,{type:T.MEDIA_ERROR,details:w.FRAG_PARSING_ERROR,fatal:!0,error:j,reason:j.message});return}const h=(s>>6&3)+1,g=e[t+3]>>6&3|(s&1)<<2,d="mp4a.40."+h,v=r[a];let S=a;(h===5||h===29)&&(S-=3);const M=[h<<3|(S&14)>>1,(S&1)<<7|g<<3];return F.log(`manifest codec:${i}, parsed codec:${d}, channels:${g}, rate:${v} (ADTS object type:${h} sampling index:${a})`),{config:M,samplerate:v,channelCount:g,codec:d,parsedCodec:d,manifestCodec:i}}function fa(o,e){return o[e]===255&&(o[e+1]&246)===240}function da(o,e){return o[e+1]&1?7:9}function ls(o,e){return(o[e+3]&3)<<11|o[e+4]<<3|(o[e+5]&224)>>>5}function nl(o,e){return e+5<o.length}function Nn(o,e){return e+1<o.length&&fa(o,e)}function sl(o,e){return nl(o,e)&&fa(o,e)&&ls(o,e)<=o.length-e}function al(o,e){if(Nn(o,e)){const t=da(o,e);if(e+t>=o.length)return!1;const i=ls(o,e);if(i<=t)return!1;const r=e+i;return r===o.length||Nn(o,r)}return!1}function pa(o,e,t,i,r){if(!o.samplerate){const s=rl(e,t,i,r);if(!s)return;c(o,s)}}function _a(o){return 1024*9e4/o}function ol(o,e){const t=da(o,e);if(e+t<=o.length){const i=ls(o,e)-t;if(i>0)return{headerLength:t,frameLength:i}}}function ga(o,e,t,i,r){const s=_a(o.samplerate),a=i+r*s,h=ol(e,t);let g;if(h){const{frameLength:S,headerLength:M}=h,j=M+S,H=Math.max(0,t+j-e.length);H?(g=new Uint8Array(j-M),g.set(e.subarray(t+M,e.length),0)):g=e.subarray(t+M,t+j);const Q={unit:g,pts:a};return H||o.samples.push(Q),{sample:Q,length:j,missing:H}}const d=e.length-t;return g=new Uint8Array(d),g.set(e.subarray(t,e.length),0),{sample:{unit:g,pts:a},length:d,missing:-1}}function ll(o,e){return os(o,e)&&Bn(o,e+6)+10<=o.length-e}function ul(o){return o instanceof ArrayBuffer?o:o.byteOffset==0&&o.byteLength==o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer}function us(o,e=0,t=1/0){return cl(o,e,t,Uint8Array)}function cl(o,e,t,i){const r=hl(o);let s=1;"BYTES_PER_ELEMENT"in i&&(s=i.BYTES_PER_ELEMENT);const a=fl(o)?o.byteOffset:0,h=(a+o.byteLength)/s,g=(a+e)/s,d=Math.floor(Math.max(0,Math.min(g,h))),v=Math.floor(Math.min(d+Math.max(t,0),h));return new i(r,d,v-d)}function hl(o){return o instanceof ArrayBuffer?o:o.buffer}function fl(o){return o&&o.buffer instanceof ArrayBuffer&&o.byteLength!==void 0&&o.byteOffset!==void 0}function dl(o){const e={key:o.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(o.size<2)return;if(o.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const i=o.data.subarray(1).indexOf(0);if(i===-1)return;const r=oe(us(o.data,1,i)),s=o.data[2+i],a=o.data.subarray(3+i).indexOf(0);if(a===-1)return;const h=oe(us(o.data,3+i,a));let g;return r==="-->"?g=oe(us(o.data,4+i+a)):g=ul(o.data.subarray(4+i+a)),e.mimeType=r,e.pictureType=s,e.description=h,e.data=g,e}function pl(o){if(o.size<2)return;const e=oe(o.data,!0),t=new Uint8Array(o.data.subarray(e.length+1));return{key:o.type,info:e,data:t.buffer}}function _l(o){if(o.size<2)return;if(o.type==="TXXX"){let t=1;const i=oe(o.data.subarray(t),!0);t+=i.length+1;const r=oe(o.data.subarray(t));return{key:o.type,info:i,data:r}}const e=oe(o.data.subarray(1));return{key:o.type,info:"",data:e}}function gl(o){if(o.type==="WXXX"){if(o.size<2)return;let t=1;const i=oe(o.data.subarray(t),!0);t+=i.length+1;const r=oe(o.data.subarray(t));return{key:o.type,info:i,data:r}}const e=oe(o.data);return{key:o.type,info:"",data:e}}function ml(o){return o.type==="PRIV"?pl(o):o.type[0]==="W"?gl(o):o.type==="APIC"?dl(o):_l(o)}function vl(o){const e=String.fromCharCode(o[0],o[1],o[2],o[3]),t=Bn(o,4),i=10;return{type:e,size:t,data:o.subarray(i,i+t)}}const Un=10,yl=10;function ma(o){let e=0;const t=[];for(;os(o,e);){const i=Bn(o,e+6);o[e+5]>>6&1&&(e+=Un),e+=Un;const r=e+i;for(;e+yl<r;){const s=vl(o.subarray(e)),a=ml(s);a&&t.push(a),e+=s.size+Un}ha(o,e)&&(e+=Un)}return t}function va(o){return o&&o.key==="PRIV"&&o.info==="com.apple.streaming.transportStreamTimestamp"}function bl(o){if(o.data.byteLength===8){const e=new Uint8Array(o.data),t=e[3]&1;let i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,t&&(i+=4772185884e-2),Math.round(i)}}function cs(o){const e=ma(o);for(let t=0;t<e.length;t++){const i=e[t];if(va(i))return bl(i)}}let zi=function(o){return o.audioId3="org.id3",o.dateRange="com.apple.quicktime.HLS",o.emsg="https://aomedia.org/emsg/ID3",o.misbklv="urn:misb:KLV:bin:1910.1",o}({});function vr(o="",e=9e4){return{type:o,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class hs{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,i,r){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,i){}demux(e,t){this.cachedData&&(e=je(this.cachedData,e),this.cachedData=null);let i=Tn(e,0),r=i?i.length:0,s;const a=this._audioTrack,h=this._id3Track,g=i?cs(i):void 0,d=e.length;for((this.basePTS===null||this.frameIndex===0&&k(g))&&(this.basePTS=El(g,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),i&&i.length>0&&h.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:zi.audioId3,duration:Number.POSITIVE_INFINITY});r<d;){if(this.canParse(e,r)){const v=this.appendFrame(a,e,r);v?(this.frameIndex++,this.lastPTS=v.sample.pts,r+=v.length,s=r):r=d}else ll(e,r)?(i=Tn(e,r),h.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:zi.audioId3,duration:Number.POSITIVE_INFINITY}),r+=i.length,s=r):r++;if(r===d&&s!==d){const v=e.slice(s);this.cachedData?this.cachedData=je(this.cachedData,v):this.cachedData=v}}return{audioTrack:a,videoTrack:vr(),id3Track:h,textTrack:vr()}}demuxSampleAes(e,t,i){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:vr(),id3Track:this._id3Track,textTrack:vr()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const El=(o,e,t)=>{if(k(o))return o*90;const i=t?t.baseTime*9e4/t.timescale:0;return e*9e4+i};let $n=null;const Sl=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],xl=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],wl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Cl=[0,1,1,4];function ya(o,e,t,i,r){if(t+24>e.length)return;const s=ba(e,t);if(s&&t+s.frameLength<=e.length){const a=s.samplesPerFrame*9e4/s.sampleRate,h=i+r*a,g={unit:e.subarray(t,t+s.frameLength),pts:h,dts:h};return o.config=[],o.channelCount=s.channelCount,o.samplerate=s.sampleRate,o.samples.push(g),{sample:g,length:s.frameLength,missing:0}}}function ba(o,e){const t=o[e+1]>>3&3,i=o[e+1]>>1&3,r=o[e+2]>>4&15,s=o[e+2]>>2&3;if(t!==1&&r!==0&&r!==15&&s!==3){const a=o[e+2]>>1&1,h=o[e+3]>>6,g=t===3?3-i:i===3?3:4,d=Sl[g*14+r-1]*1e3,S=xl[(t===3?0:t===2?1:2)*3+s],M=h===3?1:2,j=wl[t][i],H=Cl[i],Q=j*8*H,Z=Math.floor(j*d/S+a)*H;if($n===null){const le=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);$n=le?parseInt(le[1]):0}return!!$n&&$n<=87&&i===2&&d>=224e3&&h===0&&(o[e+3]=o[e+3]|128),{sampleRate:S,channelCount:M,frameLength:Z,samplesPerFrame:Q}}}function fs(o,e){return o[e]===255&&(o[e+1]&224)===224&&(o[e+1]&6)!==0}function Ea(o,e){return e+1<o.length&&fs(o,e)}function Al(o,e){return fs(o,e)&&4<=o.length-e}function Sa(o,e){if(e+1<o.length&&fs(o,e)){const i=ba(o,e);let r=4;i!=null&&i.frameLength&&(r=i.frameLength);const s=e+r;return s===o.length||Ea(o,s)}return!1}class Tl extends hs{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const i=Tn(e,0);let r=(i==null?void 0:i.length)||0;if(Sa(e,r))return!1;for(let s=e.length;r<s;r++)if(al(e,r))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return sl(e,t)}appendFrame(e,t,i){pa(e,this.observer,t,i,e.manifestCodec);const r=ga(e,t,i,this.basePTS,this.frameIndex);if(r&&r.missing===0)return r}}const xa=(o,e)=>{let t=0,i=5;e+=i;const r=new Uint32Array(1),s=new Uint32Array(1),a=new Uint8Array(1);for(;i>0;){a[0]=o[e];const h=Math.min(i,8),g=8-h;s[0]=4278190080>>>24+g<<g,r[0]=(a[0]&s[0])>>g,t=t?t<<h|r[0]:r[0],e+=1,i-=h}return t};class Dl extends hs{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,i){const r=wa(e,t,i,this.basePTS,this.frameIndex);if(r!==-1)return{sample:e.samples[e.samples.length-1],length:r,missing:0}}static probe(e){if(!e)return!1;const t=Tn(e,0);if(!t)return!1;const i=t.length;return e[i]===11&&e[i+1]===119&&cs(t)!==void 0&&xa(e,i)<16}}function wa(o,e,t,i,r){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const s=e[t+4]>>6;if(s>=3)return-1;const h=[48e3,44100,32e3][s],g=e[t+4]&63,v=[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][g*3+s]*2;if(t+v>e.length)return-1;const S=e[t+6]>>5;let M=0;S===2?M+=2:(S&1&&S!==1&&(M+=2),S&4&&(M+=2));const j=(e[t+6]<<8|e[t+7])>>12-M&1,Q=[2,1,2,3,3,4,4,5][S]+j,Z=e[t+5]>>3,re=e[t+5]&7,fe=new Uint8Array([s<<6|Z<<1|re>>2,(re&3)<<6|S<<3|j<<2|g>>4,g<<4&224]),le=1536/h*9e4,be=i+r*le,we=e.subarray(t,t+v);return o.config=fe,o.channelCount=Q,o.samplerate=h,o.samples.push({unit:we,pts:be}),v}class Ll extends hs{resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=Tn(e,0);let i=(t==null?void 0:t.length)||0;if(t&&e[i]===11&&e[i+1]===119&&cs(t)!==void 0&&xa(e,i)<=16)return!1;for(let r=e.length;i<r;i++)if(Sa(e,i))return F.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Al(e,t)}appendFrame(e,t,i){if(this.basePTS!==null)return ya(e,t,i,this.basePTS,this.frameIndex)}}const Rl=/\/emsg[-/]ID3/i;class kl{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,i,r){const s=this.videoTrack=vr("video",1),a=this.audioTrack=vr("audio",1),h=this.txtTrack=vr("text",1);if(this.id3Track=vr("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const g=We(e);if(g.video){const{id:d,timescale:v,codec:S,supplemental:M}=g.video;s.id=d,s.timescale=h.timescale=v,s.codec=S,s.supplemental=M}if(g.audio){const{id:d,timescale:v,codec:S}=g.audio;a.id=d,a.timescale=v,a.codec=S}h.id=Be.text,s.sampleDuration=0,s.duration=a.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return Re(e)}demux(e,t){this.timeOffset=t;let i=e;const r=this.videoTrack,s=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=je(this.remainderData,e));const h=Me(i);this.remainderData=h.remainder,r.samples=h.valid||new Uint8Array}else r.samples=i;const a=this.extractID3Track(r,t);return s.samples=tt(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:a,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,i=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(t,this.timeOffset);return i.samples=tt(e,t),{videoTrack:t,audioTrack:vr(),id3Track:r,textTrack:vr()}}extractID3Track(e,t){const i=this.id3Track;if(e.samples.length){const r=he(e.samples,["emsg"]);r&&r.forEach(s=>{const a=Qe(s);if(Rl.test(a.schemeIdUri)){const h=Ca(a,t);let g=a.eventDuration===4294967295?Number.POSITIVE_INFINITY:a.eventDuration/a.timeScale;g<=.001&&(g=Number.POSITIVE_INFINITY);const d=a.payload;i.samples.push({data:d,len:d.byteLength,dts:h,pts:h,type:zi.emsg,duration:g})}else if(this.config.enableEmsgKLVMetadata&&a.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const h=Ca(a,t);i.samples.push({data:a.payload,len:a.payload.byteLength,dts:h,pts:h,type:zi.misbklv,duration:Number.POSITIVE_INFINITY})}})}return i}demuxSampleAes(e,t,i){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 Ca(o,e){return k(o.presentationTime)?o.presentationTime/o.timeScale:e+o.presentationTimeDelta/o.timeScale}class Il{constructor(e,t,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new Ur(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Li.cbc)}decryptAacSample(e,t,i){const r=e[t].unit;if(r.length<=16)return;const s=r.subarray(16,r.length-r.length%16),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.length);this.decryptBuffer(a).then(h=>{const g=new Uint8Array(h);r.set(g,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,i)})}decryptAacSamples(e,t,i){for(;;t++){if(t>=e.length){i();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,i),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,i=new Int8Array(t);let r=0;for(let s=32;s<e.length-16;s+=160,r+=16)i.set(e.subarray(s,s+16),r);return i}getAvcDecryptedUnit(e,t){const i=new Uint8Array(t);let r=0;for(let s=32;s<e.length-16;s+=160,r+=16)e.set(i.subarray(r,r+16),s);return e}decryptAvcSample(e,t,i,r,s){const a=st(s.data),h=this.getAvcEncryptedData(a);this.decryptBuffer(h.buffer).then(g=>{s.data=this.getAvcDecryptedUnit(a,g),this.decrypter.isSync()||this.decryptAvcSamples(e,t,i+1,r)})}decryptAvcSamples(e,t,i,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,i=0){if(t>=e.length){r();return}const s=e[t].units;for(;!(i>=s.length);i++){const a=s[i];if(!(a.data.length<=48||a.type!==1&&a.type!==5)&&(this.decryptAvcSample(e,t,i,r,a),!this.decrypter.isSync()))return}}}}class Aa{constructor(){this.VideoSample=null}createVideoSample(e,t,i){return{key:e,frame:!1,pts:t,dts:i,units:[],length:0}}getLastNalUnit(e){var t;let i=this.VideoSample,r;if((!i||i.units.length===0)&&(i=e[e.length-1]),(t=i)!=null&&t.units){const s=i.units;r=s[s.length-1]}return r}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const i=t.samples,r=i.length;if(r){const s=i[r-1];e.pts=s.pts,e.dts=s.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,i){const r=t.byteLength;let s=e.naluState||0;const a=s,h=[];let g=0,d,v,S,M=-1,j=0;for(s===-1&&(M=0,j=this.getNALuType(t,0),s=0,g=1);g<r;){if(d=t[g++],!s){s=d?0:1;continue}if(s===1){s=d?0:2;continue}if(!d)s=3;else if(d===1){if(v=g-s-1,M>=0){const H={data:t.subarray(M,v),type:j};h.push(H)}else{const H=this.getLastNalUnit(e.samples);H&&(a&&g<=4-a&&H.state&&(H.data=H.data.subarray(0,H.data.byteLength-a)),v>0&&(H.data=je(H.data,t.subarray(0,v)),H.state=0))}g<r?(S=this.getNALuType(t,g),M=g,j=S,s=0):s=-1}else s=0}if(M>=0&&s>=0){const H={data:t.subarray(M,r),type:j,state:s};h.push(H)}if(h.length===0){const H=this.getLastNalUnit(e.samples);H&&(H.data=je(H.data,t))}return e.naluState=s,h}}class Dn{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,i=e.byteLength-t,r=new Uint8Array(4),s=Math.min(4,t);if(s===0)throw new Error("no bytes available");r.set(e.subarray(i,i+s)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=s*8,this.bytesAvailable-=s}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 i=this.word>>>32-t;if(e>32&&F.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?i<<t|this.readBits(t):i}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 Ta extends Aa{parsePES(e,t,i,r){const s=this.parseNALu(e,i.data,r);let a=this.VideoSample,h,g=!1;i.data=null,a&&s.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),s.forEach(d=>{var v,S;switch(d.type){case 1:{let Q=!1;h=!0;const Z=d.data;if(g&&Z.length>4){const re=this.readSliceType(Z);(re===2||re===4||re===7||re===9)&&(Q=!0)}if(Q){var M;(M=a)!=null&&M.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null)}a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.frame=!0,a.key=Q;break}case 5:h=!0,(v=a)!=null&&v.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0,a.frame=!0;break;case 6:{h=!0,ht(d.data,1,i.pts,t.samples);break}case 7:{var j,H;h=!0,g=!0;const Q=d.data,Z=this.readSPS(Q);if(!e.sps||e.width!==Z.width||e.height!==Z.height||((j=e.pixelRatio)==null?void 0:j[0])!==Z.pixelRatio[0]||((H=e.pixelRatio)==null?void 0:H[1])!==Z.pixelRatio[1]){e.width=Z.width,e.height=Z.height,e.pixelRatio=Z.pixelRatio,e.sps=[Q];const re=Q.subarray(1,4);let fe="avc1.";for(let le=0;le<3;le++){let be=re[le].toString(16);be.length<2&&(be="0"+be),fe+=be}e.codec=fe}break}case 8:h=!0,e.pps=[d.data];break;case 9:h=!0,e.audFound=!0,(S=a)!=null&&S.frame&&(this.pushAccessUnit(a,e),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts));break;case 12:h=!0;break;default:h=!1;break}a&&h&&a.units.push(d)}),r&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new Dn(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let i=8,r=8,s;for(let a=0;a<e;a++)r!==0&&(s=t.readEG(),r=(i+s+256)%256),i=r===0?i:r}readSPS(e){const t=new Dn(e);let i=0,r=0,s=0,a=0,h,g,d;const v=t.readUByte.bind(t),S=t.readBits.bind(t),M=t.readUEG.bind(t),j=t.readBoolean.bind(t),H=t.skipBits.bind(t),Q=t.skipEG.bind(t),Z=t.skipUEG.bind(t),re=this.skipScalingList.bind(this);v();const fe=v();if(S(5),H(3),v(),Z(),fe===100||fe===110||fe===122||fe===244||fe===44||fe===83||fe===86||fe===118||fe===128){const Pe=M();if(Pe===3&&H(1),Z(),Z(),H(1),j())for(g=Pe!==3?8:12,d=0;d<g;d++)j()&&(d<6?re(16,t):re(64,t))}Z();const le=M();if(le===0)M();else if(le===1)for(H(1),Q(),Q(),h=M(),d=0;d<h;d++)Q();Z(),H(1);const be=M(),we=M(),$e=S(1);$e===0&&H(1),H(1),j()&&(i=M(),r=M(),s=M(),a=M());let Ae=[1,1];if(j()&&j())switch(v()){case 1:Ae=[1,1];break;case 2:Ae=[12,11];break;case 3:Ae=[10,11];break;case 4:Ae=[16,11];break;case 5:Ae=[40,33];break;case 6:Ae=[24,11];break;case 7:Ae=[20,11];break;case 8:Ae=[32,11];break;case 9:Ae=[80,33];break;case 10:Ae=[18,11];break;case 11:Ae=[15,11];break;case 12:Ae=[64,33];break;case 13:Ae=[160,99];break;case 14:Ae=[4,3];break;case 15:Ae=[3,2];break;case 16:Ae=[2,1];break;case 255:{Ae=[v()<<8|v(),v()<<8|v()];break}}return{width:Math.ceil((be+1)*16-i*2-r*2),height:(2-$e)*(we+1)*16-($e?2:4)*(s+a),pixelRatio:Ae}}}class Da extends Aa{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,i,r){const s=this.parseNALu(e,i.data,r);let a=this.VideoSample,h,g=!1;i.data=null,a&&s.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),s.forEach(d=>{var v,S;switch(d.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:a||(a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),a.frame=!0,h=!0;break;case 16:case 17:case 18:case 21:if(h=!0,g){var M;(M=a)!=null&&M.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null)}a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0,a.frame=!0;break;case 19:case 20:h=!0,(v=a)!=null&&v.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0,a.frame=!0;break;case 39:h=!0,ht(d.data,2,i.pts,t.samples);break;case 32:h=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=c(e.params,this.readVPS(d.data)),this.initVPS=d.data),e.vps=[d.data];break;case 33:if(h=!0,g=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],d.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const j=this.readSPS(d.data);e.width=j.width,e.height=j.height,e.pixelRatio=j.pixelRatio,e.codec=j.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const H in j.params)e.params[H]=j.params[H]}this.pushParameterSet(e.sps,d.data,e.vps),a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0;break;case 34:if(h=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const j=this.readPPS(d.data);for(const H in j)e.params[H]=j[H]}this.pushParameterSet(e.pps,d.data,e.vps)}break;case 35:h=!0,e.audFound=!0,(S=a)!=null&&S.frame&&(this.pushAccessUnit(a,e),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts));break;default:h=!1;break}a&&h&&a.units.push(d)}),r&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}pushParameterSet(e,t,i){(i&&i[0]===this.initVPS||!i&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let i=0;for(let r=0;r<e.byteLength;r++)r>=2&&e[r]===3&&e[r-1]===0&&e[r-2]===0||(t[i]=e[r],i++);return new Uint8Array(t.buffer,0,i)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new Dn(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const i=t.readBits(3),r=t.readBoolean();return{numTemporalLayers:i+1,temporalIdNested:r}}readSPS(e){const t=new Dn(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const i=t.readBits(3);t.readBoolean();const r=t.readBits(2),s=t.readBoolean(),a=t.readBits(5),h=t.readUByte(),g=t.readUByte(),d=t.readUByte(),v=t.readUByte(),S=t.readUByte(),M=t.readUByte(),j=t.readUByte(),H=t.readUByte(),Q=t.readUByte(),Z=t.readUByte(),re=t.readUByte(),fe=[],le=[];for(let Zt=0;Zt<i;Zt++)fe.push(t.readBoolean()),le.push(t.readBoolean());if(i>0)for(let Zt=i;Zt<8;Zt++)t.readBits(2);for(let Zt=0;Zt<i;Zt++)fe[Zt]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),le[Zt]&&t.readUByte();t.readUEG();const be=t.readUEG();be==3&&t.skipBits(1);const we=t.readUEG(),$e=t.readUEG(),Ae=t.readBoolean();let Pe=0,Ue=0,De=0,Xe=0;Ae&&(Pe+=t.readUEG(),Ue+=t.readUEG(),De+=t.readUEG(),Xe+=t.readUEG());const ut=t.readUEG(),Tt=t.readUEG(),gt=t.readUEG(),vt=t.readBoolean();for(let Zt=vt?0:i;Zt<=i;Zt++)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 Fi=0;Fi<4;Fi++)for(let rr=0;rr<(Fi===3?2:6);rr++)if(!t.readBoolean())t.readUEG();else{const hr=Math.min(64,1<<4+(Fi<<1));Fi>1&&t.readEG();for(let gn=0;gn<hr;gn++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const wt=t.readUEG();let et=0;for(let Zt=0;Zt<wt;Zt++){let Fi=!1;if(Zt!==0&&(Fi=t.readBoolean()),Fi){Zt===wt&&t.readUEG(),t.readBoolean(),t.readUEG();let rr=0;for(let Zr=0;Zr<=et;Zr++){const hr=t.readBoolean();let gn=!1;hr||(gn=t.readBoolean()),(hr||gn)&&rr++}et=rr}else{const rr=t.readUEG(),Zr=t.readUEG();et=rr+Zr;for(let hr=0;hr<rr;hr++)t.readUEG(),t.readBoolean();for(let hr=0;hr<Zr;hr++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const Zt=t.readUEG();for(let Fi=0;Fi<Zt;Fi++){for(let rr=0;rr<gt+4;rr++)t.readBits(1);t.readBits(1)}}let Ft=0,Pt=1,$t=1,Vt=!0,ti=1,li=0;t.readBoolean(),t.readBoolean();let $i=!1;if(t.readBoolean()){if(t.readBoolean()){const Xr=t.readUByte(),ko=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Jn=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Xr>0&&Xr<16?(Pt=ko[Xr-1],$t=Jn[Xr-1]):Xr===255&&(Pt=t.readBits(16),$t=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(),$i=t.readBoolean(),$i&&(Pe+=t.readUEG(),Ue+=t.readUEG(),De+=t.readUEG(),Xe+=t.readUEG()),t.readBoolean()&&(ti=t.readBits(32),li=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const Jn=t.readBoolean(),Io=t.readBoolean();let On=!1;(Jn||Io)&&(On=t.readBoolean(),On&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),On&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Po=0;Po<=i;Po++){Vt=t.readBoolean();const ih=Vt||t.readBoolean();let Oo=!1;ih?t.readEG():Oo=t.readBoolean();const Fo=Oo?1:t.readUEG()+1;if(Jn)for(let Fn=0;Fn<Fo;Fn++)t.readUEG(),t.readUEG(),On&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(Io)for(let Fn=0;Fn<Fo;Fn++)t.readUEG(),t.readUEG(),On&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),Ft=t.readUEG())}let Nr=we,Ro=$e;if(Ae||$i){let Zt=1,Fi=1;be===1?Zt=Fi=2:be==2&&(Zt=2),Nr=we-Zt*Ue-Zt*Pe,Ro=$e-Fi*Xe-Fi*De}const eh=r?["A","B","C"][r]:"",th=h<<24|g<<16|d<<8|v;let Hs=0;for(let Zt=0;Zt<32;Zt++)Hs=(Hs|(th>>Zt&1)<<31-Zt)>>>0;let js=Hs.toString(16);return a===1&&js==="2"&&(js="6"),{codecString:`hvc1.${eh}${a}.${js}.${s?"H":"L"}${re}.B0`,params:{general_tier_flag:s,general_profile_idc:a,general_profile_space:r,general_profile_compatibility_flags:[h,g,d,v],general_constraint_indicator_flags:[S,M,j,H,Q,Z],general_level_idc:re,bit_depth:ut+8,bit_depth_luma_minus8:ut,bit_depth_chroma_minus8:Tt,min_spatial_segmentation_idc:Ft,chroma_format_idc:be,frame_rate:{fixed:Vt,fps:li/ti}},width:Nr,height:Ro,pixelRatio:[Pt,$t]}}readPPS(e){const t=new Dn(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 r=t.readBoolean(),s=t.readBoolean();let a=1;return s&&r?a=0:s?a=3:r&&(a=2),{parallelismType:a}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Ai=188;class Or{constructor(e,t,i,r){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=i,this.logger=r,this.videoParser=null}static probe(e,t){const i=Or.syncOffset(e);return i>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${i}`),i!==-1}static syncOffset(e){const t=e.length;let i=Math.min(Ai*5,t-Ai)+1,r=0;for(;r<i;){let s=!1,a=-1,h=0;for(let g=r;g<t;g+=Ai)if(e[g]===71&&(t-g===Ai||e[g+Ai]===71)){if(h++,a===-1&&(a=g,a!==0&&(i=Math.min(a+Ai*99,e.length-Ai)+1)),s||(s=ds(e,g)===0),s&&h>1&&(a===0&&h>2||g+Ai>i))return a}else{if(h)return-1;break}r++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Be[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,i,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Or.createTrack("video"),this._videoTrack.duration=r,this._audioTrack=Or.createTrack("audio",r),this._id3Track=Or.createTrack("id3"),this._txtTrack=Or.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:i}=this;e&&(e.pesData=null),t&&(t.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,i=!1,r=!1){i||(this.sampleAes=null);let s;const a=this._videoTrack,h=this._audioTrack,g=this._id3Track,d=this._txtTrack;let v=a.pid,S=a.pesData,M=h.pid,j=g.pid,H=h.pesData,Q=g.pesData,Z=null,re=this.pmtParsed,fe=this._pmtId,le=e.length;if(this.remainderData&&(e=je(this.remainderData,e),le=e.length,this.remainderData=null),le<Ai&&!r)return this.remainderData=e,{audioTrack:h,videoTrack:a,id3Track:g,textTrack:d};const be=Math.max(0,Or.syncOffset(e));le-=(le-be)%Ai,le<e.byteLength&&!r&&(this.remainderData=new Uint8Array(e.buffer,le,e.buffer.byteLength-le));let we=0;for(let Ae=be;Ae<le;Ae+=Ai)if(e[Ae]===71){const Pe=!!(e[Ae+1]&64),Ue=ds(e,Ae),De=(e[Ae+3]&48)>>4;let Xe;if(De>1){if(Xe=Ae+5+e[Ae+4],Xe===Ae+Ai)continue}else Xe=Ae+4;switch(Ue){case v:if(Pe){if(S&&(s=un(S,this.logger))){if(this.videoParser===null)switch(a.segmentCodec){case"avc":this.videoParser=new Ta;break;case"hevc":this.videoParser=new Da;break}this.videoParser!==null&&this.videoParser.parsePES(a,d,s,!1)}S={data:[],size:0}}S&&(S.data.push(e.subarray(Xe,Ae+Ai)),S.size+=Ae+Ai-Xe);break;case M:if(Pe){if(H&&(s=un(H,this.logger)))switch(h.segmentCodec){case"aac":this.parseAACPES(h,s);break;case"mp3":this.parseMPEGPES(h,s);break;case"ac3":this.parseAC3PES(h,s);break}H={data:[],size:0}}H&&(H.data.push(e.subarray(Xe,Ae+Ai)),H.size+=Ae+Ai-Xe);break;case j:Pe&&(Q&&(s=un(Q,this.logger))&&this.parseID3PES(g,s),Q={data:[],size:0}),Q&&(Q.data.push(e.subarray(Xe,Ae+Ai)),Q.size+=Ae+Ai-Xe);break;case 0:Pe&&(Xe+=e[Xe]+1),fe=this._pmtId=Pl(e,Xe);break;case fe:{Pe&&(Xe+=e[Xe]+1);const ut=Ol(e,Xe,this.typeSupported,i,this.observer,this.logger);v=ut.videoPid,v>0&&(a.pid=v,a.segmentCodec=ut.segmentVideoCodec),M=ut.audioPid,M>0&&(h.pid=M,h.segmentCodec=ut.segmentAudioCodec),j=ut.id3Pid,j>0&&(g.pid=j),Z!==null&&!re&&(this.logger.warn(`MPEG-TS PMT found at ${Ae} after unknown PID '${Z}'. Backtracking to sync byte @${be} to parse all TS packets.`),Z=null,Ae=be-188),re=this.pmtParsed=!0;break}case 17:case 8191:break;default:Z=Ue;break}}else we++;we>0&&ps(this.observer,new Error(`Found ${we} TS packet/s that do not start with 0x47`),void 0,this.logger),a.pesData=S,h.pesData=H,g.pesData=Q;const $e={audioTrack:h,videoTrack:a,id3Track:g,textTrack:d};return r&&this.extractRemainingSamples($e),$e}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:i,id3Track:r,textTrack:s}=e,a=i.pesData,h=t.pesData,g=r.pesData;let d;if(a&&(d=un(a,this.logger))){if(this.videoParser===null)switch(i.segmentCodec){case"avc":this.videoParser=new Ta;break;case"hevc":this.videoParser=new Da;break}this.videoParser!==null&&(this.videoParser.parsePES(i,s,d,!0),i.pesData=null)}else i.pesData=a;if(h&&(d=un(h,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,d);break;case"mp3":this.parseMPEGPES(t,d);break;case"ac3":this.parseAC3PES(t,d);break}t.pesData=null}else h!=null&&h.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=h;g&&(d=un(g,this.logger))?(this.parseID3PES(r,d),r.pesData=null):r.pesData=g}demuxSampleAes(e,t,i){const r=this.demux(e,i,!0,!this.config.progressive),s=this.sampleAes=new Il(this.observer,this.config,t);return this.decrypt(r,s)}decrypt(e,t){return new Promise(i=>{const{audioTrack:r,videoTrack:s}=e;r.samples&&r.segmentCodec==="aac"?t.decryptAacSamples(r.samples,0,()=>{s.samples?t.decryptAvcSamples(s.samples,0,0,()=>{i(e)}):i(e)}):s.samples&&t.decryptAvcSamples(s.samples,0,0,()=>{i(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 i=0;const r=this.aacOverFlow;let s=t.data;if(r){this.aacOverFlow=null;const S=r.missing,M=r.sample.unit.byteLength;if(S===-1)s=je(r.sample.unit,s);else{const j=M-S;r.sample.unit.set(s.subarray(0,S),j),e.samples.push(r.sample),i=r.missing}}let a,h;for(a=i,h=s.length;a<h-1&&!Nn(s,a);a++);if(a!==i){let S;const M=a<h-1;if(M?S=`AAC PES did not start with ADTS header,offset:${a}`:S="No ADTS header found in AAC PES",ps(this.observer,new Error(S),M,this.logger),!M)return}pa(e,this.observer,s,a,this.audioCodec);let g;if(t.pts!==void 0)g=t.pts;else if(r){const S=_a(e.samplerate);g=r.sample.pts+S}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let d=0,v;for(;a<h;)if(v=ga(e,s,a,g,d),a+=v.length,v.missing){this.aacOverFlow=v;break}else for(d++;a<h-1&&!Nn(s,a);a++);}parseMPEGPES(e,t){const i=t.data,r=i.length;let s=0,a=0;const h=t.pts;if(h===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<r;)if(Ea(i,a)){const g=ya(e,i,a,h,s);if(g)a+=g.length,s++;else break}else a++}parseAC3PES(e,t){{const i=t.data,r=t.pts;if(r===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const s=i.length;let a=0,h=0,g;for(;h<s&&(g=wa(e,i,h,r,a++))>0;)h+=g}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const i=c({},t,{type:this._videoTrack?zi.emsg:zi.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(i)}}function ds(o,e){return((o[e+1]&31)<<8)+o[e+2]}function Pl(o,e){return(o[e+10]&31)<<8|o[e+11]}function Ol(o,e,t,i,r,s){const a={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},h=(o[e+1]&15)<<8|o[e+2],g=e+3+h-4,d=(o[e+10]&15)<<8|o[e+11];for(e+=12+d;e<g;){const v=ds(o,e),S=(o[e+3]&15)<<8|o[e+4];switch(o[e]){case 207:if(!i){_s("ADTS AAC",s);break}case 15:a.audioPid===-1&&(a.audioPid=v);break;case 21:a.id3Pid===-1&&(a.id3Pid=v);break;case 219:if(!i){_s("H.264",s);break}case 27:a.videoPid===-1&&(a.videoPid=v);break;case 3:case 4:!t.mpeg&&!t.mp3?s.log("MPEG audio found, not supported in this browser"):a.audioPid===-1&&(a.audioPid=v,a.segmentAudioCodec="mp3");break;case 193:if(!i){_s("AC-3",s);break}case 129:t.ac3?a.audioPid===-1&&(a.audioPid=v,a.segmentAudioCodec="ac3"):s.log("AC-3 audio found, not supported in this browser");break;case 6:if(a.audioPid===-1&&S>0){let M=e+5,j=S;for(;j>2;){switch(o[M]){case 106:t.ac3!==!0?s.log("AC-3 audio found, not supported in this browser for now"):(a.audioPid=v,a.segmentAudioCodec="ac3");break}const Q=o[M+1]+2;M+=Q,j-=Q}}break;case 194:case 135:return ps(r,new Error("Unsupported EC-3 in M2TS found"),void 0,s),a;case 36:a.videoPid===-1&&(a.videoPid=v,a.segmentVideoCodec="hevc",s.log("HEVC in M2TS found"));break}e+=S+5}return a}function ps(o,e,t,i){i.warn(`parsing error: ${e.message}`),o.emit(_.ERROR,_.ERROR,{type:T.MEDIA_ERROR,details:w.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function _s(o,e){e.log(`${o} with AES-128-CBC encryption found in unencrypted stream`)}function un(o,e){let t=0,i,r,s,a,h;const g=o.data;if(!o||o.size===0)return null;for(;g[0].length<19&&g.length>1;)g[0]=je(g[0],g[1]),g.splice(1,1);if(i=g[0],(i[0]<<16)+(i[1]<<8)+i[2]===1){if(r=(i[4]<<8)+i[5],r&&r>o.size-6)return null;const v=i[7];v&192&&(a=(i[9]&14)*536870912+(i[10]&255)*4194304+(i[11]&254)*16384+(i[12]&255)*128+(i[13]&254)/2,v&64?(h=(i[14]&14)*536870912+(i[15]&255)*4194304+(i[16]&254)*16384+(i[17]&255)*128+(i[18]&254)/2,a-h>60*9e4&&(e.warn(`${Math.round((a-h)/9e4)}s delta between PTS and DTS, align them`),a=h)):h=a),s=i[8];let S=s+9;if(o.size<=S)return null;o.size-=S;const M=new Uint8Array(o.size);for(let j=0,H=g.length;j<H;j++){i=g[j];let Q=i.byteLength;if(S)if(S>Q){S-=Q;continue}else i=i.subarray(S),Q-=S,S=0;M.set(i,t),t+=Q}return r&&(r-=s+3),{data:M,pts:a,dts:h,len:r}}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 Fr=Math.pow(2,32)-1;class ke{static init(){ke.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 ke.types)ke.types.hasOwnProperty(e)&&(ke.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]),i=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]);ke.HDLR_TYPES={video:t,audio:i};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);ke.STTS=ke.STSC=ke.STCO=s,ke.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ke.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),ke.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),ke.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const a=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),g=new Uint8Array([0,0,0,1]);ke.FTYP=ke.box(ke.types.ftyp,a,g,a,h),ke.DINF=ke.box(ke.types.dinf,ke.box(ke.types.dref,r))}static box(e,...t){let i=8,r=t.length;const s=r;for(;r--;)i+=t[r].byteLength;const a=new Uint8Array(i);for(a[0]=i>>24&255,a[1]=i>>16&255,a[2]=i>>8&255,a[3]=i&255,a.set(e,4),r=0,i=8;r<s;r++)a.set(t[r],i),i+=t[r].byteLength;return a}static hdlr(e){return ke.box(ke.types.hdlr,ke.HDLR_TYPES[e])}static mdat(e){return ke.box(ke.types.mdat,e)}static mdhd(e,t){t*=e;const i=Math.floor(t/(Fr+1)),r=Math.floor(t%(Fr+1));return ke.box(ke.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,i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))}static mdia(e){return ke.box(ke.types.mdia,ke.mdhd(e.timescale||0,e.duration||0),ke.hdlr(e.type),ke.minf(e))}static mfhd(e){return ke.box(ke.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"?ke.box(ke.types.minf,ke.box(ke.types.smhd,ke.SMHD),ke.DINF,ke.stbl(e)):ke.box(ke.types.minf,ke.box(ke.types.vmhd,ke.VMHD),ke.DINF,ke.stbl(e))}static moof(e,t,i){return ke.box(ke.types.moof,ke.mfhd(e),ke.traf(i,t))}static moov(e){let t=e.length;const i=[];for(;t--;)i[t]=ke.trak(e[t]);return ke.box.apply(null,[ke.types.moov,ke.mvhd(e[0].timescale||0,e[0].duration||0)].concat(i).concat(ke.mvex(e)))}static mvex(e){let t=e.length;const i=[];for(;t--;)i[t]=ke.trex(e[t]);return ke.box.apply(null,[ke.types.mvex,...i])}static mvhd(e,t){t*=e;const i=Math.floor(t/(Fr+1)),r=Math.floor(t%(Fr+1)),s=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,i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&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 ke.box(ke.types.mvhd,s)}static sdtp(e){const t=e.samples||[],i=new Uint8Array(4+t.length);let r,s;for(r=0;r<t.length;r++)s=t[r].flags,i[r+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy;return ke.box(ke.types.sdtp,i)}static stbl(e){return ke.box(ke.types.stbl,ke.stsd(e),ke.box(ke.types.stts,ke.STTS),ke.box(ke.types.stsc,ke.STSC),ke.box(ke.types.stsz,ke.STSZ),ke.box(ke.types.stco,ke.STCO))}static avc1(e){let t=[],i=[],r,s,a;for(r=0;r<e.sps.length;r++)s=e.sps[r],a=s.byteLength,t.push(a>>>8&255),t.push(a&255),t=t.concat(Array.prototype.slice.call(s));for(r=0;r<e.pps.length;r++)s=e.pps[r],a=s.byteLength,i.push(a>>>8&255),i.push(a&255),i=i.concat(Array.prototype.slice.call(s));const h=ke.box(ke.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(i))),g=e.width,d=e.height,v=e.pixelRatio[0],S=e.pixelRatio[1];return ke.box(ke.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,g>>8&255,g&255,d>>8&255,d&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]),h,ke.box(ke.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),ke.box(ke.types.pasp,new Uint8Array([v>>24,v>>16&255,v>>8&255,v&255,S>>24,S>>16&255,S>>8&255,S&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 ke.box(ke.types.mp4a,ke.audioStsd(e),ke.box(ke.types.esds,ke.esds(e)))}static mp3(e){return ke.box(ke.types[".mp3"],ke.audioStsd(e))}static ac3(e){return ke.box(ke.types["ac-3"],ke.audioStsd(e),ke.box(ke.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return ke.box(ke.types.stsd,ke.STSD,ke.mp4a(e));if(t==="ac3"&&e.config)return ke.box(ke.types.stsd,ke.STSD,ke.ac3(e));if(t==="mp3"&&e.codec==="mp3")return ke.box(ke.types.stsd,ke.STSD,ke.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return ke.box(ke.types.stsd,ke.STSD,ke.avc1(e));if(t==="hevc"&&e.vps)return ke.box(ke.types.stsd,ke.STSD,ke.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,i=(e.duration||0)*(e.timescale||0),r=e.width||0,s=e.height||0,a=Math.floor(i/(Fr+1)),h=Math.floor(i%(Fr+1));return ke.box(ke.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,a>>24,a>>16&255,a>>8&255,a&255,h>>24,h>>16&255,h>>8&255,h&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,r>>8&255,r&255,0,0,s>>8&255,s&255,0,0]))}static traf(e,t){const i=ke.sdtp(e),r=e.id,s=Math.floor(t/(Fr+1)),a=Math.floor(t%(Fr+1));return ke.box(ke.types.traf,ke.box(ke.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),ke.box(ke.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,a>>24,a>>16&255,a>>8&255,a&255])),ke.trun(e,i.length+16+20+8+16+8+8),i)}static trak(e){return e.duration=e.duration||4294967295,ke.box(ke.types.trak,ke.tkhd(e),ke.mdia(e))}static trex(e){const t=e.id;return ke.box(ke.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 i=e.samples||[],r=i.length,s=12+16*r,a=new Uint8Array(s);let h,g,d,v,S,M;for(t+=8+s,a.set([e.type==="video"?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),h=0;h<r;h++)g=i[h],d=g.duration,v=g.size,S=g.flags,M=g.cts,a.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,v>>>24&255,v>>>16&255,v>>>8&255,v&255,S.isLeading<<2|S.dependsOn,S.isDependedOn<<6|S.hasRedundancy<<4|S.paddingValue<<1|S.isNonSync,S.degradPrio&61440,S.degradPrio&15,M>>>24&255,M>>>16&255,M>>>8&255,M&255],12+16*h);return ke.box(ke.types.trun,a)}static initSegment(e){ke.types||ke.init();const t=ke.moov(e);return je(ke.FTYP,t)}static hvc1(e){const t=e.params,i=[e.vps,e.sps,e.pps],r=4,s=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),r-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),i.length]);let a=s.length;for(let H=0;H<i.length;H+=1){a+=3;for(let Q=0;Q<i[H].length;Q+=1)a+=2+i[H][Q].length}const h=new Uint8Array(a);h.set(s,0),a=s.length;const g=i.length-1;for(let H=0;H<i.length;H+=1){h.set(new Uint8Array([32+H|(H===g?128:0),0,i[H].length]),a),a+=3;for(let Q=0;Q<i[H].length;Q+=1)h.set(new Uint8Array([i[H][Q].length>>8,i[H][Q].length&255]),a),a+=2,h.set(i[H][Q],a),a+=i[H][Q].length}const d=ke.box(ke.types.hvcC,h),v=e.width,S=e.height,M=e.pixelRatio[0],j=e.pixelRatio[1];return ke.box(ke.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,v>>8&255,v&255,S>>8&255,S&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]),d,ke.box(ke.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),ke.box(ke.types.pasp,new Uint8Array([M>>24,M>>16&255,M>>8&255,M&255,j>>24,j>>16&255,j>>8&255,j&255])))}}ke.types=void 0,ke.HDLR_TYPES=void 0,ke.STTS=void 0,ke.STSC=void 0,ke.STCO=void 0,ke.STSZ=void 0,ke.VMHD=void 0,ke.SMHD=void 0,ke.STSD=void 0,ke.FTYP=void 0,ke.DINF=void 0;const La=9e4;function gs(o,e,t=1,i=!1){const r=o*e*t;return i?Math.round(r):r}function Ml(o,e,t=1,i=!1){return gs(o,e,1/t,i)}function Ln(o,e=!1){return gs(o,1e3,1/La,e)}function Bl(o,e=1){return gs(o,La,1/e)}const Nl=10*1e3,Ul=1024,$l=1152,Hl=1536;let cn=null,ms=null;function Ra(o,e,t,i){return{duration:e,size:t,cts:i,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:o?2:1,isNonSync:o?0:1}}}class Hn{constructor(e,t,i,r){if(this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=i,this.logger=r,this.ISGenerated=!1,cn===null){const a=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);cn=a?parseInt(a[1]):0}if(ms===null){const s=navigator.userAgent.match(/Safari\/(\d+)/i);ms=s?parseInt(s[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const i=e[0].pts,r=e.reduce((s,a)=>{let h=a.pts,g=h-s;return g<-4294967296&&(t=!0,h=er(h,i),g=h-s),g>0?s:h},i);return t&&this.logger.debug("PTS rollover detected"),r}remux(e,t,i,r,s,a,h,g){let d,v,S,M,j,H,Q=s,Z=s;const re=e.pid>-1,fe=t.pid>-1,le=t.samples.length,be=e.samples.length>0,we=h&&le>0||le>1;if((!re||be)&&(!fe||we)||this.ISGenerated||h){if(this.ISGenerated){var Ae,Pe,Ue,De;const gt=this.videoTrackConfig;(gt&&(t.width!==gt.width||t.height!==gt.height||((Ae=t.pixelRatio)==null?void 0:Ae[0])!==((Pe=gt.pixelRatio)==null?void 0:Pe[0])||((Ue=t.pixelRatio)==null?void 0:Ue[1])!==((De=gt.pixelRatio)==null?void 0:De[1]))||!gt&&we||this.nextAudioPts===null&&be)&&this.resetInitSegment()}this.ISGenerated||(S=this.generateIS(e,t,s,a));const Xe=this.isVideoContiguous;let ut=-1,Tt;if(we&&(ut=jl(t.samples),!Xe&&this.config.forceKeyFrameOnDiscontinuity))if(H=!0,ut>0){this.logger.warn(`[mp4-remuxer]: Dropped ${ut} out of ${le} video samples due to a missing keyframe`);const gt=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(ut),t.dropped+=ut,Z+=(t.samples[0].pts-gt)/t.inputTimeScale,Tt=Z}else ut===-1&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${le} video samples`),H=!1);if(this.ISGenerated){if(be&&we){const gt=this.getVideoStartPts(t.samples),ct=(er(e.samples[0].pts,gt)-gt)/t.inputTimeScale;Q+=Math.max(0,ct),Z+=Math.max(0,-ct)}if(be){if(e.samplerate||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),S=this.generateIS(e,t,s,a)),v=this.remuxAudio(e,Q,this.isAudioContiguous,a,fe||we||g===m.AUDIO?Z:void 0),we){const gt=v?v.endPTS-v.startPTS:0;t.inputTimeScale||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),S=this.generateIS(e,t,s,a)),d=this.remuxVideo(t,Z,Xe,gt)}}else we&&(d=this.remuxVideo(t,Z,Xe,0));d&&(d.firstKeyFrame=ut,d.independent=ut!==-1,d.firstKeyFramePTS=Tt)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(j=ka(i,s,this._initPTS,this._initDTS)),r.samples.length&&(M=Ia(r,s,this._initPTS))),{audio:v,video:d,initSegment:S,independent:H,text:M,id3:j}}generateIS(e,t,i,r){const s=e.samples,a=t.samples,h=this.typeSupported,g={},d=this._initPTS;let v=!d||r,S="audio/mp4",M,j,H,Q;if(v&&(M=j=1/0),e.config&&s.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":h.mpeg?(S="audio/mpeg",e.codec=""):h.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}g.audio={id:"audio",container:S,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&h.mpeg?new Uint8Array(0):ke.initSegment([e]),metadata:{channelCount:e.channelCount}},v&&(Q=e.id,H=e.inputTimeScale,!d||H!==d.timescale?M=j=s[0].pts-Math.round(H*i):v=!1)}if(t.sps&&t.pps&&a.length){if(t.timescale=t.inputTimeScale,g.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:ke.initSegment([t]),metadata:{width:t.width,height:t.height}},v)if(Q=t.id,H=t.inputTimeScale,!d||H!==d.timescale){const Z=this.getVideoStartPts(a),re=Math.round(H*i);j=Math.min(j,er(a[0].dts,Z)-re),M=Math.min(M,Z-re)}else v=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(g).length)return this.ISGenerated=!0,v?(this._initPTS={baseTime:M,timescale:H},this._initDTS={baseTime:j,timescale:H}):M=H=void 0,{tracks:g,initPTS:M,timescale:H,trackId:Q}}remuxVideo(e,t,i,r){const s=e.inputTimeScale,a=e.samples,h=[],g=a.length,d=this._initPTS;let v=this.nextAvcDts,S=8,M=this.videoSampleDuration,j,H,Q=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,re=!1;if(!i||v===null){const et=t*s,rt=a[0].pts-er(a[0].dts,a[0].pts);cn&&v!==null&&Math.abs(et-rt-v)<15e3?i=!0:v=et-rt}const fe=d.baseTime*s/d.timescale;for(let et=0;et<g;et++){const rt=a[et];rt.pts=er(rt.pts-fe,v),rt.dts=er(rt.dts-fe,v),rt.dts<a[et>0?et-1:et].dts&&(re=!0)}re&&a.sort(function(et,rt){const Ft=et.dts-rt.dts,Pt=et.pts-rt.pts;return Ft||Pt}),j=a[0].dts,H=a[a.length-1].dts;const le=H-j,be=le?Math.round(le/(g-1)):M||e.inputTimeScale/30;if(i){const et=j-v,rt=et>be,Ft=et<-1;if((rt||Ft)&&(rt?this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Ln(et,!0)} ms (${et}dts) hole between fragments detected at ${t.toFixed(3)}`):this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Ln(-et,!0)} ms (${et}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!Ft||v>=a[0].pts||cn)){j=v;const Pt=a[0].pts-et;if(rt)a[0].dts=j,a[0].pts=Pt;else{let $t=!0;for(let Vt=0;Vt<a.length&&!(a[Vt].dts>Pt&&$t);Vt++){const ti=a[Vt].pts;if(a[Vt].dts-=et,a[Vt].pts-=et,Vt<a.length-1){const li=a[Vt+1].pts,$i=a[Vt].pts,Gi=li<=$i,Nr=li<=ti;$t=Gi==Nr}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${Ln(Pt,!0)}/${Ln(j,!0)}, delta: ${Ln(et,!0)} ms`)}}j=Math.max(0,j);let we=0,$e=0,Ae=j;for(let et=0;et<g;et++){const rt=a[et],Ft=rt.units,Pt=Ft.length;let $t=0;for(let Vt=0;Vt<Pt;Vt++)$t+=Ft[Vt].data.length;$e+=$t,we+=Pt,rt.length=$t,rt.dts<Ae?(rt.dts=Ae,Ae+=be/4|0||1):Ae=rt.dts,Q=Math.min(rt.pts,Q),Z=Math.max(rt.pts,Z)}H=a[g-1].dts;const Pe=$e+4*we+8;let Ue;try{Ue=new Uint8Array(Pe)}catch(et){this.observer.emit(_.ERROR,_.ERROR,{type:T.MUX_ERROR,details:w.REMUX_ALLOC_ERROR,fatal:!1,error:et,bytes:Pe,reason:`fail allocating video mdat ${Pe}`});return}const De=new DataView(Ue.buffer);De.setUint32(0,Pe),Ue.set(ke.types.mdat,4);let Xe=!1,ut=Number.POSITIVE_INFINITY,Tt=Number.POSITIVE_INFINITY,gt=Number.NEGATIVE_INFINITY,vt=Number.NEGATIVE_INFINITY;for(let et=0;et<g;et++){const rt=a[et],Ft=rt.units;let Pt=0;for(let ti=0,li=Ft.length;ti<li;ti++){const $i=Ft[ti],Gi=$i.data,Nr=$i.data.byteLength;De.setUint32(S,Nr),S+=4,Ue.set(Gi,S),S+=Nr,Pt+=4+Nr}let $t;if(et<g-1)M=a[et+1].dts-rt.dts,$t=a[et+1].pts-rt.pts;else{const ti=this.config,li=et>0?rt.dts-a[et-1].dts:be;if($t=et>0?rt.pts-a[et-1].pts:be,ti.stretchShortVideoTrack&&this.nextAudioPts!==null){const $i=Math.floor(ti.maxBufferHole*s),Gi=(r?Q+r*s:this.nextAudioPts)-rt.pts;Gi>$i?(M=Gi-li,M<0?M=li:Xe=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${Gi/90} ms to the next segment; using duration ${M/90} ms for the last video frame.`)):M=li}else M=li}const Vt=Math.round(rt.pts-rt.dts);ut=Math.min(ut,M),gt=Math.max(gt,M),Tt=Math.min(Tt,$t),vt=Math.max(vt,$t),h.push(Ra(rt.key,M,Pt,Vt))}if(h.length){if(cn){if(cn<70){const et=h[0].flags;et.dependsOn=2,et.isNonSync=0}}else if(ms&&vt-Tt<gt-ut&&be/gt<.025&&h[0].cts===0){this.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let et=j;for(let rt=0,Ft=h.length;rt<Ft;rt++){const Pt=et+h[rt].duration,$t=et+h[rt].cts;if(rt<Ft-1){const Vt=Pt+h[rt+1].cts;h[rt].duration=Vt-$t}else h[rt].duration=rt?h[rt-1].duration:be;h[rt].cts=0,et=Pt}}}M=Xe||!M?be:M,this.nextAvcDts=v=H+M,this.videoSampleDuration=M,this.isVideoContiguous=!0;const wt={data1:ke.moof(e.sequenceNumber++,j,c(e,{samples:h})),data2:Ue,startPTS:Q/s,endPTS:(Z+M)/s,startDTS:j/s,endDTS:v/s,type:"video",hasAudio:!1,hasVideo:!0,nb:h.length,dropped:e.dropped};return e.samples=[],e.dropped=0,wt}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return $l;case"ac3":return Hl;default:return Ul}}remuxAudio(e,t,i,r,s){const a=e.inputTimeScale,h=e.samplerate?e.samplerate:a,g=a/h,d=this.getSamplesPerFrame(e),v=d*g,S=this._initPTS,M=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,j=[],H=s!==void 0;let Q=e.samples,Z=M?0:8,re=this.nextAudioPts||-1;const fe=t*a,le=S.baseTime*a/S.timescale;if(this.isAudioContiguous=i=i||Q.length&&re>0&&(r&&Math.abs(fe-re)<9e3||Math.abs(er(Q[0].pts-le,fe)-re)<20*v),Q.forEach(function(ct){ct.pts=er(ct.pts-le,fe)}),!i||re<0){if(Q=Q.filter(ct=>ct.pts>=0),!Q.length)return;s===0?re=0:r&&!H?re=Math.max(0,fe):re=Q[0].pts}if(e.segmentCodec==="aac"){const ct=this.config.maxAudioFramesDrift;for(let bt=0,wt=re;bt<Q.length;bt++){const et=Q[bt],rt=et.pts,Ft=rt-wt,Pt=Math.abs(1e3*Ft/a);if(Ft<=-ct*v&&H)bt===0&&(this.logger.warn(`Audio frame @ ${(rt/a).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*Ft/a)} ms.`),this.nextAudioPts=re=wt=rt);else if(Ft>=ct*v&&Pt<Nl&&H){let $t=Math.round(Ft/v);wt=rt-$t*v,wt<0&&($t--,wt+=v),bt===0&&(this.nextAudioPts=re=wt),this.logger.warn(`[mp4-remuxer]: Injecting ${$t} audio frame @ ${(wt/a).toFixed(3)}s due to ${Math.round(1e3*Ft/a)} ms gap.`);for(let Vt=0;Vt<$t;Vt++){const ti=Math.max(wt,0);let li=Fl.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);li||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),li=et.unit.subarray()),Q.splice(bt,0,{unit:li,pts:ti}),wt+=v,bt++}}et.pts=wt,wt+=v}}let be=null,we=null,$e,Ae=0,Pe=Q.length;for(;Pe--;)Ae+=Q[Pe].unit.byteLength;for(let ct=0,bt=Q.length;ct<bt;ct++){const wt=Q[ct],et=wt.unit;let rt=wt.pts;if(we!==null){const Pt=j[ct-1];Pt.duration=Math.round((rt-we)/g)}else if(i&&e.segmentCodec==="aac"&&(rt=re),be=rt,Ae>0){Ae+=Z;try{$e=new Uint8Array(Ae)}catch(Pt){this.observer.emit(_.ERROR,_.ERROR,{type:T.MUX_ERROR,details:w.REMUX_ALLOC_ERROR,fatal:!1,error:Pt,bytes:Ae,reason:`fail allocating audio mdat ${Ae}`});return}M||(new DataView($e.buffer).setUint32(0,Ae),$e.set(ke.types.mdat,4))}else return;$e.set(et,Z);const Ft=et.byteLength;Z+=Ft,j.push(Ra(!0,d,Ft,0)),we=rt}const Ue=j.length;if(!Ue)return;const De=j[j.length-1];this.nextAudioPts=re=we+g*De.duration;const Xe=M?new Uint8Array(0):ke.moof(e.sequenceNumber++,be/g,c({},e,{samples:j}));e.samples=[];const ut=be/a,Tt=re/a,vt={data1:Xe,data2:$e,startPTS:ut,endPTS:Tt,startDTS:ut,endDTS:Tt,type:"audio",hasAudio:!0,hasVideo:!1,nb:Ue};return this.isAudioContiguous=!0,vt}}function er(o,e){let t;if(e===null)return o;for(e<o?t=-8589934592:t=8589934592;Math.abs(o-e)>4294967296;)o+=t;return o}function jl(o){for(let e=0;e<o.length;e++)if(o[e].key)return e;return-1}function ka(o,e,t,i){const r=o.samples.length;if(!r)return;const s=o.inputTimeScale;for(let h=0;h<r;h++){const g=o.samples[h];g.pts=er(g.pts-t.baseTime*s/t.timescale,e*s)/s,g.dts=er(g.dts-i.baseTime*s/i.timescale,e*s)/s}const a=o.samples;return o.samples=[],{samples:a}}function Ia(o,e,t){const i=o.samples.length;if(!i)return;const r=o.inputTimeScale;for(let a=0;a<i;a++){const h=o.samples[a];h.pts=er(h.pts-t.baseTime*r/t.timescale,e*r)/r}o.samples.sort((a,h)=>a.pts-h.pts);const s=o.samples;return o.samples=[],{samples:s}}class Wl{constructor(e,t,i,r){this.logger=void 0,this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1,this.logger=r}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,i,r){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(Ce(e,r)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:i}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const r=this.initData=We(e);r.audio&&(t=Pa(r.audio,x.AUDIO,this.logger)),r.video&&(i=Pa(r.video,x.VIDEO,this.logger));const s={};r.audio&&r.video?s.audiovideo={container:"video/mp4",codec:t+","+i,supplemental:r.video.supplemental,initSegment:e,id:"main"}:r.audio?s.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?s.video={container:"video/mp4",codec:i,supplemental:r.video.supplemental,initSegment:e,id:"main"}:this.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s}remux(e,t,i,r,s,a){var h,g;let{initPTS:d,lastEndTime:v}=this;const S={audio:void 0,video:void 0,text:r,id3:i,initSegment:void 0};k(v)||(v=this.lastEndTime=s||0);const M=t.samples;if(!(M!=null&&M.length))return S;const j={initPTS:void 0,timescale:void 0,trackId:void 0};let H=this.initData;if((h=H)!=null&&h.length||(this.generateInitSegment(M),H=this.initData),!((g=H)!=null&&g.length))return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(j.tracks=this.initTracks,this.emitInitSegment=!1);const Q=Te(M,H,this.logger),Z=H.audio?Q[H.audio.id]:null,re=H.video?Q[H.video.id]:null,fe=jn(re,1/0),le=jn(Z,1/0),be=jn(re,0,!0),we=jn(Z,0,!0);let $e,Ae=s,Pe=0;if(Z&&(!re||!d&&le<fe||d&&d.trackId===H.audio.id)?(j.trackId=H.audio.id,$e=Z,Pe=we-le):re&&(j.trackId=H.video.id,$e=re,Pe=be-fe),$e){const ct=$e.timescale;Ae=$e.start/ct,j.timescale=ct,d||(j.initPTS=$e.start-s*ct,this.initPTS=d={baseTime:j.initPTS,timescale:ct,trackId:j.trackId})}(a||!d)&&(Gl(d,Ae,s,Pe)||j.timescale!==d.timescale)&&(j.initPTS=Ae-s,d&&d.timescale===1&&this.logger.warn(`Adjusting initPTS @${s} from ${d.baseTime/d.timescale} to ${j.initPTS}`),this.initPTS=d={baseTime:j.initPTS,timescale:1});const Ue=e?Ae-d.baseTime/d.timescale:v;Ne(H,M,d.baseTime/d.timescale);const De=Ue+Pe;Pe>0?this.lastEndTime=De:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Xe=!!H.audio,ut=!!H.video;let Tt="";Xe&&(Tt+="audio"),ut&&(Tt+="video");const gt={data1:M,startPTS:Ue,startDTS:Ue,endPTS:De,endDTS:De,type:Tt,hasAudio:Xe,hasVideo:ut,nb:1,dropped:0};S.audio=Xe&&!ut?gt:void 0,S.video=ut?gt:void 0;const vt=re==null?void 0:re.sampleCount;if(vt){const ct=re.keyFrameIndex,bt=ct!==-1;gt.nb=vt,gt.dropped=ct===0||this.isVideoContiguous?0:bt?ct:vt,gt.independent=bt,gt.firstKeyFrame=ct,bt&&re.keyFrameStart&&(gt.firstKeyFramePTS=re.keyFrameStart-d.baseTime/d.timescale),this.isVideoContiguous||(S.independent=bt),this.isVideoContiguous||(this.isVideoContiguous=bt),gt.dropped&&this.logger.warn(`fmp4 does not start with IDR: firstIDR ${ct}/${vt} dropped: ${gt.dropped} pts: ${gt.firstKeyFramePTS||"NA"}`)}return S.initSegment=j,S.id3=ka(i,s,d,d),r.samples.length&&(S.text=Ia(r,s,d)),S}}function jn(o,e,t=!1){return(o==null?void 0:o.start)!==void 0?(o.start+(t?o.duration:0))/o.timescale:e}function Gl(o,e,t,i){if(o===null)return!0;const r=Math.max(i,1),s=e-o.baseTime/o.timescale;return Math.abs(s-t)>r}function Pa(o,e,t){const i=o==null?void 0:o.codec;return i&&i.length>4?i:e===x.AUDIO?i==="ec-3"||i==="ac-3"||i==="alac"?i:i==="fLaC"||i==="Opus"?Ve(i,!1):(t.warn(`Unhandled audio codec "${i}" in mp4 MAP`),i||"mp4a"):(t.warn(`Unhandled video codec "${i}" in mp4 MAP`),i||"avc1")}let Lr;try{Lr=self.performance.now.bind(self.performance)}catch(o){Lr=Date.now}const Wn=[{demux:kl,remux:Wl},{demux:Or,remux:Hn},{demux:Tl,remux:Hn},{demux:Ll,remux:Hn}];Wn.splice(2,0,{demux:Dl,remux:Hn});class Oa{constructor(e,t,i,r,s,a){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=i,this.id=s,this.logger=a}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,i,r){const s=i.transmuxing;s.executeStart=Lr();let a=new Uint8Array(e);const{currentTransmuxState:h,transmuxConfig:g}=this;r&&(this.currentTransmuxState=r);const{contiguous:d,discontinuity:v,trackSwitch:S,accurateTimeOffset:M,timeOffset:j,initSegmentChange:H}=r||h,{audioCodec:Q,videoCodec:Z,defaultInitPts:re,duration:fe,initSegmentData:le}=g,be=Kl(a,t);if(be&&ur(be.method)){const Pe=this.getDecrypter(),Ue=Gr(be.method);if(Pe.isSync()){let De=Pe.softwareDecrypt(a,be.key.buffer,be.iv.buffer,Ue);if(i.part>-1){const ut=Pe.flush();De=ut&&ut.buffer}if(!De)return s.executeEnd=Lr(),vs(i);a=new Uint8Array(De)}else return this.asyncResult=!0,this.decryptionPromise=Pe.webCryptoDecrypt(a,be.key.buffer,be.iv.buffer,Ue).then(De=>{const Xe=this.push(De,null,i);return this.decryptionPromise=null,Xe}),this.decryptionPromise}const we=this.needsProbing(v,S);if(we){const Pe=this.configureTransmuxer(a);if(Pe)return this.logger.warn(`[transmuxer] ${Pe.message}`),this.observer.emit(_.ERROR,_.ERROR,{type:T.MEDIA_ERROR,details:w.FRAG_PARSING_ERROR,fatal:!1,error:Pe,reason:Pe.message}),s.executeEnd=Lr(),vs(i)}(v||S||H||we)&&this.resetInitSegment(le,Q,Z,fe,t),(v||H||we)&&this.resetInitialTimestamp(re),d||this.resetContiguity();const $e=this.transmux(a,be,j,M,i);this.asyncResult=Rn($e);const Ae=this.currentTransmuxState;return Ae.contiguous=!0,Ae.discontinuity=!1,Ae.trackSwitch=!1,s.executeEnd=Lr(),$e}flush(e){const t=e.transmuxing;t.executeStart=Lr();const{decrypter:i,currentTransmuxState:r,decryptionPromise:s}=this;if(s)return this.asyncResult=!0,s.then(()=>this.flush(e));const a=[],{timeOffset:h}=r;if(i){const S=i.flush();S&&a.push(this.push(S.buffer,null,e))}const{demuxer:g,remuxer:d}=this;if(!g||!d){t.executeEnd=Lr();const S=[vs(e)];return this.asyncResult?Promise.resolve(S):S}const v=g.flush(h);return Rn(v)?(this.asyncResult=!0,v.then(S=>(this.flushRemux(a,S,e),a))):(this.flushRemux(a,v,e),this.asyncResult?Promise.resolve(a):a)}flushRemux(e,t,i){const{audioTrack:r,videoTrack:s,id3Track:a,textTrack:h}=t,{accurateTimeOffset:g,timeOffset:d}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${i.sn}${i.part>-1?" part: "+i.part:""} of ${this.id===m.MAIN?"level":"track"} ${i.level}`);const v=this.remuxer.remux(r,s,a,h,d,g,!0,this.id);e.push({remuxResult:v,chunkMeta:i}),i.transmuxing.executeEnd=Lr()}resetInitialTimestamp(e){const{demuxer:t,remuxer:i}=this;!t||!i||(t.resetTimeStamp(e),i.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,i,r,s){const{demuxer:a,remuxer:h}=this;!a||!h||(a.resetInitSegment(e,t,i,r),h.resetInitSegment(e,t,i,s))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,i,r,s){let a;return t&&t.method==="SAMPLE-AES"?a=this.transmuxSampleAes(e,t,i,r,s):a=this.transmuxUnencrypted(e,i,r,s),a}transmuxUnencrypted(e,t,i,r){const{audioTrack:s,videoTrack:a,id3Track:h,textTrack:g}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(s,a,h,g,t,i,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,i,r,s){return this.demuxer.demuxSampleAes(e,t,i).then(a=>({remuxResult:this.remuxer.remux(a.audioTrack,a.videoTrack,a.id3Track,a.textTrack,i,r,!1,this.id),chunkMeta:s}))}configureTransmuxer(e){const{config:t,observer:i,typeSupported:r}=this;let s;for(let S=0,M=Wn.length;S<M;S++){var a;if((a=Wn[S].demux)!=null&&a.probe(e,this.logger)){s=Wn[S];break}}if(!s)return new Error("Failed to find demuxer by probing fragment data");const h=this.demuxer,g=this.remuxer,d=s.remux,v=s.demux;(!g||!(g instanceof d))&&(this.remuxer=new d(i,t,r,this.logger)),(!h||!(h instanceof v))&&(this.demuxer=new v(i,t,r,this.logger),this.probe=v.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Ur(this.config)),e}}function Kl(o,e){let t=null;return o.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const vs=o=>({remuxResult:{},chunkMeta:o});function Rn(o){return"then"in o&&o.then instanceof Function}class zl{constructor(e,t,i,r,s){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=i,this.duration=r,this.defaultInitPts=s||null}}class Vl{constructor(e,t,i,r,s,a){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=i,this.trackSwitch=r,this.timeOffset=s,this.initSegmentChange=a}}let Fa=0;class Ma{constructor(e,t,i,r){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Fa++,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=g=>{const d=g.data,v=this.hls;if(!(!v||!(d!=null&&d.event)||d.instanceNo!==this.instanceNo))switch(d.event){case"init":{var S;const M=(S=this.workerContext)==null?void 0:S.objectURL;M&&self.URL.revokeObjectURL(M);break}case"transmuxComplete":{this.handleTransmuxComplete(d.data);break}case"flush":{this.onFlush(d.data);break}case"workerLog":{v.logger[d.data.logType]&&v.logger[d.data.logType](d.data.message);break}default:{d.data=d.data||{},d.data.frag=this.frag,d.data.part=this.part,d.data.id=this.id,v.trigger(d.event,d.data);break}}},this.onWorkerError=g=>{if(!this.hls)return;const d=new Error(`${g.message} (${g.filename}:${g.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(_.ERROR,{type:T.OTHER_ERROR,details:w.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:d})};const s=e.config;this.hls=e,this.id=t,this.useWorker=!!s.enableWorker,this.onTransmuxComplete=i,this.onFlush=r;const a=(g,d)=>{d=d||{},d.frag=this.frag||void 0,g===_.ERROR&&(d=d,d.parent=this.id,d.part=this.part,this.error=d.error),this.hls.trigger(g,d)};this.observer=new as,this.observer.on(_.FRAG_DECRYPTED,a),this.observer.on(_.ERROR,a);const h=Kt(s.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const g=this.hls.logger;if(s.workerPath||Jo()){try{s.workerPath?(g.log(`loading Web Worker ${s.workerPath} for "${t}"`),this.workerContext=tl(s.workerPath)):(g.log(`injecting Web Worker for "${t}"`),this.workerContext=el());const{worker:v}=this.workerContext;v.addEventListener("message",this.onWorkerMessage),v.addEventListener("error",this.onWorkerError),v.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:h,id:t,config:yt(s)})}catch(v){g.warn(`Error setting up "${t}" Web Worker, fallback to inline`,v),this.terminateWorker(),this.error=null,this.transmuxer=new Oa(this.observer,h,s,"",t,e.logger)}return}}this.transmuxer=new Oa(this.observer,h,s,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Fa++;const t=this.hls.config,i=Kt(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:i,id:this.id,config:yt(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),il(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,i,r,s,a,h,g,d,v){var S,M;d.transmuxing.start=self.performance.now();const{instanceNo:j,transmuxer:H}=this,Q=a?a.start:s.start,Z=s.decryptdata,re=this.frag,fe=!(re&&s.cc===re.cc),le=!(re&&d.level===re.level),be=re?d.sn-re.sn:-1,we=this.part?d.part-this.part.index:-1,$e=be===0&&d.id>1&&d.id===(re==null?void 0:re.stats.chunkCount),Ae=!le&&(be===1||be===0&&(we===1||$e&&we<=0)),Pe=self.performance.now();(le||be||s.stats.parsing.start===0)&&(s.stats.parsing.start=Pe),a&&(we||!Ae)&&(a.stats.parsing.start=Pe);const Ue=!(re&&((S=s.initSegment)==null?void 0:S.url)===((M=re.initSegment)==null?void 0:M.url)),De=new Vl(fe,Ae,g,le,Q,Ue);if(!Ae||fe||Ue){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${s.type} sn: ${d.sn}${d.part>-1?" part: "+d.part:""} ${this.id===m.MAIN?"level":"track"}: ${d.level} id: ${d.id}
|
|
|
discontinuity: ${fe}
|
|
|
trackSwitch: ${le}
|
|
|
contiguous: ${Ae}
|
|
|
accurateTimeOffset: ${g}
|
|
|
timeOffset: ${Q}
|
|
|
initSegmentChange: ${Ue}`);const Xe=new zl(i,r,t,h,v);this.configureTransmuxer(Xe)}if(this.frag=s,this.part=a,this.workerContext)this.workerContext.worker.postMessage({instanceNo:j,cmd:"demux",data:e,decryptdata:Z,chunkMeta:d,state:De},e instanceof ArrayBuffer?[e]:[]);else if(H){const Xe=H.push(e,Z,d,De);Rn(Xe)?Xe.then(ut=>{this.handleTransmuxComplete(ut)}).catch(ut=>{this.transmuxerError(ut,d,"transmuxer-interface push error")}):this.handleTransmuxComplete(Xe)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:i}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(i){const r=i.flush(e);Rn(r)?r.then(s=>{this.handleFlushResult(s,e)}).catch(s=>{this.transmuxerError(s,e,"transmuxer-interface flush error")}):this.handleFlushResult(r,e)}}transmuxerError(e,t,i){this.hls&&(this.error=e,this.hls.trigger(_.ERROR,{type:T.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:i}))}handleFlushResult(e,t){e.forEach(i=>{this.handleTransmuxComplete(i)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:i}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):i&&i.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const Ba=100;class ql extends ns{constructor(e,t,i){super(e,t,i,"audio-stream-controller",m.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(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(_.BUFFER_RESET,this.onBufferReset,this),e.on(_.BUFFER_CREATED,this.onBufferCreated,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(_.FRAG_LOADING,this.onFragLoading,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(_.BUFFER_RESET,this.onBufferReset,this),e.off(_.BUFFER_CREATED,this.onBufferCreated,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(_.FRAG_LOADING,this.onFragLoading,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:i,initPTS:r,timescale:s}){if(i===m.MAIN){const a=t.cc,h=this.fragCurrent;if(this.initPTS[a]={baseTime:r,timescale:s},this.log(`InitPTS for cc: ${a} found from main: ${r}/${s}`),this.mainAnchor=t,this.state===Ke.WAITING_INIT_PTS){const g=this.waitingData;(!g&&!this.loadingParts||g&&g.frag.cc!==a)&&this.syncWithAnchor(t,g==null?void 0:g.frag)}else!this.hls.hasEnoughToStart&&h&&h.cc!==a?(h.abortRequests(),this.syncWithAnchor(t,h)):this.state===Ke.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var i;const r=((i=this.mainFragLoading)==null?void 0:i.frag)||null;if(t&&(r==null?void 0:r.cc)===t.cc)return;const s=(r||e).cc,a=this.getLevelDetails(),h=this.getLoadPosition(),g=Ni(a,s,h);g&&(this.log(`Waiting fragment cc (${t==null?void 0:t.cc}) cancelled because video is at cc ${e.cc}`),this.startFragRequested=!1,this.nextLoadPosition=g.start,this.resetLoadingState(),this.state===Ke.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=Ke.STOPPED;return}const i=this.lastCurrentTime;this.stopLoad(),this.setInterval(Ba),i>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),e=i,this.state=Ke.IDLE):this.state=Ke.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case Ke.IDLE:this.doTickIdle();break;case Ke.WAITING_TRACK:{const{levels:t,trackId:i}=this,r=t==null?void 0:t[i],s=r==null?void 0:r.details;if(s&&!this.waitForLive(r)){if(this.waitForCdnTuneIn(s))break;this.state=Ke.WAITING_INIT_PTS}break}case Ke.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),i=this.retryDate;if(!i||t>=i||(e=this.media)!=null&&e.seeking){const{levels:r,trackId:s}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((r==null?void 0:r[s])||null),this.state=Ke.IDLE}break}case Ke.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:i,part:r,cache:s,complete:a}=t,h=this.mainAnchor;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.state=Ke.FRAG_LOADING;const g=s.flush().buffer,d={frag:i,part:r,payload:g,networkDetails:null};this._handleFragmentLoadProgress(d),a&&super._handleFragmentLoadComplete(d)}else h&&h.cc!==t.frag.cc&&this.syncWithAnchor(h,t.frag)}else this.state=Ke.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:i,media:r,trackId:s}=this,a=t.config;if(!this.buffering||!r&&!this.primaryPrefetch&&(this.startFragRequested||!a.startFragPrefetch)||!(i!=null&&i[s]))return;const h=i[s],g=h.details;if(!g||this.waitForLive(h)||this.waitForCdnTuneIn(g)){this.state=Ke.WAITING_TRACK,this.startFragRequested=!1;return}const d=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&d&&(this.bufferFlushed=!1,this.afterBufferFlushed(d,x.AUDIO,m.AUDIO));const v=this.getFwdBufferInfo(d,m.AUDIO);if(v===null)return;if(!this.switchingTrack&&this._streamEnded(v,g)){t.trigger(_.BUFFER_EOS,{type:"audio"}),this.state=Ke.ENDED;return}const S=v.len,M=t.maxBufferLength,j=g.fragments,H=j[0].start,Q=this.getLoadPosition(),Z=this.flushing?Q:v.end;if(this.switchingTrack&&r){const le=Q;g.PTSKnown&&le<H&&(v.end>H||v.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=H+.05)}if(S>=M&&!this.switchingTrack&&Z<j[j.length-1].start)return;let re=this.getNextFragment(Z,g);if(re&&this.isLoopLoading(re,Z)&&(re=this.getNextFragmentLoopLoading(re,g,v,m.MAIN,M)),!re){this.bufferFlushed=!0;return}let fe=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&fe&&te(re)&&!re.endList&&(!g.live||!this.loadingParts&&Z<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(fe)===di.OK&&(this.mainFragLoading=fe=null),fe&&te(fe))){if(re.start>fe.end){const be=this.fragmentTracker.getFragAtPos(Z,m.MAIN);be&&be.end>fe.end&&(fe=be,this.mainFragLoading={frag:be,targetBufferTime:null})}if(re.start>fe.end)return}this.loadFragment(re,h,Z)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(i=>new Mi(i))}onAudioTrackSwitching(e,t){const i=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),i?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==Ke.STOPPED&&(this.setInterval(Ba),this.state=Ke.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 i=this.cachedTrackLoadedData;i&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(_.AUDIO_TRACK_LOADED,i))}onAudioTrackLoaded(e,t){var i;const{levels:r}=this,{details:s,id:a,groupId:h,track:g}=t;if(!r){this.warn(`Audio tracks reset while loading track ${a} "${g.name}" of "${h}"`);return}const d=this.mainDetails;if(!d||s.endCC>d.endCC||d.expired){this.cachedTrackLoadedData=t,this.state!==Ke.STOPPED&&(this.state=Ke.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${a} "${g.name}" of "${h}" loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`);const v=r[a];let S=0;if(s.live||(i=v.details)!=null&&i.live){if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;if(v.details){var M;S=this.alignPlaylists(s,v.details,(M=this.levelLastLoaded)==null?void 0:M.details)}s.alignedSliding||(oa(s,d),s.alignedSliding||Mn(s,d),S=s.fragmentStart)}v.details=s,this.levelLastLoaded=v,this.startFragRequested||this.setStartPosition(d,S),this.hls.trigger(_.AUDIO_TRACK_UPDATED,{details:s,id:a,groupId:t.groupId}),this.state===Ke.WAITING_TRACK&&!this.waitForCdnTuneIn(s)&&(this.state=Ke.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const i=e.frag,{part:r,payload:s}=e,{config:a,trackId:h,levels:g}=this;if(!g){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const d=g[h];if(!d){this.warn("Audio track is undefined on fragment load progress");return}const v=d.details;if(!v){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(i.start);return}const S=a.defaultAudioCodec||d.audioCodec||"mp4a.40.2";let M=this.transmuxer;M||(M=this.transmuxer=new Ma(this.hls,m.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const j=this.initPTS[i.cc],H=(t=i.initSegment)==null?void 0:t.data;if(j!==void 0){const Z=r?r.index:-1,re=Z!==-1,fe=new Cr(i.level,i.sn,i.stats.chunkCount,s.byteLength,Z,re);M.push(s,H,S,"",i,r,v.totalduration,!1,fe,j)}else{this.log(`Unknown video PTS for cc ${i.cc}, waiting for video PTS before demuxing audio frag ${i.sn} of [${v.startSN} ,${v.endSN}],track ${h}`);const{cache:Q}=this.waitingData=this.waitingData||{frag:i,part:r,cache:new ua,complete:!1};Q.push(new Uint8Array(s)),this.state!==Ke.STOPPED&&(this.state=Ke.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 i=t.tracks.audio;i&&(this.mediaBuffer=i.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===m.MAIN&&te(t.frag)&&(this.mainFragLoading=t,this.state===Ke.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:i,part:r}=t;if(i.type!==m.AUDIO){!this.audioOnly&&i.type===m.MAIN&&!i.elementaryStreams.video&&!i.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(te(i)){this.fragPrevious=i;const s=this.switchingTrack;s&&(this.bufferedTrack=s,this.switchingTrack=null,this.hls.trigger(_.AUDIO_TRACK_SWITCHED,u({},s)))}this.fragBufferedComplete(i,r),this.media&&this.tick()}onError(e,t){var i;if(t.fatal){this.state=Ke.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(m.AUDIO,t);break;case w.AUDIO_TRACK_LOAD_ERROR:case w.AUDIO_TRACK_LOAD_TIMEOUT:case w.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Ke.WAITING_TRACK&&((i=t.context)==null?void 0:i.type)===O.AUDIO_TRACK&&(this.state=Ke.IDLE);break;case w.BUFFER_ADD_CODEC_ERROR:case w.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;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!==x.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==x.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===Ke.ENDED&&(this.state=Ke.IDLE);const i=this.mediaBuffer||this.media;i&&(this.afterBufferFlushed(i,t,m.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const i="audio",{hls:r}=this,{remuxResult:s,chunkMeta:a}=e,h=this.getCurrentContext(a);if(!h){this.resetWhenMissingContext(a);return}const{frag:g,part:d,level:v}=h,{details:S}=v,{audio:M,text:j,id3:H,initSegment:Q}=s;if(this.fragContextChanged(g)||!S){this.fragmentTracker.removeFragment(g);return}if(this.state=Ke.PARSING,this.switchingTrack&&M&&this.completeAudioSwitch(this.switchingTrack),Q!=null&&Q.tracks){const Z=g.initSegment||g;this._bufferInitSegment(v,Q.tracks,Z,a),r.trigger(_.FRAG_PARSING_INIT_SEGMENT,{frag:Z,id:i,tracks:Q.tracks})}if(M){const{startPTS:Z,endPTS:re,startDTS:fe,endDTS:le}=M;d&&(d.elementaryStreams[x.AUDIO]={startPTS:Z,endPTS:re,startDTS:fe,endDTS:le}),g.setElementaryStreamInfo(x.AUDIO,Z,re,fe,le),this.bufferFragmentData(M,g,d,a)}if(H!=null&&(t=H.samples)!=null&&t.length){const Z=c({id:i,frag:g,details:S},H);r.trigger(_.FRAG_PARSING_METADATA,Z)}if(j){const Z=c({id:i,frag:g,details:S},j);r.trigger(_.FRAG_PARSING_USERDATA,Z)}}_bufferInitSegment(e,t,i,r){if(this.state!==Ke.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const s=t.audio;s.id=m.AUDIO;const a=e.audioCodec;this.log(`Init audio buffer, container:${s.container}, codecs[level/parsed]=[${a}/${s.codec}]`),a&&a.split(",").length===1&&(s.levelCodec=a),this.hls.trigger(_.BUFFER_CODECS,t);const h=s.initSegment;if(h!=null&&h.byteLength){const g={type:"audio",frag:i,part:null,chunkMeta:r,parent:i.type,data:h};this.hls.trigger(_.BUFFER_APPENDING,g)}this.tickImmediate()}loadFragment(e,t,i){const r=this.fragmentTracker.getState(e);if(this.switchingTrack||r===di.NOT_LOADED||r===di.PARTIAL){var s;if(!te(e))this._loadInitSegment(e,t);else if((s=t.details)!=null&&s.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=Ke.WAITING_INIT_PTS;const a=this.mainDetails;a&&a.fragmentStart!==t.details.fragmentStart&&Mn(t.details,a)}else super.loadFragment(e,t,i)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:i,assocLang:r,characteristics:s,audioCodec:a,channels:h}=this.bufferedTrack;qt({name:t,lang:i,assocLang:r,characteristics:s,audioCodec:a,channels:h},e,si)||(Gt(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(_.AUDIO_TRACK_SWITCHED,u({},e))}}class ys extends D{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,i){const r=t==null?void 0:t.renditionReports;if(r){let s=-1;for(let a=0;a<r.length;a++){const h=r[a];let g;try{g=new self.URL(h.URI,t.url).href}catch(d){this.warn(`Could not construct new URL for Rendition Report: ${d}`),g=h.URI||""}if(g===e){s=a;break}else g===e.substring(0,g.length)&&(s=a)}if(s!==-1){const a=r[s],h=parseInt(a["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let g=parseInt(a["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const v=Math.min(t.age-t.partTarget,t.targetduration);g>=0&&v>t.partTarget&&(g+=1)}const d=i&&qi(i);return new Ii(h,g>=0?g:void 0,d)}}}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(i){this.warn(`Could not construct new URL with HLS Delivery Directives: ${i}`)}return e}playlistLoaded(e,t,i){const{details:r,stats:s}=t,a=self.performance.now(),h=s.loading.first?Math.max(0,a-s.loading.first):0;r.advancedDateTime=Date.now()-h;const g=this.hls.config.timelineOffset;if(g!==r.appliedTimelineOffset){const v=Math.max(g||0,0);r.appliedTimelineOffset=v,r.fragments.forEach(S=>{S.start=S.playlistOffset+v})}if(r.live||i!=null&&i.live){const v="levelInfo"in t?t.levelInfo:t.track;if(r.reloaded(i),i&&r.fragments.length>0){Wo(i,r);const fe=r.playlistParsingError;if(fe){this.warn(fe);const le=this.hls;if(!le.config.ignorePlaylistParsingErrors){var d;const{networkDetails:be}=t;le.trigger(_.ERROR,{type:T.NETWORK_ERROR,details:w.LEVEL_PARSING_ERROR,fatal:!1,url:r.url,error:fe,reason:fe.message,level:t.level||void 0,parent:(d=r.fragments[0])==null?void 0:d.type,networkDetails:be,stats:s});return}r.playlistParsingError=null}}r.requestScheduled===-1&&(r.requestScheduled=s.loading.start);const S=this.hls.mainForwardBufferInfo,M=S?S.end-S.len:0,j=(r.edge-M)*1e3,H=ea(r,j);if(r.requestScheduled+H<a?r.requestScheduled=a:r.requestScheduled+=H,this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),!this.canLoad||!r.live)return;let Q,Z,re;if(r.canBlockReload&&r.endSN&&r.advanced){const fe=this.hls.config.lowLatencyMode,le=r.lastPartSn,be=r.endSN,we=r.lastPartIndex,$e=we!==-1,Ae=le===be;$e?Ae?(Z=be+1,re=fe?0:we):(Z=le,re=fe?we+1:r.maxPartIndex):Z=be+1;const Pe=r.age,Ue=Pe+r.ageHeader;let De=Math.min(Ue-r.partTarget,r.targetduration*1.5);if(De>0){if(Ue>r.targetduration*3)this.log(`Playlist last advanced ${Pe.toFixed(2)}s ago. Omitting segment and part directives.`),Z=void 0,re=void 0;else if(i!=null&&i.tuneInGoal&&Ue-r.partTarget>i.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${i.tuneInGoal} to: ${De} with playlist age: ${r.age}`),De=0;else{const Xe=Math.floor(De/r.targetduration);if(Z+=Xe,re!==void 0){const ut=Math.round(De%r.targetduration/r.partTarget);re+=ut}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${Pe.toFixed(2)}s goal: ${De} skip sn ${Xe} to part ${re}`)}r.tuneInGoal=De}if(Q=this.getDeliveryDirectives(r,t.deliveryDirectives,Z,re),fe||!Ae){r.requestScheduled=a,this.loadingPlaylist(v,Q);return}}else(r.canBlockReload||r.canSkipUntil)&&(Q=this.getDeliveryDirectives(r,t.deliveryDirectives,Z,re));Q&&Z!==void 0&&r.canBlockReload&&(r.requestScheduled=s.loading.first+Math.max(H-h*2,H/2)),this.scheduleLoading(v,Q,r)}else this.clearTimer()}scheduleLoading(e,t,i){const r=i||e.details;if(!r){this.loadingPlaylist(e,t);return}const s=self.performance.now(),a=r.requestScheduled;if(s>=a){this.loadingPlaylist(e,t);return}const h=a-s;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(h)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),h)}getDeliveryDirectives(e,t,i,r){let s=qi(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(i=t.msn,r=t.part,s=mi.No),new Ii(i,r,s)}checkRetry(e){const t=e.details,i=ei(e),r=e.errorAction,{action:s,retryCount:a=0,retryConfig:h}=r||{},g=!!r&&!!h&&(s===yi.RetryRequest||!r.resolved&&s===yi.SendAlternateToPenaltyBox);if(g){var d;if(a>=h.maxNumRetry)return!1;if(i&&(d=e.context)!=null&&d.deliveryDirectives)this.warn(`Retrying playlist loading ${a+1}/${h.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const v=Ui(h,a);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),v),this.warn(`Retrying playlist loading ${a+1}/${h.maxNumRetry} after "${t}" in ${v}ms`)}e.levelRetry=!0,r.resolved=!0}return g}}function Na(o,e){if(o.length!==e.length)return!1;for(let t=0;t<o.length;t++)if(!kn(o[t].attrs,e[t].attrs))return!1;return!0}function kn(o,e,t){const i=o["STABLE-RENDITION-ID"];return i&&!t?i===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(r=>o[r]!==e[r])}function bs(o,e){return e.label.toLowerCase()===o.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(o.lang||"").toLowerCase())}class Yl extends ys{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(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVEL_LOADING,this.onLevelLoading,this),e.off(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(_.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:i,groupId:r,details:s}=t,a=this.tracksInGroup[i];if(!a||a.groupId!==r){this.warn(`Audio track with id:${i} and group:${r} not found in active group ${a==null?void 0:a.groupId}`);return}const h=a.details;a.details=t.details,this.log(`Audio track ${i} "${a.name}" lang:${a.lang} group:${r} loaded [${s.startSN}-${s.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,h)}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 i=t.audioGroups||null,r=this.groupIds;let s=this.currentTrack;if(!i||(r==null?void 0:r.length)!==(i==null?void 0:i.length)||i!=null&&i.some(h=>(r==null?void 0:r.indexOf(h))===-1)){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const h=this.tracks.filter(M=>!i||i.indexOf(M.groupId)!==-1);if(h.length)this.selectDefaultTrack&&!h.some(M=>M.default)&&(this.selectDefaultTrack=!1),h.forEach((M,j)=>{M.id=j});else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=h;const g=this.hls.config.audioPreference;if(!s&&g){const M=Qt(g,h,si);if(M>-1)s=h[M];else{const j=Qt(g,this.tracks);s=this.tracks[j]}}let d=this.findTrackId(s);d===-1&&s&&(d=this.findTrackId(null));const v={audioTracks:h};this.log(`Updating audio tracks, ${h.length} track(s) found in group(s): ${i==null?void 0:i.join(",")}`),this.hls.trigger(_.AUDIO_TRACKS_UPDATED,v);const S=this.trackId;if(d!==-1&&S===-1)this.setAudioTrack(d);else if(h.length&&S===-1){var a;const M=new Error(`No audio track selected for current audio group-ID(s): ${(a=this.groupIds)==null?void 0:a.join(",")} track count: ${h.length}`);this.warn(M.message),this.hls.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:M})}}}onError(e,t){t.fatal||!t.context||t.context.type===O.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 i=this.allAudioTracks;if(this.selectDefaultTrack=!1,i.length){const r=this.currentTrack;if(r&&qt(e,r,si))return r;const s=Qt(e,this.tracksInGroup,si);if(s>-1){const a=this.tracksInGroup[s];return this.setAudioTrack(s),a}else if(r){let a=t.loadLevel;a===-1&&(a=t.firstAutoLevel);const h=Ki(e,t.levels,i,a,si);if(h===-1)return null;t.nextLoadLevel=h}if(e.channels||e.audioCodec){const a=Qt(e,i);if(a>-1)return i[a]}}}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 i=this.currentTrack,r=t[e],s=r.details&&!r.details.live;if(e===this.trackId&&r===i&&s||(this.log(`Switching to audio-track ${e} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=e,this.currentTrack=r,this.hls.trigger(_.AUDIO_TRACK_SWITCHING,u({},r)),s))return;const a=this.switchParams(r.url,i==null?void 0:i.details,r.details);this.loadPlaylist(a)}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const r=t[i];if(!(this.selectDefaultTrack&&!r.default)&&(!e||qt(e,r,si)))return i}if(e){const{name:i,lang:r,assocLang:s,characteristics:a,audioCodec:h,channels:g}=e;for(let d=0;d<t.length;d++){const v=t[d];if(qt({name:i,lang:r,assocLang:s,characteristics:a,audioCodec:h,channels:g},v,si))return d}for(let d=0;d<t.length;d++){const v=t[d];if(kn(e.attrs,v.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return d}for(let d=0;d<t.length;d++){const v=t[d];if(kn(e.attrs,v.attrs,["LANGUAGE"]))return d}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Gt(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const i=e.id,r=e.groupId,s=this.getUrlWithDirectives(e.url,t),a=e.details,h=a==null?void 0:a.age;this.log(`Loading audio-track ${i} "${e.name}" lang:${e.lang} group:${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${h&&a.live?" age "+h.toFixed(1)+(a.type?" "+a.type||0:""):""} ${s}`),this.hls.trigger(_.AUDIO_TRACK_LOADING,{url:s,id:i,groupId:r,deliveryDirectives:t||null,track:e})}}class Zl{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,i){if(this.queues===null||this.tracks===null)return;const r=this.queues[t];r.push(e),r.length===1&&!i&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const i={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(i,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const i={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(i)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const i=(t=e[0])==null?void 0:t.label;(i==="async-blocker"||i==="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 r=t[0];try{r.execute()}catch(s){var i;if(r.onError(s),this.queues===null||this.tracks===null)return;const a=(i=this.tracks[e])==null?void 0:i.buffer;a!=null&&a.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,i;return(t=this.queues)!=null&&t[e]||(i=this.tracks)!=null&&i[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const i=(t=this.tracks)==null?void 0:t[e],r=i==null?void 0:i.buffer;return r?`SourceBuffer${r.updating?" updating":""}${i.ended?" ended":""}${i.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(i=>i.label).join(", "))||""}}const Ua=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,$a="HlsJsTrackRemovedError";class Xl extends Error{constructor(e){super(e),this.name=$a}}class Ql extends D{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=i=>{var r;this.hls&&((r=this.mediaSource)==null?void 0:r.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=i=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=i=>{const{media:r,mediaSource:s}=this;i&&this.log("Media source opened"),!(!r||!s)&&(s.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(_.MEDIA_ATTACHED,{media:r,mediaSource:s}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:i,_objectUrl:r}=this;i!==r&&this.error(`Media element src was set while attaching MediaSource (${r} > ${i})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=V(q(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(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.BUFFER_RESET,this.onBufferReset,this),e.on(_.BUFFER_APPENDING,this.onBufferAppending,this),e.on(_.BUFFER_CODECS,this.onBufferCodecs,this),e.on(_.BUFFER_EOS,this.onBufferEos,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.FRAG_PARSED,this.onFragParsed,this),e.on(_.FRAG_CHANGED,this.onFragChanged,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.BUFFER_RESET,this.onBufferReset,this),e.off(_.BUFFER_APPENDING,this.onBufferAppending,this),e.off(_.BUFFER_CODECS,this.onBufferCodecs,this),e.off(_.BUFFER_EOS,this.onBufferEos,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.FRAG_PARSED,this.onFragParsed,this),e.off(_.FRAG_CHANGED,this.onFragChanged,this),e.off(_.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const i={};if(this.operationQueue){const s=this.isUpdating();s||this.operationQueue.removeBlockers();const a=this.isQueued();(s||a)&&this.warn(`Transfering MediaSource with${a?" operations in queue":""}${s?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const r=this.transferData;return!this.sourceBufferCount&&r&&r.mediaSource===t?c(i,r.tracks):this.sourceBuffers.forEach(s=>{const[a]=s;a&&(i[a]=c({},this.tracks[a]),this.removeBuffer(a)),s[0]=s[1]=null}),{media:e,mediaSource:t,tracks:i}}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 i;let r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsTotal=r,this.log(`${r} bufferCodec event(s) expected.`),(i=this.transferData)!=null&&i.mediaSource&&this.sourceBufferCount&&r&&this.bufferCreated()}onMediaAttaching(e,t){const i=this.media=t.media,r=q(this.appendSource);if(this.transferData=this.overrides=void 0,i&&r){const s=!!t.mediaSource;(s||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const a=this.mediaSource=t.mediaSource||new r;if(this.assignMediaSource(a),s)this._objectUrl=i.src,this.attachTransferred();else{const h=this._objectUrl=self.URL.createObjectURL(a);if(this.appendSource)try{i.removeAttribute("src");const g=self.ManagedMediaSource;i.disableRemotePlayback=i.disableRemotePlayback||g&&a instanceof g,Ha(i),Jl(i,h),i.load()}catch(g){i.src=h}else i.src=h}i.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,i;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(i=e.constructor)==null?void 0:i.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 i=this.tracks,r=t.tracks,s=r?Object.keys(r):null,a=s?s.length:0,h=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(r&&s&&a){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: ${yt(i,(g,d)=>g==="initSegment"?void 0:d)};
|
|
|
transfer tracks: ${yt(r,(g,d)=>g==="initSegment"?void 0:d)}}`),!ne(r,i)){t.mediaSource=null,t.tracks=void 0;const g=e.currentTime,d=this.details,v=Math.max(g,(d==null?void 0:d.fragments[0].start)||0);if(v-g>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${g} -> ${v}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(r)}"->"${Object.keys(i)}") start time: ${v} currentTime: ${g}`),this.onMediaDetaching(_.MEDIA_DETACHING,{}),this.onMediaAttaching(_.MEDIA_ATTACHING,t),e.currentTime=v;return}this.transferData=void 0,s.forEach(g=>{const d=g,v=r[d];if(v){const S=v.buffer;if(S){const M=this.fragmentTracker,j=v.id;if(M.hasFragments(j)||M.hasParts(j)){const Z=Rt.getBuffered(S);M.detectEvictedFragments(d,Z,j,null,!0)}const H=Es(d),Q=[d,S];this.sourceBuffers[H]=Q,S.updating&&this.operationQueue&&this.operationQueue.prependBlocker(d),this.trackSourceBuffer(d,v)}}}),h(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),h()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const i=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:r,mediaSource:s,_objectUrl:a}=this;if(s){if(this.log(`media source ${i?"transferring":"detaching"}`),i)this.sourceBuffers.forEach(([h])=>{h&&this.removeBuffer(h)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const h=s.readyState==="open";try{const g=s.sourceBuffers;for(let d=g.length;d--;)h&&g[d].abort(),s.removeSourceBuffer(g[d]);h&&s.endOfStream()}catch(g){this.warn(`onMediaDetaching: ${g.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(s.removeEventListener("startstreaming",this._onStartStreaming),s.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}r&&(r.removeEventListener("emptied",this._onMediaEmptied),i||(a&&self.URL.revokeObjectURL(a),this.mediaSrc===a?(r.removeAttribute("src"),this.appendSource&&Ha(r),r.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(_.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const i=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),i)try{var r;(r=this.mediaSource)!=null&&r.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(i)}catch(s){this.warn(`onBufferReset ${e}`,s)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[Es(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Zl(this.tracks)}onBufferCodecs(e,t){const i=this.tracks,r=Object.keys(t);this.log(`BUFFER_CODECS: "${r}" (current SB count ${this.sourceBufferCount})`);const s="audiovideo"in t&&(i.audio||i.video)||i.audiovideo&&("audio"in t||"video"in t),a=!s&&this.sourceBufferCount&&this.media&&r.some(h=>!i[h]);if(s||a){this.warn(`Unsupported transition between "${Object.keys(i)}" and "${r}" SourceBuffers`);return}r.forEach(h=>{var g,d,v;const S=t[h],{id:M,codec:j,levelCodec:H,container:Q,metadata:Z,supplemental:re}=S;let fe=i[h];const le=(g=this.transferData)==null||(d=g.tracks)==null?void 0:d[h],be=le!=null&&le.buffer?le:fe,we=(be==null?void 0:be.pendingCodec)||(be==null?void 0:be.codec),$e=be==null?void 0:be.levelCodec;fe||(fe=i[h]={buffer:void 0,listeners:[],codec:j,supplemental:re,container:Q,levelCodec:H,metadata:Z,id:M});const Ae=at(we,$e),Pe=Ae==null?void 0:Ae.replace(Ua,"$1");let Ue=at(j,H);const De=(v=Ue)==null?void 0:v.replace(Ua,"$1");Ue&&Ae&&Pe!==De&&(h.slice(0,5)==="audio"&&(Ue=Ve(Ue,this.appendSource)),this.log(`switching codec ${we} to ${Ue}`),Ue!==(fe.pendingCodec||fe.codec)&&(fe.pendingCodec=Ue),fe.container=Q,this.appendChangeType(h,Q,Ue))}),(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 i=this.tracks[t];return e[t]={id:i.id,container:i.container,codec:i.codec,levelCodec:i.levelCodec},e},{})}appendChangeType(e,t,i){const r=`${t};codecs=${i}`,s={label:`change-type=${r}`,execute:()=>{const a=this.tracks[e];if(a){const h=a.buffer;h!=null&&h.changeType&&(this.log(`changing ${e} sourceBuffer type to ${r}`),h.changeType(r),a.codec=i,a.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:a=>{this.warn(`Failed to change ${e} SourceBuffer type`,a)}};this.append(s,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const i=e.start,r=i+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(i,m.MAIN))==null?void 0:t.gap)===!0)return;const a={label:"block-audio",execute:()=>{var h;const g=this.tracks.video;(this.lastVideoAppendEnd>r||g!=null&&g.buffer&&Rt.isBuffered(g.buffer,r)||((h=this.fragmentTracker.getAppendedFrag(r,m.MAIN))==null?void 0:h.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:h=>{this.warn("Error executing block-audio operation",h)}};this.blockedAudioAppend={op:a,frag:e},this.append(a,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:i}=this,{data:r,type:s,parent:a,frag:h,part:g,chunkMeta:d}=t,v=d.buffering[s],S=h.sn,M=self.performance.now();v.start=M;const j=h.stats.buffering,H=g?g.stats.buffering:null;j.start===0&&(j.start=M),H&&H.start===0&&(H.start=M);const Q=i.audio;let Z=!1;s==="audio"&&(Q==null?void 0:Q.container)==="audio/mpeg"&&(Z=!this.lastMpegAudioChunk||d.id===1||this.lastMpegAudioChunk.sn!==d.sn,this.lastMpegAudioChunk=d);const re=this.tracks.video,fe=re==null?void 0:re.buffer;if(fe&&S!=="initSegment"){const we=g||h,$e=this.blockedAudioAppend;if(s==="audio"&&a!=="main"&&!this.blockedAudioAppend){const Pe=we.start+we.duration*.05,Ue=fe.buffered,De=this.currentOp("video");!Ue.length&&!De?this.blockAudio(we):!De&&!Rt.isBuffered(fe,Pe)&&this.lastVideoAppendEnd<Pe&&this.blockAudio(we)}else if(s==="video"){const Ae=we.end;if($e){const Pe=$e.frag.start;(Ae>Pe||Ae<this.lastVideoAppendEnd||Rt.isBuffered(fe,Pe))&&this.unblockAudio()}this.lastVideoAppendEnd=Ae}}const le=(g||h).start,be={label:`append-${s}`,execute:()=>{if(v.executeStart=self.performance.now(),Z){const we=this.tracks[s];if(we){const $e=we.buffer;if($e){const Ae=le-$e.timestampOffset;Math.abs(Ae)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${le} (delta: ${Ae}) sn: ${S})`),$e.timestampOffset=le)}}}this.appendExecutor(r,s)},onStart:()=>{},onComplete:()=>{const we=self.performance.now();v.executeEnd=v.end=we,j.first===0&&(j.first=we),H&&H.first===0&&(H.first=we);const $e={};this.sourceBuffers.forEach(([Ae,Pe])=>{Ae&&($e[Ae]=Rt.getBuffered(Pe))}),this.appendErrors[s]=0,s==="audio"||s==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(_.BUFFER_APPENDED,{type:s,frag:h,part:g,chunkMeta:d,parent:h.type,timeRanges:$e})},onError:we=>{var $e;const Ae={type:T.MEDIA_ERROR,parent:h.type,details:w.BUFFER_APPEND_ERROR,sourceBufferName:s,frag:h,part:g,chunkMeta:d,error:we,err:we,fatal:!1},Pe=($e=this.media)==null?void 0:$e.error;if(we.code===DOMException.QUOTA_EXCEEDED_ERR)Ae.details=w.BUFFER_FULL_ERROR;else if(we.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!Pe)Ae.errorAction=Sr(!0);else if(we.name===$a&&this.sourceBufferCount===0)Ae.errorAction=Sr(!0);else{const Ue=++this.appendErrors[s];this.warn(`Failed ${Ue}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${s}" sourceBuffer (${Pe||"no media error"})`),(Ue>=this.hls.config.appendErrorMaxRetry||Pe)&&(Ae.fatal=!0)}this.hls.trigger(_.ERROR,Ae)}};this.append(be,s,this.isPending(this.tracks[s]))}getFlushOp(e,t,i){return this.log(`queuing "${e}" remove ${t}-${i}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,i)},onStart:()=>{},onComplete:()=>{this.hls.trigger(_.BUFFER_FLUSHED,{type:e})},onError:r=>{this.warn(`Failed to remove ${t}-${i} from "${e}" SourceBuffer`,r)}}}onBufferFlushing(e,t){const{type:i,startOffset:r,endOffset:s}=t;i?this.append(this.getFlushOp(i,r,s),i):this.sourceBuffers.forEach(([a])=>{a&&this.append(this.getFlushOp(a,r,s),a)})}onFragParsed(e,t){const{frag:i,part:r}=t,s=[],a=r?r.elementaryStreams:i.elementaryStreams;a[x.AUDIOVIDEO]?s.push("audiovideo"):(a[x.AUDIO]&&s.push("audio"),a[x.VIDEO]&&s.push("video"));const h=()=>{const g=self.performance.now();i.stats.buffering.end=g,r&&(r.stats.buffering.end=g);const d=r?r.stats:i.stats;this.hls.trigger(_.FRAG_BUFFERED,{frag:i,part:r,stats:d,id:i.type})};s.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${i.type} level: ${i.level} sn: ${i.sn}`),this.blockBuffers(h,s).catch(g=>{this.warn(`Fragment buffered callback ${g}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t,i;return e&&(!((t=this.tracks[e])!=null&&t.ended)||((i=this.tracks[e])==null?void 0:i.ending))})}onBufferEos(e,t){var i;this.sourceBuffers.forEach(([a])=>{if(a){const h=this.tracks[a];(!t.type||t.type===a)&&(h.ending=!0,h.ended||(h.ended=!0,this.log(`${a} buffer reached EOS`)))}});const r=((i=this.overrides)==null?void 0:i.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([a])=>{var h;return a&&!((h=this.tracks[a])!=null&&h.ended)})&&(r?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:a}=this;if(!a||a.readyState!=="open"){a&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${a.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),a.endOfStream(),this.hls.trigger(_.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(_.BUFFERED_TO_END,void 0)))}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){const e=this.getDurationAndRange();e&&this.blockUntilOpen(()=>this.updateMediaSource(e))}onError(e,t){if(t.details===w.BUFFER_APPEND_ERROR&&t.frag){var i;const r=(i=t.errorAction)==null?void 0:i.nextAutoLevel;k(r)&&r!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:i}=this;if(!i||t===null||!this.sourceBufferCount)return;const r=e.config,s=i.currentTime,a=t.levelTargetDuration,h=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(k(h)&&h>=0){const g=Math.max(h,a),d=Math.floor(s/a)*a-g;this.flushBackBuffer(s,a,d)}if(k(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const g=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),d=Math.max(g,a),v=Math.floor(s/a)*a+d;this.flushFrontBuffer(s,a,v)}}flushBackBuffer(e,t,i){this.sourceBuffers.forEach(([r,s])=>{if(s){const h=Rt.getBuffered(s);if(h.length>0&&i>h.start(0)){var a;this.hls.trigger(_.BACK_BUFFER_REACHED,{bufferEnd:i});const g=this.tracks[r];if((a=this.details)!=null&&a.live)this.hls.trigger(_.LIVE_BACK_BUFFER_REACHED,{bufferEnd:i});else if(g!=null&&g.ended){this.log(`Cannot flush ${r} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(_.BUFFER_FLUSHING,{startOffset:0,endOffset:i,type:r})}}})}flushFrontBuffer(e,t,i){this.sourceBuffers.forEach(([r,s])=>{if(s){const a=Rt.getBuffered(s),h=a.length;if(h<2)return;const g=a.start(h-1),d=a.end(h-1);if(i>g||e>=g&&e<=d)return;this.hls.trigger(_.BUFFER_FLUSHING,{startOffset:g,endOffset:1/0,type:r})}})}getDurationAndRange(){var e;const{details:t,mediaSource:i}=this;if(!t||!this.media||(i==null?void 0:i.readyState)!=="open")return null;const r=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&i.setLiveSeekableRange){const d=Math.max(0,t.fragmentStart),v=Math.max(d,r);return{duration:1/0,start:d,end:v}}return{duration:1/0}}const s=(e=this.overrides)==null?void 0:e.duration;if(s)return k(s)?{duration:s}:null;const a=this.media.duration,h=k(i.duration)?i.duration:0;return r>h&&r>a||!k(a)?{duration:r}:null}updateMediaSource({duration:e,start:t,end:i}){const r=this.mediaSource;!this.media||!r||r.readyState!=="open"||(r.duration!==e&&(k(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),r.duration=e),t!==void 0&&i!==void 0&&(this.log(`MediaSource duration is set to ${r.duration}. Setting seekable range to ${t}-${i}.`),r.setLiveSeekableRange(t,i)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:i}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${yt(i)}`),this.tracksReady){var r;const s=(r=this.transferData)==null?void 0:r.tracks;s&&Object.keys(s).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,i])=>{if(t){const r=this.tracks[t];e[t]={buffer:i,container:r.container,codec:r.codec,supplemental:r.supplemental,levelCodec:r.levelCodec,id:r.id,metadata:r.metadata}}}),this.hls.trigger(_.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(_.ERROR,{type:T.MEDIA_ERROR,details:w.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:i}=this;if(!i)throw new Error("createSourceBuffers called when mediaSource was null");for(const s in e){const a=s,h=e[a];if(this.isPending(h)){const g=this.getTrackCodec(h,a),d=`${h.container};codecs=${g}`;h.codec=g,this.log(`creating sourceBuffer(${d})${this.currentOp(a)?" Queued":""} ${yt(h)}`);try{const v=i.addSourceBuffer(d),S=Es(a),M=[a,v];t[S]=M,h.buffer=v}catch(v){var r;this.error(`error while trying to add sourceBuffer: ${v.message}`),this.shiftAndExecuteNext(a),(r=this.operationQueue)==null||r.removeBlockers(),delete this.tracks[a],this.hls.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:v,sourceBufferName:a,mimeType:d,parent:h.id});return}this.trackSourceBuffer(a,h)}}this.bufferCreated()}getTrackCodec(e,t){const i=e.supplemental;let r=e.codec;i&&(t==="video"||t==="audiovideo")&&xe(i,"video")&&(r=Ye(r,i));const s=at(r,e.levelCodec);return s?t.slice(0,5)==="audio"?Ve(s,this.appendSource):s:""}trackSourceBuffer(e,t){const i=t.buffer;if(!i)return;const r=this.getTrackCodec(t,e);this.tracks[e]={buffer:i,codec:r,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",(s,a)=>{const h=a.removedRanges;h!=null&&h.length&&this.hls.trigger(_.BUFFER_FLUSHED,{type:s})})}get mediaSrc(){var e,t;const i=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return i==null?void 0:i.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 i=this.currentOp(e);i&&(i.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var i;const r=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(i=this.mediaSource)==null?void 0:i.readyState}`);this.error(`${r}`,t),this.hls.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:r,fatal:!1});const s=this.currentOp(e);s&&s.onError(r)}removeExecutor(e,t,i){const{media:r,mediaSource:s}=this,a=this.tracks[e],h=a==null?void 0:a.buffer;if(!r||!s||!h){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const g=k(r.duration)?r.duration:1/0,d=k(s.duration)?s.duration:1/0,v=Math.max(0,t),S=Math.min(i,g,d);S>v&&(!a.ending||a.ended)?(a.ended=!1,this.log(`Removing [${v},${S}] from the ${e} SourceBuffer`),h.remove(v,S)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const i=this.tracks[t],r=i==null?void 0:i.buffer;if(!r)throw new Xl(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);i.ending=!1,i.ended=!1,r.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:i}=this,r=t.map(a=>this.appendBlocker(a));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(r).then(a=>{i===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var i;const r=(i=this.tracks[t])==null?void 0:i.buffer;!r||r.updating||this.shiftAndExecuteNext(t)})}append(e,t,i){this.operationQueue&&this.operationQueue.append(e,t,i)}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,i){const r=this.tracks[e];if(!r)return;const s=r.buffer;if(!s)return;const a=i.bind(this,e);r.listeners.push({event:t,listener:a}),s.addEventListener(t,a)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const i=t.buffer;i&&(t.listeners.forEach(r=>{i.removeEventListener(r.event,r.listener)}),t.listeners.length=0)}}function Ha(o){const e=o.querySelectorAll("source");[].slice.call(e).forEach(t=>{o.removeChild(t)})}function Jl(o,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,o.appendChild(t)}function Es(o){return o==="audio"?1:0}class Ss{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(_.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.BUFFER_CODECS,this.onBufferCodecs,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(_.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.BUFFER_CODECS,this.onBufferCodecs,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const i=this.hls.levels[t.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.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 i=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,i.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&k(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,i=this.getMaxLevel(e.length-1);i!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${i}: ${e[i].height}p@${e[i].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=i,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 i=t.filter((r,s)=>this.isLevelAllowed(r)&&s<=e);return this.clientRect=null,Ss.getMaxLevelByMediaSize(i,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 i=e.getBoundingClientRect();t.width=i.width,t.height=i.height,!t.width&&!t.height&&(t.width=i.right-i.left||e.width||0,t.height=i.bottom-i.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(i=>e.bitrate===i.bitrate&&e.width===i.width&&e.height===i.height)}static getMaxLevelByMediaSize(e,t,i){if(!(e!=null&&e.length))return-1;const r=(h,g)=>g?h.width!==g.width||h.height!==g.height:!0;let s=e.length-1;const a=Math.max(t,i);for(let h=0;h<e.length;h+=1){const g=e[h];if((g.width>=a||g.height>=a)&&r(g,e[h+1])){s=h;break}}return s}}const Wi={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},eu={HLS:"h"},In={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},tu={[In.OBJECT]:["br","d","ot","tb"],[In.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[In.SESSION]:["cid","pr","sf","sid","st","v"],[In.STATUS]:["bs","rtp"]};class hn{constructor(e,t){Array.isArray(e)&&(e=e.map(i=>i instanceof hn?i:new hn(i))),this.value=e,this.params=t}}const iu="Dict";function ru(o){return Array.isArray(o)?JSON.stringify(o):o instanceof Map?"Map{}":o instanceof Set?"Set{}":typeof o=="object"?JSON.stringify(o):String(o)}function nu(o,e,t,i){return new Error(`failed to ${o} "${ru(e)}" as ${t}`,{cause:i})}function yr(o,e,t){return nu("serialize",o,e,t)}class ja{constructor(e){this.description=e}}const Wa="Bare Item",su="Boolean";function au(o){if(typeof o!="boolean")throw yr(o,su);return o?"?1":"?0"}function ou(o){return btoa(String.fromCharCode(...o))}const lu="Byte Sequence";function uu(o){if(ArrayBuffer.isView(o)===!1)throw yr(o,lu);return`:${ou(o)}:`}const cu="Integer";function hu(o){return o<-999999999999999||999999999999999<o}function Ga(o){if(hu(o))throw yr(o,cu);return o.toString()}function fu(o){return`@${Ga(o.getTime()/1e3)}`}function Ka(o,e){if(o<0)return-Ka(-o,e);const t=Math.pow(10,e);if(Math.abs(o*t%1-.5)<Number.EPSILON){const r=Math.floor(o*t);return(r%2===0?r:r+1)/t}else return Math.round(o*t)/t}const du="Decimal";function pu(o){const e=Ka(o,3);if(Math.floor(Math.abs(e)).toString().length>12)throw yr(o,du);const t=e.toString();return t.includes(".")?t:`${t}.0`}const _u="String",gu=/[\x00-\x1f\x7f]+/;function mu(o){if(gu.test(o))throw yr(o,_u);return`"${o.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function vu(o){return o.description||o.toString().slice(7,-1)}const yu="Token";function za(o){const e=vu(o);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw yr(e,yu);return e}function xs(o){switch(typeof o){case"number":if(!k(o))throw yr(o,Wa);return Number.isInteger(o)?Ga(o):pu(o);case"string":return mu(o);case"symbol":return za(o);case"boolean":return au(o);case"object":if(o instanceof Date)return fu(o);if(o instanceof Uint8Array)return uu(o);if(o instanceof ja)return za(o);default:throw yr(o,Wa)}}const bu="Key";function ws(o){if(/^[a-z*][a-z0-9\-_.*]*$/.test(o)===!1)throw yr(o,bu);return o}function Cs(o){return o==null?"":Object.entries(o).map(([e,t])=>t===!0?`;${ws(e)}`:`;${ws(e)}=${xs(t)}`).join("")}function Va(o){return o instanceof hn?`${xs(o.value)}${Cs(o.params)}`:xs(o)}function Eu(o){return`(${o.value.map(Va).join(" ")})${Cs(o.params)}`}function Su(o,e={whitespace:!0}){if(typeof o!="object")throw yr(o,iu);const t=o instanceof Map?o.entries():Object.entries(o),i=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([r,s])=>{s instanceof hn||(s=new hn(s));let a=ws(r);return s.value===!0?a+=Cs(s.params):(a+="=",Array.isArray(s.value)?a+=Eu(s):a+=Va(s)),a}).join(`,${i}`)}function xu(o,e){return Su(o,e)}function wu(o){return o==="ot"||o==="sf"||o==="st"}function Cu(o){return typeof o=="number"?k(o):o!=null&&o!==""&&o!==!1}function Au(o,e){const t=new URL(o),i=new URL(e);if(t.origin!==i.origin)return o;const r=t.pathname.split("/").slice(1),s=i.pathname.split("/").slice(1,-1);for(;r[0]===s[0];)r.shift(),s.shift();for(;s.length;)s.shift(),r.unshift("..");return r.join("/")}const Gn=o=>Math.round(o),Tu=(o,e)=>(e!=null&&e.baseUrl&&(o=Au(o,e.baseUrl)),encodeURIComponent(o)),Kn=o=>Gn(o/100)*100,Du={br:Gn,d:Gn,bl:Kn,dl:Kn,mtp:Kn,nor:Tu,rtp:Kn,tb:Gn};function Lu(o,e){const t={};if(o==null||typeof o!="object")return t;const i=Object.keys(o).sort(),r=c({},Du,e==null?void 0:e.formatters),s=e==null?void 0:e.filter;return i.forEach(a=>{if(s!=null&&s(a))return;let h=o[a];const g=r[a];g&&(h=g(h,e)),!(a==="v"&&h===1)&&(a=="pr"&&h===1||Cu(h)&&(wu(a)&&typeof h=="string"&&(h=new ja(h)),t[a]=h))}),t}function qa(o,e={}){return o?xu(Lu(o,e),c({whitespace:!1},e)):""}function Ru(o,e={}){const t={};if(!o)return t;const i=Object.entries(o),r=Object.entries(tu).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),s=i.reduce((a,h)=>{var g,d;const[v,S]=h,M=((g=r.find(j=>j[1].includes(v)))===null||g===void 0?void 0:g[0])||In.REQUEST;return(d=a[M])!==null&&d!==void 0||(a[M]={}),a[M][v]=S,a},{});return Object.entries(s).reduce((a,[h,g])=>(a[h]=qa(g,e),a),t)}function ku(o,e,t){return c(o,Ru(e,t))}const Iu="CMCD";function Pu(o,e={}){if(!o)return"";const t=qa(o,e);return`${Iu}=${encodeURIComponent(t)}`}const Ya=/CMCD=[^&#]+/;function Ou(o,e,t){const i=Pu(e,t);if(!i)return o;if(Ya.test(o))return o.replace(Ya,i);const r=o.includes("?")?"&":"?";return`${o}${r}${i}`}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=r=>{try{this.apply(r,{ot:Wi.MANIFEST,su:!this.initialized})}catch(s){this.hls.logger.warn("Could not generate manifest CMCD data.",s)}},this.applyFragmentData=r=>{try{const{frag:s,part:a}=r,h=this.hls.levels[s.level],g=this.getObjectType(s),d={d:(a||s).duration*1e3,ot:g};(g===Wi.VIDEO||g===Wi.AUDIO||g==Wi.MUXED)&&(d.br=h.bitrate/1e3,d.tb=this.getTopBandwidth(g)/1e3,d.bl=this.getBufferLength(g));const v=a?this.getNextPart(a):this.getNextFrag(s);v!=null&&v.url&&v.url!==s.url&&(d.nor=v.url),this.apply(r,d)}catch(s){this.hls.logger.warn("Could not generate segment CMCD data.",s)}},this.hls=e;const t=this.config=e.config,{cmcd:i}=t;i!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||e.sessionId,this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.includeKeys=i.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHED,this.onMediaDetached,this),e.on(_.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHED,this.onMediaDetached,this),e.off(_.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 i,r;this.audioBuffer=(i=t.tracks.audio)==null?void 0:i.buffer,this.videoBuffer=(r=t.tracks.video)==null?void 0:r.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={}){c(t,this.createData());const i=t.ot===Wi.INIT||t.ot===Wi.VIDEO||t.ot===Wi.MUXED;this.starved&&i&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:r}=this;r&&(t=Object.keys(t).reduce((a,h)=>(r.includes(h)&&(a[h]=t[h]),a),{}));const s={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),ku(e.headers,t,s)):e.url=Ou(e.url,t,s)}getNextFrag(e){var t;const i=(t=this.hls.levels[e.level])==null?void 0:t.details;if(i){const r=e.sn-i.startSN;return i.fragments[r+1]}}getNextPart(e){var t,i;const{index:r,fragment:s}=e,a=(t=this.hls.levels[s.level])==null||(i=t.details)==null?void 0:i.partList;if(a){const{sn:h}=s;for(let g=a.length-1;g>=0;g--){const d=a[g];if(d.index===r&&d.fragment.sn===h)return a[g+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Wi.TIMED_TEXT;if(e.sn==="initSegment")return Wi.INIT;if(t==="audio")return Wi.AUDIO;if(t==="main")return this.hls.audioTracks.length?Wi.VIDEO:Wi.MUXED}getTopBandwidth(e){let t=0,i;const r=this.hls;if(e===Wi.AUDIO)i=r.audioTracks;else{const s=r.maxAutoLevel,a=s>-1?s+1:r.levels.length;i=r.levels.slice(0,a)}return i.forEach(s=>{s.bitrate>t&&(t=s.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,i=e===Wi.AUDIO?this.audioBuffer:this.videoBuffer;return!i||!t?NaN:Rt.bufferInfo(i,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,i=e||this.config.loader;return class{constructor(s){this.loader=void 0,this.loader=new i(s)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(s,a,h){t(s),this.loader.load(s,a,h)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,i=e||this.config.loader;return class{constructor(s){this.loader=void 0,this.loader=new i(s)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(s,a,h){t(s),this.loader.load(s,a,h)}}}}const Mu=3e5;class Bu extends D{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(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.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(i=>i!==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:i}=t;i!==null&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:i}=t;if((i==null?void 0:i.action)===yi.SendAlternateToPenaltyBox&&i.flags===Ci.MoveAllAlternatesMatchingHost){const r=this.levels;let s=this._pathwayPriority,a=this.pathwayId;if(t.context){const{groupId:h,pathwayId:g,type:d}=t.context;h&&r?a=this.getPathwayForGroupId(h,d,a):g&&(a=g)}a in this.penalizedPathways||(this.penalizedPathways[a]=performance.now()),!s&&r&&(s=this.pathways()),s&&s.length>1&&(this.updatePathwayPriority(s),i.resolved=this.pathwayId!==a),i.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${a} levels: ${r&&r.length} priorities: ${yt(s)} penalized: ${yt(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const i=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${i}"`),t=this.getLevelsForPathway(i),this.pathwayId=i}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 i=this.penalizedPathways,r=performance.now();Object.keys(i).forEach(s=>{r-i[s]>Mu&&delete i[s]});for(let s=0;s<e.length;s++){const a=e[s];if(a in i)continue;if(a===this.pathwayId)return;const h=this.hls.nextLoadLevel,g=this.hls.levels[h];if(t=this.getLevelsForPathway(a),t.length>0){this.log(`Setting Pathway to "${a}"`),this.pathwayId=a,na(t),this.hls.trigger(_.LEVELS_UPDATED,{levels:t});const d=this.hls.levels[h];g&&d&&this.levels&&(d.attrs["STABLE-VARIANT-ID"]!==g.attrs["STABLE-VARIANT-ID"]&&d.bitrate!==g.bitrate&&this.log(`Unstable Pathways change from bitrate ${g.bitrate} to ${d.bitrate}`),this.hls.nextLoadLevel=h);break}}}getPathwayForGroupId(e,t,i){const r=this.getLevelsForPathway(i).concat(this.levels||[]);for(let s=0;s<r.length;s++)if(t===O.AUDIO_TRACK&&r[s].hasAudioGroup(e)||t===O.SUBTITLE_TRACK&&r[s].hasSubtitleGroup(e))return r[s].pathwayId;return i}clonePathways(e){const t=this.levels;if(!t)return;const i={},r={};e.forEach(s=>{const{ID:a,"BASE-ID":h,"URI-REPLACEMENT":g}=s;if(t.some(v=>v.pathwayId===a))return;const d=this.getLevelsForPathway(h).map(v=>{const S=new ai(v.attrs);S["PATHWAY-ID"]=a;const M=S.AUDIO&&`${S.AUDIO}_clone_${a}`,j=S.SUBTITLES&&`${S.SUBTITLES}_clone_${a}`;M&&(i[S.AUDIO]=M,S.AUDIO=M),j&&(r[S.SUBTITLES]=j,S.SUBTITLES=j);const H=Xa(v.uri,S["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",g),Q=new Mi({attrs:S,audioCodec:v.audioCodec,bitrate:v.bitrate,height:v.height,name:v.name,url:H,videoCodec:v.videoCodec,width:v.width});if(v.audioGroups)for(let Z=1;Z<v.audioGroups.length;Z++)Q.addGroupId("audio",`${v.audioGroups[Z]}_clone_${a}`);if(v.subtitleGroups)for(let Z=1;Z<v.subtitleGroups.length;Z++)Q.addGroupId("text",`${v.subtitleGroups[Z]}_clone_${a}`);return Q});t.push(...d),Za(this.audioTracks,i,g,a),Za(this.subtitleTracks,r,g,a)})}loadSteeringManifest(e){const t=this.hls.config,i=t.loader;this.loader&&this.loader.destroy(),this.loader=new i(t);let r;try{r=new self.URL(e)}catch(v){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(r.protocol!=="data:"){const v=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+v)}const s={responseType:"json",url:r.href},a=t.steeringManifestLoadPolicy.default,h=a.errorRetry||a.timeoutRetry||{},g={loadPolicy:a,timeout:a.maxLoadTimeMs,maxRetry:h.maxNumRetry||0,retryDelay:h.retryDelayMs||0,maxRetryDelay:h.maxRetryDelayMs||0},d={onSuccess:(v,S,M,j)=>{this.log(`Loaded steering manifest: "${r}"`);const H=v.data;if((H==null?void 0:H.VERSION)!==1){this.log(`Steering VERSION ${H.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=H.TTL;const{"RELOAD-URI":Q,"PATHWAY-CLONES":Z,"PATHWAY-PRIORITY":re}=H;if(Q)try{this.uri=new self.URL(Q,r).href}catch(le){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${Q}`);return}this.scheduleRefresh(this.uri||M.url),Z&&this.clonePathways(Z);const fe={steeringManifest:H,url:r.toString()};this.hls.trigger(_.STEERING_MANIFEST_LOADED,fe),re&&this.updatePathwayPriority(re)},onError:(v,S,M,j)=>{if(this.log(`Error loading steering manifest: ${v.code} ${v.text} (${S.url})`),this.stopLoad(),v.code===410){this.enabled=!1,this.log(`Steering manifest ${S.url} no longer available`);return}let H=this.timeToLoad*1e3;if(v.code===429){const Q=this.loader;if(typeof(Q==null?void 0:Q.getResponseHeader)=="function"){const Z=Q.getResponseHeader("Retry-After");Z&&(H=parseFloat(Z)*1e3)}this.log(`Steering manifest ${S.url} rate limited`);return}this.scheduleRefresh(this.uri||S.url,H)},onTimeout:(v,S,M)=>{this.log(`Timeout loading steering manifest (${S.url})`),this.scheduleRefresh(this.uri||S.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(s,g,d)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var i;const r=(i=this.hls)==null?void 0:i.media;if(r&&!r.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function Za(o,e,t,i){o&&Object.keys(e).forEach(r=>{const s=o.filter(a=>a.groupId===r).map(a=>{const h=c({},a);return h.details=void 0,h.attrs=new ai(h.attrs),h.url=h.attrs.URI=Xa(a.url,a.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),h.groupId=h.attrs["GROUP-ID"]=e[r],h.attrs["PATHWAY-ID"]=i,h});o.push(...s)})}function Xa(o,e,t,i){const{HOST:r,PARAMS:s,[t]:a}=i;let h;e&&(h=a==null?void 0:a[e],h&&(o=h));const g=new self.URL(o);return r&&!h&&(g.host=r),s&&Object.keys(s).sort().forEach(d=>{d&&g.searchParams.set(d,s[d])}),g.href}function Vi(o,e,t){tr(o,e,t),o.addEventListener(e,t)}function tr(o,e,t){o.removeEventListener(e,t)}class fn extends D{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=fn.CDMCleanupPromise?[fn.CDMCleanupPromise]:[],this.onMediaEncrypted=t=>{const{initDataType:i,initData:r}=t,s=`"${t.type}" event: init data type: "${i}"`;if(this.debug(s),r!==null){if(!this.keyFormatPromise){let a=Object.keys(this.keySystemAccessPromises);a.length||(a=Tr(this.config));const h=a.map(Ar).filter(g=>!!g);this.keyFormatPromise=this.getKeyFormatPromise(h)}this.keyFormatPromise.then(a=>{const h=ji(a);let g,d;if(i==="sinf"){if(h!==Ht.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${i}" for selected key-system ${h}`);return}const H=lt(new Uint8Array(r));try{const Q=Kr(JSON.parse(H).sinf),Z=Fe(Q);if(!Z)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");g=new Uint8Array(Z.subarray(8,24)),d=Ht.FAIRPLAY}catch(Q){this.warn(`${s} Failed to parse sinf: ${Q}`);return}}else{if(h!==Ht.WIDEVINE&&h!==Ht.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${i}" for selected key-system ${h}`);return}const H=Mt(r),Q=H.filter(re=>!!re.systemId&&Pr(re.systemId)===h);Q.length>1&&this.warn(`${s} Using first of ${Q.length} pssh found for selected key-system ${h}`);const Z=Q[0];if(!Z){H.length===0||H.some(re=>!re.systemId)?this.warn(`${s} contains incomplete or invalid pssh data`):this.log(`ignoring ${s} for ${H.map(re=>Pr(re.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(d=Pr(Z.systemId),Z.version===0&&Z.data)if(d===Ht.WIDEVINE){const re=Z.data.length-22;g=new Uint8Array(Z.data.subarray(re,re+16))}else d===Ht.PLAYREADY&&(g=pi(Z.data))}if(!d||!g)return;const v=J.hexDump(g),{keyIdToKeySessionPromise:S,mediaKeySessions:M}=this;let j=S[v];for(let H=0;H<M.length;H++){const Q=M[H],Z=Q.decryptdata;if(!Z.keyId)continue;const re=J.hexDump(Z.keyId);if(v===re||Z.uri.replace(/-/g,"").indexOf(v)!==-1){if(j=S[re],Z.pssh)break;delete S[re],Z.pssh=new Uint8Array(r),Z.keyId=g,j=S[v]=j.then(()=>this.generateRequestWithPreferredKeySession(Q,i,r,"encrypted-event-key-match")),j.catch(fe=>this.handleError(fe));break}}if(!j){if(d!==h){this.log(`Ignoring "${t.type}" event with ${d} init data for selected key-system ${h}`);return}j=S[v]=this.getKeySystemSelectionPromise([d]).then(({keySystem:H,mediaKeys:Q})=>{var Z;this.throwIfDestroyed();const re=new gr("ISO-23001-7",v,(Z=Ar(H))!=null?Z:"");return re.pssh=new Uint8Array(r),re.keyId=g,this.attemptSetMediaKeys(H,Q).then(()=>{this.throwIfDestroyed();const fe=this.createMediaKeySessionContext({decryptdata:re,keySystem:H,mediaKeys:Q});return this.generateRequestWithPreferredKeySession(fe,i,r,"encrypted-event-no-match")})}),j.catch(H=>this.handleError(H))}})}},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.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(_.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(_.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(_.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(_.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(_.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(_.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:i}=this.config,r=t[e];if(r)return r.licenseUrl;if(e===Ht.WIDEVINE&&i)return i}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,i=t[e];if(i)return i.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,i=(a,h,g)=>!!a&&g.indexOf(a)===h,r=t.map(a=>a.audioCodec).filter(i),s=t.map(a=>a.videoCodec).filter(i);return r.length+s.length===0&&s.push("avc1.42e01e"),new Promise((a,h)=>{const g=d=>{const v=d.shift();this.getMediaKeysPromise(v,r,s).then(S=>a({keySystem:v,mediaKeys:S})).catch(S=>{d.length?g(d):S instanceof ir?h(S):h(new ir({type:T.KEY_SYSTEM_ERROR,details:w.KEY_SYSTEM_NO_ACCESS,error:S,fatal:!0},S.message))})};g(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:i}=this.config;if(typeof i!="function"){let r=`Configured requestMediaKeySystemAccess is not a function ${i}`;return on===null&&self.location.protocol==="http:"&&(r=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(r))}return i(e,t)}getMediaKeysPromise(e,t,i){const r=_t(e,t,i,this.config.drmSystemOptions),s=this.keySystemAccessPromises[e];let a=s==null?void 0:s.keySystemAccess;if(!a){this.log(`Requesting encrypted media "${e}" key-system access with config: ${yt(r)}`),a=this.requestMediaKeySystemAccess(e,r);const h=this.keySystemAccessPromises[e]={keySystemAccess:a};return a.catch(g=>{this.log(`Failed to obtain access to key-system "${e}": ${g}`)}),a.then(g=>{this.log(`Access for key-system "${g.keySystem}" obtained`);const d=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),h.mediaKeys=g.createMediaKeys().then(v=>(this.log(`Media-keys created for "${e}"`),h.hasMediaKeys=!0,d.then(S=>S?this.setMediaKeysServerCertificate(v,e,S):v))),h.mediaKeys.catch(v=>{this.error(`Failed to create media-keys for "${e}"}: ${v}`)}),h.mediaKeys})}return a.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:i}){this.log(`Creating key-system session "${t}" keyId: ${J.hexDump(e.keyId||[])}`);const r=i.createSession(),s={decryptdata:e,keySystem:t,mediaKeys:i,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(s),s}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const i=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),s="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(i,s,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 J.hexDump(e.keyId)}updateKeySession(e,t){var i;const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${J.hexDump(((i=e.decryptdata)==null?void 0:i.keyId)||[])}
|
|
|
} (data length: ${t&&t.byteLength})`),r.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>Ar(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:i})=>this.attemptSetMediaKeys(t,i))}selectKeySystem(e){return new Promise((t,i)=>this.getKeySystemSelectionPromise(e).then(({keySystem:r})=>{const s=Ar(r);s?t(s):i(new Error(`Unable to find format for key-system "${r}"`))}).catch(i))}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),i=e.map(ji).filter(r=>!!r&&t.indexOf(r)!==-1);return this.selectKeySystem(i)}loadKey(e){const t=e.keyInfo.decryptdata,i=this.getKeyIdString(t),r=`(keyId: ${i} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);let s=this.keyIdToKeySessionPromise[i];return s||(s=this.getKeySystemForKeyPromise(t).then(({keySystem:h,mediaKeys:g})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(h,g).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:h,mediaKeys:g,decryptdata:t}))))),(this.keyIdToKeySessionPromise[i]=s.then(h=>{const g="cenc",d=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(h,g,d,"playlist-key")})).catch(h=>this.handleError(h))),s}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof ir?this.hls.trigger(_.ERROR,e.data):this.hls.trigger(_.ERROR,{type:T.KEY_SYSTEM_ERROR,details:w.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),i=this.keyIdToKeySessionPromise[t];if(!i){const r=ji(e.keyFormat),s=r?[r]:Tr(this.config);return this.attemptKeySystemAccess(s)}return i}getKeySystemSelectionPromise(e){if(e.length||(e=Tr(this.config)),e.length===0)throw new ir({type:T.KEY_SYSTEM_ERROR,details:w.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${yt({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaKeys===t)return Promise.resolve();const i=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const r=Promise.all(i).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(r),r.then(()=>{this.log(`Media-keys set for "${e}"`),i.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(s=>i.indexOf(s)===-1)})}generateRequestWithPreferredKeySession(e,t,i,r){var s,a;const h=(s=this.config.drmSystems)==null||(a=s[e.keySystem])==null?void 0:a.generateRequest;if(h)try{const H=h.call(this.hls,t,i,e);if(!H)throw new Error("Invalid response from configured generateRequest filter");t=H.initDataType,i=H.initData?H.initData:null,e.decryptdata.pssh=i?new Uint8Array(i):null}catch(H){var g;if(this.warn(H.message),(g=this.hls)!=null&&g.config.debug)throw H}if(i===null)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const d=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${r}": ${d} (init data type: ${t} length: ${i?i.byteLength:null})`);const v=new as,S=e._onmessage=H=>{const Q=e.mediaKeysSession;if(!Q){v.emit("error",new Error("invalid state"));return}const{messageType:Z,message:re}=H;this.log(`"${Z}" message event for session "${Q.sessionId}" message size: ${re.byteLength}`),Z==="license-request"||Z==="license-renewal"?this.renewLicense(e,re).catch(fe=>{v.eventNames().length?v.emit("error",fe):this.handleError(fe)}):Z==="license-release"?e.keySystem===Ht.FAIRPLAY&&(this.updateKeySession(e,zr("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${Z}"`)},M=e._onkeystatuseschange=H=>{if(!e.mediaKeysSession){v.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const Z=e.keyStatus;v.emit("keyStatus",Z),Z==="expired"&&(this.warn(`${e.keySystem} expired for key ${d}`),this.renewKeySession(e))};Vi(e.mediaKeysSession,"message",S),Vi(e.mediaKeysSession,"keystatuseschange",M);const j=new Promise((H,Q)=>{v.on("error",Q),v.on("keyStatus",Z=>{Z.startsWith("usable")?H():Z==="output-restricted"?Q(new ir({type:T.KEY_SYSTEM_ERROR,details:w.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):Z==="internal-error"?Q(new ir({type:T.KEY_SYSTEM_ERROR,details:w.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${Z}"`)):Z==="expired"?Q(new Error("key expired while generating request")):this.warn(`unhandled key status change "${Z}"`)})});return e.mediaKeysSession.generateRequest(t,i).then(()=>{var H;this.log(`Request generated for key-session "${(H=e.mediaKeysSession)==null?void 0:H.sessionId}" keyId: ${d}`)}).catch(H=>{throw new ir({type:T.KEY_SYSTEM_ERROR,details:w.KEY_SYSTEM_NO_SESSION,error:H,fatal:!1},`Error generating key-session request: ${H}`)}).then(()=>j).catch(H=>{throw v.removeAllListeners(),this.removeSession(e),H}).then(()=>(v.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,i)=>{if(typeof i=="string"&&typeof t=="object"){const r=i;i=t,t=r}this.log(`key status change "${t}" for keyStatuses keyId: ${J.hexDump("buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i))} session keyId: ${J.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,i=t.loader,r=new i(t),s=this.getServerCertificateUrl(e);return s?(this.log(`Fetching server certificate for "${e}"`),new Promise((a,h)=>{const g={responseType:"arraybuffer",url:s},d=t.certLoadPolicy.default,v={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(M,j,H,Q)=>{a(M.data)},onError:(M,j,H,Q)=>{h(new ir({type:T.KEY_SYSTEM_ERROR,details:w.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:H,response:u({url:g.url,data:void 0},M)},`"${e}" certificate request failed (${s}). Status: ${M.code} (${M.text})`))},onTimeout:(M,j,H)=>{h(new ir({type:T.KEY_SYSTEM_ERROR,details:w.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:H,response:{url:g.url,data:void 0}},`"${e}" certificate request timed out (${s})`))},onAbort:(M,j,H)=>{h(new Error("aborted"))}};r.load(g,v,S)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,i){return new Promise((r,s)=>{e.setServerCertificate(i).then(a=>{this.log(`setServerCertificate ${a?"success":"not supported by CDM"} (${i==null?void 0:i.byteLength}) on "${t}"`),r(e)}).catch(a=>{s(new ir({type:T.KEY_SYSTEM_ERROR,details:w.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:a,fatal:!0},a.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(i=>this.updateKeySession(e,new Uint8Array(i)).catch(r=>{throw new ir({type:T.KEY_SYSTEM_ERROR,details:w.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:r,fatal:!0},r.message)}))}unpackPlayReadyKeyMessage(e,t){const i=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!i.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const r=new DOMParser().parseFromString(i,"application/xml"),s=r.querySelectorAll("HttpHeader");if(s.length>0){let v;for(let S=0,M=s.length;S<M;S++){var a,h;v=s[S];const j=(a=v.querySelector("name"))==null?void 0:a.textContent,H=(h=v.querySelector("value"))==null?void 0:h.textContent;j&&H&&e.setRequestHeader(j,H)}}const g=r.querySelector("Challenge"),d=g==null?void 0:g.textContent;if(!d)throw new Error("Cannot find <Challenge> in key message");return zr(atob(d))}setupLicenseXHR(e,t,i,r){const s=this.config.licenseXhrSetup;return s?Promise.resolve().then(()=>{if(!i.decryptdata)throw new Error("Key removed");return s.call(this.hls,e,t,i,r)}).catch(a=>{if(!i.decryptdata)throw a;return e.open("POST",t,!0),s.call(this.hls,e,t,i,r)}).then(a=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:a||r})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const i=this.config.keyLoadPolicy.default;return new Promise((r,s)=>{const a=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${a}`);const h=new XMLHttpRequest;h.responseType="arraybuffer",h.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return s(new Error("invalid state"));if(h.readyState===4)if(h.status===200){this._requestLicenseFailureCount=0;let g=h.response;this.log(`License received ${g instanceof ArrayBuffer?g.byteLength:g}`);const d=this.config.licenseResponseCallback;if(d)try{g=d.call(this.hls,h,a,e)}catch(v){this.error(v)}r(g)}else{const g=i.errorRetry,d=g?g.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>d||h.status>=400&&h.status<500)s(new ir({type:T.KEY_SYSTEM_ERROR,details:w.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:h,response:{url:a,data:void 0,code:h.status,text:h.statusText}},`License Request XHR failed (${a}). Status: ${h.status} (${h.statusText})`));else{const v=d-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${v} attempts left`),this.requestLicense(e,t).then(r,s)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=h,this.setupLicenseXHR(h,a,e,t).then(({xhr:g,licenseChallenge:d})=>{e.keySystem==Ht.PLAYREADY&&(d=this.unpackPlayReadyKeyMessage(g,d)),g.send(d)})})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const i=t.media;this.media=i,Vi(i,"encrypted",this.onMediaEncrypted),Vi(i,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(tr(e,"encrypted",this.onMediaEncrypted),tr(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,i=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,gr.clearKeyUriToKeyIdMap();const r=i.length;fn.CDMCleanupPromise=Promise.all(i.map(s=>this.removeSession(s)).concat(t==null||(e=t.setMediaKeys(null))==null?void 0:e.catch(s=>{var a;this.log(`Could not clear media keys: ${s}`),(a=this.hls)==null||a.trigger(_.ERROR,{type:T.OTHER_ERROR,details:w.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${s}`)})}))).catch(s=>{var a;this.log(`Could not close sessions and clear media keys: ${s}`),(a=this.hls)==null||a.trigger(_.ERROR,{type:T.OTHER_ERROR,details:w.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${s}`)})}).then(()=>{r&&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 i=t.reduce((r,s)=>(r.indexOf(s.keyFormat)===-1&&r.push(s.keyFormat),r),[]);this.log(`Selecting key-system from session-keys ${i.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(i)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:i}=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),i&&i.readyState!==XMLHttpRequest.DONE&&i.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);r>-1&&this.mediaKeySessions.splice(r,1);const{drmSystemOptions:s}=this.config;return(fi(s)?new Promise((h,g)=>{self.setTimeout(()=>g(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(h)}):Promise.resolve()).catch(h=>{var g;this.log(`Could not remove session: ${h}`),(g=this.hls)==null||g.trigger(_.ERROR,{type:T.OTHER_ERROR,details:w.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${h}`)})}).then(()=>t.close()).catch(h=>{var g;this.log(`Could not close session: ${h}`),(g=this.hls)==null||g.trigger(_.ERROR,{type:T.OTHER_ERROR,details:w.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${h}`)})})}}}fn.CDMCleanupPromise=void 0;class ir 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 Nu{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(_.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(_.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(_.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const i=this.hls.config;if(i.capLevelOnFPSDrop){const r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&typeof r.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,i){const r=performance.now();if(t){if(this.lastTime){const s=r-this.lastTime,a=i-this.lastDroppedFrames,h=t-this.lastDecodedFrames,g=1e3*a/s,d=this.hls;if(d.trigger(_.FPS_DROP,{currentDropped:a,currentDecoded:h,totalDroppedFrames:i}),g>0&&a>d.config.fpsDroppedMonitoringThreshold*h){let v=d.currentLevel;d.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+v),v>0&&(d.autoLevelCapping===-1||d.autoLevelCapping>=v)&&(v=v-1,d.trigger(_.FPS_DROP_LEVEL_CAPPING,{level:v,droppedLevel:d.currentLevel}),d.autoLevelCapping=v,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=i,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 Qa(o,e){let t;try{t=new Event("addtrack")}catch(i){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=o,e.dispatchEvent(t)}function Ja(o,e){const t=o.mode;if(t==="disabled"&&(o.mode="hidden"),o.cues&&!o.cues.getCueById(e.id))try{if(o.addCue(e),!o.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(i){F.debug(`[texttrack-utils]: ${i}`);try{const r=new self.TextTrackCue(e.startTime,e.endTime,e.text);r.id=e.id,o.addCue(r)}catch(r){F.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${r}`)}}t==="disabled"&&(o.mode=t)}function dn(o,e){const t=o.mode;if(t==="disabled"&&(o.mode="hidden"),o.cues)for(let i=o.cues.length;i--;)e&&o.cues[i].removeEventListener("enter",e),o.removeCue(o.cues[i]);t==="disabled"&&(o.mode=t)}function As(o,e,t,i){const r=o.mode;if(r==="disabled"&&(o.mode="hidden"),o.cues&&o.cues.length>0){const s=$u(o.cues,e,t);for(let a=0;a<s.length;a++)(!i||i(s[a]))&&o.removeCue(s[a])}r==="disabled"&&(o.mode=r)}function Uu(o,e){if(e<=o[0].startTime)return 0;const t=o.length-1;if(e>o[t].endTime)return-1;let i=0,r=t,s;for(;i<=r;)if(s=Math.floor((r+i)/2),e<o[s].startTime)r=s-1;else if(e>o[s].startTime&&i<t)i=s+1;else return s;return o[i].startTime-e<e-o[r].startTime?i:r}function $u(o,e,t){const i=[],r=Uu(o,e);if(r>-1)for(let s=r,a=o.length;s<a;s++){const h=o[s];if(h.startTime>=e&&h.endTime<=t)i.push(h);else if(h.startTime>t)return i}return i}function zn(o){const e=[];for(let t=0;t<o.length;t++){const i=o[t];(i.kind==="subtitles"||i.kind==="captions")&&i.label&&e.push(o[t])}return e}class Hu extends ys{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 i=zn(this.media.textTracks);for(let s=0;s<i.length;s++)if(i[s].mode==="hidden")t=i[s];else if(i[s].mode==="showing"){t=i[s];break}const r=this.findTrackForTextTrack(t);this.subtitleTrack!==r&&this.setSubtitleTrack(r)},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(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(_.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVEL_LOADING,this.onLevelLoading,this),e.off(_.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(_.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 i=this.media;if(!i)return;const r=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||i.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,r)return;zn(i.textTracks).forEach(a=>{dn(a)})}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:i,groupId:r,details:s}=t,a=this.tracksInGroup[i];if(!a||a.groupId!==r){this.warn(`Subtitle track with id:${i} and group:${r} not found in active group ${a==null?void 0:a.groupId}`);return}const h=a.details;a.details=t.details,this.log(`Subtitle track ${i} "${a.name}" lang:${a.lang} group:${r} loaded [${s.startSN}-${s.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,h)}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 i=t.subtitleGroups||null,r=this.groupIds;let s=this.currentTrack;if(!i||(r==null?void 0:r.length)!==(i==null?void 0:i.length)||i!=null&&i.some(a=>(r==null?void 0:r.indexOf(a))===-1)){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const a=this.tracks.filter(v=>!i||i.indexOf(v.groupId)!==-1);if(a.length)this.selectDefaultTrack&&!a.some(v=>v.default)&&(this.selectDefaultTrack=!1),a.forEach((v,S)=>{v.id=S});else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=a;const h=this.hls.config.subtitlePreference;if(!s&&h){this.selectDefaultTrack=!1;const v=Qt(h,a);if(v>-1)s=a[v];else{const S=Qt(h,this.tracks);s=this.tracks[S]}}let g=this.findTrackId(s);g===-1&&s&&(g=this.findTrackId(null));const d={subtitleTracks:a};this.log(`Updating subtitle tracks, ${a.length} track(s) found in "${i==null?void 0:i.join(",")}" group-id`),this.hls.trigger(_.SUBTITLE_TRACKS_UPDATED,d),g!==-1&&this.trackId===-1&&this.setSubtitleTrack(g)}}findTrackId(e){const t=this.tracksInGroup,i=this.selectDefaultTrack;for(let r=0;r<t.length;r++){const s=t[r];if(!(i&&!s.default||!i&&!e)&&(!e||qt(s,e)))return r}if(e){for(let r=0;r<t.length;r++){const s=t[r];if(kn(e.attrs,s.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return r}for(let r=0;r<t.length;r++){const s=t[r];if(kn(e.attrs,s.attrs,["LANGUAGE"]))return r}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const r=t[i];if(bs(r,e))return i}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===O.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 i=this.currentTrack;if(i&&qt(e,i))return i;const r=Qt(e,this.tracksInGroup);if(r>-1){const s=this.tracksInGroup[r];return this.setSubtitleTrack(r),s}else{if(i)return null;{const s=Qt(e,t);if(s>-1)return t[s]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const i=e.id,r=e.groupId,s=this.getUrlWithDirectives(e.url,t),a=e.details,h=a==null?void 0:a.age;this.log(`Loading subtitle ${i} "${e.name}" lang:${e.lang} group:${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${h&&a.live?" age "+h.toFixed(1)+(a.type?" "+a.type||0:""):""} ${s}`),this.hls.trigger(_.SUBTITLE_TRACK_LOADING,{url:s,id:i,groupId:r,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=zn(e.textTracks),i=this.currentTrack;let r;if(i&&(r=t.filter(s=>bs(i,s))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${i.name}" and language "${i.lang}"`)),[].slice.call(t).forEach(s=>{s.mode!=="disabled"&&s!==r&&(s.mode="disabled")}),r){const s=this.subtitleDisplay?"showing":"hidden";r.mode!==s&&(r.mode=s)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!k(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const i=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),!r){this.hls.trigger(_.SUBTITLE_TRACK_SWITCH,{id:e});return}const s=!!r.details&&!r.details.live;if(e===this.trackId&&r===i&&s)return;this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:a,groupId:h="",name:g,type:d,url:v}=r;this.hls.trigger(_.SUBTITLE_TRACK_SWITCH,{id:a,groupId:h,name:g,type:d,url:v});const S=this.switchParams(r.url,i==null?void 0:i.details,r.details);this.loadPlaylist(S)}}function ju(){try{return crypto.randomUUID()}catch(o){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,r=>{const s=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(r=="x"?s:s&3|8).toString(16)})}}}function Pn(o){let e=5381,t=o.length;for(;t;)e=e*33^o.charCodeAt(--t);return(e>>>0).toString()}const pn=.025;let Vn=function(o){return o[o.Point=0]="Point",o[o.Range=1]="Range",o}({});function Wu(o,e,t){return`${o.identifier}-${t+1}-${Pn(e)}`}class Gu{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 i=this.playoutLimit;return e<=0||isNaN(i)?!1:i===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>i}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 Ts(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,i=Ts(t,e);return t-i<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=k(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 Ts(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)<pn))}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"?Vn.Range:Vn.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 Ku(this)}}function Ts(o,e){return o-e.start<e.duration/2&&!(Math.abs(o-(e.start+e.duration))<pn)?e.start:e.start+e.duration}function eo(o,e,t){const i=new self.URL(o,t);return i.protocol!=="data:"&&i.searchParams.set("_HLS_primary_id",e),i}function Ds(o,e){for(;(t=o.assetList[++e])!=null&&t.error;)var t;return e}function Ku(o){return`["${o.identifier}" ${o.cue.pre?"<pre>":o.cue.post?"<post>":""}${o.timelineStart.toFixed(2)}-${o.resumeTime.toFixed(2)}]`}function _n(o){const e=o.timelineStart,t=o.duration||0;return`["${o.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class zu{constructor(e,t,i,r){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(_.PLAYOUT_LIMIT_REACHED,{})};const s=this.hls=new e(t);this.interstitial=i,this.assetItem=r;let a=r.uri;try{a=eo(a,t.primarySessionId).href}catch(g){}s.loadSource(a);const h=()=>{this.hasDetails=!0};s.once(_.LEVEL_LOADED,h),s.once(_.AUDIO_TRACK_LOADED,h),s.once(_.SUBTITLE_TRACK_LOADED,h),s.on(_.MEDIA_ATTACHING,(g,{media:d})=>{this.removeMediaListeners(),this.mediaAttached=d,this.interstitial.playoutLimit&&(d.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&s.on(_.BUFFER_APPENDED,()=>{const S=this.bufferedEnd;this.reachedPlayout(S)&&(this._bufferedEosTime=S,s.trigger(_.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 i=this.timelineOffset,r=Rt.bufferInfo(e,i,0);return this.getAssetTime(r.end)>=this._bufferedEosTime-.02}reachedPlayout(e){const i=this.interstitial.playoutLimit;return this.startOffset+e>=i}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=Rt.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 i=e-t;if(Math.abs(i)>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,i=this.duration;return Math.min(Math.max(0,e-t),i)}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=i=>delete i.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,i){this.hls.on(e,t)}once(e,t,i){this.hls.once(e,t)}off(e,t,i){this.hls.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${_n(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const to=.033;class Vu extends D{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((i,r)=>e<=r.startOffset&&t>r.startOffset?(delete r.error,i+1):i,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 i=-1;e.nextEvent?i=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(i=this.findEventIndex(e.previousEvent.identifier)+1);const r=this.items;if(r)for(r[i]||(t===void 0&&(t=e.start),i=this.findItemIndexAtTime(t));i>=0&&(s=r[i])!=null&&s.event;){var s;i--}return i}findItemIndexAtTime(e,t){const i=this.items;if(i)for(let r=0;r<i.length;r++){let s=i[r];if(t&&t!=="primary"&&(s=s[t]),e===s.start||e>s.start&&e<s.end)return r}return-1}findJumpRestrictedIndex(e,t){const i=this.items;if(i)for(let r=e;r<=t&&i[r];r++){const s=i[r].event;if(s!=null&&s.restrictions.jump&&!s.appendInPlace)return r}return-1}findEventIndex(e){const t=this.items;if(t)for(let r=t.length;r--;){var i;if(((i=t[r].event)==null?void 0:i.identifier)===e)return r}return-1}findAssetIndex(e,t){const i=e.assetList,r=i.length;if(r>1)for(let s=0;s<r;s++){const a=i[s];if(!a.error){const h=a.timelineStart;if(t===h||t>h&&t<h+(a.duration||0))return s}}return 0}get assetIdAtEnd(){var e,t;const i=(e=this.items)==null||(t=e[this.length-1])==null?void 0:t.event;if(i){const r=i.assetList,s=r[r.length-1];if(s)return s.identifier}return null}parseInterstitialDateRanges(e,t){const i=e.main.details,{dateRanges:r}=i,s=this.events,a=this.parseDateRanges(r,{url:i.url},t),h=Object.keys(r),g=s?s.filter(d=>!h.includes(d.identifier)):[];a.length&&a.sort((d,v)=>{const S=d.cue.pre,M=d.cue.post,j=v.cue.pre,H=v.cue.post;if(S&&!j)return-1;if(j&&!S||M&&!H)return 1;if(H&&!M)return-1;if(!S&&!j&&!M&&!H){const Q=d.startTime,Z=v.startTime;if(Q!==Z)return Q-Z}return d.dateRange.tagOrder-v.dateRange.tagOrder}),this.events=a,g.forEach(d=>{this.removeEvent(d)}),this.updateSchedule(e,g)}updateSchedule(e,t=[]){const i=this.events||[];if(i.length||t.length||this.length<2){const r=this.items,s=this.parseSchedule(i,e);(t.length||(r==null?void 0:r.length)!==s.length||s.some((h,g)=>Math.abs(h.playout.start-r[g].playout.start)>.005||Math.abs(h.playout.end-r[g].playout.end)>.005))&&(this.items=s,this.onScheduleUpdate(t,r))}}parseDateRanges(e,t,i){const r=[],s=Object.keys(e);for(let a=0;a<s.length;a++){const h=s[a],g=e[h];if(g.isInterstitial){let d=this.eventMap[h];d?d.setDateRange(g):(d=new Gu(g,t),this.eventMap[h]=d,i===!1&&(d.appendInPlace=i)),r.push(d)}}return r}parseSchedule(e,t){const i=[],r=t.main.details,s=r.live?1/0:r.edge;let a=0;if(e=e.filter(g=>!g.error&&!(g.cue.once&&g.hasPlayed)),e.length){this.resolveOffsets(e,t);let g=0,d=0;if(e.forEach((v,S)=>{const M=v.cue.pre,j=v.cue.post,H=e[S-1]||null,Q=v.appendInPlace,Z=j?s:v.startOffset,re=v.duration,fe=v.timelineOccupancy===Vn.Range?re:0,le=v.resumptionOffset,be=(H==null?void 0:H.startTime)===Z,we=Z+v.cumulativeDuration;let $e=Q?we+re:Z+le;if(M||!j&&Z<=0){const Pe=d;d+=fe,v.timelineStart=we;const Ue=a;a+=re,i.push({event:v,start:we,end:$e,playout:{start:Ue,end:a},integrated:{start:Pe,end:d}})}else if(Z<=s){if(!be){const De=Z-g;if(De>to){const Xe=g,ut=d;d+=De;const Tt=a;a+=De;const gt={previousEvent:e[S-1]||null,nextEvent:v,start:Xe,end:Xe+De,playout:{start:Tt,end:a},integrated:{start:ut,end:d}};i.push(gt)}else De>0&&H&&(H.cumulativeDuration+=De,i[i.length-1].end=Z)}j&&($e=we),v.timelineStart=we;const Pe=d;d+=fe;const Ue=a;a+=re,i.push({event:v,start:we,end:$e,playout:{start:Ue,end:a},integrated:{start:Pe,end:d}})}else return;const Ae=v.resumeTime;j||Ae>s?g=s:g=Ae}),g<s){var h;const v=g,S=d,M=s-g;d+=M;const j=a;a+=M,i.push({previousEvent:((h=i[i.length-1])==null?void 0:h.event)||null,nextEvent:null,start:g,end:v+M,playout:{start:j,end:a},integrated:{start:S,end:d}})}this.setDurations(s,a,d)}else i.push({previousEvent:null,nextEvent:null,start:0,end:s,playout:{start:0,end:s},integrated:{start:0,end:s}}),this.setDurations(s,s,s);return i}setDurations(e,t,i){this.durations={primary:e,playout:t,integrated:i}}resolveOffsets(e,t){const i=t.main.details,r=i.live?1/0:i.edge;let s=0,a=-1;e.forEach((h,g)=>{const d=h.cue.pre,v=h.cue.post,S=d?0:v?r:h.startTime;this.updateAssetDurations(h),a===S?h.cumulativeDuration=s:(s=0,a=S),!v&&h.snapOptions.in&&(h.resumeAnchor=ni(null,i.fragments,h.startOffset+h.resumptionOffset,0,0)||void 0),h.appendInPlace&&!h.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(h,t)||(h.appendInPlace=!1)),!h.appendInPlace&&g+1<e.length&&e[g+1].startTime-e[g].resumeTime<to&&(e[g+1].appendInPlace=!1,e[g+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${h}`));const j=k(h.resumeOffset)?h.resumeOffset:h.duration;s+=j})}primaryCanResumeInPlaceAt(e,t){const i=e.resumeTime,r=e.startTime+e.resumptionOffset;return Math.abs(i-r)>pn?(this.log(`"${e.identifier}" resumption ${i} not aligned with estimated timeline end ${r}`),!1):t?!Object.keys(t).some(a=>{const h=t[a].details,g=h.edge;if(i>=g)return this.log(`"${e.identifier}" resumption ${i} past ${a} playlist end ${g}`),!1;const d=ni(null,h.fragments,i);if(!d)return this.log(`"${e.identifier}" resumption ${i} does not align with any fragments in ${a} playlist (${h.fragStart}-${h.fragmentEnd})`),!0;const v=a==="audio"?.175:0;return Math.abs(d.start-i)<pn+v||Math.abs(d.end-i)<pn+v?!1:(this.log(`"${e.identifier}" resumption ${i} not aligned with ${a} fragment bounds (${d.start}-${d.end} sn: ${d.sn} cc: ${d.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${i} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let i=0,r=!1,s=!1;e.assetList.forEach((a,h)=>{const g=t+i;a.startOffset=i,a.timelineStart=g,r||(r=a.duration===null),s||(s=!!a.error);const d=a.error?0:a.duration||0;i+=d}),r&&!s?e.duration=Math.max(i,e.duration):e.duration=i}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Mr(o){return`[${o.event?'"'+o.event.identifier+'"':"primary"}: ${o.start.toFixed(2)}-${o.end.toFixed(2)}]`}class qu{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const i=e.assetListUrl;let r;try{r=eo(i,this.hls.sessionId,e.baseUrl)}catch(M){const j=this.assignAssetListError(e,w.ASSET_LIST_LOAD_ERROR,M,i);this.hls.trigger(_.ERROR,j);return}t&&r.protocol!=="data:"&&r.searchParams.set("_HLS_start_offset",""+t);const s=this.hls.config,a=s.loader,h=new a(s),g={responseType:"json",url:r.href},d=s.interstitialAssetListLoadPolicy.default,v={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(M,j,H,Q)=>{const Z=M.data,re=Z==null?void 0:Z.ASSETS;if(!Array.isArray(re)){const fe=this.assignAssetListError(e,w.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),H.url,j,Q);this.hls.trigger(_.ERROR,fe);return}e.assetListResponse=Z,this.hls.trigger(_.ASSET_LIST_LOADED,{event:e,assetListResponse:Z,networkDetails:Q})},onError:(M,j,H,Q)=>{const Z=this.assignAssetListError(e,w.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${M.code} ${M.text} (${j.url})`),j.url,Q,H);this.hls.trigger(_.ERROR,Z)},onTimeout:(M,j,H)=>{const Q=this.assignAssetListError(e,w.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${j.url})`),j.url,M,H);this.hls.trigger(_.ERROR,Q)}};return h.load(g,v,S),this.hls.trigger(_.ASSET_LIST_LOADING,{event:e}),h}assignAssetListError(e,t,i,r,s,a){return e.error=i,{type:T.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:r,error:i,networkDetails:a,stats:s}}}function io(o){o==null||o.play().catch(()=>{})}class Yu extends D{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 i=this.currentTime;if(i===void 0||this.playbackDisabled)return;const r=i-this.timelinePos;if(Math.abs(r)<1/7056e5)return;const a=r<=-.01;this.timelinePos=i,this.bufferedPos=i;const h=this.playingItem;if(!h){this.checkBuffer();return}if(a&&this.schedule.resetErrorsInRange(i,i-r)&&this.updateSchedule(),this.checkBuffer(),a&&i<h.start||i>=h.end){var g;const M=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(h)&&(g=this.media)!=null&&g.paused&&(this.shouldPlay=!1),!a){const j=this.findItemIndex(h);if(M>j){const H=this.schedule.findJumpRestrictedIndex(j+1,M);if(H>j){this.setSchedulePosition(H);return}}}this.setSchedulePosition(M);return}const d=this.playingAsset;if(!d){if(this.playingLastItem&&this.isInterstitial(h)){const M=h.event.assetList[0];M&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(i,M))}return}const v=d.timelineStart,S=d.duration||0;(a&&i<v||i>=v+S)&&this.setScheduleToAssetAtTime(i,d)},this.onTimeupdate=()=>{const i=this.currentTime;if(i===void 0||this.playbackDisabled)return;if(i>this.timelinePos)this.timelinePos=i,i>this.bufferedPos&&this.checkBuffer();else return;const r=this.playingItem;if(!r||this.playingLastItem)return;if(i>=r.end){this.timelinePos=r.end;const h=this.findItemIndex(r);this.setSchedulePosition(h+1)}const s=this.playingAsset;if(!s)return;const a=s.timelineStart+(s.duration||0);i>=a&&this.setScheduleToAssetAtTime(i,s)},this.onScheduleUpdate=(i,r)=>{const s=this.schedule,a=this.playingItem,h=s.events||[],g=s.items||[],d=s.durations,v=i.map(H=>H.identifier),S=!!(h.length||v.length);(S||r)&&this.log(`INTERSTITIALS_UPDATED (${h.length}): ${h}
|
|
|
Schedule: ${g.map(H=>Mr(H))} pos: ${this.timelinePos}`),v.length&&this.log(`Removed events ${v}`),this.playerQueue.forEach(H=>{if(H.interstitial.appendInPlace){const Q=H.assetItem.timelineStart,Z=H.timelineOffset-Q;if(Z)try{H.timelineOffset=Q}catch(re){Math.abs(Z)>pn&&this.warn(`${re} ("${H.assetId}" ${H.timelineOffset}->${Q})`)}}});let M=null;if(a){const H=this.updateItem(a,this.timelinePos);this.itemsMatch(a,H)&&(this.playingItem=H,this.waitingItem=this.endedItem=null,M=()=>this.trimInPlace(H,a))}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const j=this.bufferingItem;if(j){const H=this.updateItem(j,this.bufferedPos);this.itemsMatch(j,H)?(this.bufferingItem=H,M||(M=()=>this.trimInPlace(H,j))):j.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(j.event,null))}if(i.forEach(H=>{H.assetList.forEach(Q=>{this.clearAssetPlayer(Q.identifier,null)})}),S||r){if(this.hls.trigger(_.INTERSTITIALS_UPDATED,{events:h.slice(0),schedule:g.slice(0),durations:d,removedIds:v}),this.isInterstitial(a)&&v.includes(a.event.identifier)){this.warn(`Interstitial "${a.event.identifier}" removed while playing`),this.primaryFallback(a.event);return}M&&M(),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new qu(e),this.schedule=new Vu(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(_.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(_.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(_.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(_.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(_.BUFFER_APPENDED,this.onBufferAppended,this),e.on(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(_.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(_.MEDIA_ENDED,this.onMediaEnded,this),e.on(_.ERROR,this.onError,this),e.on(_.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(_.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(_.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(_.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(_.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(_.BUFFER_CODECS,this.onBufferCodecs,this),e.off(_.BUFFER_APPENDED,this.onBufferAppended,this),e.off(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(_.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(_.MEDIA_ENDED,this.onMediaEnded,this),e.off(_.ERROR,this.onError,this),e.off(_.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){tr(e,"play",this.onPlay),tr(e,"pause",this.onPause),tr(e,"seeking",this.onSeeking),tr(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const i=this.media=t.media;Vi(i,"seeking",this.onSeeking),Vi(i,"timeupdate",this.onTimeupdate),Vi(i,"play",this.onPlay),Vi(i,"pause",this.onPause)}onMediaAttached(e,t){const i=this.effectivePlayingItem,r=this.detachedData;if(this.detachedData=null,i===null)this.checkStart();else if(!r){this.clearScheduleState();const s=this.findItemIndex(i);this.setSchedulePosition(s)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const i=!!t.transferMedia,r=this.media;if(this.media=null,!i&&(r&&this.removeMediaListeners(r),this.detachedData)){const s=this.getBufferingPlayer();s&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,s.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const e=this,t=()=>e.bufferingItem||e.waitingItem,i=S=>S&&e.getAssetPlayer(S.identifier),r=(S,M,j,H,Q)=>{if(S){let Z=S[M].start;const re=S.event;if(re){if(M==="playout"||re.timelineOccupancy!==Vn.Point){const fe=i(j);(fe==null?void 0:fe.interstitial)===re&&(Z+=fe.assetItem.startOffset+fe[Q])}}else{const fe=H==="bufferedPos"?a():e[H];Z+=fe-S.start}return Z}return 0},s=(S,M)=>{if(S!==0&&M!=="primary"&&e.schedule.length){var j;const H=e.schedule.findItemIndexAtTime(S),Q=(j=e.schedule.items)==null?void 0:j[H];if(Q){const Z=Q[M].start-Q.start;return S+Z}}return S},a=()=>{const S=e.bufferedPos;return S===Number.MAX_VALUE?h("primary"):Math.max(S,0)},h=S=>{var M;return(M=e.primaryDetails)!=null&&M.live?e.primaryDetails.edge:e.schedule.durations[S]},g=(S,M)=>{var j,H;const Q=e.effectivePlayingItem;if(Q!=null&&(j=Q.event)!=null&&j.restrictions.skip)return;e.log(`seek to ${S} "${M}"`);const Z=e.effectivePlayingItem,re=e.schedule.findItemIndexAtTime(S,M),fe=(H=e.schedule.items)==null?void 0:H[re],le=e.getBufferingPlayer(),be=le==null?void 0:le.interstitial,we=be==null?void 0:be.appendInPlace,$e=Z&&e.itemsMatch(Z,fe);if(Z&&(we||$e)){const Pe=i(e.playingAsset),Ue=(Pe==null?void 0:Pe.media)||e.primaryMedia;if(Ue){const De=M==="primary"?Ue.currentTime:r(Z,M,e.playingAsset,"timelinePos","currentTime"),Xe=S-De,ut=(we?De:Ue.currentTime)+Xe;if(ut>=0&&(!Pe||we||ut<=Pe.duration)){Ue.currentTime=ut;return}}}if(fe){let Pe=S;if(M!=="primary"){const De=fe[M].start,Xe=S-De;Pe=fe.start+Xe}const Ue=!e.isInterstitial(fe);if((!e.isInterstitial(Z)||Z.event.appendInPlace)&&(Ue||fe.event.appendInPlace)){const De=e.media||(we?le==null?void 0:le.media:null);De&&(De.currentTime=Pe)}else if(Z){const De=e.findItemIndex(Z);if(re>De){const ut=e.schedule.findJumpRestrictedIndex(De+1,re);if(ut>De){e.setSchedulePosition(ut);return}}let Xe=0;if(Ue)e.timelinePos=Pe,e.checkBuffer();else{var Ae;const ut=fe==null||(Ae=fe.event)==null?void 0:Ae.assetList;if(ut){const Tt=S-(fe[M]||fe).start;for(let gt=ut.length;gt--;){const vt=ut[gt];if(vt.duration&&Tt>=vt.startOffset&&Tt<vt.startOffset+vt.duration){Xe=gt;break}}}}e.setSchedulePosition(re,Xe)}}},d=()=>{const S=e.effectivePlayingItem;if(e.isInterstitial(S))return S;const M=t();return e.isInterstitial(M)?M:null},v={get currentTime(){const S=d(),M=e.effectivePlayingItem;return M&&M===S?r(M,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-M.playout.start:0},set currentTime(S){const M=d(),j=e.effectivePlayingItem;j&&j===M&&g(S+j.playout.start,"playout")},get duration(){const S=d();return S?S.playout.end-S.playout.start:0},get assetPlayers(){var S;const M=(S=d())==null?void 0:S.event.assetList;return M?M.map(j=>e.getAssetPlayer(j.identifier)):[]},get playingIndex(){var S;const M=(S=d())==null?void 0:S.event;return M&&e.effectivePlayingAsset?M.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return d()}};this.manager={get events(){var S,M;return((S=e.schedule)==null||(M=S.events)==null?void 0:M.slice(0))||[]},get schedule(){var S,M;return((S=e.schedule)==null||(M=S.items)==null?void 0:M.slice(0))||[]},get interstitialPlayer(){return d()?v:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const S=t();return e.findItemIndex(S)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const S=e.effectivePlayingItem;return e.findItemIndex(S)},primary:{get bufferedEnd(){return a()},get currentTime(){const S=e.timelinePos;return S>0?S:0},set currentTime(S){g(S,"primary")},get duration(){return h("primary")},get seekableStart(){var S;return((S=e.primaryDetails)==null?void 0:S.fragmentStart)||0}},integrated:{get bufferedEnd(){return r(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return r(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(S){g(S,"integrated")},get duration(){return h("integrated")},get seekableStart(){var S;return s(((S=e.primaryDetails)==null?void 0:S.fragmentStart)||0,"integrated")}},skip:()=>{const S=e.effectivePlayingItem,M=S==null?void 0:S.event;if(M&&!M.restrictions.skip){const j=e.findItemIndex(S);if(M.appendInPlace){const H=S.playout.start+S.event.duration;g(H+.001,"playout")}else e.advanceAfterAssetEnded(M,j,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,i=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!i?!1:this.findItemIndex(t)===i.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t,i;if(this.mediaSelection===null)return;const r=this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&!r.event.appendInPlace)return;let s=this.media;!s&&(e=this.bufferingItem)!=null&&(t=e.event)!=null&&t.appendInPlace&&(s=this.primaryMedia);const a=(i=s)==null?void 0:i.currentTime;if(!(a===void 0||!k(a)))return a}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 i=this.getAssetPlayer(e);i&&this.transferMediaFromPlayer(i,t)}transferMediaFromPlayer(e,t){const i=e.interstitial.appendInPlace,r=e.media;if(i&&r===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&r){this.detachedData={media:r};return}const s=e.transferMedia();this.log(`transfer MediaSource from ${e} ${yt(s)}`),this.detachedData=s}else t&&r&&(this.shouldPlay||(this.shouldPlay=!r.paused))}transferMediaTo(e,t){var i,r;if(e.media===t)return;let s=null;const a=this.hls,h=e!==a,g=h&&e.interstitial.appendInPlace,d=(i=this.detachedData)==null?void 0:i.mediaSource;let v;if(a.media)g&&(s=a.transferMedia(),this.detachedData=s),v="Primary";else if(d){const j=this.getBufferingPlayer();j?(s=j.transferMedia(),v=`${j}`):v="detached MediaSource"}else v="detached media";if(!s){if(d)s=this.detachedData,this.log(`using detachedData: MediaSource ${yt(s)}`);else if(!this.detachedData||a.media===t){const j=this.playerQueue;j.length>1&&j.forEach(H=>{if(h&&H.interstitial.appendInPlace!==g){const Q=H.interstitial;this.clearInterstitial(H.interstitial,null),Q.appendInPlace=!1,Q.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${Q}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const S=s&&"mediaSource"in s&&((r=s.mediaSource)==null?void 0:r.readyState)!=="closed",M=S&&s?s:t;if(this.log(`${S?"transfering MediaSource":"attaching media"} to ${h?e:"Primary"} from ${v}`),M===s){const j=h&&e.assetId===this.schedule.assetIdAtEnd;M.overrides={duration:this.schedule.duration,endOfStream:!h||j,cueRemoval:!h}}e.attachMedia(M)}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 i=this.timelinePos,r=this.effectivePlayingItem;if(i===-1){const s=this.hls.startPosition;if(this.timelinePos=s,t.length&&t[0].cue.pre){const a=e.findEventIndex(t[0].identifier);this.setSchedulePosition(a)}else if(s>=0||!this.primaryLive){const a=this.timelinePos=s>0?s:0,h=e.findItemIndexAtTime(a);this.setSchedulePosition(h)}}else if(r&&!this.playingItem){const s=e.findItemIndex(r);this.setSchedulePosition(s)}}advanceAfterAssetEnded(e,t,i){const r=Ds(e,i);if(!e.isAssetPastPlayoutLimit(r))this.setSchedulePosition(t,r);else{const s=this.schedule.items;if(s){const a=t+1,h=s.length;if(a>=h){this.setSchedulePosition(-1);return}const g=e.resumeTime;this.timelinePos<g&&(this.timelinePos=g,this.checkBuffer()),this.setSchedulePosition(a)}}}setScheduleToAssetAtTime(e,t){const i=this.schedule,r=t.parentIdentifier,s=i.getEvent(r);if(s){const a=i.findEventIndex(r),h=i.findAssetIndex(s,e);this.advanceAfterAssetEnded(s,a,h-1)}}setSchedulePosition(e,t){const i=this.schedule.items;if(!i||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const r=e>=0?i[e]:null,s=this.playingItem,a=this.playingLastItem;if(this.isInterstitial(s)){var h;const d=s.event,v=this.playingAsset,S=v==null?void 0:v.identifier,M=S?this.getAssetPlayer(S):null;if(M&&S&&(!this.eventItemsMatch(s,r)||t!==void 0&&S!==((h=d.assetList)==null?void 0:h[t].identifier))){var g;const j=d.findAssetIndex(v);this.log(`INTERSTITIAL_ASSET_ENDED ${j+1}/${d.assetList.length} ${_n(v)}`),this.endedAsset=v,this.playingAsset=null,this.hls.trigger(_.INTERSTITIAL_ASSET_ENDED,{asset:v,assetListIndex:j,event:d,schedule:i.slice(0),scheduleIndex:e,player:M}),this.retreiveMediaSource(S,r),M.media&&!((g=this.detachedData)!=null&&g.mediaSource)&&M.detachMedia()}if(!this.eventItemsMatch(s,r)&&(this.endedItem=s,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${d} ${Mr(s)}`),d.hasPlayed=!0,this.hls.trigger(_.INTERSTITIAL_ENDED,{event:d,schedule:i.slice(0),scheduleIndex:e}),d.cue.once)){this.updateSchedule();const j=this.schedule.items;if(r&&j){const H=this.schedule.findItemIndex(r);this.advanceSchedule(H,j,t,s,a)}return}}this.advanceSchedule(e,i,t,s,a)}advanceSchedule(e,t,i,r,s){const a=e>=0?t[e]:null,h=this.primaryMedia,g=this.playerQueue;if(g.length&&g.forEach(d=>{const v=d.interstitial,S=this.schedule.findEventIndex(v.identifier);(S<e||S>e+1)&&this.clearInterstitial(v,a)}),this.isInterstitial(a)){this.timelinePos=Math.min(Math.max(this.timelinePos,a.start),a.end);const d=a.event;if(i===void 0){i=this.schedule.findAssetIndex(d,this.timelinePos);const j=Ds(d,i-1);if(d.isAssetPastPlayoutLimit(j)){this.advanceAfterAssetEnded(d,e,i);return}i=j}const v=this.waitingItem;this.assetsBuffered(a,h)||this.setBufferingItem(a);let S=this.preloadAssets(d,i);if(this.eventItemsMatch(a,v||r)||(this.waitingItem=a,this.log(`INTERSTITIAL_STARTED ${Mr(a)} ${d.appendInPlace?"append in place":""}`),this.hls.trigger(_.INTERSTITIAL_STARTED,{event:d,schedule:t.slice(0),scheduleIndex:e})),!d.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${d}`);return}if(d.assetListLoader&&(d.assetListLoader.destroy(),d.assetListLoader=void 0),!h){this.log(`Waiting for attachMedia to start Interstitial ${d}`);return}this.waitingItem=this.endedItem=null,this.playingItem=a;const M=d.assetList[i];if(!M){const j=t[e+1],H=this.media;j&&H&&!this.isInterstitial(j)&&H.currentTime<j.start&&(H.currentTime=this.timelinePos=j.start),this.advanceAfterAssetEnded(d,e,i||0);return}if(S||(S=this.getAssetPlayer(M.identifier)),S===null||S.destroyed){const j=d.assetList.length;this.warn(`asset ${i+1}/${j} player destroyed ${d}`),S=this.createAssetPlayer(d,M,i)}if(!this.eventItemsMatch(a,this.bufferingItem)&&d.appendInPlace&&this.isAssetBuffered(M))return;this.startAssetPlayer(S,i,t,e,h),this.shouldPlay&&io(S.media)}else a!==null?(this.resumePrimary(a,e,r),this.shouldPlay&&io(this.hls.media)):s&&this.isInterstitial(r)&&(this.endedItem=null,this.playingItem=r,r.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,i){var r;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Mr(e)}`),!((r=this.detachedData)!=null&&r.mediaSource)){let a=this.timelinePos;(a<e.start||a>=e.end)&&(a=this.getPrimaryResumption(e,t),this.timelinePos=a),this.attachPrimary(a,e)}if(!i)return;const s=this.schedule.items;s&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Mr(e)}`),this.hls.trigger(_.INTERSTITIALS_PRIMARY_RESUMED,{schedule:s.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const i=e.start;if(this.primaryLive){const r=this.primaryDetails;if(t===0)return this.hls.startPosition;if(r&&(i<r.fragmentStart||i>r.edge))return this.hls.liveSyncPosition||-1}return i}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:Rt.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,i){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const r=this.primaryMedia;if(!r)return;const s=this.hls;s.media?this.checkBuffer():(this.transferMediaTo(s,r),i&&this.startLoadingPrimaryAt(e,i)),i||(this.timelinePos=e,this.startLoadingPrimaryAt(e,i))}startLoadingPrimaryAt(e,t){var i;const r=this.hls;!r.loadingEnabled||!r.media||Math.abs((((i=r.mainForwardBufferInfo)==null?void 0:i.start)||r.media.currentTime)-e)>.5?r.startLoad(e,t):r.bufferingEnabled||r.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(_.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(_.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1)return;const i=this.hls.levels[t.level],r=u(u({},this.mediaSelection||this.altSelection),{},{main:i});this.mediaSelection=r,this.schedule.parseInterstitialDateRanges(r,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const i=this.hls.audioTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=u(u({},this.altSelection),{},{audio:i});return}const s=u(u({},r),{},{audio:i});this.mediaSelection=s}onSubtitleTrackUpdated(e,t){const i=this.hls.subtitleTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=u(u({},this.altSelection),{},{subtitles:i});return}const s=u(u({},r),{},{subtitles:i});this.mediaSelection=s}onAudioTrackSwitching(e,t){const i=xi(t);this.playerQueue.forEach(r=>r.hls.setAudioOption(t)||r.hls.setAudioOption(i))}onSubtitleTrackSwitch(e,t){const i=xi(t);this.playerQueue.forEach(r=>r.hls.setSubtitleOption(t)||t.id!==-1&&r.hls.setSubtitleOption(i))}onBufferCodecs(e,t){const i=t.tracks;i&&(this.requiredTracks=i)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const i=this.playingItem;if(i&&!this.itemsMatch(i,this.bufferingItem)&&!this.isInterstitial(i)){const r=this.timelinePos;this.bufferedPos=r,this.checkBuffer()}}onBufferedToEnd(e){const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let r=0;r<t.length;r++){const s=t[r];if(s.cue.post){var i;const a=this.schedule.findEventIndex(s.identifier),h=(i=this.schedule.items)==null?void 0:i[a];this.isInterstitial(h)&&this.eventItemsMatch(h,this.bufferingItem)&&this.bufferedToItem(h,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const i=this.findItemIndex(t);this.setSchedulePosition(i+1)}else this.shouldPlay=!1}updateItem(e,t){const i=this.schedule.items;if(e&&i){const r=this.findItemIndex(e,t);return i[r]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((s,a)=>{e.event.isAssetPastPlayoutLimit(a)&&this.clearAssetPlayer(s.identifier,null)});const i=e.end+.25,r=Rt.bufferInfo(this.primaryMedia,i,0);(r.end>i||(r.nextStart||0)>i)&&(this.attachPrimary(i,null),this.flushFrontBuffer(i))}}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 i;return!!t&&(e===t||e.event.identifier===((i=t.event)==null?void 0:i.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 i=Rt.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=i.len<1),this.updateBufferedPos(i.end,t,e)}updateBufferedPos(e,t,i){const r=this.schedule,s=this.bufferingItem;if(this.bufferedPos>e)return;if(t.length===1&&this.itemsMatch(t[0],s)){this.bufferedPos=e;return}const a=this.playingItem,h=this.findItemIndex(a);let g=r.findItemIndexAtTime(e);if(this.bufferedPos<e){var d,v;const S=this.findItemIndex(s),M=Math.min(S+1,t.length-1),j=t[M];if((g===-1&&s&&e>=s.end||(d=j.event)!=null&&d.appendInPlace&&e+.01>=j.start)&&(g=M),M-h>1&&(s==null||(v=s.event)==null?void 0:v.appendInPlace)===!1)return;if(this.bufferedPos=e,g>S&&g>h)this.bufferedToItem(j);else{const H=this.primaryDetails;this.primaryLive&&H&&e>H.edge-H.targetduration&&j.start<H.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(j)&&this.preloadAssets(j.event,0)}}else i&&a&&!this.itemsMatch(a,s)&&(g===h?this.bufferedToItem(a):g===h+1&&this.bufferedToItem(t[g]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(r=>{const s=this.getAssetPlayer(r.identifier);return!(s!=null&&s.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,i=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:r,events:s}=i;if(!r||!s)return t;const a=this.isInterstitial(e),h=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const g=h?h.remaining:t?t.end-this.timelinePos:0;this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Mr(e)}`+(t?` (${g.toFixed(2)} remaining)`:"")),this.playbackDisabled||(a?e.event.assetList.forEach(d=>{const v=this.getAssetPlayer(d.identifier);v&&v.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(d=>d.pauseBuffering()))),this.hls.trigger(_.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:s.slice(0),schedule:r.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}return t}bufferedToItem(e,t=0){const i=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(i!==null){this.bufferingAsset=null;const r=this.detachedData;r?r.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),i=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(i)}bufferedToEvent(e,t){const i=e.event,r=i.assetList.length===0&&!i.assetListLoader,s=i.cue.once;if(r||!s){const a=this.preloadAssets(i,t);if(a!=null&&a.interstitial.appendInPlace){const h=i.assetList[t],g=this.primaryMedia;h&&g&&this.bufferAssetPlayer(a,g)}}}preloadAssets(e,t){const i=e.assetUrl,r=e.assetList.length,s=r===0&&!e.assetListLoader,a=e.cue.once;if(s){const g=e.timelineStart;if(e.appendInPlace){var h;const M=this.playingItem;!this.isInterstitial(M)&&(M==null||(h=M.nextEvent)==null?void 0:h.identifier)===e.identifier&&this.flushFrontBuffer(g+.25)}let d,v=0;if(!this.playingItem&&this.primaryLive&&(v=this.hls.startPosition,v===-1&&(v=this.hls.liveSyncPosition||0)),v&&!(e.cue.pre||e.cue.post)){const M=v-g;M>0&&(d=Math.round(M*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${i?1:r} ${e}${d?` live-start: ${v} start-offset: ${d}`:""}`),i)return this.createAsset(e,0,0,g,e.duration,i);const S=this.assetListLoader.loadAssetList(e,d);S&&(e.assetListLoader=S)}else if(!a&&r){for(let g=t;g<r;g++){const d=e.assetList[g],v=this.getAssetPlayerQueueIndex(d.identifier);(v===-1||this.playerQueue[v].destroyed)&&!d.error&&this.createAssetPlayer(e,d,g)}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(r=>{this.hls.trigger(_.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:r})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let i=0;i<t.length;i++)if(e===t[i].assetId)return i;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 i=0;i<e.length;i++)if(e[i].media===t)return e[i]}return null}createAsset(e,t,i,r,s,a){const h={parentIdentifier:e.identifier,identifier:Wu(e,a,t),duration:s,startOffset:i,timelineStart:r,uri:a};return this.createAssetPlayer(e,h,t)}createAssetPlayer(e,t,i){const r=this.hls,s=r.userConfig;let a=s.videoPreference;const h=r.loadLevelObj||r.levels[r.currentLevel];(a||h)&&(a=c({},a),h.videoCodec&&(a.videoCodec=h.videoCodec),h.videoRange&&(a.allowedVideoRanges=[h.videoRange]));const g=r.audioTracks[r.audioTrack],d=r.subtitleTracks[r.subtitleTrack];let v=0;if(this.primaryLive||e.appendInPlace){const le=this.timelinePos-t.timelineStart;if(le>1){const be=t.duration;be&&le<be&&(v=le)}}const S=t.identifier,M=u(u({},s),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:r.sessionId,assetPlayerId:S,abrEwmaDefaultEstimate:r.bandwidthEstimate,interstitialsController:void 0,startPosition:v,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:a,audioPreference:g||s.audioPreference,subtitlePreference:d||s.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(M.timelineOffset=t.timelineStart));const j=M.cmcd;j!=null&&j.sessionId&&j.contentId&&(M.cmcd=c({},j,{contentId:Pn(t.uri)})),this.getAssetPlayer(S)&&this.warn(`Duplicate date range identifier ${e} and asset ${S}`);const H=new zu(this.HlsPlayerClass,M,e,t);this.playerQueue.push(H),e.assetList[i]=t;const Q=le=>{if(le.live){const $e=new Error(`Interstitials MUST be VOD assets ${e}`),Ae={fatal:!0,type:T.OTHER_ERROR,details:w.INTERSTITIAL_ASSET_ITEM_ERROR,error:$e};this.handleAssetItemError(Ae,e,this.schedule.findEventIndex(e.identifier),i,$e.message);return}const be=le.edge-le.fragmentStart,we=t.duration;(we===null||be>we)&&(this.log(`Interstitial asset "${S}" duration change ${we} > ${be}`),t.duration=be,this.updateSchedule())};H.on(_.LEVEL_UPDATED,(le,{details:be})=>Q(be)),H.on(_.LEVEL_PTS_UPDATED,(le,{details:be})=>Q(be));const Z=(le,be)=>{const we=this.getAssetPlayer(S);if(we&&be.tracks){we.off(_.BUFFER_CODECS,Z),we.tracks=be.tracks;const $e=this.primaryMedia;this.bufferingAsset===we.assetItem&&$e&&!we.media&&this.bufferAssetPlayer(we,$e)}};H.on(_.BUFFER_CODECS,Z);const re=()=>{var le;const be=this.getAssetPlayer(S);if(this.log(`buffered to end of asset ${be}`),!be)return;const we=this.schedule.findEventIndex(e.identifier),$e=(le=this.schedule.items)==null?void 0:le[we];if(this.isInterstitial($e)){const Pe=e.findAssetIndex(t),Ue=Ds(e,Pe);if(!e.isAssetPastPlayoutLimit(Ue))this.bufferedToItem($e,Ue);else{var Ae;const De=(Ae=this.schedule.items)==null?void 0:Ae[we+1];De&&this.bufferedToItem(De)}}};H.on(_.BUFFERED_TO_END,re);const fe=le=>()=>{if(!this.getAssetPlayer(S))return;this.shouldPlay=!0;const we=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,we,le)};return H.once(_.MEDIA_ENDED,fe(i)),H.once(_.PLAYOUT_LIMIT_REACHED,fe(1/0)),H.on(_.ERROR,(le,be)=>{const we=this.getAssetPlayer(S);if(be.details===w.BUFFER_STALLED_ERROR){if(we!=null&&we.media){const $e=we.currentTime,Ae=we.duration-$e;$e&&e.appendInPlace&&Ae/we.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${S} ${e} at ${we.media.currentTime}`),re()):(this.warn(`Stalled at ${$e} of ${$e+Ae} in asset ${S} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError(be,e,this.schedule.findEventIndex(e.identifier),i,`Asset player error ${be.error} ${e}`)}),H.on(_.DESTROYING,()=>{if(!this.getAssetPlayer(S))return;const be=new Error(`Asset player destroyed unexpectedly ${S}`),we={fatal:!0,type:T.OTHER_ERROR,details:w.INTERSTITIAL_ASSET_ITEM_ERROR,error:be};this.handleAssetItemError(we,e,this.schedule.findEventIndex(e.identifier),i,be.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${_n(t)}`),this.hls.trigger(_.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:i,event:e,player:H}),H}clearInterstitial(e,t){e.assetList.forEach(i=>{this.clearAssetPlayer(i.identifier,t)}),e.reset()}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const i=this.playerQueue[t];this.transferMediaFromPlayer(i,null),i.resetDetails()}}clearAssetPlayer(e,t){const i=this.getAssetPlayerQueueIndex(e);if(i!==-1){this.log(`clear asset player "${e}" toSegment: ${t&&Mr(t)}`);const r=this.playerQueue[i];this.transferMediaFromPlayer(r,t),this.playerQueue.splice(i,1),r.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,i,r,s){const{interstitial:a,assetItem:h,assetId:g}=e,d=a.assetList.length,v=this.playingAsset;this.endedAsset=null,this.playingAsset=h,(!v||v.identifier!==g)&&(v&&(this.clearAssetPlayer(v.identifier,i[r]),delete v.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${d} ${_n(h)}`),this.hls.trigger(_.INTERSTITIAL_ASSET_STARTED,{asset:h,assetListIndex:t,event:a,schedule:i.slice(0),scheduleIndex:r,player:e})),this.bufferAssetPlayer(e,s)}bufferAssetPlayer(e,t){var i,r;const{interstitial:s,assetItem:a}=e,h=this.schedule.findEventIndex(s.identifier),g=(i=this.schedule.items)==null?void 0:i[h];if(!g)return;this.setBufferingItem(g),this.bufferingAsset=a;const d=this.getBufferingPlayer();if(d===e)return;const v=s.appendInPlace;if(v&&(d==null?void 0:d.interstitial.appendInPlace)===!1)return;const S=(d==null?void 0:d.tracks)||((r=this.detachedData)==null?void 0:r.tracks)||this.requiredTracks;if(v&&a!==this.playingAsset){if(!e.tracks)return;if(S&&!ne(S,e.tracks)){const M=new Error(`Asset ${_n(a)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(S)}')`),j={fatal:!0,type:T.OTHER_ERROR,details:w.INTERSTITIAL_ASSET_ITEM_ERROR,error:M},H=s.findAssetIndex(a);this.handleAssetItemError(j,s,h,H,M.message);return}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,i,r,s){if(e.details===w.BUFFER_STALLED_ERROR)return;const a=t.assetList[r];this.warn(`INTERSTITIAL_ASSET_ERROR ${a&&_n(a)} ${e.error}`);const h=a==null?void 0:a.identifier,g=this.getAssetPlayerQueueIndex(h),d=this.playerQueue[g]||null,v=this.schedule.items,S=c({},e,{fatal:!1,errorAction:Sr(!0),asset:a,assetListIndex:r,event:t,schedule:v,scheduleIndex:i,player:d});if(this.hls.trigger(_.INTERSTITIAL_ASSET_ERROR,S),!e.fatal)return;const M=this.playingAsset,j=new Error(s);if(a&&(this.clearAssetPlayer(h,null),a.error=j),!t.assetList.some(H=>!H.error))t.error=j;else if(t.appendInPlace){for(let H=r;H<t.assetList.length;H++)this.resetAssetPlayer(t.assetList[H].identifier);this.updateSchedule()}t.error?this.primaryFallback(t):M&&M.identifier===h&&this.advanceAfterAssetEnded(t,i,r)}primaryFallback(e){const t=e.timelineStart,i=this.effectivePlayingItem;if(this.updateSchedule(),i){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${i?Mr(i):"<none>"} error: ${e.error}`);let r=this.timelinePos;r===-1&&(r=this.hls.startPosition);const s=this.updateItem(i,r);this.itemsMatch(i,s)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));const a=this.schedule.findItemIndexAtTime(r);this.setSchedulePosition(a)}else this.checkStart()}onAssetListLoaded(e,t){var i;const r=t.event,s=r.identifier,a=t.assetListResponse.ASSETS;if(!this.schedule.hasEvent(s))return;const h=r.timelineStart,g=r.duration;let d=0;a.forEach((H,Q)=>{const Z=parseFloat(H.DURATION);this.createAsset(r,Q,d,h+d,Z,H.URI),d+=Z}),r.duration=d,this.log(`Loaded asset-list with duration: ${d} (was: ${g}) ${r}`);const v=this.waitingItem,S=(v==null?void 0:v.event.identifier)===s;this.updateSchedule();const M=(i=this.bufferingItem)==null?void 0:i.event;if(S){var j;const H=this.schedule.findEventIndex(s),Q=(j=this.schedule.items)==null?void 0:j[H];if(Q){if(!this.playingItem&&this.timelinePos>Q.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==H){r.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${r}`),this.primaryFallback(r);return}this.setBufferingItem(Q)}this.setSchedulePosition(H)}else if((M==null?void 0:M.identifier)===s&&M.appendInPlace){const H=r.assetList[0],Q=this.getAssetPlayer(H.identifier),Z=this.primaryMedia;H&&Q&&Z&&this.bufferAssetPlayer(Q,Z)}}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 i=t.interstitial;i&&this.primaryFallback(i);break}case w.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const ro=500;class Zu extends ns{constructor(e,t,i){super(e,t,i,"subtitle-stream-controller",m.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(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(_.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(_.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(_.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(_.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=Ke.IDLE,this.setInterval(ro),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:i,success:r}=t;if(te(i)&&(this.fragPrevious=i),this.state=Ke.IDLE,!r)return;const s=this.tracksBuffered[this.currentTrackId];if(!s)return;let a;const h=i.start;for(let d=0;d<s.length;d++)if(h>=s[d].start&&h<=s[d].end){a=s[d];break}const g=i.start+i.duration;a?a.end=g:(a={start:h,end:g},s.push(a)),this.fragmentTracker.fragBuffered(i),this.fragBufferedComplete(i,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:i,endOffset:r}=t;if(i===0&&r!==Number.POSITIVE_INFINITY){const s=r-1;if(s<=0)return;t.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach(a=>{for(let h=0;h<a.length;){if(a[h].end<=s){a.shift();continue}else if(a[h].start<s)a[h].start=s;else break;h++}}),this.fragmentTracker.removeFragmentsInRange(i,s,m.SUBTITLE)}}onError(e,t){const i=t.frag;(i==null?void 0:i.type)===m.SUBTITLE&&(t.details===w.FRAG_GAP&&this.fragmentTracker.fragBuffered(i,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Ke.STOPPED&&(this.state=Ke.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&Na(this.levels,t)){this.levels=t.map(i=>new Mi(i));return}this.tracksBuffered=[],this.levels=t.map(i=>{const r=new Mi(i);return this.tracksBuffered[r.id]=[],r}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,m.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var i;if(this.currentTrackId=t.id,!((i=this.levels)!=null&&i.length)||this.currentTrackId===-1){this.clearInterval();return}const r=this.levels[this.currentTrackId];r!=null&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.state!==Ke.STOPPED&&this.setInterval(ro)}onSubtitleTrackLoaded(e,t){var i;const{currentTrackId:r,levels:s}=this,{details:a,id:h}=t;if(!s){this.warn(`Subtitle tracks were reset while loading level ${h}`);return}const g=s[h];if(h>=s.length||!g)return;this.log(`Subtitle track ${h} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""},duration:${a.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let d=0;if(a.live||(i=g.details)!=null&&i.live){const S=this.mainDetails;if(a.deltaUpdateFailed||!S)return;const M=S.fragments[0];if(!g.details)a.hasProgramDateTime&&S.hasProgramDateTime?(Mn(a,S),d=a.fragmentStart):M&&(d=M.start,rs(a,d));else{var v;d=this.alignPlaylists(a,g.details,(v=this.levelLastLoaded)==null?void 0:v.details),d===0&&M&&(d=M.start,rs(a,d))}}g.details=a,this.levelLastLoaded=g,h===r&&(this.hls.trigger(_.SUBTITLE_TRACK_UPDATED,{details:a,id:h,groupId:t.groupId}),this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===Ke.IDLE&&(ni(null,a.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:i}=e,r=t.decryptdata,s=this.hls;if(!this.fragContextChanged(t)&&i&&i.byteLength>0&&r!=null&&r.key&&r.iv&&ur(r.method)){const a=performance.now();this.decrypter.decrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer,Gr(r.method)).catch(h=>{throw s.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.FRAG_DECRYPT_ERROR,fatal:!1,error:h,reason:h.message,frag:t}),h}).then(h=>{const g=performance.now();s.trigger(_.FRAG_DECRYPTED,{frag:t,payload:h,stats:{tstart:a,tdecrypt:g}})}).catch(h=>{this.warn(`${h.name}: ${h.message}`),this.state=Ke.IDLE})}}doTick(){if(!this.media){this.state=Ke.IDLE;return}if(this.state===Ke.IDLE){const{currentTrackId:e,levels:t}=this,i=t==null?void 0:t[e];if(!i||!t.length||!i.details||this.waitForLive(i))return;const{config:r}=this,s=this.getLoadPosition(),a=Rt.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],s,r.maxBufferHole),{end:h,len:g}=a,d=i.details,v=this.hls.maxBufferLength+d.levelTargetDuration;if(g>v)return;const S=d.fragments,M=S.length,j=d.edge;let H=null;const Q=this.fragPrevious;if(h<j){const fe=r.maxFragLookUpTolerance,le=h>j-fe?0:fe;H=ni(Q,S,Math.max(S[0].start,h),le),!H&&Q&&Q.start<S[0].start&&(H=S[0])}else H=S[M-1];if(H=this.filterReplacedPrimary(H,i.details),!H)return;const Z=H.sn-d.startSN,re=S[Z-1];if(re&&re.cc===H.cc&&this.fragmentTracker.getState(re)===di.NOT_LOADED&&(H=re),this.fragmentTracker.getState(H)===di.NOT_LOADED){const fe=this.mapToInitFragWhenRequired(H);fe&&this.loadFragment(fe,i,h)}}}loadFragment(e,t,i){te(e)?super.loadFragment(e,t,i):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Xu(this.tracksBuffered[this.currentTrackId]||[])}}class Xu{constructor(e){this.buffered=void 0;const t=(i,r,s)=>{if(r=r>>>0,r>s-1)throw new DOMException(`Failed to execute '${i}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${s})`);return e[r][i]};this.buffered={get length(){return e.length},end(i){return t("end",i,e.length)},start(i){return t("start",i,e.length)}}}}const Qu={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},no=o=>String.fromCharCode(Qu[o]||o),cr=15,Rr=100,Ju={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},ic={25:2,26:4,29:6,30:8,31:10,27:13,28:15},rc=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class nc{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const i=typeof t=="function"?t():t;F.log(`${this.time} [${e}] ${i}`)}}}const Yr=function(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].toString(16));return t};class so{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let i=0;i<t.length;i++){const r=t[i];e.hasOwnProperty(r)&&(this[r]=e[r])}}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 so}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class ac{constructor(e){this.chars=[],this.pos=0,this.currPenState=new so,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Rr;t++)this.chars.push(new sc);this.logger=e}equals(e){for(let t=0;t<Rr;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Rr;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Rr;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>Rr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Rr)}moveCursor(e){const t=this.pos+e;if(e>1)for(let i=this.pos+1;i<t+1;i++)this.chars[i].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=no(e);if(this.pos>=Rr){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<Rr;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 i=0;i<Rr;i++){const r=this.chars[i].uchar;r!==" "&&(t=!1),e.push(r)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Ls{constructor(e){this.rows=[],this.currRow=cr-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<cr;t++)this.rows.push(new ac(e));this.logger=e}reset(){for(let e=0;e<cr;e++)this.rows[e].clear();this.currRow=cr-1}equals(e){let t=!0;for(let i=0;i<cr;i++)if(!this.rows[i].equals(e.rows[i])){t=!1;break}return t}copy(e){for(let t=0;t<cr;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<cr;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 = "+yt(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let h=0;h<cr;h++)this.rows[h].clear();const s=this.currRow+1-this.nrRollUpRows,a=this.lastOutputScreen;if(a){const h=a.rows[s].cueStartTime,g=this.logger.time;if(h!==null&&g!==null&&h<g)for(let d=0;d<this.nrRollUpRows;d++)this.rows[t-this.nrRollUpRows+d+1].copy(a.rows[s+d])}}this.currRow=t;const i=this.rows[this.currRow];if(e.indent!==null){const s=e.indent,a=Math.max(s-1,0);i.setCursor(e.indent),e.color=i.chars[a].penState.foreground}const r={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+yt(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 i="",r=-1;for(let s=0;s<cr;s++){const a=this.rows[s].getTextString();a&&(r=s+1,e?t.push("Row "+r+": '"+a+"'"):t.push(a.trim()))}return t.length>0&&(e?i="["+t.join(" | ")+"]":i=t.join(`
|
|
|
`)),i}getTextAndFormat(){return this.rows}}class ao{constructor(e,t,i){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 Ls(i),this.nonDisplayedMemory=new Ls(i),this.lastOutputScreen=new Ls(i),this.currRollUpRow=this.displayedMemory.rows[cr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[cr-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 i=0;i<e.length;i++)this.writeScreen.insertChar(e[i]);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 i=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[i]}this.logger.log(2,"MIDROW: "+yt(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 oo{constructor(e,t,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory=lc(),this.logger=void 0;const r=this.logger=new nc;this.channels=[null,new ao(e,t,r),new ao(e+1,i,r)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let i=0;i<t.length;i+=2){const r=t[i]&127,s=t[i+1]&127;let a=!1,h=null;if(r===0&&s===0)continue;this.logger.log(3,()=>"["+Yr([t[i],t[i+1]])+"] -> ("+Yr([r,s])+")");const g=this.cmdHistory;if(r>=16&&r<=31){if(oc(r,s,g)){qn(null,null,g),this.logger.log(3,()=>"Repeated command ("+Yr([r,s])+") is dropped");continue}qn(r,s,this.cmdHistory),a=this.parseCmd(r,s),a||(a=this.parseMidrow(r,s)),a||(a=this.parsePAC(r,s)),a||(a=this.parseBackgroundAttributes(r,s))}else qn(null,null,g);if(!a&&(h=this.parseChars(r,s),h)){const v=this.currentChannel;v&&v>0?this.channels[v].insertChars(h):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!a&&!h&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Yr([r,s])+" orig: "+Yr([t[i],t[i+1]]))}}parseCmd(e,t){const i=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=33&&t<=35;if(!(i||r))return!1;const s=e===20||e===21||e===23?1:2,a=this.channels[s];return e===20||e===21||e===28||e===29?t===32?a.ccRCL():t===33?a.ccBS():t===34?a.ccAOF():t===35?a.ccAON():t===36?a.ccDER():t===37?a.ccRU(2):t===38?a.ccRU(3):t===39?a.ccRU(4):t===40?a.ccFON():t===41?a.ccRDC():t===42?a.ccTR():t===43?a.ccRTD():t===44?a.ccEDM():t===45?a.ccCR():t===46?a.ccENM():t===47&&a.ccEOC():a.ccTO(t-32),this.currentChannel=s,!0}parseMidrow(e,t){let i=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?i=1:i=2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[i];return r?(r.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Yr([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let i;const r=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,s=(e===16||e===24)&&t>=64&&t<=95;if(!(r||s))return!1;const a=e<=23?1:2;t>=64&&t<=95?i=a===1?Ju[e]:tc[e]:i=a===1?ec[e]:ic[e];const h=this.channels[a];return h?(h.setPAC(this.interpretPAC(i,t)),this.currentChannel=a,!0):!1}interpretPAC(e,t){let i;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?i=t-96:i=t-64,r.underline=(i&1)===1,i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=Math.floor((i-16)/2)*4,r}parseChars(e,t){let i,r=null,s=null;if(e>=25?(i=2,s=e-8):(i=1,s=e),s>=17&&s<=19){let a;s===17?a=t+80:s===18?a=t+112:a=t+144,this.logger.log(2,()=>"Special char '"+no(a)+"' in channel "+i),r=[a]}else e>=32&&e<=127&&(r=t===0?[e]:[e,t]);return r&&this.logger.log(3,()=>"Char codes = "+Yr(r).join(",")),r}parseBackgroundAttributes(e,t){const i=(e===16||e===24)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=45&&t<=47;if(!(i||r))return!1;let s;const a={};e===16||e===24?(s=Math.floor((t-32)/2),a.background=rc[s],t%2===1&&(a.background=a.background+"_semi")):t===45?a.background="transparent":(a.foreground="black",t===47&&(a.underline=!0));const h=e<=23?1:2;return this.channels[h].setBkgData(a),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}qn(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const i=this.channels[t];i&&i.cueSplitAtTime(e)}}}function qn(o,e,t){t.a=o,t.b=e}function oc(o,e,t){return t.a===o&&t.b===e}function lc(){return{a:null,b:null}}var Rs=function(){if(ki!=null&&ki.VTTCue)return self.VTTCue;const o=["","lr","rl"],e=["start","middle","end","left","right"];function t(h,g){if(typeof g!="string"||!Array.isArray(h))return!1;const d=g.toLowerCase();return~h.indexOf(d)?d:!1}function i(h){return t(o,h)}function r(h){return t(e,h)}function s(h,...g){let d=1;for(;d<arguments.length;d++){const v=arguments[d];for(const S in v)h[S]=v[S]}return h}function a(h,g,d){const v=this,S={enumerable:!0};v.hasBeenReset=!1;let M="",j=!1,H=h,Q=g,Z=d,re=null,fe="",le=!0,be="auto",we="start",$e=50,Ae="middle",Pe=50,Ue="middle";Object.defineProperty(v,"id",s({},S,{get:function(){return M},set:function(De){M=""+De}})),Object.defineProperty(v,"pauseOnExit",s({},S,{get:function(){return j},set:function(De){j=!!De}})),Object.defineProperty(v,"startTime",s({},S,{get:function(){return H},set:function(De){if(typeof De!="number")throw new TypeError("Start time must be set to a number.");H=De,this.hasBeenReset=!0}})),Object.defineProperty(v,"endTime",s({},S,{get:function(){return Q},set:function(De){if(typeof De!="number")throw new TypeError("End time must be set to a number.");Q=De,this.hasBeenReset=!0}})),Object.defineProperty(v,"text",s({},S,{get:function(){return Z},set:function(De){Z=""+De,this.hasBeenReset=!0}})),Object.defineProperty(v,"region",s({},S,{get:function(){return re},set:function(De){re=De,this.hasBeenReset=!0}})),Object.defineProperty(v,"vertical",s({},S,{get:function(){return fe},set:function(De){const Xe=i(De);if(Xe===!1)throw new SyntaxError("An invalid or illegal string was specified.");fe=Xe,this.hasBeenReset=!0}})),Object.defineProperty(v,"snapToLines",s({},S,{get:function(){return le},set:function(De){le=!!De,this.hasBeenReset=!0}})),Object.defineProperty(v,"line",s({},S,{get:function(){return be},set:function(De){if(typeof De!="number"&&De!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");be=De,this.hasBeenReset=!0}})),Object.defineProperty(v,"lineAlign",s({},S,{get:function(){return we},set:function(De){const Xe=r(De);if(!Xe)throw new SyntaxError("An invalid or illegal string was specified.");we=Xe,this.hasBeenReset=!0}})),Object.defineProperty(v,"position",s({},S,{get:function(){return $e},set:function(De){if(De<0||De>100)throw new Error("Position must be between 0 and 100.");$e=De,this.hasBeenReset=!0}})),Object.defineProperty(v,"positionAlign",s({},S,{get:function(){return Ae},set:function(De){const Xe=r(De);if(!Xe)throw new SyntaxError("An invalid or illegal string was specified.");Ae=Xe,this.hasBeenReset=!0}})),Object.defineProperty(v,"size",s({},S,{get:function(){return Pe},set:function(De){if(De<0||De>100)throw new Error("Size must be between 0 and 100.");Pe=De,this.hasBeenReset=!0}})),Object.defineProperty(v,"align",s({},S,{get:function(){return Ue},set:function(De){const Xe=r(De);if(!Xe)throw new SyntaxError("An invalid or illegal string was specified.");Ue=Xe,this.hasBeenReset=!0}})),v.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}();class uc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function lo(o){function e(i,r,s,a){return(i|0)*3600+(r|0)*60+(s|0)+parseFloat(a||0)}const t=o.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,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,i){for(let r=0;r<i.length;++r)if(t===i[r]){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 i=parseFloat(t);if(i>=0&&i<=100)return this.set(e,i),!0}return!1}}function uo(o,e,t,i){const r=i?o.split(i):[o];for(const s in r){if(typeof r[s]!="string")continue;const a=r[s].split(t);if(a.length!==2)continue;const h=a[0],g=a[1];e(h,g)}}const ks=new Rs(0,0,""),Yn=ks.align==="middle"?"middle":"center";function hc(o,e,t){const i=o;function r(){const h=lo(o);if(h===null)throw new Error("Malformed timestamp: "+i);return o=o.replace(/^[^\sa-zA-Z-]+/,""),h}function s(h,g){const d=new cc;uo(h,function(M,j){let H;switch(M){case"region":for(let Q=t.length-1;Q>=0;Q--)if(t[Q].id===j){d.set(M,t[Q].region);break}break;case"vertical":d.alt(M,j,["rl","lr"]);break;case"line":H=j.split(","),d.integer(M,H[0]),d.percent(M,H[0])&&d.set("snapToLines",!1),d.alt(M,H[0],["auto"]),H.length===2&&d.alt("lineAlign",H[1],["start",Yn,"end"]);break;case"position":H=j.split(","),d.percent(M,H[0]),H.length===2&&d.alt("positionAlign",H[1],["start",Yn,"end","line-left","line-right","auto"]);break;case"size":d.percent(M,j);break;case"align":d.alt(M,j,["start",Yn,"end","left","right"]);break}},/:/,/\s/),g.region=d.get("region",null),g.vertical=d.get("vertical","");let v=d.get("line","auto");v==="auto"&&ks.line===-1&&(v=-1),g.line=v,g.lineAlign=d.get("lineAlign","start"),g.snapToLines=d.get("snapToLines",!0),g.size=d.get("size",100),g.align=d.get("align",Yn);let S=d.get("position","auto");S==="auto"&&ks.position===50&&(S=g.align==="start"||g.align==="left"?0:g.align==="end"||g.align==="right"?100:50),g.position=S}function a(){o=o.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),o.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);o=o.slice(3),a(),e.endTime=r(),a(),s(o,e)}function co(o){return o.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}class fc{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 i(){let s=t.buffer,a=0;for(s=co(s);a<s.length&&s[a]!=="\r"&&s[a]!==`
|
|
|
`;)++a;const h=s.slice(0,a);return s[a]==="\r"&&++a,s[a]===`
|
|
|
`&&++a,t.buffer=s.slice(a),h}function r(s){uo(s,function(a,h){},/:/)}try{let s="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;s=i();const h=s.match(/^()?WEBVTT([ \t].*)?$/);if(!(h!=null&&h[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let a=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(a?a=!1:s=i(),t.state){case"HEADER":/:/.test(s)?r(s):s||(t.state="ID");continue;case"NOTE":s||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(s)){t.state="NOTE";break}if(!s)continue;if(t.cue=new Rs(0,0,""),t.state="CUE",s.indexOf("-->")===-1){t.cue.id=s;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{hc(s,t.cue,t.regionList)}catch(h){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const h=s.indexOf("-->")!==-1;if(!s||h&&(a=!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+=s}continue;case"BADCUE":s||(t.state="ID")}}}catch(s){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,Is=function(e,t,i=0){return e.slice(i,i+t.length)===t},pc=function(e){let t=parseInt(e.slice(-3));const i=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),s=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!k(t)||!k(i)||!k(r)||!k(s))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*i,t+=60*1e3*r,t+=60*60*1e3*s,t};function Ps(o,e,t){return Pn(o.toString())+Pn(e.toString())+Pn(t)}const _c=function(e,t,i){let r=e[t],s=e[r.prevCC];if(!s||!s.new&&r.new){e.ccOffset=e.presentationOffset=r.start,r.new=!1;return}for(;(a=s)!=null&&a.new;){var a;e.ccOffset+=r.start-s.start,r.new=!1,r=s,s=e[r.prevCC]}e.presentationOffset=i};function gc(o,e,t,i,r,s,a){const h=new fc,g=oe(new Uint8Array(o)).trim().replace(dc,`
|
|
|
`).split(`
|
|
|
`),d=[],v=e?Bl(e.baseTime,e.timescale):0;let S="00:00.000",M=0,j=0,H,Q=!0;h.oncue=function(Z){const re=t[i];let fe=t.ccOffset;const le=(M-v)/9e4;if(re!=null&&re.new&&(j!==void 0?fe=t.ccOffset=re.start:_c(t,i,le)),le){if(!e){H=new Error("Missing initPTS for VTT MPEGTS");return}fe=le-t.presentationOffset}const be=Z.endTime-Z.startTime,we=er((Z.startTime+fe-j)*9e4,r*9e4)/9e4;Z.startTime=Math.max(we,0),Z.endTime=Math.max(we+be,0);const $e=Z.text.trim();Z.text=decodeURIComponent(encodeURIComponent($e)),Z.id||(Z.id=Ps(Z.startTime,Z.endTime,$e)),Z.endTime>0&&d.push(Z)},h.onparsingerror=function(Z){H=Z},h.onflush=function(){if(H){a(H);return}s(d)},g.forEach(Z=>{if(Q)if(Is(Z,"X-TIMESTAMP-MAP=")){Q=!1,Z.slice(16).split(",").forEach(re=>{Is(re,"LOCAL:")?S=re.slice(6):Is(re,"MPEGTS:")&&(M=parseInt(re.slice(7)))});try{j=pc(S)/1e3}catch(re){H=re}return}else Z===""&&(Q=!1);h.parse(Z+`
|
|
|
`)}),h.flush()}const Os="stpp.ttml.im1t",ho=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,fo=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,mc={left:"start",center:"center",right:"end",start:"start",end:"end"};function po(o,e,t,i){const r=he(new Uint8Array(o),["mdat"]);if(r.length===0){i(new Error("Could not parse IMSC1 mdat"));return}const s=r.map(h=>oe(h)),a=Ml(e.baseTime,1,e.timescale);try{s.forEach(h=>t(vc(h,a)))}catch(h){i(h)}}function vc(o,e){const r=new DOMParser().parseFromString(o,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const s={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(s).reduce((S,M)=>(S[M]=r.getAttribute(`ttp:${M}`)||s[M],S),{}),h=r.getAttribute("xml:space")!=="preserve",g=_o(Fs(r,"styling","style")),d=_o(Fs(r,"layout","region")),v=Fs(r,"body","[begin]");return[].map.call(v,S=>{const M=go(S,h);if(!M||!S.hasAttribute("begin"))return null;const j=Bs(S.getAttribute("begin"),a),H=Bs(S.getAttribute("dur"),a);let Q=Bs(S.getAttribute("end"),a);if(j===null)throw mo(S);if(Q===null){if(H===null)throw mo(S);Q=j+H}const Z=new Rs(j-e,Q-e,M);Z.id=Ps(Z.startTime,Z.endTime,Z.text);const re=d[S.getAttribute("region")],fe=g[S.getAttribute("style")],le=yc(re,fe,g),{textAlign:be}=le;if(be){const we=mc[be];we&&(Z.lineAlign=we),Z.align=be}return c(Z,le),Z}).filter(S=>S!==null)}function Fs(o,e,t){const i=o.getElementsByTagName(e)[0];return i?[].slice.call(i.querySelectorAll(t)):[]}function _o(o){return o.reduce((e,t)=>{const i=t.getAttribute("xml:id");return i&&(e[i]=t),e},{})}function go(o,e){return[].slice.call(o.childNodes).reduce((t,i,r)=>{var s;return i.nodeName==="br"&&r?t+`
|
|
|
`:(s=i.childNodes)!=null&&s.length?go(i,e):e?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent},"")}function yc(o,e,t){const i="http://www.w3.org/ns/ttml#styling";let r=null;const s=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=o!=null&&o.hasAttribute("style")?o.getAttribute("style"):null;return a&&t.hasOwnProperty(a)&&(r=t[a]),s.reduce((h,g)=>{const d=Ms(e,i,g)||Ms(o,i,g)||Ms(r,i,g);return d&&(h[g]=d),h},{})}function Ms(o,e,t){return o&&o.hasAttributeNS(e,t)?o.getAttributeNS(e,t):null}function mo(o){return new Error(`Could not parse ttml timestamp ${o}`)}function Bs(o,e){if(!o)return null;let t=lo(o);return t===null&&(ho.test(o)?t=bc(o,e):fo.test(o)&&(t=Ec(o,e))),t}function bc(o,e){const t=ho.exec(o),i=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+i/e.frameRate}function Ec(o,e){const t=fo.exec(o),i=Number(t[1]);switch(t[2]){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/e.frameRate;case"t":return i/e.tickRate}return i}class Zn{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,i){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class Sc{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=bo(),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(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(_.FRAG_LOADING,this.onFragLoading,this),e.on(_.FRAG_LOADED,this.onFragLoaded,this),e.on(_.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(_.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(_.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(_.FRAG_LOADING,this.onFragLoading,this),e.off(_.FRAG_LOADED,this.onFragLoaded,this),e.off(_.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(_.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(_.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(_.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Zn(this,"textTrack1"),t=new Zn(this,"textTrack2"),i=new Zn(this,"textTrack3"),r=new Zn(this,"textTrack4");this.cea608Parser1=new oo(1,e,t),this.cea608Parser2=new oo(3,i,r)}addCues(e,t,i,r,s){let a=!1;for(let h=s.length;h--;){const g=s[h],d=xc(g[0],g[1],t,i);if(d>=0&&(g[0]=Math.min(g[0],t),g[1]=Math.max(g[1],i),a=!0,d/(i-t)>.5))return}if(a||s.push([t,i]),this.config.renderTextTracksNatively){const h=this.captionsTracks[e];this.Cues.newCue(h,t,i,r)}else{const h=this.Cues.newCue(null,t,i,r);this.hls.trigger(_.CUES_PARSED,{type:"captions",cues:h,track:e})}}onInitPtsFound(e,{frag:t,id:i,initPTS:r,timescale:s}){const{unparsedVttFrags:a}=this;i===m.MAIN&&(this.initPTS[t.cc]={baseTime:r,timescale:s}),a.length&&(this.unparsedVttFrags=[],a.forEach(h=>{this.onFragLoaded(_.FRAG_LOADED,h)}))}getExistingTrack(e,t){const{media:i}=this;if(i)for(let r=0;r<i.textTracks.length;r++){const s=i.textTracks[r];if(yo(s,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return s}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:i,media:r}=this,{label:s,languageCode:a}=t[e],h=this.getExistingTrack(s,a);if(h)i[e]=h,dn(i[e]),Qa(i[e],r);else{const g=this.createTextTrack("captions",s,a);g&&(g[e]=!0,i[e]=g)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const i=t.label,r={_id:e,label:i,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=r,this.hls.trigger(_.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}createTextTrack(e,t,i){const r=this.media;if(r)return r.addTextTrack(e,t,i)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const i=!!t.transferMedia;if(this.media=null,i)return;const{captionsTracks:r}=this;Object.keys(r).forEach(s=>{dn(r[s]),delete r[s]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=bo(),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 i=0;i<t.length;i++)dn(t[i])}onSubtitleTracksUpdated(e,t){const i=t.subtitleTracks||[],r=i.some(s=>s.textCodec===Os);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(Na(this.tracks,i)){this.tracks=i;return}if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const a=this.media,h=a?zn(a.textTracks):null;if(this.tracks.forEach((g,d)=>{let v;if(h){let S=null;for(let M=0;M<h.length;M++)if(h[M]&&yo(h[M],g)){S=h[M],h[M]=null;break}S&&(v=S)}if(v)dn(v);else{const S=vo(g);v=this.createTextTrack(S,g.name,g.lang),v&&(v.mode="disabled")}v&&this.textTracks.push(v)}),h!=null&&h.length){const g=h.filter(d=>d!==null).map(d=>d.label);g.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${g.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const a=this.tracks.map(h=>({label:h.name,kind:h.type.toLowerCase(),default:h.default,subtitleTrack:h}));this.hls.trigger(_.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:a})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(i=>{const r=/(?:CC|SERVICE)([1-4])/.exec(i.instreamId);if(!r)return;const s=`textTrack${r[1]}`,a=this.captionsProperties[s];a&&(a.label=i.name,i.lang&&(a.languageCode=i.lang),a.media=i)})}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===m.MAIN){var i,r;const{cea608Parser1:s,cea608Parser2:a,lastSn:h}=this,{cc:g,sn:d}=t.frag,v=(i=(r=t.part)==null?void 0:r.index)!=null?i:-1;s&&a&&(d!==h+1||d===h&&v!==this.lastPartIndex+1||g!==this.lastCc)&&(s.reset(),a.reset()),this.lastCc=g,this.lastSn=d,this.lastPartIndex=v}}onFragLoaded(e,t){const{frag:i,payload:r}=t;if(i.type===m.SUBTITLE)if(r.byteLength){const s=i.decryptdata,a="stats"in t;if(s==null||!s.encrypted||a){const h=this.tracks[i.level],g=this.vttCCs;g[i.cc]||(g[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),h&&h.textCodec===Os?this._parseIMSC1(i,r):this._parseVTTs(t)}}else this.hls.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const i=this.hls;po(t,this.initPTS[e.cc],r=>{this._appendCues(r,e.level),i.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},r=>{i.logger.log(`Failed to parse IMSC1: ${r}`),i.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:r})})}_parseVTTs(e){var t;const{frag:i,payload:r}=e,{initPTS:s,unparsedVttFrags:a}=this,h=s.length-1;if(!s[i.cc]&&h===-1){a.push(e);return}const g=this.hls,d=(t=i.initSegment)!=null&&t.data?je(i.initSegment.data,new Uint8Array(r)).buffer:r;gc(d,this.initPTS[i.cc],this.vttCCs,i.cc,i.start,v=>{this._appendCues(v,i.level),g.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},v=>{const S=v.message==="Missing initPTS for VTT MPEGTS";S?a.push(e):this._fallbackToIMSC1(i,r),g.logger.log(`Failed to parse VTT cue: ${v}`),!(S&&h>i.cc)&&g.trigger(_.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:v})})}_fallbackToIMSC1(e,t){const i=this.tracks[e.level];i.textCodec||po(t,this.initPTS[e.cc],()=>{i.textCodec=Os,this._parseIMSC1(e,t)},()=>{i.textCodec="wvtt"})}_appendCues(e,t){const i=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||r.mode==="disabled")return;e.forEach(s=>Ja(r,s))}else{const r=this.tracks[t];if(!r)return;const s=r.default?"default":"subtitles"+t;i.trigger(_.CUES_PARSED,{type:"subtitles",cues:e,track:s})}}onFragDecrypted(e,t){const{frag:i}=t;i.type===m.SUBTITLE&&this.onFragLoaded(_.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:i,samples:r}=t;if(!(i.type===m.MAIN&&this.closedCaptionsForLevel(i)==="NONE"))for(let s=0;s<r.length;s++){const a=r[s].bytes;if(a){this.cea608Parser1||this.initCea608Parsers();const h=this.extractCea608Data(a);this.cea608Parser1.addData(r[s].pts,h[0]),this.cea608Parser2.addData(r[s].pts,h[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:i,endOffsetSubtitles:r,type:s}){const{media:a}=this;if(!(!a||a.currentTime<i)){if(!s||s==="video"){const{captionsTracks:h}=this;Object.keys(h).forEach(g=>As(h[g],t,i))}if(this.config.renderTextTracksNatively&&t===0&&r!==void 0){const{textTracks:h}=this;Object.keys(h).forEach(g=>As(h[g],t,r))}}}extractCea608Data(e){const t=[[],[]],i=e[0]&31;let r=2;for(let s=0;s<i;s++){const a=e[r++],h=127&e[r++],g=127&e[r++];if(h===0&&g===0)continue;if((4&a)!==0){const v=3&a;(v===0||v===1)&&(t[v].push(h),t[v].push(g))}}return t}}function vo(o){return o.characteristics&&/transcribes-spoken-dialog/gi.test(o.characteristics)&&/describes-music-and-sound/gi.test(o.characteristics)?"captions":"subtitles"}function yo(o,e){return!!o&&o.kind===vo(e)&&bs(e,o)}function xc(o,e,t,i){return Math.min(e,i)-Math.max(o,t)}function bo(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const wc=/\s/,Cc={newCue(o,e,t,i){const r=[];let s,a,h,g,d;const v=self.VTTCue||self.TextTrackCue;for(let M=0;M<i.rows.length;M++)if(s=i.rows[M],h=!0,g=0,d="",!s.isEmpty()){var S;for(let Q=0;Q<s.chars.length;Q++)wc.test(s.chars[Q].uchar)&&h?g++:(d+=s.chars[Q].uchar,h=!1);s.cueStartTime=e,e===t&&(t+=1e-4),g>=16?g--:g++;const j=co(d.trim()),H=Ps(e,t,j);o!=null&&(S=o.cues)!=null&&S.getCueById(H)||(a=new v(e,t,j),a.id=H,a.line=M+1,a.align="left",a.position=10+Math.min(80,Math.floor(g*8/32)*10),r.push(a))}return o&&r.length&&(r.sort((M,j)=>M.line==="auto"||j.line==="auto"?0:M.line>8&&j.line>8?j.line-M.line:M.line-j.line),r.forEach(M=>Ja(o,M))),r}};function Ac(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(o){}return!1}const Tc=/(\d+)-(\d+)\/(\d+)/;class Eo{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||kc,this.controller=new self.AbortController,this.stats=new R}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,i){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const s=Dc(e,this.controller.signal),a=e.responseType==="arraybuffer",h=a?"byteLength":"length",{maxTimeToFirstByteMs:g,maxLoadTimeMs:d}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,s),self.clearTimeout(this.requestTimeout),t.timeout=g&&k(g)?g:d,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},t.timeout),(Rn(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(S=>{var M;this.response=this.loader=S;const j=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=d,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},d-(j-r.loading.start)),!S.ok){const{status:Q,statusText:Z}=S;throw new Ic(Z||"fetch, bad network response",Q,S)}r.loading.first=j,r.total=Rc(S.headers)||r.total;const H=(M=this.callbacks)==null?void 0:M.onProgress;return H&&k(t.highWaterMark)?this.loadProgressively(S,r,e,t.highWaterMark,H):a?S.arrayBuffer():e.responseType==="json"?S.json():S.text()}).then(S=>{var M,j;const H=this.response;if(!H)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const Q=S[h];Q&&(r.loaded=r.total=Q);const Z={url:H.url,data:S,code:H.status},re=(M=this.callbacks)==null?void 0:M.onProgress;re&&!k(t.highWaterMark)&&re(r,e,S,H),(j=this.callbacks)==null||j.onSuccess(Z,r,e,H)}).catch(S=>{var M;if(self.clearTimeout(this.requestTimeout),r.aborted)return;const j=S&&S.code||0,H=S?S.message:null;(M=this.callbacks)==null||M.onError({code:j,text:H},e,S?S.details:null,r)})}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,i,r=0,s){const a=new ua,h=e.body.getReader(),g=()=>h.read().then(d=>{if(d.done)return a.dataLength&&s(t,i,a.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const v=d.value,S=v.length;return t.loaded+=S,S<r||a.dataLength?(a.push(v),a.dataLength>=r&&s(t,i,a.flush().buffer,e)):s(t,i,v.buffer,e),g()}).catch(()=>Promise.reject());return g()}}function Dc(o,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(c({},o.headers))};return o.rangeEnd&&t.headers.set("Range","bytes="+o.rangeStart+"-"+String(o.rangeEnd-1)),t}function Lc(o){const e=Tc.exec(o);if(e)return parseInt(e[2])-parseInt(e[1])+1}function Rc(o){const e=o.get("Content-Range");if(e){const i=Lc(e);if(k(i))return i}const t=o.get("Content-Length");if(t)return parseInt(t)}function kc(o,e){return new self.Request(o.url,e)}class Ic extends Error{constructor(e,t,i){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=i}}const Pc=/^age:\s*[\d.]+\s*$/im;class So{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 R,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,i){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=i,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const i=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const s=this.xhrSetup;s?Promise.resolve().then(()=>{if(!(this.loader!==i||this.stats.aborted))return s(i,t.url)}).catch(a=>{if(!(this.loader!==i||this.stats.aborted))return i.open("GET",t.url,!0),s(i,t.url)}).then(()=>{this.loader!==i||this.stats.aborted||this.openAndSendXhr(i,t,e)}).catch(a=>{var h;(h=this.callbacks)==null||h.onError({code:i.status,text:a.message},t,i,r)}):this.openAndSendXhr(i,t,e)}openAndSendXhr(e,t,i){e.readyState||e.open("GET",t.url,!0);const r=t.headers,{maxTimeToFirstByteMs:s,maxLoadTimeMs:a}=i.loadPolicy;if(r)for(const h in r)e.setRequestHeader(h,r[h]);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),i.timeout=s&&k(s)?s:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:i}=this;if(!e||!t)return;const r=t.readyState,s=this.config;if(!i.aborted&&r>=2&&(i.loading.first===0&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),s.timeout!==s.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),s.timeout=s.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),r===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const d=t.status,v=t.responseType==="text"?t.responseText:null;if(d>=200&&d<300){const H=v!=null?v:t.response;if(H!=null){var a,h;i.loading.end=Math.max(self.performance.now(),i.loading.first);const Q=t.responseType==="arraybuffer"?H.byteLength:H.length;i.loaded=i.total=Q,i.bwEstimate=i.total*8e3/(i.loading.end-i.loading.first);const Z=(a=this.callbacks)==null?void 0:a.onProgress;Z&&Z(i,e,H,t);const re={url:t.responseURL,data:H,code:d};(h=this.callbacks)==null||h.onSuccess(re,i,e,t);return}}const S=s.loadPolicy.errorRetry,M=i.retry,j={url:e.url,data:void 0,code:d};if(Di(S,M,!1,j))this.retry(S);else{var g;F.error(`${d} while loading ${e.url}`),(g=this.callbacks)==null||g.onError({code:d,text:t.statusText},e,t,i)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Di(e,t,!0))this.retry(e);else{var i;F.warn(`timeout while loading ${(i=this.context)==null?void 0:i.url}`);const r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:i}=this;this.retryDelay=Ui(e,i.retry),i.retry++,F.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${i.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=u(u({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:So,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Jt,bufferController:Ql,capLevelController:Ss,errorController:Er,fpsController:Nu,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:on,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:Zu,subtitleTrackController:Hu,timelineController:Sc,audioStreamController:ql,audioTrackController:Yl,emeController:fn,cmcdController:Fu,contentSteeringController:Bu,interstitialsController:Yu});function Mc(){return{cueHandler:Cc,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 Bc(o,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 i=Ns(o),r=["manifest","level","frag"],s=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return r.forEach(a=>{const h=`${a==="level"?"playlist":a}LoadPolicy`,g=e[h]===void 0,d=[];s.forEach(v=>{const S=`${a}Loading${v}`,M=e[S];if(M!==void 0&&g){d.push(S);const j=i[h].default;switch(e[h]={default:j},v){case"TimeOut":j.maxLoadTimeMs=M,j.maxTimeToFirstByteMs=M;break;case"MaxRetry":j.errorRetry.maxNumRetry=M,j.timeoutRetry.maxNumRetry=M;break;case"RetryDelay":j.errorRetry.retryDelayMs=M,j.timeoutRetry.retryDelayMs=M;break;case"MaxRetryTimeout":j.errorRetry.maxRetryDelayMs=M,j.timeoutRetry.maxRetryDelayMs=M;break}}}),d.length&&t.warn(`hls.js config: "${d.join('", "')}" setting(s) are deprecated, use "${h}": ${yt(e[h])}`)}),u(u({},i),e)}function Ns(o){return o&&typeof o=="object"?Array.isArray(o)?o.map(Ns):Object.keys(o).reduce((e,t)=>(e[t]=Ns(o[t]),e),{}):o}function Nc(o,e){const t=o.loader;t!==Eo&&t!==So?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),o.progressive=!1):Ac()&&(o.loader=Eo,o.progressive=!0,o.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Xn=2,Uc=.1,$c=.05,Hc=100;class jc extends _r{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 i;(i=this.media)!=null&&i.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var i;this.ended=((i=this.media)==null?void 0:i.currentTime)||1,this.hls.trigger(_.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.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(Hc),this.mediaSource=t.mediaSource;const i=this.media=t.media;Vi(i,"playing",this.onMediaPlaying),Vi(i,"waiting",this.onMediaWaiting),Vi(i,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:i}=this;i&&(tr(i,"playing",this.onMediaPlaying),tr(i,"waiting",this.onMediaWaiting),tr(i,"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 i,r;const s=(i=this.hls)==null?void 0:i.config;if(!s)return;const a=this.media;if(!a)return;const{seeking:h}=a,g=this.seeking&&!h,d=!this.seeking&&h,v=a.paused&&!h||a.ended||a.playbackRate===0;if(this.seeking=h,e!==t){t&&(this.ended=0),this.moved=!0,h||(this.nudgeRetry=0,s.nudgeOnVideoHole&&!v&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(d||g){g&&this.stallResolved(e);return}if(v){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&a.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(_.MEDIA_ENDED,{stalled:!1}));return}if(!Rt.getBuffered(a).length){this.nudgeRetry=0;return}const S=Rt.bufferInfo(a,e,0),M=S.nextStart||0,j=this.fragmentTracker;if(h&&j&&this.hls){const $e=xo(this.hls.inFlightFragments,e),Ae=S.len>Xn,Pe=!M||$e||M-e>Xn&&!j.getPartialFragment(e);if(Ae||Pe)return;this.moved=!1}const H=(r=this.hls)==null?void 0:r.latestLevelDetails;if(!this.moved&&this.stalled!==null&&j){if(!(S.len>0)&&!M)return;const Ae=Math.max(M,S.start||0)-e,Ue=!!(H!=null&&H.live)?H.targetduration*2:Xn,De=j.getPartialFragment(e);if(Ae>0&&(Ae<=Ue||De)){a.paused||this._trySkipBufferHole(De);return}}const Q=s.detectStallWithCurrentTimeMs,Z=self.performance.now(),re=this.waiting;let fe=this.stalled;if(fe===null)if(re>0&&Z-re<Q)fe=this.stalled=re;else{this.stalled=Z;return}const le=Z-fe;if(!h&&(le>=Q||re)&&this.hls){var be;if(((be=this.mediaSource)==null?void 0:be.readyState)==="ended"&&!(H!=null&&H.live)&&Math.abs(e-((H==null?void 0:H.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(_.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(S),!this.media||!this.hls)return}const we=Rt.bufferInfo(a,e,s.maxBufferHole);this._tryFixBufferStall(we,le,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const i=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(i)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(_.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var i;const r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(i=this.buffered.audio)!=null&&i.length&&r&&r.length>1&&e>r.end(0)){const s=Rt.bufferedInfo(Rt.timeRangesToArray(this.buffered.audio),e,0);if(s.len>1&&t>=s.start){const a=Rt.timeRangesToArray(r),h=Rt.bufferedInfo(a,t,0).bufferedIndex;if(h>-1&&h<a.length-1){const g=Rt.bufferedInfo(a,e,0).bufferedIndex,d=a[h].end,v=a[h+1].start;if((g===-1||g>h)&&v-d<1&&e-d<2){const S=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${d} -> ${v} buffered index: ${g}`);this.warn(S.message),this.media.currentTime+=1e-6;const M=this.fragmentTracker.getPartialFragment(e)||void 0,j=Rt.bufferInfo(this.media,e,0);this.hls.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:S,reason:S.message,frag:M,buffer:j.len,bufferInfo:j})}}}}}_tryFixBufferStall(e,t,i){var r,s;const{fragmentTracker:a,media:h}=this,g=(r=this.hls)==null?void 0:r.config;if(!h||!a||!g)return;const d=(s=this.hls)==null?void 0:s.latestLevelDetails,v=a.getPartialFragment(i);if((v||d!=null&&d.live&&i<d.fragmentStart)&&(this._trySkipBufferHole(v)||!this.media))return;const S=e.buffered,M=this.adjacentTraversal(e,i);(S&&S.length>1&&e.len>g.maxBufferHole||e.nextStart&&(e.nextStart-i<g.maxBufferHole||M))&&(t>g.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const i=this.fragmentTracker,r=e.nextStart;if(i&&r){const s=i.getFragAtPos(t,m.MAIN),a=i.getFragAtPos(r,m.MAIN);if(s&&a)return a.sn-s.sn<2}return!1}_reportStall(e){const{hls:t,media:i,stallReported:r,stalled:s}=this;if(!r&&s!==null&&i&&t){this.stallReported=!0;const a=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${yt(e)})`);this.warn(a.message),t.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.BUFFER_STALLED_ERROR,fatal:!1,error:a,buffer:e.len,bufferInfo:e,stalled:{start:s}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:i,media:r}=this,s=(t=this.hls)==null?void 0:t.config;if(!r||!i||!s)return 0;const a=r.currentTime,h=Rt.bufferInfo(r,a,0),g=a<h.start?h.start:h.nextStart;if(g&&this.hls){const v=h.len<=s.maxBufferHole,S=h.len>0&&h.len<1&&r.readyState<3,M=g-a;if(M>0&&(v||S)){if(M>s.maxBufferHole){let H=!1;if(a===0){const Q=i.getAppendedFrag(0,m.MAIN);Q&&g<Q.end&&(H=!0)}if(!H){const Q=e||i.getAppendedFrag(a,m.MAIN);if(Q){var d;if(!((d=this.hls.loadLevelObj)!=null&&d.details)||xo(this.hls.inFlightFragments,g))return 0;let re=!1,fe=Q.end;for(;fe<g;){const le=i.getPartialFragment(fe);if(le)fe+=le.duration;else{re=!0;break}}if(re)return 0}}}const j=Math.max(g+$c,a+Uc);if(this.warn(`skipping hole, adjusting currentTime from ${a} to ${j}`),this.moved=!0,r.currentTime=j,!(e!=null&&e.gap)){const H=new Error(`fragment loaded with buffer holes, seeking from ${a} to ${j}`);this.hls.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:H,reason:H.message,frag:e||void 0,buffer:h.len,bufferInfo:h})}return j}}return 0}_tryNudgeBuffer(e){const{hls:t,media:i,nudgeRetry:r}=this,s=t==null?void 0:t.config;if(!i||!s)return 0;const a=i.currentTime;if(this.nudgeRetry++,r<s.nudgeMaxRetry){const h=a+(r+1)*s.nudgeOffset,g=new Error(`Nudging 'currentTime' from ${a} to ${h}`);this.warn(g.message),i.currentTime=h,t.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.BUFFER_NUDGE_ON_STALL,error:g,fatal:!1,buffer:e.len,bufferInfo:e})}else{const h=new Error(`Playhead still not moving while enough data buffered @${a} after ${s.nudgeMaxRetry} nudges`);this.error(h.message),t.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.BUFFER_STALLED_ERROR,error:h,fatal:!0,buffer:e.len,bufferInfo:e})}}}function xo(o,e){const t=wo(o.main);if(t&&t.start<=e)return t;const i=wo(o.audio);return i&&i.start<=e?i:null}function wo(o){if(!o)return null;switch(o.state){case Ke.IDLE:case Ke.STOPPED:case Ke.ENDED:case Ke.ERROR:return null}return o.frag}const Wc=.25;function Us(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Co(o,e,t,i,r){let s=new o(e,t,"");try{s.value=i,r&&(s.type=r)}catch(a){s=new o(e,t,yt(r?u({type:r},i):i))}return s}const Qn=(()=>{const o=Us();try{o&&new o(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Gc(o){return Uint8Array.from(o.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Kc{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(_.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(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(_.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(_.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(e,t){var i;this.media=t.media,((i=t.overrides)==null?void 0:i.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&&dn(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 i=e[t];if(i.kind==="metadata"&&i.label==="id3")return Qa(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:i,enableID3MetadataCues:r}}}=this;if(!i&&!r)return;const{samples:s}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const a=Us();if(a)for(let h=0;h<s.length;h++){const g=s[h].type;if(g===zi.emsg&&!i||!r)continue;const d=ma(s[h].data);if(d){const v=s[h].pts;let S=v+s[h].duration;S>Qn&&(S=Qn),S-v<=0&&(S=v+Wc);for(let j=0;j<d.length;j++){const H=d[j];if(!va(H)){this.updateId3CueEnds(v,g);const Q=Co(a,v,S,H,g);Q&&this.id3Track.addCue(Q)}}}}}updateId3CueEnds(e,t){var i;const r=(i=this.id3Track)==null?void 0:i.cues;if(r)for(let s=r.length;s--;){const a=r[s];a.type===t&&a.startTime<e&&a.endTime===Qn&&(a.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:i,type:r}){const{id3Track:s,hls:a}=this;if(!a)return;const{config:{enableEmsgMetadataCues:h,enableID3MetadataCues:g}}=a;if(s&&(h||g)){let d;r==="audio"?d=v=>v.type===zi.audioId3&&g:r==="video"?d=v=>v.type===zi.emsg&&h:d=v=>v.type===zi.audioId3&&g||v.type===zi.emsg&&h,As(s,t,i,d)}}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:i}=this,{dateRanges:r}=e,s=Object.keys(r);let a=this.dateRangeCuesAppended;if(i&&t){var h;if((h=i.cues)!=null&&h.length){const v=Object.keys(a).filter(S=>!s.includes(S));for(let S=v.length;S--;){const M=v[S],j=a[M].cues;delete a[M],Object.keys(j).forEach(H=>{try{const Q=j[H];Q.removeEventListener("enter",this.onEventCueEnter),i.removeCue(Q)}catch(Q){}})}}else a=this.dateRangeCuesAppended={}}const g=e.fragments[e.fragments.length-1];if(s.length===0||!k(g==null?void 0:g.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const d=Us();for(let v=0;v<s.length;v++){const S=s[v],M=r[S],j=M.startTime,H=a[S],Q=(H==null?void 0:H.cues)||{};let Z=(H==null?void 0:H.durationKnown)||!1,re=Qn;const{duration:fe,endDate:le}=M;if(le&&fe!==null)re=j+fe,Z=!0;else if(M.endOnNext&&!Z){const we=s.reduce(($e,Ae)=>{if(Ae!==M.id){const Pe=r[Ae];if(Pe.class===M.class&&Pe.startDate>M.startDate&&(!$e||M.startDate<$e.startDate))return Pe}return $e},null);we&&(re=we.startTime,Z=!0)}const be=Object.keys(M.attr);for(let we=0;we<be.length;we++){const $e=be[we];if(!vn($e))continue;const Ae=Q[$e];if(Ae)Z&&!H.durationKnown?Ae.endTime=re:Math.abs(Ae.startTime-j)>.01&&(Ae.startTime=j,Ae.endTime=re);else if(d){let Pe=M.attr[$e];yn($e)&&(Pe=Gc(Pe));const De=Co(d,j,re,{key:$e,data:Pe},zi.dateRange);De&&(De.id=S,this.id3Track.addCue(De),Q[$e]=De,this.hls.config.interstitialsController&&($e==="X-ASSET-LIST"||$e==="X-ASSET-URL")&&De.addEventListener("enter",this.onEventCueEnter))}}a[S]={cues:Q,dateRange:M,durationKnown:Z}}}}class zc{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,i=this.levelDetails;if(!t||!i)return;this.currentTime=t.currentTime;const r=this.computeLatency();if(r===null)return;this._latency=r;const{lowLatencyMode:s,maxLiveSyncPlaybackRate:a}=this.config;if(!s||a===1||!i.live)return;const h=this.targetLatency;if(h===null)return;const g=r-h,d=Math.min(this.maxLatency,h+i.targetduration);if(g<d&&g>.05&&this.forwardBufferLength>1){const S=Math.min(2,Math.max(1,a)),M=Math.round(2/(1+Math.exp(-.75*g-this.edgeStalled))*20)/20,j=Math.min(S,Math.max(1,M));this.changeMediaPlaybackRate(t,j)}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:i,targetduration:r}=e,{liveSyncDuration:s,liveSyncDurationCount:a,lowLatencyMode:h}=this.config,g=this.hls.userConfig;let d=h&&i||t;(this._targetLatencyUpdated||g.liveSyncDuration||g.liveSyncDurationCount||d===0)&&(d=s!==void 0?s:a*r);const v=r;return d+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,v)}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 i=this.levelDetails;if(i===null)return null;const r=i.edge,s=e-t-this.edgeStalled,a=r-i.totalduration,h=r-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(a,s),h)}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 i=e.buffered.length;return(i?e.buffered.end(i-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(_.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_.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 i;t.details===w.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(i=this.levelDetails)!=null&&i.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var i,r;e.playbackRate!==t&&((i=this.hls)==null||i.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(r=this.targetLatency)==null?void 0:r.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 ys{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(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this),e.on(_.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this),e.off(_.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 i=this.hls.config.preferManagedMediaSource,r=[],s={},a={};let h=!1,g=!1,d=!1;t.levels.forEach(v=>{const S=v.attrs;let{audioCodec:M,videoCodec:j}=v;M&&(v.audioCodec=M=Ve(M,i)||void 0),j&&(j=v.videoCodec=ft(j));const{width:H,height:Q,unknownCodecs:Z}=v;let re=Z?Z.length:0;if(Z)for(let De=re;De--;){const Xe=Z[De];this.isAudioSupported(Xe)?(v.audioCodec=M=M?`${M},${Xe}`:Xe,re--,Je.audio[M.substring(0,4)]=2):this.isVideoSupported(Xe)&&(v.videoCodec=j=j?`${j},${Xe}`:Xe,re--,Je.video[j.substring(0,4)]=2)}if(h||(h=!!(H&&Q)),g||(g=!!j),d||(d=!!M),re||M&&!this.isAudioSupported(M)||j&&!this.isVideoSupported(j)){this.log(`Some or all CODECS not supported "${S.CODECS}"`);return}const{CODECS:fe,"FRAME-RATE":le,"HDCP-LEVEL":be,"PATHWAY-ID":we,RESOLUTION:$e,"VIDEO-RANGE":Ae}=S,Ue=`${`${we||"."}-`}${v.bitrate}-${$e}-${le}-${fe}-${Ae}-${be}`;if(s[Ue])if(s[Ue].uri!==v.url&&!v.attrs["PATHWAY-ID"]){const De=a[Ue]+=1;v.attrs["PATHWAY-ID"]=new Array(De+1).join(".");const Xe=this.createLevel(v);s[Ue]=Xe,r.push(Xe)}else s[Ue].addGroupId("audio",S.AUDIO),s[Ue].addGroupId("text",S.SUBTITLES);else{const De=this.createLevel(v);s[Ue]=De,a[Ue]=1,r.push(De)}}),this.filterAndSortMediaOptions(r,t,h,g,d)}createLevel(e){const t=new Mi(e),i=e.supplemental;if(i!=null&&i.videoCodec&&!this.isVideoSupported(i.videoCodec)){const r=new Error(`SUPPLEMENTAL-CODECS not supported "${i.videoCodec}"`);this.log(r.message),t.supportedResult=ui(r,[])}return t}isAudioSupported(e){return xe(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return xe(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,i,r,s){let a=[],h=[],g=e;if((i||r)&&s&&(g=g.filter(({videoCodec:Z,videoRange:re,width:fe,height:le})=>(!!Z||!!(fe&&le))&&gi(re))),g.length===0){Promise.resolve().then(()=>{if(this.hls){let Z="no level with compatible codecs found in manifest",re=Z;t.levels.length&&(re=`one or more CODECS in variant not supported: ${yt(t.levels.map(le=>le.attrs.CODECS).filter((le,be,we)=>we.indexOf(le)===be))}`,this.warn(re),Z+=` (${re})`);const fe=new Error(Z);this.hls.trigger(_.ERROR,{type:T.MEDIA_ERROR,details:w.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:fe,reason:re})}});return}t.audioTracks&&(a=t.audioTracks.filter(Z=>!Z.audioCodec||this.isAudioSupported(Z.audioCodec)),Ao(a)),t.subtitles&&(h=t.subtitles,Ao(h));const d=g.slice(0);g.sort((Z,re)=>{if(Z.attrs["HDCP-LEVEL"]!==re.attrs["HDCP-LEVEL"])return(Z.attrs["HDCP-LEVEL"]||"")>(re.attrs["HDCP-LEVEL"]||"")?1:-1;if(i&&Z.height!==re.height)return Z.height-re.height;if(Z.frameRate!==re.frameRate)return Z.frameRate-re.frameRate;if(Z.videoRange!==re.videoRange)return Xt.indexOf(Z.videoRange)-Xt.indexOf(re.videoRange);if(Z.videoCodec!==re.videoCodec){const fe=ee(Z.videoCodec),le=ee(re.videoCodec);if(fe!==le)return le-fe}if(Z.uri===re.uri&&Z.codecSet!==re.codecSet){const fe=ie(Z.codecSet),le=ie(re.codecSet);if(fe!==le)return le-fe}return Z.averageBitrate!==re.averageBitrate?Z.averageBitrate-re.averageBitrate:0});let v=d[0];if(this.steering&&(g=this.steering.filterParsedLevels(g),g.length!==d.length)){for(let Z=0;Z<d.length;Z++)if(d[Z].pathwayId===g[0].pathwayId){v=d[Z];break}}this._levels=g;for(let Z=0;Z<g.length;Z++)if(g[Z]===v){var S;this._firstLevel=Z;const re=v.bitrate,fe=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${g.length} level(s) found, first bitrate: ${re}`),((S=this.hls.userConfig)==null?void 0:S.abrEwmaDefaultEstimate)===void 0){const le=Math.min(re,this.hls.config.abrEwmaDefaultEstimateMax);le>fe&&fe===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=le)}break}const M=s&&!r,j=this.hls.config,H=!!(j.audioStreamController&&j.audioTrackController),Q={levels:g,audioTracks:a,subtitleTracks:h,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:s,video:r,altAudio:H&&!M&&a.some(Z=>!!Z.url)};this.hls.trigger(_.MANIFEST_PARSED,Q)}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 v=new Error("invalid level idx"),S=e<0;if(this.hls.trigger(_.ERROR,{type:T.OTHER_ERROR,details:w.LEVEL_SWITCH_ERROR,level:e,fatal:S,error:v,reason:v.message}),S)return;e=Math.min(e,t.length-1)}const i=this.currentLevelIndex,r=this.currentLevel,s=r?r.attrs["PATHWAY-ID"]:void 0,a=t[e],h=a.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=a,i===e&&r&&s===h)return;this.log(`Switching to level ${e} (${a.height?a.height+"p ":""}${a.videoRange?a.videoRange+" ":""}${a.codecSet?a.codecSet+" ":""}@${a.bitrate})${h?" with Pathway "+h:""} from level ${i}${s?" with Pathway "+s:""}`);const g={level:e,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(_.LEVEL_SWITCHING,g);const d=a.details;if(!d||d.live){const v=this.switchParams(a.uri,r==null?void 0:r.details,d);this.loadPlaylist(v)}}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(),i=e.filter(r=>t.indexOf(r)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=i}}onError(e,t){t.fatal||!t.context||t.context.type===O.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===m.MAIN){const i=t.elementaryStreams;if(!Object.keys(i).some(s=>!!i[s]))return;const r=this._levels[t.level];r!=null&&r.loadError&&(this.log(`Resetting level error count of ${r.loadError} on frag buffered`),r.loadError=0)}}onLevelLoaded(e,t){var i;const{level:r,details:s}=t,a=t.levelInfo;if(!a){var h;this.warn(`Invalid level index ${r}`),(h=t.deliveryDirectives)!=null&&h.skip&&(s.deltaUpdateFailed=!0);return}if(a===this.currentLevel||t.withoutMultiVariant){a.fragmentError===0&&(a.loadError=0);let g=a.details;g===t.details&&g.advanced&&(g=void 0),this.playlistLoaded(r,t,g)}else(i=t.deliveryDirectives)!=null&&i.skip&&(s.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const i=this.getUrlWithDirectives(e.uri,t),r=this.currentLevelIndex,s=e.attrs["PATHWAY-ID"],a=e.details,h=a==null?void 0:a.age;this.log(`Loading level index ${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${s?" Pathway "+s:""}${h&&a.live?" age "+h.toFixed(1)+(a.type?" "+a.type||0:""):""} ${i}`),this.hls.trigger(_.LEVEL_LOADING,{url:i,level:r,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 i=this._levels.filter((s,a)=>a!==e?!0:(this.steering&&this.steering.removeLevel(s),s===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,s.details&&s.details.fragments.forEach(h=>h.level=-1)),!1));na(i),this._levels=i,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 r=i.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&(this._startLevel=Math.min(this._startLevel,r)),this.hls.trigger(_.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:i}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(_.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:i}))}}function Ao(o){const e={};o.forEach(t=>{const i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++})}function To(){return self.SourceBuffer||self.WebKitSourceBuffer}function Do(){if(!q())return!1;const e=To();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function qc(){if(!Do())return!1;const o=q();return typeof(o==null?void 0:o.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>o.isTypeSupported(ye(e,"video")))||["mp4a.40.2","fLaC"].some(e=>o.isTypeSupported(ye(e,"audio"))))}function Yc(){var o;const e=To();return typeof(e==null||(o=e.prototype)==null?void 0:o.changeType)=="function"}const Zc=100;class Xc extends ns{constructor(e,t,i){super(e,t,i,"stream-controller",m.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 r=this.media,s=r?r.currentTime:null;if(s===null||!k(s)||(this.log(`Media seeked to ${s.toFixed(3)}`),!this.getBufferedFrag(s)))return;const a=this.getFwdBufferInfoAtPos(r,s,m.MAIN,0);if(a===null||a.len===0){this.warn(`Main forward buffer length at ${s} on "seeked" event ${a?a.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(_.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(_.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(_.BUFFER_CREATED,this.onBufferCreated,this),e.on(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(_.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(_.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(_.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(_.BUFFER_CREATED,this.onBufferCreated,this),e.off(_.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:i,hls:r}=this;if(this.stopLoad(),this.setInterval(Zc),this.level=-1,!this.startFragRequested){let s=r.startLevel;s===-1&&(r.config.testBandwidth&&this.levels.length>1?(s=0,this.bitrateTest=!0):s=r.firstAutoLevel),r.nextLoadLevel=s,this.level=r.loadLevel,this._hasEnoughToStart=!!t}i>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),e=i),this.state=Ke.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=Ke.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Ke.WAITING_LEVEL:{const{levels:t,level:i}=this,r=t==null?void 0:t[i],s=r==null?void 0:r.details;if(s&&(!s.live||this.levelLastLoaded===r&&!this.waitForLive(r))){if(this.waitForCdnTuneIn(s))break;this.state=Ke.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=Ke.IDLE;break}break}case Ke.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),i=this.retryDate;if(!i||t>=i||(e=this.media)!=null&&e.seeking){const{levels:r,level:s}=this,a=r==null?void 0:r[s];this.resetStartWhenNotLoaded(a||null),this.state=Ke.IDLE}}break}this.state===Ke.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:i,media:r}=this;if(t===null||!r&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const s=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(i!=null&&i[s]))return;const a=i[s],h=this.getMainFwdBufferInfo();if(h===null)return;const g=this.getLevelDetails();if(g&&this._streamEnded(h,g)){const Q={};this.altAudio===2&&(Q.type="video"),this.hls.trigger(_.BUFFER_EOS,Q),this.state=Ke.ENDED;return}if(!this.buffering)return;e.loadLevel!==s&&e.manualLevel===-1&&this.log(`Adapting to level ${s} from level ${this.level}`),this.level=e.nextLoadLevel=s;const d=a.details;if(!d||this.state===Ke.WAITING_LEVEL||this.waitForLive(a)){this.level=s,this.state=Ke.WAITING_LEVEL,this.startFragRequested=!1;return}const v=h.len,S=this.getMaxBufferLength(a.maxBitrate);if(v>=S)return;this.backtrackFragment&&this.backtrackFragment.start>h.end&&(this.backtrackFragment=null);const M=this.backtrackFragment?this.backtrackFragment.start:h.end;let j=this.getNextFragment(M,d);if(this.couldBacktrack&&!this.fragPrevious&&j&&te(j)&&this.fragmentTracker.getState(j)!==di.OK){var H;const Z=((H=this.backtrackFragment)!=null?H:j).sn-d.startSN,re=d.fragments[Z-1];re&&j.cc===re.cc&&(j=re,this.fragmentTracker.removeFragment(re))}else this.backtrackFragment&&h.len&&(this.backtrackFragment=null);if(j&&this.isLoopLoading(j,M)){if(!j.gap){const Z=this.audioOnly&&!this.altAudio?x.AUDIO:x.VIDEO,re=(Z===x.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;re&&this.afterBufferFlushed(re,Z,m.MAIN)}j=this.getNextFragmentLoopLoading(j,d,h,m.MAIN,S)}j&&(j.initSegment&&!j.initSegment.data&&!this.bitrateTest&&(j=j.initSegment),this.loadFragment(j,a,M))}loadFragment(e,t,i){const r=this.fragmentTracker.getState(e);r===di.NOT_LOADED||r===di.PARTIAL?te(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,i):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,m.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 i;const r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const s=this.getLevelDetails();if(s!=null&&s.live){const h=this.getMainFwdBufferInfo();if(!h||h.len<s.targetduration*2)return}if(!t.paused&&e){const h=this.hls.nextLoadLevel,g=e[h],d=this.fragLastKbps;d&&this.fragCurrent?i=this.fragCurrent.duration*g.maxBitrate/(1e3*d)+1:i=0}else i=0;const a=this.getBufferedFrag(t.currentTime+i);if(a){const h=this.followingBufferedFrag(a);if(h){this.abortCurrentFrag();const g=h.maxStartPTS?h.maxStartPTS:h.start,d=h.duration,v=Math.max(a.end,g+Math.min(Math.max(d-this.config.maxFragLookUpTolerance,d*(this.couldBacktrack?.5:.125)),d*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(v,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 Ke.KEY_LOADING:case Ke.FRAG_LOADING:case Ke.FRAG_LOADING_WAITING_RETRY:case Ke.PARSING:case Ke.PARSED:this.state=Ke.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 i=t.media;Vi(i,"playing",this.onMediaPlaying),Vi(i,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:i}=this;i&&(tr(i,"playing",this.onMediaPlaying),tr(i,"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(_.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 i=!1,r=!1;t.levels.forEach(s=>{const a=s.audioCodec;a&&(i=i||a.indexOf("mp4a.40.2")!==-1,r=r||a.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=i&&r&&!Yc(),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:i}=this;if(!i||this.state!==Ke.IDLE)return;const r=t.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=Ke.WAITING_LEVEL)}onLevelLoaded(e,t){var i;const{levels:r,startFragRequested:s}=this,a=t.level,h=t.details,g=h.totalduration;if(!r){this.warn(`Levels were reset while loading level ${a}`);return}this.log(`Level ${a} loaded [${h.startSN},${h.endSN}]${h.lastPartSn?`[part-${h.lastPartSn}-${h.lastPartIndex}]`:""}, cc [${h.startCC}, ${h.endCC}] duration:${g}`);const d=t.levelInfo,v=this.fragCurrent;v&&(this.state===Ke.FRAG_LOADING||this.state===Ke.FRAG_LOADING_WAITING_RETRY)&&v.level!==t.level&&v.loader&&this.abortCurrentFrag();let S=0;if(h.live||(i=d.details)!=null&&i.live){var M;if(this.checkLiveUpdate(h),h.deltaUpdateFailed)return;S=this.alignPlaylists(h,d.details,(M=this.levelLastLoaded)==null?void 0:M.details)}if(d.details=h,this.levelLastLoaded=d,s||this.setStartPosition(h,S),this.hls.trigger(_.LEVEL_UPDATED,{details:h,level:a}),this.state===Ke.WAITING_LEVEL){if(this.waitForCdnTuneIn(h))return;this.state=Ke.IDLE}s&&h.live&&this.synchronizeToLiveEdge(h),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:i}=this;if(!i)return;const r=this.hls.liveSyncPosition,s=this.getLoadPosition(),a=e.fragmentStart,h=e.edge,g=s>=a-t.maxFragLookUpTolerance&&s<=h;if(r!==null&&i.duration>r&&(s<r||!g)){const v=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!g&&i.readyState<4||s<h-v)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),i.readyState))if(this.warn(`Playback: ${s.toFixed(3)} is located too far from the end of live sliding playlist: ${h}, reset currentTime to : ${r.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var d;const S=Rt.bufferInfo(i,r,0);if(!(S!=null&&(d=S.buffered)!=null&&d.length)){i.currentTime=r;return}if(S.start<=s){i.currentTime=r;return}const{nextStart:j}=Rt.bufferedInfo(S.buffered,s,0);j&&(i.currentTime=j)}else i.currentTime=r}}_handleFragmentLoadProgress(e){var t;const i=e.frag,{part:r,payload:s}=e,{levels:a}=this;if(!a){this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const h=a[i.level];if(!h){this.warn(`Level ${i.level} not found on progress`);return}const g=h.details;if(!g){this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),this.fragmentTracker.removeFragment(i);return}const d=h.videoCodec,v=g.PTSKnown||!g.live,S=(t=i.initSegment)==null?void 0:t.data,M=this._getAudioCodec(h),j=this.transmuxer=this.transmuxer||new Ma(this.hls,m.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),H=r?r.index:-1,Q=H!==-1,Z=new Cr(i.level,i.sn,i.stats.chunkCount,s.byteLength,H,Q),re=this.initPTS[i.cc];j.push(s,S,M,d,i,r,g.totalduration,v,Z,re)}onAudioTrackSwitching(e,t){const i=this.hls,r=this.altAudio===2;if(Gt(t.url,i))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 a=this.fragCurrent;a&&(this.log("Switching to main audio track, cancel main fragment load"),a.abortRequests(),this.fragmentTracker.removeFragment(a)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(r){this.fragmentTracker.removeAllFragments(),i.once(_.BUFFER_FLUSHED,()=>{var a;(a=this.hls)==null||a.trigger(_.AUDIO_TRACK_SWITCHED,t)}),i.trigger(_.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}i.trigger(_.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const i=Gt(t.url,this.hls);if(i){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i?2:0,this.tick()}onBufferCreated(e,t){const i=t.tracks;let r,s,a=!1;for(const h in i){const g=i[h];if(g.id==="main"){if(s=h,r=g,h==="video"){const d=i[h];d&&(this.videoBuffer=d.buffer)}}else a=!0}a&&r?(this.log(`Alternate track found, use ${s}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:i,part:r}=t,s=i.type===m.MAIN;if(s){if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),this.state===Ke.PARSED&&(this.state=Ke.IDLE);return}const h=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*h.total/(h.buffering.end-h.loading.first)),te(i)&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}const a=this.media;a&&(!this._hasEnoughToStart&&Rt.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),s&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var i;if(t.fatal){this.state=Ke.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(m.MAIN,t);break;case w.LEVEL_LOAD_ERROR:case w.LEVEL_LOAD_TIMEOUT:case w.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Ke.WAITING_LEVEL&&((i=t.context)==null?void 0:i.type)===O.LEVEL&&(this.state=Ke.IDLE);break;case w.BUFFER_ADD_CODEC_ERROR:case w.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;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=Ke.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==x.AUDIO||!this.altAudio){const i=(t===x.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;i&&(this.afterBufferFlushed(i,t,m.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 i=this.startPosition;if(i>=0&&t<i){if(e.seeking){this.log(`could not seek to ${i}, already seeking at ${t}`);return}const r=this.timelineOffset;r&&i&&(i+=r);const s=this.getLevelDetails(),a=Rt.getBuffered(e),h=a.length?a.start(0):0,g=h-i,d=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||g>0&&(g<d||this.loadingParts&&g<2*((s==null?void 0:s.partTarget)||0)))&&(this.log(`adjusting start position by ${g} to match buffer start`),i+=g,this.startPosition=i),t<i&&(this.log(`seek to target start position ${i} from current time ${t} buffer start ${h}`),e.currentTime=i)}}_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(i=>{const{hls:r}=this,s=i==null?void 0:i.frag;if(!s||this.fragContextChanged(s))return;t.fragmentError=0,this.state=Ke.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const a=s.stats;a.parsing.start=a.parsing.end=a.buffering.start=a.buffering.end=self.performance.now(),r.trigger(_.FRAG_LOADED,i),s.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const i=this.playlistType,{hls:r}=this,{remuxResult:s,chunkMeta:a}=e,h=this.getCurrentContext(a);if(!h){this.resetWhenMissingContext(a);return}const{frag:g,part:d,level:v}=h,{video:S,text:M,id3:j,initSegment:H}=s,{details:Q}=v,Z=this.altAudio?void 0:s.audio;if(this.fragContextChanged(g)){this.fragmentTracker.removeFragment(g);return}if(this.state=Ke.PARSING,H){if(H!=null&&H.tracks){const le=g.initSegment||g;this._bufferInitSegment(v,H.tracks,le,a),r.trigger(_.FRAG_PARSING_INIT_SEGMENT,{frag:le,id:i,tracks:H.tracks})}const re=H.initPTS,fe=H.timescale;k(re)&&(this.initPTS[g.cc]={baseTime:re,timescale:fe},r.trigger(_.INIT_PTS_FOUND,{frag:g,id:i,initPTS:re,timescale:fe}))}if(S&&Q){Z&&S.type==="audiovideo"&&this.logMuxedErr(g);const re=Q.fragments[g.sn-1-Q.startSN],fe=g.sn===Q.startSN,le=!re||g.cc>re.cc;if(s.independent!==!1){const{startPTS:be,endPTS:we,startDTS:$e,endDTS:Ae}=S;if(d)d.elementaryStreams[S.type]={startPTS:be,endPTS:we,startDTS:$e,endDTS:Ae};else if(S.firstKeyFrame&&S.independent&&a.id===1&&!le&&(this.couldBacktrack=!0),S.dropped&&S.independent){const Pe=this.getMainFwdBufferInfo(),Ue=(Pe?Pe.end:this.getLoadPosition())+this.config.maxBufferHole,De=S.firstKeyFramePTS?S.firstKeyFramePTS:be;if(!fe&&Ue<De-this.config.maxBufferHole&&!le){this.backtrack(g);return}else le&&(g.gap=!0);g.setElementaryStreamInfo(S.type,g.start,we,g.start,Ae,!0)}else fe&&be-(Q.appliedTimelineOffset||0)>Xn&&(g.gap=!0);g.setElementaryStreamInfo(S.type,be,we,$e,Ae),this.backtrackFragment&&(this.backtrackFragment=g),this.bufferFragmentData(S,g,d,a,fe||le)}else if(fe||le)g.gap=!0;else{this.backtrack(g);return}}if(Z){const{startPTS:re,endPTS:fe,startDTS:le,endDTS:be}=Z;d&&(d.elementaryStreams[x.AUDIO]={startPTS:re,endPTS:fe,startDTS:le,endDTS:be}),g.setElementaryStreamInfo(x.AUDIO,re,fe,le,be),this.bufferFragmentData(Z,g,d,a)}if(Q&&j!=null&&(t=j.samples)!=null&&t.length){const re={id:i,frag:g,details:Q,samples:j.samples};r.trigger(_.FRAG_PARSING_METADATA,re)}if(Q&&M){const re={id:i,frag:g,details:Q,samples:M.samples};r.trigger(_.FRAG_PARSING_USERDATA,re)}}logMuxedErr(e){this.warn(`${te(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,i,r){if(this.state!==Ke.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(i));const{audio:s,video:a,audiovideo:h}=t;if(s){let d=at(s.codec,e.audioCodec);d==="mp4a"&&(d="mp4a.40.5");const v=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){d&&(d.indexOf("mp4a.40.5")!==-1?d="mp4a.40.2":d="mp4a.40.5");const S=s.metadata;S&&"channelCount"in S&&(S.channelCount||1)!==1&&v.indexOf("firefox")===-1&&(d="mp4a.40.5")}d&&d.indexOf("mp4a.40.5")!==-1&&v.indexOf("android")!==-1&&s.container!=="audio/mpeg"&&(d="mp4a.40.2",this.log(`Android: force audio codec to ${d}`)),e.audioCodec&&e.audioCodec!==d&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${d}"`),s.levelCodec=d,s.id=m.MAIN,this.log(`Init audio buffer, container:${s.container}, codecs[selected/level/parsed]=[${d||""}/${e.audioCodec||""}/${s.codec}]`),delete t.audiovideo}if(a){a.levelCodec=e.videoCodec,a.id=m.MAIN;const d=a.codec;if((d==null?void 0:d.length)===4)switch(d){case"hvc1":case"hev1":a.codec="hvc1.1.6.L120.90";break;case"av01":a.codec="av01.0.04M.08";break;case"avc1":a.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${e.videoCodec||""}/${d}]${a.codec!==d?" parsed-corrected="+a.codec:""}${a.supplemental?" supplemental="+a.supplemental:""}`),delete t.audiovideo}h&&(this.log(`Init audiovideo buffer, container:${h.container}, codecs[level/parsed]=[${e.codecs}/${h.codec}]`),delete t.video,delete t.audio);const g=Object.keys(t);if(g.length){if(this.hls.trigger(_.BUFFER_CODECS,t),!this.hls)return;g.forEach(d=>{const S=t[d].initSegment;S!=null&&S.byteLength&&this.hls.trigger(_.BUFFER_APPENDING,{type:d,data:S,frag:i,part:null,chunkMeta:r,parent:i.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,m.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,i=e==null?void 0:e[t];return i?this.getMaxBufferLength(i.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=Ke.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const i=e.currentTime;if(Rt.isBuffered(e,i)?t=this.getAppendedFrag(i):Rt.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){this.backtrackFragment=null;const r=this.fragPlaying,s=t.level;(!r||t.sn!==r.sn||r.level!==s)&&(this.fragPlaying=t,this.hls.trigger(_.FRAG_CHANGED,{frag:t}),(!r||r.level!==s)&&this.hls.trigger(_.LEVEL_SWITCHED,{level:s}))}}}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 k(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(k(t)){const i=this.getLevelDetails(),r=this.currentFrag||(i?ni(null,i.fragments,t):null);if(r){const s=r.programDateTime;if(s!==null){const a=s+(t-r.start)*1e3;return new Date(a)}}}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 i in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[i].loader;if(r){var t;if(e&&e!==((t=r.context)==null?void 0:t.frag.type))return;r.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,i,r,s){return new Ri({type:T.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:s,error:i,networkDetails:r})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length){const{sn:i,cc:r}=e;for(let s=0;s<t.length;s++){const a=t[s];if(r<=a.cc&&(i==="initSegment"||a.sn==="initSegment"||i<a.sn))return this.emeController.selectKeySystemFormat(a).then(h=>{if(a.setKeyFormat(h),this.emeController&&this.config.requireKeySystemAccessOnStart){const g=ji(h);if(g)return this.emeController.getKeySystemAccess([g])}})}}else 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 i,r;t&&e.setKeyFormat(t);const s=e.decryptdata;if(!s){const d=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,d))}const a=s.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,w.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));let h=this.keyUriToKeyInfo[a];if((i=h)!=null&&i.decryptdata.key)return s.key=h.decryptdata.key,Promise.resolve({frag:e,keyInfo:h});if((r=h)!=null&&r.keyLoadPromise){var g;switch((g=h.mediaKeySessionContext)==null?void 0:g.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return h.keyLoadPromise.then(d=>(s.key=d.keyInfo.decryptdata.key,{frag:e,keyInfo:h}))}}switch(h=this.keyUriToKeyInfo[a]={decryptdata:s,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},s.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return s.keyFormat==="identity"?this.loadKeyHTTP(h,e):this.loadKeyEME(h,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(h,e);default:return Promise.reject(this.createKeyLoadError(e,w.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${s.method}"`)))}}loadKeyEME(e,t){const i={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const r=this.emeController.loadKey(i);if(r)return(e.keyLoadPromise=r.then(s=>(e.mediaKeySessionContext=s,i))).catch(s=>{throw e.keyLoadPromise=null,s})}return Promise.resolve(i)}loadKeyHTTP(e,t){const i=this.config,r=i.loader,s=new r(i);return t.keyLoader=e.loader=s,e.keyLoadPromise=new Promise((a,h)=>{const g={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},d=i.keyLoadPolicy.default,v={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(M,j,H,Q)=>{const{frag:Z,keyInfo:re,url:fe}=H;if(!Z.decryptdata||re!==this.keyUriToKeyInfo[fe])return h(this.createKeyLoadError(Z,w.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),Q));re.decryptdata.key=Z.decryptdata.key=new Uint8Array(M.data),Z.keyLoader=null,re.loader=null,a({frag:Z,keyInfo:re})},onError:(M,j,H,Q)=>{this.resetLoader(j),h(this.createKeyLoadError(t,w.KEY_LOAD_ERROR,new Error(`HTTP Error ${M.code} loading key ${M.text}`),H,u({url:g.url,data:void 0},M)))},onTimeout:(M,j,H)=>{this.resetLoader(j),h(this.createKeyLoadError(t,w.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),H))},onAbort:(M,j,H)=>{this.resetLoader(j),h(this.createKeyLoadError(t,w.INTERNAL_ABORTED,new Error("key loading aborted"),H))}};s.load(g,v,S)})}resetLoader(e){const{frag:t,keyInfo:i,url:r}=e,s=i.loader;t.keyLoader===s&&(t.keyLoader=null,i.loader=null),delete this.keyUriToKeyInfo[r],s&&s.destroy()}}function Lo(o){const{type:e}=o;switch(e){case O.AUDIO_TRACK:return m.AUDIO;case O.SUBTITLE_TRACK:return m.SUBTITLE;default:return m.MAIN}}function $s(o,e){let t=o.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(_.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_.LEVEL_LOADING,this.onLevelLoading,this),e.on(_.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(_.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(_.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(_.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_.LEVEL_LOADING,this.onLevelLoading,this),e.off(_.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(_.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(_.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,i=t.pLoader,r=t.loader,s=i||r,a=new s(t);return this.loaders[e.type]=a,a}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:i}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:O.MANIFEST,url:i,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:i,level:r,pathwayId:s,url:a,deliveryDirectives:h,levelInfo:g}=t;this.load({id:i,level:r,pathwayId:s,responseType:"text",type:O.LEVEL,url:a,deliveryDirectives:h,levelOrTrack:g})}onAudioTrackLoading(e,t){const{id:i,groupId:r,url:s,deliveryDirectives:a,track:h}=t;this.load({id:i,groupId:r,level:null,responseType:"text",type:O.AUDIO_TRACK,url:s,deliveryDirectives:a,levelOrTrack:h})}onSubtitleTrackLoading(e,t){const{id:i,groupId:r,url:s,deliveryDirectives:a,track:h}=t;this.load({id:i,groupId:r,level:null,responseType:"text",type:O.SUBTITLE_TRACK,url:s,deliveryDirectives:a,levelOrTrack:h})}onLevelsUpdated(e,t){const i=this.loaders[O.LEVEL];if(i){const r=i.context;r&&!t.levels.some(s=>s===r.levelOrTrack)&&(i.abort(),delete this.loaders[O.LEVEL])}}load(e){var t;const i=this.hls.config;let r=this.getInternalLoader(e);if(r){const d=this.hls.logger,v=r.context;if(v&&v.levelOrTrack===e.levelOrTrack&&(v.url===e.url||v.deliveryDirectives&&!e.deliveryDirectives)){v.url===e.url?d.log(`[playlist-loader]: ignore ${e.url} ongoing request`):d.log(`[playlist-loader]: ignore ${e.url} in favor of ${v.url}`);return}d.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),r.abort()}let s;if(e.type===O.MANIFEST?s=i.manifestLoadPolicy.default:s=c({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),r=this.createInternalLoader(e),k((t=e.deliveryDirectives)==null?void 0:t.part)){let d;if(e.type===O.LEVEL&&e.level!==null?d=this.hls.levels[e.level].details:e.type===O.AUDIO_TRACK&&e.id!==null?d=this.hls.audioTracks[e.id].details:e.type===O.SUBTITLE_TRACK&&e.id!==null&&(d=this.hls.subtitleTracks[e.id].details),d){const v=d.partTarget,S=d.targetduration;if(v&&S){const M=Math.max(v*3,S*.8)*1e3;s=c({},s,{maxTimeToFirstByteMs:Math.min(M,s.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(M,s.maxTimeToFirstByteMs)})}}}const a=s.errorRetry||s.timeoutRetry||{},h={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},g={onSuccess:(d,v,S,M)=>{const j=this.getInternalLoader(S);this.resetInternalLoader(S.type);const H=d.data;if(H.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(d,S,new Error("no EXTM3U delimiter"),M||null,v);return}v.parsing.start=performance.now(),mr.isMediaPlaylist(H)||S.type!==O.MANIFEST?this.handleTrackOrLevelPlaylist(d,v,S,M||null,j):this.handleMasterPlaylist(d,v,S,M)},onError:(d,v,S,M)=>{this.handleNetworkError(v,S,!1,d,M)},onTimeout:(d,v,S)=>{this.handleNetworkError(v,S,!0,void 0,d)}};r.load(e,h,g)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:i}=this.hls;(e||i)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,i,r){const s=this.hls,a=e.data,h=$s(e,i),g=mr.parseMasterPlaylist(a,h);if(g.playlistParsingError){this.handleManifestParsingError(e,i,g.playlistParsingError,r,t);return}const{contentSteering:d,levels:v,sessionData:S,sessionKeys:M,startTimeOffset:j,variableList:H}=g;this.variableList=H;const{AUDIO:Q=[],SUBTITLES:Z,"CLOSED-CAPTIONS":re}=mr.parseMasterPlaylistMedia(a,h,g);Q.length&&!Q.some(le=>!le.url)&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),Q.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new ai({}),bitrate:0,url:""})),s.trigger(_.MANIFEST_LOADED,{levels:v,audioTracks:Q,subtitles:Z,captions:re,contentSteering:d,url:h,stats:t,networkDetails:r,sessionData:S,sessionKeys:M,startTimeOffset:j,variableList:H})}handleTrackOrLevelPlaylist(e,t,i,r,s){const a=this.hls,{id:h,level:g,type:d}=i,v=$s(e,i),S=k(g)?g:k(h)?h:0,M=Lo(i),j=mr.parseLevelPlaylist(e.data,v,S,M,0,this.variableList);if(d===O.MANIFEST){const H={attrs:new ai({}),bitrate:0,details:j,name:"",url:v};j.requestScheduled=t.loading.start+ea(j,0),a.trigger(_.MANIFEST_LOADED,{levels:[H],audioTracks:[],url:v,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),i.levelDetails=j,this.handlePlaylistLoaded(j,e,t,i,r,s)}handleManifestParsingError(e,t,i,r,s){this.hls.trigger(_.ERROR,{type:T.NETWORK_ERROR,details:w.MANIFEST_PARSING_ERROR,fatal:t.type===O.MANIFEST,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:r,stats:s})}handleNetworkError(e,t,i=!1,r,s){let a=`A network ${i?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===O.LEVEL?a+=`: ${e.level} id: ${e.id}`:(e.type===O.AUDIO_TRACK||e.type===O.SUBTITLE_TRACK)&&(a+=` id: ${e.id} group-id: "${e.groupId}"`);const h=new Error(a);this.hls.logger.warn(`[playlist-loader]: ${a}`);let g=w.UNKNOWN,d=!1;const v=this.getInternalLoader(e);switch(e.type){case O.MANIFEST:g=i?w.MANIFEST_LOAD_TIMEOUT:w.MANIFEST_LOAD_ERROR,d=!0;break;case O.LEVEL:g=i?w.LEVEL_LOAD_TIMEOUT:w.LEVEL_LOAD_ERROR,d=!1;break;case O.AUDIO_TRACK:g=i?w.AUDIO_TRACK_LOAD_TIMEOUT:w.AUDIO_TRACK_LOAD_ERROR,d=!1;break;case O.SUBTITLE_TRACK:g=i?w.SUBTITLE_TRACK_LOAD_TIMEOUT:w.SUBTITLE_LOAD_ERROR,d=!1;break}v&&this.resetInternalLoader(e.type);const S={type:T.NETWORK_ERROR,details:g,fatal:d,url:e.url,loader:v,context:e,error:h,networkDetails:t,stats:s};if(r){const M=(t==null?void 0:t.url)||e.url;S.response=u({url:M,data:void 0},r)}this.hls.trigger(_.ERROR,S)}handlePlaylistLoaded(e,t,i,r,s,a){const h=this.hls,{type:g,level:d,id:v,groupId:S,deliveryDirectives:M}=r,j=$s(t,r),H=Lo(r),Q=typeof r.level=="number"&&H===m.MAIN?d:void 0;if(!e.fragments.length){const re=e.playlistParsingError=new Error("No Segments found in Playlist");h.trigger(_.ERROR,{type:T.NETWORK_ERROR,details:w.LEVEL_EMPTY_ERROR,fatal:!1,url:j,error:re,reason:re.message,response:t,context:r,level:Q,parent:H,networkDetails:s,stats:i});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const Z=e.playlistParsingError;if(Z){if(this.hls.logger.warn(Z),!h.config.ignorePlaylistParsingErrors){h.trigger(_.ERROR,{type:T.NETWORK_ERROR,details:w.LEVEL_PARSING_ERROR,fatal:!1,url:j,error:Z,reason:Z.message,response:t,context:r,level:Q,parent:H,networkDetails:s,stats:i});return}e.playlistParsingError=null}switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),(!a.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),g){case O.MANIFEST:case O.LEVEL:h.trigger(_.LEVEL_LOADED,{details:e,levelInfo:r.levelOrTrack||h.levels[0],level:Q||0,id:v||0,stats:i,networkDetails:s,deliveryDirectives:M,withoutMultiVariant:g===O.MANIFEST});break;case O.AUDIO_TRACK:h.trigger(_.AUDIO_TRACK_LOADED,{details:e,track:r.levelOrTrack,id:v||0,groupId:S||"",stats:i,networkDetails:s,deliveryDirectives:M});break;case O.SUBTITLE_TRACK:h.trigger(_.SUBTITLE_TRACK_LOADED,{details:e,track:r.levelOrTrack,id:v||0,groupId:S||"",stats:i,networkDetails:s,deliveryDirectives:M});break}}}class Br{static get version(){return An}static isMSESupported(){return Do()}static isSupported(){return qc()}static getMediaSource(){return q()}static get Events(){return _}static get MetadataSchema(){return zi}static get ErrorTypes(){return T}static get ErrorDetails(){return w}static get DefaultConfig(){return Br.defaultConfig?Br.defaultConfig:Fc}static set DefaultConfig(e){Br.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new as,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=$(e.debug||!1,"Hls instance",e.assetPlayerId),i=this.config=Bc(Br.DefaultConfig,e,t);this.userConfig=e,i.progressive&&Nc(i,t);const{abrController:r,bufferController:s,capLevelController:a,errorController:h,fpsController:g}=i,d=new h(this),v=this.abrController=new r(this),S=new kr(this),M=i.interstitialsController,j=M?this.interstitialsController=new M(this,Br):null,H=this.bufferController=new s(this,S),Q=this.capLevelController=new a(this),Z=new g(this),re=new Jc(this),fe=i.contentSteeringController,le=fe?new fe(this):null,be=this.levelController=new Vc(this,le),we=new Kc(this),$e=new Qc(this.config),Ae=this.streamController=new Xc(this,S,$e),Pe=this.gapController=new jc(this,S);Q.setStreamController(Ae),Z.setStreamController(Ae);const Ue=[re,be,Ae];j&&Ue.splice(1,0,j),le&&Ue.splice(1,0,le),this.networkControllers=Ue;const De=[v,H,Pe,Q,Z,we,S];this.audioTrackController=this.createController(i.audioTrackController,Ue);const Xe=i.audioStreamController;Xe&&Ue.push(this.audioStreamController=new Xe(this,S,$e)),this.subtitleTrackController=this.createController(i.subtitleTrackController,Ue);const ut=i.subtitleStreamController;ut&&Ue.push(this.subtititleStreamController=new ut(this,S,$e)),this.createController(i.timelineController,De),$e.emeController=this.emeController=this.createController(i.emeController,De),this.cmcdController=this.createController(i.cmcdController,De),this.latencyController=this.createController(zc,De),this.coreComponents=De,Ue.push(d);const Tt=d.onErrorOut;typeof Tt=="function"&&this.on(_.ERROR,Tt,d),this.on(_.MANIFEST_LOADED,re.onManifestLoaded,re)}createController(e,t){if(e){const i=new e(this);return t&&t.push(i),i}return null}on(e,t,i=this){this._emitter.on(e,t,i)}once(e,t,i=this){this._emitter.once(e,t,i)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,i=this,r){this._emitter.off(e,t,i,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,i){return this._emitter.emit(e,t,i)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(i){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+i.message+'". Here is a stacktrace:',i),!this.triggeringException){this.triggeringException=!0;const r=e===_.ERROR;this.trigger(_.ERROR,{type:T.OTHER_ERROR,details:w.INTERNAL_EXCEPTION,fatal:r,event:e,error:i}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(_.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 s=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(_.ERROR,{type:T.OTHER_ERROR,details:w.ATTACH_MEDIA_ERROR,fatal:!0,error:s});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,i=t?e.media:e,r=t?e:{media:i};this._media=i,this.trigger(_.MEDIA_ATTACHING,r)}detachMedia(){this.logger.log("detachMedia"),this.trigger(_.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(_.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,i=this._url,r=this._url=W.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),t&&i&&(i!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(_.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 i=0;i<this.networkControllers.length&&(this.networkControllers[i].startLoad(e,t),!(!this.started||!this.networkControllers));i++);}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={[m.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[m.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[m.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=ju()),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){Ot(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 i=e.length;for(let r=0;r<i;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:i}=this;let r;if(t===-1&&e!=null&&e.length?r=e.length-1:r=t,i)for(let s=r;s--;){const a=e[s].attrs["HDCP-LEVEL"];if(a&&a<=i)return s}return r}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 i=Ti(t);return ii(e,i,navigator.mediaCapabilities)}}Br.defaultConfig=void 0}}]);
|
|
|
}()); |